moreShopAdmin/build/admin/assets/engine.io-client.6bbd7bb9.js

2 lines
26 KiB
JavaScript
Raw Permalink Normal View History

2024-11-21 16:02:32 +08:00
import{n as v}from"./@babel.80d29b7b.js";import{r as M}from"./engine.io-parser.4305f785.js";import{r as J}from"./@socket.io.573b606e.js";import{r as j}from"./debug.b392f131.js";var I={},k={},W={},w={},L={},q={},R={},T={},Q;function O(){if(Q)return T;Q=1,Object.defineProperty(T,"__esModule",{value:!0}),T.defaultBinaryType=T.globalThisShim=T.nextTick=void 0,T.createCookieJar=n,T.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?d=>Promise.resolve().then(d):(d,l)=>l(d,0))(),T.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),T.defaultBinaryType="arraybuffer";function n(){}return T}var Y;function x(){if(Y)return R;Y=1,Object.defineProperty(R,"__esModule",{value:!0}),R.pick=y,R.installTimerFunctions=p,R.byteLength=g,R.randomString=a;const n=O();function y(i,...s){return s.reduce((h,c)=>(i.hasOwnProperty(c)&&(h[c]=i[c]),h),{})}const d=n.globalThisShim.setTimeout,l=n.globalThisShim.clearTimeout;function p(i,s){s.useNativeTimers?(i.setTimeoutFn=d.bind(n.globalThisShim),i.clearTimeoutFn=l.bind(n.globalThisShim)):(i.setTimeoutFn=n.globalThisShim.setTimeout.bind(n.globalThisShim),i.clearTimeoutFn=n.globalThisShim.clearTimeout.bind(n.globalThisShim))}const o=1.33;function g(i){return typeof i=="string"?u(i):Math.ceil((i.byteLength||i.size)*o)}function u(i){let s=0,h=0;for(let c=0,m=i.length;c<m;c++)s=i.charCodeAt(c),s<128?h+=1:s<2048?h+=2:s<55296||s>=57344?h+=3:(c++,h+=4);return h}function a(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}return R}var B={},Z;function pe(){if(Z)return B;Z=1,Object.defineProperty(B,"__esModule",{value:!0}),B.encode=n,B.decode=y;function n(d){let l="";for(let p in d)d.hasOwnProperty(p)&&(l.length&&(l+="&"),l+=encodeURIComponent(p)+"="+encodeURIComponent(d[p]));return l}function y(d){let l={},p=d.split("&");for(let o=0,g=p.length;o<g;o++){let u=p[o].split("=");l[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return l}return B}var ee;function N(){if(ee)return q;ee=1;var n=v&&v.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(q,"__esModule",{value:!0}),q.Transport=q.TransportError=void 0;const y=M(),d=J,l=x(),p=pe(),g=(0,n(j()).default)("engine.io-client:transport");class u extends Error{constructor(s,h,c){super(s),this.description=h,this.context=c,this.type="TransportError"}}q.TransportError=u;class a extends d.Emitter{constructor(s){super(),this.writable=!1,(0,l.installTimerFunctions)(this,s),this.opts=s,this.query=s.query,this.socket=s.socket,this.supportsBinary=!s.forceBase64}onError(s,h,c){return super.emitReserved("error",new u(s,h,c)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(s){this.readyState==="open"?this.write(s):g("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(s){const h=(0,y.decodePacket)(s,this.socket.binaryType);this.onPacket(h)}onPacket(s){super.emitReserved("packet",s)}onClose(s){this.readyState="closed",super.emitReserved("close",s)}pause(s){}createUri(s,h={}){return s+"://"+this._hostname()+this._port()+this.opts.path+this._query(h)}_hostname(){const s=this.opts.hostname;return s.indexOf(":")===-1?s:"["+s+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(s){const h=(0,p.encode)(s);return h.length?"?"+h:""}}return q.Transport=a,q}var te;function de(){if(te)return L;te=1;var n=v&&v.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(L,"__esModule",{value:!0}),L.Polling=void 0;const y=N(),d=x(),l=M(),o=(0,n(j()).default)("engine.io-client:polling");class g extends y.Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(a){this.readyState="pausing";const i=()=>{o("paused"),this.readyState="paused",a()};if(this._polling