sockjs.js 113 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207
  1. /* sockjs-client v1.6.1 | http://sockjs.org | MIT license */
  2. !(function (e) {
  3. if ('object' == typeof exports && 'undefined' != typeof module) module.exports = e()
  4. else if ('function' == typeof define && define.amd) define([], e)
  5. else {
  6. ;('undefined' != typeof window
  7. ? window
  8. : 'undefined' != typeof global
  9. ? global
  10. : 'undefined' != typeof self
  11. ? self
  12. : this
  13. ).SockJS = e()
  14. }
  15. })(function () {
  16. return (function i(s, a, l) {
  17. function u(t, e) {
  18. if (!a[t]) {
  19. if (!s[t]) {
  20. var n = 'function' == typeof require && require
  21. if (!e && n) return n(t, !0)
  22. if (c) return c(t, !0)
  23. var r = new Error("Cannot find module '" + t + "'")
  24. throw ((r.code = 'MODULE_NOT_FOUND'), r)
  25. }
  26. var o = (a[t] = { exports: {} })
  27. s[t][0].call(
  28. o.exports,
  29. function (e) {
  30. return u(s[t][1][e] || e)
  31. },
  32. o,
  33. o.exports,
  34. i,
  35. s,
  36. a,
  37. l
  38. )
  39. }
  40. return a[t].exports
  41. }
  42. for (var c = 'function' == typeof require && require, e = 0; e < l.length; e++)
  43. u(l[e])
  44. return u
  45. })(
  46. {
  47. 1: [
  48. function (n, r, e) {
  49. ;(function (t) {
  50. ;(function () {
  51. var e = n('./transport-list')
  52. ;(r.exports = n('./main')(e)),
  53. '_sockjs_onload' in t && setTimeout(t._sockjs_onload, 1)
  54. }).call(this)
  55. }).call(
  56. this,
  57. 'undefined' != typeof global
  58. ? global
  59. : 'undefined' != typeof self
  60. ? self
  61. : 'undefined' != typeof window
  62. ? window
  63. : {}
  64. )
  65. },
  66. { './main': 14, './transport-list': 16 }
  67. ],
  68. 2: [
  69. function (e, t, n) {
  70. var r = e('inherits'),
  71. o = e('./event')
  72. function i() {
  73. o.call(this),
  74. this.initEvent('close', !1, !1),
  75. (this.wasClean = !1),
  76. (this.code = 0),
  77. (this.reason = '')
  78. }
  79. r(i, o), (t.exports = i)
  80. },
  81. { './event': 4, inherits: 54 }
  82. ],
  83. 3: [
  84. function (e, t, n) {
  85. var r = e('inherits'),
  86. o = e('./eventtarget')
  87. function i() {
  88. o.call(this)
  89. }
  90. r(i, o),
  91. (i.prototype.removeAllListeners = function (e) {
  92. e ? delete this._listeners[e] : (this._listeners = {})
  93. }),
  94. (i.prototype.once = function (t, n) {
  95. var r = this,
  96. o = !1
  97. this.on(t, function e() {
  98. r.removeListener(t, e), o || ((o = !0), n.apply(this, arguments))
  99. })
  100. }),
  101. (i.prototype.emit = function () {
  102. var e = arguments[0],
  103. t = this._listeners[e]
  104. if (t) {
  105. for (var n = arguments.length, r = new Array(n - 1), o = 1; o < n; o++)
  106. r[o - 1] = arguments[o]
  107. for (var i = 0; i < t.length; i++) t[i].apply(this, r)
  108. }
  109. }),
  110. (i.prototype.on = i.prototype.addListener = o.prototype.addEventListener),
  111. (i.prototype.removeListener = o.prototype.removeEventListener),
  112. (t.exports.EventEmitter = i)
  113. },
  114. { './eventtarget': 5, inherits: 54 }
  115. ],
  116. 4: [
  117. function (e, t, n) {
  118. function r(e) {
  119. this.type = e
  120. }
  121. ;(r.prototype.initEvent = function (e, t, n) {
  122. return (
  123. (this.type = e),
  124. (this.bubbles = t),
  125. (this.cancelable = n),
  126. (this.timeStamp = +new Date()),
  127. this
  128. )
  129. }),
  130. (r.prototype.stopPropagation = function () {}),
  131. (r.prototype.preventDefault = function () {}),
  132. (r.CAPTURING_PHASE = 1),
  133. (r.AT_TARGET = 2),
  134. (r.BUBBLING_PHASE = 3),
  135. (t.exports = r)
  136. },
  137. {}
  138. ],
  139. 5: [
  140. function (e, t, n) {
  141. function r() {
  142. this._listeners = {}
  143. }
  144. ;(r.prototype.addEventListener = function (e, t) {
  145. e in this._listeners || (this._listeners[e] = [])
  146. var n = this._listeners[e]
  147. ;-1 === n.indexOf(t) && (n = n.concat([t])), (this._listeners[e] = n)
  148. }),
  149. (r.prototype.removeEventListener = function (e, t) {
  150. var n = this._listeners[e]
  151. if (n) {
  152. var r = n.indexOf(t)
  153. ;-1 === r ||
  154. (1 < n.length
  155. ? (this._listeners[e] = n.slice(0, r).concat(n.slice(r + 1)))
  156. : delete this._listeners[e])
  157. }
  158. }),
  159. (r.prototype.dispatchEvent = function () {
  160. var e = arguments[0],
  161. t = e.type,
  162. n = 1 === arguments.length ? [e] : Array.apply(null, arguments)
  163. if ((this['on' + t] && this['on' + t].apply(this, n), t in this._listeners))
  164. for (var r = this._listeners[t], o = 0; o < r.length; o++)
  165. r[o].apply(this, n)
  166. }),
  167. (t.exports = r)
  168. },
  169. {}
  170. ],
  171. 6: [
  172. function (e, t, n) {
  173. var r = e('inherits'),
  174. o = e('./event')
  175. function i(e) {
  176. o.call(this), this.initEvent('message', !1, !1), (this.data = e)
  177. }
  178. r(i, o), (t.exports = i)
  179. },
  180. { './event': 4, inherits: 54 }
  181. ],
  182. 7: [
  183. function (e, t, n) {
  184. var r = e('./utils/iframe')
  185. function o(e) {
  186. ;(this._transport = e).on('message', this._transportMessage.bind(this)),
  187. e.on('close', this._transportClose.bind(this))
  188. }
  189. ;(o.prototype._transportClose = function (e, t) {
  190. r.postMessage('c', JSON.stringify([e, t]))
  191. }),
  192. (o.prototype._transportMessage = function (e) {
  193. r.postMessage('t', e)
  194. }),
  195. (o.prototype._send = function (e) {
  196. this._transport.send(e)
  197. }),
  198. (o.prototype._close = function () {
  199. this._transport.close(), this._transport.removeAllListeners()
  200. }),
  201. (t.exports = o)
  202. },
  203. { './utils/iframe': 47 }
  204. ],
  205. 8: [
  206. function (e, t, n) {
  207. var f = e('./utils/url'),
  208. r = e('./utils/event'),
  209. h = e('./facade'),
  210. o = e('./info-iframe-receiver'),
  211. d = e('./utils/iframe'),
  212. p = e('./location'),
  213. m = function () {}
  214. t.exports = function (l, e) {
  215. var u,
  216. c = {}
  217. e.forEach(function (e) {
  218. e.facadeTransport &&
  219. (c[e.facadeTransport.transportName] = e.facadeTransport)
  220. }),
  221. (c[o.transportName] = o),
  222. (l.bootstrap_iframe = function () {
  223. var a
  224. d.currentWindowId = p.hash.slice(1)
  225. r.attachEvent('message', function (t) {
  226. if (
  227. t.source === parent &&
  228. (void 0 === u && (u = t.origin), t.origin === u)
  229. ) {
  230. var n
  231. try {
  232. n = JSON.parse(t.data)
  233. } catch (e) {
  234. return void m('bad json', t.data)
  235. }
  236. if (n.windowId === d.currentWindowId)
  237. switch (n.type) {
  238. case 's':
  239. var e
  240. try {
  241. e = JSON.parse(n.data)
  242. } catch (e) {
  243. m('bad json', n.data)
  244. break
  245. }
  246. var r = e[0],
  247. o = e[1],
  248. i = e[2],
  249. s = e[3]
  250. if ((m(r, o, i, s), r !== l.version))
  251. throw new Error(
  252. 'Incompatible SockJS! Main site uses: "' +
  253. r +
  254. '", the iframe: "' +
  255. l.version +
  256. '".'
  257. )
  258. if (!f.isOriginEqual(i, p.href) || !f.isOriginEqual(s, p.href))
  259. throw new Error(
  260. "Can't connect to different domain from within an iframe. (" +
  261. p.href +
  262. ', ' +
  263. i +
  264. ', ' +
  265. s +
  266. ')'
  267. )
  268. a = new h(new c[o](i, s))
  269. break
  270. case 'm':
  271. a._send(n.data)
  272. break
  273. case 'c':
  274. a && a._close(), (a = null)
  275. }
  276. }
  277. }),
  278. d.postMessage('s')
  279. })
  280. }
  281. },
  282. {
  283. './facade': 7,
  284. './info-iframe-receiver': 10,
  285. './location': 13,
  286. './utils/event': 46,
  287. './utils/iframe': 47,
  288. './utils/url': 52,
  289. debug: void 0
  290. }
  291. ],
  292. 9: [
  293. function (e, t, n) {
  294. var r = e('events').EventEmitter,
  295. o = e('inherits'),
  296. s = e('./utils/object'),
  297. a = function () {}
  298. function i(e, t) {
  299. r.call(this)
  300. var o = this,
  301. i = +new Date()
  302. ;(this.xo = new t('GET', e)),
  303. this.xo.once('finish', function (e, t) {
  304. var n, r
  305. if (200 === e) {
  306. if (((r = +new Date() - i), t))
  307. try {
  308. n = JSON.parse(t)
  309. } catch (e) {
  310. a('bad json', t)
  311. }
  312. s.isObject(n) || (n = {})
  313. }
  314. o.emit('finish', n, r), o.removeAllListeners()
  315. })
  316. }
  317. o(i, r),
  318. (i.prototype.close = function () {
  319. this.removeAllListeners(), this.xo.close()
  320. }),
  321. (t.exports = i)
  322. },
  323. { './utils/object': 49, debug: void 0, events: 3, inherits: 54 }
  324. ],
  325. 10: [
  326. function (e, t, n) {
  327. var r = e('inherits'),
  328. o = e('events').EventEmitter,
  329. i = e('./transport/sender/xhr-local'),
  330. s = e('./info-ajax')
  331. function a(e) {
  332. var n = this
  333. o.call(this),
  334. (this.ir = new s(e, i)),
  335. this.ir.once('finish', function (e, t) {
  336. ;(n.ir = null), n.emit('message', JSON.stringify([e, t]))
  337. })
  338. }
  339. r(a, o),
  340. (a.transportName = 'iframe-info-receiver'),
  341. (a.prototype.close = function () {
  342. this.ir && (this.ir.close(), (this.ir = null)), this.removeAllListeners()
  343. }),
  344. (t.exports = a)
  345. },
  346. { './info-ajax': 9, './transport/sender/xhr-local': 37, events: 3, inherits: 54 }
  347. ],
  348. 11: [
  349. function (n, o, e) {
  350. ;(function (u) {
  351. ;(function () {
  352. var r = n('events').EventEmitter,
  353. e = n('inherits'),
  354. i = n('./utils/event'),
  355. s = n('./transport/iframe'),
  356. a = n('./info-iframe-receiver'),
  357. l = function () {}
  358. function t(t, n) {
  359. var o = this
  360. r.call(this)
  361. function e() {
  362. var e = (o.ifr = new s(a.transportName, n, t))
  363. e.once('message', function (t) {
  364. if (t) {
  365. var e
  366. try {
  367. e = JSON.parse(t)
  368. } catch (e) {
  369. return l('bad json', t), o.emit('finish'), void o.close()
  370. }
  371. var n = e[0],
  372. r = e[1]
  373. o.emit('finish', n, r)
  374. }
  375. o.close()
  376. }),
  377. e.once('close', function () {
  378. o.emit('finish'), o.close()
  379. })
  380. }
  381. u.document.body ? e() : i.attachEvent('load', e)
  382. }
  383. e(t, r),
  384. (t.enabled = function () {
  385. return s.enabled()
  386. }),
  387. (t.prototype.close = function () {
  388. this.ifr && this.ifr.close(),
  389. this.removeAllListeners(),
  390. (this.ifr = null)
  391. }),
  392. (o.exports = t)
  393. }).call(this)
  394. }).call(
  395. this,
  396. 'undefined' != typeof global
  397. ? global
  398. : 'undefined' != typeof self
  399. ? self
  400. : 'undefined' != typeof window
  401. ? window
  402. : {}
  403. )
  404. },
  405. {
  406. './info-iframe-receiver': 10,
  407. './transport/iframe': 22,
  408. './utils/event': 46,
  409. debug: void 0,
  410. events: 3,
  411. inherits: 54
  412. }
  413. ],
  414. 12: [
  415. function (e, t, n) {
  416. var r = e('events').EventEmitter,
  417. o = e('inherits'),
  418. i = e('./utils/url'),
  419. s = e('./transport/sender/xdr'),
  420. a = e('./transport/sender/xhr-cors'),
  421. l = e('./transport/sender/xhr-local'),
  422. u = e('./transport/sender/xhr-fake'),
  423. c = e('./info-iframe'),
  424. f = e('./info-ajax'),
  425. h = function () {}
  426. function d(e, t) {
  427. h(e)
  428. var n = this
  429. r.call(this),
  430. setTimeout(function () {
  431. n.doXhr(e, t)
  432. }, 0)
  433. }
  434. o(d, r),
  435. (d._getReceiver = function (e, t, n) {
  436. return n.sameOrigin
  437. ? new f(t, l)
  438. : a.enabled
  439. ? new f(t, a)
  440. : s.enabled && n.sameScheme
  441. ? new f(t, s)
  442. : c.enabled()
  443. ? new c(e, t)
  444. : new f(t, u)
  445. }),
  446. (d.prototype.doXhr = function (e, t) {
  447. var n = this,
  448. r = i.addPath(e, '/info')
  449. h('doXhr', r),
  450. (this.xo = d._getReceiver(e, r, t)),
  451. (this.timeoutRef = setTimeout(function () {
  452. h('timeout'), n._cleanup(!1), n.emit('finish')
  453. }, d.timeout)),
  454. this.xo.once('finish', function (e, t) {
  455. h('finish', e, t), n._cleanup(!0), n.emit('finish', e, t)
  456. })
  457. }),
  458. (d.prototype._cleanup = function (e) {
  459. h('_cleanup'),
  460. clearTimeout(this.timeoutRef),
  461. (this.timeoutRef = null),
  462. !e && this.xo && this.xo.close(),
  463. (this.xo = null)
  464. }),
  465. (d.prototype.close = function () {
  466. h('close'), this.removeAllListeners(), this._cleanup(!1)
  467. }),
  468. (d.timeout = 8e3),
  469. (t.exports = d)
  470. },
  471. {
  472. './info-ajax': 9,
  473. './info-iframe': 11,
  474. './transport/sender/xdr': 34,
  475. './transport/sender/xhr-cors': 35,
  476. './transport/sender/xhr-fake': 36,
  477. './transport/sender/xhr-local': 37,
  478. './utils/url': 52,
  479. debug: void 0,
  480. events: 3,
  481. inherits: 54
  482. }
  483. ],
  484. 13: [
  485. function (e, t, n) {
  486. ;(function (e) {
  487. ;(function () {
  488. t.exports = e.location || {
  489. origin: 'http://localhost:80',
  490. protocol: 'http:',
  491. host: 'localhost',
  492. port: 80,
  493. href: 'http://localhost/',
  494. hash: ''
  495. }
  496. }).call(this)
  497. }).call(
  498. this,
  499. 'undefined' != typeof global
  500. ? global
  501. : 'undefined' != typeof self
  502. ? self
  503. : 'undefined' != typeof window
  504. ? window
  505. : {}
  506. )
  507. },
  508. {}
  509. ],
  510. 14: [
  511. function (x, _, e) {
  512. ;(function (w) {
  513. ;(function () {
  514. x('./shims')
  515. var r,
  516. l = x('url-parse'),
  517. e = x('inherits'),
  518. u = x('./utils/random'),
  519. t = x('./utils/escape'),
  520. c = x('./utils/url'),
  521. i = x('./utils/event'),
  522. n = x('./utils/transport'),
  523. o = x('./utils/object'),
  524. f = x('./utils/browser'),
  525. h = x('./utils/log'),
  526. s = x('./event/event'),
  527. d = x('./event/eventtarget'),
  528. p = x('./location'),
  529. a = x('./event/close'),
  530. m = x('./event/trans-message'),
  531. v = x('./info-receiver'),
  532. b = function () {}
  533. function y(e, t, n) {
  534. if (!(this instanceof y)) return new y(e, t, n)
  535. if (arguments.length < 1)
  536. throw new TypeError(
  537. "Failed to construct 'SockJS: 1 argument required, but only 0 present"
  538. )
  539. d.call(this),
  540. (this.readyState = y.CONNECTING),
  541. (this.extensions = ''),
  542. (this.protocol = ''),
  543. (n = n || {}).protocols_whitelist &&
  544. h.warn(
  545. "'protocols_whitelist' is DEPRECATED. Use 'transports' instead."
  546. ),
  547. (this._transportsWhitelist = n.transports),
  548. (this._transportOptions = n.transportOptions || {}),
  549. (this._timeout = n.timeout || 0)
  550. var r = n.sessionId || 8
  551. if ('function' == typeof r) this._generateSessionId = r
  552. else {
  553. if ('number' != typeof r)
  554. throw new TypeError(
  555. 'If sessionId is used in the options, it needs to be a number or a function.'
  556. )
  557. this._generateSessionId = function () {
  558. return u.string(r)
  559. }
  560. }
  561. this._server = n.server || u.numberString(1e3)
  562. var o = new l(e)
  563. if (!o.host || !o.protocol)
  564. throw new SyntaxError("The URL '" + e + "' is invalid")
  565. if (o.hash) throw new SyntaxError('The URL must not contain a fragment')
  566. if ('http:' !== o.protocol && 'https:' !== o.protocol)
  567. throw new SyntaxError(
  568. "The URL's scheme must be either 'http:' or 'https:'. '" +
  569. o.protocol +
  570. "' is not allowed."
  571. )
  572. var i = 'https:' === o.protocol
  573. if ('https:' === p.protocol && !i && !c.isLoopbackAddr(o.hostname))
  574. throw new Error(
  575. 'SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS'
  576. )
  577. t ? Array.isArray(t) || (t = [t]) : (t = [])
  578. var s = t.sort()
  579. s.forEach(function (e, t) {
  580. if (!e)
  581. throw new SyntaxError("The protocols entry '" + e + "' is invalid.")
  582. if (t < s.length - 1 && e === s[t + 1])
  583. throw new SyntaxError(
  584. "The protocols entry '" + e + "' is duplicated."
  585. )
  586. })
  587. var a = c.getOrigin(p.href)
  588. ;(this._origin = a ? a.toLowerCase() : null),
  589. o.set('pathname', o.pathname.replace(/\/+$/, '')),
  590. (this.url = o.href),
  591. b('using url', this.url),
  592. (this._urlInfo = {
  593. nullOrigin: !f.hasDomain(),
  594. sameOrigin: c.isOriginEqual(this.url, p.href),
  595. sameScheme: c.isSchemeEqual(this.url, p.href)
  596. }),
  597. (this._ir = new v(this.url, this._urlInfo)),
  598. this._ir.once('finish', this._receiveInfo.bind(this))
  599. }
  600. function g(e) {
  601. return 1e3 === e || (3e3 <= e && e <= 4999)
  602. }
  603. e(y, d),
  604. (y.prototype.close = function (e, t) {
  605. if (e && !g(e)) throw new Error('InvalidAccessError: Invalid code')
  606. if (t && 123 < t.length)
  607. throw new SyntaxError('reason argument has an invalid length')
  608. if (this.readyState !== y.CLOSING && this.readyState !== y.CLOSED) {
  609. this._close(e || 1e3, t || 'Normal closure', !0)
  610. }
  611. }),
  612. (y.prototype.send = function (e) {
  613. if (
  614. ('string' != typeof e && (e = '' + e),
  615. this.readyState === y.CONNECTING)
  616. )
  617. throw new Error(
  618. 'InvalidStateError: The connection has not been established yet'
  619. )
  620. this.readyState === y.OPEN && this._transport.send(t.quote(e))
  621. }),
  622. (y.version = x('./version')),
  623. (y.CONNECTING = 0),
  624. (y.OPEN = 1),
  625. (y.CLOSING = 2),
  626. (y.CLOSED = 3),
  627. (y.prototype._receiveInfo = function (e, t) {
  628. if ((b('_receiveInfo', t), (this._ir = null), e)) {
  629. ;(this._rto = this.countRTO(t)),
  630. (this._transUrl = e.base_url ? e.base_url : this.url),
  631. (e = o.extend(e, this._urlInfo)),
  632. b('info', e)
  633. var n = r.filterToEnabled(this._transportsWhitelist, e)
  634. ;(this._transports = n.main),
  635. b(this._transports.length + ' enabled transports'),
  636. this._connect()
  637. } else this._close(1002, 'Cannot connect to server')
  638. }),
  639. (y.prototype._connect = function () {
  640. for (
  641. var e = this._transports.shift();
  642. e;
  643. e = this._transports.shift()
  644. ) {
  645. if (
  646. (b('attempt', e.transportName),
  647. e.needBody &&
  648. (!w.document.body ||
  649. (void 0 !== w.document.readyState &&
  650. 'complete' !== w.document.readyState &&
  651. 'interactive' !== w.document.readyState)))
  652. )
  653. return (
  654. b('waiting for body'),
  655. this._transports.unshift(e),
  656. void i.attachEvent('load', this._connect.bind(this))
  657. )
  658. var t = Math.max(this._timeout, this._rto * e.roundTrips || 5e3)
  659. ;(this._transportTimeoutId = setTimeout(
  660. this._transportTimeout.bind(this),
  661. t
  662. )),
  663. b('using timeout', t)
  664. var n = c.addPath(
  665. this._transUrl,
  666. '/' + this._server + '/' + this._generateSessionId()
  667. ),
  668. r = this._transportOptions[e.transportName]
  669. b('transport url', n)
  670. var o = new e(n, this._transUrl, r)
  671. return (
  672. o.on('message', this._transportMessage.bind(this)),
  673. o.once('close', this._transportClose.bind(this)),
  674. (o.transportName = e.transportName),
  675. void (this._transport = o)
  676. )
  677. }
  678. this._close(2e3, 'All transports failed', !1)
  679. }),
  680. (y.prototype._transportTimeout = function () {
  681. b('_transportTimeout'),
  682. this.readyState === y.CONNECTING &&
  683. (this._transport && this._transport.close(),
  684. this._transportClose(2007, 'Transport timed out'))
  685. }),
  686. (y.prototype._transportMessage = function (e) {
  687. b('_transportMessage', e)
  688. var t,
  689. n = this,
  690. r = e.slice(0, 1),
  691. o = e.slice(1)
  692. switch (r) {
  693. case 'o':
  694. return void this._open()
  695. case 'h':
  696. return (
  697. this.dispatchEvent(new s('heartbeat')),
  698. void b('heartbeat', this.transport)
  699. )
  700. }
  701. if (o)
  702. try {
  703. t = JSON.parse(o)
  704. } catch (e) {
  705. b('bad json', o)
  706. }
  707. if (void 0 !== t)
  708. switch (r) {
  709. case 'a':
  710. Array.isArray(t) &&
  711. t.forEach(function (e) {
  712. b('message', n.transport, e), n.dispatchEvent(new m(e))
  713. })
  714. break
  715. case 'm':
  716. b('message', this.transport, t), this.dispatchEvent(new m(t))
  717. break
  718. case 'c':
  719. Array.isArray(t) && 2 === t.length && this._close(t[0], t[1], !0)
  720. }
  721. else b('empty payload', o)
  722. }),
  723. (y.prototype._transportClose = function (e, t) {
  724. b('_transportClose', this.transport, e, t),
  725. this._transport &&
  726. (this._transport.removeAllListeners(),
  727. (this._transport = null),
  728. (this.transport = null)),
  729. g(e) || 2e3 === e || this.readyState !== y.CONNECTING
  730. ? this._close(e, t)
  731. : this._connect()
  732. }),
  733. (y.prototype._open = function () {
  734. b(
  735. '_open',
  736. this._transport && this._transport.transportName,
  737. this.readyState
  738. ),
  739. this.readyState === y.CONNECTING
  740. ? (this._transportTimeoutId &&
  741. (clearTimeout(this._transportTimeoutId),
  742. (this._transportTimeoutId = null)),
  743. (this.readyState = y.OPEN),
  744. (this.transport = this._transport.transportName),
  745. this.dispatchEvent(new s('open')),
  746. b('connected', this.transport))
  747. : this._close(1006, 'Server lost session')
  748. }),
  749. (y.prototype._close = function (t, n, r) {
  750. b('_close', this.transport, t, n, r, this.readyState)
  751. var o = !1
  752. if (
  753. (this._ir && ((o = !0), this._ir.close(), (this._ir = null)),
  754. this._transport &&
  755. (this._transport.close(),
  756. (this._transport = null),
  757. (this.transport = null)),
  758. this.readyState === y.CLOSED)
  759. )
  760. throw new Error('InvalidStateError: SockJS has already been closed')
  761. ;(this.readyState = y.CLOSING),
  762. setTimeout(
  763. function () {
  764. ;(this.readyState = y.CLOSED),
  765. o && this.dispatchEvent(new s('error'))
  766. var e = new a('close')
  767. ;(e.wasClean = r || !1),
  768. (e.code = t || 1e3),
  769. (e.reason = n),
  770. this.dispatchEvent(e),
  771. (this.onmessage = this.onclose = this.onerror = null),
  772. b('disconnected')
  773. }.bind(this),
  774. 0
  775. )
  776. }),
  777. (y.prototype.countRTO = function (e) {
  778. return 100 < e ? 4 * e : 300 + e
  779. }),
  780. (_.exports = function (e) {
  781. return (r = n(e)), x('./iframe-bootstrap')(y, e), y
  782. })
  783. }).call(this)
  784. }).call(
  785. this,
  786. 'undefined' != typeof global
  787. ? global
  788. : 'undefined' != typeof self
  789. ? self
  790. : 'undefined' != typeof window
  791. ? window
  792. : {}
  793. )
  794. },
  795. {
  796. './event/close': 2,
  797. './event/event': 4,
  798. './event/eventtarget': 5,
  799. './event/trans-message': 6,
  800. './iframe-bootstrap': 8,
  801. './info-receiver': 12,
  802. './location': 13,
  803. './shims': 15,
  804. './utils/browser': 44,
  805. './utils/escape': 45,
  806. './utils/event': 46,
  807. './utils/log': 48,
  808. './utils/object': 49,
  809. './utils/random': 50,
  810. './utils/transport': 51,
  811. './utils/url': 52,
  812. './version': 53,
  813. debug: void 0,
  814. inherits: 54,
  815. 'url-parse': 57
  816. }
  817. ],
  818. 15: [
  819. function (e, t, n) {
  820. function a(e) {
  821. return '[object Function]' === i.toString.call(e)
  822. }
  823. function l(e) {
  824. return '[object String]' === f.call(e)
  825. }
  826. var o,
  827. c = Array.prototype,
  828. i = Object.prototype,
  829. r = Function.prototype,
  830. s = String.prototype,
  831. u = c.slice,
  832. f = i.toString,
  833. h =
  834. Object.defineProperty &&
  835. (function () {
  836. try {
  837. return Object.defineProperty({}, 'x', {}), !0
  838. } catch (e) {
  839. return !1
  840. }
  841. })()
  842. o = h
  843. ? function (e, t, n, r) {
  844. ;(!r && t in e) ||
  845. Object.defineProperty(e, t, {
  846. configurable: !0,
  847. enumerable: !1,
  848. writable: !0,
  849. value: n
  850. })
  851. }
  852. : function (e, t, n, r) {
  853. ;(!r && t in e) || (e[t] = n)
  854. }
  855. function d(e, t, n) {
  856. for (var r in t) i.hasOwnProperty.call(t, r) && o(e, r, t[r], n)
  857. }
  858. function p(e) {
  859. if (null == e) throw new TypeError("can't convert " + e + ' to object')
  860. return Object(e)
  861. }
  862. function m() {}
  863. d(r, {
  864. bind: function (t) {
  865. var n = this
  866. if (!a(n))
  867. throw new TypeError('Function.prototype.bind called on incompatible ' + n)
  868. for (
  869. var r = u.call(arguments, 1),
  870. e = Math.max(0, n.length - r.length),
  871. o = [],
  872. i = 0;
  873. i < e;
  874. i++
  875. )
  876. o.push('$' + i)
  877. var s = Function(
  878. 'binder',
  879. 'return function (' +
  880. o.join(',') +
  881. '){ return binder.apply(this, arguments); }'
  882. )(function () {
  883. if (this instanceof s) {
  884. var e = n.apply(this, r.concat(u.call(arguments)))
  885. return Object(e) === e ? e : this
  886. }
  887. return n.apply(t, r.concat(u.call(arguments)))
  888. })
  889. return (
  890. n.prototype &&
  891. ((m.prototype = n.prototype),
  892. (s.prototype = new m()),
  893. (m.prototype = null)),
  894. s
  895. )
  896. }
  897. }),
  898. d(Array, {
  899. isArray: function (e) {
  900. return '[object Array]' === f.call(e)
  901. }
  902. })
  903. var v,
  904. b,
  905. y,
  906. g = Object('a'),
  907. w = 'a' !== g[0] || !(0 in g)
  908. d(
  909. c,
  910. {
  911. forEach: function (e, t) {
  912. var n = p(this),
  913. r = w && l(this) ? this.split('') : n,
  914. o = t,
  915. i = -1,
  916. s = r.length >>> 0
  917. if (!a(e)) throw new TypeError()
  918. for (; ++i < s; ) i in r && e.call(o, r[i], i, n)
  919. }
  920. },
  921. ((v = c.forEach),
  922. (y = b = !0),
  923. v &&
  924. (v.call('foo', function (e, t, n) {
  925. 'object' != typeof n && (b = !1)
  926. }),
  927. v.call(
  928. [1],
  929. function () {
  930. y = 'string' == typeof this
  931. },
  932. 'x'
  933. )),
  934. !(v && b && y))
  935. )
  936. var x = Array.prototype.indexOf && -1 !== [0, 1].indexOf(1, 2)
  937. d(
  938. c,
  939. {
  940. indexOf: function (e, t) {
  941. var n = w && l(this) ? this.split('') : p(this),
  942. r = n.length >>> 0
  943. if (!r) return -1
  944. var o = 0
  945. for (
  946. 1 < arguments.length &&
  947. (o = (function (e) {
  948. var t = +e
  949. return (
  950. t != t
  951. ? (t = 0)
  952. : 0 !== t &&
  953. t !== 1 / 0 &&
  954. t !== -1 / 0 &&
  955. (t = (0 < t || -1) * Math.floor(Math.abs(t))),
  956. t
  957. )
  958. })(t)),
  959. o = 0 <= o ? o : Math.max(0, r + o);
  960. o < r;
  961. o++
  962. )
  963. if (o in n && n[o] === e) return o
  964. return -1
  965. }
  966. },
  967. x
  968. )
  969. var _,
  970. E = s.split
  971. 2 !== 'ab'.split(/(?:ab)*/).length ||
  972. 4 !== '.'.split(/(.?)(.?)/).length ||
  973. 't' === 'tesst'.split(/(s)*/)[1] ||
  974. 4 !== 'test'.split(/(?:)/, -1).length ||
  975. ''.split(/.?/).length ||
  976. 1 < '.'.split(/()()/).length
  977. ? ((_ = void 0 === /()??/.exec('')[1]),
  978. (s.split = function (e, t) {
  979. var n = this
  980. if (void 0 === e && 0 === t) return []
  981. if ('[object RegExp]' !== f.call(e)) return E.call(this, e, t)
  982. var r,
  983. o,
  984. i,
  985. s,
  986. a = [],
  987. l =
  988. (e.ignoreCase ? 'i' : '') +
  989. (e.multiline ? 'm' : '') +
  990. (e.extended ? 'x' : '') +
  991. (e.sticky ? 'y' : ''),
  992. u = 0
  993. for (
  994. e = new RegExp(e.source, l + 'g'),
  995. n += '',
  996. _ || (r = new RegExp('^' + e.source + '$(?!\\s)', l)),
  997. t =
  998. void 0 === t
  999. ? -1 >>> 0
  1000. : (function (e) {
  1001. return e >>> 0
  1002. })(t);
  1003. (o = e.exec(n)) &&
  1004. !(
  1005. u < (i = o.index + o[0].length) &&
  1006. (a.push(n.slice(u, o.index)),
  1007. !_ &&
  1008. 1 < o.length &&
  1009. o[0].replace(r, function () {
  1010. for (var e = 1; e < arguments.length - 2; e++)
  1011. void 0 === arguments[e] && (o[e] = void 0)
  1012. }),
  1013. 1 < o.length && o.index < n.length && c.push.apply(a, o.slice(1)),
  1014. (s = o[0].length),
  1015. (u = i),
  1016. a.length >= t)
  1017. );
  1018. )
  1019. e.lastIndex === o.index && e.lastIndex++
  1020. return (
  1021. u === n.length ? (!s && e.test('')) || a.push('') : a.push(n.slice(u)),
  1022. a.length > t ? a.slice(0, t) : a
  1023. )
  1024. }))
  1025. : '0'.split(void 0, 0).length &&
  1026. (s.split = function (e, t) {
  1027. return void 0 === e && 0 === t ? [] : E.call(this, e, t)
  1028. })
  1029. var S = s.substr,
  1030. O = ''.substr && 'b' !== '0b'.substr(-1)
  1031. d(
  1032. s,
  1033. {
  1034. substr: function (e, t) {
  1035. return S.call(this, e < 0 && (e = this.length + e) < 0 ? 0 : e, t)
  1036. }
  1037. },
  1038. O
  1039. )
  1040. },
  1041. {}
  1042. ],
  1043. 16: [
  1044. function (e, t, n) {
  1045. t.exports = [
  1046. e('./transport/websocket'),
  1047. e('./transport/xhr-streaming'),
  1048. e('./transport/xdr-streaming'),
  1049. e('./transport/eventsource'),
  1050. e('./transport/lib/iframe-wrap')(e('./transport/eventsource')),
  1051. e('./transport/htmlfile'),
  1052. e('./transport/lib/iframe-wrap')(e('./transport/htmlfile')),
  1053. e('./transport/xhr-polling'),
  1054. e('./transport/xdr-polling'),
  1055. e('./transport/lib/iframe-wrap')(e('./transport/xhr-polling')),
  1056. e('./transport/jsonp-polling')
  1057. ]
  1058. },
  1059. {
  1060. './transport/eventsource': 20,
  1061. './transport/htmlfile': 21,
  1062. './transport/jsonp-polling': 23,
  1063. './transport/lib/iframe-wrap': 26,
  1064. './transport/websocket': 38,
  1065. './transport/xdr-polling': 39,
  1066. './transport/xdr-streaming': 40,
  1067. './transport/xhr-polling': 41,
  1068. './transport/xhr-streaming': 42
  1069. }
  1070. ],
  1071. 17: [
  1072. function (o, f, e) {
  1073. ;(function (r) {
  1074. ;(function () {
  1075. var i = o('events').EventEmitter,
  1076. e = o('inherits'),
  1077. s = o('../../utils/event'),
  1078. a = o('../../utils/url'),
  1079. l = r.XMLHttpRequest,
  1080. u = function () {}
  1081. function c(e, t, n, r) {
  1082. u(e, t)
  1083. var o = this
  1084. i.call(this),
  1085. setTimeout(function () {
  1086. o._start(e, t, n, r)
  1087. }, 0)
  1088. }
  1089. e(c, i),
  1090. (c.prototype._start = function (e, t, n, r) {
  1091. var o = this
  1092. try {
  1093. this.xhr = new l()
  1094. } catch (e) {}
  1095. if (!this.xhr)
  1096. return (
  1097. u('no xhr'),
  1098. this.emit('finish', 0, 'no xhr support'),
  1099. void this._cleanup()
  1100. )
  1101. ;(t = a.addQuery(t, 't=' + +new Date())),
  1102. (this.unloadRef = s.unloadAdd(function () {
  1103. u('unload cleanup'), o._cleanup(!0)
  1104. }))
  1105. try {
  1106. this.xhr.open(e, t, !0),
  1107. this.timeout &&
  1108. 'timeout' in this.xhr &&
  1109. ((this.xhr.timeout = this.timeout),
  1110. (this.xhr.ontimeout = function () {
  1111. u('xhr timeout'), o.emit('finish', 0, ''), o._cleanup(!1)
  1112. }))
  1113. } catch (e) {
  1114. return (
  1115. u('exception', e),
  1116. this.emit('finish', 0, ''),
  1117. void this._cleanup(!1)
  1118. )
  1119. }
  1120. if (
  1121. ((r && r.noCredentials) ||
  1122. !c.supportsCORS ||
  1123. (u('withCredentials'), (this.xhr.withCredentials = !0)),
  1124. r && r.headers)
  1125. )
  1126. for (var i in r.headers) this.xhr.setRequestHeader(i, r.headers[i])
  1127. this.xhr.onreadystatechange = function () {
  1128. if (o.xhr) {
  1129. var e,
  1130. t,
  1131. n = o.xhr
  1132. switch ((u('readyState', n.readyState), n.readyState)) {
  1133. case 3:
  1134. try {
  1135. ;(t = n.status), (e = n.responseText)
  1136. } catch (e) {}
  1137. u('status', t),
  1138. 1223 === t && (t = 204),
  1139. 200 === t &&
  1140. e &&
  1141. 0 < e.length &&
  1142. (u('chunk'), o.emit('chunk', t, e))
  1143. break
  1144. case 4:
  1145. ;(t = n.status),
  1146. u('status', t),
  1147. 1223 === t && (t = 204),
  1148. (12005 !== t && 12029 !== t) || (t = 0),
  1149. u('finish', t, n.responseText),
  1150. o.emit('finish', t, n.responseText),
  1151. o._cleanup(!1)
  1152. }
  1153. }
  1154. }
  1155. try {
  1156. o.xhr.send(n)
  1157. } catch (e) {
  1158. o.emit('finish', 0, ''), o._cleanup(!1)
  1159. }
  1160. }),
  1161. (c.prototype._cleanup = function (e) {
  1162. if ((u('cleanup'), this.xhr)) {
  1163. if (
  1164. (this.removeAllListeners(),
  1165. s.unloadDel(this.unloadRef),
  1166. (this.xhr.onreadystatechange = function () {}),
  1167. this.xhr.ontimeout && (this.xhr.ontimeout = null),
  1168. e)
  1169. )
  1170. try {
  1171. this.xhr.abort()
  1172. } catch (e) {}
  1173. this.unloadRef = this.xhr = null
  1174. }
  1175. }),
  1176. (c.prototype.close = function () {
  1177. u('close'), this._cleanup(!0)
  1178. }),
  1179. (c.enabled = !!l)
  1180. var t = ['Active'].concat('Object').join('X')
  1181. !c.enabled &&
  1182. t in r &&
  1183. (u('overriding xmlhttprequest'),
  1184. (c.enabled = !!new (l = function () {
  1185. try {
  1186. return new r[t]('Microsoft.XMLHTTP')
  1187. } catch (e) {
  1188. return null
  1189. }
  1190. })()))
  1191. var n = !1
  1192. try {
  1193. n = 'withCredentials' in new l()
  1194. } catch (e) {}
  1195. ;(c.supportsCORS = n), (f.exports = c)
  1196. }).call(this)
  1197. }).call(
  1198. this,
  1199. 'undefined' != typeof global
  1200. ? global
  1201. : 'undefined' != typeof self
  1202. ? self
  1203. : 'undefined' != typeof window
  1204. ? window
  1205. : {}
  1206. )
  1207. },
  1208. {
  1209. '../../utils/event': 46,
  1210. '../../utils/url': 52,
  1211. debug: void 0,
  1212. events: 3,
  1213. inherits: 54
  1214. }
  1215. ],
  1216. 18: [
  1217. function (e, t, n) {
  1218. ;(function (e) {
  1219. ;(function () {
  1220. t.exports = e.EventSource
  1221. }).call(this)
  1222. }).call(
  1223. this,
  1224. 'undefined' != typeof global
  1225. ? global
  1226. : 'undefined' != typeof self
  1227. ? self
  1228. : 'undefined' != typeof window
  1229. ? window
  1230. : {}
  1231. )
  1232. },
  1233. {}
  1234. ],
  1235. 19: [
  1236. function (e, n, t) {
  1237. ;(function (e) {
  1238. ;(function () {
  1239. var t = e.WebSocket || e.MozWebSocket
  1240. n.exports = t
  1241. ? function (e) {
  1242. return new t(e)
  1243. }
  1244. : void 0
  1245. }).call(this)
  1246. }).call(
  1247. this,
  1248. 'undefined' != typeof global
  1249. ? global
  1250. : 'undefined' != typeof self
  1251. ? self
  1252. : 'undefined' != typeof window
  1253. ? window
  1254. : {}
  1255. )
  1256. },
  1257. {}
  1258. ],
  1259. 20: [
  1260. function (e, t, n) {
  1261. var r = e('inherits'),
  1262. o = e('./lib/ajax-based'),
  1263. i = e('./receiver/eventsource'),
  1264. s = e('./sender/xhr-cors'),
  1265. a = e('eventsource')
  1266. function l(e) {
  1267. if (!l.enabled()) throw new Error('Transport created when disabled')
  1268. o.call(this, e, '/eventsource', i, s)
  1269. }
  1270. r(l, o),
  1271. (l.enabled = function () {
  1272. return !!a
  1273. }),
  1274. (l.transportName = 'eventsource'),
  1275. (l.roundTrips = 2),
  1276. (t.exports = l)
  1277. },
  1278. {
  1279. './lib/ajax-based': 24,
  1280. './receiver/eventsource': 29,
  1281. './sender/xhr-cors': 35,
  1282. eventsource: 18,
  1283. inherits: 54
  1284. }
  1285. ],
  1286. 21: [
  1287. function (e, t, n) {
  1288. var r = e('inherits'),
  1289. o = e('./receiver/htmlfile'),
  1290. i = e('./sender/xhr-local'),
  1291. s = e('./lib/ajax-based')
  1292. function a(e) {
  1293. if (!o.enabled) throw new Error('Transport created when disabled')
  1294. s.call(this, e, '/htmlfile', o, i)
  1295. }
  1296. r(a, s),
  1297. (a.enabled = function (e) {
  1298. return o.enabled && e.sameOrigin
  1299. }),
  1300. (a.transportName = 'htmlfile'),
  1301. (a.roundTrips = 2),
  1302. (t.exports = a)
  1303. },
  1304. {
  1305. './lib/ajax-based': 24,
  1306. './receiver/htmlfile': 30,
  1307. './sender/xhr-local': 37,
  1308. inherits: 54
  1309. }
  1310. ],
  1311. 22: [
  1312. function (e, t, n) {
  1313. var r = e('inherits'),
  1314. i = e('events').EventEmitter,
  1315. o = e('../version'),
  1316. s = e('../utils/url'),
  1317. a = e('../utils/iframe'),
  1318. l = e('../utils/event'),
  1319. u = e('../utils/random'),
  1320. c = function () {}
  1321. function f(e, t, n) {
  1322. if (!f.enabled()) throw new Error('Transport created when disabled')
  1323. i.call(this)
  1324. var r = this
  1325. ;(this.origin = s.getOrigin(n)),
  1326. (this.baseUrl = n),
  1327. (this.transUrl = t),
  1328. (this.transport = e),
  1329. (this.windowId = u.string(8))
  1330. var o = s.addPath(n, '/iframe.html') + '#' + this.windowId
  1331. c(e, t, o),
  1332. (this.iframeObj = a.createIframe(o, function (e) {
  1333. c('err callback'),
  1334. r.emit('close', 1006, 'Unable to load an iframe (' + e + ')'),
  1335. r.close()
  1336. })),
  1337. (this.onmessageCallback = this._message.bind(this)),
  1338. l.attachEvent('message', this.onmessageCallback)
  1339. }
  1340. r(f, i),
  1341. (f.prototype.close = function () {
  1342. if ((c('close'), this.removeAllListeners(), this.iframeObj)) {
  1343. l.detachEvent('message', this.onmessageCallback)
  1344. try {
  1345. this.postMessage('c')
  1346. } catch (e) {}
  1347. this.iframeObj.cleanup(),
  1348. (this.iframeObj = null),
  1349. (this.onmessageCallback = this.iframeObj = null)
  1350. }
  1351. }),
  1352. (f.prototype._message = function (t) {
  1353. if ((c('message', t.data), s.isOriginEqual(t.origin, this.origin))) {
  1354. var n
  1355. try {
  1356. n = JSON.parse(t.data)
  1357. } catch (e) {
  1358. return void c('bad json', t.data)
  1359. }
  1360. if (n.windowId === this.windowId)
  1361. switch (n.type) {
  1362. case 's':
  1363. this.iframeObj.loaded(),
  1364. this.postMessage(
  1365. 's',
  1366. JSON.stringify([o, this.transport, this.transUrl, this.baseUrl])
  1367. )
  1368. break
  1369. case 't':
  1370. this.emit('message', n.data)
  1371. break
  1372. case 'c':
  1373. var e
  1374. try {
  1375. e = JSON.parse(n.data)
  1376. } catch (e) {
  1377. return void c('bad json', n.data)
  1378. }
  1379. this.emit('close', e[0], e[1]), this.close()
  1380. }
  1381. else c('mismatched window id', n.windowId, this.windowId)
  1382. } else c('not same origin', t.origin, this.origin)
  1383. }),
  1384. (f.prototype.postMessage = function (e, t) {
  1385. c('postMessage', e, t),
  1386. this.iframeObj.post(
  1387. JSON.stringify({ windowId: this.windowId, type: e, data: t || '' }),
  1388. this.origin
  1389. )
  1390. }),
  1391. (f.prototype.send = function (e) {
  1392. c('send', e), this.postMessage('m', e)
  1393. }),
  1394. (f.enabled = function () {
  1395. return a.iframeEnabled
  1396. }),
  1397. (f.transportName = 'iframe'),
  1398. (f.roundTrips = 2),
  1399. (t.exports = f)
  1400. },
  1401. {
  1402. '../utils/event': 46,
  1403. '../utils/iframe': 47,
  1404. '../utils/random': 50,
  1405. '../utils/url': 52,
  1406. '../version': 53,
  1407. debug: void 0,
  1408. events: 3,
  1409. inherits: 54
  1410. }
  1411. ],
  1412. 23: [
  1413. function (s, a, e) {
  1414. ;(function (i) {
  1415. ;(function () {
  1416. var e = s('inherits'),
  1417. t = s('./lib/sender-receiver'),
  1418. n = s('./receiver/jsonp'),
  1419. r = s('./sender/jsonp')
  1420. function o(e) {
  1421. if (!o.enabled()) throw new Error('Transport created when disabled')
  1422. t.call(this, e, '/jsonp', r, n)
  1423. }
  1424. e(o, t),
  1425. (o.enabled = function () {
  1426. return !!i.document
  1427. }),
  1428. (o.transportName = 'jsonp-polling'),
  1429. (o.roundTrips = 1),
  1430. (o.needBody = !0),
  1431. (a.exports = o)
  1432. }).call(this)
  1433. }).call(
  1434. this,
  1435. 'undefined' != typeof global
  1436. ? global
  1437. : 'undefined' != typeof self
  1438. ? self
  1439. : 'undefined' != typeof window
  1440. ? window
  1441. : {}
  1442. )
  1443. },
  1444. {
  1445. './lib/sender-receiver': 28,
  1446. './receiver/jsonp': 31,
  1447. './sender/jsonp': 33,
  1448. inherits: 54
  1449. }
  1450. ],
  1451. 24: [
  1452. function (e, t, n) {
  1453. var r = e('inherits'),
  1454. a = e('../../utils/url'),
  1455. o = e('./sender-receiver'),
  1456. l = function () {}
  1457. function i(e, t, n, r) {
  1458. o.call(
  1459. this,
  1460. e,
  1461. t,
  1462. (function (s) {
  1463. return function (e, t, n) {
  1464. l('create ajax sender', e, t)
  1465. var r = {}
  1466. 'string' == typeof t && (r.headers = { 'Content-type': 'text/plain' })
  1467. var o = a.addPath(e, '/xhr_send'),
  1468. i = new s('POST', o, t, r)
  1469. return (
  1470. i.once('finish', function (e) {
  1471. if ((l('finish', e), (i = null), 200 !== e && 204 !== e))
  1472. return n(new Error('http status ' + e))
  1473. n()
  1474. }),
  1475. function () {
  1476. l('abort'), i.close(), (i = null)
  1477. var e = new Error('Aborted')
  1478. ;(e.code = 1e3), n(e)
  1479. }
  1480. )
  1481. }
  1482. })(r),
  1483. n,
  1484. r
  1485. )
  1486. }
  1487. r(i, o), (t.exports = i)
  1488. },
  1489. { '../../utils/url': 52, './sender-receiver': 28, debug: void 0, inherits: 54 }
  1490. ],
  1491. 25: [
  1492. function (e, t, n) {
  1493. var r = e('inherits'),
  1494. o = e('events').EventEmitter,
  1495. i = function () {}
  1496. function s(e, t) {
  1497. i(e), o.call(this), (this.sendBuffer = []), (this.sender = t), (this.url = e)
  1498. }
  1499. r(s, o),
  1500. (s.prototype.send = function (e) {
  1501. i('send', e), this.sendBuffer.push(e), this.sendStop || this.sendSchedule()
  1502. }),
  1503. (s.prototype.sendScheduleWait = function () {
  1504. i('sendScheduleWait')
  1505. var e,
  1506. t = this
  1507. ;(this.sendStop = function () {
  1508. i('sendStop'), (t.sendStop = null), clearTimeout(e)
  1509. }),
  1510. (e = setTimeout(function () {
  1511. i('timeout'), (t.sendStop = null), t.sendSchedule()
  1512. }, 25))
  1513. }),
  1514. (s.prototype.sendSchedule = function () {
  1515. i('sendSchedule', this.sendBuffer.length)
  1516. var t = this
  1517. if (0 < this.sendBuffer.length) {
  1518. var e = '[' + this.sendBuffer.join(',') + ']'
  1519. ;(this.sendStop = this.sender(this.url, e, function (e) {
  1520. ;(t.sendStop = null),
  1521. e
  1522. ? (i('error', e),
  1523. t.emit('close', e.code || 1006, 'Sending error: ' + e),
  1524. t.close())
  1525. : t.sendScheduleWait()
  1526. })),
  1527. (this.sendBuffer = [])
  1528. }
  1529. }),
  1530. (s.prototype._cleanup = function () {
  1531. i('_cleanup'), this.removeAllListeners()
  1532. }),
  1533. (s.prototype.close = function () {
  1534. i('close'),
  1535. this._cleanup(),
  1536. this.sendStop && (this.sendStop(), (this.sendStop = null))
  1537. }),
  1538. (t.exports = s)
  1539. },
  1540. { debug: void 0, events: 3, inherits: 54 }
  1541. ],
  1542. 26: [
  1543. function (e, n, t) {
  1544. ;(function (s) {
  1545. ;(function () {
  1546. var t = e('inherits'),
  1547. o = e('../iframe'),
  1548. i = e('../../utils/object')
  1549. n.exports = function (r) {
  1550. function e(e, t) {
  1551. o.call(this, r.transportName, e, t)
  1552. }
  1553. return (
  1554. t(e, o),
  1555. (e.enabled = function (e, t) {
  1556. if (!s.document) return !1
  1557. var n = i.extend({}, t)
  1558. return (n.sameOrigin = !0), r.enabled(n) && o.enabled()
  1559. }),
  1560. (e.transportName = 'iframe-' + r.transportName),
  1561. (e.needBody = !0),
  1562. (e.roundTrips = o.roundTrips + r.roundTrips - 1),
  1563. (e.facadeTransport = r),
  1564. e
  1565. )
  1566. }
  1567. }).call(this)
  1568. }).call(
  1569. this,
  1570. 'undefined' != typeof global
  1571. ? global
  1572. : 'undefined' != typeof self
  1573. ? self
  1574. : 'undefined' != typeof window
  1575. ? window
  1576. : {}
  1577. )
  1578. },
  1579. { '../../utils/object': 49, '../iframe': 22, inherits: 54 }
  1580. ],
  1581. 27: [
  1582. function (e, t, n) {
  1583. var r = e('inherits'),
  1584. o = e('events').EventEmitter,
  1585. i = function () {}
  1586. function s(e, t, n) {
  1587. i(t),
  1588. o.call(this),
  1589. (this.Receiver = e),
  1590. (this.receiveUrl = t),
  1591. (this.AjaxObject = n),
  1592. this._scheduleReceiver()
  1593. }
  1594. r(s, o),
  1595. (s.prototype._scheduleReceiver = function () {
  1596. i('_scheduleReceiver')
  1597. var n = this,
  1598. r = (this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject))
  1599. r.on('message', function (e) {
  1600. i('message', e), n.emit('message', e)
  1601. }),
  1602. r.once('close', function (e, t) {
  1603. i('close', e, t, n.pollIsClosing),
  1604. (n.poll = r = null),
  1605. n.pollIsClosing ||
  1606. ('network' === t
  1607. ? n._scheduleReceiver()
  1608. : (n.emit('close', e || 1006, t), n.removeAllListeners()))
  1609. })
  1610. }),
  1611. (s.prototype.abort = function () {
  1612. i('abort'),
  1613. this.removeAllListeners(),
  1614. (this.pollIsClosing = !0),
  1615. this.poll && this.poll.abort()
  1616. }),
  1617. (t.exports = s)
  1618. },
  1619. { debug: void 0, events: 3, inherits: 54 }
  1620. ],
  1621. 28: [
  1622. function (e, t, n) {
  1623. var r = e('inherits'),
  1624. a = e('../../utils/url'),
  1625. l = e('./buffered-sender'),
  1626. u = e('./polling'),
  1627. c = function () {}
  1628. function o(e, t, n, r, o) {
  1629. var i = a.addPath(e, t)
  1630. c(i)
  1631. var s = this
  1632. l.call(this, e, n),
  1633. (this.poll = new u(r, i, o)),
  1634. this.poll.on('message', function (e) {
  1635. c('poll message', e), s.emit('message', e)
  1636. }),
  1637. this.poll.once('close', function (e, t) {
  1638. c('poll close', e, t), (s.poll = null), s.emit('close', e, t), s.close()
  1639. })
  1640. }
  1641. r(o, l),
  1642. (o.prototype.close = function () {
  1643. l.prototype.close.call(this),
  1644. c('close'),
  1645. this.removeAllListeners(),
  1646. this.poll && (this.poll.abort(), (this.poll = null))
  1647. }),
  1648. (t.exports = o)
  1649. },
  1650. {
  1651. '../../utils/url': 52,
  1652. './buffered-sender': 25,
  1653. './polling': 27,
  1654. debug: void 0,
  1655. inherits: 54
  1656. }
  1657. ],
  1658. 29: [
  1659. function (e, t, n) {
  1660. var r = e('inherits'),
  1661. o = e('events').EventEmitter,
  1662. i = e('eventsource'),
  1663. s = function () {}
  1664. function a(e) {
  1665. s(e), o.call(this)
  1666. var n = this,
  1667. r = (this.es = new i(e))
  1668. ;(r.onmessage = function (e) {
  1669. s('message', e.data), n.emit('message', decodeURI(e.data))
  1670. }),
  1671. (r.onerror = function (e) {
  1672. s('error', r.readyState, e)
  1673. var t = 2 !== r.readyState ? 'network' : 'permanent'
  1674. n._cleanup(), n._close(t)
  1675. })
  1676. }
  1677. r(a, o),
  1678. (a.prototype.abort = function () {
  1679. s('abort'), this._cleanup(), this._close('user')
  1680. }),
  1681. (a.prototype._cleanup = function () {
  1682. s('cleanup')
  1683. var e = this.es
  1684. e && ((e.onmessage = e.onerror = null), e.close(), (this.es = null))
  1685. }),
  1686. (a.prototype._close = function (e) {
  1687. s('close', e)
  1688. var t = this
  1689. setTimeout(function () {
  1690. t.emit('close', null, e), t.removeAllListeners()
  1691. }, 200)
  1692. }),
  1693. (t.exports = a)
  1694. },
  1695. { debug: void 0, events: 3, eventsource: 18, inherits: 54 }
  1696. ],
  1697. 30: [
  1698. function (n, c, e) {
  1699. ;(function (u) {
  1700. ;(function () {
  1701. var e = n('inherits'),
  1702. r = n('../../utils/iframe'),
  1703. o = n('../../utils/url'),
  1704. i = n('events').EventEmitter,
  1705. s = n('../../utils/random'),
  1706. a = function () {}
  1707. function l(e) {
  1708. a(e), i.call(this)
  1709. var t = this
  1710. r.polluteGlobalNamespace(),
  1711. (this.id = 'a' + s.string(6)),
  1712. (e = o.addQuery(
  1713. e,
  1714. 'c=' + decodeURIComponent(r.WPrefix + '.' + this.id)
  1715. )),
  1716. a('using htmlfile', l.htmlfileEnabled)
  1717. var n = l.htmlfileEnabled ? r.createHtmlfile : r.createIframe
  1718. ;(u[r.WPrefix][this.id] = {
  1719. start: function () {
  1720. a('start'), t.iframeObj.loaded()
  1721. },
  1722. message: function (e) {
  1723. a('message', e), t.emit('message', e)
  1724. },
  1725. stop: function () {
  1726. a('stop'), t._cleanup(), t._close('network')
  1727. }
  1728. }),
  1729. (this.iframeObj = n(e, function () {
  1730. a('callback'), t._cleanup(), t._close('permanent')
  1731. }))
  1732. }
  1733. e(l, i),
  1734. (l.prototype.abort = function () {
  1735. a('abort'), this._cleanup(), this._close('user')
  1736. }),
  1737. (l.prototype._cleanup = function () {
  1738. a('_cleanup'),
  1739. this.iframeObj && (this.iframeObj.cleanup(), (this.iframeObj = null)),
  1740. delete u[r.WPrefix][this.id]
  1741. }),
  1742. (l.prototype._close = function (e) {
  1743. a('_close', e), this.emit('close', null, e), this.removeAllListeners()
  1744. }),
  1745. (l.htmlfileEnabled = !1)
  1746. var t = ['Active'].concat('Object').join('X')
  1747. if (t in u)
  1748. try {
  1749. l.htmlfileEnabled = !!new u[t]('htmlfile')
  1750. } catch (e) {}
  1751. ;(l.enabled = l.htmlfileEnabled || r.iframeEnabled), (c.exports = l)
  1752. }).call(this)
  1753. }).call(
  1754. this,
  1755. 'undefined' != typeof global
  1756. ? global
  1757. : 'undefined' != typeof self
  1758. ? self
  1759. : 'undefined' != typeof window
  1760. ? window
  1761. : {}
  1762. )
  1763. },
  1764. {
  1765. '../../utils/iframe': 47,
  1766. '../../utils/random': 50,
  1767. '../../utils/url': 52,
  1768. debug: void 0,
  1769. events: 3,
  1770. inherits: 54
  1771. }
  1772. ],
  1773. 31: [
  1774. function (t, n, e) {
  1775. ;(function (c) {
  1776. ;(function () {
  1777. var r = t('../../utils/iframe'),
  1778. i = t('../../utils/random'),
  1779. s = t('../../utils/browser'),
  1780. o = t('../../utils/url'),
  1781. e = t('inherits'),
  1782. a = t('events').EventEmitter,
  1783. l = function () {}
  1784. function u(e) {
  1785. l(e)
  1786. var t = this
  1787. a.call(this), r.polluteGlobalNamespace(), (this.id = 'a' + i.string(6))
  1788. var n = o.addQuery(
  1789. e,
  1790. 'c=' + encodeURIComponent(r.WPrefix + '.' + this.id)
  1791. )
  1792. ;(c[r.WPrefix][this.id] = this._callback.bind(this)),
  1793. this._createScript(n),
  1794. (this.timeoutId = setTimeout(function () {
  1795. l('timeout'),
  1796. t._abort(new Error('JSONP script loaded abnormally (timeout)'))
  1797. }, u.timeout))
  1798. }
  1799. e(u, a),
  1800. (u.prototype.abort = function () {
  1801. if ((l('abort'), c[r.WPrefix][this.id])) {
  1802. var e = new Error('JSONP user aborted read')
  1803. ;(e.code = 1e3), this._abort(e)
  1804. }
  1805. }),
  1806. (u.timeout = 35e3),
  1807. (u.scriptErrorTimeout = 1e3),
  1808. (u.prototype._callback = function (e) {
  1809. l('_callback', e),
  1810. this._cleanup(),
  1811. this.aborting ||
  1812. (e && (l('message', e), this.emit('message', e)),
  1813. this.emit('close', null, 'network'),
  1814. this.removeAllListeners())
  1815. }),
  1816. (u.prototype._abort = function (e) {
  1817. l('_abort', e),
  1818. this._cleanup(),
  1819. (this.aborting = !0),
  1820. this.emit('close', e.code, e.message),
  1821. this.removeAllListeners()
  1822. }),
  1823. (u.prototype._cleanup = function () {
  1824. if (
  1825. (l('_cleanup'),
  1826. clearTimeout(this.timeoutId),
  1827. this.script2 &&
  1828. (this.script2.parentNode.removeChild(this.script2),
  1829. (this.script2 = null)),
  1830. this.script)
  1831. ) {
  1832. var e = this.script
  1833. e.parentNode.removeChild(e),
  1834. (e.onreadystatechange = e.onerror = e.onload = e.onclick = null),
  1835. (this.script = null)
  1836. }
  1837. delete c[r.WPrefix][this.id]
  1838. }),
  1839. (u.prototype._scriptError = function () {
  1840. l('_scriptError')
  1841. var e = this
  1842. this.errorTimer ||
  1843. (this.errorTimer = setTimeout(function () {
  1844. e.loadedOkay ||
  1845. e._abort(new Error('JSONP script loaded abnormally (onerror)'))
  1846. }, u.scriptErrorTimeout))
  1847. }),
  1848. (u.prototype._createScript = function (e) {
  1849. l('_createScript', e)
  1850. var t,
  1851. n = this,
  1852. r = (this.script = c.document.createElement('script'))
  1853. if (
  1854. ((r.id = 'a' + i.string(8)),
  1855. (r.src = e),
  1856. (r.type = 'text/javascript'),
  1857. (r.charset = 'UTF-8'),
  1858. (r.onerror = this._scriptError.bind(this)),
  1859. (r.onload = function () {
  1860. l('onload'),
  1861. n._abort(new Error('JSONP script loaded abnormally (onload)'))
  1862. }),
  1863. (r.onreadystatechange = function () {
  1864. if (
  1865. (l('onreadystatechange', r.readyState),
  1866. /loaded|closed/.test(r.readyState))
  1867. ) {
  1868. if (r && r.htmlFor && r.onclick) {
  1869. n.loadedOkay = !0
  1870. try {
  1871. r.onclick()
  1872. } catch (e) {}
  1873. }
  1874. r &&
  1875. n._abort(
  1876. new Error(
  1877. 'JSONP script loaded abnormally (onreadystatechange)'
  1878. )
  1879. )
  1880. }
  1881. }),
  1882. void 0 === r.async && c.document.attachEvent)
  1883. )
  1884. if (s.isOpera())
  1885. ((t = this.script2 = c.document.createElement('script')).text =
  1886. "try{var a = document.getElementById('" +
  1887. r.id +
  1888. "'); if(a)a.onerror();}catch(x){};"),
  1889. (r.async = t.async = !1)
  1890. else {
  1891. try {
  1892. ;(r.htmlFor = r.id), (r.event = 'onclick')
  1893. } catch (e) {}
  1894. r.async = !0
  1895. }
  1896. void 0 !== r.async && (r.async = !0)
  1897. var o = c.document.getElementsByTagName('head')[0]
  1898. o.insertBefore(r, o.firstChild), t && o.insertBefore(t, o.firstChild)
  1899. }),
  1900. (n.exports = u)
  1901. }).call(this)
  1902. }).call(
  1903. this,
  1904. 'undefined' != typeof global
  1905. ? global
  1906. : 'undefined' != typeof self
  1907. ? self
  1908. : 'undefined' != typeof window
  1909. ? window
  1910. : {}
  1911. )
  1912. },
  1913. {
  1914. '../../utils/browser': 44,
  1915. '../../utils/iframe': 47,
  1916. '../../utils/random': 50,
  1917. '../../utils/url': 52,
  1918. debug: void 0,
  1919. events: 3,
  1920. inherits: 54
  1921. }
  1922. ],
  1923. 32: [
  1924. function (e, t, n) {
  1925. var r = e('inherits'),
  1926. o = e('events').EventEmitter,
  1927. i = function () {}
  1928. function s(e, t) {
  1929. i(e), o.call(this)
  1930. var r = this
  1931. ;(this.bufferPosition = 0),
  1932. (this.xo = new t('POST', e, null)),
  1933. this.xo.on('chunk', this._chunkHandler.bind(this)),
  1934. this.xo.once('finish', function (e, t) {
  1935. i('finish', e, t), r._chunkHandler(e, t), (r.xo = null)
  1936. var n = 200 === e ? 'network' : 'permanent'
  1937. i('close', n), r.emit('close', null, n), r._cleanup()
  1938. })
  1939. }
  1940. r(s, o),
  1941. (s.prototype._chunkHandler = function (e, t) {
  1942. if ((i('_chunkHandler', e), 200 === e && t))
  1943. for (var n = -1; ; this.bufferPosition += n + 1) {
  1944. var r = t.slice(this.bufferPosition)
  1945. if (-1 === (n = r.indexOf('\n'))) break
  1946. var o = r.slice(0, n)
  1947. o && (i('message', o), this.emit('message', o))
  1948. }
  1949. }),
  1950. (s.prototype._cleanup = function () {
  1951. i('_cleanup'), this.removeAllListeners()
  1952. }),
  1953. (s.prototype.abort = function () {
  1954. i('abort'),
  1955. this.xo &&
  1956. (this.xo.close(),
  1957. i('close'),
  1958. this.emit('close', null, 'user'),
  1959. (this.xo = null)),
  1960. this._cleanup()
  1961. }),
  1962. (t.exports = s)
  1963. },
  1964. { debug: void 0, events: 3, inherits: 54 }
  1965. ],
  1966. 33: [
  1967. function (e, t, n) {
  1968. ;(function (f) {
  1969. ;(function () {
  1970. var s,
  1971. a,
  1972. l = e('../../utils/random'),
  1973. u = e('../../utils/url'),
  1974. c = function () {}
  1975. t.exports = function (e, t, n) {
  1976. c(e, t),
  1977. s ||
  1978. (c('createForm'),
  1979. ((s = f.document.createElement('form')).style.display = 'none'),
  1980. (s.style.position = 'absolute'),
  1981. (s.method = 'POST'),
  1982. (s.enctype = 'application/x-www-form-urlencoded'),
  1983. (s.acceptCharset = 'UTF-8'),
  1984. ((a = f.document.createElement('textarea')).name = 'd'),
  1985. s.appendChild(a),
  1986. f.document.body.appendChild(s))
  1987. var r = 'a' + l.string(8)
  1988. ;(s.target = r),
  1989. (s.action = u.addQuery(u.addPath(e, '/jsonp_send'), 'i=' + r))
  1990. var o = (function (t) {
  1991. c('createIframe', t)
  1992. try {
  1993. return f.document.createElement('<iframe name="' + t + '">')
  1994. } catch (e) {
  1995. var n = f.document.createElement('iframe')
  1996. return (n.name = t), n
  1997. }
  1998. })(r)
  1999. ;(o.id = r), (o.style.display = 'none'), s.appendChild(o)
  2000. try {
  2001. a.value = t
  2002. } catch (e) {}
  2003. s.submit()
  2004. function i(e) {
  2005. c('completed', r, e),
  2006. o.onerror &&
  2007. ((o.onreadystatechange = o.onerror = o.onload = null),
  2008. setTimeout(function () {
  2009. c('cleaning up', r), o.parentNode.removeChild(o), (o = null)
  2010. }, 500),
  2011. (a.value = ''),
  2012. n(e))
  2013. }
  2014. return (
  2015. (o.onerror = function () {
  2016. c('onerror', r), i()
  2017. }),
  2018. (o.onload = function () {
  2019. c('onload', r), i()
  2020. }),
  2021. (o.onreadystatechange = function (e) {
  2022. c('onreadystatechange', r, o.readyState, e),
  2023. 'complete' === o.readyState && i()
  2024. }),
  2025. function () {
  2026. c('aborted', r), i(new Error('Aborted'))
  2027. }
  2028. )
  2029. }
  2030. }).call(this)
  2031. }).call(
  2032. this,
  2033. 'undefined' != typeof global
  2034. ? global
  2035. : 'undefined' != typeof self
  2036. ? self
  2037. : 'undefined' != typeof window
  2038. ? window
  2039. : {}
  2040. )
  2041. },
  2042. { '../../utils/random': 50, '../../utils/url': 52, debug: void 0 }
  2043. ],
  2044. 34: [
  2045. function (r, u, e) {
  2046. ;(function (l) {
  2047. ;(function () {
  2048. var o = r('events').EventEmitter,
  2049. e = r('inherits'),
  2050. i = r('../../utils/event'),
  2051. t = r('../../utils/browser'),
  2052. s = r('../../utils/url'),
  2053. a = function () {}
  2054. function n(e, t, n) {
  2055. a(e, t)
  2056. var r = this
  2057. o.call(this),
  2058. setTimeout(function () {
  2059. r._start(e, t, n)
  2060. }, 0)
  2061. }
  2062. e(n, o),
  2063. (n.prototype._start = function (e, t, n) {
  2064. a('_start')
  2065. var r = this,
  2066. o = new l.XDomainRequest()
  2067. ;(t = s.addQuery(t, 't=' + +new Date())),
  2068. (o.onerror = function () {
  2069. a('onerror'), r._error()
  2070. }),
  2071. (o.ontimeout = function () {
  2072. a('ontimeout'), r._error()
  2073. }),
  2074. (o.onprogress = function () {
  2075. a('progress', o.responseText), r.emit('chunk', 200, o.responseText)
  2076. }),
  2077. (o.onload = function () {
  2078. a('load'), r.emit('finish', 200, o.responseText), r._cleanup(!1)
  2079. }),
  2080. (this.xdr = o),
  2081. (this.unloadRef = i.unloadAdd(function () {
  2082. r._cleanup(!0)
  2083. }))
  2084. try {
  2085. this.xdr.open(e, t),
  2086. this.timeout && (this.xdr.timeout = this.timeout),
  2087. this.xdr.send(n)
  2088. } catch (e) {
  2089. this._error()
  2090. }
  2091. }),
  2092. (n.prototype._error = function () {
  2093. this.emit('finish', 0, ''), this._cleanup(!1)
  2094. }),
  2095. (n.prototype._cleanup = function (e) {
  2096. if ((a('cleanup', e), this.xdr)) {
  2097. if (
  2098. (this.removeAllListeners(),
  2099. i.unloadDel(this.unloadRef),
  2100. (this.xdr.ontimeout =
  2101. this.xdr.onerror =
  2102. this.xdr.onprogress =
  2103. this.xdr.onload =
  2104. null),
  2105. e)
  2106. )
  2107. try {
  2108. this.xdr.abort()
  2109. } catch (e) {}
  2110. this.unloadRef = this.xdr = null
  2111. }
  2112. }),
  2113. (n.prototype.close = function () {
  2114. a('close'), this._cleanup(!0)
  2115. }),
  2116. (n.enabled = !(!l.XDomainRequest || !t.hasDomain())),
  2117. (u.exports = n)
  2118. }).call(this)
  2119. }).call(
  2120. this,
  2121. 'undefined' != typeof global
  2122. ? global
  2123. : 'undefined' != typeof self
  2124. ? self
  2125. : 'undefined' != typeof window
  2126. ? window
  2127. : {}
  2128. )
  2129. },
  2130. {
  2131. '../../utils/browser': 44,
  2132. '../../utils/event': 46,
  2133. '../../utils/url': 52,
  2134. debug: void 0,
  2135. events: 3,
  2136. inherits: 54
  2137. }
  2138. ],
  2139. 35: [
  2140. function (e, t, n) {
  2141. var r = e('inherits'),
  2142. o = e('../driver/xhr')
  2143. function i(e, t, n, r) {
  2144. o.call(this, e, t, n, r)
  2145. }
  2146. r(i, o), (i.enabled = o.enabled && o.supportsCORS), (t.exports = i)
  2147. },
  2148. { '../driver/xhr': 17, inherits: 54 }
  2149. ],
  2150. 36: [
  2151. function (e, t, n) {
  2152. var r = e('events').EventEmitter
  2153. function o() {
  2154. var e = this
  2155. r.call(this),
  2156. (this.to = setTimeout(function () {
  2157. e.emit('finish', 200, '{}')
  2158. }, o.timeout))
  2159. }
  2160. e('inherits')(o, r),
  2161. (o.prototype.close = function () {
  2162. clearTimeout(this.to)
  2163. }),
  2164. (o.timeout = 2e3),
  2165. (t.exports = o)
  2166. },
  2167. { events: 3, inherits: 54 }
  2168. ],
  2169. 37: [
  2170. function (e, t, n) {
  2171. var r = e('inherits'),
  2172. o = e('../driver/xhr')
  2173. function i(e, t, n) {
  2174. o.call(this, e, t, n, { noCredentials: !0 })
  2175. }
  2176. r(i, o), (i.enabled = o.enabled), (t.exports = i)
  2177. },
  2178. { '../driver/xhr': 17, inherits: 54 }
  2179. ],
  2180. 38: [
  2181. function (e, t, n) {
  2182. var i = e('../utils/event'),
  2183. s = e('../utils/url'),
  2184. r = e('inherits'),
  2185. a = e('events').EventEmitter,
  2186. l = e('./driver/websocket'),
  2187. u = function () {}
  2188. function c(e, t, n) {
  2189. if (!c.enabled()) throw new Error('Transport created when disabled')
  2190. a.call(this), u('constructor', e)
  2191. var r = this,
  2192. o = s.addPath(e, '/websocket')
  2193. ;(o = 'https' === o.slice(0, 5) ? 'wss' + o.slice(5) : 'ws' + o.slice(4)),
  2194. (this.url = o),
  2195. (this.ws = new l(this.url, [], n)),
  2196. (this.ws.onmessage = function (e) {
  2197. u('message event', e.data), r.emit('message', e.data)
  2198. }),
  2199. (this.unloadRef = i.unloadAdd(function () {
  2200. u('unload'), r.ws.close()
  2201. })),
  2202. (this.ws.onclose = function (e) {
  2203. u('close event', e.code, e.reason),
  2204. r.emit('close', e.code, e.reason),
  2205. r._cleanup()
  2206. }),
  2207. (this.ws.onerror = function (e) {
  2208. u('error event', e),
  2209. r.emit('close', 1006, 'WebSocket connection broken'),
  2210. r._cleanup()
  2211. })
  2212. }
  2213. r(c, a),
  2214. (c.prototype.send = function (e) {
  2215. var t = '[' + e + ']'
  2216. u('send', t), this.ws.send(t)
  2217. }),
  2218. (c.prototype.close = function () {
  2219. u('close')
  2220. var e = this.ws
  2221. this._cleanup(), e && e.close()
  2222. }),
  2223. (c.prototype._cleanup = function () {
  2224. u('_cleanup')
  2225. var e = this.ws
  2226. e && (e.onmessage = e.onclose = e.onerror = null),
  2227. i.unloadDel(this.unloadRef),
  2228. (this.unloadRef = this.ws = null),
  2229. this.removeAllListeners()
  2230. }),
  2231. (c.enabled = function () {
  2232. return u('enabled'), !!l
  2233. }),
  2234. (c.transportName = 'websocket'),
  2235. (c.roundTrips = 2),
  2236. (t.exports = c)
  2237. },
  2238. {
  2239. '../utils/event': 46,
  2240. '../utils/url': 52,
  2241. './driver/websocket': 19,
  2242. debug: void 0,
  2243. events: 3,
  2244. inherits: 54
  2245. }
  2246. ],
  2247. 39: [
  2248. function (e, t, n) {
  2249. var r = e('inherits'),
  2250. o = e('./lib/ajax-based'),
  2251. i = e('./xdr-streaming'),
  2252. s = e('./receiver/xhr'),
  2253. a = e('./sender/xdr')
  2254. function l(e) {
  2255. if (!a.enabled) throw new Error('Transport created when disabled')
  2256. o.call(this, e, '/xhr', s, a)
  2257. }
  2258. r(l, o),
  2259. (l.enabled = i.enabled),
  2260. (l.transportName = 'xdr-polling'),
  2261. (l.roundTrips = 2),
  2262. (t.exports = l)
  2263. },
  2264. {
  2265. './lib/ajax-based': 24,
  2266. './receiver/xhr': 32,
  2267. './sender/xdr': 34,
  2268. './xdr-streaming': 40,
  2269. inherits: 54
  2270. }
  2271. ],
  2272. 40: [
  2273. function (e, t, n) {
  2274. var r = e('inherits'),
  2275. o = e('./lib/ajax-based'),
  2276. i = e('./receiver/xhr'),
  2277. s = e('./sender/xdr')
  2278. function a(e) {
  2279. if (!s.enabled) throw new Error('Transport created when disabled')
  2280. o.call(this, e, '/xhr_streaming', i, s)
  2281. }
  2282. r(a, o),
  2283. (a.enabled = function (e) {
  2284. return !e.cookie_needed && !e.nullOrigin && s.enabled && e.sameScheme
  2285. }),
  2286. (a.transportName = 'xdr-streaming'),
  2287. (a.roundTrips = 2),
  2288. (t.exports = a)
  2289. },
  2290. { './lib/ajax-based': 24, './receiver/xhr': 32, './sender/xdr': 34, inherits: 54 }
  2291. ],
  2292. 41: [
  2293. function (e, t, n) {
  2294. var r = e('inherits'),
  2295. o = e('./lib/ajax-based'),
  2296. i = e('./receiver/xhr'),
  2297. s = e('./sender/xhr-cors'),
  2298. a = e('./sender/xhr-local')
  2299. function l(e) {
  2300. if (!a.enabled && !s.enabled)
  2301. throw new Error('Transport created when disabled')
  2302. o.call(this, e, '/xhr', i, s)
  2303. }
  2304. r(l, o),
  2305. (l.enabled = function (e) {
  2306. return !e.nullOrigin && (!(!a.enabled || !e.sameOrigin) || s.enabled)
  2307. }),
  2308. (l.transportName = 'xhr-polling'),
  2309. (l.roundTrips = 2),
  2310. (t.exports = l)
  2311. },
  2312. {
  2313. './lib/ajax-based': 24,
  2314. './receiver/xhr': 32,
  2315. './sender/xhr-cors': 35,
  2316. './sender/xhr-local': 37,
  2317. inherits: 54
  2318. }
  2319. ],
  2320. 42: [
  2321. function (l, u, e) {
  2322. ;(function (a) {
  2323. ;(function () {
  2324. var e = l('inherits'),
  2325. t = l('./lib/ajax-based'),
  2326. n = l('./receiver/xhr'),
  2327. r = l('./sender/xhr-cors'),
  2328. o = l('./sender/xhr-local'),
  2329. i = l('../utils/browser')
  2330. function s(e) {
  2331. if (!o.enabled && !r.enabled)
  2332. throw new Error('Transport created when disabled')
  2333. t.call(this, e, '/xhr_streaming', n, r)
  2334. }
  2335. e(s, t),
  2336. (s.enabled = function (e) {
  2337. return !e.nullOrigin && !i.isOpera() && r.enabled
  2338. }),
  2339. (s.transportName = 'xhr-streaming'),
  2340. (s.roundTrips = 2),
  2341. (s.needBody = !!a.document),
  2342. (u.exports = s)
  2343. }).call(this)
  2344. }).call(
  2345. this,
  2346. 'undefined' != typeof global
  2347. ? global
  2348. : 'undefined' != typeof self
  2349. ? self
  2350. : 'undefined' != typeof window
  2351. ? window
  2352. : {}
  2353. )
  2354. },
  2355. {
  2356. '../utils/browser': 44,
  2357. './lib/ajax-based': 24,
  2358. './receiver/xhr': 32,
  2359. './sender/xhr-cors': 35,
  2360. './sender/xhr-local': 37,
  2361. inherits: 54
  2362. }
  2363. ],
  2364. 43: [
  2365. function (e, t, n) {
  2366. ;(function (n) {
  2367. ;(function () {
  2368. n.crypto && n.crypto.getRandomValues
  2369. ? (t.exports.randomBytes = function (e) {
  2370. var t = new Uint8Array(e)
  2371. return n.crypto.getRandomValues(t), t
  2372. })
  2373. : (t.exports.randomBytes = function (e) {
  2374. for (var t = new Array(e), n = 0; n < e; n++)
  2375. t[n] = Math.floor(256 * Math.random())
  2376. return t
  2377. })
  2378. }).call(this)
  2379. }).call(
  2380. this,
  2381. 'undefined' != typeof global
  2382. ? global
  2383. : 'undefined' != typeof self
  2384. ? self
  2385. : 'undefined' != typeof window
  2386. ? window
  2387. : {}
  2388. )
  2389. },
  2390. {}
  2391. ],
  2392. 44: [
  2393. function (e, t, n) {
  2394. ;(function (e) {
  2395. ;(function () {
  2396. t.exports = {
  2397. isOpera: function () {
  2398. return e.navigator && /opera/i.test(e.navigator.userAgent)
  2399. },
  2400. isKonqueror: function () {
  2401. return e.navigator && /konqueror/i.test(e.navigator.userAgent)
  2402. },
  2403. hasDomain: function () {
  2404. if (!e.document) return !0
  2405. try {
  2406. return !!e.document.domain
  2407. } catch (e) {
  2408. return !1
  2409. }
  2410. }
  2411. }
  2412. }).call(this)
  2413. }).call(
  2414. this,
  2415. 'undefined' != typeof global
  2416. ? global
  2417. : 'undefined' != typeof self
  2418. ? self
  2419. : 'undefined' != typeof window
  2420. ? window
  2421. : {}
  2422. )
  2423. },
  2424. {}
  2425. ],
  2426. 45: [
  2427. function (e, t, n) {
  2428. var r,
  2429. o =
  2430. /[\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
  2431. t.exports = {
  2432. quote: function (e) {
  2433. var t = JSON.stringify(e)
  2434. return (
  2435. (o.lastIndex = 0),
  2436. o.test(t)
  2437. ? ((r =
  2438. r ||
  2439. (function (e) {
  2440. var t,
  2441. n = {},
  2442. r = []
  2443. for (t = 0; t < 65536; t++) r.push(String.fromCharCode(t))
  2444. return (
  2445. (e.lastIndex = 0),
  2446. r.join('').replace(e, function (e) {
  2447. return (
  2448. (n[e] =
  2449. '\\u' +
  2450. ('0000' + e.charCodeAt(0).toString(16)).slice(-4)),
  2451. ''
  2452. )
  2453. }),
  2454. (e.lastIndex = 0),
  2455. n
  2456. )
  2457. })(o)),
  2458. t.replace(o, function (e) {
  2459. return r[e]
  2460. }))
  2461. : t
  2462. )
  2463. }
  2464. }
  2465. },
  2466. {}
  2467. ],
  2468. 46: [
  2469. function (e, t, n) {
  2470. ;(function (s) {
  2471. ;(function () {
  2472. var n = e('./random'),
  2473. r = {},
  2474. o = !1,
  2475. i = s.chrome && s.chrome.app && s.chrome.app.runtime
  2476. t.exports = {
  2477. attachEvent: function (e, t) {
  2478. void 0 !== s.addEventListener
  2479. ? s.addEventListener(e, t, !1)
  2480. : s.document &&
  2481. s.attachEvent &&
  2482. (s.document.attachEvent('on' + e, t), s.attachEvent('on' + e, t))
  2483. },
  2484. detachEvent: function (e, t) {
  2485. void 0 !== s.addEventListener
  2486. ? s.removeEventListener(e, t, !1)
  2487. : s.document &&
  2488. s.detachEvent &&
  2489. (s.document.detachEvent('on' + e, t), s.detachEvent('on' + e, t))
  2490. },
  2491. unloadAdd: function (e) {
  2492. if (i) return null
  2493. var t = n.string(8)
  2494. return (r[t] = e), o && setTimeout(this.triggerUnloadCallbacks, 0), t
  2495. },
  2496. unloadDel: function (e) {
  2497. e in r && delete r[e]
  2498. },
  2499. triggerUnloadCallbacks: function () {
  2500. for (var e in r) r[e](), delete r[e]
  2501. }
  2502. }
  2503. i ||
  2504. t.exports.attachEvent('unload', function () {
  2505. o || ((o = !0), t.exports.triggerUnloadCallbacks())
  2506. })
  2507. }).call(this)
  2508. }).call(
  2509. this,
  2510. 'undefined' != typeof global
  2511. ? global
  2512. : 'undefined' != typeof self
  2513. ? self
  2514. : 'undefined' != typeof window
  2515. ? window
  2516. : {}
  2517. )
  2518. },
  2519. { './random': 50 }
  2520. ],
  2521. 47: [
  2522. function (t, p, e) {
  2523. ;(function (d) {
  2524. ;(function () {
  2525. var f = t('./event'),
  2526. e = t('./browser'),
  2527. h = function () {}
  2528. ;(p.exports = {
  2529. WPrefix: '_jp',
  2530. currentWindowId: null,
  2531. polluteGlobalNamespace: function () {
  2532. p.exports.WPrefix in d || (d[p.exports.WPrefix] = {})
  2533. },
  2534. postMessage: function (e, t) {
  2535. d.parent !== d
  2536. ? d.parent.postMessage(
  2537. JSON.stringify({
  2538. windowId: p.exports.currentWindowId,
  2539. type: e,
  2540. data: t || ''
  2541. }),
  2542. '*'
  2543. )
  2544. : h('Cannot postMessage, no parent window.', e, t)
  2545. },
  2546. createIframe: function (e, t) {
  2547. function n() {
  2548. h('unattach'), clearTimeout(i)
  2549. try {
  2550. a.onload = null
  2551. } catch (e) {}
  2552. a.onerror = null
  2553. }
  2554. function r() {
  2555. h('cleanup'),
  2556. a &&
  2557. (n(),
  2558. setTimeout(function () {
  2559. a && a.parentNode.removeChild(a), (a = null)
  2560. }, 0),
  2561. f.unloadDel(s))
  2562. }
  2563. function o(e) {
  2564. h('onerror', e), a && (r(), t(e))
  2565. }
  2566. var i,
  2567. s,
  2568. a = d.document.createElement('iframe')
  2569. return (
  2570. (a.src = e),
  2571. (a.style.display = 'none'),
  2572. (a.style.position = 'absolute'),
  2573. (a.onerror = function () {
  2574. o('onerror')
  2575. }),
  2576. (a.onload = function () {
  2577. h('onload'),
  2578. clearTimeout(i),
  2579. (i = setTimeout(function () {
  2580. o('onload timeout')
  2581. }, 2e3))
  2582. }),
  2583. d.document.body.appendChild(a),
  2584. (i = setTimeout(function () {
  2585. o('timeout')
  2586. }, 15e3)),
  2587. (s = f.unloadAdd(r)),
  2588. {
  2589. post: function (e, t) {
  2590. h('post', e, t),
  2591. setTimeout(function () {
  2592. try {
  2593. a && a.contentWindow && a.contentWindow.postMessage(e, t)
  2594. } catch (e) {}
  2595. }, 0)
  2596. },
  2597. cleanup: r,
  2598. loaded: n
  2599. }
  2600. )
  2601. },
  2602. createHtmlfile: function (e, t) {
  2603. function n() {
  2604. clearTimeout(i), (a.onerror = null)
  2605. }
  2606. function r() {
  2607. u &&
  2608. (n(),
  2609. f.unloadDel(s),
  2610. a.parentNode.removeChild(a),
  2611. (a = u = null),
  2612. CollectGarbage())
  2613. }
  2614. function o(e) {
  2615. h('onerror', e), u && (r(), t(e))
  2616. }
  2617. var i,
  2618. s,
  2619. a,
  2620. l = ['Active'].concat('Object').join('X'),
  2621. u = new d[l]('htmlfile')
  2622. u.open(),
  2623. u.write(
  2624. '<html><script>document.domain="' +
  2625. d.document.domain +
  2626. '";</script></html>'
  2627. ),
  2628. u.close(),
  2629. (u.parentWindow[p.exports.WPrefix] = d[p.exports.WPrefix])
  2630. var c = u.createElement('div')
  2631. return (
  2632. u.body.appendChild(c),
  2633. (a = u.createElement('iframe')),
  2634. c.appendChild(a),
  2635. (a.src = e),
  2636. (a.onerror = function () {
  2637. o('onerror')
  2638. }),
  2639. (i = setTimeout(function () {
  2640. o('timeout')
  2641. }, 15e3)),
  2642. (s = f.unloadAdd(r)),
  2643. {
  2644. post: function (e, t) {
  2645. try {
  2646. setTimeout(function () {
  2647. a && a.contentWindow && a.contentWindow.postMessage(e, t)
  2648. }, 0)
  2649. } catch (e) {}
  2650. },
  2651. cleanup: r,
  2652. loaded: n
  2653. }
  2654. )
  2655. }
  2656. }),
  2657. (p.exports.iframeEnabled = !1),
  2658. d.document &&
  2659. (p.exports.iframeEnabled =
  2660. ('function' == typeof d.postMessage ||
  2661. 'object' == typeof d.postMessage) &&
  2662. !e.isKonqueror())
  2663. }).call(this)
  2664. }).call(
  2665. this,
  2666. 'undefined' != typeof global
  2667. ? global
  2668. : 'undefined' != typeof self
  2669. ? self
  2670. : 'undefined' != typeof window
  2671. ? window
  2672. : {}
  2673. )
  2674. },
  2675. { './browser': 44, './event': 46, debug: void 0 }
  2676. ],
  2677. 48: [
  2678. function (e, t, n) {
  2679. ;(function (r) {
  2680. ;(function () {
  2681. var n = {}
  2682. ;['log', 'debug', 'warn'].forEach(function (e) {
  2683. var t
  2684. try {
  2685. t = r.console && r.console[e] && r.console[e].apply
  2686. } catch (e) {}
  2687. n[e] = t
  2688. ? function () {
  2689. return r.console[e].apply(r.console, arguments)
  2690. }
  2691. : 'log' === e
  2692. ? function () {}
  2693. : n.log
  2694. }),
  2695. (t.exports = n)
  2696. }).call(this)
  2697. }).call(
  2698. this,
  2699. 'undefined' != typeof global
  2700. ? global
  2701. : 'undefined' != typeof self
  2702. ? self
  2703. : 'undefined' != typeof window
  2704. ? window
  2705. : {}
  2706. )
  2707. },
  2708. {}
  2709. ],
  2710. 49: [
  2711. function (e, t, n) {
  2712. t.exports = {
  2713. isObject: function (e) {
  2714. var t = typeof e
  2715. return 'function' == t || ('object' == t && !!e)
  2716. },
  2717. extend: function (e) {
  2718. if (!this.isObject(e)) return e
  2719. for (var t, n, r = 1, o = arguments.length; r < o; r++)
  2720. for (n in (t = arguments[r]))
  2721. Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n])
  2722. return e
  2723. }
  2724. }
  2725. },
  2726. {}
  2727. ],
  2728. 50: [
  2729. function (e, t, n) {
  2730. var i = e('crypto'),
  2731. s = 'abcdefghijklmnopqrstuvwxyz012345'
  2732. t.exports = {
  2733. string: function (e) {
  2734. for (var t = s.length, n = i.randomBytes(e), r = [], o = 0; o < e; o++)
  2735. r.push(s.substr(n[o] % t, 1))
  2736. return r.join('')
  2737. },
  2738. number: function (e) {
  2739. return Math.floor(Math.random() * e)
  2740. },
  2741. numberString: function (e) {
  2742. var t = ('' + (e - 1)).length
  2743. return (new Array(t + 1).join('0') + this.number(e)).slice(-t)
  2744. }
  2745. }
  2746. },
  2747. { crypto: 43 }
  2748. ],
  2749. 51: [
  2750. function (e, t, n) {
  2751. var o = function () {}
  2752. t.exports = function (e) {
  2753. return {
  2754. filterToEnabled: function (t, n) {
  2755. var r = { main: [], facade: [] }
  2756. return (
  2757. t ? 'string' == typeof t && (t = [t]) : (t = []),
  2758. e.forEach(function (e) {
  2759. e &&
  2760. ('websocket' !== e.transportName || !1 !== n.websocket
  2761. ? t.length && -1 === t.indexOf(e.transportName)
  2762. ? o('not in whitelist', e.transportName)
  2763. : e.enabled(n)
  2764. ? (o('enabled', e.transportName),
  2765. r.main.push(e),
  2766. e.facadeTransport && r.facade.push(e.facadeTransport))
  2767. : o('disabled', e.transportName)
  2768. : o('disabled from server', 'websocket'))
  2769. }),
  2770. r
  2771. )
  2772. }
  2773. }
  2774. }
  2775. },
  2776. { debug: void 0 }
  2777. ],
  2778. 52: [
  2779. function (e, t, n) {
  2780. var r = e('url-parse'),
  2781. o = function () {}
  2782. t.exports = {
  2783. getOrigin: function (e) {
  2784. if (!e) return null
  2785. var t = new r(e)
  2786. if ('file:' === t.protocol) return null
  2787. var n = t.port
  2788. return (
  2789. (n = n || ('https:' === t.protocol ? '443' : '80')),
  2790. t.protocol + '//' + t.hostname + ':' + n
  2791. )
  2792. },
  2793. isOriginEqual: function (e, t) {
  2794. var n = this.getOrigin(e) === this.getOrigin(t)
  2795. return o('same', e, t, n), n
  2796. },
  2797. isSchemeEqual: function (e, t) {
  2798. return e.split(':')[0] === t.split(':')[0]
  2799. },
  2800. addPath: function (e, t) {
  2801. var n = e.split('?')
  2802. return n[0] + t + (n[1] ? '?' + n[1] : '')
  2803. },
  2804. addQuery: function (e, t) {
  2805. return e + (-1 === e.indexOf('?') ? '?' + t : '&' + t)
  2806. },
  2807. isLoopbackAddr: function (e) {
  2808. return (
  2809. /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e) ||
  2810. /^\[::1\]$/.test(e)
  2811. )
  2812. }
  2813. }
  2814. },
  2815. { debug: void 0, 'url-parse': 57 }
  2816. ],
  2817. 53: [
  2818. function (e, t, n) {
  2819. t.exports = '1.6.1'
  2820. },
  2821. {}
  2822. ],
  2823. 54: [
  2824. function (e, t, n) {
  2825. 'function' == typeof Object.create
  2826. ? (t.exports = function (e, t) {
  2827. t &&
  2828. ((e.super_ = t),
  2829. (e.prototype = Object.create(t.prototype, {
  2830. constructor: {
  2831. value: e,
  2832. enumerable: !1,
  2833. writable: !0,
  2834. configurable: !0
  2835. }
  2836. })))
  2837. })
  2838. : (t.exports = function (e, t) {
  2839. if (t) {
  2840. e.super_ = t
  2841. function n() {}
  2842. ;(n.prototype = t.prototype),
  2843. (e.prototype = new n()),
  2844. (e.prototype.constructor = e)
  2845. }
  2846. })
  2847. },
  2848. {}
  2849. ],
  2850. 55: [
  2851. function (e, t, n) {
  2852. var i = Object.prototype.hasOwnProperty
  2853. function s(e) {
  2854. try {
  2855. return decodeURIComponent(e.replace(/\+/g, ' '))
  2856. } catch (e) {
  2857. return null
  2858. }
  2859. }
  2860. ;(n.stringify = function (e, t) {
  2861. t = t || ''
  2862. var n,
  2863. r,
  2864. o = []
  2865. for (r in ('string' != typeof t && (t = '?'), e))
  2866. if (i.call(e, r)) {
  2867. if (
  2868. ((n = e[r]) || (null != n && !isNaN(n)) || (n = ''),
  2869. (r = encodeURIComponent(r)),
  2870. (n = encodeURIComponent(n)),
  2871. null === r || null === n)
  2872. )
  2873. continue
  2874. o.push(r + '=' + n)
  2875. }
  2876. return o.length ? t + o.join('&') : ''
  2877. }),
  2878. (n.parse = function (e) {
  2879. for (var t, n = /([^=?&]+)=?([^&]*)/g, r = {}; (t = n.exec(e)); ) {
  2880. var o = s(t[1]),
  2881. i = s(t[2])
  2882. null === o || null === i || o in r || (r[o] = i)
  2883. }
  2884. return r
  2885. })
  2886. },
  2887. {}
  2888. ],
  2889. 56: [
  2890. function (e, t, n) {
  2891. t.exports = function (e, t) {
  2892. if (((t = t.split(':')[0]), !(e = +e))) return !1
  2893. switch (t) {
  2894. case 'http':
  2895. case 'ws':
  2896. return 80 !== e
  2897. case 'https':
  2898. case 'wss':
  2899. return 443 !== e
  2900. case 'ftp':
  2901. return 21 !== e
  2902. case 'gopher':
  2903. return 70 !== e
  2904. case 'file':
  2905. return !1
  2906. }
  2907. return 0 !== e
  2908. }
  2909. },
  2910. {}
  2911. ],
  2912. 57: [
  2913. function (e, n, t) {
  2914. ;(function (a) {
  2915. ;(function () {
  2916. var d = e('requires-port'),
  2917. p = e('querystringify'),
  2918. t =
  2919. /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,
  2920. m = /[\n\r\t]/g,
  2921. i = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//,
  2922. l = /:\d+$/,
  2923. u = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,
  2924. v = /^[a-zA-Z]:/
  2925. function b(e) {
  2926. return (e || '').toString().replace(t, '')
  2927. }
  2928. var y = [
  2929. ['#', 'hash'],
  2930. ['?', 'query'],
  2931. function (e, t) {
  2932. return w(t.protocol) ? e.replace(/\\/g, '/') : e
  2933. },
  2934. ['/', 'pathname'],
  2935. ['@', 'auth', 1],
  2936. [NaN, 'host', void 0, 1, 1],
  2937. [/:(\d*)$/, 'port', void 0, 1],
  2938. [NaN, 'hostname', void 0, 1, 1]
  2939. ],
  2940. s = { hash: 1, query: 1 }
  2941. function g(e) {
  2942. var t,
  2943. n =
  2944. ('undefined' != typeof window
  2945. ? window
  2946. : void 0 !== a
  2947. ? a
  2948. : 'undefined' != typeof self
  2949. ? self
  2950. : {}
  2951. ).location || {},
  2952. r = {},
  2953. o = typeof (e = e || n)
  2954. if ('blob:' === e.protocol) r = new _(unescape(e.pathname), {})
  2955. else if ('string' == o) for (t in ((r = new _(e, {})), s)) delete r[t]
  2956. else if ('object' == o) {
  2957. for (t in e) t in s || (r[t] = e[t])
  2958. void 0 === r.slashes && (r.slashes = i.test(e.href))
  2959. }
  2960. return r
  2961. }
  2962. function w(e) {
  2963. return (
  2964. 'file:' === e ||
  2965. 'ftp:' === e ||
  2966. 'http:' === e ||
  2967. 'https:' === e ||
  2968. 'ws:' === e ||
  2969. 'wss:' === e
  2970. )
  2971. }
  2972. function x(e, t) {
  2973. ;(e = (e = b(e)).replace(m, '')), (t = t || {})
  2974. var n,
  2975. r = u.exec(e),
  2976. o = r[1] ? r[1].toLowerCase() : '',
  2977. i = !!r[2],
  2978. s = !!r[3],
  2979. a = 0
  2980. return (
  2981. i
  2982. ? (a = s
  2983. ? ((n = r[2] + r[3] + r[4]), r[2].length + r[3].length)
  2984. : ((n = r[2] + r[4]), r[2].length))
  2985. : s
  2986. ? ((n = r[3] + r[4]), (a = r[3].length))
  2987. : (n = r[4]),
  2988. 'file:' === o
  2989. ? 2 <= a && (n = n.slice(2))
  2990. : w(o)
  2991. ? (n = r[4])
  2992. : o
  2993. ? i && (n = n.slice(2))
  2994. : 2 <= a && w(t.protocol) && (n = r[4]),
  2995. { protocol: o, slashes: i || w(o), slashesCount: a, rest: n }
  2996. )
  2997. }
  2998. function _(e, t, n) {
  2999. if (((e = (e = b(e)).replace(m, '')), !(this instanceof _)))
  3000. return new _(e, t, n)
  3001. var r,
  3002. o,
  3003. i,
  3004. s,
  3005. a,
  3006. l,
  3007. u = y.slice(),
  3008. c = typeof t,
  3009. f = this,
  3010. h = 0
  3011. for (
  3012. 'object' != c && 'string' != c && ((n = t), (t = null)),
  3013. n && 'function' != typeof n && (n = p.parse),
  3014. r = !(o = x(e || '', (t = g(t)))).protocol && !o.slashes,
  3015. f.slashes = o.slashes || (r && t.slashes),
  3016. f.protocol = o.protocol || t.protocol || '',
  3017. e = o.rest,
  3018. (('file:' === o.protocol && (2 !== o.slashesCount || v.test(e))) ||
  3019. (!o.slashes &&
  3020. (o.protocol || o.slashesCount < 2 || !w(f.protocol)))) &&
  3021. (u[3] = [/(.*)/, 'pathname']);
  3022. h < u.length;
  3023. h++
  3024. )
  3025. 'function' != typeof (s = u[h])
  3026. ? ((i = s[0]),
  3027. (l = s[1]),
  3028. i != i
  3029. ? (f[l] = e)
  3030. : 'string' == typeof i
  3031. ? ~(a = '@' === i ? e.lastIndexOf(i) : e.indexOf(i)) &&
  3032. (e =
  3033. 'number' == typeof s[2]
  3034. ? ((f[l] = e.slice(0, a)), e.slice(a + s[2]))
  3035. : ((f[l] = e.slice(a)), e.slice(0, a)))
  3036. : (a = i.exec(e)) && ((f[l] = a[1]), (e = e.slice(0, a.index))),
  3037. (f[l] = f[l] || (r && s[3] && t[l]) || ''),
  3038. s[4] && (f[l] = f[l].toLowerCase()))
  3039. : (e = s(e, f))
  3040. n && (f.query = n(f.query)),
  3041. r &&
  3042. t.slashes &&
  3043. '/' !== f.pathname.charAt(0) &&
  3044. ('' !== f.pathname || '' !== t.pathname) &&
  3045. (f.pathname = (function (e, t) {
  3046. if ('' === e) return t
  3047. for (
  3048. var n = (t || '/').split('/').slice(0, -1).concat(e.split('/')),
  3049. r = n.length,
  3050. o = n[r - 1],
  3051. i = !1,
  3052. s = 0;
  3053. r--;
  3054. )
  3055. '.' === n[r]
  3056. ? n.splice(r, 1)
  3057. : '..' === n[r]
  3058. ? (n.splice(r, 1), s++)
  3059. : s && (0 === r && (i = !0), n.splice(r, 1), s--)
  3060. return (
  3061. i && n.unshift(''),
  3062. ('.' !== o && '..' !== o) || n.push(''),
  3063. n.join('/')
  3064. )
  3065. })(f.pathname, t.pathname)),
  3066. '/' !== f.pathname.charAt(0) &&
  3067. w(f.protocol) &&
  3068. (f.pathname = '/' + f.pathname),
  3069. d(f.port, f.protocol) || ((f.host = f.hostname), (f.port = '')),
  3070. (f.username = f.password = ''),
  3071. f.auth &&
  3072. (~(a = f.auth.indexOf(':'))
  3073. ? ((f.username = f.auth.slice(0, a)),
  3074. (f.username = encodeURIComponent(decodeURIComponent(f.username))),
  3075. (f.password = f.auth.slice(a + 1)),
  3076. (f.password = encodeURIComponent(decodeURIComponent(f.password))))
  3077. : (f.username = encodeURIComponent(decodeURIComponent(f.auth))),
  3078. (f.auth = f.password ? f.username + ':' + f.password : f.username)),
  3079. (f.origin =
  3080. 'file:' !== f.protocol && w(f.protocol) && f.host
  3081. ? f.protocol + '//' + f.host
  3082. : 'null'),
  3083. (f.href = f.toString())
  3084. }
  3085. ;(_.prototype = {
  3086. set: function (e, t, n) {
  3087. var r = this
  3088. switch (e) {
  3089. case 'query':
  3090. 'string' == typeof t && t.length && (t = (n || p.parse)(t)),
  3091. (r[e] = t)
  3092. break
  3093. case 'port':
  3094. ;(r[e] = t),
  3095. d(t, r.protocol)
  3096. ? t && (r.host = r.hostname + ':' + t)
  3097. : ((r.host = r.hostname), (r[e] = ''))
  3098. break
  3099. case 'hostname':
  3100. ;(r[e] = t), r.port && (t += ':' + r.port), (r.host = t)
  3101. break
  3102. case 'host':
  3103. ;(r[e] = t),
  3104. l.test(t)
  3105. ? ((t = t.split(':')),
  3106. (r.port = t.pop()),
  3107. (r.hostname = t.join(':')))
  3108. : ((r.hostname = t), (r.port = ''))
  3109. break
  3110. case 'protocol':
  3111. ;(r.protocol = t.toLowerCase()), (r.slashes = !n)
  3112. break
  3113. case 'pathname':
  3114. case 'hash':
  3115. if (t) {
  3116. var o = 'pathname' === e ? '/' : '#'
  3117. r[e] = t.charAt(0) !== o ? o + t : t
  3118. } else r[e] = t
  3119. break
  3120. case 'username':
  3121. case 'password':
  3122. r[e] = encodeURIComponent(t)
  3123. break
  3124. case 'auth':
  3125. var i = t.indexOf(':')
  3126. ~i
  3127. ? ((r.username = t.slice(0, i)),
  3128. (r.username = encodeURIComponent(
  3129. decodeURIComponent(r.username)
  3130. )),
  3131. (r.password = t.slice(i + 1)),
  3132. (r.password = encodeURIComponent(
  3133. decodeURIComponent(r.password)
  3134. )))
  3135. : (r.username = encodeURIComponent(decodeURIComponent(t)))
  3136. }
  3137. for (var s = 0; s < y.length; s++) {
  3138. var a = y[s]
  3139. a[4] && (r[a[1]] = r[a[1]].toLowerCase())
  3140. }
  3141. return (
  3142. (r.auth = r.password ? r.username + ':' + r.password : r.username),
  3143. (r.origin =
  3144. 'file:' !== r.protocol && w(r.protocol) && r.host
  3145. ? r.protocol + '//' + r.host
  3146. : 'null'),
  3147. (r.href = r.toString()),
  3148. r
  3149. )
  3150. },
  3151. toString: function (e) {
  3152. ;(e && 'function' == typeof e) || (e = p.stringify)
  3153. var t,
  3154. n = this,
  3155. r = n.host,
  3156. o = n.protocol
  3157. o && ':' !== o.charAt(o.length - 1) && (o += ':')
  3158. var i = o + ((n.protocol && n.slashes) || w(n.protocol) ? '//' : '')
  3159. return (
  3160. n.username
  3161. ? ((i += n.username),
  3162. n.password && (i += ':' + n.password),
  3163. (i += '@'))
  3164. : n.password
  3165. ? ((i += ':' + n.password), (i += '@'))
  3166. : 'file:' !== n.protocol &&
  3167. w(n.protocol) &&
  3168. !r &&
  3169. '/' !== n.pathname &&
  3170. (i += '@'),
  3171. (':' === r[r.length - 1] || (l.test(n.hostname) && !n.port)) &&
  3172. (r += ':'),
  3173. (i += r + n.pathname),
  3174. (t = 'object' == typeof n.query ? e(n.query) : n.query) &&
  3175. (i += '?' !== t.charAt(0) ? '?' + t : t),
  3176. n.hash && (i += n.hash),
  3177. i
  3178. )
  3179. }
  3180. }),
  3181. (_.extractProtocol = x),
  3182. (_.location = g),
  3183. (_.trimLeft = b),
  3184. (_.qs = p),
  3185. (n.exports = _)
  3186. }).call(this)
  3187. }).call(
  3188. this,
  3189. 'undefined' != typeof global
  3190. ? global
  3191. : 'undefined' != typeof self
  3192. ? self
  3193. : 'undefined' != typeof window
  3194. ? window
  3195. : {}
  3196. )
  3197. },
  3198. { querystringify: 55, 'requires-port': 56 }
  3199. ]
  3200. },
  3201. {},
  3202. [1]
  3203. )(1)
  3204. })
  3205. //# sourceMappingURL=sockjs.min.js.map