@reachfive/identity-ui 1.32.1 → 1.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @reachfive/identity-ui - v1.32.1
3
- * Compiled Thu, 06 Feb 2025 17:46:27 UTC
2
+ * @reachfive/identity-ui - v1.32.2
3
+ * Compiled Mon, 10 Feb 2025 15:46:55 UTC
4
4
  *
5
5
  * Copyright (c) ReachFive.
6
6
  *
@@ -307,7 +307,7 @@
307
307
  `,U8=UX.div`
308
308
  flex-basis: ${e=>e.width}%;
309
309
  ${e=>e.minWidth?`min-width: ${e.minWidth}px;`:void 0}
310
- `,j8=({i18n:e,inputId:t,label:n,locale:r,onChange:a,path:o,required:i,showLabel:s,validation:l={},value:u,yearDebounce:c=1e3})=>{const d=L4(u,"raw")?u.raw:u,[f,h]=DD.useState(d?function(e,t){return b8(e,t?.in).getDate()}(d):void 0),[p,g]=DD.useState(d?function(e,t){return b8(e,t?.in).getMonth()}(d):void 0),[m,v]=DD.useState(d?function(e,t){return b8(e,t?.in).getFullYear()}(d):void 0),y=((e,t)=>{const[n,r]=DD.useState(e);return DD.useEffect((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n})(m,c),b=(e,t)=>{Number.isNaN(Number(t))||e(Number(t))},w=l&&n6(l)?l.error:void 0;DD.useEffect((()=>{void 0!==f&&void 0!==p&&void 0!==y&&a({value:new Date(y,p,f),isDirty:!0})}),[y,p,f]);const C=DD.useMemo((()=>k8({start:A8(new Date),end:E8(new Date)}).map((e=>P8(e,{month:"long"},{locale:r})))),[r]),S=DD.useMemo((()=>[...Array(y&&p?T8(new Date(y,p,1)):31).keys()].map((e=>e+1))),[y,p]);f&&!S.includes(f)&&h(void 0);const $=DD.useMemo((()=>new Intl.DateTimeFormat(r,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts().map((e=>e.type)).filter((e=>["day","month","year"].includes(e)))),[r]),k={day:_D.createElement(U8,{key:"day",width:20,minWidth:70},_D.createElement(b6,{name:`${o}.day`,value:f??"",hasError:!!w,required:i,onChange:e=>b(h,e.target.value),placeholder:e("day"),options:S.map((e=>({value:`${e}`,label:`${e}`}))),"data-testid":`${o}.day`,"aria-label":e("day")})),month:_D.createElement(U8,{key:"month",width:50},_D.createElement(b6,{name:`${o}.month`,value:p??"",hasError:!!w,required:i,onChange:e=>b(g,e.target.value),placeholder:e("month"),options:C.map(((e,t)=>({value:`${t}`,label:e}))),"data-testid":`${o}.month`,"aria-label":e("month")})),year:_D.createElement(U8,{key:"year",width:30,minWidth:100},_D.createElement(y6,{type:"number",maxLength:4,inputMode:"numeric",name:`${o}.year`,value:m??"",hasError:!!w,required:i,onChange:e=>b(v,e.target.value),placeholder:e("year"),"data-testid":`${o}.year`,"aria-label":e("year")}))};return _D.createElement(m6,{inputId:t,labelText:n,error:w,showLabel:s,required:i},_D.createElement(G8,null,$.flatMap((e=>k[e]))))},z8=e=>new Intl.DateTimeFormat(e).formatToParts().map((e=>{switch(e.type){case"day":return"dd";case"month":return"mm";case"year":return"yyyy";case"literal":return e.value}})).join(""),K8=e=>new r6({rule:e=>S8(e),hint:"date",parameters:{format:z8(e)}});function V8({format:e,key:t="date",label:n="date",locale:r,validator:a,yearDebounce:o,...i},s){return d6({key:t,label:n,...i,format:e??{bind:e=>{const t=e?I8(e):void 0;return t&&S8(t)?{raw:t}:void 0},unbind:e=>L4(e,"raw")?x8(e.raw):e?x8(e):null},validator:a?K8(s.language).and(a):K8(s.language),component:j8,extendedParams:{locale:r??s.language,yearDebounce:o}})}const H8=(e=6,t=129)=>new r6({rule:n=>{const r=$8(new Date,n);return e<=r&&r<=t},hint:"birthdate.yearLimit",parameters:{min:e,max:t}});function W8(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Z8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z8(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Z8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q8(e,t){for(var n,r=0,a=W8(t.split(""));!(n=a()).done;){n.value===e&&r++}return r}function Y8(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J8(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q8(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",n=arguments.length>2?arguments[2]:void 0;if(!e)return function(e){return{text:e}};var r=q8(t,e);return function(a){if(!a)return{text:"",template:e};for(var o,i=0,s="",l=Y8(e.split(""));!(o=l()).done;){var u=o.value;if(u===t){if(s+=a[i],++i===a.length&&a.length<r)break}else s+=u}return n&&(s=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:" ",a=e.length,o=q8("(",e)-q8(")",e);o>0&&a<t.length;)e+=t[a].replace(n,r),")"===t[a]&&o--,a++;return e}(s,e)),{text:s,template:e}}}var X8={Backspace:8,Delete:46};function e9(e,t){void 0!==t&&(!function(){if("undefined"!=typeof navigator)return t9.test(navigator.userAgent)}()?e.setSelectionRange(t,t):setTimeout((function(){return e.setSelectionRange(t,t)}),0))}var t9=/Android/i;function n9(e,t,n,r,a){if(!t.hasAttribute("readonly")){var o=function(e){switch(e.keyCode){case X8.Backspace:return"Backspace";case X8.Delete:return"Delete"}}(e);switch(o){case"Delete":case"Backspace":e.preventDefault();var i=function(e){if(e.selectionStart!==e.selectionEnd)return{start:e.selectionStart,end:e.selectionEnd}}(t);return i?(function(e,t){var n=e.value;n=n.slice(0,t.start)+n.slice(t.end),e.value=n,e9(e,t.start)}(t,i),r9(t,n,r,void 0,a)):r9(t,n,r,o,a)}}}function r9(e,t,n,r,a){var o=function(e,t,n){for(var r={},a="",o=0,i=0;i<e.length;){var s=n(e[i],a,r);void 0!==s&&(a+=s,void 0!==t&&(t===i?o=a.length-1:t>i&&(o=a.length))),i++}return void 0===t&&(o=a.length),{value:a,caret:o}}(e.value,e.selectionStart,t),i=o.value,s=o.caret;if(r){var l=function(e,t,n){switch(n){case"Backspace":t>0&&(e=e.slice(0,t-1)+e.slice(t),t--);break;case"Delete":e=e.slice(0,t)+e.slice(t+1)}return{value:e,caret:t}}(i,s,r);i=l.value,s=l.caret}var u=function(e,t,n){"string"==typeof n&&(n=Q8(n));var r=n(e)||{},a=r.text,o=r.template;if(void 0===a&&(a=e),o)if(void 0===t)t=a.length;else{for(var i=0,s=!1,l=-1;i<a.length&&i<o.length;){if(a[i]!==o[i]){if(0===t){s=!0,t=i;break}l=i,t--}i++}s||(t=l+1)}return{text:a,caret:t}}(i,s,n),c=u.text;s=u.caret,e.value=c,e9(e,s),a(i)}var a9=["value","parse","format","inputComponent","onChange","onKeyDown"];function o9(){return o9=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o9.apply(this,arguments)}function i9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function s9(e,t){var n=e.value,r=e.parse,a=e.format,o=e.inputComponent,i=e.onChange,s=e.onKeyDown,l=i9(e,a9),u=DD.useRef(),c=DD.useCallback((function(e){u.current=e,t&&("function"==typeof t?t(e):t.current=e)}),[t]),d=DD.useCallback((function(e){r9(u.current,r,a,void 0,i)}),[u,r,a,i]),f=DD.useCallback((function(e){if(s&&s(e),!e.defaultPrevented)return n9(e,u.current,r,a,i)}),[u,r,a,i,s]);return _D.createElement(o,o9({},l,{ref:c,value:a(l9(n)?"":n).text,onKeyDown:f,onChange:d}))}function l9(e){return null==e}function u9(e){var t=e.country,n=e.international,r=e.withCountryCallingCode,a=e.metadata;return t&&n&&!r?"+".concat(p1(t,a)):""}function c9(e,t){return t&&" "===(e=e.slice(t.length))[0]&&(e=e.slice(1)),e}function d9(e,t,n){if(!n||!n.ignoreRest){return R1(e,t,(function(e){if(n&&"end"===e)n.ignoreRest=!0}))}}function f9(e){var t=e.onKeyDown,n=e.international;return DD.useCallback((function(e){e.keyCode===h9&&n&&e.target instanceof HTMLInputElement&&e.target.selectionStart===p9?e.preventDefault():t&&t(e)}),[t,n])}(s9=_D.forwardRef(s9)).propTypes={parse:y2.func.isRequired,format:y2.func.isRequired,inputComponent:y2.elementType.isRequired,type:y2.string.isRequired,value:y2.string,onChange:y2.func.isRequired,onKeyDown:y2.func,onCut:y2.func,onPaste:y2.func},s9.defaultProps={inputComponent:"input",type:"text"};var h9=8;var p9=1,g9=["onKeyDown","country","international","withCountryCallingCode","metadata"];function m9(){return m9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m9.apply(this,arguments)}function v9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var y9=function(e){function t(t,n){var r=t.onKeyDown,a=t.country,o=t.international,i=t.withCountryCallingCode,s=t.metadata,l=void 0===s?e:s,u=v9(t,g9),c=DD.useCallback((function(e){var t=new O4(a,l),n=u9({country:a,international:o,withCountryCallingCode:i,metadata:l}),r=t.input(n+e),s=t.getTemplate();return n&&(r=c9(r,n),s&&(s=c9(s,n))),{text:r,template:s}}),[a,l]),d=f9({onKeyDown:r,international:o});return _D.createElement(s9,m9({},u,{ref:n,parse:d9,format:c,onKeyDown:d}))}return(t=_D.forwardRef(t)).propTypes={value:y2.string.isRequired,onChange:y2.func.isRequired,onKeyDown:y2.func,country:y2.string,international:y2.bool,withCountryCallingCode:y2.bool,metadata:y2.object},t}(),b9=["value","onChange","onKeyDown","country","international","withCountryCallingCode","metadata","inputComponent"];function w9(){return w9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w9.apply(this,arguments)}function C9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var S9=function(e){function t(t,n){var r=t.value,a=t.onChange,o=t.onKeyDown,i=t.country,s=t.international,l=t.withCountryCallingCode,u=t.metadata,c=void 0===u?e:u,d=t.inputComponent,f=void 0===d?"input":d,h=C9(t,b9),p=u9({country:i,international:s,withCountryCallingCode:l,metadata:c}),g=DD.useCallback((function(e){var t=N1(e.target.value);t===r&&(0===$9(p,t,i,c).indexOf(e.target.value)&&(t=t.slice(0,-1)));a(t)}),[p,r,a,i,c]),m=f9({onKeyDown:o,international:s});return _D.createElement(f,w9({},h,{ref:n,value:$9(p,r,i,c),onChange:g,onKeyDown:m}))}return(t=_D.forwardRef(t)).propTypes={value:y2.string.isRequired,onChange:y2.func.isRequired,onKeyDown:y2.func,country:y2.string,international:y2.bool,withCountryCallingCode:y2.bool,metadata:y2.object,inputComponent:y2.elementType},t}();function $9(e,t,n,r){return c9(function(e,t,n){return n||(n=t,t=void 0),new O4(t,n).input(e)}(e+t,n,r),e)}function k9(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var E9=["value","onChange","options","disabled","readOnly"],A9=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function M9(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return x9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x9(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T9(){return T9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T9.apply(this,arguments)}function P9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function I9(e){var t=e.value,n=e.onChange,r=e.options,a=e.disabled,o=e.readOnly,i=P9(e,E9),s=DD.useCallback((function(e){var t=e.target.value;n("ZZ"===t?void 0:t)}),[n]);return DD.useMemo((function(){return F9(r,t)}),[r,t]),_D.createElement("select",T9({},i,{disabled:a||o,readOnly:o,value:t||"ZZ",onChange:s}),r.map((function(e){var t=e.value,n=e.label,r=e.divider;return _D.createElement("option",{key:r?"|":t||"ZZ",value:r?"|":t||"ZZ",disabled:!!r,style:r?O9:void 0},n)})))}I9.propTypes={value:y2.string,onChange:y2.func.isRequired,options:y2.arrayOf(y2.shape({value:y2.string,label:y2.string,divider:y2.bool})).isRequired,disabled:y2.bool,readOnly:y2.bool};var O9={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function N9(e){var t=e.value,n=e.options,r=e.className,a=e.iconComponent;e.getIconAspectRatio;var o,i=e.arrowComponent,s=void 0===i?R9:i,l=e.unicodeFlags,u=P9(e,A9),c=DD.useMemo((function(){return F9(n,t)}),[n,t]);return _D.createElement("div",{className:"PhoneInputCountry"},_D.createElement(I9,T9({},u,{value:t,options:n,className:T2("PhoneInputCountrySelect",r)})),l&&t&&_D.createElement("div",{className:"PhoneInputCountryIconUnicode"},k9((o=t)[0])+k9(o[1])),!(l&&t)&&_D.createElement(a,{"aria-hidden":!0,country:t,label:c&&c.label,aspectRatio:l?1:void 0}),_D.createElement(s,null))}function R9(){return _D.createElement("div",{className:"PhoneInputCountrySelectArrow"})}function F9(e,t){for(var n,r=M9(e);!(n=r()).done;){var a=n.value;if(!a.divider&&a.value===t)return a}}N9.propTypes={iconComponent:y2.elementType,arrowComponent:y2.elementType,unicodeFlags:y2.bool};var B9=["country","countryName","flags","flagUrl"];function L9(){return L9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L9.apply(this,arguments)}function D9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function _9(e){var t=e.country,n=e.countryName,r=e.flags,a=e.flagUrl,o=D9(e,B9);return r&&r[t]?r[t]({title:n}):_D.createElement("img",L9({},o,{alt:n,role:n?void 0:"presentation",src:a.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}_9.propTypes={country:y2.string.isRequired,countryName:y2.string.isRequired,flags:y2.objectOf(y2.elementType),flagUrl:y2.string.isRequired};var G9=["aspectRatio"],U9=["title"],j9=["title"];function z9(){return z9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z9.apply(this,arguments)}function K9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function V9(e){var t=e.aspectRatio,n=K9(e,G9);return 1===t?_D.createElement(W9,n):_D.createElement(H9,n)}function H9(e){var t=e.title,n=K9(e,U9);return _D.createElement("svg",z9({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),_D.createElement("title",null,t),_D.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},_D.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),_D.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),_D.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),_D.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),_D.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),_D.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),_D.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}function W9(e){var t=e.title,n=K9(e,j9);return _D.createElement("svg",z9({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),_D.createElement("title",null,t),_D.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},_D.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),_D.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),_D.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),_D.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),_D.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),_D.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),_D.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}function Z9(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q9(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y9(e,t){return!!g1(e,t)||(console.error("Country not found: ".concat(e)),!1)}function J9(e,t){return e&&0===(e=e.filter((function(e){return Y9(e,t)}))).length&&(e=void 0),e}V9.propTypes={title:y2.string.isRequired,aspectRatio:y2.number},H9.propTypes={title:y2.string.isRequired},W9.propTypes={title:y2.string.isRequired};var Q9=["country","label","aspectRatio"];function X9(){return X9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X9.apply(this,arguments)}function e7(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function t7(e){var t=e.flags,n=e.flagUrl,r=e.flagComponent,a=e.internationalIcon;function o(e){var o=e.country,i=e.label,s=e.aspectRatio,l=e7(e,Q9),u=a===V9?s:void 0;return _D.createElement("div",X9({},l,{className:T2("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":1===u,"PhoneInputCountryIcon--border":o})}),o?_D.createElement(r,{country:o,countryName:i,flags:t,flagUrl:n,className:"PhoneInputCountryIconImg"}):_D.createElement(a,{title:i,aspectRatio:u,className:"PhoneInputCountryIconImg"}))}return o.propTypes={country:y2.string,label:y2.string.isRequired,aspectRatio:y2.number},o}function n7(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r7(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a7(e,t){"function"==typeof e?e(t):e.current=t}t7({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:_9,internationalIcon:V9});var o7=y2.shape({country_calling_codes:y2.object.isRequired,countries:y2.object.isRequired}),i7=y2.objectOf(y2.string);function s7(e,t){return"+"+p1(e,t)}function l7(e,t){return K3(e||"",t)}function u7(e,t){var n=t.prevCountry,r=t.newCountry,a=t.metadata,o=t.useNationalFormat;if(n===r)return e;if(!e)return o?"":r?s7(r,a):"";if(r){if("+"===e[0]){if(o)return 0===e.indexOf("+"+p1(r,a))?function(e,t,n){if(t){var r="+"+p1(t,n);if(e.length<r.length){if(0===r.indexOf(e))return""}else if(0===e.indexOf(r))return e.slice(r.length)}for(var a=0,o=Object.keys(n.country_calling_codes);a<o.length;a++){var i=o[a];if(1===e.indexOf(i))return e.slice(1+i.length)}return""}(e,r,a):"";if(n){var i=s7(r,a);return 0===e.indexOf(i)?e:i}var s=s7(r,a);return 0===e.indexOf(s)?e:s}}else if("+"!==e[0])return c7(e,n,a)||"";return e}function c7(e,t,n){if(e){if("+"===e[0]){if("+"===e)return;var r=new O4(t,n);return r.input(e),r.getNumberValue()}if(t){var a=g7(e,t,n);return"+".concat(p1(t,n)).concat(a||"")}}}function d7(e,t,n){var r=g7(e,t,n);if(r){var a=r.length-function(e,t){return t=new s1(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}(t,n);if(a>0)return e.slice(0,e.length-a)}return e}function f7(e,t){var n=t.country,r=t.countries,a=t.defaultCountry,o=t.latestCountrySelectedByUser,i=t.required,s=t.metadata;if("+"===e)return n;var l=function(e,t){var n=new O4(null,t);return n.input(e),n.getCountry()}(e,s);if(l)return!r||r.indexOf(l)>=0?l:void 0;if(n)if(m7(e,n,s)){if(o&&m7(e,o,s))return o;if(a&&m7(e,a,s))return a;if(!i)return}else if(!i)return;return n}function h7(e,t,n){if(0===e.indexOf(s7(t,n))){var r=new O4(t,n);r.input(e);var a=r.getNumber();return a?a.formatNational().replace(/\D/g,""):""}return e.replace(/\D/g,"")}function p7(e,t,n){return String.prototype.localeCompare?e.localeCompare(t,n):e<t?-1:e>t?1:0}function g7(e,t,n){var r=new O4(t,n);r.input(e);var a=r.getNumber();return a&&a.nationalNumber}function m7(e,t,n){for(var r=s7(t,n),a=0;a<e.length&&a<r.length;){if(e[a]!==r[a])return!1;a++}return!0}function v7(e){var t=e.value,n=e.phoneNumber,r=e.defaultCountry,a=e.international,o=e.useNationalFormat,i=e.metadata;return(!1===a||o)&&n&&n.country?function(e){return e.formatNational().replace(/\D/g,"")}(n):!t&&a&&r?s7(r,i):t}function y7(e){return y7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y7(e)}function b7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b7(Object(n),!0).forEach((function(t){C7(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b7(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C7(e,t,n){return t=function(e){var t=function(e,t){if("object"!=y7(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=y7(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y7(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S7(e,t){return null===e&&(e=void 0),null===t&&(t=void 0),e===t}var $7=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function k7(e){return k7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k7(e)}function E7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E7(Object(n),!0).forEach((function(t){R7(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E7(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M7(){return M7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M7.apply(this,arguments)}function x7(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function T7(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,F7(r.key),r)}}function P7(e,t,n){return t=O7(t),function(e,t){if(t&&("object"===k7(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,I7()?Reflect.construct(t,n||[],O7(e).constructor):t.apply(e,n))}function I7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I7=function(){return!!e})()}function O7(e){return O7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O7(e)}function N7(e,t){return N7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N7(e,t)}function R7(e,t,n){return(t=F7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=function(e,t){if("object"!=k7(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=k7(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==k7(t)?t:t+""}var B7=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),R7(n=P7(this,t,[e]),"setInputRef",(function(e){!function(e,t){for(var n,r=n7(e);!(n=r()).done;){var a=n.value;a&&a7(a,t)}}([n.props.inputRef,n.inputRef],e)})),R7(n,"isCountrySupportedWithError",(function(e){return Y9(e,n.props.metadata)})),R7(n,"onCountryChange",(function(e){var t=n.props,r=t.international,a=t.metadata,o=t.onChange,i=t.focusInputOnCountrySelection,s=n.state,l=u7(s.phoneDigits,{prevCountry:s.country,newCountry:e,metadata:a,useNationalFormat:!r}),u=c7(l,e,a);i&&n.inputRef.current.focus(),n.setState({country:e,latestCountrySelectedByUser:e,hasUserSelectedACountry:!0,phoneDigits:l,value:u},(function(){o(u)}))})),R7(n,"onChange",(function(e){var t=n.props,r=t.defaultCountry,a=t.onChange,o=t.addInternationalOption,i=t.international,s=t.limitMaxLength,l=t.countryCallingCodeEditable,u=t.metadata,c=n.state,d=c.countries,f=c.phoneDigits,h=c.country,p=c.latestCountrySelectedByUser,g=function(e,t){var n,r=t.prevPhoneDigits,a=t.country,o=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.countryRequired,l=t.getAnyCountry,u=t.countries,c=t.international,d=t.limitMaxLength,f=t.countryCallingCodeEditable,h=t.metadata;if(c&&!1===f&&a){var p,g=s7(a,h);if(0!==e.indexOf(g))return e&&"+"!==e[0]?p=c7(e=g+e,a,h):e=g,{phoneDigits:e,value:p,country:a}}return!1===c&&a&&e&&"+"===e[0]&&(e=h7(e,a,h)),e&&a&&d&&(e=d7(e,a,h)),!e||"+"===e[0]||a&&!c||(e="+"+e),!e&&r&&"+"===r[0]&&(a=c?void 0:o),"+"===e&&r&&"+"===r[0]&&r.length>1&&(a=void 0),e&&(n="+"===e[0]&&("+"===e||a&&0===s7(a,h).indexOf(e))?void 0:c7(e,a,h)),n&&(a=f7(n,{country:a,countries:u,defaultCountry:o,latestCountrySelectedByUser:i,required:!1,metadata:h}),!1===c&&a&&e&&"+"===e[0]&&(n=c7(e=h7(e,a,h),a,h))),!a&&s&&(a=o||l()),{phoneDigits:e,country:a,value:n}}(e,{prevPhoneDigits:f,country:h,countryRequired:!o,defaultCountry:r,latestCountrySelectedByUser:p,getAnyCountry:function(){return n.getFirstSupportedCountry({countries:d})},countries:d,international:i,limitMaxLength:s,countryCallingCodeEditable:l,metadata:u}),m=g.phoneDigits,v=g.country,y=g.value,b={phoneDigits:m,value:y,country:v};p&&y&&!m7(y,p,u)&&(b.latestCountrySelectedByUser=void 0),!1===l&&(y||m!==n.state.phoneDigits||(b.forceRerender={})),n.setState(b,(function(){return a(y)}))})),R7(n,"_onFocus",(function(){return n.setState({isFocused:!0})})),R7(n,"_onBlur",(function(){return n.setState({isFocused:!1})})),R7(n,"onFocus",(function(e){n._onFocus();var t=n.props.onFocus;t&&t(e)})),R7(n,"onBlur",(function(e){var t=n.props.onBlur;n._onBlur(),t&&t(e)})),R7(n,"onCountryFocus",(function(e){n._onFocus();var t=n.props.countrySelectProps;if(t){var r=t.onFocus;r&&r(e)}})),R7(n,"onCountryBlur",(function(e){n._onBlur();var t=n.props.countrySelectProps;if(t){var r=t.onBlur;r&&r(e)}})),n.inputRef=_D.createRef();var r=n.props,a=r.value;r.labels;var o=r.international,i=r.addInternationalOption,s=r.displayInitialValueAsLocalNumber,l=r.initialValueFormat,u=r.metadata,c=n.props,d=c.defaultCountry,f=c.countries;d&&(n.isCountrySupportedWithError(d)||(d=void 0)),f=J9(f,u);var h=l7(a,u);n.CountryIcon=t7(n.props);var p=function(e){var t,n=e.value,r=e.phoneNumber,a=e.defaultCountry,o=e.getAnyCountry,i=e.countries,s=e.required,l=e.metadata;return r&&r.country?t=r.country:a&&(n&&!m7(n,a,l)||(t=a)),i&&i.indexOf(t)<0&&(t=void 0),!t&&s&&i&&i.length>0&&(t=o()),t}({value:a,phoneNumber:h,defaultCountry:d,required:!i,countries:f||N4(u),getAnyCountry:function(){return n.getFirstSupportedCountry({countries:f})},metadata:u});return n.state={props:n.props,country:p,countries:f,phoneDigits:v7({value:a,phoneNumber:h,defaultCountry:d,international:o,useNationalFormat:s||"national"===l,metadata:u}),value:a},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N7(e,t)}(t,e),function(e,t,n){return t&&T7(e.prototype,t),n&&T7(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"componentDidMount",value:function(){var e=this.props.onCountryChange,t=this.props.defaultCountry,n=this.state.country;e&&(t&&(this.isCountrySupportedWithError(t)||(t=void 0)),n!==t&&e(n))}},{key:"componentDidUpdate",value:function(e,t){var n=this.props.onCountryChange,r=this.state.country;n&&r!==t.country&&n(r)}},{key:"getCountrySelectOptions",value:function(e){var t=e.countries,n=this.props,r=n.international,a=n.countryCallingCodeEditable,o=n.countryOptionsOrder,i=n.addInternationalOption,s=n.labels,l=n.locales,u=n.metadata;return this.useMemoCountrySelectOptions((function(){return function(e,t){if(!t)return e;for(var n,r=[],a=[],o=r,i=function(){var t=n.value;if("|"===t)o.push({divider:!0});else if("..."===t||"…"===t)o=a;else{var r;r="🌐"===t?void 0:t;var i=e.indexOf(e.filter((function(e){return e.value===r}))[0]),s=e[i];e.splice(i,1),o.push(s)}},s=Z9(t);!(n=s()).done;)i();return r.concat(e).concat(a)}(function(e){var t=e.countries,n=e.countryNames,r=e.addInternationalOption,a=e.compareStringsLocales,o=e.compareStrings;o||(o=p7);var i=t.map((function(e){return{value:e,label:n[e]||e}}));return i.sort((function(e,t){return o(e.label,t.label,a)})),r&&i.unshift({label:n.ZZ}),i}({countries:t||N4(u),countryNames:s,addInternationalOption:(!r||!1!==a)&&i,compareStringsLocales:l}),function(e,t){if(e&&(e=e.filter((function(e){switch(e){case"🌐":case"|":case"...":case"…":return!0;default:return Y9(e,t)}}))).length>0)return e}(o,u))}),[t,o,i,s,u])}},{key:"useMemoCountrySelectOptions",value:function(e,t){return this.countrySelectOptionsMemoDependencies&&function(e,t){if(e.length!==t.length)return!1;var n=0;for(;n<e.length;){if(e[n]!==t[n])return!1;n++}return!0}(t,this.countrySelectOptionsMemoDependencies)||(this.countrySelectOptionsMemo=e(),this.countrySelectOptionsMemoDependencies=t),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(e){var t=e.countries;return this.getCountrySelectOptions({countries:t})[0].value}},{key:"render",value:function(){var e=this.props,t=e.name,n=e.disabled,r=e.readOnly,a=e.autoComplete,o=e.style,i=e.className;e.inputRef;var s=e.inputComponent,l=e.numberInputProps,u=e.smartCaret,c=e.countrySelectComponent,d=e.countrySelectProps,f=e.containerComponent,h=e.containerComponentProps;e.defaultCountry,e.countries,e.countryOptionsOrder;var p=e.labels;e.flags,e.flagComponent,e.flagUrl,e.addInternationalOption,e.internationalIcon,e.displayInitialValueAsLocalNumber,e.initialValueFormat,e.onCountryChange,e.limitMaxLength,e.countryCallingCodeEditable,e.focusInputOnCountrySelection,e.reset;var g=e.metadata,m=e.international;e.locales;var v=x7(e,$7),y=this.state,b=y.country,w=y.countries,C=y.phoneDigits,S=y.isFocused,$=u?y9:S9,k=this.getCountrySelectOptions({countries:w});return _D.createElement(f,M7({style:o,className:T2(i,"PhoneInput",{"PhoneInput--focus":S,"PhoneInput--disabled":n,"PhoneInput--readOnly":r})},h),_D.createElement(c,M7({name:t?"".concat(t,"Country"):void 0,"aria-label":p.country},d,{value:b,options:k,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:n||d&&d.disabled,readOnly:r||d&&d.readOnly,iconComponent:this.CountryIcon})),_D.createElement($,M7({ref:this.setInputRef,type:"tel",autoComplete:a},l,v,{international:!!m||void 0,withCountryCallingCode:!!m||void 0,name:t,metadata:g,country:b,value:C||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:n,readOnly:r,inputComponent:s,className:T2("PhoneInputInput",l&&l.className,v.className)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return A7({props:e},function(e,t,n){var r=e.metadata,a=e.countries,o=e.defaultCountry,i=e.value,s=e.reset,l=e.international,u=e.displayInitialValueAsLocalNumber,c=e.initialValueFormat,d=t.defaultCountry,f=t.value,h=t.reset;n.country;var p=n.value,g=n.hasUserSelectedACountry,m=n.latestCountrySelectedByUser,v=function(e){return v7(w7(w7({},e),{},{international:l,useNationalFormat:u||"national"===c,metadata:r}))};if(s!==h)return{phoneDigits:v({value:void 0,defaultCountry:o}),value:void 0,country:o,latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};if(o!==d){var y=!o||Y9(o,r),b=!p||l&&p===v({value:void 0,defaultCountry:d});if(!g&&y&&!i&&b)return{country:o,phoneDigits:v({value:void 0,defaultCountry:o}),value:void 0}}if(!S7(i,f)&&!S7(i,p)){var w,C,S;if(i){w=l7(i,r);var $=J9(a,r);w&&w.country?(!$||$.indexOf(w.country)>=0)&&(C=w.country):(C=f7(i,{country:void 0,countries:$,metadata:r}))||o&&0===i.indexOf(s7(o,r))&&(C=o)}return i?m&&((C?m===C:m7(i,m,r))?C||(C=m):S={latestCountrySelectedByUser:void 0}):S={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0},w7(w7({},S),{},{phoneDigits:v({phoneNumber:w,value:i,defaultCountry:o}),value:i,country:i?C:o})}}(e,t.props,t))}}])}(_D.PureComponent),L7=_D.forwardRef((function(e,t){return _D.createElement(B7,M7({},function(e){for(var t in e=A7({},e),D7)void 0===e[t]&&(e[t]=D7[t]);return e}(e),{inputRef:t}))}));L7.propTypes={value:y2.string,onChange:y2.func.isRequired,onFocus:y2.func,onBlur:y2.func,disabled:y2.bool,readOnly:y2.bool,autoComplete:y2.string,initialValueFormat:y2.oneOf(["national"]),displayInitialValueAsLocalNumber:y2.bool,defaultCountry:y2.string,countries:y2.arrayOf(y2.string),labels:i7,locales:y2.oneOfType([y2.string,y2.arrayOf(y2.string)]),flagUrl:y2.string,flags:y2.objectOf(y2.elementType),flagComponent:y2.elementType,addInternationalOption:y2.bool,internationalIcon:y2.elementType,countryOptionsOrder:y2.arrayOf(y2.string),style:y2.object,className:y2.string,countrySelectComponent:y2.elementType,countrySelectProps:y2.object,inputComponent:y2.elementType,numberInputProps:y2.object,containerComponent:y2.elementType,containerComponentProps:y2.object,smartCaret:y2.bool,international:y2.bool,limitMaxLength:y2.bool,countryCallingCodeEditable:y2.bool,metadata:o7,onCountryChange:y2.func,focusInputOnCountrySelection:y2.bool};var D7={autoComplete:"tel",countrySelectComponent:N9,flagComponent:_9,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:V9,inputComponent:"input",containerComponent:"div",reset:y2.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};var _7={ext:"ext.",country:"Phone number country",phone:"Phone",AB:"Abkhazia",AC:"Ascension Island",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin (French Part)",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",OS:"South Ossetia",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TA:"Tristan da Cunha",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XK:"Kosovo",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"International"},G7=Object.freeze({__proto__:null,default:_7}),U7=["metadata","labels"];function j7(){return j7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j7.apply(this,arguments)}function z7(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function K7(e){var t=_D.forwardRef((function(t,n){var r=t.metadata,a=void 0===r?e:r,o=t.labels,i=void 0===o?_7:o,s=z7(t,U7);return _D.createElement(L7,j7({},s,{ref:n,metadata:a,labels:i}))}));return t.propTypes={metadata:o7,labels:i7},t}function V7(e,t){var n=Array.prototype.slice.call(t);return n.push(L2),e.apply(this,n)}K7();var H7=K7(L2);function W7(){return V7(K3,arguments)}function Z7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return q7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q7(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y7(e){var t=this,n=e.value,r=e.onChange,a=e.country,o=e.defaultCountry,i=e.international,s=e.withCountryCallingCode,l=e.useNationalFormatForDefaultCountryValue,u=e.metadata,c=DD.useRef(),d=function(e,t,n){console.error("[react-phone-number-input] Expected phone number ".concat(e," to correspond to country ").concat(t," but ").concat(n?"in reality it corresponds to country "+n:"it doesn't",".")),c.current=!0},f=function(e){return function(e,t,n,r,a,o,i,s){if(t&&n&&r){var l=s7(t,i);return e?(0!==e.indexOf(l)&&s(e,t),e):l}if(!e)return"";if(!t&&!a)return e;var u=new O4(void 0,i);u.input(e);var c=u.getNumber();return c?t?(c.country&&c.country!==t?s(e,t,c.country):c.countryCallingCode!==p1(t,i)&&s(e,t),n?c.nationalNumber:P1(c.formatNational())):c.countryCallingCode&&c.countryCallingCode===p1(a,i)&&o?P1(c.formatNational()):e:""}(n,a,i,s,o,l,u,(function(){e&&e.onCountryMismatch&&e.onCountryMismatch();for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];d.apply(t,r)}))},h=Z7(DD.useState(a),2),p=h[0],g=h[1],m=Z7(DD.useState(o),2),v=m[0],y=m[1],b=Z7(DD.useState(f()),2),w=b[0],C=b[1],S=Z7(DD.useState(n),2),$=S[0],k=S[1],E=Z7(DD.useState(),2);E[0];var A=E[1],M=DD.useCallback((function(){return A({})}),[A]);function x(e){if(e){a&&i&&!s&&(e="+".concat(p1(a,u)).concat(e));var t=new O4(a||o,u);return t.input(e),t.getNumberValue()}}DD.useEffect((function(){n!==$&&(k(n),C(f()))}),[n]),DD.useEffect((function(){if(a!==p){var e;g(a);var t=f({onCountryMismatch:function(){e=!0}});C(t),e&&k(x(t))}}),[a]),DD.useEffect((function(){o!==v&&(y(o),C(f()))}),[o]),DD.useEffect((function(){$!==n&&r($)}),[$]);var T=DD.useCallback((function(e){var t;if(a)if(i&&s){var n=s7(a,u);if(0!==e.indexOf(n))if(e&&"+"!==e[0])e=n+e;else if(!c.current)return C(n),k(void 0),M()}else e&&"+"===e[0]&&(e=e.slice(1));else o||e&&"+"!==e[0]&&(e="+"+e);e&&(t=x(e)),C(e),k(t)}),[a,i,s,o,u,C,k,M,c]);return[w,T]}var J7=["Component","country","defaultCountry","useNationalFormatForDefaultCountryValue","value","onChange","metadata","international","withCountryCallingCode"];function Q7(){return Q7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q7.apply(this,arguments)}function X7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tee(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function nee(e,t){var n=e.Component,r=e.country,a=e.defaultCountry,o=e.useNationalFormatForDefaultCountryValue,i=void 0===o||o,s=e.value,l=e.onChange,u=e.metadata,c=e.international,d=e.withCountryCallingCode,f=tee(e,J7),h=X7(Y7({value:s,onChange:l,country:r,defaultCountry:a,international:c,withCountryCallingCode:d,useNationalFormatForDefaultCountryValue:i,metadata:u}),2),p=h[0],g=h[1];return _D.createElement(n,Q7({},f,{ref:t,metadata:u,international:c,withCountryCallingCode:d,country:r||a,value:p,onChange:g}))}(nee=_D.forwardRef(nee)).propTypes={value:y2.string,onChange:y2.func.isRequired,country:y2.string,defaultCountry:y2.string,international:y2.bool,withCountryCallingCode:y2.bool,Component:y2.elementType.isRequired,useNationalFormatForDefaultCountryValue:y2.bool,metadata:o7};var ree=nee,aee=["type","autoComplete","smartCaret","metadata"];function oee(){return oee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oee.apply(this,arguments)}function iee(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function see(e){function t(t,n){var r=t.type,a=void 0===r?"tel":r,o=t.autoComplete,i=void 0===o?"tel":o,s=t.smartCaret,l=void 0===s||s,u=t.metadata,c=void 0===u?e:u,d=iee(t,aee);return _D.createElement(ree,oee({},d,{type:a,autoComplete:i,metadata:c,ref:n,Component:l?y9:S9}))}return(t=_D.forwardRef(t)).propTypes={type:y2.string,autoComplete:y2.string,smartCaret:y2.bool,metadata:y2.object},t}see();var lee=see(L2);function uee(e){return"string"==typeof e&&function(){return V7(g1,arguments)}(e)}const cee=(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=yX.apply(void 0,[e].concat(n)),o="sc-global-"+RX(JSON.stringify(a)),i=new jX(a,o);return _D.memo((function e(t){var n=lX(),r=uX(),a=DD.useContext(BX),s=DD.useRef(null);null===s.current&&(s.current=n.allocateGSInstance(o));var l=s.current;if(i.isStatic)i.renderStyles(l,NQ,n,r);else{var u=yQ({},t,{theme:TX(t,a,e.defaultProps)});i.renderStyles(l,u,n,r)}return DD.useEffect((function(){return function(){return i.removeStyles(l,n)}}),CQ),null}))})`
310
+ `,j8=({i18n:e,inputId:t,label:n,locale:r,onChange:a,path:o,required:i,showLabel:s,validation:l={},value:u,yearDebounce:c=1e3})=>{const d=L4(u,"raw")?u.raw:u,[f,h]=DD.useState(d?function(e,t){return b8(e,t?.in).getDate()}(d):void 0),[p,g]=DD.useState(d?function(e,t){return b8(e,t?.in).getMonth()}(d):void 0),[m,v]=DD.useState(d?function(e,t){return b8(e,t?.in).getFullYear()}(d):void 0),y=((e,t)=>{const[n,r]=DD.useState(e);return DD.useEffect((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n})(m,c),b=(e,t)=>{Number.isNaN(Number(t))||e(Number(t))},w=l&&n6(l)?l.error:void 0;DD.useEffect((()=>{void 0!==f&&void 0!==p&&void 0!==y&&a({value:new Date(y,p,f),isDirty:!0})}),[y,p,f]);const C=DD.useMemo((()=>k8({start:A8(new Date),end:E8(new Date)}).map((e=>P8(e,{month:"long"},{locale:r})))),[r]),S=DD.useMemo((()=>[...Array(y&&p?T8(new Date(y,p,1)):31).keys()].map((e=>e+1))),[y,p]);f&&!S.includes(f)&&h(void 0);const $=DD.useMemo((()=>new Intl.DateTimeFormat(r,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts().map((e=>e.type)).filter((e=>["day","month","year"].includes(e)))),[r]),k={day:_D.createElement(U8,{key:"day",width:20,minWidth:70},_D.createElement(b6,{name:`${o}.day`,value:f??"",hasError:!!w,required:i,onChange:e=>b(h,e.target.value),placeholder:e("day"),options:S.map((e=>({value:`${e}`,label:`${e}`}))),"data-testid":`${o}.day`,"aria-label":e("day")})),month:_D.createElement(U8,{key:"month",width:50},_D.createElement(b6,{name:`${o}.month`,value:p??"",hasError:!!w,required:i,onChange:e=>b(g,e.target.value),placeholder:e("month"),options:C.map(((e,t)=>({value:`${t}`,label:e}))),"data-testid":`${o}.month`,"aria-label":e("month")})),year:_D.createElement(U8,{key:"year",width:30,minWidth:100},_D.createElement(y6,{type:"number",maxLength:4,inputMode:"numeric",name:`${o}.year`,value:m??"",hasError:!!w,required:i,onChange:e=>b(v,e.target.value),placeholder:e("year"),"data-testid":`${o}.year`,"aria-label":e("year")}))};return _D.createElement(m6,{inputId:t,labelText:n,error:w,showLabel:s,required:i},_D.createElement(G8,null,$.flatMap((e=>k[e]))))},z8=e=>new Intl.DateTimeFormat(e).formatToParts().map((e=>{switch(e.type){case"day":return"dd";case"month":return"mm";case"year":return"yyyy";case"literal":return e.value}})).join(""),K8=e=>new r6({rule:e=>S8(e),hint:"date",parameters:{format:z8(e)}});function V8({format:e,key:t="date",label:n="date",locale:r,validator:a,yearDebounce:o,...i},s){return d6({key:t,label:n,...i,format:e??{bind:e=>{const t=e?I8(e):void 0;return t&&S8(t)?{raw:t}:void 0},unbind:e=>L4(e,"raw")?x8(e.raw,{representation:"date"}):e?x8(e,{representation:"date"}):null},validator:a?K8(s.language).and(a):K8(s.language),component:j8,extendedParams:{locale:r??s.language,yearDebounce:o}})}const H8=(e=6,t=129)=>new r6({rule:n=>{const r=$8(new Date,n);return e<=r&&r<=t},hint:"birthdate.yearLimit",parameters:{min:e,max:t}});function W8(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Z8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z8(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Z8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q8(e,t){for(var n,r=0,a=W8(t.split(""));!(n=a()).done;){n.value===e&&r++}return r}function Y8(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J8(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q8(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",n=arguments.length>2?arguments[2]:void 0;if(!e)return function(e){return{text:e}};var r=q8(t,e);return function(a){if(!a)return{text:"",template:e};for(var o,i=0,s="",l=Y8(e.split(""));!(o=l()).done;){var u=o.value;if(u===t){if(s+=a[i],++i===a.length&&a.length<r)break}else s+=u}return n&&(s=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:" ",a=e.length,o=q8("(",e)-q8(")",e);o>0&&a<t.length;)e+=t[a].replace(n,r),")"===t[a]&&o--,a++;return e}(s,e)),{text:s,template:e}}}var X8={Backspace:8,Delete:46};function e9(e,t){void 0!==t&&(!function(){if("undefined"!=typeof navigator)return t9.test(navigator.userAgent)}()?e.setSelectionRange(t,t):setTimeout((function(){return e.setSelectionRange(t,t)}),0))}var t9=/Android/i;function n9(e,t,n,r,a){if(!t.hasAttribute("readonly")){var o=function(e){switch(e.keyCode){case X8.Backspace:return"Backspace";case X8.Delete:return"Delete"}}(e);switch(o){case"Delete":case"Backspace":e.preventDefault();var i=function(e){if(e.selectionStart!==e.selectionEnd)return{start:e.selectionStart,end:e.selectionEnd}}(t);return i?(function(e,t){var n=e.value;n=n.slice(0,t.start)+n.slice(t.end),e.value=n,e9(e,t.start)}(t,i),r9(t,n,r,void 0,a)):r9(t,n,r,o,a)}}}function r9(e,t,n,r,a){var o=function(e,t,n){for(var r={},a="",o=0,i=0;i<e.length;){var s=n(e[i],a,r);void 0!==s&&(a+=s,void 0!==t&&(t===i?o=a.length-1:t>i&&(o=a.length))),i++}return void 0===t&&(o=a.length),{value:a,caret:o}}(e.value,e.selectionStart,t),i=o.value,s=o.caret;if(r){var l=function(e,t,n){switch(n){case"Backspace":t>0&&(e=e.slice(0,t-1)+e.slice(t),t--);break;case"Delete":e=e.slice(0,t)+e.slice(t+1)}return{value:e,caret:t}}(i,s,r);i=l.value,s=l.caret}var u=function(e,t,n){"string"==typeof n&&(n=Q8(n));var r=n(e)||{},a=r.text,o=r.template;if(void 0===a&&(a=e),o)if(void 0===t)t=a.length;else{for(var i=0,s=!1,l=-1;i<a.length&&i<o.length;){if(a[i]!==o[i]){if(0===t){s=!0,t=i;break}l=i,t--}i++}s||(t=l+1)}return{text:a,caret:t}}(i,s,n),c=u.text;s=u.caret,e.value=c,e9(e,s),a(i)}var a9=["value","parse","format","inputComponent","onChange","onKeyDown"];function o9(){return o9=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o9.apply(this,arguments)}function i9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function s9(e,t){var n=e.value,r=e.parse,a=e.format,o=e.inputComponent,i=e.onChange,s=e.onKeyDown,l=i9(e,a9),u=DD.useRef(),c=DD.useCallback((function(e){u.current=e,t&&("function"==typeof t?t(e):t.current=e)}),[t]),d=DD.useCallback((function(e){r9(u.current,r,a,void 0,i)}),[u,r,a,i]),f=DD.useCallback((function(e){if(s&&s(e),!e.defaultPrevented)return n9(e,u.current,r,a,i)}),[u,r,a,i,s]);return _D.createElement(o,o9({},l,{ref:c,value:a(l9(n)?"":n).text,onKeyDown:f,onChange:d}))}function l9(e){return null==e}function u9(e){var t=e.country,n=e.international,r=e.withCountryCallingCode,a=e.metadata;return t&&n&&!r?"+".concat(p1(t,a)):""}function c9(e,t){return t&&" "===(e=e.slice(t.length))[0]&&(e=e.slice(1)),e}function d9(e,t,n){if(!n||!n.ignoreRest){return R1(e,t,(function(e){if(n&&"end"===e)n.ignoreRest=!0}))}}function f9(e){var t=e.onKeyDown,n=e.international;return DD.useCallback((function(e){e.keyCode===h9&&n&&e.target instanceof HTMLInputElement&&e.target.selectionStart===p9?e.preventDefault():t&&t(e)}),[t,n])}(s9=_D.forwardRef(s9)).propTypes={parse:y2.func.isRequired,format:y2.func.isRequired,inputComponent:y2.elementType.isRequired,type:y2.string.isRequired,value:y2.string,onChange:y2.func.isRequired,onKeyDown:y2.func,onCut:y2.func,onPaste:y2.func},s9.defaultProps={inputComponent:"input",type:"text"};var h9=8;var p9=1,g9=["onKeyDown","country","international","withCountryCallingCode","metadata"];function m9(){return m9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m9.apply(this,arguments)}function v9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var y9=function(e){function t(t,n){var r=t.onKeyDown,a=t.country,o=t.international,i=t.withCountryCallingCode,s=t.metadata,l=void 0===s?e:s,u=v9(t,g9),c=DD.useCallback((function(e){var t=new O4(a,l),n=u9({country:a,international:o,withCountryCallingCode:i,metadata:l}),r=t.input(n+e),s=t.getTemplate();return n&&(r=c9(r,n),s&&(s=c9(s,n))),{text:r,template:s}}),[a,l]),d=f9({onKeyDown:r,international:o});return _D.createElement(s9,m9({},u,{ref:n,parse:d9,format:c,onKeyDown:d}))}return(t=_D.forwardRef(t)).propTypes={value:y2.string.isRequired,onChange:y2.func.isRequired,onKeyDown:y2.func,country:y2.string,international:y2.bool,withCountryCallingCode:y2.bool,metadata:y2.object},t}(),b9=["value","onChange","onKeyDown","country","international","withCountryCallingCode","metadata","inputComponent"];function w9(){return w9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w9.apply(this,arguments)}function C9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var S9=function(e){function t(t,n){var r=t.value,a=t.onChange,o=t.onKeyDown,i=t.country,s=t.international,l=t.withCountryCallingCode,u=t.metadata,c=void 0===u?e:u,d=t.inputComponent,f=void 0===d?"input":d,h=C9(t,b9),p=u9({country:i,international:s,withCountryCallingCode:l,metadata:c}),g=DD.useCallback((function(e){var t=N1(e.target.value);t===r&&(0===$9(p,t,i,c).indexOf(e.target.value)&&(t=t.slice(0,-1)));a(t)}),[p,r,a,i,c]),m=f9({onKeyDown:o,international:s});return _D.createElement(f,w9({},h,{ref:n,value:$9(p,r,i,c),onChange:g,onKeyDown:m}))}return(t=_D.forwardRef(t)).propTypes={value:y2.string.isRequired,onChange:y2.func.isRequired,onKeyDown:y2.func,country:y2.string,international:y2.bool,withCountryCallingCode:y2.bool,metadata:y2.object,inputComponent:y2.elementType},t}();function $9(e,t,n,r){return c9(function(e,t,n){return n||(n=t,t=void 0),new O4(t,n).input(e)}(e+t,n,r),e)}function k9(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var E9=["value","onChange","options","disabled","readOnly"],A9=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function M9(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return x9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x9(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T9(){return T9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T9.apply(this,arguments)}function P9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function I9(e){var t=e.value,n=e.onChange,r=e.options,a=e.disabled,o=e.readOnly,i=P9(e,E9),s=DD.useCallback((function(e){var t=e.target.value;n("ZZ"===t?void 0:t)}),[n]);return DD.useMemo((function(){return F9(r,t)}),[r,t]),_D.createElement("select",T9({},i,{disabled:a||o,readOnly:o,value:t||"ZZ",onChange:s}),r.map((function(e){var t=e.value,n=e.label,r=e.divider;return _D.createElement("option",{key:r?"|":t||"ZZ",value:r?"|":t||"ZZ",disabled:!!r,style:r?O9:void 0},n)})))}I9.propTypes={value:y2.string,onChange:y2.func.isRequired,options:y2.arrayOf(y2.shape({value:y2.string,label:y2.string,divider:y2.bool})).isRequired,disabled:y2.bool,readOnly:y2.bool};var O9={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function N9(e){var t=e.value,n=e.options,r=e.className,a=e.iconComponent;e.getIconAspectRatio;var o,i=e.arrowComponent,s=void 0===i?R9:i,l=e.unicodeFlags,u=P9(e,A9),c=DD.useMemo((function(){return F9(n,t)}),[n,t]);return _D.createElement("div",{className:"PhoneInputCountry"},_D.createElement(I9,T9({},u,{value:t,options:n,className:T2("PhoneInputCountrySelect",r)})),l&&t&&_D.createElement("div",{className:"PhoneInputCountryIconUnicode"},k9((o=t)[0])+k9(o[1])),!(l&&t)&&_D.createElement(a,{"aria-hidden":!0,country:t,label:c&&c.label,aspectRatio:l?1:void 0}),_D.createElement(s,null))}function R9(){return _D.createElement("div",{className:"PhoneInputCountrySelectArrow"})}function F9(e,t){for(var n,r=M9(e);!(n=r()).done;){var a=n.value;if(!a.divider&&a.value===t)return a}}N9.propTypes={iconComponent:y2.elementType,arrowComponent:y2.elementType,unicodeFlags:y2.bool};var B9=["country","countryName","flags","flagUrl"];function L9(){return L9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L9.apply(this,arguments)}function D9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function _9(e){var t=e.country,n=e.countryName,r=e.flags,a=e.flagUrl,o=D9(e,B9);return r&&r[t]?r[t]({title:n}):_D.createElement("img",L9({},o,{alt:n,role:n?void 0:"presentation",src:a.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}_9.propTypes={country:y2.string.isRequired,countryName:y2.string.isRequired,flags:y2.objectOf(y2.elementType),flagUrl:y2.string.isRequired};var G9=["aspectRatio"],U9=["title"],j9=["title"];function z9(){return z9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z9.apply(this,arguments)}function K9(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function V9(e){var t=e.aspectRatio,n=K9(e,G9);return 1===t?_D.createElement(W9,n):_D.createElement(H9,n)}function H9(e){var t=e.title,n=K9(e,U9);return _D.createElement("svg",z9({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),_D.createElement("title",null,t),_D.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},_D.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),_D.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),_D.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),_D.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),_D.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),_D.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),_D.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}function W9(e){var t=e.title,n=K9(e,j9);return _D.createElement("svg",z9({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),_D.createElement("title",null,t),_D.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},_D.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),_D.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),_D.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),_D.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),_D.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),_D.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),_D.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}function Z9(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q9(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y9(e,t){return!!g1(e,t)||(console.error("Country not found: ".concat(e)),!1)}function J9(e,t){return e&&0===(e=e.filter((function(e){return Y9(e,t)}))).length&&(e=void 0),e}V9.propTypes={title:y2.string.isRequired,aspectRatio:y2.number},H9.propTypes={title:y2.string.isRequired},W9.propTypes={title:y2.string.isRequired};var Q9=["country","label","aspectRatio"];function X9(){return X9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X9.apply(this,arguments)}function e7(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function t7(e){var t=e.flags,n=e.flagUrl,r=e.flagComponent,a=e.internationalIcon;function o(e){var o=e.country,i=e.label,s=e.aspectRatio,l=e7(e,Q9),u=a===V9?s:void 0;return _D.createElement("div",X9({},l,{className:T2("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":1===u,"PhoneInputCountryIcon--border":o})}),o?_D.createElement(r,{country:o,countryName:i,flags:t,flagUrl:n,className:"PhoneInputCountryIconImg"}):_D.createElement(a,{title:i,aspectRatio:u,className:"PhoneInputCountryIconImg"}))}return o.propTypes={country:y2.string,label:y2.string.isRequired,aspectRatio:y2.number},o}function n7(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r7(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a7(e,t){"function"==typeof e?e(t):e.current=t}t7({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:_9,internationalIcon:V9});var o7=y2.shape({country_calling_codes:y2.object.isRequired,countries:y2.object.isRequired}),i7=y2.objectOf(y2.string);function s7(e,t){return"+"+p1(e,t)}function l7(e,t){return K3(e||"",t)}function u7(e,t){var n=t.prevCountry,r=t.newCountry,a=t.metadata,o=t.useNationalFormat;if(n===r)return e;if(!e)return o?"":r?s7(r,a):"";if(r){if("+"===e[0]){if(o)return 0===e.indexOf("+"+p1(r,a))?function(e,t,n){if(t){var r="+"+p1(t,n);if(e.length<r.length){if(0===r.indexOf(e))return""}else if(0===e.indexOf(r))return e.slice(r.length)}for(var a=0,o=Object.keys(n.country_calling_codes);a<o.length;a++){var i=o[a];if(1===e.indexOf(i))return e.slice(1+i.length)}return""}(e,r,a):"";if(n){var i=s7(r,a);return 0===e.indexOf(i)?e:i}var s=s7(r,a);return 0===e.indexOf(s)?e:s}}else if("+"!==e[0])return c7(e,n,a)||"";return e}function c7(e,t,n){if(e){if("+"===e[0]){if("+"===e)return;var r=new O4(t,n);return r.input(e),r.getNumberValue()}if(t){var a=g7(e,t,n);return"+".concat(p1(t,n)).concat(a||"")}}}function d7(e,t,n){var r=g7(e,t,n);if(r){var a=r.length-function(e,t){return t=new s1(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}(t,n);if(a>0)return e.slice(0,e.length-a)}return e}function f7(e,t){var n=t.country,r=t.countries,a=t.defaultCountry,o=t.latestCountrySelectedByUser,i=t.required,s=t.metadata;if("+"===e)return n;var l=function(e,t){var n=new O4(null,t);return n.input(e),n.getCountry()}(e,s);if(l)return!r||r.indexOf(l)>=0?l:void 0;if(n)if(m7(e,n,s)){if(o&&m7(e,o,s))return o;if(a&&m7(e,a,s))return a;if(!i)return}else if(!i)return;return n}function h7(e,t,n){if(0===e.indexOf(s7(t,n))){var r=new O4(t,n);r.input(e);var a=r.getNumber();return a?a.formatNational().replace(/\D/g,""):""}return e.replace(/\D/g,"")}function p7(e,t,n){return String.prototype.localeCompare?e.localeCompare(t,n):e<t?-1:e>t?1:0}function g7(e,t,n){var r=new O4(t,n);r.input(e);var a=r.getNumber();return a&&a.nationalNumber}function m7(e,t,n){for(var r=s7(t,n),a=0;a<e.length&&a<r.length;){if(e[a]!==r[a])return!1;a++}return!0}function v7(e){var t=e.value,n=e.phoneNumber,r=e.defaultCountry,a=e.international,o=e.useNationalFormat,i=e.metadata;return(!1===a||o)&&n&&n.country?function(e){return e.formatNational().replace(/\D/g,"")}(n):!t&&a&&r?s7(r,i):t}function y7(e){return y7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y7(e)}function b7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b7(Object(n),!0).forEach((function(t){C7(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b7(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C7(e,t,n){return t=function(e){var t=function(e,t){if("object"!=y7(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=y7(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y7(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S7(e,t){return null===e&&(e=void 0),null===t&&(t=void 0),e===t}var $7=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function k7(e){return k7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k7(e)}function E7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E7(Object(n),!0).forEach((function(t){R7(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E7(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M7(){return M7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M7.apply(this,arguments)}function x7(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function T7(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,F7(r.key),r)}}function P7(e,t,n){return t=O7(t),function(e,t){if(t&&("object"===k7(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,I7()?Reflect.construct(t,n||[],O7(e).constructor):t.apply(e,n))}function I7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I7=function(){return!!e})()}function O7(e){return O7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O7(e)}function N7(e,t){return N7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N7(e,t)}function R7(e,t,n){return(t=F7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=function(e,t){if("object"!=k7(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=k7(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==k7(t)?t:t+""}var B7=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),R7(n=P7(this,t,[e]),"setInputRef",(function(e){!function(e,t){for(var n,r=n7(e);!(n=r()).done;){var a=n.value;a&&a7(a,t)}}([n.props.inputRef,n.inputRef],e)})),R7(n,"isCountrySupportedWithError",(function(e){return Y9(e,n.props.metadata)})),R7(n,"onCountryChange",(function(e){var t=n.props,r=t.international,a=t.metadata,o=t.onChange,i=t.focusInputOnCountrySelection,s=n.state,l=u7(s.phoneDigits,{prevCountry:s.country,newCountry:e,metadata:a,useNationalFormat:!r}),u=c7(l,e,a);i&&n.inputRef.current.focus(),n.setState({country:e,latestCountrySelectedByUser:e,hasUserSelectedACountry:!0,phoneDigits:l,value:u},(function(){o(u)}))})),R7(n,"onChange",(function(e){var t=n.props,r=t.defaultCountry,a=t.onChange,o=t.addInternationalOption,i=t.international,s=t.limitMaxLength,l=t.countryCallingCodeEditable,u=t.metadata,c=n.state,d=c.countries,f=c.phoneDigits,h=c.country,p=c.latestCountrySelectedByUser,g=function(e,t){var n,r=t.prevPhoneDigits,a=t.country,o=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.countryRequired,l=t.getAnyCountry,u=t.countries,c=t.international,d=t.limitMaxLength,f=t.countryCallingCodeEditable,h=t.metadata;if(c&&!1===f&&a){var p,g=s7(a,h);if(0!==e.indexOf(g))return e&&"+"!==e[0]?p=c7(e=g+e,a,h):e=g,{phoneDigits:e,value:p,country:a}}return!1===c&&a&&e&&"+"===e[0]&&(e=h7(e,a,h)),e&&a&&d&&(e=d7(e,a,h)),!e||"+"===e[0]||a&&!c||(e="+"+e),!e&&r&&"+"===r[0]&&(a=c?void 0:o),"+"===e&&r&&"+"===r[0]&&r.length>1&&(a=void 0),e&&(n="+"===e[0]&&("+"===e||a&&0===s7(a,h).indexOf(e))?void 0:c7(e,a,h)),n&&(a=f7(n,{country:a,countries:u,defaultCountry:o,latestCountrySelectedByUser:i,required:!1,metadata:h}),!1===c&&a&&e&&"+"===e[0]&&(n=c7(e=h7(e,a,h),a,h))),!a&&s&&(a=o||l()),{phoneDigits:e,country:a,value:n}}(e,{prevPhoneDigits:f,country:h,countryRequired:!o,defaultCountry:r,latestCountrySelectedByUser:p,getAnyCountry:function(){return n.getFirstSupportedCountry({countries:d})},countries:d,international:i,limitMaxLength:s,countryCallingCodeEditable:l,metadata:u}),m=g.phoneDigits,v=g.country,y=g.value,b={phoneDigits:m,value:y,country:v};p&&y&&!m7(y,p,u)&&(b.latestCountrySelectedByUser=void 0),!1===l&&(y||m!==n.state.phoneDigits||(b.forceRerender={})),n.setState(b,(function(){return a(y)}))})),R7(n,"_onFocus",(function(){return n.setState({isFocused:!0})})),R7(n,"_onBlur",(function(){return n.setState({isFocused:!1})})),R7(n,"onFocus",(function(e){n._onFocus();var t=n.props.onFocus;t&&t(e)})),R7(n,"onBlur",(function(e){var t=n.props.onBlur;n._onBlur(),t&&t(e)})),R7(n,"onCountryFocus",(function(e){n._onFocus();var t=n.props.countrySelectProps;if(t){var r=t.onFocus;r&&r(e)}})),R7(n,"onCountryBlur",(function(e){n._onBlur();var t=n.props.countrySelectProps;if(t){var r=t.onBlur;r&&r(e)}})),n.inputRef=_D.createRef();var r=n.props,a=r.value;r.labels;var o=r.international,i=r.addInternationalOption,s=r.displayInitialValueAsLocalNumber,l=r.initialValueFormat,u=r.metadata,c=n.props,d=c.defaultCountry,f=c.countries;d&&(n.isCountrySupportedWithError(d)||(d=void 0)),f=J9(f,u);var h=l7(a,u);n.CountryIcon=t7(n.props);var p=function(e){var t,n=e.value,r=e.phoneNumber,a=e.defaultCountry,o=e.getAnyCountry,i=e.countries,s=e.required,l=e.metadata;return r&&r.country?t=r.country:a&&(n&&!m7(n,a,l)||(t=a)),i&&i.indexOf(t)<0&&(t=void 0),!t&&s&&i&&i.length>0&&(t=o()),t}({value:a,phoneNumber:h,defaultCountry:d,required:!i,countries:f||N4(u),getAnyCountry:function(){return n.getFirstSupportedCountry({countries:f})},metadata:u});return n.state={props:n.props,country:p,countries:f,phoneDigits:v7({value:a,phoneNumber:h,defaultCountry:d,international:o,useNationalFormat:s||"national"===l,metadata:u}),value:a},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N7(e,t)}(t,e),function(e,t,n){return t&&T7(e.prototype,t),n&&T7(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"componentDidMount",value:function(){var e=this.props.onCountryChange,t=this.props.defaultCountry,n=this.state.country;e&&(t&&(this.isCountrySupportedWithError(t)||(t=void 0)),n!==t&&e(n))}},{key:"componentDidUpdate",value:function(e,t){var n=this.props.onCountryChange,r=this.state.country;n&&r!==t.country&&n(r)}},{key:"getCountrySelectOptions",value:function(e){var t=e.countries,n=this.props,r=n.international,a=n.countryCallingCodeEditable,o=n.countryOptionsOrder,i=n.addInternationalOption,s=n.labels,l=n.locales,u=n.metadata;return this.useMemoCountrySelectOptions((function(){return function(e,t){if(!t)return e;for(var n,r=[],a=[],o=r,i=function(){var t=n.value;if("|"===t)o.push({divider:!0});else if("..."===t||"…"===t)o=a;else{var r;r="🌐"===t?void 0:t;var i=e.indexOf(e.filter((function(e){return e.value===r}))[0]),s=e[i];e.splice(i,1),o.push(s)}},s=Z9(t);!(n=s()).done;)i();return r.concat(e).concat(a)}(function(e){var t=e.countries,n=e.countryNames,r=e.addInternationalOption,a=e.compareStringsLocales,o=e.compareStrings;o||(o=p7);var i=t.map((function(e){return{value:e,label:n[e]||e}}));return i.sort((function(e,t){return o(e.label,t.label,a)})),r&&i.unshift({label:n.ZZ}),i}({countries:t||N4(u),countryNames:s,addInternationalOption:(!r||!1!==a)&&i,compareStringsLocales:l}),function(e,t){if(e&&(e=e.filter((function(e){switch(e){case"🌐":case"|":case"...":case"…":return!0;default:return Y9(e,t)}}))).length>0)return e}(o,u))}),[t,o,i,s,u])}},{key:"useMemoCountrySelectOptions",value:function(e,t){return this.countrySelectOptionsMemoDependencies&&function(e,t){if(e.length!==t.length)return!1;var n=0;for(;n<e.length;){if(e[n]!==t[n])return!1;n++}return!0}(t,this.countrySelectOptionsMemoDependencies)||(this.countrySelectOptionsMemo=e(),this.countrySelectOptionsMemoDependencies=t),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(e){var t=e.countries;return this.getCountrySelectOptions({countries:t})[0].value}},{key:"render",value:function(){var e=this.props,t=e.name,n=e.disabled,r=e.readOnly,a=e.autoComplete,o=e.style,i=e.className;e.inputRef;var s=e.inputComponent,l=e.numberInputProps,u=e.smartCaret,c=e.countrySelectComponent,d=e.countrySelectProps,f=e.containerComponent,h=e.containerComponentProps;e.defaultCountry,e.countries,e.countryOptionsOrder;var p=e.labels;e.flags,e.flagComponent,e.flagUrl,e.addInternationalOption,e.internationalIcon,e.displayInitialValueAsLocalNumber,e.initialValueFormat,e.onCountryChange,e.limitMaxLength,e.countryCallingCodeEditable,e.focusInputOnCountrySelection,e.reset;var g=e.metadata,m=e.international;e.locales;var v=x7(e,$7),y=this.state,b=y.country,w=y.countries,C=y.phoneDigits,S=y.isFocused,$=u?y9:S9,k=this.getCountrySelectOptions({countries:w});return _D.createElement(f,M7({style:o,className:T2(i,"PhoneInput",{"PhoneInput--focus":S,"PhoneInput--disabled":n,"PhoneInput--readOnly":r})},h),_D.createElement(c,M7({name:t?"".concat(t,"Country"):void 0,"aria-label":p.country},d,{value:b,options:k,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:n||d&&d.disabled,readOnly:r||d&&d.readOnly,iconComponent:this.CountryIcon})),_D.createElement($,M7({ref:this.setInputRef,type:"tel",autoComplete:a},l,v,{international:!!m||void 0,withCountryCallingCode:!!m||void 0,name:t,metadata:g,country:b,value:C||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:n,readOnly:r,inputComponent:s,className:T2("PhoneInputInput",l&&l.className,v.className)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return A7({props:e},function(e,t,n){var r=e.metadata,a=e.countries,o=e.defaultCountry,i=e.value,s=e.reset,l=e.international,u=e.displayInitialValueAsLocalNumber,c=e.initialValueFormat,d=t.defaultCountry,f=t.value,h=t.reset;n.country;var p=n.value,g=n.hasUserSelectedACountry,m=n.latestCountrySelectedByUser,v=function(e){return v7(w7(w7({},e),{},{international:l,useNationalFormat:u||"national"===c,metadata:r}))};if(s!==h)return{phoneDigits:v({value:void 0,defaultCountry:o}),value:void 0,country:o,latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};if(o!==d){var y=!o||Y9(o,r),b=!p||l&&p===v({value:void 0,defaultCountry:d});if(!g&&y&&!i&&b)return{country:o,phoneDigits:v({value:void 0,defaultCountry:o}),value:void 0}}if(!S7(i,f)&&!S7(i,p)){var w,C,S;if(i){w=l7(i,r);var $=J9(a,r);w&&w.country?(!$||$.indexOf(w.country)>=0)&&(C=w.country):(C=f7(i,{country:void 0,countries:$,metadata:r}))||o&&0===i.indexOf(s7(o,r))&&(C=o)}return i?m&&((C?m===C:m7(i,m,r))?C||(C=m):S={latestCountrySelectedByUser:void 0}):S={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0},w7(w7({},S),{},{phoneDigits:v({phoneNumber:w,value:i,defaultCountry:o}),value:i,country:i?C:o})}}(e,t.props,t))}}])}(_D.PureComponent),L7=_D.forwardRef((function(e,t){return _D.createElement(B7,M7({},function(e){for(var t in e=A7({},e),D7)void 0===e[t]&&(e[t]=D7[t]);return e}(e),{inputRef:t}))}));L7.propTypes={value:y2.string,onChange:y2.func.isRequired,onFocus:y2.func,onBlur:y2.func,disabled:y2.bool,readOnly:y2.bool,autoComplete:y2.string,initialValueFormat:y2.oneOf(["national"]),displayInitialValueAsLocalNumber:y2.bool,defaultCountry:y2.string,countries:y2.arrayOf(y2.string),labels:i7,locales:y2.oneOfType([y2.string,y2.arrayOf(y2.string)]),flagUrl:y2.string,flags:y2.objectOf(y2.elementType),flagComponent:y2.elementType,addInternationalOption:y2.bool,internationalIcon:y2.elementType,countryOptionsOrder:y2.arrayOf(y2.string),style:y2.object,className:y2.string,countrySelectComponent:y2.elementType,countrySelectProps:y2.object,inputComponent:y2.elementType,numberInputProps:y2.object,containerComponent:y2.elementType,containerComponentProps:y2.object,smartCaret:y2.bool,international:y2.bool,limitMaxLength:y2.bool,countryCallingCodeEditable:y2.bool,metadata:o7,onCountryChange:y2.func,focusInputOnCountrySelection:y2.bool};var D7={autoComplete:"tel",countrySelectComponent:N9,flagComponent:_9,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:V9,inputComponent:"input",containerComponent:"div",reset:y2.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};var _7={ext:"ext.",country:"Phone number country",phone:"Phone",AB:"Abkhazia",AC:"Ascension Island",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin (French Part)",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",OS:"South Ossetia",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TA:"Tristan da Cunha",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XK:"Kosovo",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"International"},G7=Object.freeze({__proto__:null,default:_7}),U7=["metadata","labels"];function j7(){return j7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j7.apply(this,arguments)}function z7(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function K7(e){var t=_D.forwardRef((function(t,n){var r=t.metadata,a=void 0===r?e:r,o=t.labels,i=void 0===o?_7:o,s=z7(t,U7);return _D.createElement(L7,j7({},s,{ref:n,metadata:a,labels:i}))}));return t.propTypes={metadata:o7,labels:i7},t}function V7(e,t){var n=Array.prototype.slice.call(t);return n.push(L2),e.apply(this,n)}K7();var H7=K7(L2);function W7(){return V7(K3,arguments)}function Z7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return q7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q7(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y7(e){var t=this,n=e.value,r=e.onChange,a=e.country,o=e.defaultCountry,i=e.international,s=e.withCountryCallingCode,l=e.useNationalFormatForDefaultCountryValue,u=e.metadata,c=DD.useRef(),d=function(e,t,n){console.error("[react-phone-number-input] Expected phone number ".concat(e," to correspond to country ").concat(t," but ").concat(n?"in reality it corresponds to country "+n:"it doesn't",".")),c.current=!0},f=function(e){return function(e,t,n,r,a,o,i,s){if(t&&n&&r){var l=s7(t,i);return e?(0!==e.indexOf(l)&&s(e,t),e):l}if(!e)return"";if(!t&&!a)return e;var u=new O4(void 0,i);u.input(e);var c=u.getNumber();return c?t?(c.country&&c.country!==t?s(e,t,c.country):c.countryCallingCode!==p1(t,i)&&s(e,t),n?c.nationalNumber:P1(c.formatNational())):c.countryCallingCode&&c.countryCallingCode===p1(a,i)&&o?P1(c.formatNational()):e:""}(n,a,i,s,o,l,u,(function(){e&&e.onCountryMismatch&&e.onCountryMismatch();for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];d.apply(t,r)}))},h=Z7(DD.useState(a),2),p=h[0],g=h[1],m=Z7(DD.useState(o),2),v=m[0],y=m[1],b=Z7(DD.useState(f()),2),w=b[0],C=b[1],S=Z7(DD.useState(n),2),$=S[0],k=S[1],E=Z7(DD.useState(),2);E[0];var A=E[1],M=DD.useCallback((function(){return A({})}),[A]);function x(e){if(e){a&&i&&!s&&(e="+".concat(p1(a,u)).concat(e));var t=new O4(a||o,u);return t.input(e),t.getNumberValue()}}DD.useEffect((function(){n!==$&&(k(n),C(f()))}),[n]),DD.useEffect((function(){if(a!==p){var e;g(a);var t=f({onCountryMismatch:function(){e=!0}});C(t),e&&k(x(t))}}),[a]),DD.useEffect((function(){o!==v&&(y(o),C(f()))}),[o]),DD.useEffect((function(){$!==n&&r($)}),[$]);var T=DD.useCallback((function(e){var t;if(a)if(i&&s){var n=s7(a,u);if(0!==e.indexOf(n))if(e&&"+"!==e[0])e=n+e;else if(!c.current)return C(n),k(void 0),M()}else e&&"+"===e[0]&&(e=e.slice(1));else o||e&&"+"!==e[0]&&(e="+"+e);e&&(t=x(e)),C(e),k(t)}),[a,i,s,o,u,C,k,M,c]);return[w,T]}var J7=["Component","country","defaultCountry","useNationalFormatForDefaultCountryValue","value","onChange","metadata","international","withCountryCallingCode"];function Q7(){return Q7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q7.apply(this,arguments)}function X7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tee(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function nee(e,t){var n=e.Component,r=e.country,a=e.defaultCountry,o=e.useNationalFormatForDefaultCountryValue,i=void 0===o||o,s=e.value,l=e.onChange,u=e.metadata,c=e.international,d=e.withCountryCallingCode,f=tee(e,J7),h=X7(Y7({value:s,onChange:l,country:r,defaultCountry:a,international:c,withCountryCallingCode:d,useNationalFormatForDefaultCountryValue:i,metadata:u}),2),p=h[0],g=h[1];return _D.createElement(n,Q7({},f,{ref:t,metadata:u,international:c,withCountryCallingCode:d,country:r||a,value:p,onChange:g}))}(nee=_D.forwardRef(nee)).propTypes={value:y2.string,onChange:y2.func.isRequired,country:y2.string,defaultCountry:y2.string,international:y2.bool,withCountryCallingCode:y2.bool,Component:y2.elementType.isRequired,useNationalFormatForDefaultCountryValue:y2.bool,metadata:o7};var ree=nee,aee=["type","autoComplete","smartCaret","metadata"];function oee(){return oee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oee.apply(this,arguments)}function iee(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function see(e){function t(t,n){var r=t.type,a=void 0===r?"tel":r,o=t.autoComplete,i=void 0===o?"tel":o,s=t.smartCaret,l=void 0===s||s,u=t.metadata,c=void 0===u?e:u,d=iee(t,aee);return _D.createElement(ree,oee({},d,{type:a,autoComplete:i,metadata:c,ref:n,Component:l?y9:S9}))}return(t=_D.forwardRef(t)).propTypes={type:y2.string,autoComplete:y2.string,smartCaret:y2.bool,metadata:y2.object},t}see();var lee=see(L2);function uee(e){return"string"==typeof e&&function(){return V7(g1,arguments)}(e)}const cee=(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=yX.apply(void 0,[e].concat(n)),o="sc-global-"+RX(JSON.stringify(a)),i=new jX(a,o);return _D.memo((function e(t){var n=lX(),r=uX(),a=DD.useContext(BX),s=DD.useRef(null);null===s.current&&(s.current=n.allocateGSInstance(o));var l=s.current;if(i.isStatic)i.renderStyles(l,NQ,n,r);else{var u=yQ({},t,{theme:TX(t,a,e.defaultProps)});i.renderStyles(l,u,n,r)}return DD.useEffect((function(){return function(){return i.removeStyles(l,n)}}),CQ),null}))})`
311
311
  ${"/* CSS variables. */\r\n:root {\r\n\t--PhoneInput-color--focus: #03b2cb;\r\n\t--PhoneInputInternationalIconPhone-opacity: 0.8;\r\n\t--PhoneInputInternationalIconGlobe-opacity: 0.65;\r\n\t--PhoneInputCountrySelect-marginRight: 0.35em;\r\n\t--PhoneInputCountrySelectArrow-width: 0.3em;\r\n\t--PhoneInputCountrySelectArrow-marginLeft: var(--PhoneInputCountrySelect-marginRight);\r\n\t--PhoneInputCountrySelectArrow-borderWidth: 1px;\r\n\t--PhoneInputCountrySelectArrow-opacity: 0.45;\r\n\t--PhoneInputCountrySelectArrow-color: currentColor;\r\n\t--PhoneInputCountrySelectArrow-color--focus: var(--PhoneInput-color--focus);\r\n\t--PhoneInputCountrySelectArrow-transform: rotate(45deg);\r\n\t--PhoneInputCountryFlag-aspectRatio: 1.5;\r\n\t--PhoneInputCountryFlag-height: 1em;\r\n\t--PhoneInputCountryFlag-borderWidth: 1px;\r\n\t--PhoneInputCountryFlag-borderColor: rgba(0,0,0,0.5);\r\n\t--PhoneInputCountryFlag-borderColor--focus: var(--PhoneInput-color--focus);\r\n\t--PhoneInputCountryFlag-backgroundColor--loading: rgba(0,0,0,0.1);\r\n}\r\n\r\n.PhoneInput {\r\n\t/* This is done to stretch the contents of this component. */\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n}\r\n\r\n.PhoneInputInput {\r\n\t/* The phone number input stretches to fill all empty space */\r\n\tflex: 1;\r\n\t/* The phone number input should shrink\r\n\t to make room for the extension input */\r\n\tmin-width: 0;\r\n}\r\n\r\n.PhoneInputCountryIcon {\r\n\twidth: calc(var(--PhoneInputCountryFlag-height) * var(--PhoneInputCountryFlag-aspectRatio));\r\n\theight: var(--PhoneInputCountryFlag-height);\r\n}\r\n\r\n.PhoneInputCountryIcon--square {\r\n\twidth: var(--PhoneInputCountryFlag-height);\r\n}\r\n\r\n.PhoneInputCountryIcon--border {\r\n\t/* Removed `background-color` because when an `<img/>` was still loading\r\n\t it would show a dark gray rectangle. */\r\n\t/* For some reason the `<img/>` is not stretched to 100% width and height\r\n\t and sometime there can be seen white pixels of the background at top and bottom. */\r\n\tbackground-color: var(--PhoneInputCountryFlag-backgroundColor--loading);\r\n\t/* Border is added via `box-shadow` because `border` interferes with `width`/`height`. */\r\n\t/* For some reason the `<img/>` is not stretched to 100% width and height\r\n\t and sometime there can be seen white pixels of the background at top and bottom,\r\n\t so an additional \"inset\" border is added. */\r\n\tbox-shadow: 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor),\r\n\t\tinset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor);\r\n}\r\n\r\n.PhoneInputCountryIconImg {\r\n\t/* Fixes weird vertical space above the flag icon. */\r\n\t/* https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/7#note_348586559 */\r\n\tdisplay: block;\r\n\t/* 3rd party <SVG/> flag icons won't stretch if they have `width` and `height`.\r\n\t Also, if an <SVG/> icon's aspect ratio was different, it wouldn't fit too. */\r\n\twidth: 100%;\r\n\theight: 100%;\r\n}\r\n\r\n.PhoneInputInternationalIconPhone {\r\n\topacity: var(--PhoneInputInternationalIconPhone-opacity);\r\n}\r\n\r\n.PhoneInputInternationalIconGlobe {\r\n\topacity: var(--PhoneInputInternationalIconGlobe-opacity);\r\n}\r\n\r\n/* Styling native country `<select/>`. */\r\n\r\n.PhoneInputCountry {\r\n\tposition: relative;\r\n\talign-self: stretch;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tmargin-right: var(--PhoneInputCountrySelect-marginRight);\r\n}\r\n\r\n.PhoneInputCountrySelect {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\theight: 100%;\r\n\twidth: 100%;\r\n\tz-index: 1;\r\n\tborder: 0;\r\n\topacity: 0;\r\n\tcursor: pointer;\r\n}\r\n\r\n.PhoneInputCountrySelect[disabled],\r\n.PhoneInputCountrySelect[readonly] {\r\n\tcursor: default;\r\n}\r\n\r\n.PhoneInputCountrySelectArrow {\r\n\tdisplay: block;\r\n\tcontent: '';\r\n\twidth: var(--PhoneInputCountrySelectArrow-width);\r\n\theight: var(--PhoneInputCountrySelectArrow-width);\r\n\tmargin-left: var(--PhoneInputCountrySelectArrow-marginLeft);\r\n\tborder-style: solid;\r\n\tborder-color: var(--PhoneInputCountrySelectArrow-color);\r\n\tborder-top-width: 0;\r\n\tborder-bottom-width: var(--PhoneInputCountrySelectArrow-borderWidth);\r\n\tborder-left-width: 0;\r\n\tborder-right-width: var(--PhoneInputCountrySelectArrow-borderWidth);\r\n\ttransform: var(--PhoneInputCountrySelectArrow-transform);\r\n\topacity: var(--PhoneInputCountrySelectArrow-opacity);\r\n}\r\n\r\n.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon + .PhoneInputCountrySelectArrow {\r\n\topacity: 1;\r\n\tcolor: var(--PhoneInputCountrySelectArrow-color--focus);\r\n}\r\n\r\n.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon--border {\r\n\tbox-shadow: 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus),\r\n\t\tinset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus);\r\n}\r\n\r\n.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon .PhoneInputInternationalIconGlobe {\r\n\topacity: 1;\r\n\tcolor: var(--PhoneInputCountrySelectArrow-color--focus);\r\n}"}
312
312
 
313
313
  :root {
@@ -406,7 +406,7 @@
406
406
  margin-top: 1px;
407
407
  margin-bottom: 1px;
408
408
  }
409
- `,Ree=({value:e,onChange:t,label:n,description:r,path:a,required:o,validation:i,consentCannotBeGranted:s})=>{const l=(L4(e,"granted")?e.granted:e)??!1,u=i&&n6(i)?i.error:void 0;return _D.createElement("div",{style:{position:"relative"}},_D.createElement(C6,{value:l?String(l):void 0,onToggle:()=>t({value:!s&&!l,isDirty:!0}),name:a,label:n,"data-testid":a,required:o,error:u}),_D.createElement(r0,{root:Nee,source:r,"data-testid":`${a}.description`}))};const Fee={customIdentifier:(e,t)=>H6({label:"customIdentifier",...e}),givenName:(e,t)=>H6({label:"givenName",...e}),familyName:(e,t)=>H6({label:"familyName",...e}),email:(e,t)=>H6({label:"email",type:"email",...e,validator:s6}),phoneNumber:(e,t)=>hee(e,t),password:(e,t)=>Oee(e,t),passwordConfirmation:(e,t)=>O6({label:"passwordConfirmation",...e,canShowPassword:!1,validator:new r6({rule:(e,t)=>e===t.fields.password.value,hint:"passwordMatch"})}),gender:(e,t)=>p8({label:"gender",...e,values:[{value:"male",label:"genders.male"},{value:"female",label:"genders.female"},{value:"other",label:"genders.other"}]}),birthdate:(e,t)=>function({min:e,max:t,label:n="birthdate",...r},a){return V8({...r,label:n,format:{bind:e=>{const t=e?I8(e):void 0;return t&&S8(t)?{raw:t}:void 0},unbind:e=>L4(e,"raw")?x8(e.raw,{representation:"date"}):e?x8(e,{representation:"date"}):null},validator:H8(e,t)},a)}(e,t),"address.streetAddress":(e,t)=>H6({label:"address.streetAddress",...e}),"address.locality":(e,t)=>H6({label:"address.locality",...e}),"address.region":(e,t)=>H6({label:"address.region",...e}),"address.postalCode":(e,t)=>H6({label:"address.postalCode",...e}),"address.country":(e,t)=>H6({label:"address.country",...e}),friendlyName:(e,t)=>H6({label:"webauthn.friendly.name",required:!1,...e})};const Bee={number:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"number"}),integer:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"number",format:{bind:e=>"number"==typeof e?e.toString():"",unbind:e=>{const t=L4(e)?e.raw:e;return t?parseInt(t,10):0}},validator:l6}),decimal:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"number",format:{bind:e=>"number"==typeof e?e.toString():"",unbind:e=>{const t=L4(e)?e.raw:e;return t?parseFloat(t):0}},validator:u6}),string:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`}),date:(e,{label:t,...n},r)=>V8({label:t??e.name,...n,key:`custom_fields.${e.path}`},r),checkbox:(e,{label:t,...n},r)=>R6({label:t??e.name,...n,key:`custom_fields.${e.path}`,...n.required?{validator:i6}:{}}),select:(e,{label:t,...n},r)=>p8({label:t??e.name,...n,key:`custom_fields.${e.path}`,values:e.selectableValues??[]}),phone:(e,{label:t,...n},r)=>hee({label:t??e.name,...n,key:`custom_fields.${e.path}`},r),email:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"email",validator:s6}),tags:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`}),object:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`})};function Lee(e,t,n){if(t.errorArchivedConsents&&"archived"===e.status)throw new Jq(`The '${e.key}' consent is archived and cannot be displayed.`);const r=Number(n)||Math.max(...Object.values(e.versions.map((e=>Number(e.versionId))))),a=e.versions.find((e=>e.versionId===r));if(!a)throw new Jq(`Unknown version ID n°${r} of consent '${e.key}'.`);return function({type:e,required:t=!1,consentCannotBeGranted:n,description:r,version:a,...o}){return d6({...o,required:t,defaultValue:{granted:o.defaultValue??!1},format:{bind:e=>e,unbind:t=>void 0!==t?{granted:(L4(t,"granted")?t.granted:t)??!1,consentType:e,consentVersion:a}:null},validator:t?i6:a6,rawProperty:"granted",component:Ree,extendedParams:{consentCannotBeGranted:n,description:r,type:e,version:a}})}({...t,key:`consents.${e.key}.${r}`,path:`consents.${e.key}`,label:a.title,type:e.consentType,version:{versionId:r,language:a.language},description:a.description??a.title,consentCannotBeGranted:!t.errorArchivedConsents&&"archived"===e.status})}const Dee=(e,t)=>{if(function(e){return e in Fee}(e.key)){return function(e,t,n){return e(t,n)}(Fee[e.key],e,t)}if(function(e,t,n){return e.customFields.some((e=>{const n=U4(e.path);return t===n||t===`customFields.${n}`}))}(t,e.key)){const n=((e,t)=>e.customFields.find((e=>{const n=U4(e.path);return t===n||t===`customFields.${n}`})))(t,e.key);if(n){return function(e,t,n,r){return t(e,n,r)}(n,Bee[n.dataType],e,t)}}const n=e.key.split(".v");if(function(e,t,n){return Object.values(e.consentsVersions).some((e=>{const n=U4(e.key);return t===n||t===`consents.${n}`}))}(t,n[0])){const r=((e,t)=>Object.values(e.consentsVersions).find((e=>{const n=U4(e.key);return t===n||t===`consents.${n}`})))(t,n[0]);if(r){const t=r.versions[0].versionId;return Lee(r,e,n[1]||t)}}throw new Jq(`Unknown field: ${e.key}`)};function _ee(e=[],{canShowPassword:t,errorArchivedConsents:n,...r}){return e.filter((e=>!!e)).map((e=>Dee("string"==typeof e?{key:z4(e),canShowPassword:t,errorArchivedConsents:n}:{...e,key:z4(e.key),canShowPassword:t,errorArchivedConsents:n},r)))}const Gee=l5({prefix:"r5-signup-",submitLabel:"signup.submitLabel"}),Uee=({auth:e,beforeSignup:t=(e=>e),canShowPassword:n,phoneNumberOptions:r,recaptcha_enabled:a=!1,recaptcha_site_key:o,redirectUrl:i,returnToAfterEmailConfirmation:s,showLabels:l,signupFields:u=["given_name","family_name","email","password","password_confirmation"],userAgreement:c})=>{const d=f0(),f=o0(),[h,p]=DD.useState([]);DD.useLayoutEffect((()=>{K6(o)}),[o]);const g=DD.useCallback((t=>{const n=function(e){const t=e.captchaToken;return delete e.captchaToken,t}(t);return d.signup({captchaToken:n,data:V4(t),auth:e,redirectUrl:i,returnToAfterEmailConfirmation:s})}),[e,d,i,s]),m=DD.useCallback((e=>{const t=(L4(e.email?.value)?e.email?.value.raw:e.email?.value)??"",n=(L4(e.givenName?.value)?e.givenName?.value.raw:e.givenName?.value)??"",r=(L4(e.familyName?.value)?e.familyName?.value.raw:e.familyName?.value)??"",a=[t.split("@"),t,n.split(" "),r.split(" ")].flat(1).map((e=>e.trim().toLowerCase())).filter((function(e){return D4(e)})),o=Array.from(new Set(a));var i,s;s=h,(i=o).length===s.length&&i.every((e=>s.includes(e)))||p(o)}),[h]),v=_ee(u,{...f,canShowPassword:n,errorArchivedConsents:!0}),y=c?[...v,{staticContent:_D.createElement(r0,{key:"user-aggreement","data-testid":"user-aggreement",root:$6,source:c})}]:v;return _D.createElement(Gee,{fields:y,showLabels:l,beforeSubmit:t,onFieldChange:m,sharedProps:{blacklist:h,...r},handler:e=>z6.handle(e,{recaptcha_enabled:a,recaptcha_site_key:o},g,"signup")})},jee=l5({prefix:"r5-webauthn-signup-",submitLabel:"signup.submitLabel"}),zee=l5({prefix:"r5-forgot-password-",fields:()=>[H6({key:"email",label:"email",required:!0,type:"email",validator:s6})],submitLabel:"forgotPassword.submitLabel"}),Kee=l5({prefix:"r5-forgot-password-",fields:({config:e,phoneNumberOptions:t})=>[hee({key:"phoneNumber",label:"phoneNumber",required:!0,withCountryCallingCode:!1,...t},e)],submitLabel:"forgotPassword.submitLabel.code"}),Vee=l5({prefix:"r5-verification-code-",fields:({canShowPassword:e=!1,config:t})=>[H6({key:"verification_code",label:"verificationCode",type:"text"}),Oee({label:"newPassword",autoComplete:"new-password",canShowPassword:e},t),O6({key:"password_confirmation",label:"passwordConfirmation",autoComplete:"new-password",validator:new r6({rule:(e,t)=>e===t.fields.password.value,hint:"passwordMatch"})})]}),Hee=e=>!!Yq(e)&&"resource_not_found"===e.error,Wee=e=>{const{label:t,value:n,...r}=e,a=L4(n,"raw")?n.raw:n;return _D.createElement(S6,{labelText:t,value:a,...r})};function Zee({defaultValue:e,options:t,...n}){return d6({...n,defaultValue:e??(1===t.length?String(t[0].value):void 0),component:Wee,extendedParams:e=>({options:t.map((({label:t,value:n})=>({value:n,label:t?"string"==typeof t?e(t):t:"string"==typeof n?e(n):n})))})})}const qee=l5({prefix:"r5-mfa-start-step-up-",submitLabel:"mfa.stepUp.start"}),Yee=l5({prefix:"r5-passwordless-sms-",fields:({allowTrustDevice:e})=>[H6({key:"verification_code",label:"verificationCode",type:"text"}),...e?[R6({key:"trust_device",label:"mfa.stepUp.trustDevice",defaultValue:!1})]:[]]}),Jee=l5({prefix:"r5-mfa-start-passwordless",fields:({options:e})=>[Zee({key:"authType",label:"authType",options:e})]}),Qee=e=>{const t=f0(),n=u0(),{params:r}=VX(),a=r,{amr:o,showIntro:i=!0,token:s}={...e,...a},[l,u]=DD.useState(),c=DD.useCallback((e=>t.startPasswordless({...e,stepUp:s}).then((t=>u({...t,...e})))),[t,s]);return DD.useEffect((()=>{1===o.length&&c({authType:o[0]})}),[o,c]),l?_D.createElement(Xee,{...l,auth:e.auth,allowTrustDevice:e.allowTrustDevice}):o.length>1?_D.createElement("div",null,i&&_D.createElement(QX,null,n("mfa.select.factor")),_D.createElement(Jee,{options:o.map((e=>({key:e,value:e,label:e}))),handler:c})):null},Xee=e=>{const t=f0(),n=u0(),{params:r}=VX(),{rbaEnabled:a}=o0(),o=r,{auth:i,authType:s,challengeId:l,allowTrustDevice:u}={...e,...o};return _D.createElement("div",null,"sms"===s&&_D.createElement(qX,null,n("passwordless.sms.verification.intro")),"email"===s&&_D.createElement(qX,null,n("passwordless.email.verification.intro")),_D.createElement(Yee,{allowTrustDevice:a&&u,handler:e=>t.verifyMfaPasswordless({challengeId:l,verificationCode:e.verificationCode,trustDevice:e.trustDevice}).then((e=>window.location.replace(i?.redirectUri+"?"+Z4(e))))}))};var ete=F2({initialView:"main",views:{main:({accessToken:e,auth:t,showIntro:n=!0,showStepUpStart:r=!0,allowTrustDevice:a=!1})=>{const o=f0(),{goTo:i}=VX(),[s,l]=DD.useState(),u=DD.useCallback((()=>o.getMfaStepUpToken({options:t,accessToken:e}).then((e=>(l(e),e)))),[e,t,o]);return DD.useEffect((()=>{r||u()}),[r,u]),r?_D.createElement(qee,{handler:u,onSuccess:e=>i("fa-selection",{...e,allowTrustDevice:a})}):s?_D.createElement(Qee,{...s,showIntro:n,auth:t,allowTrustDevice:a}):null},"fa-selection":Qee,"verification-code":Xee}});const tte=l5({prefix:"r5-account-recovery-",fields:[H6({key:"email",label:"email",type:"email",validator:s6})],submitLabel:"accountRecovery.submitLabel"}),nte=e=>!!Yq(e)&&"resource_not_found"===e.error;function rte(e,t){return"login"===e||"login-with-web-authn"===e?e:t?"login-with-web-authn":"login"}var ate=F2({initialView({initialScreen:e,allowLogin:t=!0,allowQuickLogin:n=!0,allowSignup:r=!0,allowWebAuthnLogin:a,socialProviders:o,session:i={}}){const s=n&&!i.isAuthenticated&&i.lastLoginType&&o?.includes(i.lastLoginType);return e??(s?"quick-login":void 0)??(i.isAuthenticated?"reauth":void 0)??(t&&!a?"login":void 0)??(t?"login-with-web-authn":void 0)??(r?"signup":void 0)??"forgot-password"},views:{login:({acceptTos:e,allowForgotPassword:t=!0,allowSignup:n=!0,allowWebAuthnLogin:r,allowAccountRecovery:a=!1,auth:o,canShowPassword:i=!1,socialProviders:s,allowCustomIdentifier:l=!1,showLabels:u=!1,showRememberMe:c=!1,recaptcha_enabled:d=!1,recaptcha_site_key:f,allowAuthentMailPhone:h=!0,allowTrustDevice:p})=>{const g=u0(),m=f0(),{goTo:v}=VX(),y=g0();DD.useLayoutEffect((()=>{K6(f)}),[f]);const b=new AbortController,w=b.signal;_D.useEffect((()=>{r&&m.loginWithWebAuthn({conditionalMediation:"preferred",auth:{...o},signal:w}).catch((()=>{}))}),[m,o,r,w]);const C=e=>{const{auth:t,...n}=G4(e);return m.loginWithPassword({...n,auth:{...t,...o}}).then((e=>e?.stepUpToken?v("fa-selection",{token:e.stepUpToken,amr:e.amr??[],allowTrustDevice:p}):e))},S="password"===y?.lastLoginType?y.email:void 0;return _D.createElement("div",null,_D.createElement(WX,null,g("login.title")),s&&s.length>0&&_D.createElement(a5,{providers:s,auth:o,acceptTos:e}),s&&s.length>0&&_D.createElement(e0,{text:g("or")}),_D.createElement(Z6,{showLabels:u,showRememberMe:c,showForgotPassword:t,showAccountRecovery:a,canShowPassword:i,defaultIdentifier:S,allowCustomIdentifier:l,allowAuthentMailPhone:h,handler:e=>z6.handle(e,{recaptcha_enabled:d,recaptcha_site_key:f},C,"login")}),n&&_D.createElement(t0,null,_D.createElement("span",null,g("login.signupLinkPrefix"))," ",_D.createElement(n0,{target:"signup",controller:b},g("login.signupLink"))))},"login-with-web-authn":({acceptTos:e,allowSignup:t=!0,auth:n,enablePasswordAuthentication:r=!0,showLabels:a=!1,socialProviders:o,allowAccountRecovery:i})=>{const s=f0(),{goTo:l}=VX(),u=u0(),c=g0(),d=new AbortController,f=d.signal;_D.useEffect((()=>{s.loginWithWebAuthn({conditionalMediation:"preferred",auth:{...n},signal:f}).catch((()=>{}))}),[s,n,f]);const h=_D.useCallback((e=>{const{auth:t,...r}=G4(e);return(e=>"customIdentifier"in e)(r)?(console.error("Custom identifier is not a valid WebAuthn identifier."),Promise.reject(new Error("Custom identifier is not a valid WebAuthn identifier."))):s.loginWithWebAuthn({...r,auth:{...t,...n}})}),[s,n]),p=DD.useCallback((e=>{const t="identifier"in e?e.identifier:"email"in e?e.email:"";l("login-with-password",{username:t})}),[l]),g="password"===c?.lastLoginType?c.email:void 0;return _D.createElement("div",null,_D.createElement(WX,null,u("login.title")),o&&o.length>0&&_D.createElement(a5,{providers:o,auth:n,acceptTos:e}),o&&o.length>0&&_D.createElement(e0,{text:u("or")}),_D.createElement(c8,{showLabels:a,defaultIdentifier:g,handler:h,showAccountRecovery:i,SubmitComponent:({disabled:e,onClick:t})=>_D.createElement(s8,{disabled:e,enablePasswordAuthentication:r,onPasswordClick:()=>t(p)})}),t&&_D.createElement(t0,null,_D.createElement("span",null,u("login.signupLinkPrefix"))," ",_D.createElement(n0,{controller:d,target:"signup"},u("login.signupLink"))))},"login-with-password":({allowForgotPassword:e=!0,allowAccountRecovery:t=!1,auth:n,canShowPassword:r,recaptcha_enabled:a=!1,recaptcha_site_key:o,showLabels:i,showRememberMe:s,allowTrustDevice:l})=>{const u=u0(),c=f0(),{goTo:d,params:f}=VX(),{username:h}=f;DD.useLayoutEffect((()=>{K6(o)}),[o]);const p=e=>{const{auth:t,...r}=G4(e);return c.loginWithPassword({...r,captchaToken:e.captchaToken,auth:{...t,...n}}).then((e=>e?.stepUpToken?d("fa-selection",{token:e.stepUpToken,amr:e.amr??[],allowTrustDevice:l}):e))};return _D.createElement("div",null,_D.createElement(WX,null,u("login.title")),_D.createElement(f8,{username:h,showLabels:i,showRememberMe:s,showForgotPassword:e,showAccountRecovery:t,canShowPassword:r,handler:e=>z6.handle(e,{recaptcha_enabled:a,recaptcha_site_key:o},p,"login")}),_D.createElement(t0,null,_D.createElement(n0,{target:"login-with-web-authn"},u("login.password.userAnotherIdentifier"))))},signup:({allowLogin:e=!0,initialScreen:t,allowWebAuthnLogin:n=!1,allowWebAuthnSignup:r=!1,enablePasswordAuthentication:a=!0,socialProviders:o,...i})=>{const s=u0(),{goTo:l}=VX();return _D.createElement("div",null,_D.createElement(WX,null,s("signup.title")),o&&o.length>0&&_D.createElement(a5,{providers:o,auth:i.auth}),o&&o.length>0&&_D.createElement(e0,{text:s("or")}),r?_D.createElement(l8,{enablePasswordAuthentication:a,onPasswordClick:()=>l("signup-with-password"),onBiometricClick:()=>l("signup-with-web-authn")}):_D.createElement(Uee,{...i}),e&&_D.createElement(t0,null,_D.createElement("span",null,s("signup.loginLinkPrefix"))," ",_D.createElement(n0,{target:rte(t,n)},s("signup.loginLink"))))},"signup-with-password":e=>{const t=u0();return _D.createElement("div",null,_D.createElement(WX,null,t("signup.withPassword")),_D.createElement(Uee,{...e}),_D.createElement(t0,null,_D.createElement(n0,{target:"signup"},t("back"))))},"signup-with-web-authn":({auth:e,beforeSignup:t=(e=>e),redirectUrl:n,returnToAfterEmailConfirmation:r,signupFields:a=["given_name","family_name","email"],showLabels:o=!1,userAgreement:i})=>{const s=f0(),l=o0(),u=u0(),c=_ee(a.filter((e=>"password"!==e&&"password_confirmation"!==e)),l),d=i?[...c,{staticContent:_D.createElement(r0,{key:"user-aggreement",root:$6,source:i})}]:c;return _D.createElement("div",null,_D.createElement(WX,null,u("signup.withBiometrics")),_D.createElement(jee,{fields:d,showLabels:o,beforeSubmit:t,handler:t=>s.signupWithWebAuthn({profile:V4(t),friendlyName:t.friendlyName,redirectUrl:n,returnToAfterEmailConfirmation:r},e)}),_D.createElement(t0,null,_D.createElement(n0,{target:"signup"},u("back"))))},"forgot-password":({allowLogin:e=!0,allowPhoneNumberResetPassword:t=!1,displaySafeErrorMessage:n=!1,showLabels:r=!1,allowWebAuthnLogin:a=!1,initialScreen:o,recaptcha_enabled:i=!1,recaptcha_site_key:s,redirectUrl:l,returnToAfterPasswordReset:u})=>{const c=f0(),d=o0(),{goTo:f}=VX(),h=u0(),p=DD.useCallback((e=>z6.handle({...e,redirectUrl:l,returnToAfterPasswordReset:u},{recaptcha_enabled:i,recaptcha_site_key:s},c.requestPasswordReset,"forgot_password")),[c,i,s,l,u]);return DD.useLayoutEffect((()=>{K6(s)}),[s]),_D.createElement("div",null,_D.createElement(WX,null,h("forgotPassword.title")),_D.createElement(QX,null,h("forgotPassword.prompt")),_D.createElement(zee,{showLabels:r,handler:p,onSuccess:()=>f("forgot-password-success"),skipError:n&&Hee}),t&&d.sms&&_D.createElement(t0,null,_D.createElement(Q4,{onClick:()=>f("forgot-password-phone-number")},h("forgotPassword.usePhoneNumberButton"))),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(o,a)},h("forgotPassword.backToLoginLink"))))},"forgot-password-phone-number":({allowLogin:e=!0,displaySafeErrorMessage:t=!1,showLabels:n=!1,allowWebAuthnLogin:r=!1,initialScreen:a,phoneNumberOptions:o,recaptcha_enabled:i=!1,recaptcha_site_key:s,redirectUrl:l,returnToAfterPasswordReset:u})=>{const c=f0(),{goTo:d}=VX(),f=u0(),[h,p]=DD.useState(""),g=DD.useCallback((e=>(p(e.phoneNumber),z6.handle({...e,redirectUrl:l,returnToAfterPasswordReset:u},{recaptcha_enabled:i,recaptcha_site_key:s},c.requestPasswordReset,"forgot_password"))),[c,i,s,l,u]);return DD.useLayoutEffect((()=>{K6(s)}),[s]),_D.createElement("div",null,_D.createElement(WX,null,f("forgotPassword.title")),_D.createElement(QX,null,f("forgotPassword.prompt.phoneNumber")),_D.createElement(Kee,{showLabels:n,handler:g,onSuccess:()=>d("forgot-password-code",{phoneNumber:h}),skipError:t&&Hee,phoneNumberOptions:o}),_D.createElement(t0,null,_D.createElement(Q4,{onClick:()=>d("forgot-password")},f("forgotPassword.useEmailButton"))),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(a,r)},f("forgotPassword.backToLoginLink"))))},"account-recovery":({allowLogin:e=!0,displaySafeErrorMessage:t=!1,showLabels:n=!1,recaptcha_enabled:r=!1,recaptcha_site_key:a,redirectUrl:o,returnToAfterAccountRecovery:i})=>{const s=f0(),{goTo:l}=VX(),u=u0(),c=DD.useCallback((e=>z6.handle({...e,redirectUrl:o,returnToAfterAccountRecovery:i},{recaptcha_enabled:r,recaptcha_site_key:a},s.requestAccountRecovery,"account_recovery")),[s,r,a,o,i]);return DD.useLayoutEffect((()=>{K6(a)}),[a]),_D.createElement("div",null,_D.createElement(WX,null,u("accountRecovery.title")),_D.createElement(QX,null,u("accountRecovery.prompt")),_D.createElement(tte,{showLabels:n,handler:c,onSuccess:()=>l("account-recovery-success"),skipError:t&&nte}),e&&_D.createElement(t0,null,_D.createElement(n0,{target:"login"},u("accountRecovery.backToLoginLink"))))},"forgot-password-code":({allowLogin:e=!0,displaySafeErrorMessage:t=!1,initialScreen:n,allowWebAuthnLogin:r=!1,showLabels:a=!1})=>{const o=f0(),{goTo:i,params:s}=VX(),l=u0(),u=DD.useCallback((({passwordConfirmation:e,...t})=>o.updatePassword({...s,...t})),[o,s]);return _D.createElement("div",null,_D.createElement(WX,null,l("forgotPassword.title")),_D.createElement(qX,null,l("forgotPassword.verificationCode")),_D.createElement(Vee,{showLabels:a,handler:u,onSuccess:()=>i("login"),skipError:t&&Hee}),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(n,r)},l("back"))))},"forgot-password-success":({allowLogin:e=!0,initialScreen:t,allowWebAuthnLogin:n=!1})=>{const r=u0();return _D.createElement("div",null,_D.createElement(WX,null,r("forgotPassword.title")),_D.createElement(qX,null,r("forgotPassword.successMessage")),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(t,n)},r("back"))))},"account-recovery-success":({allowLogin:e})=>{const t=u0();return _D.createElement("div",null,_D.createElement(WX,null,t("accountRecovery.title")),_D.createElement(qX,null,t("accountRecovery.successMessage")),e&&_D.createElement(t0,null,_D.createElement(n0,{target:"login"},t("back"))))},"quick-login":({initialScreen:e,allowWebAuthnLogin:t=!1,auth:n,session:r})=>{const a=u0();return r?_D.createElement("div",null,_D.createElement(WX,null,r.name??r.email),_D.createElement(QX,null,a("lastTimeYouLoggedInWith")),_D.createElement(a5,{providers:r.lastLoginType?[r.lastLoginType]:[],auth:n}),_D.createElement(t0,null,_D.createElement(n0,{target:rte(e,t)},a("notYourAccount")))):null},"fa-selection":Qee,"verification-code":Xee,reauth:({allowForgotPassword:e=!0,auth:t,session:n,showLabels:r=!1,socialProviders:a})=>{const o=f0(),i=u0();if(!n)return null;const s=function(e,...t){return e.filter((e=>t.every((t=>t.includes(e)))))}(a??[],n.socialProviders??[]);return _D.createElement("div",null,_D.createElement(WX,null,n.name),_D.createElement(QX,null,i("confirmYourIdentity")),s&&s.length>0&&_D.createElement(a5,{providers:s,auth:t}),s&&s.length>0&&n.hasPassword&&_D.createElement(e0,{text:i("or")}),n.hasPassword&&_D.createElement(Z6,{showLabels:r,showRememberMe:!1,showForgotPassword:e,showEmail:!1,handler:({password:e})=>o.loginWithPassword({email:n.email??"",password:e,auth:t})}))}},prepare:(e,{config:t,session:n})=>{if(!t.passwordPolicy)throw new Jq("This feature is not available on your account.");if(!t.webAuthn&&e.allowWebAuthnLogin)throw new Jq("The WebAuthn feature is not available on your account.");return{socialProviders:t.socialProviders,...e,session:n}}});const ote=l5({prefix:"r5-email-editor-",supportMultipleSubmits:!0,fields:[H6({key:"email",label:"email",type:"email",validator:s6})]});var ite=F2({initialView:"main",views:{main:({accessToken:e,recaptcha_enabled:t=!1,recaptcha_site_key:n,redirectUrl:r,showLabels:a=!1})=>{const o=f0(),i=u0(),{goTo:s}=VX();DD.useLayoutEffect((()=>{K6(n)}),[n]);const l=t=>o.updateEmail({...t,accessToken:e,redirectUrl:r});return _D.createElement("div",null,_D.createElement(QX,null,i("emailEditor.intro")),_D.createElement(ote,{showLabels:a,handler:e=>z6.handle(e,{recaptcha_enabled:t,recaptcha_site_key:n},l,"update_email"),onSuccess:()=>s("success")}))},success:()=>{const e=u0();return _D.createElement(qX,null,e("emailEditor.successMessage"))}}});const ste=l5({prefix:"r5-password-editor-",fields:({promptOldPassword:e=!1,canShowPassword:t=!1,config:n})=>[...e?[O6({key:"old_password",label:"oldPassword"})]:[],Oee({label:"newPassword",autoComplete:"new-password",canShowPassword:t},n),O6({key:"password_confirmation",label:"passwordConfirmation",autoComplete:"new-password",validator:new r6({rule:(e,t)=>e===t.fields.password.value,hint:"passwordMatch"})})],resetAfterSuccess:!0,resetAfterError:!0});var lte=R2({component:({authentication:e,canShowPassword:t=!1,promptOldPassword:n=!1,showLabels:r=!1,onSuccess:a=(()=>{}),onError:o=(()=>{})})=>{const i=f0();return _D.createElement(ste,{handler:({password:t,oldPassword:n})=>i.updatePassword({password:t,oldPassword:n,...e}),supportMultipleSubmits:n,promptOldPassword:n,canShowPassword:t,showLabels:r,onSuccess:a,onError:o})},prepare:e=>{return{...e,...(t=e.accessToken,n=e.userId,t?{authentication:{accessToken:t}}:n?{authentication:{userId:n}}:{})};var t,n}});const ute=l5({prefix:"r5-phonenumber-editor-",fields:[H6({key:"verification_code",label:"verificationCode",type:"text"})]});var cte=F2({initialView:"main",views:{main:({accessToken:e,showLabels:t=!1,phoneNumberOptions:n})=>{const r=f0(),a=o0(),o=u0(),{goTo:i}=VX(),s=DD.useMemo((()=>(e=>l5({prefix:"r5-phonenumber-editor-",fields:({phoneNumberOptions:t})=>[hee({required:!0,...t},e)]}))(a)),[a]);return _D.createElement("div",null,_D.createElement(QX,null,o("phoneNumberEditor.intro")),_D.createElement(s,{showLabels:t,handler:t=>r.updatePhoneNumber({...t,accessToken:e}).then((()=>t)),onSuccess:e=>i("verificationCode",e),phoneNumberOptions:n}))},verificationCode:({accessToken:e,onSuccess:t=(()=>{}),onError:n=(()=>{})})=>{const r=f0(),a=u0(),{params:o}=VX(),{phoneNumber:i}=o;return _D.createElement("div",null,_D.createElement(qX,null,a("phoneNumberEditor.verification.intro")),_D.createElement(ute,{handler:t=>r.verifyPhoneNumber({...t,phoneNumber:i,accessToken:e}),onSuccess:t,onError:n}))}}});const dte=()=>{const e=window.location.search.substring(1),{verificationCode:t,email:n}=W4(e);return{authentication:{verificationCode:t,email:n}}};var fte=F2({initialView:"main",views:{main:({authentication:e,canShowPassword:t=!1,onSuccess:n=(()=>{}),onError:r=(()=>{}),showLabels:a=!1})=>{const o=f0(),i=u0(),{goTo:s}=VX();return _D.createElement("div",null,_D.createElement(WX,null,i("passwordReset.title")),_D.createElement(qX,null,i("passwordReset.intro")),_D.createElement(ste,{handler:({password:t})=>o.updatePassword({password:t,...e}),canShowPassword:t,showLabels:a,onSuccess:()=>{n(),s("success")},onError:r}))},success:({loginLink:e})=>{const t=u0();return _D.createElement("div",null,_D.createElement(WX,null,t("passwordReset.successTitle")),_D.createElement(qX,null,t("passwordReset.successMessage")),e&&_D.createElement(qX,null,_D.createElement(n0,{href:e},t("passwordReset.loginLink"))))}},prepare:e=>({...e,...dte()})});const hte=l5({prefix:"r5-passwordless-",fields:[H6({key:"email",label:"email",type:"email",validator:s6})]}),pte=l5({prefix:"r5-passwordless-sms-",fields:[H6({key:"verification_code",label:"verificationCode",type:"text"})]});var gte=F2({initialView:"main",views:{main:({auth:e,authType:t="magic_link",recaptcha_enabled:n=!1,recaptcha_site_key:r,showIntro:a=!0,showSocialLogins:o=!1,socialProviders:i,phoneNumberOptions:s})=>{const l=f0(),u=o0(),c=u0(),{goTo:d}=VX();DD.useLayoutEffect((()=>{K6(r)}),[r]);const f=n=>l.startPasswordless({authType:t,...n},e).then((()=>n)),h=e=>"email"in e?d("emailSent"):d("verificationCode",e),p="magic_link"===t,g=(e=>l5({prefix:"r5-passwordless-sms-",fields:({phoneNumberOptions:t})=>[hee({required:!0,...t},e)]}))(u);return _D.createElement("div",null,o&&i&&i.length>0&&_D.createElement(a5,{providers:i,auth:e}),o&&i&&i.length>0&&_D.createElement(e0,{text:c("or")}),p&&a&&_D.createElement(QX,null,c("passwordless.intro")),p&&_D.createElement(hte,{handler:e=>z6.handle(e,{recaptcha_enabled:n,recaptcha_site_key:r},f,"passwordless_email"),onSuccess:h}),!p&&a&&_D.createElement(QX,null,c("passwordless.sms.intro")),!p&&_D.createElement(g,{handler:e=>z6.handle(e,{recaptcha_enabled:n,recaptcha_site_key:r},f,"passwordless_phone"),onSuccess:h,phoneNumberOptions:s}))},emailSent:()=>{const e=u0();return _D.createElement(qX,null,e("passwordless.emailSent"))},verificationCode:({authType:e="magic_link",recaptcha_enabled:t=!1,recaptcha_site_key:n})=>{const r=f0(),a=u0(),{params:o}=VX(),{phoneNumber:i}=o,s=t=>r.verifyPasswordless({authType:e,phoneNumber:i,...t});return _D.createElement("div",null,_D.createElement(qX,null,a("passwordless.sms.verification.intro")),_D.createElement(pte,{handler:e=>z6.handle(e,{recaptcha_enabled:t,recaptcha_site_key:n},s,"verify_passwordless_sms")}))}},prepare:(e,{config:t})=>({socialProviders:t.socialProviders,...e})});const mte=l5({prefix:"r5-profile-editor-",supportMultipleSubmits:!0,submitLabel:"save"});var vte=R2({component:({accessToken:e,onSuccess:t=(()=>{}),onError:n=(()=>{}),phoneNumberOptions:r,profile:a,redirectUrl:o,resolvedFields:i,showLabels:s=!1})=>{const l=f0();return _D.createElement(mte,{handler:t=>l.updateProfile({data:t,accessToken:e,redirectUrl:o}),initialModel:a,fields:i,sharedProps:{...r},showLabels:s,onSuccess:t,onError:n})},prepare:(e,{apiClient:t,config:n})=>{const r={showLabels:!0,fields:[],...e},{accessToken:a,fields:o=[]}=r;if(o.some((e=>{const t="string"==typeof e?e:e.key;return"password"===t||"password_confirmation"===t})))throw new Jq("These fields are not allowed: password, password_confirmation.");const i=_ee(o,{...n,errorArchivedConsents:!1});return t.getUser({accessToken:a,fields:i.map((({path:e})=>e)).join(",")}).then((e=>K4(e))).then((e=>{const t=e.consents&&Object.keys(e.consents).length>0?yte(o,n.consentsVersions,e.consents):void 0,a={...e,consents:t};return{...r,profile:a,resolvedFields:i.filter((e=>!("email"===e.path&&a.email||"phone_number"===e.path&&n.sms&&a.phoneNumber)))}}))}});const yte=(e,t,n)=>Object.keys(n).filter((r=>{const a=e.map((e=>"string"==typeof e?e:e.key)).find((e=>e.startsWith(`consents.${r}`))),o=a?a.split(".v"):[],i=t[r].versions[0].versionId,s=parseInt(o[1])||i,l=n[r].consentVersion?.versionId;return!s||s===l})).reduce(((e,t)=>(e[t]=n[t],e)),{}),bte=UX.span`
409
+ `,Ree=({value:e,onChange:t,label:n,description:r,path:a,required:o,validation:i,consentCannotBeGranted:s})=>{const l=(L4(e,"granted")?e.granted:e)??!1,u=i&&n6(i)?i.error:void 0;return _D.createElement("div",{style:{position:"relative"}},_D.createElement(C6,{value:l?String(l):void 0,onToggle:()=>t({value:!s&&!l,isDirty:!0}),name:a,label:n,"data-testid":a,required:o,error:u}),_D.createElement(r0,{root:Nee,source:r,"data-testid":`${a}.description`}))};const Fee={customIdentifier:(e,t)=>H6({label:"customIdentifier",...e}),givenName:(e,t)=>H6({label:"givenName",...e}),familyName:(e,t)=>H6({label:"familyName",...e}),email:(e,t)=>H6({label:"email",type:"email",...e,validator:s6}),phoneNumber:(e,t)=>hee(e,t),password:(e,t)=>Oee(e,t),passwordConfirmation:(e,t)=>O6({label:"passwordConfirmation",...e,canShowPassword:!1,validator:new r6({rule:(e,t)=>e===t.fields.password.value,hint:"passwordMatch"})}),gender:(e,t)=>p8({label:"gender",...e,values:[{value:"male",label:"genders.male"},{value:"female",label:"genders.female"},{value:"other",label:"genders.other"}]}),birthdate:(e,t)=>function({min:e,max:t,label:n="birthdate",...r},a){return V8({...r,label:n,validator:H8(e,t)},a)}(e,t),"address.streetAddress":(e,t)=>H6({label:"address.streetAddress",...e}),"address.locality":(e,t)=>H6({label:"address.locality",...e}),"address.region":(e,t)=>H6({label:"address.region",...e}),"address.postalCode":(e,t)=>H6({label:"address.postalCode",...e}),"address.country":(e,t)=>H6({label:"address.country",...e}),friendlyName:(e,t)=>H6({label:"webauthn.friendly.name",required:!1,...e})};const Bee={number:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"number"}),integer:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"number",format:{bind:e=>"number"==typeof e?e.toString():"",unbind:e=>{const t=L4(e)?e.raw:e;return t?parseInt(t,10):0}},validator:l6}),decimal:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"number",format:{bind:e=>"number"==typeof e?e.toString():"",unbind:e=>{const t=L4(e)?e.raw:e;return t?parseFloat(t):0}},validator:u6}),string:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`}),date:(e,{label:t,...n},r)=>V8({label:t??e.name,...n,key:`custom_fields.${e.path}`},r),checkbox:(e,{label:t,...n},r)=>R6({label:t??e.name,...n,key:`custom_fields.${e.path}`,...n.required?{validator:i6}:{}}),select:(e,{label:t,...n},r)=>p8({label:t??e.name,...n,key:`custom_fields.${e.path}`,values:e.selectableValues??[]}),phone:(e,{label:t,...n},r)=>hee({label:t??e.name,...n,key:`custom_fields.${e.path}`},r),email:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`,type:"email",validator:s6}),tags:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`}),object:(e,{label:t,...n},r)=>H6({label:t??e.name,...n,key:`custom_fields.${e.path}`})};function Lee(e,t,n){if(t.errorArchivedConsents&&"archived"===e.status)throw new Jq(`The '${e.key}' consent is archived and cannot be displayed.`);const r=Number(n)||Math.max(...Object.values(e.versions.map((e=>Number(e.versionId))))),a=e.versions.find((e=>e.versionId===r));if(!a)throw new Jq(`Unknown version ID n°${r} of consent '${e.key}'.`);return function({type:e,required:t=!1,consentCannotBeGranted:n,description:r,version:a,...o}){return d6({...o,required:t,defaultValue:{granted:o.defaultValue??!1},format:{bind:e=>e,unbind:t=>void 0!==t?{granted:(L4(t,"granted")?t.granted:t)??!1,consentType:e,consentVersion:a}:null},validator:t?i6:a6,rawProperty:"granted",component:Ree,extendedParams:{consentCannotBeGranted:n,description:r,type:e,version:a}})}({...t,key:`consents.${e.key}.${r}`,path:`consents.${e.key}`,label:a.title,type:e.consentType,version:{versionId:r,language:a.language},description:a.description??a.title,consentCannotBeGranted:!t.errorArchivedConsents&&"archived"===e.status})}const Dee=(e,t)=>{if(function(e){return e in Fee}(e.key)){return function(e,t,n){return e(t,n)}(Fee[e.key],e,t)}if(function(e,t,n){return e.customFields.some((e=>{const n=U4(e.path);return t===n||t===`customFields.${n}`}))}(t,e.key)){const n=((e,t)=>e.customFields.find((e=>{const n=U4(e.path);return t===n||t===`customFields.${n}`})))(t,e.key);if(n){return function(e,t,n,r){return t(e,n,r)}(n,Bee[n.dataType],e,t)}}const n=e.key.split(".v");if(function(e,t,n){return Object.values(e.consentsVersions).some((e=>{const n=U4(e.key);return t===n||t===`consents.${n}`}))}(t,n[0])){const r=((e,t)=>Object.values(e.consentsVersions).find((e=>{const n=U4(e.key);return t===n||t===`consents.${n}`})))(t,n[0]);if(r){const t=r.versions[0].versionId;return Lee(r,e,n[1]||t)}}throw new Jq(`Unknown field: ${e.key}`)};function _ee(e=[],{canShowPassword:t,errorArchivedConsents:n,...r}){return e.filter((e=>!!e)).map((e=>Dee("string"==typeof e?{key:z4(e),canShowPassword:t,errorArchivedConsents:n}:{...e,key:z4(e.key),canShowPassword:t,errorArchivedConsents:n},r)))}const Gee=l5({prefix:"r5-signup-",submitLabel:"signup.submitLabel"}),Uee=({auth:e,beforeSignup:t=(e=>e),canShowPassword:n,phoneNumberOptions:r,recaptcha_enabled:a=!1,recaptcha_site_key:o,redirectUrl:i,returnToAfterEmailConfirmation:s,showLabels:l,signupFields:u=["given_name","family_name","email","password","password_confirmation"],userAgreement:c})=>{const d=f0(),f=o0(),[h,p]=DD.useState([]);DD.useLayoutEffect((()=>{K6(o)}),[o]);const g=DD.useCallback((t=>{const n=function(e){const t=e.captchaToken;return delete e.captchaToken,t}(t);return d.signup({captchaToken:n,data:V4(t),auth:e,redirectUrl:i,returnToAfterEmailConfirmation:s})}),[e,d,i,s]),m=DD.useCallback((e=>{const t=(L4(e.email?.value)?e.email?.value.raw:e.email?.value)??"",n=(L4(e.givenName?.value)?e.givenName?.value.raw:e.givenName?.value)??"",r=(L4(e.familyName?.value)?e.familyName?.value.raw:e.familyName?.value)??"",a=[t.split("@"),t,n.split(" "),r.split(" ")].flat(1).map((e=>e.trim().toLowerCase())).filter((function(e){return D4(e)})),o=Array.from(new Set(a));var i,s;s=h,(i=o).length===s.length&&i.every((e=>s.includes(e)))||p(o)}),[h]),v=_ee(u,{...f,canShowPassword:n,errorArchivedConsents:!0}),y=c?[...v,{staticContent:_D.createElement(r0,{key:"user-aggreement","data-testid":"user-aggreement",root:$6,source:c})}]:v;return _D.createElement(Gee,{fields:y,showLabels:l,beforeSubmit:t,onFieldChange:m,sharedProps:{blacklist:h,...r},handler:e=>z6.handle(e,{recaptcha_enabled:a,recaptcha_site_key:o},g,"signup")})},jee=l5({prefix:"r5-webauthn-signup-",submitLabel:"signup.submitLabel"}),zee=l5({prefix:"r5-forgot-password-",fields:()=>[H6({key:"email",label:"email",required:!0,type:"email",validator:s6})],submitLabel:"forgotPassword.submitLabel"}),Kee=l5({prefix:"r5-forgot-password-",fields:({config:e,phoneNumberOptions:t})=>[hee({key:"phoneNumber",label:"phoneNumber",required:!0,withCountryCallingCode:!1,...t},e)],submitLabel:"forgotPassword.submitLabel.code"}),Vee=l5({prefix:"r5-verification-code-",fields:({canShowPassword:e=!1,config:t})=>[H6({key:"verification_code",label:"verificationCode",type:"text"}),Oee({label:"newPassword",autoComplete:"new-password",canShowPassword:e},t),O6({key:"password_confirmation",label:"passwordConfirmation",autoComplete:"new-password",validator:new r6({rule:(e,t)=>e===t.fields.password.value,hint:"passwordMatch"})})]}),Hee=e=>!!Yq(e)&&"resource_not_found"===e.error,Wee=e=>{const{label:t,value:n,...r}=e,a=L4(n,"raw")?n.raw:n;return _D.createElement(S6,{labelText:t,value:a,...r})};function Zee({defaultValue:e,options:t,...n}){return d6({...n,defaultValue:e??(1===t.length?String(t[0].value):void 0),component:Wee,extendedParams:e=>({options:t.map((({label:t,value:n})=>({value:n,label:t?"string"==typeof t?e(t):t:"string"==typeof n?e(n):n})))})})}const qee=l5({prefix:"r5-mfa-start-step-up-",submitLabel:"mfa.stepUp.start"}),Yee=l5({prefix:"r5-passwordless-sms-",fields:({allowTrustDevice:e})=>[H6({key:"verification_code",label:"verificationCode",type:"text"}),...e?[R6({key:"trust_device",label:"mfa.stepUp.trustDevice",defaultValue:!1})]:[]]}),Jee=l5({prefix:"r5-mfa-start-passwordless",fields:({options:e})=>[Zee({key:"authType",label:"authType",options:e})]}),Qee=e=>{const t=f0(),n=u0(),{params:r}=VX(),a=r,{amr:o,showIntro:i=!0,token:s}={...e,...a},[l,u]=DD.useState(),c=DD.useCallback((e=>t.startPasswordless({...e,stepUp:s}).then((t=>u({...t,...e})))),[t,s]);return DD.useEffect((()=>{1===o.length&&c({authType:o[0]})}),[o,c]),l?_D.createElement(Xee,{...l,auth:e.auth,allowTrustDevice:e.allowTrustDevice}):o.length>1?_D.createElement("div",null,i&&_D.createElement(QX,null,n("mfa.select.factor")),_D.createElement(Jee,{options:o.map((e=>({key:e,value:e,label:e}))),handler:c})):null},Xee=e=>{const t=f0(),n=u0(),{params:r}=VX(),{rbaEnabled:a}=o0(),o=r,{auth:i,authType:s,challengeId:l,allowTrustDevice:u}={...e,...o};return _D.createElement("div",null,"sms"===s&&_D.createElement(qX,null,n("passwordless.sms.verification.intro")),"email"===s&&_D.createElement(qX,null,n("passwordless.email.verification.intro")),_D.createElement(Yee,{allowTrustDevice:a&&u,handler:e=>t.verifyMfaPasswordless({challengeId:l,verificationCode:e.verificationCode,trustDevice:e.trustDevice}).then((e=>window.location.replace(i?.redirectUri+"?"+Z4(e))))}))};var ete=F2({initialView:"main",views:{main:({accessToken:e,auth:t,showIntro:n=!0,showStepUpStart:r=!0,allowTrustDevice:a=!1})=>{const o=f0(),{goTo:i}=VX(),[s,l]=DD.useState(),u=DD.useCallback((()=>o.getMfaStepUpToken({options:t,accessToken:e}).then((e=>(l(e),e)))),[e,t,o]);return DD.useEffect((()=>{r||u()}),[r,u]),r?_D.createElement(qee,{handler:u,onSuccess:e=>i("fa-selection",{...e,allowTrustDevice:a})}):s?_D.createElement(Qee,{...s,showIntro:n,auth:t,allowTrustDevice:a}):null},"fa-selection":Qee,"verification-code":Xee}});const tte=l5({prefix:"r5-account-recovery-",fields:[H6({key:"email",label:"email",type:"email",validator:s6})],submitLabel:"accountRecovery.submitLabel"}),nte=e=>!!Yq(e)&&"resource_not_found"===e.error;function rte(e,t){return"login"===e||"login-with-web-authn"===e?e:t?"login-with-web-authn":"login"}var ate=F2({initialView({initialScreen:e,allowLogin:t=!0,allowQuickLogin:n=!0,allowSignup:r=!0,allowWebAuthnLogin:a,socialProviders:o,session:i={}}){const s=n&&!i.isAuthenticated&&i.lastLoginType&&o?.includes(i.lastLoginType);return e??(s?"quick-login":void 0)??(i.isAuthenticated?"reauth":void 0)??(t&&!a?"login":void 0)??(t?"login-with-web-authn":void 0)??(r?"signup":void 0)??"forgot-password"},views:{login:({acceptTos:e,allowForgotPassword:t=!0,allowSignup:n=!0,allowWebAuthnLogin:r,allowAccountRecovery:a=!1,auth:o,canShowPassword:i=!1,socialProviders:s,allowCustomIdentifier:l=!1,showLabels:u=!1,showRememberMe:c=!1,recaptcha_enabled:d=!1,recaptcha_site_key:f,allowAuthentMailPhone:h=!0,allowTrustDevice:p})=>{const g=u0(),m=f0(),{goTo:v}=VX(),y=g0();DD.useLayoutEffect((()=>{K6(f)}),[f]);const b=new AbortController,w=b.signal;_D.useEffect((()=>{r&&m.loginWithWebAuthn({conditionalMediation:"preferred",auth:{...o},signal:w}).catch((()=>{}))}),[m,o,r,w]);const C=e=>{const{auth:t,...n}=G4(e);return m.loginWithPassword({...n,auth:{...t,...o}}).then((e=>e?.stepUpToken?v("fa-selection",{token:e.stepUpToken,amr:e.amr??[],allowTrustDevice:p}):e))},S="password"===y?.lastLoginType?y.email:void 0;return _D.createElement("div",null,_D.createElement(WX,null,g("login.title")),s&&s.length>0&&_D.createElement(a5,{providers:s,auth:o,acceptTos:e}),s&&s.length>0&&_D.createElement(e0,{text:g("or")}),_D.createElement(Z6,{showLabels:u,showRememberMe:c,showForgotPassword:t,showAccountRecovery:a,canShowPassword:i,defaultIdentifier:S,allowCustomIdentifier:l,allowAuthentMailPhone:h,handler:e=>z6.handle(e,{recaptcha_enabled:d,recaptcha_site_key:f},C,"login")}),n&&_D.createElement(t0,null,_D.createElement("span",null,g("login.signupLinkPrefix"))," ",_D.createElement(n0,{target:"signup",controller:b},g("login.signupLink"))))},"login-with-web-authn":({acceptTos:e,allowSignup:t=!0,auth:n,enablePasswordAuthentication:r=!0,showLabels:a=!1,socialProviders:o,allowAccountRecovery:i})=>{const s=f0(),{goTo:l}=VX(),u=u0(),c=g0(),d=new AbortController,f=d.signal;_D.useEffect((()=>{s.loginWithWebAuthn({conditionalMediation:"preferred",auth:{...n},signal:f}).catch((()=>{}))}),[s,n,f]);const h=_D.useCallback((e=>{const{auth:t,...r}=G4(e);return(e=>"customIdentifier"in e)(r)?(console.error("Custom identifier is not a valid WebAuthn identifier."),Promise.reject(new Error("Custom identifier is not a valid WebAuthn identifier."))):s.loginWithWebAuthn({...r,auth:{...t,...n}})}),[s,n]),p=DD.useCallback((e=>{const t="identifier"in e?e.identifier:"email"in e?e.email:"";l("login-with-password",{username:t})}),[l]),g="password"===c?.lastLoginType?c.email:void 0;return _D.createElement("div",null,_D.createElement(WX,null,u("login.title")),o&&o.length>0&&_D.createElement(a5,{providers:o,auth:n,acceptTos:e}),o&&o.length>0&&_D.createElement(e0,{text:u("or")}),_D.createElement(c8,{showLabels:a,defaultIdentifier:g,handler:h,showAccountRecovery:i,SubmitComponent:({disabled:e,onClick:t})=>_D.createElement(s8,{disabled:e,enablePasswordAuthentication:r,onPasswordClick:()=>t(p)})}),t&&_D.createElement(t0,null,_D.createElement("span",null,u("login.signupLinkPrefix"))," ",_D.createElement(n0,{controller:d,target:"signup"},u("login.signupLink"))))},"login-with-password":({allowForgotPassword:e=!0,allowAccountRecovery:t=!1,auth:n,canShowPassword:r,recaptcha_enabled:a=!1,recaptcha_site_key:o,showLabels:i,showRememberMe:s,allowTrustDevice:l})=>{const u=u0(),c=f0(),{goTo:d,params:f}=VX(),{username:h}=f;DD.useLayoutEffect((()=>{K6(o)}),[o]);const p=e=>{const{auth:t,...r}=G4(e);return c.loginWithPassword({...r,captchaToken:e.captchaToken,auth:{...t,...n}}).then((e=>e?.stepUpToken?d("fa-selection",{token:e.stepUpToken,amr:e.amr??[],allowTrustDevice:l}):e))};return _D.createElement("div",null,_D.createElement(WX,null,u("login.title")),_D.createElement(f8,{username:h,showLabels:i,showRememberMe:s,showForgotPassword:e,showAccountRecovery:t,canShowPassword:r,handler:e=>z6.handle(e,{recaptcha_enabled:a,recaptcha_site_key:o},p,"login")}),_D.createElement(t0,null,_D.createElement(n0,{target:"login-with-web-authn"},u("login.password.userAnotherIdentifier"))))},signup:({allowLogin:e=!0,initialScreen:t,allowWebAuthnLogin:n=!1,allowWebAuthnSignup:r=!1,enablePasswordAuthentication:a=!0,socialProviders:o,...i})=>{const s=u0(),{goTo:l}=VX();return _D.createElement("div",null,_D.createElement(WX,null,s("signup.title")),o&&o.length>0&&_D.createElement(a5,{providers:o,auth:i.auth}),o&&o.length>0&&_D.createElement(e0,{text:s("or")}),r?_D.createElement(l8,{enablePasswordAuthentication:a,onPasswordClick:()=>l("signup-with-password"),onBiometricClick:()=>l("signup-with-web-authn")}):_D.createElement(Uee,{...i}),e&&_D.createElement(t0,null,_D.createElement("span",null,s("signup.loginLinkPrefix"))," ",_D.createElement(n0,{target:rte(t,n)},s("signup.loginLink"))))},"signup-with-password":e=>{const t=u0();return _D.createElement("div",null,_D.createElement(WX,null,t("signup.withPassword")),_D.createElement(Uee,{...e}),_D.createElement(t0,null,_D.createElement(n0,{target:"signup"},t("back"))))},"signup-with-web-authn":({auth:e,beforeSignup:t=(e=>e),redirectUrl:n,returnToAfterEmailConfirmation:r,signupFields:a=["given_name","family_name","email"],showLabels:o=!1,userAgreement:i})=>{const s=f0(),l=o0(),u=u0(),c=_ee(a.filter((e=>"password"!==e&&"password_confirmation"!==e)),l),d=i?[...c,{staticContent:_D.createElement(r0,{key:"user-aggreement",root:$6,source:i})}]:c;return _D.createElement("div",null,_D.createElement(WX,null,u("signup.withBiometrics")),_D.createElement(jee,{fields:d,showLabels:o,beforeSubmit:t,handler:t=>s.signupWithWebAuthn({profile:V4(t),friendlyName:t.friendlyName,redirectUrl:n,returnToAfterEmailConfirmation:r},e)}),_D.createElement(t0,null,_D.createElement(n0,{target:"signup"},u("back"))))},"forgot-password":({allowLogin:e=!0,allowPhoneNumberResetPassword:t=!1,displaySafeErrorMessage:n=!1,showLabels:r=!1,allowWebAuthnLogin:a=!1,initialScreen:o,recaptcha_enabled:i=!1,recaptcha_site_key:s,redirectUrl:l,returnToAfterPasswordReset:u})=>{const c=f0(),d=o0(),{goTo:f}=VX(),h=u0(),p=DD.useCallback((e=>z6.handle({...e,redirectUrl:l,returnToAfterPasswordReset:u},{recaptcha_enabled:i,recaptcha_site_key:s},c.requestPasswordReset,"forgot_password")),[c,i,s,l,u]);return DD.useLayoutEffect((()=>{K6(s)}),[s]),_D.createElement("div",null,_D.createElement(WX,null,h("forgotPassword.title")),_D.createElement(QX,null,h("forgotPassword.prompt")),_D.createElement(zee,{showLabels:r,handler:p,onSuccess:()=>f("forgot-password-success"),skipError:n&&Hee}),t&&d.sms&&_D.createElement(t0,null,_D.createElement(Q4,{onClick:()=>f("forgot-password-phone-number")},h("forgotPassword.usePhoneNumberButton"))),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(o,a)},h("forgotPassword.backToLoginLink"))))},"forgot-password-phone-number":({allowLogin:e=!0,displaySafeErrorMessage:t=!1,showLabels:n=!1,allowWebAuthnLogin:r=!1,initialScreen:a,phoneNumberOptions:o,recaptcha_enabled:i=!1,recaptcha_site_key:s,redirectUrl:l,returnToAfterPasswordReset:u})=>{const c=f0(),{goTo:d}=VX(),f=u0(),[h,p]=DD.useState(""),g=DD.useCallback((e=>(p(e.phoneNumber),z6.handle({...e,redirectUrl:l,returnToAfterPasswordReset:u},{recaptcha_enabled:i,recaptcha_site_key:s},c.requestPasswordReset,"forgot_password"))),[c,i,s,l,u]);return DD.useLayoutEffect((()=>{K6(s)}),[s]),_D.createElement("div",null,_D.createElement(WX,null,f("forgotPassword.title")),_D.createElement(QX,null,f("forgotPassword.prompt.phoneNumber")),_D.createElement(Kee,{showLabels:n,handler:g,onSuccess:()=>d("forgot-password-code",{phoneNumber:h}),skipError:t&&Hee,phoneNumberOptions:o}),_D.createElement(t0,null,_D.createElement(Q4,{onClick:()=>d("forgot-password")},f("forgotPassword.useEmailButton"))),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(a,r)},f("forgotPassword.backToLoginLink"))))},"account-recovery":({allowLogin:e=!0,displaySafeErrorMessage:t=!1,showLabels:n=!1,recaptcha_enabled:r=!1,recaptcha_site_key:a,redirectUrl:o,returnToAfterAccountRecovery:i})=>{const s=f0(),{goTo:l}=VX(),u=u0(),c=DD.useCallback((e=>z6.handle({...e,redirectUrl:o,returnToAfterAccountRecovery:i},{recaptcha_enabled:r,recaptcha_site_key:a},s.requestAccountRecovery,"account_recovery")),[s,r,a,o,i]);return DD.useLayoutEffect((()=>{K6(a)}),[a]),_D.createElement("div",null,_D.createElement(WX,null,u("accountRecovery.title")),_D.createElement(QX,null,u("accountRecovery.prompt")),_D.createElement(tte,{showLabels:n,handler:c,onSuccess:()=>l("account-recovery-success"),skipError:t&&nte}),e&&_D.createElement(t0,null,_D.createElement(n0,{target:"login"},u("accountRecovery.backToLoginLink"))))},"forgot-password-code":({allowLogin:e=!0,displaySafeErrorMessage:t=!1,initialScreen:n,allowWebAuthnLogin:r=!1,showLabels:a=!1})=>{const o=f0(),{goTo:i,params:s}=VX(),l=u0(),u=DD.useCallback((({passwordConfirmation:e,...t})=>o.updatePassword({...s,...t})),[o,s]);return _D.createElement("div",null,_D.createElement(WX,null,l("forgotPassword.title")),_D.createElement(qX,null,l("forgotPassword.verificationCode")),_D.createElement(Vee,{showLabels:a,handler:u,onSuccess:()=>i("login"),skipError:t&&Hee}),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(n,r)},l("back"))))},"forgot-password-success":({allowLogin:e=!0,initialScreen:t,allowWebAuthnLogin:n=!1})=>{const r=u0();return _D.createElement("div",null,_D.createElement(WX,null,r("forgotPassword.title")),_D.createElement(qX,null,r("forgotPassword.successMessage")),e&&_D.createElement(t0,null,_D.createElement(n0,{target:rte(t,n)},r("back"))))},"account-recovery-success":({allowLogin:e})=>{const t=u0();return _D.createElement("div",null,_D.createElement(WX,null,t("accountRecovery.title")),_D.createElement(qX,null,t("accountRecovery.successMessage")),e&&_D.createElement(t0,null,_D.createElement(n0,{target:"login"},t("back"))))},"quick-login":({initialScreen:e,allowWebAuthnLogin:t=!1,auth:n,session:r})=>{const a=u0();return r?_D.createElement("div",null,_D.createElement(WX,null,r.name??r.email),_D.createElement(QX,null,a("lastTimeYouLoggedInWith")),_D.createElement(a5,{providers:r.lastLoginType?[r.lastLoginType]:[],auth:n}),_D.createElement(t0,null,_D.createElement(n0,{target:rte(e,t)},a("notYourAccount")))):null},"fa-selection":Qee,"verification-code":Xee,reauth:({allowForgotPassword:e=!0,auth:t,session:n,showLabels:r=!1,socialProviders:a})=>{const o=f0(),i=u0();if(!n)return null;const s=function(e,...t){return e.filter((e=>t.every((t=>t.includes(e)))))}(a??[],n.socialProviders??[]);return _D.createElement("div",null,_D.createElement(WX,null,n.name),_D.createElement(QX,null,i("confirmYourIdentity")),s&&s.length>0&&_D.createElement(a5,{providers:s,auth:t}),s&&s.length>0&&n.hasPassword&&_D.createElement(e0,{text:i("or")}),n.hasPassword&&_D.createElement(Z6,{showLabels:r,showRememberMe:!1,showForgotPassword:e,showEmail:!1,handler:({password:e})=>o.loginWithPassword({email:n.email??"",password:e,auth:t})}))}},prepare:(e,{config:t,session:n})=>{if(!t.passwordPolicy)throw new Jq("This feature is not available on your account.");if(!t.webAuthn&&e.allowWebAuthnLogin)throw new Jq("The WebAuthn feature is not available on your account.");return{socialProviders:t.socialProviders,...e,session:n}}});const ote=l5({prefix:"r5-email-editor-",supportMultipleSubmits:!0,fields:[H6({key:"email",label:"email",type:"email",validator:s6})]});var ite=F2({initialView:"main",views:{main:({accessToken:e,recaptcha_enabled:t=!1,recaptcha_site_key:n,redirectUrl:r,showLabels:a=!1})=>{const o=f0(),i=u0(),{goTo:s}=VX();DD.useLayoutEffect((()=>{K6(n)}),[n]);const l=t=>o.updateEmail({...t,accessToken:e,redirectUrl:r});return _D.createElement("div",null,_D.createElement(QX,null,i("emailEditor.intro")),_D.createElement(ote,{showLabels:a,handler:e=>z6.handle(e,{recaptcha_enabled:t,recaptcha_site_key:n},l,"update_email"),onSuccess:()=>s("success")}))},success:()=>{const e=u0();return _D.createElement(qX,null,e("emailEditor.successMessage"))}}});const ste=l5({prefix:"r5-password-editor-",fields:({promptOldPassword:e=!1,canShowPassword:t=!1,config:n})=>[...e?[O6({key:"old_password",label:"oldPassword"})]:[],Oee({label:"newPassword",autoComplete:"new-password",canShowPassword:t},n),O6({key:"password_confirmation",label:"passwordConfirmation",autoComplete:"new-password",validator:new r6({rule:(e,t)=>e===t.fields.password.value,hint:"passwordMatch"})})],resetAfterSuccess:!0,resetAfterError:!0});var lte=R2({component:({authentication:e,canShowPassword:t=!1,promptOldPassword:n=!1,showLabels:r=!1,onSuccess:a=(()=>{}),onError:o=(()=>{})})=>{const i=f0();return _D.createElement(ste,{handler:({password:t,oldPassword:n})=>i.updatePassword({password:t,oldPassword:n,...e}),supportMultipleSubmits:n,promptOldPassword:n,canShowPassword:t,showLabels:r,onSuccess:a,onError:o})},prepare:e=>{return{...e,...(t=e.accessToken,n=e.userId,t?{authentication:{accessToken:t}}:n?{authentication:{userId:n}}:{})};var t,n}});const ute=l5({prefix:"r5-phonenumber-editor-",fields:[H6({key:"verification_code",label:"verificationCode",type:"text"})]});var cte=F2({initialView:"main",views:{main:({accessToken:e,showLabels:t=!1,phoneNumberOptions:n})=>{const r=f0(),a=o0(),o=u0(),{goTo:i}=VX(),s=DD.useMemo((()=>(e=>l5({prefix:"r5-phonenumber-editor-",fields:({phoneNumberOptions:t})=>[hee({required:!0,...t},e)]}))(a)),[a]);return _D.createElement("div",null,_D.createElement(QX,null,o("phoneNumberEditor.intro")),_D.createElement(s,{showLabels:t,handler:t=>r.updatePhoneNumber({...t,accessToken:e}).then((()=>t)),onSuccess:e=>i("verificationCode",e),phoneNumberOptions:n}))},verificationCode:({accessToken:e,onSuccess:t=(()=>{}),onError:n=(()=>{})})=>{const r=f0(),a=u0(),{params:o}=VX(),{phoneNumber:i}=o;return _D.createElement("div",null,_D.createElement(qX,null,a("phoneNumberEditor.verification.intro")),_D.createElement(ute,{handler:t=>r.verifyPhoneNumber({...t,phoneNumber:i,accessToken:e}),onSuccess:t,onError:n}))}}});const dte=()=>{const e=window.location.search.substring(1),{verificationCode:t,email:n}=W4(e);return{authentication:{verificationCode:t,email:n}}};var fte=F2({initialView:"main",views:{main:({authentication:e,canShowPassword:t=!1,onSuccess:n=(()=>{}),onError:r=(()=>{}),showLabels:a=!1})=>{const o=f0(),i=u0(),{goTo:s}=VX();return _D.createElement("div",null,_D.createElement(WX,null,i("passwordReset.title")),_D.createElement(qX,null,i("passwordReset.intro")),_D.createElement(ste,{handler:({password:t})=>o.updatePassword({password:t,...e}),canShowPassword:t,showLabels:a,onSuccess:()=>{n(),s("success")},onError:r}))},success:({loginLink:e})=>{const t=u0();return _D.createElement("div",null,_D.createElement(WX,null,t("passwordReset.successTitle")),_D.createElement(qX,null,t("passwordReset.successMessage")),e&&_D.createElement(qX,null,_D.createElement(n0,{href:e},t("passwordReset.loginLink"))))}},prepare:e=>({...e,...dte()})});const hte=l5({prefix:"r5-passwordless-",fields:[H6({key:"email",label:"email",type:"email",validator:s6})]}),pte=l5({prefix:"r5-passwordless-sms-",fields:[H6({key:"verification_code",label:"verificationCode",type:"text"})]});var gte=F2({initialView:"main",views:{main:({auth:e,authType:t="magic_link",recaptcha_enabled:n=!1,recaptcha_site_key:r,showIntro:a=!0,showSocialLogins:o=!1,socialProviders:i,phoneNumberOptions:s})=>{const l=f0(),u=o0(),c=u0(),{goTo:d}=VX();DD.useLayoutEffect((()=>{K6(r)}),[r]);const f=n=>l.startPasswordless({authType:t,...n},e).then((()=>n)),h=e=>"email"in e?d("emailSent"):d("verificationCode",e),p="magic_link"===t,g=(e=>l5({prefix:"r5-passwordless-sms-",fields:({phoneNumberOptions:t})=>[hee({required:!0,...t},e)]}))(u);return _D.createElement("div",null,o&&i&&i.length>0&&_D.createElement(a5,{providers:i,auth:e}),o&&i&&i.length>0&&_D.createElement(e0,{text:c("or")}),p&&a&&_D.createElement(QX,null,c("passwordless.intro")),p&&_D.createElement(hte,{handler:e=>z6.handle(e,{recaptcha_enabled:n,recaptcha_site_key:r},f,"passwordless_email"),onSuccess:h}),!p&&a&&_D.createElement(QX,null,c("passwordless.sms.intro")),!p&&_D.createElement(g,{handler:e=>z6.handle(e,{recaptcha_enabled:n,recaptcha_site_key:r},f,"passwordless_phone"),onSuccess:h,phoneNumberOptions:s}))},emailSent:()=>{const e=u0();return _D.createElement(qX,null,e("passwordless.emailSent"))},verificationCode:({authType:e="magic_link",recaptcha_enabled:t=!1,recaptcha_site_key:n})=>{const r=f0(),a=u0(),{params:o}=VX(),{phoneNumber:i}=o,s=t=>r.verifyPasswordless({authType:e,phoneNumber:i,...t});return _D.createElement("div",null,_D.createElement(qX,null,a("passwordless.sms.verification.intro")),_D.createElement(pte,{handler:e=>z6.handle(e,{recaptcha_enabled:t,recaptcha_site_key:n},s,"verify_passwordless_sms")}))}},prepare:(e,{config:t})=>({socialProviders:t.socialProviders,...e})});const mte=l5({prefix:"r5-profile-editor-",supportMultipleSubmits:!0,submitLabel:"save"});var vte=R2({component:({accessToken:e,onSuccess:t=(()=>{}),onError:n=(()=>{}),phoneNumberOptions:r,profile:a,redirectUrl:o,resolvedFields:i,showLabels:s=!1})=>{const l=f0();return _D.createElement(mte,{handler:t=>l.updateProfile({data:t,accessToken:e,redirectUrl:o}),initialModel:a,fields:i,sharedProps:{...r},showLabels:s,onSuccess:t,onError:n})},prepare:(e,{apiClient:t,config:n})=>{const r={showLabels:!0,fields:[],...e},{accessToken:a,fields:o=[]}=r;if(o.some((e=>{const t="string"==typeof e?e:e.key;return"password"===t||"password_confirmation"===t})))throw new Jq("These fields are not allowed: password, password_confirmation.");const i=_ee(o,{...n,errorArchivedConsents:!1});return t.getUser({accessToken:a,fields:i.map((({path:e})=>e)).join(",")}).then((e=>K4(e))).then((e=>{const t=e.consents&&Object.keys(e.consents).length>0?yte(o,n.consentsVersions,e.consents):void 0,a={...e,consents:t};return{...r,profile:a,resolvedFields:i.filter((e=>!("email"===e.path&&a.email||"phone_number"===e.path&&n.sms&&a.phoneNumber)))}}))}});const yte=(e,t,n)=>Object.keys(n).filter((r=>{const a=e.map((e=>"string"==typeof e?e:e.key)).find((e=>e.startsWith(`consents.${r}`))),o=a?a.split(".v"):[],i=t[r].versions[0].versionId,s=parseInt(o[1])||i,l=n[r].consentVersion?.versionId;return!s||s===l})).reduce(((e,t)=>(e[t]=n[t],e)),{}),bte=UX.span`
410
410
  position: absolute;
411
411
  right: ${({theme:e})=>e.paddingY}px;
412
412
  top: ${({theme:e})=>e.paddingY}px;