gearboxdownloadmodal 5.0.95 → 5.0.97

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.
package/dist/index.umd.js CHANGED
@@ -47,7 +47,7 @@ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var S=se(T,D,z,B,N+"."+D
47
47
  `).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&Ra[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},eo=Symbol("internals");function bt(e){return e&&String(e).trim().toLowerCase()}function Tt(e){return e===!1||e==null?e:v.isArray(e)?e.map(Tt):String(e)}function Ta(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Ha=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wn(e,t,n,r,o){if(v.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!v.isString(t)){if(v.isString(r))return t.indexOf(r)!==-1;if(v.isRegExp(r))return r.test(t)}}function Xa(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Qa(e,t){const n=v.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,a){return this[r].call(this,t,o,i,a)},configurable:!0})})}class Ht{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(A,d,c){const s=bt(d);if(!s)throw new Error("header name must be a non-empty string");const m=v.findKey(o,s);(!m||o[m]===void 0||c===!0||c===void 0&&o[m]!==!1)&&(o[m||d]=Tt(A))}const a=(A,d)=>v.forEach(A,(c,s)=>i(c,s,d));return v.isPlainObject(t)||t instanceof this.constructor?a(t,n):v.isString(t)&&(t=t.trim())&&!Ha(t)?a(Ga(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=bt(t),t){const r=v.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Ta(o);if(v.isFunction(n))return n.call(this,o,r);if(v.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=bt(t),t){const r=v.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Wn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(a){if(a=bt(a),a){const A=v.findKey(r,a);A&&(!n||Wn(r,r[A],A,n))&&(delete r[A],o=!0)}}return v.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||Wn(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return v.forEach(this,(o,i)=>{const a=v.findKey(r,i);if(a){n[a]=Tt(o),delete n[i];return}const A=t?Xa(i):String(i).trim();A!==i&&delete n[i],n[A]=Tt(o),r[A]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return v.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&v.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
48
48
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[eo]=this[eo]={accessors:{}}).accessors,o=this.prototype;function i(a){const A=bt(a);r[A]||(Qa(o,a),r[A]=!0)}return v.isArray(t)?t.forEach(i):i(t),this}}Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),v.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),v.freezeMethods(Ht);const De=Ht;function Mn(e,t){const n=this||Kn,r=t||n,o=De.from(r.headers);let i=r.data;return v.forEach(e,function(A){i=A.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function to(e){return!!(e&&e.__CANCEL__)}function Ct(e,t,n){_.call(this,e??"canceled",_.ERR_CANCELED,t,n),this.name="CanceledError"}v.inherits(Ct,_,{__CANCEL__:!0});function Va(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new _("Request failed with status code "+n.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Pa=Je.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,a,A){const d=[];d.push(n+"="+encodeURIComponent(r)),v.isNumber(o)&&d.push("expires="+new Date(o).toGMTString()),v.isString(i)&&d.push("path="+i),v.isString(a)&&d.push("domain="+a),A===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ba(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ua(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function no(e,t){return e&&!Ba(t)?Ua(e,t):t}const Fa=Je.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(a){const A=v.isString(a)?o(a):a;return A.protocol===r.protocol&&A.host===r.host}}():function(){return function(){return!0}}();function _a(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function $a(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),s=r[i];a||(a=c),n[o]=d,r[o]=c;let m=i,y=0;for(;m!==o;)y+=n[m++],m=m%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const q=s&&c-s;return q?Math.round(y*1e3/q):void 0}}function ro(e,t){let n=0;const r=$a(50,250);return o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,A=i-n,d=r(A),c=i<=a;n=i;const s={loaded:i,total:a,progress:a?i/a:void 0,bytes:A,rate:d||void 0,estimated:d&&a&&c?(a-i)/d:void 0,event:o};s[t?"download":"upload"]=!0,e(s)}}const Sn={http:Ka,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let o=e.data;const i=De.from(e.headers).normalize(),a=e.responseType;let A;function d(){e.cancelToken&&e.cancelToken.unsubscribe(A),e.signal&&e.signal.removeEventListener("abort",A)}let c;v.isFormData(o)&&(Je.isStandardBrowserEnv||Je.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?v.isString(c=i.getContentType())&&i.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):i.setContentType("multipart/form-data"));let s=new XMLHttpRequest;if(e.auth){const p=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+h))}const m=no(e.baseURL,e.url);s.open(e.method.toUpperCase(),Ur(m,e.params,e.paramsSerializer),!0),s.timeout=e.timeout;function y(){if(!s)return;const p=De.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),Z={data:!a||a==="text"||a==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:p,config:e,request:s};Va(function(k){n(k),d()},function(k){r(k),d()},Z),s=null}if("onloadend"in s?s.onloadend=y:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(y)},s.onabort=function(){s&&(r(new _("Request aborted",_.ECONNABORTED,e,s)),s=null)},s.onerror=function(){r(new _("Network Error",_.ERR_NETWORK,e,s)),s=null},s.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const Z=e.transitional||_r;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),r(new _(h,Z.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,e,s)),s=null},Je.isStandardBrowserEnv){const p=(e.withCredentials||Fa(m))&&e.xsrfCookieName&&Pa.read(e.xsrfCookieName);p&&i.set(e.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in s&&v.forEach(i.toJSON(),function(h,Z){s.setRequestHeader(Z,h)}),v.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),a&&a!=="json"&&(s.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&s.addEventListener("progress",ro(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",ro(e.onUploadProgress)),(e.cancelToken||e.signal)&&(A=p=>{s&&(r(!p||p.type?new Ct(null,e,s):p),s.abort(),s=null)},e.cancelToken&&e.cancelToken.subscribe(A),e.signal&&(e.signal.aborted?A():e.signal.addEventListener("abort",A)));const q=_a(m);if(q&&Je.protocols.indexOf(q)===-1){r(new _("Unsupported protocol "+q+":",_.ERR_BAD_REQUEST,e));return}s.send(o||null)})}};v.forEach(Sn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const oo=e=>`- ${e}`,eA=e=>v.isFunction(e)||e===null||e===!1,io={getAdapter:e=>{e=v.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!eA(n)&&(r=Sn[(a=String(n)).toLowerCase()],r===void 0))throw new _(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([A,d])=>`adapter ${A} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
49
49
  `+i.map(oo).join(`
50
- `):" "+oo(i[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Sn};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function ao(e){return Ln(e),e.headers=De.from(e.headers),e.data=Mn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),io.getAdapter(e.adapter||Kn.adapter)(e).then(function(r){return Ln(e),r.data=Mn.call(e,e.transformResponse,r),r.headers=De.from(r.headers),r},function(r){return to(r)||(Ln(e),r&&r.response&&(r.response.data=Mn.call(e,e.transformResponse,r.response),r.response.headers=De.from(r.response.headers))),Promise.reject(r)})}const Ao=e=>e instanceof De?e.toJSON():e;function At(e,t){t=t||{};const n={};function r(c,s,m){return v.isPlainObject(c)&&v.isPlainObject(s)?v.merge.call({caseless:m},c,s):v.isPlainObject(s)?v.merge({},s):v.isArray(s)?s.slice():s}function o(c,s,m){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c,m)}else return r(c,s,m)}function i(c,s){if(!v.isUndefined(s))return r(void 0,s)}function a(c,s){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c)}else return r(void 0,s)}function A(c,s,m){if(m in t)return r(c,s);if(m in e)return r(void 0,c)}const d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:A,headers:(c,s)=>o(Ao(c),Ao(s),!0)};return v.forEach(Object.keys(Object.assign({},e,t)),function(s){const m=d[s]||o,y=m(e[s],t[s],s);v.isUndefined(y)&&m!==A||(n[s]=y)}),n}const so="1.5.1",On={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{On[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const lo={};On.transitional=function(t,n,r){function o(i,a){return"[Axios v"+so+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new _(o(a," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!lo[a]&&(lo[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,A):!0}};function tA(e,t,n){if(typeof e!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const A=e[i],d=A===void 0||a(A,i,e);if(d!==!0)throw new _("option "+i+" must be "+d,_.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _("Unknown option "+i,_.ERR_BAD_OPTION)}}const En={assertOptions:tA,validators:On},Xe=En.validators;class Xt{constructor(t){this.defaults=t,this.interceptors={request:new Fr,response:new Fr}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=At(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&En.assertOptions(r,{silentJSONParsing:Xe.transitional(Xe.boolean),forcedJSONParsing:Xe.transitional(Xe.boolean),clarifyTimeoutError:Xe.transitional(Xe.boolean)},!1),o!=null&&(v.isFunction(o)?n.paramsSerializer={serialize:o}:En.assertOptions(o,{encode:Xe.function,serialize:Xe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&v.merge(i.common,i[n.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=De.concat(a,i);const A=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,A.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let s,m=0,y;if(!d){const p=[ao.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),y=p.length,s=Promise.resolve(n);m<y;)s=s.then(p[m++],p[m++]);return s}y=A.length;let q=n;for(m=0;m<y;){const p=A[m++],h=A[m++];try{q=p(q)}catch(Z){h.call(this,Z);break}}try{s=ao.call(this,q)}catch(p){return Promise.reject(p)}for(m=0,y=c.length;m<y;)s=s.then(c[m++],c[m++]);return s}getUri(t){t=At(this.defaults,t);const n=no(t.baseURL,t.url);return Ur(n,t.params,t.paramsSerializer)}}v.forEach(["delete","get","head","options"],function(t){Xt.prototype[t]=function(n,r){return this.request(At(r||{},{method:t,url:n,data:(r||{}).data}))}}),v.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(At(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Xt.prototype[t]=n(),Xt.prototype[t+"Form"]=n(!0)});const Qt=Xt;class kn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(A=>{r.subscribe(A),i=A}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,A){r.reason||(r.reason=new Ct(i,a,A),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new kn(function(o){t=o}),cancel:t}}}const nA=kn;function rA(e){return function(n){return e.apply(null,n)}}function oA(e){return v.isObject(e)&&e.isAxiosError===!0}const zn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(zn).forEach(([e,t])=>{zn[t]=e});const iA=zn;function uo(e){const t=new Qt(e),n=kr(Qt.prototype.request,t);return v.extend(n,Qt.prototype,t,{allOwnKeys:!0}),v.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return uo(At(e,o))},n}const me=uo(Kn);me.Axios=Qt,me.CanceledError=Ct,me.CancelToken=nA,me.isCancel=to,me.VERSION=so,me.toFormData=Gt,me.AxiosError=_,me.Cancel=me.CanceledError,me.all=function(t){return Promise.all(t)},me.spread=rA,me.isAxiosError=oA,me.mergeConfig=At,me.AxiosHeaders=De,me.formToJSON=e=>$r(v.isHTMLForm(e)?new FormData(e):e),me.getAdapter=io.getAdapter,me.HttpStatusCode=iA,me.default=me;const aA=me;/*! typescript-cookie v1.0.6 | MIT */const co=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),mo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Yn=decodeURIComponent,jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function AA(e){return e=Object.assign({},e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires!=null&&(e.expires=e.expires.toUTCString()),Object.entries(e).filter(([t,n])=>n!=null&&n!==!1).map(([t,n])=>n===!0?`; ${t}`:`; ${t}=${n.split(";")[0]}`).join("")}function po(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,o={};let i;for(;(i=r.exec(document.cookie))!=null;)try{const a=n(i[1]);if(o[a]=t(i[2],a),e===a)break}catch{}return e!=null?o[e]:o}const fo=Object.freeze({decodeName:Yn,decodeValue:jn,encodeName:co,encodeValue:mo}),Jn=Object.freeze({path:"/"});function ho(e,t,n=Jn,{encodeValue:r=mo,encodeName:o=co}={}){return document.cookie=`${o(e)}=${r(t,e)}${AA(n)}`}function qo(e,{decodeValue:t=jn,decodeName:n=Yn}={}){return po(e,t,n)}function sA({decodeValue:e=jn,decodeName:t=Yn}={}){return po(void 0,e,t)}function lA(e,t=Jn){ho(e,"",Object.assign({},t,{expires:-1}))}function Nn(e,t){const n={set:function(o,i,a){return ho(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return sA(this.converter.read);if(o!=null)return qo(o,this.converter.read)},remove:function(o,i){lA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Nn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Nn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Nn({read:fo.decodeValue,write:fo.encodeValue},Jn);let go;typeof window<"u"&&(go=qo("token"));const fe=aA.create({headers:{Authorization:go}});async function uA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function cA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function dA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function mA(e,t,n,r,o){return console.log(r),(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function pA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function fA(e,t,n){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n})).data}async function hA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function yo(e,t){return(await fe.post(t+"/updateFlexUrl",e||{})).data}async function Vt(e,t,n){return(await fe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Pt(e){const t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select();try{return document.execCommand("copy")?(document.body.removeChild(t),!0):(document.body.removeChild(t),!1)}catch{return document.body.removeChild(t),!1}}function vo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=vo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Qe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=vo(e))&&(r&&(r+=" "),r+=t);return r}const Zt=e=>typeof e=="number"&&!isNaN(e),Ue=e=>typeof e=="string",be=e=>typeof e=="function",Bt=e=>Ue(e)||be(e)?e:null,Dn=e=>C.isValidElement(e)||Ue(e)||be(e)||Zt(e);function qA(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Ut(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:d,preventExitTransition:c,done:s,nodeRef:m,isIn:y}=a;const q=r?`${t}--${d}`:t,p=r?`${n}--${d}`:n,h=C.useRef(0);return C.useLayoutEffect(()=>{const Z=m.current,x=q.split(" "),k=Y=>{Y.target===m.current&&(Z.dispatchEvent(new Event("d")),Z.removeEventListener("animationend",k),Z.removeEventListener("animationcancel",k),h.current===0&&Y.type!=="animationcancel"&&Z.classList.remove(...x))};Z.classList.add(...x),Z.addEventListener("animationend",k),Z.addEventListener("animationcancel",k)},[]),C.useEffect(()=>{const Z=m.current,x=()=>{Z.removeEventListener("animationend",x),o?qA(Z,s,i):s()};y||(c?x():(h.current=1,Z.className+=` ${p}`,Z.addEventListener("animationend",x)))},[y]),C.createElement(C.Fragment,null,A)}}function bo(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const We={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(r=>r!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},Ft=e=>{let{theme:t,type:n,...r}=e;return C.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Rn={info:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return C.createElement("div",{className:"Toastify__spinner"})}};function gA(e){const[,t]=C.useReducer(q=>q+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=q=>n.indexOf(q)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:q=>i.get(q)}).current;function d(q){let{containerId:p}=q;const{limit:h}=A.props;!h||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(q){r(p=>q==null?[]:p.filter(h=>h!==q))}function s(){const{toastContent:q,toastProps:p,staleId:h}=A.queue.shift();y(q,p,h)}function m(q,p){let{delay:h,staleId:Z,...x}=p;if(!Dn(q)||function(ne){return!o.current||A.props.enableMultiContainer&&ne.containerId!==A.props.containerId||i.has(ne.toastId)&&ne.updateId==null}(x))return;const{toastId:k,updateId:Y,data:L}=x,{props:b}=A,U=()=>c(k),ee=Y==null;ee&&A.count++;const P={...b,style:b.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(x).filter(ne=>{let[Q,W]=ne;return W!=null})),toastId:k,updateId:Y,data:L,closeToast:U,isIn:!1,className:Bt(x.className||b.toastClassName),bodyClassName:Bt(x.bodyClassName||b.bodyClassName),progressClassName:Bt(x.progressClassName||b.progressClassName),autoClose:!x.isLoading&&(Ae=x.autoClose,re=b.autoClose,Ae===!1||Zt(Ae)&&Ae>0?Ae:re),deleteToast(){const ne=bo(i.get(k),"removed");i.delete(k),We.emit(4,ne);const Q=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),Q>0){const W=k==null?A.props.limit:1;if(Q===1||W===1)A.displayedToast++,s();else{const E=W>Q?Q:W;A.displayedToast=E;for(let J=0;J<E;J++)s()}}else t()}};var Ae,re;P.iconOut=function(ne){let{theme:Q,type:W,isLoading:E,icon:J}=ne,f=null;const M={theme:Q,type:W};return J===!1||(be(J)?f=J(M):C.isValidElement(J)?f=C.cloneElement(J,M):Ue(J)||Zt(J)?f=J:E?f=Rn.spinner():(V=>V in Rn)(W)&&(f=Rn[W](M))),f}(P),be(x.onOpen)&&(P.onOpen=x.onOpen),be(x.onClose)&&(P.onClose=x.onClose),P.closeButton=b.closeButton,x.closeButton===!1||Dn(x.closeButton)?P.closeButton=x.closeButton:x.closeButton===!0&&(P.closeButton=!Dn(b.closeButton)||b.closeButton);let te=q;C.isValidElement(q)&&!Ue(q.type)?te=C.cloneElement(q,{closeToast:U,toastProps:P,data:L}):be(q)&&(te=q({closeToast:U,toastProps:P,data:L})),b.limit&&b.limit>0&&A.count>b.limit&&ee?A.queue.push({toastContent:te,toastProps:P,staleId:Z}):Zt(h)?setTimeout(()=>{y(te,P,Z)},h):y(te,P,Z)}function y(q,p,h){const{toastId:Z}=p;h&&i.delete(h);const x={content:q,props:p};i.set(Z,x),r(k=>[...k,Z].filter(Y=>Y!==h)),We.emit(4,bo(x,x.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,We.cancelEmit(3).on(0,m).on(1,q=>o.current&&c(q)).on(5,d).emit(2,A),()=>{i.clear(),We.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(q){const p=new Map,h=Array.from(i.values());return e.newestOnTop&&h.reverse(),h.forEach(Z=>{const{position:x}=Z.props;p.has(x)||p.set(x,[]),p.get(x).push(Z)}),Array.from(p,Z=>q(Z[0],Z[1]))},containerRef:o,isToastActive:a}}function Co(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Zo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function yA(e){const[t,n]=C.useState(!1),[r,o]=C.useState(!1),i=C.useRef(null),a=C.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=C.useRef(e),{autoClose:d,pauseOnHover:c,closeToast:s,onClick:m,closeOnClick:y}=e;function q(L){if(e.draggable){L.nativeEvent.type==="touchstart"&&L.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",x),document.addEventListener("mouseup",k),document.addEventListener("touchmove",x),document.addEventListener("touchend",k);const b=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=b.getBoundingClientRect(),b.style.transition="",a.x=Co(L.nativeEvent),a.y=Zo(L.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=b.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=b.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(L){if(a.boundingRect){const{top:b,bottom:U,left:ee,right:P}=a.boundingRect;L.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=ee&&a.x<=P&&a.y>=b&&a.y<=U?Z():h()}}function h(){n(!0)}function Z(){n(!1)}function x(L){const b=i.current;a.canDrag&&b&&(a.didMove=!0,t&&Z(),a.x=Co(L),a.y=Zo(L),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),b.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,b.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",k);const L=i.current;if(a.canDrag&&a.didMove&&L){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();L.style.transition="transform 0.2s, opacity 0.2s",L.style.transform=`translate${e.draggableDirection}(0)`,L.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),be(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const L=A.current;be(L.onClose)&&L.onClose(C.isValidElement(L.children)&&L.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||Z(),window.addEventListener("focus",h),window.addEventListener("blur",Z)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",Z))}),[e.pauseOnFocusLoss]);const Y={onMouseDown:q,onTouchStart:q,onMouseUp:p,onTouchEnd:p};return d&&c&&(Y.onMouseEnter=Z,Y.onMouseLeave=h),y&&(Y.onClick=L=>{m&&m(L),a.canCloseOnClick&&s()}),{playToast:h,pauseToast:Z,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:Y}}function Io(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return C.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},C.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function vA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:d,progress:c,rtl:s,isIn:m,theme:y}=e;const q=i||d&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:q?0:1};d&&(p.transform=`scaleX(${c})`);const h=Qe("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),Z=be(a)?a({rtl:s,type:o,defaultClassName:h}):Qe(h,a);return C.createElement("div",{role:"progressbar","aria-hidden":q?"true":"false","aria-label":"notification timer",className:Z,style:p,[d&&c>=1?"onTransitionEnd":"onAnimationEnd"]:d&&c<1?null:()=>{m&&r()}})}const bA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=yA(e),{closeButton:i,children:a,autoClose:A,onClick:d,type:c,hideProgressBar:s,closeToast:m,transition:y,position:q,className:p,style:h,bodyClassName:Z,bodyStyle:x,progressClassName:k,progressStyle:Y,updateId:L,role:b,progress:U,rtl:ee,toastId:P,deleteToast:Ae,isIn:re,isLoading:te,iconOut:ne,closeOnClick:Q,theme:W}=e,E=Qe("Toastify__toast",`Toastify__toast-theme--${W}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":ee},{"Toastify__toast--close-on-click":Q}),J=be(p)?p({rtl:ee,position:q,type:c,defaultClassName:E}):Qe(E,p),f=!!U||!A,M={closeToast:m,type:c,theme:W};let V=null;return i===!1||(V=be(i)?i(M):C.isValidElement(i)?C.cloneElement(i,M):Io(M)),C.createElement(y,{isIn:re,done:Ae,position:q,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:P,onClick:d,className:J,...o,style:h,ref:r},C.createElement("div",{...re&&{role:b},className:be(Z)?Z({type:c}):Qe("Toastify__toast-body",Z),style:x},ne!=null&&C.createElement("div",{className:Qe("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!te})},ne),C.createElement("div",null,a)),V,C.createElement(vA,{...L&&!f?{key:`pb-${L}`}:{},rtl:ee,theme:W,delay:A,isRunning:t,isIn:re,closeToast:m,hide:s,type:c,style:Y,className:k,controlledProgress:f,progress:U||0})))},_t=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},CA=Ut(_t("bounce",!0));Ut(_t("slide",!0)),Ut(_t("zoom")),Ut(_t("flip"));const Gn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=gA(e),{className:i,style:a,rtl:A,containerId:d}=e;function c(s){const m=Qe("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return be(i)?i({position:s,rtl:A,defaultClassName:m}):Qe(m,Bt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:d},n((s,m)=>{const y=m.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:c(s),style:y,key:`container-${s}`},m.map((q,p)=>{let{content:h,props:Z}=q;return C.createElement(bA,{...Z,isIn:o(Z.toastId),style:{...Z.style,"--nth":p+1,"--len":m.length},key:`toast-${Z.key}`},h)}))}))});Gn.displayName="ToastContainer",Gn.defaultProps={position:"top-right",transition:CA,autoClose:5e3,closeButton:Io,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Tn,Fe=new Map,It=[],ZA=1;function wo(){return""+ZA++}function IA(e){return e&&(Ue(e.toastId)||Zt(e.toastId))?e.toastId:wo()}function wt(e,t){return Fe.size>0?We.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function $t(e,t){return{...t,type:t&&t.type||e,toastId:IA(t)}}function en(e){return(t,n)=>wt(t,$t(e,n))}function ue(e,t){return wt(e,$t("default",t))}ue.loading=(e,t)=>wt(e,$t("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ue.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=Ue(o)?ue.loading(o,n):ue.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(s,m,y)=>{if(m==null)return void ue.dismiss(r);const q={type:s,...A,...n,data:y},p=Ue(m)?{render:m}:m;return r?ue.update(r,{...q,...p}):ue(p.render,{...q,...p}),y},c=be(e)?e():e;return c.then(s=>d("success",a,s)).catch(s=>d("error",i,s)),c},ue.success=en("success"),ue.info=en("info"),ue.error=en("error"),ue.warning=en("warning"),ue.warn=ue.warning,ue.dark=(e,t)=>wt(e,$t("default",{theme:"dark",...t})),ue.dismiss=e=>{Fe.size>0?We.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ue.clearWaitingQueue=function(e){return e===void 0&&(e={}),We.emit(5,e)},ue.isActive=e=>{let t=!1;return Fe.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},ue.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=Fe.get(i||Tn);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:wo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,wt(a,i)}},0)},ue.done=e=>{ue.update(e,{progress:1})},ue.onChange=e=>(We.on(4,e),()=>{We.off(4,e)}),ue.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},ue.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},We.on(2,e=>{Tn=e.containerId||e,Fe.set(Tn,e),It.forEach(t=>{We.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{Fe.delete(e.containerId||e),Fe.size===0&&We.off(0).off(1).off(5)});function xt(e){ue.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Hn="",_e="Playable",Ce=null,xo=null;const tn=async e=>{let t=Hn+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const o=window.URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=n.split("/").reduce((a,A)=>A,""),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(o),xt("Download successfully")}).catch(r=>{console.error("File error:",r)})},wA=(e,t)=>{let n=Hn+"/"+e;Pt(n)?xt("Link Copied"):t(n)};async function nn(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let d=async c=>{r==="download"?await tn(c):r==="copy"&&wA(c,xo)};_e==="Playable"?(n&&await Vt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),mA(Ce,e,t,o,i).then(async c=>{let{url:s}=c;d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):_e==="Flex"?(n&&await yo({_id:e,iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),cA({_id:e,network:t},Ce).then(async c=>{if(c.message){A(c);return}let{url:s}=c;d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):_e==="Import"?dA(Ce,e,t).then(c=>{let s=c.url;d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):_e==="Ready"&&(n&&await Vt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),fA(Ce,e,t).then(async c=>{if(c.message){A(c);return}let s=c.url;await d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}))})}async function xA(e,t,n){return new Promise(async(r,o)=>{console.log("get multi download"),_e==="Flex"?(await yo({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),uA(e,n,Ce).then(async i=>{if(i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})})):_e==="Ready"?(console.log("ready"),await Vt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),console.log("ready link multi"),hA(e,n,Ce).then(async i=>{if(console.log("res",i),i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{console.log("err",i);let a=i.response.data.error.msg;o({message:a})})):(await Vt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),pA(e,n,Ce).then(async i=>{await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})}))})}function KA(e,t,n,r){_e=e,Ce=t,xo=n,Hn=r}const WA=({versionId:e,typeOfProduct:t,api:n,fetchFileUrl:r,copyLinkUrl:o,setSafariCopyLink:i})=>{const[a,A]=C.useState(!1),d=async()=>{A(!0),nn(e,"default",null,null,!1).then(c=>{A(!1);let s;t==="Flex"?s=`${o}/preview?versionId=${e}`:t==="Import"?s=`${o}/preview?versionId=${e}_`:s=`${o}/preview?versionId=${e}_`,Pt(s)?xt("Link copied"):i(s),A(!1)}).catch(c=>{A(!1)})};return l.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[l.jsx("div",{style:{marginRight:"0.75rem",width:"50%"},children:l.jsx(Vi,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:`${o}/preview?versionId=${e}`+(t==="Flex"?"":"_")})}),l.jsxs("div",{children:[l.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),l.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),l.jsxs("div",{style:{display:"flex",cursor:"pointer",borderRadius:"0.375rem",backgroundColor:"#00A3FF1A",color:"secondary-blue"},children:[l.jsx(Er,{style:{marginRight:"0.25rem",height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),a?l.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",margin:"auto"},children:l.jsx("img",{style:{height:"90%"},src:Be,alt:"loading"})}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},onClick:d,children:"Copy Link"})]})]})]})},MA=({versionName:e,versionId:t,typeOfProduct:n,api:r,iframeUrl:o,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})=>{const[d,c]=C.useState(window.innerWidth);C.useEffect(()=>{const m=()=>{c(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const s=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return l.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:d>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(ci,{iframeUrl:o}),l.jsx(di,{name:s}),l.jsx(WA,{versionId:t,typeOfProduct:n,api:r,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})]})};var ce=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(ce||{});const SA=({typeOfProduct:e})=>l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold"},children:[l.jsx("span",{style:{color:ce[e]},children:"Select a Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]});async function LA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const OA=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[l.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),l.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_518_12094",children:l.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),EA=({creditDownload:e,api:t})=>l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem",paddingRight:"1.5rem",fontWeight:100},children:"If you continue to export, you will spend 1 credit."}),l.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"0.25rem",fontSize:"12px",fontWeight:100},children:["You have"," ",l.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)<0?0:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)})," ","credits remaining.",l.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>LA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(OA,{})]})]})]}),kA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:d,isTest:c,setIsTest:s,urlType:m,setUrlType:y})=>{const q=Y=>{r(Y.target.value)},p=Y=>{o(Y.target.value)},h=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"App Store:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"text",value:n.iosUrl,onChange:q,placeholder:"Ios Url",disabled:i})]}),l.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Google Play:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"text",value:n.googleUrl,onChange:p,placeholder:"Google Url",disabled:i})]})]}),Z=()=>l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"URL:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"text",value:n.iosUrl,onChange:q,placeholder:"Ios Url",disabled:i})]})}),x=()=>l.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"20px",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"checkbox",checked:c,onChange:()=>{s(!c)},placeholder:"Google Url",disabled:i})]}),k=()=>l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",width:"400px",height:"30px",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid #eaeaec",marginBottom:"10px",position:"relative"},className:"tab-switch",children:[l.jsx("div",{style:{position:"absolute",bottom:"-3px",left:m==="single"?"0":"50%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="0",document.getElementById("single-tab").style.color="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{y("single")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="single"?"#000":"#a3a3a3",fontWeight:m==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Single URL"})},"singleTab"),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="50%",document.getElementById("single-tab").style.color="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{y("game")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="game"?"#000":"#a3a3a3",fontWeight:m==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"Multi URL"})},"gameTab")]})});return l.jsx(l.Fragment,{children:e!=="Import"&&l.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[d.customer=="playableFactoryInternal"&&e==="Playable"&&l.jsx(x,{}),e==="Ready"&&l.jsx(k,{}),m==="game"&&l.jsx(h,{}),m==="single"&&l.jsx(Z,{}),(A==null?void 0:A.willSpendCredit)&&l.jsx(EA,{creditDownload:A,api:a})]})})},zA=({typeOfProduct:e,title:t,fileSize:n})=>l.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[l.jsx("span",{style:{color:ce[e]},children:t}),n&&l.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),YA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:q})=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid #D1D5DB",paddingLeft:"1.25rem",paddingRight:"1.25rem",gap:"0.5rem"},children:[l.jsx(zA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(kA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:q}),l.jsx(SA,{typeOfProduct:e})]}),Ko=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>l.jsx("button",{onClick:n,className:t,style:{display:"flex",height:"40px",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",border:"1px solid lightgray",padding:"0.25rem",fontSize:"0.875rem",width:200,backgroundColor:"#FFFFFF"},disabled:r||o,children:e}),jA=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return l.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:l.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[l.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all ease-in-out",border:"1px solid lightgray",opacity:1},id:n,checked:r,onChange:i}),l.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:r?1:0,transition:"opacity ease-in-out"},children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:ce[t],stroke:ce[t],strokeWidth:"1",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})," "]})]})})},Nl="",JA=({typeOfProduct:e})=>l.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:l.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}})]})}),Xn=({isNetworksLoading:e=!1})=>l.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:l.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Be,alt:"pf-logo-gif"})}),NA=({title:e,titleId:t,...n})=>l.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":t,...n,children:[e?l.jsx("title",{id:t,children:e}):null,l.jsx("path",{stroke:"currentColor",d:"m15.985 11.111-3.556 3.556-3.556-3.556M12.429 4v10.667M20.429 16.444A3.556 3.556 0 0 1 16.873 20H7.985a3.556 3.556 0 0 1-3.556-3.556",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),DA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i})=>{let a="";return!t&&!n?a="Both links are empty. Are you sure you want to continue?":t?n||(a="Google link is empty. Are you sure you want to continue?"):a="iOS link is empty. Are you sure you want to continue?",l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",maxWidth:"350px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:a}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:()=>{e(!1)},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #666666",padding:"0.5rem",fontWeight:"bold",transition:"all 0.15s ease-linear"},children:"No"}),l.jsx("button",{onClick:async A=>{r==="download"?await i():r==="copyLink"&&await o(),e()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid red",backgroundColor:"darkorange",padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:"Yes"})]})]})]})},Wo=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:350,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:"You are going to spend 1 credit for this download, do you want to continue?"}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),l.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async i=>{i.preventDefault(),i.stopPropagation(),r==="download"?(await n(),await o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),RA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:e,children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},onClick:a=>{a.stopPropagation()},children:l.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Be,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:t,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),i?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Be,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:()=>{t(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),l.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:l.jsx("img",{width:"25px",height:"25px",src:Be,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:n,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:"Download Moloco Test"})})]})})]});async function GA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const Mo=({fill:e,stroke:t,className:n,style:r})=>l.jsxs("svg",{width:"115",height:"114",viewBox:"0 0 115 114",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,children:[l.jsx("ellipse",{cx:"57.5623",cy:"56.7577",rx:"56.6053",ry:"56.4569",fill:"white"}),l.jsx("path",{d:"M24.7305 79.2015C24.7305 82.0917 24.8379 84.0921 24.9789 85.4794C25.2764 88.4065 27.6305 90.083 30.2086 90.1693C31.2215 90.2031 32.5619 90.2283 34.3121 90.2283C36.0623 90.2283 37.4027 90.2031 38.4155 90.1693C40.9937 90.083 43.3477 88.4065 43.6453 85.4794C43.7863 84.0921 43.8937 82.0917 43.8937 79.2015C43.8937 76.3114 43.7863 74.311 43.6453 72.9237C43.3477 69.9966 40.9937 68.3201 38.4155 68.2338C37.4027 68.1999 36.0623 68.1748 34.3121 68.1748C32.5619 68.1748 31.2215 68.1999 30.2086 68.2338C27.6305 68.3201 25.2764 69.9966 24.9789 72.9237C24.8379 74.311 24.7305 76.3114 24.7305 79.2015Z",fill:"#8BCF40"}),l.jsx("path",{d:"M71.9004 68.9101C71.9004 77.2702 72.0947 82.0161 72.289 84.6796C72.5046 87.6344 74.669 89.94 77.7461 90.1279C78.7253 90.1876 79.9532 90.2285 81.482 90.2285C83.0108 90.2285 84.2387 90.1876 85.218 90.1279C88.295 89.94 90.4594 87.6344 90.6751 84.6796C90.8694 82.0161 91.0636 77.2702 91.0636 68.9101C91.0636 60.5501 90.8694 55.8042 90.6751 53.1407C90.4594 50.1859 88.295 47.8803 85.218 47.6924C84.2387 47.6327 83.0108 47.5918 81.482 47.5918C79.9532 47.5918 78.7253 47.6327 77.7461 47.6924C74.669 47.8803 72.5046 50.1859 72.289 53.1407C72.0947 55.8042 71.9004 60.5501 71.9004 68.9101Z",fill:"#8BCF40"}),l.jsx("path",{d:"M48.3164 74.7919C48.3164 79.8075 48.4618 82.9723 48.6297 84.9622C48.8836 87.973 51.195 90.029 54.1148 90.1567C55.0924 90.1995 56.3343 90.2293 57.898 90.2293C59.4618 90.2293 60.7037 90.1995 61.6813 90.1567C64.601 90.029 66.9124 87.973 67.1664 84.9621C67.3343 82.9723 67.4797 79.8075 67.4797 74.7919C67.4797 69.7764 67.3343 66.6116 67.1664 64.6217C66.9124 61.6109 64.601 59.5549 61.6813 59.4271C60.7037 59.3843 59.4618 59.3545 57.898 59.3545C56.3343 59.3545 55.0924 59.3843 54.1148 59.4271C51.195 59.5549 48.8836 61.6109 48.6297 64.6217C48.4618 66.6116 48.3164 69.7764 48.3164 74.7919Z",fill:"#8BCF40"}),l.jsx("path",{d:"M84.6819 24.1036C82.5944 24.0168 78.1969 24.0056 73.191 25.0298C70.2379 25.634 69.4377 29.1745 71.3961 31.1279L74.0374 33.7623C73.1954 34.5241 72.1093 35.5228 70.8815 36.6895C68.0243 39.4044 64.3529 43.0729 61.2048 46.803C61.1649 46.8502 61.0921 46.8943 60.9809 46.8912C60.9293 46.8898 60.8925 46.8774 60.8726 46.8674C60.8577 46.8598 60.8477 46.852 60.835 46.8345C59.4972 44.9673 57.726 42.5735 55.8505 40.2596C54.0307 38.0144 50.776 37.4362 48.2948 39.1139C44.7474 41.5126 37.3817 47.0411 29.1424 56.4388C28.6422 57.0094 28.1388 57.5941 27.6327 58.1935C26.5838 59.4356 26.7432 61.2905 27.9886 62.3368C29.234 63.3828 31.0938 63.2239 32.1427 61.9818C32.625 61.4107 33.1047 60.8534 33.5812 60.3099C41.2675 51.5431 48.105 46.3693 51.3981 44.1213C53.1257 46.2623 54.771 48.4857 56.0375 50.2535C58.3937 53.5424 63.2069 53.563 65.7159 50.5902C68.6648 47.0959 72.1618 43.5954 74.9487 40.9474C76.2434 39.7171 77.3748 38.6804 78.2119 37.9258L81.0367 40.7433C82.9954 42.6967 86.5451 41.8985 87.151 38.9532C88.1778 33.9604 88.1666 29.5744 88.0795 27.4924C88.0024 25.6466 86.5326 24.1806 84.6819 24.1036Z",fill:"#8BCF40"})]}),TA=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],HA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:d,versionId:c,api:s,handleDownloadError:m,fetchFileUrl:y,urls:q,game:p,setIsConfirmActive:h,creditDownload:Z,getDownloadCount:x,disabled:k,user:Y,setSafariCopyLink:L,isTest:b})=>{const[U,ee]=C.useState(!1),[P,Ae]=C.useState(""),[re,te]=C.useState(!1),[ne,Q]=C.useState(!1),[W,E]=C.useState(!1),[J,f]=C.useState("download"),[M,V]=C.useState(!1),[g,I]=C.useState(!1),[R,K]=C.useState(!1);let z={aarki:"html,copy",adcolony:"copy,html",adjoe:"copy,html",applovin:"copy,html",appreciate:"zip",chartboost:"copy,html",criteo:"zip",crossinstall:"copy,html",default:"copy",fb:"zip",fyber:"copy,html",google:"zip",google360:"zip",ironsource:"copy,html",kayzen:"apikey",kaden:"html",kidoz:"html",lifestreet:"copy,html",liftoff:"copy,zip",mobvista:"html",moloco:"html,molocotest",molocoV2:"html,molocotest",nucleo:"copy,html",oceanengine:"copy,zip",pointblank:"html",smadex:"zip",snapchat:"zip",tapjoy:"copy,html",tencent:"zip",toutiao:"copy,zip",toutiao_cn:"copy,zip",unity:"copy,html",vungle:"html",web:"copy,html",yandex:"zip",zucks:"copy,html",luna:"zip",inmobi:"copy,html,",nend:"html",adikteev:"html",jammp:"copy,html"};const B=()=>{n(e)},N=async(j,D)=>(ee(!0),new Promise((se,S)=>{nn(c,j,q,D,b).then(he=>{ee(!1),se(he)}).catch(he=>{ee(!1),m(he.message,he),S(he)})})),T=async(j=!1)=>{j?I(!0):V(!0);const D={};j&&(D.molocoGenerateHtml=!0),nn(c,o,q,"download",b,D).then(se=>{j?I(!1):V(!1),E(!1)}).catch(se=>{m(se.message,se)})},G=async()=>{K(!0);const j=await GA(s,c,o,d);let D=`${y}/${j==null?void 0:j.url}`;Pt(D)?(xt("Link Copied"),K(!1)):L(D)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?ce[d]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+d,onClick:B,children:[l.jsxs("div",{style:{marginTop:"40px",display:"flex",justifyContent:"center"},children:[l.jsxs("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:[TA.includes(o)&&d!=="Import"&&l.jsx(Mo,{fill:ce[d],stroke:ce[d],className:"mb-1 inline-block w-6",style:{marginBottom:"0.25rem",display:"inline-block",width:"1.5rem",height:"auto"}}),l.jsx("div",{children:i&&i.map(j=>j.network).includes(o)?a?l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center",marginRight:"2rem"},children:l.jsx(JA,{typeOfProduct:d})}):i.map(j=>l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",marginRight:"2rem",fontSize:"1rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center"},children:j.network===o?j.size.toString().slice(0,5)+"Mb":""},j.network)):null})]}),l.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(d==="Playable"||d==="Ready"||d==="Flex")&&A&&l.jsx(jA,{checked:r,typeOfProduct:d,id:e})}),l.jsx("img",{onClick:B,style:{width:"30rem",height:"50px",objectFit:"contain"},src:t})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[l.jsxs(Ko,{className:"w-2/3 border-hover-"+d,downloading:U,onClickDonwload:async j=>{if(j.stopPropagation(),(o==="moloco"||o==="molocoV2")&&Y.customer==="playableFactoryInternal"){E(!0);return}else{Ae("download");const D=q.iosUrl,se=q.googleUrl;Z&&Z.willSpendCredit?(h(!0),f("download"),te(!0)):d!=="Import"&&(!D||!se)?(h(!0),Q(!0)):(Q(!1),te(!1),await N(o,"download"))}},children:[!U&&l.jsxs(l.Fragment,{children:[l.jsx(NA,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1.5rem",stroke:"dark-full"}}),"Download"]}),U&&l.jsx(Xn,{})]}),z[o]&&z[o].includes("copy")&&l.jsx(Ko,{className:"w-1/3 border-hover-"+d,onClickDonwload:async j=>{j.stopPropagation(),Ae("copyLink");const D=q.iosUrl,se=q.googleUrl;Z&&(Z!=null&&Z.willSpendCredit)?(f("copy"),h(!0),te(!0)):d!=="Import"&&(!D||!se)?(h(!0),Q(!0)):(te(!1),Q(!1),await N(o,"copy"))},disabled:k,children:l.jsx(Er,{className:"h-6 w-6 stroke-dark-full"})})]})]}),re&&l.jsx(Wo,{creditConfirmType:J,handleCopyLink:async()=>{Q(!1),h(!1),await N(o,"copy")},download:async()=>{Q(!1),h(!1),await N(o,"download")},onClose:()=>{te(!1),h(!1)},getDownloadCount:x}),ne&&l.jsx(DA,{onClose:()=>{Q(!1),h(!1)},iosLink:q.iosUrl,googleLink:q.googleUrl,buttonType:P,handleCopyLink:async()=>{Q(!1),h(!1),await N(o,"copy")},download:async()=>{Q(!1),h(!1),await N(o,"download")}}),W&&Y.customer==="playableFactoryInternal"&&l.jsx(RA,{onClose:()=>{E(!1)},handleDownload:T,handleDownloadMolocoTest:G,downloadingMoloco:M,donwloadintMolocoTest:R,downloadingMolocoHtml:g})]})},Qn=[{id:"1",name:"unity",imageSrc:"https://gearbox.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://gearbox.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://gearbox.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://gearbox.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://gearbox.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://gearbox.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://gearbox.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://gearbox.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://gearbox.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://gearbox.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://gearbox.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://gearbox.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://gearbox.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://gearbox.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://gearbox.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://gearbox.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://gearbox.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://gearbox.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://gearbox.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://gearbox.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://gearbox.playablefactory.com/liftoff.png"},{id:"22",name:"moloco",imageSrc:"https://gearbox.playablefactory.com/moloco.png"},{id:"23",name:"nucleo",imageSrc:"https://gearbox.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://gearbox.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://gearbox.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://gearbox.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://gearbox.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://gearbox.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://gearbox.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://gearbox.playablefactory.com/yandex.png"},{id:"33",name:"web",imageSrc:"https://gearbox.playablefactory.com/web.png"},{id:"34",name:"zucks",imageSrc:"https://gearbox.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://gearbox.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://gearbox.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://gearbox.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://gearbox.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://gearbox.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://gearbox.playablefactory.com/adjoe.png"},{id:"44",name:"molocoV2",imageSrc:"https://gearbox.playablefactory.com/molocoV2.png"},{id:"45",name:"adikteev",imageSrc:"https://gearbox.playablefactory.com/adikteev.png"},{id:"46",name:"appier",imageSrc:"https://gearbox.playablefactory.com/appier.png"},{id:"47",name:"remerge",imageSrc:"https://gearbox.playablefactory.com/remerge.png"},{id:"48",name:"persona",imageSrc:"https://gearbox.playablefactory.com/persona.png"}],XA=({typeOfProduct:e})=>l.jsx("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem"},children:l.jsx("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"0.875rem",fontWeight:"bold",height:"1.5rem"},children:e!=="Import"&&l.jsxs(l.Fragment,{children:[l.jsx(Mo,{fill:ce[e],stroke:ce[e],style:{display:"inline-block",width:"1.5rem",height:"auto"},className:""}),l.jsx("span",{style:{display:"flex",alignItems:"center",marginTop:"0.25rem",marginLeft:"0.25rem"},children:"Data tracking functionality is turned on by default for marked network downloads"})]})})}),QA=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const o={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:ce[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return l.jsx("button",{onClick:r,className:n,style:o,children:e})},VA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?l.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:ce[t]},children:l.jsx(Xn,{})}):l.jsx(QA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),PA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,getDownloadCount:m,disabled:y,setSafariCopyLink:q,isTest:p})=>{const[h,Z]=C.useState([]),[x,k]=C.useState([]),[Y,L]=C.useState(!1),[b,U]=C.useState(""),[ee,P]=C.useState(!1),[Ae,re]=C.useState(!1),[te,ne]=C.useState("download"),[Q,W]=C.useState(!1),E=async M=>{const V=[...h];if(h.includes(M)){const g=V.findIndex(I=>I===M);V.splice(g,1),Z(V)}else V.push(M),Z([...h,M]);Qn.filter(g=>[...V].includes(g.id)).map(g=>g.name)},J=async()=>(console.log("multi download"),new Promise(async(M,V)=>{const g=Qn.filter(I=>[...h].includes(I.id)).map(I=>I.name);P(!0),console.log("get multi download"),xA(r,c,g).then(I=>{console.log("get multi download res"),P(!1),M(I)}).catch(I=>{console.log("get multi download err"),P(!1),A(I.message,I),V(I)})})),f=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(re(!0),ne("download"),W(!0)):(W(!1),await J())};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",flex:1,overflowY:Ae?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:[l.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&Qn.filter(M=>{var V;return t&&((V=t==null?void 0:t.networks)==null?void 0:V.length)>0?t==null?void 0:t.networks.includes(M.name):o==="Import"?e==null?void 0:e.networks.filter(g=>g.status==="paid").some(g=>g.name===M.name):e==null?void 0:e.networks.includes(M.name)}).filter(M=>M.name==="voodoo"?a.customer==="customer:20":!0).map(M=>l.jsx(HA,{id:M.id,name:M.name,imageUrl:M.imageSrc,selected:h.includes(M.id),handleCardClick:E,networkVersionSize:x,fileSizeLoading:Y,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,creditDownload:t,setIsConfirmActive:re,getDownloadCount:m,disabled:y,user:a,setSafariCopyLink:q,isTest:p},M.id))}),l.jsx(XA,{typeOfProduct:o})]}),h.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&l.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:l.jsx(VA,{onClickMultiDownload:f,networksVersionTotalSize:b,typeOfProduct:o,multiDownloading:ee})}),Q&&l.jsx(Wo,{creditConfirmType:te,handleCopyLink:async()=>{},download:async()=>{W(!1),re(!1),await J()},onClose:()=>{W(!1),re(!1)},getDownloadCount:m})]})};async function BA(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}async function UA(e,t){return(await fe.post(t+"/getFlexDownloadCount",e)).data}async function FA(e,t){try{return(await fe.post(t+"/findGame",{_id:e})).data}catch{}}async function _A(e,t){return(await fe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function $A(e,t){return(await fe.post(t+"/getFlexData",{_id:e})).data}async function es(e,t){return(await fe.post(t+"/getImportedPlayable",{id:e})).data}async function ts(e,t){return(await fe.post(t+"/getReadyDownloadCount",e)).data}const ns=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],rs=["adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"],os=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:d,fetchFileUrl:c,fileSize:s,setFileSize:m,setSafariCopyLink:y})=>{const[q,p]=C.useState(null),[h,Z]=C.useState(null),[x,k]=C.useState(null),[Y,L]=C.useState(!1),[b,U]=C.useState("Loading..."),[ee,P]=C.useState("Loading..."),[Ae,re]=C.useState(!0),[te,ne]=C.useState(window.innerWidth),[Q,W]=C.useState(!1),[E,J]=C.useState("single");C.useEffect(()=>{const K=()=>{ne(window.innerWidth)};return window.addEventListener("resize",K),()=>{window.removeEventListener("resize",K)}},[]);const f=async()=>{L(!0);const K=await BA(e,i);return K!=null&&K.networks||(K.networks=ns),p(K),K},M=K=>{U(K)},V=K=>{P(K)},g=async(K,z)=>{var B,N;try{let T;if(r==="Playable"||r==="Ready"){const G=await _A(t,i);if(G){U(G.iosLink),P(G.androidLink),L(!1);return}if(K&&(K.iosUrl||K.googleUrl)){U(K.iosUrl),P(K.googleUrl),L(!1);return}if(z&&z.html){let j=await fetch(c+"/"+z.html).then(S=>S.text());const D=((B=j.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:B.at(1))||"";U(D);const se=((N=j.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:N.at(1))||"";P(se),L(!1)}else P(""),U(""),L(!1)}else if(r==="Flex"){const G=await $A(t,i);if(G.googleUrl||G.iosUrl){P(G.googleUrl),U(G.iosUrl),L(!1);return}K&&(K.iosUrl||K.googleUrl)?(U(K.iosUrl),P(K.googleUrl),L(!1)):(P(""),U(""),L(!1))}}catch(T){d(T.response.data.error.msg)}},I=async()=>{L(!0);let K;r==="Flex"?K=await UA({_id:t},i):r==="Ready"&&(K=await ts({_id:t},i)),K&&(["admin","pm","tester"].includes(a.role)?k({...K,networks:rs}):k(K)),L(!1)},R=async()=>await FA(n,i);return C.useEffect(()=>{o||(p(null),Z(null),k(null),m(null)),o&&(r==="Playable"?(f().then(K=>{g(null,K)}),re(!1)):r==="Ready"?I().then(K=>{f().then(z=>{g(null,z),re(!1)})}):r==="Flex"?I().then(K=>{re(!1),R().then(z=>{o&&(g(z,null),re(!1),Z(z))})}):r==="Import"&&es(t,i).then(K=>{console.log(K),p(K),U(K.iosUrl||""),P(K.googleUrl||""),L(!1),re(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:te>1440?"700px":"650px",width:te>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(YA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:b,googleUrl:ee},handleIosChange:M,handleGoogleChange:V,disabled:Ae,api:i,creditDownload:x,user:a,isTest:Q,setIsTest:W,urlType:E,setUrlType:J}),Y?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Xn,{isNetworksLoading:!0})}):(q||x)&&(r==="Flex"?h:!0)&&!Y&&b!=="Loading..."&&ee!=="Loading..."&&l.jsx(PA,{playable:q,creditDownload:x,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:d,fetchFileUrl:c,urls:{iosUrl:b,googleUrl:ee},game:h,getDownloadCount:I,disabled:Ae,setSafariCopyLink:y,isTest:Q})]})},Dl="";var Vn={exports:{}},$e={},Pn={exports:{}},Le={},Bn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
50
+ `):" "+oo(i[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Sn};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function ao(e){return Ln(e),e.headers=De.from(e.headers),e.data=Mn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),io.getAdapter(e.adapter||Kn.adapter)(e).then(function(r){return Ln(e),r.data=Mn.call(e,e.transformResponse,r),r.headers=De.from(r.headers),r},function(r){return to(r)||(Ln(e),r&&r.response&&(r.response.data=Mn.call(e,e.transformResponse,r.response),r.response.headers=De.from(r.response.headers))),Promise.reject(r)})}const Ao=e=>e instanceof De?e.toJSON():e;function At(e,t){t=t||{};const n={};function r(c,s,m){return v.isPlainObject(c)&&v.isPlainObject(s)?v.merge.call({caseless:m},c,s):v.isPlainObject(s)?v.merge({},s):v.isArray(s)?s.slice():s}function o(c,s,m){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c,m)}else return r(c,s,m)}function i(c,s){if(!v.isUndefined(s))return r(void 0,s)}function a(c,s){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c)}else return r(void 0,s)}function A(c,s,m){if(m in t)return r(c,s);if(m in e)return r(void 0,c)}const d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:A,headers:(c,s)=>o(Ao(c),Ao(s),!0)};return v.forEach(Object.keys(Object.assign({},e,t)),function(s){const m=d[s]||o,y=m(e[s],t[s],s);v.isUndefined(y)&&m!==A||(n[s]=y)}),n}const so="1.5.1",On={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{On[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const lo={};On.transitional=function(t,n,r){function o(i,a){return"[Axios v"+so+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new _(o(a," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!lo[a]&&(lo[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,A):!0}};function tA(e,t,n){if(typeof e!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const A=e[i],d=A===void 0||a(A,i,e);if(d!==!0)throw new _("option "+i+" must be "+d,_.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _("Unknown option "+i,_.ERR_BAD_OPTION)}}const En={assertOptions:tA,validators:On},Xe=En.validators;class Xt{constructor(t){this.defaults=t,this.interceptors={request:new Fr,response:new Fr}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=At(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&En.assertOptions(r,{silentJSONParsing:Xe.transitional(Xe.boolean),forcedJSONParsing:Xe.transitional(Xe.boolean),clarifyTimeoutError:Xe.transitional(Xe.boolean)},!1),o!=null&&(v.isFunction(o)?n.paramsSerializer={serialize:o}:En.assertOptions(o,{encode:Xe.function,serialize:Xe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&v.merge(i.common,i[n.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=De.concat(a,i);const A=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,A.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let s,m=0,y;if(!d){const p=[ao.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),y=p.length,s=Promise.resolve(n);m<y;)s=s.then(p[m++],p[m++]);return s}y=A.length;let q=n;for(m=0;m<y;){const p=A[m++],h=A[m++];try{q=p(q)}catch(Z){h.call(this,Z);break}}try{s=ao.call(this,q)}catch(p){return Promise.reject(p)}for(m=0,y=c.length;m<y;)s=s.then(c[m++],c[m++]);return s}getUri(t){t=At(this.defaults,t);const n=no(t.baseURL,t.url);return Ur(n,t.params,t.paramsSerializer)}}v.forEach(["delete","get","head","options"],function(t){Xt.prototype[t]=function(n,r){return this.request(At(r||{},{method:t,url:n,data:(r||{}).data}))}}),v.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(At(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Xt.prototype[t]=n(),Xt.prototype[t+"Form"]=n(!0)});const Qt=Xt;class kn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(A=>{r.subscribe(A),i=A}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,A){r.reason||(r.reason=new Ct(i,a,A),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new kn(function(o){t=o}),cancel:t}}}const nA=kn;function rA(e){return function(n){return e.apply(null,n)}}function oA(e){return v.isObject(e)&&e.isAxiosError===!0}const zn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(zn).forEach(([e,t])=>{zn[t]=e});const iA=zn;function uo(e){const t=new Qt(e),n=kr(Qt.prototype.request,t);return v.extend(n,Qt.prototype,t,{allOwnKeys:!0}),v.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return uo(At(e,o))},n}const me=uo(Kn);me.Axios=Qt,me.CanceledError=Ct,me.CancelToken=nA,me.isCancel=to,me.VERSION=so,me.toFormData=Gt,me.AxiosError=_,me.Cancel=me.CanceledError,me.all=function(t){return Promise.all(t)},me.spread=rA,me.isAxiosError=oA,me.mergeConfig=At,me.AxiosHeaders=De,me.formToJSON=e=>$r(v.isHTMLForm(e)?new FormData(e):e),me.getAdapter=io.getAdapter,me.HttpStatusCode=iA,me.default=me;const aA=me;/*! typescript-cookie v1.0.6 | MIT */const co=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),mo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Yn=decodeURIComponent,jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function AA(e){return e=Object.assign({},e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires!=null&&(e.expires=e.expires.toUTCString()),Object.entries(e).filter(([t,n])=>n!=null&&n!==!1).map(([t,n])=>n===!0?`; ${t}`:`; ${t}=${n.split(";")[0]}`).join("")}function po(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,o={};let i;for(;(i=r.exec(document.cookie))!=null;)try{const a=n(i[1]);if(o[a]=t(i[2],a),e===a)break}catch{}return e!=null?o[e]:o}const fo=Object.freeze({decodeName:Yn,decodeValue:jn,encodeName:co,encodeValue:mo}),Jn=Object.freeze({path:"/"});function ho(e,t,n=Jn,{encodeValue:r=mo,encodeName:o=co}={}){return document.cookie=`${o(e)}=${r(t,e)}${AA(n)}`}function qo(e,{decodeValue:t=jn,decodeName:n=Yn}={}){return po(e,t,n)}function sA({decodeValue:e=jn,decodeName:t=Yn}={}){return po(void 0,e,t)}function lA(e,t=Jn){ho(e,"",Object.assign({},t,{expires:-1}))}function Nn(e,t){const n={set:function(o,i,a){return ho(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return sA(this.converter.read);if(o!=null)return qo(o,this.converter.read)},remove:function(o,i){lA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Nn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Nn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Nn({read:fo.decodeValue,write:fo.encodeValue},Jn);let go;typeof window<"u"&&(go=qo("token"));const fe=aA.create({headers:{Authorization:go}});async function uA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function cA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function dA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function mA(e,t,n,r,o){return console.log(r),(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function pA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function fA(e,t,n){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n})).data}async function hA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function yo(e,t){return(await fe.post(t+"/updateFlexUrl",e||{})).data}async function Vt(e,t,n){return(await fe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Pt(e){const t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select();try{return document.execCommand("copy")?(document.body.removeChild(t),!0):(document.body.removeChild(t),!1)}catch{return document.body.removeChild(t),!1}}function vo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=vo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Qe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=vo(e))&&(r&&(r+=" "),r+=t);return r}const Zt=e=>typeof e=="number"&&!isNaN(e),Ue=e=>typeof e=="string",be=e=>typeof e=="function",Bt=e=>Ue(e)||be(e)?e:null,Dn=e=>C.isValidElement(e)||Ue(e)||be(e)||Zt(e);function qA(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Ut(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:d,preventExitTransition:c,done:s,nodeRef:m,isIn:y}=a;const q=r?`${t}--${d}`:t,p=r?`${n}--${d}`:n,h=C.useRef(0);return C.useLayoutEffect(()=>{const Z=m.current,x=q.split(" "),k=Y=>{Y.target===m.current&&(Z.dispatchEvent(new Event("d")),Z.removeEventListener("animationend",k),Z.removeEventListener("animationcancel",k),h.current===0&&Y.type!=="animationcancel"&&Z.classList.remove(...x))};Z.classList.add(...x),Z.addEventListener("animationend",k),Z.addEventListener("animationcancel",k)},[]),C.useEffect(()=>{const Z=m.current,x=()=>{Z.removeEventListener("animationend",x),o?qA(Z,s,i):s()};y||(c?x():(h.current=1,Z.className+=` ${p}`,Z.addEventListener("animationend",x)))},[y]),C.createElement(C.Fragment,null,A)}}function bo(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const We={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(r=>r!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},Ft=e=>{let{theme:t,type:n,...r}=e;return C.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Rn={info:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return C.createElement(Ft,{...e},C.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return C.createElement("div",{className:"Toastify__spinner"})}};function gA(e){const[,t]=C.useReducer(q=>q+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=q=>n.indexOf(q)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:q=>i.get(q)}).current;function d(q){let{containerId:p}=q;const{limit:h}=A.props;!h||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(q){r(p=>q==null?[]:p.filter(h=>h!==q))}function s(){const{toastContent:q,toastProps:p,staleId:h}=A.queue.shift();y(q,p,h)}function m(q,p){let{delay:h,staleId:Z,...x}=p;if(!Dn(q)||function(ne){return!o.current||A.props.enableMultiContainer&&ne.containerId!==A.props.containerId||i.has(ne.toastId)&&ne.updateId==null}(x))return;const{toastId:k,updateId:Y,data:L}=x,{props:b}=A,U=()=>c(k),ee=Y==null;ee&&A.count++;const P={...b,style:b.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(x).filter(ne=>{let[Q,W]=ne;return W!=null})),toastId:k,updateId:Y,data:L,closeToast:U,isIn:!1,className:Bt(x.className||b.toastClassName),bodyClassName:Bt(x.bodyClassName||b.bodyClassName),progressClassName:Bt(x.progressClassName||b.progressClassName),autoClose:!x.isLoading&&(Ae=x.autoClose,re=b.autoClose,Ae===!1||Zt(Ae)&&Ae>0?Ae:re),deleteToast(){const ne=bo(i.get(k),"removed");i.delete(k),We.emit(4,ne);const Q=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),Q>0){const W=k==null?A.props.limit:1;if(Q===1||W===1)A.displayedToast++,s();else{const E=W>Q?Q:W;A.displayedToast=E;for(let J=0;J<E;J++)s()}}else t()}};var Ae,re;P.iconOut=function(ne){let{theme:Q,type:W,isLoading:E,icon:J}=ne,f=null;const M={theme:Q,type:W};return J===!1||(be(J)?f=J(M):C.isValidElement(J)?f=C.cloneElement(J,M):Ue(J)||Zt(J)?f=J:E?f=Rn.spinner():(V=>V in Rn)(W)&&(f=Rn[W](M))),f}(P),be(x.onOpen)&&(P.onOpen=x.onOpen),be(x.onClose)&&(P.onClose=x.onClose),P.closeButton=b.closeButton,x.closeButton===!1||Dn(x.closeButton)?P.closeButton=x.closeButton:x.closeButton===!0&&(P.closeButton=!Dn(b.closeButton)||b.closeButton);let te=q;C.isValidElement(q)&&!Ue(q.type)?te=C.cloneElement(q,{closeToast:U,toastProps:P,data:L}):be(q)&&(te=q({closeToast:U,toastProps:P,data:L})),b.limit&&b.limit>0&&A.count>b.limit&&ee?A.queue.push({toastContent:te,toastProps:P,staleId:Z}):Zt(h)?setTimeout(()=>{y(te,P,Z)},h):y(te,P,Z)}function y(q,p,h){const{toastId:Z}=p;h&&i.delete(h);const x={content:q,props:p};i.set(Z,x),r(k=>[...k,Z].filter(Y=>Y!==h)),We.emit(4,bo(x,x.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,We.cancelEmit(3).on(0,m).on(1,q=>o.current&&c(q)).on(5,d).emit(2,A),()=>{i.clear(),We.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(q){const p=new Map,h=Array.from(i.values());return e.newestOnTop&&h.reverse(),h.forEach(Z=>{const{position:x}=Z.props;p.has(x)||p.set(x,[]),p.get(x).push(Z)}),Array.from(p,Z=>q(Z[0],Z[1]))},containerRef:o,isToastActive:a}}function Co(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Zo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function yA(e){const[t,n]=C.useState(!1),[r,o]=C.useState(!1),i=C.useRef(null),a=C.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=C.useRef(e),{autoClose:d,pauseOnHover:c,closeToast:s,onClick:m,closeOnClick:y}=e;function q(L){if(e.draggable){L.nativeEvent.type==="touchstart"&&L.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",x),document.addEventListener("mouseup",k),document.addEventListener("touchmove",x),document.addEventListener("touchend",k);const b=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=b.getBoundingClientRect(),b.style.transition="",a.x=Co(L.nativeEvent),a.y=Zo(L.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=b.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=b.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(L){if(a.boundingRect){const{top:b,bottom:U,left:ee,right:P}=a.boundingRect;L.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=ee&&a.x<=P&&a.y>=b&&a.y<=U?Z():h()}}function h(){n(!0)}function Z(){n(!1)}function x(L){const b=i.current;a.canDrag&&b&&(a.didMove=!0,t&&Z(),a.x=Co(L),a.y=Zo(L),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),b.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,b.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",k);const L=i.current;if(a.canDrag&&a.didMove&&L){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();L.style.transition="transform 0.2s, opacity 0.2s",L.style.transform=`translate${e.draggableDirection}(0)`,L.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),be(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const L=A.current;be(L.onClose)&&L.onClose(C.isValidElement(L.children)&&L.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||Z(),window.addEventListener("focus",h),window.addEventListener("blur",Z)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",Z))}),[e.pauseOnFocusLoss]);const Y={onMouseDown:q,onTouchStart:q,onMouseUp:p,onTouchEnd:p};return d&&c&&(Y.onMouseEnter=Z,Y.onMouseLeave=h),y&&(Y.onClick=L=>{m&&m(L),a.canCloseOnClick&&s()}),{playToast:h,pauseToast:Z,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:Y}}function Io(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return C.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},C.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function vA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:d,progress:c,rtl:s,isIn:m,theme:y}=e;const q=i||d&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:q?0:1};d&&(p.transform=`scaleX(${c})`);const h=Qe("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),Z=be(a)?a({rtl:s,type:o,defaultClassName:h}):Qe(h,a);return C.createElement("div",{role:"progressbar","aria-hidden":q?"true":"false","aria-label":"notification timer",className:Z,style:p,[d&&c>=1?"onTransitionEnd":"onAnimationEnd"]:d&&c<1?null:()=>{m&&r()}})}const bA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=yA(e),{closeButton:i,children:a,autoClose:A,onClick:d,type:c,hideProgressBar:s,closeToast:m,transition:y,position:q,className:p,style:h,bodyClassName:Z,bodyStyle:x,progressClassName:k,progressStyle:Y,updateId:L,role:b,progress:U,rtl:ee,toastId:P,deleteToast:Ae,isIn:re,isLoading:te,iconOut:ne,closeOnClick:Q,theme:W}=e,E=Qe("Toastify__toast",`Toastify__toast-theme--${W}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":ee},{"Toastify__toast--close-on-click":Q}),J=be(p)?p({rtl:ee,position:q,type:c,defaultClassName:E}):Qe(E,p),f=!!U||!A,M={closeToast:m,type:c,theme:W};let V=null;return i===!1||(V=be(i)?i(M):C.isValidElement(i)?C.cloneElement(i,M):Io(M)),C.createElement(y,{isIn:re,done:Ae,position:q,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:P,onClick:d,className:J,...o,style:h,ref:r},C.createElement("div",{...re&&{role:b},className:be(Z)?Z({type:c}):Qe("Toastify__toast-body",Z),style:x},ne!=null&&C.createElement("div",{className:Qe("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!te})},ne),C.createElement("div",null,a)),V,C.createElement(vA,{...L&&!f?{key:`pb-${L}`}:{},rtl:ee,theme:W,delay:A,isRunning:t,isIn:re,closeToast:m,hide:s,type:c,style:Y,className:k,controlledProgress:f,progress:U||0})))},_t=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},CA=Ut(_t("bounce",!0));Ut(_t("slide",!0)),Ut(_t("zoom")),Ut(_t("flip"));const Gn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=gA(e),{className:i,style:a,rtl:A,containerId:d}=e;function c(s){const m=Qe("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return be(i)?i({position:s,rtl:A,defaultClassName:m}):Qe(m,Bt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:d},n((s,m)=>{const y=m.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:c(s),style:y,key:`container-${s}`},m.map((q,p)=>{let{content:h,props:Z}=q;return C.createElement(bA,{...Z,isIn:o(Z.toastId),style:{...Z.style,"--nth":p+1,"--len":m.length},key:`toast-${Z.key}`},h)}))}))});Gn.displayName="ToastContainer",Gn.defaultProps={position:"top-right",transition:CA,autoClose:5e3,closeButton:Io,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Tn,Fe=new Map,It=[],ZA=1;function wo(){return""+ZA++}function IA(e){return e&&(Ue(e.toastId)||Zt(e.toastId))?e.toastId:wo()}function wt(e,t){return Fe.size>0?We.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function $t(e,t){return{...t,type:t&&t.type||e,toastId:IA(t)}}function en(e){return(t,n)=>wt(t,$t(e,n))}function ue(e,t){return wt(e,$t("default",t))}ue.loading=(e,t)=>wt(e,$t("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ue.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=Ue(o)?ue.loading(o,n):ue.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(s,m,y)=>{if(m==null)return void ue.dismiss(r);const q={type:s,...A,...n,data:y},p=Ue(m)?{render:m}:m;return r?ue.update(r,{...q,...p}):ue(p.render,{...q,...p}),y},c=be(e)?e():e;return c.then(s=>d("success",a,s)).catch(s=>d("error",i,s)),c},ue.success=en("success"),ue.info=en("info"),ue.error=en("error"),ue.warning=en("warning"),ue.warn=ue.warning,ue.dark=(e,t)=>wt(e,$t("default",{theme:"dark",...t})),ue.dismiss=e=>{Fe.size>0?We.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ue.clearWaitingQueue=function(e){return e===void 0&&(e={}),We.emit(5,e)},ue.isActive=e=>{let t=!1;return Fe.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},ue.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=Fe.get(i||Tn);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:wo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,wt(a,i)}},0)},ue.done=e=>{ue.update(e,{progress:1})},ue.onChange=e=>(We.on(4,e),()=>{We.off(4,e)}),ue.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},ue.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},We.on(2,e=>{Tn=e.containerId||e,Fe.set(Tn,e),It.forEach(t=>{We.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{Fe.delete(e.containerId||e),Fe.size===0&&We.off(0).off(1).off(5)});function xt(e){ue.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Hn="",_e="Playable",Ce=null,xo=null;const tn=async e=>{let t=Hn+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const o=window.URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=n.split("/").reduce((a,A)=>A,""),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(o),xt("Download successfully")}).catch(r=>{console.error("File error:",r)})},wA=(e,t)=>{let n=Hn+"/"+e;Pt(n)?xt("Link Copied"):t(n)};async function nn(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let d=async c=>{r==="download"?await tn(c):r==="copy"&&wA(c,xo)};_e==="Playable"?(n&&await Vt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),mA(Ce,e,t,o,i).then(async c=>{let{url:s}=c;d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):_e==="Flex"?(n&&await yo({_id:e,iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),cA({_id:e,network:t},Ce).then(async c=>{if(c.message){A(c);return}let{url:s}=c;d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):_e==="Import"?dA(Ce,e,t).then(c=>{let s=c.url;d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):_e==="Ready"&&(n&&await Vt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),fA(Ce,e,t).then(async c=>{if(c.message){A(c);return}let s=c.url;await d(s),a(s)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}))})}async function xA(e,t,n){return new Promise(async(r,o)=>{console.log("get multi download"),_e==="Flex"?(await yo({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),uA(e,n,Ce).then(async i=>{if(i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})})):_e==="Ready"?(console.log("ready"),await Vt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),console.log("ready link multi"),hA(e,n,Ce).then(async i=>{if(console.log("res",i),i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{console.log("err",i);let a=i.response.data.error.msg;o({message:a})})):(await Vt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),pA(e,n,Ce).then(async i=>{await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})}))})}function KA(e,t,n,r){_e=e,Ce=t,xo=n,Hn=r}const WA=({versionId:e,typeOfProduct:t,api:n,fetchFileUrl:r,copyLinkUrl:o,setSafariCopyLink:i})=>{const[a,A]=C.useState(!1),d=async()=>{A(!0),nn(e,"default",null,null,!1).then(c=>{A(!1);let s;t==="Flex"?s=`${o}/preview?versionId=${e}`:t==="Import"?s=`${o}/preview?versionId=${e}_`:s=`${o}/preview?versionId=${e}_`,Pt(s)?xt("Link copied"):i(s),A(!1)}).catch(c=>{A(!1)})};return l.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[l.jsx("div",{style:{marginRight:"0.75rem",width:"50%"},children:l.jsx(Vi,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:`${o}/preview?versionId=${e}`+(t==="Flex"?"":"_")})}),l.jsxs("div",{children:[l.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),l.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),l.jsxs("div",{style:{display:"flex",cursor:"pointer",borderRadius:"0.375rem",backgroundColor:"#00A3FF1A",color:"secondary-blue"},children:[l.jsx(Er,{style:{marginRight:"0.25rem",height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),a?l.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",margin:"auto"},children:l.jsx("img",{style:{height:"90%"},src:Be,alt:"loading"})}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},onClick:d,children:"Copy Link"})]})]})]})},MA=({versionName:e,versionId:t,typeOfProduct:n,api:r,iframeUrl:o,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})=>{const[d,c]=C.useState(window.innerWidth);C.useEffect(()=>{const m=()=>{c(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const s=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return l.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:d>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(ci,{iframeUrl:o}),l.jsx(di,{name:s}),l.jsx(WA,{versionId:t,typeOfProduct:n,api:r,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})]})};var ce=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(ce||{});const SA=({typeOfProduct:e})=>l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold"},children:[l.jsx("span",{style:{color:ce[e]},children:"Select a Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]});async function LA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const OA=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[l.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),l.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_518_12094",children:l.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),EA=({creditDownload:e,api:t})=>l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem",paddingRight:"1.5rem",fontWeight:100},children:"If you continue to export, you will spend 1 credit."}),l.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"0.25rem",fontSize:"12px",fontWeight:100},children:["You have"," ",l.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)<0?0:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)})," ","credits remaining.",l.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>LA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(OA,{})]})]})]}),kA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:d,isTest:c,setIsTest:s,urlType:m,setUrlType:y})=>{const q=Y=>{r(Y.target.value)},p=Y=>{o(Y.target.value)},h=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"App Store:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"text",value:n.iosUrl,onChange:q,placeholder:"Ios Url",disabled:i})]}),l.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Google Play:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"text",value:n.googleUrl,onChange:p,placeholder:"Google Url",disabled:i})]})]}),Z=()=>l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"Redirection URL:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"text",value:n.iosUrl,onChange:q,placeholder:"Ios Url",disabled:i})]})}),x=()=>l.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"20px",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ce[e]},type:"checkbox",checked:c,onChange:()=>{s(!c)},placeholder:"Google Url",disabled:i})]}),k=()=>l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",width:"400px",height:"30px",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid #eaeaec",marginBottom:"10px",position:"relative"},className:"tab-switch",children:[l.jsx("div",{style:{position:"absolute",bottom:"-3px",left:m==="single"?"0":"50%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="0",document.getElementById("single-tab").style.color="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{y("single")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="single"?"#000":"#a3a3a3",fontWeight:m==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Single URL"})},"singleTab"),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="50%",document.getElementById("single-tab").style.color="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{y("game")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="game"?"#000":"#a3a3a3",fontWeight:m==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"Multi URL"})},"gameTab")]})});return l.jsx(l.Fragment,{children:e!=="Import"&&l.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[d.customer=="playableFactoryInternal"&&e==="Playable"&&l.jsx(x,{}),e==="Ready"&&l.jsx(k,{}),m==="game"&&l.jsx(h,{}),m==="single"&&l.jsx(Z,{}),(A==null?void 0:A.willSpendCredit)&&l.jsx(EA,{creditDownload:A,api:a})]})})},zA=({typeOfProduct:e,title:t,fileSize:n})=>l.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[l.jsx("span",{style:{color:ce[e]},children:t}),n&&l.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),YA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:q})=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid #D1D5DB",paddingLeft:"1.25rem",paddingRight:"1.25rem",gap:"0.5rem"},children:[l.jsx(zA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(kA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:q}),l.jsx(SA,{typeOfProduct:e})]}),Ko=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>l.jsx("button",{onClick:n,className:t,style:{display:"flex",height:"40px",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",border:"1px solid lightgray",padding:"0.25rem",fontSize:"0.875rem",width:200,backgroundColor:"#FFFFFF"},disabled:r||o,children:e}),jA=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return l.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:l.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[l.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all ease-in-out",border:"1px solid lightgray",opacity:1},id:n,checked:r,onChange:i}),l.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:r?1:0,transition:"opacity ease-in-out"},children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:ce[t],stroke:ce[t],strokeWidth:"1",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})," "]})]})})},Nl="",JA=({typeOfProduct:e})=>l.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:l.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ce[e]}})]})}),Xn=({isNetworksLoading:e=!1})=>l.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:l.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Be,alt:"pf-logo-gif"})}),NA=({title:e,titleId:t,...n})=>l.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":t,...n,children:[e?l.jsx("title",{id:t,children:e}):null,l.jsx("path",{stroke:"currentColor",d:"m15.985 11.111-3.556 3.556-3.556-3.556M12.429 4v10.667M20.429 16.444A3.556 3.556 0 0 1 16.873 20H7.985a3.556 3.556 0 0 1-3.556-3.556",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),DA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i})=>{let a="";return!t&&!n?a="Both links are empty. Are you sure you want to continue?":t?n||(a="Google link is empty. Are you sure you want to continue?"):a="iOS link is empty. Are you sure you want to continue?",l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",maxWidth:"350px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:a}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:()=>{e(!1)},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #666666",padding:"0.5rem",fontWeight:"bold",transition:"all 0.15s ease-linear"},children:"No"}),l.jsx("button",{onClick:async A=>{r==="download"?await i():r==="copyLink"&&await o(),e()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid red",backgroundColor:"darkorange",padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:"Yes"})]})]})]})},Wo=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:350,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:"You are going to spend 1 credit for this download, do you want to continue?"}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),l.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async i=>{i.preventDefault(),i.stopPropagation(),r==="download"?(await n(),await o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),RA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:e,children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},onClick:a=>{a.stopPropagation()},children:l.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Be,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:t,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),i?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Be,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:()=>{t(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),l.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:l.jsx("img",{width:"25px",height:"25px",src:Be,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:n,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:"Download Moloco Test"})})]})})]});async function GA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const Mo=({fill:e,stroke:t,className:n,style:r})=>l.jsxs("svg",{width:"115",height:"114",viewBox:"0 0 115 114",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,children:[l.jsx("ellipse",{cx:"57.5623",cy:"56.7577",rx:"56.6053",ry:"56.4569",fill:"white"}),l.jsx("path",{d:"M24.7305 79.2015C24.7305 82.0917 24.8379 84.0921 24.9789 85.4794C25.2764 88.4065 27.6305 90.083 30.2086 90.1693C31.2215 90.2031 32.5619 90.2283 34.3121 90.2283C36.0623 90.2283 37.4027 90.2031 38.4155 90.1693C40.9937 90.083 43.3477 88.4065 43.6453 85.4794C43.7863 84.0921 43.8937 82.0917 43.8937 79.2015C43.8937 76.3114 43.7863 74.311 43.6453 72.9237C43.3477 69.9966 40.9937 68.3201 38.4155 68.2338C37.4027 68.1999 36.0623 68.1748 34.3121 68.1748C32.5619 68.1748 31.2215 68.1999 30.2086 68.2338C27.6305 68.3201 25.2764 69.9966 24.9789 72.9237C24.8379 74.311 24.7305 76.3114 24.7305 79.2015Z",fill:"#8BCF40"}),l.jsx("path",{d:"M71.9004 68.9101C71.9004 77.2702 72.0947 82.0161 72.289 84.6796C72.5046 87.6344 74.669 89.94 77.7461 90.1279C78.7253 90.1876 79.9532 90.2285 81.482 90.2285C83.0108 90.2285 84.2387 90.1876 85.218 90.1279C88.295 89.94 90.4594 87.6344 90.6751 84.6796C90.8694 82.0161 91.0636 77.2702 91.0636 68.9101C91.0636 60.5501 90.8694 55.8042 90.6751 53.1407C90.4594 50.1859 88.295 47.8803 85.218 47.6924C84.2387 47.6327 83.0108 47.5918 81.482 47.5918C79.9532 47.5918 78.7253 47.6327 77.7461 47.6924C74.669 47.8803 72.5046 50.1859 72.289 53.1407C72.0947 55.8042 71.9004 60.5501 71.9004 68.9101Z",fill:"#8BCF40"}),l.jsx("path",{d:"M48.3164 74.7919C48.3164 79.8075 48.4618 82.9723 48.6297 84.9622C48.8836 87.973 51.195 90.029 54.1148 90.1567C55.0924 90.1995 56.3343 90.2293 57.898 90.2293C59.4618 90.2293 60.7037 90.1995 61.6813 90.1567C64.601 90.029 66.9124 87.973 67.1664 84.9621C67.3343 82.9723 67.4797 79.8075 67.4797 74.7919C67.4797 69.7764 67.3343 66.6116 67.1664 64.6217C66.9124 61.6109 64.601 59.5549 61.6813 59.4271C60.7037 59.3843 59.4618 59.3545 57.898 59.3545C56.3343 59.3545 55.0924 59.3843 54.1148 59.4271C51.195 59.5549 48.8836 61.6109 48.6297 64.6217C48.4618 66.6116 48.3164 69.7764 48.3164 74.7919Z",fill:"#8BCF40"}),l.jsx("path",{d:"M84.6819 24.1036C82.5944 24.0168 78.1969 24.0056 73.191 25.0298C70.2379 25.634 69.4377 29.1745 71.3961 31.1279L74.0374 33.7623C73.1954 34.5241 72.1093 35.5228 70.8815 36.6895C68.0243 39.4044 64.3529 43.0729 61.2048 46.803C61.1649 46.8502 61.0921 46.8943 60.9809 46.8912C60.9293 46.8898 60.8925 46.8774 60.8726 46.8674C60.8577 46.8598 60.8477 46.852 60.835 46.8345C59.4972 44.9673 57.726 42.5735 55.8505 40.2596C54.0307 38.0144 50.776 37.4362 48.2948 39.1139C44.7474 41.5126 37.3817 47.0411 29.1424 56.4388C28.6422 57.0094 28.1388 57.5941 27.6327 58.1935C26.5838 59.4356 26.7432 61.2905 27.9886 62.3368C29.234 63.3828 31.0938 63.2239 32.1427 61.9818C32.625 61.4107 33.1047 60.8534 33.5812 60.3099C41.2675 51.5431 48.105 46.3693 51.3981 44.1213C53.1257 46.2623 54.771 48.4857 56.0375 50.2535C58.3937 53.5424 63.2069 53.563 65.7159 50.5902C68.6648 47.0959 72.1618 43.5954 74.9487 40.9474C76.2434 39.7171 77.3748 38.6804 78.2119 37.9258L81.0367 40.7433C82.9954 42.6967 86.5451 41.8985 87.151 38.9532C88.1778 33.9604 88.1666 29.5744 88.0795 27.4924C88.0024 25.6466 86.5326 24.1806 84.6819 24.1036Z",fill:"#8BCF40"})]}),TA=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],HA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:d,versionId:c,api:s,handleDownloadError:m,fetchFileUrl:y,urls:q,game:p,setIsConfirmActive:h,creditDownload:Z,getDownloadCount:x,disabled:k,user:Y,setSafariCopyLink:L,isTest:b})=>{const[U,ee]=C.useState(!1),[P,Ae]=C.useState(""),[re,te]=C.useState(!1),[ne,Q]=C.useState(!1),[W,E]=C.useState(!1),[J,f]=C.useState("download"),[M,V]=C.useState(!1),[g,I]=C.useState(!1),[R,K]=C.useState(!1);let z={aarki:"html,copy",adcolony:"copy,html",adjoe:"copy,html",applovin:"copy,html",appreciate:"zip",chartboost:"copy,html",criteo:"zip",crossinstall:"copy,html",default:"copy",fb:"zip",fyber:"copy,html",google:"zip",google360:"zip",ironsource:"copy,html",kayzen:"apikey",kaden:"html",kidoz:"html",lifestreet:"copy,html",liftoff:"copy,zip",mobvista:"html",moloco:"html,molocotest",molocoV2:"html,molocotest",nucleo:"copy,html",oceanengine:"copy,zip",pointblank:"html",smadex:"zip",snapchat:"zip",tapjoy:"copy,html",tencent:"zip",toutiao:"copy,zip",toutiao_cn:"copy,zip",unity:"copy,html",vungle:"html",web:"copy,html",yandex:"zip",zucks:"copy,html",luna:"zip",inmobi:"copy,html,",nend:"html",adikteev:"html",jammp:"copy,html"};const B=()=>{n(e)},N=async(j,D)=>(ee(!0),new Promise((se,S)=>{nn(c,j,q,D,b).then(he=>{ee(!1),se(he)}).catch(he=>{ee(!1),m(he.message,he),S(he)})})),T=async(j=!1)=>{j?I(!0):V(!0);const D={};j&&(D.molocoGenerateHtml=!0),nn(c,o,q,"download",b,D).then(se=>{j?I(!1):V(!1),E(!1)}).catch(se=>{m(se.message,se)})},G=async()=>{K(!0);const j=await GA(s,c,o,d);let D=`${y}/${j==null?void 0:j.url}`;Pt(D)?(xt("Link Copied"),K(!1)):L(D)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?ce[d]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+d,onClick:B,children:[l.jsxs("div",{style:{marginTop:"40px",display:"flex",justifyContent:"center"},children:[l.jsxs("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:[TA.includes(o)&&d!=="Import"&&l.jsx(Mo,{fill:ce[d],stroke:ce[d],className:"mb-1 inline-block w-6",style:{marginBottom:"0.25rem",display:"inline-block",width:"1.5rem",height:"auto"}}),l.jsx("div",{children:i&&i.map(j=>j.network).includes(o)?a?l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center",marginRight:"2rem"},children:l.jsx(JA,{typeOfProduct:d})}):i.map(j=>l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",marginRight:"2rem",fontSize:"1rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center"},children:j.network===o?j.size.toString().slice(0,5)+"Mb":""},j.network)):null})]}),l.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(d==="Playable"||d==="Ready"||d==="Flex")&&A&&l.jsx(jA,{checked:r,typeOfProduct:d,id:e})}),l.jsx("img",{onClick:B,style:{width:"30rem",height:"50px",objectFit:"contain"},src:t})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[l.jsxs(Ko,{className:"w-2/3 border-hover-"+d,downloading:U,onClickDonwload:async j=>{if(j.stopPropagation(),(o==="moloco"||o==="molocoV2")&&Y.customer==="playableFactoryInternal"){E(!0);return}else{Ae("download");const D=q.iosUrl,se=q.googleUrl;Z&&Z.willSpendCredit?(h(!0),f("download"),te(!0)):d!=="Import"&&(!D||!se)?(h(!0),Q(!0)):(Q(!1),te(!1),await N(o,"download"))}},children:[!U&&l.jsxs(l.Fragment,{children:[l.jsx(NA,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1.5rem",stroke:"dark-full"}}),"Download"]}),U&&l.jsx(Xn,{})]}),z[o]&&z[o].includes("copy")&&l.jsx(Ko,{className:"w-1/3 border-hover-"+d,onClickDonwload:async j=>{j.stopPropagation(),Ae("copyLink");const D=q.iosUrl,se=q.googleUrl;Z&&(Z!=null&&Z.willSpendCredit)?(f("copy"),h(!0),te(!0)):d!=="Import"&&(!D||!se)?(h(!0),Q(!0)):(te(!1),Q(!1),await N(o,"copy"))},disabled:k,children:l.jsx(Er,{className:"h-6 w-6 stroke-dark-full"})})]})]}),re&&l.jsx(Wo,{creditConfirmType:J,handleCopyLink:async()=>{Q(!1),h(!1),await N(o,"copy")},download:async()=>{Q(!1),h(!1),await N(o,"download")},onClose:()=>{te(!1),h(!1)},getDownloadCount:x}),ne&&l.jsx(DA,{onClose:()=>{Q(!1),h(!1)},iosLink:q.iosUrl,googleLink:q.googleUrl,buttonType:P,handleCopyLink:async()=>{Q(!1),h(!1),await N(o,"copy")},download:async()=>{Q(!1),h(!1),await N(o,"download")}}),W&&Y.customer==="playableFactoryInternal"&&l.jsx(RA,{onClose:()=>{E(!1)},handleDownload:T,handleDownloadMolocoTest:G,downloadingMoloco:M,donwloadintMolocoTest:R,downloadingMolocoHtml:g})]})},Qn=[{id:"1",name:"unity",imageSrc:"https://gearbox.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://gearbox.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://gearbox.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://gearbox.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://gearbox.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://gearbox.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://gearbox.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://gearbox.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://gearbox.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://gearbox.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://gearbox.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://gearbox.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://gearbox.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://gearbox.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://gearbox.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://gearbox.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://gearbox.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://gearbox.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://gearbox.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://gearbox.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://gearbox.playablefactory.com/liftoff.png"},{id:"22",name:"moloco",imageSrc:"https://gearbox.playablefactory.com/moloco.png"},{id:"23",name:"nucleo",imageSrc:"https://gearbox.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://gearbox.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://gearbox.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://gearbox.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://gearbox.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://gearbox.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://gearbox.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://gearbox.playablefactory.com/yandex.png"},{id:"33",name:"web",imageSrc:"https://gearbox.playablefactory.com/web.png"},{id:"34",name:"zucks",imageSrc:"https://gearbox.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://gearbox.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://gearbox.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://gearbox.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://gearbox.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://gearbox.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://gearbox.playablefactory.com/adjoe.png"},{id:"44",name:"molocoV2",imageSrc:"https://gearbox.playablefactory.com/molocoV2.png"},{id:"45",name:"adikteev",imageSrc:"https://gearbox.playablefactory.com/adikteev.png"},{id:"46",name:"appier",imageSrc:"https://gearbox.playablefactory.com/appier.png"},{id:"47",name:"remerge",imageSrc:"https://gearbox.playablefactory.com/remerge.png"},{id:"48",name:"persona",imageSrc:"https://gearbox.playablefactory.com/persona.png"}],XA=({typeOfProduct:e})=>l.jsx("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem"},children:l.jsx("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"0.875rem",fontWeight:"bold",height:"1.5rem"},children:e!=="Import"&&l.jsxs(l.Fragment,{children:[l.jsx(Mo,{fill:ce[e],stroke:ce[e],style:{display:"inline-block",width:"1.5rem",height:"auto"},className:""}),l.jsx("span",{style:{display:"flex",alignItems:"center",marginTop:"0.25rem",marginLeft:"0.25rem"},children:"Data tracking functionality is turned on by default for marked network downloads"})]})})}),QA=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const o={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:ce[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return l.jsx("button",{onClick:r,className:n,style:o,children:e})},VA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?l.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:ce[t]},children:l.jsx(Xn,{})}):l.jsx(QA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),PA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,getDownloadCount:m,disabled:y,setSafariCopyLink:q,isTest:p})=>{const[h,Z]=C.useState([]),[x,k]=C.useState([]),[Y,L]=C.useState(!1),[b,U]=C.useState(""),[ee,P]=C.useState(!1),[Ae,re]=C.useState(!1),[te,ne]=C.useState("download"),[Q,W]=C.useState(!1),E=async M=>{const V=[...h];if(h.includes(M)){const g=V.findIndex(I=>I===M);V.splice(g,1),Z(V)}else V.push(M),Z([...h,M]);Qn.filter(g=>[...V].includes(g.id)).map(g=>g.name)},J=async()=>(console.log("multi download"),new Promise(async(M,V)=>{const g=Qn.filter(I=>[...h].includes(I.id)).map(I=>I.name);P(!0),console.log("get multi download"),xA(r,c,g).then(I=>{console.log("get multi download res"),P(!1),M(I)}).catch(I=>{console.log("get multi download err"),P(!1),A(I.message,I),V(I)})})),f=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(re(!0),ne("download"),W(!0)):(W(!1),await J())};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",flex:1,overflowY:Ae?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:[l.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&Qn.filter(M=>{var V;return t&&((V=t==null?void 0:t.networks)==null?void 0:V.length)>0?t==null?void 0:t.networks.includes(M.name):o==="Import"?e==null?void 0:e.networks.filter(g=>g.status==="paid").some(g=>g.name===M.name):e==null?void 0:e.networks.includes(M.name)}).filter(M=>M.name==="voodoo"?a.customer==="customer:20":!0).map(M=>l.jsx(HA,{id:M.id,name:M.name,imageUrl:M.imageSrc,selected:h.includes(M.id),handleCardClick:E,networkVersionSize:x,fileSizeLoading:Y,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,creditDownload:t,setIsConfirmActive:re,getDownloadCount:m,disabled:y,user:a,setSafariCopyLink:q,isTest:p},M.id))}),l.jsx(XA,{typeOfProduct:o})]}),h.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&l.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:l.jsx(VA,{onClickMultiDownload:f,networksVersionTotalSize:b,typeOfProduct:o,multiDownloading:ee})}),Q&&l.jsx(Wo,{creditConfirmType:te,handleCopyLink:async()=>{},download:async()=>{W(!1),re(!1),await J()},onClose:()=>{W(!1),re(!1)},getDownloadCount:m})]})};async function BA(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}async function UA(e,t){return(await fe.post(t+"/getFlexDownloadCount",e)).data}async function FA(e,t){try{return(await fe.post(t+"/findGame",{_id:e})).data}catch{}}async function _A(e,t){return(await fe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function $A(e,t){return(await fe.post(t+"/getFlexData",{_id:e})).data}async function es(e,t){return(await fe.post(t+"/getImportedPlayable",{id:e})).data}async function ts(e,t){return(await fe.post(t+"/getReadyDownloadCount",e)).data}const ns=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],rs=["adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"],os=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:d,fetchFileUrl:c,fileSize:s,setFileSize:m,setSafariCopyLink:y})=>{const[q,p]=C.useState(null),[h,Z]=C.useState(null),[x,k]=C.useState(null),[Y,L]=C.useState(!1),[b,U]=C.useState("Loading..."),[ee,P]=C.useState("Loading..."),[Ae,re]=C.useState(!0),[te,ne]=C.useState(window.innerWidth),[Q,W]=C.useState(!1),[E,J]=C.useState("single");C.useEffect(()=>{const K=()=>{ne(window.innerWidth)};return window.addEventListener("resize",K),()=>{window.removeEventListener("resize",K)}},[]);const f=async()=>{L(!0);const K=await BA(e,i);return K!=null&&K.networks||(K.networks=ns),p(K),K},M=K=>{U(K)},V=K=>{P(K)},g=async(K,z)=>{var B,N;try{let T;if(r==="Playable"||r==="Ready"){const G=await _A(t,i);if(G){U(G.iosLink),P(G.androidLink),L(!1);return}if(K&&(K.iosUrl||K.googleUrl)){U(K.iosUrl),P(K.googleUrl),L(!1);return}if(z&&z.html){let j=await fetch(c+"/"+z.html).then(S=>S.text());const D=((B=j.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:B.at(1))||"";U(D);const se=((N=j.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:N.at(1))||"";P(se),L(!1)}else P(""),U(""),L(!1)}else if(r==="Flex"){const G=await $A(t,i);if(G.googleUrl||G.iosUrl){P(G.googleUrl),U(G.iosUrl),L(!1);return}K&&(K.iosUrl||K.googleUrl)?(U(K.iosUrl),P(K.googleUrl),L(!1)):(P(""),U(""),L(!1))}}catch(T){d(T.response.data.error.msg)}},I=async()=>{L(!0);let K;r==="Flex"?K=await UA({_id:t},i):r==="Ready"&&(K=await ts({_id:t},i)),K&&(["admin","pm","tester"].includes(a.role)?k({...K,networks:rs}):k(K)),L(!1)},R=async()=>await FA(n,i);return C.useEffect(()=>{o||(p(null),Z(null),k(null),m(null)),o&&(r==="Playable"?(f().then(K=>{g(null,K)}),re(!1)):r==="Ready"?I().then(K=>{f().then(z=>{g(null,z),re(!1)})}):r==="Flex"?I().then(K=>{re(!1),R().then(z=>{o&&(g(z,null),re(!1),Z(z))})}):r==="Import"&&es(t,i).then(K=>{console.log(K),p(K),U(K.iosUrl||""),P(K.googleUrl||""),L(!1),re(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:te>1440?"700px":"650px",width:te>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(YA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:b,googleUrl:ee},handleIosChange:M,handleGoogleChange:V,disabled:Ae,api:i,creditDownload:x,user:a,isTest:Q,setIsTest:W,urlType:E,setUrlType:J}),Y?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Xn,{isNetworksLoading:!0})}):(q||x)&&(r==="Flex"?h:!0)&&!Y&&b!=="Loading..."&&ee!=="Loading..."&&l.jsx(PA,{playable:q,creditDownload:x,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:d,fetchFileUrl:c,urls:{iosUrl:b,googleUrl:ee},game:h,getDownloadCount:I,disabled:Ae,setSafariCopyLink:y,isTest:Q})]})},Dl="";var Vn={exports:{}},$e={},Pn={exports:{}},Le={},Bn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
51
51
  * Adapted from jQuery UI core
52
52
  *
53
53
  * http://jqueryui.com