@arcblock/did-connect-service 4.1.53 → 4.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_generated/asset-bytes.js +1 -1
- package/dist/_generated/asset-manifest.js +2 -2
- package/dist/_generated/login-bundle-string.d.ts +1 -1
- package/dist/_generated/login-bundle-string.d.ts.map +1 -1
- package/dist/_generated/login-bundle-string.js +1 -1
- package/dist/_generated/login-bundle-string.js.map +1 -1
- package/dist/assets/login.de8082af.js +878 -0
- package/dist/assets/{login.941957f5.css → login.f90a92c9.css} +54 -23
- package/dist/handlers/oauth-handler.d.ts.map +1 -1
- package/dist/handlers/oauth-handler.js +27 -4
- package/dist/handlers/oauth-handler.js.map +1 -1
- package/dist/pages/oauth-callback-page.d.ts +17 -1
- package/dist/pages/oauth-callback-page.d.ts.map +1 -1
- package/dist/pages/oauth-callback-page.js +29 -9
- package/dist/pages/oauth-callback-page.js.map +1 -1
- package/package.json +3 -3
- package/dist/assets/login.f7787c55.js +0 -847
|
@@ -1,847 +0,0 @@
|
|
|
1
|
-
"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=`
|
|
2
|
-
:root, :host {
|
|
3
|
-
/* Backgrounds \u2014 layered depth */
|
|
4
|
-
--bg-root: ${B.bg.root};
|
|
5
|
-
--bg-surface: ${B.bg.surface};
|
|
6
|
-
--bg-card: ${B.bg.card};
|
|
7
|
-
--bg-elevated: ${B.bg.elevated};
|
|
8
|
-
--bg-hover: ${B.bg.hover};
|
|
9
|
-
--bg-active: ${B.bg.active};
|
|
10
|
-
--bg-input: ${B.bg.input};
|
|
11
|
-
|
|
12
|
-
/* Borders \u2014 semi-transparent for adaptability */
|
|
13
|
-
--border: ${B.border.default};
|
|
14
|
-
--border-subtle:${B.border.subtle};
|
|
15
|
-
--border-strong:${B.border.strong};
|
|
16
|
-
--border-focus: ${B.border.focus};
|
|
17
|
-
|
|
18
|
-
/* Text hierarchy */
|
|
19
|
-
--text: ${B.text.primary};
|
|
20
|
-
--text-secondary:${B.text.secondary};
|
|
21
|
-
--text-tertiary:${B.text.tertiary};
|
|
22
|
-
--text-placeholder:${B.text.placeholder};
|
|
23
|
-
--text-white: ${B.text.white};
|
|
24
|
-
|
|
25
|
-
/* Accents */
|
|
26
|
-
--blue: ${B.color.blue};
|
|
27
|
-
--blue-hover: ${B.color.blueHover};
|
|
28
|
-
--blue-light: ${B.color.blueLight};
|
|
29
|
-
--blue-muted: ${B.color.blueMuted};
|
|
30
|
-
--red: ${B.color.red};
|
|
31
|
-
--red-light: ${B.color.redLight};
|
|
32
|
-
--red-text: ${B.color.redText};
|
|
33
|
-
--green: ${B.color.green};
|
|
34
|
-
--green-light: ${B.color.greenLight};
|
|
35
|
-
--green-text: ${B.color.greenText};
|
|
36
|
-
--yellow: ${B.color.yellow};
|
|
37
|
-
--yellow-light: ${B.color.yellowLight};
|
|
38
|
-
--yellow-text: ${B.color.yellowText};
|
|
39
|
-
--info: ${B.color.info};
|
|
40
|
-
--info-light: ${B.color.infoLight};
|
|
41
|
-
--info-text: ${B.color.infoText};
|
|
42
|
-
|
|
43
|
-
/* Radii */
|
|
44
|
-
--radius-xs: ${B.radius.xs};
|
|
45
|
-
--radius-sm: ${B.radius.sm};
|
|
46
|
-
--radius: ${B.radius.md};
|
|
47
|
-
--radius-lg: ${B.radius.lg};
|
|
48
|
-
--radius-full: ${B.radius.full};
|
|
49
|
-
|
|
50
|
-
/* Shadows */
|
|
51
|
-
--shadow-sm: ${B.shadow.sm};
|
|
52
|
-
--shadow-md: ${B.shadow.md};
|
|
53
|
-
--shadow-lg: ${B.shadow.lg};
|
|
54
|
-
--shadow-focus: ${B.shadow.focus};
|
|
55
|
-
}
|
|
56
|
-
`,Te=`
|
|
57
|
-
[data-theme="light"], :host([data-theme="light"]) {
|
|
58
|
-
--bg-root: ${$.bg.root};
|
|
59
|
-
--bg-surface: ${$.bg.surface};
|
|
60
|
-
--bg-card: ${$.bg.card};
|
|
61
|
-
--bg-elevated: ${$.bg.elevated};
|
|
62
|
-
--bg-hover: ${$.bg.hover};
|
|
63
|
-
--bg-active: ${$.bg.active};
|
|
64
|
-
--bg-input: ${$.bg.input};
|
|
65
|
-
|
|
66
|
-
--border: ${$.border.default};
|
|
67
|
-
--border-subtle:${$.border.subtle};
|
|
68
|
-
--border-strong:${$.border.strong};
|
|
69
|
-
--border-focus: ${$.border.focus};
|
|
70
|
-
|
|
71
|
-
--text: ${$.text.primary};
|
|
72
|
-
--text-secondary:${$.text.secondary};
|
|
73
|
-
--text-tertiary:${$.text.tertiary};
|
|
74
|
-
--text-placeholder:${$.text.placeholder};
|
|
75
|
-
--text-white: ${$.text.white};
|
|
76
|
-
|
|
77
|
-
--shadow-sm: ${$.shadow.sm};
|
|
78
|
-
--shadow-md: ${$.shadow.md};
|
|
79
|
-
--shadow-lg: ${$.shadow.lg};
|
|
80
|
-
--shadow-focus: ${$.shadow.focus};
|
|
81
|
-
}
|
|
82
|
-
`,$e=`
|
|
83
|
-
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
84
|
-
html, :host { color-scheme: dark; }
|
|
85
|
-
html[data-theme="light"], :host([data-theme="light"]) { color-scheme: light; }
|
|
86
|
-
body {
|
|
87
|
-
font-family: ${B.font.family};
|
|
88
|
-
background: var(--bg-root);
|
|
89
|
-
color: var(--text);
|
|
90
|
-
-webkit-font-smoothing: antialiased;
|
|
91
|
-
-moz-osx-font-smoothing: grayscale;
|
|
92
|
-
font-size: ${B.font.sizeBase};
|
|
93
|
-
line-height: ${B.font.lineHeight};
|
|
94
|
-
}
|
|
95
|
-
a { color: var(--blue-muted); text-decoration: none; }
|
|
96
|
-
a:hover { text-decoration: underline; }
|
|
97
|
-
.hidden { display: none; }
|
|
98
|
-
`,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=`
|
|
99
|
-
:host {
|
|
100
|
-
display: inline-flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
max-width: 100%;
|
|
103
|
-
overflow: hidden;
|
|
104
|
-
font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
|
|
105
|
-
line-height: 1.5;
|
|
106
|
-
}
|
|
107
|
-
:host([block]) { display: flex; }
|
|
108
|
-
.prefix {
|
|
109
|
-
flex-shrink: 0;
|
|
110
|
-
opacity: 0.6;
|
|
111
|
-
margin-right: 4px;
|
|
112
|
-
white-space: nowrap;
|
|
113
|
-
}
|
|
114
|
-
.address {
|
|
115
|
-
white-space: nowrap;
|
|
116
|
-
overflow: hidden;
|
|
117
|
-
text-overflow: ellipsis;
|
|
118
|
-
color: var(--did-text-color, currentColor);
|
|
119
|
-
}
|
|
120
|
-
.address-compact {
|
|
121
|
-
white-space: nowrap;
|
|
122
|
-
color: var(--did-text-color, currentColor);
|
|
123
|
-
cursor: default;
|
|
124
|
-
}
|
|
125
|
-
.clickable { cursor: pointer; }
|
|
126
|
-
.clickable:hover { opacity: 0.8; }
|
|
127
|
-
.copy-btn {
|
|
128
|
-
flex-shrink: 0;
|
|
129
|
-
display: inline-flex;
|
|
130
|
-
align-items: center;
|
|
131
|
-
justify-content: center;
|
|
132
|
-
width: 1em;
|
|
133
|
-
height: 1em;
|
|
134
|
-
margin-left: 6px;
|
|
135
|
-
padding: 0;
|
|
136
|
-
border: none;
|
|
137
|
-
background: none;
|
|
138
|
-
color: inherit;
|
|
139
|
-
opacity: 0.5;
|
|
140
|
-
cursor: pointer;
|
|
141
|
-
transition: opacity 0.15s;
|
|
142
|
-
}
|
|
143
|
-
.copy-btn:hover { opacity: 1; }
|
|
144
|
-
.copy-btn.copied { opacity: 1; color: var(--did-copy-success-color, #22c55e); }
|
|
145
|
-
`,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=`
|
|
146
|
-
<style>${He}:host { font-size: ${n}; }</style>
|
|
147
|
-
${f}<span class="${l}${d}"${p}>${u}</span>${E}
|
|
148
|
-
`,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+="<";break;case">":m+=">";break;case"&":m+="&";break;case'"':m+=""";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+=`
|
|
149
|
-
`}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+`
|
|
150
|
-
`}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=`
|
|
151
|
-
${Fe}
|
|
152
|
-
${Te}
|
|
153
|
-
${$e}
|
|
154
|
-
|
|
155
|
-
/* Layout */
|
|
156
|
-
body {
|
|
157
|
-
min-height: 100vh;
|
|
158
|
-
display: flex;
|
|
159
|
-
align-items: center;
|
|
160
|
-
justify-content: center;
|
|
161
|
-
background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.08) 0%, transparent 60%);
|
|
162
|
-
}
|
|
163
|
-
/* The body rule does not apply inside a shadow tree. The host page must
|
|
164
|
-
give the LoginPage container a height for this centering to show. */
|
|
165
|
-
:host {
|
|
166
|
-
display: flex;
|
|
167
|
-
align-items: center;
|
|
168
|
-
justify-content: center;
|
|
169
|
-
min-height: 100%;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/* Card \u2014 fixed width prevents shrinking when views switch */
|
|
173
|
-
.card {
|
|
174
|
-
background: var(--bg-card);
|
|
175
|
-
border: 1px solid var(--border);
|
|
176
|
-
border-radius: var(--radius-lg);
|
|
177
|
-
padding: 48px 40px;
|
|
178
|
-
width: min(400px, calc(100vw - 32px));
|
|
179
|
-
text-align: center;
|
|
180
|
-
box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.15);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/* Brand header */
|
|
184
|
-
.brand-header { margin-bottom: 24px; }
|
|
185
|
-
.app-logo {
|
|
186
|
-
width: 48px;
|
|
187
|
-
height: 48px;
|
|
188
|
-
border-radius: var(--radius-sm);
|
|
189
|
-
object-fit: contain;
|
|
190
|
-
margin-bottom: 16px;
|
|
191
|
-
}
|
|
192
|
-
h1 {
|
|
193
|
-
font-size: 24px;
|
|
194
|
-
font-weight: 600;
|
|
195
|
-
margin-bottom: 8px;
|
|
196
|
-
color: var(--text-white);
|
|
197
|
-
letter-spacing: -0.01em;
|
|
198
|
-
line-height: 1.25;
|
|
199
|
-
/* Never let a long "Sign in to {appName}" blow past two lines \u2014 clamp with
|
|
200
|
-
an ellipsis so the card height stays stable. */
|
|
201
|
-
display: -webkit-box;
|
|
202
|
-
-webkit-line-clamp: 2;
|
|
203
|
-
line-clamp: 2;
|
|
204
|
-
-webkit-box-orient: vertical;
|
|
205
|
-
overflow: hidden;
|
|
206
|
-
}
|
|
207
|
-
.subtitle {
|
|
208
|
-
font-size: 14px;
|
|
209
|
-
color: var(--text-secondary);
|
|
210
|
-
margin-bottom: 0;
|
|
211
|
-
line-height: 1.5;
|
|
212
|
-
}
|
|
213
|
-
.federated-hint {
|
|
214
|
-
font-size: 12px;
|
|
215
|
-
color: var(--text-secondary);
|
|
216
|
-
margin-top: 6px;
|
|
217
|
-
margin-bottom: 0;
|
|
218
|
-
opacity: 0.7;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/* Input */
|
|
222
|
-
.input {
|
|
223
|
-
width: 100%;
|
|
224
|
-
height: 36px;
|
|
225
|
-
padding: 0 12px;
|
|
226
|
-
font-size: 14px;
|
|
227
|
-
color: var(--text);
|
|
228
|
-
background: var(--bg-input);
|
|
229
|
-
border: 1px solid var(--border-strong);
|
|
230
|
-
border-radius: var(--radius-sm);
|
|
231
|
-
outline: none;
|
|
232
|
-
margin-bottom: 16px;
|
|
233
|
-
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
234
|
-
}
|
|
235
|
-
.input:focus { border-color: var(--blue); box-shadow: var(--shadow-focus); }
|
|
236
|
-
.input::placeholder { color: var(--text-placeholder); }
|
|
237
|
-
|
|
238
|
-
/* Button */
|
|
239
|
-
.btn {
|
|
240
|
-
display: inline-flex;
|
|
241
|
-
align-items: center;
|
|
242
|
-
justify-content: center;
|
|
243
|
-
gap: 6px;
|
|
244
|
-
width: 100%;
|
|
245
|
-
height: 36px;
|
|
246
|
-
padding: 0 16px;
|
|
247
|
-
font-size: 14px;
|
|
248
|
-
font-weight: 500;
|
|
249
|
-
color: #fff;
|
|
250
|
-
background: var(--blue);
|
|
251
|
-
border: none;
|
|
252
|
-
border-radius: var(--radius-sm);
|
|
253
|
-
cursor: pointer;
|
|
254
|
-
transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
|
|
255
|
-
line-height: 1;
|
|
256
|
-
}
|
|
257
|
-
.btn:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(108,71,255,0.3); }
|
|
258
|
-
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }
|
|
259
|
-
.btn:focus-visible { box-shadow: var(--shadow-focus); }
|
|
260
|
-
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
|
|
261
|
-
.btn-secondary {
|
|
262
|
-
background: transparent;
|
|
263
|
-
border: 1px solid var(--border-strong);
|
|
264
|
-
color: var(--text);
|
|
265
|
-
}
|
|
266
|
-
.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(255,255,255,0.20); }
|
|
267
|
-
|
|
268
|
-
/* Status */
|
|
269
|
-
.status {
|
|
270
|
-
margin-top: 16px;
|
|
271
|
-
font-size: 13px;
|
|
272
|
-
min-height: 20px;
|
|
273
|
-
color: var(--text-secondary);
|
|
274
|
-
}
|
|
275
|
-
.status.error { color: var(--red-text); }
|
|
276
|
-
|
|
277
|
-
/* Name row (passkey registration) */
|
|
278
|
-
.name-row { display: none; }
|
|
279
|
-
.name-row.visible { display: block; }
|
|
280
|
-
|
|
281
|
-
/* Passkey section + secondary text action ("First time? Create a passkey") */
|
|
282
|
-
.passkey-section > .btn + .passkey-alt,
|
|
283
|
-
.passkey-section > .name-row + .btn { margin-top: 10px; }
|
|
284
|
-
.passkey-alt {
|
|
285
|
-
display: block;
|
|
286
|
-
width: 100%;
|
|
287
|
-
margin-top: 10px;
|
|
288
|
-
padding: 4px;
|
|
289
|
-
background: none;
|
|
290
|
-
border: none;
|
|
291
|
-
font-size: 13px;
|
|
292
|
-
color: var(--text-secondary);
|
|
293
|
-
cursor: pointer;
|
|
294
|
-
text-align: center;
|
|
295
|
-
transition: color 0.15s ease;
|
|
296
|
-
}
|
|
297
|
-
.passkey-alt:hover { color: var(--text); text-decoration: underline; }
|
|
298
|
-
.passkey-alt:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); outline: none; }
|
|
299
|
-
|
|
300
|
-
/* Divider */
|
|
301
|
-
.divider {
|
|
302
|
-
display: flex;
|
|
303
|
-
align-items: center;
|
|
304
|
-
margin: 20px 0;
|
|
305
|
-
color: var(--text-secondary);
|
|
306
|
-
font-size: 13px;
|
|
307
|
-
}
|
|
308
|
-
.divider::before, .divider::after {
|
|
309
|
-
content: '';
|
|
310
|
-
flex: 1;
|
|
311
|
-
border-bottom: 1px solid var(--border);
|
|
312
|
-
}
|
|
313
|
-
.divider::before { margin-right: 12px; }
|
|
314
|
-
.divider::after { margin-left: 12px; }
|
|
315
|
-
|
|
316
|
-
/* DID Wallet section (methods view) */
|
|
317
|
-
.did-wallet-section { margin-top: 8px; }
|
|
318
|
-
|
|
319
|
-
/* QR view */
|
|
320
|
-
.qr-view {
|
|
321
|
-
position: relative;
|
|
322
|
-
margin: 20px auto;
|
|
323
|
-
display: flex;
|
|
324
|
-
justify-content: center;
|
|
325
|
-
min-height: 220px;
|
|
326
|
-
align-items: center;
|
|
327
|
-
}
|
|
328
|
-
.qr-placeholder {
|
|
329
|
-
width: 220px;
|
|
330
|
-
height: 220px;
|
|
331
|
-
display: flex;
|
|
332
|
-
align-items: center;
|
|
333
|
-
justify-content: center;
|
|
334
|
-
border: 1px solid var(--border-subtle);
|
|
335
|
-
border-radius: var(--radius);
|
|
336
|
-
background: var(--bg-elevated);
|
|
337
|
-
}
|
|
338
|
-
.qr-spinner {
|
|
339
|
-
display: inline-block;
|
|
340
|
-
width: 32px; height: 32px;
|
|
341
|
-
border: 3px solid var(--border-strong);
|
|
342
|
-
border-top-color: var(--blue-muted);
|
|
343
|
-
border-radius: 50%;
|
|
344
|
-
animation: spin 0.6s linear infinite;
|
|
345
|
-
}
|
|
346
|
-
#did-connect-status {
|
|
347
|
-
font-size: 13px;
|
|
348
|
-
color: var(--text-secondary);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/* Connect result state */
|
|
352
|
-
.connect-result {
|
|
353
|
-
display: flex;
|
|
354
|
-
justify-content: center;
|
|
355
|
-
align-items: center;
|
|
356
|
-
min-height: 120px;
|
|
357
|
-
margin: 32px 0;
|
|
358
|
-
animation: fadeIn 200ms ease-out;
|
|
359
|
-
}
|
|
360
|
-
.result-icon {
|
|
361
|
-
width: 64px;
|
|
362
|
-
height: 64px;
|
|
363
|
-
border-radius: 50%;
|
|
364
|
-
display: flex;
|
|
365
|
-
align-items: center;
|
|
366
|
-
justify-content: center;
|
|
367
|
-
font-size: 28px;
|
|
368
|
-
font-weight: bold;
|
|
369
|
-
}
|
|
370
|
-
.result-error {
|
|
371
|
-
background: rgba(239, 68, 68, 0.15);
|
|
372
|
-
color: var(--red-text);
|
|
373
|
-
border: 2px solid rgba(239, 68, 68, 0.3);
|
|
374
|
-
}
|
|
375
|
-
.result-loading {
|
|
376
|
-
background: transparent;
|
|
377
|
-
}
|
|
378
|
-
.result-loading .qr-spinner {
|
|
379
|
-
width: 36px;
|
|
380
|
-
height: 36px;
|
|
381
|
-
}
|
|
382
|
-
.result-back-btn {
|
|
383
|
-
margin-top: 16px;
|
|
384
|
-
}
|
|
385
|
-
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
|
|
386
|
-
|
|
387
|
-
/* QR timeout overlay */
|
|
388
|
-
.qr-timeout-overlay {
|
|
389
|
-
position: absolute;
|
|
390
|
-
inset: 0;
|
|
391
|
-
display: flex;
|
|
392
|
-
flex-direction: column;
|
|
393
|
-
align-items: center;
|
|
394
|
-
justify-content: center;
|
|
395
|
-
gap: 12px;
|
|
396
|
-
background: rgba(0, 0, 0, 0.65);
|
|
397
|
-
border-radius: var(--radius);
|
|
398
|
-
backdrop-filter: blur(2px);
|
|
399
|
-
}
|
|
400
|
-
.qr-timeout-overlay .timeout-text {
|
|
401
|
-
font-size: 13px;
|
|
402
|
-
color: #fff;
|
|
403
|
-
}
|
|
404
|
-
.qr-timeout-overlay .refresh-btn {
|
|
405
|
-
display: inline-flex;
|
|
406
|
-
align-items: center;
|
|
407
|
-
justify-content: center;
|
|
408
|
-
gap: 6px;
|
|
409
|
-
padding: 6px 20px;
|
|
410
|
-
font-size: 14px;
|
|
411
|
-
font-weight: 500;
|
|
412
|
-
color: #fff;
|
|
413
|
-
background: var(--blue);
|
|
414
|
-
border: none;
|
|
415
|
-
border-radius: var(--radius-sm);
|
|
416
|
-
cursor: pointer;
|
|
417
|
-
transition: background-color 0.15s ease;
|
|
418
|
-
}
|
|
419
|
-
.qr-timeout-overlay .refresh-btn:hover {
|
|
420
|
-
background: var(--blue-hover);
|
|
421
|
-
}
|
|
422
|
-
/* Connect status views (scanned / success) */
|
|
423
|
-
.connect-status-icon {
|
|
424
|
-
position: relative;
|
|
425
|
-
width: 72px;
|
|
426
|
-
height: 72px;
|
|
427
|
-
margin: 16px auto;
|
|
428
|
-
display: flex;
|
|
429
|
-
align-items: center;
|
|
430
|
-
justify-content: center;
|
|
431
|
-
}
|
|
432
|
-
@keyframes connectSpin { to { transform: rotate(360deg); } }
|
|
433
|
-
.connect-spinner-ring {
|
|
434
|
-
position: absolute;
|
|
435
|
-
inset: 0;
|
|
436
|
-
width: 72px;
|
|
437
|
-
height: 72px;
|
|
438
|
-
border-radius: 50%;
|
|
439
|
-
border: 3px solid rgba(255,255,255,0.1);
|
|
440
|
-
border-top-color: var(--blue, #6c47ff);
|
|
441
|
-
animation: connectSpin 0.8s linear infinite;
|
|
442
|
-
}
|
|
443
|
-
.connect-status-badge {
|
|
444
|
-
position: relative;
|
|
445
|
-
display: flex;
|
|
446
|
-
align-items: center;
|
|
447
|
-
justify-content: center;
|
|
448
|
-
width: 44px;
|
|
449
|
-
height: 44px;
|
|
450
|
-
}
|
|
451
|
-
.connect-status-badge svg { width: 36px; height: 36px; }
|
|
452
|
-
.connect-status-icon.connect-success svg { animation: fadeIn 0.3s ease; }
|
|
453
|
-
.connect-subtitle {
|
|
454
|
-
font-size: 13px;
|
|
455
|
-
color: var(--text-secondary, #9394a1);
|
|
456
|
-
text-align: center;
|
|
457
|
-
margin: 4px 0 0;
|
|
458
|
-
}
|
|
459
|
-
.status.success { color: #49dc6e; font-weight: 500; }
|
|
460
|
-
.deep-link-btn {
|
|
461
|
-
margin-top: 12px;
|
|
462
|
-
text-decoration: none;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/* Email section (methods view) */
|
|
466
|
-
.email-section { margin-top: 8px; }
|
|
467
|
-
|
|
468
|
-
/* Back button \u2014 same top row as Cancel and the locale/theme tools.
|
|
469
|
-
A float sat inside the 48px content padding, so Back landed below the
|
|
470
|
-
absolute locale pill. */
|
|
471
|
-
.back-btn {
|
|
472
|
-
position: absolute;
|
|
473
|
-
top: 16px;
|
|
474
|
-
left: 40px;
|
|
475
|
-
display: inline-flex;
|
|
476
|
-
align-items: center;
|
|
477
|
-
gap: 4px;
|
|
478
|
-
height: 28px;
|
|
479
|
-
background: none;
|
|
480
|
-
border: none;
|
|
481
|
-
color: var(--text-secondary);
|
|
482
|
-
font-size: 14px;
|
|
483
|
-
line-height: 1;
|
|
484
|
-
cursor: pointer;
|
|
485
|
-
padding: 0;
|
|
486
|
-
margin: 0;
|
|
487
|
-
}
|
|
488
|
-
.back-btn:hover { color: var(--text); }
|
|
489
|
-
.back-btn svg { width: 18px; height: 18px; }
|
|
490
|
-
/* Escape hatch \u2014 a quiet "Cancel" link, top-left of the card, mirroring the
|
|
491
|
-
locale switcher (top-right). Conventional spot for a standalone auth card.
|
|
492
|
-
Low in the hierarchy (tertiary color, small) so it never competes with the
|
|
493
|
-
auth methods; it's an exit, not an action. */
|
|
494
|
-
.home-link {
|
|
495
|
-
position: absolute;
|
|
496
|
-
top: 16px;
|
|
497
|
-
/* Align the arrow's left edge to the content column (card's 40px padding), so
|
|
498
|
-
Cancel sits on the same left line as the title and buttons \u2014 no left padding
|
|
499
|
-
of its own, which would push it off that line. */
|
|
500
|
-
left: 40px;
|
|
501
|
-
display: inline-flex;
|
|
502
|
-
align-items: center;
|
|
503
|
-
gap: 3px;
|
|
504
|
-
background: none;
|
|
505
|
-
border: none;
|
|
506
|
-
color: var(--text-tertiary);
|
|
507
|
-
font-size: 13px;
|
|
508
|
-
line-height: 1;
|
|
509
|
-
text-decoration: none;
|
|
510
|
-
cursor: pointer;
|
|
511
|
-
height: 28px;
|
|
512
|
-
padding: 2px 4px 2px 0;
|
|
513
|
-
transition: color 0.15s ease;
|
|
514
|
-
}
|
|
515
|
-
.home-link:hover { color: var(--text-secondary); }
|
|
516
|
-
.home-link svg { width: 16px; height: 16px; }
|
|
517
|
-
|
|
518
|
-
/* View title */
|
|
519
|
-
.view-title {
|
|
520
|
-
font-size: 20px;
|
|
521
|
-
font-weight: 600;
|
|
522
|
-
color: var(--text-white);
|
|
523
|
-
margin-bottom: 8px;
|
|
524
|
-
padding-top: 8px;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
/* OAuth section \u2014 single provider (legacy) */
|
|
528
|
-
.oauth-section { margin-top: 0; }
|
|
529
|
-
|
|
530
|
-
/* OAuth grid \u2014 2+ providers in 2-column layout (legacy) */
|
|
531
|
-
.oauth-grid {
|
|
532
|
-
display: grid;
|
|
533
|
-
grid-template-columns: 1fr 1fr;
|
|
534
|
-
gap: 8px;
|
|
535
|
-
margin-bottom: 8px;
|
|
536
|
-
}
|
|
537
|
-
.oauth-grid .oauth-btn:last-child:nth-child(odd) {
|
|
538
|
-
grid-column: 1 / -1;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
/* Unified secondary methods grid \u2014 2-column layout */
|
|
542
|
-
.methods-grid {
|
|
543
|
-
display: grid;
|
|
544
|
-
grid-template-columns: 1fr 1fr;
|
|
545
|
-
gap: 8px;
|
|
546
|
-
}
|
|
547
|
-
/* Odd last child (e.g. DID Wallet when total is odd) spans full width */
|
|
548
|
-
.methods-grid .method-btn:last-child:nth-child(odd) {
|
|
549
|
-
grid-column: 1 / -1;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
.method-btn {
|
|
553
|
-
display: inline-flex;
|
|
554
|
-
align-items: center;
|
|
555
|
-
justify-content: center;
|
|
556
|
-
gap: 8px;
|
|
557
|
-
width: 100%;
|
|
558
|
-
min-height: 36px;
|
|
559
|
-
padding: 6px 16px;
|
|
560
|
-
font-size: 14px;
|
|
561
|
-
font-weight: 500;
|
|
562
|
-
color: var(--text);
|
|
563
|
-
background: var(--bg-elevated);
|
|
564
|
-
border: 1px solid var(--border-strong);
|
|
565
|
-
border-radius: var(--radius-sm);
|
|
566
|
-
cursor: pointer;
|
|
567
|
-
transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
|
|
568
|
-
white-space: normal;
|
|
569
|
-
}
|
|
570
|
-
.method-btn:hover { background: var(--bg-hover); border-color: var(--blue-muted); }
|
|
571
|
-
.method-btn:disabled { cursor: default; pointer-events: none; }
|
|
572
|
-
.method-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
|
|
573
|
-
|
|
574
|
-
.oauth-btn {
|
|
575
|
-
display: inline-flex;
|
|
576
|
-
align-items: center;
|
|
577
|
-
justify-content: center;
|
|
578
|
-
gap: 8px;
|
|
579
|
-
width: 100%;
|
|
580
|
-
height: 36px;
|
|
581
|
-
padding: 0 16px;
|
|
582
|
-
font-size: 14px;
|
|
583
|
-
font-weight: 500;
|
|
584
|
-
color: var(--text);
|
|
585
|
-
background: var(--bg-card);
|
|
586
|
-
border: 1px solid var(--border);
|
|
587
|
-
border-radius: var(--radius-sm);
|
|
588
|
-
cursor: pointer;
|
|
589
|
-
transition: background-color 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;
|
|
590
|
-
margin-bottom: 0;
|
|
591
|
-
}
|
|
592
|
-
.oauth-section .oauth-btn { margin-bottom: 8px; }
|
|
593
|
-
.oauth-btn:hover { background: var(--bg-hover); }
|
|
594
|
-
.oauth-btn:disabled { cursor: default; pointer-events: none; }
|
|
595
|
-
.oauth-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
|
|
596
|
-
.oauth-btn-loading {
|
|
597
|
-
opacity: 0.8;
|
|
598
|
-
border-color: var(--blue);
|
|
599
|
-
color: var(--text-secondary);
|
|
600
|
-
}
|
|
601
|
-
@keyframes oauth-spin { to { transform: rotate(360deg); } }
|
|
602
|
-
.oauth-spinner {
|
|
603
|
-
display: inline-block;
|
|
604
|
-
width: 14px; height: 14px;
|
|
605
|
-
border: 2px solid var(--border-strong);
|
|
606
|
-
border-top-color: var(--blue-muted);
|
|
607
|
-
border-radius: 50%;
|
|
608
|
-
animation: oauth-spin 0.6s linear infinite;
|
|
609
|
-
}
|
|
610
|
-
.oauth-check { color: var(--green-text); font-size: 16px; }
|
|
611
|
-
|
|
612
|
-
/* Browser compatibility warning */
|
|
613
|
-
.compat-warning {
|
|
614
|
-
font-size: 13px;
|
|
615
|
-
color: var(--text-tertiary);
|
|
616
|
-
padding: 12px;
|
|
617
|
-
background: var(--bg-elevated);
|
|
618
|
-
border-radius: var(--radius-sm);
|
|
619
|
-
margin-bottom: 16px;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
/* Trust footer */
|
|
623
|
-
.login-footer {
|
|
624
|
-
margin-top: 24px;
|
|
625
|
-
padding-top: 20px;
|
|
626
|
-
border-top: 1px solid var(--border);
|
|
627
|
-
}
|
|
628
|
-
.secured-badge {
|
|
629
|
-
display: flex;
|
|
630
|
-
align-items: center;
|
|
631
|
-
justify-content: center;
|
|
632
|
-
gap: 6px;
|
|
633
|
-
font-size: 12px;
|
|
634
|
-
color: var(--text-tertiary);
|
|
635
|
-
}
|
|
636
|
-
.secured-badge svg { width: 14px; height: 14px; flex-shrink: 0; }
|
|
637
|
-
.footer-links {
|
|
638
|
-
margin-top: 8px;
|
|
639
|
-
font-size: 12px;
|
|
640
|
-
color: var(--text-tertiary);
|
|
641
|
-
}
|
|
642
|
-
.footer-links a {
|
|
643
|
-
color: var(--text-secondary);
|
|
644
|
-
text-decoration: none;
|
|
645
|
-
}
|
|
646
|
-
.footer-links a:hover { text-decoration: underline; }
|
|
647
|
-
|
|
648
|
-
/* \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 */
|
|
649
|
-
@keyframes fadeIn {
|
|
650
|
-
from { opacity: 0; transform: translateY(4px); }
|
|
651
|
-
to { opacity: 1; transform: translateY(0); }
|
|
652
|
-
}
|
|
653
|
-
@keyframes fadeOut {
|
|
654
|
-
from { opacity: 1; }
|
|
655
|
-
to { opacity: 0; }
|
|
656
|
-
}
|
|
657
|
-
.card[data-view] { animation: fadeIn 200ms ease-out; }
|
|
658
|
-
|
|
659
|
-
/* QR code scale-in */
|
|
660
|
-
.qr-view { animation: qrScaleIn 300ms ease-out; }
|
|
661
|
-
@keyframes qrScaleIn {
|
|
662
|
-
from { opacity: 0; transform: scale(0.95); }
|
|
663
|
-
to { opacity: 1; transform: scale(1); }
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
/* Button loading spinner */
|
|
667
|
-
@keyframes spin { to { transform: rotate(360deg); } }
|
|
668
|
-
.btn-spinner {
|
|
669
|
-
display: inline-block;
|
|
670
|
-
width: 16px; height: 16px;
|
|
671
|
-
border: 2px solid rgba(255,255,255,0.3);
|
|
672
|
-
border-top-color: #fff;
|
|
673
|
-
border-radius: 50%;
|
|
674
|
-
animation: spin 0.6s linear infinite;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
/* Success checkmark */
|
|
678
|
-
@keyframes checkDraw {
|
|
679
|
-
from { stroke-dashoffset: 24; }
|
|
680
|
-
to { stroke-dashoffset: 0; }
|
|
681
|
-
}
|
|
682
|
-
.success-check {
|
|
683
|
-
display: inline-block;
|
|
684
|
-
width: 20px; height: 20px;
|
|
685
|
-
vertical-align: middle;
|
|
686
|
-
}
|
|
687
|
-
.success-check path {
|
|
688
|
-
stroke-dasharray: 24;
|
|
689
|
-
stroke-dashoffset: 24;
|
|
690
|
-
animation: checkDraw 400ms ease-out forwards;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
/* Light theme background gradient adjustment */
|
|
694
|
-
[data-theme="light"] body {
|
|
695
|
-
background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.05) 0%, transparent 60%);
|
|
696
|
-
}
|
|
697
|
-
[data-theme="light"] .card,
|
|
698
|
-
:host([data-theme="light"]) .card {
|
|
699
|
-
box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.08);
|
|
700
|
-
}
|
|
701
|
-
[data-theme="light"] .btn:hover,
|
|
702
|
-
:host([data-theme="light"]) .btn:hover {
|
|
703
|
-
box-shadow: 0 2px 8px rgba(108,71,255,0.15);
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
/* Language sits on the same top row as Back / Cancel. */
|
|
707
|
-
.card-tools {
|
|
708
|
-
position: absolute;
|
|
709
|
-
top: 16px;
|
|
710
|
-
right: 16px;
|
|
711
|
-
z-index: 2;
|
|
712
|
-
display: flex;
|
|
713
|
-
align-items: flex-start;
|
|
714
|
-
}
|
|
715
|
-
.locale-switcher {
|
|
716
|
-
position: relative;
|
|
717
|
-
}
|
|
718
|
-
.locale-btn {
|
|
719
|
-
display: inline-flex;
|
|
720
|
-
align-items: center;
|
|
721
|
-
gap: 4px;
|
|
722
|
-
height: 28px;
|
|
723
|
-
padding: 4px 10px;
|
|
724
|
-
font-size: 12px;
|
|
725
|
-
color: var(--text-secondary);
|
|
726
|
-
background: var(--bg-elevated);
|
|
727
|
-
border: 1px solid var(--border-subtle);
|
|
728
|
-
border-radius: var(--radius-full);
|
|
729
|
-
cursor: pointer;
|
|
730
|
-
transition: color 0.15s, border-color 0.15s;
|
|
731
|
-
}
|
|
732
|
-
.locale-btn:hover {
|
|
733
|
-
color: var(--text);
|
|
734
|
-
border-color: var(--border-strong);
|
|
735
|
-
}
|
|
736
|
-
.locale-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
|
|
737
|
-
.locale-trigger {
|
|
738
|
-
display: inline-flex;
|
|
739
|
-
align-items: center;
|
|
740
|
-
gap: 4px;
|
|
741
|
-
height: 28px;
|
|
742
|
-
padding: 4px 10px;
|
|
743
|
-
font-size: 12px;
|
|
744
|
-
color: var(--text-secondary);
|
|
745
|
-
background: var(--bg-elevated);
|
|
746
|
-
border: 1px solid var(--border-subtle);
|
|
747
|
-
border-radius: var(--radius-full);
|
|
748
|
-
cursor: pointer;
|
|
749
|
-
}
|
|
750
|
-
.locale-trigger:hover {
|
|
751
|
-
color: var(--text);
|
|
752
|
-
border-color: var(--border-strong);
|
|
753
|
-
}
|
|
754
|
-
.locale-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }
|
|
755
|
-
.locale-menu {
|
|
756
|
-
display: none;
|
|
757
|
-
flex-direction: column;
|
|
758
|
-
align-items: stretch;
|
|
759
|
-
gap: 4px;
|
|
760
|
-
margin-top: 4px;
|
|
761
|
-
}
|
|
762
|
-
.locale-switcher.open .locale-menu {
|
|
763
|
-
display: flex;
|
|
764
|
-
}
|
|
765
|
-
.locale-btn[aria-checked="true"] {
|
|
766
|
-
color: var(--text);
|
|
767
|
-
border-color: var(--border-strong);
|
|
768
|
-
}
|
|
769
|
-
.locale-check { font-size: 11px; line-height: 1; }
|
|
770
|
-
.card { position: relative; }
|
|
771
|
-
|
|
772
|
-
/* Long localized method labels remain readable on narrow screens. */
|
|
773
|
-
.methods-grid { grid-template-columns: 1fr; }
|
|
774
|
-
.method-btn { min-height: 48px; white-space: normal; }
|
|
775
|
-
.passkey-alt { min-height: 44px; font-weight: 600; }
|
|
776
|
-
.oauth-recovery { font-size: 14px; line-height: 1.5; margin: 12px 0; }
|
|
777
|
-
@media (max-width: 480px) { .card { padding: 24px 20px; width: 100%; box-sizing: border-box; } h1 { font-size: 24px; } }
|
|
778
|
-
|
|
779
|
-
.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; }
|
|
780
|
-
.passkey-create-entry:hover { background: var(--bg-hover); text-decoration: none; }
|
|
781
|
-
.status:empty { min-height: 0; padding: 0; margin: 0; }
|
|
782
|
-
.passkey-section .subtitle { margin: 8px 0 16px; font-size: 14px; line-height: 1.5; }
|
|
783
|
-
@media (max-width: 480px) { .card { padding: 20px 18px; } .brand-header { margin-bottom: 20px; } }
|
|
784
|
-
|
|
785
|
-
.card-modal .card-tools { left: 20px; right: 80px; top: 12px; }
|
|
786
|
-
.card-modal .locale-switcher { min-width: 0; max-width: 100%; }
|
|
787
|
-
.card-modal .locale-trigger { max-width: 100%; height: 36px; }
|
|
788
|
-
.locale-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
789
|
-
.card-modal .locale-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 4; margin-top: 0;
|
|
790
|
-
width: max-content; max-width: min(260px,calc(100vw - 80px)); padding: 6px;
|
|
791
|
-
background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); }
|
|
792
|
-
.card-modal .locale-menu .locale-btn { min-height: 40px; height: auto; text-align: left; border-radius: 6px; }
|
|
793
|
-
.card-modal .locale-menu .locale-btn span { overflow-wrap: anywhere; }
|
|
794
|
-
|
|
795
|
-
.card { padding: 52px 24px 24px; box-sizing: border-box; }
|
|
796
|
-
.card-modal { width: 100%; }
|
|
797
|
-
.card-modal { padding-top: 68px; border: 0; border-radius: 0; }
|
|
798
|
-
/* The dialog frame owns the shadow in both palettes. */
|
|
799
|
-
.card.card-modal, :host([data-theme="light"]) .card.card-modal { box-shadow: none; }
|
|
800
|
-
/* A translateY entrance expands an auto scroller by 4px until it finishes. */
|
|
801
|
-
.card-modal[data-view] { animation: none; }
|
|
802
|
-
.card-modal .back-btn { position: static; display: flex; width: max-content; max-width: 100%; margin: 0 0 16px; }
|
|
803
|
-
.card-modal h1 { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; line-height: 1.4; padding-block: 2px; }
|
|
804
|
-
.card-modal h1[tabindex="-1"]:focus { outline: none; }
|
|
805
|
-
.card-modal h1, .card-modal h2, .card-modal .subtitle, .card-modal .status { overflow-wrap: anywhere; }
|
|
806
|
-
.card-modal .btn { height: auto; min-height: 44px; line-height: 1.4; padding-block: 10px; white-space: normal; }
|
|
807
|
-
.card-modal button, .card-modal a { overflow-wrap: anywhere; }
|
|
808
|
-
.social-first .divider { margin: 14px 0; }
|
|
809
|
-
.social-first .app-logo { width: 32px; height: 32px; margin-bottom: 12px; }
|
|
810
|
-
.social-first .login-footer { margin-top: 16px; padding-top: 12px; }
|
|
811
|
-
.other-methods { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }
|
|
812
|
-
.other-methods summary { min-height: 44px; padding: 12px 0; cursor: pointer; }
|
|
813
|
-
.other-methods summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
|
|
814
|
-
@media (max-width:480px) { .card { padding: 52px 18px 24px; } }
|
|
815
|
-
@media (max-width:480px) { .card-modal { padding-top: 68px; } .card-modal .card-tools { left: 18px; } }
|
|
816
|
-
@media (prefers-reduced-motion: reduce) { .card[data-view], .qr-view { animation: none; } }
|
|
817
|
-
|
|
818
|
-
.passkey-creating > .methods-grid, .passkey-creating > .divider, .passkey-creating > .other-methods { display: none; }
|
|
819
|
-
|
|
820
|
-
.input-label { display: block; text-align: left; margin: 8px 0; color: var(--text); font-size: 14px; font-weight: 500; }
|
|
821
|
-
.input-label[hidden], .email-help[hidden] { display: none; }
|
|
822
|
-
.email-help { text-align: left; font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 12px; }
|
|
823
|
-
`;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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}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">
|
|
824
|
-
<div class="connect-spinner-ring"></div>
|
|
825
|
-
<span class="connect-status-badge">${Ce}</span>
|
|
826
|
-
</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">
|
|
827
|
-
<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>
|
|
828
|
-
</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}
|
|
829
|
-
:host { color-scheme: dark; }
|
|
830
|
-
:host([data-theme="light"]) { color-scheme: light; }
|
|
831
|
-
dialog { box-sizing:border-box; position:fixed; inset:0; margin:auto; padding:0;
|
|
832
|
-
width:min(420px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px);
|
|
833
|
-
border:1px solid var(--border); border-radius:16px; background:var(--bg-card);
|
|
834
|
-
color:var(--text); color-scheme:inherit; overflow:hidden; box-shadow:var(--shadow-lg); }
|
|
835
|
-
dialog::backdrop { background:rgba(8,10,18,.56); }
|
|
836
|
-
:host(:not([data-theme="light"])) dialog::backdrop { background:rgba(0,0,0,.68); }
|
|
837
|
-
[data-dialog-scroll] { max-height:calc(100dvh - 34px); overflow:auto; overscroll-behavior:contain; }
|
|
838
|
-
.close { position:absolute; top:8px; right:8px; z-index:3; display:grid; place-items:center;
|
|
839
|
-
box-sizing:border-box; width:44px; height:44px; padding:0; border:1px solid transparent;
|
|
840
|
-
border-radius:10px; background:var(--bg-card); color:var(--text-secondary);
|
|
841
|
-
font:400 24px/1 system-ui,sans-serif; cursor:pointer; }
|
|
842
|
-
.close:hover { color:var(--text); background:var(--bg-hover); }
|
|
843
|
-
.close:focus-visible { outline:2px solid var(--blue); outline-offset:-3px; }
|
|
844
|
-
.host-error { padding:16px 20px; font:14px/1.5 system-ui,sans-serif; overflow-wrap:anywhere; }
|
|
845
|
-
.retry { padding:10px 16px; margin:0 20px 20px; color:var(--text); background:var(--bg-elevated);
|
|
846
|
-
border:1px solid var(--border); border-radius:8px; font:inherit; cursor:pointer; }
|
|
847
|
-
`,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);})();
|