@descope/web-components-ui 1.0.313 → 1.0.315

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1842],{73878:(t,e,i)=>{i.d(e,{P:()=>a});var n=i(2061),r=i(94978),o=i(33346);const a=(...t)=>(0,n.qC)(r.wX,r.li,r.QT,r.mE)((0,o.s)(...t))},60395:(t,e,i)=>{i.d(e,{f:()=>p,o:()=>g});var n=i(54567),r=i(2061),o=i(94978),a=i(85857),s=i(19876),l=i(54201),d=i(2886);const p=(0,n.iY)("new-password"),c=d.S.cssVarList,{host:u,label:h,internalInputsWrapper:b,errorMessage:v,helperText:m,passwordInput:y,policyPreview:f}={host:{selector:()=>":host"},label:{selector:"::part(label)"},internalInputsWrapper:{selector:"descope-new-password-internal .wrapper"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},passwordInput:{selector:"descope-password"},policyPreview:{selector:"descope-policy-validation"}},g=(0,r.qC)((0,o.yk)({mappings:{fontSize:[u,{},{selector:s.v.componentName,property:s.v.cssVarList.fontSize}],fontFamily:[h,v,m],errorMessageTextColor:{...v,property:"color"},hostWidth:{...u,property:"width"},hostMinWidth:{...u,property:"min-width"},hostDirection:[{...u,property:"direction"},{...y,property:s.v.cssVarList.hostDirection}],inputsRequiredIndicator:{...u,property:"content"},spaceBetweenInputs:{...b,property:"gap"},policyPreviewBackgroundColor:{...f,property:c.backgroundColor},policyPreviewPadding:{...f,property:c.padding}}}),o.e4,(0,o.dj)({proxyProps:["value","selectionStart"]}),(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${a.f}\n\t\t\t\tname="new-password"\n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${a.f}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(a.f),(0,n.oP)(this,this.inputElement,{includeAttrs:["password-label","password-placeholder","confirm-label","confirm-placeholder","full-width","size","bordered","label","has-confirm","invalid","readonly","draggable","has-validation","policy-label","active-policies","available-policies","data-password-policy-value-minlength"]})}}))((0,o.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-block;\n\t\t\tmax-width: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n :host ::part(error-message) {\n direction: ltr;\n }\n\t\t${(0,l.bi)(s.v.cssVarList)}\n\t\tvaadin-text-field {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tmin-height: 0;\n\t\t\tbackground: transparent;\n\t\t\tbox-shadow: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field::part(input-field)::after {\n\t\t\tbackground: transparent;\n\t\t\topacity: 0;\n\t\t}\n\t\tdescope-new-password-internal {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\twidth: 100%;\n\t\t\tpadding: 0;\n\t\t}\n\t\tdescope-new-password-internal > .wrapper {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t\tdescope-password {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t}\n\t\tdescope-new-password-internal vaadin-password-field::before {\n\t\t\theight: initial;\n\t\t}\n descope-policy-validation {\n margin-top: 8px;\n display: flex;\n }\n descope-policy-validation.hidden {\n display: none;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:p}))},85857:(t,e,i)=>{i.d(e,{f:()=>n});const n=(0,i(54567).iY)("new-password-internal")},1545:(t,e,i)=>{i.r(e);var n=i(73878),r=i(54567),o=i(60395),a=i(85857);const s=/^password-/,l=/^confirm-/,d=(t,e)=>t.replace(e,""),p=["password-label","password-placeholder"],c=["confirm-label","confirm-placeholder"],u=["disabled","bordered","size","full-width","maxlength","invalid","readonly","draggable","autocomplete"],h=[].concat(u,p,c,["has-validation"]),b=(0,n.P)({componentName:a.f,baseSelector:"div"});customElements.define(a.f,class extends b{static get observedAttributes(){return["has-confirm"].concat(b.observedAttributes||[],h)}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper"></div>\n\t\t',this.wrapperEle=this.querySelector(".wrapper")}get value(){return this.passwordInput?.value||""}set value(t){t!==this.value&&(this.value=t)}get hasConfirm(){return"true"===this.getAttribute("has-confirm")}get hasValidation(){return"true"===this.getAttribute("has-validation")}getValidity(){if(!this.policyPanel.isValid)return{patternMismatch:!0};if(this.isRequired&&!this.value)return{valueMissing:!0};if(this.hasConfirm&&this.confirmInput&&this.value!==this.confirmInput.value)return{patternMismatch:!0};const t=this.getAttribute("minlength"),e=parseInt(t,10)||0;return this.value.length>=e?{}:{tooShort:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.passwordInput.focus()})),super.init?.(),this.renderInputs(this.hasConfirm,this.hasValidation)}renderInputs(t,e){let i=`\n <div>\n <descope-password data-id="password"></descope-password>\n <descope-policy-validation class="${e?"hidden":""}"></descope-policy-validation>\n </div>\n `;t&&(i+='<descope-password data-id="confirm"></descope-password>'),this.wrapperEle.innerHTML=i,this.passwordInput=this.querySelector('[data-id="password"]'),this.confirmInput=this.querySelector('[data-id="confirm"]'),this.policyPanel=this.querySelector("descope-policy-validation"),this.inputs=[this.passwordInput,this.confirmInput],this.initInputs(),[...p,...c,...u].forEach((t=>{this.attributeChangedCallback(t,null,this.getAttribute(t))})),this.passwordInput.addEventListener("input",(t=>{this.policyPanel.setAttribute("value",t.target.value)})),(0,r.oP)(this,this.policyPanel,{includeAttrs:["policy-label","available-policies","active-policies","data-password-policy-value-minlength"],mapAttrs:{"policy-label":"label","available-policies":"data"}})}handleIndicatorStyle(){this.inputs.forEach((t=>{const e=document.createElement("style");e.innerHTML=`\n\t\t\t\t:host ::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${o.o.cssVarList.inputsRequiredIndicator});\n width: 1em;\n text-align: center;\n\t\t\t\t}\n :host ::part(required-indicator) {\n display: inline-flex;\n }\n\t\t\t\t`,t?.shadowRoot.appendChild(e)}))}get isInvalid(){return this.hasAttribute("invalid")&&"false"!==this.getAttribute("invalid")}handleInputsInvalidAttribute(){this.inputs.forEach((t=>{t&&(0,r.FX)(t,(e=>{if(e.includes("invalid")){const e=t.getAttribute("invalid"),i=this.getAttribute("invalid");this.isInvalid&&i!==e&&t.setAttribute("invalid","true")}}),{})}))}initInputs(){this.handleIndicatorStyle(),this.handleInputsInvalidAttribute(),this.handleFocusEventsDispatching(this.inputs)}toggleBooleanAttribute(t,e,i){null===i?t?.removeAttribute(e):t?.setAttribute(e,i)}hidePolicy(){this.policyPanel.classList.add("hidden")}showPolicy(){this.policyPanel.classList.remove("hidden")}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),e!==i&&("has-validation"===t?this.renderInputs(this.hasConfirm,"true"===i):"has-confirm"===t?this.renderInputs(null!==i&&"false"!==i,this.hasValidation):u.includes(t)?this.inputs.forEach((e=>this.toggleBooleanAttribute(e,t,i))):p.includes(t)?this.toggleBooleanAttribute(this.passwordInput,d(t,s),i):c.includes(t)&&this.toggleBooleanAttribute(this.confirmInput,d(t,l),i),"has-validation"===t&&("true"===i?this.showPolicy():this.hidePolicy()))}})},19876:(t,e,i)=>{i.d(e,{f:()=>l,v:()=>g});var n=i(94978),r=i(2061),o=i(54567),a=i(22702),s=i(54201);const l=(0,o.iY)("password"),{host:d,inputField:p,inputElement:c,inputElementPlaceholder:u,revealButtonContainer:h,revealButtonIcon:b,label:v,requiredIndicator:m,errorMessage:y,helperText:f}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:"> input:placeholder-shown"},revealButtonContainer:{selector:()=>"::part(reveal-button)"},revealButtonIcon:{selector:()=>"::part(reveal-button)::before"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},g=(0,r.qC)((0,n.yk)({mappings:{hostWidth:{...d,property:"width"},hostMinWidth:{...d,property:"min-width"},hostDirection:{...d,property:"direction"},fontSize:[{},d],fontFamily:[v,p,y,f],inputHeight:{...p,property:"height"},inputHorizontalPadding:[{...c,property:"padding-left"},{...c,property:"padding-right"}],inputBackgroundColor:{...p,property:"background-color"},inputBorderStyle:{...p,property:"border-style"},inputBorderWidth:{...p,property:"border-width"},inputBorderColor:{...p,property:"border-color"},inputBorderRadius:{...p,property:"border-radius"},inputOutlineColor:{...p,property:"outline-color"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputOutlineWidth:{...p,property:"outline-width"},labelTextColor:[{...v,property:"color"},{...m,property:"color"}],labelRequiredIndicator:{...m,property:"content"},errorMessageTextColor:{...y,property:"color"},inputValueTextColor:{...c,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},revealButtonOffset:[{...h,property:"margin-right"},{...h,property:"margin-left"}],revealButtonSize:{...h,property:"font-size"},revealButtonColor:{...b,property:"color"}}}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"]}),n.Ae,a.Z)((0,n.DM)({slots:["","suffix"],wrappedEleName:"vaadin-password-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,s.bi)(g.cssVarList)}\n\t\t\t${(0,s.Pd)("vaadin-password-field")}\n ${(0,s.Wf)("vaadin-password-field")}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tmin-height: 0;\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t}\n\t\t\tvaadin-password-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t[readonly] vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${g.cssVarList.inputOutlineColor});\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},22702:(t,e,i)=>{i.d(e,{Z:()=>n});const n=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable&&this.isReadOnly){const e=this.baseElement.querySelector("input"),i=e.getAttribute("type");e.setAttribute("type","text"),setTimeout((()=>e.focus()));const n=r=>{e.setAttribute("type",i),t.target.removeEventListener("mouseup",n),t.target.removeEventListener("dragend",n)};t.target.addEventListener("mouseup",n,{once:!0}),t.target.addEventListener("dragend",n,{once:!0})}})),super.init?.()}}},2886:(t,e,i)=>{i.d(e,{S:()=>y,f:()=>l});var n=i(94978),r=i(33346),o=i(2061),a=i(54567),s=i(27487);const l=(0,a.iY)("policy-validation"),d=["data","active-policies","overrides","data-password-policy-value-minlength"],p=["label","value",...d];class c extends((0,r.s)({componentName:l,baseSelector:":host > div"})){#t;#e=[];#i;static get observedAttributes(){return p}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="label"></div>\n <ul></ul>\n </div>\n <style>\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n </style>\n\t\t',this.panel=this.shadowRoot.querySelector(":host > div"),this.label=this.shadowRoot.querySelector(".label"),this.list=this.shadowRoot.querySelector("ul")}attributeChangedCallback(t,e,i){if(super.attributeChangedCallback?.(t,e,i),e!==i){if("label"===t&&this.updateLabel(i),d.includes(t)){if("data"===t)try{this.availablePolicies=JSON.parse(i)}catch{console.error("Failed to set available policies")}if("active-policies"===t&&(this.#e=(i||"").split(",")),"data-password-policy-value-minlength"===t){const t=Number(i);!Number.isNaN(t)&&t>0&&(this.#i={...this.#i,minlength:{value:`${t}`}})}}this.renderItems(this.#t,this.#e,this.#i)}}get availablePolicies(){return this.#t||[]}set availablePolicies(t){this.#t=t}get value(){return this.getAttribute("value")||""}validate(){let t=this.#t;return this.#i&&(t=this.#t.map((t=>this.#i[t.id]?{...t,data:this.#i[t.id]}:t))),this.#e.reduce(((e,i)=>{const n=t.find((t=>t.id===i));if(!n)return e;const{pattern:r,message:o,data:a}=n;if(!r||!o)return e;const l={valid:new RegExp((0,s.I)(r,a)).test(this.value),message:(0,s.I)(o,a),id:i};return e.push(l),e}),[])}get isValid(){return!this.validate().some((({valid:t})=>!1===t))}getValidationItemTemplate({valid:t,message:e}){return`\n <li class="item" data-valid="${this.value?t:"none"}">\n <span class="message">${e}</span>\n </li>\n `}renderItems(t,e){t&&e.length&&(this.list.innerHTML=this.validate().map(this.getValidationItemTemplate.bind(this)).join(""))}updateLabel(t){t?(this.label.innerHTML=t,this.classList.remove("hide-label")):(this.classList.add("hide-label"),this.label.innerHTML="")}}const{host:u,item:h,symbolDefault:b,symbolSuccess:v,symbolError:m}={host:{selector:()=>":host > div"},item:{selector:()=>".item"},symbolDefault:{selector:()=>'.item[data-valid="none"]::before'},symbolSuccess:{selector:()=>'.item[data-valid="true"]::before'},symbolError:{selector:()=>'.item[data-valid="false"]::before'}},y=(0,o.qC)((0,n.yk)({componentNameOverride:(0,a.iY)("input-wrapper")}),(0,n.yk)({mappings:{hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},padding:{},borderWidth:{...u,property:"border-width"},borderStyle:{...u,property:"border-style"},borderColor:{...u,property:"border-color"},borderRadius:{...u,property:"border-radius"},backgroundColor:{...u,property:"background-color"},textColor:{property:"color"},labelMargin:{...u,property:"gap"},itemsSpacing:{...h,property:"line-height"},itemSymbolSuccessColor:{...v,property:"color"},itemSymbolErrorColor:{...m,property:"color"},itemSymbolDefault:{...b,property:"content"},itemSymbolSuccess:{...v,property:"content"},itemSymbolError:{...m,property:"content"}}}),n.e4,n.Ae)(c)},27487:(t,e,i)=>{i.d(e,{I:()=>n});const n=(t,e)=>t.replace(/{{(\w+)+}}/g,((t,i)=>e?.[i]||t))},54201:(t,e,i)=>{i.d(e,{B:()=>p,DY:()=>l,PH:()=>d,Pd:()=>a,TX:()=>r,Wf:()=>u,bi:()=>n,jI:()=>s,jl:()=>o,wm:()=>c});const n=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,r=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,p=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,c=(t,e)=>`\n ${r(t)}\n ${a(t)}\n ${s(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${p(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,u=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1842],{73878:(t,e,n)=>{n.d(e,{P:()=>a});var i=n(2061),r=n(94978),o=n(33346);const a=(...t)=>(0,i.qC)(r.wX,r.li,r.QT,r.mE)((0,o.s)(...t))},60395:(t,e,n)=>{n.d(e,{f:()=>p,o:()=>f});var i=n(54567),r=n(2061),o=n(94978),a=n(85857),s=n(19876),l=n(54201),d=n(2886);const p=(0,i.iY)("new-password"),u=d.S.cssVarList,{host:c,label:h,internalInputsWrapper:b,errorMessage:m,helperText:v,passwordInput:y,policyPreview:g}={host:{selector:()=>":host"},label:{selector:"::part(label)"},internalInputsWrapper:{selector:"descope-new-password-internal .wrapper"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},passwordInput:{selector:"descope-password"},policyPreview:{selector:"descope-policy-validation"}},f=(0,r.qC)((0,o.yk)({mappings:{fontSize:[c,{},{selector:s.v.componentName,property:s.v.cssVarList.fontSize}],fontFamily:[h,m,v],errorMessageTextColor:{...m,property:"color"},hostWidth:{...c,property:"width"},hostMinWidth:{...c,property:"min-width"},hostDirection:[{...c,property:"direction"},{...y,property:s.v.cssVarList.hostDirection}],inputsRequiredIndicator:{...c,property:"content"},spaceBetweenInputs:{...b,property:"gap"},policyPreviewBackgroundColor:{...g,property:u.backgroundColor},policyPreviewPadding:{...g,property:u.padding}}}),o.e4,(0,o.dj)({proxyProps:["value","selectionStart"]}),(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${a.f}\n\t\t\t\tname="new-password"\n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t>\n </${a.f}>\n\t\t\t`,this.setAttribute("external-input","true"),this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(a.f),this.passwordInput=this.inputElement.querySelector('[data-id="password"]'),this.confirmInput=this.inputElement.querySelector('[data-id="confirm"]'),this.createExternalInput(this.passwordInput,"external-password-input"),this.createExternalInput(this.confirmInput,"external-confirm-input"),(0,i.oP)(this,this.inputElement,{includeAttrs:["password-label","password-placeholder","confirm-label","confirm-placeholder","full-width","size","bordered","label","has-confirm","invalid","readonly","draggable","has-validation","policy-label","active-policies","available-policies","data-password-policy-value-minlength"]})}createExternalInput(t,e){const n=t.querySelector("input"),i=document.createElement("slot"),r=n.getAttribute("slot");i.setAttribute("name",e),i.setAttribute("slot",r),t.appendChild(i),n.setAttribute("slot",e),n.setAttribute("data-hidden-input","true"),this.appendChild(n)}}))((0,o.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-block;\n\t\t\tmax-width: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n :host ::part(error-message) {\n direction: ltr;\n }\n\t\t${(0,l.bi)(s.v.cssVarList)}\n\t\tvaadin-text-field {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tmin-height: 0;\n\t\t\tbackground: transparent;\n\t\t\tbox-shadow: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field::part(input-field)::after {\n\t\t\tbackground: transparent;\n\t\t\topacity: 0;\n\t\t}\n\t\tdescope-new-password-internal {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\twidth: 100%;\n\t\t\tpadding: 0;\n\t\t}\n\t\tdescope-new-password-internal > .wrapper {\n -webkit-mask-image: none;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t\tdescope-password {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t}\n\t\tdescope-new-password-internal vaadin-password-field::before {\n\t\t\theight: initial;\n\t\t}\n descope-policy-validation {\n margin-top: 8px;\n display: flex;\n }\n descope-policy-validation.hidden {\n display: none;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:p}))},85857:(t,e,n)=>{n.d(e,{f:()=>i});const i=(0,n(54567).iY)("new-password-internal")},1545:(t,e,n)=>{n.r(e);var i=n(73878),r=n(54567),o=n(60395),a=n(85857);const s=/^password-/,l=/^confirm-/,d=(t,e)=>t.replace(e,""),p=["password-label","password-placeholder"],u=["confirm-label","confirm-placeholder"],c=["has-confirm","disabled","bordered","size","full-width","maxlength","invalid","readonly","draggable","autocomplete"],h=[].concat(c,p,u,["has-validation"]),b=(0,i.P)({componentName:a.f,baseSelector:"div"});customElements.define(a.f,class extends b{static get observedAttributes(){return[].concat(b.observedAttributes||[],h)}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper"></div>\n\t\t',this.wrapperEle=this.querySelector(".wrapper")}get value(){return this.passwordInput?.value||""}set value(t){t!==this.value&&(this.value=t)}get hasConfirm(){return"true"===this.getAttribute("has-confirm")}onHasConfirmChange(t){this.confirmInput.style.display=t?"":"none"}onHasValidationChange(t){this.policyPanel.style.display=t?"":"none"}get hasValidation(){return"true"===this.getAttribute("has-validation")}getValidity(){if(!this.policyPanel.isValid)return{patternMismatch:!0};if(this.isRequired&&!this.value)return{valueMissing:!0};if(this.hasConfirm&&this.confirmInput&&this.value!==this.confirmInput.value)return{patternMismatch:!0};const t=this.getAttribute("minlength"),e=parseInt(t,10)||0;return this.value.length>=e?{}:{tooShort:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.passwordInput.focus()})),super.init?.(),this.renderInputs(this.hasConfirm,this.hasValidation)}renderInputs(){this.wrapperEle.innerHTML='\n <div>\n <descope-password autocomplete="new-password" data-id="password"></descope-password>\n <descope-policy-validation></descope-policy-validation>\n </div>\n <descope-password autocomplete="new-password" data-id="confirm"></descope-password>\n ',this.passwordInput=this.querySelector('[data-id="password"]'),this.confirmInput=this.querySelector('[data-id="confirm"]'),this.policyPanel=this.querySelector("descope-policy-validation"),this.inputs=[this.passwordInput,this.confirmInput],this.initInputs(),this.passwordInput.addEventListener("input",(t=>{this.policyPanel.setAttribute("value",t.target.value)})),(0,r.oP)(this,this.policyPanel,{includeAttrs:["policy-label","available-policies","active-policies","data-password-policy-value-minlength"],mapAttrs:{"policy-label":"label","available-policies":"data"}})}handleIndicatorStyle(){this.inputs.forEach((t=>{const e=document.createElement("style");e.innerHTML=`\n\t\t\t\t:host ::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${o.o.cssVarList.inputsRequiredIndicator});\n width: 1em;\n text-align: center;\n\t\t\t\t}\n :host ::part(required-indicator) {\n display: inline-flex;\n }\n\t\t\t\t`,t?.shadowRoot.appendChild(e)}))}get isInvalid(){return this.hasAttribute("invalid")&&"false"!==this.getAttribute("invalid")}handleInputsInvalidAttribute(){this.inputs.forEach((t=>{t&&(0,r.FX)(t,(e=>{if(e.includes("invalid")){const e=t.getAttribute("invalid"),n=this.getAttribute("invalid");this.isInvalid&&n!==e&&t.setAttribute("invalid","true")}}),{})}))}initInputs(){this.handleIndicatorStyle(),this.handleInputsInvalidAttribute(),this.handleFocusEventsDispatching(this.inputs)}toggleBooleanAttribute(t,e,n){null===n?t?.removeAttribute(e):t?.setAttribute(e,n)}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&("has-validation"===t?this.onHasValidationChange("true"===n):"has-confirm"===t?this.onHasConfirmChange("true"===n):c.includes(t)?this.inputs.forEach((e=>this.toggleBooleanAttribute(e,t,n))):p.includes(t)?this.toggleBooleanAttribute(this.passwordInput,d(t,s),n):u.includes(t)&&this.toggleBooleanAttribute(this.confirmInput,d(t,l),n))}})},19876:(t,e,n)=>{n.d(e,{f:()=>d,v:()=>w});var i=n(94978),r=n(2061),o=n(54567),a=n(22702),s=n(54201),l=n(64365);const d=(0,o.iY)("password"),{host:p,inputField:u,inputElement:c,inputElementPlaceholder:h,revealButtonContainer:b,revealButtonIcon:m,label:v,requiredIndicator:y,errorMessage:g,helperText:f}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:()=>":host input:placeholder-shown"},revealButtonContainer:{selector:"::part(reveal-button)"},revealButtonIcon:{selector:"::part(reveal-button)::before"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},w=(0,r.qC)((0,i.yk)({mappings:{hostWidth:{...p,property:"width"},hostMinWidth:{...p,property:"min-width"},hostDirection:{...p,property:"direction"},fontSize:[{},p],fontFamily:[v,u,g,f],inputHeight:{...u,property:"height"},inputHorizontalPadding:[{...c,property:"padding-left"},{...c,property:"padding-right"}],inputBackgroundColor:{...u,property:"background-color"},inputBorderStyle:{...u,property:"border-style"},inputBorderWidth:{...u,property:"border-width"},inputBorderColor:{...u,property:"border-color"},inputBorderRadius:{...u,property:"border-radius"},inputOutlineColor:{...u,property:"outline-color"},inputOutlineStyle:{...u,property:"outline-style"},inputOutlineOffset:{...u,property:"outline-offset"},inputOutlineWidth:{...u,property:"outline-width"},labelTextColor:[{...v,property:"color"},{...y,property:"color"}],labelRequiredIndicator:{...y,property:"content"},errorMessageTextColor:{...g,property:"color"},inputPlaceholderTextColor:[{...h,property:"color"},{selector:()=>":host ::slotted(input:placeholder-shown)",property:"color"}],inputValueTextColor:[{...c,property:"color"},{selector:()=>":host ::slotted(input)",property:"color"}],revealButtonOffset:[{...b,property:"margin-right"},{...b,property:"margin-left"}],revealButtonSize:{...b,property:"font-size"},revealButtonColor:{...m,property:"color"}}}),i.e4,(0,i.dj)({proxyProps:["value","selectionStart"]}),i.Ae,a.Z,(t=>class extends t{init(){super.init?.(),this.baseElement.checkValidity=()=>{},this.setAttribute("external-input","true");const t=this.baseElement.querySelector("input"),e=(0,l.nC)("external-input","suffix");this.baseElement.appendChild(e);const n=(0,l.X$)("external-input",this.getAutocompleteType());setTimeout((()=>{(0,l.Gc)(t,n)})),this.handleExternalInputEvents(n),(0,o.tg)(t,n,{includeAttrs:["type","readonly"]}),t.addEventListener("focus",(t=>{t.preventDefault(),t.isTrusted&&n.focus()})),this.addEventListener("focus",(t=>{t.preventDefault(),this.focus()})),this.appendChild(n)}getAutocompleteType(){return this.getAttribute("autocomplete")||"current-password"}handleExternalInputEvents(t){t.addEventListener("input",(t=>{this.value=t.target.value})),t.addEventListener("focus",(()=>{this.setAttribute("focused","true")}))}}))((0,i.DM)({slots:["","suffix"],wrappedEleName:"vaadin-password-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${(0,s.bi)(w.cssVarList)}\n\t\t\t${(0,s.Pd)("vaadin-password-field")}\n ${(0,s.Wf)("vaadin-password-field")}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${w.cssVarList.inputOutlineColor});\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:d}))},64365:(t,e,n)=>{n.d(e,{Gc:()=>o,X$:()=>r,nC:()=>i});const i=(t,e)=>{const n=document.createElement("slot");return n.setAttribute("name",t),n.setAttribute("slot",e),n},r=(t,e)=>{const n=document.createElement("input");return n.setAttribute("slot",t),n.setAttribute("type","password"),n.setAttribute("data-hidden-input","true"),n.setAttribute("autocomplete",e),n},o=(t,e)=>{const n=getComputedStyle(t),i=n.getPropertyValue("height"),r=n.getPropertyValue("padding-left"),o=n.getPropertyValue("padding-right"),a=n.getPropertyValue("font-size"),s=n.getPropertyValue("font-family"),l=n.getPropertyValue("letter-spacing"),d=n.getPropertyValue("caret-color"),p=((t,e)=>{t.value="_";const n=e.getPropertyValue("color");return t.value="",n})(t,n);e.style=`\n all: unset !important;\n position: absolute !important;\n width: calc(100% - 3em) !important;\n background-color: transparent !important;\n color: ${p} !important;\n height: ${i} !important;\n left: ${r} !important;\n right: ${o} !important;\n font-size: ${a} !important;\n font-family: ${s} !important;\n letter-spacing: ${l} !important;\n caret-color: ${d} !important;\n `}},22702:(t,e,n)=>{n.d(e,{Z:()=>i});const i=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){super.init?.();const t=this.querySelector("input");t?.addEventListener("mousedown",(e=>{if(this.isDraggable&&this.isReadOnly){t.setAttribute("inert","true");const n=e.target,i=n.getAttribute("type");n.setAttribute("type","text"),setTimeout((()=>{n.focus()}));const r=e=>{n.setAttribute("type",i),t.removeAttribute("inert"),this.removeEventListener("mouseup",r),this.removeEventListener("dragend",r)};this.addEventListener("dragend",r,{once:!0}),this.addEventListener("mouseup",r,{once:!0})}}))}}},2886:(t,e,n)=>{n.d(e,{S:()=>y,f:()=>l});var i=n(94978),r=n(33346),o=n(2061),a=n(54567),s=n(27487);const l=(0,a.iY)("policy-validation"),d=["data","active-policies","overrides","data-password-policy-value-minlength"],p=["label","value",...d];class u extends((0,r.s)({componentName:l,baseSelector:":host > div"})){#t;#e=[];#n;static get observedAttributes(){return p}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="label"></div>\n <ul></ul>\n </div>\n <style>\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n </style>\n\t\t',this.panel=this.shadowRoot.querySelector(":host > div"),this.label=this.shadowRoot.querySelector(".label"),this.list=this.shadowRoot.querySelector("ul")}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback?.(t,e,n),e!==n){if("label"===t&&this.updateLabel(n),d.includes(t)){if("data"===t)try{this.availablePolicies=JSON.parse(n)}catch{console.error("Failed to set available policies")}if("active-policies"===t&&(this.#e=(n||"").split(",")),"data-password-policy-value-minlength"===t){const t=Number(n);!Number.isNaN(t)&&t>0&&(this.#n={...this.#n,minlength:{value:`${t}`}})}}this.renderItems(this.#t,this.#e,this.#n)}}get availablePolicies(){return this.#t||[]}set availablePolicies(t){this.#t=t}get value(){return this.getAttribute("value")||""}validate(){let t=this.#t;return this.#n&&(t=this.#t.map((t=>this.#n[t.id]?{...t,data:this.#n[t.id]}:t))),this.#e.reduce(((e,n)=>{const i=t.find((t=>t.id===n));if(!i)return e;const{pattern:r,message:o,data:a}=i;if(!r||!o)return e;const l={valid:new RegExp((0,s.I)(r,a)).test(this.value),message:(0,s.I)(o,a),id:n};return e.push(l),e}),[])}get isValid(){return!this.validate().some((({valid:t})=>!1===t))}getValidationItemTemplate({valid:t,message:e}){return`\n <li class="item" data-valid="${this.value?t:"none"}">\n <span class="message">${e}</span>\n </li>\n `}renderItems(t,e){t&&e.length&&(this.list.innerHTML=this.validate().map(this.getValidationItemTemplate.bind(this)).join(""))}updateLabel(t){t?(this.label.innerHTML=t,this.classList.remove("hide-label")):(this.classList.add("hide-label"),this.label.innerHTML="")}}const{host:c,item:h,symbolDefault:b,symbolSuccess:m,symbolError:v}={host:{selector:()=>":host > div"},item:{selector:()=>".item"},symbolDefault:{selector:()=>'.item[data-valid="none"]::before'},symbolSuccess:{selector:()=>'.item[data-valid="true"]::before'},symbolError:{selector:()=>'.item[data-valid="false"]::before'}},y=(0,o.qC)((0,i.yk)({componentNameOverride:(0,a.iY)("input-wrapper")}),(0,i.yk)({mappings:{hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},padding:{},borderWidth:{...c,property:"border-width"},borderStyle:{...c,property:"border-style"},borderColor:{...c,property:"border-color"},borderRadius:{...c,property:"border-radius"},backgroundColor:{...c,property:"background-color"},textColor:{property:"color"},labelMargin:{...c,property:"gap"},itemsSpacing:{...h,property:"line-height"},itemSymbolSuccessColor:{...m,property:"color"},itemSymbolErrorColor:{...v,property:"color"},itemSymbolDefault:{...b,property:"content"},itemSymbolSuccess:{...m,property:"content"},itemSymbolError:{...v,property:"content"}}}),i.e4,i.Ae)(u)},27487:(t,e,n)=>{n.d(e,{I:()=>i});const i=(t,e)=>t.replace(/{{(\w+)+}}/g,((t,n)=>e?.[n]||t))},54201:(t,e,n)=>{n.d(e,{B:()=>p,DY:()=>l,PH:()=>d,Pd:()=>a,TX:()=>r,Wf:()=>c,bi:()=>i,jI:()=>s,jl:()=>o,wm:()=>u});const i=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,r=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,p=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${r(t)}\n ${a(t)}\n ${s(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${p(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,c=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7055,1842,8106,4570],{73878:(t,e,i)=>{i.d(e,{P:()=>a});var r=i(2061),n=i(94978),o=i(33346);const a=(...t)=>(0,r.qC)(n.wX,n.li,n.QT,n.mE)((0,o.s)(...t))},60395:(t,e,i)=>{i.d(e,{f:()=>p,o:()=>g});var r=i(54567),n=i(2061),o=i(94978),a=i(85857),l=i(19876),s=i(54201),d=i(2886);const p=(0,r.iY)("new-password"),c=d.S.cssVarList,{host:u,label:h,internalInputsWrapper:b,errorMessage:y,helperText:f,passwordInput:v,policyPreview:m}={host:{selector:()=>":host"},label:{selector:"::part(label)"},internalInputsWrapper:{selector:"descope-new-password-internal .wrapper"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},passwordInput:{selector:"descope-password"},policyPreview:{selector:"descope-policy-validation"}},g=(0,n.qC)((0,o.yk)({mappings:{fontSize:[u,{},{selector:l.v.componentName,property:l.v.cssVarList.fontSize}],fontFamily:[h,y,f],errorMessageTextColor:{...y,property:"color"},hostWidth:{...u,property:"width"},hostMinWidth:{...u,property:"min-width"},hostDirection:[{...u,property:"direction"},{...v,property:l.v.cssVarList.hostDirection}],inputsRequiredIndicator:{...u,property:"content"},spaceBetweenInputs:{...b,property:"gap"},policyPreviewBackgroundColor:{...m,property:c.backgroundColor},policyPreviewPadding:{...m,property:c.padding}}}),o.e4,(0,o.dj)({proxyProps:["value","selectionStart"]}),(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${a.f}\n\t\t\t\tname="new-password"\n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${a.f}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(a.f),(0,r.oP)(this,this.inputElement,{includeAttrs:["password-label","password-placeholder","confirm-label","confirm-placeholder","full-width","size","bordered","label","has-confirm","invalid","readonly","draggable","has-validation","policy-label","active-policies","available-policies","data-password-policy-value-minlength"]})}}))((0,o.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-block;\n\t\t\tmax-width: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n :host ::part(error-message) {\n direction: ltr;\n }\n\t\t${(0,s.bi)(l.v.cssVarList)}\n\t\tvaadin-text-field {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tmin-height: 0;\n\t\t\tbackground: transparent;\n\t\t\tbox-shadow: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field::part(input-field)::after {\n\t\t\tbackground: transparent;\n\t\t\topacity: 0;\n\t\t}\n\t\tdescope-new-password-internal {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\twidth: 100%;\n\t\t\tpadding: 0;\n\t\t}\n\t\tdescope-new-password-internal > .wrapper {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t\tdescope-password {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t}\n\t\tdescope-new-password-internal vaadin-password-field::before {\n\t\t\theight: initial;\n\t\t}\n descope-policy-validation {\n margin-top: 8px;\n display: flex;\n }\n descope-policy-validation.hidden {\n display: none;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:p}))},85857:(t,e,i)=>{i.d(e,{f:()=>r});const r=(0,i(54567).iY)("new-password-internal")},1545:(t,e,i)=>{i.r(e);var r=i(73878),n=i(54567),o=i(60395),a=i(85857);const l=/^password-/,s=/^confirm-/,d=(t,e)=>t.replace(e,""),p=["password-label","password-placeholder"],c=["confirm-label","confirm-placeholder"],u=["disabled","bordered","size","full-width","maxlength","invalid","readonly","draggable","autocomplete"],h=[].concat(u,p,c,["has-validation"]),b=(0,r.P)({componentName:a.f,baseSelector:"div"});customElements.define(a.f,class extends b{static get observedAttributes(){return["has-confirm"].concat(b.observedAttributes||[],h)}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper"></div>\n\t\t',this.wrapperEle=this.querySelector(".wrapper")}get value(){return this.passwordInput?.value||""}set value(t){t!==this.value&&(this.value=t)}get hasConfirm(){return"true"===this.getAttribute("has-confirm")}get hasValidation(){return"true"===this.getAttribute("has-validation")}getValidity(){if(!this.policyPanel.isValid)return{patternMismatch:!0};if(this.isRequired&&!this.value)return{valueMissing:!0};if(this.hasConfirm&&this.confirmInput&&this.value!==this.confirmInput.value)return{patternMismatch:!0};const t=this.getAttribute("minlength"),e=parseInt(t,10)||0;return this.value.length>=e?{}:{tooShort:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.passwordInput.focus()})),super.init?.(),this.renderInputs(this.hasConfirm,this.hasValidation)}renderInputs(t,e){let i=`\n <div>\n <descope-password data-id="password"></descope-password>\n <descope-policy-validation class="${e?"hidden":""}"></descope-policy-validation>\n </div>\n `;t&&(i+='<descope-password data-id="confirm"></descope-password>'),this.wrapperEle.innerHTML=i,this.passwordInput=this.querySelector('[data-id="password"]'),this.confirmInput=this.querySelector('[data-id="confirm"]'),this.policyPanel=this.querySelector("descope-policy-validation"),this.inputs=[this.passwordInput,this.confirmInput],this.initInputs(),[...p,...c,...u].forEach((t=>{this.attributeChangedCallback(t,null,this.getAttribute(t))})),this.passwordInput.addEventListener("input",(t=>{this.policyPanel.setAttribute("value",t.target.value)})),(0,n.oP)(this,this.policyPanel,{includeAttrs:["policy-label","available-policies","active-policies","data-password-policy-value-minlength"],mapAttrs:{"policy-label":"label","available-policies":"data"}})}handleIndicatorStyle(){this.inputs.forEach((t=>{const e=document.createElement("style");e.innerHTML=`\n\t\t\t\t:host ::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${o.o.cssVarList.inputsRequiredIndicator});\n width: 1em;\n text-align: center;\n\t\t\t\t}\n :host ::part(required-indicator) {\n display: inline-flex;\n }\n\t\t\t\t`,t?.shadowRoot.appendChild(e)}))}get isInvalid(){return this.hasAttribute("invalid")&&"false"!==this.getAttribute("invalid")}handleInputsInvalidAttribute(){this.inputs.forEach((t=>{t&&(0,n.FX)(t,(e=>{if(e.includes("invalid")){const e=t.getAttribute("invalid"),i=this.getAttribute("invalid");this.isInvalid&&i!==e&&t.setAttribute("invalid","true")}}),{})}))}initInputs(){this.handleIndicatorStyle(),this.handleInputsInvalidAttribute(),this.handleFocusEventsDispatching(this.inputs)}toggleBooleanAttribute(t,e,i){null===i?t?.removeAttribute(e):t?.setAttribute(e,i)}hidePolicy(){this.policyPanel.classList.add("hidden")}showPolicy(){this.policyPanel.classList.remove("hidden")}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),e!==i&&("has-validation"===t?this.renderInputs(this.hasConfirm,"true"===i):"has-confirm"===t?this.renderInputs(null!==i&&"false"!==i,this.hasValidation):u.includes(t)?this.inputs.forEach((e=>this.toggleBooleanAttribute(e,t,i))):p.includes(t)?this.toggleBooleanAttribute(this.passwordInput,d(t,l),i):c.includes(t)&&this.toggleBooleanAttribute(this.confirmInput,d(t,s),i),"has-validation"===t&&("true"===i?this.showPolicy():this.hidePolicy()))}})},88974:(t,e,i)=>{i.r(e),i.d(e,{NewPasswordClass:()=>r.o});var r=i(60395);i(19357),i(79279),i(38558),i(1545),customElements.define(r.f,r.o)},19876:(t,e,i)=>{i.d(e,{f:()=>s,v:()=>g});var r=i(94978),n=i(2061),o=i(54567),a=i(22702),l=i(54201);const s=(0,o.iY)("password"),{host:d,inputField:p,inputElement:c,inputElementPlaceholder:u,revealButtonContainer:h,revealButtonIcon:b,label:y,requiredIndicator:f,errorMessage:v,helperText:m}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:"> input:placeholder-shown"},revealButtonContainer:{selector:()=>"::part(reveal-button)"},revealButtonIcon:{selector:()=>"::part(reveal-button)::before"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},g=(0,n.qC)((0,r.yk)({mappings:{hostWidth:{...d,property:"width"},hostMinWidth:{...d,property:"min-width"},hostDirection:{...d,property:"direction"},fontSize:[{},d],fontFamily:[y,p,v,m],inputHeight:{...p,property:"height"},inputHorizontalPadding:[{...c,property:"padding-left"},{...c,property:"padding-right"}],inputBackgroundColor:{...p,property:"background-color"},inputBorderStyle:{...p,property:"border-style"},inputBorderWidth:{...p,property:"border-width"},inputBorderColor:{...p,property:"border-color"},inputBorderRadius:{...p,property:"border-radius"},inputOutlineColor:{...p,property:"outline-color"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputOutlineWidth:{...p,property:"outline-width"},labelTextColor:[{...y,property:"color"},{...f,property:"color"}],labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...v,property:"color"},inputValueTextColor:{...c,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},revealButtonOffset:[{...h,property:"margin-right"},{...h,property:"margin-left"}],revealButtonSize:{...h,property:"font-size"},revealButtonColor:{...b,property:"color"}}}),r.e4,(0,r.dj)({proxyProps:["value","selectionStart"]}),r.Ae,a.Z)((0,r.DM)({slots:["","suffix"],wrappedEleName:"vaadin-password-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,l.bi)(g.cssVarList)}\n\t\t\t${(0,l.Pd)("vaadin-password-field")}\n ${(0,l.Wf)("vaadin-password-field")}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tmin-height: 0;\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t}\n\t\t\tvaadin-password-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t[readonly] vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${g.cssVarList.inputOutlineColor});\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},79279:(t,e,i)=>{i.r(e),i.d(e,{PasswordClass:()=>r.v}),i(17056);var r=i(19876);customElements.define(r.f,r.v)},22702:(t,e,i)=>{i.d(e,{Z:()=>r});const r=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable&&this.isReadOnly){const e=this.baseElement.querySelector("input"),i=e.getAttribute("type");e.setAttribute("type","text"),setTimeout((()=>e.focus()));const r=n=>{e.setAttribute("type",i),t.target.removeEventListener("mouseup",r),t.target.removeEventListener("dragend",r)};t.target.addEventListener("mouseup",r,{once:!0}),t.target.addEventListener("dragend",r,{once:!0})}})),super.init?.()}}},2886:(t,e,i)=>{i.d(e,{S:()=>v,f:()=>s});var r=i(94978),n=i(33346),o=i(2061),a=i(54567),l=i(27487);const s=(0,a.iY)("policy-validation"),d=["data","active-policies","overrides","data-password-policy-value-minlength"],p=["label","value",...d];class c extends((0,n.s)({componentName:s,baseSelector:":host > div"})){#t;#e=[];#i;static get observedAttributes(){return p}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="label"></div>\n <ul></ul>\n </div>\n <style>\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n </style>\n\t\t',this.panel=this.shadowRoot.querySelector(":host > div"),this.label=this.shadowRoot.querySelector(".label"),this.list=this.shadowRoot.querySelector("ul")}attributeChangedCallback(t,e,i){if(super.attributeChangedCallback?.(t,e,i),e!==i){if("label"===t&&this.updateLabel(i),d.includes(t)){if("data"===t)try{this.availablePolicies=JSON.parse(i)}catch{console.error("Failed to set available policies")}if("active-policies"===t&&(this.#e=(i||"").split(",")),"data-password-policy-value-minlength"===t){const t=Number(i);!Number.isNaN(t)&&t>0&&(this.#i={...this.#i,minlength:{value:`${t}`}})}}this.renderItems(this.#t,this.#e,this.#i)}}get availablePolicies(){return this.#t||[]}set availablePolicies(t){this.#t=t}get value(){return this.getAttribute("value")||""}validate(){let t=this.#t;return this.#i&&(t=this.#t.map((t=>this.#i[t.id]?{...t,data:this.#i[t.id]}:t))),this.#e.reduce(((e,i)=>{const r=t.find((t=>t.id===i));if(!r)return e;const{pattern:n,message:o,data:a}=r;if(!n||!o)return e;const s={valid:new RegExp((0,l.I)(n,a)).test(this.value),message:(0,l.I)(o,a),id:i};return e.push(s),e}),[])}get isValid(){return!this.validate().some((({valid:t})=>!1===t))}getValidationItemTemplate({valid:t,message:e}){return`\n <li class="item" data-valid="${this.value?t:"none"}">\n <span class="message">${e}</span>\n </li>\n `}renderItems(t,e){t&&e.length&&(this.list.innerHTML=this.validate().map(this.getValidationItemTemplate.bind(this)).join(""))}updateLabel(t){t?(this.label.innerHTML=t,this.classList.remove("hide-label")):(this.classList.add("hide-label"),this.label.innerHTML="")}}const{host:u,item:h,symbolDefault:b,symbolSuccess:y,symbolError:f}={host:{selector:()=>":host > div"},item:{selector:()=>".item"},symbolDefault:{selector:()=>'.item[data-valid="none"]::before'},symbolSuccess:{selector:()=>'.item[data-valid="true"]::before'},symbolError:{selector:()=>'.item[data-valid="false"]::before'}},v=(0,o.qC)((0,r.yk)({componentNameOverride:(0,a.iY)("input-wrapper")}),(0,r.yk)({mappings:{hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},padding:{},borderWidth:{...u,property:"border-width"},borderStyle:{...u,property:"border-style"},borderColor:{...u,property:"border-color"},borderRadius:{...u,property:"border-radius"},backgroundColor:{...u,property:"background-color"},textColor:{property:"color"},labelMargin:{...u,property:"gap"},itemsSpacing:{...h,property:"line-height"},itemSymbolSuccessColor:{...y,property:"color"},itemSymbolErrorColor:{...f,property:"color"},itemSymbolDefault:{...b,property:"content"},itemSymbolSuccess:{...y,property:"content"},itemSymbolError:{...f,property:"content"}}}),r.e4,r.Ae)(c)},27487:(t,e,i)=>{i.d(e,{I:()=>r});const r=(t,e)=>t.replace(/{{(\w+)+}}/g,((t,i)=>e?.[i]||t))},38558:(t,e,i)=>{i.r(e),i.d(e,{PolicyValidationClass:()=>r.S});var r=i(2886);customElements.define(r.f,r.S)},56417:(t,e,i)=>{i.d(e,{f:()=>s,z:()=>p});var r=i(94978),n=i(4447),o=i(2061),a=i(54567),l=i(54201);const s=(0,a.iY)("text-field"),d=["type"],p=(0,o.qC)((0,r.yk)({mappings:n.Z}),r.e4,(0,r.dj)({proxyProps:["value","selectionStart"]}),r.Ae,(t=>class extends t{static get observedAttributes(){return d.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangeCallback?.(t,e,i),"type"===t&&this.baseElement._setType(i)}get isExternalInput(){return"true"===this.getAttribute("external-input")}constructor(){if(super(),this.isExternalInput){const t=this.baseElement.querySelector("input");this.inputSlot=document.createElement("slot"),this.focus=()=>{t.focus()},this.inputSlot.setAttribute("name","input"),this.inputSlot.setAttribute("slot","input"),this.baseElement.appendChild(this.inputSlot),this.appendChild(t)}}}))((0,r.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${p.cssVarList.inputOutlineWidth}) + var(${p.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,l.Wf)("vaadin-text-field")}\n\t\t\t${(0,l.bi)(p.cssVarList)}\n\t\t\t${(0,l.wm)("vaadin-text-field",p.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},19357:(t,e,i)=>{i.r(e),i.d(e,{TextFieldClass:()=>r.z}),i(79789);var r=i(56417);customElements.define(r.f,r.z)},4447:(t,e,i)=>{i.d(e,{Z:()=>v});const{host:r,label:n,placeholder:o,requiredIndicator:a,inputField:l,input:s,helperText:d,errorMessage:p,disabledPlaceholder:c,inputDisabled:u,externalInput:h,externalInputDisabled:b,externalPlaceholder:y,externalDisabledPlaceholder:f}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},v={fontSize:[{},r],fontFamily:[n,l,d,p],hostWidth:{...r,property:"width"},hostMinWidth:{...r,property:"min-width"},hostDirection:{...r,property:"direction"},inputBackgroundColor:{...l,property:"background-color"},labelTextColor:[{...n,property:"color"},{...a,property:"color"},{...n,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...p,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...l,property:"color"},{...u,property:"-webkit-text-fill-color"},{...b,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...s,property:"color"},{...h,property:"color"}],labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},inputHeight:{...l,property:"height"},inputHorizontalPadding:[{...s,property:"padding-left"},{...s,property:"padding-right"},{...h,property:"padding-left"},{...h,property:"padding-right"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineOffset:{...l,property:"outline-offset"},inputTextAlign:[{...s,property:"text-align"},{...h,property:"text-align"}],inputPlaceholderColor:[{...o,property:"color"},{...y,property:"color"},{...c,property:"-webkit-text-fill-color"},{...f,property:"-webkit-text-fill-color"}]}},54201:(t,e,i)=>{i.d(e,{B:()=>p,DY:()=>s,PH:()=>d,Pd:()=>a,TX:()=>n,Wf:()=>u,bi:()=>r,jI:()=>l,jl:()=>o,wm:()=>c});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,n=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,l=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,s=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,p=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,c=(t,e)=>`\n ${n(t)}\n ${a(t)}\n ${l(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${p(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,u=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`},79789:(t,e,i)=>{i(58725),i(18005)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7055,1842,8106,4570],{73878:(t,e,i)=>{i.d(e,{P:()=>a});var n=i(2061),r=i(94978),o=i(33346);const a=(...t)=>(0,n.qC)(r.wX,r.li,r.QT,r.mE)((0,o.s)(...t))},60395:(t,e,i)=>{i.d(e,{f:()=>d,o:()=>v});var n=i(54567),r=i(2061),o=i(94978),a=i(85857),s=i(19876),l=i(54201),p=i(2886);const d=(0,n.iY)("new-password"),u=p.S.cssVarList,{host:c,label:h,internalInputsWrapper:b,errorMessage:y,helperText:m,passwordInput:f,policyPreview:g}={host:{selector:()=>":host"},label:{selector:"::part(label)"},internalInputsWrapper:{selector:"descope-new-password-internal .wrapper"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},passwordInput:{selector:"descope-password"},policyPreview:{selector:"descope-policy-validation"}},v=(0,r.qC)((0,o.yk)({mappings:{fontSize:[c,{},{selector:s.v.componentName,property:s.v.cssVarList.fontSize}],fontFamily:[h,y,m],errorMessageTextColor:{...y,property:"color"},hostWidth:{...c,property:"width"},hostMinWidth:{...c,property:"min-width"},hostDirection:[{...c,property:"direction"},{...f,property:s.v.cssVarList.hostDirection}],inputsRequiredIndicator:{...c,property:"content"},spaceBetweenInputs:{...b,property:"gap"},policyPreviewBackgroundColor:{...g,property:u.backgroundColor},policyPreviewPadding:{...g,property:u.padding}}}),o.e4,(0,o.dj)({proxyProps:["value","selectionStart"]}),(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${a.f}\n\t\t\t\tname="new-password"\n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t>\n </${a.f}>\n\t\t\t`,this.setAttribute("external-input","true"),this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(a.f),this.passwordInput=this.inputElement.querySelector('[data-id="password"]'),this.confirmInput=this.inputElement.querySelector('[data-id="confirm"]'),this.createExternalInput(this.passwordInput,"external-password-input"),this.createExternalInput(this.confirmInput,"external-confirm-input"),(0,n.oP)(this,this.inputElement,{includeAttrs:["password-label","password-placeholder","confirm-label","confirm-placeholder","full-width","size","bordered","label","has-confirm","invalid","readonly","draggable","has-validation","policy-label","active-policies","available-policies","data-password-policy-value-minlength"]})}createExternalInput(t,e){const i=t.querySelector("input"),n=document.createElement("slot"),r=i.getAttribute("slot");n.setAttribute("name",e),n.setAttribute("slot",r),t.appendChild(n),i.setAttribute("slot",e),i.setAttribute("data-hidden-input","true"),this.appendChild(i)}}))((0,o.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-block;\n\t\t\tmax-width: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n :host ::part(error-message) {\n direction: ltr;\n }\n\t\t${(0,l.bi)(s.v.cssVarList)}\n\t\tvaadin-text-field {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tmin-height: 0;\n\t\t\tbackground: transparent;\n\t\t\tbox-shadow: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field::part(input-field)::after {\n\t\t\tbackground: transparent;\n\t\t\topacity: 0;\n\t\t}\n\t\tdescope-new-password-internal {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\twidth: 100%;\n\t\t\tpadding: 0;\n\t\t}\n\t\tdescope-new-password-internal > .wrapper {\n -webkit-mask-image: none;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t\tdescope-password {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t}\n\t\tdescope-new-password-internal vaadin-password-field::before {\n\t\t\theight: initial;\n\t\t}\n descope-policy-validation {\n margin-top: 8px;\n display: flex;\n }\n descope-policy-validation.hidden {\n display: none;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:d}))},85857:(t,e,i)=>{i.d(e,{f:()=>n});const n=(0,i(54567).iY)("new-password-internal")},1545:(t,e,i)=>{i.r(e);var n=i(73878),r=i(54567),o=i(60395),a=i(85857);const s=/^password-/,l=/^confirm-/,p=(t,e)=>t.replace(e,""),d=["password-label","password-placeholder"],u=["confirm-label","confirm-placeholder"],c=["has-confirm","disabled","bordered","size","full-width","maxlength","invalid","readonly","draggable","autocomplete"],h=[].concat(c,d,u,["has-validation"]),b=(0,n.P)({componentName:a.f,baseSelector:"div"});customElements.define(a.f,class extends b{static get observedAttributes(){return[].concat(b.observedAttributes||[],h)}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper"></div>\n\t\t',this.wrapperEle=this.querySelector(".wrapper")}get value(){return this.passwordInput?.value||""}set value(t){t!==this.value&&(this.value=t)}get hasConfirm(){return"true"===this.getAttribute("has-confirm")}onHasConfirmChange(t){this.confirmInput.style.display=t?"":"none"}onHasValidationChange(t){this.policyPanel.style.display=t?"":"none"}get hasValidation(){return"true"===this.getAttribute("has-validation")}getValidity(){if(!this.policyPanel.isValid)return{patternMismatch:!0};if(this.isRequired&&!this.value)return{valueMissing:!0};if(this.hasConfirm&&this.confirmInput&&this.value!==this.confirmInput.value)return{patternMismatch:!0};const t=this.getAttribute("minlength"),e=parseInt(t,10)||0;return this.value.length>=e?{}:{tooShort:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.passwordInput.focus()})),super.init?.(),this.renderInputs(this.hasConfirm,this.hasValidation)}renderInputs(){this.wrapperEle.innerHTML='\n <div>\n <descope-password autocomplete="new-password" data-id="password"></descope-password>\n <descope-policy-validation></descope-policy-validation>\n </div>\n <descope-password autocomplete="new-password" data-id="confirm"></descope-password>\n ',this.passwordInput=this.querySelector('[data-id="password"]'),this.confirmInput=this.querySelector('[data-id="confirm"]'),this.policyPanel=this.querySelector("descope-policy-validation"),this.inputs=[this.passwordInput,this.confirmInput],this.initInputs(),this.passwordInput.addEventListener("input",(t=>{this.policyPanel.setAttribute("value",t.target.value)})),(0,r.oP)(this,this.policyPanel,{includeAttrs:["policy-label","available-policies","active-policies","data-password-policy-value-minlength"],mapAttrs:{"policy-label":"label","available-policies":"data"}})}handleIndicatorStyle(){this.inputs.forEach((t=>{const e=document.createElement("style");e.innerHTML=`\n\t\t\t\t:host ::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${o.o.cssVarList.inputsRequiredIndicator});\n width: 1em;\n text-align: center;\n\t\t\t\t}\n :host ::part(required-indicator) {\n display: inline-flex;\n }\n\t\t\t\t`,t?.shadowRoot.appendChild(e)}))}get isInvalid(){return this.hasAttribute("invalid")&&"false"!==this.getAttribute("invalid")}handleInputsInvalidAttribute(){this.inputs.forEach((t=>{t&&(0,r.FX)(t,(e=>{if(e.includes("invalid")){const e=t.getAttribute("invalid"),i=this.getAttribute("invalid");this.isInvalid&&i!==e&&t.setAttribute("invalid","true")}}),{})}))}initInputs(){this.handleIndicatorStyle(),this.handleInputsInvalidAttribute(),this.handleFocusEventsDispatching(this.inputs)}toggleBooleanAttribute(t,e,i){null===i?t?.removeAttribute(e):t?.setAttribute(e,i)}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),e!==i&&("has-validation"===t?this.onHasValidationChange("true"===i):"has-confirm"===t?this.onHasConfirmChange("true"===i):c.includes(t)?this.inputs.forEach((e=>this.toggleBooleanAttribute(e,t,i))):d.includes(t)?this.toggleBooleanAttribute(this.passwordInput,p(t,s),i):u.includes(t)&&this.toggleBooleanAttribute(this.confirmInput,p(t,l),i))}})},88974:(t,e,i)=>{i.r(e),i.d(e,{NewPasswordClass:()=>n.o});var n=i(60395);i(19357),i(79279),i(38558),i(1545),customElements.define(n.f,n.o)},19876:(t,e,i)=>{i.d(e,{f:()=>p,v:()=>w});var n=i(94978),r=i(2061),o=i(54567),a=i(22702),s=i(54201),l=i(64365);const p=(0,o.iY)("password"),{host:d,inputField:u,inputElement:c,inputElementPlaceholder:h,revealButtonContainer:b,revealButtonIcon:y,label:m,requiredIndicator:f,errorMessage:g,helperText:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:()=>":host input:placeholder-shown"},revealButtonContainer:{selector:"::part(reveal-button)"},revealButtonIcon:{selector:"::part(reveal-button)::before"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},w=(0,r.qC)((0,n.yk)({mappings:{hostWidth:{...d,property:"width"},hostMinWidth:{...d,property:"min-width"},hostDirection:{...d,property:"direction"},fontSize:[{},d],fontFamily:[m,u,g,v],inputHeight:{...u,property:"height"},inputHorizontalPadding:[{...c,property:"padding-left"},{...c,property:"padding-right"}],inputBackgroundColor:{...u,property:"background-color"},inputBorderStyle:{...u,property:"border-style"},inputBorderWidth:{...u,property:"border-width"},inputBorderColor:{...u,property:"border-color"},inputBorderRadius:{...u,property:"border-radius"},inputOutlineColor:{...u,property:"outline-color"},inputOutlineStyle:{...u,property:"outline-style"},inputOutlineOffset:{...u,property:"outline-offset"},inputOutlineWidth:{...u,property:"outline-width"},labelTextColor:[{...m,property:"color"},{...f,property:"color"}],labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...g,property:"color"},inputPlaceholderTextColor:[{...h,property:"color"},{selector:()=>":host ::slotted(input:placeholder-shown)",property:"color"}],inputValueTextColor:[{...c,property:"color"},{selector:()=>":host ::slotted(input)",property:"color"}],revealButtonOffset:[{...b,property:"margin-right"},{...b,property:"margin-left"}],revealButtonSize:{...b,property:"font-size"},revealButtonColor:{...y,property:"color"}}}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"]}),n.Ae,a.Z,(t=>class extends t{init(){super.init?.(),this.baseElement.checkValidity=()=>{},this.setAttribute("external-input","true");const t=this.baseElement.querySelector("input"),e=(0,l.nC)("external-input","suffix");this.baseElement.appendChild(e);const i=(0,l.X$)("external-input",this.getAutocompleteType());setTimeout((()=>{(0,l.Gc)(t,i)})),this.handleExternalInputEvents(i),(0,o.tg)(t,i,{includeAttrs:["type","readonly"]}),t.addEventListener("focus",(t=>{t.preventDefault(),t.isTrusted&&i.focus()})),this.addEventListener("focus",(t=>{t.preventDefault(),this.focus()})),this.appendChild(i)}getAutocompleteType(){return this.getAttribute("autocomplete")||"current-password"}handleExternalInputEvents(t){t.addEventListener("input",(t=>{this.value=t.target.value})),t.addEventListener("focus",(()=>{this.setAttribute("focused","true")}))}}))((0,n.DM)({slots:["","suffix"],wrappedEleName:"vaadin-password-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${(0,s.bi)(w.cssVarList)}\n\t\t\t${(0,s.Pd)("vaadin-password-field")}\n ${(0,s.Wf)("vaadin-password-field")}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${w.cssVarList.inputOutlineColor});\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:p}))},64365:(t,e,i)=>{i.d(e,{Gc:()=>o,X$:()=>r,nC:()=>n});const n=(t,e)=>{const i=document.createElement("slot");return i.setAttribute("name",t),i.setAttribute("slot",e),i},r=(t,e)=>{const i=document.createElement("input");return i.setAttribute("slot",t),i.setAttribute("type","password"),i.setAttribute("data-hidden-input","true"),i.setAttribute("autocomplete",e),i},o=(t,e)=>{const i=getComputedStyle(t),n=i.getPropertyValue("height"),r=i.getPropertyValue("padding-left"),o=i.getPropertyValue("padding-right"),a=i.getPropertyValue("font-size"),s=i.getPropertyValue("font-family"),l=i.getPropertyValue("letter-spacing"),p=i.getPropertyValue("caret-color"),d=((t,e)=>{t.value="_";const i=e.getPropertyValue("color");return t.value="",i})(t,i);e.style=`\n all: unset !important;\n position: absolute !important;\n width: calc(100% - 3em) !important;\n background-color: transparent !important;\n color: ${d} !important;\n height: ${n} !important;\n left: ${r} !important;\n right: ${o} !important;\n font-size: ${a} !important;\n font-family: ${s} !important;\n letter-spacing: ${l} !important;\n caret-color: ${p} !important;\n `}},79279:(t,e,i)=>{i.r(e),i.d(e,{PasswordClass:()=>n.v}),i(17056);var n=i(19876);customElements.define(n.f,n.v)},22702:(t,e,i)=>{i.d(e,{Z:()=>n});const n=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){super.init?.();const t=this.querySelector("input");t?.addEventListener("mousedown",(e=>{if(this.isDraggable&&this.isReadOnly){t.setAttribute("inert","true");const i=e.target,n=i.getAttribute("type");i.setAttribute("type","text"),setTimeout((()=>{i.focus()}));const r=e=>{i.setAttribute("type",n),t.removeAttribute("inert"),this.removeEventListener("mouseup",r),this.removeEventListener("dragend",r)};this.addEventListener("dragend",r,{once:!0}),this.addEventListener("mouseup",r,{once:!0})}}))}}},2886:(t,e,i)=>{i.d(e,{S:()=>f,f:()=>l});var n=i(94978),r=i(33346),o=i(2061),a=i(54567),s=i(27487);const l=(0,a.iY)("policy-validation"),p=["data","active-policies","overrides","data-password-policy-value-minlength"],d=["label","value",...p];class u extends((0,r.s)({componentName:l,baseSelector:":host > div"})){#t;#e=[];#i;static get observedAttributes(){return d}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="label"></div>\n <ul></ul>\n </div>\n <style>\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n </style>\n\t\t',this.panel=this.shadowRoot.querySelector(":host > div"),this.label=this.shadowRoot.querySelector(".label"),this.list=this.shadowRoot.querySelector("ul")}attributeChangedCallback(t,e,i){if(super.attributeChangedCallback?.(t,e,i),e!==i){if("label"===t&&this.updateLabel(i),p.includes(t)){if("data"===t)try{this.availablePolicies=JSON.parse(i)}catch{console.error("Failed to set available policies")}if("active-policies"===t&&(this.#e=(i||"").split(",")),"data-password-policy-value-minlength"===t){const t=Number(i);!Number.isNaN(t)&&t>0&&(this.#i={...this.#i,minlength:{value:`${t}`}})}}this.renderItems(this.#t,this.#e,this.#i)}}get availablePolicies(){return this.#t||[]}set availablePolicies(t){this.#t=t}get value(){return this.getAttribute("value")||""}validate(){let t=this.#t;return this.#i&&(t=this.#t.map((t=>this.#i[t.id]?{...t,data:this.#i[t.id]}:t))),this.#e.reduce(((e,i)=>{const n=t.find((t=>t.id===i));if(!n)return e;const{pattern:r,message:o,data:a}=n;if(!r||!o)return e;const l={valid:new RegExp((0,s.I)(r,a)).test(this.value),message:(0,s.I)(o,a),id:i};return e.push(l),e}),[])}get isValid(){return!this.validate().some((({valid:t})=>!1===t))}getValidationItemTemplate({valid:t,message:e}){return`\n <li class="item" data-valid="${this.value?t:"none"}">\n <span class="message">${e}</span>\n </li>\n `}renderItems(t,e){t&&e.length&&(this.list.innerHTML=this.validate().map(this.getValidationItemTemplate.bind(this)).join(""))}updateLabel(t){t?(this.label.innerHTML=t,this.classList.remove("hide-label")):(this.classList.add("hide-label"),this.label.innerHTML="")}}const{host:c,item:h,symbolDefault:b,symbolSuccess:y,symbolError:m}={host:{selector:()=>":host > div"},item:{selector:()=>".item"},symbolDefault:{selector:()=>'.item[data-valid="none"]::before'},symbolSuccess:{selector:()=>'.item[data-valid="true"]::before'},symbolError:{selector:()=>'.item[data-valid="false"]::before'}},f=(0,o.qC)((0,n.yk)({componentNameOverride:(0,a.iY)("input-wrapper")}),(0,n.yk)({mappings:{hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},padding:{},borderWidth:{...c,property:"border-width"},borderStyle:{...c,property:"border-style"},borderColor:{...c,property:"border-color"},borderRadius:{...c,property:"border-radius"},backgroundColor:{...c,property:"background-color"},textColor:{property:"color"},labelMargin:{...c,property:"gap"},itemsSpacing:{...h,property:"line-height"},itemSymbolSuccessColor:{...y,property:"color"},itemSymbolErrorColor:{...m,property:"color"},itemSymbolDefault:{...b,property:"content"},itemSymbolSuccess:{...y,property:"content"},itemSymbolError:{...m,property:"content"}}}),n.e4,n.Ae)(u)},27487:(t,e,i)=>{i.d(e,{I:()=>n});const n=(t,e)=>t.replace(/{{(\w+)+}}/g,((t,i)=>e?.[i]||t))},38558:(t,e,i)=>{i.r(e),i.d(e,{PolicyValidationClass:()=>n.S});var n=i(2886);customElements.define(n.f,n.S)},56417:(t,e,i)=>{i.d(e,{f:()=>l,z:()=>d});var n=i(94978),r=i(4447),o=i(2061),a=i(54567),s=i(54201);const l=(0,a.iY)("text-field"),p=["type"],d=(0,o.qC)((0,n.yk)({mappings:r.Z}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"]}),n.Ae,(t=>class extends t{static get observedAttributes(){return p.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangeCallback?.(t,e,i),"type"===t&&this.baseElement._setType(i)}get isExternalInput(){return"true"===this.getAttribute("external-input")}constructor(){if(super(),this.isExternalInput){const t=this.baseElement.querySelector("input");this.inputSlot=document.createElement("slot"),this.focus=()=>{t.focus()},this.inputSlot.setAttribute("name","input"),this.inputSlot.setAttribute("slot","input"),this.baseElement.appendChild(this.inputSlot),this.appendChild(t)}}}))((0,n.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,s.Wf)("vaadin-text-field")}\n\t\t\t${(0,s.bi)(d.cssVarList)}\n\t\t\t${(0,s.wm)("vaadin-text-field",d.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},19357:(t,e,i)=>{i.r(e),i.d(e,{TextFieldClass:()=>n.z}),i(79789);var n=i(56417);customElements.define(n.f,n.z)},4447:(t,e,i)=>{i.d(e,{Z:()=>f});const{host:n,label:r,placeholder:o,requiredIndicator:a,inputField:s,input:l,helperText:p,errorMessage:d,disabledPlaceholder:u,inputDisabled:c,externalInput:h,externalInputDisabled:b,externalPlaceholder:y,externalDisabledPlaceholder:m}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},f={fontSize:[{},n],fontFamily:[r,s,p,d],hostWidth:{...n,property:"width"},hostMinWidth:{...n,property:"min-width"},hostDirection:{...n,property:"direction"},inputBackgroundColor:{...s,property:"background-color"},labelTextColor:[{...r,property:"color"},{...a,property:"color"},{...r,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...d,property:"color"},helperTextColor:{...p,property:"-webkit-text-fill-color"},inputValueTextColor:[{...s,property:"color"},{...c,property:"-webkit-text-fill-color"},{...b,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...l,property:"color"},{...h,property:"color"}],labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...s,property:"border-color"},inputBorderWidth:{...s,property:"border-width"},inputBorderStyle:{...s,property:"border-style"},inputBorderRadius:{...s,property:"border-radius"},inputHeight:{...s,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"},{...h,property:"padding-left"},{...h,property:"padding-right"}],inputOutlineColor:{...s,property:"outline-color"},inputOutlineStyle:{...s,property:"outline-style"},inputOutlineWidth:{...s,property:"outline-width"},inputOutlineOffset:{...s,property:"outline-offset"},inputTextAlign:[{...l,property:"text-align"},{...h,property:"text-align"}],inputPlaceholderColor:[{...o,property:"color"},{...y,property:"color"},{...u,property:"-webkit-text-fill-color"},{...m,property:"-webkit-text-fill-color"}]}},54201:(t,e,i)=>{i.d(e,{B:()=>d,DY:()=>l,PH:()=>p,Pd:()=>a,TX:()=>r,Wf:()=>c,bi:()=>n,jI:()=>s,jl:()=>o,wm:()=>u});const n=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,r=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${r(t)}\n ${a(t)}\n ${s(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${d(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,c=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`},79789:(t,e,i)=>{i(58725),i(18005)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8106],{19876:(t,e,n)=>{n.d(e,{f:()=>l,v:()=>v});var r=n(94978),i=n(2061),o=n(54567),a=n(22702),d=n(54201);const l=(0,o.iY)("password"),{host:p,inputField:s,inputElement:u,inputElementPlaceholder:c,revealButtonContainer:h,revealButtonIcon:b,label:f,requiredIndicator:g,errorMessage:w,helperText:y}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:"> input:placeholder-shown"},revealButtonContainer:{selector:()=>"::part(reveal-button)"},revealButtonIcon:{selector:()=>"::part(reveal-button)::before"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},v=(0,i.qC)((0,r.yk)({mappings:{hostWidth:{...p,property:"width"},hostMinWidth:{...p,property:"min-width"},hostDirection:{...p,property:"direction"},fontSize:[{},p],fontFamily:[f,s,w,y],inputHeight:{...s,property:"height"},inputHorizontalPadding:[{...u,property:"padding-left"},{...u,property:"padding-right"}],inputBackgroundColor:{...s,property:"background-color"},inputBorderStyle:{...s,property:"border-style"},inputBorderWidth:{...s,property:"border-width"},inputBorderColor:{...s,property:"border-color"},inputBorderRadius:{...s,property:"border-radius"},inputOutlineColor:{...s,property:"outline-color"},inputOutlineStyle:{...s,property:"outline-style"},inputOutlineOffset:{...s,property:"outline-offset"},inputOutlineWidth:{...s,property:"outline-width"},labelTextColor:[{...f,property:"color"},{...g,property:"color"}],labelRequiredIndicator:{...g,property:"content"},errorMessageTextColor:{...w,property:"color"},inputValueTextColor:{...u,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},revealButtonOffset:[{...h,property:"margin-right"},{...h,property:"margin-left"}],revealButtonSize:{...h,property:"font-size"},revealButtonColor:{...b,property:"color"}}}),r.e4,(0,r.dj)({proxyProps:["value","selectionStart"]}),r.Ae,a.Z)((0,r.DM)({slots:["","suffix"],wrappedEleName:"vaadin-password-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,d.bi)(v.cssVarList)}\n\t\t\t${(0,d.Pd)("vaadin-password-field")}\n ${(0,d.Wf)("vaadin-password-field")}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tmin-height: 0;\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t}\n\t\t\tvaadin-password-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t[readonly] vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${v.cssVarList.inputOutlineColor});\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},79279:(t,e,n)=>{n.r(e),n.d(e,{PasswordClass:()=>r.v}),n(17056);var r=n(19876);customElements.define(r.f,r.v)},22702:(t,e,n)=>{n.d(e,{Z:()=>r});const r=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable&&this.isReadOnly){const e=this.baseElement.querySelector("input"),n=e.getAttribute("type");e.setAttribute("type","text"),setTimeout((()=>e.focus()));const r=i=>{e.setAttribute("type",n),t.target.removeEventListener("mouseup",r),t.target.removeEventListener("dragend",r)};t.target.addEventListener("mouseup",r,{once:!0}),t.target.addEventListener("dragend",r,{once:!0})}})),super.init?.()}}},54201:(t,e,n)=>{n.d(e,{B:()=>s,DY:()=>l,PH:()=>p,Pd:()=>a,TX:()=>i,Wf:()=>c,bi:()=>r,jI:()=>d,jl:()=>o,wm:()=>u});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,i=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,d=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,s=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${i(t)}\n ${a(t)}\n ${d(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${s(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,c=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8106],{19876:(t,e,n)=>{n.d(e,{f:()=>p,v:()=>w});var r=n(94978),o=n(2061),i=n(54567),a=n(22702),s=n(54201),l=n(64365);const p=(0,i.iY)("password"),{host:d,inputField:u,inputElement:c,inputElementPlaceholder:h,revealButtonContainer:b,revealButtonIcon:f,label:g,requiredIndicator:y,errorMessage:m,helperText:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:()=>":host input:placeholder-shown"},revealButtonContainer:{selector:"::part(reveal-button)"},revealButtonIcon:{selector:"::part(reveal-button)::before"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},w=(0,o.qC)((0,r.yk)({mappings:{hostWidth:{...d,property:"width"},hostMinWidth:{...d,property:"min-width"},hostDirection:{...d,property:"direction"},fontSize:[{},d],fontFamily:[g,u,m,v],inputHeight:{...u,property:"height"},inputHorizontalPadding:[{...c,property:"padding-left"},{...c,property:"padding-right"}],inputBackgroundColor:{...u,property:"background-color"},inputBorderStyle:{...u,property:"border-style"},inputBorderWidth:{...u,property:"border-width"},inputBorderColor:{...u,property:"border-color"},inputBorderRadius:{...u,property:"border-radius"},inputOutlineColor:{...u,property:"outline-color"},inputOutlineStyle:{...u,property:"outline-style"},inputOutlineOffset:{...u,property:"outline-offset"},inputOutlineWidth:{...u,property:"outline-width"},labelTextColor:[{...g,property:"color"},{...y,property:"color"}],labelRequiredIndicator:{...y,property:"content"},errorMessageTextColor:{...m,property:"color"},inputPlaceholderTextColor:[{...h,property:"color"},{selector:()=>":host ::slotted(input:placeholder-shown)",property:"color"}],inputValueTextColor:[{...c,property:"color"},{selector:()=>":host ::slotted(input)",property:"color"}],revealButtonOffset:[{...b,property:"margin-right"},{...b,property:"margin-left"}],revealButtonSize:{...b,property:"font-size"},revealButtonColor:{...f,property:"color"}}}),r.e4,(0,r.dj)({proxyProps:["value","selectionStart"]}),r.Ae,a.Z,(t=>class extends t{init(){super.init?.(),this.baseElement.checkValidity=()=>{},this.setAttribute("external-input","true");const t=this.baseElement.querySelector("input"),e=(0,l.nC)("external-input","suffix");this.baseElement.appendChild(e);const n=(0,l.X$)("external-input",this.getAutocompleteType());setTimeout((()=>{(0,l.Gc)(t,n)})),this.handleExternalInputEvents(n),(0,i.tg)(t,n,{includeAttrs:["type","readonly"]}),t.addEventListener("focus",(t=>{t.preventDefault(),t.isTrusted&&n.focus()})),this.addEventListener("focus",(t=>{t.preventDefault(),this.focus()})),this.appendChild(n)}getAutocompleteType(){return this.getAttribute("autocomplete")||"current-password"}handleExternalInputEvents(t){t.addEventListener("input",(t=>{this.value=t.target.value})),t.addEventListener("focus",(()=>{this.setAttribute("focused","true")}))}}))((0,r.DM)({slots:["","suffix"],wrappedEleName:"vaadin-password-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${(0,s.bi)(w.cssVarList)}\n\t\t\t${(0,s.Pd)("vaadin-password-field")}\n ${(0,s.Wf)("vaadin-password-field")}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${w.cssVarList.inputOutlineColor});\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:p}))},64365:(t,e,n)=>{n.d(e,{Gc:()=>i,X$:()=>o,nC:()=>r});const r=(t,e)=>{const n=document.createElement("slot");return n.setAttribute("name",t),n.setAttribute("slot",e),n},o=(t,e)=>{const n=document.createElement("input");return n.setAttribute("slot",t),n.setAttribute("type","password"),n.setAttribute("data-hidden-input","true"),n.setAttribute("autocomplete",e),n},i=(t,e)=>{const n=getComputedStyle(t),r=n.getPropertyValue("height"),o=n.getPropertyValue("padding-left"),i=n.getPropertyValue("padding-right"),a=n.getPropertyValue("font-size"),s=n.getPropertyValue("font-family"),l=n.getPropertyValue("letter-spacing"),p=n.getPropertyValue("caret-color"),d=((t,e)=>{t.value="_";const n=e.getPropertyValue("color");return t.value="",n})(t,n);e.style=`\n all: unset !important;\n position: absolute !important;\n width: calc(100% - 3em) !important;\n background-color: transparent !important;\n color: ${d} !important;\n height: ${r} !important;\n left: ${o} !important;\n right: ${i} !important;\n font-size: ${a} !important;\n font-family: ${s} !important;\n letter-spacing: ${l} !important;\n caret-color: ${p} !important;\n `}},79279:(t,e,n)=>{n.r(e),n.d(e,{PasswordClass:()=>r.v}),n(17056);var r=n(19876);customElements.define(r.f,r.v)},22702:(t,e,n)=>{n.d(e,{Z:()=>r});const r=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){super.init?.();const t=this.querySelector("input");t?.addEventListener("mousedown",(e=>{if(this.isDraggable&&this.isReadOnly){t.setAttribute("inert","true");const n=e.target,r=n.getAttribute("type");n.setAttribute("type","text"),setTimeout((()=>{n.focus()}));const o=e=>{n.setAttribute("type",r),t.removeAttribute("inert"),this.removeEventListener("mouseup",o),this.removeEventListener("dragend",o)};this.addEventListener("dragend",o,{once:!0}),this.addEventListener("mouseup",o,{once:!0})}}))}}},54201:(t,e,n)=>{n.d(e,{B:()=>d,DY:()=>l,PH:()=>p,Pd:()=>a,TX:()=>o,Wf:()=>c,bi:()=>r,jI:()=>s,jl:()=>i,wm:()=>u});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,o=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,i=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${o(t)}\n ${a(t)}\n ${s(t)}\n ${i(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${d(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,c=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.313",
3
+ "version": "1.0.315",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -22,13 +22,24 @@ const customMixin = (superclass) =>
22
22
  name="new-password"
23
23
  tabindex="-1"
24
24
  slot="input"
25
- ></${descopeInternalComponentName}>
25
+ >
26
+ </${descopeInternalComponentName}>
26
27
  `;
27
28
 
29
+ this.setAttribute('external-input', 'true');
30
+
28
31
  this.baseElement.appendChild(template.content.cloneNode(true));
29
32
 
30
33
  this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
31
34
 
35
+ // get descope input components
36
+ this.passwordInput = this.inputElement.querySelector('[data-id="password"]');
37
+ this.confirmInput = this.inputElement.querySelector('[data-id="confirm"]');
38
+
39
+ // create slots for external password input
40
+ this.createExternalInput(this.passwordInput, 'external-password-input');
41
+ this.createExternalInput(this.confirmInput, 'external-confirm-input');
42
+
32
43
  forwardAttrs(this, this.inputElement, {
33
44
  includeAttrs: [
34
45
  'password-label',
@@ -51,6 +62,20 @@ const customMixin = (superclass) =>
51
62
  ],
52
63
  });
53
64
  }
65
+
66
+ createExternalInput(node, slotName) {
67
+ const externalInput = node.querySelector('input');
68
+ const slotEle = document.createElement('slot');
69
+ const targetSlot = externalInput.getAttribute('slot');
70
+ slotEle.setAttribute('name', slotName);
71
+ slotEle.setAttribute('slot', targetSlot);
72
+ node.appendChild(slotEle);
73
+
74
+ // move external input
75
+ externalInput.setAttribute('slot', slotName);
76
+ externalInput.setAttribute('data-hidden-input', 'true');
77
+ this.appendChild(externalInput);
78
+ }
54
79
  };
55
80
 
56
81
  const {
@@ -138,6 +163,7 @@ export const NewPasswordClass = compose(
138
163
  padding: 0;
139
164
  }
140
165
  descope-new-password-internal > .wrapper {
166
+ -webkit-mask-image: none;
141
167
  width: 100%;
142
168
  height: 100%;
143
169
  display: flex;
@@ -12,6 +12,7 @@ const passwordInputAttrs = ['password-label', 'password-placeholder'];
12
12
  const confirmInputAttrs = ['confirm-label', 'confirm-placeholder'];
13
13
  const policyPanelAttrs = ['has-validation'];
14
14
  const commonAttrs = [
15
+ 'has-confirm',
15
16
  'disabled',
16
17
  'bordered',
17
18
  'size',
@@ -34,7 +35,7 @@ const BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div'
34
35
 
35
36
  class NewPasswordInternal extends BaseInputClass {
36
37
  static get observedAttributes() {
37
- return ['has-confirm'].concat(BaseInputClass.observedAttributes || [], inputRelatedAttrs);
38
+ return [].concat(BaseInputClass.observedAttributes || [], inputRelatedAttrs);
38
39
  }
39
40
 
40
41
  constructor() {
@@ -60,6 +61,14 @@ class NewPasswordInternal extends BaseInputClass {
60
61
  return this.getAttribute('has-confirm') === 'true';
61
62
  }
62
63
 
64
+ onHasConfirmChange(hasConfirm) {
65
+ this.confirmInput.style.display = hasConfirm ? '' : 'none';
66
+ }
67
+
68
+ onHasValidationChange(hasValidation) {
69
+ this.policyPanel.style.display = hasValidation ? '' : 'none';
70
+ }
71
+
63
72
  get hasValidation() {
64
73
  return this.getAttribute('has-validation') === 'true';
65
74
  }
@@ -98,20 +107,15 @@ class NewPasswordInternal extends BaseInputClass {
98
107
  this.renderInputs(this.hasConfirm, this.hasValidation);
99
108
  }
100
109
 
101
- renderInputs(shouldRenderConfirm, shouldRenderValidation) {
102
- let template = `
110
+ renderInputs() {
111
+ const template = `
103
112
  <div>
104
- <descope-password data-id="password"></descope-password>
105
- <descope-policy-validation class="${
106
- shouldRenderValidation ? 'hidden' : ''
107
- }"></descope-policy-validation>
113
+ <descope-password autocomplete="new-password" data-id="password"></descope-password>
114
+ <descope-policy-validation></descope-policy-validation>
108
115
  </div>
116
+ <descope-password autocomplete="new-password" data-id="confirm"></descope-password>
109
117
  `;
110
118
 
111
- if (shouldRenderConfirm) {
112
- template += `<descope-password data-id="confirm"></descope-password>`;
113
- }
114
-
115
119
  this.wrapperEle.innerHTML = template;
116
120
 
117
121
  this.passwordInput = this.querySelector('[data-id="password"]');
@@ -122,12 +126,7 @@ class NewPasswordInternal extends BaseInputClass {
122
126
 
123
127
  this.initInputs();
124
128
 
125
- // we are calling attributeChangedCallback with all the input related attributes
126
- // in order to set it on the newly generated input
127
- [...passwordInputAttrs, ...confirmInputAttrs, ...commonAttrs].forEach((attr) => {
128
- this.attributeChangedCallback(attr, null, this.getAttribute(attr));
129
- });
130
-
129
+ // sync input value to policy validation panel
131
130
  this.passwordInput.addEventListener('input', (e) => {
132
131
  this.policyPanel.setAttribute('value', e.target.value);
133
132
  });
@@ -203,22 +202,14 @@ class NewPasswordInternal extends BaseInputClass {
203
202
  value === null ? ele?.removeAttribute(name) : ele?.setAttribute(name, value);
204
203
  }
205
204
 
206
- hidePolicy() {
207
- this.policyPanel.classList.add('hidden');
208
- }
209
-
210
- showPolicy() {
211
- this.policyPanel.classList.remove('hidden');
212
- }
213
-
214
205
  attributeChangedCallback(attrName, oldValue, newValue) {
215
206
  super.attributeChangedCallback?.(attrName, oldValue, newValue);
216
207
 
217
208
  if (oldValue !== newValue) {
218
209
  if (attrName === 'has-validation') {
219
- this.renderInputs(this.hasConfirm, newValue === 'true');
210
+ this.onHasValidationChange(newValue === 'true');
220
211
  } else if (attrName === 'has-confirm') {
221
- this.renderInputs(newValue !== null && newValue !== 'false', this.hasValidation);
212
+ this.onHasConfirmChange(newValue === 'true');
222
213
  } else if (commonAttrs.includes(attrName)) {
223
214
  this.inputs.forEach((input) => this.toggleBooleanAttribute(input, attrName, newValue));
224
215
  } else if (passwordInputAttrs.includes(attrName)) {
@@ -234,9 +225,6 @@ class NewPasswordInternal extends BaseInputClass {
234
225
  newValue
235
226
  );
236
227
  }
237
- if (attrName === 'has-validation') {
238
- newValue === 'true' ? this.showPolicy() : this.hidePolicy();
239
- }
240
228
  }
241
229
  }
242
230
  }
@@ -6,16 +6,86 @@ import {
6
6
  componentNameValidationMixin,
7
7
  } from '../../mixins';
8
8
  import { compose } from '../../helpers';
9
- import { getComponentName } from '../../helpers/componentHelpers';
9
+ import { getComponentName, syncAttrs } from '../../helpers/componentHelpers';
10
10
  import passwordDraggableMixin from './passwordDraggableMixin';
11
11
  import {
12
12
  resetInputLabelPosition,
13
13
  resetInputCursor,
14
14
  useHostExternalPadding,
15
15
  } from '../../helpers/themeHelpers/resetHelpers';
16
+ import {
17
+ applyExternalInputStyles,
18
+ createExternalInputEle,
19
+ createExternalInputSlot,
20
+ } from './helpers';
16
21
 
17
22
  export const componentName = getComponentName('password');
18
23
 
24
+ const customMixin = (superclass) =>
25
+ class PasswordFieldMixinClass extends superclass {
26
+ init() {
27
+ super.init?.();
28
+
29
+ // reset vaadin's checkValidity
30
+ this.baseElement.checkValidity = () => {};
31
+ // set safety attribute `external-input`
32
+ this.setAttribute('external-input', 'true');
33
+
34
+ // use original input element as reference
35
+ const origInput = this.baseElement.querySelector('input');
36
+
37
+ // create external slot
38
+ const externalInputSlot = createExternalInputSlot('external-input', 'suffix');
39
+ // append external slot to base element
40
+ this.baseElement.appendChild(externalInputSlot);
41
+
42
+ // create external input
43
+ const externalInput = createExternalInputEle('external-input', this.getAutocompleteType());
44
+
45
+ // apply original input's styles to external input
46
+ setTimeout(() => {
47
+ applyExternalInputStyles(origInput, externalInput);
48
+ });
49
+
50
+ // set external input events
51
+ this.handleExternalInputEvents(externalInput);
52
+
53
+ // sync input stateful attributes: `type` (for visibility state change) and `readonly`
54
+ syncAttrs(origInput, externalInput, { includeAttrs: ['type', 'readonly'] });
55
+
56
+ origInput.addEventListener('focus', (e) => {
57
+ e.preventDefault();
58
+ if (e.isTrusted) {
59
+ externalInput.focus();
60
+ }
61
+ });
62
+
63
+ this.addEventListener('focus', (e) => {
64
+ e.preventDefault();
65
+ this.focus();
66
+ });
67
+
68
+ // append external input to component's DOM
69
+ this.appendChild(externalInput);
70
+ }
71
+
72
+ getAutocompleteType() {
73
+ return this.getAttribute('autocomplete') || 'current-password';
74
+ }
75
+
76
+ handleExternalInputEvents(inputEle) {
77
+ // sync value of insible input back to original input
78
+ inputEle.addEventListener('input', (e) => {
79
+ this.value = e.target.value;
80
+ });
81
+
82
+ // sync `focused` attribute on host when focusing on external input
83
+ inputEle.addEventListener('focus', () => {
84
+ this.setAttribute('focused', 'true');
85
+ });
86
+ }
87
+ };
88
+
19
89
  const {
20
90
  host,
21
91
  inputField,
@@ -31,9 +101,9 @@ const {
31
101
  host: { selector: () => ':host' },
32
102
  inputField: { selector: '::part(input-field)' },
33
103
  inputElement: { selector: '> input' },
34
- inputElementPlaceholder: { selector: '> input:placeholder-shown' },
35
- revealButtonContainer: { selector: () => '::part(reveal-button)' },
36
- revealButtonIcon: { selector: () => '::part(reveal-button)::before' },
104
+ inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },
105
+ revealButtonContainer: { selector: '::part(reveal-button)' },
106
+ revealButtonIcon: { selector: '::part(reveal-button)::before' },
37
107
  label: { selector: '::part(label)' },
38
108
  requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
39
109
  helperText: { selector: '::part(helper-text)' },
@@ -72,8 +142,14 @@ export const PasswordClass = compose(
72
142
  labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
73
143
  errorMessageTextColor: { ...errorMessage, property: 'color' },
74
144
 
75
- inputValueTextColor: { ...inputElement, property: 'color' },
76
- inputPlaceholderTextColor: { ...inputElementPlaceholder, property: 'color' },
145
+ inputPlaceholderTextColor: [
146
+ { ...inputElementPlaceholder, property: 'color' },
147
+ { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },
148
+ ],
149
+ inputValueTextColor: [
150
+ { ...inputElement, property: 'color' },
151
+ { selector: () => ':host ::slotted(input)', property: 'color' },
152
+ ],
77
153
 
78
154
  revealButtonOffset: [
79
155
  { ...revealButtonContainer, property: 'margin-right' },
@@ -86,7 +162,8 @@ export const PasswordClass = compose(
86
162
  draggableMixin,
87
163
  proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
88
164
  componentNameValidationMixin,
89
- passwordDraggableMixin
165
+ passwordDraggableMixin,
166
+ customMixin
90
167
  )(
91
168
  createProxy({
92
169
  slots: ['', 'suffix'],
@@ -97,6 +174,7 @@ export const PasswordClass = compose(
97
174
  max-width: 100%;
98
175
  min-width: 10em;
99
176
  box-sizing: border-box;
177
+ position: relative;
100
178
  }
101
179
  ${useHostExternalPadding(PasswordClass.cssVarList)}
102
180
  ${resetInputCursor('vaadin-password-field')}
@@ -108,7 +186,9 @@ export const PasswordClass = compose(
108
186
  padding: 0;
109
187
  }
110
188
  vaadin-password-field > input {
189
+ -webkit-mask-image: none;
111
190
  box-sizing: border-box;
191
+ opacity: 1;
112
192
  }
113
193
  vaadin-password-field::part(input-field) {
114
194
  box-sizing: border-box;
@@ -117,12 +197,11 @@ export const PasswordClass = compose(
117
197
  vaadin-password-field[focus-ring]::part(input-field) {
118
198
  box-shadow: none;
119
199
  }
120
- vaadin-password-field > input {
200
+ :host ::slotted(input) {
121
201
  min-height: 0;
122
- -webkit-mask-image: none;
123
- }
124
- vaadin-password-field[readonly] > input:placeholder-shown {
125
- opacity: 1;
202
+ }
203
+ :host([readonly]) ::slotted(input:placeholder-shown) {
204
+ opacity: 0;
126
205
  }
127
206
  vaadin-password-field::before {
128
207
  height: initial;
@@ -133,11 +212,9 @@ export const PasswordClass = compose(
133
212
  vaadin-password-field-button {
134
213
  cursor: pointer;
135
214
  }
136
-
137
- [readonly] vaadin-password-field-button {
215
+ :host([readonly]) vaadin-password-field-button {
138
216
  pointer-events: none;
139
217
  }
140
-
141
218
  vaadin-password-field-button[focus-ring] {
142
219
  box-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});
143
220
  }