@arcblock/did-connect-service 4.1.52 → 4.1.54
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.
- package/dist/_generated/asset-bytes.js +1 -1
- package/dist/_generated/asset-manifest.js +4 -4
- package/dist/_generated/login-bundle-string.d.ts +1 -1
- package/dist/_generated/login-bundle-string.d.ts.map +1 -1
- package/dist/_generated/login-bundle-string.js +1 -1
- package/dist/_generated/login-bundle-string.js.map +1 -1
- package/dist/_generated/qr-bundle-string.d.ts +1 -1
- package/dist/_generated/qr-bundle-string.d.ts.map +1 -1
- package/dist/_generated/qr-bundle-string.js +1 -1
- package/dist/_generated/qr-bundle-string.js.map +1 -1
- package/dist/assets/{design.99dc4ddc.css → design.dfa1e109.css} +4 -4
- package/dist/assets/{login.fa75e481.css → login.875ad8b9.css} +117 -26
- package/dist/assets/login.c242a16a.js +862 -0
- package/dist/assets/{qr.c0d203ca.js → qr.dba9e6b3.js} +3 -3
- package/dist/handlers/access-key-connect-handler.d.ts +1 -1
- package/dist/handlers/access-key-connect-handler.d.ts.map +1 -1
- package/dist/handlers/access-key-connect-handler.js +1 -1
- package/dist/handlers/access-key-connect-handler.js.map +1 -1
- package/dist/handlers/auth-handler.d.ts.map +1 -1
- package/dist/handlers/auth-handler.js +35 -143
- package/dist/handlers/auth-handler.js.map +1 -1
- package/dist/handlers/login-page-model.d.ts +62 -0
- package/dist/handlers/login-page-model.d.ts.map +1 -0
- package/dist/handlers/login-page-model.js +218 -0
- package/dist/handlers/login-page-model.js.map +1 -0
- package/dist/handlers/oauth-handler.d.ts.map +1 -1
- package/dist/handlers/oauth-handler.js +27 -4
- package/dist/handlers/oauth-handler.js.map +1 -1
- package/dist/handlers/passkey-handler.d.ts +17 -2
- package/dist/handlers/passkey-handler.d.ts.map +1 -1
- package/dist/handlers/passkey-handler.js +48 -107
- package/dist/handlers/passkey-handler.js.map +1 -1
- package/dist/handlers/team-handler.d.ts.map +1 -1
- package/dist/handlers/team-handler.js +1 -13
- package/dist/handlers/team-handler.js.map +1 -1
- package/dist/http/security-headers.d.ts +38 -0
- package/dist/http/security-headers.d.ts.map +1 -0
- package/dist/http/security-headers.js +67 -0
- package/dist/http/security-headers.js.map +1 -0
- package/dist/identity/webauthn.d.ts +1 -1
- package/dist/identity/webauthn.d.ts.map +1 -1
- package/dist/identity/webauthn.js +6 -3
- package/dist/identity/webauthn.js.map +1 -1
- package/dist/pages/gen-access-key-page.d.ts +15 -0
- package/dist/pages/gen-access-key-page.d.ts.map +1 -1
- package/dist/pages/gen-access-key-page.js +15 -2
- package/dist/pages/gen-access-key-page.js.map +1 -1
- package/dist/pages/invite-page.d.ts +9 -2
- package/dist/pages/invite-page.d.ts.map +1 -1
- package/dist/pages/invite-page.js +26 -28
- package/dist/pages/invite-page.js.map +1 -1
- package/dist/pages/login-bundle-entry.d.ts +1 -1
- package/dist/pages/login-bundle-entry.d.ts.map +1 -1
- package/dist/pages/login-bundle-entry.js +1 -1
- package/dist/pages/login-bundle-entry.js.map +1 -1
- package/dist/pages/login-page.d.ts +2 -0
- package/dist/pages/login-page.d.ts.map +1 -1
- package/dist/pages/login-page.js +39 -0
- package/dist/pages/login-page.js.map +1 -1
- package/dist/pages/oauth-callback-page.d.ts +17 -1
- package/dist/pages/oauth-callback-page.d.ts.map +1 -1
- package/dist/pages/oauth-callback-page.js +29 -9
- package/dist/pages/oauth-callback-page.js.map +1 -1
- package/package.json +5 -5
- package/dist/assets/login.e70223b2.js +0 -752
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "\"use strict\";var __LoginBundle=(()=>{var ae=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var Se=(o,e)=>{for(var r in e)ae(o,r,{get:e[r],enumerable:!0})},Fe=(o,e,r,t)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of Be(e))!Ie.call(o,n)&&n!==r&&ae(o,n,{get:()=>e[n],enumerable:!(t=Ae(e,n))||t.enumerable});return o};var Ne=o=>Fe(ae({},\"__esModule\",{value:!0}),o);var at={};Se(at,{FetchHttpAdapter:()=>X,LoginPage:()=>Te,runPasskeyAuth:()=>se});var H={CREATED:\"created\",SCANNED:\"scanned\",SUCCEED:\"succeed\",ERROR:\"error\",TIMEOUT:\"timeout\",BUSY:\"busy\",FORBIDDEN:\"forbidden\"};var M={API_PREFIX:\"/api/did\",SERVICE_PREFIX:\"/.well-known/service\",ACTION:\"login\",TOKEN_TIMEOUT:3e5,CHECK_INTERVAL:2e3,TOKEN_KEY:\"_t_\",TOKEN_DELIVERY:\"cookie\",CREATE_THROTTLE:500,AUTO_CHECK_INTERVAL:6e4};var oe=\"did:abt:\";function fe(o){if(!o||typeof o!=\"string\")return!1;let e=o.replace(oe,\"\");return/^(0x)?[0-9a-f]{40}$/i.test(e)}function ge(o,e=8,r=6){return!o||typeof o!=\"string\"?\"\":o.length<=e+r+3?o:`${o.slice(0,e)}...${o.slice(-r)}`}function ue(o,e={}){if(!o||typeof o!=\"string\")return{prefix:\"DID: ABT:\",chainLabel:\"ABT\",address:\"\",compact:\"\",copyText:\"\"};let{startChars:r=8,endChars:t=6}=e,n=fe(o),a=o.replace(oe,\"\"),s=n?\"ETH\":\"ABT\",i=e.includePrefix??!n;return{prefix:`DID: ${s}:`,chainLabel:s,address:a,compact:ge(a,r,t),copyText:i?`${oe}${a}`:a}}var O={TOKEN_EXPIRED:\"TOKEN_EXPIRED\",TOKEN_NOT_FOUND:\"TOKEN_NOT_FOUND\",TOKEN_TIMEOUT:\"TOKEN_TIMEOUT\",ALREADY_EXIST:\"ALREADY_EXIST\",ALREADY_BIND:\"ALREADY_BIND\",NETWORK_ERROR:\"NETWORK_ERROR\",INVALID_RESPONSE:\"INVALID_RESPONSE\",UNAUTHORIZED:\"UNAUTHORIZED\",FORBIDDEN:\"FORBIDDEN\"},P=class extends Error{code;constructor(e,r){super(r),this.name=\"ConnectError\",this.code=e}};var X=class{_defaultHeaders;_onRequest;constructor(e){this._defaultHeaders=e?.headers??{},this._onRequest=e?.onRequest}async get(e,r){this._validateUrl(e);let t=r?.params?this._serializeParams(r.params):\"\",n=t?`${e}${e.includes(\"?\")?\"&\":\"?\"}${t}`:e,s={method:\"GET\",headers:{...this._defaultHeaders,...r?.headers},signal:r?.signal};return this._onRequest&&(s=this._onRequest(n,s)),this._execute(n,s)}async post(e,r,t){this._validateUrl(e);let n=t?.params?this._serializeParams(t.params):\"\",a=n?`${e}${e.includes(\"?\")?\"&\":\"?\"}${n}`:e,i={method:\"POST\",headers:{\"Content-Type\":\"application/json\",...this._defaultHeaders,...t?.headers},body:r!==void 0?JSON.stringify(r):void 0,signal:t?.signal};return this._onRequest&&(i=this._onRequest(a,i)),this._execute(a,i)}_validateUrl(e){if(!e?.trim())throw new P(O.NETWORK_ERROR,\"Request URL must not be empty\");if(e.trim().toLowerCase().startsWith(\"javascript:\"))throw new P(O.NETWORK_ERROR,\"Invalid URL protocol\")}async _execute(e,r){let t;try{t=await globalThis.fetch(e,r)}catch(s){throw s?.name===\"AbortError\"?s:new P(O.NETWORK_ERROR,`Network request failed: ${s?.message??\"Unknown error\"}`)}if(!t.ok){let s=\"\",i=\"\";try{let p=await t.text();try{let y=JSON.parse(p);y.error&&(s=y.error),y.code&&(i=y.code)}catch{s=p}}catch{}let d=i===\"FORBIDDEN\"?O.FORBIDDEN:O.NETWORK_ERROR;throw new P(d,s||`HTTP ${t.status} ${t.statusText||\"Error\"}`)}if(t.status===204)return null;let n=await t.text();if(!n.trim())return null;let a=t.headers.get(\"content-type\")??\"\";if(!a.includes(\"application/json\")&&!a.includes(\"+json\"))throw new P(O.INVALID_RESPONSE,`Expected JSON response but received: ${a||\"unknown content type\"}`);try{return JSON.parse(n)}catch{throw new P(O.INVALID_RESPONSE,\"Failed to parse JSON response\")}}_serializeParams(e){let r=[];for(let t of Object.keys(e)){let n=e[t];if(n!=null)if(Array.isArray(n))for(let a of n)a!=null&&r.push(`${encodeURIComponent(t)}=${encodeURIComponent(String(a))}`);else typeof n==\"boolean\"?r.push(`${encodeURIComponent(t)}=${n?\"true\":\"false\"}`):r.push(`${encodeURIComponent(t)}=${encodeURIComponent(String(n))}`)}return r.join(\"&\")}};var me=[\"en\",\"zh\",\"zh-TW\",\"ja\"],bt=new Set(me);function Z(o){let e=o.apiPrefix??M.API_PREFIX,r=o.action??M.ACTION,t=e.replace(/\\/+$/,\"\"),n=r.replace(/^\\/+/,\"\");return`${t}/${n}`}function be(){return{token:null,url:null,status:null,error:null,appInfo:null,memberAppInfo:null,loading:!1}}var ee=class{_state;_config;_http;_pollTimer=null;_checkCount=0;_maxCheckCount;_realtimeUnsub=null;_realtime;_storage;_lastCreateTime=0;_listeners=new Map;_destroyed=!1;constructor(e,r,t){this._config=this._fillDefaults(e),this._http=r,this._realtime=t?.realtime,this._storage=t?.storage,this._state=be(),this._config.checkInterval<=0?this._maxCheckCount=1/0:this._maxCheckCount=Math.ceil(this._config.tokenTimeout/this._config.checkInterval)}get state(){return Object.freeze({...this._state})}async create(e){if(Date.now()-this._lastCreateTime<M.CREATE_THROTTLE)return this.state;(this._pollTimer!==null||this._realtimeUnsub!==null)&&this.stopPolling(),this._state.loading=!0,this._emit(\"statusChange\",this.state);let r=`${Z(this._config)}/token`,t={};e?(e.locale!=null&&(t.locale=e.locale),e.provider!=null?t.provider=e.provider:t.provider=\"wallet\",e.encKey!=null&&(t.__encKey=e.encKey),e.autoConnect!=null&&(t.autoConnect=e.autoConnect),e.visitorId!=null&&(t.visitorId=e.visitorId),e.sourceToken!=null&&(t.sourceToken=e.sourceToken),e.forceConnected!=null&&(t.forceConnected=e.forceConnected),e.connectUrl!=null&&(t.connectUrl=e.connectUrl),e.extraParams&&Object.assign(t,e.extraParams)):t.provider=\"wallet\";try{let n=await this._http.get(r,{params:t});return this._state.token=n.token??null,this._state.url=n.url??null,this._state.status=H.CREATED,this._state.appInfo=n.appInfo??null,this._state.memberAppInfo=n.memberAppInfo??null,this._state.loading=!1,this._state.error=null,this._state.successResult=void 0,this._state.connectedDid=void 0,this._state.mfaCode=void 0,this._state.saveConnect=void 0,this._lastCreateTime=Date.now(),this._emit(\"statusChange\",this.state),this.state}catch(n){throw this._state.loading=!1,this._state.error=n?.message??\"Failed to create token\",this._state.status=H.ERROR,this._emit(\"statusChange\",this.state),this._emit(\"error\",new P(O.NETWORK_ERROR,this._state.error)),n}}async checkStatus(){if(!this._state.token)throw new P(O.TOKEN_NOT_FOUND,\"No token available. Call create() first.\");let e=`${Z(this._config)}/status`,r={[M.TOKEN_KEY]:this._state.token};this._config.appPid;try{let t=await this._http.get(e,{params:r}),n=t.status;return n&&(this._state.status=n),t.error!==void 0&&(this._state.error=t.error),t.connectedDid!==void 0&&(this._state.connectedDid=t.connectedDid),t.mfaCode!==void 0&&(this._state.mfaCode=t.mfaCode),t.saveConnect!==void 0&&(this._state.saveConnect=t.saveConnect),n===H.FORBIDDEN?(this._state.status=H.ERROR,this._state.error=t.error||\"Access forbidden\",this._emit(\"error\",new P(O.UNAUTHORIZED,this._state.error)),this.stopPolling()):n===H.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=t),this._emit(\"succeed\",this.state),this.stopPolling()):n===H.ERROR?(this._emit(\"error\",new P(O.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):n===H.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state),this.state}catch(t){throw t}}async cancel(){if(!this._state.token)return;let e=`${Z(this._config)}/timeout`,r={[M.TOKEN_KEY]:this._state.token};try{await this._http.get(e,{params:r})}catch{}this.stopPolling()}startPolling(){if(this._state.token){if(this._checkCount=0,this._realtime)try{let e=`relay:${this._config.appPid}:${this._state.token}`;this._realtimeUnsub=this._realtime.subscribe(e,r=>{this._handleRealtimeMessage(r)});return}catch{this._realtimeUnsub=null}this._config.checkInterval>0&&(this._pollTimer=setInterval(()=>{this._pollOnce()},this._config.checkInterval))}}stopPolling(){this._pollTimer!==null&&(clearInterval(this._pollTimer),this._pollTimer=null),this._realtimeUnsub&&(this._realtimeUnsub(),this._realtimeUnsub=null)}reset(){this.stopPolling(),this._state=be(),this._checkCount=0}destroy(){this._destroyed||(this.stopPolling(),this._state.token=null,this._state.successResult=void 0,this._listeners.clear(),this._destroyed=!0)}on(e,r){let t=this._listeners.get(e);return t||(t=new Set,this._listeners.set(e,t)),t.add(r),this}off(e,r){let t=this._listeners.get(e);return t&&(t.delete(r),t.size===0&&this._listeners.delete(e)),this}_emit(e,...r){let t=this._listeners.get(e);if(!(!t||t.size===0))for(let n of[...t])try{n(...r)}catch{}}_pollOnce(){if(this._checkCount++,this._checkCount>=this._maxCheckCount){this._handleTimeout();return}this.checkStatus().catch(()=>{})}_handleTimeout(){this.stopPolling(),this._state.status=H.TIMEOUT,this._emit(\"timeout\",this.state),this._emit(\"statusChange\",this.state)}_handleRealtimeMessage(e){if(!e||typeof e!=\"object\")return;let r=e.status;r&&(this._state.status=r,e.error!==void 0&&(this._state.error=e.error),e.connectedDid!==void 0&&(this._state.connectedDid=e.connectedDid),e.mfaCode!==void 0&&(this._state.mfaCode=e.mfaCode),e.saveConnect!==void 0&&(this._state.saveConnect=e.saveConnect),r===H.FORBIDDEN?(this._state.status=H.ERROR,this._state.error=e.error||\"Access forbidden\",this._emit(\"error\",new P(O.UNAUTHORIZED,this._state.error)),this.stopPolling()):r===H.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=e),this._emit(\"succeed\",this.state),this.stopPolling()):r===H.ERROR?(this._emit(\"error\",new P(O.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):r===H.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state))}_fillDefaults(e){return{appPid:e.appPid,appName:e.appName,appDescription:e.appDescription??\"\",appIcon:e.appIcon??\"\",appUrl:e.appUrl??\"\",apiPrefix:e.apiPrefix??M.API_PREFIX,action:e.action??M.ACTION,servicePrefix:e.servicePrefix??M.SERVICE_PREFIX,tokenTimeout:e.tokenTimeout??M.TOKEN_TIMEOUT,checkInterval:e.checkInterval??M.CHECK_INTERVAL,tokenDelivery:e.tokenDelivery??M.TOKEN_DELIVERY}}};var _={bg:{root:\"#0a0a0b\",surface:\"#141416\",card:\"#1c1c20\",elevated:\"#232328\",hover:\"#2b2b34\",active:\"#33333e\",input:\"rgba(255,255,255,0.06)\"},border:{default:\"rgba(255,255,255,0.10)\",subtle:\"rgba(255,255,255,0.06)\",strong:\"rgba(255,255,255,0.15)\",focus:\"rgba(255,255,255,0.25)\"},text:{primary:\"#f5f5f7\",secondary:\"#9394a1\",tertiary:\"#767684\",placeholder:\"#5e5f6e\",white:\"#ffffff\"},color:{blue:\"#6c47ff\",blueHover:\"#5f15fe\",blueLight:\"rgba(108,71,255,0.15)\",blueMuted:\"#9280ff\",red:\"#e02e2e\",redLight:\"rgba(224,46,46,0.15)\",redText:\"#f98a8a\",green:\"#15892b\",greenLight:\"rgba(21,137,43,0.15)\",greenText:\"#49dc6e\",yellow:\"#fd7224\",yellowLight:\"rgba(253,114,36,0.15)\",yellowText:\"#fd9357\",info:\"#236dd7\",infoLight:\"rgba(35,109,215,0.15)\",infoText:\"#73acfa\"},radius:{xs:\"4px\",sm:\"6px\",md:\"8px\",lg:\"12px\",full:\"9999px\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.3), 0 1px 2px -1px rgba(0,0,0,0.2)\",md:\"0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4)\",focus:\"0 0 0 1px rgba(255,255,255,0.12), 0 0 0 3px rgba(108,71,255,0.3)\"},font:{family:\"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",mono:\"'JetBrains Mono', 'SF Mono', monospace\",sizeBase:\"14px\",lineHeight:\"1.43\"}},$={bg:{root:\"#f8f9fa\",surface:\"#ffffff\",card:\"#ffffff\",elevated:\"#f0f1f3\",hover:\"#e9eaec\",active:\"#dddee1\",input:\"rgba(0,0,0,0.04)\"},border:{default:\"rgba(0,0,0,0.10)\",subtle:\"rgba(0,0,0,0.06)\",strong:\"rgba(0,0,0,0.15)\",focus:\"rgba(0,0,0,0.25)\"},text:{primary:\"#1a1a1a\",secondary:\"#6b7280\",tertiary:\"#9ca3af\",placeholder:\"#c0c5ce\",white:\"#1a1a1a\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.08), 0 1px 2px -1px rgba(0,0,0,0.06)\",md:\"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.12), 0 4px 6px -4px rgba(0,0,0,0.08)\",focus:\"0 0 0 1px rgba(0,0,0,0.08), 0 0 0 3px rgba(108,71,255,0.2)\"}},Le=`\n :root {\n /* Backgrounds \\u2014 layered depth */\n --bg-root: ${_.bg.root};\n --bg-surface: ${_.bg.surface};\n --bg-card: ${_.bg.card};\n --bg-elevated: ${_.bg.elevated};\n --bg-hover: ${_.bg.hover};\n --bg-active: ${_.bg.active};\n --bg-input: ${_.bg.input};\n\n /* Borders \\u2014 semi-transparent for adaptability */\n --border: ${_.border.default};\n --border-subtle:${_.border.subtle};\n --border-strong:${_.border.strong};\n --border-focus: ${_.border.focus};\n\n /* Text hierarchy */\n --text: ${_.text.primary};\n --text-secondary:${_.text.secondary};\n --text-tertiary:${_.text.tertiary};\n --text-placeholder:${_.text.placeholder};\n --text-white: ${_.text.white};\n\n /* Accents */\n --blue: ${_.color.blue};\n --blue-hover: ${_.color.blueHover};\n --blue-light: ${_.color.blueLight};\n --blue-muted: ${_.color.blueMuted};\n --red: ${_.color.red};\n --red-light: ${_.color.redLight};\n --red-text: ${_.color.redText};\n --green: ${_.color.green};\n --green-light: ${_.color.greenLight};\n --green-text: ${_.color.greenText};\n --yellow: ${_.color.yellow};\n --yellow-light: ${_.color.yellowLight};\n --yellow-text: ${_.color.yellowText};\n --info: ${_.color.info};\n --info-light: ${_.color.infoLight};\n --info-text: ${_.color.infoText};\n\n /* Radii */\n --radius-xs: ${_.radius.xs};\n --radius-sm: ${_.radius.sm};\n --radius: ${_.radius.md};\n --radius-lg: ${_.radius.lg};\n --radius-full: ${_.radius.full};\n\n /* Shadows */\n --shadow-sm: ${_.shadow.sm};\n --shadow-md: ${_.shadow.md};\n --shadow-lg: ${_.shadow.lg};\n --shadow-focus: ${_.shadow.focus};\n }\n`,Re=`\n [data-theme=\"light\"] {\n --bg-root: ${$.bg.root};\n --bg-surface: ${$.bg.surface};\n --bg-card: ${$.bg.card};\n --bg-elevated: ${$.bg.elevated};\n --bg-hover: ${$.bg.hover};\n --bg-active: ${$.bg.active};\n --bg-input: ${$.bg.input};\n\n --border: ${$.border.default};\n --border-subtle:${$.border.subtle};\n --border-strong:${$.border.strong};\n --border-focus: ${$.border.focus};\n\n --text: ${$.text.primary};\n --text-secondary:${$.text.secondary};\n --text-tertiary:${$.text.tertiary};\n --text-placeholder:${$.text.placeholder};\n --text-white: ${$.text.white};\n\n --shadow-sm: ${$.shadow.sm};\n --shadow-md: ${$.shadow.md};\n --shadow-lg: ${$.shadow.lg};\n --shadow-focus: ${$.shadow.focus};\n }\n`,Pe=`\n *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\n html { color-scheme: dark; }\n html[data-theme=\"light\"] { color-scheme: light; }\n body {\n font-family: ${_.font.family};\n background: var(--bg-root);\n color: var(--text);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: ${_.font.sizeBase};\n line-height: ${_.font.lineHeight};\n }\n a { color: var(--blue-muted); text-decoration: none; }\n a:hover { text-decoration: underline; }\n .hidden { display: none; }\n`,Oe=typeof HTMLElement<\"u\"?HTMLElement:class{},Ee='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\"/></svg>',$e='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"20 6 9 17 4 12\"/></svg>',Me=`\n:host {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n overflow: hidden;\n font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;\n line-height: 1.5;\n}\n:host([block]) { display: flex; }\n.prefix {\n flex-shrink: 0;\n opacity: 0.6;\n margin-right: 4px;\n white-space: nowrap;\n}\n.address {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--did-text-color, currentColor);\n}\n.address-compact {\n white-space: nowrap;\n color: var(--did-text-color, currentColor);\n cursor: default;\n}\n.clickable { cursor: pointer; }\n.clickable:hover { opacity: 0.8; }\n.copy-btn {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1em;\n height: 1em;\n margin-left: 6px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n opacity: 0.5;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.copy-btn:hover { opacity: 1; }\n.copy-btn.copied { opacity: 1; color: var(--did-copy-success-color, #22c55e); }\n`,Ue=class extends Oe{static observedAttributes=[\"did\",\"compact\",\"copyable\",\"start-chars\",\"end-chars\",\"show-prefix\",\"no-tooltip\",\"no-copy\",\"block\",\"size\"];shadow;copyTimer=null;constructor(){super(),this.shadow=this.attachShadow({mode:\"open\"})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}disconnectedCallback(){this.copyTimer&&clearTimeout(this.copyTimer)}get parts(){let o=Number(this.getAttribute(\"start-chars\")),e=Number(this.getAttribute(\"end-chars\"));return ue(this.getAttribute(\"did\")||\"\",{startChars:o>0?o:void 0,endChars:e>0?e:void 0})}render(){if(!(this.getAttribute(\"did\")||\"\")){this.shadow.innerHTML=\"\";return}let e=this.parts,r=this.hasAttribute(\"compact\"),t=!this.hasAttribute(\"no-copy\")&&this.getAttribute(\"copyable\")!==\"false\",n=this.hasAttribute(\"show-prefix\"),a=this.hasAttribute(\"no-tooltip\"),s=Number(this.getAttribute(\"size\"))||0,i=s>=12?`${s}px`:\"inherit\",d=r?e.compact:e.address,p=!a&&r?` title=\"${e.address}\"`:\"\",y=n?`<span class=\"prefix\">${e.prefix} </span>`:\"\",h=r?\"address-compact\":\"address\",c=t?\" clickable\":\"\",b=t?`<button class=\"copy-btn\" aria-label=\"Copy DID\">${Ee}</button>`:\"\";if(this.shadow.innerHTML=`\n <style>${Me}:host { font-size: ${i}; }</style>\n ${y}<span class=\"${h}${c}\"${p}>${d}</span>${b}\n `,t){let A=this.shadow.querySelector(`.${h}`);A&&A.addEventListener(\"click\",D=>{D.stopPropagation(),this.copyToClipboard(e.copyText)});let k=this.shadow.querySelector(\".copy-btn\");k&&k.addEventListener(\"click\",D=>{D.stopPropagation(),this.copyToClipboard(e.copyText)})}}copyToClipboard(o){navigator.clipboard?.writeText?navigator.clipboard.writeText(o).catch(()=>this.fallbackCopy(o)):this.fallbackCopy(o),this.showCopied()}fallbackCopy(o){try{let e=document.createElement(\"input\");e.value=o,document.body.appendChild(e),e.select(),document.execCommand?.(\"copy\"),e.remove()}catch{}}showCopied(){let o=this.shadow.querySelector(\".copy-btn\");o&&(o.classList.add(\"copied\"),o.innerHTML=$e,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{o.classList.remove(\"copied\"),o.innerHTML=Ee},1500))}};typeof customElements<\"u\"&&!customElements.get(\"did-address\")&&customElements.define(\"did-address\",Ue);var we={en:{signIn:\"Sign in\",signInTo:\"Sign in to {appName}\",passkeyButton:\"Continue with Passkey\",passkeySignIn:\"Sign in with Passkey\",passkeyCreate:\"Create Passkey\",passkeyFirstTime:\"First time? Create a passkey\",passkeyBackToSignIn:\"Back to sign in\",passkeyWaiting:\"Waiting for passkey\\u2026\",passkeyCreating:\"Creating your passkey\\u2026\",passkeyNoLocal:\"No passkey found on this device.\",passkeyUseAnotherDevice:\"Use another device\",passkeyCreateInstead:\"Create a new passkey instead\",didWalletButton:\"Continue with DID Wallet\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"Scan with your DID Wallet\",waitingWallet:\"Requesting connection\",walletContinue:\"Please continue in DID Wallet\",noPasskey:\"No existing passkey found. Enter a name and create one.\",success:\"Success!\",timeout:\"Session timed out. Try again.\",refreshQR:\"Refresh\",namePlaceholder:\"Your name (optional)\",or:\"or\",emailPlaceholder:\"Email address\",emailButton:\"Email\",passkeyUnsupported:\"Your browser does not support Passkey authentication.\",connecting:\"Connecting...\",verifying:\"Verifying...\",openInWallet:\"Open in DID Wallet\",authFailed:\"Authentication failed\",registrationFailed:\"Registration failed\",passkeySetupFailed:\"Passkey setup failed\",accessDenied:\"Access denied: your account is not permitted to log in to this site.\",regClosed:\"Registration requires an invitation.\",federatedBy:\"Authentication provided by {masterName}\",securedBy:\"Secured by DID Connect\",privacy:\"Privacy\",terms:\"Terms\",back:\"Back\",cancel:\"Cancel\",scanTitle:\"Scan with DID Wallet\",emailTitle:\"Continue with Email\",emailSubmit:\"Send Code\",emailSending:\"Sending code...\",emailSent:\"We sent a 6-digit code to {email}\",emailCodePlaceholder:\"6-digit code\",emailVerify:\"Verify\",emailResend:\"Resend code\",emailInvalid:\"Please enter a valid email address.\",emailCodeInvalid:\"Please enter the 6-digit code.\"},zh:{signIn:\"\\u767B\\u5F55\",signInTo:\"\\u767B\\u5F55\\u5230 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7EE7\\u7EED\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5F55\",passkeyCreate:\"\\u521B\\u5EFA Passkey\",passkeyFirstTime:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u521B\\u5EFA Passkey\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5F55\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u521B\\u5EFA Passkey\\u2026\",passkeyNoLocal:\"\\u6B64\\u8BBE\\u5907\\u4E0A\\u6CA1\\u6709\\u627E\\u5230 Passkey\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u8BBE\\u5907\\u767B\\u5F55\",passkeyCreateInstead:\"\\u6539\\u4E3A\\u521B\\u5EFA\\u65B0\\u7684 Passkey\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7EE7\\u7EED\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8BF7\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",waitingWallet:\"\\u6B63\\u5728\\u8BF7\\u6C42\\u8FDE\\u63A5\",walletContinue:\"\\u8BF7\\u5728 DID Wallet \\u4E2D\\u7EE7\\u7EED\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F93\\u5165\\u540D\\u79F0\\u5E76\\u521B\\u5EFA\\u4E00\\u4E2A\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u4F1A\\u8BDD\\u8D85\\u65F6\\uFF0C\\u8BF7\\u91CD\\u8BD5\\u3002\",refreshQR:\"\\u5237\\u65B0\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u53EF\\u9009\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u90AE\\u7BB1\\u5730\\u5740\",emailButton:\"\\u90AE\\u7BB1\",passkeyUnsupported:\"\\u60A8\\u7684\\u6D4F\\u89C8\\u5668\\u4E0D\\u652F\\u6301 Passkey \\u8BA4\\u8BC1\\u3002\",connecting:\"\\u8FDE\\u63A5\\u4E2D...\",verifying:\"\\u9A8C\\u8BC1\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u6253\\u5F00\",authFailed:\"\\u8BA4\\u8BC1\\u5931\\u8D25\",registrationFailed:\"\\u6CE8\\u518C\\u5931\\u8D25\",passkeySetupFailed:\"Passkey \\u8BBE\\u7F6E\\u5931\\u8D25\",accessDenied:\"\\u8BBF\\u95EE\\u88AB\\u62D2\\u7EDD\\uFF1A\\u60A8\\u7684\\u8D26\\u6237\\u65E0\\u6743\\u767B\\u5F55\\u6B64\\u7AD9\\u70B9\\u3002\",regClosed:\"\\u6CE8\\u518C\\u9700\\u8981\\u9080\\u8BF7\\u3002\",federatedBy:\"\\u8BA4\\u8BC1\\u670D\\u52A1\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u9690\\u79C1\",terms:\"\\u6761\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",emailTitle:\"\\u4F7F\\u7528\\u90AE\\u7BB1\\u7EE7\\u7EED\",emailSubmit:\"\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801\",emailSending:\"\\u6B63\\u5728\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801...\",emailSent:\"\\u9A8C\\u8BC1\\u7801\\u5DF2\\u53D1\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"6 \\u4F4D\\u9A8C\\u8BC1\\u7801\",emailVerify:\"\\u9A8C\\u8BC1\",emailResend:\"\\u91CD\\u65B0\\u53D1\\u9001\",emailInvalid:\"\\u8BF7\\u8F93\\u5165\\u6709\\u6548\\u7684\\u90AE\\u7BB1\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8BF7\\u8F93\\u5165 6 \\u4F4D\\u9A8C\\u8BC1\\u7801\\u3002\"},\"zh-TW\":{signIn:\"\\u767B\\u5165\",signInTo:\"\\u767B\\u5165\\u81F3 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7E7C\\u7E8C\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5165\",passkeyCreate:\"\\u5EFA\\u7ACB Passkey\",passkeyFirstTime:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u5EFA\\u7ACB Passkey\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5165\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u5EFA\\u7ACB Passkey\\u2026\",passkeyNoLocal:\"\\u6B64\\u88DD\\u7F6E\\u4E0A\\u6C92\\u6709\\u627E\\u5230 Passkey\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u88DD\\u7F6E\\u767B\\u5165\",passkeyCreateInstead:\"\\u6539\\u70BA\\u5EFA\\u7ACB\\u65B0\\u7684 Passkey\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7E7C\\u7E8C\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8ACB\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",waitingWallet:\"\\u6B63\\u5728\\u8981\\u6C42\\u9023\\u7DDA\",walletContinue:\"\\u8ACB\\u5728 DID Wallet \\u4E2D\\u7E7C\\u7E8C\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F38\\u5165\\u540D\\u7A31\\u4E26\\u5EFA\\u7ACB\\u4E00\\u500B\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u5DE5\\u4F5C\\u968E\\u6BB5\\u903E\\u6642\\uFF0C\\u8ACB\\u91CD\\u8A66\\u3002\",refreshQR:\"\\u91CD\\u65B0\\u6574\\u7406\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u9078\\u586B\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\",emailButton:\"\\u96FB\\u5B50\\u90F5\\u4EF6\",passkeyUnsupported:\"\\u60A8\\u7684\\u700F\\u89BD\\u5668\\u4E0D\\u652F\\u63F4 Passkey \\u8A8D\\u8B49\\u3002\",connecting:\"\\u9023\\u7DDA\\u4E2D...\",verifying:\"\\u9A57\\u8B49\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u958B\\u555F\",authFailed:\"\\u8A8D\\u8B49\\u5931\\u6557\",registrationFailed:\"\\u8A3B\\u518A\\u5931\\u6557\",passkeySetupFailed:\"Passkey \\u8A2D\\u5B9A\\u5931\\u6557\",accessDenied:\"\\u5B58\\u53D6\\u88AB\\u62D2\\u7D55\\uFF1A\\u60A8\\u7684\\u5E33\\u865F\\u7121\\u6B0A\\u767B\\u5165\\u6B64\\u7DB2\\u7AD9\\u3002\",regClosed:\"\\u8A3B\\u518A\\u9700\\u8981\\u9080\\u8ACB\\u3002\",federatedBy:\"\\u8A8D\\u8B49\\u670D\\u52D9\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u96B1\\u79C1\",terms:\"\\u689D\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",emailTitle:\"\\u4F7F\\u7528\\u96FB\\u5B50\\u90F5\\u4EF6\\u7E7C\\u7E8C\",emailSubmit:\"\\u50B3\\u9001\\u9A57\\u8B49\\u78BC\",emailSending:\"\\u6B63\\u5728\\u50B3\\u9001\\u9A57\\u8B49\\u78BC...\",emailSent:\"\\u9A57\\u8B49\\u78BC\\u5DF2\\u50B3\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"6 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\",emailVerify:\"\\u9A57\\u8B49\",emailResend:\"\\u91CD\\u65B0\\u50B3\\u9001\",emailInvalid:\"\\u8ACB\\u8F38\\u5165\\u6709\\u6548\\u7684\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8ACB\\u8F38\\u5165 6 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\\u3002\"},ja:{signIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\",signInTo:\"{appName} \\u306B\\u30ED\\u30B0\\u30A4\\u30F3\",passkeyButton:\"Passkey \\u3067\\u7D9A\\u3051\\u308B\",passkeySignIn:\"Passkey \\u3067\\u30ED\\u30B0\\u30A4\\u30F3\",passkeyCreate:\"Passkey \\u3092\\u4F5C\\u6210\",passkeyFirstTime:\"\\u521D\\u3081\\u3066\\u3067\\u3059\\u304B\\uFF1FPasskey \\u3092\\u4F5C\\u6210\",passkeyBackToSignIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306B\\u623B\\u308B\",passkeyWaiting:\"Passkey \\u3092\\u5F85\\u3063\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyCreating:\"Passkey \\u3092\\u4F5C\\u6210\\u3057\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyNoLocal:\"\\u3053\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u306B Passkey \\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093\\u3002\",passkeyUseAnotherDevice:\"\\u5225\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u3092\\u4F7F\\u7528\",passkeyCreateInstead:\"\\u4EE3\\u308F\\u308A\\u306B\\u65B0\\u3057\\u3044 Passkey \\u3092\\u4F5C\\u6210\",didWalletButton:\"DID Wallet \\u3067\\u7D9A\\u3051\\u308B\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\",waitingWallet:\"\\u63A5\\u7D9A\\u3092\\u8981\\u6C42\\u3057\\u3066\\u3044\\u307E\\u3059\",walletContinue:\"DID Wallet \\u3067\\u64CD\\u4F5C\\u3092\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\",noPasskey:\"\\u65E2\\u5B58\\u306E Passkey \\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093\\u3002\\u540D\\u524D\\u3092\\u5165\\u529B\\u3057\\u3066\\u4F5C\\u6210\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",success:\"\\u6210\\u529F\\u3057\\u307E\\u3057\\u305F\",timeout:\"\\u30BB\\u30C3\\u30B7\\u30E7\\u30F3\\u304C\\u30BF\\u30A4\\u30E0\\u30A2\\u30A6\\u30C8\\u3057\\u307E\\u3057\\u305F\\u3002\\u3082\\u3046\\u4E00\\u5EA6\\u304A\\u8A66\\u3057\\u304F\\u3060\\u3055\\u3044\\u3002\",refreshQR:\"\\u66F4\\u65B0\",namePlaceholder:\"\\u304A\\u540D\\u524D\\uFF08\\u4EFB\\u610F\\uFF09\",or:\"\\u307E\\u305F\\u306F\",emailPlaceholder:\"\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\",emailButton:\"\\u30E1\\u30FC\\u30EB\",passkeyUnsupported:\"\\u304A\\u4F7F\\u3044\\u306E\\u30D6\\u30E9\\u30A6\\u30B6\\u30FC\\u306F Passkey \\u8A8D\\u8A3C\\u3092\\u30B5\\u30DD\\u30FC\\u30C8\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002\",connecting:\"\\u63A5\\u7D9A\\u3057\\u3066\\u3044\\u307E\\u3059...\",verifying:\"\\u78BA\\u8A8D\\u3057\\u3066\\u3044\\u307E\\u3059...\",openInWallet:\"DID Wallet \\u3067\\u958B\\u304F\",authFailed:\"\\u8A8D\\u8A3C\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",registrationFailed:\"\\u767B\\u9332\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",passkeySetupFailed:\"Passkey \\u306E\\u8A2D\\u5B9A\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",accessDenied:\"\\u30A2\\u30AF\\u30BB\\u30B9\\u304C\\u62D2\\u5426\\u3055\\u308C\\u307E\\u3057\\u305F\\uFF1A\\u3053\\u306E\\u30B5\\u30A4\\u30C8\\u306B\\u30ED\\u30B0\\u30A4\\u30F3\\u3059\\u308B\\u6A29\\u9650\\u304C\\u3042\\u308A\\u307E\\u305B\\u3093\\u3002\",regClosed:\"\\u767B\\u9332\\u306B\\u306F\\u62DB\\u5F85\\u304C\\u5FC5\\u8981\\u3067\\u3059\\u3002\",federatedBy:\"\\u8A8D\\u8A3C\\u30B5\\u30FC\\u30D3\\u30B9\\u306F {masterName} \\u304C\\u63D0\\u4F9B\\u3057\\u3066\\u3044\\u307E\\u3059\",securedBy:\"DID Connect \\u306B\\u3088\\u308A\\u4FDD\\u8B77\\u3055\\u308C\\u3066\\u3044\\u307E\\u3059\",privacy:\"\\u30D7\\u30E9\\u30A4\\u30D0\\u30B7\\u30FC\",terms:\"\\u5229\\u7528\\u898F\\u7D04\",back:\"\\u623B\\u308B\",cancel:\"\\u30AD\\u30E3\\u30F3\\u30BB\\u30EB\",scanTitle:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\",emailTitle:\"\\u30E1\\u30FC\\u30EB\\u3067\\u7D9A\\u3051\\u308B\",emailSubmit:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\",emailSending:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u3066\\u3044\\u307E\\u3059...\",emailSent:\"{email} \\u306B 6 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u307E\\u3057\\u305F\",emailCodePlaceholder:\"6 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\",emailVerify:\"\\u78BA\\u8A8D\",emailResend:\"\\u30B3\\u30FC\\u30C9\\u3092\\u518D\\u9001\\u4FE1\",emailInvalid:\"\\u6709\\u52B9\\u306A\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",emailCodeInvalid:\"6 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\"}},ce=[{code:\"en\",label:\"English\"},{code:\"zh\",label:\"\\u4E2D\\u6587\"}];function w(o,e,r){let t=e&&we[e]?e:\"en\",n=we[t][o]??o;if(r)for(let[a,s]of Object.entries(r))n=n.replace(new RegExp(`\\\\{${a}\\\\}`,\"g\"),s);return n}var le='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M3 20v-2.8q0-.85.438-1.562T4.6 14.55q1.55-.775 3.15-1.162T11 13q.5 0 1 .038t1 .112q-.1 1.45.525 2.738T15.35 18v2zm16 3l-1.5-1.5v-4.65q-1.1-.325-1.8-1.237T15 13.5q0-1.45 1.025-2.475T18.5 10t2.475 1.025T22 13.5q0 1.125-.638 2t-1.612 1.25L21 18l-1.5 1.5L21 21zm-8-11q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m7.5 2q.425 0 .713-.288T19.5 13t-.288-.712T18.5 12t-.712.288T17.5 13t.288.713t.712.287\"/></svg>',xe='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"3\" fill=\"#4598FA\"/><rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\" fill=\"white\" opacity=\"0.9\"/><rect x=\"0\" y=\"14\" width=\"24\" height=\"10\" rx=\"0\" fill=\"url(#dw_g)\"/><path d=\"M5.5 9.5h4.5c.3 0 .5.2.5.5v2.5c0 .3-.2.5-.5.5H5.5c-.3 0-.5-.2-.5-.5V10c0-.3.2-.5.5-.5z\" fill=\"#4598FA\"/><defs><linearGradient id=\"dw_g\" x1=\"12\" y1=\"14\" x2=\"12\" y2=\"24\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#77B2F6\"/><stop offset=\"1\" stop-color=\"#4598FA\"/></linearGradient></defs></svg>',He='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M22 7.535V17a3 3 0 0 1-2.824 2.995L19 20H5a3 3 0 0 1-2.995-2.824L2 17V7.535l9.445 6.297l.116.066a1 1 0 0 0 .878 0l.116-.066z\"/><path fill=\"currentColor\" d=\"M19 4c1.08 0 2.027.57 2.555 1.427L12 11.797l-9.555-6.37a2.999 2.999 0 0 1 2.354-1.42L5 4z\"/></svg>',We='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 1L3 5v6c0 5.55 3.84 10.74 9 12c5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z\"/></svg>',Ce='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z\"/></svg>',Ke={google:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 262\"><path fill=\"#4285F4\" d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"/><path fill=\"#34A853\" d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"/><path fill=\"#FBBC05\" d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z\"/><path fill=\"#EB4335\" d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"/></svg>',github:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 250\" fill=\"currentColor\"><path d=\"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0\"/></svg>',apple:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 315\" fill=\"currentColor\"><path d=\"M213.803 167.03c.442 47.58 41.74 63.413 42.197 63.615c-.35 1.116-6.599 22.563-21.757 44.716c-13.104 19.153-26.705 38.235-48.13 38.63c-21.05.388-27.82-12.483-51.888-12.483c-24.061 0-31.582 12.088-51.51 12.871c-20.68.783-36.428-20.71-49.64-39.793c-27-39.033-47.633-110.3-19.928-158.406c13.763-23.89 38.36-39.017 65.056-39.405c20.307-.388 39.475 13.675 51.889 13.675c12.406 0 35.699-16.895 60.186-14.414c10.25.427 39.026 4.14 57.503 31.186c-1.49.923-34.335 20.044-33.978 59.808M174.24 50.199c10.98-13.29 18.369-31.79 16.353-50.199c-15.826.636-34.962 10.546-46.314 23.828c-10.173 11.763-19.082 30.589-16.678 48.633c17.64 1.365 35.66-8.964 46.639-22.262\"/></svg>',twitter:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M149.079 108.399L242.33 0h-22.098l-80.97 94.12L74.59 0H0l97.796 142.328L0 256h22.1l85.507-99.395L175.905 256h74.59L149.073 108.399zM118.81 143.58l-9.909-14.172l-78.84-112.773h33.943l63.625 91.011l9.909 14.173l82.705 118.3H186.3l-67.49-96.533z\"/></svg>',auth0:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#EB5424\" d=\"M203.97 200.38L167.47 88l-39.5 112.38h75.98zm0-144.76L167.47 168l75.97-26.16l19.76-60.82c6.64-20.4-1.94-42.72-21.18-52.76l-38.06 27.36zM52.03 55.62L88.54 168l39.5-112.38H52.02zM52.03 200.38L88.54 88L12.56 114.16l-5.92 18.2c-6.64 20.4 1.94 42.72 21.18 52.76l24.2-17.38l.01.01v-.01l-.01.01.01-.37z\"/></svg>',facebook:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#1877F2\" d=\"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445\"/></svg>'},ke='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41c0 2.08-.8 3.97-2.1 5.39\"/></svg>';function ze(o){return Ke[o.toLowerCase()]??\"\"}var J=function(o,e){let n=o,a=ne[e],s=null,i=0,d=null,p=[],y={},h=function(l,m){i=n*4+17,s=(function(u){let g=new Array(u);for(let f=0;f<u;f+=1){g[f]=new Array(u);for(let E=0;E<u;E+=1)g[f][E]=null}return g})(i),c(0,0),c(i-7,0),c(0,i-7),k(),A(),x(l,m),n>=7&&D(l),d==null&&(d=S(n,a,p)),T(d,m)},c=function(l,m){for(let u=-1;u<=7;u+=1)if(!(l+u<=-1||i<=l+u))for(let g=-1;g<=7;g+=1)m+g<=-1||i<=m+g||(0<=u&&u<=6&&(g==0||g==6)||0<=g&&g<=6&&(u==0||u==6)||2<=u&&u<=4&&2<=g&&g<=4?s[l+u][m+g]=!0:s[l+u][m+g]=!1)},b=function(){let l=0,m=0;for(let u=0;u<8;u+=1){h(!0,u);let g=q.getLostPoint(y);(u==0||l>g)&&(l=g,m=u)}return m},A=function(){for(let l=8;l<i-8;l+=1)s[l][6]==null&&(s[l][6]=l%2==0);for(let l=8;l<i-8;l+=1)s[6][l]==null&&(s[6][l]=l%2==0)},k=function(){let l=q.getPatternPosition(n);for(let m=0;m<l.length;m+=1)for(let u=0;u<l.length;u+=1){let g=l[m],f=l[u];if(s[g][f]==null)for(let E=-2;E<=2;E+=1)for(let C=-2;C<=2;C+=1)E==-2||E==2||C==-2||C==2||E==0&&C==0?s[g+E][f+C]=!0:s[g+E][f+C]=!1}},D=function(l){let m=q.getBCHTypeNumber(n);for(let u=0;u<18;u+=1){let g=!l&&(m>>u&1)==1;s[Math.floor(u/3)][u%3+i-8-3]=g}for(let u=0;u<18;u+=1){let g=!l&&(m>>u&1)==1;s[u%3+i-8-3][Math.floor(u/3)]=g}},x=function(l,m){let u=a<<3|m,g=q.getBCHTypeInfo(u);for(let f=0;f<15;f+=1){let E=!l&&(g>>f&1)==1;f<6?s[f][8]=E:f<8?s[f+1][8]=E:s[i-15+f][8]=E}for(let f=0;f<15;f+=1){let E=!l&&(g>>f&1)==1;f<8?s[8][i-f-1]=E:f<9?s[8][15-f-1+1]=E:s[8][15-f-1]=E}s[i-8][8]=!l},T=function(l,m){let u=-1,g=i-1,f=7,E=0,C=q.getMaskFunction(m);for(let B=i-1;B>0;B-=2)for(B==6&&(B-=1);;){for(let F=0;F<2;F+=1)if(s[g][B-F]==null){let R=!1;E<l.length&&(R=(l[E]>>>f&1)==1),C(g,B-F)&&(R=!R),s[g][B-F]=R,f-=1,f==-1&&(E+=1,f=7)}if(g+=u,g<0||i<=g){g-=u,u=-u;break}}},I=function(l,m){let u=0,g=0,f=0,E=new Array(m.length),C=new Array(m.length);for(let v=0;v<m.length;v+=1){let N=m[v].dataCount,K=m[v].totalCount-N;g=Math.max(g,N),f=Math.max(f,K),E[v]=new Array(N);for(let V=0;V<E[v].length;V+=1)E[v][V]=255&l.getBuffer()[V+u];u+=N;let ie=q.getErrorCorrectPolynomial(K),he=re(E[v],ie.getLength()-1).mod(ie);C[v]=new Array(ie.getLength()-1);for(let V=0;V<C[v].length;V+=1){let pe=V+he.getLength()-C[v].length;C[v][V]=pe>=0?he.getAt(pe):0}}let B=0;for(let v=0;v<m.length;v+=1)B+=m[v].totalCount;let F=new Array(B),R=0;for(let v=0;v<g;v+=1)for(let N=0;N<m.length;N+=1)v<E[N].length&&(F[R]=E[N][v],R+=1);for(let v=0;v<f;v+=1)for(let N=0;N<m.length;N+=1)v<C[N].length&&(F[R]=C[N][v],R+=1);return F},S=function(l,m,u){let g=ve.getRSBlocks(l,m),f=_e();for(let C=0;C<u.length;C+=1){let B=u[C];f.put(B.getMode(),4),f.put(B.getLength(),q.getLengthInBits(B.getMode(),l)),B.write(f)}let E=0;for(let C=0;C<g.length;C+=1)E+=g[C].dataCount;if(f.getLengthInBits()>E*8)throw\"code length overflow. (\"+f.getLengthInBits()+\">\"+E*8+\")\";for(f.getLengthInBits()+4<=E*8&&f.put(0,4);f.getLengthInBits()%8!=0;)f.putBit(!1);for(;!(f.getLengthInBits()>=E*8||(f.put(236,8),f.getLengthInBits()>=E*8));)f.put(17,8);return I(f,g)};y.addData=function(l,m){m=m||\"Byte\";let u=null;switch(m){case\"Numeric\":u=Ve(l);break;case\"Alphanumeric\":u=je(l);break;case\"Byte\":u=qe(l);break;case\"Kanji\":u=Ye(l);break;default:throw\"mode:\"+m}p.push(u),d=null},y.isDark=function(l,m){if(l<0||i<=l||m<0||i<=m)throw l+\",\"+m;return s[l][m]},y.getModuleCount=function(){return i},y.make=function(){if(n<1){let l=1;for(;l<40;l++){let m=ve.getRSBlocks(l,a),u=_e();for(let f=0;f<p.length;f++){let E=p[f];u.put(E.getMode(),4),u.put(E.getLength(),q.getLengthInBits(E.getMode(),l)),E.write(u)}let g=0;for(let f=0;f<m.length;f++)g+=m[f].dataCount;if(u.getLengthInBits()<=g*8)break}n=l}h(!1,b())},y.createTableTag=function(l,m){l=l||2,m=typeof m>\"u\"?l*4:m;let u=\"\";u+='<table style=\"',u+=\" border-width: 0px; border-style: none;\",u+=\" border-collapse: collapse;\",u+=\" padding: 0px; margin: \"+m+\"px;\",u+='\">',u+=\"<tbody>\";for(let g=0;g<y.getModuleCount();g+=1){u+=\"<tr>\";for(let f=0;f<y.getModuleCount();f+=1)u+='<td style=\"',u+=\" border-width: 0px; border-style: none;\",u+=\" border-collapse: collapse;\",u+=\" padding: 0px; margin: 0px;\",u+=\" width: \"+l+\"px;\",u+=\" height: \"+l+\"px;\",u+=\" background-color: \",u+=y.isDark(g,f)?\"#000000\":\"#ffffff\",u+=\";\",u+='\"/>';u+=\"</tr>\"}return u+=\"</tbody>\",u+=\"</table>\",u},y.createSvgTag=function(l,m,u,g){let f={};typeof arguments[0]==\"object\"&&(f=arguments[0],l=f.cellSize,m=f.margin,u=f.alt,g=f.title),l=l||2,m=typeof m>\"u\"?l*4:m,u=typeof u==\"string\"?{text:u}:u||{},u.text=u.text||null,u.id=u.text?u.id||\"qrcode-description\":null,g=typeof g==\"string\"?{text:g}:g||{},g.text=g.text||null,g.id=g.text?g.id||\"qrcode-title\":null;let E=y.getModuleCount()*l+m*2,C,B,F,R,v=\"\",N;for(N=\"l\"+l+\",0 0,\"+l+\" -\"+l+\",0 0,-\"+l+\"z \",v+='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"',v+=f.scalable?\"\":' width=\"'+E+'px\" height=\"'+E+'px\"',v+=' viewBox=\"0 0 '+E+\" \"+E+'\" ',v+=' preserveAspectRatio=\"xMinYMin meet\"',v+=g.text||u.text?' role=\"img\" aria-labelledby=\"'+L([g.id,u.id].join(\" \").trim())+'\"':\"\",v+=\">\",v+=g.text?'<title id=\"'+L(g.id)+'\">'+L(g.text)+\"</title>\":\"\",v+=u.text?'<description id=\"'+L(u.id)+'\">'+L(u.text)+\"</description>\":\"\",v+='<rect width=\"100%\" height=\"100%\" fill=\"white\" cx=\"0\" cy=\"0\"/>',v+='<path d=\"',F=0;F<y.getModuleCount();F+=1)for(R=F*l+m,C=0;C<y.getModuleCount();C+=1)y.isDark(F,C)&&(B=C*l+m,v+=\"M\"+B+\",\"+R+N);return v+='\" stroke=\"transparent\" fill=\"black\"/>',v+=\"</svg>\",v},y.createDataURL=function(l,m){l=l||2,m=typeof m>\"u\"?l*4:m;let u=y.getModuleCount()*l+m*2,g=m,f=u-m;return Xe(u,u,function(E,C){if(g<=E&&E<f&&g<=C&&C<f){let B=Math.floor((E-g)/l),F=Math.floor((C-g)/l);return y.isDark(F,B)?0:1}else return 1})},y.createImgTag=function(l,m,u){l=l||2,m=typeof m>\"u\"?l*4:m;let g=y.getModuleCount()*l+m*2,f=\"\";return f+=\"<img\",f+=' src=\"',f+=y.createDataURL(l,m),f+='\"',f+=' width=\"',f+=g,f+='\"',f+=' height=\"',f+=g,f+='\"',u&&(f+=' alt=\"',f+=L(u),f+='\"'),f+=\"/>\",f};let L=function(l){let m=\"\";for(let u=0;u<l.length;u+=1){let g=l.charAt(u);switch(g){case\"<\":m+=\"<\";break;case\">\":m+=\">\";break;case\"&\":m+=\"&\";break;case'\"':m+=\""\";break;default:m+=g;break}}return m},z=function(l){l=typeof l>\"u\"?2:l;let u=y.getModuleCount()*1+l*2,g=l,f=u-l,E,C,B,F,R,v={\"\\u2588\\u2588\":\"\\u2588\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\"\\u2584\",\" \":\" \"},N={\"\\u2588\\u2588\":\"\\u2580\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\" \",\" \":\" \"},K=\"\";for(E=0;E<u;E+=2){for(B=Math.floor((E-g)/1),F=Math.floor((E+1-g)/1),C=0;C<u;C+=1)R=\"\\u2588\",g<=C&&C<f&&g<=E&&E<f&&y.isDark(B,Math.floor((C-g)/1))&&(R=\" \"),g<=C&&C<f&&g<=E+1&&E+1<f&&y.isDark(F,Math.floor((C-g)/1))?R+=\" \":R+=\"\\u2588\",K+=l<1&&E+1>=f?N[R]:v[R];K+=`\n`}return u%2&&l>0?K.substring(0,K.length-u-1)+Array(u+1).join(\"\\u2580\"):K.substring(0,K.length-1)};return y.createASCII=function(l,m){if(l=l||1,l<2)return z(m);l-=1,m=typeof m>\"u\"?l*2:m;let u=y.getModuleCount()*l+m*2,g=m,f=u-m,E,C,B,F,R=Array(l+1).join(\"\\u2588\\u2588\"),v=Array(l+1).join(\" \"),N=\"\",K=\"\";for(E=0;E<u;E+=1){for(B=Math.floor((E-g)/l),K=\"\",C=0;C<u;C+=1)F=1,g<=C&&C<f&&g<=E&&E<f&&y.isDark(B,Math.floor((C-g)/l))&&(F=0),K+=F?R:v;for(B=0;B<l;B+=1)N+=K+`\n`}return N.substring(0,N.length-1)},y.renderTo2dContext=function(l,m){m=m||2;let u=y.getModuleCount();for(let g=0;g<u;g++)for(let f=0;f<u;f++)l.fillStyle=y.isDark(g,f)?\"black\":\"white\",l.fillRect(f*m,g*m,m,m)},y};J.stringToBytes=function(o){let e=[];for(let r=0;r<o.length;r+=1){let t=o.charCodeAt(r);e.push(t&255)}return e};J.createStringToBytes=function(o,e){let r=(function(){let n=Ge(o),a=function(){let d=n.read();if(d==-1)throw\"eof\";return d},s=0,i={};for(;;){let d=n.read();if(d==-1)break;let p=a(),y=a(),h=a(),c=String.fromCharCode(d<<8|p),b=y<<8|h;i[c]=b,s+=1}if(s!=e)throw s+\" != \"+e;return i})(),t=63;return function(n){let a=[];for(let s=0;s<n.length;s+=1){let i=n.charCodeAt(s);if(i<128)a.push(i);else{let d=r[n.charAt(s)];typeof d==\"number\"?(d&255)==d?a.push(d):(a.push(d>>>8),a.push(d&255)):a.push(t)}}return a}};var U={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ne={L:1,M:0,Q:3,H:2},j={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},q=(function(){let o=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e=1335,r=7973,t=21522,n={},a=function(s){let i=0;for(;s!=0;)i+=1,s>>>=1;return i};return n.getBCHTypeInfo=function(s){let i=s<<10;for(;a(i)-a(e)>=0;)i^=e<<a(i)-a(e);return(s<<10|i)^t},n.getBCHTypeNumber=function(s){let i=s<<12;for(;a(i)-a(r)>=0;)i^=r<<a(i)-a(r);return s<<12|i},n.getPatternPosition=function(s){return o[s-1]},n.getMaskFunction=function(s){switch(s){case j.PATTERN000:return function(i,d){return(i+d)%2==0};case j.PATTERN001:return function(i,d){return i%2==0};case j.PATTERN010:return function(i,d){return d%3==0};case j.PATTERN011:return function(i,d){return(i+d)%3==0};case j.PATTERN100:return function(i,d){return(Math.floor(i/2)+Math.floor(d/3))%2==0};case j.PATTERN101:return function(i,d){return i*d%2+i*d%3==0};case j.PATTERN110:return function(i,d){return(i*d%2+i*d%3)%2==0};case j.PATTERN111:return function(i,d){return(i*d%3+(i+d)%2)%2==0};default:throw\"bad maskPattern:\"+s}},n.getErrorCorrectPolynomial=function(s){let i=re([1],0);for(let d=0;d<s;d+=1)i=i.multiply(re([1,Y.gexp(d)],0));return i},n.getLengthInBits=function(s,i){if(1<=i&&i<10)switch(s){case U.MODE_NUMBER:return 10;case U.MODE_ALPHA_NUM:return 9;case U.MODE_8BIT_BYTE:return 8;case U.MODE_KANJI:return 8;default:throw\"mode:\"+s}else if(i<27)switch(s){case U.MODE_NUMBER:return 12;case U.MODE_ALPHA_NUM:return 11;case U.MODE_8BIT_BYTE:return 16;case U.MODE_KANJI:return 10;default:throw\"mode:\"+s}else if(i<41)switch(s){case U.MODE_NUMBER:return 14;case U.MODE_ALPHA_NUM:return 13;case U.MODE_8BIT_BYTE:return 16;case U.MODE_KANJI:return 12;default:throw\"mode:\"+s}else throw\"type:\"+i},n.getLostPoint=function(s){let i=s.getModuleCount(),d=0;for(let h=0;h<i;h+=1)for(let c=0;c<i;c+=1){let b=0,A=s.isDark(h,c);for(let k=-1;k<=1;k+=1)if(!(h+k<0||i<=h+k))for(let D=-1;D<=1;D+=1)c+D<0||i<=c+D||k==0&&D==0||A==s.isDark(h+k,c+D)&&(b+=1);b>5&&(d+=3+b-5)}for(let h=0;h<i-1;h+=1)for(let c=0;c<i-1;c+=1){let b=0;s.isDark(h,c)&&(b+=1),s.isDark(h+1,c)&&(b+=1),s.isDark(h,c+1)&&(b+=1),s.isDark(h+1,c+1)&&(b+=1),(b==0||b==4)&&(d+=3)}for(let h=0;h<i;h+=1)for(let c=0;c<i-6;c+=1)s.isDark(h,c)&&!s.isDark(h,c+1)&&s.isDark(h,c+2)&&s.isDark(h,c+3)&&s.isDark(h,c+4)&&!s.isDark(h,c+5)&&s.isDark(h,c+6)&&(d+=40);for(let h=0;h<i;h+=1)for(let c=0;c<i-6;c+=1)s.isDark(c,h)&&!s.isDark(c+1,h)&&s.isDark(c+2,h)&&s.isDark(c+3,h)&&s.isDark(c+4,h)&&!s.isDark(c+5,h)&&s.isDark(c+6,h)&&(d+=40);let p=0;for(let h=0;h<i;h+=1)for(let c=0;c<i;c+=1)s.isDark(c,h)&&(p+=1);let y=Math.abs(100*p/i/i-50)/5;return d+=y*10,d},n})(),Y=(function(){let o=new Array(256),e=new Array(256);for(let t=0;t<8;t+=1)o[t]=1<<t;for(let t=8;t<256;t+=1)o[t]=o[t-4]^o[t-5]^o[t-6]^o[t-8];for(let t=0;t<255;t+=1)e[o[t]]=t;let r={};return r.glog=function(t){if(t<1)throw\"glog(\"+t+\")\";return e[t]},r.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return o[t]},r})(),re=function(o,e){if(typeof o.length>\"u\")throw o.length+\"/\"+e;let r=(function(){let n=0;for(;n<o.length&&o[n]==0;)n+=1;let a=new Array(o.length-n+e);for(let s=0;s<o.length-n;s+=1)a[s]=o[s+n];return a})(),t={};return t.getAt=function(n){return r[n]},t.getLength=function(){return r.length},t.multiply=function(n){let a=new Array(t.getLength()+n.getLength()-1);for(let s=0;s<t.getLength();s+=1)for(let i=0;i<n.getLength();i+=1)a[s+i]^=Y.gexp(Y.glog(t.getAt(s))+Y.glog(n.getAt(i)));return re(a,0)},t.mod=function(n){if(t.getLength()-n.getLength()<0)return t;let a=Y.glog(t.getAt(0))-Y.glog(n.getAt(0)),s=new Array(t.getLength());for(let i=0;i<t.getLength();i+=1)s[i]=t.getAt(i);for(let i=0;i<n.getLength();i+=1)s[i]^=Y.gexp(Y.glog(n.getAt(i))+a);return re(s,0).mod(n)},t},ve=(function(){let o=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(n,a){let s={};return s.totalCount=n,s.dataCount=a,s},r={},t=function(n,a){switch(a){case ne.L:return o[(n-1)*4+0];case ne.M:return o[(n-1)*4+1];case ne.Q:return o[(n-1)*4+2];case ne.H:return o[(n-1)*4+3];default:return}};return r.getRSBlocks=function(n,a){let s=t(n,a);if(typeof s>\"u\")throw\"bad rs block @ typeNumber:\"+n+\"/errorCorrectionLevel:\"+a;let i=s.length/3,d=[];for(let p=0;p<i;p+=1){let y=s[p*3+0],h=s[p*3+1],c=s[p*3+2];for(let b=0;b<y;b+=1)d.push(e(h,c))}return d},r})(),_e=function(){let o=[],e=0,r={};return r.getBuffer=function(){return o},r.getAt=function(t){let n=Math.floor(t/8);return(o[n]>>>7-t%8&1)==1},r.put=function(t,n){for(let a=0;a<n;a+=1)r.putBit((t>>>n-a-1&1)==1)},r.getLengthInBits=function(){return e},r.putBit=function(t){let n=Math.floor(e/8);o.length<=n&&o.push(0),t&&(o[n]|=128>>>e%8),e+=1},r},Ve=function(o){let e=U.MODE_NUMBER,r=o,t={};t.getMode=function(){return e},t.getLength=function(s){return r.length},t.write=function(s){let i=r,d=0;for(;d+2<i.length;)s.put(n(i.substring(d,d+3)),10),d+=3;d<i.length&&(i.length-d==1?s.put(n(i.substring(d,d+1)),4):i.length-d==2&&s.put(n(i.substring(d,d+2)),7))};let n=function(s){let i=0;for(let d=0;d<s.length;d+=1)i=i*10+a(s.charAt(d));return i},a=function(s){if(\"0\"<=s&&s<=\"9\")return s.charCodeAt(0)-48;throw\"illegal char :\"+s};return t},je=function(o){let e=U.MODE_ALPHA_NUM,r=o,t={};t.getMode=function(){return e},t.getLength=function(a){return r.length},t.write=function(a){let s=r,i=0;for(;i+1<s.length;)a.put(n(s.charAt(i))*45+n(s.charAt(i+1)),11),i+=2;i<s.length&&a.put(n(s.charAt(i)),6)};let n=function(a){if(\"0\"<=a&&a<=\"9\")return a.charCodeAt(0)-48;if(\"A\"<=a&&a<=\"Z\")return a.charCodeAt(0)-65+10;switch(a){case\" \":return 36;case\"$\":return 37;case\"%\":return 38;case\"*\":return 39;case\"+\":return 40;case\"-\":return 41;case\".\":return 42;case\"/\":return 43;case\":\":return 44;default:throw\"illegal char :\"+a}};return t},qe=function(o){let e=U.MODE_8BIT_BYTE,r=o,t=J.stringToBytes(o),n={};return n.getMode=function(){return e},n.getLength=function(a){return t.length},n.write=function(a){for(let s=0;s<t.length;s+=1)a.put(t[s],8)},n},Ye=function(o){let e=U.MODE_KANJI,r=o,t=J.stringToBytes;(function(s,i){let d=t(s);if(d.length!=2||(d[0]<<8|d[1])!=i)throw\"sjis not supported.\"})(\"\\u53CB\",38726);let n=t(o),a={};return a.getMode=function(){return e},a.getLength=function(s){return~~(n.length/2)},a.write=function(s){let i=n,d=0;for(;d+1<i.length;){let p=(255&i[d])<<8|255&i[d+1];if(33088<=p&&p<=40956)p-=33088;else if(57408<=p&&p<=60351)p-=49472;else throw\"illegal char at \"+(d+1)+\"/\"+p;p=(p>>>8&255)*192+(p&255),s.put(p,13),d+=2}if(d<i.length)throw\"illegal char at \"+(d+1)},a},De=function(){let o=[],e={};return e.writeByte=function(r){o.push(r&255)},e.writeShort=function(r){e.writeByte(r),e.writeByte(r>>>8)},e.writeBytes=function(r,t,n){t=t||0,n=n||r.length;for(let a=0;a<n;a+=1)e.writeByte(r[a+t])},e.writeString=function(r){for(let t=0;t<r.length;t+=1)e.writeByte(r.charCodeAt(t))},e.toByteArray=function(){return o},e.toString=function(){let r=\"\";r+=\"[\";for(let t=0;t<o.length;t+=1)t>0&&(r+=\",\"),r+=o[t];return r+=\"]\",r},e},Qe=function(){let o=0,e=0,r=0,t=\"\",n={},a=function(i){t+=String.fromCharCode(s(i&63))},s=function(i){if(i<0)throw\"n:\"+i;if(i<26)return 65+i;if(i<52)return 97+(i-26);if(i<62)return 48+(i-52);if(i==62)return 43;if(i==63)return 47;throw\"n:\"+i};return n.writeByte=function(i){for(o=o<<8|i&255,e+=8,r+=1;e>=6;)a(o>>>e-6),e-=6},n.flush=function(){if(e>0&&(a(o<<6-e),o=0,e=0),r%3!=0){let i=3-r%3;for(let d=0;d<i;d+=1)t+=\"=\"}},n.toString=function(){return t},n},Ge=function(o){let e=o,r=0,t=0,n=0,a={};a.read=function(){for(;n<8;){if(r>=e.length){if(n==0)return-1;throw\"unexpected end of file./\"+n}let d=e.charAt(r);if(r+=1,d==\"=\")return n=0,-1;if(d.match(/^\\s$/))continue;t=t<<6|s(d.charCodeAt(0)),n+=6}let i=t>>>n-8&255;return n-=8,i};let s=function(i){if(65<=i&&i<=90)return i-65;if(97<=i&&i<=122)return i-97+26;if(48<=i&&i<=57)return i-48+52;if(i==43)return 62;if(i==47)return 63;throw\"c:\"+i};return a},Je=function(o,e){let r=o,t=e,n=new Array(o*e),a={};a.setPixel=function(p,y,h){n[y*r+p]=h},a.write=function(p){p.writeString(\"GIF87a\"),p.writeShort(r),p.writeShort(t),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(\",\"),p.writeShort(0),p.writeShort(0),p.writeShort(r),p.writeShort(t),p.writeByte(0);let y=2,h=i(y);p.writeByte(y);let c=0;for(;h.length-c>255;)p.writeByte(255),p.writeBytes(h,c,255),c+=255;p.writeByte(h.length-c),p.writeBytes(h,c,h.length-c),p.writeByte(0),p.writeString(\";\")};let s=function(p){let y=p,h=0,c=0,b={};return b.write=function(A,k){if(A>>>k)throw\"length over\";for(;h+k>=8;)y.writeByte(255&(A<<h|c)),k-=8-h,A>>>=8-h,c=0,h=0;c=A<<h|c,h=h+k},b.flush=function(){h>0&&y.writeByte(c)},b},i=function(p){let y=1<<p,h=(1<<p)+1,c=p+1,b=d();for(let T=0;T<y;T+=1)b.add(String.fromCharCode(T));b.add(String.fromCharCode(y)),b.add(String.fromCharCode(h));let A=De(),k=s(A);k.write(y,c);let D=0,x=String.fromCharCode(n[D]);for(D+=1;D<n.length;){let T=String.fromCharCode(n[D]);D+=1,b.contains(x+T)?x=x+T:(k.write(b.indexOf(x),c),b.size()<4095&&(b.size()==1<<c&&(c+=1),b.add(x+T)),x=T)}return k.write(b.indexOf(x),c),k.write(h,c),k.flush(),A.toByteArray()},d=function(){let p={},y=0,h={};return h.add=function(c){if(h.contains(c))throw\"dup key:\"+c;p[c]=y,y+=1},h.size=function(){return y},h.indexOf=function(c){return p[c]},h.contains=function(c){return typeof p[c]<\"u\"},h};return a},Xe=function(o,e,r){let t=Je(o,e);for(let i=0;i<e;i+=1)for(let d=0;d<o;d+=1)t.setPixel(d,i,r(d,i));let n=De();t.write(n);let a=Qe(),s=n.toByteArray();for(let i=0;i<s.length;i+=1)a.writeByte(s[i]);return a.flush(),\"data:image/gif;base64,\"+a},Ze=J,bn=J.stringToBytes;function et(o,e,r=200){de(o);let t=document.createElement(\"canvas\"),n=t.getContext?.(\"2d\")??null;if(!n){let h=document.createElement(\"a\");h.href=e,h.textContent=\"Open in DID Wallet\",h.target=\"_blank\",h.rel=\"noopener\",o.appendChild(h);return}let a=Ze(0,\"M\");a.addData(e),a.make();let s=a.getModuleCount(),i=Math.floor(r/s),d=i*s;t.width=d,t.height=d,t.style.display=\"block\",t.style.width=`${r}px`,t.style.height=`${r}px`,t.style.imageRendering=\"pixelated\";let p=\"#e8e8e8\";n.fillStyle=p,n.fillRect(0,0,d,d),n.fillStyle=\"#000000\";for(let h=0;h<s;h++)for(let c=0;c<s;c++)a.isDark(h,c)&&n.fillRect(c*i,h*i,i,i);let y=document.createElement(\"div\");y.style.cssText=\"display:inline-block;padding:10px;background:#e8e8e8;border-radius:8px;line-height:0\",y.appendChild(t),o.appendChild(y)}function de(o){o.innerHTML=\"\"}var tt=`\n${Le}\n${Re}\n${Pe}\n\n/* Layout */\nbody {\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.08) 0%, transparent 60%);\n}\n\n/* Card \\u2014 fixed width prevents shrinking when views switch */\n.card {\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-lg);\n padding: 48px 40px;\n width: min(400px, calc(100vw - 32px));\n text-align: center;\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.15);\n}\n\n/* Brand header */\n.brand-header { margin-bottom: 24px; }\n.app-logo {\n width: 48px;\n height: 48px;\n border-radius: var(--radius-sm);\n object-fit: contain;\n margin-bottom: 16px;\n}\nh1 {\n font-size: 24px;\n font-weight: 600;\n margin-bottom: 8px;\n color: var(--text-white);\n letter-spacing: -0.01em;\n line-height: 1.25;\n /* Never let a long \"Sign in to {appName}\" blow past two lines \\u2014 clamp with\n an ellipsis so the card height stays stable. */\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n.subtitle {\n font-size: 14px;\n color: var(--text-secondary);\n margin-bottom: 0;\n line-height: 1.5;\n}\n.federated-hint {\n font-size: 12px;\n color: var(--text-secondary);\n margin-top: 6px;\n margin-bottom: 0;\n opacity: 0.7;\n}\n\n/* Input */\n.input {\n width: 100%;\n height: 36px;\n padding: 0 12px;\n font-size: 14px;\n color: var(--text);\n background: var(--bg-input);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n outline: none;\n margin-bottom: 16px;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.input:focus { border-color: var(--blue); box-shadow: var(--shadow-focus); }\n.input::placeholder { color: var(--text-placeholder); }\n\n/* Button */\n.btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;\n line-height: 1;\n}\n.btn:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(108,71,255,0.3); }\n.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }\n.btn:focus-visible { box-shadow: var(--shadow-focus); }\n.btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.btn-secondary {\n background: transparent;\n border: 1px solid var(--border-strong);\n color: var(--text);\n}\n.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(255,255,255,0.20); }\n\n/* Status */\n.status {\n margin-top: 16px;\n font-size: 13px;\n min-height: 20px;\n color: var(--text-secondary);\n}\n.status.error { color: var(--red-text); }\n\n/* Name row (passkey registration) */\n.name-row { display: none; }\n.name-row.visible { display: block; }\n\n/* Passkey section + secondary text action (\"First time? Create a passkey\") */\n.passkey-section > .btn + .passkey-alt,\n.passkey-section > .name-row + .btn { margin-top: 10px; }\n.passkey-alt {\n display: block;\n width: 100%;\n margin-top: 10px;\n padding: 4px;\n background: none;\n border: none;\n font-size: 13px;\n color: var(--text-secondary);\n cursor: pointer;\n text-align: center;\n transition: color 0.15s ease;\n}\n.passkey-alt:hover { color: var(--text); text-decoration: underline; }\n.passkey-alt:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); outline: none; }\n\n/* Divider */\n.divider {\n display: flex;\n align-items: center;\n margin: 20px 0;\n color: var(--text-secondary);\n font-size: 13px;\n}\n.divider::before, .divider::after {\n content: '';\n flex: 1;\n border-bottom: 1px solid var(--border);\n}\n.divider::before { margin-right: 12px; }\n.divider::after { margin-left: 12px; }\n\n/* DID Wallet section (methods view) */\n.did-wallet-section { margin-top: 8px; }\n\n/* QR view */\n.qr-view {\n position: relative;\n margin: 20px auto;\n display: flex;\n justify-content: center;\n min-height: 220px;\n align-items: center;\n}\n.qr-placeholder {\n width: 220px;\n height: 220px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius);\n background: var(--bg-elevated);\n}\n.qr-spinner {\n display: inline-block;\n width: 32px; height: 32px;\n border: 3px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n#did-connect-status {\n font-size: 13px;\n color: var(--text-secondary);\n}\n\n/* Connect result state */\n.connect-result {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 120px;\n margin: 32px 0;\n animation: fadeIn 200ms ease-out;\n}\n.result-icon {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 28px;\n font-weight: bold;\n}\n.result-error {\n background: rgba(239, 68, 68, 0.15);\n color: var(--red-text);\n border: 2px solid rgba(239, 68, 68, 0.3);\n}\n.result-loading {\n background: transparent;\n}\n.result-loading .qr-spinner {\n width: 36px;\n height: 36px;\n}\n.result-back-btn {\n margin-top: 16px;\n}\n@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }\n\n/* QR timeout overlay */\n.qr-timeout-overlay {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n background: rgba(0, 0, 0, 0.65);\n border-radius: var(--radius);\n backdrop-filter: blur(2px);\n}\n.qr-timeout-overlay .timeout-text {\n font-size: 13px;\n color: #fff;\n}\n.qr-timeout-overlay .refresh-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 6px 20px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.qr-timeout-overlay .refresh-btn:hover {\n background: var(--blue-hover);\n}\n/* Connect status views (scanned / success) */\n.connect-status-icon {\n position: relative;\n width: 72px;\n height: 72px;\n margin: 16px auto;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes connectSpin { to { transform: rotate(360deg); } }\n.connect-spinner-ring {\n position: absolute;\n inset: 0;\n width: 72px;\n height: 72px;\n border-radius: 50%;\n border: 3px solid rgba(255,255,255,0.1);\n border-top-color: var(--blue, #6c47ff);\n animation: connectSpin 0.8s linear infinite;\n}\n.connect-status-badge {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n}\n.connect-status-badge svg { width: 36px; height: 36px; }\n.connect-status-icon.connect-success svg { animation: fadeIn 0.3s ease; }\n.connect-subtitle {\n font-size: 13px;\n color: var(--text-secondary, #9394a1);\n text-align: center;\n margin: 4px 0 0;\n}\n.status.success { color: #49dc6e; font-weight: 500; }\n.deep-link-btn {\n margin-top: 12px;\n text-decoration: none;\n}\n\n/* Email section (methods view) */\n.email-section { margin-top: 8px; }\n\n/* Back button */\n.back-btn {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n background: none;\n border: none;\n color: var(--text-secondary);\n font-size: 14px;\n cursor: pointer;\n padding: 0;\n margin-bottom: 16px;\n float: left;\n}\n.back-btn:hover { color: var(--text); }\n.back-btn svg { width: 18px; height: 18px; }\n/* Escape hatch \\u2014 a quiet \"Cancel\" link, top-left of the card, mirroring the\n locale switcher (top-right). Conventional spot for a standalone auth card.\n Low in the hierarchy (tertiary color, small) so it never competes with the\n auth methods; it's an exit, not an action. */\n.home-link {\n position: absolute;\n top: 16px;\n /* Align the arrow's left edge to the content column (card's 40px padding), so\n Cancel sits on the same left line as the title and buttons \\u2014 no left padding\n of its own, which would push it off that line. */\n left: 40px;\n display: inline-flex;\n align-items: center;\n gap: 3px;\n background: none;\n border: none;\n color: var(--text-tertiary);\n font-size: 13px;\n line-height: 1;\n text-decoration: none;\n cursor: pointer;\n padding: 2px 4px 2px 0;\n transition: color 0.15s ease;\n}\n.home-link:hover { color: var(--text-secondary); }\n.home-link svg { width: 16px; height: 16px; }\n\n/* View title */\n.view-title {\n font-size: 20px;\n font-weight: 600;\n color: var(--text-white);\n margin-bottom: 8px;\n clear: both;\n padding-top: 8px;\n}\n\n/* OAuth section \\u2014 single provider (legacy) */\n.oauth-section { margin-top: 0; }\n\n/* OAuth grid \\u2014 2+ providers in 2-column layout (legacy) */\n.oauth-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n margin-bottom: 8px;\n}\n.oauth-grid .oauth-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n/* Unified secondary methods grid \\u2014 2-column layout */\n.methods-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n}\n/* Odd last child (e.g. DID Wallet when total is odd) spans full width */\n.methods-grid .method-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n.method-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n min-height: 36px;\n padding: 6px 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-elevated);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;\n white-space: normal;\n}\n.method-btn:hover { background: var(--bg-hover); border-color: var(--blue-muted); }\n.method-btn:disabled { cursor: default; pointer-events: none; }\n.method-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n\n.oauth-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;\n margin-bottom: 0;\n}\n.oauth-section .oauth-btn { margin-bottom: 8px; }\n.oauth-btn:hover { background: var(--bg-hover); }\n.oauth-btn:disabled { cursor: default; pointer-events: none; }\n.oauth-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.oauth-btn-loading {\n opacity: 0.8;\n border-color: var(--blue);\n color: var(--text-secondary);\n}\n@keyframes oauth-spin { to { transform: rotate(360deg); } }\n.oauth-spinner {\n display: inline-block;\n width: 14px; height: 14px;\n border: 2px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: oauth-spin 0.6s linear infinite;\n}\n.oauth-check { color: var(--green-text); font-size: 16px; }\n\n/* Browser compatibility warning */\n.compat-warning {\n font-size: 13px;\n color: var(--text-tertiary);\n padding: 12px;\n background: var(--bg-elevated);\n border-radius: var(--radius-sm);\n margin-bottom: 16px;\n}\n\n/* Trust footer */\n.login-footer {\n margin-top: 24px;\n padding-top: 20px;\n border-top: 1px solid var(--border);\n}\n.secured-badge {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.secured-badge svg { width: 14px; height: 14px; flex-shrink: 0; }\n.footer-links {\n margin-top: 8px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.footer-links a {\n color: var(--text-secondary);\n text-decoration: none;\n}\n.footer-links a:hover { text-decoration: underline; }\n\n/* \\u2500\\u2500\\u2500 Animations \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n@keyframes fadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n.card[data-view] { animation: fadeIn 200ms ease-out; }\n\n/* QR code scale-in */\n.qr-view { animation: qrScaleIn 300ms ease-out; }\n@keyframes qrScaleIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n}\n\n/* Button loading spinner */\n@keyframes spin { to { transform: rotate(360deg); } }\n.btn-spinner {\n display: inline-block;\n width: 16px; height: 16px;\n border: 2px solid rgba(255,255,255,0.3);\n border-top-color: #fff;\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n\n/* Success checkmark */\n@keyframes checkDraw {\n from { stroke-dashoffset: 24; }\n to { stroke-dashoffset: 0; }\n}\n.success-check {\n display: inline-block;\n width: 20px; height: 20px;\n vertical-align: middle;\n}\n.success-check path {\n stroke-dasharray: 24;\n stroke-dashoffset: 24;\n animation: checkDraw 400ms ease-out forwards;\n}\n\n/* Light theme background gradient adjustment */\n[data-theme=\"light\"] body {\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.05) 0%, transparent 60%);\n}\n[data-theme=\"light\"] .card {\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.08);\n}\n[data-theme=\"light\"] .btn:hover {\n box-shadow: 0 2px 8px rgba(108,71,255,0.15);\n}\n\n/* Language switcher */\n.locale-switcher {\n position: absolute;\n top: 16px;\n right: 16px;\n}\n.locale-btn {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n transition: color 0.15s, border-color 0.15s;\n}\n.locale-btn:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-btn svg { width: 14px; height: 14px; flex-shrink: 0; }\n.locale-trigger {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n}\n.locale-trigger:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }\n.locale-menu {\n display: none;\n flex-direction: column;\n align-items: stretch;\n gap: 4px;\n margin-top: 4px;\n}\n.locale-switcher.open .locale-menu {\n display: flex;\n}\n.locale-btn[aria-checked=\"true\"] {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-check { font-size: 11px; line-height: 1; }\n.card { position: relative; }\n`;function Q(o){let e=new Uint8Array(o),r=\"\";for(let t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return btoa(r).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=+$/,\"\")}function te(o){let e=o.replace(/-/g,\"+\").replace(/_/g,\"/\"),r=atob(e),t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t.buffer}function nt(o){let e=o.response;return{id:o.id,rawId:Q(o.rawId),type:o.type,response:{attestationObject:Q(e.attestationObject),clientDataJSON:Q(e.clientDataJSON)},clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:o.authenticatorAttachment}}function rt(o){let e=o.response;return{id:o.id,rawId:Q(o.rawId),type:o.type,response:{authenticatorData:Q(e.authenticatorData),clientDataJSON:Q(e.clientDataJSON),signature:Q(e.signature),userHandle:e.userHandle?Q(e.userHandle):void 0},clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:o.authenticatorAttachment}}async function se(o){let e=o.prefix||\"/.well-known/service/api/passkey\",r=o.onStatus||(()=>{}),t=o.authOnly||!1,n=o.registerOnly||!1,a=o.invitationId||void 0,s=o.locale,i=o.texts||{},d=i.waiting||w(\"passkeyWaiting\",s),p=i.creating||w(\"passkeyCreating\",s),y=i.verifying||w(\"verifying\",s);async function h(){let x=await fetch(`${e}/auth`,{method:\"GET\"});if(!x.ok)throw new Error(w(\"authFailed\",s));return x.json()}async function c(x){let T=[];x&&T.push(`name=${encodeURIComponent(x)}`),a&&T.push(`invitationId=${encodeURIComponent(a)}`);let I=T.length?`?${T.join(\"&\")}`:\"\",S=await fetch(`${e}/register${I}`,{method:\"GET\"});if(!S.ok)throw new Error(w(\"registrationFailed\",s));return S.json()}function b(x,T){let I=new Error(x);throw T&&(I.code=T),I}async function A(x,T){let I=await fetch(`${e}/auth`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:x,credential:T})});if(!I.ok){let S=await I.json().catch(()=>({}));b(S.error||w(\"authFailed\",s),S.code)}return I.json()}async function k(x,T,I){let S=await fetch(`${e}/register`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:x,credential:T,name:I||void 0})});if(!S.ok){let L=await S.json().catch(()=>({}));b(L.error||w(\"registrationFailed\",s),L.code)}return S.json()}if(!n){r(d,!1);try{let x=await h(),{challengeId:T}=x,I=x.authentication||x,S={publicKey:{...I,challenge:te(I.challenge),allowCredentials:(I.allowCredentials||[]).map(z=>({...z,id:te(z.id)}))}},L;try{L=await navigator.credentials.get(S)}catch{if(t)return{success:!1,error:\"no_passkey\"}}if(L){let z=rt(L);return r(y,!1),await A(T,z),{success:!0}}}catch(x){let T=x instanceof Error?x.message:w(\"authFailed\",s),I=x instanceof Error?x.code:void 0;return r(T,!0),{success:!1,error:T,code:I}}}let D=await c(o.name||\"\");if(D.registrationAllowed===!1)return r(w(\"regClosed\",s),!0),{success:!1,error:\"registration_closed\"};r(p,!1);try{let x=D.registration||D,T={publicKey:{...x,challenge:te(x.challenge),user:{...x.user,id:te(x.user.id)},excludeCredentials:(x.excludeCredentials||[]).map(L=>({...L,id:te(L.id)}))}},I=await navigator.credentials.create(T),S=nt(I);return r(y,!1),await k(D.challengeId,S,o.name||\"\"),{success:!0}}catch(x){let T=x instanceof Error?x.message:w(\"passkeySetupFailed\",s),I=x instanceof Error?x.code:void 0;return r(T,!0),{success:!1,error:T,code:I}}}function G(o,e){let r=o instanceof Error?o.message:\"\",t=o instanceof Error&&\"code\"in o?o.code:\"\";return t===\"FORBIDDEN\"?w(\"accessDenied\",e):r===\"registration_closed\"||t===\"registration_closed\"?w(\"regClosed\",e):r||w(\"authFailed\",e)}var ot=\"https://web.abtwallet.io/\";function st(){return typeof navigator>\"u\"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function it(){return typeof window>\"u\"?null:window.ABT_DEV??window.ABT??null}function W(o){return o.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\")}var Te=class{container;config;http;options;tokenSession=null;styleEl=null;mounted=!1;currentView=\"methods\";cardEl=null;mediaQuery=null;mediaListener=null;localeOutsideClick=null;constructor(o,e,r,t){if(this.container=o,this.config=e,this.http=r,this.options={methods:[\"passkey\",\"did-connect\"],locale:\"en\",...t},!this.options.invitationId&&typeof document<\"u\"){let n=document.cookie.match(/(?:^|;\\s*)pending_invitation=([^;]*)/);if(n)try{this.options.invitationId=decodeURIComponent(n[1])}catch{}}}mount(){if(this.mounted)return;this.mounted=!0,this.styleEl=document.createElement(\"style\"),this.styleEl.textContent=tt,this.container.appendChild(this.styleEl),this.applyTheme();let o=this.filterMethods(this.options.methods);this.renderCard(o)}destroy(){this.detachLocaleMenu(),this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.mediaQuery&&this.mediaListener&&(this.mediaQuery.removeEventListener(\"change\",this.mediaListener),this.mediaQuery=null,this.mediaListener=null),document.documentElement.removeAttribute(\"data-theme\"),this.container.innerHTML=\"\",this.styleEl=null,this.cardEl=null,this.currentView=\"methods\",this.mounted=!1}update(o){Object.assign(this.options,o),this.mounted&&(this.destroy(),this.mount())}applyTheme(){let o=this.options.theme??\"dark\";if(o===\"light\")document.documentElement.dataset.theme=\"light\";else if(o===\"auto\"&&typeof window.matchMedia==\"function\"){let e=window.matchMedia(\"(prefers-color-scheme: light)\");this.mediaQuery=e;let r=t=>{t?document.documentElement.dataset.theme=\"light\":document.documentElement.removeAttribute(\"data-theme\")};r(e.matches),this.mediaListener=t=>r(t.matches),e.addEventListener(\"change\",this.mediaListener)}}filterMethods(o){return o.filter(e=>e===\"passkey\"?typeof window<\"u\"&&window.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential==\"function\":!0)}renderCard(o){let e=document.createElement(\"div\");e.className=\"card\",this.cardEl=e,this.container.appendChild(e),this.switchView(\"methods\",o)}renderLocaleSwitcher(o){let e=this.options.locales;if(e){this.renderLocaleMenu(o,e);return}if(ce.length<2)return;let r=document.createElement(\"div\");r.className=\"locale-switcher\";let t=this.options.locale,n=ce.find(s=>s.code!==t)??ce[0],a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-btn\",a.innerHTML=`${ke} ${W(n.label)}`,a.title=n.label,a.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(n.code),this.update({locale:n.code})}),r.appendChild(a),o.appendChild(r)}renderLocaleMenu(o,e){if(e.length<2)return;this.detachLocaleMenu();let r=this.options.locale,t=e.find(p=>p.code===r)??e[0],n=document.createElement(\"div\");n.className=\"locale-switcher\";let a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-trigger\",a.setAttribute(\"aria-haspopup\",\"menu\"),a.setAttribute(\"aria-expanded\",\"false\"),a.innerHTML=`${ke} ${W(t.label)}`,a.title=t.label;let s=document.createElement(\"div\");s.className=\"locale-menu\",s.setAttribute(\"role\",\"menu\"),s.hidden=!0;let i=p=>{n.classList.toggle(\"open\",p),s.hidden=!p,a.setAttribute(\"aria-expanded\",p?\"true\":\"false\")};a.addEventListener(\"click\",p=>{p.stopPropagation(),i(s.hidden)});for(let p of e){let y=p.code===t.code,h=document.createElement(\"button\");if(h.type=\"button\",h.className=\"locale-btn\",h.setAttribute(\"role\",\"menuitemradio\"),h.setAttribute(\"aria-checked\",y?\"true\":\"false\"),h.dataset.locale=p.code,h.title=p.label,y){let b=document.createElement(\"span\");b.className=\"locale-check\",b.setAttribute(\"aria-hidden\",\"true\"),b.textContent=\"\\u2713\",h.appendChild(b)}let c=document.createElement(\"span\");c.textContent=p.label,h.appendChild(c),h.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(p.code),this.update({locale:p.code})}),s.appendChild(h)}let d=p=>{n.contains(p.target)||i(!1)};document.addEventListener(\"click\",d),this.localeOutsideClick=d,n.append(a,s),o.appendChild(n)}detachLocaleMenu(){this.localeOutsideClick&&(document.removeEventListener(\"click\",this.localeOutsideClick),this.localeOutsideClick=null)}switchView(o,e){if(!this.cardEl)return;let r=this.options.locale;switch(this.currentView===\"qr\"&&o!==\"qr\"&&this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.currentView=o,this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=o,this.renderLocaleSwitcher(this.cardEl),o){case\"methods\":this.renderMethodsView(this.cardEl,r,e??this.filterMethods(this.options.methods));break;case\"qr\":this.renderQRView(this.cardEl,r);break;case\"email\":this.renderEmailView(this.cardEl,r);break}}renderMethodsView(o,e,r){this.renderHomeLink(o,e),this.renderBrandHeader(o,e);let t=this.options.methods.includes(\"passkey\");if(t&&!r.includes(\"passkey\")){let s=document.createElement(\"div\");s.className=\"compat-warning\",s.textContent=w(\"passkeyUnsupported\",e),o.appendChild(s)}let n=r.includes(\"passkey\");n&&this.renderPasskeySection(o,e);let a=r.filter(s=>s!==\"passkey\");if(n&&a.length>0&&this.renderDivider(o,e),a.length>0&&this.renderSecondaryGrid(o,e,r),r.length===0&&!t){let s=document.createElement(\"p\");s.className=\"subtitle\",s.textContent=\"No authentication methods available.\",o.appendChild(s)}this.renderTrustFooter(o,e)}renderQRView(o,e){this.renderBackButton(o,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=w(\"scanTitle\",e),o.appendChild(r);let t=document.createElement(\"div\");t.id=\"did-connect-qr\",t.className=\"qr-view\",t.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',o.appendChild(t);let n=document.createElement(\"button\");n.className=\"btn btn-secondary deep-link-btn\",n.id=\"did-wallet-open-btn\",n.textContent=w(\"openInWallet\",e),n.disabled=!0,o.appendChild(n);let a=document.createElement(\"div\");a.id=\"did-connect-status\",a.className=\"status\",o.appendChild(a),this.renderTrustFooter(o,e),this.startDIDConnectInView(a,t,n,e)}renderEmailView(o,e){this.renderBackButton(o,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=w(\"emailTitle\",e),o.appendChild(r);let t=document.createElement(\"input\");t.className=\"input\",t.type=\"email\",t.placeholder=w(\"emailPlaceholder\",e),o.appendChild(t);let n=document.createElement(\"button\");n.className=\"btn\",n.textContent=w(\"emailSubmit\",e),o.appendChild(n);let a=document.createElement(\"div\");a.className=\"status\",o.appendChild(a);let s=document.createElement(\"div\");s.className=\"email-code-section\",s.style.display=\"none\";let i=document.createElement(\"input\");i.className=\"input\",i.type=\"text\",i.inputMode=\"numeric\",i.maxLength=8,i.autocomplete=\"one-time-code\",i.placeholder=w(\"emailCodePlaceholder\",e),s.appendChild(i);let d=document.createElement(\"button\");d.className=\"btn\",d.textContent=w(\"emailVerify\",e),s.appendChild(d);let p=document.createElement(\"button\");p.className=\"btn btn-secondary\",p.textContent=w(\"emailResend\",e),p.style.marginTop=\"8px\",s.appendChild(p),o.insertBefore(s,a),this.renderTrustFooter(o,e);let y=\"\",h,c=this.config.servicePrefix??\"/.well-known/service\",b=async()=>{if(n.disabled)return;let k=t.value.trim();if(!k?.includes(\"@\")){a.textContent=w(\"emailInvalid\",e),a.className=\"status error\";return}n.disabled=!0,a.textContent=w(\"emailSending\",e),a.className=\"status\";try{let D=await this.http.post(`${c}/api/email/sendCode`,{email:k,locale:e});y=k,h=D?.id,t.style.display=\"none\",n.style.display=\"none\",s.style.display=\"\",r.textContent=w(\"emailVerify\",e),a.textContent=w(\"emailSent\",e,{email:k}),a.className=\"status\",i.focus()}catch(D){let x=D instanceof Error?D.message:\"Failed to send email\";a.textContent=x,a.className=\"status error\",n.disabled=!1}},A=async()=>{if(d.disabled)return;let k=i.value.trim();if(!k||k.length!==8){a.textContent=w(\"emailCodeInvalid\",e),a.className=\"status error\";return}d.disabled=!0,a.textContent=w(\"verifying\",e),a.className=\"status\";try{await this.http.post(`${c}/api/email/login`,{code:k,id:h}),a.textContent=w(\"success\",e),a.className=\"status\",this.handleSuccess()}catch(D){D instanceof Error&&\"code\"in D&&D.code===\"FORBIDDEN\"?this.showFullError(G(D,e)):(a.textContent=G(D,e),a.className=\"status error\",d.disabled=!1,i.value=\"\",i.focus())}};n.addEventListener(\"click\",b),t.addEventListener(\"keydown\",k=>{k.key===\"Enter\"&&b()}),d.addEventListener(\"click\",A),i.addEventListener(\"keydown\",k=>{k.key===\"Enter\"&&A()}),p.addEventListener(\"click\",async()=>{p.disabled=!0,a.textContent=w(\"emailSending\",e),a.className=\"status\";try{h=(await this.http.post(`${c}/api/email/sendCode`,{email:y,locale:e}))?.id,a.textContent=w(\"emailSent\",e,{email:y}),a.className=\"status\"}catch(k){let D=k instanceof Error?k.message:\"Failed to resend\";a.textContent=D,a.className=\"status error\"}p.disabled=!1})}renderBackButton(o,e){let r=document.createElement(\"button\");r.className=\"back-btn\",r.innerHTML=`${Ce} ${W(w(\"back\",e))}`,r.addEventListener(\"click\",()=>this.switchView(\"methods\")),o.appendChild(r)}renderHomeLink(o,e){let{homeUrl:r,onCancel:t}=this.options;if(!t&&!r)return;let n=`${Ce} ${W(w(\"cancel\",e))}`;if(t){let a=document.createElement(\"button\");a.type=\"button\",a.className=\"home-link\",a.innerHTML=n,a.addEventListener(\"click\",()=>this.options.onCancel?.()),o.appendChild(a)}else{let a=document.createElement(\"a\");a.className=\"home-link\",a.href=r,a.innerHTML=n,o.appendChild(a)}}renderBrandHeader(o,e){let r=document.createElement(\"div\");if(r.className=\"brand-header\",this.options.appLogo){let n=document.createElement(\"img\");n.className=\"app-logo\",n.src=W(this.options.appLogo),n.alt=this.options.appName?W(this.options.appName):\"\",n.width=48,n.height=48,r.appendChild(n)}let t=document.createElement(\"h1\");if(this.options.appName?t.textContent=w(\"signInTo\",e,{appName:this.options.appName}):t.textContent=w(\"signIn\",e),r.appendChild(t),this.options.masterAppName){let n=document.createElement(\"p\");n.className=\"federated-hint\",n.textContent=w(\"federatedBy\",e,{masterName:this.options.masterAppName}),r.appendChild(n)}o.appendChild(r)}renderTrustFooter(o,e){let r=document.createElement(\"div\");r.className=\"login-footer\";let t=document.createElement(\"div\");t.className=\"secured-badge\",t.innerHTML=`${We} ${W(w(\"securedBy\",e))}`,r.appendChild(t);let{privacyUrl:n,termsUrl:a}=this.options;if(n||a){let s=document.createElement(\"div\");if(s.className=\"footer-links\",n){let i=document.createElement(\"a\");i.href=n,i.target=\"_blank\",i.rel=\"noopener noreferrer\",i.textContent=w(\"privacy\",e),s.appendChild(i)}if(n&&a&&s.appendChild(document.createTextNode(\" \\xB7 \")),a){let i=document.createElement(\"a\");i.href=a,i.target=\"_blank\",i.rel=\"noopener noreferrer\",i.textContent=w(\"terms\",e),s.appendChild(i)}r.appendChild(s)}o.appendChild(r)}renderDivider(o,e){let r=document.createElement(\"div\");r.className=\"divider\",r.textContent=w(\"or\",e),o.appendChild(r)}renderPasskeySection(o,e){let r=document.createElement(\"div\");r.className=\"passkey-section\",o.appendChild(r);let t=document.createElement(\"div\");t.className=\"status\",t.id=\"passkey-status\",o.appendChild(t);let n=(c,b)=>{t.textContent=c,t.className=`status${b?\" error\":\"\"}`},a=()=>n(\"\",!1),s={waiting:w(\"passkeyWaiting\",e),creating:w(\"passkeyCreating\",e),verifying:w(\"verifying\",e)},i=c=>c.success?(n(w(\"success\",e),!1),this.handleSuccess(),!0):c.code===\"FORBIDDEN\"||c.error===\"registration_closed\"?(this.showFullError(G({message:c.error,code:c.code||c.error},e)),!0):!1,d=()=>{r.innerHTML=\"\",n(w(\"passkeyNoLocal\",e),!1);let c=document.createElement(\"button\");c.className=\"btn\",c.id=\"passkey-btn\",c.innerHTML=`${le} ${W(w(\"passkeyUseAnotherDevice\",e))}`,r.appendChild(c),c.addEventListener(\"click\",()=>y());let b=document.createElement(\"button\");b.type=\"button\",b.className=\"passkey-alt\",b.textContent=w(\"passkeyCreateInstead\",e),r.appendChild(b),b.addEventListener(\"click\",()=>p())},p=()=>{r.innerHTML=\"\",a();let c=document.createElement(\"div\");c.className=\"name-row visible\",c.id=\"passkey-name-row\";let b=document.createElement(\"input\");b.className=\"input\",b.id=\"passkey-name-input\",b.type=\"text\",b.placeholder=w(\"namePlaceholder\",e),b.autocomplete=\"name\",c.appendChild(b),r.appendChild(c);let A=document.createElement(\"button\");A.className=\"btn\",A.id=\"passkey-btn\",A.innerHTML=`${le} ${W(w(\"passkeyCreate\",e))}`,r.appendChild(A);let k=document.createElement(\"button\");k.type=\"button\",k.className=\"passkey-alt\",k.textContent=w(\"passkeyBackToSignIn\",e),r.appendChild(k);let D=async()=>{if(A.disabled)return;A.disabled=!0;let x=await se({registerOnly:!0,name:b.value.trim(),onStatus:n,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});i(x)||(x.error&&n(x.error,!0),A.disabled=!1)};A.addEventListener(\"click\",D),b.addEventListener(\"keydown\",x=>{x.key===\"Enter\"&&D()}),k.addEventListener(\"click\",()=>h()),b.focus()},y=async()=>{let c=r.querySelector(\"#passkey-btn\");c&&(c.disabled=!0);let b=await se({authOnly:!0,onStatus:n,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});if(!i(b)){if(b.error&&b.error!==\"no_passkey\"){n(b.error,!0),c&&(c.disabled=!1);return}d()}},h=()=>{r.innerHTML=\"\",a();let c=document.createElement(\"button\");c.className=\"btn\",c.id=\"passkey-btn\",c.innerHTML=`${le} ${W(w(\"passkeySignIn\",e))}`,r.appendChild(c),c.addEventListener(\"click\",()=>y());let b=document.createElement(\"button\");b.type=\"button\",b.className=\"passkey-alt\",b.textContent=w(\"passkeyFirstTime\",e),r.appendChild(b),b.addEventListener(\"click\",()=>p())};this.options.invitationId?p():h()}startOAuthPopup(o,e){let r=this.config.servicePrefix??\"/.well-known/service\",t=this.options.masterOAuthOrigin?`${this.options.masterOAuthOrigin}${r}`:r,n=new URL(t,window.location.href).origin,a=`${t}/api/oauth/${encodeURIComponent(o)}/login?returnUrl=${encodeURIComponent(window.location.href)}`,s=500,i=620,d=window.screenX+(window.innerWidth-s)/2,p=window.screenY+(window.innerHeight-i)/2,y=window.open(a,\"oauth-login:popup\",`left=${d},top=${p},width=${s},height=${i},resizable,scrollbars=yes,status=1,popup`);if(!y){window.location.href=a;return}let h=e.innerHTML;e.innerHTML='<span class=\"oauth-spinner\"></span> Authorizing...',e.disabled=!0,e.classList.add(\"oauth-btn-loading\");let c=()=>{e.innerHTML=h,e.disabled=!1,e.classList.remove(\"oauth-btn-loading\")},b=!1,A,k=()=>{b||(b=!0,I(),e.innerHTML='<span class=\"oauth-check\">\\u2713</span> Success',this.handleSuccess())},D=async S=>{if(S.origin!==n||!S.data||S.data.type!==\"authorization_response\"||b)return;x!==void 0&&(clearInterval(x),x=void 0);try{y.close()}catch{}if(S.data.error){c(),I();return}let{code:L,state:z}=S.data.response??S.data;if(!L){c(),I();return}e.innerHTML='<span class=\"oauth-spinner\"></span> Signing in...',e.disabled=!0;try{let l={provider:o,code:L,state:z};this.options.invitationId&&(l.invitationId=this.options.invitationId),await this.http.post(`${r}/api/oauth/login`,l),k()}catch(l){let m=l instanceof Error?l.message:\"\",u=l instanceof Error&&\"code\"in l?l.code:\"\";u===\"FORBIDDEN\"||m===\"registration_closed\"||u===\"registration_closed\"?(b=!0,I(),this.showFullError(G(l,this.options.locale))):c()}},x=setInterval(()=>{let S=!1;try{S=y.closed}catch{return}if(!S)return;x!==void 0&&(clearInterval(x),x=void 0),c();let L=()=>{this.http.get(`${r}/api/did/session`).then(z=>{z?.authenticated&&k()}).catch(()=>{})};L(),A=setInterval(L,500)},500),T=setTimeout(()=>{b||(I(),c())},300*1e3),I=()=>{x!==void 0&&(clearInterval(x),x=void 0),A!==void 0&&(clearInterval(A),A=void 0),clearTimeout(T),window.removeEventListener(\"message\",D)};window.addEventListener(\"message\",D)}renderSecondaryGrid(o,e,r){let t=document.createElement(\"div\");if(t.className=\"methods-grid\",r.includes(\"oauth\")&&this.options.oauthProviders?.length){let n=(this.options.oauthProviders??[]).filter(a=>a.enabled);for(let a of n){let s=document.createElement(\"button\");s.className=\"method-btn\",s.dataset.provider=a.id;let i=ze(a.id);s.innerHTML=`${i} ${W(a.name)}`,t.appendChild(s),s.addEventListener(\"click\",()=>{this.startOAuthPopup(a.id,s)})}}if(r.includes(\"email\")){let n=document.createElement(\"button\");n.className=\"method-btn\",n.id=\"email-btn\",n.innerHTML=`${He} ${W(w(\"emailButton\",e))}`,t.appendChild(n),n.addEventListener(\"click\",()=>{this.switchView(\"email\")})}if(r.includes(\"did-connect\")){let n=document.createElement(\"button\");n.className=\"method-btn\",n.id=\"did-wallet-btn\";let a=t.children.length>0?w(\"didWalletButtonShort\",e):w(\"didWalletButton\",e);n.innerHTML=`${xe} ${W(a)}`,t.appendChild(n),n.addEventListener(\"click\",()=>{this.switchView(\"qr\")})}o.appendChild(t)}async startDIDConnectInView(o,e,r,t){o.textContent=w(\"connecting\",t);try{this.tokenSession?.destroy(),this.tokenSession=new ee(this.config,this.http),this.tokenSession.on(\"succeed\",async()=>{this.showConnectResult(e,r,o,w(\"verifying\",t));try{let a=this.config.servicePrefix??\"/.well-known/service\";await this.http.post(`${a}/api/did/connect/complete`,{token:this.tokenSession.state.token}),this.showConnectSuccess(e,r,o,t),this.handleSuccess()}catch(a){this.showConnectResult(e,r,o,G(a,t),!0)}}),this.tokenSession.on(\"timeout\",()=>{o.textContent=w(\"timeout\",t);let a=document.createElement(\"div\");a.className=\"qr-timeout-overlay\",a.innerHTML=`<span class=\"timeout-text\">${W(w(\"timeout\",t))}</span>`;let s=document.createElement(\"button\");s.className=\"refresh-btn\",s.textContent=w(\"refreshQR\",t),s.addEventListener(\"click\",()=>{a.remove(),de(e),e.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',r.disabled=!0,this.startDIDConnectInView(o,e,r,t)}),a.appendChild(s),e.appendChild(a)}),this.tokenSession.on(\"error\",a=>{this.showConnectResult(e,r,o,G(a,t),!0)}),this.tokenSession.on(\"statusChange\",a=>{a.status===\"scanned\"&&this.showConnectScanned(e,r,o,t)});let n=await this.tokenSession.create({locale:t});n.url&&(et(e,n.url),r.disabled=!1,r.addEventListener(\"click\",()=>{this.showConnectScanned(e,r,o,t),this.openInWallet(n.url,t)})),o.textContent=w(\"scanWithWallet\",t),this.tokenSession.startPolling()}catch(n){o.textContent=G(n,t),de(e)}}showFullError(o){if(!this.cardEl)return;let e=this.options.locale;this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=\"error\",this.renderLocaleSwitcher(this.cardEl);let r=document.createElement(\"div\");r.className=\"connect-result\",r.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',this.cardEl.appendChild(r);let t=document.createElement(\"div\");t.className=\"status error\",t.textContent=o,this.cardEl.appendChild(t);let n=document.createElement(\"button\");n.className=\"btn btn-secondary result-back-btn\",n.textContent=w(\"back\",e),n.addEventListener(\"click\",()=>this.switchView(\"methods\")),this.cardEl.appendChild(n),this.renderTrustFooter(this.cardEl,e)}showConnectScanned(o,e,r,t=\"en\"){o.style.display=\"none\",e.style.display=\"none\";let n=o.parentElement?.querySelector(\".connect-result\");n||(n=document.createElement(\"div\"),n.className=\"connect-result\",o.parentElement?.insertBefore(n,r)),n.innerHTML=`<div class=\"connect-status-icon\">\n <div class=\"connect-spinner-ring\"></div>\n <span class=\"connect-status-badge\">${xe}</span>\n </div>`,r.textContent=w(\"waitingWallet\",t),r.className=\"status\";let a=r.parentElement?.querySelector(\".connect-subtitle\");a||(a=document.createElement(\"p\"),a.className=\"connect-subtitle\",r.parentElement?.insertBefore(a,r.nextSibling)),a.textContent=w(\"walletContinue\",t);let s=r.parentElement?.querySelector(\".result-back-btn\");s||(s=document.createElement(\"button\"),s.className=\"btn btn-secondary result-back-btn\",s.textContent=w(\"back\",t),s.addEventListener(\"click\",()=>this.switchView(\"methods\")),a.parentElement?.insertBefore(s,a.nextSibling))}showConnectSuccess(o,e,r,t=\"en\"){o.style.display=\"none\",e.style.display=\"none\";let n=o.parentElement?.querySelector(\".connect-result\");n||(n=document.createElement(\"div\"),n.className=\"connect-result\",o.parentElement?.insertBefore(n,r)),n.innerHTML=`<div class=\"connect-status-icon connect-success\">\n <svg viewBox=\"0 0 64 64\" width=\"64\" height=\"64\"><circle cx=\"32\" cy=\"32\" r=\"28\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\"/><polyline points=\"20 33 28 41 44 25\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>\n </div>`,r.textContent=w(\"success\",t),r.className=\"status success\";let a=r.parentElement?.querySelector(\".connect-subtitle\"),s=r.parentElement?.querySelector(\".result-back-btn\");a?.remove(),s?.remove()}showConnectResult(o,e,r,t,n=!1){let a=this.options.locale;o.style.display=\"none\",e.style.display=\"none\";let s=o.parentElement?.querySelector(\".connect-result\");if(s||(s=document.createElement(\"div\"),s.className=\"connect-result\",o.parentElement?.insertBefore(s,r)),n){s.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',r.textContent=t,r.className=\"status error\";let i=r.parentElement?.querySelector(\".result-back-btn\");i||(i=document.createElement(\"button\"),i.className=\"btn btn-secondary result-back-btn\",i.textContent=w(\"back\",a),i.addEventListener(\"click\",()=>this.switchView(\"methods\")),r.parentElement?.insertBefore(i,r.nextSibling))}else s.innerHTML='<div class=\"result-icon result-loading\"><span class=\"qr-spinner\"></span></div>',r.textContent=t,r.className=\"status\"}openInWallet(o,e=\"en\"){let r=st(),t=it();if(r){let n=o.replace(/^https?:\\/\\//,\"abt://\");window.location.href=n}else if(t&&typeof t.open==\"function\"){let n=this.tokenSession?.state;t.open({action:this.config.action??\"login\",locale:e,url:encodeURIComponent(o),appInfo:n?.appInfo??{},memberAppInfo:n?.memberAppInfo??{}})}else{let n=`${ot}?action=requestAuth&url=${encodeURIComponent(o)}`,a=414,s=736,i=window.screenX+window.innerWidth-a,d=window.screenY;window.open(n,\"did-wallet:popup\",`left=${i},top=${d},width=${a},height=${s},resizable,scrollbars=yes,status=1,popup`)}}handleSuccess(){this.options.onSuccess?this.options.onSuccess():setTimeout(()=>location.reload(),300)}};return Ne(at);})();\n";
|
|
1
|
+
declare const _default: "\"use strict\";var __LoginBundle=(()=>{var ce=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Pe=Object.prototype.hasOwnProperty;var Oe=(t,e)=>{for(var r in e)ce(t,r,{get:e[r],enumerable:!0})},Me=(t,e,r,n)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let i of Ne(e))!Pe.call(t,i)&&i!==r&&ce(t,i,{get:()=>e[i],enumerable:!(n=Re(e,i))||n.enumerable});return t};var $e=t=>Me(ce({},\"__esModule\",{value:!0}),t);var pt={};Oe(pt,{FetchHttpAdapter:()=>ee,LoginDialog:()=>Le,LoginPage:()=>me,runPasskeyAuth:()=>le});var K={CREATED:\"created\",SCANNED:\"scanned\",SUCCEED:\"succeed\",ERROR:\"error\",TIMEOUT:\"timeout\",BUSY:\"busy\",FORBIDDEN:\"forbidden\"};var U={API_PREFIX:\"/api/did\",SERVICE_PREFIX:\"/.well-known/service\",ACTION:\"login\",TOKEN_TIMEOUT:3e5,CHECK_INTERVAL:2e3,TOKEN_KEY:\"_t_\",TOKEN_DELIVERY:\"cookie\",CREATE_THROTTLE:500,AUTO_CHECK_INTERVAL:6e4};var ue=\"did:abt:\";function ye(t){if(!t||typeof t!=\"string\")return!1;let e=t.replace(ue,\"\");return/^(0x)?[0-9a-f]{40}$/i.test(e)}function be(t,e=8,r=6){return!t||typeof t!=\"string\"?\"\":t.length<=e+r+3?t:`${t.slice(0,e)}...${t.slice(-r)}`}function de(t,e={}){if(!t||typeof t!=\"string\")return{prefix:\"DID: ABT:\",chainLabel:\"ABT\",address:\"\",compact:\"\",copyText:\"\"};let{startChars:r=8,endChars:n=6}=e,i=ye(t),a=t.replace(ue,\"\"),s=i?\"ETH\":\"ABT\",o=e.includePrefix??!i;return{prefix:`DID: ${s}:`,chainLabel:s,address:a,compact:be(a,r,n),copyText:o?`${ue}${a}`:a}}var M={TOKEN_EXPIRED:\"TOKEN_EXPIRED\",TOKEN_NOT_FOUND:\"TOKEN_NOT_FOUND\",TOKEN_TIMEOUT:\"TOKEN_TIMEOUT\",ALREADY_EXIST:\"ALREADY_EXIST\",ALREADY_BIND:\"ALREADY_BIND\",NETWORK_ERROR:\"NETWORK_ERROR\",INVALID_RESPONSE:\"INVALID_RESPONSE\",UNAUTHORIZED:\"UNAUTHORIZED\",FORBIDDEN:\"FORBIDDEN\"},O=class extends Error{code;constructor(e,r){super(r),this.name=\"ConnectError\",this.code=e}};var ee=class{_defaultHeaders;_onRequest;constructor(e){this._defaultHeaders=e?.headers??{},this._onRequest=e?.onRequest}async get(e,r){this._validateUrl(e);let n=r?.params?this._serializeParams(r.params):\"\",i=n?`${e}${e.includes(\"?\")?\"&\":\"?\"}${n}`:e,s={method:\"GET\",headers:{...this._defaultHeaders,...r?.headers},signal:r?.signal};return this._onRequest&&(s=this._onRequest(i,s)),this._execute(i,s)}async post(e,r,n){this._validateUrl(e);let i=n?.params?this._serializeParams(n.params):\"\",a=i?`${e}${e.includes(\"?\")?\"&\":\"?\"}${i}`:e,o={method:\"POST\",headers:{\"Content-Type\":\"application/json\",...this._defaultHeaders,...n?.headers},body:r!==void 0?JSON.stringify(r):void 0,signal:n?.signal};return this._onRequest&&(o=this._onRequest(a,o)),this._execute(a,o)}_validateUrl(e){if(!e?.trim())throw new O(M.NETWORK_ERROR,\"Request URL must not be empty\");if(e.trim().toLowerCase().startsWith(\"javascript:\"))throw new O(M.NETWORK_ERROR,\"Invalid URL protocol\")}async _execute(e,r){let n;try{n=await globalThis.fetch(e,r)}catch(s){throw s?.name===\"AbortError\"?s:new O(M.NETWORK_ERROR,`Network request failed: ${s?.message??\"Unknown error\"}`)}if(!n.ok){let s=\"\",o=\"\";try{let l=await n.text();try{let f=JSON.parse(l);f.error&&(s=f.error),f.code&&(o=f.code)}catch{s=l}}catch{}let c=o===\"FORBIDDEN\"?M.FORBIDDEN:M.NETWORK_ERROR;throw new O(c,s||`HTTP ${n.status} ${n.statusText||\"Error\"}`)}if(n.status===204)return null;let i=await n.text();if(!i.trim())return null;let a=n.headers.get(\"content-type\")??\"\";if(!a.includes(\"application/json\")&&!a.includes(\"+json\"))throw new O(M.INVALID_RESPONSE,`Expected JSON response but received: ${a||\"unknown content type\"}`);try{return JSON.parse(i)}catch{throw new O(M.INVALID_RESPONSE,\"Failed to parse JSON response\")}}_serializeParams(e){let r=[];for(let n of Object.keys(e)){let i=e[n];if(i!=null)if(Array.isArray(i))for(let a of i)a!=null&&r.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(a))}`);else typeof i==\"boolean\"?r.push(`${encodeURIComponent(n)}=${i?\"true\":\"false\"}`):r.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`)}return r.join(\"&\")}};var Ee=[\"en\",\"zh\",\"zh-TW\",\"ja\"],vt=new Set(Ee);function te(t){let e=t.apiPrefix??U.API_PREFIX,r=t.action??U.ACTION,n=e.replace(/\\/+$/,\"\"),i=r.replace(/^\\/+/,\"\");return`${n}/${i}`}function Ce(){return{token:null,url:null,status:null,error:null,appInfo:null,memberAppInfo:null,loading:!1}}var ne=class{_state;_config;_http;_pollTimer=null;_checkCount=0;_maxCheckCount;_realtimeUnsub=null;_realtime;_storage;_lastCreateTime=0;_listeners=new Map;_destroyed=!1;constructor(e,r,n){this._config=this._fillDefaults(e),this._http=r,this._realtime=n?.realtime,this._storage=n?.storage,this._state=Ce(),this._config.checkInterval<=0?this._maxCheckCount=1/0:this._maxCheckCount=Math.ceil(this._config.tokenTimeout/this._config.checkInterval)}get state(){return Object.freeze({...this._state})}async create(e){if(Date.now()-this._lastCreateTime<U.CREATE_THROTTLE)return this.state;(this._pollTimer!==null||this._realtimeUnsub!==null)&&this.stopPolling(),this._state.loading=!0,this._emit(\"statusChange\",this.state);let r=`${te(this._config)}/token`,n={};e?(e.locale!=null&&(n.locale=e.locale),e.provider!=null?n.provider=e.provider:n.provider=\"wallet\",e.encKey!=null&&(n.__encKey=e.encKey),e.autoConnect!=null&&(n.autoConnect=e.autoConnect),e.visitorId!=null&&(n.visitorId=e.visitorId),e.sourceToken!=null&&(n.sourceToken=e.sourceToken),e.forceConnected!=null&&(n.forceConnected=e.forceConnected),e.connectUrl!=null&&(n.connectUrl=e.connectUrl),e.extraParams&&Object.assign(n,e.extraParams)):n.provider=\"wallet\";try{let i=await this._http.get(r,{params:n});return this._state.token=i.token??null,this._state.url=i.url??null,this._state.status=K.CREATED,this._state.appInfo=i.appInfo??null,this._state.memberAppInfo=i.memberAppInfo??null,this._state.loading=!1,this._state.error=null,this._state.successResult=void 0,this._state.connectedDid=void 0,this._state.mfaCode=void 0,this._state.saveConnect=void 0,this._lastCreateTime=Date.now(),this._emit(\"statusChange\",this.state),this.state}catch(i){throw this._state.loading=!1,this._state.error=i?.message??\"Failed to create token\",this._state.status=K.ERROR,this._emit(\"statusChange\",this.state),this._emit(\"error\",new O(M.NETWORK_ERROR,this._state.error)),i}}async checkStatus(){if(!this._state.token)throw new O(M.TOKEN_NOT_FOUND,\"No token available. Call create() first.\");let e=`${te(this._config)}/status`,r={[U.TOKEN_KEY]:this._state.token};this._config.appPid;try{let n=await this._http.get(e,{params:r}),i=n.status;return i&&(this._state.status=i),n.error!==void 0&&(this._state.error=n.error),n.connectedDid!==void 0&&(this._state.connectedDid=n.connectedDid),n.mfaCode!==void 0&&(this._state.mfaCode=n.mfaCode),n.saveConnect!==void 0&&(this._state.saveConnect=n.saveConnect),i===K.FORBIDDEN?(this._state.status=K.ERROR,this._state.error=n.error||\"Access forbidden\",this._emit(\"error\",new O(M.UNAUTHORIZED,this._state.error)),this.stopPolling()):i===K.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=n),this._emit(\"succeed\",this.state),this.stopPolling()):i===K.ERROR?(this._emit(\"error\",new O(M.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):i===K.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state),this.state}catch(n){throw n}}async cancel(){if(!this._state.token)return;let e=`${te(this._config)}/timeout`,r={[U.TOKEN_KEY]:this._state.token};try{await this._http.get(e,{params:r})}catch{}this.stopPolling()}startPolling(){if(this._state.token){if(this._checkCount=0,this._realtime)try{let e=`relay:${this._config.appPid}:${this._state.token}`;this._realtimeUnsub=this._realtime.subscribe(e,r=>{this._handleRealtimeMessage(r)});return}catch{this._realtimeUnsub=null}this._config.checkInterval>0&&(this._pollTimer=setInterval(()=>{this._pollOnce()},this._config.checkInterval))}}stopPolling(){this._pollTimer!==null&&(clearInterval(this._pollTimer),this._pollTimer=null),this._realtimeUnsub&&(this._realtimeUnsub(),this._realtimeUnsub=null)}reset(){this.stopPolling(),this._state=Ce(),this._checkCount=0}destroy(){this._destroyed||(this.stopPolling(),this._state.token=null,this._state.successResult=void 0,this._listeners.clear(),this._destroyed=!0)}on(e,r){let n=this._listeners.get(e);return n||(n=new Set,this._listeners.set(e,n)),n.add(r),this}off(e,r){let n=this._listeners.get(e);return n&&(n.delete(r),n.size===0&&this._listeners.delete(e)),this}_emit(e,...r){let n=this._listeners.get(e);if(!(!n||n.size===0))for(let i of[...n])try{i(...r)}catch{}}_pollOnce(){if(this._checkCount++,this._checkCount>=this._maxCheckCount){this._handleTimeout();return}this.checkStatus().catch(()=>{})}_handleTimeout(){this.stopPolling(),this._state.status=K.TIMEOUT,this._emit(\"timeout\",this.state),this._emit(\"statusChange\",this.state)}_handleRealtimeMessage(e){if(!e||typeof e!=\"object\")return;let r=e.status;r&&(this._state.status=r,e.error!==void 0&&(this._state.error=e.error),e.connectedDid!==void 0&&(this._state.connectedDid=e.connectedDid),e.mfaCode!==void 0&&(this._state.mfaCode=e.mfaCode),e.saveConnect!==void 0&&(this._state.saveConnect=e.saveConnect),r===K.FORBIDDEN?(this._state.status=K.ERROR,this._state.error=e.error||\"Access forbidden\",this._emit(\"error\",new O(M.UNAUTHORIZED,this._state.error)),this.stopPolling()):r===K.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=e),this._emit(\"succeed\",this.state),this.stopPolling()):r===K.ERROR?(this._emit(\"error\",new O(M.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):r===K.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state))}_fillDefaults(e){return{appPid:e.appPid,appName:e.appName,appDescription:e.appDescription??\"\",appIcon:e.appIcon??\"\",appUrl:e.appUrl??\"\",apiPrefix:e.apiPrefix??U.API_PREFIX,action:e.action??U.ACTION,servicePrefix:e.servicePrefix??U.SERVICE_PREFIX,tokenTimeout:e.tokenTimeout??U.TOKEN_TIMEOUT,checkInterval:e.checkInterval??U.CHECK_INTERVAL,tokenDelivery:e.tokenDelivery??U.TOKEN_DELIVERY}}};var _={bg:{root:\"#0a0a0b\",surface:\"#141416\",card:\"#1c1c20\",elevated:\"#232328\",hover:\"#2b2b34\",active:\"#33333e\",input:\"rgba(255,255,255,0.06)\"},border:{default:\"rgba(255,255,255,0.10)\",subtle:\"rgba(255,255,255,0.06)\",strong:\"rgba(255,255,255,0.15)\",focus:\"rgba(255,255,255,0.25)\"},text:{primary:\"#f5f5f7\",secondary:\"#9394a1\",tertiary:\"#767684\",placeholder:\"#5e5f6e\",white:\"#ffffff\"},color:{blue:\"#6c47ff\",blueHover:\"#5f15fe\",blueLight:\"rgba(108,71,255,0.15)\",blueMuted:\"#9280ff\",red:\"#e02e2e\",redLight:\"rgba(224,46,46,0.15)\",redText:\"#f98a8a\",green:\"#15892b\",greenLight:\"rgba(21,137,43,0.15)\",greenText:\"#49dc6e\",yellow:\"#fd7224\",yellowLight:\"rgba(253,114,36,0.15)\",yellowText:\"#fd9357\",info:\"#236dd7\",infoLight:\"rgba(35,109,215,0.15)\",infoText:\"#73acfa\"},radius:{xs:\"4px\",sm:\"6px\",md:\"8px\",lg:\"12px\",full:\"9999px\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.3), 0 1px 2px -1px rgba(0,0,0,0.2)\",md:\"0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4)\",focus:\"0 0 0 1px rgba(255,255,255,0.12), 0 0 0 3px rgba(108,71,255,0.3)\"},font:{family:\"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",mono:\"'JetBrains Mono', 'SF Mono', monospace\",sizeBase:\"14px\",lineHeight:\"1.43\"}},$={bg:{root:\"#f8f9fa\",surface:\"#ffffff\",card:\"#ffffff\",elevated:\"#f0f1f3\",hover:\"#e9eaec\",active:\"#dddee1\",input:\"rgba(0,0,0,0.04)\"},border:{default:\"rgba(0,0,0,0.10)\",subtle:\"rgba(0,0,0,0.06)\",strong:\"rgba(0,0,0,0.15)\",focus:\"rgba(0,0,0,0.25)\"},text:{primary:\"#1a1a1a\",secondary:\"#6b7280\",tertiary:\"#9ca3af\",placeholder:\"#c0c5ce\",white:\"#1a1a1a\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.08), 0 1px 2px -1px rgba(0,0,0,0.06)\",md:\"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.12), 0 4px 6px -4px rgba(0,0,0,0.08)\",focus:\"0 0 0 1px rgba(0,0,0,0.08), 0 0 0 3px rgba(108,71,255,0.2)\"}},Te=`\n :root, :host {\n /* Backgrounds \\u2014 layered depth */\n --bg-root: ${_.bg.root};\n --bg-surface: ${_.bg.surface};\n --bg-card: ${_.bg.card};\n --bg-elevated: ${_.bg.elevated};\n --bg-hover: ${_.bg.hover};\n --bg-active: ${_.bg.active};\n --bg-input: ${_.bg.input};\n\n /* Borders \\u2014 semi-transparent for adaptability */\n --border: ${_.border.default};\n --border-subtle:${_.border.subtle};\n --border-strong:${_.border.strong};\n --border-focus: ${_.border.focus};\n\n /* Text hierarchy */\n --text: ${_.text.primary};\n --text-secondary:${_.text.secondary};\n --text-tertiary:${_.text.tertiary};\n --text-placeholder:${_.text.placeholder};\n --text-white: ${_.text.white};\n\n /* Accents */\n --blue: ${_.color.blue};\n --blue-hover: ${_.color.blueHover};\n --blue-light: ${_.color.blueLight};\n --blue-muted: ${_.color.blueMuted};\n --red: ${_.color.red};\n --red-light: ${_.color.redLight};\n --red-text: ${_.color.redText};\n --green: ${_.color.green};\n --green-light: ${_.color.greenLight};\n --green-text: ${_.color.greenText};\n --yellow: ${_.color.yellow};\n --yellow-light: ${_.color.yellowLight};\n --yellow-text: ${_.color.yellowText};\n --info: ${_.color.info};\n --info-light: ${_.color.infoLight};\n --info-text: ${_.color.infoText};\n\n /* Radii */\n --radius-xs: ${_.radius.xs};\n --radius-sm: ${_.radius.sm};\n --radius: ${_.radius.md};\n --radius-lg: ${_.radius.lg};\n --radius-full: ${_.radius.full};\n\n /* Shadows */\n --shadow-sm: ${_.shadow.sm};\n --shadow-md: ${_.shadow.md};\n --shadow-lg: ${_.shadow.lg};\n --shadow-focus: ${_.shadow.focus};\n }\n`,Se=`\n [data-theme=\"light\"], :host([data-theme=\"light\"]) {\n --bg-root: ${$.bg.root};\n --bg-surface: ${$.bg.surface};\n --bg-card: ${$.bg.card};\n --bg-elevated: ${$.bg.elevated};\n --bg-hover: ${$.bg.hover};\n --bg-active: ${$.bg.active};\n --bg-input: ${$.bg.input};\n\n --border: ${$.border.default};\n --border-subtle:${$.border.subtle};\n --border-strong:${$.border.strong};\n --border-focus: ${$.border.focus};\n\n --text: ${$.text.primary};\n --text-secondary:${$.text.secondary};\n --text-tertiary:${$.text.tertiary};\n --text-placeholder:${$.text.placeholder};\n --text-white: ${$.text.white};\n\n --shadow-sm: ${$.shadow.sm};\n --shadow-md: ${$.shadow.md};\n --shadow-lg: ${$.shadow.lg};\n --shadow-focus: ${$.shadow.focus};\n }\n`,Ue=`\n *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\n html, :host { color-scheme: dark; }\n html[data-theme=\"light\"], :host([data-theme=\"light\"]) { color-scheme: light; }\n body {\n font-family: ${_.font.family};\n background: var(--bg-root);\n color: var(--text);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: ${_.font.sizeBase};\n line-height: ${_.font.lineHeight};\n }\n a { color: var(--blue-muted); text-decoration: none; }\n a:hover { text-decoration: underline; }\n .hidden { display: none; }\n`,We=typeof HTMLElement<\"u\"?HTMLElement:class{},we='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\"/></svg>',He='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"20 6 9 17 4 12\"/></svg>',Ke=`\n:host {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n overflow: hidden;\n font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;\n line-height: 1.5;\n}\n:host([block]) { display: flex; }\n.prefix {\n flex-shrink: 0;\n opacity: 0.6;\n margin-right: 4px;\n white-space: nowrap;\n}\n.address {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--did-text-color, currentColor);\n}\n.address-compact {\n white-space: nowrap;\n color: var(--did-text-color, currentColor);\n cursor: default;\n}\n.clickable { cursor: pointer; }\n.clickable:hover { opacity: 0.8; }\n.copy-btn {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1em;\n height: 1em;\n margin-left: 6px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n opacity: 0.5;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.copy-btn:hover { opacity: 1; }\n.copy-btn.copied { opacity: 1; color: var(--did-copy-success-color, #22c55e); }\n`,ze=class extends We{static observedAttributes=[\"did\",\"compact\",\"copyable\",\"start-chars\",\"end-chars\",\"show-prefix\",\"no-tooltip\",\"no-copy\",\"block\",\"size\"];shadow;copyTimer=null;constructor(){super(),this.shadow=this.attachShadow({mode:\"open\"})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}disconnectedCallback(){this.copyTimer&&clearTimeout(this.copyTimer)}get parts(){let t=Number(this.getAttribute(\"start-chars\")),e=Number(this.getAttribute(\"end-chars\"));return de(this.getAttribute(\"did\")||\"\",{startChars:t>0?t:void 0,endChars:e>0?e:void 0})}render(){if(!(this.getAttribute(\"did\")||\"\")){this.shadow.innerHTML=\"\";return}let e=this.parts,r=this.hasAttribute(\"compact\"),n=!this.hasAttribute(\"no-copy\")&&this.getAttribute(\"copyable\")!==\"false\",i=this.hasAttribute(\"show-prefix\"),a=this.hasAttribute(\"no-tooltip\"),s=Number(this.getAttribute(\"size\"))||0,o=s>=12?`${s}px`:\"inherit\",c=r?e.compact:e.address,l=!a&&r?` title=\"${e.address}\"`:\"\",f=i?`<span class=\"prefix\">${e.prefix} </span>`:\"\",p=r?\"address-compact\":\"address\",u=n?\" clickable\":\"\",E=n?`<button class=\"copy-btn\" aria-label=\"Copy DID\">${we}</button>`:\"\";if(this.shadow.innerHTML=`\n <style>${Ke}:host { font-size: ${o}; }</style>\n ${f}<span class=\"${p}${u}\"${l}>${c}</span>${E}\n `,n){let v=this.shadow.querySelector(`.${p}`);v&&v.addEventListener(\"click\",C=>{C.stopPropagation(),this.copyToClipboard(e.copyText)});let D=this.shadow.querySelector(\".copy-btn\");D&&D.addEventListener(\"click\",C=>{C.stopPropagation(),this.copyToClipboard(e.copyText)})}}copyToClipboard(t){navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch(()=>this.fallbackCopy(t)):this.fallbackCopy(t),this.showCopied()}fallbackCopy(t){try{let e=document.createElement(\"input\");e.value=t,document.body.appendChild(e),e.select(),document.execCommand?.(\"copy\"),e.remove()}catch{}}showCopied(){let t=this.shadow.querySelector(\".copy-btn\");t&&(t.classList.add(\"copied\"),t.innerHTML=He,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{t.classList.remove(\"copied\"),t.innerHTML=we},1500))}};typeof customElements<\"u\"&&!customElements.get(\"did-address\")&&customElements.define(\"did-address\",ze);var he={en:{emailExplanation:\"We will send you a verification code. No password needed.\",otherMethods:\"Other ways to sign in\",passkeyCreateAccount:\"Create an account with Passkey\",lastUsed:\"Last used\",passkeyExplanation:\"Create a new account using your fingerprint, face, or device unlock. Your device will ask you to save a Passkey. Already have an account? Go back to sign in.\",continueWith:\"Continue with {provider}\",oauthWaiting:\"Continue in the {provider} window\",oauthIncomplete:\"Sign-in is not complete. Reopen the window or choose another method.\",oauthReopen:\"Reopen window\",oauthUnconfirmed:\"We could not confirm sign-in. Reload this page to check your session before trying again.\",oauthCheckSession:\"Reload and check sign-in\",oauthCancelled:\"Stopped waiting for sign-in. If the provider window is still open, close it before retrying.\",oauthDenied:\"Authorization was declined. Try again or choose another sign-in method.\",oauthBlocked:\"Your browser blocked the sign-in window. Reopen it or continue on this page.\",oauthTimedOut:\"Sign-in timed out. Reopen the window to start again.\",oauthFailed:\"We could not complete sign-in. Try again or choose another method.\",oauthFullPage:\"Continue on this page\",emailEdit:\"Change email\",emailCooldown:\"Resend in {seconds}s\",walletRetry:\"Wallet did not open? Try again or scan the QR code.\",tryAgain:\"Try again\",signIn:\"Sign in or create an account\",signInTo:\"Sign in or join {appName}\",passkeyButton:\"Continue with Passkey\",passkeySignIn:\"Sign in with Passkey\",passkeyCreate:\"Create Passkey\",passkeyFirstTime:\"First time? Create an account\",passkeyBackToSignIn:\"Back to sign in\",passkeyWaiting:\"Waiting for passkey\\u2026\",passkeyCreating:\"Creating your passkey\\u2026\",passkeyNoLocal:\"Passkey verification was not completed. Retry, use another device, or choose another method.\",passkeyUseAnotherDevice:\"Use another device\",passkeyCreateInstead:\"First time? Create an account\",didWalletButton:\"Continue with DID Wallet\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"Scan with your DID Wallet\",waitingWallet:\"Requesting connection\",walletContinue:\"Please continue in DID Wallet\",noPasskey:\"No existing passkey found. Enter a name and create one.\",success:\"Success!\",timeout:\"Session timed out. Try again.\",refreshQR:\"Refresh\",namePlaceholder:\"Your name (optional)\",or:\"or\",emailPlaceholder:\"Email address\",emailButton:\"Email\",passkeyUnsupported:\"Your browser does not support Passkey authentication.\",connecting:\"Connecting...\",verifying:\"Verifying...\",openInWallet:\"Open in DID Wallet\",authFailed:\"Authentication failed\",registrationFailed:\"Registration failed\",passkeySetupFailed:\"Passkey setup failed\",accessDenied:\"Access denied: your account is not permitted to log in to this site.\",regClosed:\"Registration requires an invitation.\",federatedBy:\"Authentication provided by {masterName}\",securedBy:\"Secured by DID Connect\",privacy:\"Privacy\",terms:\"Terms\",back:\"Back\",cancel:\"Cancel\",scanTitle:\"Scan with DID Wallet\",emailTitle:\"Continue with Email\",emailSubmit:\"Send Code\",emailSending:\"Sending code...\",emailSent:\"We sent an 8-digit code to {email}\",emailCodePlaceholder:\"8-digit code\",emailVerify:\"Verify\",emailResend:\"Resend code\",emailInvalid:\"Please enter a valid email address.\",emailCodeInvalid:\"Please enter the 8-digit code.\"},zh:{emailExplanation:\"\\u6211\\u4EEC\\u4F1A\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801\\uFF0C\\u65E0\\u9700\\u5BC6\\u7801\\u3002\",otherMethods:\"\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\",passkeyCreateAccount:\"\\u4F7F\\u7528 Passkey \\u521B\\u5EFA\\u8D26\\u6237\",lastUsed:\"\\u4E0A\\u6B21\\u4F7F\\u7528\",passkeyExplanation:\"\\u4F7F\\u7528\\u6307\\u7EB9\\u3001\\u9762\\u5BB9\\u6216\\u8BBE\\u5907\\u89E3\\u9501\\u65B9\\u5F0F\\u521B\\u5EFA\\u65B0\\u8D26\\u6237\\uFF0C\\u65E0\\u9700\\u5BC6\\u7801\\u3002\\u8BBE\\u5907\\u4F1A\\u63D0\\u793A\\u4FDD\\u5B58 Passkey\\u3002\\u5DF2\\u6709\\u8D26\\u6237\\uFF1F\\u8BF7\\u8FD4\\u56DE\\u767B\\u5F55\\u3002\",continueWith:\"\\u4F7F\\u7528 {provider} \\u7EE7\\u7EED\",oauthWaiting:\"\\u8BF7\\u5728 {provider} \\u7A97\\u53E3\\u4E2D\\u7EE7\\u7EED\",oauthIncomplete:\"\\u767B\\u5F55\\u5C1A\\u672A\\u5B8C\\u6210\\u3002\\u60A8\\u53EF\\u4EE5\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthReopen:\"\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\",oauthUnconfirmed:\"\\u6682\\u65F6\\u65E0\\u6CD5\\u786E\\u8BA4\\u767B\\u5F55\\u7ED3\\u679C\\u3002\\u8BF7\\u5148\\u91CD\\u65B0\\u52A0\\u8F7D\\u9875\\u9762\\u68C0\\u67E5\\u767B\\u5F55\\u72B6\\u6001\\uFF0C\\u518D\\u51B3\\u5B9A\\u662F\\u5426\\u91CD\\u8BD5\\u3002\",oauthCheckSession:\"\\u91CD\\u65B0\\u52A0\\u8F7D\\u5E76\\u68C0\\u67E5\\u767B\\u5F55\\u72B6\\u6001\",oauthCancelled:\"\\u5DF2\\u505C\\u6B62\\u7B49\\u5F85\\u767B\\u5F55\\u3002\\u82E5\\u6388\\u6743\\u7A97\\u53E3\\u4ECD\\u7136\\u6253\\u5F00\\uFF0C\\u8BF7\\u5173\\u95ED\\u540E\\u518D\\u91CD\\u8BD5\\u3002\",oauthDenied:\"\\u60A8\\u672A\\u540C\\u610F\\u6388\\u6743\\u3002\\u53EF\\u4EE5\\u91CD\\u8BD5\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\\u3002\",oauthBlocked:\"\\u6D4F\\u89C8\\u5668\\u62E6\\u622A\\u4E86\\u767B\\u5F55\\u7A97\\u53E3\\u3002\\u8BF7\\u91CD\\u65B0\\u6253\\u5F00\\uFF0C\\u6216\\u5728\\u5F53\\u524D\\u9875\\u9762\\u7EE7\\u7EED\\u3002\",oauthTimedOut:\"\\u767B\\u5F55\\u7B49\\u5F85\\u5DF2\\u8D85\\u65F6\\u3002\\u8BF7\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\\u518D\\u8BD5\\u3002\",oauthFailed:\"\\u672A\\u80FD\\u5B8C\\u6210\\u767B\\u5F55\\u3002\\u8BF7\\u91CD\\u8BD5\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthFullPage:\"\\u5728\\u5F53\\u524D\\u9875\\u9762\\u7EE7\\u7EED\",emailEdit:\"\\u4FEE\\u6539\\u90AE\\u7BB1\",emailCooldown:\"{seconds} \\u79D2\\u540E\\u91CD\\u53D1\",walletRetry:\"\\u94B1\\u5305\\u672A\\u6253\\u5F00\\uFF1F\\u8BF7\\u91CD\\u8BD5\\u6216\\u626B\\u63CF\\u4E8C\\u7EF4\\u7801\\u3002\",tryAgain:\"\\u91CD\\u8BD5\",signIn:\"\\u767B\\u5F55\\u6216\\u521B\\u5EFA\\u8D26\\u6237\",signInTo:\"\\u767B\\u5F55\\u6216\\u52A0\\u5165 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7EE7\\u7EED\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5F55\",passkeyCreate:\"\\u521B\\u5EFA Passkey\",passkeyFirstTime:\"\\u9996\\u6B21\\u4F7F\\u7528\\uFF1F\\u521B\\u5EFA\\u8D26\\u6237\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5F55\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u521B\\u5EFA Passkey\\u2026\",passkeyNoLocal:\"\\u8FD9\\u6B21\\u672A\\u5B8C\\u6210 Passkey \\u9A8C\\u8BC1\\u3002\\u8BF7\\u91CD\\u8BD5\\u3001\\u4F7F\\u7528\\u5176\\u4ED6\\u8BBE\\u5907\\uFF0C\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u8BBE\\u5907\\u767B\\u5F55\",passkeyCreateInstead:\"\\u9996\\u6B21\\u4F7F\\u7528\\uFF1F\\u521B\\u5EFA\\u8D26\\u6237\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7EE7\\u7EED\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8BF7\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",waitingWallet:\"\\u6B63\\u5728\\u8BF7\\u6C42\\u8FDE\\u63A5\",walletContinue:\"\\u8BF7\\u5728 DID Wallet \\u4E2D\\u7EE7\\u7EED\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F93\\u5165\\u540D\\u79F0\\u5E76\\u521B\\u5EFA\\u4E00\\u4E2A\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u4F1A\\u8BDD\\u8D85\\u65F6\\uFF0C\\u8BF7\\u91CD\\u8BD5\\u3002\",refreshQR:\"\\u5237\\u65B0\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u53EF\\u9009\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u90AE\\u7BB1\\u5730\\u5740\",emailButton:\"\\u90AE\\u7BB1\",passkeyUnsupported:\"\\u60A8\\u7684\\u6D4F\\u89C8\\u5668\\u4E0D\\u652F\\u6301 Passkey \\u8BA4\\u8BC1\\u3002\",connecting:\"\\u8FDE\\u63A5\\u4E2D...\",verifying:\"\\u9A8C\\u8BC1\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u6253\\u5F00\",authFailed:\"\\u8BA4\\u8BC1\\u5931\\u8D25\",registrationFailed:\"\\u6CE8\\u518C\\u5931\\u8D25\",passkeySetupFailed:\"Passkey \\u8BBE\\u7F6E\\u5931\\u8D25\",accessDenied:\"\\u8BBF\\u95EE\\u88AB\\u62D2\\u7EDD\\uFF1A\\u60A8\\u7684\\u8D26\\u6237\\u65E0\\u6743\\u767B\\u5F55\\u6B64\\u7AD9\\u70B9\\u3002\",regClosed:\"\\u6CE8\\u518C\\u9700\\u8981\\u9080\\u8BF7\\u3002\",federatedBy:\"\\u8BA4\\u8BC1\\u670D\\u52A1\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u9690\\u79C1\",terms:\"\\u6761\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",emailTitle:\"\\u4F7F\\u7528\\u90AE\\u7BB1\\u7EE7\\u7EED\",emailSubmit:\"\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801\",emailSending:\"\\u6B63\\u5728\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801...\",emailSent:\"\\u9A8C\\u8BC1\\u7801\\u5DF2\\u53D1\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"8 \\u4F4D\\u9A8C\\u8BC1\\u7801\",emailVerify:\"\\u9A8C\\u8BC1\",emailResend:\"\\u91CD\\u65B0\\u53D1\\u9001\",emailInvalid:\"\\u8BF7\\u8F93\\u5165\\u6709\\u6548\\u7684\\u90AE\\u7BB1\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8BF7\\u8F93\\u5165 8 \\u4F4D\\u9A8C\\u8BC1\\u7801\\u3002\"},\"zh-TW\":{emailExplanation:\"\\u6211\\u5011\\u6703\\u50B3\\u9001\\u9A57\\u8B49\\u78BC\\uFF0C\\u7121\\u9700\\u5BC6\\u78BC\\u3002\",otherMethods:\"\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\",passkeyCreateAccount:\"\\u4F7F\\u7528 Passkey \\u5EFA\\u7ACB\\u5E33\\u6236\",lastUsed:\"\\u4E0A\\u6B21\\u4F7F\\u7528\",passkeyExplanation:\"\\u4F7F\\u7528\\u6307\\u7D0B\\u3001\\u9762\\u5BB9\\u6216\\u88DD\\u7F6E\\u89E3\\u9396\\u65B9\\u5F0F\\u5EFA\\u7ACB\\u65B0\\u5E33\\u6236\\uFF0C\\u7121\\u9700\\u5BC6\\u78BC\\u3002\\u88DD\\u7F6E\\u6703\\u63D0\\u793A\\u5132\\u5B58 Passkey\\u3002\\u5DF2\\u6709\\u5E33\\u6236\\uFF1F\\u8ACB\\u8FD4\\u56DE\\u767B\\u5165\\u3002\",continueWith:\"\\u4F7F\\u7528 {provider} \\u7E7C\\u7E8C\",oauthWaiting:\"\\u8ACB\\u5728 {provider} \\u8996\\u7A97\\u4E2D\\u7E7C\\u7E8C\",oauthIncomplete:\"\\u767B\\u5165\\u5C1A\\u672A\\u5B8C\\u6210\\u3002\\u60A8\\u53EF\\u4EE5\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthReopen:\"\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\",oauthUnconfirmed:\"\\u66AB\\u6642\\u7121\\u6CD5\\u78BA\\u8A8D\\u767B\\u5165\\u7D50\\u679C\\u3002\\u8ACB\\u5148\\u91CD\\u65B0\\u8F09\\u5165\\u9801\\u9762\\u6AA2\\u67E5\\u767B\\u5165\\u72C0\\u614B\\uFF0C\\u518D\\u6C7A\\u5B9A\\u662F\\u5426\\u91CD\\u8A66\\u3002\",oauthCheckSession:\"\\u91CD\\u65B0\\u8F09\\u5165\\u4E26\\u6AA2\\u67E5\\u767B\\u5165\\u72C0\\u614B\",oauthCancelled:\"\\u5DF2\\u505C\\u6B62\\u7B49\\u5F85\\u767B\\u5165\\u3002\\u82E5\\u6388\\u6B0A\\u8996\\u7A97\\u4ECD\\u7136\\u958B\\u555F\\uFF0C\\u8ACB\\u95DC\\u9589\\u5F8C\\u518D\\u91CD\\u8A66\\u3002\",oauthDenied:\"\\u60A8\\u672A\\u540C\\u610F\\u6388\\u6B0A\\u3002\\u53EF\\u4EE5\\u91CD\\u8A66\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\\u3002\",oauthBlocked:\"\\u700F\\u89BD\\u5668\\u5C01\\u9396\\u4E86\\u767B\\u5165\\u8996\\u7A97\\u3002\\u8ACB\\u91CD\\u65B0\\u958B\\u555F\\uFF0C\\u6216\\u5728\\u76EE\\u524D\\u9801\\u9762\\u7E7C\\u7E8C\\u3002\",oauthTimedOut:\"\\u767B\\u5165\\u7B49\\u5F85\\u5DF2\\u903E\\u6642\\u3002\\u8ACB\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\\u518D\\u8A66\\u3002\",oauthFailed:\"\\u672A\\u80FD\\u5B8C\\u6210\\u767B\\u5165\\u3002\\u8ACB\\u91CD\\u8A66\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthFullPage:\"\\u5728\\u76EE\\u524D\\u9801\\u9762\\u7E7C\\u7E8C\",emailEdit:\"\\u4FEE\\u6539\\u96FB\\u5B50\\u90F5\\u4EF6\",emailCooldown:\"{seconds} \\u79D2\\u5F8C\\u91CD\\u65B0\\u50B3\\u9001\",walletRetry:\"\\u9322\\u5305\\u672A\\u958B\\u555F\\uFF1F\\u8ACB\\u91CD\\u8A66\\u6216\\u6383\\u78BC\\u3002\",tryAgain:\"\\u91CD\\u8A66\",signIn:\"\\u767B\\u5165\\u6216\\u5EFA\\u7ACB\\u5E33\\u6236\",signInTo:\"\\u767B\\u5165\\u6216\\u52A0\\u5165 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7E7C\\u7E8C\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5165\",passkeyCreate:\"\\u5EFA\\u7ACB Passkey\",passkeyFirstTime:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u5EFA\\u7ACB\\u5E33\\u6236\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5165\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u5EFA\\u7ACB Passkey\\u2026\",passkeyNoLocal:\"\\u9019\\u6B21\\u672A\\u5B8C\\u6210 Passkey \\u9A57\\u8B49\\u3002\\u8ACB\\u91CD\\u8A66\\u3001\\u4F7F\\u7528\\u5176\\u4ED6\\u88DD\\u7F6E\\uFF0C\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u88DD\\u7F6E\\u767B\\u5165\",passkeyCreateInstead:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u5EFA\\u7ACB\\u5E33\\u6236\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7E7C\\u7E8C\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8ACB\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",waitingWallet:\"\\u6B63\\u5728\\u8981\\u6C42\\u9023\\u7DDA\",walletContinue:\"\\u8ACB\\u5728 DID Wallet \\u4E2D\\u7E7C\\u7E8C\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F38\\u5165\\u540D\\u7A31\\u4E26\\u5EFA\\u7ACB\\u4E00\\u500B\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u5DE5\\u4F5C\\u968E\\u6BB5\\u903E\\u6642\\uFF0C\\u8ACB\\u91CD\\u8A66\\u3002\",refreshQR:\"\\u91CD\\u65B0\\u6574\\u7406\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u9078\\u586B\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\",emailButton:\"\\u96FB\\u5B50\\u90F5\\u4EF6\",passkeyUnsupported:\"\\u60A8\\u7684\\u700F\\u89BD\\u5668\\u4E0D\\u652F\\u63F4 Passkey \\u8A8D\\u8B49\\u3002\",connecting:\"\\u9023\\u7DDA\\u4E2D...\",verifying:\"\\u9A57\\u8B49\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u958B\\u555F\",authFailed:\"\\u8A8D\\u8B49\\u5931\\u6557\",registrationFailed:\"\\u8A3B\\u518A\\u5931\\u6557\",passkeySetupFailed:\"Passkey \\u8A2D\\u5B9A\\u5931\\u6557\",accessDenied:\"\\u5B58\\u53D6\\u88AB\\u62D2\\u7D55\\uFF1A\\u60A8\\u7684\\u5E33\\u865F\\u7121\\u6B0A\\u767B\\u5165\\u6B64\\u7DB2\\u7AD9\\u3002\",regClosed:\"\\u8A3B\\u518A\\u9700\\u8981\\u9080\\u8ACB\\u3002\",federatedBy:\"\\u8A8D\\u8B49\\u670D\\u52D9\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u96B1\\u79C1\",terms:\"\\u689D\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",emailTitle:\"\\u4F7F\\u7528\\u96FB\\u5B50\\u90F5\\u4EF6\\u7E7C\\u7E8C\",emailSubmit:\"\\u50B3\\u9001\\u9A57\\u8B49\\u78BC\",emailSending:\"\\u6B63\\u5728\\u50B3\\u9001\\u9A57\\u8B49\\u78BC...\",emailSent:\"\\u9A57\\u8B49\\u78BC\\u5DF2\\u50B3\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"8 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\",emailVerify:\"\\u9A57\\u8B49\",emailResend:\"\\u91CD\\u65B0\\u50B3\\u9001\",emailInvalid:\"\\u8ACB\\u8F38\\u5165\\u6709\\u6548\\u7684\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8ACB\\u8F38\\u5165 8 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\\u3002\"},ja:{emailExplanation:\"\\u78BA\\u8A8D\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u307E\\u3059\\u3002\\u30D1\\u30B9\\u30EF\\u30FC\\u30C9\\u306F\\u4E0D\\u8981\\u3067\\u3059\\u3002\",otherMethods:\"\\u4ED6\\u306E\\u30ED\\u30B0\\u30A4\\u30F3\\u65B9\\u6CD5\",passkeyCreateAccount:\"Passkey \\u3067\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",lastUsed:\"\\u524D\\u56DE\\u4F7F\\u7528\",passkeyExplanation:\"\\u6307\\u7D0B\\u3001\\u9854\\u8A8D\\u8A3C\\u3001\\u307E\\u305F\\u306F\\u30C7\\u30D0\\u30A4\\u30B9\\u306E\\u30ED\\u30C3\\u30AF\\u89E3\\u9664\\u3067\\u65B0\\u3057\\u3044\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\\u3057\\u307E\\u3059\\u3002\\u30D1\\u30B9\\u30EF\\u30FC\\u30C9\\u306F\\u4E0D\\u8981\\u3067\\u3059\\u3002\\u30C7\\u30D0\\u30A4\\u30B9\\u304C Passkey \\u306E\\u4FDD\\u5B58\\u3092\\u6C42\\u3081\\u307E\\u3059\\u3002\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u304A\\u6301\\u3061\\u3067\\u3059\\u304B\\uFF1F\\u30ED\\u30B0\\u30A4\\u30F3\\u306B\\u623B\\u3063\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",continueWith:\"{provider} \\u3067\\u7D9A\\u3051\\u308B\",oauthWaiting:\"{provider} \\u306E\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3067\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\",oauthIncomplete:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306F\\u307E\\u3060\\u5B8C\\u4E86\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3059\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthReopen:\"\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3059\",oauthUnconfirmed:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u7D50\\u679C\\u3092\\u78BA\\u8A8D\\u3067\\u304D\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u306E\\u524D\\u306B\\u30DA\\u30FC\\u30B8\\u3092\\u518D\\u8AAD\\u307F\\u8FBC\\u307F\\u3057\\u3066\\u72B6\\u614B\\u3092\\u78BA\\u8A8D\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthCheckSession:\"\\u518D\\u8AAD\\u307F\\u8FBC\\u307F\\u3057\\u3066\\u30ED\\u30B0\\u30A4\\u30F3\\u3092\\u78BA\\u8A8D\",oauthCancelled:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306E\\u5F85\\u6A5F\\u3092\\u7D42\\u4E86\\u3057\\u307E\\u3057\\u305F\\u3002\\u8A8D\\u8A3C\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u304C\\u958B\\u3044\\u3066\\u3044\\u308B\\u5834\\u5408\\u306F\\u3001\\u9589\\u3058\\u3066\\u304B\\u3089\\u518D\\u8A66\\u884C\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthDenied:\"\\u8A8D\\u8A3C\\u304C\\u8A31\\u53EF\\u3055\\u308C\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthBlocked:\"\\u30D6\\u30E9\\u30A6\\u30B6\\u304C\\u30ED\\u30B0\\u30A4\\u30F3\\u753B\\u9762\\u3092\\u30D6\\u30ED\\u30C3\\u30AF\\u3057\\u307E\\u3057\\u305F\\u3002\\u958B\\u304D\\u76F4\\u3059\\u304B\\u3001\\u3053\\u306E\\u30DA\\u30FC\\u30B8\\u3067\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthTimedOut:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u304C\\u30BF\\u30A4\\u30E0\\u30A2\\u30A6\\u30C8\\u3057\\u307E\\u3057\\u305F\\u3002\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthFailed:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u3092\\u5B8C\\u4E86\\u3067\\u304D\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthFullPage:\"\\u3053\\u306E\\u30DA\\u30FC\\u30B8\\u3067\\u7D9A\\u3051\\u308B\",emailEdit:\"\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\\u3092\\u5909\\u66F4\",emailCooldown:\"{seconds} \\u79D2\\u5F8C\\u306B\\u518D\\u9001\\u4FE1\",walletRetry:\"\\u30A6\\u30A9\\u30EC\\u30C3\\u30C8\\u304C\\u958B\\u304B\\u306A\\u3044\\u5834\\u5408\\u306F\\u3001\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B QR \\u30B3\\u30FC\\u30C9\\u3092\\u30B9\\u30AD\\u30E3\\u30F3\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",tryAgain:\"\\u518D\\u8A66\\u884C\",signIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u307E\\u305F\\u306F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u4F5C\\u6210\",signInTo:\"{appName} \\u306B\\u30ED\\u30B0\\u30A4\\u30F3\\u307E\\u305F\\u306F\\u53C2\\u52A0\",passkeyButton:\"Passkey \\u3067\\u7D9A\\u3051\\u308B\",passkeySignIn:\"Passkey \\u3067\\u30ED\\u30B0\\u30A4\\u30F3\",passkeyCreate:\"Passkey \\u3092\\u4F5C\\u6210\",passkeyFirstTime:\"\\u521D\\u3081\\u3066\\u3067\\u3059\\u304B\\uFF1F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",passkeyBackToSignIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306B\\u623B\\u308B\",passkeyWaiting:\"Passkey \\u3092\\u5F85\\u3063\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyCreating:\"Passkey \\u3092\\u4F5C\\u6210\\u3057\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyNoLocal:\"\\u4ECA\\u56DE\\u306F Passkey \\u306E\\u78BA\\u8A8D\\u304C\\u5B8C\\u4E86\\u3057\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B\\u3001\\u5225\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u3092\\u4F7F\\u3046\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",passkeyUseAnotherDevice:\"\\u5225\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u3092\\u4F7F\\u7528\",passkeyCreateInstead:\"\\u521D\\u3081\\u3066\\u3067\\u3059\\u304B\\uFF1F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",didWalletButton:\"DID Wallet \\u3067\\u7D9A\\u3051\\u308B\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\",waitingWallet:\"\\u63A5\\u7D9A\\u3092\\u8981\\u6C42\\u3057\\u3066\\u3044\\u307E\\u3059\",walletContinue:\"DID Wallet \\u3067\\u64CD\\u4F5C\\u3092\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\",noPasskey:\"\\u65E2\\u5B58\\u306E Passkey \\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093\\u3002\\u540D\\u524D\\u3092\\u5165\\u529B\\u3057\\u3066\\u4F5C\\u6210\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",success:\"\\u6210\\u529F\\u3057\\u307E\\u3057\\u305F\",timeout:\"\\u30BB\\u30C3\\u30B7\\u30E7\\u30F3\\u304C\\u30BF\\u30A4\\u30E0\\u30A2\\u30A6\\u30C8\\u3057\\u307E\\u3057\\u305F\\u3002\\u3082\\u3046\\u4E00\\u5EA6\\u304A\\u8A66\\u3057\\u304F\\u3060\\u3055\\u3044\\u3002\",refreshQR:\"\\u66F4\\u65B0\",namePlaceholder:\"\\u304A\\u540D\\u524D\\uFF08\\u4EFB\\u610F\\uFF09\",or:\"\\u307E\\u305F\\u306F\",emailPlaceholder:\"\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\",emailButton:\"\\u30E1\\u30FC\\u30EB\",passkeyUnsupported:\"\\u304A\\u4F7F\\u3044\\u306E\\u30D6\\u30E9\\u30A6\\u30B6\\u30FC\\u306F Passkey \\u8A8D\\u8A3C\\u3092\\u30B5\\u30DD\\u30FC\\u30C8\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002\",connecting:\"\\u63A5\\u7D9A\\u3057\\u3066\\u3044\\u307E\\u3059...\",verifying:\"\\u78BA\\u8A8D\\u3057\\u3066\\u3044\\u307E\\u3059...\",openInWallet:\"DID Wallet \\u3067\\u958B\\u304F\",authFailed:\"\\u8A8D\\u8A3C\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",registrationFailed:\"\\u767B\\u9332\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",passkeySetupFailed:\"Passkey \\u306E\\u8A2D\\u5B9A\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",accessDenied:\"\\u30A2\\u30AF\\u30BB\\u30B9\\u304C\\u62D2\\u5426\\u3055\\u308C\\u307E\\u3057\\u305F\\uFF1A\\u3053\\u306E\\u30B5\\u30A4\\u30C8\\u306B\\u30ED\\u30B0\\u30A4\\u30F3\\u3059\\u308B\\u6A29\\u9650\\u304C\\u3042\\u308A\\u307E\\u305B\\u3093\\u3002\",regClosed:\"\\u767B\\u9332\\u306B\\u306F\\u62DB\\u5F85\\u304C\\u5FC5\\u8981\\u3067\\u3059\\u3002\",federatedBy:\"\\u8A8D\\u8A3C\\u30B5\\u30FC\\u30D3\\u30B9\\u306F {masterName} \\u304C\\u63D0\\u4F9B\\u3057\\u3066\\u3044\\u307E\\u3059\",securedBy:\"DID Connect \\u306B\\u3088\\u308A\\u4FDD\\u8B77\\u3055\\u308C\\u3066\\u3044\\u307E\\u3059\",privacy:\"\\u30D7\\u30E9\\u30A4\\u30D0\\u30B7\\u30FC\",terms:\"\\u5229\\u7528\\u898F\\u7D04\",back:\"\\u623B\\u308B\",cancel:\"\\u30AD\\u30E3\\u30F3\\u30BB\\u30EB\",scanTitle:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\",emailTitle:\"\\u30E1\\u30FC\\u30EB\\u3067\\u7D9A\\u3051\\u308B\",emailSubmit:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\",emailSending:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u3066\\u3044\\u307E\\u3059...\",emailSent:\"{email} \\u306B 8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u307E\\u3057\\u305F\",emailCodePlaceholder:\"8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\",emailVerify:\"\\u78BA\\u8A8D\",emailResend:\"\\u30B3\\u30FC\\u30C9\\u3092\\u518D\\u9001\\u4FE1\",emailInvalid:\"\\u6709\\u52B9\\u306A\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",emailCodeInvalid:\"8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\"}},pe=[{code:\"en\",label:\"English\"},{code:\"zh\",label:\"\\u4E2D\\u6587\"}];function b(t,e,r){let n=e&&he[e]?e:\"en\",i=he[n][t]??he.en[t]??t;if(r)for(let[a,s]of Object.entries(r))i=i.replace(new RegExp(`\\\\{${a}\\\\}`,\"g\"),s);return i}var fe='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M3 20v-2.8q0-.85.438-1.562T4.6 14.55q1.55-.775 3.15-1.162T11 13q.5 0 1 .038t1 .112q-.1 1.45.525 2.738T15.35 18v2zm16 3l-1.5-1.5v-4.65q-1.1-.325-1.8-1.237T15 13.5q0-1.45 1.025-2.475T18.5 10t2.475 1.025T22 13.5q0 1.125-.638 2t-1.612 1.25L21 18l-1.5 1.5L21 21zm-8-11q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m7.5 2q.425 0 .713-.288T19.5 13t-.288-.712T18.5 12t-.712.288T17.5 13t.288.713t.712.287\"/></svg>',ve='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"3\" fill=\"#4598FA\"/><rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\" fill=\"white\" opacity=\"0.9\"/><rect x=\"0\" y=\"14\" width=\"24\" height=\"10\" rx=\"0\" fill=\"url(#dw_g)\"/><path d=\"M5.5 9.5h4.5c.3 0 .5.2.5.5v2.5c0 .3-.2.5-.5.5H5.5c-.3 0-.5-.2-.5-.5V10c0-.3.2-.5.5-.5z\" fill=\"#4598FA\"/><defs><linearGradient id=\"dw_g\" x1=\"12\" y1=\"14\" x2=\"12\" y2=\"24\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#77B2F6\"/><stop offset=\"1\" stop-color=\"#4598FA\"/></linearGradient></defs></svg>',qe='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M22 7.535V17a3 3 0 0 1-2.824 2.995L19 20H5a3 3 0 0 1-2.995-2.824L2 17V7.535l9.445 6.297l.116.066a1 1 0 0 0 .878 0l.116-.066z\"/><path fill=\"currentColor\" d=\"M19 4c1.08 0 2.027.57 2.555 1.427L12 11.797l-9.555-6.37a2.999 2.999 0 0 1 2.354-1.42L5 4z\"/></svg>',Ve='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 1L3 5v6c0 5.55 3.84 10.74 9 12c5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z\"/></svg>',ke='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z\"/></svg>',je={google:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 262\"><path fill=\"#4285F4\" d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"/><path fill=\"#34A853\" d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"/><path fill=\"#FBBC05\" d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z\"/><path fill=\"#EB4335\" d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"/></svg>',github:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 250\" fill=\"currentColor\"><path d=\"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0\"/></svg>',apple:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 315\" fill=\"currentColor\"><path d=\"M213.803 167.03c.442 47.58 41.74 63.413 42.197 63.615c-.35 1.116-6.599 22.563-21.757 44.716c-13.104 19.153-26.705 38.235-48.13 38.63c-21.05.388-27.82-12.483-51.888-12.483c-24.061 0-31.582 12.088-51.51 12.871c-20.68.783-36.428-20.71-49.64-39.793c-27-39.033-47.633-110.3-19.928-158.406c13.763-23.89 38.36-39.017 65.056-39.405c20.307-.388 39.475 13.675 51.889 13.675c12.406 0 35.699-16.895 60.186-14.414c10.25.427 39.026 4.14 57.503 31.186c-1.49.923-34.335 20.044-33.978 59.808M174.24 50.199c10.98-13.29 18.369-31.79 16.353-50.199c-15.826.636-34.962 10.546-46.314 23.828c-10.173 11.763-19.082 30.589-16.678 48.633c17.64 1.365 35.66-8.964 46.639-22.262\"/></svg>',twitter:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M149.079 108.399L242.33 0h-22.098l-80.97 94.12L74.59 0H0l97.796 142.328L0 256h22.1l85.507-99.395L175.905 256h74.59L149.073 108.399zM118.81 143.58l-9.909-14.172l-78.84-112.773h33.943l63.625 91.011l9.909 14.173l82.705 118.3H186.3l-67.49-96.533z\"/></svg>',auth0:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#EB5424\" d=\"M203.97 200.38L167.47 88l-39.5 112.38h75.98zm0-144.76L167.47 168l75.97-26.16l19.76-60.82c6.64-20.4-1.94-42.72-21.18-52.76l-38.06 27.36zM52.03 55.62L88.54 168l39.5-112.38H52.02zM52.03 200.38L88.54 88L12.56 114.16l-5.92 18.2c-6.64 20.4 1.94 42.72 21.18 52.76l24.2-17.38l.01.01v-.01l-.01.01.01-.37z\"/></svg>',facebook:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#1877F2\" d=\"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445\"/></svg>'},Be='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41c0 2.08-.8 3.97-2.1 5.39\"/></svg>';function Ye(t){return je[t.toLowerCase()]??\"\"}var Z=function(t,e){let i=t,a=re[e],s=null,o=0,c=null,l=[],f={},p=function(d,m){o=i*4+17,s=(function(h){let g=new Array(h);for(let y=0;y<h;y+=1){g[y]=new Array(h);for(let x=0;x<h;x+=1)g[y][x]=null}return g})(o),u(0,0),u(o-7,0),u(0,o-7),D(),v(),F(d,m),i>=7&&C(d),c==null&&(c=W(i,a,l)),B(c,m)},u=function(d,m){for(let h=-1;h<=7;h+=1)if(!(d+h<=-1||o<=d+h))for(let g=-1;g<=7;g+=1)m+g<=-1||o<=m+g||(0<=h&&h<=6&&(g==0||g==6)||0<=g&&g<=6&&(h==0||h==6)||2<=h&&h<=4&&2<=g&&g<=4?s[d+h][m+g]=!0:s[d+h][m+g]=!1)},E=function(){let d=0,m=0;for(let h=0;h<8;h+=1){p(!0,h);let g=Q.getLostPoint(f);(h==0||d>g)&&(d=g,m=h)}return m},v=function(){for(let d=8;d<o-8;d+=1)s[d][6]==null&&(s[d][6]=d%2==0);for(let d=8;d<o-8;d+=1)s[6][d]==null&&(s[6][d]=d%2==0)},D=function(){let d=Q.getPatternPosition(i);for(let m=0;m<d.length;m+=1)for(let h=0;h<d.length;h+=1){let g=d[m],y=d[h];if(s[g][y]==null)for(let x=-2;x<=2;x+=1)for(let w=-2;w<=2;w+=1)x==-2||x==2||w==-2||w==2||x==0&&w==0?s[g+x][y+w]=!0:s[g+x][y+w]=!1}},C=function(d){let m=Q.getBCHTypeNumber(i);for(let h=0;h<18;h+=1){let g=!d&&(m>>h&1)==1;s[Math.floor(h/3)][h%3+o-8-3]=g}for(let h=0;h<18;h+=1){let g=!d&&(m>>h&1)==1;s[h%3+o-8-3][Math.floor(h/3)]=g}},F=function(d,m){let h=a<<3|m,g=Q.getBCHTypeInfo(h);for(let y=0;y<15;y+=1){let x=!d&&(g>>y&1)==1;y<6?s[y][8]=x:y<8?s[y+1][8]=x:s[o-15+y][8]=x}for(let y=0;y<15;y+=1){let x=!d&&(g>>y&1)==1;y<8?s[8][o-y-1]=x:y<9?s[8][15-y-1+1]=x:s[8][15-y-1]=x}s[o-8][8]=!d},B=function(d,m){let h=-1,g=o-1,y=7,x=0,w=Q.getMaskFunction(m);for(let T=o-1;T>0;T-=2)for(T==6&&(T-=1);;){for(let S=0;S<2;S+=1)if(s[g][T-S]==null){let P=!1;x<d.length&&(P=(d[x]>>>y&1)==1),w(g,T-S)&&(P=!P),s[g][T-S]=P,y-=1,y==-1&&(x+=1,y=7)}if(g+=h,g<0||o<=g){g-=h,h=-h;break}}},R=function(d,m){let h=0,g=0,y=0,x=new Array(m.length),w=new Array(m.length);for(let k=0;k<m.length;k+=1){let N=m[k].dataCount,A=m[k].totalCount-N;g=Math.max(g,N),y=Math.max(y,A),x[k]=new Array(N);for(let j=0;j<x[k].length;j+=1)x[k][j]=255&d.getBuffer()[j+h];h+=N;let z=Q.getErrorCorrectPolynomial(A),V=ie(x[k],z.getLength()-1).mod(z);w[k]=new Array(z.getLength()-1);for(let j=0;j<w[k].length;j+=1){let ae=j+V.getLength()-w[k].length;w[k][j]=ae>=0?V.getAt(ae):0}}let T=0;for(let k=0;k<m.length;k+=1)T+=m[k].totalCount;let S=new Array(T),P=0;for(let k=0;k<g;k+=1)for(let N=0;N<m.length;N+=1)k<x[N].length&&(S[P]=x[N][k],P+=1);for(let k=0;k<y;k+=1)for(let N=0;N<m.length;N+=1)k<w[N].length&&(S[P]=w[N][k],P+=1);return S},W=function(d,m,h){let g=Ae.getRSBlocks(d,m),y=De();for(let w=0;w<h.length;w+=1){let T=h[w];y.put(T.getMode(),4),y.put(T.getLength(),Q.getLengthInBits(T.getMode(),d)),T.write(y)}let x=0;for(let w=0;w<g.length;w+=1)x+=g[w].dataCount;if(y.getLengthInBits()>x*8)throw\"code length overflow. (\"+y.getLengthInBits()+\">\"+x*8+\")\";for(y.getLengthInBits()+4<=x*8&&y.put(0,4);y.getLengthInBits()%8!=0;)y.putBit(!1);for(;!(y.getLengthInBits()>=x*8||(y.put(236,8),y.getLengthInBits()>=x*8));)y.put(17,8);return R(y,g)};f.addData=function(d,m){m=m||\"Byte\";let h=null;switch(m){case\"Numeric\":h=Qe(d);break;case\"Alphanumeric\":h=Ge(d);break;case\"Byte\":h=Je(d);break;case\"Kanji\":h=Xe(d);break;default:throw\"mode:\"+m}l.push(h),c=null},f.isDark=function(d,m){if(d<0||o<=d||m<0||o<=m)throw d+\",\"+m;return s[d][m]},f.getModuleCount=function(){return o},f.make=function(){if(i<1){let d=1;for(;d<40;d++){let m=Ae.getRSBlocks(d,a),h=De();for(let y=0;y<l.length;y++){let x=l[y];h.put(x.getMode(),4),h.put(x.getLength(),Q.getLengthInBits(x.getMode(),d)),x.write(h)}let g=0;for(let y=0;y<m.length;y++)g+=m[y].dataCount;if(h.getLengthInBits()<=g*8)break}i=d}p(!1,E())},f.createTableTag=function(d,m){d=d||2,m=typeof m>\"u\"?d*4:m;let h=\"\";h+='<table style=\"',h+=\" border-width: 0px; border-style: none;\",h+=\" border-collapse: collapse;\",h+=\" padding: 0px; margin: \"+m+\"px;\",h+='\">',h+=\"<tbody>\";for(let g=0;g<f.getModuleCount();g+=1){h+=\"<tr>\";for(let y=0;y<f.getModuleCount();y+=1)h+='<td style=\"',h+=\" border-width: 0px; border-style: none;\",h+=\" border-collapse: collapse;\",h+=\" padding: 0px; margin: 0px;\",h+=\" width: \"+d+\"px;\",h+=\" height: \"+d+\"px;\",h+=\" background-color: \",h+=f.isDark(g,y)?\"#000000\":\"#ffffff\",h+=\";\",h+='\"/>';h+=\"</tr>\"}return h+=\"</tbody>\",h+=\"</table>\",h},f.createSvgTag=function(d,m,h,g){let y={};typeof arguments[0]==\"object\"&&(y=arguments[0],d=y.cellSize,m=y.margin,h=y.alt,g=y.title),d=d||2,m=typeof m>\"u\"?d*4:m,h=typeof h==\"string\"?{text:h}:h||{},h.text=h.text||null,h.id=h.text?h.id||\"qrcode-description\":null,g=typeof g==\"string\"?{text:g}:g||{},g.text=g.text||null,g.id=g.text?g.id||\"qrcode-title\":null;let x=f.getModuleCount()*d+m*2,w,T,S,P,k=\"\",N;for(N=\"l\"+d+\",0 0,\"+d+\" -\"+d+\",0 0,-\"+d+\"z \",k+='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"',k+=y.scalable?\"\":' width=\"'+x+'px\" height=\"'+x+'px\"',k+=' viewBox=\"0 0 '+x+\" \"+x+'\" ',k+=' preserveAspectRatio=\"xMinYMin meet\"',k+=g.text||h.text?' role=\"img\" aria-labelledby=\"'+L([g.id,h.id].join(\" \").trim())+'\"':\"\",k+=\">\",k+=g.text?'<title id=\"'+L(g.id)+'\">'+L(g.text)+\"</title>\":\"\",k+=h.text?'<description id=\"'+L(h.id)+'\">'+L(h.text)+\"</description>\":\"\",k+='<rect width=\"100%\" height=\"100%\" fill=\"white\" cx=\"0\" cy=\"0\"/>',k+='<path d=\"',S=0;S<f.getModuleCount();S+=1)for(P=S*d+m,w=0;w<f.getModuleCount();w+=1)f.isDark(S,w)&&(T=w*d+m,k+=\"M\"+T+\",\"+P+N);return k+='\" stroke=\"transparent\" fill=\"black\"/>',k+=\"</svg>\",k},f.createDataURL=function(d,m){d=d||2,m=typeof m>\"u\"?d*4:m;let h=f.getModuleCount()*d+m*2,g=m,y=h-m;return nt(h,h,function(x,w){if(g<=x&&x<y&&g<=w&&w<y){let T=Math.floor((x-g)/d),S=Math.floor((w-g)/d);return f.isDark(S,T)?0:1}else return 1})},f.createImgTag=function(d,m,h){d=d||2,m=typeof m>\"u\"?d*4:m;let g=f.getModuleCount()*d+m*2,y=\"\";return y+=\"<img\",y+=' src=\"',y+=f.createDataURL(d,m),y+='\"',y+=' width=\"',y+=g,y+='\"',y+=' height=\"',y+=g,y+='\"',h&&(y+=' alt=\"',y+=L(h),y+='\"'),y+=\"/>\",y};let L=function(d){let m=\"\";for(let h=0;h<d.length;h+=1){let g=d.charAt(h);switch(g){case\"<\":m+=\"<\";break;case\">\":m+=\">\";break;case\"&\":m+=\"&\";break;case'\"':m+=\""\";break;default:m+=g;break}}return m},I=function(d){d=typeof d>\"u\"?2:d;let h=f.getModuleCount()*1+d*2,g=d,y=h-d,x,w,T,S,P,k={\"\\u2588\\u2588\":\"\\u2588\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\"\\u2584\",\" \":\" \"},N={\"\\u2588\\u2588\":\"\\u2580\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\" \",\" \":\" \"},A=\"\";for(x=0;x<h;x+=2){for(T=Math.floor((x-g)/1),S=Math.floor((x+1-g)/1),w=0;w<h;w+=1)P=\"\\u2588\",g<=w&&w<y&&g<=x&&x<y&&f.isDark(T,Math.floor((w-g)/1))&&(P=\" \"),g<=w&&w<y&&g<=x+1&&x+1<y&&f.isDark(S,Math.floor((w-g)/1))?P+=\" \":P+=\"\\u2588\",A+=d<1&&x+1>=y?N[P]:k[P];A+=`\n`}return h%2&&d>0?A.substring(0,A.length-h-1)+Array(h+1).join(\"\\u2580\"):A.substring(0,A.length-1)};return f.createASCII=function(d,m){if(d=d||1,d<2)return I(m);d-=1,m=typeof m>\"u\"?d*2:m;let h=f.getModuleCount()*d+m*2,g=m,y=h-m,x,w,T,S,P=Array(d+1).join(\"\\u2588\\u2588\"),k=Array(d+1).join(\" \"),N=\"\",A=\"\";for(x=0;x<h;x+=1){for(T=Math.floor((x-g)/d),A=\"\",w=0;w<h;w+=1)S=1,g<=w&&w<y&&g<=x&&x<y&&f.isDark(T,Math.floor((w-g)/d))&&(S=0),A+=S?P:k;for(T=0;T<d;T+=1)N+=A+`\n`}return N.substring(0,N.length-1)},f.renderTo2dContext=function(d,m){m=m||2;let h=f.getModuleCount();for(let g=0;g<h;g++)for(let y=0;y<h;y++)d.fillStyle=f.isDark(g,y)?\"black\":\"white\",d.fillRect(y*m,g*m,m,m)},f};Z.stringToBytes=function(t){let e=[];for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);e.push(n&255)}return e};Z.createStringToBytes=function(t,e){let r=(function(){let i=et(t),a=function(){let c=i.read();if(c==-1)throw\"eof\";return c},s=0,o={};for(;;){let c=i.read();if(c==-1)break;let l=a(),f=a(),p=a(),u=String.fromCharCode(c<<8|l),E=f<<8|p;o[u]=E,s+=1}if(s!=e)throw s+\" != \"+e;return o})(),n=63;return function(i){let a=[];for(let s=0;s<i.length;s+=1){let o=i.charCodeAt(s);if(o<128)a.push(o);else{let c=r[i.charAt(s)];typeof c==\"number\"?(c&255)==c?a.push(c):(a.push(c>>>8),a.push(c&255)):a.push(n)}}return a}};var H={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},re={L:1,M:0,Q:3,H:2},Y={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Q=(function(){let t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e=1335,r=7973,n=21522,i={},a=function(s){let o=0;for(;s!=0;)o+=1,s>>>=1;return o};return i.getBCHTypeInfo=function(s){let o=s<<10;for(;a(o)-a(e)>=0;)o^=e<<a(o)-a(e);return(s<<10|o)^n},i.getBCHTypeNumber=function(s){let o=s<<12;for(;a(o)-a(r)>=0;)o^=r<<a(o)-a(r);return s<<12|o},i.getPatternPosition=function(s){return t[s-1]},i.getMaskFunction=function(s){switch(s){case Y.PATTERN000:return function(o,c){return(o+c)%2==0};case Y.PATTERN001:return function(o,c){return o%2==0};case Y.PATTERN010:return function(o,c){return c%3==0};case Y.PATTERN011:return function(o,c){return(o+c)%3==0};case Y.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case Y.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case Y.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case Y.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw\"bad maskPattern:\"+s}},i.getErrorCorrectPolynomial=function(s){let o=ie([1],0);for(let c=0;c<s;c+=1)o=o.multiply(ie([1,G.gexp(c)],0));return o},i.getLengthInBits=function(s,o){if(1<=o&&o<10)switch(s){case H.MODE_NUMBER:return 10;case H.MODE_ALPHA_NUM:return 9;case H.MODE_8BIT_BYTE:return 8;case H.MODE_KANJI:return 8;default:throw\"mode:\"+s}else if(o<27)switch(s){case H.MODE_NUMBER:return 12;case H.MODE_ALPHA_NUM:return 11;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 10;default:throw\"mode:\"+s}else if(o<41)switch(s){case H.MODE_NUMBER:return 14;case H.MODE_ALPHA_NUM:return 13;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 12;default:throw\"mode:\"+s}else throw\"type:\"+o},i.getLostPoint=function(s){let o=s.getModuleCount(),c=0;for(let p=0;p<o;p+=1)for(let u=0;u<o;u+=1){let E=0,v=s.isDark(p,u);for(let D=-1;D<=1;D+=1)if(!(p+D<0||o<=p+D))for(let C=-1;C<=1;C+=1)u+C<0||o<=u+C||D==0&&C==0||v==s.isDark(p+D,u+C)&&(E+=1);E>5&&(c+=3+E-5)}for(let p=0;p<o-1;p+=1)for(let u=0;u<o-1;u+=1){let E=0;s.isDark(p,u)&&(E+=1),s.isDark(p+1,u)&&(E+=1),s.isDark(p,u+1)&&(E+=1),s.isDark(p+1,u+1)&&(E+=1),(E==0||E==4)&&(c+=3)}for(let p=0;p<o;p+=1)for(let u=0;u<o-6;u+=1)s.isDark(p,u)&&!s.isDark(p,u+1)&&s.isDark(p,u+2)&&s.isDark(p,u+3)&&s.isDark(p,u+4)&&!s.isDark(p,u+5)&&s.isDark(p,u+6)&&(c+=40);for(let p=0;p<o;p+=1)for(let u=0;u<o-6;u+=1)s.isDark(u,p)&&!s.isDark(u+1,p)&&s.isDark(u+2,p)&&s.isDark(u+3,p)&&s.isDark(u+4,p)&&!s.isDark(u+5,p)&&s.isDark(u+6,p)&&(c+=40);let l=0;for(let p=0;p<o;p+=1)for(let u=0;u<o;u+=1)s.isDark(u,p)&&(l+=1);let f=Math.abs(100*l/o/o-50)/5;return c+=f*10,c},i})(),G=(function(){let t=new Array(256),e=new Array(256);for(let n=0;n<8;n+=1)t[n]=1<<n;for(let n=8;n<256;n+=1)t[n]=t[n-4]^t[n-5]^t[n-6]^t[n-8];for(let n=0;n<255;n+=1)e[t[n]]=n;let r={};return r.glog=function(n){if(n<1)throw\"glog(\"+n+\")\";return e[n]},r.gexp=function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return t[n]},r})(),ie=function(t,e){if(typeof t.length>\"u\")throw t.length+\"/\"+e;let r=(function(){let i=0;for(;i<t.length&&t[i]==0;)i+=1;let a=new Array(t.length-i+e);for(let s=0;s<t.length-i;s+=1)a[s]=t[s+i];return a})(),n={};return n.getAt=function(i){return r[i]},n.getLength=function(){return r.length},n.multiply=function(i){let a=new Array(n.getLength()+i.getLength()-1);for(let s=0;s<n.getLength();s+=1)for(let o=0;o<i.getLength();o+=1)a[s+o]^=G.gexp(G.glog(n.getAt(s))+G.glog(i.getAt(o)));return ie(a,0)},n.mod=function(i){if(n.getLength()-i.getLength()<0)return n;let a=G.glog(n.getAt(0))-G.glog(i.getAt(0)),s=new Array(n.getLength());for(let o=0;o<n.getLength();o+=1)s[o]=n.getAt(o);for(let o=0;o<i.getLength();o+=1)s[o]^=G.gexp(G.glog(i.getAt(o))+a);return ie(s,0).mod(i)},n},Ae=(function(){let t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(i,a){let s={};return s.totalCount=i,s.dataCount=a,s},r={},n=function(i,a){switch(a){case re.L:return t[(i-1)*4+0];case re.M:return t[(i-1)*4+1];case re.Q:return t[(i-1)*4+2];case re.H:return t[(i-1)*4+3];default:return}};return r.getRSBlocks=function(i,a){let s=n(i,a);if(typeof s>\"u\")throw\"bad rs block @ typeNumber:\"+i+\"/errorCorrectionLevel:\"+a;let o=s.length/3,c=[];for(let l=0;l<o;l+=1){let f=s[l*3+0],p=s[l*3+1],u=s[l*3+2];for(let E=0;E<f;E+=1)c.push(e(p,u))}return c},r})(),De=function(){let t=[],e=0,r={};return r.getBuffer=function(){return t},r.getAt=function(n){let i=Math.floor(n/8);return(t[i]>>>7-n%8&1)==1},r.put=function(n,i){for(let a=0;a<i;a+=1)r.putBit((n>>>i-a-1&1)==1)},r.getLengthInBits=function(){return e},r.putBit=function(n){let i=Math.floor(e/8);t.length<=i&&t.push(0),n&&(t[i]|=128>>>e%8),e+=1},r},Qe=function(t){let e=H.MODE_NUMBER,r=t,n={};n.getMode=function(){return e},n.getLength=function(s){return r.length},n.write=function(s){let o=r,c=0;for(;c+2<o.length;)s.put(i(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?s.put(i(o.substring(c,c+1)),4):o.length-c==2&&s.put(i(o.substring(c,c+2)),7))};let i=function(s){let o=0;for(let c=0;c<s.length;c+=1)o=o*10+a(s.charAt(c));return o},a=function(s){if(\"0\"<=s&&s<=\"9\")return s.charCodeAt(0)-48;throw\"illegal char :\"+s};return n},Ge=function(t){let e=H.MODE_ALPHA_NUM,r=t,n={};n.getMode=function(){return e},n.getLength=function(a){return r.length},n.write=function(a){let s=r,o=0;for(;o+1<s.length;)a.put(i(s.charAt(o))*45+i(s.charAt(o+1)),11),o+=2;o<s.length&&a.put(i(s.charAt(o)),6)};let i=function(a){if(\"0\"<=a&&a<=\"9\")return a.charCodeAt(0)-48;if(\"A\"<=a&&a<=\"Z\")return a.charCodeAt(0)-65+10;switch(a){case\" \":return 36;case\"$\":return 37;case\"%\":return 38;case\"*\":return 39;case\"+\":return 40;case\"-\":return 41;case\".\":return 42;case\"/\":return 43;case\":\":return 44;default:throw\"illegal char :\"+a}};return n},Je=function(t){let e=H.MODE_8BIT_BYTE,r=t,n=Z.stringToBytes(t),i={};return i.getMode=function(){return e},i.getLength=function(a){return n.length},i.write=function(a){for(let s=0;s<n.length;s+=1)a.put(n[s],8)},i},Xe=function(t){let e=H.MODE_KANJI,r=t,n=Z.stringToBytes;(function(s,o){let c=n(s);if(c.length!=2||(c[0]<<8|c[1])!=o)throw\"sjis not supported.\"})(\"\\u53CB\",38726);let i=n(t),a={};return a.getMode=function(){return e},a.getLength=function(s){return~~(i.length/2)},a.write=function(s){let o=i,c=0;for(;c+1<o.length;){let l=(255&o[c])<<8|255&o[c+1];if(33088<=l&&l<=40956)l-=33088;else if(57408<=l&&l<=60351)l-=49472;else throw\"illegal char at \"+(c+1)+\"/\"+l;l=(l>>>8&255)*192+(l&255),s.put(l,13),c+=2}if(c<o.length)throw\"illegal char at \"+(c+1)},a},Ie=function(){let t=[],e={};return e.writeByte=function(r){t.push(r&255)},e.writeShort=function(r){e.writeByte(r),e.writeByte(r>>>8)},e.writeBytes=function(r,n,i){n=n||0,i=i||r.length;for(let a=0;a<i;a+=1)e.writeByte(r[a+n])},e.writeString=function(r){for(let n=0;n<r.length;n+=1)e.writeByte(r.charCodeAt(n))},e.toByteArray=function(){return t},e.toString=function(){let r=\"\";r+=\"[\";for(let n=0;n<t.length;n+=1)n>0&&(r+=\",\"),r+=t[n];return r+=\"]\",r},e},Ze=function(){let t=0,e=0,r=0,n=\"\",i={},a=function(o){n+=String.fromCharCode(s(o&63))},s=function(o){if(o<0)throw\"n:\"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw\"n:\"+o};return i.writeByte=function(o){for(t=t<<8|o&255,e+=8,r+=1;e>=6;)a(t>>>e-6),e-=6},i.flush=function(){if(e>0&&(a(t<<6-e),t=0,e=0),r%3!=0){let o=3-r%3;for(let c=0;c<o;c+=1)n+=\"=\"}},i.toString=function(){return n},i},et=function(t){let e=t,r=0,n=0,i=0,a={};a.read=function(){for(;i<8;){if(r>=e.length){if(i==0)return-1;throw\"unexpected end of file./\"+i}let c=e.charAt(r);if(r+=1,c==\"=\")return i=0,-1;if(c.match(/^\\s$/))continue;n=n<<6|s(c.charCodeAt(0)),i+=6}let o=n>>>i-8&255;return i-=8,o};let s=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw\"c:\"+o};return a},tt=function(t,e){let r=t,n=e,i=new Array(t*e),a={};a.setPixel=function(l,f,p){i[f*r+l]=p},a.write=function(l){l.writeString(\"GIF87a\"),l.writeShort(r),l.writeShort(n),l.writeByte(128),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(255),l.writeByte(255),l.writeByte(255),l.writeString(\",\"),l.writeShort(0),l.writeShort(0),l.writeShort(r),l.writeShort(n),l.writeByte(0);let f=2,p=o(f);l.writeByte(f);let u=0;for(;p.length-u>255;)l.writeByte(255),l.writeBytes(p,u,255),u+=255;l.writeByte(p.length-u),l.writeBytes(p,u,p.length-u),l.writeByte(0),l.writeString(\";\")};let s=function(l){let f=l,p=0,u=0,E={};return E.write=function(v,D){if(v>>>D)throw\"length over\";for(;p+D>=8;)f.writeByte(255&(v<<p|u)),D-=8-p,v>>>=8-p,u=0,p=0;u=v<<p|u,p=p+D},E.flush=function(){p>0&&f.writeByte(u)},E},o=function(l){let f=1<<l,p=(1<<l)+1,u=l+1,E=c();for(let B=0;B<f;B+=1)E.add(String.fromCharCode(B));E.add(String.fromCharCode(f)),E.add(String.fromCharCode(p));let v=Ie(),D=s(v);D.write(f,u);let C=0,F=String.fromCharCode(i[C]);for(C+=1;C<i.length;){let B=String.fromCharCode(i[C]);C+=1,E.contains(F+B)?F=F+B:(D.write(E.indexOf(F),u),E.size()<4095&&(E.size()==1<<u&&(u+=1),E.add(F+B)),F=B)}return D.write(E.indexOf(F),u),D.write(p,u),D.flush(),v.toByteArray()},c=function(){let l={},f=0,p={};return p.add=function(u){if(p.contains(u))throw\"dup key:\"+u;l[u]=f,f+=1},p.size=function(){return f},p.indexOf=function(u){return l[u]},p.contains=function(u){return typeof l[u]<\"u\"},p};return a},nt=function(t,e,r){let n=tt(t,e);for(let o=0;o<e;o+=1)for(let c=0;c<t;c+=1)n.setPixel(c,o,r(c,o));let i=Ie();n.write(i);let a=Ze(),s=i.toByteArray();for(let o=0;o<s.length;o+=1)a.writeByte(s[o]);return a.flush(),\"data:image/gif;base64,\"+a},ot=Z,vn=Z.stringToBytes,rt=\"#e8e8e8\",it=\"#ffffff\";function st(t){let e=t.getRootNode(),r=e instanceof ShadowRoot?e.host:document.documentElement;return(r instanceof Element?r.getAttribute(\"data-theme\"):null)===\"light\"?it:rt}function Fe(t,e,r=200){ge(t),t.dataset.qrUrl=e;let n=document.createElement(\"canvas\"),i=n.getContext?.(\"2d\")??null;if(!i){let p=document.createElement(\"a\");p.href=e,p.textContent=\"Open in DID Wallet\",p.target=\"_blank\",p.rel=\"noopener\",t.appendChild(p);return}let a=ot(0,\"M\");a.addData(e),a.make();let s=a.getModuleCount(),o=Math.floor(r/s),c=o*s;n.width=c,n.height=c,n.style.display=\"block\",n.style.width=`${r}px`,n.style.height=`${r}px`,n.style.imageRendering=\"pixelated\";let l=st(t);i.fillStyle=l,i.fillRect(0,0,c,c),i.fillStyle=\"#000000\";for(let p=0;p<s;p++)for(let u=0;u<s;u++)a.isDark(p,u)&&i.fillRect(u*o,p*o,o,o);let f=document.createElement(\"div\");f.className=\"qr-plate\",f.style.display=\"inline-block\",f.style.padding=\"10px\",f.style.backgroundColor=l,f.style.borderRadius=\"8px\",f.style.lineHeight=\"0\",f.appendChild(n),t.appendChild(f)}function ge(t){t.innerHTML=\"\",delete t.dataset.qrUrl}var at=`\n${Te}\n${Se}\n${Ue}\n\n/* Layout */\nbody {\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.08) 0%, transparent 60%);\n}\n/* The body rule does not apply inside a shadow tree. The host page must\n give the LoginPage container a height for this centering to show. */\n:host {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100%;\n}\n\n/* Card \\u2014 fixed width prevents shrinking when views switch */\n.card {\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-lg);\n padding: 48px 40px;\n width: min(400px, calc(100vw - 32px));\n text-align: center;\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.15);\n}\n\n/* Brand header */\n.brand-header { margin-bottom: 24px; }\n.app-logo {\n width: 48px;\n height: 48px;\n border-radius: var(--radius-sm);\n object-fit: contain;\n margin-bottom: 16px;\n}\nh1 {\n font-size: 24px;\n font-weight: 600;\n margin-bottom: 8px;\n color: var(--text-white);\n letter-spacing: -0.01em;\n line-height: 1.25;\n /* Never let a long \"Sign in to {appName}\" blow past two lines \\u2014 clamp with\n an ellipsis so the card height stays stable. */\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n.subtitle {\n font-size: 14px;\n color: var(--text-secondary);\n margin-bottom: 0;\n line-height: 1.5;\n}\n.federated-hint {\n font-size: 12px;\n color: var(--text-secondary);\n margin-top: 6px;\n margin-bottom: 0;\n opacity: 0.7;\n}\n\n/* Input */\n.input {\n width: 100%;\n height: 36px;\n padding: 0 12px;\n font-size: 14px;\n color: var(--text);\n background: var(--bg-input);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n outline: none;\n margin-bottom: 16px;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.input:focus { border-color: var(--blue); box-shadow: var(--shadow-focus); }\n.input::placeholder { color: var(--text-placeholder); }\n\n/* Button */\n.btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;\n line-height: 1;\n}\n.btn:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(108,71,255,0.3); }\n.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }\n.btn:focus-visible { box-shadow: var(--shadow-focus); }\n.btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.btn-secondary {\n background: transparent;\n border: 1px solid var(--border-strong);\n color: var(--text);\n}\n.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(255,255,255,0.20); }\n\n/* Status */\n.status {\n margin-top: 16px;\n font-size: 13px;\n min-height: 20px;\n color: var(--text-secondary);\n}\n.status.error { color: var(--red-text); }\n\n/* Name row (passkey registration) */\n.name-row { display: none; }\n.name-row.visible { display: block; }\n\n/* Passkey section + secondary text action (\"First time? Create a passkey\") */\n.passkey-section > .btn + .passkey-alt,\n.passkey-section > .name-row + .btn { margin-top: 10px; }\n.passkey-alt {\n display: block;\n width: 100%;\n margin-top: 10px;\n padding: 4px;\n background: none;\n border: none;\n font-size: 13px;\n color: var(--text-secondary);\n cursor: pointer;\n text-align: center;\n transition: color 0.15s ease;\n}\n.passkey-alt:hover { color: var(--text); text-decoration: underline; }\n.passkey-alt:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); outline: none; }\n\n/* Divider */\n.divider {\n display: flex;\n align-items: center;\n margin: 20px 0;\n color: var(--text-secondary);\n font-size: 13px;\n}\n.divider::before, .divider::after {\n content: '';\n flex: 1;\n border-bottom: 1px solid var(--border);\n}\n.divider::before { margin-right: 12px; }\n.divider::after { margin-left: 12px; }\n\n/* DID Wallet section (methods view) */\n.did-wallet-section { margin-top: 8px; }\n\n/* QR view */\n.qr-view {\n position: relative;\n margin: 20px auto;\n display: flex;\n justify-content: center;\n min-height: 220px;\n align-items: center;\n}\n.qr-placeholder {\n width: 220px;\n height: 220px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius);\n background: var(--bg-elevated);\n}\n.qr-spinner {\n display: inline-block;\n width: 32px; height: 32px;\n border: 3px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n#did-connect-status {\n font-size: 13px;\n color: var(--text-secondary);\n}\n\n/* Connect result state */\n.connect-result {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 120px;\n margin: 32px 0;\n animation: fadeIn 200ms ease-out;\n}\n.result-icon {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 28px;\n font-weight: bold;\n}\n.result-error {\n background: rgba(239, 68, 68, 0.15);\n color: var(--red-text);\n border: 2px solid rgba(239, 68, 68, 0.3);\n}\n.result-loading {\n background: transparent;\n}\n.result-loading .qr-spinner {\n width: 36px;\n height: 36px;\n}\n.result-back-btn {\n margin-top: 16px;\n}\n@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }\n\n/* QR timeout overlay */\n.qr-timeout-overlay {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n background: rgba(0, 0, 0, 0.65);\n border-radius: var(--radius);\n backdrop-filter: blur(2px);\n}\n.qr-timeout-overlay .timeout-text {\n font-size: 13px;\n color: #fff;\n}\n.qr-timeout-overlay .refresh-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 6px 20px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.qr-timeout-overlay .refresh-btn:hover {\n background: var(--blue-hover);\n}\n/* Connect status views (scanned / success) */\n.connect-status-icon {\n position: relative;\n width: 72px;\n height: 72px;\n margin: 16px auto;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes connectSpin { to { transform: rotate(360deg); } }\n.connect-spinner-ring {\n position: absolute;\n inset: 0;\n width: 72px;\n height: 72px;\n border-radius: 50%;\n border: 3px solid rgba(255,255,255,0.1);\n border-top-color: var(--blue, #6c47ff);\n animation: connectSpin 0.8s linear infinite;\n}\n.connect-status-badge {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n}\n.connect-status-badge svg { width: 36px; height: 36px; }\n.connect-status-icon.connect-success svg { animation: fadeIn 0.3s ease; }\n.connect-subtitle {\n font-size: 13px;\n color: var(--text-secondary, #9394a1);\n text-align: center;\n margin: 4px 0 0;\n}\n.status.success { color: #49dc6e; font-weight: 500; }\n.deep-link-btn {\n margin-top: 12px;\n text-decoration: none;\n}\n\n/* Email section (methods view) */\n.email-section { margin-top: 8px; }\n\n/* Back button \\u2014 same top row as Cancel and the locale/theme tools.\n A float sat inside the 48px content padding, so Back landed below the\n absolute locale pill. */\n.back-btn {\n position: absolute;\n top: 16px;\n left: 40px;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n background: none;\n border: none;\n color: var(--text-secondary);\n font-size: 14px;\n line-height: 1;\n cursor: pointer;\n padding: 0;\n margin: 0;\n}\n.back-btn:hover { color: var(--text); }\n.back-btn svg { width: 18px; height: 18px; }\n/* Escape hatch \\u2014 a quiet \"Cancel\" link, top-left of the card, mirroring the\n locale switcher (top-right). Conventional spot for a standalone auth card.\n Low in the hierarchy (tertiary color, small) so it never competes with the\n auth methods; it's an exit, not an action. */\n.home-link {\n position: absolute;\n top: 16px;\n /* Align the arrow's left edge to the content column (card's 40px padding), so\n Cancel sits on the same left line as the title and buttons \\u2014 no left padding\n of its own, which would push it off that line. */\n left: 40px;\n display: inline-flex;\n align-items: center;\n gap: 3px;\n background: none;\n border: none;\n color: var(--text-tertiary);\n font-size: 13px;\n line-height: 1;\n text-decoration: none;\n cursor: pointer;\n height: 28px;\n padding: 2px 4px 2px 0;\n transition: color 0.15s ease;\n}\n.home-link:hover { color: var(--text-secondary); }\n.home-link svg { width: 16px; height: 16px; }\n\n/* View title */\n.view-title {\n font-size: 20px;\n font-weight: 600;\n color: var(--text-white);\n margin-bottom: 8px;\n padding-top: 8px;\n}\n\n/* OAuth section \\u2014 single provider (legacy) */\n.oauth-section { margin-top: 0; }\n\n/* OAuth grid \\u2014 2+ providers in 2-column layout (legacy) */\n.oauth-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n margin-bottom: 8px;\n}\n.oauth-grid .oauth-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n/* Unified secondary methods grid \\u2014 2-column layout */\n.methods-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n}\n/* Odd last child (e.g. DID Wallet when total is odd) spans full width */\n.methods-grid .method-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n.method-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n min-height: 36px;\n padding: 6px 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-elevated);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;\n white-space: normal;\n}\n.method-btn:hover { background: var(--bg-hover); border-color: var(--blue-muted); }\n.method-btn:disabled { cursor: default; pointer-events: none; }\n.method-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n\n.oauth-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;\n margin-bottom: 0;\n}\n.oauth-section .oauth-btn { margin-bottom: 8px; }\n.oauth-btn:hover { background: var(--bg-hover); }\n.oauth-btn:disabled { cursor: default; pointer-events: none; }\n.oauth-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.oauth-btn-loading {\n opacity: 0.8;\n border-color: var(--blue);\n color: var(--text-secondary);\n}\n@keyframes oauth-spin { to { transform: rotate(360deg); } }\n.oauth-spinner {\n display: inline-block;\n width: 14px; height: 14px;\n border: 2px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: oauth-spin 0.6s linear infinite;\n}\n.oauth-check { color: var(--green-text); font-size: 16px; }\n\n/* Browser compatibility warning */\n.compat-warning {\n font-size: 13px;\n color: var(--text-tertiary);\n padding: 12px;\n background: var(--bg-elevated);\n border-radius: var(--radius-sm);\n margin-bottom: 16px;\n}\n\n/* Trust footer */\n.login-footer {\n margin-top: 24px;\n padding-top: 20px;\n border-top: 1px solid var(--border);\n}\n.secured-badge {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.secured-badge svg { width: 14px; height: 14px; flex-shrink: 0; }\n.footer-links {\n margin-top: 8px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.footer-links a {\n color: var(--text-secondary);\n text-decoration: none;\n}\n.footer-links a:hover { text-decoration: underline; }\n\n/* \\u2500\\u2500\\u2500 Animations \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n@keyframes fadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n.card[data-view] { animation: fadeIn 200ms ease-out; }\n\n/* QR code scale-in */\n.qr-view { animation: qrScaleIn 300ms ease-out; }\n@keyframes qrScaleIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n}\n\n/* Button loading spinner */\n@keyframes spin { to { transform: rotate(360deg); } }\n.btn-spinner {\n display: inline-block;\n width: 16px; height: 16px;\n border: 2px solid rgba(255,255,255,0.3);\n border-top-color: #fff;\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n\n/* Success checkmark */\n@keyframes checkDraw {\n from { stroke-dashoffset: 24; }\n to { stroke-dashoffset: 0; }\n}\n.success-check {\n display: inline-block;\n width: 20px; height: 20px;\n vertical-align: middle;\n}\n.success-check path {\n stroke-dasharray: 24;\n stroke-dashoffset: 24;\n animation: checkDraw 400ms ease-out forwards;\n}\n\n/* Light theme background gradient adjustment */\n[data-theme=\"light\"] body {\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.05) 0%, transparent 60%);\n}\n[data-theme=\"light\"] .card,\n:host([data-theme=\"light\"]) .card {\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.08);\n}\n[data-theme=\"light\"] .btn:hover,\n:host([data-theme=\"light\"]) .btn:hover {\n box-shadow: 0 2px 8px rgba(108,71,255,0.15);\n}\n\n/* Language sits on the same top row as Back / Cancel. */\n.card-tools {\n position: absolute;\n top: 16px;\n right: 16px;\n z-index: 2;\n display: flex;\n align-items: flex-start;\n}\n.locale-switcher {\n position: relative;\n}\n.locale-btn {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n transition: color 0.15s, border-color 0.15s;\n}\n.locale-btn:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-btn svg { width: 14px; height: 14px; flex-shrink: 0; }\n.locale-trigger {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n}\n.locale-trigger:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }\n/* One compact menu surface; rows are choices, not nested pill buttons. */\n.locale-menu {\n display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 4;\n min-width: 144px; width: max-content; max-width: min(240px,calc(100vw - 64px));\n padding: 4px; background: var(--bg-card); border: 1px solid var(--border);\n border-radius: 10px; box-shadow: var(--shadow-lg);\n}\n.locale-switcher.open .locale-menu { display: flex; flex-direction: column; }\n.locale-menu .locale-btn {\n width: 100%; min-height: 36px; height: auto; padding: 7px 10px; gap: 8px;\n border: 0; border-radius: 6px; background: transparent; text-align: left;\n font-size: 13px; line-height: 1.4; overflow-wrap: anywhere;\n}\n.locale-menu .locale-btn:hover, .locale-menu .locale-btn:focus-visible { background: var(--bg-hover); color: var(--text); }\n.locale-menu .locale-btn[aria-checked=\"true\"] { color: var(--text); font-weight: 600; }\n.locale-check { width: 14px; flex: 0 0 14px; font-size: 12px; line-height: 1; }\n@media (pointer: coarse) { .locale-menu .locale-btn { min-height: 44px; } }\n.has-last-used { flex-wrap: wrap; }\n.last-used { display: inline-block; font-size: 11px; font-weight: 400; line-height: 1.4;\n padding: 2px 6px; border: 1px solid currentColor; border-radius: 4px; opacity: .72; white-space: nowrap; }\n.card { position: relative; }\n\n/* Long localized method labels remain readable on narrow screens. */\n.methods-grid { grid-template-columns: 1fr; }\n.method-btn { min-height: 48px; white-space: normal; }\n.passkey-alt { min-height: 44px; font-weight: 600; }\n.oauth-recovery { font-size: 14px; line-height: 1.5; margin: 12px 0; padding: 12px;\n border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-secondary); text-align: left; }\n.oauth-recovery p { margin: 0 0 8px; overflow-wrap: anywhere; }\n.oauth-recovery-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }\n.oauth-recovery-actions button, .oauth-recovery-actions a { font: inherit; font-size: 13px; min-height: 44px;\n display: inline-flex; align-items: center; padding: 4px 0; color: var(--text); border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }\n.oauth-recovery-actions[hidden], .oauth-recovery-actions [hidden] { display: none; }\n.oauth-recovery-actions :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }\n\n@media (max-width: 480px) { .card { padding: 24px 20px; width: 100%; box-sizing: border-box; } h1 { font-size: 24px; } }\n\n.passkey-create-entry { display: flex; justify-content: center; align-items: center; width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--text); padding: 10px 14px; }\n.passkey-create-entry:hover { background: var(--bg-hover); text-decoration: none; }\n.status:empty { min-height: 0; padding: 0; margin: 0; }\n.passkey-section .subtitle { margin: 8px 0 16px; font-size: 14px; line-height: 1.5; }\n@media (max-width: 480px) { .card { padding: 20px 18px; } .brand-header { margin-bottom: 20px; } }\n\n.card-modal .card-tools { left: 20px; right: 80px; top: 12px; }\n.card-modal .locale-switcher { min-width: 0; max-width: 100%; }\n.card-modal .locale-trigger { max-width: 100%; height: 36px; }\n.locale-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.card-modal .locale-menu { left: 0; right: auto; }\n\n.card { padding: 52px 24px 24px; box-sizing: border-box; }\n.card-modal { width: 100%; }\n.card-modal { padding-top: 68px; border: 0; border-radius: 0; }\n/* The dialog frame owns the shadow in both palettes. */\n.card.card-modal, :host([data-theme=\"light\"]) .card.card-modal { box-shadow: none; }\n/* A translateY entrance expands an auto scroller by 4px until it finishes. */\n.card-modal[data-view] { animation: none; }\n/* Sub-step navigation shares the close button's center line in both modes. */\n.back-btn { top: 8px; left: 24px; height: 44px; max-width: calc(100% - 160px); line-height: 1.4; text-align: left; }\n.back-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }\n.card-modal .back-btn { position: absolute; top: 8px; left: 24px; margin: 0; }\n.card-modal:has(.back-btn) .card-tools { left: auto; right: 64px; max-width: calc(100% - 160px); }\n.passkey-creating > .home-link { display: none; }\n@media (max-width:480px) { .back-btn, .card-modal .back-btn { left: 18px; } }\n.card-modal h1 { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; line-height: 1.4; padding-block: 2px; }\n.card-modal h1[tabindex=\"-1\"]:focus { outline: none; }\n.card-modal h1, .card-modal h2, .card-modal .subtitle, .card-modal .status { overflow-wrap: anywhere; }\n.card-modal .btn { height: auto; min-height: 44px; line-height: 1.4; padding-block: 10px; white-space: normal; }\n.card-modal button, .card-modal a { overflow-wrap: anywhere; }\n.social-first .divider { margin: 14px 0; }\n.social-first .app-logo { width: 32px; height: 32px; margin-bottom: 12px; }\n.social-first .login-footer { margin-top: 16px; padding-top: 12px; }\n.other-methods { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }\n.other-methods summary { min-height: 44px; padding: 12px 0; cursor: pointer; }\n.other-methods summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }\n@media (max-width:480px) { .card { padding: 52px 18px 24px; } }\n@media (max-width:480px) { .card-modal { padding-top: 68px; } .card-modal .card-tools { left: 18px; } }\n@media (prefers-reduced-motion: reduce) { .card[data-view], .qr-view { animation: none; } }\n\n.passkey-creating > .methods-grid, .passkey-creating > .divider, .passkey-creating > .other-methods { display: none; }\n\n.input-label { display: block; text-align: left; margin: 8px 0; color: var(--text); font-size: 14px; font-weight: 500; }\n.input-label[hidden], .email-help[hidden] { display: none; }\n.email-help { text-align: left; font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 12px; }\n`;function J(t){let e=new Uint8Array(t),r=\"\";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=+$/,\"\")}function oe(t){let e=t.replace(/-/g,\"+\").replace(/_/g,\"/\"),r=atob(e),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n.buffer}function ut(t){let e=t.response;return{id:t.id,rawId:J(t.rawId),type:t.type,response:{attestationObject:J(e.attestationObject),clientDataJSON:J(e.clientDataJSON)},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}function lt(t){let e=t.response;return{id:t.id,rawId:J(t.rawId),type:t.type,response:{authenticatorData:J(e.authenticatorData),clientDataJSON:J(e.clientDataJSON),signature:J(e.signature),userHandle:e.userHandle?J(e.userHandle):void 0},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}async function le(t){let e=t.prefix||\"/.well-known/service/api/passkey\",r=t.onStatus||(()=>{}),n=t.authOnly||!1,i=t.registerOnly||!1,a=t.invitationId||void 0,s=t.locale,o=t.texts||{},c=o.waiting||b(\"passkeyWaiting\",s),l=o.creating||b(\"passkeyCreating\",s),f=o.verifying||b(\"verifying\",s);async function p(){let C=await fetch(`${e}/auth`,{method:\"GET\",signal:t.signal});if(!C.ok)throw new Error(b(\"authFailed\",s));return C.json()}async function u(C){let F=[];C&&F.push(`name=${encodeURIComponent(C)}`),a&&F.push(`invitationId=${encodeURIComponent(a)}`);let B=F.length?`?${F.join(\"&\")}`:\"\",R=await fetch(`${e}/register${B}`,{method:\"GET\",signal:t.signal});if(!R.ok)throw new Error(b(\"registrationFailed\",s));return R.json()}function E(C,F){let B=new Error(C);throw F&&(B.code=F),B}async function v(C,F){let B=await fetch(`${e}/auth`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:C,credential:F})});if(!B.ok){let R=await B.json().catch(()=>({}));E(R.error||b(\"authFailed\",s),R.code)}return B.json()}async function D(C,F,B){let R=await fetch(`${e}/register`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:C,credential:F,name:B||void 0})});if(!R.ok){let W=await R.json().catch(()=>({}));E(W.error||b(\"registrationFailed\",s),W.code)}return R.json()}if(!i){r(c,!1);try{let C=await p(),{challengeId:F}=C,B=C.authentication||C,R={signal:t.signal,publicKey:{...B,challenge:oe(B.challenge),allowCredentials:(B.allowCredentials||[]).map(L=>({...L,id:oe(L.id)}))}},W;try{W=await navigator.credentials.get(R)}catch{if(n)return{success:!1,error:\"no_passkey\"}}if(!W&&n)return{success:!1,error:\"no_passkey\"};if(t.signal?.aborted)return{success:!1,error:\"cancelled\"};if(W){let L=lt(W);return r(f,!1),await v(F,L),{success:!0}}}catch(C){let F=C instanceof Error?C.message:b(\"authFailed\",s),B=C instanceof Error?C.code:void 0;return r(F,!0),{success:!1,error:F,code:B}}}try{let C=await u(t.name||\"\");if(C.registrationAllowed===!1)return r(b(\"regClosed\",s),!0),{success:!1,error:\"registration_closed\"};r(l,!1);let F=C.registration||C,B={signal:t.signal,publicKey:{...F,challenge:oe(F.challenge),user:{...F.user,id:oe(F.user.id)},excludeCredentials:(F.excludeCredentials||[]).map(L=>({...L,id:oe(L.id)}))}},R=await navigator.credentials.create(B);if(!R||t.signal?.aborted)return{success:!1,error:b(\"passkeyNoLocal\",s)};let W=ut(R);return r(f,!1),await D(C.challengeId,W,t.name||\"\"),{success:!0}}catch(C){let F=C instanceof Error&&(C.name===\"NotAllowedError\"||C.name===\"AbortError\")?b(\"passkeyNoLocal\",s):C instanceof Error?C.message:b(\"passkeySetupFailed\",s),B=C instanceof Error?C.code:void 0;return r(F,!0),{success:!1,error:F,code:B}}}function X(t,e){let r=t instanceof Error?t.message:\"\",n=t instanceof Error&&\"code\"in t?t.code:\"\";return n===\"FORBIDDEN\"?b(\"accessDenied\",e):r===\"registration_closed\"||n===\"registration_closed\"?b(\"regClosed\",e):r||b(\"authFailed\",e)}var ct=\"https://web.abtwallet.io/\";function _e(){return typeof navigator>\"u\"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function dt(){return typeof window>\"u\"?null:window.ABT_DEV??window.ABT??null}function q(t){return t.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\")}var me=class{container;config;http;options;tokenSession=null;styleEl=null;mounted=!1;completed=!1;generation=0;activeMethod;activeProvider;oauthCleanup;emailTimer;emailDraft=\"\";abort;emit(t){try{this.options.onEvent?.({name:t,method:this.activeMethod,mode:this.options.mode??\"page\"})}catch{}}select(t){this.generation++,this.oauthCleanup?.(),this.abort?.abort(),this.abort=new AbortController,this.activeMethod=t,this.activeProvider=void 0,this.emit(\"method_selected\")}currentView=\"methods\";cardEl=null;mediaQuery=null;mediaListener=null;localeOutsideClick=null;shadow=null;isolate;constructor(t,e,r,n){if(this.container=t,this.config=e,this.http=r,this.isolate=n?.isolate===!0,this.options={methods:[\"passkey\",\"did-connect\"],locale:\"en\",...n},!this.options.invitationId&&typeof document<\"u\"){let i=document.cookie.match(/(?:^|;\\s*)pending_invitation=([^;]*)/);if(i)try{this.options.invitationId=decodeURIComponent(i[1])}catch{}}}mount(){if(this.mounted)return;this.mounted=!0,this.completed=!1,this.emit(\"view\"),this.styleEl=document.createElement(\"style\"),this.styleEl.textContent=at,this.mountRoot().appendChild(this.styleEl),this.adoptStoredTheme(),this.applyTheme();let t=this.filterMethods(this.options.methods);this.renderCard(t)}destroy(){if(this.generation++,this.oauthCleanup?.(),this.abort?.abort(),clearInterval(this.emailTimer),this.detachLocaleMenu(),this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.detachMedia(),this.isolate){let t=this.shadow??this.container.shadowRoot;t&&(t.innerHTML=\"\"),this.container.removeAttribute(\"data-theme\")}else document.documentElement.removeAttribute(\"data-theme\"),this.container.innerHTML=\"\";this.styleEl=null,this.cardEl=null,this.currentView=\"methods\",this.mounted=!1}setTheme(t){this.options.theme=t,this.applyTheme()}update(t){Object.assign(this.options,t),this.mounted&&(this.destroy(),this.mount())}themeTarget(){return this.isolate?this.container:document.documentElement}mountRoot(){return this.isolate?this.shadow?this.shadow:(this.shadow=this.container.shadowRoot??this.container.attachShadow({mode:\"open\"}),this.shadow):this.container}detachMedia(){this.mediaQuery&&this.mediaListener&&this.mediaQuery.removeEventListener(\"change\",this.mediaListener),this.mediaQuery=null,this.mediaListener=null}adoptStoredTheme(){if(this.options.mode===\"dialog\"||typeof window>\"u\")return;let t=new URLSearchParams(window.location.search).get(\"theme\");if(t===\"light\"||t===\"dark\"||t===\"auto\"){this.options.theme=t;return}try{let e=localStorage.getItem(\"web-mode\");(e===\"light\"||e===\"dark\"||e===\"auto\")&&(this.options.theme=e)}catch{}}applyTheme(){this.detachMedia();let t=this.options.theme??\"dark\",e=this.themeTarget();if(t===\"light\")e.dataset.theme=\"light\";else if(t===\"auto\"&&typeof window.matchMedia==\"function\"){let r=window.matchMedia(\"(prefers-color-scheme: light)\");this.mediaQuery=r;let n=i=>{i?e.dataset.theme=\"light\":e.removeAttribute(\"data-theme\"),this.repaintQRPlate()};n(r.matches),this.mediaListener=i=>n(i.matches),r.addEventListener(\"change\",this.mediaListener);return}else e.removeAttribute(\"data-theme\");this.repaintQRPlate()}repaintQRPlate(){let t=this.mountRoot().querySelector(\"#did-connect-qr\");if(!(t instanceof HTMLElement))return;let e=t.dataset.qrUrl;!e||!t.querySelector(\"canvas\")||t.querySelector(\".qr-timeout-overlay\")||Fe(t,e)}filterMethods(t){return t.filter(e=>e===\"passkey\"?typeof window<\"u\"&&window.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential==\"function\":!0)}renderCard(t){let e=document.createElement(\"div\");e.className=this.options.mode===\"dialog\"?\"card card-modal\":\"card\",this.cardEl=e,this.mountRoot().appendChild(e),this.switchView(\"methods\",t)}renderCardTools(t){if(!(this.options.showLocaleSelector??this.options.mode!==\"dialog\"))return;let e=document.createElement(\"div\");e.className=\"card-tools\",this.renderLocaleSwitcher(e),t.appendChild(e)}renderLocaleSwitcher(t){let e=this.options.locales;if(e){this.renderLocaleMenu(t,e);return}if(pe.length<2)return;let r=document.createElement(\"div\");r.className=\"locale-switcher\";let n=this.options.locale,i=pe.find(s=>s.code!==n)??pe[0],a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-btn\",a.innerHTML=`${Be} ${q(i.label)}`,a.title=i.label,a.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(i.code),this.update({locale:i.code})}),r.appendChild(a),t.appendChild(r)}renderLocaleMenu(t,e){if(e.length<2)return;this.detachLocaleMenu();let r=this.options.locale,n=e.find(l=>l.code===r)??e[0],i=document.createElement(\"div\");i.className=\"locale-switcher\";let a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-trigger\",a.setAttribute(\"aria-haspopup\",\"menu\"),a.setAttribute(\"aria-expanded\",\"false\"),a.innerHTML=`${Be} <span class=\"locale-label\">${q(n.label)}</span>`,a.title=n.label;let s=document.createElement(\"div\");s.className=\"locale-menu\",s.setAttribute(\"role\",\"menu\"),s.hidden=!0;let o=l=>{i.classList.toggle(\"open\",l),s.hidden=!l,a.setAttribute(\"aria-expanded\",l?\"true\":\"false\")};a.addEventListener(\"click\",l=>{l.stopPropagation(),o(s.hidden),s.hidden||s.querySelector('[aria-checked=\"true\"]')?.focus()});for(let l of e){let f=l.code===n.code,p=document.createElement(\"button\");p.type=\"button\",p.className=\"locale-btn\",p.setAttribute(\"role\",\"menuitemradio\"),p.setAttribute(\"aria-checked\",f?\"true\":\"false\"),p.dataset.locale=l.code,p.tabIndex=-1,p.title=l.label;{let E=document.createElement(\"span\");E.className=\"locale-check\",E.setAttribute(\"aria-hidden\",\"true\"),E.textContent=f?\"\\u2713\":\"\",p.appendChild(E)}let u=document.createElement(\"span\");u.textContent=l.label,p.appendChild(u),p.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(l.code),this.update({locale:l.code})}),s.appendChild(p)}i.addEventListener(\"keydown\",l=>{let f=[...s.querySelectorAll(\".locale-btn\")],p=this.shadow?.activeElement??document.activeElement,u=f.indexOf(p);if(l.key===\"Escape\")l.preventDefault(),l.stopPropagation(),o(!1),a.focus();else if(l.key===\"Tab\")o(!1);else if([\"ArrowDown\",\"ArrowUp\",\"Home\",\"End\"].includes(l.key)){l.preventDefault(),o(!0);let E=l.key===\"Home\"?0:l.key===\"End\"?f.length-1:u<0?l.key===\"ArrowUp\"?f.length-1:0:(u+(l.key===\"ArrowUp\"?-1:1)+f.length)%f.length;f[E]?.focus()}});let c=l=>{let f=l.composedPath();f.includes(i)||this.isolate&&f.includes(this.container)||o(!1)};document.addEventListener(\"click\",c),this.localeOutsideClick=c,i.append(a,s),t.appendChild(i)}detachLocaleMenu(){this.localeOutsideClick&&(document.removeEventListener(\"click\",this.localeOutsideClick),this.localeOutsideClick=null)}switchView(t,e){if(!this.cardEl)return;let r=this.options.locale;switch(this.currentView===\"qr\"&&t!==\"qr\"&&this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.generation++,this.oauthCleanup?.(),this.abort?.abort(),clearInterval(this.emailTimer),this.currentView=t,this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=t,this.renderCardTools(this.cardEl),t){case\"methods\":this.renderMethodsView(this.cardEl,r,e??this.filterMethods(this.options.methods));break;case\"qr\":this.renderQRView(this.cardEl,r);break;case\"email\":this.renderEmailView(this.cardEl,r);break}}markLastUsed(t,e,r){if(this.options.preferenceKey)try{if(localStorage.getItem(`did-login-method:${this.options.preferenceKey}`)!==e)return;let n=document.createElement(\"span\");n.className=\"last-used\",n.textContent=b(\"lastUsed\",r),t.classList.add(\"has-last-used\"),t.appendChild(n)}catch{}}renderMethodsView(t,e,r){this.options.mode!==\"dialog\"&&this.renderHomeLink(t,e),this.renderBrandHeader(t,e);let n=this.options.methods.includes(\"passkey\");if(n&&!r.includes(\"passkey\")){let o=document.createElement(\"div\");o.className=\"compat-warning\",o.textContent=b(\"passkeyUnsupported\",e),t.appendChild(o)}let i=this.options.preferredLayout!==\"passkey-first\"&&r.includes(\"oauth\")&&this.options.oauthProviders?.some(o=>o.enabled&&[\"google\",\"apple\"].includes(o.id));t.classList.toggle(\"social-first\",!!i),i&&(this.renderSecondaryGrid(t,e,[\"oauth\"],\"primary\"),this.renderDivider(t,e));let a=r.includes(\"passkey\");a&&this.renderPasskeySection(t,e);let s=r.filter(o=>o!==\"passkey\");if(a&&s.length>0&&this.renderDivider(t,e),s.length>0)if(i){r.includes(\"email\")&&this.renderSecondaryGrid(t,e,[\"email\"]);let o=document.createElement(\"details\");o.className=\"other-methods\";let c=document.createElement(\"summary\");c.textContent=b(\"otherMethods\",e),o.appendChild(c),this.renderSecondaryGrid(o,e,r.filter(l=>l!==\"email\"),\"secondary\"),o.querySelector(\"button\")&&t.appendChild(o)}else this.renderSecondaryGrid(t,e,r);if(r.length===0&&!n){let o=document.createElement(\"p\");o.className=\"subtitle\",o.textContent=\"No authentication methods available.\",t.appendChild(o)}this.renderTrustFooter(t,e)}renderQRView(t,e){this.renderBackButton(t,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=b(\"scanTitle\",e),t.appendChild(r);let n=document.createElement(\"div\");n.id=\"did-connect-qr\",n.className=\"qr-view\",n.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',t.appendChild(n);let i=document.createElement(\"button\");i.className=\"btn btn-secondary deep-link-btn\",i.id=\"did-wallet-open-btn\",i.textContent=b(\"openInWallet\",e),i.disabled=!0,_e()?t.insertBefore(i,n):t.appendChild(i);let a=document.createElement(\"div\");a.id=\"did-connect-status\",a.className=\"status\",a.setAttribute(\"role\",\"status\"),t.appendChild(a),this.renderTrustFooter(t,e),this.startDIDConnectInView(a,n,i,e)}renderEmailView(t,e){this.renderBackButton(t,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=b(\"emailTitle\",e),t.appendChild(r);let n=document.createElement(\"label\");n.className=\"input-label\",n.htmlFor=\"login-email-address\",n.textContent=b(\"emailPlaceholder\",e),t.appendChild(n);let i=document.createElement(\"p\");i.className=\"email-help\",i.textContent=b(\"emailExplanation\",e),t.appendChild(i);let a=document.createElement(\"input\");a.className=\"input\",a.id=\"login-email-address\",a.type=\"email\",a.required=!0,a.autocomplete=\"email\",a.value=this.emailDraft,a.setAttribute(\"aria-label\",b(\"emailPlaceholder\",e)),a.addEventListener(\"input\",()=>{this.emailDraft=a.value}),a.placeholder=b(\"emailPlaceholder\",e),t.appendChild(a);let s=document.createElement(\"button\");s.className=\"btn\",s.textContent=b(\"emailSubmit\",e),t.appendChild(s);let o=document.createElement(\"div\");o.className=\"status\",o.setAttribute(\"role\",\"status\"),t.appendChild(o);let c=document.createElement(\"div\");c.className=\"email-code-section\",c.style.display=\"none\";let l=document.createElement(\"label\");l.className=\"input-label\",l.htmlFor=\"login-email-code\",l.textContent=b(\"emailCodePlaceholder\",e),c.appendChild(l);let f=document.createElement(\"input\");f.id=\"login-email-code\",f.className=\"input\",f.type=\"text\",f.inputMode=\"numeric\",f.maxLength=8,f.setAttribute(\"aria-label\",b(\"emailCodePlaceholder\",e)),f.autocomplete=\"one-time-code\",f.placeholder=b(\"emailCodePlaceholder\",e),c.appendChild(f);let p=document.createElement(\"button\");p.className=\"btn\",p.textContent=b(\"emailVerify\",e),c.appendChild(p);let u=document.createElement(\"button\");u.className=\"btn btn-secondary\",u.textContent=b(\"emailResend\",e),u.style.marginTop=\"8px\",c.appendChild(u),t.insertBefore(c,o),this.renderTrustFooter(t,e);let E=this.generation,v=()=>this.mounted&&E===this.generation,D=document.createElement(\"button\");D.className=\"passkey-alt\",D.textContent=b(\"emailEdit\",e),c.appendChild(D),D.addEventListener(\"click\",()=>this.switchView(\"email\"));let C=()=>{let I=60;clearInterval(this.emailTimer),u.disabled=!0,u.textContent=b(\"emailCooldown\",e,{seconds:String(I)}),this.emailTimer=setInterval(()=>{I--,u.textContent=I>0?b(\"emailCooldown\",e,{seconds:String(I)}):b(\"emailResend\",e),I<=0&&(clearInterval(this.emailTimer),u.disabled=!1)},1e3)},F=\"\",B,R=this.config.servicePrefix??\"/.well-known/service\",W=async()=>{if(s.disabled)return;let I=a.value.trim();if(!a.checkValidity()){o.textContent=b(\"emailInvalid\",e),o.className=\"status error\";return}s.disabled=!0,o.textContent=b(\"emailSending\",e),o.className=\"status\",o.setAttribute(\"role\",\"status\");try{let d=await this.http.post(`${R}/api/email/sendCode`,{email:I,locale:e});if(!v())return;C(),F=I,B=d?.id,a.style.display=\"none\",n.hidden=!0,i.hidden=!0,s.style.display=\"none\",c.style.display=\"\",r.textContent=b(\"emailVerify\",e),o.textContent=b(\"emailSent\",e,{email:I}),o.className=\"status\",f.focus()}catch(d){if(!v())return;let m=d instanceof Error?d.message:\"Failed to send email\";o.textContent=m,o.className=\"status error\",s.disabled=!1}},L=async()=>{if(p.disabled)return;let I=f.value.trim();if(!/^\\d{8}$/.test(I)){o.textContent=b(\"emailCodeInvalid\",e),o.className=\"status error\";return}p.disabled=!0,o.textContent=b(\"verifying\",e),o.className=\"status\";try{if(await this.http.post(`${R}/api/email/login`,{code:I,id:B}),!v())return;o.textContent=b(\"success\",e),o.className=\"status\",this.handleSuccess()}catch(d){if(!v())return;d instanceof Error&&\"code\"in d&&d.code===\"FORBIDDEN\"?this.showFullError(X(d,e)):(o.textContent=X(d,e),o.className=\"status error\",p.disabled=!1,f.value=\"\",f.focus())}};s.addEventListener(\"click\",W),a.addEventListener(\"keydown\",I=>{I.key===\"Enter\"&&W()}),p.addEventListener(\"click\",L),f.addEventListener(\"keydown\",I=>{I.key===\"Enter\"&&L()}),u.addEventListener(\"click\",async()=>{if(!u.disabled){u.disabled=!0,o.textContent=b(\"emailSending\",e),o.className=\"status\";try{let I=await this.http.post(`${R}/api/email/sendCode`,{email:F,locale:e});if(!v())return;C(),B=I?.id,o.textContent=b(\"emailSent\",e,{email:F}),o.className=\"status\"}catch(I){if(!v())return;u.disabled=!1;let d=I instanceof Error?I.message:\"Failed to resend\";o.textContent=d,o.className=\"status error\"}}})}renderBackButton(t,e,r=()=>this.switchView(\"methods\")){let n=document.createElement(\"button\");n.type=\"button\",n.className=\"back-btn\",n.innerHTML=`${ke} ${q(b(\"back\",e))}`,n.addEventListener(\"click\",r),t.appendChild(n)}renderHomeLink(t,e){if(this.options.dismissible===!1)return;let{homeUrl:r,onCancel:n}=this.options;if(!n&&!r)return;let i=`${ke} ${q(b(\"cancel\",e))}`;if(n){let a=document.createElement(\"button\");a.type=\"button\",a.className=\"home-link\",a.innerHTML=i,a.addEventListener(\"click\",()=>{this.emit(\"cancel\"),this.options.onCancel?.()}),t.appendChild(a)}else{let a=document.createElement(\"a\");a.className=\"home-link\",a.href=r,a.innerHTML=i,t.appendChild(a)}}renderBrandHeader(t,e){let r=document.createElement(\"div\");if(r.className=\"brand-header\",this.options.appLogo){let i=document.createElement(\"img\");i.className=\"app-logo\",i.src=q(this.options.appLogo),i.alt=this.options.appName?q(this.options.appName):\"\",i.width=48,i.height=48,r.appendChild(i)}let n=document.createElement(\"h1\");if(this.options.appName?n.textContent=b(\"signInTo\",e,{appName:this.options.appName}):n.textContent=b(\"signIn\",e),this.options.purpose&&(n.textContent=this.options.purpose.title),n.id=\"login-title\",r.appendChild(n),this.options.purpose?.description){let i=document.createElement(\"p\");i.className=\"subtitle\",i.textContent=this.options.purpose.description,r.appendChild(i)}if(this.options.masterAppName){let i=document.createElement(\"p\");i.className=\"federated-hint\",i.textContent=b(\"federatedBy\",e,{masterName:this.options.masterAppName}),r.appendChild(i)}t.appendChild(r)}renderTrustFooter(t,e){let r=document.createElement(\"div\");r.className=\"login-footer\";let n=document.createElement(\"div\");n.className=\"secured-badge\",n.innerHTML=`${Ve} ${q(b(\"securedBy\",e))}`,r.appendChild(n);let{privacyUrl:i,termsUrl:a}=this.options;if(i||a){let s=document.createElement(\"div\");if(s.className=\"footer-links\",i){let o=document.createElement(\"a\");o.href=i,o.target=\"_blank\",o.rel=\"noopener noreferrer\",o.textContent=b(\"privacy\",e),s.appendChild(o)}if(i&&a&&s.appendChild(document.createTextNode(\" \\xB7 \")),a){let o=document.createElement(\"a\");o.href=a,o.target=\"_blank\",o.rel=\"noopener noreferrer\",o.textContent=b(\"terms\",e),s.appendChild(o)}r.appendChild(s)}if(this.currentView!==\"methods\"&&this.options.mode!==\"dialog\"){this.renderHomeLink(r,e);let s=r.querySelector(\".home-link\");s&&(s.style.cssText=\"position:static;display:inline-flex;margin-top:12px\")}t.appendChild(r)}renderDivider(t,e){let r=document.createElement(\"div\");r.className=\"divider\",r.textContent=b(\"or\",e),t.appendChild(r)}renderPasskeySection(t,e){let r=document.createElement(\"div\");r.className=\"passkey-section\",t.appendChild(r);let n=document.createElement(\"div\");n.className=\"status\",n.id=\"passkey-status\",t.appendChild(n);let i=(u,E)=>{n.textContent=u,n.className=`status${E?\" error\":\"\"}`},a=()=>i(\"\",!1),s={waiting:b(\"passkeyWaiting\",e),creating:b(\"passkeyCreating\",e),verifying:b(\"verifying\",e)},o=u=>u.success?(i(b(\"success\",e),!1),this.handleSuccess(),!0):u.code===\"FORBIDDEN\"||u.error===\"registration_closed\"?(this.showFullError(X({message:u.error,code:u.code||u.error},e)),!0):!1,c=()=>{r.innerHTML=\"\",i(b(\"passkeyNoLocal\",e),!1);let u=document.createElement(\"button\");u.className=\"btn\",u.id=\"passkey-btn\",u.innerHTML=`${fe} ${q(b(\"passkeyUseAnotherDevice\",e))}`,r.appendChild(u),u.addEventListener(\"click\",()=>f());let E=document.createElement(\"button\");E.type=\"button\",E.className=\"passkey-alt passkey-create-entry\",E.textContent=b(\"passkeyCreateInstead\",e),r.appendChild(E),E.addEventListener(\"click\",()=>l())},l=()=>{this.cardEl?.classList.add(\"passkey-creating\"),this.abort?.abort(),this.generation++,r.innerHTML=\"\",a();let u=this.cardEl?.querySelector(\"h1\");u&&(u.textContent=b(\"passkeyCreateAccount\",e));let E=document.createElement(\"p\");E.className=\"subtitle\",E.textContent=b(\"passkeyExplanation\",e),r.appendChild(E);let v=document.createElement(\"div\");v.className=\"name-row visible\",v.id=\"passkey-name-row\";let D=document.createElement(\"input\");D.className=\"input\",D.id=\"passkey-name-input\",D.type=\"text\",D.setAttribute(\"aria-label\",b(\"namePlaceholder\",e)),D.placeholder=b(\"namePlaceholder\",e),D.autocomplete=\"name\",v.appendChild(D),r.appendChild(v);let C=document.createElement(\"button\");C.className=\"btn\",C.id=\"passkey-btn\",C.innerHTML=`${fe} ${q(b(\"passkeyCreate\",e))}`,r.appendChild(C),t.querySelector(\".back-btn\")?.remove(),this.renderBackButton(t,e,()=>p());let F=async()=>{if(C.disabled)return;C.disabled=!0,this.select(\"passkey\");let B=this.generation,R=await le({registerOnly:!0,signal:this.abort?.signal,name:D.value.trim(),onStatus:i,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});!this.mounted||B!==this.generation||this.abort?.signal.aborted||o(R)||(R.error&&i(R.error,!0),C.disabled=!1)};C.addEventListener(\"click\",F),D.addEventListener(\"keydown\",B=>{B.key===\"Enter\"&&F()}),C.focus()},f=async()=>{let u=r.querySelector(\"#passkey-btn\");if(u?.disabled)return;u&&(u.disabled=!0),this.select(\"passkey\");let E=this.generation,v=await le({authOnly:!0,signal:this.abort?.signal,onStatus:i,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});if(!(!this.mounted||E!==this.generation||this.abort?.signal.aborted)&&!o(v)){if(v.error&&v.error!==\"no_passkey\"){i(v.error,!0),u&&(u.disabled=!1);return}this.emit(\"incomplete\"),c()}},p=()=>{this.cardEl?.classList.remove(\"passkey-creating\"),t.querySelector(\".back-btn\")?.remove(),this.abort?.abort(),this.generation++;let u=this.cardEl?.querySelector(\"h1\");u&&(u.textContent=this.options.purpose?.title??(this.options.appName?b(\"signInTo\",e,{appName:this.options.appName}):b(\"signIn\",e))),r.innerHTML=\"\",a();let E=document.createElement(\"button\");E.className=this.cardEl?.classList.contains(\"social-first\")?\"btn btn-secondary\":\"btn\",E.id=\"passkey-btn\",E.innerHTML=`${fe} ${q(b(\"passkeySignIn\",e))}`,this.markLastUsed(E,\"passkey\",e),r.appendChild(E),E.addEventListener(\"click\",()=>f());let v=document.createElement(\"button\");v.type=\"button\",v.className=\"passkey-alt passkey-create-entry\",v.textContent=b(\"passkeyFirstTime\",e),r.appendChild(v),v.addEventListener(\"click\",()=>l())};this.options.invitationId?l():p()}startOAuthPopup(t,e){this.oauthCleanup?.();let r=this.generation,n=this.options.locale,i=this.config.servicePrefix??\"/.well-known/service\",a=this.options.masterOAuthOrigin?`${this.options.masterOAuthOrigin}${i}`:i,s=new URL(a,window.location.href).origin,o=window.location.href;if(this.options.mode!==\"dialog\"&&window.location.pathname===`${i}/login`){let A=new URLSearchParams(window.location.search).get(\"return_to\");try{let z=new URL(A||\"/\",window.location.origin);o=z.origin===window.location.origin&&!/^\\/[/\\\\]/.test(z.pathname)?z.href:`${window.location.origin}/`}catch{o=`${window.location.origin}/`}}let c=`${a}/api/oauth/${encodeURIComponent(t)}/login?returnUrl=${encodeURIComponent(o)}`,l=this.options.oauthProviders?.find(A=>A.id===t)?.name??t,f=e.innerHTML,p=null,u=!1,E=!1,v=!1,D,C,F,B=()=>!u&&this.mounted&&r===this.generation,R=[],W=()=>{for(let A of this.cardEl?.querySelectorAll(\".method-btn, .passkey-create-entry, #passkey-btn, .locale-trigger, .locale-btn\")??[])R.push({button:A,disabled:A.disabled}),A.disabled=!0},L=document.createElement(\"div\");L.className=\"oauth-recovery\",L.setAttribute(\"role\",\"status\");let I=document.createElement(\"p\"),d=document.createElement(\"div\");d.className=\"oauth-recovery-actions\";let m=document.createElement(\"button\");m.type=\"button\",m.className=\"oauth-retry\",m.textContent=b(\"oauthReopen\",n),m.hidden=!0,m.onclick=()=>{this.select(\"oauth\"),this.activeProvider=t,this.startOAuthPopup(t,e)};let h=document.createElement(\"a\");h.href=c,h.textContent=b(\"oauthFullPage\",n),h.addEventListener(\"click\",A=>{let z=L.dataset.state===\"oauthUnconfirmed\";if(E&&!u){A.preventDefault();return}z&&A.preventDefault(),this.options.onBeforeRedirect?.(),this.oauthCleanup?.(),z&&window.location.reload()});let g=document.createElement(\"button\");g.type=\"button\",g.className=\"oauth-cancel\",g.textContent=b(\"cancel\",n),d.append(m,h,g),L.append(I,d),e.parentElement?.after(L);let y=()=>{e.innerHTML=f,e.disabled=!1,e.classList.remove(\"oauth-btn-loading\")},x=()=>{try{p?.close()}catch{}},w=()=>{u=!0,clearInterval(D),clearInterval(C),clearTimeout(F),window.removeEventListener(\"message\",k);for(let A of R.splice(0))A.button.disabled=A.disabled;y()},T=A=>{I.textContent=b(A,n,{provider:l}),L.dataset.state=A,d.hidden=!1,m.hidden=!1,g.hidden=!0,y()},S=A=>{B()&&(w(),x(),T(A),this.emit(\"incomplete\"))},P=()=>{B()&&(w(),x(),L.remove(),e.textContent=b(\"success\",n),e.disabled=!0,this.handleSuccess())};g.onclick=()=>{E||(S(\"oauthCancelled\"),e.focus())};let k=async A=>{if(A.origin!==s||A.source!==p||!p||!A.data||A.data.type!==\"authorization_response\"||!B()||E)return;if(clearInterval(D),clearInterval(C),A.data.error){S(A.data.error===\"access_denied\"?\"oauthDenied\":A.data.error===\"cancelled\"?\"oauthCancelled\":\"oauthFailed\");return}let{code:z,state:se}=A.data.response??A.data;if(typeof z!=\"string\"||!z||typeof se!=\"string\"||!se){S(\"oauthFailed\");return}E=!0,W(),d.hidden=!0,x(),I.textContent=b(\"verifying\",n),e.textContent=b(\"verifying\",n),e.disabled=!0;try{let V={provider:t,code:z,state:se};this.options.invitationId&&(V.invitationId=this.options.invitationId),await this.http.post(`${i}/api/oauth/login`,V,{signal:this.abort?.signal}),P()}catch(V){if(!B())return;let j=V instanceof Error&&\"code\"in V?String(V.code):\"\",ae=V instanceof Error?V.message:\"\";j===\"FORBIDDEN\"||j===\"registration_closed\"||ae===\"registration_closed\"?(w(),L.remove(),this.showFullError(X(V,n))):S(\"oauthFailed\")}};this.oauthCleanup=()=>{w(),L.remove(),x()},window.addEventListener(\"message\",k);try{p=window.open(c,\"oauth-login:popup\",`left=${window.screenX+(window.innerWidth-500)/2},top=${window.screenY+(window.innerHeight-620)/2},width=500,height=620,resizable,scrollbars=yes,status=1,popup`)}catch{}if(!p){S(\"oauthBlocked\");return}I.textContent=b(\"oauthWaiting\",n,{provider:l}),e.textContent=b(\"oauthWaiting\",n,{provider:l}),e.disabled=!0,e.classList.add(\"oauth-btn-loading\");let N=async()=>{if(!(!B()||E||v)){v=!0;try{let A=await this.http.get(`${i}/api/did/session`);B()&&!E&&A?.authenticated===!0&&P()}catch{}finally{v=!1}}};D=setInterval(()=>{let A=!1;try{A=!!p?.closed}catch{return}!A||!B()||(clearInterval(D),T(\"oauthIncomplete\"),g.hidden=!1,N(),C=setInterval(()=>{N()},2e3))},500),F=setTimeout(()=>{if(B()){if(!E){S(\"oauthTimedOut\");return}this.abort?.abort(),w(),x(),W(),I.textContent=b(\"oauthUnconfirmed\",n),L.dataset.state=\"oauthUnconfirmed\",d.hidden=!1,m.hidden=!0,g.hidden=!0,h.href=window.location.href,h.textContent=b(\"oauthCheckSession\",n),this.emit(\"incomplete\")}},300*1e3)}renderSecondaryGrid(t,e,r,n){let i=document.createElement(\"div\");if(i.className=\"methods-grid\",r.includes(\"oauth\")&&this.options.oauthProviders?.length){let a=this.options.oauthProviderOrder??[\"google\",\"apple\",\"github\"],s=l=>a.includes(l)?a.indexOf(l):a.length,o=!!this.options.oauthProviderOrder||this.options.oauthProviders?.some(l=>l.order!==void 0&&l.order!==999),c=(this.options.oauthProviders??[]).filter(l=>l.enabled&&(!n||(o||[\"google\",\"apple\"].includes(l.id))===(n===\"primary\"))).sort((l,f)=>this.options.oauthProviderOrder?s(l.id)-s(f.id):(l.order??999)-(f.order??999)||s(l.id)-s(f.id));for(let l of c){let f=document.createElement(\"button\");f.className=\"method-btn\",f.dataset.provider=l.id;let p=Ye(l.id);f.innerHTML=`${p} ${q(b(\"continueWith\",e,{provider:l.name}))}`,this.markLastUsed(f,`oauth:${l.id}`,e),i.appendChild(f),f.addEventListener(\"click\",()=>{this.select(\"oauth\"),this.activeProvider=l.id,this.startOAuthPopup(l.id,f)})}}if(r.includes(\"email\")){let a=document.createElement(\"button\");a.className=\"method-btn\",a.id=\"email-btn\",a.innerHTML=`${qe} ${q(b(\"emailButton\",e))}`,this.markLastUsed(a,\"email\",e),i.appendChild(a),a.addEventListener(\"click\",()=>{this.select(\"email\"),this.switchView(\"email\")})}if(r.includes(\"did-connect\")){let a=document.createElement(\"button\");a.className=\"method-btn\",a.id=\"did-wallet-btn\";let s=i.children.length>0?b(\"didWalletButtonShort\",e):b(\"didWalletButton\",e);a.innerHTML=`${ve} ${q(s)}`,this.markLastUsed(a,\"did-connect\",e),i.appendChild(a),a.addEventListener(\"click\",()=>{this.select(\"did-connect\"),this.switchView(\"qr\")})}t.appendChild(i)}async startDIDConnectInView(t,e,r,n){t.textContent=b(\"connecting\",n);let i=this.generation,a=()=>this.mounted&&i===this.generation;try{this.tokenSession?.destroy(),this.tokenSession=new ne(this.config,this.http),this.tokenSession.on(\"succeed\",async()=>{if(a()){this.showConnectResult(e,r,t,b(\"verifying\",n));try{let o=this.config.servicePrefix??\"/.well-known/service\";if(await this.http.post(`${o}/api/did/connect/complete`,{token:this.tokenSession.state.token}),!a())return;this.showConnectSuccess(e,r,t,n),this.handleSuccess()}catch(o){if(!a())return;this.showConnectResult(e,r,t,X(o,n),!0)}}}),this.tokenSession.on(\"timeout\",()=>{t.textContent=b(\"timeout\",n);let o=document.createElement(\"div\");o.className=\"qr-timeout-overlay\",o.innerHTML=`<span class=\"timeout-text\">${q(b(\"timeout\",n))}</span>`;let c=document.createElement(\"button\");c.className=\"refresh-btn\",c.textContent=b(\"refreshQR\",n),c.addEventListener(\"click\",()=>{o.remove(),ge(e),e.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',r.disabled=!0,this.startDIDConnectInView(t,e,r,n)}),o.appendChild(c),e.appendChild(o)}),this.tokenSession.on(\"error\",o=>{this.showConnectResult(e,r,t,X(o,n),!0)}),this.tokenSession.on(\"statusChange\",o=>{o.status===\"scanned\"&&this.showConnectScanned(e,r,t,n)});let s=await this.tokenSession.create({locale:n});if(!a())return;s.url&&(Fe(e,s.url),r.disabled=!1,r.addEventListener(\"click\",()=>{t.textContent=b(\"walletRetry\",n),this.openInWallet(s.url,n)})),t.textContent=b(\"scanWithWallet\",n),this.tokenSession.startPolling()}catch(s){if(!a())return;t.textContent=X(s,n),ge(e)}}showFullError(t){if(!this.cardEl)return;let e=this.options.locale;this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=\"error\",this.renderCardTools(this.cardEl);let r=document.createElement(\"div\");r.className=\"connect-result\",r.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',this.cardEl.appendChild(r);let n=document.createElement(\"div\");n.className=\"status error\",n.textContent=t,this.cardEl.appendChild(n);let i=document.createElement(\"button\");i.className=\"btn btn-secondary result-back-btn\",i.textContent=b(\"back\",e),i.addEventListener(\"click\",()=>this.switchView(\"methods\")),this.cardEl.appendChild(i),this.renderTrustFooter(this.cardEl,e)}showConnectScanned(t,e,r,n=\"en\"){t.style.display=\"none\",e.style.display=\"none\";let i=t.parentElement?.querySelector(\".connect-result\");i||(i=document.createElement(\"div\"),i.className=\"connect-result\",t.parentElement?.insertBefore(i,r)),i.innerHTML=`<div class=\"connect-status-icon\">\n <div class=\"connect-spinner-ring\"></div>\n <span class=\"connect-status-badge\">${ve}</span>\n </div>`,r.textContent=b(\"waitingWallet\",n),r.className=\"status\";let a=r.parentElement?.querySelector(\".connect-subtitle\");a||(a=document.createElement(\"p\"),a.className=\"connect-subtitle\",r.parentElement?.insertBefore(a,r.nextSibling)),a.textContent=b(\"walletContinue\",n);let s=r.parentElement?.querySelector(\".result-back-btn\");s||(s=document.createElement(\"button\"),s.className=\"btn btn-secondary result-back-btn\",s.textContent=b(\"back\",n),s.addEventListener(\"click\",()=>this.switchView(\"methods\")),a.parentElement?.insertBefore(s,a.nextSibling))}showConnectSuccess(t,e,r,n=\"en\"){t.style.display=\"none\",e.style.display=\"none\";let i=t.parentElement?.querySelector(\".connect-result\");i||(i=document.createElement(\"div\"),i.className=\"connect-result\",t.parentElement?.insertBefore(i,r)),i.innerHTML=`<div class=\"connect-status-icon connect-success\">\n <svg viewBox=\"0 0 64 64\" width=\"64\" height=\"64\"><circle cx=\"32\" cy=\"32\" r=\"28\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\"/><polyline points=\"20 33 28 41 44 25\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>\n </div>`,r.textContent=b(\"success\",n),r.className=\"status success\";let a=r.parentElement?.querySelector(\".connect-subtitle\"),s=r.parentElement?.querySelector(\".result-back-btn\");a?.remove(),s?.remove()}showConnectResult(t,e,r,n,i=!1){let a=this.options.locale;t.style.display=\"none\",e.style.display=\"none\";let s=t.parentElement?.querySelector(\".connect-result\");if(s||(s=document.createElement(\"div\"),s.className=\"connect-result\",t.parentElement?.insertBefore(s,r)),i){s.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',r.textContent=n,r.className=\"status error\";let o=r.parentElement?.querySelector(\".result-back-btn\");o||(o=document.createElement(\"button\"),o.className=\"btn btn-secondary result-back-btn\",o.textContent=b(\"back\",a),o.addEventListener(\"click\",()=>this.switchView(\"methods\")),r.parentElement?.insertBefore(o,r.nextSibling))}else s.innerHTML='<div class=\"result-icon result-loading\"><span class=\"qr-spinner\"></span></div>',r.textContent=n,r.className=\"status\"}openInWallet(t,e=\"en\"){let r=_e(),n=dt();if(r){let i=t.replace(/^https?:\\/\\//,\"abt://\");window.location.href=i}else if(n&&typeof n.open==\"function\"){let i=this.tokenSession?.state;n.open({action:this.config.action??\"login\",locale:e,url:encodeURIComponent(t),appInfo:i?.appInfo??{},memberAppInfo:i?.memberAppInfo??{}})}else{let i=`${ct}?action=requestAuth&url=${encodeURIComponent(t)}`,a=414,s=736,o=window.screenX+window.innerWidth-a,c=window.screenY;window.open(i,\"did-wallet:popup\",`left=${o},top=${c},width=${a},height=${s},resizable,scrollbars=yes,status=1,popup`)}}handleSuccess(){if(!(!this.mounted||this.completed)){if(this.completed=!0,this.emit(\"success\"),this.options.preferenceKey&&this.activeMethod)try{localStorage.setItem(`did-login-method:${this.options.preferenceKey}`,this.activeMethod===\"oauth\"&&this.activeProvider?`oauth:${this.activeProvider}`:this.activeMethod)}catch{}if(this.options.onSuccess){let t=this.generation;Promise.resolve().then(()=>{if(this.mounted&&t===this.generation)return this.options.onSuccess?.()}).catch(()=>{!this.mounted||t!==this.generation||(this.completed=!1,this.showFullError(b(\"authFailed\",this.options.locale)))})}else setTimeout(()=>location.reload(),300)}}},ht=`${Te}${Se}\n:host { color-scheme: dark; }\n:host([data-theme=\"light\"]) { color-scheme: light; }\ndialog { box-sizing:border-box; position:fixed; inset:0; margin:auto; padding:0;\n width:min(420px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px);\n border:1px solid var(--border); border-radius:16px; background:var(--bg-card);\n color:var(--text); color-scheme:inherit; overflow:hidden; box-shadow:var(--shadow-lg); }\ndialog::backdrop { background:rgba(8,10,18,.56); }\n:host(:not([data-theme=\"light\"])) dialog::backdrop { background:rgba(0,0,0,.68); }\n[data-dialog-scroll] { max-height:calc(100dvh - 34px); overflow:auto; overscroll-behavior:contain; }\n.close { position:absolute; top:8px; right:8px; z-index:3; display:grid; place-items:center;\n box-sizing:border-box; width:44px; height:44px; padding:0; border:1px solid transparent;\n border-radius:10px; background:var(--bg-card); color:var(--text-secondary);\n font:400 24px/1 system-ui,sans-serif; cursor:pointer; }\n.close:hover { color:var(--text); background:var(--bg-hover); }\n.close:focus-visible { outline:2px solid var(--blue); outline-offset:-3px; }\n.host-error { padding:16px 20px; font:14px/1.5 system-ui,sans-serif; overflow-wrap:anywhere; }\n.retry { padding:10px 16px; margin:0 20px 20px; color:var(--text); background:var(--bg-elevated);\n border:1px solid var(--border); border-radius:8px; font:inherit; cursor:pointer; }\n`,Le=class{config;http;options;host;dialog;page;previous;themeObserver;systemTheme;syncTheme=()=>this.applyTheme(this.hostTheme());constructor(t,e,r={}){this.config=t,this.http=e,this.options=r}mount(){if(this.dialog)return;let t=document.documentElement.lang;t&&(this.options.locale=t);let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;this.previous=this.options.returnFocus??(e instanceof HTMLElement?e:void 0);let r=document.createElement(\"div\");r.dataset.didLoginDialogHost=\"\",r.style.cssText=\"position:fixed;width:0;height:0;\",this.host=r;let n=r.attachShadow({mode:\"open\"}),i=document.createElement(\"style\");i.textContent=ht,n.append(i);let a=document.createElement(\"dialog\");this.dialog=a,a.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",this.options.locale)),n.append(a);let s=document.createElement(\"button\");s.type=\"button\",s.className=\"close\",s.textContent=\"\\xD7\",s.setAttribute(\"aria-label\",b(\"cancel\",this.options.locale));let o=()=>{if(!(this.options.dismissible===!1||this.dialog!==a)){try{this.options.onEvent?.({name:\"cancel\",mode:\"dialog\"})}catch{}this.destroy(),this.options.onCancel?.()}};s.addEventListener(\"click\",o),this.options.dismissible!==!1&&a.append(s);let c=document.createElement(\"div\");c.dataset.dialogScroll=\"\",a.append(c);let l=document.createElement(\"div\");l.dataset.loginDialogMount=\"\",c.append(l),a.addEventListener(\"cancel\",u=>{u.preventDefault(),o()}),document.body.append(r);let f=this.hostTheme();r.dataset.theme=f,this.page=new me(l,this.config,this.http,{...this.options,theme:f,isolate:!0,mode:\"dialog\",onCancel:o,onLocaleChange:u=>{this.options.locale=u,s.setAttribute(\"aria-label\",b(\"cancel\",u)),a.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",u)),this.options.onLocaleChange?.(u)},onSuccess:async()=>{let u=()=>{if(!a.isConnected||this.dialog!==a)return;for(let D of c.querySelectorAll(\".host-error, .retry\"))D.remove();let E=document.createElement(\"p\");E.className=\"host-error\",E.setAttribute(\"role\",\"alert\"),E.textContent=b(\"authFailed\",this.options.locale);let v=document.createElement(\"button\");v.type=\"button\",v.className=\"retry\",v.textContent=b(\"tryAgain\",this.options.locale),v.onclick=async()=>{v.disabled=!0;try{await this.options.onSuccess?.(),this.dialog===a&&this.destroy()}catch{u()}},c.append(E,v)};try{await this.options.onSuccess?.(),this.dialog===a&&this.destroy()}catch{u()}}}),this.page.mount(),this.themeObserver=new MutationObserver(this.syncTheme);for(let u of[document.documentElement,document.body])this.themeObserver.observe(u,{attributes:!0,attributeFilter:[\"data-theme\",\"data-mode\",\"class\",\"style\"]});typeof window.matchMedia==\"function\"&&(this.systemTheme=window.matchMedia(\"(prefers-color-scheme: dark)\"),this.systemTheme.addEventListener(\"change\",this.syncTheme)),a.showModal();let p=l.shadowRoot?.querySelector(\"h1, h2\");p&&(p.tabIndex=-1,p.focus({preventScroll:!0}))}hostTheme(){for(let t of[document.documentElement,document.body])for(let e of[\"data-mode\",\"data-theme\"]){let r=t.getAttribute(e);if(r===\"light\"||r===\"dark\")return r;if(r===\"system\"||r===\"auto\")return window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}for(let t of[document.documentElement,document.body]){if(t.classList.contains(\"dark\"))return\"dark\";if(t.classList.contains(\"light\"))return\"light\"}for(let t of[document.body,document.documentElement]){let e=getComputedStyle(t).colorScheme.split(/\\s+/);if(e.includes(\"light\")&&e.includes(\"dark\"))return window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\";if(e.includes(\"light\"))return\"light\";if(e.includes(\"dark\"))return\"dark\"}return this.options.theme===\"light\"||this.options.theme===\"dark\"?this.options.theme:window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}setTheme(t){this.options.theme=t,this.applyTheme(t)}applyTheme(t){this.host&&(this.host.dataset.theme=t),this.page?.setTheme(t)}destroy(){this.themeObserver?.disconnect(),this.themeObserver=void 0,this.systemTheme?.removeEventListener(\"change\",this.syncTheme),this.systemTheme=void 0,this.page?.destroy(),this.page=void 0,this.dialog?.close(),this.dialog?.remove(),this.dialog=void 0,this.host?.remove(),this.host=void 0,this.previous?.isConnected&&this.previous.focus({preventScroll:!0})}};return $e(pt);})();\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=login-bundle-string.d.ts.map
|