gearboxdownloadmodal 6.0.80 → 6.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -84,5 +84,5 @@ doc.body (`+t+`):
84
84
  `+i:"")+`
85
85
 
86
86
  The above lifecycles should be removed. Learn more about this warning here:
87
- https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStateFromProps=="function"&&(e.componentWillMount=Uo,e.componentWillReceiveProps=Qo),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=Fo;var a=e.componentDidUpdate;e.componentDidUpdate=function(A,u,c){var f=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:c;a.call(this,A,u,f)}}return t}const Cd=Wa(Object.freeze(Object.defineProperty({__proto__:null,polyfill:bd},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(bt,"__esModule",{value:!0}),bt.bodyOpenClassName=bt.portalClassName=void 0;var _o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},wd=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),$o=b,Qn=un($o),xd=Ka,Fn=un(xd),Zd=hn,re=un(Zd),Id=qd,ea=un(Id),Sd=_e,Ed=Ld(Sd),pt=$e,ta=un(pt),Od=Cd;function Ld(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function un(t){return t&&t.__esModule?t:{default:t}}function kd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function na(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Kd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Md=bt.portalClassName="ReactModalPortal",Wd=bt.bodyOpenClassName="ReactModal__Body--open",It=pt.canUseDOM&&Fn.default.createPortal!==void 0,hi=function(e){return document.createElement(e)},ra=function(){return It?Fn.default.createPortal:Fn.default.unstable_renderSubtreeIntoContainer};function _n(t){return t()}var zt=function(t){Kd(e,t);function e(){var n,r,i,s;kd(this,e);for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return s=(r=(i=na(this,(n=e.__proto__||Object.getPrototypeOf(e)).call.apply(n,[this].concat(a))),i),i.removePortal=function(){!It&&Fn.default.unmountComponentAtNode(i.node);var A=_n(i.props.parentSelector);A&&A.contains(i.node)?A.removeChild(i.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},i.portalRef=function(A){i.portal=A},i.renderPortal=function(A){var u=ra(),c=u(i,Qn.default.createElement(ea.default,_o({defaultStyles:e.defaultStyles},A)),i.node);i.portalRef(c)},r),na(i,s)}return wd(e,[{key:"componentDidMount",value:function(){if(pt.canUseDOM){It||(this.node=hi("div")),this.node.className=this.props.portalClassName;var r=_n(this.props.parentSelector);r.appendChild(this.node),!It&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var i=_n(r.parentSelector),s=_n(this.props.parentSelector);return{prevParent:i,nextParent:s}}},{key:"componentDidUpdate",value:function(r,i,s){if(pt.canUseDOM){var o=this.props,a=o.isOpen,l=o.portalClassName;r.portalClassName!==l&&(this.node.className=l);var A=s.prevParent,u=s.nextParent;u!==A&&(A.removeChild(this.node),u.appendChild(this.node)),!(!r.isOpen&&!a)&&!It&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!pt.canUseDOM||!this.node||!this.portal)){var r=this.portal.state,i=Date.now(),s=r.isOpen&&this.props.closeTimeoutMS&&(r.closesAt||i+this.props.closeTimeoutMS);s?(r.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,s-i)):this.removePortal()}}},{key:"render",value:function(){if(!pt.canUseDOM||!It)return null;!this.node&&It&&(this.node=hi("div"));var r=ra();return r(Qn.default.createElement(ea.default,_o({ref:this.portalRef,defaultStyles:e.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){Ed.setElement(r)}}]),e}($o.Component);zt.propTypes={isOpen:re.default.bool.isRequired,style:re.default.shape({content:re.default.object,overlay:re.default.object}),portalClassName:re.default.string,bodyOpenClassName:re.default.string,htmlOpenClassName:re.default.string,className:re.default.oneOfType([re.default.string,re.default.shape({base:re.default.string.isRequired,afterOpen:re.default.string.isRequired,beforeClose:re.default.string.isRequired})]),overlayClassName:re.default.oneOfType([re.default.string,re.default.shape({base:re.default.string.isRequired,afterOpen:re.default.string.isRequired,beforeClose:re.default.string.isRequired})]),appElement:re.default.oneOfType([re.default.instanceOf(ta.default),re.default.instanceOf(pt.SafeHTMLCollection),re.default.instanceOf(pt.SafeNodeList),re.default.arrayOf(re.default.instanceOf(ta.default))]),onAfterOpen:re.default.func,onRequestClose:re.default.func,closeTimeoutMS:re.default.number,ariaHideApp:re.default.bool,shouldFocusAfterRender:re.default.bool,shouldCloseOnOverlayClick:re.default.bool,shouldReturnFocusAfterClose:re.default.bool,preventScroll:re.default.bool,parentSelector:re.default.func,aria:re.default.object,data:re.default.object,role:re.default.string,contentLabel:re.default.string,shouldCloseOnEsc:re.default.bool,overlayRef:re.default.func,contentRef:re.default.func,id:re.default.string,overlayElement:re.default.func,contentElement:re.default.func},zt.defaultProps={isOpen:!1,portalClassName:Md,bodyOpenClassName:Wd,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,n){return Qn.default.createElement("div",e,n)},contentElement:function(e,n){return Qn.default.createElement("div",e,n)}},zt.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,Od.polyfill)(zt),process.env.NODE_ENV!=="production"&&(zt.setCreateHTMLElement=function(t){return hi=t}),bt.default=zt,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=bt,r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}e.default=r.default,t.exports=e.default}(li,li.exports);var jd=li.exports;const mi=Ma(jd),Rd=({width:t,height:e,fill:n})=>d.jsxs("svg",{width:t,height:e,viewBox:"0 0 105 105",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.2918 79.3302C42.5513 78.6026 43.0293 77.973 43.6602 77.5273C44.2911 77.0816 45.0443 76.8416 45.8168 76.8402H59.2418C60.0143 76.8416 60.7675 77.0816 61.3984 77.5273C62.0293 77.973 62.5072 78.6026 62.7668 79.3302L67.9193 93.7152H75.0293C76.5211 93.7152 77.9519 94.3078 79.0068 95.3627C80.0617 96.4176 80.6543 97.8484 80.6543 99.3402C80.6543 100.832 80.0617 102.263 79.0068 103.318C77.9519 104.373 76.5211 104.965 75.0293 104.965H30.0293C28.5375 104.965 27.1067 104.373 26.0518 103.318C24.9969 102.263 24.4043 100.832 24.4043 99.3402C24.4043 97.8484 24.9969 96.4176 26.0518 95.3627C27.1067 94.3078 28.5375 93.7152 30.0293 93.7152H37.1393L42.2843 79.3302H42.2918Z",fill:n,opacity:.8}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M69.6975 22.1831H69.375V7.50562C69.375 6.21562 69.225 4.96312 68.955 3.75562H94.08C100.103 3.75562 105 8.64562 105 14.6831V71.5781C105 77.6156 100.11 82.5056 94.0725 82.5056H10.9275C9.49248 82.5056 8.07151 82.223 6.74573 81.6738C5.41994 81.1247 4.2153 80.3197 3.20059 79.305C2.18588 78.2903 1.38096 77.0857 0.831806 75.7599C0.282648 74.4341 0 73.0131 0 71.5781L0 14.6831C0 8.64562 4.89 3.75562 10.9275 3.75562H36.045C35.7657 4.98606 35.6248 6.24387 35.625 7.50562V22.1831H35.3025C23.61 22.1831 17.7525 36.3206 26.025 44.5931L43.2225 61.7906C45.6836 64.25 49.0206 65.6316 52.5 65.6316C55.9794 65.6316 59.3164 64.25 61.7775 61.7906L78.975 44.5931C87.2475 36.3206 81.39 22.1831 69.6975 22.1831Z",fill:n}),d.jsx("path",{d:"M55.1876 55.1551L72.3776 37.9501C72.903 37.4261 73.2611 36.758 73.4066 36.0304C73.552 35.3028 73.4784 34.5484 73.195 33.8626C72.9115 33.1769 72.431 32.5906 71.8142 32.1781C71.1974 31.7656 70.4722 31.5453 69.7301 31.5451H60.0326V7.50012C60.0326 5.511 59.2425 3.60334 57.8359 2.19682C56.4294 0.790299 54.5218 0.00012207 52.5326 0.00012207C50.5435 0.00012207 48.6359 0.790299 47.2293 2.19682C45.8228 3.60334 45.0326 5.511 45.0326 7.50012V31.5526H35.3351C34.5931 31.5528 33.8678 31.7731 33.2511 32.1856C32.6343 32.5981 32.1538 33.1844 31.8703 33.8701C31.5869 34.5559 31.5132 35.3103 31.6587 36.0379C31.8042 36.7655 32.1623 37.4336 32.6876 37.9576L49.8776 55.1551C50.226 55.5044 50.6398 55.7814 51.0954 55.9705C51.551 56.1595 52.0394 56.2568 52.5326 56.2568C53.0259 56.2568 53.5143 56.1595 53.9699 55.9705C54.4255 55.7814 54.8393 55.5044 55.1876 55.1551Z",fill:n,opacity:.8})]}),ot=Object.create(null);ot.open="0",ot.close="1",ot.ping="2",ot.pong="3",ot.message="4",ot.upgrade="5",ot.noop="6";const $n=Object.create(null);Object.keys(ot).forEach(t=>{$n[ot[t]]=t});const gi={type:"error",data:"parser error"},ia=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",sa=typeof ArrayBuffer=="function",oa=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,yi=({type:t,data:e},n,r)=>ia&&e instanceof Blob?n?r(e):aa(e,r):sa&&(e instanceof ArrayBuffer||oa(e))?n?r(e):aa(new Blob([e]),r):r(ot[t]+(e||"")),aa=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function la(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let vi;function zd(t,e){if(ia&&t.data instanceof Blob)return t.data.arrayBuffer().then(la).then(e);if(sa&&(t.data instanceof ArrayBuffer||oa(t.data)))return e(la(t.data));yi(t,!1,n=>{vi||(vi=new TextEncoder),e(vi.encode(n))})}const ua="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",An=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<ua.length;t++)An[ua.charCodeAt(t)]=t;const Yd=t=>{let e=t.length*.75,n=t.length,r,i=0,s,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const A=new ArrayBuffer(e),u=new Uint8Array(A);for(r=0;r<n;r+=4)s=An[t.charCodeAt(r)],o=An[t.charCodeAt(r+1)],a=An[t.charCodeAt(r+2)],l=An[t.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return A},Nd=typeof ArrayBuffer=="function",qi=(t,e)=>{if(typeof t!="string")return{type:"message",data:Aa(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Jd(t.substring(1),e)}:$n[n]?t.length>1?{type:$n[n],data:t.substring(1)}:{type:$n[n]}:gi},Jd=(t,e)=>{if(Nd){const n=Yd(t);return Aa(n,e)}else return{base64:!0,data:t}},Aa=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ca=String.fromCharCode(30),Dd=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{yi(s,!1,a=>{r[o]=a,++i===n&&e(r.join(ca))})})},Td=(t,e)=>{const n=t.split(ca),r=[];for(let i=0;i<n.length;i++){const s=qi(n[i],e);if(r.push(s),s.type==="error")break}return r};function Gd(){return new TransformStream({transform(t,e){zd(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let bi;function er(t){return t.reduce((e,n)=>e+n.length,0)}function tr(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function Pd(t,e){bi||(bi=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(er(n)<1)break;const l=tr(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(er(n)<2)break;const l=tr(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(er(n)<8)break;const l=tr(n,8),A=new DataView(l.buffer,l.byteOffset,l.length),u=A.getUint32(0);if(u>Math.pow(2,53-32)-1){a.enqueue(gi);break}i=u*Math.pow(2,32)+A.getUint32(4),r=3}else{if(er(n)<i)break;const l=tr(n,i);a.enqueue(qi(s?l:bi.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(gi);break}}}})}const da=4;function we(t){if(t)return Hd(t)}function Hd(t){for(var e in we.prototype)t[e]=we.prototype[e];return t}we.prototype.on=we.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},we.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},we.prototype.off=we.prototype.removeListener=we.prototype.removeAllListeners=we.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this},we.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this},we.prototype.emitReserved=we.prototype.emit,we.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},we.prototype.hasListeners=function(t){return!!this.listeners(t).length};const nr=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),He=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Bd="arraybuffer";function th(){}function fa(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const Vd=He.setTimeout,Xd=He.clearTimeout;function rr(t,e){e.useNativeTimers?(t.setTimeoutFn=Vd.bind(He),t.clearTimeoutFn=Xd.bind(He)):(t.setTimeoutFn=He.setTimeout.bind(He),t.clearTimeoutFn=He.clearTimeout.bind(He))}const Ud=1.33;function Qd(t){return typeof t=="string"?Fd(t):Math.ceil((t.byteLength||t.size)*Ud)}function Fd(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function pa(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function _d(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function $d(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class ef extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Ci extends we{constructor(e){super(),this.writable=!1,rr(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new ef(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=qi(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=_d(e);return n.length?"?"+n:""}}class tf extends Ci{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Td(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Dd(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=pa()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let ha=!1;try{ha=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const nf=ha;function rf(){}class sf extends tf{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Yt=class lr extends we{constructor(e,n,r){super(),this.createRequest=e,rr(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=fa(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=lr.requestsCount++,lr.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=rf,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete lr.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};if(Yt.requestsCount=0,Yt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ma);else if(typeof addEventListener=="function"){const t="onpagehide"in He?"pagehide":"unload";addEventListener(t,ma,!1)}}function ma(){for(let t in Yt.requests)Yt.requests.hasOwnProperty(t)&&Yt.requests[t].abort()}const of=function(){const t=ga({xdomain:!1});return t&&t.responseType!==null}();class af extends sf{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=of&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Yt(ga,this.uri(),e)}}function ga(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||nf))return new XMLHttpRequest}catch{}if(!e)try{return new He[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ya=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class lf extends Ci{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=ya?{}:fa(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;yi(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&nr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=pa()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const wi=He.WebSocket||He.MozWebSocket;class uf extends lf{createSocket(e,n,r){return ya?new wi(e,n,r):n?new wi(e,n):new wi(e)}doWrite(e,n){this.ws.send(n)}}class Af extends Ci{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=Pd(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=Gd();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this._writer.write(r).then(()=>{i&&nr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const cf={websocket:uf,webtransport:Af,polling:af},df=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ff=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xi(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=df.exec(t||""),s={},o=14;for(;o--;)s[ff[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=pf(s,s.path),s.queryKey=hf(s,s.query),s}function pf(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function hf(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Zi=typeof addEventListener=="function"&&typeof removeEventListener=="function",ir=[];Zi&&addEventListener("offline",()=>{ir.forEach(t=>t())},!1);class ht extends we{constructor(e,n){if(super(),this.binaryType=Bd,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=xi(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=xi(n.host).host);rr(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=$d(this.opts.query)),Zi&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ir.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=da,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&ht.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ht.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Qd(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,nr(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(ht.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Zi&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ir.indexOf(this._offlineEventListener);r!==-1&&ir.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}ht.protocol=da;class mf extends ht{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;ht.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ht.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=c=>{const f=new Error("probe error: "+c);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function A(c){n&&c.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",A)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",A),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let gf=class extends mf{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>cf[i]).filter(i=>!!i)),super(e,r)}};function yf(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=xi(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const vf=typeof ArrayBuffer=="function",qf=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,va=Object.prototype.toString,bf=typeof Blob=="function"||typeof Blob<"u"&&va.call(Blob)==="[object BlobConstructor]",Cf=typeof File=="function"||typeof File<"u"&&va.call(File)==="[object FileConstructor]";function Ii(t){return vf&&(t instanceof ArrayBuffer||qf(t))||bf&&t instanceof Blob||Cf&&t instanceof File}function sr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(sr(t[n]))return!0;return!1}if(Ii(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return sr(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&sr(t[n]))return!0;return!1}function wf(t){const e=[],n=t.data,r=t;return r.data=Si(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Si(t,e){if(!t)return t;if(Ii(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Si(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Si(t[r],e));return n}return t}function xf(t,e){return t.data=Ei(t.data,e),delete t.attachments,t}function Ei(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Ei(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Ei(t[n],e));return t}const Zf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],If=5;var ce;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(ce||(ce={}));class Sf{constructor(e){this.replacer=e}encode(e){return(e.type===ce.EVENT||e.type===ce.ACK)&&sr(e)?this.encodeAsBinary({type:e.type===ce.EVENT?ce.BINARY_EVENT:ce.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ce.BINARY_EVENT||e.type===ce.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=wf(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function qa(t){return Object.prototype.toString.call(t)==="[object Object]"}class Oi extends we{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===ce.BINARY_EVENT;r||n.type===ce.BINARY_ACK?(n.type=r?ce.EVENT:ce.ACK,this.reconstructor=new Ef(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ii(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(ce[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ce.BINARY_EVENT||r.type===ce.BINARY_ACK){const s=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const o=e.substring(s,n);if(o!=Number(o)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(s,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=e.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===e.length)break}r.id=Number(e.substring(s,n+1))}if(e.charAt(++n)){const s=this.tryParse(e.substr(n));if(Oi.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case ce.CONNECT:return qa(n);case ce.DISCONNECT:return n===void 0;case ce.CONNECT_ERROR:return typeof n=="string"||qa(n);case ce.EVENT:case ce.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Zf.indexOf(n[0])===-1);case ce.ACK:case ce.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ef{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=xf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Of=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Oi,Encoder:Sf,get PacketType(){return ce},protocol:If},Symbol.toStringTag,{value:"Module"}));function tt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Lf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ba extends we{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[tt(e,"open",this.onopen.bind(this)),tt(e,"packet",this.onpacket.bind(this)),tt(e,"error",this.onerror.bind(this)),tt(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,i,s;if(Lf.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:ce.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,c=n.pop();this._registerAckCallback(u,c),o.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ce.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ce.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ce.EVENT:case ce.BINARY_EVENT:this.onevent(e);break;case ce.ACK:case ce.BINARY_ACK:this.onack(e);break;case ce.DISCONNECT:this.ondisconnect();break;case ce.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:ce.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ce.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Nt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Nt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},Nt.prototype.reset=function(){this.attempts=0},Nt.prototype.setMin=function(t){this.ms=t},Nt.prototype.setMax=function(t){this.max=t},Nt.prototype.setJitter=function(t){this.jitter=t};class Li extends we{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,rr(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Nt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||Of;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new gf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=tt(n,"open",function(){r.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=tt(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(tt(e,"ping",this.onping.bind(this)),tt(e,"data",this.ondata.bind(this)),tt(e,"error",this.onerror.bind(this)),tt(e,"close",this.onclose.bind(this)),tt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){nr(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new ba(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const cn={};function or(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=yf(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=cn[i]&&s in cn[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Li(r,e):(cn[i]||(cn[i]=new Li(r,e)),l=cn[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(or,{Manager:Li,Socket:ba,io:or,connect:or});async function kf(t,e,n){return(await ve.post(n,{versionId:t,fileSize:e})).data}const Ca=5,Kf=({setIsExceedingFileSizeAccepted:t,closeModal:e,setLoading:n,typeOfProduct:r,versionId:i,fileSize:s,user:o,compressApi:a,producerApi:l})=>{const[A,u]=b.useState(!1),[c,f]=b.useState(!1);b.useEffect(()=>{const m=or(a,{path:"/socket.io"});return m.on("connect",()=>{console.log("Connected to the socket server")}),m.on("video-compressing",async v=>{console.log(v),v.userId===o._id&&v.isSuccess&&(console.log("Video compress successfull"),u(!1),f(!0))}),m.on("error",v=>{console.error("Socket error:",v)}),()=>{m.disconnect()}},[i]);const h=()=>{e(),t(!1),n(!0)},g=async()=>{try{u(!0);const m=await kf(i,s,`${l}/videos/compressByDiff`);console.log("Compression result:",m),n(!1)}catch(m){console.error("Error compressing video:",m),n(!1),e()}};return d.jsxs(mi,{isOpen:!0,ariaHideApp:!1,onRequestClose:h,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:"400px",width:"650px",overflow:"hidden",padding:"0px 0px 0px 0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{className:"fixed h-[40px] w-full flex justify-end",children:d.jsx("div",{className:"pointer-events-auto absolute flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white hover:bg-dark-10",onClick:h,children:d.jsx("img",{src:Yi,alt:"close image"})})}),d.jsx("div",{className:"mt-5 h-[150px] w-full ",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx(Rd,{width:100,height:100,fill:Oe[r]})})}),d.jsx("div",{className:"mb-5 h-[50px] w-full",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx("span",{className:"text-3xl font-bold text-flex-purple",children:"Playable Size Too Big"})})}),d.jsx("div",{className:"mb-3 h-[50px] w-full",children:d.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[!c&&!A&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"You can compress it to reduce the size automatically,",d.jsx("br",{}),"or go back and edit your content manually"]}),!c&&A&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"Compressing to reduce size..."]}),c&&!A&&d.jsx("span",{className:"text-center align-middle text-lg text-black",children:"Your playable is now under 5 MB and ready to export"})]})}),d.jsxs("div",{className:"my-5 flex h-[53px] w-full flex-row justify-center ",children:[d.jsx("div",{className:"pointer-events-auto mr-3 flex h-full w-[180px] items-center justify-center rounded-md border border-red-600 transition-all hover:scale-105 cursor-pointer",onClick:h,children:d.jsx("span",{className:"text-center align-middle text-xl font-bold text-red-600",children:"Cancel"})}),d.jsx("div",{className:" pointer-events-auto ml-3 flex h-full w-[180px] items-center justify-center rounded-md transition-all hover:scale-105 cursor-pointer",style:{backgroundColor:Oe[r]},onClick:()=>{r==="Flex"&&!c?g():t(!0)},children:d.jsxs("span",{className:"text-center align-middle text-xl font-bold text-white",children:[r==="Flex"&&A&&!c&&"Compressing...",r==="Flex"&&!A&&!c&&s-Ca<2&&"Compress",r==="Flex"&&!A&&!c&&"Export",r==="Flex"&&!A&&!c&&s-Ca>=2&&"Continue",r!=="Flex"&&!A&&c&&"Export",r!=="Flex"&&"Continue"]})})]})]})},Mf=({onClose:t,url:e})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:500,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px",minHeight:"48px"},children:d.jsx("a",{style:{fontSize:"12px",display:"block",fontWeight:"normal",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"},href:e,children:e})}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"Close"}),d.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async n=>{n.preventDefault(),n.stopPropagation(),t()},children:"Copy"})]})]})]});async function Wf(t,e){return(await ve.post(t+"/getNetworks",{typeOfProduct:e})).data}const jf=({visible:t,closeModal:e,versionId:n,gameId:r,versionName:i,playableId:s,typeOfProduct:o,api:a,user:l,title:A,iframeUrl:u,handleDownloadError:c,fetchFileUrl:f,copyLinkUrl:h,fusionData:g})=>{const[m,v]=b.useState(window.innerWidth),[w,L]=b.useState(!1),[R,S]=b.useState(u),[q,G]=b.useState(!1),[Z,K]=b.useState(!0),[N,W]=b.useState(null),[z,j]=b.useState(""),[V,E]=b.useState("Loading..."),[k,P]=b.useState("Loading..."),[y,M]=b.useState("game"),[Q,x]=Re(ii),[I,U]=Re(zo);YA(o,a,j,f,g);const B=async()=>{let D=await Wf(a,o);if(!D){jA("Networks not found");return}D=D.map(H=>(H.name=H.id,H)),x(D),U(D.map(H=>H.id).filter(H=>H!=="default")),NA(D),nn(n,"preview",null,null,!1).then(H=>{L(!0),S(f+"/"+H.url),(o==="Flex"||o==="Ready"||o==="Playable"||o==="Fusion")&&(H.size>=5?G(!0):G(!1),W(H.size)),K(!1)})};return b.useEffect(()=>{t?w||(B(),L(!0)):(L(!1),S(""))},[t]),b.useEffect(()=>{const D=()=>{v(window.innerWidth)};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[]),Z&&t?d.jsx(d.Fragment,{children:d.jsx(mi,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&K(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:d.jsx("div",{style:{display:"flex",height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",alignItems:"center",justifyContent:"center"},children:d.jsx("img",{style:{width:"100px",height:"100px"},src:it,alt:"pf-logo-gif"})})})}):Z&&o==="Flex"?null:d.jsxs("div",{onMouseDown:D=>{D.stopPropagation()},onMouseUp:D=>{D.stopPropagation()},children:[q&&t&&d.jsx(Kf,{setIsExceedingFileSizeAccepted:G,closeModal:e,setLoading:K,typeOfProduct:o,versionId:n,fileSize:N,user:l,compressApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app",producerApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app"}),!q&&d.jsxs(mi,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&K(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{style:{position:"absolute",top:"1.25rem",right:"1.25rem",zIndex:50},children:d.jsx("button",{onClick:()=>{e(),o==="Flex"&&K(!0)},style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:d.jsx("img",{src:Yi,alt:"close image"})})}),d.jsxs(za,{children:[w?d.jsx(nc,{versionName:i,versionId:n,playableId:s||"",typeOfProduct:o,iframeUrl:R,api:a,fetchFileUrl:f,copyLinkUrl:h,setSafariCopyLink:j,iosLink:V,androidLink:k,urlType:y}):d.jsx(d.Fragment,{children:d.jsx("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"5px",height:m>1440?"650px":"625px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:d.jsx("img",{width:"75px",height:"75px",src:it,alt:"pf-logo-gif"})})}),d.jsx(Oc,{visible:t,versionId:n,playableId:s,gameId:r,typeOfProduct:o,api:a,user:l,title:A,handleDownloadError:c,fetchFileUrl:f,fileSize:N,setFileSize:W,setSafariCopyLink:j,iosLink:V,androidLink:k,setIosLink:E,setAndroidLink:P,urlType:y,setUrlType:M})]}),d.jsx(Vr,{}),z&&d.jsx(Mf,{onClose:()=>{Mt(z),j("")},url:z}),d.jsx("div",{style:{position:"absolute",bottom:"0",left:"30px",fontSize:"12px",lineHeight:"12px",zIndex:50},children:"Version: 6.0.37"})]})]})};ut.DownloadModal=jf,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})});
87
+ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStateFromProps=="function"&&(e.componentWillMount=Uo,e.componentWillReceiveProps=Qo),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=Fo;var a=e.componentDidUpdate;e.componentDidUpdate=function(A,u,c){var f=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:c;a.call(this,A,u,f)}}return t}const Cd=Wa(Object.freeze(Object.defineProperty({__proto__:null,polyfill:bd},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(bt,"__esModule",{value:!0}),bt.bodyOpenClassName=bt.portalClassName=void 0;var _o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},wd=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),$o=b,Qn=un($o),xd=Ka,Fn=un(xd),Zd=hn,re=un(Zd),Id=qd,ea=un(Id),Sd=_e,Ed=Ld(Sd),pt=$e,ta=un(pt),Od=Cd;function Ld(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function un(t){return t&&t.__esModule?t:{default:t}}function kd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function na(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Kd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Md=bt.portalClassName="ReactModalPortal",Wd=bt.bodyOpenClassName="ReactModal__Body--open",It=pt.canUseDOM&&Fn.default.createPortal!==void 0,hi=function(e){return document.createElement(e)},ra=function(){return It?Fn.default.createPortal:Fn.default.unstable_renderSubtreeIntoContainer};function _n(t){return t()}var zt=function(t){Kd(e,t);function e(){var n,r,i,s;kd(this,e);for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return s=(r=(i=na(this,(n=e.__proto__||Object.getPrototypeOf(e)).call.apply(n,[this].concat(a))),i),i.removePortal=function(){!It&&Fn.default.unmountComponentAtNode(i.node);var A=_n(i.props.parentSelector);A&&A.contains(i.node)?A.removeChild(i.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},i.portalRef=function(A){i.portal=A},i.renderPortal=function(A){var u=ra(),c=u(i,Qn.default.createElement(ea.default,_o({defaultStyles:e.defaultStyles},A)),i.node);i.portalRef(c)},r),na(i,s)}return wd(e,[{key:"componentDidMount",value:function(){if(pt.canUseDOM){It||(this.node=hi("div")),this.node.className=this.props.portalClassName;var r=_n(this.props.parentSelector);r.appendChild(this.node),!It&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var i=_n(r.parentSelector),s=_n(this.props.parentSelector);return{prevParent:i,nextParent:s}}},{key:"componentDidUpdate",value:function(r,i,s){if(pt.canUseDOM){var o=this.props,a=o.isOpen,l=o.portalClassName;r.portalClassName!==l&&(this.node.className=l);var A=s.prevParent,u=s.nextParent;u!==A&&(A.removeChild(this.node),u.appendChild(this.node)),!(!r.isOpen&&!a)&&!It&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!pt.canUseDOM||!this.node||!this.portal)){var r=this.portal.state,i=Date.now(),s=r.isOpen&&this.props.closeTimeoutMS&&(r.closesAt||i+this.props.closeTimeoutMS);s?(r.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,s-i)):this.removePortal()}}},{key:"render",value:function(){if(!pt.canUseDOM||!It)return null;!this.node&&It&&(this.node=hi("div"));var r=ra();return r(Qn.default.createElement(ea.default,_o({ref:this.portalRef,defaultStyles:e.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){Ed.setElement(r)}}]),e}($o.Component);zt.propTypes={isOpen:re.default.bool.isRequired,style:re.default.shape({content:re.default.object,overlay:re.default.object}),portalClassName:re.default.string,bodyOpenClassName:re.default.string,htmlOpenClassName:re.default.string,className:re.default.oneOfType([re.default.string,re.default.shape({base:re.default.string.isRequired,afterOpen:re.default.string.isRequired,beforeClose:re.default.string.isRequired})]),overlayClassName:re.default.oneOfType([re.default.string,re.default.shape({base:re.default.string.isRequired,afterOpen:re.default.string.isRequired,beforeClose:re.default.string.isRequired})]),appElement:re.default.oneOfType([re.default.instanceOf(ta.default),re.default.instanceOf(pt.SafeHTMLCollection),re.default.instanceOf(pt.SafeNodeList),re.default.arrayOf(re.default.instanceOf(ta.default))]),onAfterOpen:re.default.func,onRequestClose:re.default.func,closeTimeoutMS:re.default.number,ariaHideApp:re.default.bool,shouldFocusAfterRender:re.default.bool,shouldCloseOnOverlayClick:re.default.bool,shouldReturnFocusAfterClose:re.default.bool,preventScroll:re.default.bool,parentSelector:re.default.func,aria:re.default.object,data:re.default.object,role:re.default.string,contentLabel:re.default.string,shouldCloseOnEsc:re.default.bool,overlayRef:re.default.func,contentRef:re.default.func,id:re.default.string,overlayElement:re.default.func,contentElement:re.default.func},zt.defaultProps={isOpen:!1,portalClassName:Md,bodyOpenClassName:Wd,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,n){return Qn.default.createElement("div",e,n)},contentElement:function(e,n){return Qn.default.createElement("div",e,n)}},zt.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,Od.polyfill)(zt),process.env.NODE_ENV!=="production"&&(zt.setCreateHTMLElement=function(t){return hi=t}),bt.default=zt,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=bt,r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}e.default=r.default,t.exports=e.default}(li,li.exports);var jd=li.exports;const mi=Ma(jd),Rd=({width:t,height:e,fill:n})=>d.jsxs("svg",{width:t,height:e,viewBox:"0 0 105 105",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.2918 79.3302C42.5513 78.6026 43.0293 77.973 43.6602 77.5273C44.2911 77.0816 45.0443 76.8416 45.8168 76.8402H59.2418C60.0143 76.8416 60.7675 77.0816 61.3984 77.5273C62.0293 77.973 62.5072 78.6026 62.7668 79.3302L67.9193 93.7152H75.0293C76.5211 93.7152 77.9519 94.3078 79.0068 95.3627C80.0617 96.4176 80.6543 97.8484 80.6543 99.3402C80.6543 100.832 80.0617 102.263 79.0068 103.318C77.9519 104.373 76.5211 104.965 75.0293 104.965H30.0293C28.5375 104.965 27.1067 104.373 26.0518 103.318C24.9969 102.263 24.4043 100.832 24.4043 99.3402C24.4043 97.8484 24.9969 96.4176 26.0518 95.3627C27.1067 94.3078 28.5375 93.7152 30.0293 93.7152H37.1393L42.2843 79.3302H42.2918Z",fill:n,opacity:.8}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M69.6975 22.1831H69.375V7.50562C69.375 6.21562 69.225 4.96312 68.955 3.75562H94.08C100.103 3.75562 105 8.64562 105 14.6831V71.5781C105 77.6156 100.11 82.5056 94.0725 82.5056H10.9275C9.49248 82.5056 8.07151 82.223 6.74573 81.6738C5.41994 81.1247 4.2153 80.3197 3.20059 79.305C2.18588 78.2903 1.38096 77.0857 0.831806 75.7599C0.282648 74.4341 0 73.0131 0 71.5781L0 14.6831C0 8.64562 4.89 3.75562 10.9275 3.75562H36.045C35.7657 4.98606 35.6248 6.24387 35.625 7.50562V22.1831H35.3025C23.61 22.1831 17.7525 36.3206 26.025 44.5931L43.2225 61.7906C45.6836 64.25 49.0206 65.6316 52.5 65.6316C55.9794 65.6316 59.3164 64.25 61.7775 61.7906L78.975 44.5931C87.2475 36.3206 81.39 22.1831 69.6975 22.1831Z",fill:n}),d.jsx("path",{d:"M55.1876 55.1551L72.3776 37.9501C72.903 37.4261 73.2611 36.758 73.4066 36.0304C73.552 35.3028 73.4784 34.5484 73.195 33.8626C72.9115 33.1769 72.431 32.5906 71.8142 32.1781C71.1974 31.7656 70.4722 31.5453 69.7301 31.5451H60.0326V7.50012C60.0326 5.511 59.2425 3.60334 57.8359 2.19682C56.4294 0.790299 54.5218 0.00012207 52.5326 0.00012207C50.5435 0.00012207 48.6359 0.790299 47.2293 2.19682C45.8228 3.60334 45.0326 5.511 45.0326 7.50012V31.5526H35.3351C34.5931 31.5528 33.8678 31.7731 33.2511 32.1856C32.6343 32.5981 32.1538 33.1844 31.8703 33.8701C31.5869 34.5559 31.5132 35.3103 31.6587 36.0379C31.8042 36.7655 32.1623 37.4336 32.6876 37.9576L49.8776 55.1551C50.226 55.5044 50.6398 55.7814 51.0954 55.9705C51.551 56.1595 52.0394 56.2568 52.5326 56.2568C53.0259 56.2568 53.5143 56.1595 53.9699 55.9705C54.4255 55.7814 54.8393 55.5044 55.1876 55.1551Z",fill:n,opacity:.8})]}),ot=Object.create(null);ot.open="0",ot.close="1",ot.ping="2",ot.pong="3",ot.message="4",ot.upgrade="5",ot.noop="6";const $n=Object.create(null);Object.keys(ot).forEach(t=>{$n[ot[t]]=t});const gi={type:"error",data:"parser error"},ia=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",sa=typeof ArrayBuffer=="function",oa=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,yi=({type:t,data:e},n,r)=>ia&&e instanceof Blob?n?r(e):aa(e,r):sa&&(e instanceof ArrayBuffer||oa(e))?n?r(e):aa(new Blob([e]),r):r(ot[t]+(e||"")),aa=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function la(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let vi;function zd(t,e){if(ia&&t.data instanceof Blob)return t.data.arrayBuffer().then(la).then(e);if(sa&&(t.data instanceof ArrayBuffer||oa(t.data)))return e(la(t.data));yi(t,!1,n=>{vi||(vi=new TextEncoder),e(vi.encode(n))})}const ua="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",An=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<ua.length;t++)An[ua.charCodeAt(t)]=t;const Yd=t=>{let e=t.length*.75,n=t.length,r,i=0,s,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const A=new ArrayBuffer(e),u=new Uint8Array(A);for(r=0;r<n;r+=4)s=An[t.charCodeAt(r)],o=An[t.charCodeAt(r+1)],a=An[t.charCodeAt(r+2)],l=An[t.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return A},Nd=typeof ArrayBuffer=="function",qi=(t,e)=>{if(typeof t!="string")return{type:"message",data:Aa(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Jd(t.substring(1),e)}:$n[n]?t.length>1?{type:$n[n],data:t.substring(1)}:{type:$n[n]}:gi},Jd=(t,e)=>{if(Nd){const n=Yd(t);return Aa(n,e)}else return{base64:!0,data:t}},Aa=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ca=String.fromCharCode(30),Dd=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{yi(s,!1,a=>{r[o]=a,++i===n&&e(r.join(ca))})})},Td=(t,e)=>{const n=t.split(ca),r=[];for(let i=0;i<n.length;i++){const s=qi(n[i],e);if(r.push(s),s.type==="error")break}return r};function Gd(){return new TransformStream({transform(t,e){zd(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let bi;function er(t){return t.reduce((e,n)=>e+n.length,0)}function tr(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function Pd(t,e){bi||(bi=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(er(n)<1)break;const l=tr(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(er(n)<2)break;const l=tr(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(er(n)<8)break;const l=tr(n,8),A=new DataView(l.buffer,l.byteOffset,l.length),u=A.getUint32(0);if(u>Math.pow(2,53-32)-1){a.enqueue(gi);break}i=u*Math.pow(2,32)+A.getUint32(4),r=3}else{if(er(n)<i)break;const l=tr(n,i);a.enqueue(qi(s?l:bi.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(gi);break}}}})}const da=4;function we(t){if(t)return Hd(t)}function Hd(t){for(var e in we.prototype)t[e]=we.prototype[e];return t}we.prototype.on=we.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},we.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},we.prototype.off=we.prototype.removeListener=we.prototype.removeAllListeners=we.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this},we.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this},we.prototype.emitReserved=we.prototype.emit,we.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},we.prototype.hasListeners=function(t){return!!this.listeners(t).length};const nr=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),He=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Bd="arraybuffer";function th(){}function fa(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const Vd=He.setTimeout,Xd=He.clearTimeout;function rr(t,e){e.useNativeTimers?(t.setTimeoutFn=Vd.bind(He),t.clearTimeoutFn=Xd.bind(He)):(t.setTimeoutFn=He.setTimeout.bind(He),t.clearTimeoutFn=He.clearTimeout.bind(He))}const Ud=1.33;function Qd(t){return typeof t=="string"?Fd(t):Math.ceil((t.byteLength||t.size)*Ud)}function Fd(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function pa(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function _d(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function $d(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class ef extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Ci extends we{constructor(e){super(),this.writable=!1,rr(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new ef(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=qi(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=_d(e);return n.length?"?"+n:""}}class tf extends Ci{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Td(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Dd(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=pa()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let ha=!1;try{ha=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const nf=ha;function rf(){}class sf extends tf{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Yt=class lr extends we{constructor(e,n,r){super(),this.createRequest=e,rr(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=fa(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=lr.requestsCount++,lr.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=rf,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete lr.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};if(Yt.requestsCount=0,Yt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ma);else if(typeof addEventListener=="function"){const t="onpagehide"in He?"pagehide":"unload";addEventListener(t,ma,!1)}}function ma(){for(let t in Yt.requests)Yt.requests.hasOwnProperty(t)&&Yt.requests[t].abort()}const of=function(){const t=ga({xdomain:!1});return t&&t.responseType!==null}();class af extends sf{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=of&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Yt(ga,this.uri(),e)}}function ga(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||nf))return new XMLHttpRequest}catch{}if(!e)try{return new He[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ya=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class lf extends Ci{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=ya?{}:fa(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;yi(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&nr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=pa()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const wi=He.WebSocket||He.MozWebSocket;class uf extends lf{createSocket(e,n,r){return ya?new wi(e,n,r):n?new wi(e,n):new wi(e)}doWrite(e,n){this.ws.send(n)}}class Af extends Ci{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=Pd(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=Gd();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this._writer.write(r).then(()=>{i&&nr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const cf={websocket:uf,webtransport:Af,polling:af},df=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ff=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xi(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=df.exec(t||""),s={},o=14;for(;o--;)s[ff[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=pf(s,s.path),s.queryKey=hf(s,s.query),s}function pf(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function hf(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Zi=typeof addEventListener=="function"&&typeof removeEventListener=="function",ir=[];Zi&&addEventListener("offline",()=>{ir.forEach(t=>t())},!1);class ht extends we{constructor(e,n){if(super(),this.binaryType=Bd,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=xi(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=xi(n.host).host);rr(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=$d(this.opts.query)),Zi&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ir.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=da,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&ht.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ht.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Qd(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,nr(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(ht.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Zi&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ir.indexOf(this._offlineEventListener);r!==-1&&ir.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}ht.protocol=da;class mf extends ht{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;ht.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ht.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=c=>{const f=new Error("probe error: "+c);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function A(c){n&&c.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",A)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",A),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let gf=class extends mf{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>cf[i]).filter(i=>!!i)),super(e,r)}};function yf(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=xi(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const vf=typeof ArrayBuffer=="function",qf=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,va=Object.prototype.toString,bf=typeof Blob=="function"||typeof Blob<"u"&&va.call(Blob)==="[object BlobConstructor]",Cf=typeof File=="function"||typeof File<"u"&&va.call(File)==="[object FileConstructor]";function Ii(t){return vf&&(t instanceof ArrayBuffer||qf(t))||bf&&t instanceof Blob||Cf&&t instanceof File}function sr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(sr(t[n]))return!0;return!1}if(Ii(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return sr(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&sr(t[n]))return!0;return!1}function wf(t){const e=[],n=t.data,r=t;return r.data=Si(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Si(t,e){if(!t)return t;if(Ii(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Si(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Si(t[r],e));return n}return t}function xf(t,e){return t.data=Ei(t.data,e),delete t.attachments,t}function Ei(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Ei(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Ei(t[n],e));return t}const Zf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],If=5;var ce;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(ce||(ce={}));class Sf{constructor(e){this.replacer=e}encode(e){return(e.type===ce.EVENT||e.type===ce.ACK)&&sr(e)?this.encodeAsBinary({type:e.type===ce.EVENT?ce.BINARY_EVENT:ce.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ce.BINARY_EVENT||e.type===ce.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=wf(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function qa(t){return Object.prototype.toString.call(t)==="[object Object]"}class Oi extends we{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===ce.BINARY_EVENT;r||n.type===ce.BINARY_ACK?(n.type=r?ce.EVENT:ce.ACK,this.reconstructor=new Ef(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ii(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(ce[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ce.BINARY_EVENT||r.type===ce.BINARY_ACK){const s=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const o=e.substring(s,n);if(o!=Number(o)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(s,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=e.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===e.length)break}r.id=Number(e.substring(s,n+1))}if(e.charAt(++n)){const s=this.tryParse(e.substr(n));if(Oi.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case ce.CONNECT:return qa(n);case ce.DISCONNECT:return n===void 0;case ce.CONNECT_ERROR:return typeof n=="string"||qa(n);case ce.EVENT:case ce.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Zf.indexOf(n[0])===-1);case ce.ACK:case ce.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ef{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=xf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Of=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Oi,Encoder:Sf,get PacketType(){return ce},protocol:If},Symbol.toStringTag,{value:"Module"}));function tt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Lf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ba extends we{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[tt(e,"open",this.onopen.bind(this)),tt(e,"packet",this.onpacket.bind(this)),tt(e,"error",this.onerror.bind(this)),tt(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,i,s;if(Lf.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:ce.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,c=n.pop();this._registerAckCallback(u,c),o.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ce.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ce.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ce.EVENT:case ce.BINARY_EVENT:this.onevent(e);break;case ce.ACK:case ce.BINARY_ACK:this.onack(e);break;case ce.DISCONNECT:this.ondisconnect();break;case ce.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:ce.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ce.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Nt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Nt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},Nt.prototype.reset=function(){this.attempts=0},Nt.prototype.setMin=function(t){this.ms=t},Nt.prototype.setMax=function(t){this.max=t},Nt.prototype.setJitter=function(t){this.jitter=t};class Li extends we{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,rr(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Nt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||Of;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new gf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=tt(n,"open",function(){r.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=tt(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(tt(e,"ping",this.onping.bind(this)),tt(e,"data",this.ondata.bind(this)),tt(e,"error",this.onerror.bind(this)),tt(e,"close",this.onclose.bind(this)),tt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){nr(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new ba(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const cn={};function or(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=yf(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=cn[i]&&s in cn[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Li(r,e):(cn[i]||(cn[i]=new Li(r,e)),l=cn[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(or,{Manager:Li,Socket:ba,io:or,connect:or});async function kf(t,e,n){return(await ve.post(n,{versionId:t,fileSize:e})).data}const Ca=5,Kf=({setIsExceedingFileSizeAccepted:t,closeModal:e,setLoading:n,typeOfProduct:r,versionId:i,fileSize:s,user:o,compressApi:a,producerApi:l})=>{const[A,u]=b.useState(!1),[c,f]=b.useState(!1);b.useEffect(()=>{const m=or(a,{path:"/socket.io"});return m.on("connect",()=>{console.log("Connected to the socket server")}),m.on("video-compressing",async v=>{console.log(v),v.userId===o._id&&v.isSuccess&&(console.log("Video compress successfull"),t(!1))}),m.on("error",v=>{console.error("Socket error:",v)}),()=>{m.disconnect()}},[i]);const h=()=>{e(),t(!1),n(!0)},g=async()=>{try{u(!0);const m=await kf(i,s,`${l}/videos/compressByDiff`);console.log("Compression result:",m),n(!1)}catch(m){console.error("Error compressing video:",m),n(!1),e()}};return d.jsxs(mi,{isOpen:!0,ariaHideApp:!1,onRequestClose:h,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:"400px",width:"650px",overflow:"hidden",padding:"0px 0px 0px 0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{className:"fixed h-[40px] w-full flex justify-end",children:d.jsx("div",{className:"pointer-events-auto absolute flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white hover:bg-dark-10",onClick:h,children:d.jsx("img",{src:Yi,alt:"close image"})})}),d.jsx("div",{className:"mt-5 h-[150px] w-full ",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx(Rd,{width:100,height:100,fill:Oe[r]})})}),d.jsx("div",{className:"mb-5 h-[50px] w-full",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx("span",{className:"text-3xl font-bold text-flex-purple",children:"Playable Size Too Big"})})}),d.jsx("div",{className:"mb-3 h-[50px] w-full",children:d.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[!c&&!A&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"You can compress it to reduce the size automatically,",d.jsx("br",{}),"or go back and edit your content manually"]}),!c&&A&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"Compressing to reduce size..."]}),c&&!A&&d.jsx("span",{className:"text-center align-middle text-lg text-black",children:"Your playable is now under 5 MB and ready to export"})]})}),d.jsxs("div",{className:"my-5 flex h-[53px] w-full flex-row justify-center ",children:[d.jsx("div",{className:"pointer-events-auto mr-3 flex h-full w-[180px] items-center justify-center rounded-md border border-red-600 transition-all hover:scale-105 cursor-pointer",onClick:h,children:d.jsx("span",{className:"text-center align-middle text-xl font-bold text-red-600",children:"Cancel"})}),d.jsx("div",{className:" pointer-events-auto ml-3 flex h-full w-[180px] items-center justify-center rounded-md transition-all hover:scale-105 cursor-pointer",style:{backgroundColor:Oe[r]},onClick:()=>{r==="Flex"&&!c?g():t(!1)},children:d.jsxs("span",{className:"text-center align-middle text-xl font-bold text-white",children:[r==="Flex"&&A&&!c&&"Compressing...",r==="Flex"&&!A&&!c&&s-Ca<2&&"Compress",r==="Flex"&&!A&&!c&&"Export",r==="Flex"&&!A&&!c&&s-Ca>=2&&"Continue",r!=="Flex"&&!A&&c&&"Export",r!=="Flex"&&"Continue"]})})]})]})},Mf=({onClose:t,url:e})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:500,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px",minHeight:"48px"},children:d.jsx("a",{style:{fontSize:"12px",display:"block",fontWeight:"normal",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"},href:e,children:e})}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"Close"}),d.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async n=>{n.preventDefault(),n.stopPropagation(),t()},children:"Copy"})]})]})]});async function Wf(t,e){return(await ve.post(t+"/getNetworks",{typeOfProduct:e})).data}const jf=({visible:t,closeModal:e,versionId:n,gameId:r,versionName:i,playableId:s,typeOfProduct:o,api:a,user:l,title:A,iframeUrl:u,handleDownloadError:c,fetchFileUrl:f,copyLinkUrl:h,fusionData:g})=>{const[m,v]=b.useState(window.innerWidth),[w,L]=b.useState(!1),[R,S]=b.useState(u),[q,G]=b.useState(!1),[Z,K]=b.useState(!0),[N,W]=b.useState(null),[z,j]=b.useState(""),[V,E]=b.useState("Loading..."),[k,P]=b.useState("Loading..."),[y,M]=b.useState("game"),[Q,x]=Re(ii),[I,U]=Re(zo);YA(o,a,j,f,g);const B=async()=>{let D=await Wf(a,o);if(!D){jA("Networks not found");return}D=D.map(H=>(H.name=H.id,H)),x(D),U(D.map(H=>H.id).filter(H=>H!=="default")),NA(D),nn(n,"preview",null,null,!1).then(H=>{L(!0),S(f+"/"+H.url),(o==="Flex"||o==="Ready"||o==="Playable"||o==="Fusion")&&(H.size>=5?G(!0):G(!1),W(H.size)),K(!1)})};return b.useEffect(()=>{t?w||(B(),L(!0)):(L(!1),S(""))},[t]),b.useEffect(()=>{const D=()=>{v(window.innerWidth)};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[]),Z&&t?d.jsx(d.Fragment,{children:d.jsx(mi,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&K(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:d.jsx("div",{style:{display:"flex",height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",alignItems:"center",justifyContent:"center"},children:d.jsx("img",{style:{width:"100px",height:"100px"},src:it,alt:"pf-logo-gif"})})})}):Z&&o==="Flex"?null:d.jsxs("div",{onMouseDown:D=>{D.stopPropagation()},onMouseUp:D=>{D.stopPropagation()},children:[q&&t&&d.jsx(Kf,{setIsExceedingFileSizeAccepted:G,closeModal:e,setLoading:K,typeOfProduct:o,versionId:n,fileSize:N,user:l,compressApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app",producerApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app"}),!q&&d.jsxs(mi,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&K(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{style:{position:"absolute",top:"1.25rem",right:"1.25rem",zIndex:50},children:d.jsx("button",{onClick:()=>{e(),o==="Flex"&&K(!0)},style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:d.jsx("img",{src:Yi,alt:"close image"})})}),d.jsxs(za,{children:[w?d.jsx(nc,{versionName:i,versionId:n,playableId:s||"",typeOfProduct:o,iframeUrl:R,api:a,fetchFileUrl:f,copyLinkUrl:h,setSafariCopyLink:j,iosLink:V,androidLink:k,urlType:y}):d.jsx(d.Fragment,{children:d.jsx("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"5px",height:m>1440?"650px":"625px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:d.jsx("img",{width:"75px",height:"75px",src:it,alt:"pf-logo-gif"})})}),d.jsx(Oc,{visible:t,versionId:n,playableId:s,gameId:r,typeOfProduct:o,api:a,user:l,title:A,handleDownloadError:c,fetchFileUrl:f,fileSize:N,setFileSize:W,setSafariCopyLink:j,iosLink:V,androidLink:k,setIosLink:E,setAndroidLink:P,urlType:y,setUrlType:M})]}),d.jsx(Vr,{}),z&&d.jsx(Mf,{onClose:()=>{Mt(z),j("")},url:z}),d.jsx("div",{style:{position:"absolute",bottom:"0",left:"30px",fontSize:"12px",lineHeight:"12px",zIndex:50},children:"Version: 6.0.37"})]})]})};ut.DownloadModal=jf,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})});
88
88
  //# sourceMappingURL=index.umd.js.map