pwa-auth 3.7.1 → 3.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/base/webcomponents/drawer/css/exit.js +1 -1
- package/base/webcomponents/drawer/drawer.d.ts +1 -0
- package/base/webcomponents/drawer/drawer.d.ts.map +1 -1
- package/base/webcomponents/drawer/drawer.js +24 -10
- package/base/webcomponents/drawer/drawer.js.map +1 -1
- package/base/webcomponents/form/css/button.js +2 -2
- package/base/webcomponents/form/css/input.d.ts.map +1 -1
- package/base/webcomponents/form/css/input.js +9 -1
- package/base/webcomponents/form/css/input.js.map +1 -1
- package/base/webcomponents/form/css/label.d.ts.map +1 -1
- package/base/webcomponents/form/css/label.js +5 -0
- package/base/webcomponents/form/css/label.js.map +1 -1
- package/base/webcomponents/form/css/status.d.ts.map +1 -1
- package/base/webcomponents/form/css/status.js +1 -0
- package/base/webcomponents/form/css/status.js.map +1 -1
- package/base/webcomponents/form/css/toggle.d.ts.map +1 -1
- package/base/webcomponents/form/css/toggle.js +6 -1
- package/base/webcomponents/form/css/toggle.js.map +1 -1
- package/base/webcomponents/form/forgot.d.ts.map +1 -1
- package/base/webcomponents/form/forgot.js +5 -1
- package/base/webcomponents/form/forgot.js.map +1 -1
- package/base/webcomponents/form/login.d.ts.map +1 -1
- package/base/webcomponents/form/login.js +14 -16
- package/base/webcomponents/form/login.js.map +1 -1
- package/base/webcomponents/form/signup.d.ts.map +1 -1
- package/base/webcomponents/form/signup.js +4 -6
- package/base/webcomponents/form/signup.js.map +1 -1
- package/base/webcomponents/icon/css/icon.js +1 -1
- package/base/webcomponents/icon/icon.d.ts +2 -0
- package/base/webcomponents/icon/icon.d.ts.map +1 -1
- package/base/webcomponents/icon/icon.js +19 -0
- package/base/webcomponents/icon/icon.js.map +1 -1
- package/base/webcomponents/login/css/auth.js +1 -1
- package/base/webcomponents/login/page.d.ts.map +1 -1
- package/base/webcomponents/login/page.js +9 -3
- package/base/webcomponents/login/page.js.map +1 -1
- package/base/webcomponents/settings/css/navigation.d.ts.map +1 -1
- package/base/webcomponents/settings/css/navigation.js +7 -0
- package/base/webcomponents/settings/css/navigation.js.map +1 -1
- package/base/webcomponents/settings/input/delete.d.ts.map +1 -1
- package/base/webcomponents/settings/input/delete.js +4 -5
- package/base/webcomponents/settings/input/delete.js.map +1 -1
- package/base/webcomponents/settings/input/email.js +5 -5
- package/base/webcomponents/settings/input/email.js.map +1 -1
- package/base/webcomponents/settings/input/name.d.ts.map +1 -1
- package/base/webcomponents/settings/input/name.js +1 -0
- package/base/webcomponents/settings/input/name.js.map +1 -1
- package/base/webcomponents/settings/input/password.d.ts.map +1 -1
- package/base/webcomponents/settings/input/password.js +12 -15
- package/base/webcomponents/settings/input/password.js.map +1 -1
- package/base/webcomponents/settings/input/uploader.js +1 -1
- package/base/webcomponents/settings/input/verify.js +1 -1
- package/base/webcomponents/settings/settings.d.ts +20 -4
- package/base/webcomponents/settings/settings.d.ts.map +1 -1
- package/base/webcomponents/settings/settings.js +240 -129
- package/base/webcomponents/settings/settings.js.map +1 -1
- package/package.json +1 -1
- package/source/pwa-auth.js +182 -165
package/source/pwa-auth.js
CHANGED
|
@@ -146,7 +146,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
146
146
|
background-color: var(--pwa_background, var(--section_background_color, #fff));
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
h2 {
|
|
150
150
|
margin: 0;
|
|
151
151
|
padding: 18px var(--pwa_inset, 0px) 14px;
|
|
152
152
|
font-size: 1.15rem;
|
|
@@ -196,7 +196,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
196
196
|
.action-button:focus { outline: 0; }
|
|
197
197
|
|
|
198
198
|
.action-button:focus-visible {
|
|
199
|
-
outline: 2px solid var(--
|
|
199
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
200
200
|
outline-offset: 2px;
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -267,7 +267,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
267
267
|
.google:focus { outline: 0; }
|
|
268
268
|
|
|
269
269
|
.google:focus-visible {
|
|
270
|
-
outline: 2px solid #
|
|
270
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
271
271
|
outline-offset: 2px;
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -318,6 +318,11 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
318
318
|
padding-inline: var(--pwa_inset, 0px);
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
/* Required - the show button sits beside the field, not inside the label. */
|
|
322
|
+
label:has(+ .pair) {
|
|
323
|
+
padding-bottom: 6px;
|
|
324
|
+
}
|
|
325
|
+
|
|
321
326
|
label {
|
|
322
327
|
display: grid;
|
|
323
328
|
gap: 6px;
|
|
@@ -353,11 +358,19 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
353
358
|
padding: 8px 14px;
|
|
354
359
|
color: var(--pwa_drawer_text_color, #1c2430);
|
|
355
360
|
background-color: var(--pwa_input_background_color, var(--pwa_background, #fff));
|
|
356
|
-
border: 1px solid var(--
|
|
361
|
+
border: 1px solid var(--pwa_input_border_color, #8d8870);
|
|
357
362
|
border-radius: 10px;
|
|
358
363
|
font-size: 1rem;
|
|
359
364
|
}
|
|
360
365
|
|
|
366
|
+
input[type=text]:focus-visible,
|
|
367
|
+
input[type=email]:focus-visible,
|
|
368
|
+
input[type=password]:focus-visible,
|
|
369
|
+
select:focus-visible {
|
|
370
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
371
|
+
outline-offset: 1px;
|
|
372
|
+
}
|
|
373
|
+
|
|
361
374
|
input.invalid { background-color: #ffdddd; }
|
|
362
375
|
|
|
363
376
|
/* Required - Chrome paints a yellow autofill. Keep the field on the component background. */
|
|
@@ -393,6 +406,11 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
393
406
|
min-height: var(--pwa_tap, 44px); /* Required - minimum tap target */
|
|
394
407
|
}
|
|
395
408
|
|
|
409
|
+
.new:focus-visible {
|
|
410
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
411
|
+
outline-offset: 2px;
|
|
412
|
+
}
|
|
413
|
+
|
|
396
414
|
.reveal {
|
|
397
415
|
appearance: none;
|
|
398
416
|
border: 0;
|
|
@@ -410,7 +428,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
410
428
|
.reveal:focus { outline: 0; }
|
|
411
429
|
|
|
412
430
|
.reveal:focus-visible {
|
|
413
|
-
outline: 2px solid var(--
|
|
431
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
414
432
|
outline-offset: 2px;
|
|
415
433
|
}
|
|
416
434
|
|
|
@@ -446,6 +464,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
446
464
|
display: block;
|
|
447
465
|
position: relative;
|
|
448
466
|
min-width: 0;
|
|
467
|
+
margin: 0 0 14px;
|
|
449
468
|
}
|
|
450
469
|
|
|
451
470
|
/* Required - Show sits in the field so the input border matches the column. */
|
|
@@ -549,26 +568,24 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
549
568
|
|
|
550
569
|
<li>
|
|
551
570
|
|
|
552
|
-
<label for="${e}">Password
|
|
553
|
-
|
|
554
|
-
<span class="pair">
|
|
571
|
+
<label for="${e}">Password</label>
|
|
555
572
|
|
|
556
|
-
|
|
557
|
-
id= "${e}"
|
|
558
|
-
name= "password"
|
|
559
|
-
part= "password"
|
|
560
|
-
type= "${this.showPassword?"text":"password"}"
|
|
561
|
-
autocomplete= "current-password"
|
|
562
|
-
aria-invalid= "${"error"===this.tone?"true":"false"}"
|
|
563
|
-
aria-describedby="${n}"
|
|
564
|
-
@input= "${this.handlePassword}"
|
|
565
|
-
@change= "${this.handlePassword}">
|
|
573
|
+
<span class="pair">
|
|
566
574
|
|
|
567
|
-
|
|
575
|
+
<input
|
|
576
|
+
id= "${e}"
|
|
577
|
+
name= "password"
|
|
578
|
+
part= "password"
|
|
579
|
+
type= "${this.showPassword?"text":"password"}"
|
|
580
|
+
autocomplete= "current-password"
|
|
581
|
+
aria-invalid= "${"error"===this.tone?"true":"false"}"
|
|
582
|
+
aria-describedby="${n}"
|
|
583
|
+
@input= "${this.handlePassword}"
|
|
584
|
+
@change= "${this.handlePassword}">
|
|
568
585
|
|
|
569
|
-
|
|
586
|
+
${nD(this.showPassword,()=>{this.showPassword=!this.showPassword})}
|
|
570
587
|
|
|
571
|
-
</
|
|
588
|
+
</span>
|
|
572
589
|
|
|
573
590
|
</li>
|
|
574
591
|
|
|
@@ -669,9 +686,9 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
669
686
|
|
|
670
687
|
<li>
|
|
671
688
|
|
|
672
|
-
<label for="${e}">Password
|
|
673
|
-
|
|
674
|
-
|
|
689
|
+
<label for="${e}">Password</label>
|
|
690
|
+
|
|
691
|
+
<span class="pair">
|
|
675
692
|
|
|
676
693
|
<input
|
|
677
694
|
id= "${e}"
|
|
@@ -690,9 +707,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
690
707
|
|
|
691
708
|
</span>
|
|
692
709
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
</label>
|
|
710
|
+
<p id="${n}" class="hint" part="hint">${VE}</p>
|
|
696
711
|
|
|
697
712
|
</li>
|
|
698
713
|
|
|
@@ -725,7 +740,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
725
740
|
|
|
726
741
|
</form>
|
|
727
742
|
|
|
728
|
-
`}change(){bn.dispatch(rn(this.source))}async google(){if(!this.busy){this.busy=!0,this.tone="",this.status="";try{await bE()}catch(t){this.show(mE(t))}finally{this.busy=!1}}}show(t){this.tone="error",this.status=KE(t),gE(PE,t)}readFields(){const t=this.renderRoot.querySelector('input[type="email"]'),e=this.renderRoot.querySelector('input[name="new-password"]');this.email=t?.value??"",this.password=e?.value??""}_handleSubmit(t){t.preventDefault(),this.signUp()}handleEmail(t){const e=t.target;this.email=e.value}handlePassword(t){const e=t.target;this.password=e.value}async signUp(){if(this.busy)return;if(this.readFields(),this.email.length<4)return void this.show({code:"pwa/missing-email",message:"Enter an email address."});const t=qE(this.password);t?this.show(t):await this.newAccount(this.email,this.password)}};function nb(t){if(lE())return;const e=t.getAttribute("firebase-config");if(e)try{dE({config:JSON.parse(e)})}catch(t){gE(PE,mE(t))}}function sb(t,e){const n=t.trim();if(n){return n.split(/\s+/).slice(0,2).map(t=>t.charAt(0)).join("").toUpperCase()}const s=e.trim();return s?s.charAt(0).toUpperCase():""}function rb(t,e){const n=t.trim();if(n)return n;const s=e.trim();return s||"Account"}Z_([lt({type:String}),tb("design:type",Object)],eb.prototype,"source",void 0),Z_([lt({type:Boolean,attribute:"hide-google",reflect:!0}),tb("design:type",Object)],eb.prototype,"hideGoogle",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"email",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"password",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"status",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"tone",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"busy",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"showPassword",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"notice",void 0),eb=Z_([at("form-signup"),tb("design:paramtypes",[])],eb);var ib=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ob=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ab=class extends(wt(bn)(it)){constructor(){super(),this.subscribe=!1,this.hideGoogle=!1,this._name="",this._email="",this._verified=!1,this._notice="",this._log=!1,this._sign=!1,this.motion=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.booted=!1,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&this.rest()}}connectedCallback(){nb(this),super.connectedCallback(),this._notice=Y_(),this.stopNotice=X_(()=>{this._notice=Y_()})}disconnectedCallback(){this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){this._name=t.backend.name,this._email=t.backend.email,this._verified=Boolean(t.backend?.verified),this._log=t.frontend.login,this._sign=t.frontend.registerTwo}willUpdate(t){if(!this.booted)return;if(!t.has("_sign")&&!t.has("_log"))return;t.has("_sign")&&(this.motion=!0);const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,e)return this.watchColumn(),void requestAnimationFrame(()=>{this.motion=!0});if(!t.has("_sign")&&!t.has("_log"))return;const n=this.clip(),s=this.sheet();if(!n||!s||null==this.heldHeight)return;const r=this.heldHeight;this.heldHeight=null;const i=Math.ceil(s.getBoundingClientRect().height);Math.abs(i-r)>1?this.rollBetween(n,s,r,i,i):this.rest()}watchColumn(){"undefined"!=typeof ResizeObserver&&(this.columnObserver=new ResizeObserver(()=>{const t=Math.round(this.getBoundingClientRect().width);if(!t||t===this.columnWidth)return;if(this.columnWidth=t,!this.rollMotion)return;const e=this.clip(),n=this.sheet();if(!e||!n)return;const s=Math.ceil(e.getBoundingClientRect().height),r=Math.ceil(n.getBoundingClientRect().height);this.rollBetween(e,n,s,r,r)}),this.columnObserver.observe(this))}clip(){return this.shadowRoot?.querySelector(".login-clip")??null}sheet(){return this.shadowRoot?.querySelector(".service")??null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}rest(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}clipStyle(){const t=this.rollMotion&&!this.reduced();return{height:this.clipHeight,maxHeight:"auto"===this.clipHeight?"none":this.clipHeight,transition:t?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}sheetStyle(){const t=this.rollMotion&&!this.reduced();return{transform:this.sheetShift,transition:t?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}rollBetween(t,e,n,s,r){const i=n-r,o=s-r,a=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(s-n)<=1)return void this.rest();t.style.transition="none",e.style.transition="none",t.style.height=`${Math.max(0,n)}px`,t.style.maxHeight=`${Math.max(0,n)}px`,e.style.transform=a(i),t.offsetHeight,t.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",e.style.transition="transform var(--pwa_slide, 2s) ease-in-out",t.style.height=`${Math.max(0,s)}px`,t.style.maxHeight=`${Math.max(0,s)}px`,e.style.transform=a(o),this.rollMotion=!0,this.clipHeight=`${Math.max(0,s)}px`,this.sheetShift=a(o)}static get styles(){return[Tn,On,An,Sn,vn,eD,K_,i`
|
|
743
|
+
`}change(){bn.dispatch(rn(this.source))}async google(){if(!this.busy){this.busy=!0,this.tone="",this.status="";try{await bE()}catch(t){this.show(mE(t))}finally{this.busy=!1}}}show(t){this.tone="error",this.status=KE(t),gE(PE,t)}readFields(){const t=this.renderRoot.querySelector('input[type="email"]'),e=this.renderRoot.querySelector('input[name="new-password"]');this.email=t?.value??"",this.password=e?.value??""}_handleSubmit(t){t.preventDefault(),this.signUp()}handleEmail(t){const e=t.target;this.email=e.value}handlePassword(t){const e=t.target;this.password=e.value}async signUp(){if(this.busy)return;if(this.readFields(),this.email.length<4)return void this.show({code:"pwa/missing-email",message:"Enter an email address."});const t=qE(this.password);t?this.show(t):await this.newAccount(this.email,this.password)}};function nb(t){if(lE())return;const e=t.getAttribute("firebase-config");if(e)try{dE({config:JSON.parse(e)})}catch(t){gE(PE,mE(t))}}function sb(t,e){const n=t.trim();if(n){return n.split(/\s+/).slice(0,2).map(t=>t.charAt(0)).join("").toUpperCase()}const s=e.trim();return s?s.charAt(0).toUpperCase():""}function rb(t,e){const n=t.trim();if(n)return n;const s=e.trim();return s||"Account"}Z_([lt({type:String}),tb("design:type",Object)],eb.prototype,"source",void 0),Z_([lt({type:Boolean,attribute:"hide-google",reflect:!0}),tb("design:type",Object)],eb.prototype,"hideGoogle",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"email",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"password",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"status",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"tone",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"busy",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"showPassword",void 0),Z_([ut(),tb("design:type",Object)],eb.prototype,"notice",void 0),eb=Z_([at("form-signup"),tb("design:paramtypes",[])],eb);var ib=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ob=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ab=class extends(wt(bn)(it)){constructor(){super(),this.subscribe=!1,this.hideGoogle=!1,this._name="",this._email="",this._verified=!1,this._notice="",this._log=!1,this._sign=!1,this.motion=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.booted=!1,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&this.rest()}}connectedCallback(){nb(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Account"),super.connectedCallback(),this._notice=Y_(),this.stopNotice=X_(()=>{this._notice=Y_()})}disconnectedCallback(){this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){this._name=t.backend.name,this._email=t.backend.email,this._verified=Boolean(t.backend?.verified),this._log=t.frontend.login,this._sign=t.frontend.registerTwo}willUpdate(t){if(!this.booted)return;if(!t.has("_sign")&&!t.has("_log"))return;t.has("_sign")&&(this.motion=!0);const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,e)return this.watchColumn(),void requestAnimationFrame(()=>{this.motion=!0});if(!t.has("_sign")&&!t.has("_log"))return;const n=this.clip(),s=this.sheet();if(!n||!s||null==this.heldHeight)return;const r=this.heldHeight;this.heldHeight=null;const i=Math.ceil(s.getBoundingClientRect().height);Math.abs(i-r)>1?this.rollBetween(n,s,r,i,i):this.rest()}watchColumn(){"undefined"!=typeof ResizeObserver&&(this.columnObserver=new ResizeObserver(()=>{const t=Math.round(this.getBoundingClientRect().width);if(!t||t===this.columnWidth)return;if(this.columnWidth=t,!this.rollMotion)return;const e=this.clip(),n=this.sheet();if(!e||!n)return;const s=Math.ceil(e.getBoundingClientRect().height),r=Math.ceil(n.getBoundingClientRect().height);this.rollBetween(e,n,s,r,r)}),this.columnObserver.observe(this))}clip(){return this.shadowRoot?.querySelector(".login-clip")??null}sheet(){return this.shadowRoot?.querySelector(".service")??null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}rest(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}clipStyle(){const t=this.rollMotion&&!this.reduced();return{height:this.clipHeight,maxHeight:"auto"===this.clipHeight?"none":this.clipHeight,transition:t?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}sheetStyle(){const t=this.rollMotion&&!this.reduced();return{transform:this.sheetShift,transition:t?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}rollBetween(t,e,n,s,r){const i=n-r,o=s-r,a=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(s-n)<=1)return void this.rest();t.style.transition="none",e.style.transition="none",t.style.height=`${Math.max(0,n)}px`,t.style.maxHeight=`${Math.max(0,n)}px`,e.style.transform=a(i),t.offsetHeight,t.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",e.style.transition="transform var(--pwa_slide, 2s) ease-in-out",t.style.height=`${Math.max(0,s)}px`,t.style.maxHeight=`${Math.max(0,s)}px`,e.style.transform=a(o),this.rollMotion=!0,this.clipHeight=`${Math.max(0,s)}px`,this.sheetShift=a(o)}static get styles(){return[Tn,On,An,Sn,vn,eD,K_,i`
|
|
729
744
|
/* Required - this card's roll only. Block, so the sheet is not stretched to the clip. */
|
|
730
745
|
.login-clip {
|
|
731
746
|
display: block;
|
|
@@ -745,9 +760,9 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
745
760
|
@transitionend=${this.onClipEnd}>
|
|
746
761
|
<section class="service" part="panel" style=${mt(this.sheetStyle())}>
|
|
747
762
|
|
|
748
|
-
<
|
|
749
|
-
<
|
|
750
|
-
</
|
|
763
|
+
<div part="header">
|
|
764
|
+
<h2 part="title">${this._log?rb(this._name,this._email):this._sign===this.subscribe?"Login":"Subscribe"}</h2>
|
|
765
|
+
</div>
|
|
751
766
|
|
|
752
767
|
<!-- Logged-out State -->
|
|
753
768
|
<div
|
|
@@ -763,6 +778,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
763
778
|
?hide-google= "${this.hideGoogle}"
|
|
764
779
|
exportparts= "email: login-email, password: login-password, submit: login-submit, switch: login-switch, forgot: login-forgot, status: login-status, reveal: login-reveal, google: login-google"
|
|
765
780
|
?inert= "${this._sign!==this.subscribe}"
|
|
781
|
+
aria-hidden= "${this._sign!==this.subscribe?"true":"false"}"
|
|
766
782
|
class= ${ft({content:!0,opened:this._sign===this.subscribe,closed:this._sign!==this.subscribe})}></form-login>
|
|
767
783
|
|
|
768
784
|
<!-- Sign-up State -->
|
|
@@ -771,6 +787,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
771
787
|
?hide-google= "${this.hideGoogle}"
|
|
772
788
|
exportparts= "email: signup-email, password: signup-password, submit: signup-submit, switch: signup-switch, status: signup-status, reveal: signup-reveal, notice: signup-notice, google: signup-google"
|
|
773
789
|
?inert= "${this._sign===this.subscribe}"
|
|
790
|
+
aria-hidden= "${this._sign===this.subscribe?"true":"false"}"
|
|
774
791
|
class= ${ft({content:!0,opened:!this._sign===this.subscribe,closed:!this._sign!==this.subscribe})}></form-signup>
|
|
775
792
|
|
|
776
793
|
</div>
|
|
@@ -861,7 +878,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
861
878
|
border-bottom: 1px solid var(--pwa_line_color, #e3daca);
|
|
862
879
|
}
|
|
863
880
|
|
|
864
|
-
.exit >
|
|
881
|
+
.exit > h2 {
|
|
865
882
|
font-weight: 600;
|
|
866
883
|
font-size: 1rem;
|
|
867
884
|
margin: 0 auto;
|
|
@@ -1078,7 +1095,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1078
1095
|
.status:focus { outline: 0; }
|
|
1079
1096
|
|
|
1080
1097
|
.status:focus-visible {
|
|
1081
|
-
outline: 2px solid var(--
|
|
1098
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
1082
1099
|
outline-offset: 2px;
|
|
1083
1100
|
}
|
|
1084
1101
|
|
|
@@ -1135,7 +1152,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1135
1152
|
</form>
|
|
1136
1153
|
|
|
1137
1154
|
</div>
|
|
1138
|
-
`}showSent(){this.tone="",this.status="Check your inbox for the verification email.",this.cooldown=45,this.armCooldown(),this.updateComplete.then(()=>{this.focusStatus()})}showFirebase(t){this.tone="error",this.status=KE(t),this.updateComplete.then(()=>{this.focusStatus()})}focusStatus(){const t=this.renderRoot.querySelector("#pwa-verify-status");t?.focus()}clearWait(){window.clearInterval(this.timer),this.timer=0,this.cooldown=0}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}}mb([ut(),wb("design:type",Object)],yb.prototype,"login",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"verified",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"email",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"status",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"tone",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"busy",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"cooldown",void 0),customElements.define("email-verify",yb);var Eb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Db=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _b=class extends(wt(bn)(it)){constructor(){super(),this.url="",this.drawer=!1,this.subscribe=!1,this.hideGoogle=!1,this.name="",this.email="",this.verified=!1,this.notice="",this.user=!1,this.signup=!1,this.sliding=!1,this.motion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)",this.rollMotion=!1,this.booted=!1,this.wasOpen=!1,this.sawOpen=!1,this.returnFocus=null,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{if(!(t instanceof TransitionEvent))return;if(t.target!==t.currentTarget)return;if("max-height"!==t.propertyName)return;const e=t.currentTarget;e instanceof HTMLElement&&(this.drawer?this.restOpen():e.getBoundingClientRect().height>1||(this.sliding=!1,this.restShut()))},this.onKey=t=>{if(!this.drawer)return;if("Escape"===t.key)return t.preventDefault(),void bn.dispatch(hn());if("Tab"!==t.key)return;const e=pb(this);if(!e.length)return;const n=e[0],s=e[e.length-1],r=fb(),i=!!r&&e.includes(r);t.shiftKey?i&&r!==n||(t.preventDefault(),s.focus({preventScroll:!0})):i&&r!==s||(t.preventDefault(),n.focus({preventScroll:!0}))},this.onLightClick=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const n=e.closest("a, button");n instanceof HTMLElement&&this.contains(n)&&(this.shadowRoot?.contains(n)||bn.dispatch(hn()))},this.onSettings=t=>{const e=this.destination();if(!this.dispatchEvent(new CustomEvent(FE,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:e}})))return void t.preventDefault();if(bn.dispatch(hn()),e)return;t.preventDefault();const n=document.querySelector("user-settings");n instanceof HTMLElement&&n.scrollIntoView({block:"nearest"})}}connectedCallback(){nb(this),super.connectedCallback(),this.addEventListener("keydown",this.onKey),this.addEventListener("click",this.onLightClick),this.notice=Y_(),this.stopNotice=X_(()=>{this.notice=Y_()})}disconnectedCallback(){this.removeEventListener("keydown",this.onKey),this.removeEventListener("click",this.onLightClick),this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){const e=t.frontend.drawer;this.name=t.backend.name,this.email=t.backend.email,this.verified=Boolean(t.backend?.verified),e?this.sliding=!0:this.reduced()&&(this.sliding=!1),this.drawer=e,this.user=t.frontend.login,this.signup=t.frontend.registerOne;(this.sawOpen?e!==this.wasOpen:e)&&function(t,e,n){t.dispatchEvent(new CustomEvent(e,{...fE,detail:n}))}(this,LE,{open:e}),this.wasOpen=e,this.sawOpen=!0}willUpdate(t){if(!this.booted)return void(this.drawer&&this.restOpen());if(t.has("signup")&&(this.motion=!0),t.has("drawer")||!t.has("signup")||!this.drawer)return;const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,!e&&t.has("drawer"))this.heldHeight=null,this.drawer?this.unroll():this.rollUp();else if(!e&&null!=this.heldHeight&&this.drawer){const t=this.heldHeight;this.heldHeight=null;const e=this.clip(),n=this.sheet();if(e&&n){const s=Math.ceil(n.getBoundingClientRect().height);Math.abs(s-t)>1?this.rollBetween(e,n,t,s,s):this.restOpen()}}if(e&&requestAnimationFrame(()=>{this.motion=!0})
|
|
1155
|
+
`}showSent(){this.tone="",this.status="Check your inbox for the verification email.",this.cooldown=45,this.armCooldown(),this.updateComplete.then(()=>{this.focusStatus()})}showFirebase(t){this.tone="error",this.status=KE(t),this.updateComplete.then(()=>{this.focusStatus()})}focusStatus(){const t=this.renderRoot.querySelector("#pwa-verify-status");t?.focus()}clearWait(){window.clearInterval(this.timer),this.timer=0,this.cooldown=0}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}}mb([ut(),wb("design:type",Object)],yb.prototype,"login",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"verified",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"email",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"status",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"tone",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"busy",void 0),mb([ut(),wb("design:type",Object)],yb.prototype,"cooldown",void 0),customElements.define("email-verify",yb);var Eb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Db=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _b=class extends(wt(bn)(it)){constructor(){super(),this.url="",this.drawer=!1,this.subscribe=!1,this.hideGoogle=!1,this.name="",this.email="",this.verified=!1,this.notice="",this.user=!1,this.signup=!1,this.sliding=!1,this.motion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)",this.rollMotion=!1,this.booted=!1,this.wasOpen=!1,this.sawOpen=!1,this.returnFocus=null,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{if(!(t instanceof TransitionEvent))return;if(t.target!==t.currentTarget)return;if("max-height"!==t.propertyName)return;const e=t.currentTarget;e instanceof HTMLElement&&(this.drawer?this.restOpen():e.getBoundingClientRect().height>1||(this.sliding=!1,this.restShut()))},this.onKey=t=>{if(!this.drawer)return;if("Escape"===t.key)return t.preventDefault(),void bn.dispatch(hn());if("Tab"!==t.key)return;const e=pb(this);if(!e.length)return;const n=e[0],s=e[e.length-1],r=fb(),i=!!r&&e.includes(r);t.shiftKey?i&&r!==n||(t.preventDefault(),s.focus({preventScroll:!0})):i&&r!==s||(t.preventDefault(),n.focus({preventScroll:!0}))},this.onLightClick=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const n=e.closest("a, button");n instanceof HTMLElement&&this.contains(n)&&(this.shadowRoot?.contains(n)||bn.dispatch(hn()))},this.onSettings=t=>{const e=this.destination();if(!this.dispatchEvent(new CustomEvent(FE,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:e}})))return void t.preventDefault();if(bn.dispatch(hn()),e)return;t.preventDefault();const n=document.querySelector("user-settings");n instanceof HTMLElement&&n.scrollIntoView({block:"nearest"})}}connectedCallback(){nb(this),this.id||(this.id="pwa-user-drawer"),super.connectedCallback(),this.addEventListener("keydown",this.onKey),this.addEventListener("click",this.onLightClick),this.notice=Y_(),this.stopNotice=X_(()=>{this.notice=Y_()})}disconnectedCallback(){this.removeEventListener("keydown",this.onKey),this.removeEventListener("click",this.onLightClick),this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){const e=t.frontend.drawer;this.name=t.backend.name,this.email=t.backend.email,this.verified=Boolean(t.backend?.verified),e?this.sliding=!0:this.reduced()&&(this.sliding=!1),this.drawer=e,this.user=t.frontend.login,this.signup=t.frontend.registerOne;(this.sawOpen?e!==this.wasOpen:e)&&function(t,e,n){t.dispatchEvent(new CustomEvent(e,{...fE,detail:n}))}(this,LE,{open:e}),this.wasOpen=e,this.sawOpen=!0}willUpdate(t){if(!this.booted)return void(this.drawer&&this.restOpen());if(t.has("signup")&&(this.motion=!0),t.has("drawer")||!t.has("signup")||!this.drawer)return;const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,!e&&t.has("drawer"))this.heldHeight=null,this.drawer?this.unroll():this.rollUp();else if(!e&&null!=this.heldHeight&&this.drawer){const t=this.heldHeight;this.heldHeight=null;const e=this.clip(),n=this.sheet();if(e&&n){const s=Math.ceil(n.getBoundingClientRect().height);Math.abs(s-t)>1?this.rollBetween(e,n,t,s,s):this.restOpen()}}if(e&&requestAnimationFrame(()=>{this.motion=!0}),!t.has("drawer"))return;if(this.drawer){const t=fb();return this.returnFocus=t&&!this.contains(t)?t:this.returnFocus,this.shadowRoot?.querySelector(".close")?.focus({preventScroll:!0}),void V_(!1)}const n=this.returnFocus??this.toggleButton();n?.focus(),this.returnFocus=null}clip(){return this.shadowRoot?.querySelector(".drawer-clip")??null}sheet(){return this.shadowRoot?.querySelector(".userDrawer")??null}toggleButton(){const t=document.querySelector("user-icon"),e=t?.shadowRoot?.querySelector("button");return e instanceof HTMLElement?e:null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}restShut(){this.rollMotion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)"}restOpen(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}clipStyle(){const t=this.rollMotion&&!this.reduced();return{height:this.clipHeight,maxHeight:"auto"===this.clipHeight?"none":this.clipHeight,transition:t?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}sheetStyle(){const t=this.rollMotion&&!this.reduced();return{transform:this.sheetShift,transition:t?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}unroll(){const t=this.clip(),e=this.sheet();if(!t||!e)return;this.scrollTop=0,this.placeAnchor();const n=this.sheetPx(t,e),s=Math.ceil(t.getBoundingClientRect().height);this.rollBetween(t,e,s,n,n)}rollUp(){const t=this.clip(),e=this.sheet();if(!t||!e)return;const n=Math.ceil(e.getBoundingClientRect().height),s=Math.ceil(t.getBoundingClientRect().height);this.rollBetween(t,e,s,0,n),this.reduced()&&(this.sliding=!1)}sheetPx(t,e){const n=t.style.transition,s=t.style.maxHeight,r=t.style.height;t.style.transition="none",t.style.maxHeight="none",t.style.height="auto";const i=Math.ceil(e.getBoundingClientRect().height);return t.style.height=r,t.style.maxHeight=s,t.style.transition=n,i}rollBetween(t,e,n,s,r){const i=n-r,o=s-r,a=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(s-n)<=1)return void(0===s?this.restShut():this.restOpen());t.style.transition="none",e.style.transition="none",t.style.height=`${Math.max(0,n)}px`,t.style.maxHeight=`${Math.max(0,n)}px`,e.style.transform=a(i),t.offsetHeight,t.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",e.style.transition="transform var(--pwa_slide, 2s) ease-in-out",t.style.height=`${Math.max(0,s)}px`,t.style.maxHeight=`${Math.max(0,s)}px`,e.style.transform=a(o),this.rollMotion=!0,this.clipHeight=`${Math.max(0,s)}px`,this.sheetShift=a(o)}firstUpdated(){this.shadowRoot.querySelector(".close").addEventListener("click",()=>{bn.dispatch(hn())}),this.shadowRoot.querySelector(".leave").addEventListener("click",async()=>{if(this.user)try{await x_()}catch{return}bn.dispatch(hn())});this.shadowRoot.querySelectorAll("a").forEach(t=>{t.addEventListener("click",()=>{bn.dispatch(hn())})}),this.watchColumn()}placeAnchor(){const t=getComputedStyle(this).position;if("fixed"===t||"absolute"===t)return void(this.style.top&&(this.style.top=""));const e=this.parentElement;if(!e)return;const n=this.previousElementSibling,s=n?n.getBoundingClientRect().bottom:e.getBoundingClientRect().top+(parseFloat(getComputedStyle(e).paddingTop)||0),r=parseFloat(this.style.top)||0,i=s-(this.getBoundingClientRect().top-r);Math.abs(i-r)<=.5||(this.style.top=Math.abs(i)<=.5?"":`${i}px`)}watchColumn(){if("undefined"==typeof ResizeObserver)return;this.columnObserver=new ResizeObserver(()=>{this.placeAnchor();const t=Math.round(this.getBoundingClientRect().width);t&&t!==this.columnWidth&&(this.columnWidth=t,this.onColumnResize())}),this.columnObserver.observe(this);const t=this.previousElementSibling;t&&this.columnObserver.observe(t),this.placeAnchor()}onColumnResize(){if(!this.rollMotion)return;const t=this.clip(),e=this.sheet();if(!t||!e)return;const n=Math.ceil(t.getBoundingClientRect().height),s=this.sheetPx(t,e);this.rollBetween(t,e,n,this.drawer?s:0,s)}static get styles(){return[cb,vn,In,lb,ub,hb,db,Sn,eD,K_,gb,i`
|
|
1139
1156
|
/* Required - this drawer's roll only. The clip hangs from the tag and grows down. */
|
|
1140
1157
|
.drawer-clip {
|
|
1141
1158
|
display: block;
|
|
@@ -1155,7 +1172,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1155
1172
|
align-self: start;
|
|
1156
1173
|
}
|
|
1157
1174
|
|
|
1158
|
-
.exit >
|
|
1175
|
+
.exit > h2 {
|
|
1159
1176
|
display: flex;
|
|
1160
1177
|
align-items: center;
|
|
1161
1178
|
justify-content: center;
|
|
@@ -1165,8 +1182,11 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1165
1182
|
|
|
1166
1183
|
.close:focus-visible,
|
|
1167
1184
|
.leave:focus-visible,
|
|
1168
|
-
.settings:focus-visible
|
|
1169
|
-
|
|
1185
|
+
.settings:focus-visible,
|
|
1186
|
+
a:focus-visible,
|
|
1187
|
+
::slotted(a:focus-visible),
|
|
1188
|
+
::slotted(button:focus-visible) {
|
|
1189
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
1170
1190
|
outline-offset: 2px;
|
|
1171
1191
|
}
|
|
1172
1192
|
|
|
@@ -1205,7 +1225,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1205
1225
|
color: var(--pwa_nav_highlight_color, #1c2430);
|
|
1206
1226
|
background: var(--pwa_nav_on_background, #f2f2f2);
|
|
1207
1227
|
}
|
|
1208
|
-
`]}render(){return U`
|
|
1228
|
+
`]}render(){return this.toggleAttribute("sliding",this.sliding),U`
|
|
1209
1229
|
|
|
1210
1230
|
<!-- Clip. The first render binds shut, with no transition. -->
|
|
1211
1231
|
<div
|
|
@@ -1219,20 +1239,20 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1219
1239
|
role="dialog"
|
|
1220
1240
|
aria-modal="true"
|
|
1221
1241
|
aria-labelledby="pwa-drawer-title"
|
|
1222
|
-
aria-hidden="${this.
|
|
1223
|
-
?inert="${!this.
|
|
1242
|
+
aria-hidden="${this.drawer?"false":"true"}"
|
|
1243
|
+
?inert="${!this.drawer}"
|
|
1224
1244
|
class="userDrawer"
|
|
1225
1245
|
style=${mt(this.sheetStyle())}>
|
|
1226
1246
|
|
|
1227
1247
|
<!-- Exit Button -->
|
|
1228
|
-
<
|
|
1248
|
+
<div class="exit" part="header">
|
|
1229
1249
|
<div></div>
|
|
1230
|
-
<
|
|
1250
|
+
<h2 id="pwa-drawer-title" part="title">
|
|
1231
1251
|
<span class="who">${!1===this.user?this.signup===this.subscribe?"Login":"Subscribe":rb(this.name,this.email)}</span>
|
|
1232
1252
|
${this.user?this.verified?Cb:U`<span class="unverified" part="unverified">Not verified</span>`:""}
|
|
1233
|
-
</
|
|
1253
|
+
</h2>
|
|
1234
1254
|
<button class="close" part="close" type="button" aria-label="Close">${Bb}</button>
|
|
1235
|
-
</
|
|
1255
|
+
</div>
|
|
1236
1256
|
|
|
1237
1257
|
<!-- Logged-out State -->
|
|
1238
1258
|
<div
|
|
@@ -1248,6 +1268,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1248
1268
|
?hide-google="${this.hideGoogle}"
|
|
1249
1269
|
exportparts="email: login-email, password: login-password, submit: login-submit, switch: login-switch, forgot: login-forgot, status: login-status, reveal: login-reveal, google: login-google"
|
|
1250
1270
|
?inert="${this.signup!==this.subscribe}"
|
|
1271
|
+
aria-hidden="${this.signup!==this.subscribe?"true":"false"}"
|
|
1251
1272
|
class=${ft({content:!0,opened:this.signup===this.subscribe,closed:this.signup!==this.subscribe})}>
|
|
1252
1273
|
</form-login>
|
|
1253
1274
|
|
|
@@ -1257,6 +1278,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1257
1278
|
?hide-google="${this.hideGoogle}"
|
|
1258
1279
|
exportparts="email: signup-email, password: signup-password, submit: signup-submit, switch: signup-switch, status: signup-status, reveal: signup-reveal, notice: signup-notice, google: signup-google"
|
|
1259
1280
|
?inert="${this.signup===this.subscribe}"
|
|
1281
|
+
aria-hidden="${this.signup===this.subscribe?"true":"false"}"
|
|
1260
1282
|
class=${ft({content:!0,opened:!this.signup===this.subscribe,closed:!this.signup!==this.subscribe})}>
|
|
1261
1283
|
</form-signup>
|
|
1262
1284
|
|
|
@@ -1339,6 +1361,13 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1339
1361
|
|
|
1340
1362
|
}
|
|
1341
1363
|
|
|
1364
|
+
nav > ul > li > button:focus-visible {
|
|
1365
|
+
|
|
1366
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
1367
|
+
outline-offset: 2px;
|
|
1368
|
+
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1342
1371
|
/* Required - fit 320px */
|
|
1343
1372
|
@media (max-width: 320px) {
|
|
1344
1373
|
|
|
@@ -1452,7 +1481,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1452
1481
|
|
|
1453
1482
|
<label
|
|
1454
1483
|
style="
|
|
1455
|
-
border: 1px dashed var(--
|
|
1484
|
+
border: 1px dashed var(--pwa_input_border_color, #8d8870);
|
|
1456
1485
|
border-radius: 12px;
|
|
1457
1486
|
overflow: hidden;
|
|
1458
1487
|
margin: 0;
|
|
@@ -1494,6 +1523,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1494
1523
|
part = "name"
|
|
1495
1524
|
type = "text"
|
|
1496
1525
|
autocomplete = "name"
|
|
1526
|
+
aria-invalid = "${"error"===this.tone?"true":"false"}"
|
|
1497
1527
|
aria-describedby = "pwa-name-status"
|
|
1498
1528
|
@input = "${this.handleInput}"
|
|
1499
1529
|
.value = "${this.draft}" />
|
|
@@ -1522,22 +1552,21 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1522
1552
|
aria-busy="${this.busy?"true":"false"}"
|
|
1523
1553
|
@submit="${this.saveEmail}">
|
|
1524
1554
|
|
|
1525
|
-
<label for="pwa-current-email-password">Current password
|
|
1555
|
+
<label for="pwa-current-email-password">Current password</label>
|
|
1526
1556
|
|
|
1527
|
-
|
|
1557
|
+
<span class="pair">
|
|
1528
1558
|
|
|
1529
1559
|
<input
|
|
1530
1560
|
id = "pwa-current-email-password"
|
|
1531
1561
|
name = "current_password"
|
|
1532
1562
|
type = "${this.showPassword?"text":"password"}"
|
|
1533
1563
|
autocomplete = "current-password"
|
|
1564
|
+
aria-invalid = "${"error"===this.tone?"true":"false"}"
|
|
1534
1565
|
aria-describedby = "pwa-email-status"/>
|
|
1535
1566
|
|
|
1536
1567
|
${nD(this.showPassword,()=>{this.showPassword=!this.showPassword})}
|
|
1537
1568
|
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
</label>
|
|
1569
|
+
</span>
|
|
1541
1570
|
|
|
1542
1571
|
<label for="pwa-email" >E-mail
|
|
1543
1572
|
|
|
@@ -1551,6 +1580,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1551
1580
|
autocapitalize= "off"
|
|
1552
1581
|
spellcheck = "false"
|
|
1553
1582
|
class = "email"
|
|
1583
|
+
aria-invalid = "${"error"===this.tone?"true":"false"}"
|
|
1554
1584
|
aria-describedby = "pwa-email-status"
|
|
1555
1585
|
@input = "${this.handleEmail}"
|
|
1556
1586
|
.value = "${this.mail}"/>
|
|
@@ -1586,30 +1616,29 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1586
1616
|
|
|
1587
1617
|
<div>
|
|
1588
1618
|
|
|
1589
|
-
<label for="pwa-current-password">Current Password
|
|
1619
|
+
<label for="pwa-current-password">Current Password</label>
|
|
1590
1620
|
|
|
1591
|
-
|
|
1621
|
+
<span class="pair">
|
|
1592
1622
|
|
|
1593
1623
|
<input
|
|
1594
1624
|
id = "pwa-current-password"
|
|
1595
1625
|
name = "current_password"
|
|
1596
1626
|
type = "${this.showCurrent?"text":"password"}"
|
|
1597
1627
|
autocomplete = "current-password"
|
|
1628
|
+
aria-invalid = "${"error"===this.tone?"true":"false"}"
|
|
1598
1629
|
aria-describedby = "pwa-password-status">
|
|
1599
1630
|
|
|
1600
1631
|
${nD(this.showCurrent,()=>{this.showCurrent=!this.showCurrent})}
|
|
1601
1632
|
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
</label>
|
|
1633
|
+
</span>
|
|
1605
1634
|
|
|
1606
1635
|
</div>
|
|
1607
1636
|
|
|
1608
1637
|
<div>
|
|
1609
1638
|
|
|
1610
|
-
<label for="pwa-new-password">New Password
|
|
1639
|
+
<label for="pwa-new-password">New Password</label>
|
|
1611
1640
|
|
|
1612
|
-
|
|
1641
|
+
<span class="pair">
|
|
1613
1642
|
|
|
1614
1643
|
<input
|
|
1615
1644
|
id = "pwa-new-password"
|
|
@@ -1621,23 +1650,22 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1621
1650
|
maxlength = "${UE}"
|
|
1622
1651
|
.value = "${this.password}"
|
|
1623
1652
|
@input = "${this.handleInputChange}"
|
|
1653
|
+
aria-invalid = "${"error"===this.tone?"true":"false"}"
|
|
1624
1654
|
aria-describedby = "pwa-new-password-hint pwa-password-status">
|
|
1625
1655
|
|
|
1626
1656
|
${nD(this.showNext,()=>{this.showNext=!this.showNext})}
|
|
1627
1657
|
|
|
1628
1658
|
</span>
|
|
1629
1659
|
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
</label>
|
|
1660
|
+
<p id="pwa-new-password-hint" class="hint" part="hint">${VE}</p>
|
|
1633
1661
|
|
|
1634
1662
|
</div>
|
|
1635
1663
|
|
|
1636
1664
|
<div>
|
|
1637
1665
|
|
|
1638
|
-
<label for="pwa-verify-password">Verify Password
|
|
1666
|
+
<label for="pwa-verify-password">Verify Password</label>
|
|
1639
1667
|
|
|
1640
|
-
|
|
1668
|
+
<span class="pair">
|
|
1641
1669
|
|
|
1642
1670
|
<input
|
|
1643
1671
|
id = "pwa-verify-password"
|
|
@@ -1647,13 +1675,12 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1647
1675
|
autocomplete = "new-password"
|
|
1648
1676
|
minlength = "${8}"
|
|
1649
1677
|
maxlength = "${UE}"
|
|
1678
|
+
aria-invalid = "${"error"===this.tone?"true":"false"}"
|
|
1650
1679
|
aria-describedby = "pwa-password-status">
|
|
1651
1680
|
|
|
1652
1681
|
${nD(this.showVerify,()=>{this.showVerify=!this.showVerify})}
|
|
1653
1682
|
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
</label>
|
|
1683
|
+
</span>
|
|
1657
1684
|
|
|
1658
1685
|
</div>
|
|
1659
1686
|
|
|
@@ -1693,22 +1720,21 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1693
1720
|
|
|
1694
1721
|
<p class="lead">Permanently delete the user account and data related to: ${this.email}</p>
|
|
1695
1722
|
|
|
1696
|
-
<label for="pwa-delete-password">Current password
|
|
1723
|
+
<label for="pwa-delete-password">Current password</label>
|
|
1697
1724
|
|
|
1698
|
-
|
|
1725
|
+
<span class="pair">
|
|
1699
1726
|
|
|
1700
1727
|
<input
|
|
1701
1728
|
id="pwa-delete-password"
|
|
1702
1729
|
name="current_password"
|
|
1703
1730
|
type="${this.showPassword?"text":"password"}"
|
|
1704
1731
|
autocomplete="current-password"
|
|
1732
|
+
aria-invalid="${"error"===this.tone?"true":"false"}"
|
|
1705
1733
|
aria-describedby="pwa-delete-status"/>
|
|
1706
1734
|
|
|
1707
1735
|
${nD(this.showPassword,()=>{this.showPassword=!this.showPassword})}
|
|
1708
1736
|
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
</label>
|
|
1737
|
+
</span>
|
|
1712
1738
|
|
|
1713
1739
|
${tD("pwa-delete-status",this.status,this.tone)}
|
|
1714
1740
|
|
|
@@ -1720,7 +1746,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1720
1746
|
?disabled="${!1===this.login||this.busy}"
|
|
1721
1747
|
@click="${this.alertDelete}">${this.busy?"Deleting…":"Delete"}</button>
|
|
1722
1748
|
|
|
1723
|
-
`}show(t){this.tone="error",this.status=KE(t),gE(PE,t)}}Mb([ut(),Gb("design:type",Boolean)],Hb.prototype,"login",void 0),Mb([ut(),Gb("design:type",String)],Hb.prototype,"email",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"busy",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"status",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"tone",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"showPassword",void 0),customElements.define("delete-user",Hb);var Ub=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Vb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jb=class extends(wt(bn)(it)){constructor(){super(),this.empty="",this.profileTopic="",this.name="",this.email="",this.login=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.booted=!1,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onSubmit=t=>{t.preventDefault()},this.
|
|
1749
|
+
`}show(t){this.tone="error",this.status=KE(t),gE(PE,t)}}Mb([ut(),Gb("design:type",Boolean)],Hb.prototype,"login",void 0),Mb([ut(),Gb("design:type",String)],Hb.prototype,"email",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"busy",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"status",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"tone",void 0),Mb([ut(),Gb("design:type",Object)],Hb.prototype,"showPassword",void 0),customElements.define("delete-user",Hb);var Ub=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Vb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jb=class extends(wt(bn)(it)){constructor(){super(),this.empty="",this.profileTopic="",this.name="",this.email="",this.login=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.leaving="",this.leaveClipHeight="0px",this.leaveSheetShift="translate3d(0, 0, 0)",this.leaveMotion=!1,this.booted=!1,this.heldHeight=null,this.leaveFrom=0,this.columnWidth=0,this.columnObserver=null,this.onSubmit=t=>{t.preventDefault()},this.onFrontEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&this.rest()},this.onBackEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&(this.leaving="",this.leaveMotion=!1)}}connectedCallback(){nb(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Account settings"),super.connectedCallback(),this.addEventListener("submit",this.onSubmit)}disconnectedCallback(){this.removeEventListener("submit",this.onSubmit),this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}onTabKey(t){if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const e=["profile","verification","password","delete"],n=e.indexOf(this.profileTopic),s=e[(n+("ArrowRight"===t.key?1:-1)+e.length)%e.length];bn.dispatch(on(s)),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`button[value="${s}"]`)?.focus()})}stateChanged(t){this.profileTopic=t.frontend.settings,this.login=Boolean(t.frontend?.login),this.name=t.backend.name,this.email=t.backend.email}static get styles(){return[bb,Sn,eD,i`
|
|
1724
1750
|
|
|
1725
1751
|
:host {
|
|
1726
1752
|
display: block;
|
|
@@ -1737,13 +1763,25 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1737
1763
|
:host { --pwa_slide: 0s; }
|
|
1738
1764
|
}
|
|
1739
1765
|
|
|
1740
|
-
/* Required - this settings roll only.
|
|
1766
|
+
/* Required - this settings roll only. The two clips share one cell so the
|
|
1767
|
+
stage is as tall as the lower edge, and the incoming clip paints in front. */
|
|
1768
|
+
.settings-stage {
|
|
1769
|
+
display: grid;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1741
1772
|
.settings-clip {
|
|
1773
|
+
grid-area: 1 / 1;
|
|
1774
|
+
align-self: start;
|
|
1775
|
+
justify-self: stretch;
|
|
1742
1776
|
display: block;
|
|
1743
1777
|
overflow: hidden;
|
|
1744
1778
|
min-height: 0;
|
|
1779
|
+
width: 100%;
|
|
1745
1780
|
}
|
|
1746
1781
|
|
|
1782
|
+
.settings-clip.is-front { z-index: 2; }
|
|
1783
|
+
.settings-clip.is-back { z-index: 1; }
|
|
1784
|
+
|
|
1747
1785
|
.settings-sheet {
|
|
1748
1786
|
display: block;
|
|
1749
1787
|
height: auto;
|
|
@@ -1752,6 +1790,11 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1752
1790
|
background-color: var(--pwa_background, var(--pwa_settings_background_color, #fff));
|
|
1753
1791
|
}
|
|
1754
1792
|
|
|
1793
|
+
/* Required - an inactive tab stays fully behind the fold. */
|
|
1794
|
+
.settings-sheet > section[hidden] {
|
|
1795
|
+
display: none !important;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1755
1798
|
form {
|
|
1756
1799
|
box-sizing: border-box;
|
|
1757
1800
|
display: grid;
|
|
@@ -1776,7 +1819,32 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1776
1819
|
}
|
|
1777
1820
|
}
|
|
1778
1821
|
|
|
1779
|
-
`]}openTab(t){bn.dispatch(on(t))}willUpdate(t){if(!this.booted||!this.login||t.has("login"))return;if(!t.has("profileTopic"))return;const e=
|
|
1822
|
+
`]}openTab(t){bn.dispatch(on(t))}tabOn(t){return(this.profileTopic||"profile")===t}willUpdate(t){if(!this.booted||!this.login||t.has("login"))return;if(!t.has("profileTopic"))return;if(this.reduced())return;const e=String(t.get("profileTopic")||"");if(!e||e===this.profileTopic)return;const n=this.clipFor(e);this.leaveFrom=n?Math.ceil(n.getBoundingClientRect().height):0,this.leaving=e,this.leaveMotion=!1,this.leaveClipHeight=`${this.leaveFrom}px`,this.leaveSheetShift="translate3d(0, 0, 0)",this.rollMotion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)",this.heldHeight=0}updated(t){const e=!this.booted;if(this.booted=!0,e&&this.watchColumn(),e||!t.has("profileTopic")||!this.login||t.has("login"))return;const n=this.frontClip(),s=this.sheetOf(n);if(n&&s&&null!=this.heldHeight){const t=this.heldHeight;this.heldHeight=null;const e=this.sheetPx(n,s);Math.abs(e-t)>1?this.rollLayer("front",n,s,t,e,e):this.rest()}const r=this.backClip(),i=this.sheetOf(r);if(r&&i&&this.leaving){const t=this.sheetPx(r,i),e=this.leaveFrom||t;this.rollLayer("back",r,i,e,0,t)}}watchColumn(){"undefined"!=typeof ResizeObserver&&(this.columnObserver=new ResizeObserver(()=>{const t=Math.round(this.getBoundingClientRect().width);if(t&&t!==this.columnWidth){if(this.columnWidth=t,this.rollMotion){const t=this.frontClip(),e=this.sheetOf(t);if(t&&e){const n=Math.ceil(t.getBoundingClientRect().height),s=this.sheetPx(t,e);this.rollLayer("front",t,e,n,s,s)}}if(this.leaveMotion){const t=this.backClip(),e=this.sheetOf(t);if(t&&e){const n=Math.ceil(t.getBoundingClientRect().height),s=this.sheetPx(t,e);this.rollLayer("back",t,e,n,0,s)}}}}),this.columnObserver.observe(this))}clipFor(t){return this.shadowRoot?.querySelector(`.settings-clip[data-panel="${t}"]`)??null}frontClip(){return this.clipFor(this.profileTopic||"profile")}backClip(){return this.leaving?this.clipFor(this.leaving):null}sheetOf(t){return t?.querySelector(".settings-sheet")??null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}sheetPx(t,e){const n=t.style.transition,s=t.style.maxHeight,r=t.style.height;t.style.transition="none",t.style.maxHeight="none",t.style.height="auto";const i=Math.ceil(e.offsetHeight);return t.style.height=r,t.style.maxHeight=s,t.style.transition=n,i}rest(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}layerStyle(t,e){return{height:e,maxHeight:"auto"===e?"none":e,transition:t&&!this.reduced()?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}shiftStyle(t,e){return{transform:e,transition:t&&!this.reduced()?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}clipStyle(){return this.layerStyle(this.rollMotion,this.clipHeight)}sheetStyle(){return this.shiftStyle(this.rollMotion,this.sheetShift)}leaveClipStyle(){return this.layerStyle(this.leaveMotion,this.leaveClipHeight)}leaveSheetStyle(){return this.shiftStyle(this.leaveMotion,this.leaveSheetShift)}rollLayer(t,e,n,s,r,i){const o=s-i,a=r-i,B=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(r-s)<=1)return void("front"===t?this.rest():this.leaving="");e.style.transition="none",n.style.transition="none",e.style.height=`${Math.max(0,s)}px`,e.style.maxHeight=`${Math.max(0,s)}px`,n.style.transform=B(o),e.offsetHeight,e.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",n.style.transition="transform var(--pwa_slide, 2s) ease-in-out",e.style.height=`${Math.max(0,r)}px`,e.style.maxHeight=`${Math.max(0,r)}px`,n.style.transform=B(a),"front"===t?(this.rollMotion=!0,this.clipHeight=`${Math.max(0,r)}px`,this.sheetShift=B(a)):(this.leaveMotion=!0,this.leaveClipHeight=`${Math.max(0,r)}px`,this.leaveSheetShift=B(a))}layerOf(t){return t===this.leaving?"back":this.tabOn(t)?"front":"idle"}panel(t,e){const n=this.layerOf(t),s="front"===n,r="idle"===n,i=`pwa-panel-${t}`,o=`pwa-tab-${t}`,a="profile"===t?U`
|
|
1823
|
+
<h2>${e}</h2>
|
|
1824
|
+
<contact-photo emptyArtwork="${this.empty}" exportparts="progress, file, preview"></contact-photo>
|
|
1825
|
+
`:"verification"===t?U`
|
|
1826
|
+
<h2>Contact Information</h2>
|
|
1827
|
+
<email-verify exportparts="notice, status: verify-status, submit: verify-submit, verified, unverified"></email-verify>
|
|
1828
|
+
<input-name exportparts="name, submit: name-submit"></input-name>
|
|
1829
|
+
<contact-email exportparts="email, submit: email-submit"></contact-email>
|
|
1830
|
+
`:"password"===t?U`
|
|
1831
|
+
<h2>Password</h2>
|
|
1832
|
+
<input-password exportparts="password, verify, submit: password-submit"></input-password>
|
|
1833
|
+
`:U`
|
|
1834
|
+
<h2>Delete Account</h2>
|
|
1835
|
+
<delete-user exportparts="submit: delete"></delete-user>
|
|
1836
|
+
`;return U`
|
|
1837
|
+
<section
|
|
1838
|
+
id="${i}"
|
|
1839
|
+
part="panel"
|
|
1840
|
+
role="tabpanel"
|
|
1841
|
+
aria-labelledby="${o}"
|
|
1842
|
+
aria-hidden="${s?"false":"true"}"
|
|
1843
|
+
?inert="${!s}"
|
|
1844
|
+
?hidden="${r}">
|
|
1845
|
+
${a}
|
|
1846
|
+
</section>
|
|
1847
|
+
`}render(){if(!this.login)return U`
|
|
1780
1848
|
<p class="signed-out" part="signed-out" role="status">Sign in to change the photo, name, email, or password.</p>
|
|
1781
1849
|
`;const t=rb(this.name,this.email);return U`
|
|
1782
1850
|
|
|
@@ -1789,10 +1857,13 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1789
1857
|
<button
|
|
1790
1858
|
type="button"
|
|
1791
1859
|
role="tab"
|
|
1860
|
+
id="pwa-tab-profile"
|
|
1792
1861
|
part="tab"
|
|
1793
1862
|
value="profile"
|
|
1794
|
-
aria-selected="${"profile"
|
|
1795
|
-
|
|
1863
|
+
aria-selected="${this.tabOn("profile")}"
|
|
1864
|
+
aria-controls="pwa-panel-profile"
|
|
1865
|
+
tabindex="${this.tabOn("profile")?"0":"-1"}"
|
|
1866
|
+
?on="${this.tabOn("profile")}"
|
|
1796
1867
|
@click="${()=>this.openTab("profile")}">Icon
|
|
1797
1868
|
</button>
|
|
1798
1869
|
</li>
|
|
@@ -1801,10 +1872,13 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1801
1872
|
<button
|
|
1802
1873
|
type="button"
|
|
1803
1874
|
role="tab"
|
|
1875
|
+
id="pwa-tab-verification"
|
|
1804
1876
|
part="tab"
|
|
1805
1877
|
value="verification"
|
|
1806
|
-
aria-selected="${"verification"
|
|
1807
|
-
|
|
1878
|
+
aria-selected="${this.tabOn("verification")}"
|
|
1879
|
+
aria-controls="pwa-panel-verification"
|
|
1880
|
+
tabindex="${this.tabOn("verification")?"0":"-1"}"
|
|
1881
|
+
?on="${this.tabOn("verification")}"
|
|
1808
1882
|
@click="${()=>this.openTab("verification")}">Profile
|
|
1809
1883
|
</button>
|
|
1810
1884
|
</li>
|
|
@@ -1813,10 +1887,13 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1813
1887
|
<button
|
|
1814
1888
|
type="button"
|
|
1815
1889
|
role="tab"
|
|
1890
|
+
id="pwa-tab-password"
|
|
1816
1891
|
part="tab"
|
|
1817
1892
|
value="password"
|
|
1818
|
-
aria-selected="${"password"
|
|
1819
|
-
|
|
1893
|
+
aria-selected="${this.tabOn("password")}"
|
|
1894
|
+
aria-controls="pwa-panel-password"
|
|
1895
|
+
tabindex="${this.tabOn("password")?"0":"-1"}"
|
|
1896
|
+
?on="${this.tabOn("password")}"
|
|
1820
1897
|
@click="${()=>this.openTab("password")}">Password
|
|
1821
1898
|
</button>
|
|
1822
1899
|
</li>
|
|
@@ -1825,10 +1902,13 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1825
1902
|
<button
|
|
1826
1903
|
type="button"
|
|
1827
1904
|
role="tab"
|
|
1905
|
+
id="pwa-tab-delete"
|
|
1828
1906
|
part="tab"
|
|
1829
1907
|
value="delete"
|
|
1830
|
-
aria-selected="${"delete"
|
|
1831
|
-
|
|
1908
|
+
aria-selected="${this.tabOn("delete")}"
|
|
1909
|
+
aria-controls="pwa-panel-delete"
|
|
1910
|
+
tabindex="${this.tabOn("delete")?"0":"-1"}"
|
|
1911
|
+
?on="${this.tabOn("delete")}"
|
|
1832
1912
|
@click="${()=>this.openTab("delete")}">Delete
|
|
1833
1913
|
</button>
|
|
1834
1914
|
</li>
|
|
@@ -1838,87 +1918,21 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1838
1918
|
</nav>
|
|
1839
1919
|
|
|
1840
1920
|
|
|
1841
|
-
<div
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
?inert="${"profile"!==this.profileTopic}"
|
|
1854
|
-
?hidden="${"profile"!==this.profileTopic}">
|
|
1855
|
-
|
|
1856
|
-
<!-- Display Username -->
|
|
1857
|
-
<h2>${t}</h2>
|
|
1858
|
-
|
|
1859
|
-
<!-- Custom Image Element - Display / Upload -->
|
|
1860
|
-
<contact-photo emptyArtwork="${this.empty}" exportparts="progress, file, preview"></contact-photo>
|
|
1861
|
-
|
|
1862
|
-
</section>
|
|
1863
|
-
|
|
1864
|
-
<!-- Page 2: Verification -->
|
|
1865
|
-
<section
|
|
1866
|
-
part="panel"
|
|
1867
|
-
role="tabpanel"
|
|
1868
|
-
aria-hidden="${"verification"===this.profileTopic?"false":"true"}"
|
|
1869
|
-
?inert="${"verification"!==this.profileTopic}"
|
|
1870
|
-
?hidden="${"verification"!==this.profileTopic}">
|
|
1871
|
-
|
|
1872
|
-
<!-- Page Title -->
|
|
1873
|
-
<h2>Contact Information</h2>
|
|
1874
|
-
|
|
1875
|
-
<!-- Required - unverified notice. Sign-in stays open. -->
|
|
1876
|
-
<email-verify exportparts="notice, status: verify-status, submit: verify-submit, verified, unverified"></email-verify>
|
|
1877
|
-
|
|
1878
|
-
<!-- Custom - Username -->
|
|
1879
|
-
<input-name exportparts="name, submit: name-submit"></input-name>
|
|
1880
|
-
|
|
1881
|
-
<!-- Custom - Email -->
|
|
1882
|
-
<contact-email exportparts="email, submit: email-submit"></contact-email>
|
|
1883
|
-
|
|
1884
|
-
</section>
|
|
1885
|
-
|
|
1886
|
-
<!-- Page 3: Password -->
|
|
1887
|
-
<section
|
|
1888
|
-
part="panel"
|
|
1889
|
-
role="tabpanel"
|
|
1890
|
-
aria-hidden="${"password"===this.profileTopic?"false":"true"}"
|
|
1891
|
-
?inert="${"password"!==this.profileTopic}"
|
|
1892
|
-
?hidden="${"password"!==this.profileTopic}">
|
|
1893
|
-
|
|
1894
|
-
<!-- Page Title -->
|
|
1895
|
-
<h2>Password</h2>
|
|
1896
|
-
|
|
1897
|
-
<!-- Custom - Password -->
|
|
1898
|
-
<input-password exportparts="password, verify, submit: password-submit"></input-password>
|
|
1899
|
-
|
|
1900
|
-
</section>
|
|
1901
|
-
|
|
1902
|
-
<!-- Page 4: Delete -->
|
|
1903
|
-
<section
|
|
1904
|
-
part="panel"
|
|
1905
|
-
role="tabpanel"
|
|
1906
|
-
aria-hidden="${"delete"===this.profileTopic?"false":"true"}"
|
|
1907
|
-
?inert="${"delete"!==this.profileTopic}"
|
|
1908
|
-
?hidden="${"delete"!==this.profileTopic}">
|
|
1909
|
-
|
|
1910
|
-
<!-- Page Title -->
|
|
1911
|
-
<h2>Delete Account</h2>
|
|
1912
|
-
|
|
1913
|
-
<!-- Custom - Delete -->
|
|
1914
|
-
<delete-user exportparts="submit: delete"></delete-user>
|
|
1915
|
-
|
|
1916
|
-
</section>
|
|
1917
|
-
|
|
1918
|
-
</div>
|
|
1921
|
+
<div class="settings-stage">
|
|
1922
|
+
${["profile","verification","password","delete"].map(e=>{const n=this.layerOf(e);return U`
|
|
1923
|
+
<div
|
|
1924
|
+
class="settings-clip ${"front"===n?"is-front":"back"===n?"is-back":""}"
|
|
1925
|
+
data-panel="${e}"
|
|
1926
|
+
style=${mt("back"===n?this.leaveClipStyle():"front"===n?this.clipStyle():{height:"0px",maxHeight:"0px",transition:"none"})}
|
|
1927
|
+
@transitionend=${"back"===n?this.onBackEnd:this.onFrontEnd}>
|
|
1928
|
+
<div class="settings-sheet" style=${mt("back"===n?this.leaveSheetStyle():"front"===n?this.sheetStyle():{transform:"translate3d(0, -100%, 0)",transition:"none"})}>
|
|
1929
|
+
${this.panel(e,t)}
|
|
1930
|
+
</div>
|
|
1931
|
+
</div>
|
|
1932
|
+
`})}
|
|
1919
1933
|
</div>
|
|
1920
1934
|
|
|
1921
|
-
`}};Ub([lt({type:String,reflect:!0}),Vb("design:type",Object)],jb.prototype,"empty",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"profileTopic",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"name",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"email",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"login",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"clipHeight",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"sheetShift",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"rollMotion",void 0),jb=Ub([at("user-settings"),Vb("design:paramtypes",[])],jb);const $b=i`
|
|
1935
|
+
`}};Ub([lt({type:String,reflect:!0}),Vb("design:type",Object)],jb.prototype,"empty",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"profileTopic",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"name",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"email",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"login",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"clipHeight",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"sheetShift",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"rollMotion",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"leaving",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"leaveClipHeight",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"leaveSheetShift",void 0),Ub([ut(),Vb("design:type",Object)],jb.prototype,"leaveMotion",void 0),jb=Ub([at("user-settings"),Vb("design:paramtypes",[])],jb);const $b=i`
|
|
1922
1936
|
|
|
1923
1937
|
:host {
|
|
1924
1938
|
display: block;
|
|
@@ -1948,7 +1962,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1948
1962
|
|
|
1949
1963
|
.icon:focus-visible,
|
|
1950
1964
|
.login:focus-visible {
|
|
1951
|
-
outline: 2px solid var(--
|
|
1965
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
1952
1966
|
outline-offset: 2px;
|
|
1953
1967
|
}
|
|
1954
1968
|
|
|
@@ -1990,20 +2004,23 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1990
2004
|
letter-spacing: 0.04em;
|
|
1991
2005
|
}
|
|
1992
2006
|
|
|
1993
|
-
`;var Jb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zb=class extends(wt(bn)(it)){constructor(){super(),this.subscribe=!1,this.empty="",this._user=!1,this._photoURL="",this._name="",this._email=""}connectedCallback(){nb(this),super.connectedCallback()}firstUpdated(){this.shadowRoot.querySelector(".toggles").addEventListener("click",()=>{bn.dispatch(ln())})}stateChanged(t){this._user=t.frontend.login,this._photoURL=t.backend.photoURL,this._name=t.backend.name,this._email=t.backend.email}static get styles(){return[$b,i`:host { border-radius: 10px; }`]}render(){return U`
|
|
2007
|
+
`;var Jb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zb=class extends(wt(bn)(it)){constructor(){super(),this.subscribe=!1,this.empty="",this._user=!1,this._open=!1,this._photoURL="",this._name="",this._email=""}connectedCallback(){nb(this),super.connectedCallback()}firstUpdated(){this.shadowRoot.querySelector(".toggles").addEventListener("click",()=>{bn.dispatch(ln())})}stateChanged(t){this._user=t.frontend.login,this._open=t.frontend.drawer,this._photoURL=t.backend.photoURL,this._name=t.backend.name,this._email=t.backend.email}updated(){const t=this.shadowRoot?.querySelector("button"),e=document.querySelector("user-drawer");if(!(t&&e instanceof HTMLElement&&e.id))return;t.setAttribute("aria-controls",e.id);"ariaControlsElements"in t&&(t.ariaControlsElements=[e])}static get styles(){return[$b,i`:host { border-radius: 10px; }`]}render(){return U`
|
|
1994
2008
|
|
|
1995
2009
|
<!-- two classes: icon / login -->
|
|
1996
2010
|
<button
|
|
1997
2011
|
type="button"
|
|
1998
2012
|
part="button"
|
|
1999
2013
|
class="${this._user?"icon":"login"} toggles"
|
|
2014
|
+
aria-haspopup="dialog"
|
|
2015
|
+
aria-expanded="${this._open?"true":"false"}"
|
|
2016
|
+
aria-controls="pwa-user-drawer"
|
|
2000
2017
|
aria-label="${this._user?"Account":this.subscribe?"Subscribe":"Login"}">
|
|
2001
2018
|
|
|
2002
2019
|
${this._user?this.face():this.subscribe?"Subscribe":"Login"}
|
|
2003
2020
|
|
|
2004
2021
|
</button>
|
|
2005
2022
|
|
|
2006
|
-
`}face(){if(this._photoURL)return U`<img class="userImage" part="photo" alt="" src="${this._photoURL}">`;const t=sb(this._name,this._email);return t?U`<span class="initials" part="initials" aria-hidden="true">${t}</span>`:this.empty?U`<img class="userImage" part="photo" alt="" src="${this.empty}">`:U`<span class="initials" part="initials" aria-hidden="true">?</span>`}};Jb([lt({type:Boolean,reflect:!0}),qb("design:type",Object)],zb.prototype,"subscribe",void 0),Jb([lt({type:String,reflect:!0}),qb("design:type",Object)],zb.prototype,"empty",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_user",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_photoURL",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_name",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_email",void 0),zb=Jb([at("user-icon"),qb("design:paramtypes",[])],zb);var Kb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Wb extends it{constructor(){super(),this.active=!1}shouldUpdate(){return this.active}}function Yb(){bn.dispatch(un())}function Xb(){bn.dispatch(hn())}function Zb(){bn.dispatch(ln())}Kb([lt({type:Boolean}),Qb("design:type",Boolean)],Wb.prototype,"active",void 0);var tv=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ev=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let nv=class extends Wb{constructor(){super(),this.userEmail="",this.status="",this.tone="",this.invalid=!1,this.busy=!1,this.cooldown=0,this.touched=!1,this.timer=0,this.stopDraft=null,this.resetPassword=async t=>{if(t.preventDefault(),this.busy||this.cooldown>0)return;const e=this.renderRoot.querySelector(".email");this.userEmail=(e?e.value:this.userEmail).trim(),e&&e.value!==this.userEmail&&(e.value=this.userEmail);const n=(s=this.userEmail).length<4?{code:"pwa/missing-email",message:"Enter an email address."}:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)?null:{code:"pwa/invalid-email",message:"Enter a valid email address."};var s;if(n)this.showError(n,"email");else{this.busy=!0,this.tone="",this.status="";try{await Po(sE,this.userEmail),this.showSent()}catch(t){!function(t){return"auth/user-not-found"===mE(t).code}(t)?this.showFirebase(t):this.showSent()}finally{this.busy=!1}}},this.backToSignIn=()=>{const t=document.querySelector("user-drawer");if(t){const e=t.hasAttribute("subscribe");return Boolean(bn.getState().frontend?.registerOne)!==e&&bn.dispatch(rn("drawer")),void Yb()}const e=document.querySelector("user-login");if(!e)return;const n=e.hasAttribute("subscribe");Boolean(bn.getState().frontend?.registerTwo)!==n&&bn.dispatch(rn("page")),e.scrollIntoView({block:"nearest"})}}static{this.styles=[WE,YE,QE,XE,i`
|
|
2023
|
+
`}face(){if(this._photoURL)return U`<img class="userImage" part="photo" alt="" src="${this._photoURL}">`;const t=sb(this._name,this._email);return t?U`<span class="initials" part="initials" aria-hidden="true">${t}</span>`:this.empty?U`<img class="userImage" part="photo" alt="" src="${this.empty}">`:U`<span class="initials" part="initials" aria-hidden="true">?</span>`}};Jb([lt({type:Boolean,reflect:!0}),qb("design:type",Object)],zb.prototype,"subscribe",void 0),Jb([lt({type:String,reflect:!0}),qb("design:type",Object)],zb.prototype,"empty",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_user",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_open",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_photoURL",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_name",void 0),Jb([ut(),qb("design:type",Object)],zb.prototype,"_email",void 0),zb=Jb([at("user-icon"),qb("design:paramtypes",[])],zb);var Kb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Wb extends it{constructor(){super(),this.active=!1}shouldUpdate(){return this.active}}function Yb(){bn.dispatch(un())}function Xb(){bn.dispatch(hn())}function Zb(){bn.dispatch(ln())}Kb([lt({type:Boolean}),Qb("design:type",Boolean)],Wb.prototype,"active",void 0);var tv=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ev=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let nv=class extends Wb{constructor(){super(),this.userEmail="",this.status="",this.tone="",this.invalid=!1,this.busy=!1,this.cooldown=0,this.touched=!1,this.timer=0,this.stopDraft=null,this.resetPassword=async t=>{if(t.preventDefault(),this.busy||this.cooldown>0)return;const e=this.renderRoot.querySelector(".email");this.userEmail=(e?e.value:this.userEmail).trim(),e&&e.value!==this.userEmail&&(e.value=this.userEmail);const n=(s=this.userEmail).length<4?{code:"pwa/missing-email",message:"Enter an email address."}:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)?null:{code:"pwa/invalid-email",message:"Enter a valid email address."};var s;if(n)this.showError(n,"email");else{this.busy=!0,this.tone="",this.status="";try{await Po(sE,this.userEmail),this.showSent()}catch(t){!function(t){return"auth/user-not-found"===mE(t).code}(t)?this.showFirebase(t):this.showSent()}finally{this.busy=!1}}},this.backToSignIn=()=>{const t=document.querySelector("user-drawer");if(t){const e=t.hasAttribute("subscribe");return Boolean(bn.getState().frontend?.registerOne)!==e&&bn.dispatch(rn("drawer")),void Yb()}const e=document.querySelector("user-login");if(!e)return;const n=e.hasAttribute("subscribe");Boolean(bn.getState().frontend?.registerTwo)!==n&&bn.dispatch(rn("page")),e.scrollIntoView({block:"nearest"})}}static{this.styles=[WE,YE,QE,XE,i`
|
|
2007
2024
|
:host {
|
|
2008
2025
|
display: block;
|
|
2009
2026
|
background-color: var(--pwa_background, #fff);
|
|
@@ -2034,7 +2051,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
2034
2051
|
.status:focus { outline: 0; }
|
|
2035
2052
|
|
|
2036
2053
|
.status:focus-visible {
|
|
2037
|
-
outline: 2px solid var(--
|
|
2054
|
+
outline: 2px solid var(--pwa_focus, #1c2430);
|
|
2038
2055
|
outline-offset: 2px;
|
|
2039
2056
|
}
|
|
2040
2057
|
|
|
@@ -2046,7 +2063,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
2046
2063
|
button.new {
|
|
2047
2064
|
display: block;
|
|
2048
2065
|
}
|
|
2049
|
-
`]}connectedCallback(){var t;super.connectedCallback(),this.stopDraft=(t=()=>{this.prefill()},oD.add(t),()=>{oD.delete(t)}),this.prefill()}disconnectedCallback(){window.clearInterval(this.timer),this.timer=0,this.stopDraft?.(),this.stopDraft=null,super.disconnectedCallback()}updated(){this.paintEmail()}prefill(){if(this.touched)return;const t=BD();t&&t!==this.userEmail&&(this.userEmail=t,this.paintEmail())}paintEmail(){if(this.touched)return;const t=this.renderRoot.querySelector(".email");t&&!t.value&&this.userEmail&&(t.value=this.userEmail)}handleEmail(t){const e=t.target;this.touched=!0,this.userEmail=e.value,this.invalid&&(this.invalid=!1)}buttonLabel(){return this.busy?"Sending…":this.cooldown>0?`Send again in ${this.cooldown}s`:"Send reset email"}render(){const t="pwa-reset-status";return U`
|
|
2066
|
+
`]}connectedCallback(){var t;this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Reset password"),super.connectedCallback(),this.stopDraft=(t=()=>{this.prefill()},oD.add(t),()=>{oD.delete(t)}),this.prefill()}disconnectedCallback(){window.clearInterval(this.timer),this.timer=0,this.stopDraft?.(),this.stopDraft=null,super.disconnectedCallback()}updated(){this.paintEmail()}prefill(){if(this.touched)return;const t=BD();t&&t!==this.userEmail&&(this.userEmail=t,this.paintEmail())}paintEmail(){if(this.touched)return;const t=this.renderRoot.querySelector(".email");t&&!t.value&&this.userEmail&&(t.value=this.userEmail)}handleEmail(t){const e=t.target;this.touched=!0,this.userEmail=e.value,this.invalid&&(this.invalid=!1)}buttonLabel(){return this.busy?"Sending…":this.cooldown>0?`Send again in ${this.cooldown}s`:"Send reset email"}render(){const t="pwa-reset-status";return U`
|
|
2050
2067
|
|
|
2051
2068
|
<form
|
|
2052
2069
|
class="resetPass"
|