;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="4fcb4c54-58b1-a817-b360-b728b2ea4cb6")}catch(e){}}(); (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,661986,e=>{"use strict";var t=e.i(568433);let a=async e=>{try{let t=`${e}/api/check-ip`,a=await fetch(t);if(!a.ok)throw Error(`HTTP ${a?.status}`);let r=await a.json();return{ip:r?.ipAddress||"0.0.0.0",country:r?.country??null,city:r?.city??null}}catch(e){return t.logger?.error("fetch","getUserIP",e),{ip:"0.0.0.0",country:null,city:null}}};e.s(["getUserIP",0,a])},31994,e=>{"use strict";var t=e.i(568433);let a=async(e,a)=>{if(!a)return{ip:"0.0.0.0",country:null};try{let t=`${e}/api/array/pkg/countries/timezone`,r=await fetch(t,{method:"POST",body:JSON.stringify({tz:a})});if(!r.ok)throw Error(`HTTP ${r?.status}`);let n=await r.json();return{ip:n?.ipAddress||"0.0.0.0",country:n?.country}}catch(e){return t.logger?.error("fetch","getUserTimezoneCountry",e),{ip:"0.0.0.0",country:null}}};e.s(["getUserTimezoneCountry",0,a])},70997,e=>{"use strict";let t=["Backspace","Enter","ArrowLeft","ArrowRight","Delete"],a=["ƒ","£","Ø","Ú","∫","¼","±","÷","µ","æ","™","©","®","♠","♦","♣","♥","€","♯","♪","ß","σ","∆","ℓ","μ","ª","º","ø","ˆ","π","˜","¬","Ω","å","`","∑","´","∂","¢","œ","Â","Ç","Å","Í","Î","Ï","Ó","Ô","Ò","Æ","Œ","Á","¨","ј","џ","ќ","њ","ѓ","ѕ","ў","ъ","ы","ћ","љ","э","ё","ђ","и","´","®","¨","ˆ","ø","˜","µ","à","☺","☻","♥","♦","♣","♠","•","◘","○","◙","♂","♀","♪","♫","☼","►","◄","↕","‼","¶","§","▬","↨","↑","↓","→","←","∟","↔","▲","▼","⌂","ÿ","¢","£","¥","₧","ƒ","ª","º","¿","⌐","¬","½","¼","¡","«","»","[","]","'","alt","Alt"],r=e=>(e.ctrlKey||e.metaKey)&&("c"===e.key||"v"===e.key||"a"===e.key||"x"===e.key||"z"===e.key),n=(e,n,o=[],i=[])=>{if(e.altKey&&!r(e))return void e.preventDefault();let l=[...a,...i],s=[...t,...o];!l?.includes(e.key)&&(s?.includes(e.key)||n.test(e.key)||r(e))||e.preventDefault()};e.s(["AmountKeyDown",0,e=>{let t=e.target;n(e,t.value?.includes(".")?/^[0-9\u0660-\u0669\u06F0-\u06F9]$/:/^[0-9\u0660-\u0669\u06F0-\u06F9.]$/)},"cardKeyDown",0,e=>{let t=e.target,a=t.value&&/\s{1,}$/.test(t.value);" "===e.key&&a||e.shiftKey&&"Shift"!==e.key?e?.preventDefault():n(e,/^[0-9\u0660-\u0669\u06F0-\u06F9]$/)},"cryptoAddressKeyDown",0,e=>{let t=e.target,a=t.value&&/\s{1,}$/.test(t.value);" "===e.key&&a?e?.preventDefault():n(e,/^[a-zA-Z0-9\u0660-\u0669\u06F0-\u06F9]$/)},"ibanKeyDown",0,e=>{let t=e.target,a=t.value&&/\s{1,}$/.test(t.value);" "===e.key&&a||e.shiftKey&&"Shift"!==e.key?e?.preventDefault():n(e,/^[0-9\u0660-\u0669\u06F0-\u06F9]$/)},"mapToEnglishNumbers",0,e=>{let t=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],a=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],r=["0","1","2","3","4","5","6","7","8","9"];return e.split("")?.map(e=>{let n=t.indexOf(e);if(-1!==n)return r[n];let o=a.indexOf(e);return -1!==o?r[o]:e}).join("")},"onlyLetterKeyDown",0,(e,t=!1,a=!1)=>{let r=e.target,o=/\s$/.test(r.value);" "!==e.key||t&&(a||!o)?n(e,t?/^[\p{L}\s]$/u:/^[\p{L}]$/u):e.preventDefault()},"onlyNumberKeyDown",0,e=>{e.shiftKey&&"Shift"!==e.key?e?.preventDefault():n(e,/^[0-9\u0660-\u0669\u06F0-\u06F9]$/)},"onlyNumberLetterKeyDown",0,(e,t=!1,a=[],r=!1)=>{let o=e.target,i=/\s$/.test(o.value);if(" "===e.key&&(!t||!r&&i))return void e.preventDefault();let l=["!","@","#","$","%","^","&","*","(",")","+","=","-","_","]","[","{","}","|","\\",";",":",'"',"'","<",">",",",".","?","/"].filter(e=>!a?.includes(e));n(e,t?/^[\p{L}\p{N}\s\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u0660-\u0669\u06F0-\u06F9]$/u:/^[\p{L}\p{N}\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u0660-\u0669\u06F0-\u06F9]$/u,a,l)},"phoneNumberKeyDown",0,e=>{n(e,/^[0-9\u0660-\u0669\u06F0-\u06F9]$/,["+"])}])},667585,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let r=e.r(132061);function n({reason:e,children:t}){if("u"{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"PreloadChunks",{enumerable:!0,get:function(){return s}});let r=e.r(843476),n=e.r(174080),o=e.r(563599),i=e.r(309885),l=e.r(543369);function s({moduleIds:e}){if("u">typeof window)return null;let t=o.workAsyncStorage.getStore();if(void 0===t)return null;let a=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;a.push(...e)}}if(0===a.length)return null;let s=(0,l.getDeploymentIdQueryOrEmptyString)();return(0,r.jsx)(r.Fragment,{children:a.map(e=>{let a=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${s}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:a,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,n.preload)(a,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},869093,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return c}});let r=e.r(843476),n=e.r(271645),o=e.r(667585),i=e.r(652157);function l(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},c=function(e){let t={...s,...e},a=(0,n.lazy)(()=>t.loader().then(l)),c=t.loading;function u(e){let l=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,u=s?n.Suspense:n.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return n}});let r=e.r(555682)._(e.r(869093));function n(e,t){let a={};"function"==typeof e&&(a.loader=e);let n={...a,...t};return(0,r.default)({...n,modules:n.loadableGenerated?.modules})}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},641411,188525,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(234251),n=e.i(563745),o=e.i(866796);e.i(785269);var i=e.i(322831),l=e.i(421417),s=e.i(142193),c=e.i(625661),u=e.i(724569),d=e.i(678656),p=e.i(70997),m=e.i(469885),g=e.i(336076),h=e.i(33986),f=e.i(643174),y=e.i(688641),x=e.i(661986),v=e.i(452455),b=e.i(770703),w=e.i(31994);let j=/^\+\d{1,15}$/,C=e=>(0,p.mapToEnglishNumbers)(e??"").replace(/[^\d]/g,"");async function S(e,t,a){try{let r=a?.minTotal??8,n=a?.maxTotal??15,o=C(String(e??"")),i=C(t??"");if(!o)return"invalid_phone_code";if(!i)return"invalid_phone";let l=o.length+i.length;if(ln)return"phone_too_long";return}catch{return"invalid_phone"}}e.s(["PHONE_E164_WHOLE",0,j,"normalizeDigits",0,C,"validatePhoneWithCode",()=>S],188525);let I=(0,b.default)(()=>e.A(429192).then(e=>e.ReactCountryFlag),{loadableGenerated:{modules:[696610]}});function $(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch(e){return console.warn("Could not detect timezone:",e),null}}let k={firstName:"",lastName:"",email:"",phoneCode:"",phone:""},_=({lang:e,onSuccess:b})=>{let{t:_}=(0,i.useTranslation)(),{playerId:N,emailAddress:T,phoneNumber:D}=(0,u.useAppSelector)(d.getPlayerSlice),[F,O]=(0,a.useState)(()=>({...k,email:T??""})),[P,L]=(0,a.useState)(!0),[A,z]=(0,a.useState)({}),[M,E]=(0,a.useState)(!1),[R,K]=(0,a.useState)([]),[W,B]=(0,a.useState)(void 0),U=(0,a.useMemo)(()=>F.phoneCode?F.phoneCode:W&&!Array.isArray(W)?String(W?.value??""):"",[F.phoneCode,W]),H=(0,a.useMemo)(()=>Math.max(1,15-C(U).length),[U]);(0,a.useEffect)(()=>{(async()=>{let e,a=await fetch("/api/array/phone-code"),r=await a.json().catch(()=>[]),i=Array.isArray(r)?r:[],l=i.map(e=>({label:`${e.flag} +${e.phonecode}`,extraSearchValue:`${e.isoCode} ${e.flag} +${e.phonecode} ${e.name}`,labelReactNode:(0,t.jsxs)(n.Stack,{dir:"ltr",direction:"row",gap:2,alignItems:"center",children:[(0,t.jsx)(I,{svg:!0,countryCode:e.isoCode,style:{width:"1em",height:"1em"},"aria-label":e.isoCode}),(0,t.jsx)(o.Typography,{variant:"smallBold",children:`+${e.phonecode}`})]}),value:e.phonecode}));if(K(l),D&&j.test(D)){let e=D.slice(1),a=i.find(t=>e.startsWith(String(t.phonecode)));if(a){let r=String(a.phonecode),i=e.slice(r.length);B({label:`${a.flag} +${a.phonecode}`,extraSearchValue:`${a.isoCode} ${a.flag} +${a.phonecode} ${a.name}`,labelReactNode:(0,t.jsxs)(n.Stack,{dir:"ltr",direction:"row",gap:2,alignItems:"center",children:[(0,t.jsx)(I,{svg:!0,countryCode:a.isoCode,style:{width:"1em",height:"1em"},"aria-label":a.isoCode}),(0,t.jsx)(o.Typography,{variant:"smallBold",children:`+${a.phonecode}`})]}),value:a.phonecode}),O(e=>({...e,phoneCode:r,phone:i}));return}}let s=$(),[c,u]=await Promise.all([(0,x.getUserIP)(window.location.origin),(0,w.getUserTimezoneCountry)(window.location.origin,s)]);u?.country&&(e=i.find(e=>e.isoCode?.toLowerCase()===u.country?.toLowerCase())),!e&&c?.country&&(e=i.find(e=>e.isoCode?.toLowerCase()===c.country?.toLowerCase()));let d=e?{label:`${e.flag} +${e.phonecode}`,extraSearchValue:`${e.isoCode} ${e.flag} +${e.phonecode} ${e.name}`,labelReactNode:(0,t.jsxs)(n.Stack,{dir:"ltr",direction:"row",gap:2,alignItems:"center",children:[(0,t.jsx)(I,{svg:!0,countryCode:e.isoCode,style:{width:"1em",height:"1em"},"aria-label":e.isoCode}),(0,t.jsx)(o.Typography,{variant:"smallBold",children:`+${e.phonecode}`})]}),value:e.phonecode}:l[0];B(d),O(e=>({...e,phoneCode:String(d.value)}))})()},[D]),(0,a.useEffect)(()=>{let e=A&&Object.values(A).some(e=>void 0!==e&&""!==e);L(!(Object.values(F).every(e=>""!==e)&&!e))},[A,F]);let V=async()=>{E(!0);try{let e={playerId:N,opId:window.opId,firstName:F.firstName.trim(),lastName:F.lastName.trim(),email:F.email.trim(),phone:`${C(F.phoneCode)}${C(F.phone)}`},t=await fetch("/api/v2/auth/complete-profile",{method:"POST",body:JSON.stringify(e)});t.ok||f.default.dispatch((0,y.showToast)({message:"profile_completion_failed",options:{variant:"error"},browserId:(0,h.getUniqID)("browserId")}));let a=!0;try{let e=await t.json();e&&"boolean"==typeof e.ok&&(a=e.ok&&!0===e.value)}catch{}if(!a)throw Error("Profile completion failed");f.default.dispatch((0,y.showToast)({message:"profile_completion_success",options:{variant:"success"},browserId:(0,h.getUniqID)("browserId")})),b?.()}catch(e){g.logger.error("Profile completion failed",e),f.default.dispatch((0,y.showToast)({message:"profile_completion_failed",options:{variant:"error"},browserId:(0,h.getUniqID)("browserId")}))}finally{E(!1)}},G=async e=>{let t=await S(U,e,{minTotal:8,maxTotal:15});t?(L(!0),z(e=>({...e,phone:t}))):z(e=>({...e,phone:void 0})),O(t=>({...t,phone:e}))},q=(e,t,a,r)=>{let n=(0,p.mapToEnglishNumbers)(t),o=(0,m.sanitizeInput)(n),i=(0,m.simpleValidateString)({value:o,minLength:a,maxLength:r});i?(L(!0),z(t=>({...t,[e]:i.title}))):z(t=>({...t,[e]:void 0})),O(t=>({...t,[e]:o}))},Z=e=>A?.[e],J=async e=>{let t="";if(Array.isArray(e)){let a=e[0]??void 0;t=a?String(a.value):"",B(a)}else t=e?String(e.value):"",B(e??void 0);O(e=>({...e,phoneCode:t}));let a=await S(t,F.phone,{minTotal:8,maxTotal:15});z(e=>({...e,phone:a}))};return(0,t.jsxs)(n.Stack,{sx:{width:1,p:{xs:3,md:4},gap:2},children:[(0,t.jsxs)(n.Stack,{direction:"row",gap:2,children:[(0,t.jsx)(s.CustomInput,{lang:e,lable:"first_name",startIcon:l.faUser,placeholder:"first_name_placeholder",value:F.firstName,onKeyDown:e=>(0,p.onlyLetterKeyDown)(e,!0),onChange:e=>q("firstName",e.target.value,2,40),errorMassage:Z("firstName"),onPaste:e=>{e.preventDefault(),q("firstName",e.clipboardData.getData("text").replace(/[0-9]/g,""),2,40)}}),(0,t.jsx)(s.CustomInput,{lang:e,lable:"last_name",startIcon:l.faUser,placeholder:"last_name_placeholder",value:F.lastName,onKeyDown:e=>(0,p.onlyLetterKeyDown)(e,!0),onChange:e=>q("lastName",e.target.value,2,40),errorMassage:Z("lastName"),onPaste:e=>{e.preventDefault(),q("lastName",e.clipboardData.getData("text").replace(/[0-9]/g,""),2,40)}})]}),(0,t.jsx)(s.CustomInput,{lang:e,lable:"email",startIcon:l.faEnvelope,placeholder:"email_placeholder",value:F.email,maxLength:254,onChange:e=>{var t;let a,r;return t=e.target.value,a=(0,p.mapToEnglishNumbers)(t),void((r=(0,m.validateEmail)(a))&&r.length>0?(L(!0),z(e=>({...e,email:r[0]?.title}))):z(e=>({...e,email:void 0})),O(e=>({...e,email:a})))},errorMassage:Z("email"),disabled:!!T}),R?.length>0&&W?(0,t.jsxs)(n.Stack,{direction:"row",gap:2,alignItems:"flex-start",justifyContent:"space-between",children:[(0,t.jsx)(c.CustomSelect,{lang:e,maxWidth:140,enableSearch:!0,lable:"phone_code",selectedState:W||void 0,onChange:J,options:R,disabled:!!D}),(0,t.jsx)(s.CustomInput,{lang:e,lable:"phone",inputmode:"numeric",startIcon:l.faMobile,placeholder:"phone_placeholder",value:F.phone,onKeyDown:p.phoneNumberKeyDown,onChange:e=>G(e.target.value),maxLength:H,errorMassage:Z("phone"),disabled:!!D})]}):(0,t.jsx)(n.Stack,{width:1,height:70,alignItems:"center",justifyContent:"center",children:(0,t.jsx)(v.WaveLoader,{})}),(0,t.jsx)(r.Button,{variant:"contained",title:M?_("submit_loading","Submitting..."):_("submit","Submit"),color:"primary",size:"large",fullWidth:!0,sx:{mt:3},onClick:V,loading:M,disabled:M||P,children:M?_("submit_loading","Submitting..."):_("submit","Submit")})]})};e.s(["CompleteProfile",0,_,"default",0,_,"getTimezone",()=>$],641411)},336076,761723,e=>{"use strict";var t=e.i(224339);function a(e,a,r,n,o){(0,t._INTERNAL_captureLog)({level:e,message:a,attributes:r,severityNumber:o},n)}function r(e,t,{scope:n}={}){a("trace",e,t,n)}function n(e,t,{scope:r}={}){a("debug",e,t,r)}function o(e,t,{scope:r}={}){a("info",e,t,r)}function i(e,t,{scope:r}={}){a("warn",e,t,r)}function l(e,t,{scope:r}={}){a("error",e,t,r)}function s(e,t,{scope:r}={}){a("fatal",e,t,r)}function c(e,...t){let a=new String(String.raw(e,...t));return a.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),a.__sentry_template_values__=t,a}e.s(["debug",()=>n,"error",()=>l,"fatal",()=>s,"info",()=>o,"trace",()=>r,"warn",()=>i],655115),e.i(655115),e.s(["fmt",()=>c,"parameterize",()=>c],761723),e.s(["debug",()=>n,"error",()=>l,"fatal",()=>s,"fmt",()=>c,"info",()=>o,"trace",()=>r,"warn",()=>i],160443);var u=e.i(160443);e.s(["logger",0,u],336076)},625661,227581,511458,e=>{"use strict";var t=e.i(843476),a=e.i(421417),r=e.i(149721),n=e.i(617590);e.s(["Menu",()=>n.default],227581);var n=n;e.i(247167);var o=e.i(271645),i=e.i(207670),l=e.i(519130),s=e.i(152039),c=e.i(940799),u=e.i(75149),d=e.i(594425),p=e.i(36561),m=e.i(154033),g=e.i(343612),h=e.i(719636),f=e.i(398020),f=f,y=e.i(540672);let x=(0,y.default)("MuiListItemIcon",["root","alignItemsFlexStart"]),v=(0,y.default)("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);var b=e.i(319727);function w(e){return(0,b.default)("MuiMenuItem",e)}let j=(0,y.default)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),C=(0,c.styled)(m.default,{shouldForwardProp:e=>(0,s.default)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,a.dense&&t.dense,a.divider&&t.divider,!a.disableGutters&&t.gutters]}})((0,u.default)(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${j.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${j.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${j.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${j.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${j.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${f.default.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${f.default.inset}`]:{marginLeft:52},[`& .${v.root}`]:{marginTop:0,marginBottom:0},[`& .${v.inset}`]:{paddingLeft:36},[`& .${x.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${x.root} svg`]:{fontSize:"1.25rem"}}}]}))),S=o.forwardRef(function(e,a){let r,n=(0,d.useDefaultProps)({props:e,name:"MuiMenuItem"}),{autoFocus:s=!1,component:c="li",dense:u=!1,divider:m=!1,disableGutters:f=!1,focusVisibleClassName:y,role:x="menuitem",tabIndex:v,className:b,...j}=n,S=o.useContext(p.default),I=o.useMemo(()=>({dense:u||S.dense||!1,disableGutters:f}),[S.dense,u,f]),$=o.useRef(null);(0,g.default)(()=>{s&&$.current&&$.current.focus()},[s]);let k={...n,dense:I.dense,divider:m,disableGutters:f},_=(e=>{let{disabled:t,dense:a,divider:r,disableGutters:n,selected:o,classes:i}=e,s=(0,l.default)({root:["root",a&&"dense",t&&"disabled",!n&&"gutters",r&&"divider",o&&"selected"]},w,i);return{...i,...s}})(n),N=(0,h.default)($,a);return n.disabled||(r=void 0!==v?v:-1),(0,t.jsx)(p.default.Provider,{value:I,children:(0,t.jsx)(C,{ref:N,role:x,tabIndex:r,component:c,focusVisibleClassName:(0,i.default)(_.focusVisible,y),className:(0,i.default)(_.root,b),...j,ownerState:k,classes:_})})});e.s(["MenuItem",0,S],511458);var I=e.i(563745),$=e.i(866796),k=e.i(551757);e.i(785269);var _=e.i(322831),N=e.i(359883),T=e.i(69e4),T=T;let D=e=>{let a=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{e.preventDefault()};return e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchmove",t)}},[]),(0,t.jsx)(T.default,{ref:a,...e})};var F=e.i(941834),O=e.i(452455),P=e.i(142193),L=e.i(93572);let A=({children:e})=>(0,t.jsx)(I.Stack,{sx:{width:20,height:20,alignItems:"center",justifyContent:"center"},children:e}),z=({lang:e})=>{let{t:n}=(0,_.useTranslation)();return(0,t.jsxs)(I.Stack,{sx:{width:1,alignItems:"center",justifyContent:"center",p:2},children:[(0,t.jsxs)(I.Stack,{sx:{alignItems:"center",textAlign:"center",svg:{color:"text.primary"}},children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:a.faMessageExclamation,fontSize:24}),(0,t.jsx)($.Typography,{variant:"h6",children:n("ooops")})]}),(0,t.jsx)($.Typography,{variant:"medium",sx:{},children:n("no_data")})]})};e.s(["CustomSelect",0,({lang:e,id:i,lable:l,placeholder:s,insideLabel:c,startIcon:u,startCurrencyIcon:d,startImg:p,className:m,size:g="large",multiple:h,centerSelectOption:f,sx:y,selectedState:x,options:v,extraOptions:b,extraOptionsOnClick:w,variant:j="select",onChange:C,anchorPosition:T="bottom",extraColorMenu:M,disabled:E,enableSearch:R,maxHeight:K="25%",rltLeft:W,maxWidth:B})=>{var U;let H,{t:V}=(0,_.useTranslation)(),[G,q]=(0,o.useState)(null),[Z,J]=(0,o.useState)(0),[Q,X]=(0,o.useState)(""),Y=v.length>1,ee=l&&V(l)||s?.label||c||V("select_an_option"),et={top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}}};(0,o.useLayoutEffect)(()=>{G&&J(G.offsetWidth)},[G]);let ea=()=>q(null),er=e=>!isNaN(Number(e?.replace(/,/g,""))),en=e=>(e??"").toString().toLocaleLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu,"").replace(/[\s+()\-]/g,""),eo=(0,o.useMemo)(()=>{let e;return(e=en(Q))?v.filter(t=>{let a,r,n,{nLabel:o,nValue:i,nISO:l,nDial:s,nExtra:c}=(r=(e=>{if(!e)return"";let t=Array.from(e,e=>e.codePointAt(0)??0).filter(e=>e>=127462&&e<=127487);return t.length<2?"":String.fromCharCode(t[0]-127462+65)+String.fromCharCode(t[1]-127462+65)})(a=t.label??"")||(e=>{if(!e)return"";let t=e.match(/(?:^|\/)([A-Z]{2})(?:\.(?:svg|png|jpg|webp))?$/i);return t?.[1]?.toUpperCase()??""})(t.img),n=(e=>{if(!e)return"";let t=e.match(/\+(\d{1,4})/);return t?.[1]??""})(a),{nLabel:en(a),nValue:en(t.value),nISO:en(r),nDial:en(n),nExtra:en(t?.extraSearchValue??"")});return o.includes(e)||i.includes(e)||l.includes(e)||s.includes(e)||c.includes(e)}):v},[v,Q]);return(0,t.jsxs)(I.Stack,{className:`custom-select-wrap ${j} ${m}`,sx:{position:"relative",maxWidth:B,width:1,gap:1,...y},children:[l&&(0,t.jsx)($.Typography,{variant:"small",sx:{color:"text.secondary",lineHeight:"120%",pb:1},children:V(l)}),(0,t.jsxs)(I.Stack,{id:i,className:`custom-select custom-select-bg-color custom-select-size-${g}`,component:"button",type:"button",role:"button",direction:"row","aria-expanded":!!G,"aria-haspopup":"listbox","aria-label":ee,onClick:e=>{if(!Y&&!b||E)return null;e.preventDefault(),e.stopPropagation(),e.currentTarget.focus(),q(e.currentTarget)},sx:{width:1,alignItems:"center",justifyContent:"space-between",gap:2,cursor:E||v?.length<2?"default":"pointer",bgcolor:"background.default",border:"1px solid ",borderColor:"grey.100",pt:2,pb:2,borderRadius:3,".custom-select-field":{paddingInlineStart:3*!u,paddingInlineEnd:3*!u,"&.badge":{paddingInlineStart:"0 !important",paddingInlineEnd:"0 !important",alignItems:"center",justifyContent:"center"}},"&.custom-select-size-small":{height:32,borderRadius:1},"&.custom-select-size-medium":{height:40,borderRadius:2},"&.custom-select-size-large":{height:48,borderRadius:3},".selected-item":{borderRadius:1,p:0,gap:1},".rtl-left":{justifyContent:"flex-end"}},children:[(0,t.jsxs)(I.Stack,{direction:"row",sx:{display:p||u||d?"flex":"none",alignItems:"center",justifyContent:"center",gap:2,paddingInlineStart:2,".input-start-icon img":{width:16,height:16},svg:{color:"text.primary"}},children:[p&&(0,t.jsx)(A,{children:(0,t.jsx)(k.CustomImg,{className:"input-start-icon",alt:"",src:p})}),u&&(0,t.jsx)(A,{children:(0,t.jsx)(r.FontAwesomeIcon,{className:"input-start-img-icon",icon:u,fontSize:16})}),d&&(0,t.jsx)(A,{children:(0,t.jsx)(N.default,{lang:e,className:"input-start-currency-icon",currency:d.code,size:"Small"})})]}),(0,t.jsxs)(I.Stack,{className:`custom-select-field ${j}`,sx:{flex:1,gap:1,paddingInlineStart:p||u||d?"0px !important":"12px"},children:["badge"!==j&&c&&(0,t.jsx)($.Typography,{className:"select-lable",variant:"caption",sx:{fontSize:"10px !important",textWrap:"nowrap",whiteSpace:"nowrap",lineHeight:"120%",textAlign:"left"},children:V(c)}),(0,t.jsx)(I.Stack,{className:`custom-select-selected ${W?"rtl-left":""}`,typography:"mediumBold",direction:"row",sx:{alignItems:"center",justifyContent:"flex-start",flexWrap:"wrap"},children:(U=x,H=e=>(0,t.jsxs)(I.Stack,{className:"selected-item ",direction:"row",sx:{alignItems:"center",lineHeight:"120%"},children:[e?.img&&(0,t.jsx)(k.CustomImg,{src:e.img,style:{width:16,height:16}}),e?.icon&&(0,t.jsx)(r.FontAwesomeIcon,{icon:e.icon,fontSize:16}),"select"===j&&(0,t.jsx)(F.NoSsr,{fallback:(0,t.jsx)(O.WaveLoader,{}),children:e?.labelReactNode?(0,t.jsx)(t.Fragment,{children:e?.labelReactNode}):(0,t.jsx)(t.Fragment,{children:e?.label&&(0,t.jsx)($.Typography,{variant:"smallBold",sx:{maxWidth:280,textWrap:"noWrap",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxHeight:40,textTransform:"capitalize",...!x&&{color:"text.secondary"}},children:er(e?.label)?e?.label:V(e?.label)})})})]}),U?Array.isArray(U)?U?.map((e,a)=>(0,t.jsx)(o.Fragment,{children:H(e)},a)):H(U):s?H(s):(0,t.jsx)(I.Stack,{className:"selected-item",direction:"row",children:V("select_an_option")}))})]}),(0,t.jsx)(I.Stack,{sx:{display:"badge"!==j&&(Y||b)?"flex":"none",alignItems:"center",justifyContent:"center",gap:2,paddingInlineEnd:3,img:{width:16,height:16},svg:{color:"text.primary"}},children:!E&&"badge"!==j&&(Y||b)&&(0,t.jsx)(r.FontAwesomeIcon,{icon:G?a.faChevronUp:a.faChevronDown})})]}),(Y||b)&&(0,t.jsxs)(n.default,{className:`seclect-menu seclect-menu-${j}`,anchorEl:G,open:!!G,onClose:ea,marginThreshold:null,transitionDuration:0,disablePortal:!0,anchorOrigin:et[T].anchorOrigin,transformOrigin:et[T].transformOrigin,slots:{backdrop:D},slotProps:{list:{role:"listbox",sx:{width:Z,height:"100%"}}},sx:{WebkitOverflowScrolling:"touch",".MuiPaper-root":{borderRadius:2,boxShadow:"none",...M&&{bgcolor:M},maxHeight:K,height:{xs:v?.length<10?48*v?.length+2+56*!!R:1,md:v?.length<15?48*v?.length+2+56*!!R:1},border:"1px solid",borderColor:"grey.100",bgcolor:"grey.200",".MuiList-root":{gap:0}}},children:[R&&(0,t.jsx)(I.Stack,{direction:"row",gap:1,alignItems:"center",justifyContent:f?"center":"flex-start",width:1,sx:{height:56,p:1},children:(0,t.jsx)(P.CustomInput,{lang:e,insideLabel:"search",value:Q,onKeyDown:e=>e.stopPropagation(),onChange:e=>{X(e.target.value)}})}),eo?.length<1?(0,t.jsx)(z,{lang:e}):(0,t.jsx)(L.Virtuoso,{className:"custom-select-menu-virt fade-in",style:{height:"100%"},data:eo,components:{Footer:()=>(0,t.jsx)(o.Fragment,{children:b&&(0,t.jsx)(S,{id:`${i}-menu-item-extra-options`,className:`seclect-menuItem seclect-menuItem-${j}`,sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},onClick:w,children:(0,t.jsx)(I.Stack,{className:"seclect-menu-item-wrap fade-in",direction:"row",sx:{width:1,alignItems:"center",p:1,gap:1,textTransform:"capitalize"},children:b})})})},itemContent:(e,a)=>(0,t.jsx)(S,{onClick:()=>{let e;return e=a,void(h&&(e=Array.isArray(x)?x.some(e=>e.value===a.value)?x.length>1?x.filter(e=>e.value!==a.value):x:[...x,e]:x?[x,e]:[e]),C(e),ea())},sx:{gap:1,height:48},children:(0,t.jsxs)(I.Stack,{direction:"row",gap:1,alignItems:"center",justifyContent:f?"center":"flex-start",width:1,children:[a.img&&(0,t.jsx)(k.CustomImg,{src:a.img,alt:"",style:{width:16,height:16}}),a.icon&&(0,t.jsx)(r.FontAwesomeIcon,{icon:a.icon,fontSize:16}),"select"===j&&(0,t.jsx)(F.NoSsr,{fallback:(0,t.jsx)(O.WaveLoader,{}),children:a?.labelReactNode?a?.labelReactNode:(0,t.jsx)(t.Fragment,{children:a.label&&(0,t.jsx)($.Typography,{variant:"smallBold",noWrap:!0,sx:{textTransform:"capitalize"},children:er(a?.label)?a?.label:V(a?.label)})})})]})},a.value??e)})]})]})}],625661)}]); //# debugId=4fcb4c54-58b1-a817-b360-b728b2ea4cb6 //# sourceMappingURL=1475433e10a69029.js.map