/*! For license information please see vendors~PhoneNumberInput~Dropdown.47042859ee973ee808a6.js.LICENSE.txt */ "use strict";(self.webpackChunk_klaviyo_onsite_modules=self.webpackChunk_klaviyo_onsite_modules||[]).push([[9734],{6576:function(e,t,n){function r(e,t){if(null==e)return{};var n,r,i={},u=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;tt||u>e&&o=t&&a>=n?u-e-r:o>t&&an?o-t+i:0}var f=0;function h(){}function g(e,t){if(e){var n=function(e,t){var n=window,r=t.scrollMode,i=t.block,u=t.inline,o=t.boundary,a=t.skipOverflowHiddenElements,c="function"==typeof o?o:function(e){return e!==o};if(!s(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,h=[],g=e;s(g)&&c(g);){if((g=g.parentElement)===f){h.push(g);break}null!=g&&g===document.body&&l(g)&&!l(document.documentElement)||null!=g&&l(g,a)&&h.push(g)}for(var p=n.visualViewport?n.visualViewport.width:innerWidth,m=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,I=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),b=y.height,x=y.width,w=y.top,k=y.right,E=y.bottom,O=y.left,C="start"===i||"nearest"===i?w:"end"===i?E:w+b/2,M="center"===u?O+x/2:"end"===u?k:O,V=[],R=0;R=0&&O>=0&&E<=m&&k<=p&&w>=L&&E<=A&&O>=N&&k<=K)return V;var P=getComputedStyle(S),B=parseInt(P.borderLeftWidth,10),H=parseInt(P.borderTopWidth,10),_=parseInt(P.borderRightWidth,10),W=parseInt(P.borderBottomWidth,10),j=0,U=0,$="offsetWidth"in S?S.offsetWidth-S.clientWidth-B-_:0,X="offsetHeight"in S?S.offsetHeight-S.clientHeight-H-W:0;if(f===S)j="start"===i?C:"end"===i?C-m:"nearest"===i?d(I,I+m,m,H,W,I+C,I+C+b,b):C-m/2,U="start"===u?M:"center"===u?M-p/2:"end"===u?M-p:d(v,v+p,p,B,_,v+M,v+M+x,x),j=Math.max(0,j+I),U=Math.max(0,U+v);else{j="start"===i?C-L-H:"end"===i?C-A+W+X:"nearest"===i?d(L,A,D,H,W+X,C,C+b,b):C-(L+D/2)+X/2,U="start"===u?M-N-B:"center"===u?M-(N+F/2)+$/2:"end"===u?M-K+_+$:d(N,K,F,B,_+$,M,M+x,x);var Y=S.scrollLeft,q=S.scrollTop;C+=q-(j=Math.max(0,Math.min(q+j,S.scrollHeight-D+X))),M+=Y-(U=Math.max(0,Math.min(Y+U,S.scrollWidth-F+$)))}V.push({el:S,top:j,left:U})}return V}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}}function p(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function m(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,u=new Array(i),o=0;o1?n-1:0),i=1;i=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function E(e,t,n,r,i){if(void 0===i&&(i=!0),0===n)return-1;var u=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:u+1);var o=t+e;o<0?o=i?u:0:o>u&&(o=i?0:u);var a=O(e,o,n,r,i);return-1===a?t>=n?-1:t:a}function O(e,t,n,r,i){var u=r(t);if(!u||!u.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o=0;a--)if(!r(a).hasAttribute("disabled"))return a;return i?e>0?O(1,0,n,r,!1):O(-1,n-1,n,r,!1):-1}function C(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(p(t,e,n)||r&&p(t,n.document.activeElement,n))}))}var M=m((function(e){R(e).textContent=""}),500);function V(e,t){var n=R(t);e&&(n.textContent=e,M(t))}function R(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var S={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function T(e,t,n){var r=e.props,u=e.type,o={};Object.keys(t).forEach((function(r){!function(e,t,n,r){var u=t.props,o=t.type,a="on"+A(e)+"Change";u[a]&&void 0!==r[e]&&r[e]!==n[e]&&u[a](i({type:o},r))}(r,e,t,n),n[r]!==t[r]&&(o[r]=n[r])})),r.onStateChange&&Object.keys(o).length&&r.onStateChange(i({type:u},o))}var D=m((function(e,t){V(e(),t)}),200),F="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.useLayoutEffect:a.useEffect;function L(e){var t=e.id,n=void 0===t?"downshift-"+y():t,r=e.labelId,i=e.menuId,u=e.getItemId,o=e.toggleButtonId,s=e.inputId;return(0,a.useRef)({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:o||n+"-toggle-button",inputId:s||n+"-input"}).current}function K(e,t,n){return void 0!==e?e:0===n.length?-1:n.indexOf(t)}function A(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function N(e){var t=(0,a.useRef)(e);return t.current=e,t}function P(e,t,n){var r=(0,a.useRef)(),u=(0,a.useRef)(),o=(0,a.useCallback)((function(t,n){u.current=n,t=x(t,n.props);var r=e(t,n);return n.props.stateReducer(t,i({},n,{changes:r}))}),[e]),s=(0,a.useReducer)(o,t),c=s[0],l=s[1],d=N(n),f=(0,a.useCallback)((function(e){return l(i({props:d.current},e))}),[d]),h=u.current;return(0,a.useEffect)((function(){h&&r.current&&r.current!==c&&T(h,x(r.current,h.props),c),r.current=c}),[c,n,h]),[c,f]}var B={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:g,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};function H(e,t,n){void 0===n&&(n=S);var r="default"+A(t);return r in e?e[r]:n[t]}function _(e,t,n){if(void 0===n&&(n=S),t in e)return e[t];var r="initial"+A(t);return r in e?e[r]:H(e,t,n)}function W(e){var t=_(e,"selectedItem"),n=_(e,"isOpen"),r=_(e,"highlightedIndex"),i=_(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function j(e,t,n,r){var i=e.items,u=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,a=t.selectedItem,s=t.highlightedIndex;return 0===i.length?-1:void 0!==u&&s===u?u:void 0!==o?o:a?0===n?i.indexOf(a):E(n,i.indexOf(a),i.length,r,!1):0===n?-1:n<0?i.length-1:0}function U(e,t,n,r){var i=(0,a.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,a.useEffect)((function(){var u=function(){i.current.isMouseDown=!0},o=function(u){i.current.isMouseDown=!1,e&&!C(u.target,t.map((function(e){return e.current})),n)&&r()},a=function(){i.current.isTouchMove=!1},s=function(){i.current.isTouchMove=!0},c=function(u){!e||i.current.isTouchMove||C(u.target,t.map((function(e){return e.current})),n,!1)||r()};return n.addEventListener("mousedown",u),n.addEventListener("mouseup",o),n.addEventListener("touchstart",a),n.addEventListener("touchmove",s),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",u),n.removeEventListener("mouseup",o),n.removeEventListener("touchstart",a),n.removeEventListener("touchmove",s),n.removeEventListener("touchend",c)}}),[e,n]),i}var $=function(){return h};function X(e,t,n){var u=n.isInitialMount,o=n.highlightedIndex,s=n.items,c=n.environment,l=r(n,["isInitialMount","highlightedIndex","items","environment"]);(0,a.useEffect)((function(){u||D((function(){return e(i({highlightedIndex:o,highlightedItem:s[o],resultCount:s.length},l))}),c.document)}),t)}function Y(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,u=e.menuElement,o=e.scrollIntoView,s=(0,a.useRef)(!0);return F((function(){t<0||!n||!Object.keys(r.current).length||(!1===s.current?s.current=!0:o(i(t),u))}),[t]),s}var q=h;function z(e,t,n){var r,u=t.type,o=t.props;switch(u){case n.ItemMouseMove:r={highlightedIndex:t.index};break;case n.MenuMouseLeave:r={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:r={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:j(o,e,0)};break;case n.FunctionOpenMenu:r={isOpen:!0,highlightedIndex:j(o,e,0)};break;case n.FunctionCloseMenu:r={isOpen:!1};break;case n.FunctionSetHighlightedIndex:r={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:r={inputValue:t.inputValue};break;case n.FunctionReset:r={highlightedIndex:H(o,"highlightedIndex"),isOpen:H(o,"isOpen"),selectedItem:H(o,"selectedItem"),inputValue:H(o,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return i({},e,r)}o().array.isRequired,o().func,o().func,o().func,o().bool,o().number,o().number,o().number,o().bool,o().bool,o().bool,o().any,o().any,o().any,o().string,o().string,o().string,o().func,o().string,o().func,o().func,o().func,o().func,o().func,o().shape({addEventListener:o().func,removeEventListener:o().func,document:o().shape({getElementById:o().func,activeElement:o().any,body:o().any})});i({},B,{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}});var G=Object.freeze({__proto__:null,InputKeyDownArrowDown:0,InputKeyDownArrowUp:1,InputKeyDownEscape:2,InputKeyDownHome:3,InputKeyDownEnd:4,InputKeyDownEnter:5,InputChange:6,InputBlur:7,MenuMouseLeave:8,ItemMouseMove:9,ItemClick:10,ToggleButtonClick:11,FunctionToggleMenu:12,FunctionOpenMenu:13,FunctionCloseMenu:14,FunctionSetHighlightedIndex:15,FunctionSelectItem:16,FunctionSetInputValue:17,FunctionReset:18,ControlledPropUpdatedSelectedItem:19});o().array.isRequired,o().func,o().func,o().func,o().bool,o().number,o().number,o().number,o().bool,o().bool,o().bool,o().any,o().any,o().any,o().string,o().string,o().string,o().string,o().string,o().string,o().func,o().string,o().string,o().func,o().func,o().func,o().func,o().func,o().func,o().shape({addEventListener:o().func,removeEventListener:o().func,document:o().shape({getElementById:o().func,activeElement:o().any,body:o().any})});var J=h;var Q=i({},B,{getA11yStatusMessage:b,circularNavigation:!0});function Z(e,t){var n,r=t.type,u=t.props,o=t.shiftKey;switch(r){case 10:n={isOpen:H(u,"isOpen"),highlightedIndex:H(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case 0:n=e.isOpen?{highlightedIndex:E(o?5:1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,u.circularNavigation)}:{highlightedIndex:j(u,e,1,t.getItemNodeFromIndex),isOpen:u.items.length>=0};break;case 1:n=e.isOpen?{highlightedIndex:E(o?-5:-1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,u.circularNavigation)}:{highlightedIndex:j(u,e,-1,t.getItemNodeFromIndex),isOpen:u.items.length>=0};break;case 5:n=i({},e.isOpen&&e.highlightedIndex>=0&&{selectedItem:u.items[e.highlightedIndex],isOpen:H(u,"isOpen"),highlightedIndex:H(u,"highlightedIndex"),inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case 2:n=i({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case 3:n={highlightedIndex:O(1,0,u.items.length,t.getItemNodeFromIndex,!1)};break;case 4:n={highlightedIndex:O(-1,u.items.length-1,u.items.length,t.getItemNodeFromIndex,!1)};break;case 7:n=i({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:u.items[e.highlightedIndex],inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case 6:n={isOpen:!0,highlightedIndex:H(u,"highlightedIndex"),inputValue:t.inputValue};break;case 16:n={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case 19:n={inputValue:t.inputValue};break;default:return z(e,t,G)}return i({},e,n)}function ee(e){void 0===e&&(e={}),J(e,ee);var t=i({},Q,e),n=t.initialIsOpen,u=t.defaultIsOpen,o=t.items,s=t.scrollIntoView,c=t.environment,l=t.getA11yStatusMessage,d=t.getA11ySelectionMessage,f=t.itemToString,h=function(e){var t=W(e),n=t.selectedItem,r=t.inputValue;return""===r&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(r=e.itemToString(n)),i({},t,{inputValue:r})}(t),g=function(e,t,n){var r=(0,a.useRef)(),i=P(e,t,n),u=i[0],o=i[1];return(0,a.useEffect)((function(){w(n,"selectedItem")&&(r.current!==n.selectedItem&&o({type:19,inputValue:n.itemToString(n.selectedItem)}),r.current=u.selectedItem===r.current?n.selectedItem:u.selectedItem)})),[x(u,n),o]}(Z,h,t),p=g[0],m=g[1],y=p.isOpen,b=p.highlightedIndex,E=p.selectedItem,O=p.inputValue,C=(0,a.useRef)(null),M=(0,a.useRef)({}),V=(0,a.useRef)(null),R=(0,a.useRef)(null),S=(0,a.useRef)(null),T=(0,a.useRef)(!0),D=L(t),F=(0,a.useRef)(),A=N({state:p,props:t}),B=(0,a.useCallback)((function(e){return M.current[D.getItemId(e)]}),[D]);X(l,[y,b,O,o],i({isInitialMount:T.current,previousResultCount:F.current,items:o,environment:c,itemToString:f},p)),X(d,[E],i({isInitialMount:T.current,previousResultCount:F.current,items:o,environment:c,itemToString:f},p));var H=Y({menuElement:C.current,highlightedIndex:b,isOpen:y,itemRefs:M,scrollIntoView:s,getItemNodeFromIndex:B});q({isInitialMount:T.current,props:t,state:p}),(0,a.useEffect)((function(){(n||u||y)&&V.current&&V.current.focus()}),[]),(0,a.useEffect)((function(){T.current||(F.current=o.length)}));var _=U(y,[S,C,R],c,(function(){m({type:7,selectItem:!1})})),j=$();(0,a.useEffect)((function(){T.current=!1}),[]),(0,a.useEffect)((function(){y||(M.current={})}),[y]);var z=(0,a.useMemo)((function(){return{ArrowDown:function(e){e.preventDefault(),m({type:0,shiftKey:e.shiftKey,getItemNodeFromIndex:B})},ArrowUp:function(e){e.preventDefault(),m({type:1,shiftKey:e.shiftKey,getItemNodeFromIndex:B})},Home:function(e){A.current.state.isOpen&&(e.preventDefault(),m({type:3,getItemNodeFromIndex:B}))},End:function(e){A.current.state.isOpen&&(e.preventDefault(),m({type:4,getItemNodeFromIndex:B}))},Escape:function(){var e=A.current.state;(e.isOpen||e.inputValue||e.selectedItem||e.highlightedIndex>-1)&&m({type:2})},Enter:function(e){var t=A.current.state;!t.isOpen||t.highlightedIndex<0||229===e.which||(e.preventDefault(),m({type:5,getItemNodeFromIndex:B}))}}}),[m,A,B]),G=(0,a.useCallback)((function(e){return i({id:D.labelId,htmlFor:D.inputId},e)}),[D]),te=(0,a.useCallback)((function(e,t){var n,u=void 0===e?{}:e,o=u.onMouseLeave,a=u.refKey,s=void 0===a?"ref":a,c=u.ref,l=r(u,["onMouseLeave","refKey","ref"]),d=(void 0===t?{}:t).suppressRefError;return j("getMenuProps",void 0!==d&&d,s,C),i(((n={})[s]=I(c,(function(e){C.current=e})),n.id=D.menuId,n.role="listbox",n["aria-labelledby"]=D.labelId,n.onMouseLeave=v(o,(function(){m({type:8})})),n),l)}),[m,j,D]),ne=(0,a.useCallback)((function(e){var t,n,u=void 0===e?{}:e,o=u.item,a=u.index,s=u.refKey,c=void 0===s?"ref":s,l=u.ref,d=u.onMouseMove,f=u.onClick;u.onPress;var h=r(u,["item","index","refKey","ref","onMouseMove","onClick","onPress"]),g=A.current,p=g.props,y=g.state,b=K(a,o,p.items);if(b<0)throw new Error("Pass either item or item index in getItemProps!");var x=f;return i(((t={})[c]=I(l,(function(e){e&&(M.current[D.getItemId(b)]=e)})),t.role="option",t["aria-selected"]=""+(b===y.highlightedIndex),t.id=D.getItemId(b),t),!h.disabled&&((n={onMouseMove:v(d,(function(){a!==y.highlightedIndex&&(H.current=!1,m({type:9,index:a}))}))}).onClick=v(x,(function(){m({type:10,index:a}),V.current&&V.current.focus()})),n),h)}),[m,A,H,D]),re=(0,a.useCallback)((function(e){var t,n=void 0===e?{}:e,u=n.onClick;n.onPress;var o=n.refKey,a=void 0===o?"ref":o,s=n.ref,c=r(n,["onClick","onPress","refKey","ref"]);return i(((t={})[a]=I(s,(function(e){R.current=e})),t.id=D.toggleButtonId,t.tabIndex=-1,t),!c.disabled&&i({},{onClick:v(u,(function(){m({type:11}),!A.current.state.isOpen&&V.current&&V.current.focus()}))}),c)}),[m,A,D]),ie=(0,a.useCallback)((function(e,t){var n,u=void 0===e?{}:e,o=u.onKeyDown,a=u.onChange,s=u.onInput,c=u.onBlur;u.onChangeText;var l=u.refKey,d=void 0===l?"ref":l,f=u.ref,h=r(u,["onKeyDown","onChange","onInput","onBlur","onChangeText","refKey","ref"]),g=(void 0===t?{}:t).suppressRefError;j("getInputProps",void 0!==g&&g,d,V);var p,y=A.current.state,b={};h.disabled||((p={}).onChange=v(a,s,(function(e){m({type:6,inputValue:e.target.value})})),p.onKeyDown=v(o,(function(e){var t=k(e);t&&z[t]&&z[t](e)})),p.onBlur=v(c,(function(){y.isOpen&&!_.current.isMouseDown&&m({type:7,selectItem:!0})})),b=p);return i(((n={})[d]=I(f,(function(e){V.current=e})),n.id=D.inputId,n["aria-autocomplete"]="list",n["aria-controls"]=D.menuId,n),y.isOpen&&y.highlightedIndex>-1&&{"aria-activedescendant":D.getItemId(y.highlightedIndex)},{"aria-labelledby":D.labelId,autoComplete:"off",value:y.inputValue},b,h)}),[m,z,A,_,j,D]),ue=(0,a.useCallback)((function(e,t){var n,u=void 0===e?{}:e,o=u.refKey,a=void 0===o?"ref":o,s=u.ref,c=r(u,["refKey","ref"]),l=(void 0===t?{}:t).suppressRefError;return j("getComboboxProps",void 0!==l&&l,a,S),i(((n={})[a]=I(s,(function(e){S.current=e})),n.role="combobox",n["aria-haspopup"]="listbox",n["aria-owns"]=D.menuId,n["aria-expanded"]=A.current.state.isOpen,n),c)}),[A,j,D]),oe=(0,a.useCallback)((function(){m({type:12})}),[m]),ae=(0,a.useCallback)((function(){m({type:14})}),[m]),se=(0,a.useCallback)((function(){m({type:13})}),[m]),ce=(0,a.useCallback)((function(e){m({type:15,highlightedIndex:e})}),[m]),le=(0,a.useCallback)((function(e){m({type:16,selectedItem:e})}),[m]);return{getItemProps:ne,getLabelProps:G,getMenuProps:te,getInputProps:ie,getComboboxProps:ue,getToggleButtonProps:re,toggleMenu:oe,openMenu:se,closeMenu:ae,setHighlightedIndex:ce,setInputValue:(0,a.useCallback)((function(e){m({type:17,inputValue:e})}),[m]),selectItem:le,reset:(0,a.useCallback)((function(){m({type:18})}),[m]),highlightedIndex:b,isOpen:y,selectedItem:E,inputValue:O}}ee.stateChangeTypes=G;o().array,o().array,o().array,o().func,o().func,o().func,o().number,o().number,o().number,o().func,o().func,o().string,o().string,o().shape({addEventListener:o().func,removeEventListener:o().func,document:o().shape({getElementById:o().func,activeElement:o().any,body:o().any})})},7755:function(e,t){var n=60103,r=60106,i=60107,u=60108,o=60114,a=60109,s=60110,c=60112,l=60113,d=60120,f=60115,h=60116,g=60121,p=60122,m=60117,v=60129,I=60131;if("function"==typeof Symbol&&Symbol.for){var y=Symbol.for;n=y("react.element"),r=y("react.portal"),i=y("react.fragment"),u=y("react.strict_mode"),o=y("react.profiler"),a=y("react.provider"),s=y("react.context"),c=y("react.forward_ref"),l=y("react.suspense"),d=y("react.suspense_list"),f=y("react.memo"),h=y("react.lazy"),g=y("react.block"),p=y("react.server.block"),m=y("react.fundamental"),v=y("react.debug_trace_mode"),I=y("react.legacy_hidden")}function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case i:case o:case u:case l:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case h:case f:case a:return e;default:return t}}case r:return t}}}},5124:function(e,t,n){n(7755)}}]);