@payloqa/payment-widget 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +460 -0
  2. package/dist/components/NetworkSelector.d.ts +11 -0
  3. package/dist/components/NetworkSelector.d.ts.map +1 -0
  4. package/dist/components/OTPInput.d.ts +13 -0
  5. package/dist/components/OTPInput.d.ts.map +1 -0
  6. package/dist/components/PaymentWidget.d.ts +10 -0
  7. package/dist/components/PaymentWidget.d.ts.map +1 -0
  8. package/dist/components/PhoneInput.d.ts +13 -0
  9. package/dist/components/PhoneInput.d.ts.map +1 -0
  10. package/dist/components/ResultScreen.d.ts +12 -0
  11. package/dist/components/ResultScreen.d.ts.map +1 -0
  12. package/dist/components/TimeoutScreen.d.ts +11 -0
  13. package/dist/components/TimeoutScreen.d.ts.map +1 -0
  14. package/dist/components/VerifyingScreen.d.ts +9 -0
  15. package/dist/components/VerifyingScreen.d.ts.map +1 -0
  16. package/dist/demo.d.ts +4 -0
  17. package/dist/demo.d.ts.map +1 -0
  18. package/dist/index.d.ts +175 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.esm.js +2 -0
  21. package/dist/index.esm.js.map +1 -0
  22. package/dist/index.umd.js +2 -0
  23. package/dist/index.umd.js.map +1 -0
  24. package/dist/payment-widget.css +1 -0
  25. package/dist/payment-widget.d.ts +175 -0
  26. package/dist/payment-widget.esm.js +2 -0
  27. package/dist/payment-widget.esm.js.map +1 -0
  28. package/dist/payment-widget.umd.js +2 -0
  29. package/dist/payment-widget.umd.js.map +1 -0
  30. package/dist/services/paymentService.d.ts +16 -0
  31. package/dist/services/paymentService.d.ts.map +1 -0
  32. package/dist/types/payment.d.ts +150 -0
  33. package/dist/types/payment.d.ts.map +1 -0
  34. package/dist/utils/index.d.ts +11 -0
  35. package/dist/utils/index.d.ts.map +1 -0
  36. package/package.json +86 -0
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).PayloqaPaymentWidget={},e.React,e.ReactDOM)}(this,function(e,t,n){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=r(t),i={exports:{}},a={},s=t,l=Symbol.for("react.element"),u=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function f(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)c.call(t,r)&&!p.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:l,type:e,key:i,ref:a,props:o,_owner:d.current}}a.Fragment=u,a.jsx=f,a.jsxs=f,i.exports=a;var m=i.exports;function h(e){try{return"https:"===new URL(e).protocol}catch{return!1}}function g(e,t,n,r){const o=new URLSearchParams({payment_id:t,status:n});if("completed"===n&&r){const e="number"==typeof r.amount?r.amount.toString():r.amount;o.append("amount",e),o.append("currency",r.currency||"GHS");const t=r.metadata?.reference||r.metadata?.order_reference;t&&o.append("reference",t)}if("failed"===n&&r?.metadata?.error){const e=r.metadata.error;o.append("reason",e.code||"unknown"),o.append("message",e.message||"Payment failed")}return`${e}?${o.toString()}`}class v{constructor(e){this.config=e}async makeRequest(e,t={}){const n=`${this.config.baseUrl||"https://payment.payloqa.com/api/v1/payments"}${e}`,r={"Content-Type":"application/json","X-API-Key":this.config.apiKey,"X-Platform-Id":this.config.platformId,...t.headers},o=await fetch(n,{...t,headers:r}),i=await o.json();if(!o.ok||!1===i.success){const e=i.error?.message||i.message||`HTTP ${o.status}: ${o.statusText}`,t=new Error(e);throw i.error?.code&&(t.code=i.error.code),t}return i}async createPayment(e){if(e.redirect_url&&!h(e.redirect_url))throw new Error("Redirect URL must be a valid HTTPS URL. HTTP URLs are not allowed for security reasons.");return this.makeRequest("/create",{method:"POST",body:JSON.stringify(e)})}async verifyOTP(e,t){return this.makeRequest(`/${e}/verify-otp`,{method:"POST",body:JSON.stringify(t)})}async resendOTP(e,t){return this.makeRequest(`/${e}/resend-otp`,{method:"POST",body:JSON.stringify(t)})}async getPaymentStatus(e){return this.makeRequest(`/${e}`,{method:"GET"})}async cancelPayment(e,t){return this.makeRequest(`/${e}/cancel`,{method:"POST",body:t?JSON.stringify(t):void 0})}async getPlatformInfo(){const e=await this.makeRequest("/platform",{method:"GET"});return{logo_url:e.data?.logo_url}}}const b=({value:e,onChange:t,onValid:n,placeholder:r="Phone number",disabled:o=!1,error:i,primaryColor:a="#3B82F6"})=>m.jsxs("div",{className:"w-full",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone Number"}),m.jsx("input",{type:"tel",value:e,onChange:e=>{const r=e.target.value.replace(/\D/g,"").slice(0,10);t(r);10===r.length&&n&&n((e=>{const t=e.replace(/[^\d+]/g,"");return t.startsWith("+233")?t:t.startsWith("0")?"+233"+t.substring(1):10!==t.length||t.startsWith("0")?t:"+233"+t})(r))},placeholder:r,disabled:o,maxLength:10,className:`w-full px-4 py-3 border-2 rounded-lg text-base focus:outline-none focus:ring-2 focus:border-transparent transition-all ${i?"border-red-500":"border-gray-300"} ${o?"bg-gray-50 cursor-not-allowed":"bg-white"}`,style:i?{}:{"--focus-ring-color":a},onFocus:e=>{i||o||(e.target.style.borderColor=a,e.target.style.boxShadow=`0 0 0 3px ${a}33`)},onBlur:e=>{i||(e.target.style.borderColor="#D1D5DB",e.target.style.boxShadow="")}}),i&&m.jsx("p",{className:"mt-2 text-sm text-red-600 font-medium",children:i})]});function y(e){return y="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},y(e)}function x(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y(t)?t:t+""}function w(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(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 C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){w(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){if(e){if("string"==typeof e)return S(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function I(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,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||k(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 E(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var P=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M.apply(null,arguments)}function R(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,x(r.key),r)}}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(V=function(){return!!e})()}function L(e,t){if(t&&("object"==y(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)}function F(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var D=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),N="-ms-",A="-moz-",$="-webkit-",_="comm",H="rule",U="decl",B="@keyframes",z=Math.abs,W=String.fromCharCode,q=Object.assign;function G(e){return e.trim()}function Y(e,t,n){return e.replace(t,n)}function X(e,t){return e.indexOf(t)}function K(e,t){return 0|e.charCodeAt(t)}function J(e,t,n){return e.slice(t,n)}function Z(e){return e.length}function Q(e){return e.length}function ee(e,t){return t.push(e),e}var te=1,ne=1,re=0,oe=0,ie=0,ae="";function se(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:te,column:ne,length:a,return:""}}function le(e,t){return q(se("",null,null,"",null,null,0),e,{length:-e.length},t)}function ue(){return ie=oe>0?K(ae,--oe):0,ne--,10===ie&&(ne=1,te--),ie}function ce(){return ie=oe<re?K(ae,oe++):0,ne++,10===ie&&(ne=1,te++),ie}function de(){return K(ae,oe)}function pe(){return oe}function fe(e,t){return J(ae,e,t)}function me(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function he(e){return te=ne=1,re=Z(ae=e),oe=0,[]}function ge(e){return ae="",e}function ve(e){return G(fe(oe-1,xe(91===e?e+2:40===e?e+1:e)))}function be(e){for(;(ie=de())&&ie<33;)ce();return me(e)>2||me(ie)>3?"":" "}function ye(e,t){for(;--t&&ce()&&!(ie<48||ie>102||ie>57&&ie<65||ie>70&&ie<97););return fe(e,pe()+(t<6&&32==de()&&32==ce()))}function xe(e){for(;ce();)switch(ie){case e:return oe;case 34:case 39:34!==e&&39!==e&&xe(ie);break;case 40:41===e&&xe(e);break;case 92:ce()}return oe}function we(e,t){for(;ce()&&e+ie!==57&&(e+ie!==84||47!==de()););return"/*"+fe(t,oe-1)+"*"+W(47===e?e:ce())}function Oe(e){for(;!me(de());)ce();return fe(e,oe)}function Ce(e){return ge(Se("",null,null,null,[""],e=he(e),0,[0],e))}function Se(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,d=a,p=0,f=0,m=0,h=1,g=1,v=1,b=0,y="",x=o,w=i,O=r,C=y;g;)switch(m=b,b=ce()){case 40:if(108!=m&&58==K(C,d-1)){-1!=X(C+=Y(ve(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:C+=ve(b);break;case 9:case 10:case 13:case 32:C+=be(m);break;case 92:C+=ye(pe()-1,7);continue;case 47:switch(de()){case 42:case 47:ee(Ie(we(ce(),pe()),t,n),l);break;default:C+="/"}break;case 123*h:s[u++]=Z(C)*v;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+c:-1==v&&(C=Y(C,/\f/g,"")),f>0&&Z(C)-d&&ee(f>32?Ee(C+";",r,n,d-1):Ee(Y(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(ee(O=ke(C,t,n,u,c,o,s,y,x=[],w=[],d),i),123===b)if(0===c)Se(C,t,O,O,x,i,d,s,w);else switch(99===p&&110===K(C,3)?100:p){case 100:case 108:case 109:case 115:Se(e,O,O,r&&ee(ke(e,O,O,0,0,o,s,y,o,x=[],d),w),o,w,d,s,r?x:w);break;default:Se(C,O,O,O,[""],w,0,s,w)}}u=c=f=0,h=v=1,y=C="",d=a;break;case 58:d=1+Z(C),f=m;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==ue())continue;switch(C+=W(b),b*h){case 38:v=c>0?1:(C+="\f",-1);break;case 44:s[u++]=(Z(C)-1)*v,v=1;break;case 64:45===de()&&(C+=ve(ce())),p=de(),c=d=Z(y=C+=Oe(pe())),b++;break;case 45:45===m&&2==Z(C)&&(h=0)}}return i}function ke(e,t,n,r,o,i,a,s,l,u,c){for(var d=o-1,p=0===o?i:[""],f=Q(p),m=0,h=0,g=0;m<r;++m)for(var v=0,b=J(e,d+1,d=z(h=a[m])),y=e;v<f;++v)(y=G(h>0?p[v]+" "+b:Y(b,/&\f/g,p[v])))&&(l[g++]=y);return se(e,t,n,0===o?H:s,l,u,c)}function Ie(e,t,n){return se(e,t,n,_,W(ie),J(e,2,-2),0)}function Ee(e,t,n,r){return se(e,t,n,U,J(e,0,r),J(e,r+1,-1),r)}function Pe(e,t){for(var n="",r=Q(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Me(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case U:return e.return=e.return||e.value;case _:return"";case B:return e.return=e.value+"{"+Pe(e.children,r)+"}";case H:e.value=e.props.join(",")}return Z(n=Pe(e.children,r))?e.return=e.value+"{"+n+"}":""}function Re(e){var t=Q(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}function je(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Te="undefined"!=typeof document,Ve=function(e,t,n){for(var r=0,o=0;r=o,o=de(),38===r&&12===o&&(t[n]=1),!me(o);)ce();return fe(e,oe)},Le=function(e,t){return ge(function(e,t){var n=-1,r=44;do{switch(me(r)){case 0:38===r&&12===de()&&(t[n]=1),e[n]+=Ve(oe-1,t,n);break;case 2:e[n]+=ve(r);break;case 4:if(44===r){e[++n]=58===de()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=W(r)}}while(r=ce());return e}(he(e),t))},Fe=new WeakMap,De=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Fe.get(n))&&!r){Fe.set(e,!0);for(var o=[],i=Le(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var u=0;u<a.length;u++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[u]):a[u]+" "+i[s]}}},Ne=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ae(e,t){switch(function(e,t){return 45^K(e,0)?(((t<<2^K(e,0))<<2^K(e,1))<<2^K(e,2))<<2^K(e,3):0}(e,t)){case 5103:return $+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return $+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return $+e+A+e+N+e+e;case 6828:case 4268:return $+e+N+e+e;case 6165:return $+e+N+"flex-"+e+e;case 5187:return $+e+Y(e,/(\w+).+(:[^]+)/,$+"box-$1$2"+N+"flex-$1$2")+e;case 5443:return $+e+N+"flex-item-"+Y(e,/flex-|-self/,"")+e;case 4675:return $+e+N+"flex-line-pack"+Y(e,/align-content|flex-|-self/,"")+e;case 5548:return $+e+N+Y(e,"shrink","negative")+e;case 5292:return $+e+N+Y(e,"basis","preferred-size")+e;case 6060:return $+"box-"+Y(e,"-grow","")+$+e+N+Y(e,"grow","positive")+e;case 4554:return $+Y(e,/([^-])(transform)/g,"$1"+$+"$2")+e;case 6187:return Y(Y(Y(e,/(zoom-|grab)/,$+"$1"),/(image-set)/,$+"$1"),e,"")+e;case 5495:case 3959:return Y(e,/(image-set\([^]*)/,$+"$1$`$1");case 4968:return Y(Y(e,/(.+:)(flex-)?(.*)/,$+"box-pack:$3"+N+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+$+e+e;case 4095:case 3583:case 4068:case 2532:return Y(e,/(.+)-inline(.+)/,$+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Z(e)-1-t>6)switch(K(e,t+1)){case 109:if(45!==K(e,t+4))break;case 102:return Y(e,/(.+:)(.+)-([^]+)/,"$1"+$+"$2-$3$1"+A+(108==K(e,t+3)?"$3":"$2-$3"))+e;case 115:return~X(e,"stretch")?Ae(Y(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==K(e,t+1))break;case 6444:switch(K(e,Z(e)-3-(~X(e,"!important")&&10))){case 107:return Y(e,":",":"+$)+e;case 101:return Y(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$+(45===K(e,14)?"inline-":"")+"box$3$1"+$+"$2$3$1"+N+"$2box$3")+e}break;case 5936:switch(K(e,t+11)){case 114:return $+e+N+Y(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return $+e+N+Y(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return $+e+N+Y(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return $+e+N+e+e}return e}var $e,_e,He=Te?void 0:($e=function(){return je(function(){return{}})},_e=new WeakMap,function(e){if(_e.has(e))return _e.get(e);var t=$e(e);return _e.set(e,t),t}),Ue=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case U:e.return=Ae(e.value,e.length);break;case B:return Pe([le(e,{value:Y(e.value,"@","@"+$)})],r);case H:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Pe([le(e,{props:[Y(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Pe([le(e,{props:[Y(t,/:(plac\w+)/,":"+$+"input-$1")]}),le(e,{props:[Y(t,/:(plac\w+)/,":-moz-$1")]}),le(e,{props:[Y(t,/:(plac\w+)/,N+"input-$1")]})],r)}return""})}}],Be=function(e){var t=e.key;if(Te&&"css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,i=e.stylisPlugins||Ue,a={},s=[];Te&&(r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)}));var l,u=[De,Ne];if(He){var c=[Me],d=Re(u.concat(i,c)),p=He(i)(t),f=function(e,t){var n=t.name;return void 0===p[n]&&(p[n]=Pe(Ce(e?e+"{"+t.styles+"}":t.styles),d)),p[n]};o=function(e,t,n,r){var o=t.name,i=f(e,t);return void 0===v.compat?(r&&(v.inserted[o]=!0),i):r?void(v.inserted[o]=i):i}}else{var m,h=[Me,(l=function(e){m.insert(e)},function(e){e.root||(e=e.return)&&l(e)})],g=Re(u.concat(i,h));o=function(e,t,n,r){m=n,Pe(Ce(e?e+"{"+t.styles+"}":t.styles),g),r&&(v.inserted[t.name]=!0)}}var v={key:t,sheet:new D({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return v.sheet.hydrate(s),v},ze={exports:{}},We={},qe="function"==typeof Symbol&&Symbol.for,Ge=qe?Symbol.for("react.element"):60103,Ye=qe?Symbol.for("react.portal"):60106,Xe=qe?Symbol.for("react.fragment"):60107,Ke=qe?Symbol.for("react.strict_mode"):60108,Je=qe?Symbol.for("react.profiler"):60114,Ze=qe?Symbol.for("react.provider"):60109,Qe=qe?Symbol.for("react.context"):60110,et=qe?Symbol.for("react.async_mode"):60111,tt=qe?Symbol.for("react.concurrent_mode"):60111,nt=qe?Symbol.for("react.forward_ref"):60112,rt=qe?Symbol.for("react.suspense"):60113,ot=qe?Symbol.for("react.suspense_list"):60120,it=qe?Symbol.for("react.memo"):60115,at=qe?Symbol.for("react.lazy"):60116,st=qe?Symbol.for("react.block"):60121,lt=qe?Symbol.for("react.fundamental"):60117,ut=qe?Symbol.for("react.responder"):60118,ct=qe?Symbol.for("react.scope"):60119;function dt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Ge:switch(e=e.type){case et:case tt:case Xe:case Je:case Ke:case rt:return e;default:switch(e=e&&e.$$typeof){case Qe:case nt:case at:case it:case Ze:return e;default:return t}}case Ye:return t}}}function pt(e){return dt(e)===tt}We.AsyncMode=et,We.ConcurrentMode=tt,We.ContextConsumer=Qe,We.ContextProvider=Ze,We.Element=Ge,We.ForwardRef=nt,We.Fragment=Xe,We.Lazy=at,We.Memo=it,We.Portal=Ye,We.Profiler=Je,We.StrictMode=Ke,We.Suspense=rt,We.isAsyncMode=function(e){return pt(e)||dt(e)===et},We.isConcurrentMode=pt,We.isContextConsumer=function(e){return dt(e)===Qe},We.isContextProvider=function(e){return dt(e)===Ze},We.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Ge},We.isForwardRef=function(e){return dt(e)===nt},We.isFragment=function(e){return dt(e)===Xe},We.isLazy=function(e){return dt(e)===at},We.isMemo=function(e){return dt(e)===it},We.isPortal=function(e){return dt(e)===Ye},We.isProfiler=function(e){return dt(e)===Je},We.isStrictMode=function(e){return dt(e)===Ke},We.isSuspense=function(e){return dt(e)===rt},We.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===Xe||e===tt||e===Je||e===Ke||e===rt||e===ot||"object"==typeof e&&null!==e&&(e.$$typeof===at||e.$$typeof===it||e.$$typeof===Ze||e.$$typeof===Qe||e.$$typeof===nt||e.$$typeof===lt||e.$$typeof===ut||e.$$typeof===ct||e.$$typeof===st)},We.typeOf=dt,ze.exports=We;var ft=ze.exports,mt={};mt[ft.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mt[ft.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};var ht="undefined"!=typeof document;var gt=function(e,t,n){var r=e.key+"-"+t.name;(!1===n||!1===ht&&void 0!==e.compat)&&void 0===e.registered[r]&&(e.registered[r]=t.styles)};var vt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},bt=/[A-Z]|^ms/g,yt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xt=function(e){return 45===e.charCodeAt(1)},wt=function(e){return null!=e&&"boolean"!=typeof e},Ot=je(function(e){return xt(e)?e:e.replace(bt,"-$&").toLowerCase()}),Ct=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(yt,function(e,t,n){return kt={name:t,styles:n,next:kt},t})}return 1===vt[e]||xt(e)||"number"!=typeof t||0===t?t:t+"px"};function St(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return kt={name:o.name,styles:o.styles,next:kt},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)kt={name:a.name,styles:a.styles,next:kt},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=St(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;wt(s)&&(r+=Ot(i)+":"+Ct(i,s)+";")}else if(Array.isArray(a)&&"string"==typeof a[0]&&null==t)for(var l=0;l<a.length;l++)wt(a[l])&&(r+=Ot(i)+":"+Ct(i,a[l])+";");else{var u=St(e,t,a);switch(i){case"animation":case"animationName":r+=Ot(i)+":"+u+";";break;default:r+=i+"{"+u+"}"}}}return r}(e,t,n);case"function":if(void 0!==e){var s=kt,l=n(e);return kt=s,St(e,t,l)}}return n}var kt,It=/label:\s*([^\s;{]+)\s*(;|$)/g;function Et(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";kt=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=St(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++){if(o+=St(n,t,e[a]),r)o+=i[a]}It.lastIndex=0;for(var s,l="";null!==(s=It.exec(o));)l+="-"+s[1];var u=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:u,styles:o,next:kt}}var Pt="undefined"!=typeof document,Mt=function(e){return e()},Rt=!!o.useInsertionEffect&&o.useInsertionEffect,jt=Pt&&Rt||Mt,Tt="undefined"!=typeof document,Vt=o.createContext("undefined"!=typeof HTMLElement?Be({key:"css"}):null);Vt.Provider;var Lt=function(e){return t.forwardRef(function(n,r){var o=t.useContext(Vt);return e(n,o,r)})};Tt||(Lt=function(e){return function(n){var r=t.useContext(Vt);return null===r?(r=Be({key:"css"}),o.createElement(Vt.Provider,{value:r},e(n,r))):e(n,r)}});var Ft,Dt,Nt=o.createContext({}),At={}.hasOwnProperty,$t="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",_t=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;gt(t,n,r);var i=jt(function(){return function(e,t,n){gt(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o="",i=t;do{var a=e.insert(t===i?"."+r:"",i,e.sheet,!0);ht||void 0===a||(o+=a),i=i.next}while(void 0!==i);if(!ht&&0!==o.length)return o}}(t,n,r)});if(!Tt&&void 0!==i){for(var a,s=n.name,l=n.next;void 0!==l;)s+=" "+l.name,l=l.next;return o.createElement("style",((a={})["data-emotion"]=t.key+" "+s,a.dangerouslySetInnerHTML={__html:i},a.nonce=t.sheet.nonce,a))}return null},Ht=Lt(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var i=e[$t],a=[r],s="";"string"==typeof e.className?s=function(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}(t.registered,a,e.className):null!=e.className&&(s=e.className+" ");var l=Et(a,void 0,o.useContext(Nt));s+=t.key+"-"+l.name;var u={};for(var c in e)At.call(e,c)&&"css"!==c&&c!==$t&&(u[c]=e[c]);return u.className=s,n&&(u.ref=n),o.createElement(o.Fragment,null,o.createElement(_t,{cache:t,serialized:l,isStringTag:"string"==typeof i}),o.createElement(i,u))}),Ut=Ht,Bt=function(e,t){var n=arguments;if(null==t||!At.call(t,"css"))return o.createElement.apply(void 0,n);var r=n.length,i=new Array(r);i[0]=Ut,i[1]=function(e,t){var n={};for(var r in t)At.call(t,r)&&(n[r]=t[r]);return n[$t]=e,n}(e,t);for(var a=2;a<r;a++)i[a]=n[a];return o.createElement.apply(null,i)};function zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Et(t)}Ft=Bt||(Bt={}),Dt||(Dt=Ft.JSX||(Ft.JSX={}));const Wt=Math.min,qt=Math.max,Gt=Math.round,Yt=Math.floor,Xt=e=>({x:e,y:e});function Kt(){return"undefined"!=typeof window}function Jt(e){return en(e)?(e.nodeName||"").toLowerCase():"#document"}function Zt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Qt(e){var t;return null==(t=(en(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function en(e){return!!Kt()&&(e instanceof Node||e instanceof Zt(e).Node)}function tn(e){return!!Kt()&&(e instanceof HTMLElement||e instanceof Zt(e).HTMLElement)}function nn(e){return!(!Kt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Zt(e).ShadowRoot)}const rn=new Set(["inline","contents"]);function on(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=sn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rn.has(o)}const an=new Set(["html","body","#document"]);function sn(e){return Zt(e).getComputedStyle(e)}function ln(e){const t=function(e){if("html"===Jt(e))return e;const t=e.assignedSlot||e.parentNode||nn(e)&&e.host||Qt(e);return nn(t)?t.host:t}(e);return function(e){return an.has(Jt(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:tn(t)&&on(t)?t:ln(t)}function un(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ln(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Zt(o);if(i){const e=cn(a);return t.concat(a,a.visualViewport||[],on(o)?o:[],e&&n?un(e):[])}return t.concat(o,un(o,[],n))}function cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dn(e){return t=e,Kt()&&(t instanceof Element||t instanceof Zt(t).Element)?e:e.contextElement;var t}function pn(e){const t=dn(e);if(!tn(t))return Xt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=function(e){const t=sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=tn(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Gt(n)!==i||Gt(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}(t);let a=(i?Gt(n.width):n.width)/r,s=(i?Gt(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function fn(e,t,n,r){void 0===t&&(t=!1);const o=e.getBoundingClientRect(),i=dn(e);let a=Xt(1);t&&(a=pn(e));const s=Xt(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=r;let t=Zt(i),n=cn(t);for(;n&&r&&e!==t;){const e=pn(n),r=n.getBoundingClientRect(),o=sn(n),i=r.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,a=r.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,t=Zt(n),n=cn(t)}}return function(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}({width:c,height:d,x:l,y:u})}function mn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=dn(e),c=o||i?[...u?un(u):[],...un(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=Qt(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(s||t(),!p||!f)return;const m={rootMargin:-Yt(d)+"px "+-Yt(o.clientWidth-(c+p))+"px "+-Yt(o.clientHeight-(d+f))+"px "+-Yt(c)+"px",threshold:qt(0,Wt(1,l))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||mn(u,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let h=l?fn(e):null;return l&&function t(){const r=fn(e);h&&!mn(h,r)&&n();h=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}var gn="undefined"!=typeof document?t.useLayoutEffect:function(){},vn=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],bn=function(){};function yn(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function xn(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat(yn(e,a)));return i.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var wn=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===y(e)&&null!==e?[e]:[];var t},On=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,C({},E(e,vn))},Cn=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(t,e),className:r(null!=n?n:{},i(t,e),a)}};function Sn(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function kn(e){return Sn(e)?window.pageYOffset:e.scrollTop}function In(e,t){Sn(e)?window.scrollTo(0,t):e.scrollTop=t}function En(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bn,o=kn(e),i=t-o,a=0;!function t(){var s=function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}(a+=10,o,i,n);In(e,s),a<n?window.requestAnimationFrame(t):r(e)}()}function Pn(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?In(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&In(e,Math.max(t.offsetTop-o,0))}function Mn(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var Rn=!1,jn={get passive(){return Rn=!0}},Tn="undefined"!=typeof window?window:{};Tn.addEventListener&&Tn.removeEventListener&&(Tn.addEventListener("p",bn,jn),Tn.removeEventListener("p",bn,!1));var Vn=Rn;function Ln(e){return null!=e}function Fn(e,t,n){return e?t:n}var Dn=["children","innerProps"],Nn=["children","innerProps"];function An(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c,d=l.getBoundingClientRect().height,p=n.getBoundingClientRect(),f=p.bottom,m=p.height,h=p.top,g=n.offsetParent.getBoundingClientRect().top,v=a?window.innerHeight:Sn(c=l)?window.innerHeight:c.clientHeight,b=kn(l),y=parseInt(getComputedStyle(n).marginBottom,10),x=parseInt(getComputedStyle(n).marginTop,10),w=g-x,O=v-h,C=w+b,S=d-b-h,k=f-v+b+y,I=b+h-x,E=160;switch(o){case"auto":case"bottom":if(O>=m)return{placement:"bottom",maxHeight:t};if(S>=m&&!a)return i&&En(l,k,E),{placement:"bottom",maxHeight:t};if(!a&&S>=r||a&&O>=r)return i&&En(l,k,E),{placement:"bottom",maxHeight:a?O-y:S-y};if("auto"===o||a){var P=t,M=a?w:C;return M>=r&&(P=Math.min(M-y-s,t)),{placement:"top",maxHeight:P}}if("bottom"===o)return i&&In(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(w>=m)return{placement:"top",maxHeight:t};if(C>=m&&!a)return i&&En(l,I,E),{placement:"top",maxHeight:t};if(!a&&C>=r||a&&w>=r){var R=t;return(!a&&C>=r||a&&w>=r)&&(R=a?w-x:C-x),i&&En(l,I,E),{placement:"top",maxHeight:R}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return u}var $n,_n=function(e){return"auto"===e?"bottom":e},Hn=t.createContext(null),Un=function(e){var n=e.children,r=e.minMenuHeight,o=e.maxMenuHeight,i=e.menuPlacement,a=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,u=(t.useContext(Hn)||{}).setPortalPlacement,c=t.useRef(null),d=I(t.useState(o),2),p=d[0],f=d[1],m=I(t.useState(null),2),h=m[0],g=m[1],v=l.spacing.controlHeight;return gn(function(){var e=c.current;if(e){var t="fixed"===a,n=An({maxHeight:o,menuEl:e,minHeight:r,placement:i,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:v});f(n.maxHeight),g(n.placement),null==u||u(n.placement)}},[o,i,a,s,r,u,v]),n({ref:c,placerProps:C(C({},e),{},{placement:h||_n(i),maxHeight:p})})},Bn=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return Bt("div",M({},Cn(e,"menu",{menu:!0}),{ref:n},r),t)},zn=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return C({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},Wn=zn,qn=zn,Gn=["size"],Yn=["innerProps","isRtl","size"],Xn={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Kn=function(e){var t=e.size,n=E(e,Gn);return Bt("svg",M({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Xn},n))},Jn=function(e){return Bt(Kn,M({size:20},e),Bt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Zn=function(e){return Bt(Kn,M({size:20},e),Bt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Qn=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return C({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*o,":hover":{color:n?i.neutral80:i.neutral40}})},er=Qn,tr=Qn,nr=function(){var e=zt.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}($n||($n=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))),rr=function(e){var t=e.delay,n=e.offset;return Bt("span",{css:zt({animation:"".concat(nr," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},or=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Bt("div",M({ref:o},Cn(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},ir=["data"],ar=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,s=e.innerProps,l=e.label,u=e.theme,c=e.selectProps;return Bt("div",M({},Cn(e,"group",{group:!0}),s),Bt(i,M({},a,{selectProps:c,theme:u,getStyles:r,getClassNames:o,cx:n}),l),Bt("div",null,t))},sr=["innerRef","isDisabled","isHidden","inputClassName"],lr={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},ur={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":C({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},lr)},cr=function(e){return C({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},lr)},dr=function(e){var t=e.children,n=e.innerProps;return Bt("div",n,t)};var pr=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,s=e.selectProps,l=n.Container,u=n.Label,c=n.Remove;return Bt(l,{data:r,innerProps:C(C({},Cn(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:s},Bt(u,{data:r,innerProps:C({},Cn(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Bt(c,{data:r,innerProps:C(C({},Cn(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:s}))},fr={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Bt("div",M({},Cn(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Bt(Jn,null))},Control:or,DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Bt("div",M({},Cn(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Bt(Zn,null))},DownChevron:Zn,CrossIcon:Jn,Group:ar,GroupHeading:function(e){var t=On(e);t.data;var n=E(t,ir);return Bt("div",M({},Cn(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Bt("div",M({},Cn(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Bt("span",M({},t,Cn(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=On(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,s=r.inputClassName,l=E(r,sr);return Bt("div",M({},Cn(e,"input",{"input-container":!0}),{"data-value":n||""}),Bt("input",M({className:t({input:!0},s),ref:o,style:cr(a),disabled:i},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,i=E(e,Yn);return Bt("div",M({},Cn(C(C({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Bt(rr,{delay:0,offset:n}),Bt(rr,{delay:160,offset:!0}),Bt(rr,{delay:320,offset:!n}))},Menu:Bn,MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return Bt("div",M({},Cn(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},MenuPortal:function(e){var r=e.appendTo,o=e.children,i=e.controlElement,a=e.innerProps,s=e.menuPlacement,l=e.menuPosition,u=t.useRef(null),c=t.useRef(null),d=I(t.useState(_n(s)),2),p=d[0],f=d[1],m=t.useMemo(function(){return{setPortalPlacement:f}},[]),h=I(t.useState(null),2),g=h[0],v=h[1],b=t.useCallback(function(){if(i){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(i),t="fixed"===l?0:window.pageYOffset,n=e[p]+t;n===(null==g?void 0:g.offset)&&e.left===(null==g?void 0:g.rect.left)&&e.width===(null==g?void 0:g.rect.width)||v({offset:n,rect:e})}},[i,l,p,null==g?void 0:g.offset,null==g?void 0:g.rect.left,null==g?void 0:g.rect.width]);gn(function(){b()},[b]);var y=t.useCallback(function(){"function"==typeof c.current&&(c.current(),c.current=null),i&&u.current&&(c.current=hn(i,u.current,b,{elementResize:"ResizeObserver"in window}))},[i,b]);gn(function(){y()},[y]);var x=t.useCallback(function(e){u.current=e,y()},[y]);if(!r&&"fixed"!==l||!g)return null;var w=Bt("div",M({ref:x},Cn(C(C({},e),{},{offset:g.offset,position:l,rect:g.rect}),"menuPortal",{"menu-portal":!0}),a),o);return Bt(Hn.Provider,{value:m},r?n.createPortal(w,r):w)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=E(e,Nn);return Bt("div",M({},Cn(C(C({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,o=E(e,Dn);return Bt("div",M({},Cn(C(C({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:pr,MultiValueContainer:dr,MultiValueLabel:dr,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Bt("div",M({role:"button"},n),t||Bt(Jn,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return Bt("div",M({},Cn(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Bt("div",M({},Cn(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return Bt("div",M({},Cn(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Bt("div",M({},Cn(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return Bt("div",M({},Cn(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},mr=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function hr(e,t){return e===t||!(!mr(e)||!mr(t))}function gr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!hr(e[n],t[n]))return!1;return!0}for(var vr={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},br=function(e){return Bt("span",M({css:vr},e))},yr={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=void 0===n?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,s=e.isDisabled,l=e.isSelected,u=e.isAppleDevice,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(c(a,n),".");if("menu"===t&&u){var d=s?" disabled":"",p="".concat(l?" selected":"").concat(d);return"".concat(i).concat(p,", ").concat(c(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},xr=function(e){var n=e.ariaSelection,r=e.focusedOption,o=e.focusedValue,i=e.focusableOptions,a=e.isFocused,s=e.selectValue,l=e.selectProps,u=e.id,c=e.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,f=l.inputValue,m=l.isMulti,h=l.isOptionDisabled,g=l.isSearchable,v=l.menuIsOpen,b=l.options,y=l.screenReaderStatus,x=l.tabSelectsValue,w=l.isLoading,O=l["aria-label"],S=l["aria-live"],k=t.useMemo(function(){return C(C({},yr),d||{})},[d]),I=t.useMemo(function(){var e,t="";if(n&&k.onChange){var r=n.option,o=n.options,i=n.removedValue,a=n.removedValues,l=n.value,u=i||r||(e=l,Array.isArray(e)?null:e),c=u?p(u):"",d=o||a||void 0,f=d?d.map(p):[],m=C({isDisabled:u&&h(u,s),label:c,labels:f},n);t=k.onChange(m)}return t},[n,k,h,s,p]),E=t.useMemo(function(){var e="",t=r||o,n=!!(r&&s&&s.includes(r));if(t&&k.onFocus){var a={focused:t,label:p(t),isDisabled:h(t,s),isSelected:n,options:i,context:t===r?"menu":"value",selectValue:s,isAppleDevice:c};e=k.onFocus(a)}return e},[r,o,p,h,k,i,s,c]),P=t.useMemo(function(){var e="";if(v&&b.length&&!w&&k.onFilter){var t=y({count:i.length});e=k.onFilter({inputValue:f,resultsMessage:t})}return e},[i,f,v,k,b,y,w]),M="initial-input-focus"===(null==n?void 0:n.action),R=t.useMemo(function(){var e="";if(k.guidance){var t=o?"value":v?"menu":"input";e=k.guidance({"aria-label":O,context:t,isDisabled:r&&h(r,s),isMulti:m,isSearchable:g,tabSelectsValue:x,isInitialFocus:M})}return e},[O,r,o,m,h,g,v,k,s,x,M]),j=Bt(t.Fragment,null,Bt("span",{id:"aria-selection"},I),Bt("span",{id:"aria-focused"},E),Bt("span",{id:"aria-results"},P),Bt("span",{id:"aria-guidance"},R));return Bt(t.Fragment,null,Bt(br,{id:u},M&&j),Bt(br,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!M&&j))},wr=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Or=new RegExp("["+wr.map(function(e){return e.letters}).join("")+"]","g"),Cr={},Sr=0;Sr<wr.length;Sr++)for(var kr=wr[Sr],Ir=0;Ir<kr.letters.length;Ir++)Cr[kr.letters[Ir]]=kr.base;var Er=function(e){return e.replace(Or,function(e){return Cr[e]})},Pr=function(e,t){void 0===t&&(t=gr);var n=null;function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}(Er),Mr=function(e){return e.replace(/^\s+|\s+$/g,"")},Rr=function(e){return"".concat(e.label," ").concat(e.value)},jr=["innerRef"];function Tr(e){var t=e.innerRef,n=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 o=Object.entries(e).filter(function(e){var t=I(e,1)[0];return!n.includes(t)});return o.reduce(function(e,t){var n=I(t,2),r=n[0],o=n[1];return e[r]=o,e},{})}(E(e,jr),"onExited","in","enter","exit","appear");return Bt("input",M({ref:t},n,{css:zt({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Vr=["boxSizing","height","overflow","paddingRight","position"],Lr={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Fr(e){e.cancelable&&e.preventDefault()}function Dr(e){e.stopPropagation()}function Nr(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ar(){return"ontouchstart"in window||navigator.maxTouchPoints}var $r=!("undefined"==typeof window||!window.document||!window.document.createElement),_r=0,Hr={capture:!1,passive:!1};var Ur=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Br={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function zr(e){var n=e.children,r=e.lockEnabled,o=e.captureEnabled,i=function(e){var n=e.isEnabled,r=e.onBottomArrive,o=e.onBottomLeave,i=e.onTopArrive,a=e.onTopLeave,s=t.useRef(!1),l=t.useRef(!1),u=t.useRef(0),c=t.useRef(null),d=t.useCallback(function(e,t){if(null!==c.current){var n=c.current,u=n.scrollTop,d=n.scrollHeight,p=n.clientHeight,f=c.current,m=t>0,h=d-p-u,g=!1;h>t&&s.current&&(o&&o(e),s.current=!1),m&&l.current&&(a&&a(e),l.current=!1),m&&t>h?(r&&!s.current&&r(e),f.scrollTop=d,g=!0,s.current=!0):!m&&-t>u&&(i&&!l.current&&i(e),f.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[r,o,i,a]),p=t.useCallback(function(e){d(e,e.deltaY)},[d]),f=t.useCallback(function(e){u.current=e.changedTouches[0].clientY},[]),m=t.useCallback(function(e){var t=u.current-e.changedTouches[0].clientY;d(e,t)},[d]),h=t.useCallback(function(e){if(e){var t=!!Vn&&{passive:!1};e.addEventListener("wheel",p,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",m,t)}},[m,f,p]),g=t.useCallback(function(e){e&&(e.removeEventListener("wheel",p,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",m,!1))},[m,f,p]);return t.useEffect(function(){if(n){var e=c.current;return h(e),function(){g(e)}}},[n,h,g]),function(e){c.current=e}}({isEnabled:void 0===o||o,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),a=function(e){var n=e.isEnabled,r=e.accountForScrollbars,o=void 0===r||r,i=t.useRef({}),a=t.useRef(null),s=t.useCallback(function(e){if($r){var t=document.body,n=t&&t.style;if(o&&Vr.forEach(function(e){var t=n&&n[e];i.current[e]=t}),o&&_r<1){var r=parseInt(i.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,s=window.innerWidth-a+r||0;Object.keys(Lr).forEach(function(e){var t=Lr[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&Ar()&&(t.addEventListener("touchmove",Fr,Hr),e&&(e.addEventListener("touchstart",Nr,Hr),e.addEventListener("touchmove",Dr,Hr))),_r+=1}},[o]),l=t.useCallback(function(e){if($r){var t=document.body,n=t&&t.style;_r=Math.max(_r-1,0),o&&_r<1&&Vr.forEach(function(e){var t=i.current[e];n&&(n[e]=t)}),t&&Ar()&&(t.removeEventListener("touchmove",Fr,Hr),e&&(e.removeEventListener("touchstart",Nr,Hr),e.removeEventListener("touchmove",Dr,Hr)))}},[o]);return t.useEffect(function(){if(n){var e=a.current;return s(e),function(){l(e)}}},[n,s,l]),function(e){a.current=e}}({isEnabled:r});return Bt(t.Fragment,null,r&&Bt("div",{onClick:Ur,css:Br}),n(function(e){i(e),a(e)}))}var Wr={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},qr=function(e){var t=e.name,n=e.onFocus;return Bt("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Wr,value:"",onChange:function(){}})};function Gr(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function Yr(){return Gr(/^Mac/i)}function Xr(){return Gr(/^iPhone/i)||Gr(/^iPad/i)||Yr()&&navigator.maxTouchPoints>1}var Kr,Jr={clearIndicator:tr,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius;return C({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},dropdownIndicator:er,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return C({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return C({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return C(C({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},ur),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return C({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*a})},loadingMessage:qn,menu:function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,s=o.colors;return C((w(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),w(n,"position","absolute"),w(n,"width","100%"),w(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return C({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return C({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return C({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return C({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:Wn,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,s=i.colors;return C({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?s.primary:r?s.primary25:"transparent",color:n?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return C({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return C({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return C({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},Zr={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Qr={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Mn(),captureMenuScroll:!Mn(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=C({ignoreCase:!0,ignoreAccents:!0,stringify:Rr,trim:!0,matchFrom:"any"},Kr),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,s=n.matchFrom,l=a?Mr(t):t,u=a?Mr(i(e)):i(e);return r&&(l=l.toLowerCase(),u=u.toLowerCase()),o&&(l=Pr(l),u=Er(u)),"start"===s?u.substr(0,l.length)===l:u.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function eo(e,t,n,r){return{type:"option",data:t,isDisabled:lo(e,t,n),isSelected:uo(e,t,n),label:ao(e,t),value:so(e,t),index:r}}function to(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(n,r){return eo(e,n,t,r)}).filter(function(t){return oo(e,t)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=eo(e,n,t,r);return oo(e,i)?i:void 0}).filter(Ln)}function no(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,F(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function ro(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,F(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function oo(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,s=t.value;return(!po(e)||!i)&&co(e,{label:a,value:s,data:o},r)}var io=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},ao=function(e,t){return e.getOptionLabel(t)},so=function(e,t){return e.getOptionValue(t)};function lo(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function uo(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=so(e,t);return n.some(function(t){return so(e,t)===r})}function co(e,t,n){return!e.filterOption||e.filterOption(t,n)}var po=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},fo=1,mo=function(e){!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&&j(e,t)}(n,e);var t=function(e){var t=V();return function(){var n,r=T(e);if(t){var o=T(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return L(this,n)}}(n);function n(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,o=n.onChange,i=n.name;t.name=i,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,i=o.closeMenuOnSelect,a=o.isMulti,s=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(r.setState({inputIsHiddenAfterUpdate:!a}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,o=t.isMulti,i=t.name,a=r.state.selectValue,s=o&&r.isOptionSelected(e,a),l=r.isOptionDisabled(e,a);if(s){var u=r.getOptionValue(e);r.setValue(a.filter(function(e){return r.getOptionValue(e)!==u}),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:i});o?r.setValue([].concat(F(a),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,o=r.getOptionValue(e),i=n.filter(function(e){return r.getOptionValue(e)!==o}),a=Fn(t,i,i[0]||null);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(Fn(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),i=Fn(e,o,o[0]||null);n&&r.onChange(i,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return io(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return ro(to(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return xn.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return ao(r.props,e)},r.getOptionValue=function(e){return so(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=Jr[e](t,n);o.boxSizing="border-box";var i=r.props.styles[e];return i?i(o,t):o},r.getClassNames=function(e,t){var n,o;return null===(n=(o=r.props.classNames)[e])||void 0===n?void 0:n.call(o,t)},r.getElementId=function(e){return"".concat(r.state.instancePrefix,"-").concat(e)},r.getComponents=function(){return e=r.props,C(C({},fr),e.components);var e},r.buildCategorizedOptions=function(){return to(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return no(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:C({value:e},t)})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,o=t.menuIsOpen;r.focusInput(),o?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu("first"),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Sn(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var o=Math.abs(n.clientX-r.initialTouchX),i=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=o>5||i>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){if(!r.blockOptionHover&&r.state.focusedOption!==e){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return po(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,s=t.isClearable,l=t.isDisabled,u=t.menuIsOpen,c=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,f=r.state,m=f.focusedOption,h=f.focusedValue,g=f.selectValue;if(!(l||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;r.focusValue("previous");break;case"ArrowRight":if(!n||a)return;r.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(h)r.removeValue(h);else{if(!o)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!u||!d||!m||p&&r.isOptionSelected(m,g))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":u?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:a}),r.onMenuClose()):s&&i&&r.clearValue();break;case" ":if(a)return;if(!u){r.openMenu("first");break}if(!m)return;r.selectOption(m);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++fo),r.state.selectValue=wn(e.value),e.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=i[a],r.state.focusedOptionId=io(o,i[a])}return r}return function(e,t,n){t&&R(e.prototype,t),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Pn(this.menuListRef,this.focusedOptionRef),(Yr()||Xr())&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Pn(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildFocusableOptions(),a="first"===e?0:i.length-1;if(!this.props.isMulti){var s=i.indexOf(r[0]);s>-1&&(a=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a],focusedOptionId:this.getFocusedOptionId(i[a])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o<i&&(a=o+1)}this.setState({inputIsHidden:-1!==a,focusedValue:n[a]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[o])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Zr):C(C({},Zr),this.props.theme):Zr}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,i=this.selectOption,a=this.setValue,s=this.props,l=s.isMulti,u=s.isRtl,c=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:l,isRtl:u,options:c,selectOption:i,selectProps:s,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return lo(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return uo(this.props,e,t)}},{key:"filterOption",value:function(e,t){return co(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,a=e.tabIndex,s=e.form,l=e.menuIsOpen,u=e.required,c=this.getComponents().Input,d=this.state,p=d.inputIsHidden,f=d.ariaSelection,m=this.commonProps,h=r||this.getElementId("input"),g=C(C(C({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":u,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?o.createElement(c,M({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:s,type:"text",value:i},g)):o.createElement(Tr,M({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:bn,onFocus:this.onInputFocus,disabled:t,tabIndex:a,inputMode:"none",form:s,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,a=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,u=this.commonProps,c=this.props,d=c.controlShouldRenderValue,p=c.isDisabled,f=c.isMulti,m=c.inputValue,h=c.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,y=g.isFocused;if(!this.hasValue()||!d)return m?null:o.createElement(l,M({},u,{key:"placeholder",isDisabled:p,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),h);if(f)return v.map(function(t,s){var l=t===b,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return o.createElement(n,M({},u,{components:{Container:r,Label:i,Remove:a},isFocused:l,isDisabled:p,key:c,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var x=v[0];return o.createElement(s,M({},u,{data:x,isDisabled:p}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,M({},t,{innerProps:s,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!e||!i)return null;return o.createElement(e,M({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:a}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return o.createElement(n,M({},r,{isDisabled:i,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,M({},t,{innerProps:i,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,i=t.Menu,a=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,u=t.NoOptionsMessage,c=t.Option,d=this.commonProps,p=this.state.focusedOption,f=this.props,m=f.captureMenuScroll,h=f.inputValue,g=f.isLoading,v=f.loadingMessage,b=f.minMenuHeight,y=f.maxMenuHeight,x=f.menuIsOpen,w=f.menuPlacement,O=f.menuPosition,C=f.menuPortalTarget,S=f.menuShouldBlockScroll,k=f.menuShouldScrollIntoView,I=f.noOptionsMessage,E=f.onMenuScrollToTop,P=f.onMenuScrollToBottom;if(!x)return null;var R,j=function(t,n){var r=t.type,i=t.data,a=t.isDisabled,s=t.isSelected,l=t.label,u=t.value,f=p===i,m=a?void 0:function(){return e.onOptionHover(i)},h=a?void 0:function(){return e.selectOption(i)},g="".concat(e.getElementId("option"),"-").concat(n),v={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:"option","aria-selected":e.state.isAppleDevice?void 0:s};return o.createElement(c,M({},d,{innerProps:v,data:i,isDisabled:a,isSelected:s,key:g,label:l,type:r,value:u,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())R=this.getCategorizedOptions().map(function(t){if("group"===t.type){var i=t.data,a=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),u="".concat(l,"-heading");return o.createElement(n,M({},d,{key:l,data:i,options:a,Heading:r,headingProps:{id:u,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return j(e,"".concat(s,"-").concat(e.index))}))}if("option"===t.type)return j(t,"".concat(t.index))});else if(g){var T=v({inputValue:h});if(null===T)return null;R=o.createElement(l,d,T)}else{var V=I({inputValue:h});if(null===V)return null;R=o.createElement(u,d,V)}var L={minMenuHeight:b,maxMenuHeight:y,menuPlacement:w,menuPosition:O,menuShouldScrollIntoView:k},F=o.createElement(Un,M({},d,L),function(t){var n=t.ref,r=t.placerProps,s=r.placement,l=r.maxHeight;return o.createElement(i,M({},d,L,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),o.createElement(zr,{captureEnabled:m,onTopArrive:E,onBottomArrive:P,lockEnabled:S},function(t){return o.createElement(a,M({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:p}),R)}))});return C||"fixed"===O?o.createElement(s,M({},d,{appendTo:C,controlElement:this.controlRef,menuPlacement:w,menuPosition:O}),F):F}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,a=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!r)return o.createElement(qr,{name:a,onFocus:this.onValueInputFocus});if(a&&!r){if(i){if(n){var u=l.map(function(t){return e.getOptionValue(t)}).join(n);return o.createElement("input",{name:a,type:"hidden",value:u})}var c=l.length>0?l.map(function(t,n){return o.createElement("input",{key:"i-".concat(n),name:a,type:"hidden",value:e.getOptionValue(t)})}):o.createElement("input",{name:a,type:"hidden",value:""});return o.createElement("div",null,c)}var d=l[0]?this.getOptionValue(l[0]):"";return o.createElement("input",{name:a,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return o.createElement(xr,M({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:i,isFocused:a,selectValue:s,focusableOptions:l,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,a=this.props,s=a.className,l=a.id,u=a.isDisabled,c=a.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return o.createElement(r,M({},p,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:d}),this.renderLiveRegion(),o.createElement(t,M({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:d,menuIsOpen:c}),o.createElement(i,M({},p,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),o.createElement(n,M({},p,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,u=e.options,c=e.value,d=e.menuIsOpen,p=e.inputValue,f=e.isMulti,m=wn(c),h={};if(n&&(c!==n.value||u!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return no(to(e,t))}(e,m):[],v=d?ro(to(e,m),"".concat(l,"-option")):[],b=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}(t,m):null,y=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);h={selectValue:m,focusedOption:y,focusedOptionId:io(v,y),focusableOptionsWithIds:v,focusedValue:b,clearFocusValueOnUpdate:!1}}var x=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},w=i,O=a&&s;return a&&!O&&(w={value:Fn(f,m,m[0]||null),options:m,action:"initial-input-focus"},O=!s),"initial-input-focus"===(null==i?void 0:i.action)&&(w=null),C(C(C({},h),x),{},{prevProps:e,ariaSelection:w,prevWasFocused:O})}}]),n}(t.Component);mo.defaultProps=Qr;var ho=t.forwardRef(function(e,n){var r=function(e){var n=e.defaultInputValue,r=void 0===n?"":n,o=e.defaultMenuIsOpen,i=void 0!==o&&o,a=e.defaultValue,s=void 0===a?null:a,l=e.inputValue,u=e.menuIsOpen,c=e.onChange,d=e.onInputChange,p=e.onMenuClose,f=e.onMenuOpen,m=e.value,h=E(e,P),g=I(t.useState(void 0!==l?l:r),2),v=g[0],b=g[1],y=I(t.useState(void 0!==u?u:i),2),x=y[0],w=y[1],O=I(t.useState(void 0!==m?m:s),2),S=O[0],k=O[1],M=t.useCallback(function(e,t){"function"==typeof c&&c(e,t),k(e)},[c]),R=t.useCallback(function(e,t){var n;"function"==typeof d&&(n=d(e,t)),b(void 0!==n?n:e)},[d]),j=t.useCallback(function(){"function"==typeof f&&f(),w(!0)},[f]),T=t.useCallback(function(){"function"==typeof p&&p(),w(!1)},[p]),V=void 0!==l?l:v,L=void 0!==u?u:x,F=void 0!==m?m:S;return C(C({},h),{},{inputValue:V,menuIsOpen:L,onChange:M,onInputChange:R,onMenuClose:T,onMenuOpen:j,value:F})}(e);return o.createElement(mo,M({ref:n},r))}),go=ho;const vo=({logoUrl:e,alt:t})=>m.jsx("img",{src:e,alt:t,className:"w-8 h-8 flex-shrink-0 object-contain",onError:e=>{const n=e.target;n.style.display="none";const r=document.createElement("div");r.className="w-8 h-8 rounded-full flex items-center justify-center font-bold text-xs flex-shrink-0 bg-gray-200",r.textContent=t.substring(0,2).toUpperCase(),n.parentNode?.appendChild(r)}}),bo=[{value:"mtn",label:"MTN",logoUrl:"https://payments-web.anmgw.com/assets/images/mtn.svg"},{value:"vodafone",label:"Telecel",logoUrl:"https://payments-web.anmgw.com/assets/images/telecel.svg"},{value:"airteltigo",label:"AirtelTigo",logoUrl:"https://payments-web.anmgw.com/assets/images/at.svg"}],yo=e=>m.jsx(fr.Option,{...e,children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(vo,{logoUrl:e.data.logoUrl,alt:e.data.label}),m.jsx("span",{className:"font-medium",children:e.data.label})]})}),xo=e=>m.jsx(fr.SingleValue,{...e,children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(vo,{logoUrl:e.data.logoUrl,alt:e.data.label}),m.jsx("span",{className:"font-medium",children:e.data.label})]})}),wo=({selectedNetwork:e,onSelect:n,disabled:r=!1,primaryColor:o})=>{const i=o||"#3B82F6",a=bo.find(t=>t.value===e),s={control:(t,n)=>({...t,minHeight:"48px",borderWidth:"2px",borderColor:n.isFocused||e?i:"#D1D5DB",boxShadow:n.isFocused?`0 0 0 3px ${i}33`:"none",outline:"none","&:hover":{borderColor:n.isFocused||e?i:"#9CA3AF"},opacity:r?.5:1,cursor:r?"not-allowed":"pointer",backgroundColor:r?"#F9FAFB":"white"}),menu:e=>({...e,borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",border:`1px solid ${i}33`,zIndex:9999,position:"absolute"}),menuList:e=>({...e,padding:"4px",maxHeight:"200px",overflowY:"auto",overflowX:"hidden"}),menuPortal:e=>({...e,zIndex:9999}),option:(e,t)=>({...e,backgroundColor:t.isSelected?i:t.isFocused?`${i}20`:"white",color:t.isSelected?"white":"#111827",cursor:"pointer","&:active":{backgroundColor:t.isSelected?i:`${i}40`}}),placeholder:e=>({...e,color:"#9CA3AF"}),singleValue:e=>({...e,color:"#111827"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:e=>({...e,color:"#6B7280","&:hover":{color:"#111827"}})},l=t.useMemo(()=>`network-selector-${Math.random().toString(36).substr(2,9)}`,[]);return m.jsxs(m.Fragment,{children:[m.jsx("style",{children:`\n #${l} .react-select__control--is-focused {\n border-color: ${i} !important;\n box-shadow: 0 0 0 3px ${i}33 !important;\n }\n #${l} .react-select__control:hover:not(.react-select__control--is-disabled) {\n border-color: ${e?i:"#9CA3AF"} !important;\n }\n `}),m.jsxs("div",{id:l,className:"w-full",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select Network"}),m.jsx(go,{value:a||null,onChange:e=>{e&&n(e.value)},options:bo,isDisabled:r,placeholder:"-- Select Network --",components:{Option:yo,SingleValue:xo},styles:s,isSearchable:!1,menuPortalTarget:"undefined"!=typeof document?document.body:void 0,menuPosition:"fixed",className:"react-select-container",classNamePrefix:"react-select"})]})]})},Oo=({length:e=4,onComplete:n,onResend:r,disabled:o=!1,loading:i=!1,error:a,primaryColor:s="#3B82F6"})=>{const[l,u]=t.useState(new Array(e).fill("")),[c,d]=t.useState(0);t.useEffect(()=>{let e;return c>0&&(e=setTimeout(()=>d(c-1),1e3)),()=>clearTimeout(e)},[c]);const p=t=>{if(o||i)return;t.preventDefault();const r=t.clipboardData.getData("text/plain").replace(/\D/g,"");if(r.length===e){const t=r.split("");u(t),n(r);const o=document.getElementById("otp-input-"+(e-1));o?.focus()}};return m.jsxs("div",{className:"w-full",children:[m.jsx("div",{className:"flex justify-center gap-2 mb-4",children:l.map((t,r)=>m.jsx("input",{id:`otp-input-${r}`,type:"text",inputMode:"numeric",maxLength:1,value:t,onChange:t=>((t,r)=>{if(o||i)return;if(!/^\d*$/.test(r))return;const a=[...l];if(a[t]=r,u(a),r&&t<e-1){const e=document.getElementById(`otp-input-${t+1}`);e?.focus()}const s=a.join("");s.length===e&&n(s)})(r,t.target.value),onKeyDown:t=>((t,n)=>{if(!o&&!i){if("Backspace"===n.key)if(l[t]){const e=[...l];e[t]="",u(e)}else if(t>0){const e=document.getElementById("otp-input-"+(t-1));e?.focus()}if("ArrowLeft"===n.key&&t>0){const e=document.getElementById("otp-input-"+(t-1));e?.focus()}if("ArrowRight"===n.key&&t<e-1){const e=document.getElementById(`otp-input-${t+1}`);e?.focus()}}})(r,t),onPaste:p,disabled:o||i,className:`w-12 h-12 md:w-14 md:h-14 text-center text-lg md:text-xl font-semibold border-2 rounded-lg focus:outline-none focus:ring-2 transition-all ${a?"border-red-500 bg-red-50":"border-gray-300 bg-white"} ${o||i?"opacity-50 cursor-not-allowed":""}`,style:{...a?{}:{"--focus-ring-color":s,"--focus-border-color":s}},onFocus:e=>{a||o||i||(e.target.style.borderColor=s,e.target.style.boxShadow=`0 0 0 3px ${s}33`)},onBlur:e=>{a||(e.target.style.borderColor="#D1D5DB",e.target.style.boxShadow="")}},r))}),a&&m.jsx("p",{className:"text-red-500 text-sm text-center mb-4",children:a}),m.jsx("div",{className:"text-center",children:m.jsx("button",{type:"button",onClick:()=>{c>0||o||i||(r(),d(60))},disabled:c>0||o||i,className:"text-sm "+(c>0||o||i?"opacity-50 cursor-not-allowed":""),style:{color:s},onMouseEnter:e=>{e.currentTarget.disabled||(e.currentTarget.style.opacity="0.8")},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:c>0?`Resend OTP in ${c}s`:"Resend OTP"})})]})},Co=({paymentId:e,showTimeoutWarning:t=!1,primaryColor:n="#3B82F6"})=>m.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[m.jsx("div",{className:"relative w-16 h-16 mb-4",children:m.jsx("div",{className:"absolute inset-0 border-4 rounded-full animate-spin",style:{borderColor:`${n}33`,borderTopColor:n}})}),m.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Processing Payment"}),m.jsx("div",{className:"rounded-lg p-3 mb-4 max-w-sm border",style:{backgroundColor:`${n}15`,borderColor:`${n}40`},children:m.jsxs("p",{className:"text-sm text-center font-medium",style:{color:n},children:["Please wait for a prompt or go to ",m.jsx("strong",{children:"my approvals"})," to complete the transaction"]})}),t&&m.jsx("p",{className:"text-xs text-amber-600 text-center mt-2",children:"This is taking longer than usual. You'll be notified when it completes."}),m.jsxs("p",{className:"text-xs text-gray-400 mt-2",children:["Payment ID: ",e]})]}),So=({success:e,payment:n,redirectUrl:r,onRedirect:o,primaryColor:i="#3B82F6"})=>{const[a,s]=t.useState(r?5:0);return t.useEffect(()=>{if(r&&a>0){const e=setTimeout(()=>{s(a-1)},1e3);return()=>clearTimeout(e)}if(r&&0===a){const e=setTimeout(()=>{o()},100);return()=>clearTimeout(e)}},[a,r,o]),m.jsx("div",{className:"flex flex-col items-center justify-center py-8",children:e?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:m.jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),m.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Payment Successful!"}),n&&m.jsxs("p",{className:"text-gray-600 text-sm mb-2",children:["Amount: ",n.currency," ","number"==typeof n.amount?n.amount.toFixed(2):"string"==typeof n.amount?Number.parseFloat(n.amount).toFixed(2):n.amount]}),r?m.jsx("p",{className:"text-gray-500 text-xs mb-4",children:a>0?`Redirecting in ${a} seconds...`:"Redirecting..."}):m.jsx("button",{onClick:o,className:"mt-4 px-6 py-2 text-white rounded-lg transition-all",style:{backgroundColor:i},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:"Close"})]}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4",children:m.jsx("svg",{className:"w-8 h-8 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),m.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Payment Failed"}),m.jsx("p",{className:"text-gray-600 text-sm mb-4",children:"Your payment could not be processed. Please try again."}),r?m.jsx("p",{className:"text-gray-500 text-xs mb-4",children:a>0?`Redirecting in ${a} seconds...`:"Redirecting..."}):m.jsx("button",{onClick:o,className:"mt-4 px-6 py-2 text-white rounded-lg transition-all",style:{backgroundColor:i},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:"Close"})]})})},ko=({paymentId:e,redirectUrl:n,onRedirect:r,onContinueWaiting:o,primaryColor:i="#3B82F6"})=>{const[a,s]=t.useState(5);return t.useEffect(()=>{if(!n)return;const e=setInterval(()=>{s(t=>t<=1?(clearInterval(e),r(),0):t-1)},1e3);return()=>clearInterval(e)},[n,r]),m.jsxs("div",{className:"mt-6 p-4 rounded-lg border",style:{backgroundColor:`${i}08`,borderColor:`${i}30`},children:[m.jsx("h4",{className:"text-sm font-semibold mb-2",style:{color:i},children:"Payment Still Processing"}),m.jsx("p",{className:"text-sm mb-4",style:{color:`${i}DD`},children:"Your payment is still being processed. You'll be notified via webhook when it completes."}),m.jsx("div",{className:"flex gap-3",children:n?m.jsxs(m.Fragment,{children:[m.jsxs("button",{onClick:r,className:"flex-1 py-2 px-4 text-white rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:i},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:["Return Now ",a>0&&`(${a}s)`]}),m.jsx("button",{onClick:o,className:"flex-1 py-2 px-4 bg-white border rounded-lg text-sm font-medium transition-colors",style:{borderColor:`${i}40`,color:i},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`${i}10`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="white"},children:"Continue Waiting"})]}):m.jsx("button",{onClick:o,className:"w-full py-2 px-4 text-white rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:i},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:"Continue Waiting"})}),m.jsxs("p",{className:"text-xs mt-3 text-gray-500 text-center",children:["Payment ID: ",e]})]})};e.PaymentService=v,e.PaymentWidget=({config:e,isOpen:n,onClose:r})=>{const[o,i]=t.useState("phone-input"),[a,s]=t.useState(""),[l,u]=t.useState(""),[c,d]=t.useState(),[p,f]=t.useState(""),[y,x]=t.useState(null),[w,O]=t.useState(null),[C,S]=t.useState(!1),[k,I]=t.useState(null),[E,P]=t.useState(!1),[M,R]=t.useState(!1),[j,T]=t.useState(!1),[V,L]=t.useState(0),F=new v({apiKey:e.apiKey,platformId:e.platformId,baseUrl:e.apiUrl});t.useEffect(()=>{n&&e.platformId&&F.getPlatformInfo().then(e=>{if(e.logo_url){const t=new Image;t.onload=()=>{I(e.logo_url),P(!0)},t.onerror=()=>{P(!1)},t.src=e.logo_url}}).catch(e=>{console.debug("Failed to fetch platform logo:",e)})},[n,e.platformId,F]),t.useEffect(()=>{const t=e.displayMode||"modal";if(n&&"modal"===t){const e=globalThis.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[n,e.displayMode]),t.useEffect(()=>{n||(i("phone-input"),s(""),u(""),d(void 0),f(""),x(null),O(null),S(!1),I(null),P(!1),R(!1),T(!1),L(0))},[n]),t.useEffect(()=>{if("verifying"===o&&p&&!M){let t=0;const n=15,r=7;R(!1),T(!1);const o=setInterval(async()=>{t++,t===r&&T(!0);try{const t=await F.getPaymentStatus(p);if(t.data){const n=t.data.status;"completed"===n?(x(t.data),clearInterval(o),T(!1),R(!1),e.onSuccess?.(t.data),i("success")):"failed"!==n&&"cancelled"!==n&&"expired"!==n||(clearInterval(o),T(!1),R(!1),e.onError?.({message:`Payment ${n}`}),i("failed"))}}catch(e){console.error("Error polling payment status:",e)}t>=n&&(clearInterval(o),R(!0),T(!1))},2e3);return()=>{clearInterval(o),T(!1)}}},[o,p,e,V,M]);const D=async()=>{if(l&&c){if(e.redirect_url&&!h(e.redirect_url))return O("Redirect URL must be a valid HTTPS URL"),void e.onError?.({message:"Redirect URL must be a valid HTTPS URL",code:"INVALID_REDIRECT_URL"});S(!0),O(null);try{const t=await F.createPayment({amount:e.amount,currency:e.currency||"GHS",payment_method:"mobile_money",phone_number:l,network:c,redirect_url:e.redirect_url,webhook_url:e.webhookUrl,order_id:e.orderId,metadata:e.metadata});if(!t.data?.payment_id)throw new Error("Failed to create payment");f(t.data.payment_id),t.data.otp_required?i("otp-input"):i("verifying")}catch(t){const n=t instanceof Error?t.message:"Failed to create payment";O(n),e.onError?.({message:n})}finally{S(!1)}}else O("Please enter phone number and select network")},N=async t=>{if(p&&l){S(!0),O(null);try{if(!(await F.verifyOTP(p,{phone_number:l,otp_code:t})).data)throw new Error("Failed to verify OTP");i("verifying")}catch(t){const n=t instanceof Error?t.message:"Invalid OTP code";O(n),e.onError?.({message:n})}finally{S(!1)}}else O("Missing required data")},A=async()=>{if(p){S(!0),O(null);try{await F.resendOTP(p,{phone_number:l})}catch(e){const t=e instanceof Error?e.message:"Failed to resend OTP";O(t)}finally{S(!1)}}},$=()=>{if(p&&e.redirect_url){const t=g(e.redirect_url,p,"cancelled");return void(globalThis.location.href=t)}r&&r()},_=e.displayMode||"modal",H=e.primaryColor||"#3B82F6",U=k||e.logoUrl;if(t.useEffect(()=>{if(e.logoUrl&&!k&&""!==e.logoUrl.trim()){const t=new Image;t.onload=()=>P(!0),t.onerror=()=>P(!1),t.src=e.logoUrl}},[e.logoUrl,k]),t.useEffect(()=>{if(!n)return;const e=e=>(e.preventDefault(),!1),t=e=>{if("F12"===e.key||e.ctrlKey&&e.shiftKey&&("I"===e.key||"J"===e.key||"C"===e.key)||e.ctrlKey&&("U"===e.key||"S"===e.key))return e.preventDefault(),!1},r=e=>{const t=e.target;"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&e.preventDefault()};return document.addEventListener("contextmenu",e),document.addEventListener("keydown",t),document.addEventListener("selectstart",r),()=>{document.removeEventListener("contextmenu",e),document.removeEventListener("keydown",t),document.removeEventListener("selectstart",r)}},[n]),!n)return null;const B=()=>m.jsxs(m.Fragment,{children:["fullpage"!==_&&m.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[U&&m.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-200 flex-shrink-0 flex items-center justify-center bg-gray-100 overflow-hidden",children:E||U===e.logoUrl&&!k?m.jsx("img",{src:U,alt:"Logo",className:"w-full h-full rounded-full object-cover",onError:e=>{e.target.style.display="none"}}):m.jsx("div",{className:"w-full h-full rounded-full bg-gray-200 animate-pulse"})}),m.jsxs("h2",{className:"text-xl font-semibold text-gray-800",children:[e.currency||"GHS"," ",e.amount.toFixed(2)]})]}),"success"!==o&&"failed"!==o&&m.jsx("button",{onClick:$,className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close",children:m.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsxs("div",{className:"p-6",children:["phone-input"===o&&m.jsxs("div",{className:"space-y-4",children:[m.jsx(wo,{selectedNetwork:c,onSelect:d,disabled:C,primaryColor:H}),m.jsx(b,{value:a,onChange:s,onValid:u,disabled:C,error:w||void 0,primaryColor:H}),w&&m.jsx("p",{className:"text-red-500 text-sm",children:w}),m.jsx("button",{onClick:D,disabled:!l||!c||C,className:"w-full py-3 text-white rounded-lg font-medium disabled:opacity-50 disabled:cursor-not-allowed transition-all",style:{backgroundColor:H},onMouseEnter:e=>{e.currentTarget.disabled||(e.currentTarget.style.opacity="0.9")},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:C?"Processing...":"Continue"})]}),"otp-input"===o&&m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-2",children:"Enter OTP"}),m.jsxs("p",{className:"text-sm text-gray-600 mb-4",children:["We've sent a 4-digit code to ",l]})]}),m.jsx(Oo,{length:4,onComplete:N,onResend:A,disabled:C,loading:C,error:w||void 0,primaryColor:H})]}),"verifying"===o&&m.jsxs(m.Fragment,{children:[m.jsx(Co,{paymentId:p,primaryColor:H,showTimeoutWarning:j}),M&&m.jsx(ko,{paymentId:p,redirectUrl:e.redirect_url,onRedirect:()=>{if(e.redirect_url){const t=g(e.redirect_url,p,"pending");globalThis.location.href=t}},onContinueWaiting:()=>{R(!1),T(!1),L(e=>e+1)},primaryColor:H})]}),("success"===o||"failed"===o)&&m.jsx(So,{success:"success"===o,payment:y||void 0,redirectUrl:e.redirect_url,primaryColor:H,onRedirect:()=>((t,n)=>{if(e.redirect_url&&p){const r=g(e.redirect_url,p,t,n);return void(globalThis.location.href=r)}r&&r()})("success"===o?"completed":"failed"===o?"failed":"cancelled",y||void 0)})]})]});return"inline"===_?m.jsx("div",{className:"w-full max-w-md mx-auto bg-white rounded-lg shadow-lg border border-gray-200",children:B()}):"fullpage"===_?m.jsx("div",{className:"fixed inset-0 z-50 bg-white overflow-y-auto",children:m.jsxs("div",{className:"min-h-screen flex flex-col",children:[m.jsxs("div",{className:"flex items-center justify-between p-4 border-b bg-gray-50",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[U&&m.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-200 flex-shrink-0 flex items-center justify-center bg-gray-100 overflow-hidden",children:E||U===e.logoUrl&&!k?m.jsx("img",{src:U,alt:"Logo",className:"w-full h-full rounded-full object-cover",onError:e=>{e.target.style.display="none"}}):m.jsx("div",{className:"w-full h-full rounded-full bg-gray-200 animate-pulse"})}),m.jsxs("h2",{className:"text-xl font-semibold text-gray-800",children:[e.currency||"GHS"," ",e.amount.toFixed(2)]})]}),"success"!==o&&"failed"!==o&&m.jsx("button",{onClick:$,className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close",children:m.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:m.jsx("div",{className:"w-full max-w-md",children:m.jsx("div",{className:"bg-white rounded-lg shadow-lg border border-gray-200",children:B()})})})]})}):m.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 p-4",children:m.jsx("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-md max-h-[90vh] overflow-y-auto",children:B()})})}});
2
+ //# sourceMappingURL=payment-widget.umd.js.map