PageSourceSearch

https://cnm.com/_nuxt/DACxSriu.js

js cnm.com collected 2026-10-09 04:59:02 UTC 87,403 bytes, 9 lines download raw bytes

1import{aH as _,aM as Wn,R as Mn,f as Vn,h as hn,O as W,L as $n,ap as qe,e as H,aa as Fn,g as Xn,u as Gn,l as zn,c as Jn,a as P,m as He,q as oe,b as De,s as Pe,t as Kn,o as Yn}from"#entry";function Qn(s,e){s.terminate=function(){const t=()=>{};this.onerror=t,this.onmessage=t,this.onopen=t;const r=new Date,n=Math.random().toString().substring(2,8),i=this.onclose;this.onclose=o=>{const a=new Date().getTime()-r.getTime();e(`Discarded socket (#${n})  closed after ${a}ms, with code/reason: ${o.code}/${o.reason}`)},this.close(),i?.call(s,{code:4001,reason:`Quick discarding socket (#${n}) without waiting for the shutdown sequence.`,wasClean:!1})}}const fe={LF:`
2`,NULL:"\0"};class ee{get body(){return!this._body&&this.isBinaryBody&&(this._body=new TextDecoder().decode(this._binaryBody)),this._body||""}get binaryBody(){return!this._binaryBody&&!this.isBinaryBody&&(this._binaryBody=new TextEncoder().encode(this._body)),this._binaryBody}constructor(e){const{command:t,headers:r,body:n,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:a}=e;this.command=t,this.headers=Object.assign({},r||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=n||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=a||!1}static fromRawFrame(e,t){const r={},n=i=>i.replace(/^\s+|\s+$/g,"");for(const i of e.headers.reverse()){i.indexOf(":");const o=n(i[0]);let a=n(i[1]);t&&e.command!=="CONNECT"&&e.command!=="CONNECTED"&&(a=ee.hdrValueUnEscape(a)),r[o]=a}return new ee({command:e.command,headers:r,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?ee.toUnit8Array(e,this._binaryBody).buffer:e+this._body+fe.NULL}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const r=this.headers[t];this.escapeHeaderValues&&this.command!=="CONNECT"&&this.command!=="CONNECTED"?e.push(`${t}:${ee.hdrValueEscape(`${r}`)}`):e.push(`${t}:${r}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(fe.LF)+fe.LF+fe.LF}isBodyEmpty(){return this.bodyLength()===0}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?new TextEncoder().encode(e).length:0}static toUnit8Array(e,t){const r=new TextEncoder().encode(e),n=new Uint8Array([0]),i=new Uint8Array(r.length+t.length+n.length);return i.set(r),i.set(t,r.length),i.set(n,r.length+t.length),i}static marshall(e){return new ee(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n
2/g,`
3`).replace(/\\c/g,":").replace(/\\\\/g,"\\")}}const er=0,we=10,Se=13,Zn=58;class ei{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let r;if(typeof e=="string"?r=this._encoder.encode(e):r=new Uint8Array(e),t&&r[r.length-1]!==0){const n=new Uint8Array(r.length+1);n.set(r,0),n[r.length]=0,r=n}for(let n=0;n<r.length;n++){const i=r[n];this._onByte(i)}}_collectFrame(e){if(e!==er&&e!==Se){if(e===we){this.onIncomingPing();return}this._onByte=this._collectCommand,this._reinjectByte(e)}}_collectCommand(e){if(e!==Se){if(e===we){this._results.command=this._consumeTokenAsUTF8(),this._onByte=this._collectHeaders;return}this._consumeByte(e)}}_collectHeaders(e){if(e!==Se){if(e===we){this._setupCollectBody();return}this._onByte=this._collectHeaderKey,this._reinjectByte(e)}}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(e===Zn){this._headerKey=this._consumeTokenAsUTF8(),this._onByte=this._collectHeaderValue;return}this._consumeByte(e)}_collectHeaderValue(e){if(e!==Se){if(e===we){this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,this._onByte=this._collectHeaders;return}this._consumeByte(e)}}_setupCollectBody(){const e=this._results.headers.filter(t=>t[0]==="content-length")[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){if(e===er){this._retrievedBody();return}this._consumeByte(e)}_collectBodyFixedSize(e){if(this._bodyBytesRemaining--===0){this._retrievedBody();return}this._consumeByte(e)}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw();try{this.onFrame(this._results)}catch(e){console.log("Ignoring an exception thrown by a frame handler. Original exception: ",e)}this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var te;(function(s){s[s.CONNECTING=0]="CONNECTING",s[s.OPEN=1]="OPEN",s[s.CLOSING=2]="CLOSING",s[s.CLOSED=3]="CLOSED"})(te||(te={}));var X;(function(s){s[s.ACTIVE=0]="ACTIVE",s[s.DEACTIVATING=1]="DEACTIVATING",s[s.INACTIVE=2]="INACTIVE"})(X||(X={}));var Te;(function(s){s[s.LINEAR=0]="LINEAR",s[s.EXPONENTIAL=1]="EXPONENTIAL"})(Te||(Te={}));var pe;(function(s){s.Interval="interval",s.Worker="worker"})(pe||(pe={}));class ti{constructor(e,t=pe.Interval,r){this._interval=e,this._strategy=t,this._debug=r,this._workerScript=`
4    var startTime = Date.now();
5    setInterval(function() {
6        self.postMessage(Date.now() - startTime);
7    }, ${this._interval});
8  `}start(e){this.stop(),this.shouldUseWorker()?this.runWorker(e):this.runInterval(e)}stop(){this.disposeWorker(),this.disposeInterval()}shouldUseWorker(){return typeof Worker<"u"&&this._strategy===pe.Worker}runWorker(e){this._debug("Using runWorker for outgoing pings"),this._worker||(this._worker=new Worker(URL.createObjectURL(new Blob([this._workerScript],{type:"text/javascript"}))),this._worker.onmessage=t=>e(t.data))}runInterval(e){if(this._debug("Using runInterval for outgoing pings"),!this._timer){const t=Date.now();this._timer=setInterval(()=>{e(Date.now()-t)},this._interval)}}disposeWorker(){this._worker&&(this._worker.terminate(),delete this._worker,this._debug("Outgoing ping disposeWorker"))}disposeInterval(){this._timer&&(clearInterval(this._timer),delete this._timer,this._debug("Outgoing ping disposeInterval"))}}class j{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(e=>`v${e.replace(".","")}.stomp`)}}j.V1_0="1.0";j.V1_1="1.1";j.V1_2="1.2";j.default=new j([j.V1_2,j.V1_1,j.V1_0]);class ri{get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}constructor(e,t,r){this._client=e,this._webSocket=t,this._connected=!1,this._serverFrameHandlers={CONNECTED:n=>{this.debug(`connected to server ${n.headers.server}`),this._connected=!0,this._connectedVersion=n.headers.version,this._connectedVersion===j.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(n.headers),this.onConnect(n)},MESSAGE:n=>{const i=n.headers.subscription,o=this._subscriptions[i]||this.onUnhandledMessage,a=n,l=this,u=this._connectedVersion===j.V1_2?a.headers.ack:a.headers["message-id"];a.ack=(c={})=>l.ack(u,i,c),a.nack=(c={})=>l.nack(u,i,c),o(a)},RECEIPT:n=>{const i=this._receiptWatchers[n.headers["receipt-id"]];i?(i(n),delete this._receiptWatchers[n.headers["receipt-id"]]):this.onUnhandledReceipt(n)},ERROR:n=>{this.onStompError(n)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.debug=r.debug,this.stompVersions=r.stompVersions,this.connectHeaders=r.connectHeaders,this.disconnectHeaders=r.disconnectHeaders,this.heartbeatIncoming=r.heartbeatIncoming,this.heartbeatToleranceMultiplier=r.heartbeatGracePeriods,this.heartbeatOutgoing=r.heartbeatOutgoing,this.splitLargeFrames=r.splitLargeFrames,this.maxWebSocketChunkSize=r.maxWebSocketChunkSize,this.forceBinaryWSFrames=r.forceBinaryWSFrames,this.logRawCommunication=r.logRawCommunication,this.appendMissingNULLonIncoming=r.appendMissingNULLonIncoming,this.discardWebsocketOnCommFailure=r.discardWebsocketOnCommFailure,this.onConnect=r.onConnect,this.onDisconnect=r.onDisconnect,this.onStompError=r.onStompError,this.onWeb
8SocketClose=r.onWebSocketClose,this.onWebSocketError=r.onWebSocketError,this.onUnhandledMessage=r.onUnhandledMessage,this.onUnhandledReceipt=r.onUnhandledReceipt,this.onUnhandledFrame=r.onUnhandledFrame,this.onHeartbeatReceived=r.onHeartbeatReceived,this.onHeartbeatLost=r.onHeartbeatLost}start(){const e=new ei(t=>{const r=ee.fromRawFrame(t,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${r}`),(this._serverFrameHandlers[r.command]||this.onUnhandledFrame)(r)},()=>{this.debug("<<< PONG"),this.onHeartbeatReceived()});this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const r=t.data instanceof ArrayBuffer?new TextDecoder().decode(t.data):t.data;this.debug(`<<< ${r}`)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._webSocket.onclose=t=>{this.debug(`Connection closed to ${this._webSocket.url}`),this._cleanUp(),this.onWebSocketClose(t)},this._webSocket.onerror=t=>{this.onWebSocketError(t)},this._webSocket.onopen=()=>{const t=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),t["accept-version"]=this.stompVersions.supportedVersions(),t["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:t})}}_setupHeartbeat(e){if(e.version!==j.V1_1&&e.version!==j.V1_2||!e["heart-beat"])return;const[t,r]=e["heart-beat"].split(",").map(n=>parseInt(n,10));if(this.heartbeatOutgoing!==0&&r!==0){const n=Math.max(this.heartbeatOutgoing,r);this.debug(`send PING every ${n}ms`),this._pinger=new ti(n,this._client.heartbeatStrategy,this.debug),this._pinger.start(()=>{this._webSocket.readyState===te.OPEN&&(this._webSocket.send(fe.LF),this.debug(">>> PING"))})}if(this.heartbeatIncoming!==0&&t!==0){const n=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${n}ms`),this._ponger=setInterval(()=>{const i=Date.now()-this._lastServerActivityTS;i>n*this.heartbeatToleranceMultiplier&&(this.debug(`did not receive server activity for the last ${i}ms`),this.onHeartbeatLost(),this._closeOrDiscardWebsocket())},n)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this.discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState===te.CONNECTING||this._webSocket.readyState===te.OPEN)&&this._closeOrDiscardWebsocket()}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}discardWebsocket(){typeof this._webSocket.terminate!="function"&&Qn(this._webSocket,e=>this.debug(e)),this._webSocket.terminate()}_transmit(e){const{command:t,headers:r,body:n,binaryBody:i,skipContentLengthHeader:o}=e,a=new ee({command:t,headers:r,body:n,binaryBody:i,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o});let l=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${l}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&typeof l=="string"&&(l=new TextEncoder().encode(l)),typeof l!="string"||!this.splitLargeFrames)this._webSocket.send(l);else{let u=l;for(;u.length>0;){const c=u.substring(0,this.maxWebSocketChunkSize);u=u.substring(this.maxWebSocketChunkSize),this._webSocket.send(c),this.debug(`chunk sent = ${c.length}, remaining = ${u.length}`)}}}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt=`close-${this._counter++}`),this.watchForReceipt(e.receipt,t=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(t)}),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}else(this._webSocket.readyState===te.CONNECTING||this._webSocket.readyState===te.OPEN)&&this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&(this._pinger.stop(),this._pinger=void 0),this._ponger&&(clearInterval(this._ponger),this._ponger=void 0)}publish(e){const{destination:t,headers:r,body:n,binaryBody:i,skipContentLengthHeader:o}=e,a=Object.assign({destination:t},r);this._transmit({command:"SEND",headers:a,body:n,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,r={}){r=Object.assign({},r),r.id||(r.id=`sub-${this._counter++}`),r.destination=e,this._subscriptions[r.id]=t,this._transmit({command:"SUBSCRIBE",headers:r});const n=this;return{id:r.id,unsubscribe(i){return n.unsubscribe(r.id,i)}}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||`tx-${this._counter++}`;this._transmit({command:"BEGIN",headers:{transaction:t}});const r=this;return{id:t,commit(){r.commit(t)},abort(){r.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,r={}){r=Object.assign({},r),this._connectedVersion===j.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"ACK",headers:r})}nack(e,t,r={}){return r=Object.assign({},r),this._connectedVersion===j.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"NACK",headers:r})}}
8class ni{get webSocket(){return this._stompHandler?._webSocket}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===X.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}constructor(e={}){this.stompVersions=j.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this._nextReconnectDelay=0,this.maxReconnectDelay=900*1e3,this.reconnectTimeMode=Te.LINEAR,this.heartbeatIncoming=1e4,this.heartbeatToleranceMultiplier=2,this.heartbeatOutgoing=1e4,this.heartbeatStrategy=pe.Interval,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8*1024,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.discardWebsocketOnCommFailure=!1,this.state=X.INACTIVE;const t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onHeartbeatReceived=t,this.onHeartbeatLost=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}configure(e){Object.assign(this,e),this.maxReconnectDelay>0&&this.maxReconnectDelay<this.reconnectDelay&&(this.debug(`Warning: maxReconnectDelay (${this.maxReconnectDelay}ms) is less than reconnectDelay (${this.reconnectDelay}ms). Using reconnectDelay as the maxReconnectDelay delay.`),this.maxReconnectDelay=this.reconnectDelay)}activate(){const e=()=>{if(this.active){this.debug("Already ACTIVE, ignoring request to activate");return}this._changeState(X.ACTIVE),this._nextReconnectDelay=this.reconnectDelay,this._connect()};this.state===X.DEACTIVATING?(this.debug("Waiting for deactivation to finish before activating"),this.deactivate().then(()=>{e()})):e()}async _connect(){if(await this.beforeConnect(this),this._stompHandler){this.debug("There is already a stompHandler, skipping the call to connect");return}if(!this.active){this.debug("Client has been marked inactive, will not attempt to connect");return}this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");const e=this._createWebSocket();this._stompHandler=new ri(this,e,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatGracePeriods:this.heartbeatToleranceMultiplier,heartbeatOutgoing:this.heartbeatOutgoing,heartbeatStrategy:this.heartbeatStrategy,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:t=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),this._nextReconnectDelay=this.reconnectDelay,!this.active){this.debug("STOMP got connected while deactivate was issued, will disconnect now"),this._disposeStompHandler();return}this.onConnect(t)},onDisconnect:t=>{this.onDisconnect(t)},onStompError:t=>{this.onStompError(t)},onWebSocketClose:t=>{this._stompHandler=void 0,this.state===X.DEACTIVATING&&this._changeState(X.INACTIVE),this.onWebSocketClose(t),this.active&&this._schedule_reconnect()},onWebSocketError:t=>{this.onWebSocketError(t)},onUnhandledMessage:t=>{this.onUnhandledMessage(t)},onUnhandledReceipt:t=>{this.onUnhandledReceipt(t)},onUnhandledFrame:t=>{this.onUnhandledFrame(t)},onHeartbeatReceived:()=>{this.onHeartbeatReceived()},onHeartbeatLost:()=>{this.onHeartbeatLost()}}),this._stompHandler.start()}_createWebSocket(){let e;if(this.webSocketFactory)e=this.webSocketFactory();else if(this.brokerURL)e=new WebSocket(this.brokerURL,this.stompVersions.protocolVersions());else throw new Error("Either brokerURL or webSocketFactory must be provided");return e.binaryType="arraybuffer",e}_schedule_reconnect(){this._nextReconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this._nextReconnectDelay}ms`),this._reconnector=setTimeout(()=>
8{this.reconnectTimeMode===Te.EXPONENTIAL&&(this._nextReconnectDelay=this._nextReconnectDelay*2,this.maxReconnectDelay!==0&&(this._nextReconnectDelay=Math.min(this._nextReconnectDelay,this.maxReconnectDelay))),this._connect()},this._nextReconnectDelay))}async deactivate(e={}){const t=e.force||!1,r=this.active;let n;if(this.state===X.INACTIVE)return this.debug("Already INACTIVE, nothing more to do"),Promise.resolve();if(this._changeState(X.DEACTIVATING),this._nextReconnectDelay=0,this._reconnector&&(clearTimeout(this._reconnector),this._reconnector=void 0),this._stompHandler&&this.webSocket.readyState!==te.CLOSED){const i=this._stompHandler.onWebSocketClose;n=new Promise((o,a)=>{this._stompHandler.onWebSocketClose=l=>{i(l),o()}})}else return this._changeState(X.INACTIVE),Promise.resolve();return t?this._stompHandler?.discardWebsocket():r&&this._disposeStompHandler(),n}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&this._stompHandler.dispose()}publish(e){this._checkConnection(),this._stompHandler.publish(e)}_checkConnection(){if(!this.connected)throw new TypeError("There is no underlying STOMP connection")}watchForReceipt(e,t){this._checkConnection(),this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,r={}){return this._checkConnection(),this._stompHandler.subscribe(e,t,r)}unsubscribe(e,t={}){this._checkConnection(),this._stompHandler.unsubscribe(e,t)}begin(e){return this._checkConnection(),this._stompHandler.begin(e)}commit(e){this._checkConnection(),this._stompHandler.commit(e)}abort(e){this._checkConnection(),this._stompHandler.abort(e)}ack(e,t,r={}){this._checkConnection(),this._stompHandler.ack(e,t,r)}nack(e,t,r={}){this._checkConnection(),this._stompHandler.nack(e,t,r)}}var je={exports:{}},Ee={},tr;function ii(){return tr||(tr=1,_.crypto&&_.crypto.getRandomValues?Ee.randomBytes=function(s){var e=new Uint8Array(s);return _.crypto.getRandomValues(e),e}:Ee.randomBytes=function(s){for(var e=new Array(s),t=0;t<s;t++)e[t]=Math.floor(Math.random()*256);return e}),Ee}var Be,rr;function ae(){if(rr)return Be;rr=1;var s=ii(),e="abcdefghijklmnopqrstuvwxyz012345";return Be={string:function(t){for(var r=e.length,n=s.randomBytes(t),i=[],o=0;o<t;o++)i.push(e.substr(n[o]%r,1));return i.join("")},number:function(t){return Math.floor(Math.random()*t)},numberString:function(t){var r=(""+(t-1)).length,n=new Array(r+1).join("0");return(n+this.number(t)).slice(-r)}},Be}var nr;function re(){return nr||(nr=1,(function(s){var e=ae(),t={},r=!1,n=_.chrome&&_.chrome.app&&_.chrome.app.runtime;s.exports={attachEvent:function(o,a){typeof _.addEventListener<"u"?_.addEventListener(o,a,!1):_.document&&_.attachEvent&&(_.document.attachEvent("on"+o,a),_.attachEvent("on"+o,a))},detachEvent:function(o,a){typeof _.addEventListener<"u"?_.removeEventListener(o,a,!1):_.document&&_.detachEvent&&(_.document.detachEvent("on"+o,a),_.detachEvent("on"+o,a))},unloadAdd:function(o){if(n)return null;var a=e.string(8);return t[a]=o,r&&setTimeout(this.triggerUnloadCallbacks,0),a},unloadDel:function(o){o in t&&delete t[o]},triggerUnloadCallbacks:function(){for(var o in t)t[o](),delete t[o]}};var i=function(){r||(r=!0,s.exports.triggerUnloadCallbacks())};n||s.exports.attachEvent("unload",i)})(je)),je.exports}var We,ir;function si(){return ir||(ir=1,We=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}),We}var xe={},sr;function oi(){if(sr)return xe;sr=1;var s=Object.prototype.hasOwnProperty,e;function t(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function r(o){try{return encodeURIComponent(o)}catch{return null}}function n(o){for(var a=/([^=?#&]+)=?([^&]*)/g,l={},u;u=a.exec(o);){var c=t(u[1]),f=t(u[2]);c===null||f===null||c in l||(l[c]=f)}return l}function i(o,a){a=a||"";var l=[],u,c;typeof a!="string"&&(a="?");for(c in o)if(s.call(o,c)){if(u=o[c],!u&&(u===null||u===e||isNaN(u))&&(u=""),c=r(c),u=r(u),c===null||u===null)continue;l.push(c+"="+u)}return l.length?a+l.join("&"):""}return xe.stringify=i,xe.parse=n,xe}var Me,or;function dn(){if(or)return Me;or=1;var s=si(),e=oi(),t=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r=/[\n\r\t]/g,n=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,i=/:\d+$/,o=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/;function l(m){return(m||"").toString().replace(t,"")}var u=[["#","hash"],["?","query"],function(y,h){return g(h.protocol)?y.replace(/\\/g,"/"):y},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],c={hash:1,query:1};function f(m){var y;typeof window<"u"?y=window:typeof _<"u"?y=_:typeof self<"u"?y=self:y={};var h=y.location||{};m=m||h;var p={},C=typeof m,b;if(m.protocol==="blob:")p=new T(unescape(m.pathname),{});else if(C==="string"){p=new T(m,{});for(b in c)delete p[b]}else if(C==="object"){for(b in m)b in c||(p[b]=m[b]);p.slashes===void 0&&(p.slashes=n.test(m.href))}return p}function g(m){return m==="file:"||m==="ftp:"||m==="http:"||m==="https:"||m==="ws:"||m==="wss:"}function k(m,y){m=l(m),m=m.replace(r,""),y=y||{};var h=o.exec(m),p=h[1]?h[1].toLowerCase():"",C=!!h[2],b=!!h[3],d=0,w;return C?b?(w=h[2]+h[3]+h[4],d=h[2].length+h[3].length):(w=h[2]+h[4],d=h[2].length):b?(w=h[3]+h[4],d=h[3].length):w=h[4],p==="file:"?d>=2&&(w=w.slice(2)):g(p)?w=h[4]:p?C&&(w=w.slice(2)):d>=2&&g(y.protocol)&&(w=h[4]),{protocol:p,slashes:C||g(p),slashesCount:d,rest:w}}function N(m,y){if(m==="")return y;for(var h=(y||"/").split("/").slice(0,-1).concat(m.split("/")),p=h.length,C=h[p-1],b=!1,d=0;p--;)h[p]==="."?h.splice(p,1):h[p]===".."?(h.splice(p,1),d++):d&&(p===0&&(b=!0),h.splice(p,1),d--);return b&&h.unshift(""),(C==="."||C==="..")&&h.push(""),h.join("/")}function T(m,y,h){if(m=l(m),m=m.replace(r,""),!(this instanceof T))return new T(m,y,h);var p,C,b,d,w,I,O=u.slice(),U=typeof y,E=this,M=0;for(U!=="object"&&U!=="string"&&(h=y,y=null),h&&typeof h!="function"&&(h=e.parse),y=f(y),C=k(m||"",y),p=!C.protocol&&!C.slashes,E.slashes=C.slashes||p&&y.slashes,E.protocol=C.protocol||y.protocol||"",m=C.rest,(C.protocol==="file:"&&(C.slashesCount!==2||a.test(m))||!C.slashes&&(C.protocol||C.slashesCount<2||!g(E.protocol)))&&(O[3]=[/(.*)/,"pathname"]);M<O.length;M++){if(d=O[M],typeof d=="function"){m=d(m,E);continue}b=d[0],I=d[1],b!==b?E[I]=m:typeof b=="string"?(w=b==="@"?m.lastIndexOf(b):m.indexOf(b),~w&&(typeof d[2]=="number"?(E[I]=m.slice(0,w),m=m.slice(w+d[2])):(E[I]=m.slice(w),m=m.slice(0,w)))):(w=b.exec(m))&&(E[I]=w[1],m=m.slice(0,w.index)),E[I]=E[I]||p&&d[3]&&y[I]||"",d[4]&&(E[I]=E[I].toLowerCase())}h&&(E.query=h(E.query)),p&&y.slashes&&E.pathname.charAt(0)!=="/"&&(E.pathname!==""||y.pathname!=="")&&(E.pathname=N(E.pathname,y.pathname)),E.pathname.charAt(0)!=="/"&&g(E.protocol)&&(E.pathname="/"+E.pathname),s(E.port,E.protocol)||(E.host=E.hostname,E.port=""),E.username=E.password="",E.auth&&(w=E.auth.indexOf(":"),~w?(E.username=E.auth.slice(0,w),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=E.auth.slice(w+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(E.auth)),E.auth=E.password?E.username+":"+E.password:E.username),E.origin=E.protocol!=="file:"&&g(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString()}function L(m,y,h){var p=this;switch(m){case"query":typeof y=="string"&&y.length&&(y=(h||e.parse)(y)),p[m]=y;break;case"port":p[m]=y,s(y,p.protocol)?y&&(p.host=p.hostname+":"+y):(p.host=p.hostname,p[m]="");break;case"hostname":p[m]=y,p.port&&(y+=":"+p.port),p.host=y;break;case"host":p[m]=y,i.test(y)?(y=y.split(":"),p.port=y.pop(),p.hostname=y.join(":")):(p.hostname=y,p.port="");break;case"protocol":p.protocol=y.toLowerCase(),p.slashes=!h;break;case"pathname":case"hash":if(y){var C=m==="pathname"?"/":"#";
8p[m]=y.charAt(0)!==C?C+y:y}else p[m]=y;break;case"username":case"password":p[m]=encodeURIComponent(y);break;case"auth":var b=y.indexOf(":");~b?(p.username=y.slice(0,b),p.username=encodeURIComponent(decodeURIComponent(p.username)),p.password=y.slice(b+1),p.password=encodeURIComponent(decodeURIComponent(p.password))):p.username=encodeURIComponent(decodeURIComponent(y))}for(var d=0;d<u.length;d++){var w=u[d];w[4]&&(p[w[1]]=p[w[1]].toLowerCase())}return p.auth=p.password?p.username+":"+p.password:p.username,p.origin=p.protocol!=="file:"&&g(p.protocol)&&p.host?p.protocol+"//"+p.host:"null",p.href=p.toString(),p}function R(m){(!m||typeof m!="function")&&(m=e.stringify);var y,h=this,p=h.host,C=h.protocol;C&&C.charAt(C.length-1)!==":"&&(C+=":");var b=C+(h.protocol&&h.slashes||g(h.protocol)?"//":"");return h.username?(b+=h.username,h.password&&(b+=":"+h.password),b+="@"):h.password?(b+=":"+h.password,b+="@"):h.protocol!=="file:"&&g(h.protocol)&&!p&&h.pathname!=="/"&&(b+="@"),(p[p.length-1]===":"||i.test(h.hostname)&&!h.port)&&(p+=":"),b+=p+h.pathname,y=typeof h.query=="object"?m(h.query):h.query,y&&(b+=y.charAt(0)!=="?"?"?"+y:y),h.hash&&(b+=h.hash),b}return T.prototype={set:L,toString:R},T.extractProtocol=k,T.location=f,T.trimLeft=l,T.qs=e,Me=T,Me}var Ve,ar;function V(){if(ar)return Ve;ar=1;var s=dn();return Ve={getOrigin:function(e){if(!e)return null;var t=new s(e);if(t.protocol==="file:")return null;var r=t.port;return r||(r=t.protocol==="https:"?"443":"80"),t.protocol+"//"+t.hostname+":"+r},isOriginEqual:function(e,t){var r=this.getOrigin(e)===this.getOrigin(t);return r},isSchemeEqual:function(e,t){return e.split(":")[0]===t.split(":")[0]},addPath:function(e,t){var r=e.split("?");return r[0]+t+(r[1]?"?"+r[1]:"")},addQuery:function(e,t){return e+(e.indexOf("?")===-1?"?"+t:"&"+t)},isLoopbackAddr:function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^\[::1\]$/.test(e)}},Ve}var Ce={exports:{}},cr;function A(){return cr||(cr=1,typeof Object.create=="function"?Ce.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ce.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Ce.exports}var $e={},Fe,lr;function fn(){if(lr)return Fe;lr=1;function s(){this._listeners={}}return s.prototype.addEventListener=function(e,t){e in this._listeners||(this._listeners[e]=[]);var r=this._listeners[e];r.indexOf(t)===-1&&(r=r.concat([t])),this._listeners[e]=r},s.prototype.removeEventListener=function(e,t){var r=this._listeners[e];if(r){var n=r.indexOf(t);if(n!==-1){r.length>1?this._listeners[e]=r.slice(0,n).concat(r.slice(n+1)):delete this._listeners[e];return}}},s.prototype.dispatchEvent=function(){var e=arguments[0],t=e.type,r=arguments.length===1?[e]:Array.apply(null,arguments);if(this["on"+t]&&this["on"+t].apply(this,r),t in this._listeners)for(var n=this._listeners[t],i=0;i<n.length;i++)n[i].apply(this,r)},Fe=s,Fe}var ur;function B(){if(ur)return $e;ur=1;var s=A(),e=fn();function t(){e.call(this)}return s(t,e),t.prototype.removeAllListeners=function(r){r?delete this._listeners[r]:this._listeners={}},t.prototype.once=function(r,n){var i=this,o=!1;function a(){i.removeListener(r,a),o||(o=!0,n.apply(this,arguments))}this.on(r,a)},t.prototype.emit=function(){var r=arguments[0],n=this._listeners[r];if(n){for(var i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(var l=0;l<n.length;l++)n[l].apply(this,o)}},t.prototype.on=t.prototype.addListener=e.prototype.addEventListener,t.prototype.removeListener=e.prototype.removeEventListener,$e.EventEmitter=t,$e}var ke={exports:{}},hr;function ai(){if(hr)return ke.exports;hr=1;var s=_.WebSocket||_.MozWebSocket;return s?ke.exports=function(t){return new s(t)}:ke.exports=void 0,ke.exports}var Xe,dr;function ci(){if(dr)return Xe;dr=1;var s=re(),e=V(),t=A(),r=B().EventEmitter,n=ai(),i=function(){};function o(a,l,u){if(!o.enabled())throw new Error("Transport created when disabled");r.call(this);var c=this,f=e.addPath(a,"/websocket");f.slice(0,5)==="https"?f="wss"+f.slice(5):f="ws"+f.slice(4),this.url=f,this.ws=new n(this.url,[],u),this.ws.onmessage=function(g){i("message event",g.data),c.emit("message",g.data)},this.unloadRef=s.unloadAdd(function(){c.ws.close()}
8),this.ws.onclose=function(g){i("close event",g.code,g.reason),c.emit("close",g.code,g.reason),c._cleanup()},this.ws.onerror=function(g){c.emit("close",1006,"WebSocket connection broken"),c._cleanup()}}return t(o,r),o.prototype.send=function(a){var l="["+a+"]";this.ws.send(l)},o.prototype.close=function(){var a=this.ws;this._cleanup(),a&&a.close()},o.prototype._cleanup=function(){var a=this.ws;a&&(a.onmessage=a.onclose=a.onerror=null),s.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},o.enabled=function(){return!!n},o.transportName="websocket",o.roundTrips=2,Xe=o,Xe}var Ge,fr;function li(){if(fr)return Ge;fr=1;var s=A(),e=B().EventEmitter,t=function(){};function r(n,i){e.call(this),this.sendBuffer=[],this.sender=i,this.url=n}return s(r,e),r.prototype.send=function(n){this.sendBuffer.push(n),this.sendStop||this.sendSchedule()},r.prototype.sendScheduleWait=function(){var n=this,i;this.sendStop=function(){n.sendStop=null,clearTimeout(i)},i=setTimeout(function(){n.sendStop=null,n.sendSchedule()},25)},r.prototype.sendSchedule=function(){t("sendSchedule",this.sendBuffer.length);var n=this;if(this.sendBuffer.length>0){var i="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,i,function(o){n.sendStop=null,o?(n.emit("close",o.code||1006,"Sending error: "+o),n.close()):n.sendScheduleWait()}),this.sendBuffer=[]}},r.prototype._cleanup=function(){this.removeAllListeners()},r.prototype.close=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},Ge=r,Ge}var ze,pr;function ui(){if(pr)return ze;pr=1;var s=A(),e=B().EventEmitter,t=function(){};function r(n,i,o){e.call(this),this.Receiver=n,this.receiveUrl=i,this.AjaxObject=o,this._scheduleReceiver()}return s(r,e),r.prototype._scheduleReceiver=function(){var n=this,i=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);i.on("message",function(o){n.emit("message",o)}),i.once("close",function(o,a){t("close",o,a,n.pollIsClosing),n.poll=i=null,n.pollIsClosing||(a==="network"?n._scheduleReceiver():(n.emit("close",o||1006,a),n.removeAllListeners()))})},r.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},ze=r,ze}var Je,mr;function pn(){if(mr)return Je;mr=1;var s=A(),e=V(),t=li(),r=ui();function n(i,o,a,l,u){var c=e.addPath(i,o),f=this;t.call(this,i,a),this.poll=new r(l,c,u),this.poll.on("message",function(g){f.emit("message",g)}),this.poll.once("close",function(g,k){f.poll=null,f.emit("close",g,k),f.close()})}return s(n,t),n.prototype.close=function(){t.prototype.close.call(this),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},Je=n,Je}var Ke,vr;function ce(){if(vr)return Ke;vr=1;var s=A(),e=V(),t=pn();function r(i){return function(o,a,l){var u={};typeof a=="string"&&(u.headers={"Content-type":"text/plain"});var c=e.addPath(o,"/xhr_send"),f=new i("POST",c,a,u);return f.once("finish",function(g){if(f=null,g!==200&&g!==204)return l(new Error("http status "+g));l()}),function(){f.close(),f=null;var g=new Error("Aborted");g.code=1e3,l(g)}}}function n(i,o,a,l){t.call(this,i,o,r(l),a,l)}return s(n,t),Ke=n,Ke}var Ye,gr;function Re(){if(gr)return Ye;gr=1;var s=A(),e=B().EventEmitter;function t(r,n){e.call(this);var i=this;this.bufferPosition=0,this.xo=new n("POST",r,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(o,a){i._chunkHandler(o,a),i.xo=null;var l=o===200?"network":"permanent";i.emit("close",null,l),i._cleanup()})}return s(t,e),t.prototype._chunkHandler=function(r,n){if(!(r!==200||!n))for(var i=-1;;this.bufferPosition+=i+1){var o=n.slice(this.bufferPosition);if(i=o.indexOf(`
9`),i===-1)break;var a=o.slice(0,i);a&&this.emit("message",a)}},t.prototype._cleanup=function(){this.removeAllListeners()},t.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},Ye=t,Ye}var Qe,br;function mn(){if(br)return Qe;br=1;var s=B().EventEmitter,e=A(),t=re(),r=V(),n=_.XMLHttpRequest,i=function(){};function o(u,c,f,g){var k=this;s.call(this),setTimeout(function(){k._start(u,c,f,g)},0)}e(o,s),o.prototype._start=function(u,c,f,g){var k=this;try{this.xhr=new n}catch{}
9if(!this.xhr){this.emit("finish",0,"no xhr support"),this._cleanup();return}c=r.addQuery(c,"t="+ +new Date),this.unloadRef=t.unloadAdd(function(){k._cleanup(!0)});try{this.xhr.open(u,c,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){i("xhr timeout"),k.emit("finish",0,""),k._cleanup(!1)})}catch{this.emit("finish",0,""),this._cleanup(!1);return}if((!g||!g.noCredentials)&&o.supportsCORS&&(this.xhr.withCredentials=!0),g&&g.headers)for(var N in g.headers)this.xhr.setRequestHeader(N,g.headers[N]);this.xhr.onreadystatechange=function(){if(k.xhr){var T=k.xhr,L,R;switch(i("readyState",T.readyState),T.readyState){case 3:try{R=T.status,L=T.responseText}catch{}R===1223&&(R=204),R===200&&L&&L.length>0&&k.emit("chunk",R,L);break;case 4:R=T.status,R===1223&&(R=204),(R===12005||R===12029)&&(R=0),i("finish",R,T.responseText),k.emit("finish",R,T.responseText),k._cleanup(!1);break}}};try{k.xhr.send(f)}catch{k.emit("finish",0,""),k._cleanup(!1)}},o.prototype._cleanup=function(u){if(this.xhr){if(this.removeAllListeners(),t.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),u)try{this.xhr.abort()}catch{}this.unloadRef=this.xhr=null}},o.prototype.close=function(){this._cleanup(!0)},o.enabled=!!n;var a=["Active"].concat("Object").join("X");!o.enabled&&a in _&&(n=function(){try{return new _[a]("Microsoft.XMLHTTP")}catch{return null}},o.enabled=!!new n);var l=!1;try{l="withCredentials"in new n}catch{}return o.supportsCORS=l,Qe=o,Qe}var Ze,yr;function Oe(){if(yr)return Ze;yr=1;var s=A(),e=mn();function t(r,n,i,o){e.call(this,r,n,i,o)}return s(t,e),t.enabled=e.enabled&&e.supportsCORS,Ze=t,Ze}var et,_r;function me(){if(_r)return et;_r=1;var s=A(),e=mn();function t(r,n,i){e.call(this,r,n,i,{noCredentials:!0})}return s(t,e),t.enabled=e.enabled,et=t,et}var tt,wr;function ve(){return wr||(wr=1,tt={isOpera:function(){return _.navigator&&/opera/i.test(_.navigator.userAgent)},isKonqueror:function(){return _.navigator&&/konqueror/i.test(_.navigator.userAgent)},hasDomain:function(){if(!_.document)return!0;try{return!!_.document.domain}catch{return!1}}}),tt}var rt,Sr;function hi(){if(Sr)return rt;Sr=1;var s=A(),e=ce(),t=Re(),r=Oe(),n=me(),i=ve();function o(a){if(!n.enabled&&!r.enabled)throw new Error("Transport created when disabled");e.call(this,a,"/xhr_streaming",t,r)}return s(o,e),o.enabled=function(a){return a.nullOrigin||i.isOpera()?!1:r.enabled},o.transportName="xhr-streaming",o.roundTrips=2,o.needBody=!!_.document,rt=o,rt}var nt,Er;function $t(){if(Er)return nt;Er=1;var s=B().EventEmitter,e=A(),t=re(),r=ve(),n=V(),i=function(){};function o(a,l,u){var c=this;s.call(this),setTimeout(function(){c._start(a,l,u)},0)}return e(o,s),o.prototype._start=function(a,l,u){var c=this,f=new _.XDomainRequest;l=n.addQuery(l,"t="+ +new Date),f.onerror=function(){c._error()},f.ontimeout=function(){c._error()},f.onprogress=function(){i("progress",f.responseText),c.emit("chunk",200,f.responseText)},f.onload=function(){c.emit("finish",200,f.responseText),c._cleanup(!1)},this.xdr=f,this.unloadRef=t.unloadAdd(function(){c._cleanup(!0)});try{this.xdr.open(a,l),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(u)}catch{this._error()}},o.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},o.prototype._cleanup=function(a){if(this.xdr){if(this.removeAllListeners(),t.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,a)try{this.xdr.abort()}catch{}this.unloadRef=this.xdr=null}},o.prototype.close=function(){this._cleanup(!0)},o.enabled=!!(_.XDomainRequest&&r.hasDomain()),nt=o,nt}var it,xr;function vn(){if(xr)return it;xr=1;var s=A(),e=ce(),t=Re(),r=$t();function n(i){if(!r.enabled)throw new Error("Transport created when disabled");e.call(this,i,"/xhr_streaming",t,r)}return s(n,e),n.enabled=function(i){return i.cookie_needed||i.nullOrigin?!1:r.enabled&&i.sameScheme},n.transportName="xdr-streaming",n.roundTrips=2,it=n,it}var st,Cr;function gn(){return Cr||(Cr=1,st=_.EventSource),st}var ot,kr;function di(){if(kr)return ot;kr=1;var s=A(),e=B().EventEmitter,t=gn(),r=function(){};function n(i){e.call(this);var o=this,a=this.es=new t(i);a.onmessage=function(l){r("message",l.data),o.emit("message",decodeURI(l.data))},a.onerror=function(l){r("error",a.readyState);var u=a.readyState!==2?"network":"permanent";o._cleanup(),o._close(u)}}return s(n,e),n.prototype.abort=function(){this._cleanup(),this._close("user")},n.prototype._cleanup=function(){var i=this.es;i&&(i.onmessage=i.onerror=null,i.close(),this.es=null)},n.prototype._close=function(i){var o=this;
9setTimeout(function(){o.emit("close",null,i),o.removeAllListeners()},200)},ot=n,ot}var at,Ir;function Tr(){if(Ir)return at;Ir=1;var s=A(),e=ce(),t=di(),r=Oe(),n=gn();function i(o){if(!i.enabled())throw new Error("Transport created when disabled");e.call(this,o,"/eventsource",t,r)}return s(i,e),i.enabled=function(){return!!n},i.transportName="eventsource",i.roundTrips=2,at=i,at}var ct,Rr;function bn(){return Rr||(Rr=1,ct="1.6.1"),ct}var lt={exports:{}},Or;function ge(){return Or||(Or=1,(function(s){var e=re(),t=ve();s.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){s.exports.WPrefix in _||(_[s.exports.WPrefix]={})},postMessage:function(r,n){_.parent!==_&&_.parent.postMessage(JSON.stringify({windowId:s.exports.currentWindowId,type:r,data:n||""}),"*")},createIframe:function(r,n){var i=_.document.createElement("iframe"),o,a,l=function(){clearTimeout(o);try{i.onload=null}catch{}i.onerror=null},u=function(){i&&(l(),setTimeout(function(){i&&i.parentNode.removeChild(i),i=null},0),e.unloadDel(a))},c=function(g){i&&(u(),n(g))},f=function(g,k){setTimeout(function(){try{i&&i.contentWindow&&i.contentWindow.postMessage(g,k)}catch{}},0)};return i.src=r,i.style.display="none",i.style.position="absolute",i.onerror=function(){c("onerror")},i.onload=function(){clearTimeout(o),o=setTimeout(function(){c("onload timeout")},2e3)},_.document.body.appendChild(i),o=setTimeout(function(){c("timeout")},15e3),a=e.unloadAdd(u),{post:f,cleanup:u,loaded:l}},createHtmlfile:function(r,n){var i=["Active"].concat("Object").join("X"),o=new _[i]("htmlfile"),a,l,u,c=function(){clearTimeout(a),u.onerror=null},f=function(){o&&(c(),e.unloadDel(l),u.parentNode.removeChild(u),u=o=null,CollectGarbage())},g=function(T){o&&(f(),n(T))},k=function(T,L){try{setTimeout(function(){u&&u.contentWindow&&u.contentWindow.postMessage(T,L)},0)}catch{}};o.open(),o.write('<html><script>document.domain="'+_.document.domain+'";<\/script></html>'),o.close(),o.parentWindow[s.exports.WPrefix]=_[s.exports.WPrefix];var N=o.createElement("div");return o.body.appendChild(N),u=o.createElement("iframe"),N.appendChild(u),u.src=r,u.onerror=function(){g("onerror")},a=setTimeout(function(){g("timeout")},15e3),l=e.unloadAdd(f),{post:k,cleanup:f,loaded:c}}},s.exports.iframeEnabled=!1,_.document&&(s.exports.iframeEnabled=(typeof _.postMessage=="function"||typeof _.postMessage=="object")&&!t.isKonqueror())})(lt)),lt.exports}var ut,Nr;function yn(){if(Nr)return ut;Nr=1;var s=A(),e=B().EventEmitter,t=bn(),r=V(),n=ge(),i=re(),o=ae(),a=function(){};function l(u,c,f){if(!l.enabled())throw new Error("Transport created when disabled");e.call(this);var g=this;this.origin=r.getOrigin(f),this.baseUrl=f,this.transUrl=c,this.transport=u,this.windowId=o.string(8);var k=r.addPath(f,"/iframe.html")+"#"+this.windowId;this.iframeObj=n.createIframe(k,function(N){g.emit("close",1006,"Unable to load an iframe ("+N+")"),g.close()}),this.onmessageCallback=this._message.bind(this),i.attachEvent("message",this.onmessageCallback)}return s(l,e),l.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){i.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch{}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},l.prototype._message=function(u){if(a("message",u.data),!r.isOriginEqual(u.origin,this.origin)){a("not same origin",u.origin,this.origin);return}var c;try{c=JSON.parse(u.data)}catch{a("bad json",u.data);return}if(c.windowId!==this.windowId){a("mismatched window id",c.windowId,this.windowId);return}switch(c.type){case"s":this.iframeObj.loaded(),this.postMessage("s",JSON.stringify([t,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",c.data);break;case"c":var f;try{f=JSON.parse(c.data)}catch{a("bad json",c.data);return}this.emit("close",f[0],f[1]),this.close();break}},l.prototype.postMessage=function(u,c){this.iframeObj.post(JSON.stringify({windowId:this.windowId,type:u,data:c||""}),this.origin)},l.prototype.send=function(u){this.postMessage("m",u)},l.enabled=function(){return n.iframeEnabled},l.transportName="iframe",l.roundTrips=2,ut=l,ut}var ht,Ar;function Ft(){return Ar||(Ar=1,ht={isObject:function(s){var e=typeof s;return e==="function"||e==="object"&&!!s},extend:function(s){if(!this.isObject(s))return s;for(var e,t,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(s[t]=e[t])}return s}}),ht}var dt,Lr;function ft(){if(Lr)return dt;Lr=1;var s=A(),e=yn(),t=Ft();return dt=function(r){function n(i,o){e.call(this,r.transportName,i,o)}return s(n,e),n.enabled=function(i,o){if(!_.document)return!1;var a=t.extend({},o);return a.sameOrigin=!0,r.enabled(a)&&e.enabled()}
9,n.transportName="iframe-"+r.transportName,n.needBody=!0,n.roundTrips=e.roundTrips+r.roundTrips-1,n.facadeTransport=r,n},dt}var pt,Ur;function fi(){if(Ur)return pt;Ur=1;var s=A(),e=ge(),t=V(),r=B().EventEmitter,n=ae(),i=function(){};function o(l){r.call(this);var u=this;e.polluteGlobalNamespace(),this.id="a"+n.string(6),l=t.addQuery(l,"c="+decodeURIComponent(e.WPrefix+"."+this.id)),i("using htmlfile",o.htmlfileEnabled);var c=o.htmlfileEnabled?e.createHtmlfile:e.createIframe;_[e.WPrefix][this.id]={start:function(){u.iframeObj.loaded()},message:function(f){u.emit("message",f)},stop:function(){u._cleanup(),u._close("network")}},this.iframeObj=c(l,function(){u._cleanup(),u._close("permanent")})}s(o,r),o.prototype.abort=function(){this._cleanup(),this._close("user")},o.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete _[e.WPrefix][this.id]},o.prototype._close=function(l){this.emit("close",null,l),this.removeAllListeners()},o.htmlfileEnabled=!1;var a=["Active"].concat("Object").join("X");if(a in _)try{o.htmlfileEnabled=!!new _[a]("htmlfile")}catch{}return o.enabled=o.htmlfileEnabled||e.iframeEnabled,pt=o,pt}var mt,qr;function Hr(){if(qr)return mt;qr=1;var s=A(),e=fi(),t=me(),r=ce();function n(i){if(!e.enabled)throw new Error("Transport created when disabled");r.call(this,i,"/htmlfile",e,t)}return s(n,r),n.enabled=function(i){return e.enabled&&i.sameOrigin},n.transportName="htmlfile",n.roundTrips=2,mt=n,mt}var vt,Dr;function Pr(){if(Dr)return vt;Dr=1;var s=A(),e=ce(),t=Re(),r=Oe(),n=me();function i(o){if(!n.enabled&&!r.enabled)throw new Error("Transport created when disabled");e.call(this,o,"/xhr",t,r)}return s(i,e),i.enabled=function(o){return o.nullOrigin?!1:n.enabled&&o.sameOrigin?!0:r.enabled},i.transportName="xhr-polling",i.roundTrips=2,vt=i,vt}var gt,jr;function pi(){if(jr)return gt;jr=1;var s=A(),e=ce(),t=vn(),r=Re(),n=$t();function i(o){if(!n.enabled)throw new Error("Transport created when disabled");e.call(this,o,"/xhr",r,n)}return s(i,e),i.enabled=t.enabled,i.transportName="xdr-polling",i.roundTrips=2,gt=i,gt}var bt,Br;function mi(){if(Br)return bt;Br=1;var s=ge(),e=ae(),t=ve(),r=V(),n=A(),i=B().EventEmitter,o=function(){};function a(l){var u=this;i.call(this),s.polluteGlobalNamespace(),this.id="a"+e.string(6);var c=r.addQuery(l,"c="+encodeURIComponent(s.WPrefix+"."+this.id));_[s.WPrefix][this.id]=this._callback.bind(this),this._createScript(c),this.timeoutId=setTimeout(function(){u._abort(new Error("JSONP script loaded abnormally (timeout)"))},a.timeout)}return n(a,i),a.prototype.abort=function(){if(_[s.WPrefix][this.id]){var l=new Error("JSONP user aborted read");l.code=1e3,this._abort(l)}},a.timeout=35e3,a.scriptErrorTimeout=1e3,a.prototype._callback=function(l){this._cleanup(),!this.aborting&&(l&&this.emit("message",l),this.emit("close",null,"network"),this.removeAllListeners())},a.prototype._abort=function(l){this._cleanup(),this.aborting=!0,this.emit("close",l.code,l.message),this.removeAllListeners()},a.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var l=this.script;l.parentNode.removeChild(l),l.onreadystatechange=l.onerror=l.onload=l.onclick=null,this.script=null}delete _[s.WPrefix][this.id]},a.prototype._scriptError=function(){var l=this;this.errorTimer||(this.errorTimer=setTimeout(function(){l.loadedOkay||l._abort(new Error("JSONP script loaded abnormally (onerror)"))},a.scriptErrorTimeout))},a.prototype._createScript=function(l){var u=this,c=this.script=_.document.createElement("script"),f;if(c.id="a"+e.string(8),c.src=l,c.type="text/javascript",c.charset="UTF-8",c.onerror=this._scriptError.bind(this),c.onload=function(){u._abort(new Error("JSONP script loaded abnormally (onload)"))},c.onreadystatechange=function(){if(o("onreadystatechange",c.readyState),/loaded|closed/.test(c.readyState)){if(c&&c.htmlFor&&c.onclick){u.loadedOkay=!0;try{c.onclick()}catch{}}c&&u._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},typeof c.async>"u"&&_.document.attachEvent)if(t.isOpera())f=this.script2=_.document.createElement("script"),f.text="try{var a = document.getElementById('"+c.id+"');
9 if(a)a.onerror();}catch(x){};",c.async=f.async=!1;else{try{c.htmlFor=c.id,c.event="onclick"}catch{}c.async=!0}typeof c.async<"u"&&(c.async=!0);var g=_.document.getElementsByTagName("head")[0];g.insertBefore(c,g.firstChild),f&&g.insertBefore(f,g.firstChild)},bt=a,bt}var yt,Wr;function vi(){if(Wr)return yt;Wr=1;var s=ae(),e=V(),t=function(){},r,n;function i(a){try{return _.document.createElement('<iframe name="'+a+'">')}catch{var l=_.document.createElement("iframe");return l.name=a,l}}function o(){r=_.document.createElement("form"),r.style.display="none",r.style.position="absolute",r.method="POST",r.enctype="application/x-www-form-urlencoded",r.acceptCharset="UTF-8",n=_.document.createElement("textarea"),n.name="d",r.appendChild(n),_.document.body.appendChild(r)}return yt=function(a,l,u){r||o();var c="a"+s.string(8);r.target=c,r.action=e.addQuery(e.addPath(a,"/jsonp_send"),"i="+c);var f=i(c);f.id=c,f.style.display="none",r.appendChild(f);try{n.value=l}catch{}r.submit();var g=function(k){f.onerror&&(f.onreadystatechange=f.onerror=f.onload=null,setTimeout(function(){f.parentNode.removeChild(f),f=null},500),n.value="",u(k))};return f.onerror=function(){g()},f.onload=function(){g()},f.onreadystatechange=function(k){t("onreadystatechange",c,f.readyState),f.readyState==="complete"&&g()},function(){g(new Error("Aborted"))}},yt}var _t,Mr;function gi(){if(Mr)return _t;Mr=1;var s=A(),e=pn(),t=mi(),r=vi();function n(i){if(!n.enabled())throw new Error("Transport created when disabled");e.call(this,i,"/jsonp",r,t)}return s(n,e),n.enabled=function(){return!!_.document},n.transportName="jsonp-polling",n.roundTrips=1,n.needBody=!0,_t=n,_t}var wt,Vr;function bi(){return Vr||(Vr=1,wt=[ci(),hi(),vn(),Tr(),ft()(Tr()),Hr(),ft()(Hr()),Pr(),pi(),ft()(Pr()),gi()]),wt}var $r={},Fr;function yi(){if(Fr)return $r;Fr=1;var s=Array.prototype,e=Object.prototype,t=Function.prototype,r=String.prototype,n=s.slice,i=e.toString,o=function(b){return e.toString.call(b)==="[object Function]"},a=function(d){return i.call(d)==="[object Array]"},l=function(d){return i.call(d)==="[object String]"},u=Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})(),c;u?c=function(b,d,w,I){!I&&d in b||Object.defineProperty(b,d,{configurable:!0,enumerable:!1,writable:!0,value:w})}:c=function(b,d,w,I){!I&&d in b||(b[d]=w)};var f=function(b,d,w){for(var I in d)e.hasOwnProperty.call(d,I)&&c(b,I,d[I],w)},g=function(b){if(b==null)throw new TypeError("can't convert "+b+" to object");return Object(b)};function k(b){var d=+b;return d!==d?d=0:d!==0&&d!==1/0&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d))),d}function N(b){return b>>>0}function T(){}f(t,{bind:function(d){var w=this;if(!o(w))throw new TypeError("Function.prototype.bind called on incompatible "+w);for(var I=n.call(arguments,1),O=function(){if(this instanceof q){var z=w.apply(this,I.concat(n.call(arguments)));return Object(z)===z?z:this}else return w.apply(d,I.concat(n.call(arguments)))},U=Math.max(0,w.length-I.length),E=[],M=0;M<U;M++)E.push("$"+M);var q=Function("binder","return function ("+E.join(",")+"){ return binder.apply(this, arguments); }")(O);return w.prototype&&(T.prototype=w.prototype,q.prototype=new T,T.prototype=null),q}}),f(Array,{isArray:a});var L=Object("a"),R=L[0]!=="a"||!(0 in L),m=function(d){var w=!0,I=!0;return d&&(d.call("foo",function(O,U,E){typeof E!="object"&&(w=!1)}),d.call([1],function(){I=typeof this=="string"},"x")),!!d&&w&&I};f(s,{forEach:function(d){var w=g(this),I=R&&l(this)?this.split(""):w,O=arguments[1],U=-1,E=I.length>>>0;if(!o(d))throw new TypeError;for(;++U<E;)U in I&&d.call(O,I[U],U,w)}},!m(s.forEach));var y=Array.prototype.indexOf&&[0,1].indexOf(1,2)!==-1;f(s,{indexOf:function(d){var w=R&&l(this)?this.split(""):g(this),I=w.length>>>0;if(!I)return-1;var O=0;for(arguments.length>1&&(O=k(arguments[1])),O=O>=0?O:Math.max(0,I+O);O<I;O++)if(O in w&&w[O]===d)return O;return-1}},y);var h=r.split;"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||"tesst".split(/(s)*/)[1]==="t"||"test".split(/(?:)/,-1).length!==4||"".split(/.?/).length||".".split(/()()/).length>1?(function(){var b=/()??/.exec("")[1]===void 0;r.split=function(d,w){var I=this;if(d===void 0&&w===0)return[];
9if(i.call(d)!=="[object RegExp]")return h.call(this,d,w);var O=[],U=(d.ignoreCase?"i":"")+(d.multiline?"m":"")+(d.extended?"x":"")+(d.sticky?"y":""),E=0,M,q,z,ne;for(d=new RegExp(d.source,U+"g"),I+="",b||(M=new RegExp("^"+d.source+"$(?!\\s)",U)),w=w===void 0?-1>>>0:N(w);(q=d.exec(I))&&(z=q.index+q[0].length,!(z>E&&(O.push(I.slice(E,q.index)),!b&&q.length>1&&q[0].replace(M,function(){for(var K=1;K<arguments.length-2;K++)arguments[K]===void 0&&(q[K]=void 0)}),q.length>1&&q.index<I.length&&s.push.apply(O,q.slice(1)),ne=q[0].length,E=z,O.length>=w)));)d.lastIndex===q.index&&d.lastIndex++;return E===I.length?(ne||!d.test(""))&&O.push(""):O.push(I.slice(E)),O.length>w?O.slice(0,w):O}})():"0".split(void 0,0).length&&(r.split=function(d,w){return d===void 0&&w===0?[]:h.call(this,d,w)});var p=r.substr,C="".substr&&"0b".substr(-1)!=="b";return f(r,{substr:function(d,w){return p.call(this,d<0&&(d=this.length+d)<0?0:d,w)}},C),$r}var St,Xr;function _i(){if(Xr)return St;Xr=1;var s=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,e,t=function(r){var n,i={},o=[];for(n=0;n<65536;n++)o.push(String.fromCharCode(n));return r.lastIndex=0,o.join("").replace(r,function(a){return i[a]="\\u"+("0000"+a.charCo
9deAt(0).toString(16)).slice(-4),""}),r.lastIndex=0,i};return St={quote:function(r){var n=JSON.stringify(r);return s.lastIndex=0,s.test(n)?(e||(e=t(s)),n.replace(s,function(i){return e[i]})):n}},St}var Et,Gr;function wi(){if(Gr)return Et;Gr=1;var s=function(){};return Et=function(e){return{filterToEnabled:function(t,r){var n={main:[],facade:[]};return t?typeof t=="string"&&(t=[t]):t=[],e.forEach(function(i){if(i&&!(i.transportName==="websocket"&&r.websocket===!1)){if(t.length&&t.indexOf(i.transportName)===-1){s("not in whitelist",i.transportName);return}i.enabled(r)?(s("enabled",i.transportName),n.main.push(i),i.facadeTransport&&n.facade.push(i.facadeTransport)):s("disabled",i.transportName)}}),n}}},Et}var xt,zr;function Si(){if(zr)return xt;zr=1;var s={};return["log","debug","warn"].forEach(function(e){var t;try{t=_.console&&_.console[e]&&_.console[e].apply}catch{}s[e]=t?function(){return _.console[e].apply(_.console,arguments)}:e==="log"?function(){}:s.log}),xt=s,xt}var Ct,Jr;function Xt(){if(Jr)return Ct;Jr=1;function s(e){this.type=e}return s.prototype.initEvent=function(e,t,r){return this.type=e,this.bubbles=t,this.cancelable=r,this.timeStamp=+new Date,this},s.prototype.stopPropagation=function(){},s.prototype.preventDefault=function(){},s.CAPTURING_PHASE=1,s.AT_TARGET=2,s.BUBBLING_PHASE=3,Ct=s,Ct}var kt,Kr;function _n(){return Kr||(Kr=1,kt=_.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""}),kt}var It,Yr;function Ei(){if(Yr)return It;Yr=1;var s=A(),e=Xt();function t(){e.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}return s(t,e),It=t,It}var Tt,Qr;function xi(){if(Qr)return Tt;Qr=1;var s=A(),e=Xt();function t(r){e.call(this),this.initEvent("message",!1,!1),this.data=r}return s(t,e),Tt=t,Tt}var Rt,Zr;function Ci(){if(Zr)return Rt;Zr=1;var s=B().EventEmitter,e=A();function t(){var r=this;s.call(this),this.to=setTimeout(function(){r.emit("finish",200,"{}")},t.timeout)}return e(t,s),t.prototype.close=function(){clearTimeout(this.to)},t.timeout=2e3,Rt=t,Rt}var Ot,en;function wn(){if(en)return Ot;en=1;var s=B().EventEmitter,e=A(),t=Ft();function r(n,i){s.call(this);var o=this,a=+new Date;this.xo=new i("GET",n),this.xo.once("finish",function(l,u){var c,f;if(l===200){if(f=+new Date-a,u)try{c=JSON.parse(u)}catch{}t.isObject(c)||(c={})}o.emit("finish",c,f),o.removeAllListeners()})}return e(r,s),r.prototype.close=function(){this.removeAllListeners(),this.xo.close()},Ot=r,Ot}var Nt,tn;function Sn(){if(tn)return Nt;tn=1;var s=A(),e=B().EventEmitter,t=me(),r=wn();function n(i){var o=this;e.call(this),this.ir=new r(i,t),this.ir.once("finish",function(a,l){o.ir=null,o.emit("message",JSON.stringify([a,l]))})}return s(n,e),n.transportName="iframe-info-receiver",n.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},Nt=n,Nt}var At,rn;function ki(){if(rn)return At;rn=1;var s=B().EventEmitter,e=A(),t=re(),r=yn(),n=Sn();function i(o,a){var l=this;s.call(this);var u=function(){var c=l.ifr=new r(n.transportName,a,o);c.once("message",function(f){if(f){var g;try{g=JSON.parse(f)}catch{l.emit("finish"),l.close();return}var k=g[0],N=g[1];l.emit("finish",k,N)}l.close()}),c.once("close",function(){l.emit("finish"),l.close()})};_.document.body?u():t.attachEvent("load",u)}return e(i,s),i.enabled=function(){return r.enabled()},i.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},At=i,At}var Lt,nn;function Ii(){if(nn)return Lt;nn=1;var s=B().EventEmitter,e=A(),t=V(),r=$t(),n=Oe(),i=me(),o=Ci(),a=ki(),l=wn();function u(c,f){var g=this;s.call(this),setTimeout(function(){g.doXhr(c,f)},0)}return e(u,s),u._getReceiver=function(c,f,g){return g.sameOrigin?new l(f,i):n.enabled?new l(f,n):r.enabled&&g.sameScheme?new l(f,r):a.enabled()?new a(c,f):new l(f,o)},u.prototype.doXhr=function(c,f){var g=this,k=t.addPath(c,"/info");this.xo=u._getReceiver(c,k,f),this.timeoutRef=setTimeout(function(){g._cleanup(!1),g.emit("finish")},u.timeout),this.xo.once("finish",function(N,T){g._cleanup(!0),g.emit("finish",N,T)})},u.prototype._cleanup=function(c){clearTimeout(this.timeoutRef),this.timeoutRef=null,!c&&this.xo&&this.xo.close(),this.xo=null},u.prototype.close=function(){this.removeAllListeners(),this._cleanup(!1)},u.timeout=8e3,Lt=u,Lt}var Ut,sn;function Ti(){if(sn)return Ut;sn=1;var s=ge();function e(t){this._transport=t,t.on("message",this._transportMessage.bind(this)),t.on("close",this._transportClose.bind(this))}return e.prototype._transportClose=function(t,r){s.postMessage("c",JSON.stringify([t,r]))},e.prototype._transportMessage=function(t){s.postMessage("t",t)},e.prototype._send=function(t){this._transport.send(t)},e.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},Ut=e,Ut}var qt,on;function Ri(){if(on)return qt;on=1;var s=V(),e=re(),t=Ti(),r=Sn(),n=ge(),i=_n(),o=function(){};return qt=function(a,l){var u={};l.forEach(function(f){f.facadeTransport&&(u[f.facadeTransport.transportName]=f.facadeTransport)}
9),u[r.transportName]=r;var c;a.bootstrap_iframe=function(){var f;n.currentWindowId=i.hash.slice(1);var g=function(k){if(k.source===parent&&(typeof c>"u"&&(c=k.origin),k.origin===c)){var N;try{N=JSON.parse(k.data)}catch{o("bad json",k.data);return}if(N.windowId===n.currentWindowId)switch(N.type){case"s":var T;try{T=JSON.parse(N.data)}catch{o("bad json",N.data);break}var L=T[0],R=T[1],m=T[2],y=T[3];if(L!==a.version)throw new Error('Incompatible SockJS! Main site uses: "'+L+'", the iframe: "'+a.version+'".');if(!s.isOriginEqual(m,i.href)||!s.isOriginEqual(y,i.href))throw new Error("Can't connect to different domain from within an iframe. ("+i.href+", "+m+", "+y+")");f=new t(new u[R](m,y));break;case"m":f._send(N.data);break;case"c":f&&f._close(),f=null;break}}};e.attachEvent("message",g),n.postMessage("s")}},qt}var Ht,an;function Oi(){if(an)return Ht;an=1,yi();var s=dn(),e=A(),t=ae(),r=_i(),n=V(),i=re(),o=wi(),a=Ft(),l=ve(),u=Si(),c=Xt(),f=fn(),g=_n(),k=Ei(),N=xi(),T=Ii(),L=function(){},R;function m(h,p,C){if(!(this instanceof m))return new m(h,p,C);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");f.call(this),this.readyState=m.CONNECTING,this.extensions="",this.protocol="",C=C||{},C.protocols_whitelist&&u.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=C.transports,this._transportOptions=C.transportOptions||{},this._timeout=C.timeout||0;var b=C.sessionId||8;if(typeof b=="function")this._generateSessionId=b;else if(typeof b=="number")this._generateSessionId=function(){return t.string(b)};else throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._server=C.server||t.numberString(1e3);var d=new s(h);if(!d.host||!d.protocol)throw new SyntaxError("The URL '"+h+"' is invalid");if(d.hash)throw new SyntaxError("The URL must not contain a fragment");if(d.protocol!=="http:"&&d.protocol!=="https:")throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+d.protocol+"' is not allowed.");var w=d.protocol==="https:";if(g.protocol==="https:"&&!w&&!n.isLoopbackAddr(d.hostname))throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");p?Array.isArray(p)||(p=[p]):p=[];var I=p.sort();I.forEach(function(U,E){if(!U)throw new SyntaxError("The protocols entry '"+U+"' is invalid.");if(E<I.length-1&&U===I[E+1])throw new SyntaxError("The protocols entry '"+U+"' is duplicated.")});var O=n.getOrigin(g.href);this._origin=O?O.toLowerCase():null,d.set("pathname",d.pathname.replace(/\/+$/,"")),this.url=d.href,L("using url",this.url),this._urlInfo={nullOrigin:!l.hasDomain(),sameOrigin:n.isOriginEqual(this.url,g.href),sameScheme:n.isSchemeEqual(this.url,g.href)},this._ir=new T(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}e(m,f);function y(h){return h===1e3||h>=3e3&&h<=4999}return m.prototype.close=function(h,p){if(h&&!y(h))throw new Error("InvalidAccessError: Invalid code");if(p&&p.length>123)throw new SyntaxError("reason argument has an invalid length");if(!(this.readyState===m.CLOSING||this.readyState===m.CLOSED)){var C=!0;this._close(h||1e3,p||"Normal closure",C)}},m.prototype.send=function(h){if(typeof h!="string"&&(h=""+h),this.readyState===m.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===m.OPEN&&this._transport.send(r.quote(h))},m.version=bn(),m.CONNECTING=0,m.OPEN=1,m.CLOSING=2,m.CLOSED=3,m.prototype._receiveInfo=function(h,p){if(this._ir=null,!h){this._close(1002,"Cannot connect to server");return}this._rto=this.countRTO(p),this._transUrl=h.base_url?h.base_url:this.url,h=a.extend(h,this._urlInfo);var C=R.filterToEnabled(this._transportsWhitelist,h);this._transports=C.main,L(this._transports.length+" enabled transports"),this._connect()},m.prototype._connect=function(){for(var h=this._transports.shift();h;h=this._transports.shift()){if(L("attempt",h.transportName),h.needBody&&(!_.document.body||typeof _.document.readyState<"u"&&_.document.readyState!=="complete"&&_.document.readyState!=="interactive")){this._transports.unshift(h),i.attachEvent("load",this._connect.bind(this));return}var p=Math.max(this._timeout,this._rto*h.roundTrips||5e3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),p);
9var C=n.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),b=this._transportOptions[h.transportName],d=new h(C,this._transUrl,b);d.on("message",this._transportMessage.bind(this)),d.once("close",this._transportClose.bind(this)),d.transportName=h.transportName,this._transport=d;return}this._close(2e3,"All transports failed",!1)},m.prototype._transportTimeout=function(){this.readyState===m.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},m.prototype._transportMessage=function(h){var p=this,C=h.slice(0,1),b=h.slice(1),d;switch(C){case"o":this._open();return;case"h":this.dispatchEvent(new c("heartbeat")),L("heartbeat",this.transport);return}if(b)try{d=JSON.parse(b)}catch{}if(!(typeof d>"u"))switch(C){case"a":Array.isArray(d)&&d.forEach(function(w){L("message",p.transport),p.dispatchEvent(new N(w))});break;case"m":L("message",this.transport),this.dispatchEvent(new N(d));break;case"c":Array.isArray(d)&&d.length===2&&this._close(d[0],d[1],!0);break}},m.prototype._transportClose=function(h,p){if(L("_transportClose",this.transport),this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),!y(h)&&h!==2e3&&this.readyState===m.CONNECTING){this._connect();return}this._close(h,p)},m.prototype._open=function(){L("_open",this._transport&&this._transport.transportName,this.readyState),this.readyState===m.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=m.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new c("open")),L("connected",this.transport)):this._close(1006,"Server lost session")},m.prototype._close=function(h,p,C){L("_close",this.transport,h,p,C,this.readyState);var b=!1;if(this._ir&&(b=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===m.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=m.CLOSING,setTimeout(function(){this.readyState=m.CLOSED,b&&this.dispatchEvent(new c("error"));var d=new k("close");d.wasClean=C||!1,d.code=h||1e3,d.reason=p,this.dispatchEvent(d),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},m.prototype.countRTO=function(h){return h>100?4*h:300+h},Ht=function(h){return R=o(h),Ri()(m,h),m},Ht}var Dt,cn;function Ni(){if(cn)return Dt;cn=1;var s=bi();return Dt=Oi()(s),"_sockjs_onload"in _&&setTimeout(_._sockjs_onload,1),Dt}var Ai=Ni();const Li=Wn(Ai),Ui=3e3,qi=2e3,Hi=5e3,Di=1e3,Pi=6e4,ji=10080*60*1e3,Bi="visitor_chat_csat_skipped:",Wi=8*1024*1024,Vt=400,Mi="image/png,image/jpeg,image/gif,image/webp,application/pdf";class Ie extends Error{status;constructor(e,t){super(e),this.name="AttachmentError",this.status=t}}const J=H(!1),Pt=H(""),ln=H(null);let ue=null;const jt=s=>s==="OPERATOR"||s==="AI_AUTO"||s==="CANNED"||s==="SYSTEM"?s:null,Bt=s=>{if(!Array.isArray(s))return;const e=s.filter(t=>typeof t=="string"&&t.length>0);return e.length?e:void 0},Vi="local-",Gt=()=>{const e=$n().public.apiUrl||"http://localhost:9099",t="visitor_chat_initialized",r=H(""),n=H([]),i=H(!1),o=H(""),a=H(""),l=H(""),u=H(0),c=H(null),f=H(null),g=H(null),k=H(null),N=H("ACTIVE"),T=H(!1);let L=!1,R=null,m=null,y=null,h=null,p=null,C=0,b=!1,d=0,w=0,I="",O=null,U=!1;const E=()=>{h&&(clearTimeout(h),h=null),f.value=null},M=v=>{switch(v?.type){case"TYPING":if(v.role!=="ADMIN")return;
9v.typing?(f.value={name:v.fromName||k.value||"Support"},h&&clearTimeout(h),h=setTimeout(()=>{f.value=null},Hi)):E();return;case"SEEN":v.role==="ADMIN"&&v.at&&(g.value=v.at);return;case"ASSIGNED":k.value=v.agentName||null;return;case"STATUS":(v.status==="ACTIVE"||v.status==="CLOSED"||v.status==="CONVERTED")&&(N.value=v.status,v.status==="ACTIVE"&&(T.value=!1));return}};let q=null;const z=v=>{q=v},ne=()=>{try{const v=localStorage.getItem("dash_auth");if(v)return JSON.parse(v).token||null}catch{}return null},K=()=>{const v=ne();return v?{"Content-Type":"application/json",Authorization:`Bearer ${v}`}:{"Content-Type":"application/json"}},Ne=async()=>{try{const v=await $fetch(`${e}/api/chats/availability`);v&&typeof v.online=="boolean"&&(ln.value={online:v.online,operators:Number.isFinite(v.operators)?v.operators:0})}catch{console.debug("[Visitor Chat] availability not fetched")}},En=()=>{ue||(Ne(),ue=Fn(()=>{document.visibilityState==="visible"&&Ne()},Pi))},xn=()=>{ue&&(clearInterval(ue),ue=null)},zt=()=>`${Bi}${r.value}`,Cn=()=>{if(!r.value)return!1;try{return sessionStorage.getItem(zt())==="1"}catch{return!1}},Jt=()=>{L||Cn()||(T.value=!0)},kn=v=>{if(!v||v.status!=="CLOSED"||!v.closedAt||v.csatRating!==null&&v.csatRating!==void 0)return;const S=qe(v.closedAt).getTime();Number.isNaN(S)||Date.now()-S>ji||Jt()},In=async(v,S="")=>{if(!r.value||!Number.isInteger(v)||v<1||v>5)return!1;try{return await $fetch(`${e}/api/chats/visitor/${r.value}/csat`,{method:"POST",headers:K(),body:{rating:v,comment:S.trim().slice(0,500)}}),L=!0,!0}catch(x){return console.warn("[Visitor Chat] CSAT not submitted:",x),!1}},Tn=(v="skip")=>{if(L=!0,T.value=!1,v==="skip"&&r.value)try{sessionStorage.setItem(zt(),"1")}catch{}},Kt=()=>{{const S=new URLSearchParams(window.location.search).get("session");let x=localStorage.getItem("visitor_chat_session");S?(x=S,localStorage.setItem("visitor_chat_session",x)):x||(x=crypto.randomUUID(),localStorage.setItem("visitor_chat_session",x)),r.value=x;const D=localStorage.getItem("visitor_auth_user");if(D)try{const Y=JSON.parse(D);o.value=`${Y.firstName||""} ${Y.lastName||""}`.trim(),a.value=Y.email||""}catch{}}},Yt=async v=>{r.value||Kt();try{const S=await $fetch(`${e}/api/chats/visitor/init`,{method:"POST",headers:K(),body:{sessionId:r.value,name:o.value,email:a.value,phone:l.value,currentPage:window.location.href,referrer:document.referrer,turnstileToken:v||""}});if(S.messages&&Array.isArray(S.messages)&&(n.value=S.messages.map(x=>{const D=x.fromAdmin?jt(x.origin):null;return{id:x.id,content:x.content,from:x.sender?.email||(D==="AI_AUTO"?"[email protected]":"Visitor"),fromName:x.fromAdmin?D==="AI_AUTO"?"CNM Assistant":"Support":o.value||"You",role:x.fromAdmin?"ADMIN":"VISITOR",timestamp:x.timestamp,origin:D,mediaUrls:Bt(x.mediaUrls)}})),g.value=S.adminLastReadAt||null,S.visitorLastReadAt){const x=qe(S.visitorLastReadAt).getTime();!Number.isNaN(x)&&x>w&&(w=x)}return(S.status==="ACTIVE"||S.status==="CLOSED"||S.status==="CONVERTED")&&(N.value=S.status),N.value==="ACTIVE"?T.value=!1:kn(S),k.value=S.assignedAdmin?.firstName||null,localStorage.setItem(t,"1"),S}catch(S){if(console.error("Failed to initialize chat:",S),S.statusCode===400)throw console.warn("[Visitor Chat] Bad request - clearing corrupted localStorage data"),localStorage.removeItem("visitor_chat_session"),localStorage.removeItem(t),localStorage.removeItem("visitor_chat_name"),localStorage.removeItem("visitor_chat_email"),localStorage.removeItem("visitor_chat_phone"),r.value=crypto.randomUUID(),localStorage.setItem("visitor_chat_session",r.value),o.value="",a.value="",l.value="",new Error("Session reset - please try again");if(S.statusCode===403&&S.data?.visitorName)throw new Error(S.data.visitorName);if(S.statusCode===422&&S.data?.visitorEmail)throw new Error(S.data.visitorEmail);if(S.statusCode===401){console.warn("[Visitor Chat] Session expired - clearing auth data"),localStorage.removeItem("dash_auth"),localStorage.removeItem("visitor_chat_session"),localStorage.removeItem(t),r.value=crypto.randomUUID(),localStorage.setItem("visitor_chat_session",r.value);const x=S.data?.visitorName||"Session expired. Please sign in to continue.";throw new Error(x)}throw S}},Qt=()=>{if(!r.value||R?.active)return;const v=new ni({webSocketFactory:()=>new Li(`${e}/ws`),beforeConnect:()=>{const S=ne();v.connectHeaders=S?{Authorization:`Bearer ${S}`}:{}},debug:S=>{console.log("[Visitor Chat WS]",S)},reconnectDelay:3e3,heartbeatIncoming:1e4,heartbeatOutgoing:1e4,onConnect:()=>{if(v!==R){v.deactivate();return}console.log("Visitor chat WebSocket connected"),i.value=!0,m=v.subscribe(`/topic/visitor/${r.value}`,S=>{try{const x=JSON.parse(S.body);if(console.log("[Visitor Chat] Message received:",x),x.type==="COMMAND"){console.log("[Visitor Chat] Command received:",x.action),c.value=x,q&&q(x),x.action==="OPEN_CHAT"?(J.value=!0,u.value=0):x.action==="CLOSE_CHAT"?(se(),J.value=!1):x.action==="REQUEST_CSAT"&&Jt();return}if(x.type!==void 0&&x.type!=="MESSAGE")return;const D=x.id;if(!n.value.some(Q=>Q.id===D)){const Q={id:D,content:x.content,from:x.from,fromName:x.fromName,role:x.role,timestamp:x.timestamp,origin:x.role==="ADMIN"?jt
9(x.origin):null,mediaUrls:Bt(x.mediaUrls)},Z=Q.role==="VISITOR"&&Q.mediaUrls?n.value.findIndex(ye=>ye.pending):-1;Z>=0?(be(n.value[Z]),n.value.splice(Z,1,Q)):n.value.push(Q)}x.role==="ADMIN"&&(E(),J.value||u.value++)}catch(x){console.error("Error parsing WebSocket message:",x)}}),y=v.subscribe(`/topic/visitor/${r.value}/events`,S=>{try{M(JSON.parse(S.body))}catch(x){console.error("Error parsing WebSocket event:",x)}}),U&&(U=!1,Le())},onStompError:S=>{console.error("STOMP error:",S),v===R&&(i.value=!1)},onWebSocketClose:()=>{console.log("WebSocket connection closed"),v===R&&(i.value=!1)},onWebSocketError:S=>{console.error("WebSocket error:",S),v===R&&(i.value=!1)}});R=v,v.activate()},Rn=v=>{if(!R||!i.value)return console.error("WebSocket not connected"),!1;try{return se(),R.publish({destination:`/app/visitor/${r.value}/message`,body:JSON.stringify({content:v,senderRole:"visitor",currentPage:window.location.href})}),!0}catch(S){return console.error("Error sending message:",S),!1}},be=v=>{if(v?.pending){for(const S of v.mediaUrls||[])if(S.startsWith("blob:"))try{URL.revokeObjectURL(S)}catch{}}},On=v=>{const S=v.fromAdmin?jt(v.origin):null;return{id:v.id,content:v.content??"",from:v.sender?.email||(S==="AI_AUTO"?"[email protected]":"Visitor"),fromName:v.fromAdmin?S==="AI_AUTO"?"CNM Assistant":"Support":o.value||"You",role:v.fromAdmin?"ADMIN":"VISITOR",timestamp:v.timestamp,origin:S,mediaUrls:Bt(v.mediaUrls)}},Nn=async(v,S="")=>{if(!r.value)throw new Ie("Chat is not ready yet",0);const x=S.trim();if(x.length>Vt)throw new Ie(`Captions are limited to ${Vt} characters`,400);se();const D=`${Vi}${crypto.randomUUID()}`,Y=URL.createObjectURL(v),Q={id:D,content:x,from:"Visitor",fromName:o.value||"You",role:"VISITOR",timestamp:new Date().toISOString().replace(/Z$/,""),origin:null,mediaUrls:[Y],pending:!0};n.value.push(Q);const Z=new FormData;Z.append("file",v,v.name),x&&Z.append("content",x),Z.append("currentPage",window.location.href);const ye=ne(),Bn=ye?{Authorization:`Bearer ${ye}`}:{};try{const $=await fetch(`${e}/api/chats/visitor/${r.value}/attachments`,{method:"POST",headers:Bn,body:Z});if(!$.ok){let G=null;try{G=await $.json()}catch{}throw Object.assign(new Error(`Upload failed (${$.status})`),{statusCode:$.status,data:G})}const le=await $.json(),F=On(le),ie=n.value.findIndex(G=>G.id===D),_e=n.value.some(G=>G.id===F.id&&!G.pending);ie>=0?(be(n.value[ie]),_e?n.value.splice(ie,1):n.value.splice(ie,1,F)):_e||n.value.push(F)}catch($){const le=n.value.findIndex(G=>G.id===D);if(le>=0)be(n.value[le]),n.value.splice(le,1);else try{URL.revokeObjectURL(Y)}catch{}const F=Number($?.statusCode??$?.status??0)||0,ie=typeof $?.data?.error=="string"?$.data.error:"",_e=F===413?"That file is larger than 8 MB":F===415?"Only images (PNG, JPG, GIF, WebP) and PDF":F===429?"Too many uploads — try again in a little while":F===503?"Storage is unavailable right now":F===0?"Upload failed — check your connection":"Upload failed";throw console.warn("[Visitor Chat] attachment not sent:",F,ie||$),new Ie(ie||_e,F)}},Ae=v=>{if(!R||!i.value||!r.value)return!1;try{return R.publish({destination:`/app/visitor/${r.value}/typing`,body:JSON.stringify({senderRole:"visitor",typing:v})}),!0}catch(S){return console.debug("[Visitor Chat] typing publish failed:",S),!1}},An=()=>{if(!i.value)return;const v=Date.now();(!b||v-C>=Ui)&&Ae(!0)&&(b=!0,C=v),p&&clearTimeout(p),p=setTimeout(se,qi)},se=()=>{p&&(clearTimeout(p),p=null),b&&(b=!1,Ae(!1))},Ln=()=>{let v=0;for(const S of n.value){if(S.role!=="ADMIN")continue;const x=qe(S.timestamp).getTime();!Number.isNaN(x)&&x>v&&(v=x)}return v},Le=()=>{if(!J.value)return;const v=Ln();if(v<=w)return;if(!R||!i.value){U=!0;return}const S=Date.now(),x=Di-(S-d);if(x>0){O||(O=setTimeout(()=>{O=null,Le()},x));return}try{R.publish({destination:`/app/visitor/${r.value}/seen`,body:"{}"}),d=S,w=v}catch(D){console.debug("[Visitor Chat] seen publish failed:",D)}},Un=(v,S,x="")=>{console.log("[Visitor Chat] Updating visitor info:",{name:v,email:S,phone:x}),o.value=v,a.value=S,l.value=x,localStorage.setItem("visitor_chat_name",v),localStorage.setItem("visitor_chat_email",S),x&&localStorage.setItem("visitor_chat_phone",x),console.log("[Visitor Chat] Visitor info saved to localStorage")},Zt=()=>{try{if(typeof window>"u"||typeof window.gtag!="function"||sessionStorage.getItem("cnm_chat_open_tracked"))return;sessionStorage.setItem("cnm_chat_open_tracked","true");const v=window.location.pathname.match(/^\/(?:buy-domain|checkout)\/([^/]+)/),S=v&&v[1].includes(".")?decode
9URIComponent(v[1]):null;window.gtag("event","chat_open",{page_path:window.location.pathname,...S?{domain_name:S}:{}})}catch(v){console.debug("GA4 chat_open failed:",v)}},qn=async(v,S)=>{J.value=!0,u.value=0,Zt(),S&&(Pt.value=S),i.value||(await Yt(v),Qt())},Hn=()=>{Pt.value=""},Dn=()=>{se(),J.value=!1},Ue=()=>{m&&(m.unsubscribe(),m=null),y&&(y.unsubscribe(),y=null),p&&(clearTimeout(p),p=null),O&&(clearTimeout(O),O=null),b=!1,U=!1,E(),R&&(R.deactivate(),R=null),i.value=!1},Pn=v=>{!r.value||!v||localStorage.getItem(t)!=="1"||v===I||!ne()||(I=v,$fetch(`${e}/api/chats/visitor/${r.value}/page`,{method:"POST",headers:K(),body:{path:v}}).catch(()=>{console.debug("[Visitor Chat] page view not reported")}))},jn=()=>{console.log("[Visitor Chat] Resetting chat state"),Ue(),r.value="",n.value.forEach(be),n.value=[],o.value="",a.value="",l.value="",u.value=0,J.value=!1,c.value=null,g.value=null,k.value=null,N.value="ACTIVE",T.value=!1,L=!1,w=0,d=0,I="",localStorage.removeItem("visitor_chat_session"),localStorage.removeItem(t),localStorage.removeItem("visitor_chat_name"),localStorage.removeItem("visitor_chat_email"),localStorage.removeItem("visitor_chat_phone")};return Mn(J,v=>{v?En():xn()},{immediate:!0}),Vn(()=>{Kt()}),hn(()=>{Ue()}),{sessionId:W(r),messages:W(n),isConnected:W(i),isOpen:J,pendingMessage:Pt,visitorName:o,visitorEmail:a,visitorPhone:l,unreadCount:W(u),lastCommand:W(c),agentTyping:W(f),adminLastReadAt:W(g),agentName:W(k),chatStatus:W(N),availability:W(ln),csatRequested:W(T),fetchAvailability:Ne,submitCsat:In,dismissCsat:Tn,initChat:Yt,connectWebSocket:Qt,sendMessage:Rn,sendAttachment:Nn,sendTyping:Ae,notifyTyping:An,stopTyping:se,markSeen:Le,reportPageView:Pn,updateVisitorInfo:Un,openChat:qn,closeChat:Dn,trackChatOpen:Zt,clearPendingMessage:Hn,disconnect:Ue,resetChat:jn,onCommand:z}},es=Object.freeze(Object.defineProperty({__proto__:null,ATTACHMENT_ACCEPT:Mi,ATTACHMENT_MAX_BYTES:Wi,ATTACHMENT_MAX_CAPTION:Vt,AttachmentError:Ie,useVisitorChat:Gt},Symbol.toStringTag,{value:"Module"})),$i={class:"min-h-screen bg-gray-50 dark:bg-gray-900"},Fi={class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16 sm:py-24"},Xi={class:"grid md:grid-cols-3 gap-8"},Gi={class:"bg-white dark:bg-gray-800 rounded-2xl p-8 border border-gray-200 dark:border-gray-700 text-center"},zi={class:"mt-12 text-center space-y-2"},Ji={class:"text-gray-600 dark:text-gray-400"},Ki={class:"text-gray-600 dark:text-gray-400"},Yi=Xn({__name:"support",setup(s){Gn({title:"Support - CNM.com",description:"Get help with your domain purchase. Contact our support team via live chat or email."}),zn({link:[{rel:"canonical",href:"https://cnm.com/support"}]});const{openChat:e}=Gt(),t=()=>{e()};return(r,n)=>{const i=Kn;return Yn(),Jn("div",$i,[P("div",Fi,[n[9]||(n[9]=P("div",{class:"text-center mb-12"},[P("h1",{class:"text-4xl sm:text-5xl font-bold text-gray-900 dark:text-white mb-4"}," How can we help? "),P("p",{class:"text-xl text-gray-600 dark:text-gray-400"}," Our team is here to assist you with any questions ")],-1)),P("div",Xi,[P("div",{class:"bg-white dark:bg-gray-800 rounded-2xl p-8 border border-gray-200 dark:border-gray-700 text-center"},[n[1]||(n[1]=He('<div class="w-16 h-16 mx-auto mb-6 rounded-full bg-cyan-100 dark:bg-cyan-900/30 flex items-center justify-center"><svg class="w-8 h-8 text-cyan-600 dark:text-cyan-400" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"></path></svg></div><h2 class="text-xl font-bold text-gray-900 dark:text-white mb-2">Live Chat</h2><p class="text-gray-600 dark:text-gray-400 mb-6"> Chat with our support team in real-time using the chat widget in the bottom right corner. </p>',3)),P("button",{onClick:t,class:"inline-flex items-center px-6 py-3 rounded-xl font-semibold text-white transition-all hover:opacity-90",style:{background:"linear-gradient(90deg, #37E6EF 0%, #31FFA9 100%)",color:"#1a202c"}},[...n[0]||(n[0]=[P("svg",{class:"w-5 h-5 mr-2",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},[P("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"})],-1),oe(" Start Chat ",-1)])])]),n[4]||(n[4]=He('<div class="bg-white dark:bg-gray-800 rounded-2xl p-8 border border-gray-200 dark:border-gray-700 text-center"><div class="w-16 h-16 mx-auto mb-6 rounded-full bg-amber-100 dar
9k:bg-amber-900/30 flex items-center justify-center"><svg class="w-8 h-8 text-amber-600 dark:text-amber-400" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"></path></svg></div><h2 class="text-xl font-bold text-gray-900 dark:text-white mb-2">Email Us</h2><p class="text-gray-600 dark:text-gray-400 mb-6"> Send us an email and we&#39;ll respond within a few hours during business days. </p><a class="inline-flex items-center px-6 py-3 rounded-xl font-semibold border-2 border-amber-500 text-amber-600 dark:text-amber-400 hover:bg-amber-500 hover:text-white transition-all" data-cnm-user="sales" data-cnm-domain="cnm.com" href="/support"><svg class="w-5 h-5 mr-2" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"></path></svg> [email protected] </a></div>',1)),P("div",Gi,[n[3]||(n[3]=He('<div class="w-16 h-16 mx-auto mb-6 rounded-full bg-violet-100 dark:bg-violet-900/30 flex items-center justify-center"><svg class="w-8 h-8 text-violet-600 dark:text-violet-400" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"></path></svg></div><h2 class="text-xl font-bold text-gray-900 dark:text-white mb-2">FAQ</h2><p class="text-gray-600 dark:text-gray-400 mb-6"> Find instant answers to common questions about buying, payment plans, escrow, and DNS. </p>',3)),De(i,{to:"/faq",class:"inline-flex items-center px-6 py-3 rounded-xl font-semibold border-2 border-violet-500 text-violet-600 dark:text-violet-400 hover:bg-violet-500 hover:text-white transition-all"},{default:Pe(()=>[...n[2]||(n[2]=[P("svg",{class:"w-5 h-5 mr-2",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},[P("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})],-1),oe(" Browse FAQ ",-1)])]),_:1})])]),P("div",zi,[P("p",Ji,[n[6]||(n[6]=oe(" Looking to buy a domain? ",-1)),De(i,{to:"/listings",class:"text-cyan-600 hover:text-cyan-700 font-medium"},{default:Pe(()=>[...n[5]||(n[5]=[oe(" Browse our marketplace → ",-1)])]),_:1})]),P("p",Ki,[n[8]||(n[8]=oe(" Review our policies? ",-1)),De(i,{to:"/legal/terms-of-service",class:"text-cyan-600 hover:text-cyan-700 font-medium"},{default:Pe(()=>[...n[7]||(n[7]=[oe(" Terms of Service → ",-1)])]),_:1})])])])])}}}),ts=Object.freeze(Object.defineProperty({__proto__:null,default:Yi},Symbol.toStringTag,{value:"Module"})),he=H(!1),Wt=H(""),un=H(!1),Mt="cnm_chat_nudge_dismissed",de="cnm_chat_nudge_shown_pages",rs=()=>{let s=null;const e=()=>sessionStorage.getItem(Mt)==="true",t=u=>{try{return JSON.parse(sessionStorage.getItem(de)||"[]").includes(u)}catch{return!1}return!1},r=u=>{try{const c=JSON.parse(sessionStorage.getItem(de)||"[]");c.includes(u)||(c.push(u),sessionStorage.setItem(de,JSON.stringify(c)))}catch{sessionStorage.setItem(de,JSON.stringify([u]))}},n=(u,c,f)=>{if(e()||t(u))return;i();const g=f??(u==="checkout"?45:60),k={hero:c?`👋 Questions about ${c}? We're here to help!`:"👋 Have questions about this domain? Chat with us!",checkout:c?`🤔 Need help completing your purchase of ${c}?`:"🤔 Need help completing your purchase? We can assist!"};Wt.value=k[u],s=setTimeout(()=>{const{isOpen:N}=Gt();!N.value&&!e()&&(he.value=!0,r(u))},g*1e3)},i=()=>{s&&(clearTimeout(s),s=null)},o=()=>{he.value=!1,un.value=!0,sessionStorage.setItem(Mt,"true"),i()},a=()=>{he.value=!1,i()},l=()=>{he.value=!1,un.value=!1,Wt.value="",sessionStorage.removeItem(Mt),sessionStorage.removeItem(de)};return hn(()=>{i()}),{showNudge:W(he),nudgeMessage:W(Wt),startTracking:n,stopTracking:i,dismissNudge:o,hideNudge:a,resetNudge:l}};
9export{Mi as A,rs as a,Vt as b,Wi as c,es as d,ts as s,Gt as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.