@arcblock/did-connect-service 4.1.52 → 4.1.53

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.
Files changed (58) hide show
  1. package/dist/_generated/asset-bytes.js +1 -1
  2. package/dist/_generated/asset-manifest.js +4 -4
  3. package/dist/_generated/login-bundle-string.d.ts +1 -1
  4. package/dist/_generated/login-bundle-string.d.ts.map +1 -1
  5. package/dist/_generated/login-bundle-string.js +1 -1
  6. package/dist/_generated/login-bundle-string.js.map +1 -1
  7. package/dist/_generated/qr-bundle-string.d.ts +1 -1
  8. package/dist/_generated/qr-bundle-string.d.ts.map +1 -1
  9. package/dist/_generated/qr-bundle-string.js +1 -1
  10. package/dist/_generated/qr-bundle-string.js.map +1 -1
  11. package/dist/assets/{design.99dc4ddc.css → design.dfa1e109.css} +4 -4
  12. package/dist/assets/{login.fa75e481.css → login.941957f5.css} +88 -12
  13. package/dist/assets/login.f7787c55.js +847 -0
  14. package/dist/assets/{qr.c0d203ca.js → qr.dba9e6b3.js} +3 -3
  15. package/dist/handlers/access-key-connect-handler.d.ts +1 -1
  16. package/dist/handlers/access-key-connect-handler.d.ts.map +1 -1
  17. package/dist/handlers/access-key-connect-handler.js +1 -1
  18. package/dist/handlers/access-key-connect-handler.js.map +1 -1
  19. package/dist/handlers/auth-handler.d.ts.map +1 -1
  20. package/dist/handlers/auth-handler.js +35 -143
  21. package/dist/handlers/auth-handler.js.map +1 -1
  22. package/dist/handlers/login-page-model.d.ts +62 -0
  23. package/dist/handlers/login-page-model.d.ts.map +1 -0
  24. package/dist/handlers/login-page-model.js +218 -0
  25. package/dist/handlers/login-page-model.js.map +1 -0
  26. package/dist/handlers/passkey-handler.d.ts +17 -2
  27. package/dist/handlers/passkey-handler.d.ts.map +1 -1
  28. package/dist/handlers/passkey-handler.js +48 -107
  29. package/dist/handlers/passkey-handler.js.map +1 -1
  30. package/dist/handlers/team-handler.d.ts.map +1 -1
  31. package/dist/handlers/team-handler.js +1 -13
  32. package/dist/handlers/team-handler.js.map +1 -1
  33. package/dist/http/security-headers.d.ts +38 -0
  34. package/dist/http/security-headers.d.ts.map +1 -0
  35. package/dist/http/security-headers.js +67 -0
  36. package/dist/http/security-headers.js.map +1 -0
  37. package/dist/identity/webauthn.d.ts +1 -1
  38. package/dist/identity/webauthn.d.ts.map +1 -1
  39. package/dist/identity/webauthn.js +6 -3
  40. package/dist/identity/webauthn.js.map +1 -1
  41. package/dist/pages/gen-access-key-page.d.ts +15 -0
  42. package/dist/pages/gen-access-key-page.d.ts.map +1 -1
  43. package/dist/pages/gen-access-key-page.js +15 -2
  44. package/dist/pages/gen-access-key-page.js.map +1 -1
  45. package/dist/pages/invite-page.d.ts +9 -2
  46. package/dist/pages/invite-page.d.ts.map +1 -1
  47. package/dist/pages/invite-page.js +26 -28
  48. package/dist/pages/invite-page.js.map +1 -1
  49. package/dist/pages/login-bundle-entry.d.ts +1 -1
  50. package/dist/pages/login-bundle-entry.d.ts.map +1 -1
  51. package/dist/pages/login-bundle-entry.js +1 -1
  52. package/dist/pages/login-bundle-entry.js.map +1 -1
  53. package/dist/pages/login-page.d.ts +2 -0
  54. package/dist/pages/login-page.d.ts.map +1 -1
  55. package/dist/pages/login-page.js +39 -0
  56. package/dist/pages/login-page.js.map +1 -1
  57. package/package.json +5 -5
  58. package/dist/assets/login.e70223b2.js +0 -752
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by build-login.mjs — do not edit
2
- export 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+=\"&lt;\";break;case\">\":m+=\"&gt;\";break;case\"&\":m+=\"&amp;\";break;case'\"':m+=\"&quot;\";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,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#x27;\")}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";
2
+ export default "\"use strict\";var __LoginBundle=(()=>{var ae=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var Pe=(t,e)=>{for(var r in e)ae(t,r,{get:e[r],enumerable:!0})},Oe=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let i of Re(e))!Ne.call(t,i)&&i!==r&&ae(t,i,{get:()=>e[i],enumerable:!(o=Le(e,i))||o.enumerable});return t};var Me=t=>Oe(ae({},\"__esModule\",{value:!0}),t);var ht={};Pe(ht,{FetchHttpAdapter:()=>X,LoginDialog:()=>Se,LoginPage:()=>pe,runPasskeyAuth:()=>ie});var H={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 re=\"did:abt:\";function me(t){if(!t||typeof t!=\"string\")return!1;let e=t.replace(re,\"\");return/^(0x)?[0-9a-f]{40}$/i.test(e)}function ye(t,e=8,r=6){return!t||typeof t!=\"string\"?\"\":t.length<=e+r+3?t:`${t.slice(0,e)}...${t.slice(-r)}`}function ue(t,e={}){if(!t||typeof t!=\"string\")return{prefix:\"DID: ABT:\",chainLabel:\"ABT\",address:\"\",compact:\"\",copyText:\"\"};let{startChars:r=8,endChars:o=6}=e,i=me(t),a=t.replace(re,\"\"),s=i?\"ETH\":\"ABT\",n=e.includePrefix??!i;return{prefix:`DID: ${s}:`,chainLabel:s,address:a,compact:ye(a,r,o),copyText:n?`${re}${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 X=class{_defaultHeaders;_onRequest;constructor(e){this._defaultHeaders=e?.headers??{},this._onRequest=e?.onRequest}async get(e,r){this._validateUrl(e);let o=r?.params?this._serializeParams(r.params):\"\",i=o?`${e}${e.includes(\"?\")?\"&\":\"?\"}${o}`: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,o){this._validateUrl(e);let i=o?.params?this._serializeParams(o.params):\"\",a=i?`${e}${e.includes(\"?\")?\"&\":\"?\"}${i}`:e,n={method:\"POST\",headers:{\"Content-Type\":\"application/json\",...this._defaultHeaders,...o?.headers},body:r!==void 0?JSON.stringify(r):void 0,signal:o?.signal};return this._onRequest&&(n=this._onRequest(a,n)),this._execute(a,n)}_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 o;try{o=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(!o.ok){let s=\"\",n=\"\";try{let p=await o.text();try{let f=JSON.parse(p);f.error&&(s=f.error),f.code&&(n=f.code)}catch{s=p}}catch{}let u=n===\"FORBIDDEN\"?M.FORBIDDEN:M.NETWORK_ERROR;throw new O(u,s||`HTTP ${o.status} ${o.statusText||\"Error\"}`)}if(o.status===204)return null;let i=await o.text();if(!i.trim())return null;let a=o.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 o of Object.keys(e)){let i=e[o];if(i!=null)if(Array.isArray(i))for(let a of i)a!=null&&r.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(a))}`);else typeof i==\"boolean\"?r.push(`${encodeURIComponent(o)}=${i?\"true\":\"false\"}`):r.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(i))}`)}return r.join(\"&\")}};var be=[\"en\",\"zh\",\"zh-TW\",\"ja\"],vt=new Set(be);function Z(t){let e=t.apiPrefix??U.API_PREFIX,r=t.action??U.ACTION,o=e.replace(/\\/+$/,\"\"),i=r.replace(/^\\/+/,\"\");return`${o}/${i}`}function xe(){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,o){this._config=this._fillDefaults(e),this._http=r,this._realtime=o?.realtime,this._storage=o?.storage,this._state=xe(),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=`${Z(this._config)}/token`,o={};e?(e.locale!=null&&(o.locale=e.locale),e.provider!=null?o.provider=e.provider:o.provider=\"wallet\",e.encKey!=null&&(o.__encKey=e.encKey),e.autoConnect!=null&&(o.autoConnect=e.autoConnect),e.visitorId!=null&&(o.visitorId=e.visitorId),e.sourceToken!=null&&(o.sourceToken=e.sourceToken),e.forceConnected!=null&&(o.forceConnected=e.forceConnected),e.connectUrl!=null&&(o.connectUrl=e.connectUrl),e.extraParams&&Object.assign(o,e.extraParams)):o.provider=\"wallet\";try{let i=await this._http.get(r,{params:o});return this._state.token=i.token??null,this._state.url=i.url??null,this._state.status=H.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=H.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=`${Z(this._config)}/status`,r={[U.TOKEN_KEY]:this._state.token};this._config.appPid;try{let o=await this._http.get(e,{params:r}),i=o.status;return i&&(this._state.status=i),o.error!==void 0&&(this._state.error=o.error),o.connectedDid!==void 0&&(this._state.connectedDid=o.connectedDid),o.mfaCode!==void 0&&(this._state.mfaCode=o.mfaCode),o.saveConnect!==void 0&&(this._state.saveConnect=o.saveConnect),i===H.FORBIDDEN?(this._state.status=H.ERROR,this._state.error=o.error||\"Access forbidden\",this._emit(\"error\",new O(M.UNAUTHORIZED,this._state.error)),this.stopPolling()):i===H.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=o),this._emit(\"succeed\",this.state),this.stopPolling()):i===H.ERROR?(this._emit(\"error\",new O(M.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):i===H.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state),this.state}catch(o){throw o}}async cancel(){if(!this._state.token)return;let e=`${Z(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=xe(),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 o=this._listeners.get(e);return o||(o=new Set,this._listeners.set(e,o)),o.add(r),this}off(e,r){let o=this._listeners.get(e);return o&&(o.delete(r),o.size===0&&this._listeners.delete(e)),this}_emit(e,...r){let o=this._listeners.get(e);if(!(!o||o.size===0))for(let i of[...o])try{i(...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 O(M.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 O(M.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??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 B={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)\"}},Fe=`\n :root, :host {\n /* Backgrounds \\u2014 layered depth */\n --bg-root: ${B.bg.root};\n --bg-surface: ${B.bg.surface};\n --bg-card: ${B.bg.card};\n --bg-elevated: ${B.bg.elevated};\n --bg-hover: ${B.bg.hover};\n --bg-active: ${B.bg.active};\n --bg-input: ${B.bg.input};\n\n /* Borders \\u2014 semi-transparent for adaptability */\n --border: ${B.border.default};\n --border-subtle:${B.border.subtle};\n --border-strong:${B.border.strong};\n --border-focus: ${B.border.focus};\n\n /* Text hierarchy */\n --text: ${B.text.primary};\n --text-secondary:${B.text.secondary};\n --text-tertiary:${B.text.tertiary};\n --text-placeholder:${B.text.placeholder};\n --text-white: ${B.text.white};\n\n /* Accents */\n --blue: ${B.color.blue};\n --blue-hover: ${B.color.blueHover};\n --blue-light: ${B.color.blueLight};\n --blue-muted: ${B.color.blueMuted};\n --red: ${B.color.red};\n --red-light: ${B.color.redLight};\n --red-text: ${B.color.redText};\n --green: ${B.color.green};\n --green-light: ${B.color.greenLight};\n --green-text: ${B.color.greenText};\n --yellow: ${B.color.yellow};\n --yellow-light: ${B.color.yellowLight};\n --yellow-text: ${B.color.yellowText};\n --info: ${B.color.info};\n --info-light: ${B.color.infoLight};\n --info-text: ${B.color.infoText};\n\n /* Radii */\n --radius-xs: ${B.radius.xs};\n --radius-sm: ${B.radius.sm};\n --radius: ${B.radius.md};\n --radius-lg: ${B.radius.lg};\n --radius-full: ${B.radius.full};\n\n /* Shadows */\n --shadow-sm: ${B.shadow.sm};\n --shadow-md: ${B.shadow.md};\n --shadow-lg: ${B.shadow.lg};\n --shadow-focus: ${B.shadow.focus};\n }\n`,Te=`\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`,$e=`\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: ${B.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: ${B.font.sizeBase};\n line-height: ${B.font.lineHeight};\n }\n a { color: var(--blue-muted); text-decoration: none; }\n a:hover { text-decoration: underline; }\n .hidden { display: none; }\n`,Ue=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>',We='<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>',He=`\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`,Ke=class extends Ue{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 ue(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\"),o=!this.hasAttribute(\"no-copy\")&&this.getAttribute(\"copyable\")!==\"false\",i=this.hasAttribute(\"show-prefix\"),a=this.hasAttribute(\"no-tooltip\"),s=Number(this.getAttribute(\"size\"))||0,n=s>=12?`${s}px`:\"inherit\",u=r?e.compact:e.address,p=!a&&r?` title=\"${e.address}\"`:\"\",f=i?`<span class=\"prefix\">${e.prefix} </span>`:\"\",l=r?\"address-compact\":\"address\",d=o?\" clickable\":\"\",E=o?`<button class=\"copy-btn\" aria-label=\"Copy DID\">${we}</button>`:\"\";if(this.shadow.innerHTML=`\n <style>${He}:host { font-size: ${n}; }</style>\n ${f}<span class=\"${l}${d}\"${p}>${u}</span>${E}\n `,o){let A=this.shadow.querySelector(`.${l}`);A&&A.addEventListener(\"click\",x=>{x.stopPropagation(),this.copyToClipboard(e.copyText)});let _=this.shadow.querySelector(\".copy-btn\");_&&_.addEventListener(\"click\",x=>{x.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=We,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\",Ke);var le={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: {method}\",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\",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\\uFF1A{method}\",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\",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\\uFF1A{method}\",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\",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\\u306E\\u65B9\\u6CD5\\uFF1A{method}\",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\",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\"}},ce=[{code:\"en\",label:\"English\"},{code:\"zh\",label:\"\\u4E2D\\u6587\"}];function b(t,e,r){let o=e&&le[e]?e:\"en\",i=le[o][t]??le.en[t]??t;if(r)for(let[a,s]of Object.entries(r))i=i.replace(new RegExp(`\\\\{${a}\\\\}`,\"g\"),s);return i}var de='<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>',Ce='<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>',ze='<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>',ve='<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>',qe={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 je(t){return qe[t.toLowerCase()]??\"\"}var J=function(t,e){let i=t,a=ne[e],s=null,n=0,u=null,p=[],f={},l=function(c,m){n=i*4+17,s=(function(h){let y=new Array(h);for(let g=0;g<h;g+=1){y[g]=new Array(h);for(let w=0;w<h;w+=1)y[g][w]=null}return y})(n),d(0,0),d(n-7,0),d(0,n-7),_(),A(),v(c,m),i>=7&&x(c),u==null&&(u=N(i,a,p)),D(u,m)},d=function(c,m){for(let h=-1;h<=7;h+=1)if(!(c+h<=-1||n<=c+h))for(let y=-1;y<=7;y+=1)m+y<=-1||n<=m+y||(0<=h&&h<=6&&(y==0||y==6)||0<=y&&y<=6&&(h==0||h==6)||2<=h&&h<=4&&2<=y&&y<=4?s[c+h][m+y]=!0:s[c+h][m+y]=!1)},E=function(){let c=0,m=0;for(let h=0;h<8;h+=1){l(!0,h);let y=j.getLostPoint(f);(h==0||c>y)&&(c=y,m=h)}return m},A=function(){for(let c=8;c<n-8;c+=1)s[c][6]==null&&(s[c][6]=c%2==0);for(let c=8;c<n-8;c+=1)s[6][c]==null&&(s[6][c]=c%2==0)},_=function(){let c=j.getPatternPosition(i);for(let m=0;m<c.length;m+=1)for(let h=0;h<c.length;h+=1){let y=c[m],g=c[h];if(s[y][g]==null)for(let w=-2;w<=2;w+=1)for(let C=-2;C<=2;C+=1)w==-2||w==2||C==-2||C==2||w==0&&C==0?s[y+w][g+C]=!0:s[y+w][g+C]=!1}},x=function(c){let m=j.getBCHTypeNumber(i);for(let h=0;h<18;h+=1){let y=!c&&(m>>h&1)==1;s[Math.floor(h/3)][h%3+n-8-3]=y}for(let h=0;h<18;h+=1){let y=!c&&(m>>h&1)==1;s[h%3+n-8-3][Math.floor(h/3)]=y}},v=function(c,m){let h=a<<3|m,y=j.getBCHTypeInfo(h);for(let g=0;g<15;g+=1){let w=!c&&(y>>g&1)==1;g<6?s[g][8]=w:g<8?s[g+1][8]=w:s[n-15+g][8]=w}for(let g=0;g<15;g+=1){let w=!c&&(y>>g&1)==1;g<8?s[8][n-g-1]=w:g<9?s[8][15-g-1+1]=w:s[8][15-g-1]=w}s[n-8][8]=!c},D=function(c,m){let h=-1,y=n-1,g=7,w=0,C=j.getMaskFunction(m);for(let F=n-1;F>0;F-=2)for(F==6&&(F-=1);;){for(let L=0;L<2;L+=1)if(s[y][F-L]==null){let P=!1;w<c.length&&(P=(c[w]>>>g&1)==1),C(y,F-L)&&(P=!P),s[y][F-L]=P,g-=1,g==-1&&(w+=1,g=7)}if(y+=h,y<0||n<=y){y-=h,h=-h;break}}},T=function(c,m){let h=0,y=0,g=0,w=new Array(m.length),C=new Array(m.length);for(let k=0;k<m.length;k+=1){let R=m[k].dataCount,z=m[k].totalCount-R;y=Math.max(y,R),g=Math.max(g,z),w[k]=new Array(R);for(let V=0;V<w[k].length;V+=1)w[k][V]=255&c.getBuffer()[V+h];h+=R;let se=j.getErrorCorrectPolynomial(z),fe=oe(w[k],se.getLength()-1).mod(se);C[k]=new Array(se.getLength()-1);for(let V=0;V<C[k].length;V+=1){let ge=V+fe.getLength()-C[k].length;C[k][V]=ge>=0?fe.getAt(ge):0}}let F=0;for(let k=0;k<m.length;k+=1)F+=m[k].totalCount;let L=new Array(F),P=0;for(let k=0;k<y;k+=1)for(let R=0;R<m.length;R+=1)k<w[R].length&&(L[P]=w[R][k],P+=1);for(let k=0;k<g;k+=1)for(let R=0;R<m.length;R+=1)k<C[R].length&&(L[P]=C[R][k],P+=1);return L},N=function(c,m,h){let y=Ae.getRSBlocks(c,m),g=_e();for(let C=0;C<h.length;C+=1){let F=h[C];g.put(F.getMode(),4),g.put(F.getLength(),j.getLengthInBits(F.getMode(),c)),F.write(g)}let w=0;for(let C=0;C<y.length;C+=1)w+=y[C].dataCount;if(g.getLengthInBits()>w*8)throw\"code length overflow. (\"+g.getLengthInBits()+\">\"+w*8+\")\";for(g.getLengthInBits()+4<=w*8&&g.put(0,4);g.getLengthInBits()%8!=0;)g.putBit(!1);for(;!(g.getLengthInBits()>=w*8||(g.put(236,8),g.getLengthInBits()>=w*8));)g.put(17,8);return T(g,y)};f.addData=function(c,m){m=m||\"Byte\";let h=null;switch(m){case\"Numeric\":h=Ye(c);break;case\"Alphanumeric\":h=Qe(c);break;case\"Byte\":h=Ge(c);break;case\"Kanji\":h=Je(c);break;default:throw\"mode:\"+m}p.push(h),u=null},f.isDark=function(c,m){if(c<0||n<=c||m<0||n<=m)throw c+\",\"+m;return s[c][m]},f.getModuleCount=function(){return n},f.make=function(){if(i<1){let c=1;for(;c<40;c++){let m=Ae.getRSBlocks(c,a),h=_e();for(let g=0;g<p.length;g++){let w=p[g];h.put(w.getMode(),4),h.put(w.getLength(),j.getLengthInBits(w.getMode(),c)),w.write(h)}let y=0;for(let g=0;g<m.length;g++)y+=m[g].dataCount;if(h.getLengthInBits()<=y*8)break}i=c}l(!1,E())},f.createTableTag=function(c,m){c=c||2,m=typeof m>\"u\"?c*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 y=0;y<f.getModuleCount();y+=1){h+=\"<tr>\";for(let g=0;g<f.getModuleCount();g+=1)h+='<td style=\"',h+=\" border-width: 0px; border-style: none;\",h+=\" border-collapse: collapse;\",h+=\" padding: 0px; margin: 0px;\",h+=\" width: \"+c+\"px;\",h+=\" height: \"+c+\"px;\",h+=\" background-color: \",h+=f.isDark(y,g)?\"#000000\":\"#ffffff\",h+=\";\",h+='\"/>';h+=\"</tr>\"}return h+=\"</tbody>\",h+=\"</table>\",h},f.createSvgTag=function(c,m,h,y){let g={};typeof arguments[0]==\"object\"&&(g=arguments[0],c=g.cellSize,m=g.margin,h=g.alt,y=g.title),c=c||2,m=typeof m>\"u\"?c*4:m,h=typeof h==\"string\"?{text:h}:h||{},h.text=h.text||null,h.id=h.text?h.id||\"qrcode-description\":null,y=typeof y==\"string\"?{text:y}:y||{},y.text=y.text||null,y.id=y.text?y.id||\"qrcode-title\":null;let w=f.getModuleCount()*c+m*2,C,F,L,P,k=\"\",R;for(R=\"l\"+c+\",0 0,\"+c+\" -\"+c+\",0 0,-\"+c+\"z \",k+='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"',k+=g.scalable?\"\":' width=\"'+w+'px\" height=\"'+w+'px\"',k+=' viewBox=\"0 0 '+w+\" \"+w+'\" ',k+=' preserveAspectRatio=\"xMinYMin meet\"',k+=y.text||h.text?' role=\"img\" aria-labelledby=\"'+I([y.id,h.id].join(\" \").trim())+'\"':\"\",k+=\">\",k+=y.text?'<title id=\"'+I(y.id)+'\">'+I(y.text)+\"</title>\":\"\",k+=h.text?'<description id=\"'+I(h.id)+'\">'+I(h.text)+\"</description>\":\"\",k+='<rect width=\"100%\" height=\"100%\" fill=\"white\" cx=\"0\" cy=\"0\"/>',k+='<path d=\"',L=0;L<f.getModuleCount();L+=1)for(P=L*c+m,C=0;C<f.getModuleCount();C+=1)f.isDark(L,C)&&(F=C*c+m,k+=\"M\"+F+\",\"+P+R);return k+='\" stroke=\"transparent\" fill=\"black\"/>',k+=\"</svg>\",k},f.createDataURL=function(c,m){c=c||2,m=typeof m>\"u\"?c*4:m;let h=f.getModuleCount()*c+m*2,y=m,g=h-m;return tt(h,h,function(w,C){if(y<=w&&w<g&&y<=C&&C<g){let F=Math.floor((w-y)/c),L=Math.floor((C-y)/c);return f.isDark(L,F)?0:1}else return 1})},f.createImgTag=function(c,m,h){c=c||2,m=typeof m>\"u\"?c*4:m;let y=f.getModuleCount()*c+m*2,g=\"\";return g+=\"<img\",g+=' src=\"',g+=f.createDataURL(c,m),g+='\"',g+=' width=\"',g+=y,g+='\"',g+=' height=\"',g+=y,g+='\"',h&&(g+=' alt=\"',g+=I(h),g+='\"'),g+=\"/>\",g};let I=function(c){let m=\"\";for(let h=0;h<c.length;h+=1){let y=c.charAt(h);switch(y){case\"<\":m+=\"&lt;\";break;case\">\":m+=\"&gt;\";break;case\"&\":m+=\"&amp;\";break;case'\"':m+=\"&quot;\";break;default:m+=y;break}}return m},S=function(c){c=typeof c>\"u\"?2:c;let h=f.getModuleCount()*1+c*2,y=c,g=h-c,w,C,F,L,P,k={\"\\u2588\\u2588\":\"\\u2588\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\"\\u2584\",\" \":\" \"},R={\"\\u2588\\u2588\":\"\\u2580\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\" \",\" \":\" \"},z=\"\";for(w=0;w<h;w+=2){for(F=Math.floor((w-y)/1),L=Math.floor((w+1-y)/1),C=0;C<h;C+=1)P=\"\\u2588\",y<=C&&C<g&&y<=w&&w<g&&f.isDark(F,Math.floor((C-y)/1))&&(P=\" \"),y<=C&&C<g&&y<=w+1&&w+1<g&&f.isDark(L,Math.floor((C-y)/1))?P+=\" \":P+=\"\\u2588\",z+=c<1&&w+1>=g?R[P]:k[P];z+=`\n`}return h%2&&c>0?z.substring(0,z.length-h-1)+Array(h+1).join(\"\\u2580\"):z.substring(0,z.length-1)};return f.createASCII=function(c,m){if(c=c||1,c<2)return S(m);c-=1,m=typeof m>\"u\"?c*2:m;let h=f.getModuleCount()*c+m*2,y=m,g=h-m,w,C,F,L,P=Array(c+1).join(\"\\u2588\\u2588\"),k=Array(c+1).join(\" \"),R=\"\",z=\"\";for(w=0;w<h;w+=1){for(F=Math.floor((w-y)/c),z=\"\",C=0;C<h;C+=1)L=1,y<=C&&C<g&&y<=w&&w<g&&f.isDark(F,Math.floor((C-y)/c))&&(L=0),z+=L?P:k;for(F=0;F<c;F+=1)R+=z+`\n`}return R.substring(0,R.length-1)},f.renderTo2dContext=function(c,m){m=m||2;let h=f.getModuleCount();for(let y=0;y<h;y++)for(let g=0;g<h;g++)c.fillStyle=f.isDark(y,g)?\"black\":\"white\",c.fillRect(g*m,y*m,m,m)},f};J.stringToBytes=function(t){let e=[];for(let r=0;r<t.length;r+=1){let o=t.charCodeAt(r);e.push(o&255)}return e};J.createStringToBytes=function(t,e){let r=(function(){let i=Ze(t),a=function(){let u=i.read();if(u==-1)throw\"eof\";return u},s=0,n={};for(;;){let u=i.read();if(u==-1)break;let p=a(),f=a(),l=a(),d=String.fromCharCode(u<<8|p),E=f<<8|l;n[d]=E,s+=1}if(s!=e)throw s+\" != \"+e;return n})(),o=63;return function(i){let a=[];for(let s=0;s<i.length;s+=1){let n=i.charCodeAt(s);if(n<128)a.push(n);else{let u=r[i.charAt(s)];typeof u==\"number\"?(u&255)==u?a.push(u):(a.push(u>>>8),a.push(u&255)):a.push(o)}}return a}};var W={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ne={L:1,M:0,Q:3,H:2},q={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},j=(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,o=21522,i={},a=function(s){let n=0;for(;s!=0;)n+=1,s>>>=1;return n};return i.getBCHTypeInfo=function(s){let n=s<<10;for(;a(n)-a(e)>=0;)n^=e<<a(n)-a(e);return(s<<10|n)^o},i.getBCHTypeNumber=function(s){let n=s<<12;for(;a(n)-a(r)>=0;)n^=r<<a(n)-a(r);return s<<12|n},i.getPatternPosition=function(s){return t[s-1]},i.getMaskFunction=function(s){switch(s){case q.PATTERN000:return function(n,u){return(n+u)%2==0};case q.PATTERN001:return function(n,u){return n%2==0};case q.PATTERN010:return function(n,u){return u%3==0};case q.PATTERN011:return function(n,u){return(n+u)%3==0};case q.PATTERN100:return function(n,u){return(Math.floor(n/2)+Math.floor(u/3))%2==0};case q.PATTERN101:return function(n,u){return n*u%2+n*u%3==0};case q.PATTERN110:return function(n,u){return(n*u%2+n*u%3)%2==0};case q.PATTERN111:return function(n,u){return(n*u%3+(n+u)%2)%2==0};default:throw\"bad maskPattern:\"+s}},i.getErrorCorrectPolynomial=function(s){let n=oe([1],0);for(let u=0;u<s;u+=1)n=n.multiply(oe([1,Y.gexp(u)],0));return n},i.getLengthInBits=function(s,n){if(1<=n&&n<10)switch(s){case W.MODE_NUMBER:return 10;case W.MODE_ALPHA_NUM:return 9;case W.MODE_8BIT_BYTE:return 8;case W.MODE_KANJI:return 8;default:throw\"mode:\"+s}else if(n<27)switch(s){case W.MODE_NUMBER:return 12;case W.MODE_ALPHA_NUM:return 11;case W.MODE_8BIT_BYTE:return 16;case W.MODE_KANJI:return 10;default:throw\"mode:\"+s}else if(n<41)switch(s){case W.MODE_NUMBER:return 14;case W.MODE_ALPHA_NUM:return 13;case W.MODE_8BIT_BYTE:return 16;case W.MODE_KANJI:return 12;default:throw\"mode:\"+s}else throw\"type:\"+n},i.getLostPoint=function(s){let n=s.getModuleCount(),u=0;for(let l=0;l<n;l+=1)for(let d=0;d<n;d+=1){let E=0,A=s.isDark(l,d);for(let _=-1;_<=1;_+=1)if(!(l+_<0||n<=l+_))for(let x=-1;x<=1;x+=1)d+x<0||n<=d+x||_==0&&x==0||A==s.isDark(l+_,d+x)&&(E+=1);E>5&&(u+=3+E-5)}for(let l=0;l<n-1;l+=1)for(let d=0;d<n-1;d+=1){let E=0;s.isDark(l,d)&&(E+=1),s.isDark(l+1,d)&&(E+=1),s.isDark(l,d+1)&&(E+=1),s.isDark(l+1,d+1)&&(E+=1),(E==0||E==4)&&(u+=3)}for(let l=0;l<n;l+=1)for(let d=0;d<n-6;d+=1)s.isDark(l,d)&&!s.isDark(l,d+1)&&s.isDark(l,d+2)&&s.isDark(l,d+3)&&s.isDark(l,d+4)&&!s.isDark(l,d+5)&&s.isDark(l,d+6)&&(u+=40);for(let l=0;l<n;l+=1)for(let d=0;d<n-6;d+=1)s.isDark(d,l)&&!s.isDark(d+1,l)&&s.isDark(d+2,l)&&s.isDark(d+3,l)&&s.isDark(d+4,l)&&!s.isDark(d+5,l)&&s.isDark(d+6,l)&&(u+=40);let p=0;for(let l=0;l<n;l+=1)for(let d=0;d<n;d+=1)s.isDark(d,l)&&(p+=1);let f=Math.abs(100*p/n/n-50)/5;return u+=f*10,u},i})(),Y=(function(){let t=new Array(256),e=new Array(256);for(let o=0;o<8;o+=1)t[o]=1<<o;for(let o=8;o<256;o+=1)t[o]=t[o-4]^t[o-5]^t[o-6]^t[o-8];for(let o=0;o<255;o+=1)e[t[o]]=o;let r={};return r.glog=function(o){if(o<1)throw\"glog(\"+o+\")\";return e[o]},r.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return t[o]},r})(),oe=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})(),o={};return o.getAt=function(i){return r[i]},o.getLength=function(){return r.length},o.multiply=function(i){let a=new Array(o.getLength()+i.getLength()-1);for(let s=0;s<o.getLength();s+=1)for(let n=0;n<i.getLength();n+=1)a[s+n]^=Y.gexp(Y.glog(o.getAt(s))+Y.glog(i.getAt(n)));return oe(a,0)},o.mod=function(i){if(o.getLength()-i.getLength()<0)return o;let a=Y.glog(o.getAt(0))-Y.glog(i.getAt(0)),s=new Array(o.getLength());for(let n=0;n<o.getLength();n+=1)s[n]=o.getAt(n);for(let n=0;n<i.getLength();n+=1)s[n]^=Y.gexp(Y.glog(i.getAt(n))+a);return oe(s,0).mod(i)},o},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={},o=function(i,a){switch(a){case ne.L:return t[(i-1)*4+0];case ne.M:return t[(i-1)*4+1];case ne.Q:return t[(i-1)*4+2];case ne.H:return t[(i-1)*4+3];default:return}};return r.getRSBlocks=function(i,a){let s=o(i,a);if(typeof s>\"u\")throw\"bad rs block @ typeNumber:\"+i+\"/errorCorrectionLevel:\"+a;let n=s.length/3,u=[];for(let p=0;p<n;p+=1){let f=s[p*3+0],l=s[p*3+1],d=s[p*3+2];for(let E=0;E<f;E+=1)u.push(e(l,d))}return u},r})(),_e=function(){let t=[],e=0,r={};return r.getBuffer=function(){return t},r.getAt=function(o){let i=Math.floor(o/8);return(t[i]>>>7-o%8&1)==1},r.put=function(o,i){for(let a=0;a<i;a+=1)r.putBit((o>>>i-a-1&1)==1)},r.getLengthInBits=function(){return e},r.putBit=function(o){let i=Math.floor(e/8);t.length<=i&&t.push(0),o&&(t[i]|=128>>>e%8),e+=1},r},Ye=function(t){let e=W.MODE_NUMBER,r=t,o={};o.getMode=function(){return e},o.getLength=function(s){return r.length},o.write=function(s){let n=r,u=0;for(;u+2<n.length;)s.put(i(n.substring(u,u+3)),10),u+=3;u<n.length&&(n.length-u==1?s.put(i(n.substring(u,u+1)),4):n.length-u==2&&s.put(i(n.substring(u,u+2)),7))};let i=function(s){let n=0;for(let u=0;u<s.length;u+=1)n=n*10+a(s.charAt(u));return n},a=function(s){if(\"0\"<=s&&s<=\"9\")return s.charCodeAt(0)-48;throw\"illegal char :\"+s};return o},Qe=function(t){let e=W.MODE_ALPHA_NUM,r=t,o={};o.getMode=function(){return e},o.getLength=function(a){return r.length},o.write=function(a){let s=r,n=0;for(;n+1<s.length;)a.put(i(s.charAt(n))*45+i(s.charAt(n+1)),11),n+=2;n<s.length&&a.put(i(s.charAt(n)),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 o},Ge=function(t){let e=W.MODE_8BIT_BYTE,r=t,o=J.stringToBytes(t),i={};return i.getMode=function(){return e},i.getLength=function(a){return o.length},i.write=function(a){for(let s=0;s<o.length;s+=1)a.put(o[s],8)},i},Je=function(t){let e=W.MODE_KANJI,r=t,o=J.stringToBytes;(function(s,n){let u=o(s);if(u.length!=2||(u[0]<<8|u[1])!=n)throw\"sjis not supported.\"})(\"\\u53CB\",38726);let i=o(t),a={};return a.getMode=function(){return e},a.getLength=function(s){return~~(i.length/2)},a.write=function(s){let n=i,u=0;for(;u+1<n.length;){let p=(255&n[u])<<8|255&n[u+1];if(33088<=p&&p<=40956)p-=33088;else if(57408<=p&&p<=60351)p-=49472;else throw\"illegal char at \"+(u+1)+\"/\"+p;p=(p>>>8&255)*192+(p&255),s.put(p,13),u+=2}if(u<n.length)throw\"illegal char at \"+(u+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,o,i){o=o||0,i=i||r.length;for(let a=0;a<i;a+=1)e.writeByte(r[a+o])},e.writeString=function(r){for(let o=0;o<r.length;o+=1)e.writeByte(r.charCodeAt(o))},e.toByteArray=function(){return t},e.toString=function(){let r=\"\";r+=\"[\";for(let o=0;o<t.length;o+=1)o>0&&(r+=\",\"),r+=t[o];return r+=\"]\",r},e},Xe=function(){let t=0,e=0,r=0,o=\"\",i={},a=function(n){o+=String.fromCharCode(s(n&63))},s=function(n){if(n<0)throw\"n:\"+n;if(n<26)return 65+n;if(n<52)return 97+(n-26);if(n<62)return 48+(n-52);if(n==62)return 43;if(n==63)return 47;throw\"n:\"+n};return i.writeByte=function(n){for(t=t<<8|n&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 n=3-r%3;for(let u=0;u<n;u+=1)o+=\"=\"}},i.toString=function(){return o},i},Ze=function(t){let e=t,r=0,o=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 u=e.charAt(r);if(r+=1,u==\"=\")return i=0,-1;if(u.match(/^\\s$/))continue;o=o<<6|s(u.charCodeAt(0)),i+=6}let n=o>>>i-8&255;return i-=8,n};let s=function(n){if(65<=n&&n<=90)return n-65;if(97<=n&&n<=122)return n-97+26;if(48<=n&&n<=57)return n-48+52;if(n==43)return 62;if(n==47)return 63;throw\"c:\"+n};return a},et=function(t,e){let r=t,o=e,i=new Array(t*e),a={};a.setPixel=function(p,f,l){i[f*r+p]=l},a.write=function(p){p.writeString(\"GIF87a\"),p.writeShort(r),p.writeShort(o),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(o),p.writeByte(0);let f=2,l=n(f);p.writeByte(f);let d=0;for(;l.length-d>255;)p.writeByte(255),p.writeBytes(l,d,255),d+=255;p.writeByte(l.length-d),p.writeBytes(l,d,l.length-d),p.writeByte(0),p.writeString(\";\")};let s=function(p){let f=p,l=0,d=0,E={};return E.write=function(A,_){if(A>>>_)throw\"length over\";for(;l+_>=8;)f.writeByte(255&(A<<l|d)),_-=8-l,A>>>=8-l,d=0,l=0;d=A<<l|d,l=l+_},E.flush=function(){l>0&&f.writeByte(d)},E},n=function(p){let f=1<<p,l=(1<<p)+1,d=p+1,E=u();for(let D=0;D<f;D+=1)E.add(String.fromCharCode(D));E.add(String.fromCharCode(f)),E.add(String.fromCharCode(l));let A=Ie(),_=s(A);_.write(f,d);let x=0,v=String.fromCharCode(i[x]);for(x+=1;x<i.length;){let D=String.fromCharCode(i[x]);x+=1,E.contains(v+D)?v=v+D:(_.write(E.indexOf(v),d),E.size()<4095&&(E.size()==1<<d&&(d+=1),E.add(v+D)),v=D)}return _.write(E.indexOf(v),d),_.write(l,d),_.flush(),A.toByteArray()},u=function(){let p={},f=0,l={};return l.add=function(d){if(l.contains(d))throw\"dup key:\"+d;p[d]=f,f+=1},l.size=function(){return f},l.indexOf=function(d){return p[d]},l.contains=function(d){return typeof p[d]<\"u\"},l};return a},tt=function(t,e,r){let o=et(t,e);for(let n=0;n<e;n+=1)for(let u=0;u<t;u+=1)o.setPixel(u,n,r(u,n));let i=Ie();o.write(i);let a=Xe(),s=i.toByteArray();for(let n=0;n<s.length;n+=1)a.writeByte(s[n]);return a.flush(),\"data:image/gif;base64,\"+a},nt=J,vn=J.stringToBytes,ot=\"#e8e8e8\",rt=\"#ffffff\";function it(t){let e=t.getRootNode(),r=e instanceof ShadowRoot?e.host:document.documentElement;return(r instanceof Element?r.getAttribute(\"data-theme\"):null)===\"light\"?rt:ot}function Be(t,e,r=200){he(t),t.dataset.qrUrl=e;let o=document.createElement(\"canvas\"),i=o.getContext?.(\"2d\")??null;if(!i){let l=document.createElement(\"a\");l.href=e,l.textContent=\"Open in DID Wallet\",l.target=\"_blank\",l.rel=\"noopener\",t.appendChild(l);return}let a=nt(0,\"M\");a.addData(e),a.make();let s=a.getModuleCount(),n=Math.floor(r/s),u=n*s;o.width=u,o.height=u,o.style.display=\"block\",o.style.width=`${r}px`,o.style.height=`${r}px`,o.style.imageRendering=\"pixelated\";let p=it(t);i.fillStyle=p,i.fillRect(0,0,u,u),i.fillStyle=\"#000000\";for(let l=0;l<s;l++)for(let d=0;d<s;d++)a.isDark(l,d)&&i.fillRect(d*n,l*n,n,n);let f=document.createElement(\"div\");f.className=\"qr-plate\",f.style.display=\"inline-block\",f.style.padding=\"10px\",f.style.backgroundColor=p,f.style.borderRadius=\"8px\",f.style.lineHeight=\"0\",f.appendChild(o),t.appendChild(f)}function he(t){t.innerHTML=\"\",delete t.dataset.qrUrl}var st=`\n${Fe}\n${Te}\n${$e}\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.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\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; }\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 { position: absolute; top: calc(100% + 8px); left: 0; z-index: 4; margin-top: 0;\n width: max-content; max-width: min(260px,calc(100vw - 80px)); padding: 6px;\n background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); }\n.card-modal .locale-menu .locale-btn { min-height: 40px; height: auto; text-align: left; border-radius: 6px; }\n.card-modal .locale-menu .locale-btn span { overflow-wrap: anywhere; }\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.card-modal .back-btn { position: static; display: flex; width: max-content; max-width: 100%; margin: 0 0 16px; }\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 Q(t){let e=new Uint8Array(t),r=\"\";for(let o=0;o<e.length;o++)r+=String.fromCharCode(e[o]);return btoa(r).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=+$/,\"\")}function te(t){let e=t.replace(/-/g,\"+\").replace(/_/g,\"/\"),r=atob(e),o=new Uint8Array(r.length);for(let i=0;i<r.length;i++)o[i]=r.charCodeAt(i);return o.buffer}function at(t){let e=t.response;return{id:t.id,rawId:Q(t.rawId),type:t.type,response:{attestationObject:Q(e.attestationObject),clientDataJSON:Q(e.clientDataJSON)},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}function ut(t){let e=t.response;return{id:t.id,rawId:Q(t.rawId),type:t.type,response:{authenticatorData:Q(e.authenticatorData),clientDataJSON:Q(e.clientDataJSON),signature:Q(e.signature),userHandle:e.userHandle?Q(e.userHandle):void 0},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}async function ie(t){let e=t.prefix||\"/.well-known/service/api/passkey\",r=t.onStatus||(()=>{}),o=t.authOnly||!1,i=t.registerOnly||!1,a=t.invitationId||void 0,s=t.locale,n=t.texts||{},u=n.waiting||b(\"passkeyWaiting\",s),p=n.creating||b(\"passkeyCreating\",s),f=n.verifying||b(\"verifying\",s);async function l(){let x=await fetch(`${e}/auth`,{method:\"GET\",signal:t.signal});if(!x.ok)throw new Error(b(\"authFailed\",s));return x.json()}async function d(x){let v=[];x&&v.push(`name=${encodeURIComponent(x)}`),a&&v.push(`invitationId=${encodeURIComponent(a)}`);let D=v.length?`?${v.join(\"&\")}`:\"\",T=await fetch(`${e}/register${D}`,{method:\"GET\",signal:t.signal});if(!T.ok)throw new Error(b(\"registrationFailed\",s));return T.json()}function E(x,v){let D=new Error(x);throw v&&(D.code=v),D}async function A(x,v){let D=await fetch(`${e}/auth`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:x,credential:v})});if(!D.ok){let T=await D.json().catch(()=>({}));E(T.error||b(\"authFailed\",s),T.code)}return D.json()}async function _(x,v,D){let T=await fetch(`${e}/register`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:x,credential:v,name:D||void 0})});if(!T.ok){let N=await T.json().catch(()=>({}));E(N.error||b(\"registrationFailed\",s),N.code)}return T.json()}if(!i){r(u,!1);try{let x=await l(),{challengeId:v}=x,D=x.authentication||x,T={signal:t.signal,publicKey:{...D,challenge:te(D.challenge),allowCredentials:(D.allowCredentials||[]).map(I=>({...I,id:te(I.id)}))}},N;try{N=await navigator.credentials.get(T)}catch{if(o)return{success:!1,error:\"no_passkey\"}}if(!N&&o)return{success:!1,error:\"no_passkey\"};if(t.signal?.aborted)return{success:!1,error:\"cancelled\"};if(N){let I=ut(N);return r(f,!1),await A(v,I),{success:!0}}}catch(x){let v=x instanceof Error?x.message:b(\"authFailed\",s),D=x instanceof Error?x.code:void 0;return r(v,!0),{success:!1,error:v,code:D}}}try{let x=await d(t.name||\"\");if(x.registrationAllowed===!1)return r(b(\"regClosed\",s),!0),{success:!1,error:\"registration_closed\"};r(p,!1);let v=x.registration||x,D={signal:t.signal,publicKey:{...v,challenge:te(v.challenge),user:{...v.user,id:te(v.user.id)},excludeCredentials:(v.excludeCredentials||[]).map(I=>({...I,id:te(I.id)}))}},T=await navigator.credentials.create(D);if(!T||t.signal?.aborted)return{success:!1,error:b(\"passkeyNoLocal\",s)};let N=at(T);return r(f,!1),await _(x.challengeId,N,t.name||\"\"),{success:!0}}catch(x){let v=x instanceof Error&&(x.name===\"NotAllowedError\"||x.name===\"AbortError\")?b(\"passkeyNoLocal\",s):x instanceof Error?x.message:b(\"passkeySetupFailed\",s),D=x instanceof Error?x.code:void 0;return r(v,!0),{success:!1,error:v,code:D}}}function G(t,e){let r=t instanceof Error?t.message:\"\",o=t instanceof Error&&\"code\"in t?t.code:\"\";return o===\"FORBIDDEN\"?b(\"accessDenied\",e):r===\"registration_closed\"||o===\"registration_closed\"?b(\"regClosed\",e):r||b(\"authFailed\",e)}var lt=\"https://web.abtwallet.io/\";function De(){return typeof navigator>\"u\"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function ct(){return typeof window>\"u\"?null:window.ABT_DEV??window.ABT??null}function K(t){return t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#x27;\")}var pe=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,o){if(this.container=t,this.config=e,this.http=r,this.isolate=o?.isolate===!0,this.options={methods:[\"passkey\",\"did-connect\"],locale:\"en\",...o},!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=st,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 o=i=>{i?e.dataset.theme=\"light\":e.removeAttribute(\"data-theme\"),this.repaintQRPlate()};o(r.matches),this.mediaListener=i=>o(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\")||Be(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){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(ce.length<2)return;let r=document.createElement(\"div\");r.className=\"locale-switcher\";let o=this.options.locale,i=ce.find(s=>s.code!==o)??ce[0],a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-btn\",a.innerHTML=`${ke} ${K(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,o=e.find(p=>p.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=`${ke} <span class=\"locale-label\">${K(o.label)}</span>`,a.title=o.label;let s=document.createElement(\"div\");s.className=\"locale-menu\",s.setAttribute(\"role\",\"menu\"),s.hidden=!0;let n=p=>{i.classList.toggle(\"open\",p),s.hidden=!p,a.setAttribute(\"aria-expanded\",p?\"true\":\"false\")};a.addEventListener(\"click\",p=>{p.stopPropagation(),n(s.hidden)});for(let p of e){let f=p.code===o.code,l=document.createElement(\"button\");if(l.type=\"button\",l.className=\"locale-btn\",l.setAttribute(\"role\",\"menuitemradio\"),l.setAttribute(\"aria-checked\",f?\"true\":\"false\"),l.dataset.locale=p.code,l.title=p.label,f){let E=document.createElement(\"span\");E.className=\"locale-check\",E.setAttribute(\"aria-hidden\",\"true\"),E.textContent=\"\\u2713\",l.appendChild(E)}let d=document.createElement(\"span\");d.textContent=p.label,l.appendChild(d),l.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(p.code),this.update({locale:p.code})}),s.appendChild(l)}let u=p=>{let f=p.composedPath();f.includes(i)||this.isolate&&f.includes(this.container)||n(!1)};document.addEventListener(\"click\",u),this.localeOutsideClick=u,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}}renderMethodsView(t,e,r){if(this.options.mode!==\"dialog\"&&this.renderHomeLink(t,e),this.renderBrandHeader(t,e),this.options.preferenceKey)try{let n=localStorage.getItem(`did-login-method:${this.options.preferenceKey}`),u={passkey:\"Passkey\",oauth:\"OAuth\",email:b(\"emailButton\",e),\"did-connect\":\"DID Wallet\"},p=n?.startsWith(\"oauth:\")?this.options.oauthProviders?.find(l=>l.enabled&&`oauth:${l.id}`===n):void 0,f=p?.name??(n?u[n]:void 0);if(n&&f&&(r.includes(n)||p&&r.includes(\"oauth\"))){let l=document.createElement(\"p\");l.className=\"subtitle\",l.textContent=b(\"lastUsed\",e,{method:f}),t.appendChild(l)}}catch{}let o=this.options.methods.includes(\"passkey\");if(o&&!r.includes(\"passkey\")){let n=document.createElement(\"div\");n.className=\"compat-warning\",n.textContent=b(\"passkeyUnsupported\",e),t.appendChild(n)}let i=this.options.preferredLayout!==\"passkey-first\"&&r.includes(\"oauth\")&&this.options.oauthProviders?.some(n=>n.enabled&&[\"google\",\"apple\"].includes(n.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(n=>n!==\"passkey\");if(a&&s.length>0&&this.renderDivider(t,e),s.length>0)if(i){r.includes(\"email\")&&this.renderSecondaryGrid(t,e,[\"email\"]);let n=document.createElement(\"details\");n.className=\"other-methods\";let u=document.createElement(\"summary\");u.textContent=b(\"otherMethods\",e),n.appendChild(u),this.renderSecondaryGrid(n,e,r.filter(p=>p!==\"email\"),\"secondary\"),n.querySelector(\"button\")&&t.appendChild(n)}else this.renderSecondaryGrid(t,e,r);if(r.length===0&&!o){let n=document.createElement(\"p\");n.className=\"subtitle\",n.textContent=\"No authentication methods available.\",t.appendChild(n)}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 o=document.createElement(\"div\");o.id=\"did-connect-qr\",o.className=\"qr-view\",o.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',t.appendChild(o);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,De()?t.insertBefore(i,o):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,o,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 o=document.createElement(\"label\");o.className=\"input-label\",o.htmlFor=\"login-email-address\",o.textContent=b(\"emailPlaceholder\",e),t.appendChild(o);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 n=document.createElement(\"div\");n.className=\"status\",n.setAttribute(\"role\",\"status\"),t.appendChild(n);let u=document.createElement(\"div\");u.className=\"email-code-section\",u.style.display=\"none\";let p=document.createElement(\"label\");p.className=\"input-label\",p.htmlFor=\"login-email-code\",p.textContent=b(\"emailCodePlaceholder\",e),u.appendChild(p);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),u.appendChild(f);let l=document.createElement(\"button\");l.className=\"btn\",l.textContent=b(\"emailVerify\",e),u.appendChild(l);let d=document.createElement(\"button\");d.className=\"btn btn-secondary\",d.textContent=b(\"emailResend\",e),d.style.marginTop=\"8px\",u.appendChild(d),t.insertBefore(u,n),this.renderTrustFooter(t,e);let E=this.generation,A=()=>this.mounted&&E===this.generation,_=document.createElement(\"button\");_.className=\"passkey-alt\",_.textContent=b(\"emailEdit\",e),u.appendChild(_),_.addEventListener(\"click\",()=>this.switchView(\"email\"));let x=()=>{let S=60;clearInterval(this.emailTimer),d.disabled=!0,d.textContent=b(\"emailCooldown\",e,{seconds:String(S)}),this.emailTimer=setInterval(()=>{S--,d.textContent=S>0?b(\"emailCooldown\",e,{seconds:String(S)}):b(\"emailResend\",e),S<=0&&(clearInterval(this.emailTimer),d.disabled=!1)},1e3)},v=\"\",D,T=this.config.servicePrefix??\"/.well-known/service\",N=async()=>{if(s.disabled)return;let S=a.value.trim();if(!a.checkValidity()){n.textContent=b(\"emailInvalid\",e),n.className=\"status error\";return}s.disabled=!0,n.textContent=b(\"emailSending\",e),n.className=\"status\",n.setAttribute(\"role\",\"status\");try{let c=await this.http.post(`${T}/api/email/sendCode`,{email:S,locale:e});if(!A())return;x(),v=S,D=c?.id,a.style.display=\"none\",o.hidden=!0,i.hidden=!0,s.style.display=\"none\",u.style.display=\"\",r.textContent=b(\"emailVerify\",e),n.textContent=b(\"emailSent\",e,{email:S}),n.className=\"status\",f.focus()}catch(c){if(!A())return;let m=c instanceof Error?c.message:\"Failed to send email\";n.textContent=m,n.className=\"status error\",s.disabled=!1}},I=async()=>{if(l.disabled)return;let S=f.value.trim();if(!/^\\d{8}$/.test(S)){n.textContent=b(\"emailCodeInvalid\",e),n.className=\"status error\";return}l.disabled=!0,n.textContent=b(\"verifying\",e),n.className=\"status\";try{if(await this.http.post(`${T}/api/email/login`,{code:S,id:D}),!A())return;n.textContent=b(\"success\",e),n.className=\"status\",this.handleSuccess()}catch(c){if(!A())return;c instanceof Error&&\"code\"in c&&c.code===\"FORBIDDEN\"?this.showFullError(G(c,e)):(n.textContent=G(c,e),n.className=\"status error\",l.disabled=!1,f.value=\"\",f.focus())}};s.addEventListener(\"click\",N),a.addEventListener(\"keydown\",S=>{S.key===\"Enter\"&&N()}),l.addEventListener(\"click\",I),f.addEventListener(\"keydown\",S=>{S.key===\"Enter\"&&I()}),d.addEventListener(\"click\",async()=>{if(!d.disabled){d.disabled=!0,n.textContent=b(\"emailSending\",e),n.className=\"status\";try{let S=await this.http.post(`${T}/api/email/sendCode`,{email:v,locale:e});if(!A())return;x(),D=S?.id,n.textContent=b(\"emailSent\",e,{email:v}),n.className=\"status\"}catch(S){if(!A())return;d.disabled=!1;let c=S instanceof Error?S.message:\"Failed to resend\";n.textContent=c,n.className=\"status error\"}}})}renderBackButton(t,e){let r=document.createElement(\"button\");r.className=\"back-btn\",r.innerHTML=`${ve} ${K(b(\"back\",e))}`,r.addEventListener(\"click\",()=>this.switchView(\"methods\")),t.appendChild(r)}renderHomeLink(t,e){if(this.options.dismissible===!1)return;let{homeUrl:r,onCancel:o}=this.options;if(!o&&!r)return;let i=`${ve} ${K(b(\"cancel\",e))}`;if(o){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=K(this.options.appLogo),i.alt=this.options.appName?K(this.options.appName):\"\",i.width=48,i.height=48,r.appendChild(i)}let o=document.createElement(\"h1\");if(this.options.appName?o.textContent=b(\"signInTo\",e,{appName:this.options.appName}):o.textContent=b(\"signIn\",e),this.options.purpose&&(o.textContent=this.options.purpose.title),o.id=\"login-title\",r.appendChild(o),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 o=document.createElement(\"div\");o.className=\"secured-badge\",o.innerHTML=`${Ve} ${K(b(\"securedBy\",e))}`,r.appendChild(o);let{privacyUrl:i,termsUrl:a}=this.options;if(i||a){let s=document.createElement(\"div\");if(s.className=\"footer-links\",i){let n=document.createElement(\"a\");n.href=i,n.target=\"_blank\",n.rel=\"noopener noreferrer\",n.textContent=b(\"privacy\",e),s.appendChild(n)}if(i&&a&&s.appendChild(document.createTextNode(\" \\xB7 \")),a){let n=document.createElement(\"a\");n.href=a,n.target=\"_blank\",n.rel=\"noopener noreferrer\",n.textContent=b(\"terms\",e),s.appendChild(n)}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 o=document.createElement(\"div\");o.className=\"status\",o.id=\"passkey-status\",t.appendChild(o);let i=(d,E)=>{o.textContent=d,o.className=`status${E?\" error\":\"\"}`},a=()=>i(\"\",!1),s={waiting:b(\"passkeyWaiting\",e),creating:b(\"passkeyCreating\",e),verifying:b(\"verifying\",e)},n=d=>d.success?(i(b(\"success\",e),!1),this.handleSuccess(),!0):d.code===\"FORBIDDEN\"||d.error===\"registration_closed\"?(this.showFullError(G({message:d.error,code:d.code||d.error},e)),!0):!1,u=()=>{r.innerHTML=\"\",i(b(\"passkeyNoLocal\",e),!1);let d=document.createElement(\"button\");d.className=\"btn\",d.id=\"passkey-btn\",d.innerHTML=`${de} ${K(b(\"passkeyUseAnotherDevice\",e))}`,r.appendChild(d),d.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\",()=>p())},p=()=>{this.cardEl?.classList.add(\"passkey-creating\"),this.abort?.abort(),this.generation++,r.innerHTML=\"\",a();let d=this.cardEl?.querySelector(\"h1\");d&&(d.textContent=b(\"passkeyCreateAccount\",e));let E=document.createElement(\"p\");E.className=\"subtitle\",E.textContent=b(\"passkeyExplanation\",e),r.appendChild(E);let A=document.createElement(\"div\");A.className=\"name-row visible\",A.id=\"passkey-name-row\";let _=document.createElement(\"input\");_.className=\"input\",_.id=\"passkey-name-input\",_.type=\"text\",_.setAttribute(\"aria-label\",b(\"namePlaceholder\",e)),_.placeholder=b(\"namePlaceholder\",e),_.autocomplete=\"name\",A.appendChild(_),r.appendChild(A);let x=document.createElement(\"button\");x.className=\"btn\",x.id=\"passkey-btn\",x.innerHTML=`${de} ${K(b(\"passkeyCreate\",e))}`,r.appendChild(x);let v=document.createElement(\"button\");v.type=\"button\",v.className=\"passkey-alt\",v.textContent=b(\"passkeyBackToSignIn\",e),r.appendChild(v);let D=async()=>{if(x.disabled)return;x.disabled=!0,this.select(\"passkey\");let T=this.generation,N=await ie({registerOnly:!0,signal:this.abort?.signal,name:_.value.trim(),onStatus:i,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});!this.mounted||T!==this.generation||this.abort?.signal.aborted||n(N)||(N.error&&i(N.error,!0),x.disabled=!1)};x.addEventListener(\"click\",D),_.addEventListener(\"keydown\",T=>{T.key===\"Enter\"&&D()}),v.addEventListener(\"click\",()=>l()),x.focus()},f=async()=>{let d=r.querySelector(\"#passkey-btn\");if(d?.disabled)return;d&&(d.disabled=!0),this.select(\"passkey\");let E=this.generation,A=await ie({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)&&!n(A)){if(A.error&&A.error!==\"no_passkey\"){i(A.error,!0),d&&(d.disabled=!1);return}this.emit(\"incomplete\"),u()}},l=()=>{this.cardEl?.classList.remove(\"passkey-creating\"),this.abort?.abort(),this.generation++;let d=this.cardEl?.querySelector(\"h1\");d&&(d.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=`${de} ${K(b(\"passkeySignIn\",e))}`,r.appendChild(E),E.addEventListener(\"click\",()=>f());let A=document.createElement(\"button\");A.type=\"button\",A.className=\"passkey-alt passkey-create-entry\",A.textContent=b(\"passkeyFirstTime\",e),r.appendChild(A),A.addEventListener(\"click\",()=>p())};this.options.invitationId?p():l()}startOAuthPopup(t,e){this.oauthCleanup?.();let r=this.generation,o=this.config.servicePrefix??\"/.well-known/service\",i=this.options.masterOAuthOrigin?`${this.options.masterOAuthOrigin}${o}`:o,a=new URL(i,window.location.href).origin,s=`${i}/api/oauth/${encodeURIComponent(t)}/login?returnUrl=${encodeURIComponent(window.location.href)}`,n=500,u=620,p=window.screenX+(window.innerWidth-n)/2,f=window.screenY+(window.innerHeight-u)/2,l=window.open(s,\"oauth-login:popup\",`left=${p},top=${f},width=${n},height=${u},resizable,scrollbars=yes,status=1,popup`);if(!l){this.options.onBeforeRedirect?.(),window.location.href=s;return}let d=e.innerHTML;e.textContent=b(\"oauthWaiting\",this.options.locale,{provider:this.options.oauthProviders?.find(m=>m.id===t)?.name??t}),e.disabled=!0,e.classList.add(\"oauth-btn-loading\");let E=document.createElement(\"div\");E.className=\"oauth-recovery\",E.setAttribute(\"role\",\"status\");let A=document.createElement(\"p\");A.textContent=b(\"oauthIncomplete\",this.options.locale);let _=document.createElement(\"a\");_.href=s,_.textContent=b(\"oauthFullPage\",this.options.locale),_.addEventListener(\"click\",()=>{this.options.onBeforeRedirect?.(),this.oauthCleanup?.()}),E.append(A,_),E.hidden=!0,e.parentElement?.after(E);let x=()=>{E.hidden=!1,this.emit(\"incomplete\"),e.innerHTML=d,e.disabled=!1,e.classList.remove(\"oauth-btn-loading\")},v=!1,D,T=()=>{v||!this.mounted||r!==this.generation||(v=!0,c(),e.textContent=b(\"success\",this.options.locale),this.handleSuccess())},N=async m=>{if(m.origin!==a||m.source!==l||!m.data||m.data.type!==\"authorization_response\"||v||!this.mounted||r!==this.generation)return;I!==void 0&&(clearInterval(I),I=void 0);try{l.close()}catch{}if(m.data.error){x(),c();return}let{code:h,state:y}=m.data.response??m.data;if(!h){x(),c();return}e.textContent=b(\"verifying\",this.options.locale),e.disabled=!0;try{let g={provider:t,code:h,state:y};this.options.invitationId&&(g.invitationId=this.options.invitationId),await this.http.post(`${o}/api/oauth/login`,g),T()}catch(g){if(v||!this.mounted||r!==this.generation)return;let w=g instanceof Error?g.message:\"\",C=g instanceof Error&&\"code\"in g?g.code:\"\";C===\"FORBIDDEN\"||w===\"registration_closed\"||C===\"registration_closed\"?(v=!0,c(),this.showFullError(G(g,this.options.locale))):x()}},I=setInterval(()=>{let m=!1;try{m=l.closed}catch{return}if(!m)return;I!==void 0&&(clearInterval(I),I=void 0),x();let h=()=>{this.http.get(`${o}/api/did/session`).then(y=>{y?.authenticated&&T()}).catch(()=>{})};h(),D=setInterval(h,500)},500),S=setTimeout(()=>{v||(c(),x())},300*1e3),c=()=>{v=!0,e.innerHTML=d,e.disabled=!1,e.classList.remove(\"oauth-btn-loading\"),I!==void 0&&(clearInterval(I),I=void 0),D!==void 0&&(clearInterval(D),D=void 0),clearTimeout(S),window.removeEventListener(\"message\",N)};this.oauthCleanup=()=>{c(),E.remove();try{l.close()}catch{}},window.addEventListener(\"message\",N)}renderSecondaryGrid(t,e,r,o){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=p=>a.includes(p)?a.indexOf(p):a.length,n=!!this.options.oauthProviderOrder||this.options.oauthProviders?.some(p=>p.order!==void 0&&p.order!==999),u=(this.options.oauthProviders??[]).filter(p=>p.enabled&&(!o||(n||[\"google\",\"apple\"].includes(p.id))===(o===\"primary\"))).sort((p,f)=>this.options.oauthProviderOrder?s(p.id)-s(f.id):(p.order??999)-(f.order??999)||s(p.id)-s(f.id));for(let p of u){let f=document.createElement(\"button\");f.className=\"method-btn\",f.dataset.provider=p.id;let l=je(p.id);f.innerHTML=`${l} ${K(b(\"continueWith\",e,{provider:p.name}))}`,i.appendChild(f),f.addEventListener(\"click\",()=>{this.select(\"oauth\"),this.activeProvider=p.id,this.startOAuthPopup(p.id,f)})}}if(r.includes(\"email\")){let a=document.createElement(\"button\");a.className=\"method-btn\",a.id=\"email-btn\",a.innerHTML=`${ze} ${K(b(\"emailButton\",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=`${Ce} ${K(s)}`,i.appendChild(a),a.addEventListener(\"click\",()=>{this.select(\"did-connect\"),this.switchView(\"qr\")})}t.appendChild(i)}async startDIDConnectInView(t,e,r,o){t.textContent=b(\"connecting\",o);let i=this.generation,a=()=>this.mounted&&i===this.generation;try{this.tokenSession?.destroy(),this.tokenSession=new ee(this.config,this.http),this.tokenSession.on(\"succeed\",async()=>{if(a()){this.showConnectResult(e,r,t,b(\"verifying\",o));try{let n=this.config.servicePrefix??\"/.well-known/service\";if(await this.http.post(`${n}/api/did/connect/complete`,{token:this.tokenSession.state.token}),!a())return;this.showConnectSuccess(e,r,t,o),this.handleSuccess()}catch(n){if(!a())return;this.showConnectResult(e,r,t,G(n,o),!0)}}}),this.tokenSession.on(\"timeout\",()=>{t.textContent=b(\"timeout\",o);let n=document.createElement(\"div\");n.className=\"qr-timeout-overlay\",n.innerHTML=`<span class=\"timeout-text\">${K(b(\"timeout\",o))}</span>`;let u=document.createElement(\"button\");u.className=\"refresh-btn\",u.textContent=b(\"refreshQR\",o),u.addEventListener(\"click\",()=>{n.remove(),he(e),e.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',r.disabled=!0,this.startDIDConnectInView(t,e,r,o)}),n.appendChild(u),e.appendChild(n)}),this.tokenSession.on(\"error\",n=>{this.showConnectResult(e,r,t,G(n,o),!0)}),this.tokenSession.on(\"statusChange\",n=>{n.status===\"scanned\"&&this.showConnectScanned(e,r,t,o)});let s=await this.tokenSession.create({locale:o});if(!a())return;s.url&&(Be(e,s.url),r.disabled=!1,r.addEventListener(\"click\",()=>{t.textContent=b(\"walletRetry\",o),this.openInWallet(s.url,o)})),t.textContent=b(\"scanWithWallet\",o),this.tokenSession.startPolling()}catch(s){if(!a())return;t.textContent=G(s,o),he(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 o=document.createElement(\"div\");o.className=\"status error\",o.textContent=t,this.cardEl.appendChild(o);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,o=\"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\">${Ce}</span>\n </div>`,r.textContent=b(\"waitingWallet\",o),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\",o);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\",o),s.addEventListener(\"click\",()=>this.switchView(\"methods\")),a.parentElement?.insertBefore(s,a.nextSibling))}showConnectSuccess(t,e,r,o=\"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\",o),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,o,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=o,r.className=\"status error\";let n=r.parentElement?.querySelector(\".result-back-btn\");n||(n=document.createElement(\"button\"),n.className=\"btn btn-secondary result-back-btn\",n.textContent=b(\"back\",a),n.addEventListener(\"click\",()=>this.switchView(\"methods\")),r.parentElement?.insertBefore(n,r.nextSibling))}else s.innerHTML='<div class=\"result-icon result-loading\"><span class=\"qr-spinner\"></span></div>',r.textContent=o,r.className=\"status\"}openInWallet(t,e=\"en\"){let r=De(),o=ct();if(r){let i=t.replace(/^https?:\\/\\//,\"abt://\");window.location.href=i}else if(o&&typeof o.open==\"function\"){let i=this.tokenSession?.state;o.open({action:this.config.action??\"login\",locale:e,url:encodeURIComponent(t),appInfo:i?.appInfo??{},memberAppInfo:i?.memberAppInfo??{}})}else{let i=`${lt}?action=requestAuth&url=${encodeURIComponent(t)}`,a=414,s=736,n=window.screenX+window.innerWidth-a,u=window.screenY;window.open(i,\"did-wallet:popup\",`left=${n},top=${u},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)}}},dt=`${Fe}${Te}\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`,Se=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.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;this.previous=this.options.returnFocus??(t instanceof HTMLElement?t:void 0);let e=document.createElement(\"div\");e.dataset.didLoginDialogHost=\"\",e.style.cssText=\"position:fixed;width:0;height:0;\",this.host=e;let r=e.attachShadow({mode:\"open\"}),o=document.createElement(\"style\");o.textContent=dt,r.append(o);let i=document.createElement(\"dialog\");this.dialog=i,i.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",this.options.locale)),r.append(i);let a=document.createElement(\"button\");a.type=\"button\",a.className=\"close\",a.textContent=\"\\xD7\",a.setAttribute(\"aria-label\",b(\"cancel\",this.options.locale));let s=()=>{if(!(this.options.dismissible===!1||this.dialog!==i)){try{this.options.onEvent?.({name:\"cancel\",mode:\"dialog\"})}catch{}this.destroy(),this.options.onCancel?.()}};a.addEventListener(\"click\",s),this.options.dismissible!==!1&&i.append(a);let n=document.createElement(\"div\");n.dataset.dialogScroll=\"\",i.append(n);let u=document.createElement(\"div\");u.dataset.loginDialogMount=\"\",n.append(u),i.addEventListener(\"cancel\",l=>{l.preventDefault(),s()}),document.body.append(e);let p=this.hostTheme();e.dataset.theme=p,this.page=new pe(u,this.config,this.http,{...this.options,theme:p,isolate:!0,mode:\"dialog\",onCancel:s,onLocaleChange:l=>{this.options.locale=l,a.setAttribute(\"aria-label\",b(\"cancel\",l)),i.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",l)),this.options.onLocaleChange?.(l)},onSuccess:async()=>{let l=()=>{if(!i.isConnected||this.dialog!==i)return;for(let A of n.querySelectorAll(\".host-error, .retry\"))A.remove();let d=document.createElement(\"p\");d.className=\"host-error\",d.setAttribute(\"role\",\"alert\"),d.textContent=b(\"authFailed\",this.options.locale);let E=document.createElement(\"button\");E.type=\"button\",E.className=\"retry\",E.textContent=b(\"tryAgain\",this.options.locale),E.onclick=async()=>{E.disabled=!0;try{await this.options.onSuccess?.(),this.dialog===i&&this.destroy()}catch{l()}},n.append(d,E)};try{await this.options.onSuccess?.(),this.dialog===i&&this.destroy()}catch{l()}}}),this.page.mount(),this.themeObserver=new MutationObserver(this.syncTheme);for(let l of[document.documentElement,document.body])this.themeObserver.observe(l,{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)),i.showModal();let f=u.shadowRoot?.querySelector(\"h1, h2\");f&&(f.tabIndex=-1,f.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 Me(ht);})();\n";
3
3
  //# sourceMappingURL=login-bundle-string.js.map