@globalpayments-private/gpds-pattern-web 0.0.0-stage → 0.1.0-pr.7.gdcb74cd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +567 -2
  2. package/dist/cjs/control-strategy-DhhYTbse.js +113 -0
  3. package/dist/cjs/gpds-pattern-web.cjs.js +24 -0
  4. package/dist/cjs/index-Dzm6P89U.js +1565 -0
  5. package/dist/cjs/index.cjs.js +180 -0
  6. package/dist/cjs/loader.cjs.js +12 -0
  7. package/dist/cjs/uds-pattern-login-card_2.cjs.entry.js +1662 -0
  8. package/dist/collection/collection-manifest.json +14 -0
  9. package/dist/collection/components/uds-pattern-login-card/slimmers/identity-memory.slimmer.js +63 -0
  10. package/dist/collection/components/uds-pattern-login-card/slimmers/login-workflow.slimmer.js +357 -0
  11. package/dist/collection/components/uds-pattern-login-card/slimmers/renderers/login-card-renderer.js +100 -0
  12. package/dist/collection/components/uds-pattern-login-card/slimmers/renderers/login-field-renderer.js +129 -0
  13. package/dist/collection/components/uds-pattern-login-card/slimmers/renderers/login-step-renderer.js +192 -0
  14. package/dist/collection/components/uds-pattern-login-card/slimmers/resend-throttle.slimmer.js +65 -0
  15. package/dist/collection/components/uds-pattern-login-card/uds-pattern-login-card.css +154 -0
  16. package/dist/collection/components/uds-pattern-login-card/uds-pattern-login-card.js +508 -0
  17. package/dist/collection/components/uds-pattern-login-card/validation/login-validation-rules.js +86 -0
  18. package/dist/collection/components/uds-pattern-login-card/view-model/login-card-handlers.js +1 -0
  19. package/dist/collection/components/uds-pattern-login-card/view-model/login-step.view-model.js +138 -0
  20. package/dist/collection/components/uds-pattern-login-page/uds-pattern-login-page.css +37 -0
  21. package/dist/collection/components/uds-pattern-login-page/uds-pattern-login-page.js +97 -0
  22. package/dist/collection/index.js +5 -0
  23. package/dist/collection/providers/auth-provider.js +28 -0
  24. package/dist/collection/providers/control-strategy.js +21 -0
  25. package/dist/collection/providers/login-config.js +4 -0
  26. package/dist/collection/providers/memory-auth-provider.js +133 -0
  27. package/dist/collection/providers/parse-auth-result.js +135 -0
  28. package/dist/collection/slimmer/common/log.js +14 -0
  29. package/dist/collection/slimmer/common/symbols.js +10 -0
  30. package/dist/collection/slimmer/common/types.js +2 -0
  31. package/dist/collection/slimmer/decorators/inject-slimmer.js +73 -0
  32. package/dist/collection/slimmer/decorators/map-to-component-field.js +41 -0
  33. package/dist/collection/slimmer/decorators/map-to-component-method.js +33 -0
  34. package/dist/collection/slimmer/decorators/slimmer.js +10 -0
  35. package/dist/collection/slimmer/index.js +5 -0
  36. package/dist/collection/utils/labels.js +81 -0
  37. package/dist/collection/utils/types.js +1 -0
  38. package/dist/components/index.d.ts +35 -0
  39. package/dist/components/index.js +1 -0
  40. package/dist/components/p-DOrg55po.js +1 -0
  41. package/dist/components/p-_G8A9gg0.js +1 -0
  42. package/dist/components/uds-pattern-login-card.d.ts +11 -0
  43. package/dist/components/uds-pattern-login-card.js +1 -0
  44. package/dist/components/uds-pattern-login-page.d.ts +11 -0
  45. package/dist/components/uds-pattern-login-page.js +1 -0
  46. package/dist/docs.d.ts +480 -0
  47. package/dist/docs.json +549 -0
  48. package/dist/esm/control-strategy-DOrg55po.js +105 -0
  49. package/dist/esm/gpds-pattern-web.js +20 -0
  50. package/dist/esm/index-DsXlLyGj.js +1537 -0
  51. package/dist/esm/index.js +170 -0
  52. package/dist/esm/loader.js +10 -0
  53. package/dist/esm/uds-pattern-login-card_2.entry.js +1659 -0
  54. package/dist/gpds-pattern-web/gpds-pattern-web.css +1 -0
  55. package/dist/gpds-pattern-web/gpds-pattern-web.esm.js +1 -0
  56. package/dist/gpds-pattern-web/index.esm.js +1 -0
  57. package/dist/gpds-pattern-web/p-2c97d2da.entry.js +1 -0
  58. package/dist/gpds-pattern-web/p-DOrg55po.js +1 -0
  59. package/dist/gpds-pattern-web/p-DsXlLyGj.js +3 -0
  60. package/dist/index.cjs.js +1 -0
  61. package/dist/index.js +1 -0
  62. package/dist/types/components/uds-pattern-login-card/slimmers/identity-memory.slimmer.d.ts +21 -0
  63. package/dist/types/components/uds-pattern-login-card/slimmers/login-workflow.slimmer.d.ts +100 -0
  64. package/dist/types/components/uds-pattern-login-card/slimmers/renderers/login-card-renderer.d.ts +44 -0
  65. package/dist/types/components/uds-pattern-login-card/slimmers/renderers/login-field-renderer.d.ts +91 -0
  66. package/dist/types/components/uds-pattern-login-card/slimmers/renderers/login-step-renderer.d.ts +40 -0
  67. package/dist/types/components/uds-pattern-login-card/slimmers/resend-throttle.slimmer.d.ts +21 -0
  68. package/dist/types/components/uds-pattern-login-card/uds-pattern-login-card.d.ts +134 -0
  69. package/dist/types/components/uds-pattern-login-card/validation/login-validation-rules.d.ts +72 -0
  70. package/dist/types/components/uds-pattern-login-card/view-model/login-card-handlers.d.ts +21 -0
  71. package/dist/types/components/uds-pattern-login-card/view-model/login-step.view-model.d.ts +96 -0
  72. package/dist/types/components/uds-pattern-login-page/uds-pattern-login-page.d.ts +21 -0
  73. package/dist/types/components.d.ts +327 -0
  74. package/dist/types/index.d.ts +10 -0
  75. package/dist/types/providers/auth-provider.d.ts +168 -0
  76. package/dist/types/providers/control-strategy.d.ts +144 -0
  77. package/dist/types/providers/login-config.d.ts +52 -0
  78. package/dist/types/providers/memory-auth-provider.d.ts +37 -0
  79. package/dist/types/providers/parse-auth-result.d.ts +8 -0
  80. package/dist/types/slimmer/common/log.d.ts +8 -0
  81. package/dist/types/slimmer/common/symbols.d.ts +10 -0
  82. package/dist/types/slimmer/common/types.d.ts +30 -0
  83. package/dist/types/slimmer/decorators/inject-slimmer.d.ts +24 -0
  84. package/dist/types/slimmer/decorators/map-to-component-field.d.ts +16 -0
  85. package/dist/types/slimmer/decorators/map-to-component-method.d.ts +11 -0
  86. package/dist/types/slimmer/decorators/slimmer.d.ts +10 -0
  87. package/dist/types/slimmer/index.d.ts +6 -0
  88. package/dist/types/stencil-public-runtime.d.ts +1879 -0
  89. package/dist/types/utils/labels.d.ts +13 -0
  90. package/dist/types/utils/types.d.ts +106 -0
  91. package/dist/types/vega.d.ts +11 -0
  92. package/loader/cdn.js +1 -0
  93. package/loader/index.cjs.js +1 -0
  94. package/loader/index.d.ts +24 -0
  95. package/loader/index.es2017.js +1 -0
  96. package/loader/index.js +2 -0
  97. package/package.json +82 -4
@@ -0,0 +1 @@
1
+ :root{--uds-pattern-color-background:#f2f3f4;--uds-pattern-color-surface:#ffffff;--uds-pattern-color-border:#d5d7da;--uds-pattern-color-text:#181d27;--uds-pattern-color-text-subtle:#535862;--uds-pattern-font-family:'Inter', 'Helvetica Neue', Arial, sans-serif;--uds-pattern-font-size-sm:0.875rem;--uds-pattern-font-size-lg:1.5rem;--uds-pattern-font-weight-bold:700;--uds-pattern-line-height-md:1.5;--uds-pattern-space-xs:0.25rem;--uds-pattern-space-sm:0.5rem;--uds-pattern-space-md:1rem;--uds-pattern-space-lg:1.5rem;--uds-pattern-space-xl:2rem;--uds-pattern-space-2xl:3rem;--uds-pattern-radius-lg:12px;--uds-pattern-shadow-card:0 2px 6px rgba(0, 0, 0, 0.1)}
@@ -0,0 +1 @@
1
+ import{p as e,g as o,b as t}from"./p-DsXlLyGj.js";export{s as setNonce}from"./p-DsXlLyGj.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await o(),t([["p-2c97d2da",[[257,"uds-pattern-login-card",{config:[1],initialStep:[1,"initial-step"],identifier:[1],otpLength:[2,"otp-length"],rememberStorageKey:[1,"remember-storage-key"],showHelpFooter:[4,"show-help-footer"],step:[32],busy:[32],errorText:[32],methods:[32],otpMethodLabel:[32],destination:[32],unlockMinutes:[32],resendAt:[32],nowTick:[32],values:[32],reset:[64]}],[257,"uds-pattern-login-page",{logoSrc:[1,"logo-src"],logoAlt:[1,"logo-alt"],logoHref:[1,"logo-href"]}]]]],e))));
@@ -0,0 +1 @@
1
+ export{D as DEFAULT_LOGIN_LABELS,c as createControlStrategy,a as fail,f as formatLabel,g as goTo,s as stay}from"./p-DOrg55po.js";function e(s){return s}const t={identifier:"ada@example.com",password:"correct-horse",mfaMethods:[{id:"app",label:"Authenticator app",description:"Use the code from your authenticator app"},{id:"sms",label:"Text message",description:"Ending in ••3312"}],otpCode:"555555"};function r(s={}){const e=s.users??[t],r=s.maxAttempts??3,o=s.resendAfterMs??3e4,a={signUp:!0,requestPasswordReset:!0,requestUsernameReminder:!0,resendOtp:!0,...s.capabilities};let n,i=0,d=!1;const c=s=>e.find((e=>e.identifier.toLowerCase()===s.trim().toLowerCase())),u={async signIn({identifier:s,password:e}){if(d)return{status:"locked"};const t=c(s);return t?(n=t,void 0===e?{status:"password_required"}:u.verifyPassword({identifier:s,password:e})):{status:"error",code:"account_not_found"}},async verifyPassword({password:s}){return d?{status:"locked"}:n?s!==n.password?(i+=1,i>=r?(d=!0,{status:"locked",unlockAfterMs:9e5}):{status:"error",code:"invalid_credentials"}):(i=0,(e=n).mustResetPassword?{status:"password_reset_required"}:e.mfaMethods?.length?{status:"mfa_required",methods:e.mfaMethods}:{status:"success",session:{identifier:e.identifier}}):{status:"error",code:"unknown"};var e},async selectMfaMethod({methodId:s}){const e=n?.mfaMethods?.find((e=>e.id===s));return{status:"otp_required",method:e,codeLength:6,resendAfterMs:o}},verifyOtp:async({code:s})=>s!==(n?.otpCode??t.otpCode)?(i+=1,i>=r?(d=!0,{status:"locked"}):{status:"error",code:"invalid_code"}):(i=0,{status:"success",session:{identifier:n?.identifier}}),resetPassword:async({password:s})=>s.length<8?{status:"error",code:"password_policy"}:(n&&(n.password=s,n.mustResetPassword=!1),{status:"success",session:{identifier:n?.identifier}})};return a.resendOtp&&(u.resendOtp=async()=>({status:"otp_required",codeLength:6,resendAfterMs:o})),a.requestPasswordReset&&(u.requestPasswordReset=async({identifier:s})=>{const e=c(s);return e?{status:"reset_link_sent",destination:e.identifier}:{status:"error",code:"account_not_found"}}),a.requestUsernameReminder&&(u.requestUsernameReminder=async({email:s})=>({status:"username_sent",destination:s})),a.signUp&&(u.signUp=async({firstName:s,lastName:r,identifier:o})=>{if(c(o))return{status:"error",code:"account_exists"};const a={identifier:o,password:"",otpCode:t.otpCode};return e.push(a),n=a,{status:"success",session:{identifier:o,firstName:s,lastName:r}}}),u}function o(s){return s}export{e as createAuthProvider,o as createLoginConfig,r as createMemoryAuthProvider}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as s,H as i,a as r}from"./p-DsXlLyGj.js";import{g as o,i as n,a,s as c,f as d,D as l}from"./p-DOrg55po.js";class h{}const u=Symbol("SlimmerMappedMethod"),f=Symbol("SlimmerConsumedBy"),p=Symbol("ConsumerSlimmers");function m(){return function(t,e){var s;Object.defineProperty(t,e,{set:(s=e,function(t){this[p]||(this[p]=new Map),this[p].set(s,t),t[f]=this,function(t,e){const s=Object.getPrototypeOf(t)[u];if(s)for(const i of s)e[i.componentMethodName]=v(e,t,e[i.componentMethodName],i)}(t,this)}),get:b(e),configurable:!0})}}function b(t){return function(){return this[p]?.get(t)}}function v(t,e,s,i){return function(...r){const o=s?.apply(t,r),n=e[i.slimmerMethodName];return o&&"function"==typeof o.then?o.then((()=>n.apply(e,r))):n.apply(e,r)}}class g{static log(...t){console.log(`%c${this.PREFIX}`,this.PREFIX_STYLE,...t)}static warn(...t){console.warn(`%c${this.PREFIX}`,this.PREFIX_STYLE,...t)}static error(...t){console.error(`%c${this.PREFIX}`,this.PREFIX_STYLE,...t)}}function w(t){return function(e,s){Object.defineProperty(e,s,{get:k(s,t),set:y(s,t),configurable:!0})}}function y(t,e={}){return function(s){e.writable?this[f][e.componentFieldName??t]=s:g.error(`${String(t)} is not writable`)}}function k(t,e={}){return function(){return this[f][e.componentFieldName??t]}}function _(t){return function(e,s){const i=e;!function(t){if(!Object.prototype.hasOwnProperty.call(t,u)){const e=t[u];t[u]=e?[...e]:[]}}(i),i[u].push({componentMethodName:t,slimmerMethodName:String(s)})}}g.PREFIX="[GP]",g.PREFIX_STYLE="font-weight: bold";const x=["success","password_required","mfa_required","otp_required","password_reset_required","reset_link_sent","username_sent","locked","error"],S=["invalid_credentials","invalid_identifier","invalid_code","code_expired","account_locked","account_not_found","account_exists","password_policy","passwords_do_not_match","rate_limited","network","unknown"];class j extends Error{}function M(t,e,s){if(!t||"object"!=typeof t||"string"!=typeof t.id||"string"!=typeof t.label)throw new j(`${e} resolved with ${s} = ${$(t)}. Expected { id: string, label: string }.`)}function R(t,e,s){if(void 0!==t&&("number"!=typeof t||!Number.isFinite(t)))throw new j(`${e} resolved with ${s} = ${$(t)}. Expected a finite number or undefined.`)}function $(t){return null===t?"null":void 0===t?"undefined":"string"==typeof t?`'${t}'`:Array.isArray(t)?`an array of ${t.length}`:"object"==typeof t?"an object":String(t)}var O=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class C extends h{constructor(){super(),this.pendingIdentifier=""}start(){this.step=this.initialStep,this.pendingIdentifier=this.memory.initialIdentifier(),this.resetStepState()}async restart(){this.methods=[],this.errorText=void 0,this.destination=void 0,this.unlockMinutes=void 0,this.otpCount=void 0,this.resend.stop(),this.applyTransition(o(this.initialStep),"reset")}get capabilities(){const t=this.auth;return{signUp:"function"==typeof t?.signUp,reset:"function"==typeof t?.requestPasswordReset,username:"function"==typeof t?.requestUsernameReminder,resend:"function"==typeof t?.resendOtp}}navigateTo(t){this.errorText=void 0,this.applyTransition(o(t),"link")}applyTransition(t,e){if("stay"===t.type)return;if("fail"===t.type)return void this.showError(t.code,t.message);const s=n(this.controlStrategy?.navigate,{from:this.step,to:t.step,cause:e},(()=>t));"stay"!==s.type&&("fail"!==s.type?this.setStep(s.step):this.showError(s.code,s.message))}setStep(t){const e=this.step;this.step=t,this.resetStepState(),e!==t&&this.udsLoginStepChange.emit({step:t,previousStep:e})}resetStepState(){this.values="identifier"!==this.step&&"forgot-password"!==this.step||!this.pendingIdentifier?{}:{identifier:this.pendingIdentifier}}get codeLength(){return Math.max(1,this.otpCount??this.otpLength)}applyResult(t){this.errorText=void 0;const e=n(this.controlStrategy?.transition,{result:t,from:this.step},(()=>this.defaultTransitionFor(t)));this.stageResultState(t),"mfa_required"!==t.status||1!==this.methods.length||"stay"!==e.type?(this.applyTransition(e,"auto"),"success"===t.status&&"goto"===e.type&&"success"===e.step&&n(this.controlStrategy?.complete,{session:t.session},(()=>this.udsLoginSuccess.emit({session:t.session})))):this.selectMfaMethod(this.methods[0].id)}defaultTransitionFor(t){switch(t.status){case"success":return o("success");case"password_required":return o("password");case"mfa_required":return 1===t.methods.length?c():o("mfa-method");case"otp_required":return o("otp");case"password_reset_required":return o("reset-password");case"reset_link_sent":case"username_sent":return o("check-email");case"locked":return o("locked");case"error":return a(t.code,t.message)}}stageResultState(t){switch(t.status){case"mfa_required":return void(this.methods=t.methods);case"otp_required":return this.otpMethodLabel=t.method?.label,this.otpCount=t.codeLength??this.otpLength,void this.resend.start(t.resendAfterMs);case"reset_link_sent":case"username_sent":return void(this.destination=t.destination);case"locked":return void(this.unlockMinutes=t.unlockAfterMs?Math.ceil(t.unlockAfterMs/6e4):void 0);default:return}}showError(t,e){const s=n(this.controlStrategy?.failure,{code:t,step:this.step,message:e},(()=>({text:this.copy.errors[t]??this.copy.errors.unknown})));this.errorText=s.text,this.udsLoginError.emit({code:t,step:this.step,message:e}),s.transition&&this.applyTransition(s.transition,"auto")}async run(t,e){if(this.busy)return;let s;this.busy=!0;try{s=function(t,e){try{return function(t,e){const s=t;if(!s||"object"!=typeof s)throw new j(`${e} resolved with ${$(t)}, expected a UdsAuthResult object.`);const i=s.status;if(!x.includes(i))throw new j(`${e} resolved with status ${$(i)}. Expected one of: ${x.join(", ")}.`);switch(i){case"mfa_required":!function(t,e){if(!Array.isArray(t)||0===t.length)throw new j(`${e} resolved with status 'mfa_required' but methods was ${$(t)}. Expected a non-empty array of UdsMfaMethod — the card has nothing to offer the user otherwise.`);t.forEach(((t,s)=>M(t,e,`methods[${s}]`)))}(s.methods,e);break;case"otp_required":void 0!==s.method&&M(s.method,e,"method"),R(s.codeLength,e,"codeLength"),R(s.resendAfterMs,e,"resendAfterMs");break;case"locked":R(s.unlockAfterMs,e,"unlockAfterMs");break;case"error":if(!S.includes(s.code))throw new j(`${e} resolved with error code ${$(s.code)}. Expected one of: ${S.join(", ")}.`)}return s}(t,e)}catch(e){if(!(e instanceof j))throw e;return console.error(`[uds-pattern-login-card] ${e.message}`,t),{status:"error",code:"unknown"}}}(await t(),`auth.${e}`)}catch{return this.busy=!1,void this.showError("network")}this.busy=!1,this.applyResult(s)}async selectMfaMethod(t){this.auth?.selectMfaMethod?await this.run((()=>this.auth.selectMfaMethod({methodId:t})),"selectMfaMethod"):this.showError("unknown")}async resendCode(){this.resend.canResend&&this.auth?.resendOtp&&await this.run((()=>this.auth.resendOtp()),"resendOtp")}async submit(){if(this.busy)return;const t=this.step,e={...this.values};this.rememberIdentifierIfRequested(t),await this.run((()=>n(this.controlStrategy?.submit,{step:t,values:e,identifier:this.pendingIdentifier},(()=>this.callProvider(t)))),`submit(${t})`)}rememberIdentifierIfRequested(t){if("identifier"!==t)return;const e=this.str("identifier").trim();this.pendingIdentifier=e,this.memory.remember(e,!0===this.values.rememberIdentifier)}callProvider(t){const e=this.auth;if(!e)return Promise.resolve({status:"error",code:"unknown"});const s=Promise.resolve({status:"error",code:"unknown"});switch(t){case"identifier":return e.signIn({identifier:this.pendingIdentifier,rememberIdentifier:!0===this.values.rememberIdentifier});case"password":{const t=this.str("password"),s=this.pendingIdentifier;return e.verifyPassword?e.verifyPassword({identifier:s,password:t}):e.signIn({identifier:s,password:t})}case"mfa-method":return e.selectMfaMethod?.({methodId:this.str("mfaMethod")})??s;case"otp":return e.verifyOtp?.({code:this.str("code")})??s;case"forgot-password":return e.requestPasswordReset?.({identifier:this.str("identifier").trim()})??s;case"forgot-username":return e.requestUsernameReminder?.({email:this.str("email").trim()})??s;case"reset-password":return e.resetPassword?.({password:this.str("password")})??s;case"sign-up":return e.signUp?.({firstName:this.str("firstName"),lastName:this.str("lastName"),identifier:this.str("identifier").trim()})??s;default:return s}}str(t){return String(this.values[t]??"")}}O([w()],C.prototype,"resend",void 0),O([w()],C.prototype,"memory",void 0),O([w()],C.prototype,"udsLoginStepChange",void 0),O([w()],C.prototype,"udsLoginError",void 0),O([w()],C.prototype,"udsLoginSuccess",void 0),O([w()],C.prototype,"auth",void 0),O([w()],C.prototype,"controlStrategy",void 0),O([w()],C.prototype,"initialStep",void 0),O([w()],C.prototype,"otpLength",void 0),O([w()],C.prototype,"copy",void 0),O([w({writable:!0})],C.prototype,"step",void 0),O([w({writable:!0})],C.prototype,"busy",void 0),O([w({writable:!0})],C.prototype,"errorText",void 0),O([w({writable:!0})],C.prototype,"methods",void 0),O([w({writable:!0})],C.prototype,"otpMethodLabel",void 0),O([w({writable:!0})],C.prototype,"destination",void 0),O([w({writable:!0})],C.prototype,"unlockMinutes",void 0),O([w({writable:!0})],C.prototype,"values",void 0),O([_("componentWillLoad")],C.prototype,"start",null),O([_("reset")],C.prototype,"restart",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class L extends h{constructor(){super()}start(t){this.stop(),!t||t<=0?this.resendAt=void 0:(this.resendAt=Date.now()+t,this.nowTick=Date.now(),this.timer=setInterval((()=>{this.nowTick=Date.now(),void 0!==this.resendAt&&this.nowTick>=this.resendAt&&(this.stop(),this.resendAt=void 0)}),1e3))}stop(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}get secondsRemaining(){return void 0===this.resendAt?0:Math.max(0,Math.ceil((this.resendAt-this.nowTick)/1e3))}get canResend(){return 0===this.secondsRemaining}}q([w({writable:!0})],L.prototype,"resendAt",void 0),q([w({writable:!0})],L.prototype,"nowTick",void 0),q([_("disconnectedCallback")],L.prototype,"stop",null);var T=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class V extends h{constructor(){super()}initialIdentifier(){return this.identifier||this.read()||""}read(){if(!this.rememberStorageKey)return"";try{return globalThis.localStorage?.getItem(this.rememberStorageKey)??""}catch{return""}}remember(t,e){if(this.rememberStorageKey)try{e?globalThis.localStorage?.setItem(this.rememberStorageKey,t):globalThis.localStorage?.removeItem(this.rememberStorageKey)}catch{}}}T([w()],V.prototype,"rememberStorageKey",void 0),T([w()],V.prototype,"identifier",void 0);class z{canEvaluate(t,e){return"string"==typeof t&&0!==t.length&&(!e||!e.disabled&&e.visible)}shouldShowError(t){return!t||!t.disabled&&t.visible&&(t.touched||t.modified)}}class E extends z{constructor(t,e){super(),this.expected=t,this.message=e}evaluate(t){const e=t===this.expected();return{isValid:e,message:e?"":this.message()}}}class N extends z{constructor(t,e){super(),this.length=t,this.message=e}evaluate(t){const e=this.length(),s=t.length>=e;return{isValid:s,message:s?"":this.message(e)}}}var I=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class A extends h{constructor(){super(),this.matchRules=new Map,this.completeCode=[new N((()=>this.viewModel.otpLength),(t=>d(this.viewModel.copy.otpIncomplete,{count:t})))]}matchRuleFor(t){let e=this.matchRules.get(t);return e||(e=[new E((()=>this.viewModel.valueOf(t)),(()=>this.viewModel.copy.errors.passwords_do_not_match))],this.matchRules.set(t,e)),e}textField(e){const s=this.viewModel,{name:i,label:r,type:o="text",autocomplete:n,mustMatch:a}=e;return t("vega-input",{key:i,class:"field",name:i,label:r,type:o,autocomplete:n,value:s.valueOf(i),disabled:s.busy,showClearIcon:!1,required:!0,autoValidation:!0,validationRules:a?this.matchRuleFor(a):void 0,onVegaChange:t=>this.handlers.onValueChange(i,t.detail)})}passcodeField(){const e=this.viewModel;return t("vega-input-passcode",{class:"field",name:"code",label:e.copy.otpFieldLabel,length:e.otpLength,inputType:"numeric",disabled:e.busy,required:!0,autoValidation:!0,validationRules:this.completeCode,value:e.valueOf("code"),onVegaChange:t=>this.handlers.onValueChange("code",t.detail)})}checkbox(e,s){const i=this.viewModel;return t("vega-checkbox",{class:"field",name:e,identifier:e,checked:i.isChecked(e),disabled:i.busy,onVegaUserChange:t=>this.handlers.onValueChange(e,!1!==t.detail)},s)}submit(e){return t("vega-button",{class:"submit",type:"submit",variant:"primary",block:!0,label:e,loading:this.viewModel.busy})}link(e,s){return t("vega-button-link",{class:"link",label:e,eventful:!0,disabled:this.viewModel.busy,onVegaClick:t=>s(t)})}methodGroup(e,s){const i=this.viewModel;return t("vega-selection-tile-group",{class:"options",name:"mfaMethod",label:s,selectType:"radio",layout:"vertical",disabled:i.busy,required:!0,value:i.valueOf("mfaMethod"),onVegaChange:t=>this.handlers.onValueChange("mfaMethod",t.detail)},e.map((e=>t("vega-selection-tile",{key:e.id,class:"option",value:e.id,titleText:e.label,note:e.description,selectType:"radio",checked:i.valueOf("mfaMethod")===e.id,disabled:!0===e.disabled||i.busy}))))}}I([w()],A.prototype,"viewModel",void 0),I([w()],A.prototype,"handlers",void 0);var D=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class F extends h{constructor(){super(),this.fields=new A}render(){const t=this.viewModel;switch(t.step){case"identifier":return this.identifierStep(t);case"password":return this.passwordStep(t);case"mfa-method":return this.mfaMethodStep(t);case"otp":return this.otpStep(t);case"forgot-password":case"forgot-username":return this.forgotStep(t);case"reset-password":return this.resetPasswordStep(t);case"sign-up":return this.signUpStep(t);default:return[]}}identifierStep(e){const{copy:s}=e;return[this.fields.textField({name:"identifier",label:s.identifierFieldLabel,type:"email",autocomplete:"username"}),this.fields.checkbox("rememberIdentifier",s.rememberIdentifier),this.fields.submit(s.continue),t("div",{class:"prose"},t("p",{class:"prose__lead"},s.troubleSigningInPrompt),t("p",null,"Follow the steps in “",this.fields.link(s.troubleSigningIn,this.handlers.onAction("trouble-signing-in")),"”."),e.can.signUp&&t("p",null,s.noAccountPrompt," ",this.fields.link(s.createAccount,this.handlers.onNavigate("sign-up"))))]}passwordStep(e){const{copy:s,can:i}=e,r=[];return i.reset&&r.push(this.fields.link(s.forgotPassword,this.handlers.onNavigate("forgot-password"))),i.username&&r.push(this.fields.link(s.forgotUsername,this.handlers.onNavigate("forgot-username"))),[this.fields.textField({name:"password",label:s.passwordFieldLabel,type:"password",autocomplete:"current-password"}),...r.length?[t("div",{class:"inline-links"},r)]:[],this.fields.submit(s.continue)]}mfaMethodStep(t){const{copy:e}=t;return[this.fields.methodGroup(t.methods,e.mfaMethodHeading),this.fields.submit(e.continue)]}otpStep(e){const{copy:s}=e,i=[];return e.methods.length>1&&i.push(this.fields.link(s.changeMfaMethod,this.handlers.onNavigate("mfa-method"))),e.can.resend&&i.push(e.isResendThrottled?t("span",{class:"countdown","aria-live":"polite"},e.resendCountdownText):this.fields.link(s.resendCode,this.handlers.onResend)),[this.fields.passcodeField(),this.fields.submit(s.otpSubmit),...i.length?[t("div",{class:"prose"},t("p",null,s.changeMfaMethodPrompt),t("p",{class:"inline-links"},i))]:[]]}forgotStep(e){const{copy:s}=e;return[this.fields.textField({name:"forgot-password"===e.step?"identifier":"email",label:s.identifierFieldLabel,type:"email",autocomplete:"username"}),this.fields.submit(s.continue),t("p",{class:"prose"},this.fields.link(s.back,this.handlers.onNavigate("identifier")))]}resetPasswordStep(t){const{copy:e}=t;return[this.fields.textField({name:"password",label:e.newPasswordFieldLabel,type:"password",autocomplete:"new-password"}),this.fields.textField({name:"confirmPassword",label:e.confirmPasswordFieldLabel,type:"password",autocomplete:"new-password",mustMatch:"password"}),this.fields.submit(e.continue)]}signUpStep(e){const{copy:s}=e;return[this.fields.textField({name:"firstName",label:s.firstNameFieldLabel,autocomplete:"given-name"}),this.fields.textField({name:"lastName",label:s.lastNameFieldLabel,autocomplete:"family-name"}),this.fields.textField({name:"identifier",label:s.identifierFieldLabel,type:"email",autocomplete:"email"}),this.fields.submit(s.signUpSubmit),t("p",{class:"prose"},s.haveAccountPrompt," ",this.fields.link(s.signIn,this.handlers.onNavigate("identifier")))]}}D([m()],F.prototype,"fields",void 0),D([w()],F.prototype,"viewModel",void 0),D([w()],F.prototype,"handlers",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class U extends h{constructor(){super(),this.steps=new F}render(){const e=this.viewModel;return[t("h1",{class:"card__heading",id:"uds-pattern-login-heading",tabindex:"-1"},e.heading),...e.description?[t("p",{class:"card__description"},e.description)]:[],...e.errorText?[t("vega-banner",{class:"alert",type:"error",content:e.errorText,isOpen:!0,showCloseButton:!1})]:[],...e.isTerminal?this.terminalBody(e):[this.form()]]}form(){return t("vega-form",{class:"form",useNativeForm:!0,disableBlurValidation:!0,onVegaFormSubmit:t=>this.handlers.onSubmit(t)},t("div",{class:"form__body"},this.steps.render()))}terminalBody(e){return"check-email"!==e.step?[]:[t("p",{class:"prose"},t("vega-button-link",{class:"link",label:e.copy.back,eventful:!0,onVegaClick:t=>this.handlers.onNavigate("identifier")(t)}))]}}P([m()],U.prototype,"steps",void 0),P([w()],U.prototype,"viewModel",void 0),P([w()],U.prototype,"handlers",void 0);class B{constructor(t,e,s,i,r,o,n,a,c,d,l){this.step=t,this.copy=e,this.heading=s,this.description=i,this.errorText=r,this.busy=o,this.can=n,this.methods=a,this.values=c,this.otpLength=d,this.resendSeconds=l}static from(t){const{step:e,copy:s}=t;return new B(e,s,function(t,e){return{identifier:e.identifierHeading,password:e.passwordHeading,"mfa-method":e.mfaMethodHeading,otp:e.otpHeading,"forgot-password":e.forgotPasswordHeading,"forgot-username":e.forgotUsernameHeading,"reset-password":e.resetPasswordHeading,"sign-up":e.signUpHeading,"check-email":e.checkEmailHeading,locked:e.lockedHeading,success:e.successHeading}[t]}(e,s),function(t,e,s){switch(t){case"mfa-method":return e.mfaMethodDescription;case"otp":return s.otpMethodLabel?d(e.otpDescriptionForMethod,{method:s.otpMethodLabel}):e.otpDescription;case"forgot-password":return e.forgotPasswordDescription;case"forgot-username":return e.forgotUsernameDescription;case"sign-up":return e.signUpDescription;case"check-email":return s.destination?d(e.checkEmailDescriptionWithDestination,{destination:s.destination}):e.checkEmailDescription;case"locked":return s.unlockMinutes?d(e.lockedDescriptionWithTime,{minutes:s.unlockMinutes}):e.lockedDescription;default:return}}(e,s,t),t.errorText,t.busy,t.can,t.methods,t.values,t.otpLength,t.resendSeconds)}get isTerminal(){return"success"===this.step||"locked"===this.step||"check-email"===this.step}get isResendThrottled(){return this.resendSeconds>0}get resendCountdownText(){return d(this.copy.resendCodeIn,{seconds:this.resendSeconds})}valueOf(t){const e=this.values[t];return"string"==typeof e?e:""}isChecked(t){return!0===this.values[t]}}var G=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};const W=class{constructor(t){e(this,t),this.udsLoginSuccess=s(this,"udsLoginSuccess"),this.udsLoginStepChange=s(this,"udsLoginStepChange"),this.udsLoginError=s(this,"udsLoginError"),this.udsLoginAction=s(this,"udsLoginAction"),this.workflow=new C,this.resend=new L,this.memory=new V,this.renderer=new U,this.config={},this.initialStep="identifier",this.identifier="",this.otpLength=6,this.rememberStorageKey="uds-pattern-login.identifier",this.showHelpFooter=!0,this.step="identifier",this.busy=!1,this.methods=[],this.nowTick=Date.now(),this.values={},this.handlers={onSubmit:t=>{t.preventDefault(),this.workflow.submit()},onNavigate:t=>e=>{e.preventDefault(),this.workflow.navigateTo(t)},onAction:t=>e=>{e.preventDefault(),this.udsLoginAction.emit({action:t,step:this.step})},onResend:t=>{t.preventDefault(),this.workflow.resendCode()},onValueChange:(t,e)=>{this.values={...this.values,[t]:e}}}}componentWillLoad(){}disconnectedCallback(){}componentDidRender(){void 0!==this.lastRenderedStep&&this.lastRenderedStep!==this.step&&this.focusFirstControl(),this.lastRenderedStep=this.step}async reset(){}get resolvedConfig(){return function(t,e){if("string"!=typeof t)return t??e;try{return JSON.parse(t)}catch{return e}}(this.config,{})}get auth(){return this.resolvedConfig.auth}get controlStrategy(){return this.resolvedConfig.control}get copy(){const t=this.resolvedConfig.labels??{};return{...l,...t,errors:{...l.errors,...t.errors??{}}}}get viewModel(){return B.from({step:this.step,copy:this.copy,errorText:this.errorText,busy:this.busy,can:this.workflow.capabilities,methods:this.methods,values:this.values,otpLength:this.workflow.codeLength,resendSeconds:this.resend.secondsRemaining,otpMethodLabel:this.otpMethodLabel,destination:this.destination,unlockMinutes:this.unlockMinutes})}focusFirstControl(){const t=this.hostEl.shadowRoot;(t.querySelector(".form .field:not([disabled])")??t.querySelector(".card__heading")).focus()}render(){return t(i,{key:"e8d37d2f818b9b2260fb2ccd3d784393a28385c4"},t("section",{key:"1c0ce6ee5c73d24b06212d8a4b2f293c89e6cb70",class:"card","aria-busy":String(this.busy)},t("slot",{key:"c87b3ceba0d974e15958aec53c19e76dc3996096",name:"brand"}),this.renderer.render(),this.showHelpFooter&&t("div",{key:"003268c5b8abf8755d55ba54e433fc8114171113",class:"card__footer"},t("slot",{key:"376accf53b60a5cb489abde889ff74bf7fab3fe6",name:"footer"},t("p",{key:"a6834071896f9a3d988c089807fc6a77ee928ffc"},this.copy.helpPrompt," ",t("vega-button-link",{key:"4645b67e1ccf70b0b386a516025659540a9308a9",class:"link",label:this.copy.help,eventful:!0,onVegaClick:t=>this.handlers.onAction("login-help")(t)}))))))}get hostEl(){return r(this)}};G([m()],W.prototype,"workflow",void 0),G([m()],W.prototype,"resend",void 0),G([m()],W.prototype,"memory",void 0),G([m()],W.prototype,"renderer",void 0),W.style=":host{display:block;width:100%;max-width:var(--uds-pattern-login-card-max-width);box-sizing:border-box;--uds-pattern-login-card-max-width:35rem}:host *,:host *::before,:host *::after{box-sizing:inherit}.card{padding:var(--uds-pattern-space-2xl);background:var(--uds-pattern-color-surface);border-radius:var(--uds-pattern-radius-lg);box-shadow:var(--uds-pattern-shadow-card)}.card__heading{margin:0 0 var(--uds-pattern-space-sm);font-size:var(--uds-pattern-font-size-lg);font-weight:var(--uds-pattern-font-weight-bold);line-height:var(--uds-pattern-line-height-md)}.card__heading:focus,.card__heading:focus-visible{outline:none}.card__description{margin:0 0 var(--uds-pattern-space-lg);font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}.card__footer{margin-top:var(--uds-pattern-space-xl);padding-top:var(--uds-pattern-space-xl);border-top:1px solid var(--uds-pattern-color-border);font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}.card__footer p{margin:0}.form{margin-top:var(--uds-pattern-space-lg)}.form__body{display:flex;flex-direction:column;gap:var(--uds-pattern-space-xl);align-items:stretch}.alert{display:block;margin-bottom:var(--uds-pattern-space-md)}.options{display:block}.prose{margin:0;font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}.prose p{margin:0 0 var(--uds-pattern-space-xs)}.prose p:last-child{margin-bottom:0}.prose__lead{font-weight:var(--uds-pattern-font-weight-bold);color:var(--uds-pattern-color-text)}.link{display:inline-block;vertical-align:baseline}.inline-links{display:flex;flex-wrap:wrap;gap:var(--uds-pattern-space-md)}.countdown{color:var(--uds-pattern-color-text-subtle)}";const H=class{constructor(t){e(this,t),this.logoAlt=""}render(){const e=this.logoSrc?t("img",{class:"masthead__logo",src:this.logoSrc,alt:this.logoAlt}):null;return t(i,{key:"7c2d0d6ae80dc7e52c0780c457de982738ef8faa"},t("header",{key:"7eac231827e53a5e4018591506f7632aff8ddda5",class:"masthead"},t("slot",{key:"e80b31f6301079a15f45066189c646ed4c444e24",name:"brand"},this.logoHref&&e?t("a",{href:this.logoHref},e):e)),t("main",{key:"3081bf6ec017cff44900f6cd0d9c98b38baf5126",class:"content"},t("slot",{key:"3c84048fae834578b00254e6bdbad4eecc74b5e2"})),t("footer",{key:"dfb064a71e3f39c8e99212b523d043f9f9f20538",class:"page-footer"},t("slot",{key:"5ea9ef897c20a96f3c42b2b4f54496155516a423",name:"footer"})))}};H.style=":host{display:flex;flex-direction:column;min-height:100vh;box-sizing:border-box;font-family:var(--uds-pattern-font-family);color:var(--uds-pattern-color-text);background:var(--uds-pattern-color-background)}.masthead{display:flex;justify-content:center;align-items:center;padding:var(--uds-pattern-space-md) var(--uds-pattern-space-lg);background:var(--uds-pattern-color-surface)}.masthead__logo{display:block;max-height:2rem}.content{display:flex;flex:1;justify-content:center;align-items:center;padding:var(--uds-pattern-space-xl) var(--uds-pattern-space-md)}.page-footer:not(:empty){padding:var(--uds-pattern-space-md) var(--uds-pattern-space-lg);text-align:center;font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}";export{W as uds_pattern_login_card,H as uds_pattern_login_page}
@@ -0,0 +1 @@
1
+ const e={identifierHeading:"Sign In to My Account",identifierFieldLabel:"Email address",rememberIdentifier:"Remember my email",passwordHeading:"Enter your password",passwordFieldLabel:"Password",showPassword:"Show password",hidePassword:"Hide password",forgotPassword:"Forgot password?",forgotUsername:"Forgot username?",mfaMethodHeading:"How do you want to receive your security code?",mfaMethodDescription:"Choose a delivery method to continue signing in.",otpHeading:"Verify your security code",otpDescription:"Enter the security code generated from your authenticator app.",otpDescriptionForMethod:"Enter the security code sent via {method}.",otpFieldLabel:"Security code",otpIncomplete:"Enter all {count} digits of your security code.",otpSubmit:"Verify and sign in",showCode:"Show security code",hideCode:"Hide security code",resendCode:"Resend code",resendCodeIn:"Resend code in {seconds}s",changeMfaMethodPrompt:"Want to change how you receive your security code?",changeMfaMethod:"Change security method",forgotPasswordHeading:"Reset your password",forgotPasswordDescription:"Enter your email address and we will send you a link to reset your password.",forgotUsernameHeading:"Find your username",forgotUsernameDescription:"Enter the email address associated with your account.",checkEmailHeading:"Check your email",checkEmailDescription:"If an account matches what you entered, we have sent you an email with next steps.",checkEmailDescriptionWithDestination:"If an account matches {destination}, we have sent an email with next steps.",lockedHeading:"Your account is temporarily locked",lockedDescription:"For your security we have paused sign-in after too many attempts. Try again later.",lockedDescriptionWithTime:"For your security we have paused sign-in after too many attempts. Try again in {minutes} minutes.",resetPasswordHeading:"Create a new password",newPasswordFieldLabel:"New password",confirmPasswordFieldLabel:"Confirm new password",signUpHeading:"Create your account",signUpDescription:"Tell us a little about you to get started.",firstNameFieldLabel:"First name",lastNameFieldLabel:"Last name",signUpSubmit:"Create account",haveAccountPrompt:"Already have an account?",signIn:"Sign in",successHeading:"You're signed in",continue:"Continue",back:"Back",troubleSigningInPrompt:"Forgot password? Account locked? Change security method?",troubleSigningIn:"Trouble Signing In?",helpPrompt:"Need help signing in? Check out our",help:"Login help",noAccountPrompt:"Don't have an account?",createAccount:"Create one",errors:{invalid_credentials:"That email address and password don't match. Try again.",invalid_identifier:"Enter a valid email address.",invalid_code:"That security code isn't right. Check it and try again.",code_expired:"That security code has expired. Request a new one.",account_locked:"Your account is temporarily locked. Try again later.",account_not_found:"We couldn't find an account for that email address.",account_exists:"An account already exists for that email address.",password_policy:"That password doesn't meet the security requirements.",passwords_do_not_match:"Those passwords don't match.",rate_limited:"Too many attempts. Wait a moment and try again.",network:"We couldn't reach the server. Check your connection and try again.",unknown:"Something went wrong. Try again."}};function t(e,t){return e.replace(/\{(\w+)\}/g,((e,o)=>o in t?String(t[o]):e))}const o=e=>({type:"goto",step:e}),a=()=>({type:"stay"}),n=(e,t)=>({type:"fail",code:e,message:t});function i(e,t,o){return e?e(t,o):o()}function r(e){return e}export{e as D,n as a,r as c,t as f,o as g,i,a as s}
@@ -0,0 +1,3 @@
1
+ const t=()=>{},e=":root{--uds-pattern-color-background:#f2f3f4;--uds-pattern-color-surface:#ffffff;--uds-pattern-color-border:#d5d7da;--uds-pattern-color-text:#181d27;--uds-pattern-color-text-subtle:#535862;--uds-pattern-font-family:'Inter', 'Helvetica Neue', Arial, sans-serif;--uds-pattern-font-size-sm:0.875rem;--uds-pattern-font-size-lg:1.5rem;--uds-pattern-font-weight-bold:700;--uds-pattern-line-height-md:1.5;--uds-pattern-space-xs:0.25rem;--uds-pattern-space-sm:0.5rem;--uds-pattern-space-md:1rem;--uds-pattern-space-lg:1.5rem;--uds-pattern-space-xl:2rem;--uds-pattern-space-2xl:3rem;--uds-pattern-radius-lg:12px;--uds-pattern-shadow-card:0 2px 6px rgba(0, 0, 0, 0.1)}";function n(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var o,l=(t,e)=>{var o;Object.entries(null!=(o=e.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=t[o],s=n(Object.getPrototypeOf(t),o,!0)||Object.getOwnPropertyDescriptor(t,o);s&&Object.defineProperty(t,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),e.l.has(o)?t[o]=e.l.get(o):void 0!==l&&(t[o]=l)}}))},s=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},r=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&l(t,e))},i=(t,e)=>e in t,c=(t,e)=>(0,console.error)(t,e),u=new Map,a=new Map,f=new Map,d="undefined"!=typeof window?window:{},p={u:0,p:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),m=(()=>{try{return!!d.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),v=!!m&&(()=>!!d.document&&Object.getOwnPropertyDescriptor(d.document.adoptedStyleSheets,"length").writable)(),b=!1,y=[],$=[],w=()=>{var t;return(null==(t=d.document)?void 0:t.hidden)?setTimeout(S,16):p.raf(S)},g=(t,e)=>n=>{t.push(n),b||(b=!0,e&&4&p.u?O(S):w())},j=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){c(t)}t.length=0},S=()=>{j(y),j($),(b=y.length>0)&&w()},O=t=>h().then(t),k=g($,!0);function x(){var t;const n=this.attachShadow({mode:"open"});if(void 0===o&&(o=null!=(t=function(t){if(!m)return;const e=new CSSStyleSheet;return e.replaceSync(t),e}(e))?t:null),o)v?n.adoptedStyleSheets.push(o):n.adoptedStyleSheets=[...n.adoptedStyleSheets,o];else if(!m){const t=document.createElement("style");t.innerHTML=e,n.prepend(t)}}function M(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var E,C=new WeakMap,N=t=>"sc-"+t.h,A=t=>"object"==(t=typeof t)||"function"===t,T=(t,e,...n)=>{let o=null,l=null,s=!1,r=!1;const i=[],u=e=>{for(let n=0;n<e.length;n++)if(o=e[n],Array.isArray(o))u(o);else if(null!=o&&"boolean"!=typeof o){if(s="function"!=typeof t&&!A(o))o+="";else if("function"!=typeof t&&void 0===o.u){c("Invalid vNode child");continue}s&&r?i[i.length-1].m+=o:i.push(s?H(null,o):o),r=s}};if(u(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const a=H(t,null);return a.v=e,i.length>0&&(a.$=i),a.j=l,a},H=(t,e)=>({u:0,S:t,m:null!=e?e:null,O:null,$:null,v:null,j:null}),L={},P=(t,e)=>null==t||A(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,R=t=>{var e;return null==(e=s(t))?void 0:e.$hostElement$},D=(t,e)=>{const n=R(t);return{emit:t=>z(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},z=(t,e,n)=>{const o=p.ce(e,n);return t.dispatchEvent(o),o},U=(t,e,n,o,l,r)=>{if(n===o)return;let c=i(t,e),u=e.toLowerCase();if("class"===e){const e=t.classList,l=q(n);let s=q(o);{let t=l.filter((t=>t&&!s.includes(t)));e.remove(...t),e.add(...s.filter((t=>t&&!l.includes(t))))}}else if("key"===e);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let l;{const e=s(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(l=t[1])}}return l||(l=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==o||!1===o?!1===o&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===o?"":o))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=o}catch(t){}return}{const s=A(o);if((c||s&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?c=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?(!1!==o||""===t.getAttribute(e)||4&r&&!F(e))&&t.removeAttribute(e):(!c||4&r||l)&&!s&&1===t.nodeType&&t.setAttribute(e,o=!0===o?"":o)}}else if(e="-"===e[2]?e.slice(3):i(d,u)?u.slice(2):u[2]+e.slice(3),n||o){const l=e.endsWith(I);e=e.replace(B,""),n&&p.rel(t,e,n,l),o&&p.ael(t,e,o,l)}},W=new Set(["draggable","contenteditable","spellcheck"]),F=t=>W.has(t)||t.startsWith("aria-"),V=/\s/,q=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(V):[]),I="Capture",B=RegExp(I+"$"),G=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.v||{},s=e.v||{};for(const t of Y(Object.keys(l)))t in s||U(o,t,l[t],void 0,n,e.u);for(const t of Y(Object.keys(s)))U(o,t,l[t],s[t],n,e.u)};function Y(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var Z=!1,_=!1,J=(t,e,n)=>{const o=e.$[n];let l,s,r=0;if(null!=o.m)l=o.O=d.document.createTextNode(o.m);else{if(!d.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=d.document.createElement(o.S),G(null,o,_),o.$){const e="template"===o.S?l.content:l;for(r=0;r<o.$.length;++r)s=J(t,o,r),s&&e.appendChild(s)}}return l["s-hn"]=E,l},K=(t,e,n,o,l,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===E&&(i=i.shadowRoot),"template"===n.S&&(i=i.content);l<=s;++l)o[l]&&(r=J(null,n,l),r&&(o[l].O=r,et(i,r,e)))},Q=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;t&&t.remove()}}},X=(t,e,n=!1)=>t.S===e.S&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),tt=(t,e,n=!1)=>{const o=e.O=t.O,l=t.$,s=e.$,r=e.m;null==r?("slot"!==e.S||Z||t.k!==e.k&&(e.O["s-sn"]=e.k||"",(t=>{p.u|=1;const e=t.closest(E.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(et(e,t,null!=n?n:null),t["s-sh"]=void 0)}p.u&=-2})(e.O.parentElement)),G(t,e,_),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=e.length-1,d=e[0],p=e[f],h=o.length-1,m=o[0],v=o[h];const b="template"===n.S?t.content:t;for(;i<=f&&c<=h;)if(null==d)d=e[++i];else if(null==p)p=e[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--h];else if(X(d,m,l))tt(d,m,l),d=e[++i],m=o[++c];else if(X(p,v,l))tt(p,v,l),p=e[--f],v=o[--h];else if(X(d,v,l))tt(d,v,l),et(b,d.O,p.O.nextSibling),d=e[++i],v=o[--h];else if(X(p,m,l))tt(p,m,l),et(b,p.O,d.O),p=e[--f],m=o[++c];else{for(u=-1,a=i;a<=f;++a)if(e[a]&&null!==e[a].j&&e[a].j===m.j){u=a;break}u>=0?(r=e[u],r.S!==m.S?s=J(e&&e[c],n,c):(tt(r,m,l),e[u]=void 0,s=r.O),m=o[++c]):(s=J(e&&e[c],n,c),m=o[++c]),s&&et(d.O.parentNode,s,d.O)}i>f?K(t,null==o[h+1]?null:o[h+1].O,n,o,c,h):c>h&&Q(e,i,f)})(o,l,e,s,n):null!==s?(null!==t.m&&(o.textContent=""),K(o,null,e,s,0,s.length-1)):!n&&null!==l&&Q(l,0,l.length-1)):t.m!==r&&(o.data=r)},et=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),nt=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},ot=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);nt(t,t.C);const n=()=>lt(t,e);if(!e)return k(n);queueMicrotask((()=>{n()}))},lt=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e?(t.N.length&&t.N.forEach((t=>t(n))),l=ft(o,"componentWillLoad",void 0,n)):l=ft(o,"componentWillUpdate",void 0,n),l=st(l,(()=>ft(o,"componentWillRender",void 0,n))),st(l,(()=>it(t,o,e)))},st=(t,e)=>rt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),rt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,it=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const s=N(e),r=f.get(s);if(!d.document)return s;if(t=11===t.nodeType?t:d.document,r)if("string"==typeof r){let l,i=C.get(t=t.head||t);if(i||C.set(t,i=new Set),!i.has(s)){l=d.document.createElement("style"),l.textContent=r;const c=null!=(n=p.A)?n:M(d.document);if(null!=c&&l.setAttribute("nonce",c),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(m){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(r),v?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=r+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=C.get(t);if(e||C.set(t,e=new Set),!e.has(s)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(r.constructor===n.CSSStyleSheet)o=r;else{o=new n.CSSStyleSheet;for(let t=0;t<r.cssRules.length;t++)o.insertRule(r.cssRules[t].cssText,t)}v?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);ct(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ut(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},ct=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,s=t.T||H(null,null),r=(t=>t&&t.S===L)(e)?e:T(null,null,e);if(E=o.tagName,n&&r.v)for(const t of Object.keys(r.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.v[t]=o[t]);r.S=null,r.u|=4,t.T=r,r.O=s.O=o.shadowRoot||o,Z=!(!(1&l.u)||128&l.u),tt(s,r,n)})(t,e,o)}catch(e){c(e,t.$hostElement$)}return null},ut=t=>{const e=t.$hostElement$,n=t.i,o=t.C;ft(n,"componentDidRender",void 0,e),64&t.u?ft(n,"componentDidUpdate",void 0,e):(t.u|=64,dt(e),ft(n,"componentDidLoad",void 0,e),t.H(e),o||at()),t.L(e),t.M&&(t.M(),t.M=void 0),512&t.u&&O((()=>ot(t,!1))),t.u&=-517},at=()=>{O((()=>z(d,"appload",{detail:{namespace:"gpds-pattern-web"}})))},ft=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){c(t,o)}},dt=t=>t.classList.add("hydrated"),pt=(t,e)=>s(t).l.get(e),ht=(t,e,n,o)=>{const l=s(t);if(!l)return;if(!l)throw Error(`Couldn't find host element for "${o.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=l.l.get(e),i=l.u,c=l.i;if(n=P(n,o.t[e][0]),(!(8&i)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(l.l.set(e,n),2&i)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(n,r,e)&&!(16&i))return;16&i||ot(l,!1)}},mt=(t,e,o)=>{var l,r;const i=t.prototype;if(e.t){const c=Object.entries(null!=(l=e.t)?l:{});if(c.map((([t,[l]])=>{if(31&l||2&o&&32&l){const{get:r,set:c}=n(i,t)||{};r&&(e.t[t][0]|=2048),c&&(e.t[t][0]|=4096),(1&o||!r)&&Object.defineProperty(i,t,{get(){{if(!(2048&e.t[t][0]))return pt(this,t);const n=s(this);return n?n.i?n.i[t]:pt(this,t):i[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(i,t,{set(n){const r=s(this);if(r){if(c)return void 0===(32&l?this[t]:r.$hostElement$[t])&&r.l.get(t)&&(n=r.l.get(t)),c.call(this,P(n,l)),void ht(this,t,n=32&l?this[t]:r.$hostElement$[t],e);{if(!(1&o&&4096&e.t[t][0]))return void ht(this,t,n,e);const s=P(n,l);if(r.i){const n=r.i[t];!r.l.get(t)&&n&&r.l.set(t,n),r.i[t]=s,ht(this,t,r.i[t],e)}else r.l.set(t,s)}}}})}else 1&o&&64&l&&Object.defineProperty(i,t,{value(...e){var n;const o=s(this);return null==(n=null==o?void 0:o.P)?void 0:n.then((()=>{var n;return null==(n=o.i)?void 0:n[t](...e)}))}})})),1&o){const n=new Map;i.attributeChangedCallback=function(t,o,l){p.jmp((()=>{var r;const u=n.get(t),a=s(this);if(this.hasOwnProperty(u)&&(l=this[u],delete this[u]),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==l)return;if(null==u){const n=null==a?void 0:a.u;if(a&&n&&!(8&n)&&l!==o){const s=a.i,i=null==(r=e.R)?void 0:r[t];null==i||i.forEach((e=>{const[[r,i]]=Object.entries(e);null!=s[r]&&(128&n||1&i)&&s[r].call(s,l,o,t)}))}return}const f=c.find((([t])=>t===u)),d=4&(f?f[1][0]:0),p=d&&null===l&&void 0===this[u];d&&(l=null!==l&&"false"!==l);const h=Object.getOwnPropertyDescriptor(i,u);p||l==this[u]||h.get&&!h.set||(this[u]=l)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=e.R)?r:{}),...c.filter((([t,e])=>31&e[0])).map((([t,e])=>{const o=e[1]||t;return n.set(o,t),o}))]))}}return t},vt=async(t,e,n)=>{var o;let l;try{if(!(32&e.u)){if(e.u|=32,e.u&=-1025,n.D){const s=((t,e)=>{var n;const o=t.h.replace(/-/g,"_"),l=t.D;if(!l)return;const s=u.get(l);if(s)return s[o];const r=null!=(n=a.get(l))?n:0,i=[r>0?"s-retry="+r:"",""].filter(Boolean).join("&");
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
3
+ return import(`./${l}.entry.js${i?"?"+i:""}`).then((t=>(a.delete(l),u.set(l,t),t[o])),(t=>{a.set(l,r+1),c(t,e.$hostElement$)}))})(n,e);if(s&&"then"in s){const t=()=>{};l=await s,t()}else l=s;if(!l)throw e.u&=-33,e.U=(null!=(o=e.U)?o:0)+1,e.U<3&&(e.u|=1024),Error(`Constructor for "${n.h}#${e.W}" was not found`);l.isProxied||(mt(l,n,2),l.isProxied=!0);const r=()=>{};e.u|=8;try{new l(e)}catch(e){c(e,t)}e.u&=-9,((t,e)=>{var n;const o=t.i;if(o)for(const[l,[s]]of Object.entries(null!=(n=e.t)?n:{}))if(4096&s&&t.l.has(l)){const e=t.l.get(l);o[l]!==e&&(o[l]=e)}})(e,n),r(),bt(e.i,t)}else l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(l&&l.style){let t;"string"==typeof l.style&&(t=l.style);const e=N(n);if(!f.has(e)){const o=()=>{};((t,e,n)=>{let o=f.get(t);m&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,f.set(t,o)})(e,t,!!(1&n.u)),o()}}}const s=e.C,r=()=>ot(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()}catch(n){c(n,t),e.M&&(e.M(),e.M=void 0),!e.H||1024&e.u||e.H(t)}},bt=(t,e)=>{ft(t,"connectedCallback",void 0,e)},yt=(t,e)=>{ft(t,"disconnectedCallback",void 0,e||t)},$t=(t,e={})=>{var n;if(!d.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const o=[],l=e.exclude||[],r=d.customElements,i=d.document.head,c=i.querySelector("meta[charset]"),u=d.document.createElement("style"),a=[];let f,h=!0;if(Object.assign(p,e),p.p=new URL(e.resourcesUrl||"./",d.document.baseURI).href,t.map((t=>{t[1].map((e=>{const n={u:e[0],h:e[1],t:e[2],F:e[3]};n.t=e[2];const i=n.h,c=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,V:new Map};n.P=new Promise((t=>n.L=t)),n.q=new Promise((t=>n.H=t)),t["s-p"]=[],t["s-rc"]=[],n.N=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,n),1&n.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${n.h}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else x.call(t,n)}connectedCallback(){s(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),f&&(clearTimeout(f),f=null),h?a.push(this):p.jmp((()=>(t=>{if(!(1&p.u)){const e=s(t);if(!e)return;const n=e.o,o=()=>{};if(1&e.u)(null==e?void 0:e.i)?bt(e.i,t):1024&e.u?setTimeout((()=>vt(t,e,n)),1e3):(null==e?void 0:e.q)&&e.q.then((()=>bt(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){nt(e,e.C=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),vt(t,e,n)}o()}})(this))))}disconnectedCallback(){p.jmp((()=>(async t=>{if(!(1&p.u)){const e=s(t);(null==e?void 0:e.i)?yt(e.i,t):(null==e?void 0:e.q)&&e.q.then((()=>yt(e.i,t)))}C.has(t)&&C.delete(t),t.shadowRoot&&C.has(t.shadowRoot)&&C.delete(t.shadowRoot)})(this))),O((()=>{var t;const e=s(this);if(!e)return;const n=a.findIndex((t=>t===this));n>-1&&a.splice(n,1),(null==(t=null==e?void 0:e.T)?void 0:t.O)instanceof Node&&!e.T.O.isConnected&&delete e.T.O}))}componentOnReady(){var t;return null==(t=s(this))?void 0:t.q}};n.D=t[0],l.includes(i)||r.get(i)||(o.push(i),r.define(i,mt(c,n,1)))}))})),o.length>0&&(u.textContent+=o.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",u.innerHTML.length)){u.setAttribute("data-styles","");const t=null!=(n=p.A)?n:M(d.document);null!=t&&u.setAttribute("nonce",t),i.insertBefore(u,c?c.nextSibling:i.firstChild)}h=!1,a.length?a.map((t=>t.connectedCallback())):p.jmp((()=>f=setTimeout(at,30)))},wt=t=>p.A=t;export{L as H,R as a,$t as b,D as c,t as g,T as h,h as p,r,wt as s}
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1,21 @@
1
+ import { UdsSlimmer } from '../../../slimmer';
2
+ /**
3
+ * Persistence of the remembered identifier.
4
+ *
5
+ * Isolated because it is the one place the pattern touches storage, and storage
6
+ * can fail for reasons that have nothing to do with signing in — private
7
+ * browsing, blocked cookies, a strict enterprise policy. Those failures are
8
+ * swallowed deliberately: remembering an email address is a convenience, never
9
+ * a precondition for authenticating.
10
+ */
11
+ export declare class IdentityMemorySlimmer extends UdsSlimmer {
12
+ /** Storage key for the remembered identifier; empty disables persistence. */
13
+ private readonly rememberStorageKey;
14
+ /** Explicit identifier set by the host, which wins over any stored value. */
15
+ private readonly identifier;
16
+ /** The identifier the card should start with. */
17
+ initialIdentifier(): string;
18
+ private read;
19
+ /** Stores or clears the identifier according to the user's choice. */
20
+ remember(identifier: string, remember: boolean): void;
21
+ }
@@ -0,0 +1,100 @@
1
+ import { UdsSlimmer } from '../../../slimmer';
2
+ import { UdsMfaMethod } from '../../../providers/auth-provider';
3
+ import { UdsLoginStep } from '../../../utils/types';
4
+ import { StepCapabilities } from '../view-model/login-step.view-model';
5
+ /**
6
+ * The login state machine.
7
+ *
8
+ * This is the pattern's core asset: the translation from "what the identity
9
+ * platform needs next" into "what the user sees next". Keeping it in one class,
10
+ * away from markup and input plumbing, is what makes the sequencing reviewable.
11
+ *
12
+ * Every decision it makes passes through the host's `controlStrategy` first, so
13
+ * a consumer can redirect the flow without reimplementing it.
14
+ */
15
+ export declare class LoginWorkflowSlimmer extends UdsSlimmer {
16
+ private readonly resend;
17
+ private readonly memory;
18
+ private readonly udsLoginStepChange;
19
+ private readonly udsLoginError;
20
+ private readonly udsLoginSuccess;
21
+ private readonly auth?;
22
+ private readonly controlStrategy?;
23
+ private readonly initialStep;
24
+ private readonly otpLength;
25
+ private readonly copy;
26
+ protected step: UdsLoginStep;
27
+ protected busy: boolean;
28
+ protected errorText?: string;
29
+ protected methods: UdsMfaMethod[];
30
+ protected otpMethodLabel?: string;
31
+ protected destination?: string;
32
+ protected unlockMinutes?: number;
33
+ protected values: Record<string, string | boolean>;
34
+ /** The identifier being authenticated, carried across steps. */
35
+ private pendingIdentifier;
36
+ /**
37
+ * How many characters the OTP step expects, once a provider has told us.
38
+ * Held apart from `values` because `resetStepState` blanks the collected
39
+ * input on every step change and must not lose the provider's chosen length.
40
+ */
41
+ private otpCount?;
42
+ start(): void;
43
+ /** Returns the workflow to its first step and clears all collected input. */
44
+ restart(): Promise<void>;
45
+ /**
46
+ * Which affordances to render. The presence of an optional provider method
47
+ * *is* the configuration, so a route can never be offered for something the
48
+ * backend cannot service.
49
+ */
50
+ get capabilities(): StepCapabilities;
51
+ /** In-workflow navigation, triggered by a link in the card. */
52
+ navigateTo(step: UdsLoginStep): void;
53
+ /**
54
+ * Performs a transition, giving the strategy its say on every step change —
55
+ * including the ones the workflow initiates for itself.
56
+ */
57
+ private applyTransition;
58
+ private setStep;
59
+ /** Clears per-step input, seeding the identifier field where appropriate. */
60
+ private resetStepState;
61
+ /** How many characters the passcode entry should render. */
62
+ get codeLength(): number;
63
+ /**
64
+ * Translates a provider result into the next step. This inversion is what
65
+ * makes the pattern a pattern: the identity platform reports what it needs,
66
+ * and the card — not the consumer — decides what that looks like.
67
+ */
68
+ private applyResult;
69
+ private defaultTransitionFor;
70
+ /** Captures the data a result carries, independent of where the flow goes. */
71
+ private stageResultState;
72
+ private showError;
73
+ /**
74
+ * Wraps a provider call with the in-flight guard and the network catch.
75
+ *
76
+ * `busy` is released *before* the result is applied, because applying a
77
+ * result may legitimately chain another provider call (auto-selecting a lone
78
+ * MFA method, for example). Holding the guard across `applyResult` would make
79
+ * that continuation a no-op and strand the user on the previous step. The
80
+ * chained call re-acquires the guard synchronously, so no un-busy frame is
81
+ * ever painted.
82
+ *
83
+ * Every provider response is validated here, at the one point where data
84
+ * crosses into the pattern from a consumer's adapter. See `parseAuthResult`.
85
+ */
86
+ private run;
87
+ private selectMfaMethod;
88
+ resendCode(): Promise<void>;
89
+ /**
90
+ * Submits the current step.
91
+ *
92
+ * The strategy wraps the whole provider call, so a consumer can gate it
93
+ * (CAPTCHA, device check, consent) or answer it outright without the pattern
94
+ * needing a dedicated prop for each case.
95
+ */
96
+ submit(): Promise<void>;
97
+ private rememberIdentifierIfRequested;
98
+ private callProvider;
99
+ private str;
100
+ }
@@ -0,0 +1,44 @@
1
+ import { VNode } from '../../../../stencil-public-runtime';
2
+ import { UdsSlimmer } from '../../../../slimmer';
3
+ import { UdsPatternLoginCard } from '../../uds-pattern-login-card';
4
+ import { LoginStepRenderer } from './login-step-renderer';
5
+ /**
6
+ * Renders the card's body — heading, description, error, form and the terminal
7
+ * outcome — and delegates the step's own controls to {@link LoginStepRenderer}.
8
+ *
9
+ * ## Why a renderer slimmer, and not the `view/` modules this replaces
10
+ *
11
+ * This is the same Slimmer mechanism the stateful layer already uses, pointed
12
+ * at rendering: one class, one responsibility, bound to the component by field
13
+ * mapping rather than by parameter passing. Vega applies the convention the
14
+ * same way — `slimmers/renderers/<name>-renderer.tsx`, a class ending in
15
+ * `Renderer`, exposing `render()` — so a reader moving between the design
16
+ * system and the pattern library meets one structure, not two.
17
+ *
18
+ * The gain over free functions is the binding. A free function has to be handed
19
+ * everything it needs on each call, so its signature grows with its appetite
20
+ * and callers thread arguments through layers that never use them — which is
21
+ * exactly what the old `StepViewModel` parameter had become.
22
+ * `@MapToComponentField()` reaches the component's `viewModel` and `handlers`
23
+ * directly, and types them by indexing the component class, so a renderer
24
+ * cannot drift out of step with what the component actually exposes: rename the
25
+ * getter and this stops compiling.
26
+ *
27
+ * Renderers only read. Every mutation goes back through `handlers`, into the
28
+ * workflow slimmer, and through the control strategy's checkpoints.
29
+ *
30
+ * ## What stays behind in the component
31
+ *
32
+ * `render()` itself and both `<slot>` elements remain in `UdsPatternLoginCard`. Stencil
33
+ * reads slots out of the component's source statically when it compiles, so a
34
+ * slot that only existed inside a slimmer would never be registered.
35
+ */
36
+ export declare class LoginCardRenderer extends UdsSlimmer {
37
+ protected steps: LoginStepRenderer;
38
+ protected readonly viewModel: UdsPatternLoginCard['viewModel'];
39
+ protected readonly handlers: UdsPatternLoginCard['handlers'];
40
+ render(): VNode[];
41
+ private form;
42
+ /** Terminal steps render no form; `check-email` still offers a way back. */
43
+ private terminalBody;
44
+ }
@@ -0,0 +1,91 @@
1
+ import { VNode } from '../../../../stencil-public-runtime';
2
+ import { UdsSlimmer } from '../../../../slimmer';
3
+ import { InputAutocompleteTypes, InputType } from '@globalpayments/vega/dist/types/components/vega-input/types';
4
+ import { UdsPatternLoginCard } from '../../uds-pattern-login-card';
5
+ import { LoginCardHandlers } from '../../view-model/login-card-handlers';
6
+ export interface MethodOption {
7
+ id: string;
8
+ label: string;
9
+ description?: string;
10
+ disabled?: boolean;
11
+ }
12
+ export interface TextFieldOptions {
13
+ name: string;
14
+ label: string;
15
+ type?: InputType;
16
+ /**
17
+ * Required rather than defaulted. Browser autofill is the difference between
18
+ * a password manager working and silently not, and `'off'` is a decision —
19
+ * not something a field should inherit by saying nothing.
20
+ */
21
+ autocomplete: InputAutocompleteTypes;
22
+ /** Field must equal the named sibling's value — used for the password pairing. */
23
+ mustMatch?: string;
24
+ }
25
+ /**
26
+ * Renders the individual form controls, composed from Vega design-system
27
+ * elements rather than raw HTML.
28
+ *
29
+ * ## Why these are Vega elements and not our own markup
30
+ *
31
+ * A pattern's job is workflow choreography; the look, the focus ring, the label
32
+ * association, the error presentation and the contrast ratios are the design
33
+ * system's job. Hand-rolling an `<input>` here would fork all of that: the DS
34
+ * could ship an accessibility fix to `vega-input` and this card would never
35
+ * receive it. Composing the DS element instead means the pattern inherits those
36
+ * guarantees — and keeps inheriting them.
37
+ *
38
+ * It is the same principle that led us to withdraw `::part` (ADR 0003), applied
39
+ * from the inside: we do not override design-system guardrails, and we do not
40
+ * quietly re-implement them either.
41
+ *
42
+ * Note how much behaviour this removes. `vega-input` carries its own password
43
+ * reveal affordance, so the card no longer tracks a `revealSecret` flag or
44
+ * renders an eye icon.
45
+ */
46
+ export declare class LoginFieldRenderer extends UdsSlimmer {
47
+ protected readonly viewModel: UdsPatternLoginCard['viewModel'];
48
+ protected readonly handlers: UdsPatternLoginCard['handlers'];
49
+ /**
50
+ * Rule instances are built once and kept.
51
+ *
52
+ * `validationRules` is a watched Vega prop, so handing it a freshly built
53
+ * array on every render would re-register the rules each time any unrelated
54
+ * state moved. These close over `this.viewModel`, which the slimmer re-reads
55
+ * from the component, so a single stable instance always evaluates against
56
+ * current state.
57
+ */
58
+ private readonly matchRules;
59
+ private readonly completeCode;
60
+ /** One rule per pairing, memoised so the array identity is stable per field. */
61
+ private matchRuleFor;
62
+ /** A labelled text input bound to a collected value. */
63
+ textField(options: TextFieldOptions): VNode;
64
+ /** The passcode entry for the OTP step. */
65
+ passcodeField(): VNode;
66
+ /** A checkbox bound to a collected boolean. */
67
+ checkbox(name: string, label: string): VNode;
68
+ /** The step's primary action. */
69
+ submit(label: string): VNode;
70
+ /**
71
+ * An inline textual action.
72
+ *
73
+ * `eventful` stops `vega-button-link` from navigating on its own so the
74
+ * workflow — not the browser — decides what the click means.
75
+ */
76
+ link(label: string, onClick: (event: Event) => void): VNode;
77
+ /**
78
+ * The MFA method chooser, as a design-system selection-tile group.
79
+ *
80
+ * The group — not the individual tiles — is the component Vega expects to be
81
+ * composed: it owns the radio `name`, the selected `value`, the change event
82
+ * and the group's accessible labelling. Rendering loose `vega-selection-tile`
83
+ * elements inside a plain `role="radiogroup"` div looked correct and even
84
+ * behaved correctly, but threw inside Vega's runtime when the tiles
85
+ * unmounted, because each tile reaches for a group ancestor that was not
86
+ * there.
87
+ */
88
+ methodGroup(methods: MethodOption[], label: string): VNode;
89
+ }
90
+ /** Keeps the renderer's dependency on the handlers contract visible. */
91
+ export type LoginFieldRendererHandlers = LoginCardHandlers;
@@ -0,0 +1,40 @@
1
+ import { VNode } from '../../../../stencil-public-runtime';
2
+ import { UdsSlimmer } from '../../../../slimmer';
3
+ import { UdsPatternLoginCard } from '../../uds-pattern-login-card';
4
+ import { LoginFieldRenderer } from './login-field-renderer';
5
+ /**
6
+ * Renders the body of whichever step the workflow is on.
7
+ *
8
+ * ## Why a renderer slimmer
9
+ *
10
+ * This is the same Slimmer mechanism the stateful layer uses, pointed at
11
+ * rendering: one class, one responsibility, bound to the component by field
12
+ * mapping rather than by parameter passing. Vega applies the convention the
13
+ * same way — `slimmers/renderers/<name>-renderer.tsx`, a class ending in
14
+ * `Renderer`, exposing `render()` — so a reader moving between the design
15
+ * system and the pattern library meets one structure, not two.
16
+ *
17
+ * The gain over the plain `view/` modules this replaces is the binding. A free
18
+ * function has to be handed everything it needs on each call, so its signature
19
+ * grows with its appetite and callers thread arguments through layers that do
20
+ * not use them. `@MapToComponentField()` reaches the component's `viewModel`
21
+ * and `handlers` directly, and types them by indexing the component class, so
22
+ * the renderer cannot drift out of step with what the component actually
23
+ * exposes — rename the getter and this stops compiling.
24
+ *
25
+ * Renderers only read. Every mutation goes back through `handlers`, into the
26
+ * workflow slimmer, and through the control strategy's checkpoints.
27
+ */
28
+ export declare class LoginStepRenderer extends UdsSlimmer {
29
+ protected fields: LoginFieldRenderer;
30
+ protected readonly viewModel: UdsPatternLoginCard['viewModel'];
31
+ protected readonly handlers: UdsPatternLoginCard['handlers'];
32
+ render(): VNode[];
33
+ private identifierStep;
34
+ private passwordStep;
35
+ private mfaMethodStep;
36
+ private otpStep;
37
+ private forgotStep;
38
+ private resetPasswordStep;
39
+ private signUpStep;
40
+ }
@@ -0,0 +1,21 @@
1
+ import { UdsSlimmer } from '../../../slimmer';
2
+ /**
3
+ * The resend throttle and its countdown.
4
+ *
5
+ * Small, but exactly the kind of thing that disappears into a large component
6
+ * and then gets subtly broken: an interval that must be cleared on disconnect,
7
+ * and a tick that must drive a re-render.
8
+ */
9
+ export declare class ResendThrottleSlimmer extends UdsSlimmer {
10
+ /** When resending becomes allowed again. Undefined means "allowed now". */
11
+ private resendAt?;
12
+ /** Advanced once a second so the countdown re-renders. */
13
+ private nowTick;
14
+ private timer?;
15
+ /** Begins a throttle window. A missing or non-positive duration clears it. */
16
+ start(resendAfterMs?: number): void;
17
+ stop(): void;
18
+ /** Seconds left on the throttle; zero when resending is allowed. */
19
+ get secondsRemaining(): number;
20
+ get canResend(): boolean;
21
+ }
@@ -0,0 +1,134 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { UdsLoginActionDetail, UdsLoginErrorDetail, UdsLoginLabels, UdsLoginStep, UdsLoginStepChangeDetail } from '../../utils/types';
3
+ import { UdsAuthProvider, UdsMfaMethod, UdsSession } from '../../providers/auth-provider';
4
+ import { UdsLoginControlStrategy } from '../../providers/control-strategy';
5
+ import { UdsLoginConfig } from '../../providers/login-config';
6
+ import { LoginWorkflowSlimmer } from './slimmers/login-workflow.slimmer';
7
+ import { ResendThrottleSlimmer } from './slimmers/resend-throttle.slimmer';
8
+ import { IdentityMemorySlimmer } from './slimmers/identity-memory.slimmer';
9
+ import { LoginCardRenderer } from './slimmers/renderers/login-card-renderer';
10
+ import { LoginStepViewModel } from './view-model/login-step.view-model';
11
+ import { LoginCardHandlers } from './view-model/login-card-handlers';
12
+ /**
13
+ * The GP login workflow, as a single pattern.
14
+ *
15
+ * Unlike a design-system component, this pattern **owns the workflow**: step
16
+ * sequencing, in-flight state, failure copy, resend throttling, lockout
17
+ * messaging, back-navigation, focus movement and identifier persistence all
18
+ * live inside the card. A consuming product does not implement any of it.
19
+ *
20
+ * Two aggregate seams are all a consumer wires:
21
+ *
22
+ * - **`auth`** — a `UdsAuthProvider` adapter saying *what the identity platform
23
+ * needs next*. The pattern decides what that looks like.
24
+ * - **`controlStrategy`** — an optional `UdsLoginControlStrategy` that intercepts
25
+ * every checkpoint in the workflow, for the cases where the course of the flow
26
+ * itself needs to change.
27
+ *
28
+ * ```ts
29
+ * card.auth = createAuthProvider({
30
+ * signIn: ({ identifier, password }) => oktaSdk.authn(identifier, password),
31
+ * verifyOtp: ({ code }) => oktaSdk.verifyFactor(code),
32
+ * });
33
+ * ```
34
+ *
35
+ * Which optional methods the adapter implements is also the configuration:
36
+ * implement `signUp` and the sign-up route appears; omit `requestPasswordReset`
37
+ * and no recovery link is rendered.
38
+ *
39
+ * This class deliberately holds only props, events, state and the render shell.
40
+ * Behaviour lives in slimmers (`./slimmers`), markup in renderer slimmers
41
+ * (`./slimmers/renderers`) and derivation in `./view-model` — see
42
+ * `src/slimmer/README.md`.
43
+ *
44
+ * @slot brand - Optional branding (logo, product name) rendered above the heading.
45
+ * @slot footer - Replaces the default help footer.
46
+ */
47
+ export declare class UdsPatternLoginCard {
48
+ hostEl: HTMLElement;
49
+ workflow: LoginWorkflowSlimmer;
50
+ resend: ResendThrottleSlimmer;
51
+ memory: IdentityMemorySlimmer;
52
+ renderer: LoginCardRenderer;
53
+ /**
54
+ * Everything that cannot be expressed as an attribute: the `auth` adapter,
55
+ * the `control` strategy and any `labels` overrides.
56
+ *
57
+ * The split is mechanical rather than a matter of taste — see
58
+ * `UdsLoginConfig`. Scalars below are attributes because they can be;
59
+ * objects and functions are gathered here because they cannot be.
60
+ *
61
+ * Also accepts a JSON string, so the `labels` member alone can be set from
62
+ * plain HTML markup.
63
+ */
64
+ config: UdsLoginConfig | string;
65
+ /** The step the workflow starts on. */
66
+ initialStep: UdsLoginStep;
67
+ /** Pre-populates the identifier field, overriding any remembered value. */
68
+ identifier: string;
69
+ /** Default number of digit inputs, when the provider does not specify one. */
70
+ otpLength: number;
71
+ /**
72
+ * Where the "Remember my email" value is persisted. Set to an empty string to
73
+ * disable persistence entirely.
74
+ */
75
+ rememberStorageKey: string;
76
+ /** Renders the "Need help signing in?" footer. */
77
+ showHelpFooter: boolean;
78
+ /** Emitted once the provider reports successful authentication. */
79
+ udsLoginSuccess: EventEmitter<{
80
+ session?: UdsSession;
81
+ }>;
82
+ /** Emitted whenever the workflow moves to a different step. */
83
+ udsLoginStepChange: EventEmitter<UdsLoginStepChangeDetail>;
84
+ /** Emitted when the provider reports a failure, after the card has displayed it. */
85
+ udsLoginError: EventEmitter<UdsLoginErrorDetail>;
86
+ /**
87
+ * Emitted for the two intents the pattern cannot resolve — the help links.
88
+ * In-workflow navigation is handled internally and is not reported here.
89
+ */
90
+ udsLoginAction: EventEmitter<UdsLoginActionDetail>;
91
+ step: UdsLoginStep;
92
+ busy: boolean;
93
+ errorText?: string;
94
+ methods: UdsMfaMethod[];
95
+ otpMethodLabel?: string;
96
+ destination?: string;
97
+ unlockMinutes?: number;
98
+ resendAt?: number;
99
+ nowTick: number;
100
+ values: Record<string, string | boolean>;
101
+ private lastRenderedStep?;
102
+ componentWillLoad(): void;
103
+ disconnectedCallback(): void;
104
+ componentDidRender(): void;
105
+ /**
106
+ * Returns the workflow to its first step and clears all collected input.
107
+ * Useful after a sign-out, or to recover from a terminal step.
108
+ */
109
+ reset(): Promise<void>;
110
+ /** The resolved configuration, accepting a JSON string for HTML consumers. */
111
+ get resolvedConfig(): UdsLoginConfig;
112
+ /** The authentication seam. Read by the workflow slimmer. */
113
+ get auth(): UdsAuthProvider | undefined;
114
+ /** The control seam. Read by the workflow slimmer at each checkpoint. */
115
+ get controlStrategy(): UdsLoginControlStrategy | undefined;
116
+ /** Merged copy. Read by the slimmers as well, for error text. */
117
+ get copy(): UdsLoginLabels;
118
+ /**
119
+ * Everything the renderers need to draw the current step, and nothing else.
120
+ *
121
+ * Derivation happens in one place — `LoginStepViewModel.from` — rather than
122
+ * being assembled inline in `render()`, so it can be tested without a DOM and
123
+ * reviewed without reading JSX.
124
+ */
125
+ get viewModel(): LoginStepViewModel;
126
+ /**
127
+ * The intents a renderer may raise. Held as one stable object — not rebuilt
128
+ * per render — so that binding to it from a slimmer is a fixed reference and
129
+ * the data half of the contract stays free of behaviour.
130
+ */
131
+ readonly handlers: LoginCardHandlers;
132
+ private focusFirstControl;
133
+ render(): any;
134
+ }