gearboxdownloadmodal 8.0.4 → 8.0.5
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=na,e.componentWillReceiveProps=ra),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=ia;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 Ed=Na(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Sd},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(It,"__esModule",{value:!0}),It.bodyOpenClassName=It.portalClassName=void 0;var sa=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},Od=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}}(),oa=q,nr=mn(oa),kd=za,rr=mn(kd),Ld=bn,ne=mn(Ld),Kd=Id,aa=mn(Kd),Md=nt,Wd=Rd(Md),vt=rt,la=mn(vt),jd=Ed;function Rd(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 mn(t){return t&&t.__esModule?t:{default:t}}function zd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ua(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 Yd(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 Nd=It.portalClassName="ReactModalPortal",Jd=It.bodyOpenClassName="ReactModal__Body--open",Lt=vt.canUseDOM&&rr.default.createPortal!==void 0,bi=function(e){return document.createElement(e)},Aa=function(){return Lt?rr.default.createPortal:rr.default.unstable_renderSubtreeIntoContainer};function ir(t){return t()}var Gt=function(t){Yd(e,t);function e(){var n,r,i,s;zd(this,e);for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return s=(r=(i=ua(this,(n=e.__proto__||Object.getPrototypeOf(e)).call.apply(n,[this].concat(a))),i),i.removePortal=function(){!Lt&&rr.default.unmountComponentAtNode(i.node);var A=ir(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=Aa(),c=u(i,nr.default.createElement(aa.default,sa({defaultStyles:e.defaultStyles},A)),i.node);i.portalRef(c)},r),ua(i,s)}return Od(e,[{key:"componentDidMount",value:function(){if(vt.canUseDOM){Lt||(this.node=bi("div")),this.node.className=this.props.portalClassName;var r=ir(this.props.parentSelector);r.appendChild(this.node),!Lt&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var i=ir(r.parentSelector),s=ir(this.props.parentSelector);return{prevParent:i,nextParent:s}}},{key:"componentDidUpdate",value:function(r,i,s){if(vt.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)&&!Lt&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!vt.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(!vt.canUseDOM||!Lt)return null;!this.node&&Lt&&(this.node=bi("div"));var r=Aa();return r(nr.default.createElement(aa.default,sa({ref:this.portalRef,defaultStyles:e.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){Wd.setElement(r)}}]),e}(oa.Component);Gt.propTypes={isOpen:ne.default.bool.isRequired,style:ne.default.shape({content:ne.default.object,overlay:ne.default.object}),portalClassName:ne.default.string,bodyOpenClassName:ne.default.string,htmlOpenClassName:ne.default.string,className:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),overlayClassName:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),appElement:ne.default.oneOfType([ne.default.instanceOf(la.default),ne.default.instanceOf(vt.SafeHTMLCollection),ne.default.instanceOf(vt.SafeNodeList),ne.default.arrayOf(ne.default.instanceOf(la.default))]),onAfterOpen:ne.default.func,onRequestClose:ne.default.func,closeTimeoutMS:ne.default.number,ariaHideApp:ne.default.bool,shouldFocusAfterRender:ne.default.bool,shouldCloseOnOverlayClick:ne.default.bool,shouldReturnFocusAfterClose:ne.default.bool,preventScroll:ne.default.bool,parentSelector:ne.default.func,aria:ne.default.object,data:ne.default.object,role:ne.default.string,contentLabel:ne.default.string,shouldCloseOnEsc:ne.default.bool,overlayRef:ne.default.func,contentRef:ne.default.func,id:ne.default.string,overlayElement:ne.default.func,contentElement:ne.default.func},Gt.defaultProps={isOpen:!1,portalClassName:Nd,bodyOpenClassName:Jd,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 nr.default.createElement("div",e,n)},contentElement:function(e,n){return nr.default.createElement("div",e,n)}},Gt.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,jd.polyfill)(Gt),process.env.NODE_ENV!=="production"&&(Gt.setCreateHTMLElement=function(t){return bi=t}),It.default=Gt,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=It,r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}e.default=r.default,t.exports=e.default}(pi,pi.exports);var Dd=pi.exports;const Ci=Ya(Dd),Td=({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})]}),At=Object.create(null);At.open="0",At.close="1",At.ping="2",At.pong="3",At.message="4",At.upgrade="5",At.noop="6";const sr=Object.create(null);Object.keys(At).forEach(t=>{sr[At[t]]=t});const wi={type:"error",data:"parser error"},ca=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",da=typeof ArrayBuffer=="function",fa=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,xi=({type:t,data:e},n,r)=>ca&&e instanceof Blob?n?r(e):pa(e,r):da&&(e instanceof ArrayBuffer||fa(e))?n?r(e):pa(new Blob([e]),r):r(At[t]+(e||"")),pa=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function ha(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Zi;function Gd(t,e){if(ca&&t.data instanceof Blob)return t.data.arrayBuffer().then(ha).then(e);if(da&&(t.data instanceof ArrayBuffer||fa(t.data)))return e(ha(t.data));xi(t,!1,n=>{Zi||(Zi=new TextEncoder),e(Zi.encode(n))})}const ma="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<ma.length;t++)gn[ma.charCodeAt(t)]=t;const Pd=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=gn[t.charCodeAt(r)],o=gn[t.charCodeAt(r+1)],a=gn[t.charCodeAt(r+2)],l=gn[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},Hd=typeof ArrayBuffer=="function",Ii=(t,e)=>{if(typeof t!="string")return{type:"message",data:ga(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Bd(t.substring(1),e)}:sr[n]?t.length>1?{type:sr[n],data:t.substring(1)}:{type:sr[n]}:wi},Bd=(t,e)=>{if(Hd){const n=Pd(t);return ga(n,e)}else return{base64:!0,data:t}},ga=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ya=String.fromCharCode(30),Vd=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{xi(s,!1,a=>{r[o]=a,++i===n&&e(r.join(ya))})})},Xd=(t,e)=>{const n=t.split(ya),r=[];for(let i=0;i<n.length;i++){const s=Ii(n[i],e);if(r.push(s),s.type==="error")break}return r};function Ud(){return new TransformStream({transform(t,e){Gd(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 Si;function or(t){return t.reduce((e,n)=>e+n.length,0)}function ar(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 Qd(t,e){Si||(Si=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(or(n)<1)break;const l=ar(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(or(n)<2)break;const l=ar(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(or(n)<8)break;const l=ar(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(wi);break}i=u*Math.pow(2,32)+A.getUint32(4),r=3}else{if(or(n)<i)break;const l=ar(n,i);a.enqueue(Ii(s?l:Si.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(wi);break}}}})}const va=4;function Ze(t){if(t)return Fd(t)}function Fd(t){for(var e in Ze.prototype)t[e]=Ze.prototype[e];return t}Ze.prototype.on=Ze.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Ze.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.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},Ze.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},Ze.prototype.emitReserved=Ze.prototype.emit,Ze.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Ze.prototype.hasListeners=function(t){return!!this.listeners(t).length};const lr=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),Xe=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),_d="arraybuffer";function rh(){}function qa(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const $d=Xe.setTimeout,ef=Xe.clearTimeout;function ur(t,e){e.useNativeTimers?(t.setTimeoutFn=$d.bind(Xe),t.clearTimeoutFn=ef.bind(Xe)):(t.setTimeoutFn=Xe.setTimeout.bind(Xe),t.clearTimeoutFn=Xe.clearTimeout.bind(Xe))}const tf=1.33;function nf(t){return typeof t=="string"?rf(t):Math.ceil((t.byteLength||t.size)*tf)}function rf(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 ba(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function sf(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function of(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 af extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Ei extends Ze{constructor(e){super(),this.writable=!1,ur(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 af(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=Ii(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=sf(e);return n.length?"?"+n:""}}class lf extends Ei{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)};Xd(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,Vd(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]=ba()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let Ca=!1;try{Ca=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const uf=Ca;function Af(){}class cf extends lf{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 Pt=class pr extends Ze{constructor(e,n,r){super(),this.createRequest=e,ur(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=qa(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=pr.requestsCount++,pr.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=Af,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete pr.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(Pt.requestsCount=0,Pt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",wa);else if(typeof addEventListener=="function"){const t="onpagehide"in Xe?"pagehide":"unload";addEventListener(t,wa,!1)}}function wa(){for(let t in Pt.requests)Pt.requests.hasOwnProperty(t)&&Pt.requests[t].abort()}const df=function(){const t=xa({xdomain:!1});return t&&t.responseType!==null}();class ff extends cf{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=df&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Pt(xa,this.uri(),e)}}function xa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||uf))return new XMLHttpRequest}catch{}if(!e)try{return new Xe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Za=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class pf extends Ei{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=Za?{}:qa(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;xi(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&lr(()=>{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]=ba()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Oi=Xe.WebSocket||Xe.MozWebSocket;class hf extends pf{createSocket(e,n,r){return Za?new Oi(e,n,r):n?new Oi(e,n):new Oi(e)}doWrite(e,n){this.ws.send(n)}}class mf extends Ei{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=Qd(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=Ud();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&&lr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const gf={websocket:hf,webtransport:mf,polling:ff},yf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ki(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=yf.exec(t||""),s={},o=14;for(;o--;)s[vf[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=qf(s,s.path),s.queryKey=bf(s,s.query),s}function qf(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 bf(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Li=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ar=[];Li&&addEventListener("offline",()=>{Ar.forEach(t=>t())},!1);class qt extends Ze{constructor(e,n){if(super(),this.binaryType=_d,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=ki(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=ki(n.host).host);ur(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=of(this.opts.query)),Li&&(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"})},Ar.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=va,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&&qt.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",qt.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+=nf(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,lr(()=>{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(qt.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(),Li&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ar.indexOf(this._offlineEventListener);r!==-1&&Ar.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}qt.protocol=va;class Cf extends qt{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;qt.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;qt.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 wf=class extends Cf{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=>gf[i]).filter(i=>!!i)),super(e,r)}};function xf(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=ki(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 Zf=typeof ArrayBuffer=="function",If=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Ia=Object.prototype.toString,Sf=typeof Blob=="function"||typeof Blob<"u"&&Ia.call(Blob)==="[object BlobConstructor]",Ef=typeof File=="function"||typeof File<"u"&&Ia.call(File)==="[object FileConstructor]";function Ki(t){return Zf&&(t instanceof ArrayBuffer||If(t))||Sf&&t instanceof Blob||Ef&&t instanceof File}function cr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(cr(t[n]))return!0;return!1}if(Ki(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return cr(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&cr(t[n]))return!0;return!1}function Of(t){const e=[],n=t.data,r=t;return r.data=Mi(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Mi(t,e){if(!t)return t;if(Ki(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]=Mi(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]=Mi(t[r],e));return n}return t}function kf(t,e){return t.data=Wi(t.data,e),delete t.attachments,t}function Wi(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]=Wi(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Wi(t[n],e));return t}const Lf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Kf=5;var ue;(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"})(ue||(ue={}));class Mf{constructor(e){this.replacer=e}encode(e){return(e.type===ue.EVENT||e.type===ue.ACK)&&cr(e)?this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ue.BINARY_EVENT||e.type===ue.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=Of(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Sa(t){return Object.prototype.toString.call(t)==="[object Object]"}class ji extends Ze{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===ue.BINARY_EVENT;r||n.type===ue.BINARY_ACK?(n.type=r?ue.EVENT:ue.ACK,this.reconstructor=new Wf(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ki(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(ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ue.BINARY_EVENT||r.type===ue.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(ji.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 ue.CONNECT:return Sa(n);case ue.DISCONNECT:return n===void 0;case ue.CONNECT_ERROR:return typeof n=="string"||Sa(n);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Lf.indexOf(n[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Wf{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=kf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const jf=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ji,Encoder:Mf,get PacketType(){return ue},protocol:Kf},Symbol.toStringTag,{value:"Module"}));function st(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Rf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ea extends Ze{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=[st(e,"open",this.onopen.bind(this)),st(e,"packet",this.onpacket.bind(this)),st(e,"error",this.onerror.bind(this)),st(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(Rf.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:ue.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:ue.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 ue.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 ue.EVENT:case ue.BINARY_EVENT:this.onevent(e);break;case ue.ACK:case ue.BINARY_ACK:this.onack(e);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.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:ue.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:ue.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 Ht(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}Ht.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},Ht.prototype.reset=function(){this.attempts=0},Ht.prototype.setMin=function(t){this.ms=t},Ht.prototype.setMax=function(t){this.max=t},Ht.prototype.setJitter=function(t){this.jitter=t};class Ri extends Ze{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,ur(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 Ht({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||jf;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 wf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=st(n,"open",function(){r.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=st(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(st(e,"ping",this.onping.bind(this)),st(e,"data",this.ondata.bind(this)),st(e,"error",this.onerror.bind(this)),st(e,"close",this.onclose.bind(this)),st(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){lr(()=>{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 Ea(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 yn={};function dr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=xf(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=yn[i]&&s in yn[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Ri(r,e):(yn[i]||(yn[i]=new Ri(r,e)),l=yn[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(dr,{Manager:Ri,Socket:Ea,io:dr,connect:dr});async function zf(t,e,n){return(await ge.post(n,{versionId:t,fileSize:e})).data}async function Yf(t,e){return(await ge.post(e+"/getFileSize",t)).data}const Oa=5,Nf=({setIsExceedingFileSizeAccepted:t,closeModal:e,setLoading:n,typeOfProduct:r,versionId:i,fileSize:s,setFileSize:o,user:a,compressApi:l,producerApi:A,api:u})=>{const[c,f]=q.useState(!1),[p,g]=q.useState(!1);q.useEffect(()=>{const C=dr(l,{path:"/socket.io"});return C.on("connect",()=>{console.log("Connected to the socket server")}),C.on("video-compressing",async I=>{if(console.log(I),I.userId===a._id&&I.isSuccess){console.log("Video compress successfull");const K=await Yf({_id:i},u);o(K.size),t(!1)}}),C.on("error",I=>{console.error("Socket error:",I)}),()=>{C.disconnect()}},[i]);const m=()=>{e(),t(!1),n(!0)},v=async()=>{try{f(!0);const C=await zf(i,s,`${A}/videos/compressByDiff`);console.log("Compression result:",C),n(!1)}catch(C){console.error("Error compressing video:",C),n(!1),e()}};return d.jsxs(Ci,{isOpen:!0,ariaHideApp:!1,onRequestClose:m,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:m,children:d.jsx("img",{src:Hi,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(Td,{width:100,height:100,fill:ke[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:[!p&&!c&&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"]}),!p&&c&&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..."]}),p&&!c&&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:m,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:ke[r]},onClick:()=>{r==="Flex"&&!p?v():t(!1)},children:d.jsxs("span",{className:"text-center align-middle text-xl font-bold text-white",children:[r==="Flex"&&c&&!p&&"Compressing...",r==="Flex"&&!c&&!p&&s-Oa<2&&"Compress",r==="Flex"&&!c&&!p&&s-Oa>=2&&"Continue",r!=="Flex"&&!c&&p&&"Export",r!=="Flex"&&"Continue"]})})]})]})},Jf=({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 Df(t,e){return(await ge.post(t+"/getNetworks",{typeOfProduct:e})).data}const Tf=({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:p,fusionData:g})=>{const[m,v]=q.useState(window.innerWidth),[C,I]=q.useState(!1),[K,E]=q.useState(u),[b,G]=q.useState(!1),[Z,M]=q.useState(!0),[N,j]=q.useState(null),[z,R]=q.useState(""),[V,O]=q.useState("Loading..."),[L,P]=q.useState("Loading..."),[y,W]=q.useState("game"),[U,x]=Ne(Ai),[S,X]=Ne(Po);GA(o,a,R,f,g);const B=async()=>{let D=await Df(a,o);if(!D){JA("Networks not found");return}D=D.map(H=>(H.name=H.id,H)),x(D),X(D.map(H=>H.id).filter(H=>H!=="default")),PA(D),An(n,"preview",null,null,!1).then(H=>{I(!0),E(f+"/"+H.url),(o==="Flex"||o==="Ready"||o==="Playable"||o==="Fusion")&&(H.size>=5?G(!0):G(!1),j(H.size)),M(!1)})};return q.useEffect(()=>{t?C||(B(),I(!0)):(I(!1),E(""))},[t]),q.useEffect(()=>{const D=()=>{v(window.innerWidth)};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[]),Z&&t?d.jsx(d.Fragment,{children:d.jsx(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!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:Te,alt:"pf-logo-gif"})})})}):Z&&o==="Flex"?null:d.jsxs("div",{onMouseDown:D=>{D.stopPropagation()},onMouseUp:D=>{D.stopPropagation()},children:[b&&t&&d.jsx(Nf,{setIsExceedingFileSizeAccepted:G,closeModal:e,setLoading:M,typeOfProduct:o,versionId:n,fileSize:N,setFileSize:j,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",api:a}),!b&&d.jsxs(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!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"&&M(!0)},style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:d.jsx("img",{src:Hi,alt:"close image"})})}),d.jsxs(Ta,{children:[C?d.jsx(ac,{versionName:i,versionId:n,playableId:s||"",typeOfProduct:o,iframeUrl:K,api:a,fetchFileUrl:f,copyLinkUrl:p,setSafariCopyLink:R,iosLink:V,androidLink:L,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:Te,alt:"pf-logo-gif"})})}),d.jsx(jc,{visible:t,versionId:n,playableId:s,gameId:r,typeOfProduct:o,api:a,user:l,title:A,handleDownloadError:c,fetchFileUrl:f,fileSize:N,setFileSize:j,setSafariCopyLink:R,iosLink:V,androidLink:L,setIosLink:O,setAndroidLink:P,urlType:y,setUrlType:W})]}),d.jsx($r,{}),z&&d.jsx(Jf,{onClose:()=>{Nt(z),R("")},url:z}),d.jsx("div",{style:{position:"absolute",bottom:"0",left:"30px",fontSize:"12px",lineHeight:"12px",zIndex:50},children:"Version: 6.0.37"})]})]})};pt.DownloadModal=Tf,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})});
|
|
87
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStateFromProps=="function"&&(e.componentWillMount=na,e.componentWillReceiveProps=ra),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=ia;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 Ed=Na(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Sd},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(It,"__esModule",{value:!0}),It.bodyOpenClassName=It.portalClassName=void 0;var sa=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},Od=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}}(),oa=q,nr=mn(oa),kd=za,rr=mn(kd),Ld=bn,ne=mn(Ld),Kd=Id,aa=mn(Kd),Md=nt,Wd=Rd(Md),vt=rt,la=mn(vt),jd=Ed;function Rd(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 mn(t){return t&&t.__esModule?t:{default:t}}function zd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ua(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 Yd(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 Nd=It.portalClassName="ReactModalPortal",Jd=It.bodyOpenClassName="ReactModal__Body--open",Lt=vt.canUseDOM&&rr.default.createPortal!==void 0,bi=function(e){return document.createElement(e)},Aa=function(){return Lt?rr.default.createPortal:rr.default.unstable_renderSubtreeIntoContainer};function ir(t){return t()}var Gt=function(t){Yd(e,t);function e(){var n,r,i,s;zd(this,e);for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return s=(r=(i=ua(this,(n=e.__proto__||Object.getPrototypeOf(e)).call.apply(n,[this].concat(a))),i),i.removePortal=function(){!Lt&&rr.default.unmountComponentAtNode(i.node);var A=ir(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=Aa(),c=u(i,nr.default.createElement(aa.default,sa({defaultStyles:e.defaultStyles},A)),i.node);i.portalRef(c)},r),ua(i,s)}return Od(e,[{key:"componentDidMount",value:function(){if(vt.canUseDOM){Lt||(this.node=bi("div")),this.node.className=this.props.portalClassName;var r=ir(this.props.parentSelector);r.appendChild(this.node),!Lt&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var i=ir(r.parentSelector),s=ir(this.props.parentSelector);return{prevParent:i,nextParent:s}}},{key:"componentDidUpdate",value:function(r,i,s){if(vt.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)&&!Lt&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!vt.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(!vt.canUseDOM||!Lt)return null;!this.node&&Lt&&(this.node=bi("div"));var r=Aa();return r(nr.default.createElement(aa.default,sa({ref:this.portalRef,defaultStyles:e.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){Wd.setElement(r)}}]),e}(oa.Component);Gt.propTypes={isOpen:ne.default.bool.isRequired,style:ne.default.shape({content:ne.default.object,overlay:ne.default.object}),portalClassName:ne.default.string,bodyOpenClassName:ne.default.string,htmlOpenClassName:ne.default.string,className:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),overlayClassName:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),appElement:ne.default.oneOfType([ne.default.instanceOf(la.default),ne.default.instanceOf(vt.SafeHTMLCollection),ne.default.instanceOf(vt.SafeNodeList),ne.default.arrayOf(ne.default.instanceOf(la.default))]),onAfterOpen:ne.default.func,onRequestClose:ne.default.func,closeTimeoutMS:ne.default.number,ariaHideApp:ne.default.bool,shouldFocusAfterRender:ne.default.bool,shouldCloseOnOverlayClick:ne.default.bool,shouldReturnFocusAfterClose:ne.default.bool,preventScroll:ne.default.bool,parentSelector:ne.default.func,aria:ne.default.object,data:ne.default.object,role:ne.default.string,contentLabel:ne.default.string,shouldCloseOnEsc:ne.default.bool,overlayRef:ne.default.func,contentRef:ne.default.func,id:ne.default.string,overlayElement:ne.default.func,contentElement:ne.default.func},Gt.defaultProps={isOpen:!1,portalClassName:Nd,bodyOpenClassName:Jd,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 nr.default.createElement("div",e,n)},contentElement:function(e,n){return nr.default.createElement("div",e,n)}},Gt.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,jd.polyfill)(Gt),process.env.NODE_ENV!=="production"&&(Gt.setCreateHTMLElement=function(t){return bi=t}),It.default=Gt,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=It,r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}e.default=r.default,t.exports=e.default}(pi,pi.exports);var Dd=pi.exports;const Ci=Ya(Dd),Td=({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})]}),At=Object.create(null);At.open="0",At.close="1",At.ping="2",At.pong="3",At.message="4",At.upgrade="5",At.noop="6";const sr=Object.create(null);Object.keys(At).forEach(t=>{sr[At[t]]=t});const wi={type:"error",data:"parser error"},ca=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",da=typeof ArrayBuffer=="function",fa=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,xi=({type:t,data:e},n,r)=>ca&&e instanceof Blob?n?r(e):pa(e,r):da&&(e instanceof ArrayBuffer||fa(e))?n?r(e):pa(new Blob([e]),r):r(At[t]+(e||"")),pa=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function ha(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Zi;function Gd(t,e){if(ca&&t.data instanceof Blob)return t.data.arrayBuffer().then(ha).then(e);if(da&&(t.data instanceof ArrayBuffer||fa(t.data)))return e(ha(t.data));xi(t,!1,n=>{Zi||(Zi=new TextEncoder),e(Zi.encode(n))})}const ma="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<ma.length;t++)gn[ma.charCodeAt(t)]=t;const Pd=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=gn[t.charCodeAt(r)],o=gn[t.charCodeAt(r+1)],a=gn[t.charCodeAt(r+2)],l=gn[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},Hd=typeof ArrayBuffer=="function",Ii=(t,e)=>{if(typeof t!="string")return{type:"message",data:ga(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Bd(t.substring(1),e)}:sr[n]?t.length>1?{type:sr[n],data:t.substring(1)}:{type:sr[n]}:wi},Bd=(t,e)=>{if(Hd){const n=Pd(t);return ga(n,e)}else return{base64:!0,data:t}},ga=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ya=String.fromCharCode(30),Vd=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{xi(s,!1,a=>{r[o]=a,++i===n&&e(r.join(ya))})})},Xd=(t,e)=>{const n=t.split(ya),r=[];for(let i=0;i<n.length;i++){const s=Ii(n[i],e);if(r.push(s),s.type==="error")break}return r};function Ud(){return new TransformStream({transform(t,e){Gd(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 Si;function or(t){return t.reduce((e,n)=>e+n.length,0)}function ar(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 Qd(t,e){Si||(Si=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(or(n)<1)break;const l=ar(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(or(n)<2)break;const l=ar(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(or(n)<8)break;const l=ar(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(wi);break}i=u*Math.pow(2,32)+A.getUint32(4),r=3}else{if(or(n)<i)break;const l=ar(n,i);a.enqueue(Ii(s?l:Si.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(wi);break}}}})}const va=4;function Ze(t){if(t)return Fd(t)}function Fd(t){for(var e in Ze.prototype)t[e]=Ze.prototype[e];return t}Ze.prototype.on=Ze.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Ze.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.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},Ze.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},Ze.prototype.emitReserved=Ze.prototype.emit,Ze.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Ze.prototype.hasListeners=function(t){return!!this.listeners(t).length};const lr=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),Xe=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),_d="arraybuffer";function rh(){}function qa(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const $d=Xe.setTimeout,ef=Xe.clearTimeout;function ur(t,e){e.useNativeTimers?(t.setTimeoutFn=$d.bind(Xe),t.clearTimeoutFn=ef.bind(Xe)):(t.setTimeoutFn=Xe.setTimeout.bind(Xe),t.clearTimeoutFn=Xe.clearTimeout.bind(Xe))}const tf=1.33;function nf(t){return typeof t=="string"?rf(t):Math.ceil((t.byteLength||t.size)*tf)}function rf(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 ba(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function sf(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function of(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 af extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Ei extends Ze{constructor(e){super(),this.writable=!1,ur(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 af(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=Ii(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=sf(e);return n.length?"?"+n:""}}class lf extends Ei{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)};Xd(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,Vd(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]=ba()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let Ca=!1;try{Ca=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const uf=Ca;function Af(){}class cf extends lf{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 Pt=class pr extends Ze{constructor(e,n,r){super(),this.createRequest=e,ur(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=qa(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=pr.requestsCount++,pr.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=Af,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete pr.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(Pt.requestsCount=0,Pt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",wa);else if(typeof addEventListener=="function"){const t="onpagehide"in Xe?"pagehide":"unload";addEventListener(t,wa,!1)}}function wa(){for(let t in Pt.requests)Pt.requests.hasOwnProperty(t)&&Pt.requests[t].abort()}const df=function(){const t=xa({xdomain:!1});return t&&t.responseType!==null}();class ff extends cf{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=df&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Pt(xa,this.uri(),e)}}function xa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||uf))return new XMLHttpRequest}catch{}if(!e)try{return new Xe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Za=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class pf extends Ei{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=Za?{}:qa(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;xi(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&lr(()=>{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]=ba()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Oi=Xe.WebSocket||Xe.MozWebSocket;class hf extends pf{createSocket(e,n,r){return Za?new Oi(e,n,r):n?new Oi(e,n):new Oi(e)}doWrite(e,n){this.ws.send(n)}}class mf extends Ei{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=Qd(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=Ud();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&&lr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const gf={websocket:hf,webtransport:mf,polling:ff},yf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ki(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=yf.exec(t||""),s={},o=14;for(;o--;)s[vf[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=qf(s,s.path),s.queryKey=bf(s,s.query),s}function qf(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 bf(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Li=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ar=[];Li&&addEventListener("offline",()=>{Ar.forEach(t=>t())},!1);class qt extends Ze{constructor(e,n){if(super(),this.binaryType=_d,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=ki(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=ki(n.host).host);ur(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=of(this.opts.query)),Li&&(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"})},Ar.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=va,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&&qt.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",qt.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+=nf(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,lr(()=>{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(qt.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(),Li&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ar.indexOf(this._offlineEventListener);r!==-1&&Ar.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}qt.protocol=va;class Cf extends qt{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;qt.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;qt.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 wf=class extends Cf{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=>gf[i]).filter(i=>!!i)),super(e,r)}};function xf(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=ki(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 Zf=typeof ArrayBuffer=="function",If=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Ia=Object.prototype.toString,Sf=typeof Blob=="function"||typeof Blob<"u"&&Ia.call(Blob)==="[object BlobConstructor]",Ef=typeof File=="function"||typeof File<"u"&&Ia.call(File)==="[object FileConstructor]";function Ki(t){return Zf&&(t instanceof ArrayBuffer||If(t))||Sf&&t instanceof Blob||Ef&&t instanceof File}function cr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(cr(t[n]))return!0;return!1}if(Ki(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return cr(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&cr(t[n]))return!0;return!1}function Of(t){const e=[],n=t.data,r=t;return r.data=Mi(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Mi(t,e){if(!t)return t;if(Ki(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]=Mi(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]=Mi(t[r],e));return n}return t}function kf(t,e){return t.data=Wi(t.data,e),delete t.attachments,t}function Wi(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]=Wi(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Wi(t[n],e));return t}const Lf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Kf=5;var ue;(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"})(ue||(ue={}));class Mf{constructor(e){this.replacer=e}encode(e){return(e.type===ue.EVENT||e.type===ue.ACK)&&cr(e)?this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ue.BINARY_EVENT||e.type===ue.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=Of(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Sa(t){return Object.prototype.toString.call(t)==="[object Object]"}class ji extends Ze{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===ue.BINARY_EVENT;r||n.type===ue.BINARY_ACK?(n.type=r?ue.EVENT:ue.ACK,this.reconstructor=new Wf(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ki(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(ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ue.BINARY_EVENT||r.type===ue.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(ji.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 ue.CONNECT:return Sa(n);case ue.DISCONNECT:return n===void 0;case ue.CONNECT_ERROR:return typeof n=="string"||Sa(n);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Lf.indexOf(n[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Wf{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=kf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const jf=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ji,Encoder:Mf,get PacketType(){return ue},protocol:Kf},Symbol.toStringTag,{value:"Module"}));function st(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Rf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ea extends Ze{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=[st(e,"open",this.onopen.bind(this)),st(e,"packet",this.onpacket.bind(this)),st(e,"error",this.onerror.bind(this)),st(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(Rf.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:ue.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:ue.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 ue.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 ue.EVENT:case ue.BINARY_EVENT:this.onevent(e);break;case ue.ACK:case ue.BINARY_ACK:this.onack(e);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.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:ue.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:ue.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 Ht(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}Ht.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},Ht.prototype.reset=function(){this.attempts=0},Ht.prototype.setMin=function(t){this.ms=t},Ht.prototype.setMax=function(t){this.max=t},Ht.prototype.setJitter=function(t){this.jitter=t};class Ri extends Ze{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,ur(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 Ht({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||jf;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 wf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=st(n,"open",function(){r.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=st(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(st(e,"ping",this.onping.bind(this)),st(e,"data",this.ondata.bind(this)),st(e,"error",this.onerror.bind(this)),st(e,"close",this.onclose.bind(this)),st(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){lr(()=>{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 Ea(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 yn={};function dr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=xf(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=yn[i]&&s in yn[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Ri(r,e):(yn[i]||(yn[i]=new Ri(r,e)),l=yn[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(dr,{Manager:Ri,Socket:Ea,io:dr,connect:dr});async function zf(t,e,n){return(await ge.post(n,{versionId:t,fileSize:e})).data}async function Yf(t,e){return(await ge.post(e+"/getFileSize",t)).data}const Oa=5,Nf=({setIsExceedingFileSizeAccepted:t,closeModal:e,setLoading:n,typeOfProduct:r,versionId:i,fileSize:s,setFileSize:o,user:a,compressApi:l,producerApi:A,api:u})=>{const[c,f]=q.useState(!1),[p,g]=q.useState(!1);q.useEffect(()=>{const C=dr(l,{path:"/socket.io"});return C.on("connect",()=>{console.log("Connected to the socket server")}),C.on("video-compressing",async I=>{if(console.log(I),I.userId===a._id&&I.isSuccess){console.log("Video compress successfull");const K=await Yf({_id:i},u);o(K.size),t(!1)}}),C.on("error",I=>{console.error("Socket error:",I)}),()=>{C.disconnect()}},[i]);const m=()=>{e(),t(!1),n(!0)},v=async()=>{try{f(!0);const C=await zf(i,s,`${A}/videos/compressByDiff`);console.log("Compression result:",C),n(!1)}catch(C){console.error("Error compressing video:",C),n(!1),e()}};return d.jsxs(Ci,{isOpen:!0,ariaHideApp:!1,onRequestClose:m,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:m,children:d.jsx("img",{src:Hi,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(Td,{width:100,height:100,fill:ke[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:[!p&&!c&&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"]}),!p&&c&&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..."]}),p&&!c&&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:m,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:ke[r]},onClick:()=>{r==="Flex"&&!p?v():t(!1)},children:d.jsxs("span",{className:"text-center align-middle text-xl font-bold text-white",children:[r==="Flex"&&c&&!p&&"Compressing...",r==="Flex"&&!c&&!p&&s-Oa<2&&"Compress",r==="Flex"&&!c&&!p&&s-Oa>=2&&"Continue",r!=="Flex"&&!c&&p&&"Export",r!=="Flex"&&"Continue"]})})]})]})},Jf=({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 Df(t,e,n,r){return(await ge.post(t+"/getNetworks",{typeOfProduct:e,versionId:n,customerId:r})).data}const Tf=({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:p,fusionData:g})=>{const[m,v]=q.useState(window.innerWidth),[C,I]=q.useState(!1),[K,E]=q.useState(u),[b,G]=q.useState(!1),[Z,M]=q.useState(!0),[N,j]=q.useState(null),[z,R]=q.useState(""),[V,O]=q.useState("Loading..."),[L,P]=q.useState("Loading..."),[y,W]=q.useState("game"),[U,x]=Ne(Ai),[S,X]=Ne(Po);GA(o,a,R,f,g);const B=async()=>{let D=await Df(a,o,n,l.customer);if(!D){JA("Networks not found");return}D=D.map(H=>(H.name=H.id,H)),x(D),X(D.map(H=>H.id).filter(H=>H!=="default")),PA(D),An(n,"preview",null,null,!1).then(H=>{I(!0),E(f+"/"+H.url),(o==="Flex"||o==="Ready"||o==="Playable"||o==="Fusion")&&(H.size>=5?G(!0):G(!1),j(H.size)),M(!1)})};return q.useEffect(()=>{t?C||(B(),I(!0)):(I(!1),E(""))},[t]),q.useEffect(()=>{const D=()=>{v(window.innerWidth)};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[]),Z&&t?d.jsx(d.Fragment,{children:d.jsx(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!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:Te,alt:"pf-logo-gif"})})})}):Z&&o==="Flex"?null:d.jsxs("div",{onMouseDown:D=>{D.stopPropagation()},onMouseUp:D=>{D.stopPropagation()},children:[b&&t&&d.jsx(Nf,{setIsExceedingFileSizeAccepted:G,closeModal:e,setLoading:M,typeOfProduct:o,versionId:n,fileSize:N,setFileSize:j,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",api:a}),!b&&d.jsxs(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!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"&&M(!0)},style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:d.jsx("img",{src:Hi,alt:"close image"})})}),d.jsxs(Ta,{children:[C?d.jsx(ac,{versionName:i,versionId:n,playableId:s||"",typeOfProduct:o,iframeUrl:K,api:a,fetchFileUrl:f,copyLinkUrl:p,setSafariCopyLink:R,iosLink:V,androidLink:L,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:Te,alt:"pf-logo-gif"})})}),d.jsx(jc,{visible:t,versionId:n,playableId:s,gameId:r,typeOfProduct:o,api:a,user:l,title:A,handleDownloadError:c,fetchFileUrl:f,fileSize:N,setFileSize:j,setSafariCopyLink:R,iosLink:V,androidLink:L,setIosLink:O,setAndroidLink:P,urlType:y,setUrlType:W})]}),d.jsx($r,{}),z&&d.jsx(Jf,{onClose:()=>{Nt(z),R("")},url:z}),d.jsx("div",{style:{position:"absolute",bottom:"0",left:"30px",fontSize:"12px",lineHeight:"12px",zIndex:50},children:"Version: 6.0.37"})]})]})};pt.DownloadModal=Tf,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})});
|
|
88
88
|
//# sourceMappingURL=index.umd.js.map
|