UNPKG

ts-buildkit

Version:

Typescript Build Kit, this is generic build kit package created by Ahsan Mahmood (https://aoneahsan.com), this package is generic and contains code which will work both on frontend (ReactJs/typescript/etc) as well as on backend (nodejs/typescript/etc). pl

1 lines 72.8 kB
'use strict';var A=require('crypto-js'),Ce=require('dayjs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var A__default=/*#__PURE__*/_interopDefault(A);var Ce__default=/*#__PURE__*/_interopDefault(Ce);var Ya=Object.defineProperty;var Ke=Object.getOwnPropertySymbols;var Ha=Object.prototype.hasOwnProperty,Za=Object.prototype.propertyIsEnumerable;var me=(e,t,a)=>t in e?Ya(e,t,{enumerable:true,configurable:true,writable:true,value:a}):e[t]=a,h=(e,t)=>{for(var a in t||(t={}))Ha.call(t,a)&&me(e,a,t[a]);if(Ke)for(var a of Ke(t))Za.call(t,a)&&me(e,a,t[a]);return e};var y=null,Te=()=>{var e;if(!y||((e=y==null?void 0:y.trim())==null?void 0:e.length)<=0)throw new Error('ts-buildkit needs "cryptoSecret" value, call "configureZTK" to set that');return y},Fe=e=>{y=e;};var Ja=e=>{let{cryptoSecret:t}=e;Fe(t);};var f=(e,t="Duplicate enumObject value found:")=>{let a=Object.values(e),s=new Set;for(let l of a){if(s.has(l))throw new Error(`${t} ${l}, for enumObject: ${e}`);s.add(l);}};var Ee=e=>{var a;let t=Te();try{return (a=A__default.default.AES.encrypt(JSON.stringify(e),t))==null?void 0:a.toString()}catch(s){return null}},et=e=>{var a;let t=Te();try{return JSON.parse((a=A__default.default.AES.decrypt(e,t))==null?void 0:a.toString(A__default.default.enc.Utf8))}catch(s){return null}},tt=(e,t)=>{var l;let a=(l=A__default.default.AES.encrypt(JSON.stringify(e),t))==null?void 0:l.toString();return A__default.default.enc.Base64.stringify(A__default.default.enc.Utf8.parse(a))},at=(e,t)=>{var l,c;let a=(l=A__default.default.enc.Base64.parse(e))==null?void 0:l.toString(A__default.default.enc.Utf8),s=(c=A__default.default.AES.decrypt(a,t))==null?void 0:c.toString(A__default.default.enc.Utf8);return JSON.parse(s)},rt=(e,t)=>{let a=A__default.default.AES.decrypt(e,t);try{return JSON.parse(a==null?void 0:a.toString(A__default.default.enc.Utf8))}catch(s){return null}};var $=(e,t,a=true)=>{try{let s={err:e,message:`[reportCustomError] - ${t!=null?t:""}`};a&&console.error(s);}catch(s){console.error({err:s});}};var U=(i=>(i.id="id",i.userId="uid",i.sortOrderNo="so",i.createdAt="cat",i.updatedAt="uat",i.deletedAt="dat",i.blockedAt="bat",i.amount="am",i.userData="ud",i.playerId="pid",i.otherPlayerId="opid",i.extraData="ed",i.playerData="pdt",i.name="n",i.email="e",i.phoneNumber="pn",i.password="pw",i.withdrawOptions="wos",i.cnic="cn",i.city="ci",i.country="cu",i.address="ad",i.referredBy="rfb",i.referralCode="rfc",i.permissions="pms",i.emailVerifiedAt="eva",i.balance="blc",i.role="r",i.firstName="fn",i.lastName="lne",i.age="a",i.gender="g",i.constellation="const",i.hometown="ht",i.language="lang",i.profileCompletePercentageNumber="pcpn",i.birthdayDate="bdt",i.aboutMe="abm",i.hobbies="hs",i.lifeStyle="ls",i.music="mc",i.movies="mos",i.travel="tl",i.books="bks",i.gym="gm",i.food="f",i.cleanliness="cln",i.smoke="sk",i.pets="ps",i.guests="gts",i.occupation="o",i.foodPreference="fp",i.workSchedule="ws",i.overnightGuests="ogs",i.getUpTime="gut",i.goToBedTime="gtt",i.roomPreference="rp",i.roommatePreference="rmp",i.whereWantToLive="wwtl",i.moveInDate="mid",i.budget="b",i.placePreference="pp",i.buildingType="bt",i.other="ot",i.min="mi",i.max="ma",i.verificationCode="vc",i.title="t",i.description="d",i.maxPlayersAllowed="mxpa",i.feePerPlayer="fpp",i.serviceCharges="scs",i.image="i",i.minPlayersToStartGame="mipa",i.isPrivate="ipt",i.roomCode="rcd",i.status="st",i.gameId="gid",i.gameRoomPlayerIds="grpsd",i.gameRoomWillStartAt="grwsat",i.firstPlayerGameRoomJoinedAt="fpgrja",i.engagerStartedTheActualGameAt="estaga",i.gameRoomWinnerPlayerId="grwpid",i.gameRoomResultScreenShot="grrss",i.timerForEngagerToStartActualGameInMinutes="tfetsag",i.timerForPlayersToJoinActualGameInMinutes="tfptjag",i.actualGameInfo="agi",i.gameData="gd",i.engagerReleasedGameRoomAt="ergrat",i.engagerDeclaredGameRoomWinnerAt="edgrat",i.agentRemarks="ars",i.transferMethod="tm",i.receptScreenshot="rs",i.transactionId="tid",i.itemId="itid",i.balanceBefore="bb",i.balanceAfter="ba",i.type="ty",i.adminUserId="auid",i.logType="lt",i.userRemarks="urs",i.otherPlayerPhoneNumber="oppn",i.otherPlayerName="opn",i.totalTopupCoins="ttcs",i.totalWithdrawCoins="twcs",i.totalWonCoins="twncs",i.totalTransferredCoins="ttdcs",i.totalReceivedCoins="trcs",i.totalLostCoins="tlcs",i.totalGamesPlayed="tgp",i.totalGamesLeft="tglt",i.totalGamesWon="tgw",i.totalGamesLost="tgl",i.gameWinStreak="gwst",i.gameLostStreak="glst",i.lastGamePlayedAt="lgpat",i.lastGameLeftAt="lglfat",i.lastGameWonAt="lgqat",i.lastGameLostAt="lglat",i.totalGameRoomReleasedForThisPlayer="tgrrftp",i.lastGameRoomReleasedForThisPlayerAt="tgrrftpat",i.totalGameRoomReleasedByThisAdminUser="tgrrbtau",i.lastGameRoomReleasedByThisAdminUserAt="tgrrbtauat",i.totalCoinsEarnedAsGameRoomEngager="tcseagre",i.totalGameRoomsCompletedAsEngager="tgrcae",i.lastGameRoomsCompletedAsEngagerAt="lgrcaeat",i.icon="ic",i.sendAt="sat",i.sendTo="sto",i.specificUsersPhoneNumbers="supns",i.roleIdentifier="ri",i.isDefault="idf",i.totalCount="tc",i.totalSoftDeletedCount="tsdc",i.totalPlayersCount="tpsc",i.totalEngagersCount="tesc",i.totalAdminsCount="tasc",i.totalActiveCount="tac",i.totalBlockedCount="tbc",i.totalCompletedCount="tcc",i.totalReleasedCount="trc",i.totalServiceCharges="tsc",i.period="ped",i.currency="cuy",i.place="pl",i.rent="re",i.generalInfo="gi",i.location="loc",i.images="ims",i.details="dts",i.latitude="lat",i.longitude="lng",i.placeId="pi",i.streetAddress="sa",i.apartmentSuit="as",i.province="pvn",i.postCode="psc",i.bedroomImages="bris",i.washroomImages="wris",i.kitchenImages="kis",i.otherImages="ois",i.availabilityTerm="abt",i.moveOutDate="mud",i.minimumLease="mil",i.houseInfo="hif",i.otherRequirements="ors",i.placeSharingDetail="psd",i.placeBenefits="pbs",i.leaseTime="lti",i.leaseTimeUnit="ltu",i.bedrooms="bds",i.washrooms="wrs",i.parking="pr",i.units="us",i.detail="dl",i.bedroom="br",i.livingRoom="lr",i.kitchen="kc",i.washroom="wr",i.livingWithLandlord="lwld",i.livingWithPersonDetails="lwpd",i.furnished="fh",i.benefits="bs",i.otherBenefits="obs",i.body="bd",i.content="ct",i.fcmDeviceToken="fcmt",i.fcmDeviceTokens="fcmts",i.apnsDeviceToken="apnt",i.apnsDeviceTokens="apnts",i.subtitle="ste",i.tag="tg",i.tags="tgs",i.badge="bge",i.notification="ncn",i.notifications="ncns",i.data="dt",i.clickAction="ca",i.link="ln",i.group="gp",i.groupSummary="gs",i.sound="sd",i.importance="ipe",i.visibility="vsb",i.light="lh",i.lights="lhs",i.lightColor="lcr",i.vibration="vbr",i.channel="cl",i.channels="cls",i.receive="rce",i.value="vle",i.actionId="aid",i.inputValue="ipv",i.gameType="gt",i.thirdPartyAppsData="tpasd",i.thirdPartyAppData="tpad",i.pubgAppId="pgai",i.uniqueId="uqid",i.userUniqueId="uuqid",i.photoURL="pul",i.displayName="dn",i.ludoStarAppId="lsaid",i.freeFireAppId="ffaid",i.callOfDutyAppId="codaid",i.robloxAppId="rxaid",i.eightBallPoolAppId="ebpaid",i.amongUsAppId="auaid",i.unoAppId="uoaid",i.miniMilitiaAppId="mmaid",i.carromAppId="cmaid",i.tennisClashAppId="tcaid",i.chessAppId="chaid",i.asphalt9AppId="a9aid",i.golfBattleAppId="gbaid",i.arenaBreakoutAppId="abaid",i))(U||{}),G=(a=>(a.asc="asc",a.desc="desc",a))(G||{}),Y=(d=>(d.lessThan="<",d.lessThanOrEqualTo="<=",d.equalTo="==",d.notEqual="!=",d.greaterThanOrEqualTo=">=",d.greaterThan=">",d.arrayContains="array-contains",d.inArray="in",d.notInArray="not-in",d.arrayContainsAny="array-contains-any",d))(Y||{});f(U,"Duplicate DBColumnKeysShortFormEnum value found:");f(G,"Duplicate FrbOrderbyDirectionEnum value found:");f(Y,"Duplicate FrbWhereConditionEnum value found:");var H=(w=>(w.success="success",w.failed="failed",w.notFound="notFound",w.badRequest="badRequest",w.serverError="serverError",w.created="created",w.deleted="deleted",w.updated="updated",w.tooManyRequests="tooManyRequests",w.invalidRequest="invalidRequest",w.unAuthenticated="unAuthenticated",w.unAuthorized="unAuthorized",w.itemExists="itemExists",w))(H||{}),Z=(d=>(d[d.success=200]="success",d[d.failed=500]="failed",d[d.notFound=404]="notFound",d[d.badRequest=400]="badRequest",d[d.created=201]="created",d[d.unAuthenticated=401]="unAuthenticated",d[d.unAuthorized=403]="unAuthorized",d[d.tooManyRequests=429]="tooManyRequests",d[d.invalidRequest=410]="invalidRequest",d[d.itemExists=10001]="itemExists",d))(Z||{}),J=(l=>(l.get="get",l.post="post",l.put="put",l.delete="delete",l))(J||{}),X=(t=>(t.blank="_blank",t))(X||{}),Q=(t=>(t.encryptedDataSearchParam="s",t))(Q||{}),q=(a=>(a.Json="application/json",a.FormData="multipart/form-data",a))(q||{}),L=(a=>(a[a.approved=1]="approved",a[a.rejected=2]="rejected",a))(L||{}),W=(a=>(a[a.easypaisa=1]="easypaisa",a[a.jazzcash=2]="jazzcash",a))(W||{}),D=(n=>(n[n.id=1]="id",n[n.roomCode=2]="roomCode",n[n.email=3]="email",n[n.phoneNumber=4]="phoneNumber",n[n.uniqueId=5]="uniqueId",n[n.pubgAppId=6]="pubgAppId",n))(D||{}),P=(a=>(a[a.completed=1]="completed",a[a.rejected=2]="rejected",a))(P||{}),S=(a=>(a[a.true=1]="true",a[a.false=0]="false",a))(S||{}),B=(n=>(n.STRING="string",n.OBJECT="object",n.ARRAY="array",n.boolean="boolean",n.NUMBER="number",n.FUNCTION="function",n))(B||{}),K=(s=>(s.web="web",s.android="android",s.ios="ios",s))(K||{}),z=(g=>(g.Years="years",g.Months="months",g.Days="days",g.Hours="hours",g.Minutes="minutes",g.Seconds="seconds",g.Milliseconds="milliseconds",g))(z||{});f(K,"duplicate values in PlatformTypeEnum");f(H,"duplicate values in ResponseCodeEnum");f(Z,"duplicate values in ResponseStatusEnum");f(J,"duplicate values in RequestTypeEnum");f(X,"duplicate values in LinkTargetEnum");f(Q,"duplicate values in SearchParamKeysEnum");f(q,"duplicate values in RequestContentTypeEnum");f(L,"duplicate values in RequestStatusEnum");f(W,"duplicate values in TransferMethodEnum");f(D,"duplicate values in QueryKeyTypeEnum");f(P,"duplicate values in ProcessStatusEnum");f(S,"duplicate values in BooleanEnum");f(B,"duplicate values in varTypesEnum");f(z,"duplicate values in TimeUnitEnum");var m={authorizationTokenType:{bearer:"Bearer"}},ot={fallbackValue:"---"},it={formate:"DD-MM-YYYY HH:mm A"},st={ISODateTimeFormate:"YYYY-MM-DDTHH:mm",fullDateWithTime12Hour:"MMMM D, h:mm a",compactDateTimeWithAMPM:"DD-MM-YYYY HH:mm A",compactDateWithMonthAbbr:"DD-MMM-YYYY"},lt={googleMapsApiKey:"{{googleMapsApiKey}}"},nt={MINUTES:"minutes"},ct={blank:"_blank"},Ae={generic:{title:{min:{val:1,errorMessage:"Title is required."},max:{val:100,errorMessage:"Title max value can not be greater than 100."},isOptional:false},description:{short:{max:{val:250,errorMessage:"Description max value allowed is 250 characters."},isOptional:true},medium:{max:{val:500,errorMessage:"Description max value allowed is 500 characters."},isOptional:true}},phoneNumber:{min:{val:12,errorMessage:"Phone number min value allowed is 13 characters."},max:{val:13,errorMessage:"Phone number max value allowed is 13 characters."},startWith:{val:"+923",errorMessage:"Phone number must start with +923"},isOptional:false},remarks:{short:{max:{val:250,errorMessage:"Remarks max value allowed is 250 characters."},isOptional:true},medium:{max:{val:500,errorMessage:"Remarks max value allowed is 500 characters."},isOptional:true}},verificationCode:{length:{val:6,errorMessage:"Verification code must contain exactly 6 character(s)"}}}},F=["image/svg","image/svg+xml"],_=["image/png","image/jpeg","image/gif"];var dt=()=>{var a,s,l;let e=(a=Date.now())==null?void 0:a.toString(36),t=(l=(s=Math.random())==null?void 0:s.toString(36))==null?void 0:l.substr(2);return e+t},pt=()=>{console.info({message:"emptyVoidReturnFunction"});},gt=async()=>{console.info({message:"emptyVoidReturnFunction"});},ft=e=>JSON.stringify(e),ut=e=>{try{return JSON.parse(e)}catch(t){return}},O=e=>{var t;return e!=null&&((t=e==null?void 0:e.trim())==null?void 0:t.length)>0},vt=e=>e==null?void 0:e.every(a=>O(a)),Ie=(e,t=false)=>{let a=Number(e);return isNaN(a)?false:t?a>0:true},bt=(e,t=false)=>e==null?void 0:e.every(a=>Ie(a,t)),ht=e=>{var t;return (t=e==null?void 0:e.replace(/([a-z])([A-Z])/g,"$1 $2"))==null?void 0:t.toLowerCase()},wt=e=>Ue(e)?e==null?void 0:e.replace(/^_*(.)|_+(.)/g,(t,a,s)=>a?a==null?void 0:a.toUpperCase():" "+(s==null?void 0:s.toUpperCase())):e,Tt=(e,t)=>e>0&&t>0?Math.ceil(e/t):0,At=async(e,t)=>{try{if(e!==void 0&&O(e)){if(typeof fetch=="undefined")throw new Error("imageUrlToBase64: fetch API is not available in this environment");let a=new Headers({"Content-Type":"application/json",Authorization:`${m.authorizationTokenType.bearer} ${t!=null?t:""}`}),s=new Request(e,{method:"GET",headers:a}),l=await fetch(s);if(!l.ok)throw new Error(`Failed to fetch image. Status: ${l.status}`);let c=await l.blob();return await new Promise((g,u)=>{let b=new FileReader;b.onloadend=()=>{g(b.result);},b.onerror=d=>{u(d);},b.readAsDataURL(c);})}return ""}catch(a){return console.error("Error fetching or converting image:",a),""}},It=({url:e,itemsId:t,urlDynamicParts:a})=>{var l,c;if((t==null?void 0:t.length)!==(a==null?void 0:a.length))throw new Error("itemsId and urlDynamicParts must have the same length.");let s=e;for(let n=0;n<(a==null?void 0:a.length);n++){let g=String(a[n]);if((l=String(s))!=null&&l.includes(g)){let u=String(t[n]);s=(c=String(s))==null?void 0:c.replace(g,u);}}return s},xt=e=>{switch(e){case "true":return true;case "false":return false;default:return !!e}},Rt=(e=6)=>{let t="abcdefghijklmnopqrstuvwxyz0123456789",a="";for(let s=0;s<e;s++){let l=Math.floor(Math.random()*(t.length));a+=t[l];}return a==null?void 0:a.toLowerCase()},_t=e=>{let a=h(h({},{length:6,charset:"alphanumeric",customCharset:"",lowercase:true,uppercase:false,excludeAmbiguous:false,prefix:"",suffix:"",segments:1,segmentSeparator:"-"}),e),s={numeric:"0123456789",alphabetic:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",alphanumeric:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",custom:a.customCharset||""},l=s[a.charset||"alphanumeric"]||s.alphanumeric;a.excludeAmbiguous&&(l=l.replace(/[0O1lI]/g,""));let c=[],n=a.segments||1,g=a.length||6,u=Math.floor(g/n);for(let d=0;d<n;d++){let T="",we=d===n-1?g-u*(n-1):u;for(let w=0;w<we;w++){let $a=Math.floor(Math.random()*l.length);T+=l[$a];}a.lowercase&&!a.uppercase?T=T.toLowerCase():a.uppercase&&!a.lowercase&&(T=T.toUpperCase()),c.push(T);}let b=c.join(a.segmentSeparator||"-");return `${a.prefix||""}${b}${a.suffix||""}`},xe=e=>e==null,yt=e=>!xe(e),Ut=(...e)=>{},E=(e,t=false)=>{let a=k(e,false)&&Array.isArray(e);return t?a&&!!(e!=null&&e.length):a},Vt=({item:e})=>typeof e.dat=="number",Ot=({item:e})=>typeof e.bat=="number",kt=({key:e,item:t})=>{let a=t==null?void 0:t[e];if(a)return ae(a)},Ct=(e,t)=>(e.search(/^http[s]?:\/\//)===-1&&(e=(t?"http://":"https://")+e),e),k=(e,t=true)=>{var s;let a=typeof e=="object"&&e!=null&&typeof e!="undefined";return t?a&&!!((s=Object.keys(e))!=null&&s.length):a},Mt=e=>{if(!k(e))return {};let t={};for(let a in e)t.field=a,t.values=e[a];return E(t.values)?t:{}},Nt=(e,t)=>{var a;return (t==null?void 0:t.field)===e?(a=t.values)!=null?a:[]:[]},Gt=e=>new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+#]*)*(\\?[;&a-z\\d%_.~+#=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e),qt=({domain:e,url:t})=>{var l;let a=(l=t==null?void 0:t.trim())==null?void 0:l.toLowerCase();return a==="www"||a===e?false:/^((?!.*[-]{2})(?=.*[a-z0-9]$)[a-z0-9][a-z0-9-]*$)+/.test(t)},Lt=e=>/[^A-Za-z0-9&,'"""'\'-(){} ]+/.test(e),Wt=({options:e={},text:t})=>{if(!t)return;let{lowercase:a=true,separator:s="-",trim:l=true}=e,c={\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00F1:"n",\u00E7:"c",\u00DF:"ss",\u00E6:"ae",\u0153:"oe"},n=t.trim();n=n.replace(/[àáâãäåèéêëìíîïòóôõöøùúûüñçßæœ]/gi,b=>{let d=b.toLowerCase();return c[d]||b}),n=n.replace(/[^a-z0-9]/gi,s);let g=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=new RegExp(`${g}+`,"g");if(n=n.replace(u,s),a&&(n=n.toLowerCase()),l){let b=new RegExp(`^${g}|${g}$`,"g");n=n.replace(b,"");}return n},Dt=({input:e,type:t})=>{if(!e)return {isValid:true,invalidChars:[],validatedValue:""};let a;if(t==="email")a=/[^\w.!#$%&'*+/=?^`{|}~@-]/g;else if(t==="name")a=/[<>\\^`{|}~]/g;else return {isValid:true,invalidChars:[],validatedValue:e};let s=e.match(a),l=s?[...new Set(s)]:[],c=e.replace(a,"");return {isValid:l.length===0,invalidChars:l,validatedValue:c}},St=e=>new Promise((t,a)=>{let s=new FileReader;s.readAsDataURL(e),s.onload=()=>t(s.result),s.onerror=l=>a(l);}),zt=e=>{let t=["?","&","#"];return e&&(t==null?void 0:t.some(a=>e==null?void 0:e.includes(a)))},jt=(e,t,a=null,s=true)=>Re(e,t,s)?e[t]:a,Re=(e,t,a=false)=>k(e,true)&&Object.hasOwnProperty.call(e,t)&&e[t]!==void 0?a?e[t]!==null:true:false,_e=(e,t)=>{if(e===t)return true;if(!(e instanceof Object)||!(t instanceof Object)||e.constructor!==t.constructor)return false;for(let a in e)if(Object.hasOwnProperty.call(e,a)){if(!Object.hasOwnProperty.call(t,a))return false;if(e[a]!==t[a]&&(typeof e[a]!="object"||!_e(e[a],t[a])))return false}for(let a in t)if(Object.hasOwnProperty.call(t,a)&&!Object.hasOwnProperty.call(e,a))return false;return true},V=e=>e*Math.PI/180,$t=(e,t,a,s)=>{let c=V(a-e),n=V(s-t);e=V(e),a=V(a);let g=Math.sin(c/2)*Math.sin(c/2)+Math.sin(n/2)*Math.sin(n/2)*Math.cos(e)*Math.cos(a);return 6371*(2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)))},Yt=(e,t=10)=>{var a;return e?(e==null?void 0:e.length)>t?`${(a=e==null?void 0:e.slice(0,t))!=null?a:""}...`:e!=null?e:"":""},Ht=(e,t)=>{let s=h(h({},{length:10,ellipsis:"...",position:"end",preserveWords:false}),t),l=s.length||10,c=s.ellipsis||"...";if(!e||e.length<=l)return e||"";if(s.position==="middle"){let g=Math.floor((l-c.length)/2),u=e.slice(0,g),b=e.slice(-g);return `${u}${c}${b}`}if(s.position==="start")return `${c}${e.slice(-(l-c.length))}`;let n=e.slice(0,l-c.length);if(s.preserveWords||s.wordBoundary){let g=n.lastIndexOf(" ");g>0&&(n=n.slice(0,g));}return `${n}${c}`},Zt=()=>{if(!te())return {webkitVer:0,isGoogle:0,isAndroid:0,androidDesktopMode:0};let e=/WebKit\/([0-9]+)|$/.exec(navigator.appVersion),t=e?parseInt(e[1],10):0,a=t&&navigator.vendor.indexOf("Google")===0,s=a&&navigator.userAgent.indexOf("Android")>0,l=!s&&a&&navigator.platform.indexOf("Linux")===0&&"ontouchstart"in document.documentElement;return {webkitVer:t,isGoogle:a,isAndroid:s,androidDesktopMode:l}},Jt=(e,t)=>e==null?void 0:e.every(s=>t==null?void 0:t.includes(s)),Xt=(e,t="svg")=>{var a,s,l,c;return t==="svg"?(s=F)==null?void 0:s.includes((a=e==null?void 0:e.type)==null?void 0:a.toLowerCase()):t==="other"?(c=_)==null?void 0:c.includes((l=e==null?void 0:e.type)==null?void 0:l.toLowerCase()):false},ye=(e,t)=>{var c;if(!e||!e.type)return false;let a={allowedTypes:[..._],caseInsensitive:true,allowWildcard:false},s=h(h({},a),t),l=s.caseInsensitive?e.type.toLowerCase():e.type;return ((c=s.allowedTypes)==null?void 0:c.some(n=>{let g=s.caseInsensitive?n.toLowerCase():n;if(s.allowWildcard&&g.includes("*")){let[u]=g.split("*");return l.startsWith(u)}return l===g}))||false},Qt=async e=>e?te()?await new Promise(t=>{let a=document.createElement("img"),s=window.URL.createObjectURL(e),l,c;a.onload=function(n){let g=n==null?void 0:n.target;l=g.naturalHeight,c=g.naturalWidth,URL.revokeObjectURL(s),t({width:c,height:l});},a.src=s;}):(console.warn("getImageDimensions: This function requires a browser environment"),null):null,Pt=(e,t)=>e===t?[1,1]:e>t?[Math.round(e/t),Math.round(t/t)]:e<t?[Math.round(e/e),Math.round(t/e)]:null,ee=(e,t="string")=>{switch(t){case "string":return typeof e=="string"&&typeof e!="undefined";case "number":return typeof e=="number"&&typeof e!="undefined";case "boolean":return typeof e=="boolean"&&typeof e!="undefined";case "object":return k(e,true);case "array":return E(e,true);case "function":return typeof e=="function"&&typeof e!="undefined";case "undefined":return typeof e=="undefined";default:return false}},Ue=e=>ee(e,"string"),Bt=e=>ee(e,"function"),Ve=e=>{var t,a;return (a=_)==null?void 0:a.includes((t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())};var Kt=({file:e,sizeLimit:t})=>parseFloat(`${e.size/1024/1024}`)>t?{status:"error",type:"FILE_SIZE_LIMIT"}:Ve(e)?{status:"success",type:"SUCCESS"}:{status:"error",type:"INVALID_FILE_TYPE"},mt=(e,t)=>{let a={maxSize:5,allowedTypes:[..._],errorMessages:{fileSize:"File size exceeds the maximum allowed size",fileType:"File type is not allowed",custom:"File validation failed"}},s=h(h({},a),t),l=h(h({},a.errorMessages),t==null?void 0:t.errorMessages),c=e.size/1024/1024;if(s.maxSize&&c>s.maxSize)return {status:"error",type:"FILE_SIZE_LIMIT",message:l.fileSize};if(!ye(e,{allowedTypes:s.allowedTypes,caseInsensitive:true,allowWildcard:true}))return {status:"error",type:"INVALID_FILE_TYPE",message:l.fileType};if(s.customValidator){let g=s.customValidator(e);if(g!==true)return {status:"error",type:"CUSTOM_ERROR",message:typeof g=="string"?g:l.custom}}return {status:"success",type:"SUCCESS"}},Ft=e=>{var a;let t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e&&(t==null?void 0:t.test((a=String(e))==null?void 0:a.toLowerCase()))},Et=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,a=e==="x"?t:t&3|8;return a==null?void 0:a.toString(16)}),Oe=e=>e.reduce((t,a)=>t.concat(Array.isArray(a)?Oe(a):a),[]),ea=(e,t)=>{let a=e==null?void 0:e.toLowerCase(),s=Object.entries(t).find(([l,c])=>{var n;return ((n=String(c))==null?void 0:n.toLowerCase())===a});return s?s[1]:null},ta=(e,t)=>(typeof t=="string"?new RegExp(t):t).test(e),aa=e=>{var t,a,s;return e&&((s=(a=(t=e==null?void 0:e.toLowerCase())==null?void 0:t.replace(/[^\w ]+/g,""))==null?void 0:a.trim())==null?void 0:s.replace(/ +/g,""))},ra=({pagination:e,returnDefaultValues:t=true,defaultOffset:a=0,defaultLimit:s=10})=>{var n,g;let l=t?a:null,c=t?s:null;return e&&(l=(n=e==null?void 0:e.offset)!=null?n:l,c=(g=e==null?void 0:e.limit)!=null?g:c),{offset:l,limit:c}},oa=(e="")=>{var t;return {$regex:new RegExp((t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase(),"i")}},ia=e=>`$${(e/100).toFixed(2)}`,sa=(e,t)=>{let s=h(h({},{currency:"USD",symbol:"$",divideBy:100,decimalPlaces:2,thousandsSeparator:",",decimalSeparator:".",symbolPosition:"before",includeSpace:false}),t),c=(e/(s.divideBy||100)).toFixed(s.decimalPlaces||2);if(s.thousandsSeparator){let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,s.thousandsSeparator),c=u.join(s.decimalSeparator||".");}let n=s.includeSpace?" ":"",g=s.symbol||"$";return s.symbolPosition==="before"?`${g}${n}${c}`:`${c}${n}${g}`},la=e=>parseFloat(e)*100,ke=({input:e,characters:t="\\",onlyLeading:a=false,onlyTrailing:s=false,trimWhitespace:l=false})=>{if(!e||typeof e!="string")return "";let c=l?e.trim():e;if(!c)return "";let g=(Array.isArray(t)?t:[t]).filter(b=>b&&typeof b=="string").map(b=>b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("");if(!g)return c;let u="";if(s||(u+=`^[${g}]+`),!a&&!s&&(u+="|"),a||(u+=`[${g}]+$`),u){let b=new RegExp(u,"g");c=c.replace(b,"");}return c},na=e=>/^\/|\/$/.test(e),ca=({input:e,removeLeadingTrailing:t=false})=>{if(!e)return "";let a=e.replace(/[*?^${}()|[\]\\/-]/g,"");return t?ke({input:a}):a},da=e=>e.replace(/([A-Z])/g," $1").toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ").trim(),pa=({valueUnit:e,value:t,outputUnit:a})=>{let s=t;switch(e){case "years":s=t*365*24*60*60;break;case "months":s=t*30*24*60*60;break;case "days":s=t*24*60*60;break;case "hours":s=t*60*60;break;case "minutes":s=t*60;break;case "seconds":s=t;break;case "milliseconds":s=t/1e3;break}switch(a){case "years":return s/(365*24*60*60);case "months":return s/(30*24*60*60);case "days":return s/(24*60*60);case "hours":return s/(60*60);case "minutes":return s/60;case "seconds":return s;case "milliseconds":return s*1e3;default:return s}},te=()=>typeof window!="undefined"&&typeof document!="undefined"&&typeof navigator!="undefined",ga=({email:e="",pattern:t=/^[a-zA-Z0-9._%+-]+@privaterelay\.appleid\.com$/})=>t.test(e);var ae=e=>{var t;return (t=new Date(e))==null?void 0:t.toISOString()},fa=({val:e})=>{var a;let t=Ce__default.default(e);return e&&(t!=null&&t.isValid())?(a=t==null?void 0:t.toDate())==null?void 0:a.getTime():null},ua=e=>{try{if(O(e)){let t=Ce__default.default(e);if(t!=null&&t.isValid()){let a=t==null?void 0:t.diff(Ce__default.default(new Date),"milliseconds");return Date.now()+a}else return 0}else return 0}catch(t){return $(t),0}};var va={authToken:"x-auth-token",authorization:"authorization",contentType:"content-type",accept:"accept"};var ba={limit:100,offset:0,orderBy:{fieldKey:"cat",order:"desc"}};var ha={mdScale:"768px",lgScale:"1000px",smScale:"767px",xsScale:"450px",xxsScale:"359px",maxMobile:"600px",width340:"340px",smallMobile:"300px",mediumMobile:"500px",largeMobile:"575px",width430:"430px",width270:"270px",width250:"250px",width200:"200px",width170:"170px",minTablet:"870px",largeScreen:"1050px",extraLargeScreen:"900px"};var C=(u=>(u[u.superAdmin=1]="superAdmin",u[u.admin=2]="admin",u[u.manager=3]="manager",u[u.editor=4]="editor",u[u.creator=5]="creator",u[u.reviewer=6]="reviewer",u[u.player=7]="player",u[u.engager=8]="engager",u))(C||{}),x=(r=>(r[r.viewDashboard=1]="viewDashboard",r[r.hideEarnings=2]="hideEarnings",r[r.hideProfile=3]="hideProfile",r[r.listUsers=4]="listUsers",r[r.viewUser=5]="viewUser",r[r.createUser=6]="createUser",r[r.updateUser=7]="updateUser",r[r.deleteUser=8]="deleteUser",r[r.forceDeleteUser=9]="forceDeleteUser",r[r.blockUser=10]="blockUser",r[r.unBlockUser=11]="unBlockUser",r[r.updateUserBalance=12]="updateUserBalance",r[r.viewTrashedUsers=13]="viewTrashedUsers",r[r.viewTrashedUser=14]="viewTrashedUser",r[r.listGames=15]="listGames",r[r.viewGame=16]="viewGame",r[r.createGame=17]="createGame",r[r.updateGame=18]="updateGame",r[r.deleteGame=19]="deleteGame",r[r.forceDeleteGame=20]="forceDeleteGame",r[r.blockGame=21]="blockGame",r[r.unBlockGame=22]="unBlockGame",r[r.viewTrashedGames=23]="viewTrashedGames",r[r.viewTrashedGame=24]="viewTrashedGame",r[r.listGameRooms=25]="listGameRooms",r[r.viewGameRoom=26]="viewGameRoom",r[r.createGameRoom=27]="createGameRoom",r[r.updateGameRoom=28]="updateGameRoom",r[r.deleteGameRoom=29]="deleteGameRoom",r[r.forceDeleteGameRoom=30]="forceDeleteGameRoom",r[r.blockGameRoom=31]="blockGameRoom",r[r.unBlockGameRoom=32]="unBlockGameRoom",r[r.createPrivateGameRoom=33]="createPrivateGameRoom",r[r.viewTrashedGameRooms=34]="viewTrashedGameRooms",r[r.viewTrashedGameRoom=35]="viewTrashedGameRoom",r[r.listTopupRequests=36]="listTopupRequests",r[r.viewTopupRequest=37]="viewTopupRequest",r[r.createTopupRequest=38]="createTopupRequest",r[r.updateTopupRequest=39]="updateTopupRequest",r[r.deleteTopupRequest=40]="deleteTopupRequest",r[r.forceDeleteTopupRequest=41]="forceDeleteTopupRequest",r[r.reviewTopupRequest=42]="reviewTopupRequest",r[r.viewTrashedTopupRequests=43]="viewTrashedTopupRequests",r[r.viewTrashedTopupRequest=44]="viewTrashedTopupRequest",r[r.listWithdrawRequests=45]="listWithdrawRequests",r[r.viewWithdrawRequest=46]="viewWithdrawRequest",r[r.createWithdrawRequest=47]="createWithdrawRequest",r[r.updateWithdrawRequest=48]="updateWithdrawRequest",r[r.deleteWithdrawRequest=49]="deleteWithdrawRequest",r[r.forceDeleteWithdrawRequest=50]="forceDeleteWithdrawRequest",r[r.reviewWithdrawRequest=51]="reviewWithdrawRequest",r[r.viewTrashedWithdrawRequests=52]="viewTrashedWithdrawRequests",r[r.viewTrashedWithdrawRequest=53]="viewTrashedWithdrawRequest",r[r.listRoles=54]="listRoles",r[r.viewRole=55]="viewRole",r[r.createRole=56]="createRole",r[r.updateRole=57]="updateRole",r[r.deleteRole=58]="deleteRole",r[r.forceDeleteRole=59]="forceDeleteRole",r[r.reviewRole=60]="reviewRole",r[r.viewTrashedRoles=61]="viewTrashedRoles",r[r.viewTrashedRole=62]="viewTrashedRole",r[r.attachRole=63]="attachRole",r[r.removeRole=64]="removeRole",r[r.addListPermissionsToRole=65]="addListPermissionsToRole",r[r.addViewPermissionsToRole=66]="addViewPermissionsToRole",r[r.addCreatePermissionsToRole=67]="addCreatePermissionsToRole",r[r.addUpdatePermissionsToRole=68]="addUpdatePermissionsToRole",r[r.addForceDeletePermissionsToRole=69]="addForceDeletePermissionsToRole",r[r.addListTrashedPermissionsToRole=70]="addListTrashedPermissionsToRole",r[r.addViewTrashedPermissionsToRole=71]="addViewTrashedPermissionsToRole",r[r.addReviewPermissionsToRole=72]="addReviewPermissionsToRole",r[r.addOtherPermissionsToRole=73]="addOtherPermissionsToRole",r[r.listTransferCoinsRequests=74]="listTransferCoinsRequests",r[r.viewTransferCoinsRequest=75]="viewTransferCoinsRequest",r[r.listInAppNotifications=76]="listInAppNotifications",r[r.viewInAppNotification=77]="viewInAppNotification",r[r.createInAppNotification=78]="createInAppNotification",r[r.updateInAppNotification=79]="updateInAppNotification",r[r.deleteInAppNotification=80]="deleteInAppNotification",r[r.forceDeleteInAppNotification=81]="forceDeleteInAppNotification",r[r.viewTrashedInAppNotifications=82]="viewTrashedInAppNotifications",r[r.viewTrashedInAppNotification=83]="viewTrashedInAppNotification",r[r.sendInAppNotificationToAllPlayers=84]="sendInAppNotificationToAllPlayers",r[r.sendInAppNotificationToAllAdminLevelUsers=85]="sendInAppNotificationToAllAdminLevelUsers",r[r.sendInAppNotificationToSpecificPlayers=86]="sendInAppNotificationToSpecificPlayers",r[r.sendInAppNotificationToSpecificAdminLevelUsers=87]="sendInAppNotificationToSpecificAdminLevelUsers",r[r.scheduleInAppNotifications=88]="scheduleInAppNotifications",r[r.listAttachments=89]="listAttachments",r[r.viewAttachment=90]="viewAttachment",r[r.createAttachment=91]="createAttachment",r[r.updateAttachment=92]="updateAttachment",r[r.deleteAttachment=93]="deleteAttachment",r[r.forceDeleteAttachment=94]="forceDeleteAttachment",r[r.viewTrashedAttachments=95]="viewTrashedAttachments",r[r.viewTrashedAttachment=96]="viewTrashedAttachment",r[r.listAppSettings=97]="listAppSettings",r[r.viewAppSetting=98]="viewAppSetting",r[r.createAppSetting=99]="createAppSetting",r[r.updateAppSetting=100]="updateAppSetting",r[r.deleteAppSetting=101]="deleteAppSetting",r[r.forceDeleteAppSetting=102]="forceDeleteAppSetting",r[r.viewTrashedAppSettings=103]="viewTrashedAppSettings",r[r.viewTrashedAppSetting=104]="viewTrashedAppSetting",r[r.listTransactions=105]="listTransactions",r[r.viewTransaction=106]="viewTransaction",r[r.createTransaction=107]="createTransaction",r[r.updateTransaction=108]="updateTransaction",r[r.deleteTransaction=109]="deleteTransaction",r[r.forceDeleteTransaction=110]="forceDeleteTransaction",r[r.viewTrashedTransactions=111]="viewTrashedTransactions",r[r.viewTrashedTransaction=112]="viewTrashedTransaction",r[r.listPlaces=113]="listPlaces",r[r.viewPlace=114]="viewPlace",r[r.createPlace=115]="createPlace",r[r.updatePlace=116]="updatePlace",r[r.deletePlace=117]="deletePlace",r[r.forceDeletePlace=118]="forceDeletePlace",r[r.viewTrashedPlaces=119]="viewTrashedPlaces",r[r.viewTrashedPlace=120]="viewTrashedPlace",r[r.restoreTrashedPlace=121]="restoreTrashedPlace",r[r.blockPlace=122]="blockPlace",r[r.unBlockPlace=123]="unBlockPlace",r[r.restoreTrashedUser=124]="restoreTrashedUser",r[r.restoreTrashedGame=125]="restoreTrashedGame",r[r.restoreTrashedGameRoom=126]="restoreTrashedGameRoom",r[r.restoreTrashedTopupRequest=127]="restoreTrashedTopupRequest",r[r.restoreTrashedWithdrawRequest=128]="restoreTrashedWithdrawRequest",r[r.restoreTrashedRole=129]="restoreTrashedRole",r[r.restoreTrashedInAppNotification=130]="restoreTrashedInAppNotification",r[r.restoreTrashedAttachment=131]="restoreTrashedAttachment",r[r.restoreTrashedAppSetting=132]="restoreTrashedAppSetting",r[r.restoreTrashedTransaction=133]="restoreTrashedTransaction",r[r.addCoinsToUserAccount=134]="addCoinsToUserAccount",r[r.removeCoinsFromUserAccount=135]="removeCoinsFromUserAccount",r[r.listAdminCoinsUpdateLogs=136]="listAdminCoinsUpdateLogs",r[r.viewAdminCoinsUpdateLog=137]="viewAdminCoinsUpdateLog",r[r.listUserDetails=138]="listUserDetails",r[r.viewUserDetail=139]="viewUserDetail",r[r.createUserDetail=140]="createUserDetail",r[r.updateUserDetail=141]="updateUserDetail",r[r.deleteUserDetail=142]="deleteUserDetail",r[r.forceDeleteUserDetail=143]="forceDeleteUserDetail",r[r.viewTrashedUserDetails=144]="viewTrashedUserDetails",r[r.viewTrashedUserDetail=145]="viewTrashedUserDetail",r))(x||{}),M=(u=>(u.superAdmin="197g24g-28h3v2g9g972g3f",u.admin="28h3v2g9g9--72g3f",u.manager="38h3vrv3-ion2g9g97-2g3f",u.editor="48h3v2g9g97-2g3f",u.creator="58h3v2g9g8h-972g3f",u.reviewer="68h-3v2g9g972g3f",u.player="78h3v2g9-g972g3f",u.engager="8hfrfr----8h3v2g9-g972g3f",u))(M||{}),re=(s=>(s[s.viewTrashedItem=1]="viewTrashedItem",s[s.viewTrashedItems=2]="viewTrashedItems",s[s.viewBlockedItem=3]="viewBlockedItem",s))(re||{}),j=(a=>(a[a.every=1]="every",a[a.any=2]="any",a))(j||{});f(C,"Duplicate RoleEnum value found:");f(j,"Duplicate PermissionCheckModeEnum value found:");f(x,"Duplicate PermissionEnum value found:");f(M,"Duplicate _UserRoleEnum value found:");f(re,"Duplicate PermissionTypeEnum value found:");var wa=[{value:1,label:"View dashboard"},{value:2,label:"Hide earnings"},{value:3,label:"Hide profile"},{value:4,label:"List users"},{value:5,label:"View user"},{value:6,label:"Create user"},{value:7,label:"Update user"},{value:8,label:"Delete user"},{value:9,label:"Force delete user"},{value:10,label:"Block user"},{value:11,label:"Unblock user"},{value:12,label:"Update user balance"},{value:13,label:"View trashed users"},{value:14,label:"View trashed user"},{value:15,label:"List games"},{value:16,label:"View game"},{value:17,label:"Create game"},{value:18,label:"Update game"},{value:19,label:"Delete game"},{value:20,label:"Force delete game"},{value:21,label:"Block game"},{value:22,label:"Unblock game"},{value:23,label:"View trashed games"},{value:24,label:"View trashed game"},{value:25,label:"List game rooms"},{value:26,label:"View game room"},{value:27,label:"Create game room"},{value:28,label:"Update game room"},{value:29,label:"Delete game room"},{value:30,label:"Force delete game room"},{value:31,label:"Block game room"},{value:32,label:"Unblock game room"},{value:33,label:"Create private game room"},{value:34,label:"View trashed game rooms"},{value:35,label:"View trashed game room"},{value:36,label:"List top-up requests"},{value:37,label:"View top-up request"},{value:38,label:"Create top-up request"},{value:39,label:"Update top-up request"},{value:40,label:"Delete top-up request"},{value:41,label:"Force delete top-up request"},{value:42,label:"Review top-up request"},{value:43,label:"View trashed top-up requests"},{value:44,label:"View trashed top-up request"},{value:45,label:"List withdraw requests"},{value:46,label:"View withdraw request"},{value:47,label:"Create withdraw request"},{value:48,label:"Update withdraw request"},{value:49,label:"Delete withdraw request"},{value:50,label:"Force delete withdraw request"},{value:51,label:"Review withdraw request"},{value:52,label:"View trashed withdraw requests"},{value:53,label:"View trashed withdraw request"},{value:54,label:"List roles"},{value:55,label:"View role"},{value:56,label:"Create role"},{value:57,label:"Update role"},{value:58,label:"Delete role"},{value:59,label:"Force delete role"},{value:60,label:"Review role"},{value:61,label:"View trashed roles"},{value:62,label:"View trashed role"},{value:63,label:"Attach role"},{value:64,label:"Remove role"},{value:65,label:"Add list permissions to role"},{value:66,label:"Add view permissions to role"},{value:67,label:"Add create permissions to role"},{value:68,label:"Add update permissions to role"},{value:69,label:"Add force delete permissions to role"},{value:70,label:"Add list trashed permissions to role"},{value:71,label:"Add view trashed permissions to role"},{value:72,label:"Add review permissions to role"},{value:73,label:"Add other permissions to role"},{value:74,label:"List transfer coins requests"},{value:75,label:"View transfer coins request"},{value:76,label:"List in-app notifications"},{value:77,label:"View in-app notification"},{value:78,label:"Create in-app notification"},{value:79,label:"Update in-app notification"},{value:80,label:"Delete in-app notification"},{value:81,label:"Force delete in-app notification"},{value:82,label:"View trashed in-app notifications"},{value:83,label:"View trashed in-app notification"},{value:84,label:"Send in-app notification to all players"},{value:85,label:"Send in-app notification to all admin users"},{value:86,label:"Send in-app notification to specific players"},{value:87,label:"Send in-app notification to specific admin users"},{value:88,label:"Schedule in-app notifications"},{value:89,label:"List attachments"},{value:90,label:"View attachment"},{value:91,label:"Create attachment"},{value:92,label:"Update attachment"},{value:93,label:"Delete attachment"},{value:94,label:"Force delete attachment"},{value:95,label:"View trashed attachments"},{value:96,label:"View trashed attachment"},{value:97,label:"List app settings"},{value:98,label:"View app setting"},{value:99,label:"Create app setting"},{value:100,label:"Update app setting"},{value:101,label:"Delete app setting"},{value:102,label:"Force delete app setting"},{value:103,label:"View trashed app settings"},{value:104,label:"View trashed app setting"},{value:105,label:"List transactions"},{value:106,label:"View transaction"},{value:107,label:"Create transaction"},{value:108,label:"Update transaction"},{value:109,label:"Delete transaction"},{value:110,label:"Force delete transaction"},{value:111,label:"View trashed transactions"},{value:112,label:"View trashed transaction"}];var Ta,Me=(Ta=Object.keys(x))==null?void 0:Ta.filter(e=>isNaN(Number(e))),I=(e=[],t=[])=>{var l;let a=e==null?void 0:e.map(c=>c==null?void 0:c.toLowerCase()),s=t==null?void 0:t.map(c=>c==null?void 0:c.toLowerCase());return (l=Me==null?void 0:Me.filter(c=>{let n=c==null?void 0:c.toLowerCase();return (s==null?void 0:s.length)>0&&(s!=null&&s.includes(n))?true:!(a!=null&&a.some(g=>n==null?void 0:n.includes(g)))}))==null?void 0:l.map(c=>x[c])},Aa=e=>{switch(e){case "197g24g-28h3v2g9g972g3f":return 1;case "28h3v2g9g9--72g3f":return 2;case "38h3vrv3-ion2g9g97-2g3f":return 3;case "48h3v2g9g97-2g3f":return 4;case "58h3v2g9g8h-972g3f":return 5;case "68h-3v2g9g972g3f":return 6;case "8hfrfr----8h3v2g9-g972g3f":return 8;default:return 7}},Ia=e=>{var a;let t=(a=Array.from(new Set(e)))==null?void 0:a.filter(s=>s>0);return t==null?void 0:t.map(s=>x[s])},N=({permission:e,userPermissions:t})=>t==null?void 0:t.includes(e),Ne=({userPermissions:e,requiredPermissions:t=[],checkModeForRequiredPermissions:a=1})=>!t||(t==null?void 0:t.length)===0?true:a===1?t==null?void 0:t.every(s=>N({userPermissions:e,permission:s})):t==null?void 0:t.some(s=>N({userPermissions:e,permission:s})),Ge=({userPermissions:e,excludedPermissions:t=[],checkModeForExcludedPermissions:a=1})=>!t||(t==null?void 0:t.length)===0?true:!(a===1?t!=null&&t.every(s=>N({userPermissions:e,permission:s})):t!=null&&t.some(s=>N({userPermissions:e,permission:s}))),xa=({userPermissions:e,requiredPermissions:t=[],excludedPermissions:a=[],checkModeForRequiredPermissions:s=1,checkModeForExcludedPermissions:l=1})=>!!(Ne({userPermissions:e,checkModeForRequiredPermissions:s,requiredPermissions:t})&&Ge({userPermissions:e,excludedPermissions:a,checkModeForExcludedPermissions:l}));var Ra=["role","permission","forcedelete","trashed","transaction","appsetting","inappnotification","restore","addcoin","removecoin","admincoin"],ie=[...Ra,"user","delete","topuprequest","withdrawrequest","transfercoinsrequest"],Xa=[...ie,"block"],oe=[...ie,"edit","update","review"],Qa=[...oe==null?void 0:oe.filter(e=>e!=="review"),"create","add","hide"],Pa=[...ie,"review","user","hide"],Ba=["createPrivateGameRoom"],_a={1:()=>I([]),2:()=>I(Ra),3:()=>I(ie),4:()=>I(Xa),5:()=>I(oe),6:()=>I(Qa),7:()=>[],8:()=>I(Pa,Ba)};var ya=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),Ua=e=>/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i.test(e),Va=e=>/^\+?[1-9]\d{1,14}$/.test(e);var Oa={general:{success:"Request Completed",failed:"Request failed",created:"item created",updated:"item updated",deleted:"item deleted",notFound:"item notFound",invalidData:"invalid data",tooManyRequests:"tooManyRequests",unAuthenticated:"unAuthenticated",unAuthorized:"unAuthorized",serverError:"serverError",badRequest:"badRequest",itemExists:"itemExists"},profile:{added:"Profile data added successfully.",updated:"Profile data updated successfully."}};var ka=e=>{switch(e){case "invalid_address_city_state_postal_code":return "The combination of the city, state, and postal code in the provided address could not be validated.";case "invalid_street_address":return "The street name and/or number for the provided address could not be validated.";case "invalid_value_other":return "An invalid value was provided for the some field. This is a general error code.";case "verification_document_address_mismatch":return "The address on the document did not match the address on the account. Upload a document with a matching address or update the address on the account.";case "verification_document_address_missing":return "The address was missing on the document. Upload a document that includes the address.";case "verification_document_corrupt":return "The uploaded file for the document was invalid or corrupt. Please upload a new file of the document.";case "verification_document_country_not_supported":return "Sorry The provided document is from an unsupported country :/";case "verification_document_dob_mismatch":return "The date of birth (DOB) on the document did not match the DOB on the account. Upload a document with a matching DOB or update the DOB on the account.";case "verification_document_duplicate_type":return "The same type of document was used twice. Two unique types of documents are required for verification. Upload two different documents.";case "verification_document_expired":return "The document could not be used for verification because it has expired. If it\u2019s an identity document, its expiration date must be after the date the document was submitted. If it\u2019s an address document, the issue date must be within the last six months.";case "verification_document_failed_copy":return "The document could not be verified because it was detected as a copy (e.g., photo or scan). Upload the original document.";case "verification_document_failed_greyscale":return "The document could not be used for verification because it was in greyscale. Upload a color copy of the document.";case "verification_document_failed_other":return "The document could not be verified for an unknown reason. Ensure that the document follows the guidelines for document uploads.";case "verification_document_failed_test_mode":return "A test data helper was supplied to simulate verification failure. Refer to the documentation for test file tokens.";case "verification_document_fraudulent":return "The document was identified as altered or falsified.";case "verification_document_id_number_mismatch":return "The ID number on the account could not be verified. Correct any errors in the ID number field or upload a document that includes the ID number.";case "verification_document_id_number_missing":return "The ID number was missing on the document. Upload a document that includes the ID number.";case "verification_document_incomplete":return "The document was cropped or missing important information. Upload a complete scan of the document.";case "verification_document_invalid":return "The uploaded file was not one of the valid document types. Ensure that the document follows the guidelines for document uploads.";case "verification_document_issue_or_expiry_date_missing":return "The issue or expiry date is missing on the document. Upload a document that includes the issue and expiry dates.";case "verification_document_manipulated":return "The document was identified as altered or falsified.";case "verification_document_missing_back":return "The uploaded file was missing the back of the document. Upload a complete scan of the document.";case "verification_document_missing_front":return "The uploaded file was missing the front of the document. Upload a complete scan of the document.";case "verification_document_name_mismatch":return "The name on the document did not match the name on the account. Upload a document with a matching name or update the name on the account.";case "verification_document_name_missing":return "The name was missing on the document. Upload a document that includes name.";case "verification_document_nationality_mismatch":return "The nationality on the document did not match the stated nationality. Update the stated nationality, or upload a document that matches it.";case "verification_document_not_readable":return "The document could not be read. Ensure that the document follows the guidelines for document uploads.";case "verification_document_not_signed":return "A valid signature is missing on the document. Upload a document that includes a valid signature.";case "verification_document_not_uploaded":return "No document was uploaded. Upload the document again.";case "verification_document_photo_mismatch":return "The document was identified as altered or falsified.";case "verification_document_too_large":return "The uploaded file exceeded the 10 MB size limit. Resize the document and upload the new file.";case "verification_document_type_not_supported":return "The provided document type was not accepted. Ensure that the document follows the guidelines for document uploads.";case "verification_failed_address_match":return "The address on the account could not be verified. Correct any errors in the address field or upload a document that includes the address.";case "verification_failed_business_iec_number":return "The Importer Exporter Code (IEC) number could not be verified. Correct any errors in the IEC number field.";case "verification_failed_document_match":return "The document could not be verified. Upload a document that includes the name, ID number, and address fields.";case "verification_failed_id_number_match":return "The ID number on the account could not be verified. Correct any errors in the ID number field or upload a document that includes the ID number.";case "verification_failed_keyed_identity":return "The keyed-in identity information could not be verified. Correct any errors or upload a document that matches the identity fields (e.g., name and date of birth) entered.";case "verification_failed_keyed_match":return "The keyed-in information on the account could not be verified. Correct any errors in the name, ID number, or address fields. You can also upload a document that includes those fields.";case "verification_failed_name_match":return "The name on the account could not be verified. Correct any errors in the name field or upload a document that includes the name.";case "verification_failed_tax_id_match":return "The tax ID on the account cannot be verified by the IRS. Either correct any possible errors in the name or tax ID, or upload a document that contains those fields.";case "verification_failed_tax_id_not_issued":return "The tax ID on the account was not recognized by the IRS. Refer to the support article for newly-issued tax ID numbers.";case "verification_failed_other":return "Verification failed for an unknown reason. Correct any errors and resubmit the required fields.";default:return "Oops, something went wrong :/"}},Ca=e=>{switch(e){case "individual.verification.additional_document":return "Some additional verification document might be required";case "individual.verification.document":return "Some verification document might be required";default:return "Please try again"}},Ma=e=>{switch(e){case "application.deauthorized":return "You opted to delete your Stripe account.";case "requirements.past_due":return "Your account is disabled because you do not meet Stripe requirements.";case "requirements.pending_verification":return "Your account is not yet enabled because it is being verified.";case "rejected.fraud":return "Your account has been permanently banned because of fraudulent activity.";case "rejected.terms_of_service":return "Your account is not enabled beacause you have rejected Stripe terms of service (TOS).";case "rejected.listed":return "Your account is rejected. Please get in touch for more info.";case "rejected.other":return "Your account is rejected. Please get in touch for more info.";case "listed":return "Your account is disabled. Please get in touch for more info";case "under_review":return "Your account is temporarily disabled and it under review. Sorry for the inconvenience.";case "other":return "Your account is disabled. Please get in touch for more info.";default:return "Your account is disabled. Please get in touch for more info."}};var se=(p=>(p.register="register",p.login="login",p.logout="logout",p.deleteUser="delete_user",p.getPersonalAccountData="get_personal_account_data",p.getUser="get_user",p.updatePersonalAccountData="update_personal_account_data",p.updateUser="update_user",p.createUser="create_user",p.listUsers="list_users",p.getAdminDashboardData="get_admin_dashboard_data",p.blockUser="block_user",p.unblockUser="unblock_user",p.searchUserData="search_user_data",p.listGames="list_games",p.getGame="get_game",p.createGame="create_game",p.updateGame="update_game",p.deleteGame="delete_game",p.listGameRooms="list_game_rooms",p.getGameRoom="get_game_room",p.createGameRoom="create_game_room",p.updateGameRoom="update_game_room",p.startGameRoom="start_game_room",p.releaseGameRoom="release_game_room",p.declareGameRoomWinner="declare_game_room_winner",p.deleteGameRoom="delete_game_room",p.getCompletedGameRoom="get_completed_game_rooms",p.getEngagerDashboardData="get_engager_dashboard_data",p.getAvailableGameRooms="get_available_game_rooms",p.listTopups="list_topups",p.reques