gearboxdownloadmodal 6.0.72 → 6.0.73
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.es.js +239 -264
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/insights.svg +14 -14
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -47,7 +47,7 @@ Valid keys: `+JSON.stringify(Object.keys(x),null," "));var j=me(U,F,N,D,V+"."+F
|
|
|
47
47
|
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&CA[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},$i=Symbol("internals");function Rt(e){return e&&String(e).trim().toLowerCase()}function qn(e){return e===!1||e==null?e:w.isArray(e)?e.map(qn):String(e)}function xA(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 wA=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ar(e,t,n,r,i){if(w.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!w.isString(t)){if(w.isString(r))return t.indexOf(r)!==-1;if(w.isRegExp(r))return r.test(t)}}function IA(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function SA(e,t){const n=w.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}class vn{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(s,l,u){const A=Rt(l);if(!A)throw new Error("header name must be a non-empty string");const d=w.findKey(i,A);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=qn(s))}const a=(s,l)=>w.forEach(s,(u,A)=>o(u,A,l));return w.isPlainObject(t)||t instanceof this.constructor?a(t,n):w.isString(t)&&(t=t.trim())&&!wA(t)?a(ZA(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=Rt(t),t){const r=w.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return xA(i);if(w.isFunction(n))return n.call(this,i,r);if(w.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Rt(t),t){const r=w.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ar(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=Rt(a),a){const s=w.findKey(r,a);s&&(!n||ar(r,r[s],s,n))&&(delete r[s],i=!0)}}return w.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||ar(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return w.forEach(this,(i,o)=>{const a=w.findKey(r,o);if(a){n[a]=qn(i),delete n[o];return}const s=t?IA(o):String(o).trim();s!==o&&delete n[o],n[s]=qn(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return w.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&w.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(i=>r.set(i)),r}static accessor(t){const r=(this[$i]=this[$i]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=Rt(a);r[s]||(SA(i,a),r[s]=!0)}return w.isArray(t)?t.forEach(o):o(t),this}}vn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),w.reduceDescriptors(vn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),w.freezeMethods(vn);const $e=vn;function sr(e,t){const n=this||or,r=t||n,i=$e.from(r.headers);let o=r.data;return w.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function eo(e){return!!(e&&e.__CANCEL__)}function Jt(e,t,n){le.call(this,e??"canceled",le.ERR_CANCELED,t,n),this.name="CanceledError"}w.inherits(Jt,le,{__CANCEL__:!0});function KA(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new le("Request failed with status code "+n.status,[le.ERR_BAD_REQUEST,le.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const LA=Fe.isStandardBrowserEnv?function(){return{write:function(n,r,i,o,a,s){const l=[];l.push(n+"="+encodeURIComponent(r)),w.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),w.isString(o)&&l.push("path="+o),w.isString(a)&&l.push("domain="+a),s===!0&&l.push("secure"),document.cookie=l.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 OA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function EA(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function to(e,t){return e&&!OA(t)?EA(e,t):t}const MA=Fe.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let a=o;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=i(window.location.href),function(a){const s=w.isString(a)?i(a):a;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function kA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function WA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),A=r[o];a||(a=u),n[i]=l,r[i]=u;let d=o,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),u-a<t)return;const g=A&&u-A;return g?Math.round(f*1e3/g):void 0}}function no(e,t){let n=0;const r=WA(50,250);return i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,l=r(s),u=o<=a;n=o;const A={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:i};A[t?"download":"upload"]=!0,e(A)}}const Ar={http:AA,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const o=$e.from(e.headers).normalize(),a=e.responseType;let s;function l(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}let u;w.isFormData(i)&&(Fe.isStandardBrowserEnv||Fe.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?w.isString(u=o.getContentType())&&o.setContentType(u.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let A=new XMLHttpRequest;if(e.auth){const y=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(y+":"+m))}const d=to(e.baseURL,e.url);A.open(e.method.toUpperCase(),Bi(d,e.params,e.paramsSerializer),!0),A.timeout=e.timeout;function f(){if(!A)return;const y=$e.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),h={data:!a||a==="text"||a==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:y,config:e,request:A};KA(function(C){n(C),l()},function(C){r(C),l()},h),A=null}if("onloadend"in A?A.onloadend=f:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(f)},A.onabort=function(){A&&(r(new le("Request aborted",le.ECONNABORTED,e,A)),A=null)},A.onerror=function(){r(new le("Network Error",le.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let m=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||Fi;e.timeoutErrorMessage&&(m=e.timeoutErrorMessage),r(new le(m,h.clarifyTimeoutError?le.ETIMEDOUT:le.ECONNABORTED,e,A)),A=null},Fe.isStandardBrowserEnv){const y=MA(d)&&e.xsrfCookieName&&LA.read(e.xsrfCookieName);y&&o.set(e.xsrfHeaderName,y)}i===void 0&&o.setContentType(null),"setRequestHeader"in A&&w.forEach(o.toJSON(),function(m,h){A.setRequestHeader(h,m)}),w.isUndefined(e.withCredentials)||(A.withCredentials=!!e.withCredentials),a&&a!=="json"&&(A.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&A.addEventListener("progress",no(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&A.upload&&A.upload.addEventListener("progress",no(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=y=>{A&&(r(!y||y.type?new Jt(null,e,A):y),A.abort(),A=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const g=kA(d);if(g&&Fe.protocols.indexOf(g)===-1){r(new le("Unsupported protocol "+g+":",le.ERR_BAD_REQUEST,e));return}A.send(i||null)})}};w.forEach(Ar,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ro=e=>`- ${e}`,jA=e=>w.isFunction(e)||e===null||e===!1,io={getAdapter:e=>{e=w.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){n=e[o];let a;if(r=n,!jA(n)&&(r=Ar[(a=String(n)).toLowerCase()],r===void 0))throw new le(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+o]=r}if(!r){const o=Object.entries(i).map(([s,l])=>`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
|
|
49
49
|
`+o.map(ro).join(`
|
|
50
|
-
`):" "+ro(o[0]):"as no adapter specified";throw new le("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ar};function lr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Jt(null,e)}function oo(e){return lr(e),e.headers=$e.from(e.headers),e.data=sr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),io.getAdapter(e.adapter||or.adapter)(e).then(function(r){return lr(e),r.data=sr.call(e,e.transformResponse,r),r.headers=$e.from(r.headers),r},function(r){return eo(r)||(lr(e),r&&r.response&&(r.response.data=sr.call(e,e.transformResponse,r.response),r.response.headers=$e.from(r.response.headers))),Promise.reject(r)})}const ao=e=>e instanceof $e?e.toJSON():e;function bt(e,t){t=t||{};const n={};function r(u,A,d){return w.isPlainObject(u)&&w.isPlainObject(A)?w.merge.call({caseless:d},u,A):w.isPlainObject(A)?w.merge({},A):w.isArray(A)?A.slice():A}function i(u,A,d){if(w.isUndefined(A)){if(!w.isUndefined(u))return r(void 0,u,d)}else return r(u,A,d)}function o(u,A){if(!w.isUndefined(A))return r(void 0,A)}function a(u,A){if(w.isUndefined(A)){if(!w.isUndefined(u))return r(void 0,u)}else return r(void 0,A)}function s(u,A,d){if(d in t)return r(u,A);if(d in e)return r(void 0,u)}const l={url:o,method:o,data:o,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:s,headers:(u,A)=>i(ao(u),ao(A),!0)};return w.forEach(Object.keys(Object.assign({},e,t)),function(A){const d=l[A]||i,f=d(e[A],t[A],A);w.isUndefined(f)&&d!==s||(n[A]=f)}),n}const so="1.6.0",ur={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ur[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ao={};ur.transitional=function(t,n,r){function i(o,a){return"[Axios v"+so+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(t===!1)throw new le(i(a," has been removed"+(n?" in "+n:"")),le.ERR_DEPRECATED);return n&&!Ao[a]&&(Ao[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,s):!0}};function zA(e,t,n){if(typeof e!="object")throw new le("options must be an object",le.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const s=e[o],l=s===void 0||a(s,o,e);if(l!==!0)throw new le("option "+o+" must be "+l,le.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new le("Unknown option "+o,le.ERR_BAD_OPTION)}}const cr={assertOptions:zA,validators:ur},ot=cr.validators;class bn{constructor(t){this.defaults=t,this.interceptors={request:new Ui,response:new Ui}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=bt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&cr.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),i!=null&&(w.isFunction(i)?n.paramsSerializer={serialize:i}:cr.assertOptions(i,{encode:ot.function,serialize:ot.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&w.merge(o.common,o[n.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=$e.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let A,d=0,f;if(!l){const y=[oo.bind(this),void 0];for(y.unshift.apply(y,s),y.push.apply(y,u),f=y.length,A=Promise.resolve(n);d<f;)A=A.then(y[d++],y[d++]);return A}f=s.length;let g=n;for(d=0;d<f;){const y=s[d++],m=s[d++];try{g=y(g)}catch(h){m.call(this,h);break}}try{A=oo.call(this,g)}catch(y){return Promise.reject(y)}for(d=0,f=u.length;d<f;)A=A.then(u[d++],u[d++]);return A}getUri(t){t=bt(this.defaults,t);const n=to(t.baseURL,t.url);return Bi(n,t.params,t.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(t){bn.prototype[t]=function(n,r){return this.request(bt(r||{},{method:t,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,s){return this.request(bt(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}bn.prototype[t]=n(),bn.prototype[t+"Form"]=n(!0)});const Cn=bn;class dr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new Jt(o,a,s),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 dr(function(i){t=i}),cancel:t}}}const YA=dr;function NA(e){return function(n){return e.apply(null,n)}}function RA(e){return w.isObject(e)&&e.isAxiosError===!0}const fr={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(fr).forEach(([e,t])=>{fr[t]=e});const JA=fr;function lo(e){const t=new Cn(e),n=ki(Cn.prototype.request,t);return w.extend(n,Cn.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return lo(bt(e,i))},n}const be=lo(or);be.Axios=Cn,be.CanceledError=Jt,be.CancelToken=YA,be.isCancel=eo,be.VERSION=so,be.toFormData=yn,be.AxiosError=le,be.Cancel=be.CanceledError,be.all=function(t){return Promise.all(t)},be.spread=NA,be.isAxiosError=RA,be.mergeConfig=bt,be.AxiosHeaders=$e,be.formToJSON=e=>_i(w.isHTMLForm(e)?new FormData(e):e),be.getAdapter=io.getAdapter,be.HttpStatusCode=JA,be.default=be;const DA=be;/*! typescript-cookie v1.0.6 | MIT */const uo=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),co=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),mr=decodeURIComponent,pr=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function TA(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 fo(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,i={};let o;for(;(o=r.exec(document.cookie))!=null;)try{const a=n(o[1]);if(i[a]=t(o[2],a),e===a)break}catch{}return e!=null?i[e]:i}const mo=Object.freeze({decodeName:mr,decodeValue:pr,encodeName:uo,encodeValue:co}),hr=Object.freeze({path:"/"});function po(e,t,n=hr,{encodeValue:r=co,encodeName:i=uo}={}){return document.cookie=`${i(e)}=${r(t,e)}${TA(n)}`}function ho(e,{decodeValue:t=pr,decodeName:n=mr}={}){return fo(e,t,n)}function GA({decodeValue:e=pr,decodeName:t=mr}={}){return fo(void 0,e,t)}function HA(e,t=hr){po(e,"",Object.assign({},t,{expires:-1}))}function gr(e,t){const n={set:function(i,o,a){return po(i,o,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(i){if(arguments.length===0)return GA(this.converter.read);if(i!=null)return ho(i,this.converter.read)},remove:function(i,o){HA(i,Object.assign({},this.attributes,o))},withAttributes:function(i){return gr(this.converter,Object.assign({},this.attributes,i))},withConverter:function(i){return gr(Object.assign({},this.converter,i),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}gr({read:mo.decodeValue,write:mo.encodeValue},hr);let go;typeof window<"u"&&(go=ho("token"));const ge=DA.create({headers:{Authorization:go}});async function PA(e,t,n){return(await ge.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function XA(e,t){return e.network=="fb"&&(e.zip=1),(await ge.post(t+"/createFlexVersionLink",e||{})).data}async function VA(e,t,n){return(await ge.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function QA(e,t,n,r,i){return(await ge.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:i})).data}async function BA(e,t,n){return(await ge.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function UA(e,t,n,r,i){return(await ge.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:i})).data}async function FA(e,t,n){return(await ge.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function _A(e,t,n,r,i,o,a,s){return(await ge.post(e+"/createFusionVersionLink",{_id:t,network:n,fusionData:r,isPfTest:i,extras:o,androidLink:a,iosLink:s})).data}async function $A(e,t){return(await ge.post(t+"/updateFusionUrl",e||{})).data}async function el(e,t){return(await ge.post(t+"/getCdnExportName",e||{})).data}async function tl(e,t){return(await ge.post(t+"/updateFlexUrl",e||{})).data}async function yo(e,t,n){return(await ge.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Ct(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 qo(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=qo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=qo(e))&&(r&&(r+=" "),r+=t);return r}const Dt=e=>typeof e=="number"&&!isNaN(e),lt=e=>typeof e=="string",Ke=e=>typeof e=="function",Zn=e=>lt(e)||Ke(e)?e:null,yr=e=>Z.isValidElement(e)||lt(e)||Ke(e)||Dt(e);function nl(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function xn(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:o=300}=e;return function(a){let{children:s,position:l,preventExitTransition:u,done:A,nodeRef:d,isIn:f}=a;const g=r?`${t}--${l}`:t,y=r?`${n}--${l}`:n,m=Z.useRef(0);return Z.useLayoutEffect(()=>{const h=d.current,b=g.split(" "),C=L=>{L.target===d.current&&(h.dispatchEvent(new Event("d")),h.removeEventListener("animationend",C),h.removeEventListener("animationcancel",C),m.current===0&&L.type!=="animationcancel"&&h.classList.remove(...b))};h.classList.add(...b),h.addEventListener("animationend",C),h.addEventListener("animationcancel",C)},[]),Z.useEffect(()=>{const h=d.current,b=()=>{h.removeEventListener("animationend",b),i?nl(h,A,o):A()};f||(u?b():(m.current=1,h.className+=` ${y}`,h.addEventListener("animationend",b)))},[f]),Z.createElement(Z.Fragment,null,s)}}function vo(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 je={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)})}},wn=e=>{let{theme:t,type:n,...r}=e;return Z.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},qr={info:function(e){return Z.createElement(wn,{...e},Z.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 Z.createElement(wn,{...e},Z.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 Z.createElement(wn,{...e},Z.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 Z.createElement(wn,{...e},Z.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 Z.createElement("div",{className:"Toastify__spinner"})}};function rl(e){const[,t]=Z.useReducer(g=>g+1,0),[n,r]=Z.useState([]),i=Z.useRef(null),o=Z.useRef(new Map).current,a=g=>n.indexOf(g)!==-1,s=Z.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:g=>o.get(g)}).current;function l(g){let{containerId:y}=g;const{limit:m}=s.props;!m||y&&s.containerId!==y||(s.count-=s.queue.length,s.queue=[])}function u(g){r(y=>g==null?[]:y.filter(m=>m!==g))}function A(){const{toastContent:g,toastProps:y,staleId:m}=s.queue.shift();f(g,y,m)}function d(g,y){let{delay:m,staleId:h,...b}=y;if(!yr(g)||function(Q){return!i.current||s.props.enableMultiContainer&&Q.containerId!==s.props.containerId||o.has(Q.toastId)&&Q.updateId==null}(b))return;const{toastId:C,updateId:L,data:I}=b,{props:q}=s,R=()=>u(C),z=L==null;z&&s.count++;const E={...q,style:q.toastStyle,key:s.toastKey++,...Object.fromEntries(Object.entries(b).filter(Q=>{let[ae,W]=Q;return W!=null})),toastId:C,updateId:L,data:I,closeToast:R,isIn:!1,className:Zn(b.className||q.toastClassName),bodyClassName:Zn(b.bodyClassName||q.bodyClassName),progressClassName:Zn(b.progressClassName||q.progressClassName),autoClose:!b.isLoading&&(X=b.autoClose,G=q.autoClose,X===!1||Dt(X)&&X>0?X:G),deleteToast(){const Q=vo(o.get(C),"removed");o.delete(C),je.emit(4,Q);const ae=s.queue.length;if(s.count=C==null?s.count-s.displayedToast:s.count-1,s.count<0&&(s.count=0),ae>0){const W=C==null?s.props.limit:1;if(ae===1||W===1)s.displayedToast++,A();else{const k=W>ae?ae:W;s.displayedToast=k;for(let T=0;T<k;T++)A()}}else t()}};var X,G;E.iconOut=function(Q){let{theme:ae,type:W,isLoading:k,icon:T}=Q,v=null;const M={theme:ae,type:W};return T===!1||(Ke(T)?v=T(M):Z.isValidElement(T)?v=Z.cloneElement(T,M):lt(T)||Dt(T)?v=T:k?v=qr.spinner():(_=>_ in qr)(W)&&(v=qr[W](M))),v}(E),Ke(b.onOpen)&&(E.onOpen=b.onOpen),Ke(b.onClose)&&(E.onClose=b.onClose),E.closeButton=q.closeButton,b.closeButton===!1||yr(b.closeButton)?E.closeButton=b.closeButton:b.closeButton===!0&&(E.closeButton=!yr(q.closeButton)||q.closeButton);let ne=g;Z.isValidElement(g)&&!lt(g.type)?ne=Z.cloneElement(g,{closeToast:R,toastProps:E,data:I}):Ke(g)&&(ne=g({closeToast:R,toastProps:E,data:I})),q.limit&&q.limit>0&&s.count>q.limit&&z?s.queue.push({toastContent:ne,toastProps:E,staleId:h}):Dt(m)?setTimeout(()=>{f(ne,E,h)},m):f(ne,E,h)}function f(g,y,m){const{toastId:h}=y;m&&o.delete(m);const b={content:g,props:y};o.set(h,b),r(C=>[...C,h].filter(L=>L!==m)),je.emit(4,vo(b,b.props.updateId==null?"added":"updated"))}return Z.useEffect(()=>(s.containerId=e.containerId,je.cancelEmit(3).on(0,d).on(1,g=>i.current&&u(g)).on(5,l).emit(2,s),()=>{o.clear(),je.emit(3,s)}),[]),Z.useEffect(()=>{s.props=e,s.isToastActive=a,s.displayedToast=n.length}),{getToastToRender:function(g){const y=new Map,m=Array.from(o.values());return e.newestOnTop&&m.reverse(),m.forEach(h=>{const{position:b}=h.props;y.has(b)||y.set(b,[]),y.get(b).push(h)}),Array.from(y,h=>g(h[0],h[1]))},containerRef:i,isToastActive:a}}function bo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Co(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function il(e){const[t,n]=Z.useState(!1),[r,i]=Z.useState(!1),o=Z.useRef(null),a=Z.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,s=Z.useRef(e),{autoClose:l,pauseOnHover:u,closeToast:A,onClick:d,closeOnClick:f}=e;function g(I){if(e.draggable){I.nativeEvent.type==="touchstart"&&I.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",b),document.addEventListener("mouseup",C),document.addEventListener("touchmove",b),document.addEventListener("touchend",C);const q=o.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=q.getBoundingClientRect(),q.style.transition="",a.x=bo(I.nativeEvent),a.y=Co(I.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=q.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=q.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function y(I){if(a.boundingRect){const{top:q,bottom:R,left:z,right:E}=a.boundingRect;I.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=z&&a.x<=E&&a.y>=q&&a.y<=R?h():m()}}function m(){n(!0)}function h(){n(!1)}function b(I){const q=o.current;a.canDrag&&q&&(a.didMove=!0,t&&h(),a.x=bo(I),a.y=Co(I),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),q.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,q.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function C(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",C);const I=o.current;if(a.canDrag&&a.didMove&&I){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return i(!0),void e.closeToast();I.style.transition="transform 0.2s, opacity 0.2s",I.style.transform=`translate${e.draggableDirection}(0)`,I.style.opacity="1"}}Z.useEffect(()=>{s.current=e}),Z.useEffect(()=>(o.current&&o.current.addEventListener("d",m,{once:!0}),Ke(e.onOpen)&&e.onOpen(Z.isValidElement(e.children)&&e.children.props),()=>{const I=s.current;Ke(I.onClose)&&I.onClose(Z.isValidElement(I.children)&&I.children.props)}),[]),Z.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||h(),window.addEventListener("focus",m),window.addEventListener("blur",h)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",m),window.removeEventListener("blur",h))}),[e.pauseOnFocusLoss]);const L={onMouseDown:g,onTouchStart:g,onMouseUp:y,onTouchEnd:y};return l&&u&&(L.onMouseEnter=h,L.onMouseLeave=m),f&&(L.onClick=I=>{d&&d(I),a.canCloseOnClick&&A()}),{playToast:m,pauseToast:h,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:L}}function Zo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return Z.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:i=>{i.stopPropagation(),t(i)},"aria-label":r},Z.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Z.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 ol(e){let{delay:t,isRunning:n,closeToast:r,type:i="default",hide:o,className:a,style:s,controlledProgress:l,progress:u,rtl:A,isIn:d,theme:f}=e;const g=o||l&&u===0,y={...s,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:g?0:1};l&&(y.transform=`scaleX(${u})`);const m=at("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":A}),h=Ke(a)?a({rtl:A,type:i,defaultClassName:m}):at(m,a);return Z.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:h,style:y,[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{d&&r()}})}const al=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i}=il(e),{closeButton:o,children:a,autoClose:s,onClick:l,type:u,hideProgressBar:A,closeToast:d,transition:f,position:g,className:y,style:m,bodyClassName:h,bodyStyle:b,progressClassName:C,progressStyle:L,updateId:I,role:q,progress:R,rtl:z,toastId:E,deleteToast:X,isIn:G,isLoading:ne,iconOut:Q,closeOnClick:ae,theme:W}=e,k=at("Toastify__toast",`Toastify__toast-theme--${W}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":z},{"Toastify__toast--close-on-click":ae}),T=Ke(y)?y({rtl:z,position:g,type:u,defaultClassName:k}):at(k,y),v=!!R||!s,M={closeToast:d,type:u,theme:W};let _=null;return o===!1||(_=Ke(o)?o(M):Z.isValidElement(o)?Z.cloneElement(o,M):Zo(M)),Z.createElement(f,{isIn:G,done:X,position:g,preventExitTransition:n,nodeRef:r},Z.createElement("div",{id:E,onClick:l,className:T,...i,style:m,ref:r},Z.createElement("div",{...G&&{role:q},className:Ke(h)?h({type:u}):at("Toastify__toast-body",h),style:b},Q!=null&&Z.createElement("div",{className:at("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!ne})},Q),Z.createElement("div",null,a)),_,Z.createElement(ol,{...I&&!v?{key:`pb-${I}`}:{},rtl:z,theme:W,delay:s,isRunning:t,isIn:G,closeToast:d,hide:A,type:u,style:L,className:C,controlledProgress:v,progress:R||0})))},In=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},sl=xn(In("bounce",!0));xn(In("slide",!0)),xn(In("zoom")),xn(In("flip"));const vr=Z.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:i}=rl(e),{className:o,style:a,rtl:s,containerId:l}=e;function u(A){const d=at("Toastify__toast-container",`Toastify__toast-container--${A}`,{"Toastify__toast-container--rtl":s});return Ke(o)?o({position:A,rtl:s,defaultClassName:d}):at(d,Zn(o))}return Z.useEffect(()=>{t&&(t.current=r.current)},[]),Z.createElement("div",{ref:r,className:"Toastify",id:l},n((A,d)=>{const f=d.length?{...a}:{...a,pointerEvents:"none"};return Z.createElement("div",{className:u(A),style:f,key:`container-${A}`},d.map((g,y)=>{let{content:m,props:h}=g;return Z.createElement(al,{...h,isIn:i(h.toastId),style:{...h.style,"--nth":y+1,"--len":d.length},key:`toast-${h.key}`},m)}))}))});vr.displayName="ToastContainer",vr.defaultProps={position:"top-right",transition:sl,autoClose:5e3,closeButton:Zo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let br,ut=new Map,Tt=[],Al=1;function xo(){return""+Al++}function ll(e){return e&&(lt(e.toastId)||Dt(e.toastId))?e.toastId:xo()}function Gt(e,t){return ut.size>0?je.emit(0,e,t):Tt.push({content:e,options:t}),t.toastId}function Sn(e,t){return{...t,type:t&&t.type||e,toastId:ll(t)}}function Kn(e){return(t,n)=>Gt(t,Sn(e,n))}function he(e,t){return Gt(e,Sn("default",t))}he.loading=(e,t)=>Gt(e,Sn("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),he.promise=function(e,t,n){let r,{pending:i,error:o,success:a}=t;i&&(r=lt(i)?he.loading(i,n):he.loading(i.render,{...n,...i}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(A,d,f)=>{if(d==null)return void he.dismiss(r);const g={type:A,...s,...n,data:f},y=lt(d)?{render:d}:d;return r?he.update(r,{...g,...y}):he(y.render,{...g,...y}),f},u=Ke(e)?e():e;return u.then(A=>l("success",a,A)).catch(A=>l("error",o,A)),u},he.success=Kn("success"),he.info=Kn("info"),he.error=Kn("error"),he.warning=Kn("warning"),he.warn=he.warning,he.dark=(e,t)=>Gt(e,Sn("default",{theme:"dark",...t})),he.dismiss=e=>{ut.size>0?je.emit(1,e):Tt=Tt.filter(t=>e!=null&&t.options.toastId!==e)},he.clearWaitingQueue=function(e){return e===void 0&&(e={}),je.emit(5,e)},he.isActive=e=>{let t=!1;return ut.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},he.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,i){let{containerId:o}=i;const a=ut.get(o||br);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:i}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:xo()};o.toastId!==e&&(o.staleId=e);const a=o.render||i;delete o.render,Gt(a,o)}},0)},he.done=e=>{he.update(e,{progress:1})},he.onChange=e=>(je.on(4,e),()=>{je.off(4,e)}),he.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"},he.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},je.on(2,e=>{br=e.containerId||e,ut.set(br,e),Tt.forEach(t=>{je.emit(0,t.content,t.options)}),Tt=[]}).on(3,e=>{ut.delete(e.containerId||e),ut.size===0&&je.off(0).off(1).off(5)});function ul(e){he.error(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function ct(e){he.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Cr="",ze="Playable",Le=null,wo=null,Ht,Io=[];const Zr=async(e,t,n)=>{ze==="Playable"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await yo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):ze==="Flex"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await tl({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):ze==="Ready"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(t.googleUrl=t.iosUrl),await yo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le)):ze==="Fusion"&&t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await $A({_id:Ht==null?void 0:Ht.fusionId,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le)},Ln=async e=>{let t=Cr+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=n.split("/").reduce((a,s)=>s,""),document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(i),ct("Download successfully")}).catch(r=>{console.error("File error:",r)})},cl=(e,t,n)=>{let r=Cr+"/"+e;n==="adikteev"&&(r=e),Ct(r)?ct(se.t("common:link_copied")):t(r)};function So(e){let t=Io.find(n=>n.id===e);return t&&t.apiName?t.apiName:e}async function Pt(e,t,n,r="download",i=!1,o=null){return t=So(t),new Promise(async(a,s)=>{let l=async u=>{r==="download"?await Ln(u):r==="copy"&&cl(u,wo,t)};try{await Zr(e,n,o)}catch(u){console.log("updateUrls error",u)}ze==="Playable"?QA(Le,e,t,i,o).then(async u=>{let{url:A}=u;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Flex"?XA({_id:e,network:t,extras:o},Le).then(async u=>{if(u.message){s(u);return}let{url:A}=u;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Import"?VA(Le,e,t).then(async u=>{let A=u.url;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Ready"?UA(Le,e,t,i,o).then(async u=>{if(u.message){s(u);return}let A=u.url;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Fusion"&&_A(Le,e,t,Ht,i,o,n==null?void 0:n.googleUrl,n==null?void 0:n.iosUrl).then(async u=>{let A=u.url;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})})})}async function dl(e,t,n,r=null){return new Promise(async(i,o)=>{n=n.map(a=>So(a)),await Zr(e,t,r),ze==="Flex"?PA(e,n,Le).then(async a=>{if(a.message){o(a);return}await Ln(a.url),i(a.url)}).catch(a=>{let s=a.response.data.error.msg;o({message:s})}):ze==="Ready"?FA(e,n,Le).then(async a=>{if(a.message){o(a);return}await Ln(a.url),i(a.url)}).catch(a=>{console.log("err",a);let s=a.response.data.error.msg;o({message:s})}):BA(e,n,Le).then(async a=>{await Ln(a.url),i(a.url)}).catch(a=>{let s=a.response.data.error.msg;o({message:s})})})}function fl(e,t,n,r,i){ze=e,Le=t,wo=n,Cr=r,Ht=i}function ml(e){Io=e}async function pl(e){try{return await el({versionId:e,checkExistance:!0},Le)}catch{return null}}async function xr(e,t){return(await ge.post(t+"/findPlayable",{_id:e})).data}const hl=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:i,setSafariCopyLink:o,qrUrl:a,iosLink:s,androidLink:l,urlType:u})=>{const[A,d]=Z.useState(!1),f=async()=>{d(!0),Pt(e,"default",{iosUrl:s,googleUrl:l},null,!1,{urlType:u}).then(async g=>{var b,C,L,I;let y="";if(t&&(n==="Playable"||n==="Ready")){const q=await xr(t,r),R=(C=(b=q==null?void 0:q.data)==null?void 0:b.globalProps)==null?void 0:C.defaultLandscape,z=(I=(L=q==null?void 0:q.data)==null?void 0:L.globalProps)==null?void 0:I.defaultPhoneIndex;R&&(y+="&landscape=true"),z!==void 0&&(y+=`&phoneIndex=${z}`)}xr(t,r),d(!1);let m;n==="Flex"?m=`${i}/preview?versionId=${e}`:n==="Import"?m=`${i}/preview?versionId=${e}`:n==="Ready"?m=`${i}/preview?versionId=${e}&ready=true`:n==="Fusion"?m=`${i}/preview?versionId=${e}`:m=`${i}/preview?versionId=${e}`,m+=y,Ct(m)?ct(se.t("common:link_copied")):o(m),d(!1)}).catch(g=>{d(!1)})};return c.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[c.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:a?c.jsx(rs,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):c.jsx("img",{style:{width:"50px",height:"50px"},src:Qe,alt:"pf-logo-gif"})}),c.jsxs("div",{children:[c.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:se.t("common:mobile_testing")}),c.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:se.t("common:scan_qr_code_to_test_in_any_browser")}),c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{A||f()},children:c.jsxs(c.Fragment,{children:[c.jsx(yi,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),c.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:A?c.jsx("img",{style:{height:"90%"},src:Qe,alt:"loading"}):c.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:se.t("common:copy_link")})})]})})]})]})},gl=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:i,iframeUrl:o,fetchFileUrl:a,copyLinkUrl:s,setSafariCopyLink:l,iosLink:u,androidLink:A,urlType:d})=>{const[f,g]=Z.useState(window.innerWidth);console.log("iosLink",u),Z.useEffect(()=>{console.log("re add event listener");function m(h){console.log(h),h.data==="cta"&&(console.log("Received 'cta' message from iframe"),u&&window.open(u,"_blank"))}return window.addEventListener("message",m,!1),()=>{window.removeEventListener("message",m)}},[u,A]),Z.useEffect(()=>{const m=()=>{g(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const y=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return c.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:f>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[c.jsx(ba,{iframeUrl:o}),c.jsx(Ca,{name:y}),c.jsx(hl,{versionId:t,playableId:n,typeOfProduct:r,api:i,copyLinkUrl:s,setSafariCopyLink:l,qrUrl:o,iosLink:u,androidLink:A,urlType:d})]})};var we=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e.Fusion="#171717",e))(we||{});const yl=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:c.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"},children:[c.jsx("span",{style:{color:we[e]},className:"mr-2",children:se.t("common:select_network")}),c.jsx("span",{style:{whiteSpace:"pre"},children:se.t("common:from_list")})]})});async function ql(e,t){return(await ge.post(t+"/buyRequest",{requestType:e})).data}const vl=()=>c.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[c.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),c.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_518_12094",children:c.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),bl=({creditDownload:e,api:t})=>c.jsxs(c.Fragment,{children:[c.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."}),c.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"," ",c.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.",c.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>ql("Flex Credit",t).then(n=>ct("You will be contacted regarding your request.")),children:["Get more",c.jsx(vl,{})]})]})]}),Ko=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const o=s=>{n(s.target.value)},a=s=>{r(s.target.value)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[c.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:se.t("common:app_store")}),c.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:we[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:o,placeholder:"Ios Url",disabled:i})]}),c.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[c.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:[se.t("common:google_play"),":"]}),c.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:we[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:i})]})]})},Cl=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const o=a=>{n(a.target.value)};return c.jsx(c.Fragment,{children:c.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[c.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),c.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:we[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:o,placeholder:"Ios Url",disabled:i})]})})},Zl=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o,api:a,creditDownload:s,user:l,isTest:u,setIsTest:A,urlType:d,setUrlType:f})=>{const g=()=>c.jsx(c.Fragment,{children:c.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:[c.jsx("div",{style:{position:"absolute",bottom:"-3px",left:d==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),c.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="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{f("game")},200)},children:c.jsx("span",{style:{position:"relative",color:d==="game"?"#000":"#a3a3a3",fontWeight:d==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),c.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="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{f("single")},200)},children:c.jsx("span",{style:{position:"relative",color:d==="single"?"#000":"#a3a3a3",fontWeight:d==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return c.jsx(c.Fragment,{children:e!=="Import"&&c.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[e==="Ready"?c.jsxs(c.Fragment,{children:[c.jsx(g,{}),d==="game"&&c.jsx(Ko,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o}),d==="single"&&c.jsx(Cl,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o})]}):c.jsx(c.Fragment,{children:c.jsx(Ko,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o})}),(s==null?void 0:s.willSpendCredit)&&c.jsx(bl,{creditDownload:s,api:a})]})})},xl=({typeOfProduct:e,title:t,fileSize:n})=>c.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[c.jsx("span",{style:{color:we[e]},children:t}),n?c.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:[se.t("common:file_size")," : ",parseFloat(n).toFixed(2)," mb"]}):null]}),wl=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:i,handleGoogleChange:o,disabled:a,creditDownload:s,api:l,user:u,isTest:A,setIsTest:d,urlType:f,setUrlType:g,allNetworksSelected:y,setAllNetworksSelected:m})=>c.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:[c.jsx(xl,{typeOfProduct:e,title:r,fileSize:t}),c.jsx(Zl,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:i,handleGoogleChange:o,disabled:a,creditDownload:s,api:l,user:u,isTest:A,setIsTest:d,urlType:f,setUrlType:g}),c.jsx(yl,{typeOfProduct:e,allNetworksSelected:y,setAllNetworksSelected:m})]}),wr=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:i})=>c.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||i,children:e}),Il=({checked:e,typeOfProduct:t,id:n})=>{const[r,i]=Z.useState(e);Z.useEffect(()=>{i(e)},[e]);const o=()=>{i(!r)};return c.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:c.jsxs("label",{onClick:o,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[c.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:o}),c.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:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:we[t],stroke:we[t],strokeWidth:"1",children:c.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"})})," "]})]})})},Id="",Sl=({typeOfProduct:e})=>c.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:c.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}}),c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}}),c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}}),c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}})]})}),Xt=({isNetworksLoading:e=!1})=>c.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:c.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Qe,alt:"pf-logo-gif"})}),Ir=({title:e,titleId:t,...n})=>c.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?c.jsx("title",{id:t,children:e}):null,c.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"})]}),Kl=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:i,download:o,typeOfProduct:a,urlType:s})=>{let l="";return a==="Ready"&&s==="single"?l=se.t("common:redirection_url_is_empty_are_you_sure_want_to_continue"):!t&&!n?l=se.t("common:both_links_are_empty_are_you_sure_want_to_continue"):t?n||(l=se.t("common:google_link_is_empty_are_you_sure_want_to_continue")):l=se.t("common:ios_link_is_empty_are_you_sure_want_to_continue"),c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.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:[c.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:l}),c.jsxs("div",{style:{display:"flex",gap:"5px"},children:[c.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:se.t("common:no")}),c.jsx("button",{onClick:async u=>{r==="download"?await o():r==="copyLink"&&await i(),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:se.t("common:yes")})]})]})]})},Sr=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:i,width:o="130%",height:a="120%"})=>c.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:a,width:o,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),c.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:[c.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?"}),c.jsxs("div",{style:{display:"flex",gap:"5px"},children:[c.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),c.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async s=>{s.preventDefault(),s.stopPropagation(),r==="download"?(await n(),await i()):r==="copy"&&(await t(),await i()),e()},children:"Yes"})]})]})]}),Ll=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:i,downloadingMolocoHtml:o})=>c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.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:c.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?c.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:c.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):c.jsx("button",{onClick:()=>{t(!1)},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"}),o?c.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:c.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):c.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"})]}),c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:i?c.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:c.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):c.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 Ol(e,t,n,r){return(await ge.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}let El=0;function On(e,t){const n=`atom${++El}`,r={toString(){return n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=Ml,r.write=kl),t&&(r.write=t),r}function Ml(e){return e(this)}function kl(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const Lo=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Oo=e=>"init"in e,Eo=e=>!!e.write,Vt=Symbol(""),Kr="pending",Wl="fulfilled",jl="rejected",zl=e=>typeof e=="object"&&e!==null&&Vt in e,En=new WeakMap,Yl=(e,t,n)=>{if(!En.has(e)){let r;const i=new Promise((o,a)=>{let s=e;const l=A=>d=>{s===A&&(i.status=Wl,i.value=d,o(d),n())},u=A=>d=>{s===A&&(i.status=jl,i.reason=d,a(d),n())};e.then(l(e),u(e)),r=(A,d)=>{A&&(En.set(A,i),s=A,A.then(l(A),u(A)),t(),t=d)}});i.status=Kr,i[Vt]=r,En.set(e,i)}return En.get(e)},Nl=e=>typeof(e==null?void 0:e.then)=="function",Mo=e=>"v"in e||"e"in e,Mn=e=>{if("e"in e)throw e.e;return e.v},kn=e=>{const t=e.v;return zl(t)&&t.status===Kr?t:null},ko=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},Qt=()=>[new Map,new Map,new Set],Wo=(e,t,n)=>{e[0].has(t)||e[0].set(t,new Set),e[1].set(t,n)},Rl=(e,t,n)=>{const r=e[0].get(t);r&&r.add(n)},Jl=(e,t)=>e[0].get(t),jo=(e,t)=>{e[2].add(t)},Zt=e=>{for(;e[1].size||e[2].size;){e[0].clear();const t=new Set(e[1].values());e[1].clear();const n=new Set(e[2]);e[2].clear(),t.forEach(r=>{var i;return(i=r.m)==null?void 0:i.l.forEach(o=>o())}),n.forEach(r=>r())}},Dl=()=>{const e=new WeakMap;let t;const n=m=>{let h=e.get(m);return h||(h={d:new Map,p:new Set,n:0},e.set(m,h)),h},r=(m,h,b,C=()=>{},L=()=>{})=>{const I="v"in h,q=h.v,R=kn(h);if(Nl(b))if(R)R!==b&&(R[Vt](b,C),++h.n);else{const z=Yl(b,C,L);if(z.status===Kr)for(const E of h.d.keys()){const X=n(E);ko(m,z,X)}h.v=z,delete h.e}else R&&R[Vt](Promise.resolve(b),C),h.v=b,delete h.e;(!I||!Object.is(q,h.v))&&++h.n},i=(m,h,b,C)=>{var L;const I=n(h);I.d.set(b,C.n);const q=kn(I);q&&ko(h,q,C),(L=C.m)==null||L.t.add(h),m&&Rl(m,b,h)},o=(m,h,b)=>{const C=n(h);if(!(b!=null&&b(h))&&Mo(C)&&(C.m||Array.from(C.d).every(([E,X])=>o(m,E,b).n===X)))return C;C.d.clear();let L=!0;const I=E=>{if(Lo(h,E)){const G=n(E);if(!Mo(G))if(Oo(E))r(E,G,E.init);else throw new Error("no atom init");return Mn(G)}const X=o(m,E,b);if(L)i(m,h,E,X);else{const G=Qt();i(G,h,E,X),A(G,h,C),Zt(G)}return Mn(X)};let q,R;const z={get signal(){return q||(q=new AbortController),q.signal},get setSelf(){return!R&&Eo(h)&&(R=(...E)=>{if(!L)return u(h,...E)}),R}};try{const E=h.read(I,z);return r(h,C,E,()=>q==null?void 0:q.abort(),()=>{if(C.m){const X=Qt();A(X,h,C),Zt(X)}}),C}catch(E){return delete C.v,C.e=E,++C.n,C}finally{L=!1}},a=m=>Mn(o(void 0,m)),s=(m,h)=>{const b=z=>{var E,X;const G=n(z),ne=new Set((E=G.m)==null?void 0:E.t);for(const Q of G.p)ne.add(Q);return(X=Jl(m,z))==null||X.forEach(Q=>{ne.add(Q)}),ne},C=[],L=new Set,I=z=>{if(!L.has(z)){L.add(z);for(const E of b(z))z!==E&&I(E);C.push(z)}};I(h);const q=new Set([h]),R=z=>L.has(z);for(let z=C.length-1;z>=0;--z){const E=C[z],X=n(E),G=X.n;let ne=!1;for(const Q of X.d.keys())if(Q!==E&&q.has(Q)){ne=!0;break}ne&&(o(m,E,R),A(m,E,X),G!==X.n&&(Wo(m,E,X),q.add(E))),L.delete(E)}},l=(m,h,...b)=>{const C=q=>Mn(o(m,q)),L=(q,...R)=>{let z;if(Lo(h,q)){if(!Oo(q))throw new Error("atom not writable");const E=n(q),X="v"in E,G=E.v,ne=R[0];r(q,E,ne),A(m,q,E),(!X||!Object.is(G,E.v))&&(Wo(m,q,E),s(m,q))}else z=l(m,q,...R);return Zt(m),z};return h.write(C,L,...b)},u=(m,...h)=>{const b=Qt(),C=l(b,m,...h);return Zt(b),C},A=(m,h,b)=>{if(b.m&&!kn(b)){for(const C of b.d.keys())b.m.d.has(C)||(d(m,C).t.add(h),b.m.d.add(C));for(const C of b.m.d||[])if(!b.d.has(C)){b.m.d.delete(C);const L=f(m,C);L==null||L.t.delete(h)}}},d=(m,h)=>{const b=n(h);if(!b.m){o(m,h);for(const C of b.d.keys())d(m,C).t.add(h);if(b.m={l:new Set,d:new Set(b.d.keys()),t:new Set},Eo(h)&&h.onMount){const C=b.m,{onMount:L}=h;jo(m,()=>{const I=L((...q)=>l(m,h,...q));I&&(C.u=I)})}}return b.m},f=(m,h)=>{const b=n(h);if(b.m&&!b.m.l.size&&!Array.from(b.m.t).some(C=>{var L;return(L=n(C).m)==null?void 0:L.d.has(h)})){const C=b.m.u;C&&jo(m,C),delete b.m;for(const I of b.d.keys()){const q=f(m,I);q==null||q.t.delete(h)}const L=kn(b);L&&L[Vt](void 0,()=>{});return}return b.m};return{get:a,set:u,sub:(m,h)=>{const b=Qt(),C=d(b,m);Zt(b);const L=C.l;return L.add(h),()=>{L.delete(h);const I=Qt();f(I,m),Zt(I)}}}};let Lr;const Tl=()=>(Lr||(Lr=Dl()),Lr),Gl=Z.createContext(void 0),zo=e=>{const t=Z.useContext(Gl);return(e==null?void 0:e.store)||t||Tl()},Hl=e=>typeof(e==null?void 0:e.then)=="function",Pl=Z.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function Xl(e,t){const n=zo(t),[[r,i,o],a]=Z.useReducer(u=>{const A=n.get(e);return Object.is(u[0],A)&&u[1]===n&&u[2]===e?u:[A,n,e]},void 0,()=>[n.get(e),n,e]);let s=r;(i!==n||o!==e)&&(a(),s=n.get(e));const l=t==null?void 0:t.delay;return Z.useEffect(()=>{const u=n.sub(e,()=>{if(typeof l=="number"){setTimeout(a,l);return}a()});return a(),u},[n,e,l]),Z.useDebugValue(s),Hl(s)?Pl(s):s}function Vl(e,t){const n=zo(t);return Z.useCallback((...i)=>n.set(e,...i),[n,e])}function et(e,t){return[Xl(e,t),Vl(e,t)]}const Yo=On(""),No=On(!1),Or=On([]),Ro=On([]),Ql=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:i,networkVersionSize:o,fileSizeLoading:a,showCheckBox:s,typeOfProduct:l,versionId:u,api:A,handleDownloadError:d,fetchFileUrl:f,urls:g,game:y,setIsConfirmActive:m,creditDownload:h,getDownloadCount:b,disabled:C,user:L,setSafariCopyLink:I,isTest:q,urlType:R,setCdnModal:z,generateCDN:E,cdnUrl:X})=>{const[G,ne]=Z.useState(!1),[Q,ae]=Z.useState(""),[W,k]=Z.useState(!1),[T,v]=Z.useState(!1),[M,_]=Z.useState(!1),[x,K]=Z.useState("download"),[H,J]=Z.useState(!1),[N,D]=Z.useState(!1),[V,U]=Z.useState(!1),[re,ie]=et(Or),F={cdn:"Generate Link",adikteev:"Copy CDN"},me=()=>{n(e)},j=async(B,oe)=>{const ye={molocoGenerateHtml:!1,urlType:R};if(S&&(oe==="copy"?(D(!0),oe="download",ye.molocoGenerateHtml=!0):J(!0)),console.log("getVersion",B,oe,ye),B==="cdn"){z(!0),await E(!0);return}return B==="adikteev"&&(oe="copy"),ne(!0),new Promise((Ne,_t)=>{Pt(u,B,g,oe,q,ye).then(Re=>{ne(!1),Ne(Re),D(!1),J(!1)}).catch(Re=>{ne(!1),d(Re.message,Re),_t(Re),D(!1),J(!1)})})},qe=async(B=!1)=>{B?D(!0):J(!0);const oe={molocoGenerateHtml:!1};B&&(oe.molocoGenerateHtml=!0),Pt(u,i,g,"download",q,oe).then(ye=>{B?D(!1):J(!1),_(!1)}).catch(ye=>{d(ye.message,ye)})},Ye=async()=>{U(!0);const B=await Ol(A,u,i,l);let oe=`${f}/${B==null?void 0:B.url}`;Ct(oe)?(ct(se.t("common:link_copied")),U(!1)):I(oe)},S=i==="moloco"||i==="molocoV2",P=re.find(B=>B.name===i);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?we[l]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+l,onClick:me,children:[c.jsxs("div",{style:{marginTop:i=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[c.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:c.jsx("div",{children:o&&o.map(B=>B.network).includes(i)?a?c.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:c.jsx(Sl,{typeOfProduct:l})}):o.map(B=>c.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:B.network===i?B.size.toString().slice(0,5)+"Mb":""},B.network)):null})}),c.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(l==="Playable"||l==="Ready"||l==="Flex")&&s&&c.jsx(Il,{checked:r,typeOfProduct:l,id:e})}),c.jsx("img",{onClick:me,style:{width:"30rem",height:i=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[c.jsx(wr,{className:`${S?"w-1/2":"w-2/3"} border-hover-`+l,downloading:G,onClickDonwload:async B=>{if(B.stopPropagation(),S&&L.customer==="playableFactoryInternal"){_(!0);return}else{ae("download");const oe=g.iosUrl,ye=g.googleUrl;i==="cdn"&&h&&h.willSpendCredit&&!X||i!=="cdn"&&h&&h.willSpendCredit?(m(!0),K("download"),k(!0)):["Playable","Flex"].includes(l)&&(!oe||!ye)||l==="Ready"&&R==="single"&&!oe||l==="Ready"&&R==="multi"&&(!oe||!ye)?(m(!0),v(!0)):(v(!1),k(!1),await j(i,"download"))}},children:S?c.jsxs(c.Fragment,{children:[!H&&c.jsxs(c.Fragment,{children:[c.jsx(Ir,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),L.customer!=="playableFactoryInternal"?se.t("common:txt"):se.t("common:download")]}),H&&c.jsx(Xt,{})]}):c.jsxs(c.Fragment,{children:[!G&&c.jsxs(c.Fragment,{children:[c.jsx(Ir,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),F[i]||se.t("common:download")]}),G&&c.jsx(Xt,{})]})}),P&&P.downloadType.includes("copy")&&c.jsx(wr,{className:"w-1/3 border-hover-"+l,onClickDonwload:async B=>{B.stopPropagation(),ae("copyLink");const oe=g.iosUrl,ye=g.googleUrl;h&&(h!=null&&h.willSpendCredit)?(K("copy"),m(!0),k(!0)):l!=="Import"&&(!oe||!ye)?(m(!0),v(!0)):(k(!1),v(!1),await j(i,"copy"))},disabled:C,children:c.jsx(yi,{className:"h-6 w-6 stroke-dark-full"})}),S&&L.customer!=="playableFactoryInternal"&&c.jsxs(wr,{className:"w-1/2 border-hover-"+l,onClickDonwload:async B=>{B.stopPropagation(),ae("copyLink");const oe=g.iosUrl,ye=g.googleUrl;h&&(h!=null&&h.willSpendCredit)?(K("download"),m(!0),k(!0)):l!=="Import"&&(!oe||!ye)?(m(!0),v(!0)):(k(!1),v(!1),await qe(!0))},disabled:C,children:[!N&&c.jsxs(c.Fragment,{children:[c.jsx(Ir,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),se.t("common:html")]}),N&&c.jsx(Xt,{})]})]}),S&&c.jsx("img",{style:{position:"absolute",width:"135px",right:"0",top:"18px"},src:"https://home.playablefactory.app/recommended_badge.png"})]}),W&&c.jsx(Sr,{creditConfirmType:x,handleCopyLink:async()=>{v(!1),m(!1),await j(i,"copy")},download:async()=>{v(!1),m(!1),await j(i,"download")},onClose:()=>{k(!1),m(!1)},getDownloadCount:b}),T&&c.jsx(Kl,{onClose:()=>{v(!1),m(!1)},iosLink:g.iosUrl,googleLink:g.googleUrl,buttonType:Q,handleCopyLink:async()=>{v(!1),m(!1),await j(i,"copy")},download:async()=>{v(!1),m(!1),await j(i,"download")},typeOfProduct:l,urlType:R}),M&&L.customer==="playableFactoryInternal"&&c.jsx(Ll,{onClose:()=>{_(!1)},handleDownload:qe,handleDownloadMolocoTest:Ye,downloadingMoloco:H,donwloadintMolocoTest:V,downloadingMolocoHtml:N})]})},Bl=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:we[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return c.jsx("button",{onClick:r,className:n,style:i,children:e})},Ul=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?c.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:we[t]},children:c.jsx(Xt,{})}):c.jsx(Bl,{typeOfProduct:t,onClick:n,children:c.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),Jo=({title:e,titleId:t})=>c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),c.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),Fl=({onClose:e,cdnUrl:t,generateCDN:n,cdnUploading:r})=>c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:i=>{i.stopPropagation()},children:c.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[c.jsxs("p",{style:{fontSize:"1.1rem",fontWeight:500,textAlign:"left",marginBottom:"10px",color:"#00a3ff",textDecoration:"underline",cursor:"pointer",width:"150px",display:"flex",gap:"10px",alignItems:"center",height:"28px"},onClick:()=>{r||n()},children:["Update Link",r&&c.jsx("img",{width:"30px",src:Qe,alt:"pf-logo-gif"})]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[c.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:c.jsx(Jo,{})}),c.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:c.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:t,target:"_blank",children:t||"No CDN link generated"})}),c.jsx("button",{onClick:()=>{if(!t)return;Ct(t)&&ct(se.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:t?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})]})})]}),_l=({onClose:e,url:t})=>c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:n=>{n.stopPropagation()},children:c.jsx("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[c.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:c.jsx(Jo,{})}),c.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:c.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:t,target:"_blank",children:t||c.jsx("img",{width:"30px",src:Qe,alt:"pf-logo-gif"})})}),c.jsx("button",{onClick:()=>{if(!t)return;Ct(t)&&ct(se.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:t?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})})})]}),$l=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:i,api:o,user:a,handleDownloadError:s,fetchFileUrl:l,urls:u,game:A,getDownloadCount:d,disabled:f,setSafariCopyLink:g,isTest:y,urlType:m,allNetworksSelected:h,cdnModal:b,setCdnModal:C,cdnUrl:L,setCdnUrl:I,customer:q})=>{const[R,z]=Z.useState([]),[E,X]=Z.useState([]),[G,ne]=Z.useState(!1),[Q,ae]=Z.useState(""),[W,k]=Z.useState(!1),[T,v]=Z.useState(!1),[M,_]=Z.useState("download"),[x,K]=Z.useState(!1),[H,J]=Z.useState(!1),[N,D]=Z.useState(!1),[V,U]=et(Yo),[re,ie]=et(No),[F]=et(Or),me=async(S=!1)=>{S&&L||N||(D(!0),Pt(r,"cdn",u,null,!1,{}).then(P=>{I(P.url),D(!1)}).catch(P=>{s(P.message,P),D(!1)}))},j=async S=>{if(S==="adikteev")return;const P=[...R];if(R.includes(S)){const B=P.findIndex(oe=>oe===S);P.splice(B,1),z(P)}else P.push(S),z([...R,S]);F.filter(B=>[...P].includes(B.id)).map(B=>B.name)},qe=async()=>new Promise(async(S,P)=>{const B=F.filter(oe=>[...R].includes(oe.id)).map(oe=>oe.name);k(!0),dl(r,u,B,{urlType:m}).then(oe=>{k(!1),S(oe)}).catch(oe=>{console.log("get multi download err"),k(!1),s(oe.message,oe),P(oe)})}),Ye=async()=>{u.iosUrl,u.googleUrl,t&&t.willSpendCredit?(v(!0),_("download"),K(!0)):(K(!1),await qe())};return Z.useEffect(()=>{const S=F.filter(P=>{var B;return t&&((B=t==null?void 0:t.networks)==null?void 0:B.length)>0?t==null?void 0:t.networks.includes(P.name):i==="Import"?e==null?void 0:e.networks.filter(oe=>oe.status==="paid").some(oe=>oe.name===P.name):(e==null?void 0:e.networks.includes(P.name))||(A==null?void 0:A.networks.includes(P.name))}).filter(P=>P.name==="voodoo"?a.customer==="customer:20":!0).map(P=>P.id);z(h?S:[])},[h]),c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{position:"relative",flex:1,overflowY:T?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:c.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&F.filter(S=>{var P;return t&&((P=t==null?void 0:t.networks)==null?void 0:P.length)>0?t==null?void 0:t.networks.includes(S.name):i==="Import"?e==null?void 0:e.networks.filter(B=>B.status==="paid").some(B=>B.name===S.name):q!=null&&q.networks?q.networks.includes(S.name):(e==null?void 0:e.networks.includes(S.name))||(A==null?void 0:A.networks.includes(S.name))}).filter(S=>S.name==="voodoo"?a.customer==="customer:20":!0).map(S=>{let P=S.imageSrc;if(S.name==="web"){let B="web_"+i.toLowerCase()+".png";P=P.replace("web.png",B)}return c.jsx(Ql,{id:S.id,name:S.name,imageUrl:P,selected:R.includes(S.id),handleCardClick:j,networkVersionSize:E,fileSizeLoading:G,showCheckBox:S.id!=="adikteev",typeOfProduct:i,versionId:r,api:o,handleDownloadError:s,fetchFileUrl:l,urls:u,game:A,creditDownload:t,setIsConfirmActive:v,getDownloadCount:d,disabled:f,user:a,setSafariCopyLink:g,isTest:y,urlType:m,setCdnModal:C,generateCDN:me,cdnUrl:L},S.id)})})}),R.length>1&&(i==="Playable"||i==="Ready"||i==="Flex")&&c.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:c.jsx(Ul,{onClickMultiDownload:Ye,networksVersionTotalSize:Q,typeOfProduct:i,multiDownloading:W})}),b&&c.jsx(Fl,{onClose:()=>{C(!1),d()},versionId:r,urls:u,handleDownloadError:s,cdnUrl:L,setCdnUrl:I,generateCDN:async()=>{if(!N){if(a.customer==="playableFactoryInternal"){me();return}J(!0)}},cdnUploading:N}),re&&c.jsx(_l,{onClose:()=>{ie(!1)},url:V}),H&&c.jsx(Sr,{width:"100%",height:"100%",creditConfirmType:M,handleCopyLink:async()=>{},download:async()=>{K(!1),J(!1),me()},onClose:()=>{K(!1),J(!1),D(!1)},getDownloadCount:d}),x&&c.jsx(Sr,{creditConfirmType:M,handleCopyLink:async()=>{},download:async()=>{K(!1),v(!1),await qe()},onClose:()=>{K(!1),v(!1)},getDownloadCount:d})]})};async function eu(e,t){return(await ge.post(t+"/getFlexDownloadCount",e)).data}async function tu(e,t){try{return(await ge.post(t+"/findGame",{_id:e})).data}catch{}}async function nu(e,t){return(await ge.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function ru(e,t){return(await ge.post(t+"/getFlexData",{_id:e})).data}async function iu(e,t){return(await ge.post(t+"/getImportedPlayable",{id:e})).data}async function ou(e,t){return(await ge.post(t+"/getReadyDownloadCount",e)).data}async function au(e,t){try{return(await ge.post(t+"/findCustomer",{_id:e})).data}catch{}}const Do=["web","adcolony","applovin","chartboost","crossinstall","fb","google","google360","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco","cdn"];let To=null;const su=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:i,api:o,user:a,title:s,handleDownloadError:l,fetchFileUrl:u,fileSize:A,setFileSize:d,setSafariCopyLink:f,iosLink:g,androidLink:y,setIosLink:m,setAndroidLink:h,urlType:b,setUrlType:C})=>{const[L,I]=Z.useState(null),[q,R]=Z.useState(null),[z,E]=Z.useState(null),[X,G]=Z.useState(!1),[ne,Q]=Z.useState(!0),[ae,W]=Z.useState(window.innerWidth),[k,T]=Z.useState(!1),[v,M]=Z.useState(!1),[_,x]=Z.useState("");et(Yo),et(No);const[K,H]=et(Ro);Z.useEffect(()=>{!_&&r!=="Fusion"&&pl(t).then(S=>{S!=null&&S.exist&&x(S.uploadPath)})},[_]),console.log("download modal version: 6.0.45");const[J,N]=Z.useState(!1);Z.useEffect(()=>{},[J]),Z.useEffect(()=>{const S=()=>{W(window.innerWidth)};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}},[]);const D=async()=>{G(!0);const S=await xr(e,o);return S!=null&&S.networks||(S.networks=Do),I(S),S},V=(S,P)=>{clearTimeout(To),To=setTimeout(()=>{Zr(t,{iosUrl:S,googleUrl:P},{urlType:b})},1e3)},U=S=>{m(S),V(S,y)},re=S=>{h(S),V(g,S)},ie=async(S,P)=>{var B,oe;try{let ye;if(r==="Playable"||r==="Ready"){const Ne=await nu(t,o);if(Ne){m(Ne.iosLink),h(Ne.androidLink),G(!1);return}if(S&&(S.iosUrl||S.googleUrl)){m(S.iosUrl),h(S.googleUrl),G(!1);return}if(P&&P.html){const _t=`${u}/${P.html}?t=${Date.now()}`;let Re=await fetch(_t).then(Rn=>Rn.text());const Jr=((B=Re.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:B.at(1))||"";m(Jr);const Dr=((oe=Re.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:oe.at(1))||"";h(Dr),G(!1)}else h(""),m(""),G(!1)}else if(r==="Flex"){const Ne=await ru(t,o);if(Ne.googleUrl||Ne.iosUrl){h(Ne.googleUrl),m(Ne.iosUrl),G(!1);return}S&&(S.iosUrl||S.googleUrl)?(m(S.iosUrl),h(S.googleUrl),G(!1)):(h(""),m(""),G(!1))}else r==="Fusion"&&(S&&(S.iosUrl||S.googleUrl)?(m(S.iosUrl),h(S.googleUrl),G(!1)):(h(""),m(""),G(!1)))}catch(ye){l(ye.response.data.error.msg)}},F=async()=>{G(!0);let S;r==="Flex"?S=await eu({_id:t},o):r==="Ready"&&(S=await ou({_id:t},o)),S&&(["admin","pm","tester","sales"].includes(a.role)?E({...S,networks:K}):r==="Ready"&&!S.canDownload?E({...S,networks:Do}):E(S)),G(!1)},me=async()=>await tu(n,o),[j,qe]=Z.useState(null),Ye=async S=>await au(S,o);return Z.useEffect(()=>{i||(I(null),R(null),E(null),d(null),qe(null)),i&&(r==="Playable"?me().then(S=>{Ye(S.customer).then(P=>{qe(P)}),D().then(P=>{ie(null,P)}),Q(!1)}):r==="Ready"?F().then(S=>{D().then(P=>{ie(null,P),Q(!1)})}):r==="Flex"?F().then(S=>{Q(!1),me().then(P=>{i&&(ie(P,null),Q(!1),R(P))})}):r==="Import"?iu(t,o).then(S=>{I(S),m(S.iosUrl||""),h(S.googleUrl||""),G(!1),Q(!1)}):r==="Fusion"&&(Q(!1),me().then(S=>{i&&(ie(S,null),Q(!1),S.networks=K.filter(P=>P!=="cdn"),R(S))})))},[n,e,t,i]),c.jsxs("div",{style:{display:"flex",height:ae>1440?"700px":"650px",width:ae>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[c.jsx(wl,{title:s,typeOfProduct:r,fileSize:A,urls:{iosUrl:g,googleUrl:y},handleIosChange:U,handleGoogleChange:re,disabled:ne,api:o,creditDownload:z,user:a,isTest:k,setIsTest:T,urlType:b,setUrlType:C,allNetworksSelected:J,setAllNetworksSelected:N}),X?c.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:c.jsx(Xt,{isNetworksLoading:!0})}):(L||z||r==="Fusion")&&(r==="Flex"?q:!0)&&!X&&g!=="Loading..."&&y!=="Loading..."&&c.jsx($l,{playable:L,creditDownload:z,visible:i,versionId:t,typeOfProduct:r,api:o,user:a,handleDownloadError:l,fetchFileUrl:u,urls:{iosUrl:g,googleUrl:y},game:q,getDownloadCount:F,disabled:ne,setSafariCopyLink:f,isTest:k,urlType:b,allNetworksSelected:J,cdnModal:v,setCdnModal:M,cdnUrl:_,setCdnUrl:x,customer:j??void 0})]})},Sd="";var Er={exports:{}},dt={},Mr={exports:{}},Te={},kr={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=A;/*!
|
|
50
|
+
`):" "+ro(o[0]):"as no adapter specified";throw new le("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ar};function lr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Jt(null,e)}function oo(e){return lr(e),e.headers=$e.from(e.headers),e.data=sr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),io.getAdapter(e.adapter||or.adapter)(e).then(function(r){return lr(e),r.data=sr.call(e,e.transformResponse,r),r.headers=$e.from(r.headers),r},function(r){return eo(r)||(lr(e),r&&r.response&&(r.response.data=sr.call(e,e.transformResponse,r.response),r.response.headers=$e.from(r.response.headers))),Promise.reject(r)})}const ao=e=>e instanceof $e?e.toJSON():e;function bt(e,t){t=t||{};const n={};function r(u,A,d){return w.isPlainObject(u)&&w.isPlainObject(A)?w.merge.call({caseless:d},u,A):w.isPlainObject(A)?w.merge({},A):w.isArray(A)?A.slice():A}function i(u,A,d){if(w.isUndefined(A)){if(!w.isUndefined(u))return r(void 0,u,d)}else return r(u,A,d)}function o(u,A){if(!w.isUndefined(A))return r(void 0,A)}function a(u,A){if(w.isUndefined(A)){if(!w.isUndefined(u))return r(void 0,u)}else return r(void 0,A)}function s(u,A,d){if(d in t)return r(u,A);if(d in e)return r(void 0,u)}const l={url:o,method:o,data:o,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:s,headers:(u,A)=>i(ao(u),ao(A),!0)};return w.forEach(Object.keys(Object.assign({},e,t)),function(A){const d=l[A]||i,f=d(e[A],t[A],A);w.isUndefined(f)&&d!==s||(n[A]=f)}),n}const so="1.6.0",ur={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ur[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ao={};ur.transitional=function(t,n,r){function i(o,a){return"[Axios v"+so+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(t===!1)throw new le(i(a," has been removed"+(n?" in "+n:"")),le.ERR_DEPRECATED);return n&&!Ao[a]&&(Ao[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,s):!0}};function zA(e,t,n){if(typeof e!="object")throw new le("options must be an object",le.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const s=e[o],l=s===void 0||a(s,o,e);if(l!==!0)throw new le("option "+o+" must be "+l,le.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new le("Unknown option "+o,le.ERR_BAD_OPTION)}}const cr={assertOptions:zA,validators:ur},ot=cr.validators;class bn{constructor(t){this.defaults=t,this.interceptors={request:new Ui,response:new Ui}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=bt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&cr.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),i!=null&&(w.isFunction(i)?n.paramsSerializer={serialize:i}:cr.assertOptions(i,{encode:ot.function,serialize:ot.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&w.merge(o.common,o[n.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=$e.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let A,d=0,f;if(!l){const y=[oo.bind(this),void 0];for(y.unshift.apply(y,s),y.push.apply(y,u),f=y.length,A=Promise.resolve(n);d<f;)A=A.then(y[d++],y[d++]);return A}f=s.length;let g=n;for(d=0;d<f;){const y=s[d++],m=s[d++];try{g=y(g)}catch(h){m.call(this,h);break}}try{A=oo.call(this,g)}catch(y){return Promise.reject(y)}for(d=0,f=u.length;d<f;)A=A.then(u[d++],u[d++]);return A}getUri(t){t=bt(this.defaults,t);const n=to(t.baseURL,t.url);return Bi(n,t.params,t.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(t){bn.prototype[t]=function(n,r){return this.request(bt(r||{},{method:t,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,s){return this.request(bt(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}bn.prototype[t]=n(),bn.prototype[t+"Form"]=n(!0)});const Cn=bn;class dr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new Jt(o,a,s),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 dr(function(i){t=i}),cancel:t}}}const YA=dr;function NA(e){return function(n){return e.apply(null,n)}}function RA(e){return w.isObject(e)&&e.isAxiosError===!0}const fr={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(fr).forEach(([e,t])=>{fr[t]=e});const JA=fr;function lo(e){const t=new Cn(e),n=ki(Cn.prototype.request,t);return w.extend(n,Cn.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return lo(bt(e,i))},n}const be=lo(or);be.Axios=Cn,be.CanceledError=Jt,be.CancelToken=YA,be.isCancel=eo,be.VERSION=so,be.toFormData=yn,be.AxiosError=le,be.Cancel=be.CanceledError,be.all=function(t){return Promise.all(t)},be.spread=NA,be.isAxiosError=RA,be.mergeConfig=bt,be.AxiosHeaders=$e,be.formToJSON=e=>_i(w.isHTMLForm(e)?new FormData(e):e),be.getAdapter=io.getAdapter,be.HttpStatusCode=JA,be.default=be;const DA=be;/*! typescript-cookie v1.0.6 | MIT */const uo=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),co=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),mr=decodeURIComponent,pr=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function TA(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 fo(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,i={};let o;for(;(o=r.exec(document.cookie))!=null;)try{const a=n(o[1]);if(i[a]=t(o[2],a),e===a)break}catch{}return e!=null?i[e]:i}const mo=Object.freeze({decodeName:mr,decodeValue:pr,encodeName:uo,encodeValue:co}),hr=Object.freeze({path:"/"});function po(e,t,n=hr,{encodeValue:r=co,encodeName:i=uo}={}){return document.cookie=`${i(e)}=${r(t,e)}${TA(n)}`}function ho(e,{decodeValue:t=pr,decodeName:n=mr}={}){return fo(e,t,n)}function GA({decodeValue:e=pr,decodeName:t=mr}={}){return fo(void 0,e,t)}function HA(e,t=hr){po(e,"",Object.assign({},t,{expires:-1}))}function gr(e,t){const n={set:function(i,o,a){return po(i,o,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(i){if(arguments.length===0)return GA(this.converter.read);if(i!=null)return ho(i,this.converter.read)},remove:function(i,o){HA(i,Object.assign({},this.attributes,o))},withAttributes:function(i){return gr(this.converter,Object.assign({},this.attributes,i))},withConverter:function(i){return gr(Object.assign({},this.converter,i),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}gr({read:mo.decodeValue,write:mo.encodeValue},hr);let go;typeof window<"u"&&(go=ho("token"));const ge=DA.create({headers:{Authorization:go}});async function PA(e,t,n){return(await ge.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function XA(e,t){return e.network=="fb"&&(e.zip=1),(await ge.post(t+"/createFlexVersionLink",e||{})).data}async function VA(e,t,n){return(await ge.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function QA(e,t,n,r,i){return(await ge.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:i})).data}async function BA(e,t,n){return(await ge.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function UA(e,t,n,r,i){return(await ge.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:i})).data}async function FA(e,t,n){return(await ge.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function _A(e,t,n,r,i,o,a,s){return(await ge.post(e+"/createFusionVersionLink",{_id:t,network:n,fusionData:r,isPfTest:i,extras:o,androidLink:a,iosLink:s})).data}async function $A(e,t){return(await ge.post(t+"/updateFusionUrl",e||{})).data}async function el(e,t){return(await ge.post(t+"/getCdnExportName",e||{})).data}async function tl(e,t){return(await ge.post(t+"/updateFlexUrl",e||{})).data}async function yo(e,t,n){return(await ge.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Ct(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 qo(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=qo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=qo(e))&&(r&&(r+=" "),r+=t);return r}const Dt=e=>typeof e=="number"&&!isNaN(e),lt=e=>typeof e=="string",Ke=e=>typeof e=="function",Zn=e=>lt(e)||Ke(e)?e:null,yr=e=>Z.isValidElement(e)||lt(e)||Ke(e)||Dt(e);function nl(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function xn(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:o=300}=e;return function(a){let{children:s,position:l,preventExitTransition:u,done:A,nodeRef:d,isIn:f}=a;const g=r?`${t}--${l}`:t,y=r?`${n}--${l}`:n,m=Z.useRef(0);return Z.useLayoutEffect(()=>{const h=d.current,b=g.split(" "),C=L=>{L.target===d.current&&(h.dispatchEvent(new Event("d")),h.removeEventListener("animationend",C),h.removeEventListener("animationcancel",C),m.current===0&&L.type!=="animationcancel"&&h.classList.remove(...b))};h.classList.add(...b),h.addEventListener("animationend",C),h.addEventListener("animationcancel",C)},[]),Z.useEffect(()=>{const h=d.current,b=()=>{h.removeEventListener("animationend",b),i?nl(h,A,o):A()};f||(u?b():(m.current=1,h.className+=` ${y}`,h.addEventListener("animationend",b)))},[f]),Z.createElement(Z.Fragment,null,s)}}function vo(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 je={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)})}},wn=e=>{let{theme:t,type:n,...r}=e;return Z.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},qr={info:function(e){return Z.createElement(wn,{...e},Z.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 Z.createElement(wn,{...e},Z.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 Z.createElement(wn,{...e},Z.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 Z.createElement(wn,{...e},Z.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 Z.createElement("div",{className:"Toastify__spinner"})}};function rl(e){const[,t]=Z.useReducer(g=>g+1,0),[n,r]=Z.useState([]),i=Z.useRef(null),o=Z.useRef(new Map).current,a=g=>n.indexOf(g)!==-1,s=Z.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:g=>o.get(g)}).current;function l(g){let{containerId:y}=g;const{limit:m}=s.props;!m||y&&s.containerId!==y||(s.count-=s.queue.length,s.queue=[])}function u(g){r(y=>g==null?[]:y.filter(m=>m!==g))}function A(){const{toastContent:g,toastProps:y,staleId:m}=s.queue.shift();f(g,y,m)}function d(g,y){let{delay:m,staleId:h,...b}=y;if(!yr(g)||function(Q){return!i.current||s.props.enableMultiContainer&&Q.containerId!==s.props.containerId||o.has(Q.toastId)&&Q.updateId==null}(b))return;const{toastId:C,updateId:L,data:I}=b,{props:q}=s,R=()=>u(C),z=L==null;z&&s.count++;const E={...q,style:q.toastStyle,key:s.toastKey++,...Object.fromEntries(Object.entries(b).filter(Q=>{let[ae,W]=Q;return W!=null})),toastId:C,updateId:L,data:I,closeToast:R,isIn:!1,className:Zn(b.className||q.toastClassName),bodyClassName:Zn(b.bodyClassName||q.bodyClassName),progressClassName:Zn(b.progressClassName||q.progressClassName),autoClose:!b.isLoading&&(X=b.autoClose,G=q.autoClose,X===!1||Dt(X)&&X>0?X:G),deleteToast(){const Q=vo(o.get(C),"removed");o.delete(C),je.emit(4,Q);const ae=s.queue.length;if(s.count=C==null?s.count-s.displayedToast:s.count-1,s.count<0&&(s.count=0),ae>0){const W=C==null?s.props.limit:1;if(ae===1||W===1)s.displayedToast++,A();else{const k=W>ae?ae:W;s.displayedToast=k;for(let T=0;T<k;T++)A()}}else t()}};var X,G;E.iconOut=function(Q){let{theme:ae,type:W,isLoading:k,icon:T}=Q,v=null;const M={theme:ae,type:W};return T===!1||(Ke(T)?v=T(M):Z.isValidElement(T)?v=Z.cloneElement(T,M):lt(T)||Dt(T)?v=T:k?v=qr.spinner():(_=>_ in qr)(W)&&(v=qr[W](M))),v}(E),Ke(b.onOpen)&&(E.onOpen=b.onOpen),Ke(b.onClose)&&(E.onClose=b.onClose),E.closeButton=q.closeButton,b.closeButton===!1||yr(b.closeButton)?E.closeButton=b.closeButton:b.closeButton===!0&&(E.closeButton=!yr(q.closeButton)||q.closeButton);let ne=g;Z.isValidElement(g)&&!lt(g.type)?ne=Z.cloneElement(g,{closeToast:R,toastProps:E,data:I}):Ke(g)&&(ne=g({closeToast:R,toastProps:E,data:I})),q.limit&&q.limit>0&&s.count>q.limit&&z?s.queue.push({toastContent:ne,toastProps:E,staleId:h}):Dt(m)?setTimeout(()=>{f(ne,E,h)},m):f(ne,E,h)}function f(g,y,m){const{toastId:h}=y;m&&o.delete(m);const b={content:g,props:y};o.set(h,b),r(C=>[...C,h].filter(L=>L!==m)),je.emit(4,vo(b,b.props.updateId==null?"added":"updated"))}return Z.useEffect(()=>(s.containerId=e.containerId,je.cancelEmit(3).on(0,d).on(1,g=>i.current&&u(g)).on(5,l).emit(2,s),()=>{o.clear(),je.emit(3,s)}),[]),Z.useEffect(()=>{s.props=e,s.isToastActive=a,s.displayedToast=n.length}),{getToastToRender:function(g){const y=new Map,m=Array.from(o.values());return e.newestOnTop&&m.reverse(),m.forEach(h=>{const{position:b}=h.props;y.has(b)||y.set(b,[]),y.get(b).push(h)}),Array.from(y,h=>g(h[0],h[1]))},containerRef:i,isToastActive:a}}function bo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Co(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function il(e){const[t,n]=Z.useState(!1),[r,i]=Z.useState(!1),o=Z.useRef(null),a=Z.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,s=Z.useRef(e),{autoClose:l,pauseOnHover:u,closeToast:A,onClick:d,closeOnClick:f}=e;function g(I){if(e.draggable){I.nativeEvent.type==="touchstart"&&I.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",b),document.addEventListener("mouseup",C),document.addEventListener("touchmove",b),document.addEventListener("touchend",C);const q=o.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=q.getBoundingClientRect(),q.style.transition="",a.x=bo(I.nativeEvent),a.y=Co(I.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=q.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=q.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function y(I){if(a.boundingRect){const{top:q,bottom:R,left:z,right:E}=a.boundingRect;I.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=z&&a.x<=E&&a.y>=q&&a.y<=R?h():m()}}function m(){n(!0)}function h(){n(!1)}function b(I){const q=o.current;a.canDrag&&q&&(a.didMove=!0,t&&h(),a.x=bo(I),a.y=Co(I),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),q.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,q.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function C(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",C);const I=o.current;if(a.canDrag&&a.didMove&&I){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return i(!0),void e.closeToast();I.style.transition="transform 0.2s, opacity 0.2s",I.style.transform=`translate${e.draggableDirection}(0)`,I.style.opacity="1"}}Z.useEffect(()=>{s.current=e}),Z.useEffect(()=>(o.current&&o.current.addEventListener("d",m,{once:!0}),Ke(e.onOpen)&&e.onOpen(Z.isValidElement(e.children)&&e.children.props),()=>{const I=s.current;Ke(I.onClose)&&I.onClose(Z.isValidElement(I.children)&&I.children.props)}),[]),Z.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||h(),window.addEventListener("focus",m),window.addEventListener("blur",h)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",m),window.removeEventListener("blur",h))}),[e.pauseOnFocusLoss]);const L={onMouseDown:g,onTouchStart:g,onMouseUp:y,onTouchEnd:y};return l&&u&&(L.onMouseEnter=h,L.onMouseLeave=m),f&&(L.onClick=I=>{d&&d(I),a.canCloseOnClick&&A()}),{playToast:m,pauseToast:h,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:L}}function Zo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return Z.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:i=>{i.stopPropagation(),t(i)},"aria-label":r},Z.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Z.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 ol(e){let{delay:t,isRunning:n,closeToast:r,type:i="default",hide:o,className:a,style:s,controlledProgress:l,progress:u,rtl:A,isIn:d,theme:f}=e;const g=o||l&&u===0,y={...s,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:g?0:1};l&&(y.transform=`scaleX(${u})`);const m=at("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":A}),h=Ke(a)?a({rtl:A,type:i,defaultClassName:m}):at(m,a);return Z.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:h,style:y,[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{d&&r()}})}const al=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i}=il(e),{closeButton:o,children:a,autoClose:s,onClick:l,type:u,hideProgressBar:A,closeToast:d,transition:f,position:g,className:y,style:m,bodyClassName:h,bodyStyle:b,progressClassName:C,progressStyle:L,updateId:I,role:q,progress:R,rtl:z,toastId:E,deleteToast:X,isIn:G,isLoading:ne,iconOut:Q,closeOnClick:ae,theme:W}=e,k=at("Toastify__toast",`Toastify__toast-theme--${W}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":z},{"Toastify__toast--close-on-click":ae}),T=Ke(y)?y({rtl:z,position:g,type:u,defaultClassName:k}):at(k,y),v=!!R||!s,M={closeToast:d,type:u,theme:W};let _=null;return o===!1||(_=Ke(o)?o(M):Z.isValidElement(o)?Z.cloneElement(o,M):Zo(M)),Z.createElement(f,{isIn:G,done:X,position:g,preventExitTransition:n,nodeRef:r},Z.createElement("div",{id:E,onClick:l,className:T,...i,style:m,ref:r},Z.createElement("div",{...G&&{role:q},className:Ke(h)?h({type:u}):at("Toastify__toast-body",h),style:b},Q!=null&&Z.createElement("div",{className:at("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!ne})},Q),Z.createElement("div",null,a)),_,Z.createElement(ol,{...I&&!v?{key:`pb-${I}`}:{},rtl:z,theme:W,delay:s,isRunning:t,isIn:G,closeToast:d,hide:A,type:u,style:L,className:C,controlledProgress:v,progress:R||0})))},In=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},sl=xn(In("bounce",!0));xn(In("slide",!0)),xn(In("zoom")),xn(In("flip"));const vr=Z.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:i}=rl(e),{className:o,style:a,rtl:s,containerId:l}=e;function u(A){const d=at("Toastify__toast-container",`Toastify__toast-container--${A}`,{"Toastify__toast-container--rtl":s});return Ke(o)?o({position:A,rtl:s,defaultClassName:d}):at(d,Zn(o))}return Z.useEffect(()=>{t&&(t.current=r.current)},[]),Z.createElement("div",{ref:r,className:"Toastify",id:l},n((A,d)=>{const f=d.length?{...a}:{...a,pointerEvents:"none"};return Z.createElement("div",{className:u(A),style:f,key:`container-${A}`},d.map((g,y)=>{let{content:m,props:h}=g;return Z.createElement(al,{...h,isIn:i(h.toastId),style:{...h.style,"--nth":y+1,"--len":d.length},key:`toast-${h.key}`},m)}))}))});vr.displayName="ToastContainer",vr.defaultProps={position:"top-right",transition:sl,autoClose:5e3,closeButton:Zo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let br,ut=new Map,Tt=[],Al=1;function xo(){return""+Al++}function ll(e){return e&&(lt(e.toastId)||Dt(e.toastId))?e.toastId:xo()}function Gt(e,t){return ut.size>0?je.emit(0,e,t):Tt.push({content:e,options:t}),t.toastId}function Sn(e,t){return{...t,type:t&&t.type||e,toastId:ll(t)}}function Kn(e){return(t,n)=>Gt(t,Sn(e,n))}function he(e,t){return Gt(e,Sn("default",t))}he.loading=(e,t)=>Gt(e,Sn("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),he.promise=function(e,t,n){let r,{pending:i,error:o,success:a}=t;i&&(r=lt(i)?he.loading(i,n):he.loading(i.render,{...n,...i}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(A,d,f)=>{if(d==null)return void he.dismiss(r);const g={type:A,...s,...n,data:f},y=lt(d)?{render:d}:d;return r?he.update(r,{...g,...y}):he(y.render,{...g,...y}),f},u=Ke(e)?e():e;return u.then(A=>l("success",a,A)).catch(A=>l("error",o,A)),u},he.success=Kn("success"),he.info=Kn("info"),he.error=Kn("error"),he.warning=Kn("warning"),he.warn=he.warning,he.dark=(e,t)=>Gt(e,Sn("default",{theme:"dark",...t})),he.dismiss=e=>{ut.size>0?je.emit(1,e):Tt=Tt.filter(t=>e!=null&&t.options.toastId!==e)},he.clearWaitingQueue=function(e){return e===void 0&&(e={}),je.emit(5,e)},he.isActive=e=>{let t=!1;return ut.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},he.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,i){let{containerId:o}=i;const a=ut.get(o||br);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:i}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:xo()};o.toastId!==e&&(o.staleId=e);const a=o.render||i;delete o.render,Gt(a,o)}},0)},he.done=e=>{he.update(e,{progress:1})},he.onChange=e=>(je.on(4,e),()=>{je.off(4,e)}),he.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"},he.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},je.on(2,e=>{br=e.containerId||e,ut.set(br,e),Tt.forEach(t=>{je.emit(0,t.content,t.options)}),Tt=[]}).on(3,e=>{ut.delete(e.containerId||e),ut.size===0&&je.off(0).off(1).off(5)});function ul(e){he.error(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function ct(e){he.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Cr="",ze="Playable",Le=null,wo=null,Ht,Io=[];const Zr=async(e,t,n)=>{ze==="Playable"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await yo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):ze==="Flex"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await tl({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):ze==="Ready"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(t.googleUrl=t.iosUrl),await yo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le)):ze==="Fusion"&&t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await $A({_id:Ht==null?void 0:Ht.fusionId,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le)},Ln=async e=>{let t=Cr+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=n.split("/").reduce((a,s)=>s,""),document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(i),ct("Download successfully")}).catch(r=>{console.error("File error:",r)})},cl=(e,t,n)=>{let r=Cr+"/"+e;n==="adikteev"&&(r=e),Ct(r)?ct(se.t("common:link_copied")):t(r)};function So(e){let t=Io.find(n=>n.id===e);return t&&t.apiName?t.apiName:e}async function Pt(e,t,n,r="download",i=!1,o=null){return t=So(t),new Promise(async(a,s)=>{let l=async u=>{r==="download"?await Ln(u):r==="copy"&&cl(u,wo,t)};try{await Zr(e,n,o)}catch(u){console.log("updateUrls error",u)}ze==="Playable"?QA(Le,e,t,i,o).then(async u=>{let{url:A}=u;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Flex"?XA({_id:e,network:t,extras:o},Le).then(async u=>{if(u.message){s(u);return}let{url:A}=u;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Import"?VA(Le,e,t).then(async u=>{let A=u.url;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Ready"?UA(Le,e,t,i,o).then(async u=>{if(u.message){s(u);return}let A=u.url;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})}):ze==="Fusion"&&_A(Le,e,t,Ht,i,o,n==null?void 0:n.googleUrl,n==null?void 0:n.iosUrl).then(async u=>{let A=u.url;await l(A),a(u)}).catch(u=>{let A=u.response.data.error.msg;s({message:A})})})}async function dl(e,t,n,r=null){return new Promise(async(i,o)=>{n=n.map(a=>So(a)),await Zr(e,t,r),ze==="Flex"?PA(e,n,Le).then(async a=>{if(a.message){o(a);return}await Ln(a.url),i(a.url)}).catch(a=>{let s=a.response.data.error.msg;o({message:s})}):ze==="Ready"?FA(e,n,Le).then(async a=>{if(a.message){o(a);return}await Ln(a.url),i(a.url)}).catch(a=>{console.log("err",a);let s=a.response.data.error.msg;o({message:s})}):BA(e,n,Le).then(async a=>{await Ln(a.url),i(a.url)}).catch(a=>{let s=a.response.data.error.msg;o({message:s})})})}function fl(e,t,n,r,i){ze=e,Le=t,wo=n,Cr=r,Ht=i}function ml(e){Io=e}async function pl(e){try{return await el({versionId:e,checkExistance:!0},Le)}catch{return null}}async function xr(e,t){return(await ge.post(t+"/findPlayable",{_id:e})).data}const hl=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:i,setSafariCopyLink:o,qrUrl:a,iosLink:s,androidLink:l,urlType:u})=>{const[A,d]=Z.useState(!1),f=async()=>{d(!0),Pt(e,"default",{iosUrl:s,googleUrl:l},null,!1,{urlType:u}).then(async g=>{var b,C,L,I;let y="";if(t&&(n==="Playable"||n==="Ready")){const q=await xr(t,r),R=(C=(b=q==null?void 0:q.data)==null?void 0:b.globalProps)==null?void 0:C.defaultLandscape,z=(I=(L=q==null?void 0:q.data)==null?void 0:L.globalProps)==null?void 0:I.defaultPhoneIndex;R&&(y+="&landscape=true"),z!==void 0&&(y+=`&phoneIndex=${z}`)}xr(t,r),d(!1);let m;n==="Flex"?m=`${i}/preview?versionId=${e}`:n==="Import"?m=`${i}/preview?versionId=${e}`:n==="Ready"?m=`${i}/preview?versionId=${e}&ready=true`:n==="Fusion"?m=`${i}/preview?versionId=${e}`:m=`${i}/preview?versionId=${e}`,m+=y,Ct(m)?ct(se.t("common:link_copied")):o(m),d(!1)}).catch(g=>{d(!1)})};return c.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[c.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:a?c.jsx(rs,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):c.jsx("img",{style:{width:"50px",height:"50px"},src:Qe,alt:"pf-logo-gif"})}),c.jsxs("div",{children:[c.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:se.t("common:mobile_testing")}),c.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:se.t("common:scan_qr_code_to_test_in_any_browser")}),c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{A||f()},children:c.jsxs(c.Fragment,{children:[c.jsx(yi,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),c.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:A?c.jsx("img",{style:{height:"90%"},src:Qe,alt:"loading"}):c.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:se.t("common:copy_link")})})]})})]})]})},gl=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:i,iframeUrl:o,fetchFileUrl:a,copyLinkUrl:s,setSafariCopyLink:l,iosLink:u,androidLink:A,urlType:d})=>{const[f,g]=Z.useState(window.innerWidth);console.log("iosLink",u),Z.useEffect(()=>{console.log("re add event listener");function m(h){console.log(h),h.data==="cta"&&(console.log("Received 'cta' message from iframe"),u&&window.open(u,"_blank"))}return window.addEventListener("message",m,!1),()=>{window.removeEventListener("message",m)}},[u,A]),Z.useEffect(()=>{const m=()=>{g(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const y=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return c.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:f>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[c.jsx(ba,{iframeUrl:o}),c.jsx(Ca,{name:y}),c.jsx(hl,{versionId:t,playableId:n,typeOfProduct:r,api:i,copyLinkUrl:s,setSafariCopyLink:l,qrUrl:o,iosLink:u,androidLink:A,urlType:d})]})},yl=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:c.jsx("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"}})});async function ql(e,t){return(await ge.post(t+"/buyRequest",{requestType:e})).data}const vl=()=>c.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[c.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),c.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_518_12094",children:c.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),bl=({creditDownload:e,api:t})=>c.jsxs(c.Fragment,{children:[c.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."}),c.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"," ",c.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.",c.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>ql("Flex Credit",t).then(n=>ct("You will be contacted regarding your request.")),children:["Get more",c.jsx(vl,{})]})]})]});var we=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e.Fusion="#171717",e))(we||{});const Ko=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const o=s=>{n(s.target.value)},a=s=>{r(s.target.value)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[c.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:se.t("common:app_store")}),c.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:we[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:o,placeholder:"Ios Url",disabled:i})]}),c.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[c.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:[se.t("common:google_play"),":"]}),c.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:we[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:i})]})]})},Cl=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const o=a=>{n(a.target.value)};return c.jsx(c.Fragment,{children:c.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[c.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),c.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:we[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:o,placeholder:"Ios Url",disabled:i})]})})},Zl=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o,api:a,creditDownload:s,user:l,isTest:u,setIsTest:A,urlType:d,setUrlType:f})=>{const g=()=>c.jsx(c.Fragment,{children:c.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:[c.jsx("div",{style:{position:"absolute",bottom:"-3px",left:d==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),c.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="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{f("game")},200)},children:c.jsx("span",{style:{position:"relative",color:d==="game"?"#000":"#a3a3a3",fontWeight:d==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),c.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="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{f("single")},200)},children:c.jsx("span",{style:{position:"relative",color:d==="single"?"#000":"#a3a3a3",fontWeight:d==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return c.jsx(c.Fragment,{children:e!=="Import"&&c.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[e==="Ready"?c.jsxs(c.Fragment,{children:[c.jsx(g,{}),d==="game"&&c.jsx(Ko,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o}),d==="single"&&c.jsx(Cl,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o})]}):c.jsx(c.Fragment,{children:c.jsx(Ko,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:o})}),(s==null?void 0:s.willSpendCredit)&&c.jsx(bl,{creditDownload:s,api:a})]})})},xl=({typeOfProduct:e,title:t,fileSize:n})=>c.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[c.jsx("span",{style:{color:we[e]},children:t}),n?c.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:[se.t("common:file_size")," ",parseFloat(n).toFixed(2)," mb"]}):null]}),wl=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:i,handleGoogleChange:o,disabled:a,creditDownload:s,api:l,user:u,isTest:A,setIsTest:d,urlType:f,setUrlType:g,allNetworksSelected:y,setAllNetworksSelected:m})=>c.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:[c.jsx(xl,{typeOfProduct:e,title:r,fileSize:t}),c.jsx(Zl,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:i,handleGoogleChange:o,disabled:a,creditDownload:s,api:l,user:u,isTest:A,setIsTest:d,urlType:f,setUrlType:g}),c.jsx(yl,{typeOfProduct:e,allNetworksSelected:y,setAllNetworksSelected:m})]}),wr=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:i})=>c.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||i,children:e}),Il=({checked:e,typeOfProduct:t,id:n})=>{const[r,i]=Z.useState(e);Z.useEffect(()=>{i(e)},[e]);const o=()=>{i(!r)};return c.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:c.jsxs("label",{onClick:o,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[c.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:o}),c.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:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:we[t],stroke:we[t],strokeWidth:"1",children:c.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"})})," "]})]})})},Id="",Sl=({typeOfProduct:e})=>c.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:c.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}}),c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}}),c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}}),c.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:we[e]}})]})}),Xt=({isNetworksLoading:e=!1})=>c.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:c.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Qe,alt:"pf-logo-gif"})}),Ir=({title:e,titleId:t,...n})=>c.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?c.jsx("title",{id:t,children:e}):null,c.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"})]}),Kl=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:i,download:o,typeOfProduct:a,urlType:s})=>{let l="";return a==="Ready"&&s==="single"?l=se.t("common:redirection_url_is_empty_are_you_sure_want_to_continue"):!t&&!n?l=se.t("common:both_links_are_empty_are_you_sure_want_to_continue"):t?n||(l=se.t("common:google_link_is_empty_are_you_sure_want_to_continue")):l=se.t("common:ios_link_is_empty_are_you_sure_want_to_continue"),c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.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:[c.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:l}),c.jsxs("div",{style:{display:"flex",gap:"5px"},children:[c.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:se.t("common:no")}),c.jsx("button",{onClick:async u=>{r==="download"?await o():r==="copyLink"&&await i(),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:se.t("common:yes")})]})]})]})},Sr=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:i,width:o="130%",height:a="120%"})=>c.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:a,width:o,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),c.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:[c.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?"}),c.jsxs("div",{style:{display:"flex",gap:"5px"},children:[c.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),c.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async s=>{s.preventDefault(),s.stopPropagation(),r==="download"?(await n(),await i()):r==="copy"&&(await t(),await i()),e()},children:"Yes"})]})]})]}),Ll=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:i,downloadingMolocoHtml:o})=>c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.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:c.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?c.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:c.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):c.jsx("button",{onClick:()=>{t(!1)},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"}),o?c.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:c.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):c.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"})]}),c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:i?c.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:c.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):c.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 Ol(e,t,n,r){return(await ge.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}let El=0;function On(e,t){const n=`atom${++El}`,r={toString(){return n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=Ml,r.write=kl),t&&(r.write=t),r}function Ml(e){return e(this)}function kl(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const Lo=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Oo=e=>"init"in e,Eo=e=>!!e.write,Vt=Symbol(""),Kr="pending",Wl="fulfilled",jl="rejected",zl=e=>typeof e=="object"&&e!==null&&Vt in e,En=new WeakMap,Yl=(e,t,n)=>{if(!En.has(e)){let r;const i=new Promise((o,a)=>{let s=e;const l=A=>d=>{s===A&&(i.status=Wl,i.value=d,o(d),n())},u=A=>d=>{s===A&&(i.status=jl,i.reason=d,a(d),n())};e.then(l(e),u(e)),r=(A,d)=>{A&&(En.set(A,i),s=A,A.then(l(A),u(A)),t(),t=d)}});i.status=Kr,i[Vt]=r,En.set(e,i)}return En.get(e)},Nl=e=>typeof(e==null?void 0:e.then)=="function",Mo=e=>"v"in e||"e"in e,Mn=e=>{if("e"in e)throw e.e;return e.v},kn=e=>{const t=e.v;return zl(t)&&t.status===Kr?t:null},ko=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},Qt=()=>[new Map,new Map,new Set],Wo=(e,t,n)=>{e[0].has(t)||e[0].set(t,new Set),e[1].set(t,n)},Rl=(e,t,n)=>{const r=e[0].get(t);r&&r.add(n)},Jl=(e,t)=>e[0].get(t),jo=(e,t)=>{e[2].add(t)},Zt=e=>{for(;e[1].size||e[2].size;){e[0].clear();const t=new Set(e[1].values());e[1].clear();const n=new Set(e[2]);e[2].clear(),t.forEach(r=>{var i;return(i=r.m)==null?void 0:i.l.forEach(o=>o())}),n.forEach(r=>r())}},Dl=()=>{const e=new WeakMap;let t;const n=m=>{let h=e.get(m);return h||(h={d:new Map,p:new Set,n:0},e.set(m,h)),h},r=(m,h,b,C=()=>{},L=()=>{})=>{const I="v"in h,q=h.v,R=kn(h);if(Nl(b))if(R)R!==b&&(R[Vt](b,C),++h.n);else{const z=Yl(b,C,L);if(z.status===Kr)for(const E of h.d.keys()){const X=n(E);ko(m,z,X)}h.v=z,delete h.e}else R&&R[Vt](Promise.resolve(b),C),h.v=b,delete h.e;(!I||!Object.is(q,h.v))&&++h.n},i=(m,h,b,C)=>{var L;const I=n(h);I.d.set(b,C.n);const q=kn(I);q&&ko(h,q,C),(L=C.m)==null||L.t.add(h),m&&Rl(m,b,h)},o=(m,h,b)=>{const C=n(h);if(!(b!=null&&b(h))&&Mo(C)&&(C.m||Array.from(C.d).every(([E,X])=>o(m,E,b).n===X)))return C;C.d.clear();let L=!0;const I=E=>{if(Lo(h,E)){const G=n(E);if(!Mo(G))if(Oo(E))r(E,G,E.init);else throw new Error("no atom init");return Mn(G)}const X=o(m,E,b);if(L)i(m,h,E,X);else{const G=Qt();i(G,h,E,X),A(G,h,C),Zt(G)}return Mn(X)};let q,R;const z={get signal(){return q||(q=new AbortController),q.signal},get setSelf(){return!R&&Eo(h)&&(R=(...E)=>{if(!L)return u(h,...E)}),R}};try{const E=h.read(I,z);return r(h,C,E,()=>q==null?void 0:q.abort(),()=>{if(C.m){const X=Qt();A(X,h,C),Zt(X)}}),C}catch(E){return delete C.v,C.e=E,++C.n,C}finally{L=!1}},a=m=>Mn(o(void 0,m)),s=(m,h)=>{const b=z=>{var E,X;const G=n(z),ne=new Set((E=G.m)==null?void 0:E.t);for(const Q of G.p)ne.add(Q);return(X=Jl(m,z))==null||X.forEach(Q=>{ne.add(Q)}),ne},C=[],L=new Set,I=z=>{if(!L.has(z)){L.add(z);for(const E of b(z))z!==E&&I(E);C.push(z)}};I(h);const q=new Set([h]),R=z=>L.has(z);for(let z=C.length-1;z>=0;--z){const E=C[z],X=n(E),G=X.n;let ne=!1;for(const Q of X.d.keys())if(Q!==E&&q.has(Q)){ne=!0;break}ne&&(o(m,E,R),A(m,E,X),G!==X.n&&(Wo(m,E,X),q.add(E))),L.delete(E)}},l=(m,h,...b)=>{const C=q=>Mn(o(m,q)),L=(q,...R)=>{let z;if(Lo(h,q)){if(!Oo(q))throw new Error("atom not writable");const E=n(q),X="v"in E,G=E.v,ne=R[0];r(q,E,ne),A(m,q,E),(!X||!Object.is(G,E.v))&&(Wo(m,q,E),s(m,q))}else z=l(m,q,...R);return Zt(m),z};return h.write(C,L,...b)},u=(m,...h)=>{const b=Qt(),C=l(b,m,...h);return Zt(b),C},A=(m,h,b)=>{if(b.m&&!kn(b)){for(const C of b.d.keys())b.m.d.has(C)||(d(m,C).t.add(h),b.m.d.add(C));for(const C of b.m.d||[])if(!b.d.has(C)){b.m.d.delete(C);const L=f(m,C);L==null||L.t.delete(h)}}},d=(m,h)=>{const b=n(h);if(!b.m){o(m,h);for(const C of b.d.keys())d(m,C).t.add(h);if(b.m={l:new Set,d:new Set(b.d.keys()),t:new Set},Eo(h)&&h.onMount){const C=b.m,{onMount:L}=h;jo(m,()=>{const I=L((...q)=>l(m,h,...q));I&&(C.u=I)})}}return b.m},f=(m,h)=>{const b=n(h);if(b.m&&!b.m.l.size&&!Array.from(b.m.t).some(C=>{var L;return(L=n(C).m)==null?void 0:L.d.has(h)})){const C=b.m.u;C&&jo(m,C),delete b.m;for(const I of b.d.keys()){const q=f(m,I);q==null||q.t.delete(h)}const L=kn(b);L&&L[Vt](void 0,()=>{});return}return b.m};return{get:a,set:u,sub:(m,h)=>{const b=Qt(),C=d(b,m);Zt(b);const L=C.l;return L.add(h),()=>{L.delete(h);const I=Qt();f(I,m),Zt(I)}}}};let Lr;const Tl=()=>(Lr||(Lr=Dl()),Lr),Gl=Z.createContext(void 0),zo=e=>{const t=Z.useContext(Gl);return(e==null?void 0:e.store)||t||Tl()},Hl=e=>typeof(e==null?void 0:e.then)=="function",Pl=Z.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function Xl(e,t){const n=zo(t),[[r,i,o],a]=Z.useReducer(u=>{const A=n.get(e);return Object.is(u[0],A)&&u[1]===n&&u[2]===e?u:[A,n,e]},void 0,()=>[n.get(e),n,e]);let s=r;(i!==n||o!==e)&&(a(),s=n.get(e));const l=t==null?void 0:t.delay;return Z.useEffect(()=>{const u=n.sub(e,()=>{if(typeof l=="number"){setTimeout(a,l);return}a()});return a(),u},[n,e,l]),Z.useDebugValue(s),Hl(s)?Pl(s):s}function Vl(e,t){const n=zo(t);return Z.useCallback((...i)=>n.set(e,...i),[n,e])}function et(e,t){return[Xl(e,t),Vl(e,t)]}const Yo=On(""),No=On(!1),Or=On([]),Ro=On([]),Ql=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:i,networkVersionSize:o,fileSizeLoading:a,showCheckBox:s,typeOfProduct:l,versionId:u,api:A,handleDownloadError:d,fetchFileUrl:f,urls:g,game:y,setIsConfirmActive:m,creditDownload:h,getDownloadCount:b,disabled:C,user:L,setSafariCopyLink:I,isTest:q,urlType:R,setCdnModal:z,generateCDN:E,cdnUrl:X})=>{const[G,ne]=Z.useState(!1),[Q,ae]=Z.useState(""),[W,k]=Z.useState(!1),[T,v]=Z.useState(!1),[M,_]=Z.useState(!1),[x,K]=Z.useState("download"),[H,J]=Z.useState(!1),[N,D]=Z.useState(!1),[V,U]=Z.useState(!1),[re,ie]=et(Or),F={cdn:"Generate Link",adikteev:"Copy CDN"},me=()=>{n(e)},j=async(B,oe)=>{const ye={molocoGenerateHtml:!1,urlType:R};if(S&&(oe==="copy"?(D(!0),oe="download",ye.molocoGenerateHtml=!0):J(!0)),console.log("getVersion",B,oe,ye),B==="cdn"){z(!0),await E(!0);return}return B==="adikteev"&&(oe="copy"),ne(!0),new Promise((Ne,_t)=>{Pt(u,B,g,oe,q,ye).then(Re=>{ne(!1),Ne(Re),D(!1),J(!1)}).catch(Re=>{ne(!1),d(Re.message,Re),_t(Re),D(!1),J(!1)})})},qe=async(B=!1)=>{B?D(!0):J(!0);const oe={molocoGenerateHtml:!1};B&&(oe.molocoGenerateHtml=!0),Pt(u,i,g,"download",q,oe).then(ye=>{B?D(!1):J(!1),_(!1)}).catch(ye=>{d(ye.message,ye)})},Ye=async()=>{U(!0);const B=await Ol(A,u,i,l);let oe=`${f}/${B==null?void 0:B.url}`;Ct(oe)?(ct(se.t("common:link_copied")),U(!1)):I(oe)},S=i==="moloco"||i==="molocoV2",P=re.find(B=>B.name===i);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?we[l]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+l,onClick:me,children:[c.jsxs("div",{style:{marginTop:i=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[c.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:c.jsx("div",{children:o&&o.map(B=>B.network).includes(i)?a?c.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:c.jsx(Sl,{typeOfProduct:l})}):o.map(B=>c.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:B.network===i?B.size.toString().slice(0,5)+"Mb":""},B.network)):null})}),c.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(l==="Playable"||l==="Ready"||l==="Flex")&&s&&c.jsx(Il,{checked:r,typeOfProduct:l,id:e})}),c.jsx("img",{onClick:me,style:{width:"30rem",height:i=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[c.jsx(wr,{className:`${S?"w-1/2":"w-2/3"} border-hover-`+l,downloading:G,onClickDonwload:async B=>{if(B.stopPropagation(),S&&L.customer==="playableFactoryInternal"){_(!0);return}else{ae("download");const oe=g.iosUrl,ye=g.googleUrl;i==="cdn"&&h&&h.willSpendCredit&&!X||i!=="cdn"&&h&&h.willSpendCredit?(m(!0),K("download"),k(!0)):["Playable","Flex"].includes(l)&&(!oe||!ye)||l==="Ready"&&R==="single"&&!oe||l==="Ready"&&R==="multi"&&(!oe||!ye)?(m(!0),v(!0)):(v(!1),k(!1),await j(i,"download"))}},children:S?c.jsxs(c.Fragment,{children:[!H&&c.jsxs(c.Fragment,{children:[c.jsx(Ir,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),L.customer!=="playableFactoryInternal"?se.t("common:txt"):se.t("common:download")]}),H&&c.jsx(Xt,{})]}):c.jsxs(c.Fragment,{children:[!G&&c.jsxs(c.Fragment,{children:[c.jsx(Ir,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),F[i]||se.t("common:download")]}),G&&c.jsx(Xt,{})]})}),P&&P.downloadType.includes("copy")&&c.jsx(wr,{className:"w-1/3 border-hover-"+l,onClickDonwload:async B=>{B.stopPropagation(),ae("copyLink");const oe=g.iosUrl,ye=g.googleUrl;h&&(h!=null&&h.willSpendCredit)?(K("copy"),m(!0),k(!0)):l!=="Import"&&(!oe||!ye)?(m(!0),v(!0)):(k(!1),v(!1),await j(i,"copy"))},disabled:C,children:c.jsx(yi,{className:"h-6 w-6 stroke-dark-full"})}),S&&L.customer!=="playableFactoryInternal"&&c.jsxs(wr,{className:"w-1/2 border-hover-"+l,onClickDonwload:async B=>{B.stopPropagation(),ae("copyLink");const oe=g.iosUrl,ye=g.googleUrl;h&&(h!=null&&h.willSpendCredit)?(K("download"),m(!0),k(!0)):l!=="Import"&&(!oe||!ye)?(m(!0),v(!0)):(k(!1),v(!1),await qe(!0))},disabled:C,children:[!N&&c.jsxs(c.Fragment,{children:[c.jsx(Ir,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),se.t("common:html")]}),N&&c.jsx(Xt,{})]})]})]}),W&&c.jsx(Sr,{creditConfirmType:x,handleCopyLink:async()=>{v(!1),m(!1),await j(i,"copy")},download:async()=>{v(!1),m(!1),await j(i,"download")},onClose:()=>{k(!1),m(!1)},getDownloadCount:b}),T&&c.jsx(Kl,{onClose:()=>{v(!1),m(!1)},iosLink:g.iosUrl,googleLink:g.googleUrl,buttonType:Q,handleCopyLink:async()=>{v(!1),m(!1),await j(i,"copy")},download:async()=>{v(!1),m(!1),await j(i,"download")},typeOfProduct:l,urlType:R}),M&&L.customer==="playableFactoryInternal"&&c.jsx(Ll,{onClose:()=>{_(!1)},handleDownload:qe,handleDownloadMolocoTest:Ye,downloadingMoloco:H,donwloadintMolocoTest:V,downloadingMolocoHtml:N})]})},Bl=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:we[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return c.jsx("button",{onClick:r,className:n,style:i,children:e})},Ul=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?c.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:we[t]},children:c.jsx(Xt,{})}):c.jsx(Bl,{typeOfProduct:t,onClick:n,children:c.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download Selected"})})}),Jo=({title:e,titleId:t})=>c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),c.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),Fl=({onClose:e,cdnUrl:t,generateCDN:n,cdnUploading:r})=>c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:i=>{i.stopPropagation()},children:c.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[c.jsxs("p",{style:{fontSize:"1.1rem",fontWeight:500,textAlign:"left",marginBottom:"10px",color:"#00a3ff",textDecoration:"underline",cursor:"pointer",width:"150px",display:"flex",gap:"10px",alignItems:"center",height:"28px"},onClick:()=>{r||n()},children:["Update Link",r&&c.jsx("img",{width:"30px",src:Qe,alt:"pf-logo-gif"})]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[c.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:c.jsx(Jo,{})}),c.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:c.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:t,target:"_blank",children:t||"No CDN link generated"})}),c.jsx("button",{onClick:()=>{if(!t)return;Ct(t)&&ct(se.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:t?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})]})})]}),_l=({onClose:e,url:t})=>c.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:[c.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:n=>{n.stopPropagation()},children:c.jsx("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[c.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:c.jsx(Jo,{})}),c.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:c.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:t,target:"_blank",children:t||c.jsx("img",{width:"30px",src:Qe,alt:"pf-logo-gif"})})}),c.jsx("button",{onClick:()=>{if(!t)return;Ct(t)&&ct(se.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:t?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})})})]}),$l=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:i,api:o,user:a,handleDownloadError:s,fetchFileUrl:l,urls:u,game:A,getDownloadCount:d,disabled:f,setSafariCopyLink:g,isTest:y,urlType:m,allNetworksSelected:h,cdnModal:b,setCdnModal:C,cdnUrl:L,setCdnUrl:I,customer:q})=>{const[R,z]=Z.useState([]),[E,X]=Z.useState([]),[G,ne]=Z.useState(!1),[Q,ae]=Z.useState(""),[W,k]=Z.useState(!1),[T,v]=Z.useState(!1),[M,_]=Z.useState("download"),[x,K]=Z.useState(!1),[H,J]=Z.useState(!1),[N,D]=Z.useState(!1),[V,U]=et(Yo),[re,ie]=et(No),[F]=et(Or),me=async(S=!1)=>{S&&L||N||(D(!0),Pt(r,"cdn",u,null,!1,{}).then(P=>{I(P.url),D(!1)}).catch(P=>{s(P.message,P),D(!1)}))},j=async S=>{if(S==="adikteev")return;const P=[...R];if(R.includes(S)){const B=P.findIndex(oe=>oe===S);P.splice(B,1),z(P)}else P.push(S),z([...R,S]);F.filter(B=>[...P].includes(B.id)).map(B=>B.name)},qe=async()=>new Promise(async(S,P)=>{const B=F.filter(oe=>[...R].includes(oe.id)).map(oe=>oe.name);k(!0),dl(r,u,B,{urlType:m}).then(oe=>{k(!1),S(oe)}).catch(oe=>{console.log("get multi download err"),k(!1),s(oe.message,oe),P(oe)})}),Ye=async()=>{u.iosUrl,u.googleUrl,t&&t.willSpendCredit?(v(!0),_("download"),K(!0)):(K(!1),await qe())};return Z.useEffect(()=>{const S=F.filter(P=>{var B;return t&&((B=t==null?void 0:t.networks)==null?void 0:B.length)>0?t==null?void 0:t.networks.includes(P.name):i==="Import"?e==null?void 0:e.networks.filter(oe=>oe.status==="paid").some(oe=>oe.name===P.name):(e==null?void 0:e.networks.includes(P.name))||(A==null?void 0:A.networks.includes(P.name))}).filter(P=>P.name==="voodoo"?a.customer==="customer:20":!0).map(P=>P.id);z(h?S:[])},[h]),c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{position:"relative",flex:1,overflowY:T?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:c.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&F.filter(S=>{var P;return t&&((P=t==null?void 0:t.networks)==null?void 0:P.length)>0?t==null?void 0:t.networks.includes(S.name):i==="Import"?e==null?void 0:e.networks.filter(B=>B.status==="paid").some(B=>B.name===S.name):q!=null&&q.networks?q.networks.includes(S.name):(e==null?void 0:e.networks.includes(S.name))||(A==null?void 0:A.networks.includes(S.name))}).filter(S=>S.name==="voodoo"?a.customer==="customer:20":!0).map(S=>{let P=S.imageSrc;if(S.name==="web"){let B="web_"+i.toLowerCase()+".png";P=P.replace("web.png",B)}return c.jsx(Ql,{id:S.id,name:S.name,imageUrl:P,selected:R.includes(S.id),handleCardClick:j,networkVersionSize:E,fileSizeLoading:G,showCheckBox:S.id!=="adikteev",typeOfProduct:i,versionId:r,api:o,handleDownloadError:s,fetchFileUrl:l,urls:u,game:A,creditDownload:t,setIsConfirmActive:v,getDownloadCount:d,disabled:f,user:a,setSafariCopyLink:g,isTest:y,urlType:m,setCdnModal:C,generateCDN:me,cdnUrl:L},S.id)})})}),R.length>1&&(i==="Playable"||i==="Ready"||i==="Flex")&&c.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:c.jsx(Ul,{onClickMultiDownload:Ye,networksVersionTotalSize:Q,typeOfProduct:i,multiDownloading:W})}),b&&c.jsx(Fl,{onClose:()=>{C(!1),d()},versionId:r,urls:u,handleDownloadError:s,cdnUrl:L,setCdnUrl:I,generateCDN:async()=>{if(!N){if(a.customer==="playableFactoryInternal"){me();return}J(!0)}},cdnUploading:N}),re&&c.jsx(_l,{onClose:()=>{ie(!1)},url:V}),H&&c.jsx(Sr,{width:"100%",height:"100%",creditConfirmType:M,handleCopyLink:async()=>{},download:async()=>{K(!1),J(!1),me()},onClose:()=>{K(!1),J(!1),D(!1)},getDownloadCount:d}),x&&c.jsx(Sr,{creditConfirmType:M,handleCopyLink:async()=>{},download:async()=>{K(!1),v(!1),await qe()},onClose:()=>{K(!1),v(!1)},getDownloadCount:d})]})};async function eu(e,t){return(await ge.post(t+"/getFlexDownloadCount",e)).data}async function tu(e,t){try{return(await ge.post(t+"/findGame",{_id:e})).data}catch{}}async function nu(e,t){return(await ge.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function ru(e,t){return(await ge.post(t+"/getFlexData",{_id:e})).data}async function iu(e,t){return(await ge.post(t+"/getImportedPlayable",{id:e})).data}async function ou(e,t){return(await ge.post(t+"/getReadyDownloadCount",e)).data}async function au(e,t){try{return(await ge.post(t+"/findCustomer",{_id:e})).data}catch{}}const Do=["web","adcolony","applovin","chartboost","crossinstall","fb","google","google360","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco","cdn"];let To=null;const su=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:i,api:o,user:a,title:s,handleDownloadError:l,fetchFileUrl:u,fileSize:A,setFileSize:d,setSafariCopyLink:f,iosLink:g,androidLink:y,setIosLink:m,setAndroidLink:h,urlType:b,setUrlType:C})=>{const[L,I]=Z.useState(null),[q,R]=Z.useState(null),[z,E]=Z.useState(null),[X,G]=Z.useState(!1),[ne,Q]=Z.useState(!0),[ae,W]=Z.useState(window.innerWidth),[k,T]=Z.useState(!1),[v,M]=Z.useState(!1),[_,x]=Z.useState("");et(Yo),et(No);const[K,H]=et(Ro);Z.useEffect(()=>{!_&&r!=="Fusion"&&pl(t).then(S=>{S!=null&&S.exist&&x(S.uploadPath)})},[_]),console.log("download modal version: 6.0.45");const[J,N]=Z.useState(!1);Z.useEffect(()=>{},[J]),Z.useEffect(()=>{const S=()=>{W(window.innerWidth)};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}},[]);const D=async()=>{G(!0);const S=await xr(e,o);return S!=null&&S.networks||(S.networks=Do),I(S),S},V=(S,P)=>{clearTimeout(To),To=setTimeout(()=>{Zr(t,{iosUrl:S,googleUrl:P},{urlType:b})},1e3)},U=S=>{m(S),V(S,y)},re=S=>{h(S),V(g,S)},ie=async(S,P)=>{var B,oe;try{let ye;if(r==="Playable"||r==="Ready"){const Ne=await nu(t,o);if(Ne){m(Ne.iosLink),h(Ne.androidLink),G(!1);return}if(S&&(S.iosUrl||S.googleUrl)){m(S.iosUrl),h(S.googleUrl),G(!1);return}if(P&&P.html){const _t=`${u}/${P.html}?t=${Date.now()}`;let Re=await fetch(_t).then(Rn=>Rn.text());const Jr=((B=Re.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:B.at(1))||"";m(Jr);const Dr=((oe=Re.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:oe.at(1))||"";h(Dr),G(!1)}else h(""),m(""),G(!1)}else if(r==="Flex"){const Ne=await ru(t,o);if(Ne.googleUrl||Ne.iosUrl){h(Ne.googleUrl),m(Ne.iosUrl),G(!1);return}S&&(S.iosUrl||S.googleUrl)?(m(S.iosUrl),h(S.googleUrl),G(!1)):(h(""),m(""),G(!1))}else r==="Fusion"&&(S&&(S.iosUrl||S.googleUrl)?(m(S.iosUrl),h(S.googleUrl),G(!1)):(h(""),m(""),G(!1)))}catch(ye){l(ye.response.data.error.msg)}},F=async()=>{G(!0);let S;r==="Flex"?S=await eu({_id:t},o):r==="Ready"&&(S=await ou({_id:t},o)),S&&(["admin","pm","tester","sales"].includes(a.role)?E({...S,networks:K}):r==="Ready"&&!S.canDownload?E({...S,networks:Do}):E(S)),G(!1)},me=async()=>await tu(n,o),[j,qe]=Z.useState(null),Ye=async S=>await au(S,o);return Z.useEffect(()=>{i||(I(null),R(null),E(null),d(null),qe(null)),i&&(r==="Playable"?me().then(S=>{Ye(S.customer).then(P=>{qe(P)}),D().then(P=>{ie(null,P)}),Q(!1)}):r==="Ready"?F().then(S=>{D().then(P=>{ie(null,P),Q(!1)})}):r==="Flex"?F().then(S=>{Q(!1),me().then(P=>{i&&(ie(P,null),Q(!1),R(P))})}):r==="Import"?iu(t,o).then(S=>{I(S),m(S.iosUrl||""),h(S.googleUrl||""),G(!1),Q(!1)}):r==="Fusion"&&(Q(!1),me().then(S=>{i&&(ie(S,null),Q(!1),S.networks=K.filter(P=>P!=="cdn"),R(S))})))},[n,e,t,i]),c.jsxs("div",{style:{display:"flex",height:ae>1440?"700px":"650px",width:ae>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[c.jsx(wl,{title:s,typeOfProduct:r,fileSize:A,urls:{iosUrl:g,googleUrl:y},handleIosChange:U,handleGoogleChange:re,disabled:ne,api:o,creditDownload:z,user:a,isTest:k,setIsTest:T,urlType:b,setUrlType:C,allNetworksSelected:J,setAllNetworksSelected:N}),X?c.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:c.jsx(Xt,{isNetworksLoading:!0})}):(L||z||r==="Fusion")&&(r==="Flex"?q:!0)&&!X&&g!=="Loading..."&&y!=="Loading..."&&c.jsx($l,{playable:L,creditDownload:z,visible:i,versionId:t,typeOfProduct:r,api:o,user:a,handleDownloadError:l,fetchFileUrl:u,urls:{iosUrl:g,googleUrl:y},game:q,getDownloadCount:F,disabled:ne,setSafariCopyLink:f,isTest:k,urlType:b,allNetworksSelected:J,cdnModal:v,setCdnModal:M,cdnUrl:_,setCdnUrl:x,customer:j??void 0})]})},Sd="";var Er={exports:{}},dt={},Mr={exports:{}},Te={},kr={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=A;/*!
|
|
51
51
|
* Adapted from jQuery UI core
|
|
52
52
|
*
|
|
53
53
|
* http://jqueryui.com
|