msgpackasdw

msgpack backup

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/494236/1371887/msgpackasdw.js

  1. // ==UserScript==
  2. // @name msgpackasdw
  3. // @description msgpack backup
  4. // @author msgpack authors
  5. // @license MIT
  6. // ==/UserScript==
  7.  
  8. (function() {
  9. 'use strict';
  10. function serialize(data) {
  11. const pow32 = 0x100000000;
  12. let floatBuffer, floatView;
  13. let array = new Uint8Array(128);
  14. let length = 0;
  15. append(data);
  16. return array.subarray(0, length);
  17.  
  18. function append(data) {
  19. switch (typeof data) {
  20. case "undefined":
  21. appendNull(data);
  22. break;
  23. case "boolean":
  24. appendBoolean(data);
  25. break;
  26. case "number":
  27. appendNumber(data);
  28. break;
  29. case "string":
  30. appendString(data);
  31. break;
  32. case "object":
  33. if (data === null) {
  34. appendNull(data);
  35. } else if (data instanceof Date) {
  36. appendDate(data);
  37. } else if (Array.isArray(data)) {
  38. appendArray(data);
  39. } else if (data instanceof Uint8Array || data instanceof Uint8ClampedArray) {
  40. appendBinArray(data);
  41. } else if (data instanceof Int8Array || data instanceof Int16Array || data instanceof Uint16Array ||
  42. data instanceof Int32Array || data instanceof Uint32Array ||
  43. data instanceof Float32Array || data instanceof Float64Array) {
  44. appendArray(data);
  45. } else {
  46. appendObject(data);
  47. }
  48. break;
  49. }
  50. }
  51.  
  52. function appendNull(data) {
  53. appendByte(0xc0);
  54. }
  55.  
  56. function appendBoolean(data) {
  57. appendByte(data ? 0xc3 : 0xc2);
  58. }
  59.  
  60. function appendNumber(data) {
  61. if (isFinite(data) && Math.floor(data) === data) {
  62. if (data >= 0 && data <= 0x7f) {
  63. appendByte(data);
  64. } else if (data < 0 && data >= -0x20) {
  65. appendByte(data);
  66. } else if (data > 0 && data <= 0xff) { // uint8
  67. appendBytes([0xcc, data]);
  68. } else if (data >= -0x80 && data <= 0x7f) { // int8
  69. appendBytes([0xd0, data]);
  70. } else if (data > 0 && data <= 0xffff) { // uint16
  71. appendBytes([0xcd, data >>> 8, data]);
  72. } else if (data >= -0x8000 && data <= 0x7fff) { // int16
  73. appendBytes([0xd1, data >>> 8, data]);
  74. } else if (data > 0 && data <= 0xffffffff) { // uint32
  75. appendBytes([0xce, data >>> 24, data >>> 16, data >>> 8, data]);
  76. } else if (data >= -0x80000000 && data <= 0x7fffffff) { // int32
  77. appendBytes([0xd2, data >>> 24, data >>> 16, data >>> 8, data]);
  78. } else if (data > 0 && data <= 0xffffffffffffffff) { // uint64
  79. let hi = data / pow32;
  80. let lo = data % pow32;
  81. appendBytes([0xd3, hi >>> 24, hi >>> 16, hi >>> 8, hi, lo >>> 24, lo >>> 16, lo >>> 8, lo]);
  82. } else if (data >= -0x8000000000000000 && data <= 0x7fffffffffffffff) { // int64
  83. appendByte(0xd3);
  84. appendInt64(data);
  85. } else if (data < 0) { // below int64
  86. appendBytes([0xd3, 0x80, 0, 0, 0, 0, 0, 0, 0]);
  87. } else { // above uint64
  88. appendBytes([0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]);
  89. }
  90. } else {
  91. if (!floatView) {
  92. floatBuffer = new ArrayBuffer(8);
  93. floatView = new DataView(floatBuffer);
  94. }
  95. floatView.setFloat64(0, data);
  96. appendByte(0xcb);
  97. appendBytes(new Uint8Array(floatBuffer));
  98. }
  99. }
  100.  
  101. function appendString(data) {
  102. let bytes = encodeUtf8(data);
  103. let length = bytes.length;
  104.  
  105. if (length <= 0x1f) {
  106. appendByte(0xa0 + length);
  107. } else if (length <= 0xff) {
  108. appendBytes([0xd9, length]);
  109. } else if (length <= 0xffff) {
  110. appendBytes([0xda, length >>> 8, length]);
  111. } else {
  112. appendBytes([0xdb, length >>> 24, length >>> 16, length >>> 8, length]);
  113. }
  114.  
  115. appendBytes(bytes);
  116. }
  117.  
  118. function appendArray(data) {
  119. let length = data.length;
  120.  
  121. if (length <= 0xf) {
  122. appendByte(0x90 + length);
  123. } else if (length <= 0xffff) {
  124. appendBytes([0xdc, length >>> 8, length]);
  125. } else {
  126. appendBytes([0xdd, length >>> 24, length >>> 16, length >>> 8, length]);
  127. }
  128.  
  129. for (let index = 0; index < length; index++) {
  130. append(data[index]);
  131. }
  132. }
  133.  
  134. function appendBinArray(data) {
  135. let length = data.length;
  136.  
  137. if (length <= 0xf) {
  138. appendBytes([0xc4, length]);
  139. } else if (length <= 0xffff) {
  140. appendBytes([0xc5, length >>> 8, length]);
  141. } else {
  142. appendBytes([0xc6, length >>> 24, length >>> 16, length >>> 8, length]);
  143. }
  144.  
  145. appendBytes(data);
  146. }
  147.  
  148. function appendObject(data) {
  149. let length = 0;
  150. for (let key in data) length++;
  151.  
  152. if (length <= 0xf) {
  153. appendByte(0x80 + length);
  154. } else if (length <= 0xffff) {
  155. appendBytes([0xde, length >>> 8, length]);
  156. } else {
  157. appendBytes([0xdf, length >>> 24, length >>> 16, length >>> 8, length]);
  158. }
  159.  
  160. for (let key in data) {
  161. append(key);
  162. append(data[key]);
  163. }
  164. }
  165.  
  166. function appendDate(data) {
  167. let sec = data.getTime() / 1000;
  168. if (data.getMilliseconds() === 0 && sec >= 0 && sec < 0x100000000) { // 32 bit seconds
  169. appendBytes([0xd6, 0xff, sec >>> 24, sec >>> 16, sec >>> 8, sec]);
  170. }
  171. else if (sec >= 0 && sec < 0x400000000) { // 30 bit nanoseconds, 34 bit seconds
  172. let ns = data.getMilliseconds() * 1000000;
  173. appendBytes([0xd7, 0xff, ns >>> 22, ns >>> 14, ns >>> 6, ((ns << 2) >>> 0) | (sec / pow32), sec >>> 24, sec >>> 16, sec >>> 8, sec]);
  174. }
  175. else { // 32 bit nanoseconds, 64 bit seconds, negative values allowed
  176. let ns = data.getMilliseconds() * 1000000;
  177. appendBytes([0xc7, 12, 0xff, ns >>> 24, ns >>> 16, ns >>> 8, ns]);
  178. appendInt64(sec);
  179. }
  180. }
  181.  
  182. function appendByte(byte) {
  183. if (array.length < length + 1) {
  184. let newLength = array.length * 2;
  185. while (newLength < length + 1)
  186. newLength *= 2;
  187. let newArray = new Uint8Array(newLength);
  188. newArray.set(array);
  189. array = newArray;
  190. }
  191. array[length] = byte;
  192. length++;
  193. }
  194.  
  195. function appendBytes(bytes) {
  196. if (array.length < length + bytes.length) {
  197. let newLength = array.length * 2;
  198. while (newLength < length + bytes.length)
  199. newLength *= 2;
  200. let newArray = new Uint8Array(newLength);
  201. newArray.set(array);
  202. array = newArray;
  203. }
  204. array.set(bytes, length);
  205. length += bytes.length;
  206. }
  207.  
  208. function appendInt64(value) {
  209. let hi, lo;
  210. if (value >= 0) {
  211. hi = value / pow32;
  212. lo = value % pow32;
  213. }
  214. else {
  215. value++;
  216. hi = Math.abs(value) / pow32;
  217. lo = Math.abs(value) % pow32;
  218. hi = ~hi;
  219. lo = ~lo;
  220. }
  221. appendBytes([hi >>> 24, hi >>> 16, hi >>> 8, hi, lo >>> 24, lo >>> 16, lo >>> 8, lo]);
  222. }
  223. }
  224.  
  225. function deserialize(array) {
  226. const pow32 = 0x100000000; // 2^32
  227. let pos = 0;
  228. if (array instanceof ArrayBuffer) {
  229. array = new Uint8Array(array);
  230. }
  231. if (typeof array !== "object" || typeof array.length === "undefined") {
  232. throw new Error("Invalid argument type: Expected a byte array (Array or Uint8Array) to deserialize.");
  233. }
  234. if (!array.length) {
  235. throw new Error("Invalid argument: The byte array to deserialize is empty.");
  236. }
  237. if (!(array instanceof Uint8Array)) {
  238. array = new Uint8Array(array);
  239. }
  240. let data = read();
  241. if (pos < array.length) {
  242. }
  243. return data;
  244.  
  245. function read() {
  246. const byte = array[pos++];
  247. if (byte >= 0x00 && byte <= 0x7f) return byte; // positive fixint
  248. if (byte >= 0x80 && byte <= 0x8f) return readMap(byte - 0x80); // fixmap
  249. if (byte >= 0x90 && byte <= 0x9f) return readArray(byte - 0x90); // fixarray
  250. if (byte >= 0xa0 && byte <= 0xbf) return readStr(byte - 0xa0); // fixstr
  251. if (byte === 0xc0) return null; // nil
  252. if (byte === 0xc1) throw new Error("Invalid byte code 0xc1 found."); // never used
  253. if (byte === 0xc2) return false // false
  254. if (byte === 0xc3) return true; // true
  255. if (byte === 0xc4) return readBin(-1, 1); // bin 8
  256. if (byte === 0xc5) return readBin(-1, 2); // bin 16
  257. if (byte === 0xc6) return readBin(-1, 4); // bin 32
  258. if (byte === 0xc7) return readExt(-1, 1); // ext 8
  259. if (byte === 0xc8) return readExt(-1, 2); // ext 16
  260. if (byte === 0xc9) return readExt(-1, 4) // ext 32
  261. if (byte === 0xca) return readFloat(4); // float 32
  262. if (byte === 0xcb) return readFloat(8); // float 64
  263. if (byte === 0xcc) return readUInt(1); // uint 8
  264. if (byte === 0xcd) return readUInt(2); // uint 16
  265. if (byte === 0xce) return readUInt(4); // uint 32
  266. if (byte === 0xcf) return readUInt(8) // uint 64
  267. if (byte === 0xd0) return readInt(1); // int 8
  268. if (byte === 0xd1) return readInt(2); // int 16
  269. if (byte === 0xd2) return readInt(4); // int 32
  270. if (byte === 0xd3) return readInt(8); // int 64
  271. if (byte === 0xd4) return readExt(1); // fixext 1
  272. if (byte === 0xd5) return readExt(2); // fixext 2
  273. if (byte === 0xd6) return readExt(4); // fixext 4
  274. if (byte === 0xd7) return readExt(8); // fixext 8
  275. if (byte === 0xd8) return readExt(16); // fixext 16
  276. if (byte === 0xd9) return readStr(-1, 1); // str 8
  277. if (byte === 0xda) return readStr(-1, 2); // str 16
  278. if (byte === 0xdb) return readStr(-1, 4); // str 32
  279. if (byte === 0xdc) return readArray(-1, 2); // array 16
  280. if (byte === 0xdd) return readArray(-1, 4); // array 32
  281. if (byte === 0xde) return readMap(-1, 2); // map 16
  282. if (byte === 0xdf) return readMap(-1, 4); // map 32
  283. if (byte >= 0xe0 && byte <= 0xff) return byte - 256; // negative fixint
  284. console.debug("msgpack array:", array);
  285. throw new Error("Invalid byte value '" + byte + "' at index " + (pos - 1) + " in the MessagePack binary data (length " + array.length + "): Expecting a range of 0 to 255. This is not a byte array.");
  286. }
  287.  
  288. function readInt(size) {
  289. let value = 0;
  290. let first = true;
  291. while (size-- > 0) {
  292. if (first) {
  293. let byte = array[pos++];
  294. value += byte & 0x7f;
  295. if (byte & 0x80) {
  296. value -= 0x80;
  297. }
  298. first = false;
  299. }
  300. else {
  301. value *= 256;
  302. value += array[pos++];
  303. }
  304. }
  305. return value;
  306. }
  307.  
  308. function readUInt(size) {
  309. let value = 0;
  310. while (size-- > 0) {
  311. value *= 256;
  312. value += array[pos++];
  313. }
  314. return value;
  315. }
  316.  
  317. function readFloat(size) {
  318. let view = new DataView(array.buffer, pos, size);
  319. pos += size;
  320. if (size === 4) {
  321. return view.getFloat32(0, false);
  322. }
  323. if (size === 8) {
  324. return view.getFloat64(0, false);
  325. }
  326. }
  327.  
  328. function readBin(size, lengthSize) {
  329. if (size < 0) size = readUInt(lengthSize);
  330. let data = array.subarray(pos, pos + size);
  331. pos += size;
  332. return data;
  333. }
  334.  
  335. function readMap(size, lengthSize) {
  336. if (size < 0) size = readUInt(lengthSize);
  337. let data = {};
  338. while (size-- > 0) {
  339. let key = read();
  340. data[key] = read();
  341. }
  342. return data;
  343. }
  344.  
  345. function readArray(size, lengthSize) {
  346. if (size < 0) size = readUInt(lengthSize);
  347. let data = [];
  348. while (size-- > 0) {
  349. data.push(read());
  350. }
  351. return data;
  352. }
  353.  
  354. function readStr(size, lengthSize) {
  355. if (size < 0) size = readUInt(lengthSize);
  356. let start = pos;
  357. pos += size;
  358. return decodeUtf8(array, start, size);
  359. }
  360.  
  361. function readExt(size, lengthSize) {
  362. if (size < 0) size = readUInt(lengthSize);
  363. let type = readUInt(1);
  364. let data = readBin(size);
  365. switch (type) {
  366. case 255:
  367. return readExtDate(data);
  368. }
  369. return { type: type, data: data };
  370. }
  371.  
  372. function readExtDate(data) {
  373. if (data.length === 4) {
  374. let sec = ((data[0] << 24) >>> 0) +
  375. ((data[1] << 16) >>> 0) +
  376. ((data[2] << 8) >>> 0) +
  377. data[3];
  378. return new Date(sec * 1000);
  379. }
  380. if (data.length === 8) {
  381. let ns = ((data[0] << 22) >>> 0) +
  382. ((data[1] << 14) >>> 0) +
  383. ((data[2] << 6) >>> 0) +
  384. (data[3] >>> 2);
  385. let sec = ((data[3] & 0x3) * pow32) +
  386. ((data[4] << 24) >>> 0) +
  387. ((data[5] << 16) >>> 0) +
  388. ((data[6] << 8) >>> 0) +
  389. data[7];
  390. return new Date(sec * 1000 + ns / 1000000);
  391. }
  392. if (data.length === 12) {
  393. let ns = ((data[0] << 24) >>> 0) +
  394. ((data[1] << 16) >>> 0) +
  395. ((data[2] << 8) >>> 0) +
  396. data[3];
  397. pos -= 8;
  398. let sec = readInt(8);
  399. return new Date(sec * 1000 + ns / 1000000);
  400. }
  401. throw new Error("Invalid data length for a date value.");
  402. }
  403. }
  404.  
  405. function encodeUtf8(str) {
  406. let ascii = true, length = str.length;
  407. for (let x = 0; x < length; x++) {
  408. if (str.charCodeAt(x) > 127) {
  409. ascii = false;
  410. break;
  411. }
  412. }
  413.  
  414. let i = 0, bytes = new Uint8Array(str.length * (ascii ? 1 : 4));
  415. for (let ci = 0; ci !== length; ci++) {
  416. let c = str.charCodeAt(ci);
  417. if (c < 128) {
  418. bytes[i++] = c;
  419. continue;
  420. }
  421. if (c < 2048) {
  422. bytes[i++] = c >> 6 | 192;
  423. }
  424. else {
  425. if (c > 0xd7ff && c < 0xdc00) {
  426. if (++ci >= length)
  427. throw new Error("UTF-8 encode: incomplete surrogate pair");
  428. let c2 = str.charCodeAt(ci);
  429. if (c2 < 0xdc00 || c2 > 0xdfff)
  430. throw new Error("UTF-8 encode: second surrogate character 0x" + c2.toString(16) + " at index " + ci + " out of range");
  431. c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);
  432. bytes[i++] = c >> 18 | 240;
  433. bytes[i++] = c >> 12 & 63 | 128;
  434. }
  435. else bytes[i++] = c >> 12 | 224;
  436. bytes[i++] = c >> 6 & 63 | 128;
  437. }
  438. bytes[i++] = c & 63 | 128;
  439. }
  440. return ascii ? bytes : bytes.subarray(0, i);
  441. }
  442.  
  443. function decodeUtf8(bytes, start, length) {
  444. let i = start, str = "";
  445. length += start;
  446. while (i < length) {
  447. let c = bytes[i++];
  448. if (c > 127) {
  449. if (c > 191 && c < 224) {
  450. if (i >= length)
  451. throw new Error("UTF-8 decode: incomplete 2-byte sequence");
  452. c = (c & 31) << 6 | bytes[i++] & 63;
  453. }
  454. else if (c > 223 && c < 240) {
  455. if (i + 1 >= length)
  456. throw new Error("UTF-8 decode: incomplete 3-byte sequence");
  457. c = (c & 15) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63;
  458. }
  459. else if (c > 239 && c < 248) {
  460. if (i + 2 >= length)
  461. throw new Error("UTF-8 decode: incomplete 4-byte sequence");
  462. c = (c & 7) << 18 | (bytes[i++] & 63) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63;
  463. }
  464. else throw new Error("UTF-8 decode: unknown multibyte start 0x" + c.toString(16) + " at index " + (i - 1));
  465. }
  466. if (c <= 0xffff) str += String.fromCharCode(c);
  467. else if (c <= 0x10ffff) {
  468. c -= 0x10000;
  469. str += String.fromCharCode(c >> 10 | 0xd800)
  470. str += String.fromCharCode(c & 0x3FF | 0xdc00)
  471. }
  472. else throw new Error("UTF-8 decode: code point 0x" + c.toString(16) + " exceeds UTF-16 reach");
  473. }
  474. return str;
  475. }
  476.  
  477. let msgpack = {
  478. serialize: serialize,
  479. deserialize: deserialize,
  480.  
  481. encode: serialize,
  482. decode: deserialize
  483. };
  484.  
  485. if (typeof module === "object" && module && typeof module.exports === "object") {
  486. module.exports = msgpack;
  487. }
  488. else {
  489. window[window.msgpackJsName || "msgpack"] = msgpack;
  490. }
  491.  
  492. })();
  493. !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("guify",[],n):"object"==typeof exports?exports.guify=n():e.guify=n()}(this,function(){return function(e){function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=16)}([function(e,n,t){function o(e,n,t){var o=l[n];if(void 0===o&&(o=r(n)),o){if(void 0===t)return e.style[o];e.style[o]=c(o,t)}}function i(e,n){for(var t in n)n.hasOwnProperty(t)&&o(e,t,n[t])}function r(e){var n=u(e),t=s(n);return l[n]=l[e]=l[t]=t,t}function a(){2===arguments.length?"string"==typeof arguments[1]?arguments[0].style.cssText=arguments[1]:i(arguments[0],arguments[1]):o(arguments[0],arguments[1],arguments[2])}var s=t(18),u=t(19),l={float:"cssFloat"},c=t(22);e.exports=a,e.exports.set=a,e.exports.get=function(e,n){return Array.isArray(n)?n.reduce(function(n,t){return n[t]=o(e,t||""),n},{}):o(e,n||"")}},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.theme=void 0;var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=t(9),a=(function(e){e&&e.__esModule}(r),function(){function e(){o(this,e)}return i(e,[{key:"Set",value:function(e){Object.assign(this,s,e)}}]),e}()),s={name:"BaseTheme",colors:{menuBarBackground:"black",menuBarText:"black",panelBackground:"black",componentBackground:"black",componentBackgroundHover:"black",componentForeground:"black",componentActive:"black",textPrimary:"black",textSecondary:"black",textHover:"black",textActive:"black"},sizing:{menuBarHeight:"25px",componentHeight:"20px",componentSpacing:"5px",labelWidth:"42%"}};n.theme=new a},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=t(0),i=function(e){return e&&e.__esModule?e:{default:e}}(o),r=function(e,n,t){var o=e.appendChild(document.createElement("div"));return o.classList.add("guify-component-container"),(0,i.default)(o,{position:"relative","min-height":t.sizing.componentHeight,"margin-bottom":t.sizing.componentSpacing}),o};n.default=r,e.exports=n.default},function(e,n,t){"use strict";var o=t(31);e.exports=o,e.exports.csjs=o,e.exports.getCss=t(45)},function(e,n,t){var o;!function(n){"use strict";function i(){}function r(e,n){for(var t=e.length;t--;)if(e[t].listener===n)return t;return-1}function a(e){return function(){return this[e].apply(this,arguments)}}function s(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&s(e.listener)}var u=i.prototype,l=n.EventEmitter;u.getListeners=function(e){var n,t,o=this._getEvents();if(e instanceof RegExp){n={};for(t in o)o.hasOwnProperty(t)&&e.test(t)&&(n[t]=o[t])}else n=o[e]||(o[e]=[]);return n},u.flattenListeners=function(e){var n,t=[];for(n=0;n<e.length;n+=1)t.push(e[n].listener);return t},u.getListenersAsObject=function(e){var n,t=this.getListeners(e);return t instanceof Array&&(n={},n[e]=t),n||t},u.addListener=function(e,n){if(!s(n))throw new TypeError("listener must be a function");var t,o=this.getListenersAsObject(e),i="object"==typeof n;for(t in o)o.hasOwnProperty(t)&&-1===r(o[t],n)&&o[t].push(i?n:{listener:n,once:!1});return this},u.on=a("addListener"),u.addOnceListener=function(e,n){return this.addListener(e,{listener:n,once:!0})},u.once=a("addOnceListener"),u.defineEvent=function(e){return this.getListeners(e),this},u.defineEvents=function(e){for(var n=0;n<e.length;n+=1)this.defineEvent(e[n]);return this},u.removeListener=function(e,n){var t,o,i=this.getListenersAsObject(e);for(o in i)i.hasOwnProperty(o)&&-1!==(t=r(i[o],n))&&i[o].splice(t,1);return this},u.off=a("removeListener"),u.addListeners=function(e,n){return this.manipulateListeners(!1,e,n)},u.removeListeners=function(e,n){return this.manipulateListeners(!0,e,n)},u.manipulateListeners=function(e,n,t){var o,i,r=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof n||n instanceof RegExp)for(o=t.length;o--;)r.call(this,n,t[o]);else for(o in n)n.hasOwnProperty(o)&&(i=n[o])&&("function"==typeof i?r.call(this,o,i):a.call(this,o,i));return this},u.removeEvent=function(e){var n,t=typeof e,o=this._getEvents();if("string"===t)delete o[e];else if(e instanceof RegExp)for(n in o)o.hasOwnProperty(n)&&e.test(n)&&delete o[n];else delete this._events;return this},u.removeAllListeners=a("removeEvent"),u.emitEvent=function(e,n){var t,o,i,r,a=this.getListenersAsObject(e);for(r in a)if(a.hasOwnProperty(r))for(t=a[r].slice(0),i=0;i<t.length;i++)o=t[i],!0===o.once&&this.removeListener(e,o.listener),o.listener.apply(this,n||[])===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},u.trigger=a("emitEvent"),u.emit=function(e){var n=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,n)},u.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},u._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},u._getEvents=function(){return this._events||(this._events={})},i.noConflict=function(){return n.EventEmitter=l,i},void 0!==(o=function(){return i}.call(n,t,n,e))&&(e.exports=o)}("undefined"!=typeof window?window:this||{})},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=t(0),i=function(e){return e&&e.__esModule?e:{default:e}}(o);n.default=function(e,n,t){var o=e.appendChild(document.createElement("div"));(0,i.default)(o,{left:0,width:"calc("+t.sizing.labelWidth+" - 2%)",display:"inline-block","margin-right":"2%",verticalAlign:"top"});var r=o.appendChild(document.createElement("div"));return r.innerHTML=n,(0,i.default)(r,{color:t.colors.textPrimary,display:"inline-block",verticalAlign:"sub","min-height":t.sizing.componentHeight,"line-height":t.sizing.componentHeight}),r},e.exports=n.default},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=t(0),i=function(e){return e&&e.__esModule?e:{default:e}}(o);n.default=function(e,n,t,o,r){var a=e.appendChild(document.createElement("input"));a.type="text",a.value=n;var s={position:"absolute",backgroundColor:t.colors.componentBackground,paddingLeft:"1%",height:t.sizing.componentHeight,width:o,display:"inline-block",overflow:"hidden",border:"none","font-family":"'Hack', monospace","font-size":"11px",color:t.colors.textSecondary,userSelect:"text",cursor:"text",lineHeight:t.sizing.componentHeight,wordBreak:"break-all","box-sizing":"border-box","-moz-box-sizing":"border-box","-webkit-box-sizing":"border-box"};return r||(s.right=0),(0,i.default)(a,s),a},e.exports=n.default},function(e,n,t){"use strict";function o(e,n,t){var o=e.join(" ");return Object.create(a.prototype,{classNames:{value:Object.freeze(e),configurable:!1,writable:!1,enumerable:!0},unscoped:{value:Object.freeze(n),configurable:!1,writable:!1,enumerable:!0},className:{value:o,configurable:!1,writable:!1,enumerable:!0},selector:{value:e.map(function(e){return t?e:"."+e}).join(", "),configurable:!1,writable:!1,enumerable:!0},toString:{value:function(){return o},configurable:!1,writeable:!1,enumerable:!1}})}function i(e){return e instanceof a}function r(e){return e.reduce(function(e,n){return i(n)&&n.classNames.forEach(function(t,o){e[t]=n.unscoped[o]}),e},{})}function a(){}e.exports={makeComposition:o,isComposition:i,ignoreComposition:r}},function(e,n,t){"use strict";var o=/(\.)(?!\d)([^\s\.,{\[>+~#:)]*)(?![^{]*})/.source,i=/(@\S*keyframes\s*)([^{\s]*)/.source,r=/(?!(?:[^*\/]|\*[^\/]|\/[^*])*\*+\/)/.source,a=new RegExp(o+r,"g"),s=new RegExp(i+r,"g");e.exports={classRegex:a,keyframesRegex:s,ignoreComments:r}},function(e,n,t){"use strict";e.exports={light:{name:"Light",colors:{menuBarBackground:"rgb(227, 227, 227)",menuBarText:"rgb(36, 36, 36)",panelBackground:"rgb(227, 227, 227)",componentBackground:"rgb(204, 204, 204)",componentBackgroundHover:"rgb(190, 190, 190)",componentForeground:"rgb(105, 105, 105)",componentActive:"rgb(36, 36, 36)",textPrimary:"rgb(36, 36, 36)",textSecondary:"rgb(87, 87, 87)",textHover:"rgb(204, 204, 204)",textActive:"rgb(204, 204, 204)"}},dark:{name:"Dark",colors:{menuBarBackground:"rgb(35, 35, 35)",menuBarText:"rgb(235, 235, 235)",panelBackground:"rgb(35, 35, 35)",componentBackground:"rgb(54, 54, 54)",componentBackgroundHover:"rgb(76, 76, 76)",componentForeground:"rgb(112, 112, 112)",componentActive:"rgb(202, 202, 202)",textPrimary:"rgb(235, 235, 235)",textSecondary:"rgb(181, 181, 181)",textHover:"rgb(235, 235, 235)",textActive:"rgb(54, 54, 54)"}},yorha:{name:"YoRHa",colors:{menuBarBackground:"#CCC8B1",menuBarText:"#454138",panelBackground:"#CCC8B1",componentBackground:"#BAB5A1",componentBackgroundHover:"#877F6E",componentForeground:"#454138",componentActive:"#978F7E",textPrimary:"#454138",textSecondary:"#454138",textHover:"#CCC8B1",textActive:"#CCC8B1"},font:{fontFamily:"helvetica, sans-serif",fontSize:"14px",fontWeight:"100"}}}},function(e,n,t){!function(t){"use strict";function o(e){return"number"==typeof e&&!isNaN(e)||!!(e=(e||"").toString().trim())&&!isNaN(e)}void 0!==e&&e.exports&&(n=e.exports=o),n.isNumeric=o}()},function(e,n,t){"use strict";e.exports=" css "},function(e,n,t){"use strict";e.exports=t(44)},function(e,n){function t(e,n){if(n=n||{},void 0===e)throw new Error(a);var t=!0===n.prepend?"prepend":"append",s=void 0!==n.container?n.container:document.querySelector("head"),u=i.indexOf(s);-1===u&&(u=i.push(s)-1,r[u]={});var l;return void 0!==r[u]&&void 0!==r[u][t]?l=r[u][t]:(l=r[u][t]=o(),"prepend"===t?s.insertBefore(l,s.childNodes[0]):s.appendChild(l)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),l.styleSheet?l.styleSheet.cssText+=e:l.textContent+=e,l}function o(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}var i=[],r=[],a="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";e.exports=t,e.exports.insertCss=t},function(e,n,t){var o;!function(i){function r(e,n){if(e=e||"",n=n||{},e instanceof r)return e;if(!(this instanceof r))return new r(e,n);var t=a(e);this._originalInput=e,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=D(100*this._a)/100,this._format=n.format||t.format,this._gradientType=n.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=t.ok,this._tc_id=I++}function a(e){var n={r:0,g:0,b:0},t=1,o=null,i=null,r=null,a=!1,u=!1;return"string"==typeof e&&(e=V(e)),"object"==typeof e&&(B(e.r)&&B(e.g)&&B(e.b)?(n=s(e.r,e.g,e.b),a=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):B(e.h)&&B(e.s)&&B(e.v)?(o=F(e.s),i=F(e.v),n=f(e.h,o,i),a=!0,u="hsv"):B(e.h)&&B(e.s)&&B(e.l)&&(o=F(e.s),r=F(e.l),n=l(e.h,o,r),a=!0,u="hsl"),e.hasOwnProperty("a")&&(t=e.a)),t=j(t),{ok:a,format:e.format||u,r:q(255,W(n.r,0)),g:q(255,W(n.g,0)),b:q(255,W(n.b,0)),a:t}}function s(e,n,t){return{r:255*C(e,255),g:255*C(n,255),b:255*C(t,255)}}function u(e,n,t){e=C(e,255),n=C(n,255),t=C(t,255);var o,i,r=W(e,n,t),a=q(e,n,t),s=(r+a)/2;if(r==a)o=i=0;else{var u=r-a;switch(i=s>.5?u/(2-r-a):u/(r+a),r){case e:o=(n-t)/u+(n<t?6:0);break;case n:o=(t-e)/u+2;break;case t:o=(e-n)/u+4}o/=6}return{h:o,s:i,l:s}}function l(e,n,t){function o(e,n,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+6*(n-e)*t:t<.5?n:t<2/3?e+(n-e)*(2/3-t)*6:e}var i,r,a;if(e=C(e,360),n=C(n,100),t=C(t,100),0===n)i=r=a=t;else{var s=t<.5?t*(1+n):t+n-t*n,u=2*t-s;i=o(u,s,e+1/3),r=o(u,s,e),a=o(u,s,e-1/3)}return{r:255*i,g:255*r,b:255*a}}function c(e,n,t){e=C(e,255),n=C(n,255),t=C(t,255);var o,i,r=W(e,n,t),a=q(e,n,t),s=r,u=r-a;if(i=0===r?0:u/r,r==a)o=0;else{switch(r){case e:o=(n-t)/u+(n<t?6:0);break;case n:o=(t-e)/u+2;break;case t:o=(e-n)/u+4}o/=6}return{h:o,s:i,v:s}}function f(e,n,t){e=6*C(e,360),n=C(n,100),t=C(t,100);var o=i.floor(e),r=e-o,a=t*(1-n),s=t*(1-r*n),u=t*(1-(1-r)*n),l=o%6;return{r:255*[t,s,a,a,u,t][l],g:255*[u,t,t,s,a,a][l],b:255*[a,a,u,t,t,s][l]}}function p(e,n,t,o){var i=[P(D(e).toString(16)),P(D(n).toString(16)),P(D(t).toString(16))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function h(e,n,t,o,i){var r=[P(D(e).toString(16)),P(D(n).toString(16)),P(D(t).toString(16)),P(T(o))];return i&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)&&r[3].charAt(0)==r[3].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function d(e,n,t,o){return[P(T(o)),P(D(e).toString(16)),P(D(n).toString(16)),P(D(t).toString(16))].join("")}function g(e,n){n=0===n?0:n||10;var t=r(e).toHsl();return t.s-=n/100,t.s=O(t.s),r(t)}function b(e,n){n=0===n?0:n||10;var t=r(e).toHsl();return t.s+=n/100,t.s=O(t.s),r(t)}function m(e){return r(e).desaturate(100)}function y(e,n){n=0===n?0:n||10;var t=r(e).toHsl();return t.l+=n/100,t.l=O(t.l),r(t)}function v(e,n){n=0===n?0:n||10;var t=r(e).toRgb();return t.r=W(0,q(255,t.r-D(-n/100*255))),t.g=W(0,q(255,t.g-D(-n/100*255))),t.b=W(0,q(255,t.b-D(-n/100*255))),r(t)}function x(e,n){n=0===n?0:n||10;var t=r(e).toHsl();return t.l-=n/100,t.l=O(t.l),r(t)}function w(e,n){var t=r(e).toHsl(),o=(t.h+n)%360;return t.h=o<0?360+o:o,r(t)}function k(e){var n=r(e).toHsl();return n.h=(n.h+180)%360,r(n)}function _(e){var n=r(e).toHsl(),t=n.h;return[r(e),r({h:(t+120)%360,s:n.s,l:n.l}),r({h:(t+240)%360,s:n.s,l:n.l})]}function S(e){var n=r(e).toHsl(),t=n.h;return[r(e),r({h:(t+90)%360,s:n.s,l:n.l}),r({h:(t+180)%360,s:n.s,l:n.l}),r({h:(t+270)%360,s:n.s,l:n.l})]}function z(e){var n=r(e).toHsl(),t=n.h;return[r(e),r({h:(t+72)%360,s:n.s,l:n.l}),r({h:(t+216)%360,s:n.s,l:n.l})]}function E(e,n,t){n=n||6,t=t||30;var o=r(e).toHsl(),i=360/t,a=[r(e)];for(o.h=(o.h-(i*n>>1)+720)%360;--n;)o.h=(o.h+i)%360,a.push(r(o));return a}function M(e,n){n=n||6;for(var t=r(e).toHsv(),o=t.h,i=t.s,a=t.v,s=[],u=1/n;n--;)s.push(r({h:o,s:i,v:a})),a=(a+u)%1;return s}function j(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(e,n){A(e)&&(e="100%");var t=L(e);return e=q(n,W(0,parseFloat(e))),t&&(e=parseInt(e*n,10)/100),i.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function O(e){return q(1,W(0,e))}function H(e){return parseInt(e,16)}function A(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)}function L(e){return"string"==typeof e&&-1!=e.indexOf("%")}function P(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function T(e){return i.round(255*parseFloat(e)).toString(16)}function R(e){return H(e)/255}function B(e){return!!Z.CSS_UNIT.exec(e)}function V(e){e=e.replace(N,"").replace($,"").toLowerCase();var n=!1;if(X[e])e=X[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Z.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Z.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Z.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Z.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Z.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Z.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Z.hex8.exec(e))?{r:H(t[1]),g:H(t[2]),b:H(t[3]),a:R(t[4]),format:n?"name":"hex8"}:(t=Z.hex6.exec(e))?{r:H(t[1]),g:H(t[2]),b:H(t[3]),format:n?"name":"hex"}:(t=Z.hex4.exec(e))?{r:H(t[1]+""+t[1]),g:H(t[2]+""+t[2]),b:H(t[3]+""+t[3]),a:R(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=Z.hex3.exec(e))&&{r:H(t[1]+""+t[1]),g:H(t[2]+""+t[2]),b:H(t[3]+""+t[3]),format:n?"name":"hex"}}function U(e){var n,t;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),t=(e.size||"small").toLowerCase(),"AA"!==n&&"AAA"!==n&&(n="AA"),"small"!==t&&"large"!==t&&(t="small"),{level:n,size:t}}var N=/^\s+/,$=/\s+$/,I=0,D=i.round,q=i.min,W=i.max,G=i.random;r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,n,t,o,r,a,s=this.toRgb();return e=s.r/255,n=s.g/255,t=s.b/255,o=e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4),r=n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4),a=t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4),.2126*o+.7152*r+.0722*a},setAlpha:function(e){return this._a=j(e),this._roundA=D(100*this._a)/100,this},toHsv:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=c(this._r,this._g,this._b),n=D(360*e.h),t=D(100*e.s),o=D(100*e.v);return 1==this._a?"hsv("+n+", "+t+"%, "+o+"%)":"hsva("+n+", "+t+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),n=D(360*e.h),t=D(100*e.s),o=D(100*e.l);return 1==this._a?"hsl("+n+", "+t+"%, "+o+"%)":"hsla("+n+", "+t+"%, "+o+"%, "+this._roundA+")"},toHex:function(e){return p(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return h(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(100*C(this._r,255))+"%",g:D(100*C(this._g,255))+"%",b:D(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+D(100*C(this._r,255))+"%, "+D(100*C(this._g,255))+"%, "+D(100*C(this._b,255))+"%)":"rgba("+D(100*C(this._r,255))+"%, "+D(100*C(this._g,255))+"%, "+D(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var n="#"+d(this._r,this._g,this._b,this._a),t=n,o=this._gradientType?"GradientType = 1, ":"";if(e){var i=r(e);t="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+t+")"},toString:function(e){var n=!!e;e=e||this._format;var t=!1,o=this._a<1&&this._a>=0;return n||!o||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(t=this.toRgbString()),"prgb"===e&&(t=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(t=this.toHexString()),"hex3"===e&&(t=this.toHexString(!0)),"hex4"===e&&(t=this.toHex8String(!0)),"hex8"===e&&(t=this.toHex8String()),"name"===e&&(t=this.toName()),"hsl"===e&&(t=this.toHslString()),"hsv"===e&&(t=this.toHsvString()),t||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(e,n){var t=e.apply(null,[this].concat([].slice.call(n)));return this._r=t._r,this._g=t._g,this._b=t._b,this.setAlpha(t._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(k,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(z,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},r.fromRatio=function(e,n){if("object"==typeof e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[o]="a"===o?e[o]:F(e[o]));e=t}return r(e,n)},r.equals=function(e,n){return!(!e||!n)&&r(e).toRgbString()==r(n).toRgbString()},r.random=function(){return r.fromRatio({r:G(),g:G(),b:G()})},r.mix=function(e,n,t){t=0===t?0:t||50;var o=r(e).toRgb(),i=r(n).toRgb(),a=t/100;return r({r:(i.r-o.r)*a+o.r,g:(i.g-o.g)*a+o.g,b:(i.b-o.b)*a+o.b,a:(i.a-o.a)*a+o.a})},r.readability=function(e,n){var t=r(e),o=r(n);return(i.max(t.getLuminance(),o.getLuminance())+.05)/(i.min(t.getLuminance(),o.getLuminance())+.05)},r.isReadable=function(e,n,t){var o,i,a=r.readability(e,n);switch(i=!1,o=U(t),o.level+o.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},r.mostReadable=function(e,n,t){var o,i,a,s,u=null,l=0;t=t||{},i=t.includeFallbackColors,a=t.level,s=t.size;for(var c=0;c<n.length;c++)(o=r.readability(e,n[c]))>l&&(l=o,u=r(n[c]));return r.isReadable(e,u,{level:a,size:s})||!i?u:(t.includeFallbackColors=!1,r.mostReadable(e,["#fff","#000"],t))};var X=r.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=r.hexNames=function(e){var n={};for(var t in e)e.hasOwnProperty(t)&&(n[e[t]]=t);return n}(X),Z=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+t),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+t),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+t),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==e&&e.exports?e.exports=r:void 0!==(o=function(){return r}.call(n,t,n,e))&&(e.exports=o)}(Math)},function(e,n){/*!
  494. * screenfull
  495. * v5.0.0 - 2019-09-09
  496. * (c) Sindre Sorhus; MIT License
  497. */
  498. !function(){"use strict";var n="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=void 0!==e&&e.exports,o=function(){for(var e,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],o=0,i=t.length,r={};o<i;o++)if((e=t[o])&&e[1]in n){for(o=0;o<e.length;o++)r[t[0][o]]=e[o];return r}return!1}(),i={change:o.fullscreenchange,error:o.fullscreenerror},r={request:function(e){return new Promise(function(t,i){var r=function(){this.off("change",r),t()}.bind(this);this.on("change",r),e=e||n.documentElement,Promise.resolve(e[o.requestFullscreen]()).catch(i)}.bind(this))},exit:function(){return new Promise(function(e,t){if(!this.isFullscreen)return void e();var i=function(){this.off("change",i),e()}.bind(this);this.on("change",i),Promise.resolve(n[o.exitFullscreen]()).catch(t)}.bind(this))},toggle:function(e){return this.isFullscreen?this.exit():this.request(e)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,t){var o=i[e];o&&n.addEventListener(o,t,!1)},off:function(e,t){var o=i[e];o&&n.removeEventListener(o,t,!1)},raw:o};if(!o)return void(t?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1});Object.defineProperties(r,{isFullscreen:{get:function(){return Boolean(n[o.fullscreenElement])}},element:{enumerable:!0,get:function(){return n[o.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(n[o.fullscreenEnabled])}}}),t?e.exports=r:window.screenfull=r}()},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=t(17),i=function(e){return e&&e.__esModule?e:{default:e}}(o);n.default=i.default,e.exports=n.default},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),a=t(0),s=o(a),u=t(23),l=o(u),c=t(9),f=o(c),p=t(1),h=t(24),d=t(72),g=t(74),b=t(77),m=t(15),y=o(m),v=t(79),x=function(){function e(n){i(this,e),this.opts=n,this.hasRoot=void 0!==n.root,n.width=n.width||300,n.root=n.root||document.body,n.align=n.align||"left",n.opacity=n.opacity||1,n.barMode=n.barMode||"offset",n.panelMode=n.panelMode||"inner",n.pollRateMS=n.pollRateMS||100,n.open=n.open||!1;var t=n.theme;void 0===n.theme&&(t=f.default.dark),(0,l.default)(n.theme)&&(void 0===f.default[n.theme]?(console.error("There is no theme preset with the name '"+n.theme+"'! Defaulting to dark theme."),t=f.default.dark):t=f.default[n.theme]),p.theme.Set(t),this._ConstructElements(),this._LoadStyles(),this.componentManager=new h.ComponentManager,this.loadedComponents=[],this._UpdateComponents()}return r(e,[{key:"_LoadStyles",value:function(){var e=function(e){var n=document.createElement("style");n.setAttribute("type","text/css"),n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(n)};e("//cdn.jsdelivr.net/font-hack/2.019/css/hack.min.css"),p.theme.font?(p.theme.font.fontURL&&e(p.theme.font.fontURL),p.theme.font.fontFamily&&(0,s.default)(this.container,"font-family",p.theme.font.fontFamily),p.theme.font.fontSize&&(0,s.default)(this.container,"font-size",p.theme.font.fontSize),p.theme.font.fontWeight&&(0,s.default)(this.container,"font-weight",p.theme.font.fontWeight)):(0,s.default)(this.container,"font-family","'Hack', monospace")}},{key:"_ConstructElements",value:function(){var e=this;this.container=document.createElement("div"),this.container.classList.add(v["guify-container"]);var n={};"overlay"!=this.opts.barMode&&"above"!=this.opts.barMode&&"none"!=this.opts.barMode||(n.position="absolute"),this.hasRoot&&"above"==this.opts.barMode&&(n.top="-"+p.theme.sizing.menuBarHeight),(0,s.default)(this.container,n),this.opts.root.insertBefore(this.container,this.opts.root.childNodes[0]),"none"!==this.opts.barMode&&(this.bar=new d.MenuBar(this.container,this.opts),this.bar.addListener("ontogglepanel",function(){e.panel.ToggleVisible()}),this.bar.addListener("onfullscreenrequested",function(){e.ToggleFullscreen()})),this.panel=new g.Panel(this.container,this.opts),"none"===this.opts.barMode||!0===this.opts.open?this.panel.SetVisible(!0):this.panel.SetVisible(!1),this.toaster=new b.ToastArea(this.container,this.opts)}},{key:"_UpdateComponents",value:function(){var e=this;this.loadedComponents.forEach(function(e){e.binding&&e.binding.object[e.binding.property]!=e.oldValue&&(e.SetValue(e.binding.object[e.binding.property]),e.oldValue=e.binding.object[e.binding.property])}),setTimeout(function(){window.requestAnimationFrame(function(){e._UpdateComponents()})},this.opts.pollRateMS)}},{key:"Register",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(e)){var o=Object.assign(e,t);return this._Register(o)}e.forEach(function(e){var o=Object.assign(e,t);n._Register(o)})}},{key:"Remove",value:function(e){e.Remove(),this.loadedComponents=this.loadedComponents.filter(function(n){return n!==e})}},{key:"_Register",value:function(e){if(e.object&&e.property&&void 0===e.object[e.property])throw new Error("Object "+e.object+" has no property '"+e.property+"'");e.object&&e.property&&(e.initial=e.object[e.property]);var n=this.panel.panel;if(e.folder){var t=this.loadedComponents.find(function(n){return"folder"===n.opts.type&&n.opts.label===e.folder});if(!t)throw new Error("No folder exists with the name "+e.folder);n=t.folderContainer}var o=this.componentManager.Create(n,e);return e.object&&e.property&&(o.binding={object:e.object,property:e.property}),o.on&&(o.on("initialized",function(n){e.onInitialize&&e.onInitialize(n)}),o.on("input",function(n){e.object&&e.property&&(e.object[e.property]=n),e.onChange&&e.onChange(n)})),this.loadedComponents.push(o),o}},{key:"Toast",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.toaster.CreateToast(e,n,t)}},{key:"ToggleFullscreen",value:function(){y.default.isFullscreen?y.default.exit():(console.log("Request fullscreen"),y.default.request(this.opts.root))}}]),e}();n.default=x,e.exports=n.default},function(e,n){var t=null,o=["Webkit","Moz","O","ms"];e.exports=function(e){t||(t=document.createElement("div"));var n=t.style;if(e in n)return e;for(var i=e.charAt(0).toUpperCase()+e.slice(1),r=o.length;r>=0;r--){var a=o[r]+i;if(a in n)return a}return!1}},function(e,n,t){function o(e){return i(e).replace(/\s(\w)/g,function(e,n){return n.toUpperCase()})}var i=t(20);e.exports=o},function(e,n,t){function o(e){return i(e).replace(/[\W_]+(.|$)/g,function(e,n){return n?" "+n:""}).trim()}var i=t(21);e.exports=o},function(e,n){function t(e){return r.test(e)?e.toLowerCase():a.test(e)?(o(e)||e).toLowerCase():s.test(e)?i(e).toLowerCase():e.toLowerCase()}function o(e){return e.replace(u,function(e,n){return n?" "+n:""})}function i(e){return e.replace(l,function(e,n,t){return n+" "+t.toLowerCase().split("").join(" ")})}e.exports=t;var r=/\s/,a=/(_|-|\.|:)/,s=/([a-z][A-Z]|[A-Z][a-z])/,u=/[\W_]+(.|$)/g,l=/(.)([A-Z]+)/g},function(e,n){var t={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=function(e,n){return"number"!=typeof n||t[e]?n:n+"px"}},function(e,n,t){"use strict";var o=String.prototype.valueOf,i=function(e){try{return o.call(e),!0}catch(e){return!1}},r=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(a?i(e):"[object String]"===r.call(e))}},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.ComponentManager=void 0;var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=t(25),a=function(e){return e&&e.__esModule?e:{default:e}}(r),s=t(1);n.ComponentManager=function(){function e(){o(this,e),this.uuid=(0,a.default)(),this.components={title:t(28),range:t(29),button:t(46),checkbox:t(48),select:t(50),text:t(52),color:t(53),folder:t(65),file:t(67),display:t(69),interval:t(70)}}return i(e,[{key:"Create",value:function(e,n){if(void 0===this.components[n.type])throw new Error("No component type named '"+n.type+"' exists.");var t=new this.components[n.type](e,n,s.theme,this.uuid);return Object.assign(t,{Remove:function(){this.container.parentNode.removeChild(this.container)}}),t}}]),e}()},function(e,n,t){function o(e,n,t){var o=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null),e=e||{};var a=e.random||(e.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var s=0;s<16;++s)n[o+s]=a[s];return n||r(a)}var i=t(26),r=t(27);e.exports=o},function(e,n){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var o=new Uint8Array(16);e.exports=function(){return t(o),o}}else{var i=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),i[n]=e>>>((3&n)<<3)&255;return i}}},function(e,n){function t(e,n){var t=n||0,i=o;return[i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]]].join("")}for(var o=[],i=0;i<256;++i)o[i]=(i+256).toString(16).substr(1);e.exports=t},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=t(0),r=function(e){return e&&e.__esModule?e:{default:e}}(i),a=function e(n,i,a){o(this,e),this.opts=i,this.container=t(2)(n,i.label,a),(0,r.default)(this.container,{});var s=this.container.appendChild(document.createElement("div"));(0,r.default)(s,{"box-sizing":"border-box",width:"100%",display:"inline-block",height:a.sizing.componentHeight,verticalAlign:"top"});var u=s.appendChild(document.createElement("div"));u.innerHTML="&#9632; "+i.label+" &#9632;",(0,r.default)(u,{display:"inline-block",verticalAlign:"sub",height:a.sizing.componentHeight,"line-height":a.sizing.componentHeight,"padding-left":"5px","padding-right":"5px","background-color":a.colors.textPrimary,color:a.colors.panelBackground})};n.default=a,e.exports=n.default},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),u=t(4),l=o(u),c=t(0),f=o(c),p=t(10),h=o(p),d=t(30),g=function(e){function n(e,o,a,s){i(this,n);var u=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));if(u.opts=o,u.container=t(2)(e,o.label,a),t(5)(u.container,o.label,a),o.step&&o.steps)throw new Error("Cannot specify both step and steps. Got step = "+o.step+", steps = ",o.steps);if(u.input=u.container.appendChild(document.createElement("input")),u.input.type="range",u.input.className=d["guify-range"],o.label&&u.input.setAttribute("aria-label",o.label+" input"),"log"===o.scale){if(o.max=(0,h.default)(o.max)?o.max:100,o.min=(0,h.default)(o.min)?o.min:.1,o.min*o.max<=0)throw new Error("Log range min/max must have the same sign and not equal zero. Got min = "+o.min+", max = "+o.max);if(u.logmin=o.min,u.logmax=o.max,u.logsign=o.min>0?1:-1,u.logmin=Math.abs(u.logmin),u.logmax=Math.abs(u.logmax),o.min=0,o.max=100,(0,h.default)(o.step))throw new Error("Log may only use steps (integer number of steps), not a step value. Got step ="+o.step);if(o.step=1,o.initial=u.InverseScaleValue((0,h.default)(o.initial)?o.initial:scaleValue(.5*(o.min+o.max))),o.initial*u.InverseScaleValue(o.max)<=0)throw new Error("Log range initial value must have the same sign as min/max and must not equal zero. Got initial value = "+o.initial)}else o.max=(0,h.default)(o.max)?o.max:100,o.min=(0,h.default)(o.min)?o.min:0,o.step=(0,h.default)(o.step)?o.step:.01,o.initial=(0,h.default)(o.initial)?o.initial:.5*(o.min+o.max);(0,h.default)(o.steps)&&(o.step=(0,h.default)(o.steps)?(o.max-o.min)/o.steps:o.step);var l=Math.round((o.initial-o.min)/o.step);return o.initial=o.min+o.step*l,u.input.min=o.min,u.input.max=o.max,u.input.step=o.step,u.input.value=o.initial,(0,f.default)(u.input,{width:"calc(100% - "+a.sizing.labelWidth+" - 16% - 0.5em)"}),u.valueComponent=t(6)(u.container,u.ScaleValue(o.initial),a,"16%"),o.label&&u.valueComponent.setAttribute("aria-label",o.label+" value"),setTimeout(function(){u.emit("initialized",parseFloat(u.input.value))}),u.userIsModifying=!1,u.input.addEventListener("focus",function(){u.focused=!0}),u.input.addEventListener("blur",function(){u.focused=!1}),u.input.addEventListener("mouseup",function(){u.input.blur()}),u.input.oninput=function(e){var n=u.ScaleValue(parseFloat(e.target.value));u.valueComponent.value=u.FormatNumber(n),u.lastValue=n,u.emit("input",n)},u.valueComponent.onchange=function(){var e=u.valueComponent.value;if(Number(parseFloat(e))==e){var n=parseFloat(e);n=Math.min(Math.max(n,o.min),o.max),n=Math.ceil((n-o.min)/o.step)*o.step+o.min,u.valueComponent.value=n,u.emit("input",n)}else u.valueComponent.value=u.lastValue},u}return a(n,e),s(n,[{key:"ScaleValue",value:function(e){return"log"===this.opts.scale?this.logsign*Math.exp(Math.log(this.logmin)+(Math.log(this.logmax)-Math.log(this.logmin))*e/100):e}},{key:"InverseScaleValue",value:function(e){return"log"===this.opts.scale?100*(Math.log(e*this.logsign)-Math.log(this.logmin))/(Math.log(this.logmax)-Math.log(this.logmin)):e}},{key:"SetValue",value:function(e){!0!==this.focused&&(this.valueComponent.value=this.FormatNumber(e),this.input.value=this.InverseScaleValue(e),this.lastValue=this.input.value)}},{key:"GetValue",value:function(){return this.input.value}},{key:"FormatNumber",value:function(e){return e.toFixed(3).replace(/\.?0*$/,"")}}]),n}(l.default);n.default=g,e.exports=n.default},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\ninput[type=range].guify-range {\n -webkit-appearance: none;\n width: 100%;\n height: ",";\n margin: 0px 0;\n padding: 0;\n display: inline-block;\n}\n\n/* Remove outlines since we'll be adding our own */\ninput[type=range].guify-range:focus {\n outline: none;\n}\ninput[type=range].guify-range::-moz-focus-outer {\n border: 0;\n}\n\n/* Webkit */\ninput[type=range].guify-range::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: ew-resize;\n background: ",";\n}\ninput[type=range].guify-range::-webkit-slider-thumb {\n height: ",";\n width: 10px;\n background: ",";\n cursor: ew-resize;\n -webkit-appearance: none;\n margin-top: 0px;\n}\ninput[type=range].guify-range:focus::-webkit-slider-runnable-track {\n background: ",";\n outline: none;\n}\n\n/* Gecko */\ninput[type=range].guify-range::-moz-range-track {\n width: 100%;\n height: ",";\n cursor: ew-resize;\n background: ",";\n}\ninput[type=range].guify-range:focus::-moz-range-track {\n background: ",";\n}\ninput[type=range].guify-range::-moz-range-thumb {\n height: ",";\n width: 10px;\n background: ",";\n cursor: ew-resize;\n border: none;\n border-radius: 0;\n}\n\n/* IE */\ninput[type=range].guify-range::-ms-track {\n width: 100%;\n height: ",";\n cursor: ew-resize;\n background: transparent;\n border-color: transparent;\n color: transparent;\n}\ninput[type=range].guify-range::-ms-fill-lower {\n background: ",";\n}\ninput[type=range].guify-range::-ms-fill-upper {\n background: ",";\n}\ninput[type=range].guify-range:focus::-ms-fill-lower {\n background: ",";\n}\ninput[type=range].guify-range:focus::-ms-fill-upper {\n background: ",";\n}\ninput[type=range].guify-range::-ms-thumb {\n width: 10px;\n border-radius: 0px;\n background: ",";\n cursor: ew-resize;\n height: ",";\n}\ninput[type=range].guify-range:focus::-ms-fill-lower {\n background: ",";\n outline: none;\n}\ninput[type=range].guify-range:focus::-ms-fill-upper {\n background: ",";\n outline: none;\n}\n\n"],["\n\ninput[type=range].guify-range {\n -webkit-appearance: none;\n width: 100%;\n height: ",";\n margin: 0px 0;\n padding: 0;\n display: inline-block;\n}\n\n/* Remove outlines since we'll be adding our own */\ninput[type=range].guify-range:focus {\n outline: none;\n}\ninput[type=range].guify-range::-moz-focus-outer {\n border: 0;\n}\n\n/* Webkit */\ninput[type=range].guify-range::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: ew-resize;\n background: ",";\n}\ninput[type=range].guify-range::-webkit-slider-thumb {\n height: ",";\n width: 10px;\n background: ",";\n cursor: ew-resize;\n -webkit-appearance: none;\n margin-top: 0px;\n}\ninput[type=range].guify-range:focus::-webkit-slider-runnable-track {\n background: ",";\n outline: none;\n}\n\n/* Gecko */\ninput[type=range].guify-range::-moz-range-track {\n width: 100%;\n height: ",";\n cursor: ew-resize;\n background: ",";\n}\ninput[type=range].guify-range:focus::-moz-range-track {\n background: ",";\n}\ninput[type=range].guify-range::-moz-range-thumb {\n height: ",";\n width: 10px;\n background: ",";\n cursor: ew-resize;\n border: none;\n border-radius: 0;\n}\n\n/* IE */\ninput[type=range].guify-range::-ms-track {\n width: 100%;\n height: ",";\n cursor: ew-resize;\n background: transparent;\n border-color: transparent;\n color: transparent;\n}\ninput[type=range].guify-range::-ms-fill-lower {\n background: ",";\n}\ninput[type=range].guify-range::-ms-fill-upper {\n background: ",";\n}\ninput[type=range].guify-range:focus::-ms-fill-lower {\n background: ",";\n}\ninput[type=range].guify-range:focus::-ms-fill-upper {\n background: ",";\n}\ninput[type=range].guify-range::-ms-thumb {\n width: 10px;\n border-radius: 0px;\n background: ",";\n cursor: ew-resize;\n height: ",";\n}\ninput[type=range].guify-range:focus::-ms-fill-lower {\n background: ",";\n outline: none;\n}\ninput[type=range].guify-range:focus::-ms-fill-upper {\n background: ",";\n outline: none;\n}\n\n"]),i=t(1),r=t(3),a=i.theme.colors.componentBackground,s=i.theme.colors.componentForeground,u=i.theme.colors.componentActive;e.exports=r(o,i.theme.sizing.componentHeight,i.theme.sizing.componentHeight,a,i.theme.sizing.componentHeight,s,u,i.theme.sizing.componentHeight,a,u,i.theme.sizing.componentHeight,s,i.theme.sizing.componentHeight,a,a,u,u,s,i.theme.sizing.componentHeight,u,u)},function(e,n,t){"use strict";(function(n){function o(){var e=Array.prototype.slice.call(arguments),t=i.apply(null,e);return n.document&&r(i.getCss(t)),t}var i=t(33),r=t(13);e.exports=o}).call(n,t(32))},function(e,n){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){"use strict";var o=t(34);e.exports=o(),e.exports.csjs=o,e.exports.noScope=o({noscope:!0}),e.exports.getCss=t(12)},function(e,n,t){"use strict";e.exports=t(35)},function(e,n,t){"use strict";function o(e){return u(e)?e.selector:e}function i(e,n){return e.map(function(e,t){return t!==n.length?e+n[t]:e}).join("")}function r(e,n){return Object.keys(e).reduce(function(t,o){return n[o]||(t[o]=e[o]),t},{})}var a=t(36),s=t(7),u=s.isComposition,l=s.ignoreComposition,c=t(37),f=t(38),p=t(11),h=t(43);e.exports=function(e){e=void 0===e?{}:e;var n=void 0!==e.noscope&&e.noscope;return function(e,t){for(var t=Array(arguments.length-1),s=1;s<arguments.length;s++)t[s-1]=arguments[s];var u=i(e,t.map(o)),d=l(t),g=n?h(u):f(u,d),b=a(g.css),m=r(g.classes,d),y=r(g.keyframes,d),v=b.compositions,x=c(m,y,v);return Object.defineProperty(x,p,{enumerable:!1,configurable:!1,writeable:!1,value:b.css})}}},function(e,n,t){"use strict";function o(e){return e.split(",").map(i)}function i(e){var n=e.trim();return"."===n[0]?n.substr(1):n}var r=(t(7).makeComposition,/\.([^\s]+)(\s+)(extends\s+)(\.[^{]+)/g);e.exports=function(e){function n(e,n){var t=i(n[1]),r=n[3],a=n[4],s=n.index+n[1].length+n[2].length,u=r.length+a.length;return e.css=e.css.slice(0,s)+" "+e.css.slice(s+u+1),o(a).forEach(function(n){e.compositions[t]||(e.compositions[t]={}),e.compositions[n]||(e.compositions[n]={}),e.compositions[t][n]=e.compositions[n]}),e}for(var t,a=[];t=r.exec(e);)a.unshift(t);return a.reduce(n,{css:e,compositions:{}})}},function(e,n,t){"use strict";function o(e){function n(e){return Object.keys(e).forEach(function(i){t[i]||(t[i]=!0,o.push(i),n(e[i]))})}var t={},o=[];return n(e),o}var i=t(7).makeComposition;e.exports=function(e,n,t){var r=Object.keys(n).reduce(function(e,t){var o=n[t];return e[o]=i([t],[o],!0),e},{});return Object.keys(e).reduce(function(n,r){var a=e[r],s=t[r],u=s?o(s):[],l=[r].concat(u),c=l.map(function(n){return e[n]?e[n]:n});return n[a]=i(l,c),n},r)}},function(e,n,t){"use strict";function o(e,n){function t(e,t){function i(i,r,a){var s=n[a]?a:o(a);return e[t][s]=a,r+s}var r=a[t];return{css:e.css.replace(r,i),keyframes:e.keyframes,classes:e.classes}}var o=i(e),a={classes:s,keyframes:u},l=Object.keys(a).reduce(t,{css:e,keyframes:{},classes:{}});return r(l)}var i=t(39),r=t(42),a=t(8),s=a.classRegex,u=a.keyframesRegex;e.exports=o},function(e,n,t){"use strict";var o=t(40),i=t(41);e.exports=function(e){var n=o(i(e));return function(e){return e+"_"+n}}},function(e,n,t){"use strict";e.exports=function(e){if(0===e)return"0";for(var n="";e>0;)n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[e%62]+n,e=Math.floor(e/62);return n}},function(e,n,t){"use strict";e.exports=function(e){for(var n=5381,t=e.length;t;)n=33*n^e.charCodeAt(--t);return n>>>0}},function(e,n,t){function o(e){var n=Object.keys(e.keyframes).reduce(function(n,t){return n[e.keyframes[t]]=t,n},{}),t=Object.keys(n);if(t.length){var o="((?:animation|animation-name)\\s*:[^};]*)("+t.join("|")+")([;\\s])"+i,r=new RegExp(o,"g");return{css:e.css.replace(r,function(e,t,o,i){return t+n[o]+i}),keyframes:e.keyframes,classes:e.classes}}return e}var i=t(8).ignoreComments;e.exports=o},function(e,n,t){"use strict";function o(e){return{css:e,keyframes:i(e,s),classes:i(e,a)}}function i(e,n){for(var t,o={};null!==(t=n.exec(e));){var i=t[2];o[i]=i}return o}var r=t(8),a=r.classRegex,s=r.keyframesRegex;e.exports=o},function(e,n,t){"use strict";var o=t(11);e.exports=function(e){return e[o]}},function(e,n,t){"use strict";e.exports=t(12)},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=t(4),u=o(s),l=t(0),c=(o(l),t(47)),f=function(e){function n(e,o,a,s){i(this,n);var u=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));u.opts=o,u.container=t(2)(e,o.label,a),t(5)(u.container,"",a);var l=u.container.appendChild(document.createElement("button"));return l.className=c["guify-button"],l.textContent=o.label,l.addEventListener("click",o.action),l.addEventListener("mouseup",function(){l.blur()}),u}return a(n,e),n}(u.default);n.default=f,e.exports=n.default},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-button {\n box-sizing: border-box !important;\n color: ",";\n background-color: ",";\n\n position: absolute;\n text-align: center;\n height: ",";\n line-height: ",";\n padding-top: 0px;\n padding-bottom: 0px;\n width: calc(100% - ",");\n border: none;\n cursor: pointer;\n right: 0;\n font-family: inherit;\n}\n\n\n.guify-button:focus {\n outline:none;\n}\n.guify-button::-moz-focus-inner {\n border:0;\n}\n\n.guify-button:hover,\n.guify-button:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-button:active {\n color: "," !important;\n background-color: "," !important;\n}\n\n"],["\n\n.guify-button {\n box-sizing: border-box !important;\n color: ",";\n background-color: ",";\n\n position: absolute;\n text-align: center;\n height: ",";\n line-height: ",";\n padding-top: 0px;\n padding-bottom: 0px;\n width: calc(100% - ",");\n border: none;\n cursor: pointer;\n right: 0;\n font-family: inherit;\n}\n\n\n.guify-button:focus {\n outline:none;\n}\n.guify-button::-moz-focus-inner {\n border:0;\n}\n\n.guify-button:hover,\n.guify-button:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-button:active {\n color: "," !important;\n background-color: "," !important;\n}\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.colors.textSecondary,i.theme.colors.componentBackground,i.theme.sizing.componentHeight,i.theme.sizing.componentHeight,i.theme.sizing.labelWidth,i.theme.colors.textHover,i.theme.colors.componentForeground,i.theme.colors.textActive,i.theme.colors.componentActive)},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),u=t(4),l=o(u),c=t(0),f=(o(c),t(49)),p=function(e){function n(e,o,a,s){i(this,n);var u=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return u.opts=o,u.container=t(2)(e,o.label,a),t(5)(u.container,o.label,a),u.input=u.container.appendChild(document.createElement("input")),u.input.id="checkbox-"+o.label+s,u.input.type="checkbox",u.input.checked=o.initial,u.input.className=f["guify-checkbox"],o.label&&u.input.setAttribute("aria-label",o.label),u.container.appendChild(document.createElement("label")).htmlFor=u.input.id,setTimeout(function(){u.emit("initialized",u.input.checked)}),u.input.onchange=function(e){u.emit("input",e.target.checked)},u}return a(n,e),s(n,[{key:"SetValue",value:function(e){this.input.checked=e}},{key:"GetValue",value:function(){return this.input.checked}}]),n}(l.default);n.default=p,e.exports=n.default},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(['\n\ninput[type=checkbox].guify-checkbox {\n opacity: 0;\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n margin: 0;\n border-radius: 0;\n cursor: pointer;\n}\n\ninput[type=checkbox].guify-checkbox + label {\n margin: 0;\n}\n\ninput[type=checkbox].guify-checkbox + label:before {\n content: "";\n display: inline-block;\n width: ',";\n height: ",";\n padding: 0;\n margin: 0;\n vertical-align: middle;\n background-color: ",";\n border-radius: 0px;\n cursor: pointer;\n box-sizing: content-box;\n -moz-box-sizing: content-box;\n -webkit-box-sizing: content-box;\n\n}\n\n/* Hover style */\ninput[type=checkbox].guify-checkbox:hover + label:before {\n width: calc("," - ("," * 2));\n height: calc("," - ("," * 2));\n background-color: ",";\n border: solid 4px ",";\n}\n\n/* Checked style */\ninput[type=checkbox]:checked.guify-checkbox + label:before {\n width: calc("," - ("," * 2));\n height: calc("," - ("," * 2));\n background-color: ",";\n border: solid "," ",";\n}\n\n/* Focused and checked */\ninput[type=checkbox]:checked.guify-checkbox:focus + label:before {\n width: calc("," - ("," * 2));\n height: calc("," - ("," * 2));\n background-color: ",";\n border: solid "," ",";\n}\n\n/* Focus and unchecked */\ninput[type=checkbox].guify-checkbox:focus + label:before {\n background-color: ",";\n}\n\n"],['\n\ninput[type=checkbox].guify-checkbox {\n opacity: 0;\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n margin: 0;\n border-radius: 0;\n cursor: pointer;\n}\n\ninput[type=checkbox].guify-checkbox + label {\n margin: 0;\n}\n\ninput[type=checkbox].guify-checkbox + label:before {\n content: "";\n display: inline-block;\n width: ',";\n height: ",";\n padding: 0;\n margin: 0;\n vertical-align: middle;\n background-color: ",";\n border-radius: 0px;\n cursor: pointer;\n box-sizing: content-box;\n -moz-box-sizing: content-box;\n -webkit-box-sizing: content-box;\n\n}\n\n/* Hover style */\ninput[type=checkbox].guify-checkbox:hover + label:before {\n width: calc("," - ("," * 2));\n height: calc("," - ("," * 2));\n background-color: ",";\n border: solid 4px ",";\n}\n\n/* Checked style */\ninput[type=checkbox]:checked.guify-checkbox + label:before {\n width: calc("," - ("," * 2));\n height: calc("," - ("," * 2));\n background-color: ",";\n border: solid "," ",";\n}\n\n/* Focused and checked */\ninput[type=checkbox]:checked.guify-checkbox:focus + label:before {\n width: calc("," - ("," * 2));\n height: calc("," - ("," * 2));\n background-color: ",";\n border: solid "," ",";\n}\n\n/* Focus and unchecked */\ninput[type=checkbox].guify-checkbox:focus + label:before {\n background-color: ",";\n}\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.sizing.componentHeight,i.theme.sizing.componentHeight,i.theme.colors.componentBackground,i.theme.sizing.componentHeight,"4px",i.theme.sizing.componentHeight,"4px",i.theme.colors.componentBackgroundHover,i.theme.colors.componentBackground,i.theme.sizing.componentHeight,"4px",i.theme.sizing.componentHeight,"4px",i.theme.colors.componentForeground,"4px",i.theme.colors.componentBackground,i.theme.sizing.componentHeight,"4px",i.theme.sizing.componentHeight,"4px",i.theme.colors.componentForeground,"4px",i.theme.colors.componentBackgroundHover,i.theme.colors.componentBackgroundHover)},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function i(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function r(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),s=t(4),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=t(51),c=function(e){function n(e,r,a,s){o(this,n);var u=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));u.opts=r;var c,f,p,h,d,g,b;if(u.container=t(2)(e,r.label,a),t(5)(u.container,r.label,a),u.input=document.createElement("select"),u.input.className=l["guify-select-dropdown"],r.label&&u.input.setAttribute("aria-label",r.label),f=document.createElement("span"),f.classList.add(l["guify-select-triangle"],l["guify-select-triangle--down"]),p=document.createElement("span"),p.classList.add(l["guify-select-triangle"],l["guify-select-triangle--up"]),u.container.appendChild(f),u.container.appendChild(p),Array.isArray(r.options))for(c=0;c<r.options.length;c++)d=r.options[c],g=document.createElement("option"),g.value=g.textContent=d,r.initial===d&&(g.selected="selected"),u.input.appendChild(g);else for(b=Object.keys(r.options),c=0;c<b.length;c++)h=b[c],g=document.createElement("option"),g.value=h,r.initial===h&&(g.selected="selected"),g.textContent=r.options[h],u.input.appendChild(g);u.container.appendChild(u.input),u.input.onchange=function(e){u.emit("input",e.target.value)};var m=function(){f.classList.add(l["guify-select-triangle--down-highlight"]),p.classList.add(l["guify-select-triangle--up-highlight"])},y=function(){f.classList.remove(l["guify-select-triangle--down-highlight"]),p.classList.remove(l["guify-select-triangle--up-highlight"])},v=!1;return u.input.addEventListener("mouseover",m),u.input.addEventListener("focus",function(){v=!0,m()}),u.input.addEventListener("blur",function(){v=!1,y()}),u.input.addEventListener("mouseleave",function(){v||y()}),u}return r(n,e),a(n,[{key:"SetValue",value:function(e){this.input.value=e}},{key:"GetValue",value:function(){return this.input.value}}]),n}(u.default);n.default=c,e.exports=n.default},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-select-dropdown {\n display: inline-block;\n position: absolute;\n width: calc(100% - ",");\n padding-left: 1.5%;\n height: ",";\n border: none;\n border-radius: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n -o-appearance:none;\n appearance: none;\n font-family: inherit;\n background-color: ",";\n color: ",";\n box-sizing: border-box !important;\n -moz-box-sizing: border-box !important;\n -webkit-box-sizing: border-box !important;\n}\n\n/* Disable default outline since we're providing our own */\n.guify-select-dropdown:focus {\n outline: none;\n}\n.guify-select-dropdown::-moz-focus-inner {\n border: 0;\n}\n\n\n.guify-select-dropdown:focus,\n.guify-select-dropdown:hover {\n color: ",";\n background-color: ",";\n}\n\n.guify-select-dropdown::-ms-expand {\n display:none;\n}\n.guify-select-triangle {\n content: ' ';\n border-right: 3px solid transparent;\n border-left: 3px solid transparent;\n line-height: ",";\n position: absolute;\n right: 2.5%;\n z-index: 1;\n pointer-events: none;\n}\n\n.guify-select-triangle--up {\n bottom: 55%;\n border-bottom: 5px solid ",";\n border-top: 0px transparent;\n}\n\n.guify-select-triangle--down {\n top: 55%;\n border-top: 5px solid ",";\n border-bottom: 0px transparent;\n}\n\n.guify-select-triangle--up-highlight {\n border-bottom-color: ",";\n}\n\n.guify-select-triangle--down-highlight {\n border-top-color: ",";\n}\n\n"],["\n\n.guify-select-dropdown {\n display: inline-block;\n position: absolute;\n width: calc(100% - ",");\n padding-left: 1.5%;\n height: ",";\n border: none;\n border-radius: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n -o-appearance:none;\n appearance: none;\n font-family: inherit;\n background-color: ",";\n color: ",";\n box-sizing: border-box !important;\n -moz-box-sizing: border-box !important;\n -webkit-box-sizing: border-box !important;\n}\n\n/* Disable default outline since we're providing our own */\n.guify-select-dropdown:focus {\n outline: none;\n}\n.guify-select-dropdown::-moz-focus-inner {\n border: 0;\n}\n\n\n.guify-select-dropdown:focus,\n.guify-select-dropdown:hover {\n color: ",";\n background-color: ",";\n}\n\n.guify-select-dropdown::-ms-expand {\n display:none;\n}\n.guify-select-triangle {\n content: ' ';\n border-right: 3px solid transparent;\n border-left: 3px solid transparent;\n line-height: ",";\n position: absolute;\n right: 2.5%;\n z-index: 1;\n pointer-events: none;\n}\n\n.guify-select-triangle--up {\n bottom: 55%;\n border-bottom: 5px solid ",";\n border-top: 0px transparent;\n}\n\n.guify-select-triangle--down {\n top: 55%;\n border-top: 5px solid ",";\n border-bottom: 0px transparent;\n}\n\n.guify-select-triangle--up-highlight {\n border-bottom-color: ",";\n}\n\n.guify-select-triangle--down-highlight {\n border-top-color: ",";\n}\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.sizing.labelWidth,i.theme.sizing.componentHeight,i.theme.colors.componentBackground,i.theme.colors.textSecondary,i.theme.colors.textHover,i.theme.colors.componentForeground,i.theme.sizing.componentHeight,i.theme.colors.textSecondary,i.theme.colors.textSecondary,i.theme.colors.textHover,i.theme.colors.textHover)},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),u=t(4),l=o(u),c=t(0),f=o(c),p=function(e){function n(e,o,a,s){i(this,n);var u=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return u.opts=o,u.container=t(2)(e,o.label,a),t(5)(u.container,o.label,a),u.input=u.container.appendChild(document.createElement("input")),u.input.type="text",u.input.className="guify-text",o.initial&&(u.input.value=o.initial),o.label&&u.input.setAttribute("aria-label",o.label),(0,f.default)(u.input,{position:"absolute",paddingLeft:"6px",height:a.sizing.componentHeight,width:"calc(100% - "+a.sizing.labelWidth+")",border:"none",background:a.colors.componentBackground,color:a.colors.textSecondary,fontFamily:"inherit","box-sizing":"border-box","-moz-box-sizing":"border-box","-webkit-box-sizing":"border-box",resize:"vertical"}),setTimeout(function(){u.emit("initialized",u.input.value)}),u.input.oninput=function(e){u.emit("input",e.target.value)},u.input.addEventListener("focus",function(){(0,f.default)(u.input,{outline:"none"}),u.focused=!0}),u.input.addEventListener("blur",function(){u.focused=!1}),u}return a(n,e),s(n,[{key:"SetValue",value:function(e){!0!==this.focused&&(this.input.value=e)}},{key:"GetValue",value:function(){return this.input.value}}]),n}(l.default);n.default=p,e.exports=n.default},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),u=t(4),l=o(u),c=t(54),f=o(c),p=t(0),h=o(p),d=t(14),g=o(d),b=t(13),m=o(b),y=function(e){function n(e,o,a,s){i(this,n);var u=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));u.opts=o,u.theme=a,o.format=o.format||"rgb",o.initial=o.initial||"#123456",u.container=t(2)(e,o.label,a),t(5)(u.container,o.label,a);var l=u.container.appendChild(document.createElement("span"));l.className="guify-color-"+s;var c=t(6)(u.container,"",a,"calc(100% - "+a.sizing.labelWidth+" - 12% - 0.5em)");c.setAttribute("readonly","true"),l.onmouseover=function(){u.picker.$el.style.display=""};var p=o.initial;switch(o.format){case"rgb":case"hex":p=(0,g.default)(p).toHexString();break;case"array":p=g.default.fromRatio({r:p[0],g:p[1],b:p[2]}).toHexString()}return u.picker=new f.default({el:l,color:p,background:a.colors.componentBackground,width:125,height:100}),(0,h.default)(u.picker.$el,{marginTop:a.sizing.componentHeight,display:"none",position:"absolute"}),(0,h.default)(l,{position:"relative",display:"inline-block",width:"12.5%",height:a.sizing.componentHeight,backgroundColor:u.picker.getHexString()}),u.InjectStyles(),l.onmouseout=function(e){u.picker.$el.style.display="none"},setTimeout(function(){u.emit("initialized",p)}),u.picker.onChange(function(e){c.value=u.Format(e),(0,h.default)(l,{backgroundColor:e}),u.emit("input",u.Format(e))}),u}return a(n,e),s(n,[{key:"Format",value:function(e){switch(this.opts.format){case"rgb":return(0,g.default)(e).toRgbString();case"hex":return(0,g.default)(e).toHexString();case"array":var n=(0,g.default)(e).toRgb();return[n.r/255,n.g/255,n.b/255].map(function(e){return e.toFixed(2)});default:return e}}},{key:"SetValue",value:function(e){this.picker.setColor(e)}},{key:"GetValue",value:function(){return this.Format(this.picker.getColor())}},{key:"InjectStyles",value:function(){(0,m.default)("\n\n .Scp {\n width: 125px;\n height: 100px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: relative;\n z-index: 1000;\n cursor: pointer;\n }\n .Scp-saturation {\n position: relative;\n width: calc(100% - 25px);\n height: 100%;\n background: linear-gradient(to right, #fff 0%, #f00 100%);\n float: left;\n margin-right: 5px;\n }\n .Scp-brightness {\n width: 100%;\n height: 100%;\n background: linear-gradient(to top, #000 0%, rgba(255,255,255,0) 100%);\n }\n .Scp-sbSelector {\n border: 1px solid;\n position: absolute;\n width: 14px;\n height: 14px;\n background: #fff;\n border-radius: 10px;\n top: -7px;\n left: -7px;\n box-sizing: border-box;\n z-index: 10;\n }\n .Scp-hue {\n width: 20px;\n height: 100%;\n position: relative;\n float: left;\n background: linear-gradient(to bottom, #f00 0%, #f0f 17%, #00f 34%, #0ff 50%, #0f0 67%, #ff0 84%, #f00 100%);\n }\n .Scp-hSelector {\n position: absolute;\n background: #fff;\n border-bottom: 1px solid #000;\n right: -3px;\n width: 10px;\n height: 2px;\n }\n\n ")}}]),n}(l.default);n.default=y,e.exports=n.default},function(e,n,t){"use strict";!function(){function n(e){return e=e||{},this.color=null,this.width=0,this.widthUnits="px",this.height=0,this.heightUnits="px",this.hue=0,this.position={x:0,y:0},this.huePosition=0,this.saturationWidth=0,this.hueHeight=0,this.maxHue=0,this.inputIsNumber=!1,this._onSaturationMouseDown=this._onSaturationMouseDown.bind(this),this._onSaturationMouseMove=this._onSaturationMouseMove.bind(this),this._onSaturationMouseUp=this._onSaturationMouseUp.bind(this),this._onHueMouseDown=this._onHueMouseDown.bind(this),this._onHueMouseMove=this._onHueMouseMove.bind(this),this._onHueMouseUp=this._onHueMouseUp.bind(this),this.$el=document.createElement("div"),this.$el.className="Scp",this.$el.innerHTML=['<div class="Scp-saturation">','<div class="Scp-brightness"></div>','<div class="Scp-sbSelector"></div>',"</div>",'<div class="Scp-hue">','<div class="Scp-hSelector"></div>',"</div>"].join(""),this.$saturation=this.$el.querySelector(".Scp-saturation"),this.$hue=this.$el.querySelector(".Scp-hue"),this.$sbSelector=this.$el.querySelector(".Scp-sbSelector"),this.$hSelector=this.$el.querySelector(".Scp-hSelector"),this.$saturation.addEventListener("mousedown",this._onSaturationMouseDown),this.$saturation.addEventListener("touchstart",this._onSaturationMouseDown),this.$hue.addEventListener("mousedown",this._onHueMouseDown),this.$hue.addEventListener("touchstart",this._onHueMouseDown),e.el&&this.appendTo(e.el),e.background&&this.setBackgroundColor(e.background),e.widthUnits&&(this.widthUnits=e.widthUnits),e.heightUnits&&(this.heightUnits=e.heightUnits),this.setSize(e.width||175,e.height||150),this.setColor(e.color),this}function o(e,n,t){return Math.min(Math.max(e,n),t)}function i(e){return e=0===e.type.indexOf("touch")?e.touches[0]:e,{x:e.clientX,y:e.clientY}}function r(e){return e="#"+("00000"+(0|e).toString(16)).substr(-6)}var a=t(55),s=t(56),u=t(14),l=t(59);a(n.prototype),n.prototype.appendTo=function(e){return e.appendChild(this.$el),this},n.prototype.remove=function(){this._onSaturationMouseUp(),this._onHueMouseUp(),this.$saturation.removeEventListener("mousedown",this._onSaturationMouseDown),this.$saturation.removeEventListener("touchstart",this._onSaturationMouseDown),this.$hue.removeEventListener("mousedown",this._onHueMouseDown),this.$hue.removeEventListener("touchstart",this._onHueMouseDown),this.off(),this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},n.prototype.setColor=function(e){s(e)?(this.inputIsNumber=!0,e=r(e)):this.inputIsNumber=!1,this.color=u(e);var n=this.color.toHsv();return isNaN(n.h)||(this.hue=n.h),this._moveSelectorTo(this.saturationWidth*n.s,(1-n.v)*this.hueHeight),this._moveHueTo((1-this.hue/360)*this.hueHeight),this._updateHue(),this},n.prototype.setSize=function(e,n){return this.width=e,this.height=n,this.$el.style.width=this.width+this.widthUnits,this.$el.style.height=this.height+this.heightUnits,this.saturationWidth=this.width-25,this.$saturation.style.width=this.saturationWidth+"px",this.hueHeight=this.height,this.maxHue=this.hueHeight-2,this},n.prototype.setBackgroundColor=function(e){return s(e)&&(e=r(e)),this.$el.style.padding="5px",this.$el.style.background=u(e).toHexString(),this},n.prototype.setNoBackground=function(){this.$el.style.padding="0px",this.$el.style.background="none"},n.prototype.onChange=function(e){return this.on("update",e),this.emit("update",this.getHexString()),this},n.prototype.getColor=function(){return this.inputIsNumber?this.getHexNumber():this.color.toString()},n.prototype.getHexString=function(){return this.color.toHexString().toUpperCase()},n.prototype.getHexNumber=function(){return parseInt(this.color.toHex(),16)},n.prototype.getRGB=function(){return this.color.toRgb()},n.prototype.getHSV=function(){return this.color.toHsv()},n.prototype.isDark=function(){return this.color.isDark()},n.prototype.isLight=function(){return this.color.isLight()},n.prototype._moveSelectorTo=function(e,n){this.position.x=o(e,0,this.saturationWidth),this.position.y=o(n,0,this.hueHeight),l(this.$sbSelector,{x:this.position.x,y:this.position.y})},n.prototype._updateColorFromPosition=function(){this.color=u({h:this.hue,s:this.position.x/this.saturationWidth,v:1-this.position.y/this.hueHeight}),this._updateColor()},n.prototype._moveHueTo=function(e){this.huePosition=o(e,0,this.maxHue),l(this.$hSelector,{y:this.huePosition})},n.prototype._updateHueFromPosition=function(){var e=this.color.toHsv();this.hue=360*(1-this.huePosition/this.maxHue),this.color=u({h:this.hue,s:e.s,v:e.v}),this._updateHue()},n.prototype._updateHue=function(){var e=u({h:this.hue,s:1,v:1});this.$saturation.style.background="linear-gradient(to right, #fff, "+e.toHexString()+")",this._updateColor()},n.prototype._updateColor=function(){this.$sbSelector.style.background=this.color.toHexString(),this.$sbSelector.style.borderColor=this.color.isDark()?"#fff":"#000",this.emit("update",this.color.toHexString())},n.prototype._onSaturationMouseDown=function(e){var n=this.$saturation.getBoundingClientRect(),t=i(e).x,o=i(e).y;this._moveSelectorTo(t-n.left,o-n.top),this._updateColorFromPosition(),window.addEventListener("mouseup",this._onSaturationMouseUp),window.addEventListener("touchend",this._onSaturationMouseUp),window.addEventListener("mousemove",this._onSaturationMouseMove),window.addEventListener("touchmove",this._onSaturationMouseMove),e.preventDefault()},n.prototype._onSaturationMouseMove=function(e){var n=this.$saturation.getBoundingClientRect(),t=i(e).x,o=i(e).y;this._moveSelectorTo(t-n.left,o-n.top),this._updateColorFromPosition()},n.prototype._onSaturationMouseUp=function(){window.removeEventListener("mouseup",this._onSaturationMouseUp),window.removeEventListener("touchend",this._onSaturationMouseUp),window.removeEventListener("mousemove",this._onSaturationMouseMove),window.removeEventListener("touchmove",this._onSaturationMouseMove)},n.prototype._onHueMouseDown=function(e){var n=this.$hue.getBoundingClientRect(),t=i(e).y;this._moveHueTo(t-n.top),this._updateHueFromPosition(),window.addEventListener("mouseup",this._onHueMouseUp),window.addEventListener("touchend",this._onHueMouseUp),window.addEventListener("mousemove",this._onHueMouseMove),window.addEventListener("touchmove",this._onHueMouseMove),e.preventDefault()},n.prototype._onHueMouseMove=function(e){var n=this.$hue.getBoundingClientRect(),t=i(e).y;this._moveHueTo(t-n.top),this._updateHueFromPosition()},n.prototype._onHueMouseUp=function(){window.removeEventListener("mouseup",this._onHueMouseUp),window.removeEventListener("touchend",this._onHueMouseUp),window.removeEventListener("mousemove",this._onHueMouseMove),window.removeEventListener("touchmove",this._onHueMouseMove)},void 0!==e&&e.exports&&(e.exports=n)}()},function(e,n,t){function o(e){if(e)return i(e)}function i(e){for(var n in o.prototype)e[n]=o.prototype[n];return e}e.exports=o,o.prototype.on=o.prototype.addEventListener=function(e,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(n),this},o.prototype.once=function(e,n){function t(){this.off(e,t),n.apply(this,arguments)}return t.fn=n,this.on(e,t),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=o.prototype.removeEventListener=function(e,n){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var t=this._callbacks["$"+e];if(!t)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o,i=0;i<t.length;i++)if((o=t[i])===n||o.fn===n){t.splice(i,1);break}return this},o.prototype.emit=function(e){this._callbacks=this._callbacks||{};var n=[].slice.call(arguments,1),t=this._callbacks["$"+e];if(t){t=t.slice(0);for(var o=0,i=t.length;o<i;++o)t[o].apply(this,n)}return this},o.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},o.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,n,t){"use strict";/*!
  499. * is-number <https://github.com/jonschlinkert/is-number>
  500. *
  501. * Copyright (c) 2014-2015, Jon Schlinkert.
  502. * Licensed under the MIT License.
  503. */
  504. var o=t(57);e.exports=function(e){var n=o(e);if("string"===n){if(!e.trim())return!1}else if("number"!==n)return!1;return e-e+1>=0}},function(e,n,t){var o=t(58),i=Object.prototype.toString;e.exports=function(e){if(void 0===e)return"undefined";if(null===e)return"null";if(!0===e||!1===e||e instanceof Boolean)return"boolean";if("string"==typeof e||e instanceof String)return"string";if("number"==typeof e||e instanceof Number)return"number";if("function"==typeof e||e instanceof Function)return"function";if(void 0!==Array.isArray&&Array.isArray(e))return"array";if(e instanceof RegExp)return"regexp";if(e instanceof Date)return"date";var n=i.call(e);return"[object RegExp]"===n?"regexp":"[object Date]"===n?"date":"[object Arguments]"===n?"arguments":"[object Error]"===n?"error":o(e)?"buffer":"[object Set]"===n?"set":"[object WeakSet]"===n?"weakset":"[object Map]"===n?"map":"[object WeakMap]"===n?"weakmap":"[object Symbol]"===n?"symbol":"[object Int8Array]"===n?"int8array":"[object Uint8Array]"===n?"uint8array":"[object Uint8ClampedArray]"===n?"uint8clampedarray":"[object Int16Array]"===n?"int16array":"[object Uint16Array]"===n?"uint16array":"[object Int32Array]"===n?"int32array":"[object Uint32Array]"===n?"uint32array":"[object Float32Array]"===n?"float32array":"[object Float64Array]"===n?"float64array":"object"}},function(e,n){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function o(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}/*!
  505. * Determine if an object is a Buffer
  506. *
  507. * @author Feross Aboukhadijeh <https://feross.org>
  508. * @license MIT
  509. */
  510. e.exports=function(e){return null!=e&&(t(e)||o(e)||!!e._isBuffer)}},function(e,n,t){"use strict";function o(e,n){var t,o,i,r=[];s(n);for(t in n)h.call(n,t)&&(o=n[t],h.call(f.transform,t)?(i=f.transform[t],c(o)&&(o=o.join(i.separator)),r.push(t+"("+p(o,i.defaultUnit,i.separator)+")")):h.call(f,t)?(i=f[t],c(o)&&(o=o.join(i.separator)),e.style[l(t)]=p(o,i.defaultUnit,i.separator)):console.warn("dom-transform: this property (`"+t+"`) is not supported."));e.style[d]=r.join(" ")}function i(e,n){var t=e.style;if("string"==typeof n)return h.call(f.transform,n)?t[d]:t[l(n)];n||(n=u());var o={};return n.forEach(function(e){o[e]=t[l(e)]}),o}function r(e,n){var t=e.style;if("string"==typeof n)return void(t[l(n)]=null);n||(n=u()),n.forEach(function(e){t[l(e)]=null})}function a(){return d.length>0}function s(e){var n;for(n in e)h.call(g,n)&&(e[g[n]]=e[n],delete e[n])}function u(){return Object.keys(f).map(function(e){return e})}var l=t(60),c=t(61),f=t(62),p=t(63),h=Object.prototype.hasOwnProperty,d=l("transform"),g={x:"translateX",y:"translateY",z:"translateZ",origin:"transformOrigin"};n=e.exports=o,n.get=i,n.reset=r,n.isSupported=a},function(e,n){function t(e){if(e=e.replace(/-([a-z])/g,function(e,n){return n.toUpperCase()}),void 0!==r[e])return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),t=a.length;t--;){var o=a[t]+n;if(void 0!==r[o])return o}return e}function o(e){return e in u?u[e]:u[e]=t(e)}function i(e){return e=t(e),s.test(e)&&(e="-"+e.replace(s,"-$1"),s.lastIndex=0),e.toLowerCase()}var r="undefined"!=typeof document?document.createElement("p").style:{},a=["O","ms","Moz","Webkit"],s=/([A-Z])/g,u={};e.exports=o,e.exports.dash=i},function(e,n){var t=Array.isArray,o=Object.prototype.toString;e.exports=t||function(e){return!!e&&"[object Array]"==o.call(e)}},function(e,n,t){"use strict";e.exports={transform:{translate:{defaultUnit:"px"},translate3d:{defaultUnit:"px"},translateX:{defaultUnit:"px"},translateY:{defaultUnit:"px"},translateZ:{defaultUnit:"px"},scale:{defaultUnit:""},scale3d:{defaultUnit:""},scaleX:{defaultUnit:""},scaleY:{defaultUnit:""},scaleZ:{defaultUnit:""},rotate:{defaultUnit:"deg"},rotate3d:{defaultUnit:""},rotateX:{defaultUnit:"deg"},rotateY:{defaultUnit:"deg"},rotateZ:{defaultUnit:"deg"},skew:{defaultUnit:"deg"},skewX:{defaultUnit:"deg"},skewY:{defaultUnit:"deg"},perspective:{defaultUnit:"px"},matrix:{defaultUnit:""},matrix3d:{defaultUnit:""}},transformOrigin:{defaultUnit:"px",separator:" "}}},function(e,n,t){"use strict";var o=t(64),i=/^-?\d+(\.\d+)?$/;e.exports=function(e,n,t){if(t=t||",","number"==typeof e)return""+e+n;var r=new RegExp(t,"g");return e.split(r.test(e)?t:" ").map(function(e){return e=o(e),i.test(e)&&(e+=n),e}).join(t)}},function(e,n){function t(e){return e.replace(/^\s*|\s*$/g,"")}n=e.exports=t,n.left=function(e){return e.replace(/^\s*/,"")},n.right=function(e){return e.replace(/\s*$/,"")}},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=t(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),s=t(66),u=function(){function e(n,i,r,u){var l=this;o(this,e),this.opts=i,this.container=t(2)(n,i.label,r),this.container.classList.add(s["guify-folder"]),this.container.setAttribute("role","button"),this.container.setAttribute("tabIndex","0"),this.arrow=this.container.appendChild(document.createElement("div")),this.arrow.innerHTML="&#9662;",(0,a.default)(this.arrow,{width:"1.5em"}),this.label=this.container.appendChild(document.createElement("div")),this.label.innerHTML=i.label,this.container.onclick=function(){l.Toggle()},this.container.addEventListener("mouseup",function(){l.container.blur()}),this.container.addEventListener("keydown",function(e){13!==e.which&&32!==e.which||l.Toggle()}),this.folderContainer=n.appendChild(document.createElement("div")),this.folderContainer.classList.add(s["guify-folder-contents"]),this.open=this.opts.open||!1,this.SetOpen(this.open)}return i(e,[{key:"Toggle",value:function(){this.open=!this.open,this.SetOpen(this.open)}},{key:"SetOpen",value:function(e){this.open=e,e?(this.folderContainer.classList.remove(s["guify-folder-closed"]),this.arrow.innerHTML="&#9662;"):(this.folderContainer.classList.add(s["guify-folder-closed"]),this.arrow.innerHTML="&#9656;")}}]),e}();n.default=u,e.exports=n.default},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-folder {\n cursor: pointer;\n padding-left: 0.5em;\n color: ",";\n}\n\n.guify-folder div {\n display: inline-block;\n vertical-align: sub;\n line-height: calc("," + 5px);\n}\n\n.guify-folder:hover,\n.guify-folder:focus {\n color: ",";\n background-color: ",";\n outline: none;\n}\n\n\n.guify-folder-contents {\n display: block;\n box-sizing: border-box;\n padding-left: 14px;\n margin-bottom: 5px;\n border-left: 2px solid ",";\n}\n\n.guify-folder-contents.guify-folder-closed {\n height: 0;\n display: none;\n}\n\n\n"],["\n\n.guify-folder {\n cursor: pointer;\n padding-left: 0.5em;\n color: ",";\n}\n\n.guify-folder div {\n display: inline-block;\n vertical-align: sub;\n line-height: calc("," + 5px);\n}\n\n.guify-folder:hover,\n.guify-folder:focus {\n color: ",";\n background-color: ",";\n outline: none;\n}\n\n\n.guify-folder-contents {\n display: block;\n box-sizing: border-box;\n padding-left: 14px;\n margin-bottom: 5px;\n border-left: 2px solid ",";\n}\n\n.guify-folder-contents.guify-folder-closed {\n height: 0;\n display: none;\n}\n\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.colors.textPrimary,i.theme.sizing.componentHeight,i.theme.colors.textHover,i.theme.colors.componentForeground,i.theme.colors.componentBackground)},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),u=t(4),l=o(u),c=t(0),f=o(c),p=t(68),h=function(e){function n(e,o,a,s){i(this,n);var u=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));u.opts=o,u.opts.fileReadFunc=u.opts.fileReadFunc||"readAsDataURL",u.file=null,u.fileName=null,u.container=t(2)(e,o.label,a),u.container.classList.add(p["guify-file-container"]),u.container.setAttribute("role","button"),u.container.setAttribute("tabIndex","0"),(0,f.default)(u.container,{width:"100%","box-sizing":"border-box","-moz-box-sizing":"border-box","-webkit-box-sizing":"border-box",height:"unset",padding:"8px"});var l=u.container.appendChild(document.createElement("div"));l.innerHTML=o.label,(0,f.default)(l,"padding-bottom","5px");var c=u.container.appendChild(document.createElement("input"));c.setAttribute("type","file"),c.setAttribute("multiple",!1),c.style.display="none",o.label&&c.setAttribute("aria-label",o.label),u.fileLabel=u.container.appendChild(document.createElement("div")),u.fileLabel.innerHTML="Choose a file...";var h=function(e){var n;e.dataTransfer?n=e.dataTransfer.files:e.target&&(n=e.target.files);var t=(n[0],new FileReader);t.onload=function(){u.file=t.result,u.fileLabel.innerHTML=n[0].name,u.emit("input",u.file)},t[u.opts.fileReadFunc](n[0])};return c.addEventListener("change",h),u.container.addEventListener("dragover",function(e){e.preventDefault(),e.stopPropagation(),u.container.classList.add(p["guify-dragover"])}),u.container.addEventListener("dragleave",function(e){e.preventDefault(),e.stopPropagation(),u.container.classList.remove(p["guify-dragover"])}),u.container.addEventListener("drop",function(e){e.preventDefault(),e.stopPropagation(),u.container.classList.remove(p["guify-dragover"]),h(e)}),u.container.onclick=function(){c.click()},u.container.addEventListener("keydown",function(e){13!==e.which&&32!==e.which||c.click()}),u.container.addEventListener("mouseup",function(){u.container.blur()}),u}return a(n,e),s(n,[{key:"SetValue",value:function(e){}},{key:"GetValue",value:function(){return this.file}}]),n}(l.default);n.default=h,e.exports=n.default},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-file-container {\n display: inline-block;\n outline: none;\n padding-top: 8px;\n padding-bottom: 8px;\n color: ",";\n background-color: ",";\n}\n\n.guify-file-container:hover,\n.guify-file-container:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-file-container:active {\n color: "," !important;\n background-color: "," !important;\n}\n\n.guify-dragover {\n background-color: ",";\n box-shadow: inset 0 0 0 3px ",";\n}\n\n\n"],["\n\n.guify-file-container {\n display: inline-block;\n outline: none;\n padding-top: 8px;\n padding-bottom: 8px;\n color: ",";\n background-color: ",";\n}\n\n.guify-file-container:hover,\n.guify-file-container:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-file-container:active {\n color: "," !important;\n background-color: "," !important;\n}\n\n.guify-dragover {\n background-color: ",";\n box-shadow: inset 0 0 0 3px ",";\n}\n\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.colors.textPrimary,i.theme.colors.componentBackground,i.theme.colors.textHover,i.theme.colors.componentForeground,i.theme.colors.textActive,i.theme.colors.componentActive,i.theme.colors.componentBackground,i.theme.colors.componentForeground)},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=t(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),s=function(){function e(n,i,r,s){o(this,e),this.opts=i,this.container=t(2)(n,i.label,r),t(5)(this.container,i.label,r),this.text=this.container.appendChild(document.createElement("div")),(0,a.default)(this.text,{display:"inline-block",height:"unset",width:"calc(100% - "+r.sizing.labelWidth+")",border:"none",color:r.colors.textSecondary,fontFamily:"inherit","box-sizing":"border-box","-moz-box-sizing":"border-box","-webkit-box-sizing":"border-box",verticalAlign:"sub","line-height":r.sizing.componentHeight,"user-select":"text"}),i.label&&this.text.setAttribute("aria-label",i.label)}return i(e,[{key:"SetValue",value:function(e){this.text.innerHTML=e.toString()}},{key:"GetValue",value:function(){return this.text.innerHTML.toString()}}]),e}();n.default=s,e.exports=n.default},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}function s(e,n,t){return Math.min(Math.max(e,n),t)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),l=t(4),c=o(l),f=t(0),p=o(f),h=t(10),d=o(h),g=t(71),b=function(e){function n(e,o,a,u){i(this,n);var l=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));if(l.opts=o,l.container=t(2)(e,o.label,a),t(5)(l.container,o.label,a),o.step&&o.steps)throw new Error("Cannot specify both step and steps. Got step = "+o.step+", steps = ",o.steps);if(l.input=l.container.appendChild(document.createElement("span")),l.input.className=g["guify-interval"],l.handle=document.createElement("span"),l.handle.className=g["guify-interval-handle"],l.input.appendChild(l.handle),Array.isArray(o.initial)||(o.initial=[]),"log"===o.scale){if(o.max=(0,d.default)(o.max)?o.max:100,o.min=(0,d.default)(o.min)?o.min:.1,o.min*o.max<=0)throw new Error("Log range min/max must have the same sign and not equal zero. Got min = "+o.min+", max = "+o.max);if(l.logmin=o.min,l.logmax=o.max,l.logsign=o.min>0?1:-1,l.logmin=Math.abs(l.logmin),l.logmax=Math.abs(l.logmax),o.min=0,o.max=100,(0,d.default)(o.step))throw new Error("Log may only use steps (integer number of steps), not a step value. Got step ="+o.step);if(o.step=1,o.initial=[l.InverseScaleValue((0,d.default)(o.initial)?o.initial[0]:scaleValue(o.min+.25*(o.max-o.min))),l.InverseScaleValue((0,d.default)(o.initial)?o.initial[1]:scaleValue(o.min+.75*(o.max-o.min)))],l.ScaleValue(o.initial[0])*l.ScaleValue(o.max)<=0||scaleValue(o.initial[1])*l.ScaleValue(o.max)<=0)throw new Error("Log range initial value must have the same sign as min/max and must not equal zero. Got initial value = ["+l.ScaleValue(o.initial[0])+", "+l.ScaleValue(o.initial[1])+"]")}else o.max=(0,d.default)(o.max)?o.max:100,o.min=(0,d.default)(o.min)?o.min:0,o.step=(0,d.default)(o.step)?o.step:.01,o.initial=[(0,d.default)(o.initial[0])?o.initial[0]:.25*(o.min+o.max),(0,d.default)(o.initial[1])?o.initial[1]:.75*(o.min+o.max)];(0,d.default)(o.steps)&&(o.step=(0,d.default)(o.steps)?(o.max-o.min)/o.steps:o.step),o.initial[0]=o.min+o.step*Math.round((o.initial[0]-o.min)/o.step),o.initial[1]=o.min+o.step*Math.round((o.initial[1]-o.min)/o.step),l.value=o.initial,(0,p.default)(l.handle,{left:(l.value[0]-o.min)/(o.max-o.min)*100+"%",right:100-(l.value[1]-o.min)/(o.max-o.min)*100+"%"}),l.lValue=t(6)(l.container,l.ScaleValue(o.initial[0]),a,"11%",!0),l.rValue=t(6)(l.container,l.ScaleValue(o.initial[1]),a,"11%"),o.label&&l.lValue.setAttribute("aria-label",o.label+" lower value"),o.label&&l.lValue.setAttribute("aria-label",o.label+" upper value"),l.activeIndex=-1,setTimeout(function(){var e=l.ScaleValue(l.value[0]),n=l.ScaleValue(l.value[1]);l.lValue.innerHTML=e,l.rValue.innerHTML=n,l.emit("initialized",[e,n])}),l.input.addEventListener("focus",function(){l.focused=!0}),l.input.addEventListener("blur",function(){l.focused=!1});var c=function(e){return e.pageX-l.input.getBoundingClientRect().left},f=function(e){var n=s(c(e)/l.input.offsetWidth,0,1);l.setActiveValue(n)},h=function e(n){var t=s(c(n)/l.input.offsetWidth,0,1);l.setActiveValue(t),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",e),l.activeIndex=-1};return l.input.addEventListener("mousedown",function(e){var n=s(c(e)/l.input.offsetWidth,0,1),t=(l.value[0]-o.min)/(o.max-o.min),i=(l.value[1]-o.min)/(o.max-o.min);t-=1e-15*Math.abs(o.max-o.min),i+=1e-15*Math.abs(o.max-o.min);var r=Math.abs(t-n),a=Math.abs(i-n);l.activeIndex=r<a?0:1,console.log(l.activeIndex),document.addEventListener("mousemove",f),document.addEventListener("mouseup",h)}),l.input.addEventListener("mouseup",function(){l.input.blur()}),l.input.oninput=function(){var e=l.ScaleValue(l.value[0]),n=l.ScaleValue(l.value[1]);l.lValue.value=e,l.rValue.value=n,l.emit("input",[e,n])},l.lValue.onchange=function(){var e=l.lValue.value,n=parseFloat(l.rValue.value);if(Number(parseFloat(e))==e){var t=parseFloat(e);t=Math.min(Math.max(t,o.min),o.max),t=Math.ceil((t-o.min)/o.step)*o.step+o.min,t=Math.min(t,n),l.lValue.value=t,l.emit("input",[t,n]),l.RefreshHandle([t,n])}else l.lValue.value=l.lastValue[0]},l.rValue.onchange=function(){var e=l.rValue.value,n=parseFloat(l.lValue.value);if(Number(parseFloat(e))==e){var t=parseFloat(e);t=Math.min(Math.max(t,o.min),o.max),t=Math.ceil((t-o.min)/o.step)*o.step+o.min,t=Math.max(t,n),l.rValue.value=t,l.emit("input",[n,t]),l.RefreshHandle([n,t])}else l.rValue.value=l.lastValue[1]},l}return a(n,e),u(n,[{key:"ScaleValue",value:function(e){return"log"===this.opts.scale?this.logsign*Math.exp(Math.log(this.logmin)+(Math.log(this.logmax)-Math.log(this.logmin))*e/100):e}},{key:"InverseScaleValue",value:function(e){return"log"===this.opts.scale?100*(Math.log(e*this.logsign)-Math.log(this.logmin))/(Math.log(this.logmax)-Math.log(this.logmin)):e}},{key:"setActiveValue",value:function(e){if(-1!==this.activeIndex){var n=this.opts,t=(this.value[0]-n.min)/(n.max-n.min),o=(this.value[1]-n.min)/(n.max-n.min);e=0===this.activeIndex?Math.min(o,e):Math.max(t,e);var i=n.min+Math.round((n.max-n.min)*e/n.step)*n.step;this.value[this.activeIndex]=i,(0,p.default)(this.handle,{left:(this.value[0]-n.min)/(n.max-n.min)*100+"%",right:100-(this.value[1]-n.min)/(n.max-n.min)*100+"%"}),this.input.oninput()}}},{key:"SetValue",value:function(e){!0!==this.focused&&(this.lValue.value=this.FormatNumber(e[0]),this.rValue.value=this.FormatNumber(e[1]),this.lastValue=[this.lValue.value,this.rValue.value])}},{key:"FormatNumber",value:function(e){return e.toFixed(3).replace(/\.?0*$/,"")}},{key:"GetValue",value:function(){return[this.lValue.value,this.rValue.value]}},{key:"RefreshHandle",value:function(e){var n=(parseFloat(e[0])-this.opts.min)/(this.opts.max-this.opts.min)*100,t=100-(parseFloat(e[1])-this.opts.min)/(this.opts.max-this.opts.min)*100;(0,p.default)(this.handle,{left:n+"%",right:t+"%"})}}]),n}(c.default);n.default=b,e.exports=n.default},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n.guify-interval {\n -webkit-appearance: none;\n position: absolute;\n height: 20px;\n margin: 0px 0;\n width: 33%;\n left: 54.5%;\n background-color: ",";\n cursor: ew-resize;\n\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.guify-interval-handle {\n background-color: ",";\n position: absolute;\n height: ",";\n min-width: 1px;\n}\n.guify-interval-handle:focus {\n background: ",";\n}\n"],["\n.guify-interval {\n -webkit-appearance: none;\n position: absolute;\n height: 20px;\n margin: 0px 0;\n width: 33%;\n left: 54.5%;\n background-color: ",";\n cursor: ew-resize;\n\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.guify-interval-handle {\n background-color: ",";\n position: absolute;\n height: ",";\n min-width: 1px;\n}\n.guify-interval-handle:focus {\n background: ",";\n}\n"]),i=t(1),r=t(3),a=i.theme.colors.componentBackground,s=i.theme.colors.componentForeground,u=i.theme.colors.componentActive;e.exports=r(o,a,s,i.theme.sizing.componentHeight,u)},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.MenuBar=void 0;var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),u=t(0),l=o(u),c=t(4),f=o(c),p=(t(1),t(15)),h=o(p);n.MenuBar=function(e){function n(e,o){i(this,n);var a=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),s=t(73);if(a.element=document.createElement("div"),a.element.className=s["guify-bar"],e.appendChild(a.element),o.title){var u=a.element.appendChild(document.createElement("div"));u.className=s["guify-bar-title"],u.innerHTML=o.title}var c=a.element.appendChild(document.createElement("button"));if(c.className=s["guify-bar-button"],c.innerHTML="Controls",(0,l.default)(c,{left:"left"==o.align?"0":"unset",right:"left"==o.align?"unset":"0"}),c.onclick=function(){a.emit("ontogglepanel")},h.default.isEnabled){var f=a.element.appendChild(document.createElement("button"));f.className=s["guify-bar-button"],f.innerHTML="「 」",f.setAttribute("aria-label","Toggle Fullscreen"),(0,l.default)(f,{left:"left"==o.align?"unset":"0",right:"left"==o.align?"0":"unset"}),f.onclick=function(){a.emit("onfullscreenrequested")}}return a}return a(n,e),s(n,[{key:"SetVisible",value:function(e){this.element.style.display=e?"block":"none"}}]),n}(f.default)},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-bar {\n background-color: ",";\n height: ",";\n width: 100%;\n opacity: 1.0;\n position: relative;\n cursor: default;\n}\n\n.guify-bar-title {\n color: ",";\n text-align: center;\n width: 100%;\n position: absolute;\n top: 0;\n line-height: ",";\n color: ",";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.guify-bar-button {\n text-align: center;\n border: none;\n cursor: pointer;\n font-family: inherit;\n height: 100%;\n position: absolute;\n top: 0;\n color: ",";\n background-color: ",";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin: 0;\n\n}\n\n/* Hide default accessibility outlines since we're providing our own visual feedback */\n.guify-bar-button:focus {\n outline:none;\n}\n.guify-bar-button::-moz-focus-inner {\n border:0;\n}\n\n.guify-bar-button:hover,\n.guify-bar-button:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-bar-button:active {\n color: "," !important;\n background-color: "," !important;\n}\n\n\n"],["\n\n.guify-bar {\n background-color: ",";\n height: ",";\n width: 100%;\n opacity: 1.0;\n position: relative;\n cursor: default;\n}\n\n.guify-bar-title {\n color: ",";\n text-align: center;\n width: 100%;\n position: absolute;\n top: 0;\n line-height: ",";\n color: ",";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.guify-bar-button {\n text-align: center;\n border: none;\n cursor: pointer;\n font-family: inherit;\n height: 100%;\n position: absolute;\n top: 0;\n color: ",";\n background-color: ",";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin: 0;\n\n}\n\n/* Hide default accessibility outlines since we're providing our own visual feedback */\n.guify-bar-button:focus {\n outline:none;\n}\n.guify-bar-button::-moz-focus-inner {\n border:0;\n}\n\n.guify-bar-button:hover,\n.guify-bar-button:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-bar-button:active {\n color: "," !important;\n background-color: "," !important;\n}\n\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.colors.menuBarBackground,i.theme.sizing.menuBarHeight,i.theme.colors.text1,i.theme.sizing.menuBarHeight,i.theme.colors.menuBarText,i.theme.colors.textPrimary,i.theme.colors.componentBackground,i.theme.colors.textHover,i.theme.colors.componentForeground,i.theme.colors.textActive,i.theme.colors.componentActive)},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.Panel=void 0;var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=t(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),s=t(1);n.Panel=function(){function e(n,i){o(this,e),this.opts=i,this.styles=t(75),this.container=n.appendChild(document.createElement("div")),this.container.className=this.styles["guify-panel-container"],(0,a.default)(this.container,{width:i.width,opacity:i.opacity||1,left:"left"==i.align?"0":"unset",right:"left"==i.align?"unset":"0"}),"outer"==i.panelMode&&(0,a.default)(this.container,{left:"left"==i.align?"unset":"100%",right:"left"==i.align?"100%":"unset"}),"none"===i.barMode&&this._MakeToggleButton(),this.panel=this.container.appendChild(document.createElement("div")),this.panel.className=this.styles["guify-panel"],"none"===i.barMode&&i.title&&t(76)(this.panel,i.title,s.theme)}return i(e,[{key:"SetVisible",value:function(e){e?(this.panel.classList.remove(this.styles["guify-panel-hidden"]),this.menuButton&&this.menuButton.setAttribute("alt","Close GUI")):(this.panel.classList.add(this.styles["guify-panel-hidden"]),this.menuButton&&this.menuButton.setAttribute("alt","Open GUI"))}},{key:"ToggleVisible",value:function(){this.panel.classList.contains(this.styles["guify-panel-hidden"])?this.SetVisible(!0):this.SetVisible(!1)}},{key:"_MakeToggleButton",value:function(){var e=this;this.menuButton=this.container.appendChild(document.createElement("button")),this.menuButton.className=this.styles["guify-panel-toggle-button"],(0,a.default)(this.menuButton,{left:"left"==this.opts.align?"0px":"unset",right:"left"==this.opts.align?"unset":"0px"}),this.menuButton.onclick=function(){e.ToggleVisible()},this.menuButton.addEventListener("mouseup",function(){e.menuButton.blur()}),this.menuButton.innerHTML='\n <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">\n <rect x="10%" y="10%" width="80%" height="80%"/>\n </svg>\n '}}]),e}()},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-panel-container {\n position: absolute;\n background: ",";\n}\n\n.guify-panel {\n padding: 14px;\n /* Last component will have a margin, so reduce padding to account for this */\n padding-bottom: calc(14px - ",");\n\n /* all: initial; */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n text-align: left;\n box-sizing: border-box;\n}\n\n.guify-panel.guify-panel-hidden {\n height: 0px;\n display: none;\n}\n\n.guify-panel * {\n box-sizing: initial;\n -webkit-box-sizing: initial;\n -moz-box-sizing: initial;\n}\n\n.guify-panel input {\n font-family: 'Hack';\n font-size: 11px;\n display: inline;\n}\n\n.guify-panel a {\n color: inherit;\n text-decoration: none;\n}\n\n.guify-panel-toggle-button {\n position: absolute;\n top: 0;\n margin: 0;\n padding: 0;\n width: 15px;\n height: 15px;\n line-height: 15px;\n text-align: center;\n border: none;\n cursor: pointer;\n font-family: inherit;\n color: ",";\n background-color: ",";\n\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n\n}\n\n/* Open/Close button styling */\n.guify-panel-toggle-button svg {\n fill-opacity: 0;\n stroke-width: 3;\n stroke: ",";\n}\n\n/* Remove browser default outlines since we're providing our own */\n.guify-panel-toggle-button:focus {\n outline:none;\n}\n.guify-panel-toggle-button::-moz-focus-inner {\n border: 0;\n}\n\n.guify-panel-toggle-button:hover,\n.guify-panel-toggle-button:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-panel-toggle-button:active {\n color: ",";\n background-color: ",";\n}\n\n"],["\n\n.guify-panel-container {\n position: absolute;\n background: ",";\n}\n\n.guify-panel {\n padding: 14px;\n /* Last component will have a margin, so reduce padding to account for this */\n padding-bottom: calc(14px - ",");\n\n /* all: initial; */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n text-align: left;\n box-sizing: border-box;\n}\n\n.guify-panel.guify-panel-hidden {\n height: 0px;\n display: none;\n}\n\n.guify-panel * {\n box-sizing: initial;\n -webkit-box-sizing: initial;\n -moz-box-sizing: initial;\n}\n\n.guify-panel input {\n font-family: 'Hack';\n font-size: 11px;\n display: inline;\n}\n\n.guify-panel a {\n color: inherit;\n text-decoration: none;\n}\n\n.guify-panel-toggle-button {\n position: absolute;\n top: 0;\n margin: 0;\n padding: 0;\n width: 15px;\n height: 15px;\n line-height: 15px;\n text-align: center;\n border: none;\n cursor: pointer;\n font-family: inherit;\n color: ",";\n background-color: ",";\n\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n\n}\n\n/* Open/Close button styling */\n.guify-panel-toggle-button svg {\n fill-opacity: 0;\n stroke-width: 3;\n stroke: ",";\n}\n\n/* Remove browser default outlines since we're providing our own */\n.guify-panel-toggle-button:focus {\n outline:none;\n}\n.guify-panel-toggle-button::-moz-focus-inner {\n border: 0;\n}\n\n.guify-panel-toggle-button:hover,\n.guify-panel-toggle-button:focus {\n color: ",";\n background-color: ",";\n}\n\n.guify-panel-toggle-button:active {\n color: ",";\n background-color: ",";\n}\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.colors.panelBackground,i.theme.sizing.componentSpacing,i.theme.colors.textPrimary,i.theme.colors.componentBackground,i.theme.colors.componentForeground,i.theme.colors.textHover,i.theme.colors.componentForeground,i.theme.colors.textActive,i.theme.colors.componentActive)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,n,t){var o=e.appendChild(document.createElement("div"));return o.innerHTML=n,(0,i.default)(o,{width:"100%",textAlign:"center",color:t.colors.textSecondary,height:"20px",marginBottom:"4px"}),o};var o=t(0),i=function(e){return e&&e.__esModule?e:{default:e}}(o);e.exports=n.default},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.ToastArea=void 0;var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=t(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r);t(1),n.ToastArea=function(){function e(n,i){o(this,e),this.opts=i,this.styles=t(78),this.element=n.appendChild(document.createElement("div")),this.element.classList.add(this.styles["guify-toast-area"]),(0,a.default)(this.element,{position:"absolute",width:"100%"})}return i(e,[{key:"CreateToast",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;console.log("[Toast] "+e);var o=this.element.appendChild(document.createElement("div"));o.classList.add(this.styles["guify-toast-notification"]),o.setAttribute("aria-live","polite"),o.innerHTML=e,(0,a.default)(o,{});var i=o.appendChild(document.createElement("button"));i.innerHTML="&#10006;",i.classList.add(this.styles["guify-toast-close-button"]);var r=void 0,s=function(){o.blur(),(0,a.default)(o,{opacity:"0"}),clearTimeout(r),r=setTimeout(function(){o&&o.parentNode.removeChild(o)},t)};r=setTimeout(s,n),i.onclick=s}}]),e}()},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-toast-notification {\n box-sizing: border-box;\n color: theme.colors.text1;\n position: relative;\n width: 100%;\n /* height: 20px; */\n padding: 8px;\n padding-left: 20px;\n padding-right: 20px;\n text-align: center;\n font-family: 'Hack', monospace;\n font-size: 11px;\n}\n\n.guify-toast-area .guify-toast-notification:nth-child(odd) {\n color: ",";\n background-color: ",";\n}\n\n.guify-toast-area .guify-toast-notification:nth-child(even) {\n color: ",";\n background-color: ",";\n}\n\n.guify-toast-close-button {\n color: ",";\n background: transparent;\n position: absolute;\n textAlign: center;\n margin-top: auto;\n margin-bottom: auto;\n border: none;\n cursor: pointer;\n top: 0;\n bottom: 0;\n right: 8px;\n}\n\n"],["\n\n.guify-toast-notification {\n box-sizing: border-box;\n color: theme.colors.text1;\n position: relative;\n width: 100%;\n /* height: 20px; */\n padding: 8px;\n padding-left: 20px;\n padding-right: 20px;\n text-align: center;\n font-family: 'Hack', monospace;\n font-size: 11px;\n}\n\n.guify-toast-area .guify-toast-notification:nth-child(odd) {\n color: ",";\n background-color: ",";\n}\n\n.guify-toast-area .guify-toast-notification:nth-child(even) {\n color: ",";\n background-color: ",";\n}\n\n.guify-toast-close-button {\n color: ",";\n background: transparent;\n position: absolute;\n textAlign: center;\n margin-top: auto;\n margin-bottom: auto;\n border: none;\n cursor: pointer;\n top: 0;\n bottom: 0;\n right: 8px;\n}\n\n"]),i=t(1),r=t(3);e.exports=r(o,i.theme.colors.textPrimary,i.theme.colors.panelBackground,i.theme.colors.textPrimary,i.theme.colors.menuBarBackground,i.theme.colors.textPrimary)},function(e,n,t){"use strict";var o=function(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(["\n\n.guify-container {\n position: relative;\n left: 0;\n width: 100%;\n font-size: 11px;\n z-index: 9999;\n}\n\n"],["\n\n.guify-container {\n position: relative;\n left: 0;\n width: 100%;\n font-size: 11px;\n z-index: 9999;\n}\n\n"]),i=(t(1),t(3));e.exports=i(o)}])});
  511. /******/
  512. (function() { // webpackBootstrap
  513. /******/
  514. "use strict";
  515. /******/
  516. var __webpack_modules__ = ({
  517. /***/
  518. "./src/Cow.js":
  519. /*!********************!*\
  520. !*** ./src/Cow.js ***!
  521. \********************/
  522. /***/
  523. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  524. __webpack_require__.r(__webpack_exports__);
  525. /* harmony import */
  526. var _config_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./config.json */ "./src/config.json");
  527. /* harmony import */
  528. var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./constants.js */ "./src/constants.js");
  529. /* harmony import */
  530. var _modules_entities_Player_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./modules/entities/Player.js */ "./src/modules/entities/Player.js");
  531. /* harmony import */
  532. var _modules_plugins_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./modules/plugins/index.js */ "./src/modules/plugins/index.js");
  533. /* harmony import */
  534. var _game_configs_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ./game_configs/index.js */ "./src/game_configs/index.js");
  535. class Cow {
  536. constructor() {
  537. this.config = _config_json__WEBPACK_IMPORTED_MODULE_0__
  538. this.items = _game_configs_index_js__WEBPACK_IMPORTED_MODULE_4__
  539. this.codec = _constants_js__WEBPACK_IMPORTED_MODULE_1__.codec
  540. this.socket = _constants_js__WEBPACK_IMPORTED_MODULE_1__.socket
  541. this.playersManager = _constants_js__WEBPACK_IMPORTED_MODULE_1__.playersManager
  542. this.objectsManager = _constants_js__WEBPACK_IMPORTED_MODULE_1__.objectsManager
  543. this.animalsManager = _constants_js__WEBPACK_IMPORTED_MODULE_1__.animalsManager
  544. this.ticker = _constants_js__WEBPACK_IMPORTED_MODULE_1__.ticker
  545. this.camera = _constants_js__WEBPACK_IMPORTED_MODULE_1__.camera
  546. this.renderer = _constants_js__WEBPACK_IMPORTED_MODULE_1__.renderer
  547. this.input = _constants_js__WEBPACK_IMPORTED_MODULE_1__.input
  548. this.placement = _constants_js__WEBPACK_IMPORTED_MODULE_1__.placement
  549. this.player = void 0
  550. this.inGame = false
  551. this._plugins = new Map([
  552. ["auto-reconect", new _modules_plugins_index_js__WEBPACK_IMPORTED_MODULE_3__.AutoReconect()]
  553. ])
  554. }
  555. onPacket(packetName, listener) {
  556. this.socket.handler.onPacket(packetName, listener)
  557. }
  558. onKeyboard(keyName, listener, options) {
  559. return this.input.keyboard.on(keyName, listener, options)
  560. }
  561. sendPacket(packetName, ...content) {
  562. this.socket.send(packetName, content)
  563. }
  564. placeItem(groupIndex, {
  565. angle
  566. } = {}) {
  567. this.placement.placeItem(groupIndex, {
  568. angle
  569. })
  570. }
  571. addRender(renderKey, renderFunc) {
  572. this.renderer.addRender(renderKey, renderFunc)
  573. }
  574. setInGame(_inGame) {
  575. if (typeof _inGame !== 'boolean') return
  576. this._inGame = _inGame
  577. }
  578. getNearPlayer(checkEnemy) {
  579. if (!this.player) return
  580. const {
  581. CowUtils
  582. } = window
  583. let players = this.playersManager.list
  584. if (checkEnemy) {
  585. players = players.filter((player) => !player.isAlly)
  586. }
  587. return players.sort((a, b) => {
  588. a = CowUtils.getDistance(a, this.player)
  589. b = CowUtils.getDistance(b, this.player)
  590. return a - b
  591. })[0]
  592. }
  593. getNearEnemy() {
  594. return this.getNearPlayer(true)
  595. }
  596. setPlayer(player) {
  597. this.camera.setTo(player.x, player.y)
  598. if (!(player instanceof _modules_entities_Player_js__WEBPACK_IMPORTED_MODULE_2__["default"]) || typeof this.player !== 'undefined') return
  599. this.player = player
  600. }
  601. setPluginState(pluginName, state) {
  602. if (!this._plugins.has(pluginName)) return
  603. const plugin = this._plugins.get(pluginName)
  604. plugin.setActiveState(state)
  605. }
  606. executePlugin(pluginName) {
  607. if (!this._plugins.has(pluginName)) return
  608. const plugin = this._plugins.get(pluginName)
  609. if (!plugin.isActiveState) return
  610. plugin.execute()
  611. }
  612. }
  613. /* harmony default export */
  614. __webpack_exports__["default"] = (Cow);
  615. /***/
  616. }),
  617. /***/
  618. "./src/constants.js":
  619. /*!**************************!*\
  620. !*** ./src/constants.js ***!
  621. \**************************/
  622. /***/
  623. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  624. __webpack_require__.r(__webpack_exports__);
  625. /* harmony export */
  626. __webpack_require__.d(__webpack_exports__, {
  627. /* harmony export */
  628. animalsManager: function() {
  629. return /* binding */ animalsManager;
  630. },
  631. /* harmony export */
  632. camera: function() {
  633. return /* binding */ camera;
  634. },
  635. /* harmony export */
  636. codec: function() {
  637. return /* binding */ codec;
  638. },
  639. /* harmony export */
  640. cow: function() {
  641. return /* binding */ cow;
  642. },
  643. /* harmony export */
  644. input: function() {
  645. return /* binding */ input;
  646. },
  647. /* harmony export */
  648. objectsManager: function() {
  649. return /* binding */ objectsManager;
  650. },
  651. /* harmony export */
  652. placement: function() {
  653. return /* binding */ placement;
  654. },
  655. /* harmony export */
  656. playersManager: function() {
  657. return /* binding */ playersManager;
  658. },
  659. /* harmony export */
  660. renderer: function() {
  661. return /* binding */ renderer;
  662. },
  663. /* harmony export */
  664. socket: function() {
  665. return /* binding */ socket;
  666. },
  667. /* harmony export */
  668. ticker: function() {
  669. return /* binding */ ticker;
  670. }
  671. /* harmony export */
  672. });
  673. /* harmony import */
  674. var _Cow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./Cow.js */ "./src/Cow.js");
  675. /* harmony import */
  676. var _modules_Placement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./modules/Placement.js */ "./src/modules/Placement.js");
  677. /* harmony import */
  678. var _modules_Ticker_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./modules/Ticker.js */ "./src/modules/Ticker.js");
  679. /* harmony import */
  680. var _modules_input_Input_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./modules/input/Input.js */ "./src/modules/input/Input.js");
  681. /* harmony import */
  682. var _modules_managers_AnimalsManager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ./modules/managers/AnimalsManager.js */ "./src/modules/managers/AnimalsManager.js");
  683. /* harmony import */
  684. var _modules_managers_ObjectsManager_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( /*! ./modules/managers/ObjectsManager.js */ "./src/modules/managers/ObjectsManager.js");
  685. /* harmony import */
  686. var _modules_managers_PlayersManager_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! ./modules/managers/PlayersManager.js */ "./src/modules/managers/PlayersManager.js");
  687. /* harmony import */
  688. var _modules_render_Camera_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! ./modules/render/Camera.js */ "./src/modules/render/Camera.js");
  689. /* harmony import */
  690. var _modules_render_Renderer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__( /*! ./modules/render/Renderer.js */ "./src/modules/render/Renderer.js");
  691. /* harmony import */
  692. var _modules_socket_Socket_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__( /*! ./modules/socket/Socket.js */ "./src/modules/socket/Socket.js");
  693. const codec = {
  694. decoder: void 0,
  695. encoder: void 0,
  696. isReady: false
  697. }
  698. const socket = new _modules_socket_Socket_js__WEBPACK_IMPORTED_MODULE_9__["default"]()
  699. const playersManager = new _modules_managers_PlayersManager_js__WEBPACK_IMPORTED_MODULE_6__["default"]()
  700. const objectsManager = new _modules_managers_ObjectsManager_js__WEBPACK_IMPORTED_MODULE_5__["default"]()
  701. const animalsManager = new _modules_managers_AnimalsManager_js__WEBPACK_IMPORTED_MODULE_4__["default"]()
  702. const ticker = new _modules_Ticker_js__WEBPACK_IMPORTED_MODULE_2__["default"]()
  703. const camera = new _modules_render_Camera_js__WEBPACK_IMPORTED_MODULE_7__["default"]()
  704. const renderer = new _modules_render_Renderer_js__WEBPACK_IMPORTED_MODULE_8__["default"]()
  705. const input = new _modules_input_Input_js__WEBPACK_IMPORTED_MODULE_3__["default"]()
  706. const placement = new _modules_Placement_js__WEBPACK_IMPORTED_MODULE_1__["default"]()
  707. const cow = new _Cow_js__WEBPACK_IMPORTED_MODULE_0__["default"]()
  708. /***/
  709. }),
  710. /***/
  711. "./src/game_configs/accessories.js":
  712. /*!*****************************************!*\
  713. !*** ./src/game_configs/accessories.js ***!
  714. \*****************************************/
  715. /***/
  716. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  717. __webpack_require__.r(__webpack_exports__);
  718. const accessories = [{
  719. id: 12,
  720. name: "Snowball",
  721. price: 1e3,
  722. scale: 105,
  723. xOff: 18,
  724. desc: "no effect"
  725. }, {
  726. id: 9,
  727. name: "Tree Cape",
  728. price: 1e3,
  729. scale: 90,
  730. desc: "no effect"
  731. }, {
  732. id: 10,
  733. name: "Stone Cape",
  734. price: 1e3,
  735. scale: 90,
  736. desc: "no effect"
  737. }, {
  738. id: 3,
  739. name: "Cookie Cape",
  740. price: 1500,
  741. scale: 90,
  742. desc: "no effect"
  743. }, {
  744. id: 8,
  745. name: "Cow Cape",
  746. price: 2e3,
  747. scale: 90,
  748. desc: "no effect"
  749. }, {
  750. id: 11,
  751. name: "Monkey Tail",
  752. price: 2e3,
  753. scale: 97,
  754. xOff: 25,
  755. desc: "Super speed but reduced damage",
  756. spdMult: 1.35,
  757. dmgMultO: .2
  758. }, {
  759. id: 17,
  760. name: "Apple Basket",
  761. price: 3e3,
  762. scale: 80,
  763. xOff: 12,
  764. desc: "slowly regenerates health over time",
  765. healthRegen: 1
  766. }, {
  767. id: 6,
  768. name: "Winter Cape",
  769. price: 3e3,
  770. scale: 90,
  771. desc: "no effect"
  772. }, {
  773. id: 4,
  774. name: "Skull Cape",
  775. price: 4e3,
  776. scale: 90,
  777. desc: "no effect"
  778. }, {
  779. id: 5,
  780. name: "Dash Cape",
  781. price: 5e3,
  782. scale: 90,
  783. desc: "no effect"
  784. }, {
  785. id: 2,
  786. name: "Dragon Cape",
  787. price: 6e3,
  788. scale: 90,
  789. desc: "no effect"
  790. }, {
  791. id: 1,
  792. name: "Super Cape",
  793. price: 8e3,
  794. scale: 90,
  795. desc: "no effect"
  796. }, {
  797. id: 7,
  798. name: "Troll Cape",
  799. price: 8e3,
  800. scale: 90,
  801. desc: "no effect"
  802. }, {
  803. id: 14,
  804. name: "Thorns",
  805. price: 1e4,
  806. scale: 115,
  807. xOff: 20,
  808. desc: "no effect"
  809. }, {
  810. id: 15,
  811. name: "Blockades",
  812. price: 1e4,
  813. scale: 95,
  814. xOff: 15,
  815. desc: "no effect"
  816. }, {
  817. id: 20,
  818. name: "Devils Tail",
  819. price: 1e4,
  820. scale: 95,
  821. xOff: 20,
  822. desc: "no effect"
  823. }, {
  824. id: 16,
  825. name: "Sawblade",
  826. price: 12e3,
  827. scale: 90,
  828. spin: !0,
  829. xOff: 0,
  830. desc: "deal damage to players that damage you",
  831. dmg: .15
  832. }, {
  833. id: 13,
  834. name: "Angel Wings",
  835. price: 15e3,
  836. scale: 138,
  837. xOff: 22,
  838. desc: "slowly regenerates health over time",
  839. healthRegen: 3
  840. }, {
  841. id: 19,
  842. name: "Shadow Wings",
  843. price: 15e3,
  844. scale: 138,
  845. xOff: 22,
  846. desc: "increased movement speed",
  847. spdMult: 1.1
  848. }, {
  849. id: 18,
  850. name: "Blood Wings",
  851. price: 2e4,
  852. scale: 178,
  853. xOff: 26,
  854. desc: "restores health when you deal damage",
  855. healD: .2
  856. }, {
  857. id: 21,
  858. name: "Corrupt X Wings",
  859. price: 2e4,
  860. scale: 178,
  861. xOff: 26,
  862. desc: "deal damage to players that damage you",
  863. dmg: .25
  864. }]
  865. accessories.searchById = function(id) {
  866. return this.find((accessory) => accessory.id === id)
  867. }
  868. /* harmony default export */
  869. __webpack_exports__["default"] = (accessories);
  870. /***/
  871. }),
  872. /***/
  873. "./src/game_configs/aiTypes.js":
  874. /*!*************************************!*\
  875. !*** ./src/game_configs/aiTypes.js ***!
  876. \*************************************/
  877. /***/
  878. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  879. __webpack_require__.r(__webpack_exports__);
  880. /* harmony default export */
  881. __webpack_exports__["default"] = ([{
  882. id: 0,
  883. src: "cow_1",
  884. killScore: 150,
  885. health: 500,
  886. weightM: 0.8,
  887. speed: 0.00095,
  888. turnSpeed: 0.001,
  889. scale: 72,
  890. drop: ["food", 50]
  891. }, {
  892. id: 1,
  893. src: "pig_1",
  894. killScore: 200,
  895. health: 800,
  896. weightM: 0.6,
  897. speed: 0.00085,
  898. turnSpeed: 0.001,
  899. scale: 72,
  900. drop: ["food", 80]
  901. }, {
  902. id: 2,
  903. name: "Bull",
  904. src: "bull_2",
  905. hostile: true,
  906. dmg: 20,
  907. killScore: 1000,
  908. health: 1800,
  909. weightM: 0.5,
  910. speed: 0.00094,
  911. turnSpeed: 0.00074,
  912. scale: 78,
  913. viewRange: 800,
  914. chargePlayer: true,
  915. drop: ["food", 100]
  916. }, {
  917. id: 3,
  918. name: "Bully",
  919. src: "bull_1",
  920. hostile: true,
  921. dmg: 20,
  922. killScore: 2000,
  923. health: 2800,
  924. weightM: 0.45,
  925. speed: 0.001,
  926. turnSpeed: 0.0008,
  927. scale: 90,
  928. viewRange: 900,
  929. chargePlayer: true,
  930. drop: ["food", 400]
  931. }, {
  932. id: 4,
  933. name: "Wolf",
  934. src: "wolf_1",
  935. hostile: true,
  936. dmg: 8,
  937. killScore: 500,
  938. health: 300,
  939. weightM: 0.45,
  940. speed: 0.001,
  941. turnSpeed: 0.002,
  942. scale: 84,
  943. viewRange: 800,
  944. chargePlayer: true,
  945. drop: ["food", 200]
  946. }, {
  947. id: 5,
  948. name: "Quack",
  949. src: "chicken_1",
  950. dmg: 8,
  951. killScore: 2000,
  952. noTrap: true,
  953. health: 300,
  954. weightM: 0.2,
  955. speed: 0.0018,
  956. turnSpeed: 0.006,
  957. scale: 70,
  958. drop: ["food", 100]
  959. }, {
  960. id: 6,
  961. name: "MOOSTAFA",
  962. nameScale: 50,
  963. src: "enemy",
  964. hostile: true,
  965. dontRun: true,
  966. fixedSpawn: true,
  967. spawnDelay: 60000,
  968. noTrap: true,
  969. colDmg: 100,
  970. dmg: 40,
  971. killScore: 8000,
  972. health: 18000,
  973. weightM: 0.4,
  974. speed: 0.0007,
  975. turnSpeed: 0.01,
  976. scale: 80,
  977. spriteMlt: 1.8,
  978. leapForce: 0.9,
  979. viewRange: 1000,
  980. hitRange: 210,
  981. hitDelay: 1000,
  982. chargePlayer: true,
  983. drop: ["food", 100]
  984. }, {
  985. id: 7,
  986. name: "Treasure",
  987. hostile: true,
  988. nameScale: 35,
  989. src: "crate_1",
  990. fixedSpawn: true,
  991. spawnDelay: 120000,
  992. colDmg: 200,
  993. killScore: 5000,
  994. health: 20000,
  995. weightM: 0.1,
  996. speed: 0.0,
  997. turnSpeed: 0.0,
  998. scale: 70,
  999. spriteMlt: 1.0
  1000. }, {
  1001. id: 8,
  1002. name: "MOOFIE",
  1003. src: "wolf_2",
  1004. hostile: true,
  1005. fixedSpawn: true,
  1006. dontRun: true,
  1007. hitScare: 4,
  1008. spawnDelay: 30000,
  1009. noTrap: true,
  1010. nameScale: 35,
  1011. dmg: 10,
  1012. colDmg: 100,
  1013. killScore: 3000,
  1014. health: 7000,
  1015. weightM: 0.45,
  1016. speed: 0.0015,
  1017. turnSpeed: 0.002,
  1018. scale: 90,
  1019. viewRange: 800,
  1020. chargePlayer: true,
  1021. drop: ["food", 1000]
  1022. }]);
  1023. /***/
  1024. }),
  1025. /***/
  1026. "./src/game_configs/groups.js":
  1027. /*!************************************!*\
  1028. !*** ./src/game_configs/groups.js ***!
  1029. \************************************/
  1030. /***/
  1031. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  1032. __webpack_require__.r(__webpack_exports__);
  1033. /* harmony default export */
  1034. __webpack_exports__["default"] = ([{
  1035. id: 0,
  1036. name: "food",
  1037. layer: 0
  1038. }, {
  1039. id: 1,
  1040. name: "walls",
  1041. place: !0,
  1042. limit: 30,
  1043. layer: 0
  1044. }, {
  1045. id: 2,
  1046. name: "spikes",
  1047. place: !0,
  1048. limit: 15,
  1049. layer: 0
  1050. }, {
  1051. id: 3,
  1052. name: "mill",
  1053. place: !0,
  1054. limit: 7,
  1055. sandboxLimit: 299,
  1056. layer: 1
  1057. }, {
  1058. id: 4,
  1059. name: "mine",
  1060. place: !0,
  1061. limit: 1,
  1062. layer: 0
  1063. }, {
  1064. id: 5,
  1065. name: "trap",
  1066. place: !0,
  1067. limit: 6,
  1068. layer: -1
  1069. }, {
  1070. id: 6,
  1071. name: "booster",
  1072. place: !0,
  1073. limit: 12,
  1074. sandboxLimit: 299,
  1075. layer: -1
  1076. }, {
  1077. id: 7,
  1078. name: "turret",
  1079. place: !0,
  1080. limit: 2,
  1081. layer: 1
  1082. }, {
  1083. id: 8,
  1084. name: "watchtower",
  1085. place: !0,
  1086. limit: 12,
  1087. layer: 1
  1088. }, {
  1089. id: 9,
  1090. name: "buff",
  1091. place: !0,
  1092. limit: 4,
  1093. layer: -1
  1094. }, {
  1095. id: 10,
  1096. name: "spawn",
  1097. place: !0,
  1098. limit: 1,
  1099. layer: -1
  1100. }, {
  1101. id: 11,
  1102. name: "sapling",
  1103. place: !0,
  1104. limit: 2,
  1105. layer: 0
  1106. }, {
  1107. id: 12,
  1108. name: "blocker",
  1109. place: !0,
  1110. limit: 3,
  1111. layer: -1
  1112. }, {
  1113. id: 13,
  1114. name: "teleporter",
  1115. place: !0,
  1116. limit: 2,
  1117. sandboxLimit: 299,
  1118. layer: -1
  1119. }]);
  1120. /***/
  1121. }),
  1122. /***/
  1123. "./src/game_configs/hats.js":
  1124. /*!**********************************!*\
  1125. !*** ./src/game_configs/hats.js ***!
  1126. \**********************************/
  1127. /***/
  1128. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  1129. __webpack_require__.r(__webpack_exports__);
  1130. const hats = [{
  1131. id: 45,
  1132. name: "Shame!",
  1133. dontSell: !0,
  1134. price: 0,
  1135. scale: 120,
  1136. desc: "hacks are for losers"
  1137. }, {
  1138. id: 51,
  1139. name: "Moo Cap",
  1140. price: 0,
  1141. scale: 120,
  1142. desc: "coolest mooer around"
  1143. }, {
  1144. id: 50,
  1145. name: "Apple Cap",
  1146. price: 0,
  1147. scale: 120,
  1148. desc: "apple farms remembers"
  1149. }, {
  1150. id: 28,
  1151. name: "Moo Head",
  1152. price: 0,
  1153. scale: 120,
  1154. desc: "no effect"
  1155. }, {
  1156. id: 29,
  1157. name: "Pig Head",
  1158. price: 0,
  1159. scale: 120,
  1160. desc: "no effect"
  1161. }, {
  1162. id: 30,
  1163. name: "Fluff Head",
  1164. price: 0,
  1165. scale: 120,
  1166. desc: "no effect"
  1167. }, {
  1168. id: 36,
  1169. name: "Pandou Head",
  1170. price: 0,
  1171. scale: 120,
  1172. desc: "no effect"
  1173. }, {
  1174. id: 37,
  1175. name: "Bear Head",
  1176. price: 0,
  1177. scale: 120,
  1178. desc: "no effect"
  1179. }, {
  1180. id: 38,
  1181. name: "Monkey Head",
  1182. price: 0,
  1183. scale: 120,
  1184. desc: "no effect"
  1185. }, {
  1186. id: 44,
  1187. name: "Polar Head",
  1188. price: 0,
  1189. scale: 120,
  1190. desc: "no effect"
  1191. }, {
  1192. id: 35,
  1193. name: "Fez Hat",
  1194. price: 0,
  1195. scale: 120,
  1196. desc: "no effect"
  1197. }, {
  1198. id: 42,
  1199. name: "Enigma Hat",
  1200. price: 0,
  1201. scale: 120,
  1202. desc: "join the enigma army"
  1203. }, {
  1204. id: 43,
  1205. name: "Blitz Hat",
  1206. price: 0,
  1207. scale: 120,
  1208. desc: "hey everybody i'm blitz"
  1209. }, {
  1210. id: 49,
  1211. name: "Bob XIII Hat",
  1212. price: 0,
  1213. scale: 120,
  1214. desc: "like and subscribe"
  1215. }, {
  1216. id: 57,
  1217. name: "Pumpkin",
  1218. price: 50,
  1219. scale: 120,
  1220. desc: "Spooooky"
  1221. }, {
  1222. id: 8,
  1223. name: "Bummle Hat",
  1224. price: 100,
  1225. scale: 120,
  1226. desc: "no effect"
  1227. }, {
  1228. id: 2,
  1229. name: "Straw Hat",
  1230. price: 500,
  1231. scale: 120,
  1232. desc: "no effect"
  1233. }, {
  1234. id: 15,
  1235. name: "Winter Cap",
  1236. price: 600,
  1237. scale: 120,
  1238. desc: "allows you to move at normal speed in snow",
  1239. coldM: 1
  1240. }, {
  1241. id: 5,
  1242. name: "Cowboy Hat",
  1243. price: 1e3,
  1244. scale: 120,
  1245. desc: "no effect"
  1246. }, {
  1247. id: 4,
  1248. name: "Ranger Hat",
  1249. price: 2e3,
  1250. scale: 120,
  1251. desc: "no effect"
  1252. }, {
  1253. id: 18,
  1254. name: "Explorer Hat",
  1255. price: 2e3,
  1256. scale: 120,
  1257. desc: "no effect"
  1258. }, {
  1259. id: 31,
  1260. name: "Flipper Hat",
  1261. price: 2500,
  1262. scale: 120,
  1263. desc: "have more control while in water",
  1264. watrImm: !0
  1265. }, {
  1266. id: 1,
  1267. name: "Marksman Cap",
  1268. price: 3e3,
  1269. scale: 120,
  1270. desc: "increases arrow speed and range",
  1271. aMlt: 1.3
  1272. }, {
  1273. id: 10,
  1274. name: "Bush Gear",
  1275. price: 3e3,
  1276. scale: 160,
  1277. desc: "allows you to disguise yourself as a bush"
  1278. }, {
  1279. id: 48,
  1280. name: "Halo",
  1281. price: 3e3,
  1282. scale: 120,
  1283. desc: "no effect"
  1284. }, {
  1285. id: 6,
  1286. name: "Soldier Helmet",
  1287. price: 4e3,
  1288. scale: 120,
  1289. desc: "reduces damage taken but slows movement",
  1290. spdMult: .94,
  1291. dmgMult: .75
  1292. }, {
  1293. id: 23,
  1294. name: "Anti Venom Gear",
  1295. price: 4e3,
  1296. scale: 120,
  1297. desc: "makes you immune to poison",
  1298. poisonRes: 1
  1299. }, {
  1300. id: 13,
  1301. name: "Medic Gear",
  1302. price: 5e3,
  1303. scale: 110,
  1304. desc: "slowly regenerates health over time",
  1305. healthRegen: 3
  1306. }, {
  1307. id: 9,
  1308. name: "Miners Helmet",
  1309. price: 5e3,
  1310. scale: 120,
  1311. desc: "earn 1 extra gold per resource",
  1312. extraGold: 1
  1313. }, {
  1314. id: 32,
  1315. name: "Musketeer Hat",
  1316. price: 5e3,
  1317. scale: 120,
  1318. desc: "reduces cost of projectiles",
  1319. projCost: .5
  1320. }, {
  1321. id: 7,
  1322. name: "Bull Helmet",
  1323. price: 6e3,
  1324. scale: 120,
  1325. desc: "increases damage done but drains health",
  1326. healthRegen: -5,
  1327. dmgMultO: 1.5,
  1328. spdMult: .96
  1329. }, {
  1330. id: 22,
  1331. name: "Emp Helmet",
  1332. price: 6e3,
  1333. scale: 120,
  1334. desc: "turrets won't attack but you move slower",
  1335. antiTurret: 1,
  1336. spdMult: .7
  1337. }, {
  1338. id: 12,
  1339. name: "Booster Hat",
  1340. price: 6e3,
  1341. scale: 120,
  1342. desc: "increases your movement speed",
  1343. spdMult: 1.16
  1344. }, {
  1345. id: 26,
  1346. name: "Barbarian Armor",
  1347. price: 8e3,
  1348. scale: 120,
  1349. desc: "knocks back enemies that attack you",
  1350. dmgK: .6
  1351. }, {
  1352. id: 21,
  1353. name: "Plague Mask",
  1354. price: 1e4,
  1355. scale: 120,
  1356. desc: "melee attacks deal poison damage",
  1357. poisonDmg: 5,
  1358. poisonTime: 6
  1359. }, {
  1360. id: 46,
  1361. name: "Bull Mask",
  1362. price: 1e4,
  1363. scale: 120,
  1364. desc: "bulls won't target you unless you attack them",
  1365. bullRepel: 1
  1366. }, {
  1367. id: 14,
  1368. name: "Windmill Hat",
  1369. topSprite: !0,
  1370. price: 1e4,
  1371. scale: 120,
  1372. desc: "generates points while worn",
  1373. pps: 1.5
  1374. }, {
  1375. id: 11,
  1376. name: "Spike Gear",
  1377. topSprite: !0,
  1378. price: 1e4,
  1379. scale: 120,
  1380. desc: "deal damage to players that damage you",
  1381. dmg: .45
  1382. }, {
  1383. id: 53,
  1384. name: "Turret Gear",
  1385. topSprite: !0,
  1386. price: 1e4,
  1387. scale: 120,
  1388. desc: "you become a walking turret",
  1389. turret: {
  1390. proj: 1,
  1391. range: 700,
  1392. rate: 2500
  1393. },
  1394. spdMult: .7
  1395. }, {
  1396. id: 20,
  1397. name: "Samurai Armor",
  1398. price: 12e3,
  1399. scale: 120,
  1400. desc: "increased attack speed and fire rate",
  1401. atkSpd: .78
  1402. }, {
  1403. id: 58,
  1404. name: "Dark Knight",
  1405. price: 12e3,
  1406. scale: 120,
  1407. desc: "restores health when you deal damage",
  1408. healD: .4
  1409. }, {
  1410. id: 27,
  1411. name: "Scavenger Gear",
  1412. price: 15e3,
  1413. scale: 120,
  1414. desc: "earn double points for each kill",
  1415. kScrM: 2
  1416. }, {
  1417. id: 40,
  1418. name: "Tank Gear",
  1419. price: 15e3,
  1420. scale: 120,
  1421. desc: "increased damage to buildings but slower movement",
  1422. spdMult: .3,
  1423. bDmg: 3.3
  1424. }, {
  1425. id: 52,
  1426. name: "Thief Gear",
  1427. price: 15e3,
  1428. scale: 120,
  1429. desc: "steal half of a players gold when you kill them",
  1430. goldSteal: .5
  1431. }, {
  1432. id: 55,
  1433. name: "Bloodthirster",
  1434. price: 2e4,
  1435. scale: 120,
  1436. desc: "Restore Health when dealing damage. And increased damage",
  1437. healD: .25,
  1438. dmgMultO: 1.2
  1439. }, {
  1440. id: 56,
  1441. name: "Assassin Gear",
  1442. price: 2e4,
  1443. scale: 120,
  1444. desc: "Go invisible when not moving. Can't eat. Increased speed",
  1445. noEat: !0,
  1446. spdMult: 1.1,
  1447. invisTimer: 1e3
  1448. }]
  1449. hats.searchById = function(id) {
  1450. return this.find((hat) => hat.id === id)
  1451. }
  1452. /* harmony default export */
  1453. __webpack_exports__["default"] = (hats);
  1454. /***/
  1455. }),
  1456. /***/
  1457. "./src/game_configs/index.js":
  1458. /*!***********************************!*\
  1459. !*** ./src/game_configs/index.js ***!
  1460. \***********************************/
  1461. /***/
  1462. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  1463. __webpack_require__.r(__webpack_exports__);
  1464. /* harmony export */
  1465. __webpack_require__.d(__webpack_exports__, {
  1466. /* harmony export */
  1467. accessories: function() {
  1468. return /* reexport safe */ _accessories_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  1469. },
  1470. /* harmony export */
  1471. aiTypes: function() {
  1472. return /* reexport safe */ _aiTypes_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  1473. },
  1474. /* harmony export */
  1475. groups: function() {
  1476. return /* reexport safe */ _groups_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  1477. },
  1478. /* harmony export */
  1479. hats: function() {
  1480. return /* reexport safe */ _hats_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  1481. },
  1482. /* harmony export */
  1483. list: function() {
  1484. return /* reexport safe */ _list_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  1485. },
  1486. /* harmony export */
  1487. projectiles: function() {
  1488. return /* reexport safe */ _projectiles_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  1489. },
  1490. /* harmony export */
  1491. variants: function() {
  1492. return /* reexport safe */ _variants_js__WEBPACK_IMPORTED_MODULE_6__["default"];
  1493. },
  1494. /* harmony export */
  1495. weapons: function() {
  1496. return /* reexport safe */ _weapons_js__WEBPACK_IMPORTED_MODULE_7__["default"];
  1497. }
  1498. /* harmony export */
  1499. });
  1500. /* harmony import */
  1501. var _accessories_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./accessories.js */ "./src/game_configs/accessories.js");
  1502. /* harmony import */
  1503. var _aiTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./aiTypes.js */ "./src/game_configs/aiTypes.js");
  1504. /* harmony import */
  1505. var _groups_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./groups.js */ "./src/game_configs/groups.js");
  1506. /* harmony import */
  1507. var _hats_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./hats.js */ "./src/game_configs/hats.js");
  1508. /* harmony import */
  1509. var _list_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ./list.js */ "./src/game_configs/list.js");
  1510. /* harmony import */
  1511. var _projectiles_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( /*! ./projectiles.js */ "./src/game_configs/projectiles.js");
  1512. /* harmony import */
  1513. var _variants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! ./variants.js */ "./src/game_configs/variants.js");
  1514. /* harmony import */
  1515. var _weapons_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! ./weapons.js */ "./src/game_configs/weapons.js");
  1516. /***/
  1517. }),
  1518. /***/
  1519. "./src/game_configs/list.js":
  1520. /*!**********************************!*\
  1521. !*** ./src/game_configs/list.js ***!
  1522. \**********************************/
  1523. /***/
  1524. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  1525. __webpack_require__.r(__webpack_exports__);
  1526. /* harmony import */
  1527. var _groups_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./groups.js */ "./src/game_configs/groups.js");
  1528. const list = [{
  1529. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][0],
  1530. name: "apple",
  1531. desc: "restores 20 health when consumed",
  1532. req: ["food", 10],
  1533. consume: function(e) {
  1534. return e.changeHealth(20, e)
  1535. },
  1536. scale: 22,
  1537. holdOffset: 15
  1538. }, {
  1539. age: 3,
  1540. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][0],
  1541. name: "cookie",
  1542. desc: "restores 40 health when consumed",
  1543. req: ["food", 15],
  1544. consume: function(e) {
  1545. return e.changeHealth(40, e)
  1546. },
  1547. scale: 27,
  1548. holdOffset: 15
  1549. }, {
  1550. age: 7,
  1551. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][0],
  1552. name: "cheese",
  1553. desc: "restores 30 health and another 50 over 5 seconds",
  1554. req: ["food", 25],
  1555. consume: function(e) {
  1556. return e.changeHealth(30, e) || e.health < 100 ? (e.dmgOverTime.dmg = -10,
  1557. e.dmgOverTime.doer = e,
  1558. e.dmgOverTime.time = 5,
  1559. !0) : !1
  1560. },
  1561. scale: 27,
  1562. holdOffset: 15
  1563. }, {
  1564. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][1],
  1565. name: "wood wall",
  1566. desc: "provides protection for your village",
  1567. req: ["wood", 10],
  1568. projDmg: !0,
  1569. health: 380,
  1570. scale: 50,
  1571. holdOffset: 20,
  1572. placeOffset: -5
  1573. }, {
  1574. age: 3,
  1575. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][1],
  1576. name: "stone wall",
  1577. desc: "provides improved protection for your village",
  1578. req: ["stone", 25],
  1579. health: 900,
  1580. scale: 50,
  1581. holdOffset: 20,
  1582. placeOffset: -5
  1583. }, {
  1584. age: 7,
  1585. pre: 1,
  1586. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][1],
  1587. name: "castle wall",
  1588. desc: "provides powerful protection for your village",
  1589. req: ["stone", 35],
  1590. health: 1500,
  1591. scale: 52,
  1592. holdOffset: 20,
  1593. placeOffset: -5
  1594. }, {
  1595. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][2],
  1596. name: "spikes",
  1597. desc: "damages enemies when they touch them",
  1598. req: ["wood", 20, "stone", 5],
  1599. health: 400,
  1600. dmg: 20,
  1601. scale: 49,
  1602. spritePadding: -23,
  1603. holdOffset: 8,
  1604. placeOffset: -5
  1605. }, {
  1606. age: 5,
  1607. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][2],
  1608. name: "greater spikes",
  1609. desc: "damages enemies when they touch them",
  1610. req: ["wood", 30, "stone", 10],
  1611. health: 500,
  1612. dmg: 35,
  1613. scale: 52,
  1614. spritePadding: -23,
  1615. holdOffset: 8,
  1616. placeOffset: -5
  1617. }, {
  1618. age: 9,
  1619. pre: 1,
  1620. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][2],
  1621. name: "poison spikes",
  1622. desc: "poisons enemies when they touch them",
  1623. req: ["wood", 35, "stone", 15],
  1624. health: 600,
  1625. dmg: 30,
  1626. pDmg: 5,
  1627. scale: 52,
  1628. spritePadding: -23,
  1629. holdOffset: 8,
  1630. placeOffset: -5
  1631. }, {
  1632. age: 9,
  1633. pre: 2,
  1634. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][2],
  1635. name: "spinning spikes",
  1636. desc: "damages enemies when they touch them",
  1637. req: ["wood", 30, "stone", 20],
  1638. health: 500,
  1639. dmg: 45,
  1640. turnSpeed: .003,
  1641. scale: 52,
  1642. spritePadding: -23,
  1643. holdOffset: 8,
  1644. placeOffset: -5
  1645. }, {
  1646. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][3],
  1647. name: "windmill",
  1648. desc: "generates gold over time",
  1649. req: ["wood", 50, "stone", 10],
  1650. health: 400,
  1651. pps: 1,
  1652. turnSpeed: .0016,
  1653. spritePadding: 25,
  1654. iconLineMult: 12,
  1655. scale: 45,
  1656. holdOffset: 20,
  1657. placeOffset: 5
  1658. }, {
  1659. age: 5,
  1660. pre: 1,
  1661. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][3],
  1662. name: "faster windmill",
  1663. desc: "generates more gold over time",
  1664. req: ["wood", 60, "stone", 20],
  1665. health: 500,
  1666. pps: 1.5,
  1667. turnSpeed: .0025,
  1668. spritePadding: 25,
  1669. iconLineMult: 12,
  1670. scale: 47,
  1671. holdOffset: 20,
  1672. placeOffset: 5
  1673. }, {
  1674. age: 8,
  1675. pre: 1,
  1676. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][3],
  1677. name: "power mill",
  1678. desc: "generates more gold over time",
  1679. req: ["wood", 100, "stone", 50],
  1680. health: 800,
  1681. pps: 2,
  1682. turnSpeed: .005,
  1683. spritePadding: 25,
  1684. iconLineMult: 12,
  1685. scale: 47,
  1686. holdOffset: 20,
  1687. placeOffset: 5
  1688. }, {
  1689. age: 5,
  1690. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][4],
  1691. type: 2,
  1692. name: "mine",
  1693. desc: "allows you to mine stone",
  1694. req: ["wood", 20, "stone", 100],
  1695. iconLineMult: 12,
  1696. scale: 65,
  1697. holdOffset: 20,
  1698. placeOffset: 0
  1699. }, {
  1700. age: 5,
  1701. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][11],
  1702. type: 0,
  1703. name: "sapling",
  1704. desc: "allows you to farm wood",
  1705. req: ["wood", 150],
  1706. iconLineMult: 12,
  1707. colDiv: .5,
  1708. scale: 110,
  1709. holdOffset: 50,
  1710. placeOffset: -15
  1711. }, {
  1712. age: 4,
  1713. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][5],
  1714. name: "pit trap",
  1715. desc: "pit that traps enemies if they walk over it",
  1716. req: ["wood", 30, "stone", 30],
  1717. trap: !0,
  1718. ignoreCollision: !0,
  1719. hideFromEnemy: !0,
  1720. health: 500,
  1721. colDiv: .2,
  1722. scale: 50,
  1723. holdOffset: 20,
  1724. placeOffset: -5
  1725. }, {
  1726. age: 4,
  1727. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][6],
  1728. name: "boost pad",
  1729. desc: "provides boost when stepped on",
  1730. req: ["stone", 20, "wood", 5],
  1731. ignoreCollision: !0,
  1732. boostSpeed: 1.5,
  1733. health: 150,
  1734. colDiv: .7,
  1735. scale: 45,
  1736. holdOffset: 20,
  1737. placeOffset: -5
  1738. }, {
  1739. age: 7,
  1740. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][7],
  1741. doUpdate: !0,
  1742. name: "turret",
  1743. desc: "defensive structure that shoots at enemies",
  1744. req: ["wood", 200, "stone", 150],
  1745. health: 800,
  1746. projectile: 1,
  1747. shootRange: 700,
  1748. shootRate: 2200,
  1749. scale: 43,
  1750. holdOffset: 20,
  1751. placeOffset: -5
  1752. }, {
  1753. age: 7,
  1754. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][8],
  1755. name: "platform",
  1756. desc: "platform to shoot over walls and cross over water",
  1757. req: ["wood", 20],
  1758. ignoreCollision: !0,
  1759. zIndex: 1,
  1760. health: 300,
  1761. scale: 43,
  1762. holdOffset: 20,
  1763. placeOffset: -5
  1764. }, {
  1765. age: 7,
  1766. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][9],
  1767. name: "healing pad",
  1768. desc: "standing on it will slowly heal you",
  1769. req: ["wood", 30, "food", 10],
  1770. ignoreCollision: !0,
  1771. healCol: 15,
  1772. health: 400,
  1773. colDiv: .7,
  1774. scale: 45,
  1775. holdOffset: 20,
  1776. placeOffset: -5
  1777. }, {
  1778. age: 9,
  1779. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][10],
  1780. name: "spawn pad",
  1781. desc: "you will spawn here when you die but it will dissapear",
  1782. req: ["wood", 100, "stone", 100],
  1783. health: 400,
  1784. ignoreCollision: !0,
  1785. spawnPoint: !0,
  1786. scale: 45,
  1787. holdOffset: 20,
  1788. placeOffset: -5
  1789. }, {
  1790. age: 7,
  1791. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][12],
  1792. name: "blocker",
  1793. desc: "blocks building in radius",
  1794. req: ["wood", 30, "stone", 25],
  1795. ignoreCollision: !0,
  1796. blocker: 300,
  1797. health: 400,
  1798. colDiv: .7,
  1799. scale: 45,
  1800. holdOffset: 20,
  1801. placeOffset: -5
  1802. }, {
  1803. age: 7,
  1804. group: _groups_js__WEBPACK_IMPORTED_MODULE_0__["default"][13],
  1805. name: "teleporter",
  1806. desc: "teleports you to a random point on the map",
  1807. req: ["wood", 60, "stone", 60],
  1808. ignoreCollision: !0,
  1809. teleport: !0,
  1810. health: 200,
  1811. colDiv: .7,
  1812. scale: 45,
  1813. holdOffset: 20,
  1814. placeOffset: -5
  1815. }]
  1816. for (var i = 0; i < list.length; ++i) {
  1817. list[i].id = i
  1818. if (list[i].pre) {
  1819. list[i].pre = i - list[i].pre
  1820. }
  1821. }
  1822. /* harmony default export */
  1823. __webpack_exports__["default"] = (list);
  1824. /***/
  1825. }),
  1826. /***/
  1827. "./src/game_configs/projectiles.js":
  1828. /*!*****************************************!*\
  1829. !*** ./src/game_configs/projectiles.js ***!
  1830. \*****************************************/
  1831. /***/
  1832. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  1833. __webpack_require__.r(__webpack_exports__);
  1834. /* harmony default export */
  1835. __webpack_exports__["default"] = ([{
  1836. indx: 0,
  1837. layer: 0,
  1838. src: "arrow_1",
  1839. dmg: 25,
  1840. speed: 1.6,
  1841. scale: 103,
  1842. range: 1e3
  1843. }, {
  1844. indx: 1,
  1845. layer: 1,
  1846. dmg: 25,
  1847. scale: 20
  1848. }, {
  1849. indx: 0,
  1850. layer: 0,
  1851. src: "arrow_1",
  1852. dmg: 35,
  1853. speed: 2.5,
  1854. scale: 103,
  1855. range: 1200
  1856. }, {
  1857. indx: 0,
  1858. layer: 0,
  1859. src: "arrow_1",
  1860. dmg: 30,
  1861. speed: 2,
  1862. scale: 103,
  1863. range: 1200
  1864. }, {
  1865. indx: 1,
  1866. layer: 1,
  1867. dmg: 16,
  1868. scale: 20
  1869. }, {
  1870. indx: 0,
  1871. layer: 0,
  1872. src: "bullet_1",
  1873. dmg: 50,
  1874. speed: 3.6,
  1875. scale: 160,
  1876. range: 1400
  1877. }]);
  1878. /***/
  1879. }),
  1880. /***/
  1881. "./src/game_configs/variants.js":
  1882. /*!**************************************!*\
  1883. !*** ./src/game_configs/variants.js ***!
  1884. \**************************************/
  1885. /***/
  1886. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  1887. __webpack_require__.r(__webpack_exports__);
  1888. /* harmony default export */
  1889. __webpack_exports__["default"] = ([{
  1890. id: 0,
  1891. src: "",
  1892. xp: 0,
  1893. val: 1
  1894. }, {
  1895. id: 1,
  1896. src: "_g",
  1897. xp: 3000,
  1898. val: 1.1
  1899. }, {
  1900. id: 2,
  1901. src: "_d",
  1902. xp: 7000,
  1903. val: 1.18
  1904. }, {
  1905. id: 3,
  1906. src: "_r",
  1907. poison: true,
  1908. xp: 12000,
  1909. val: 1.18
  1910. }]);
  1911. /***/
  1912. }),
  1913. /***/
  1914. "./src/game_configs/weapons.js":
  1915. /*!*************************************!*\
  1916. !*** ./src/game_configs/weapons.js ***!
  1917. \*************************************/
  1918. /***/
  1919. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  1920. __webpack_require__.r(__webpack_exports__);
  1921. /* harmony default export */
  1922. __webpack_exports__["default"] = ([{
  1923. id: 0,
  1924. type: 0,
  1925. name: "tool hammer",
  1926. desc: "tool for gathering all resources",
  1927. src: "hammer_1",
  1928. length: 140,
  1929. width: 140,
  1930. xOff: -3,
  1931. yOff: 18,
  1932. dmg: 25,
  1933. range: 65,
  1934. gather: 1,
  1935. speed: 300
  1936. }, {
  1937. id: 1,
  1938. type: 0,
  1939. age: 2,
  1940. name: "hand axe",
  1941. desc: "gathers resources at a higher rate",
  1942. src: "axe_1",
  1943. length: 140,
  1944. width: 140,
  1945. xOff: 3,
  1946. yOff: 24,
  1947. dmg: 30,
  1948. spdMult: 1,
  1949. range: 70,
  1950. gather: 2,
  1951. speed: 400
  1952. }, {
  1953. id: 2,
  1954. type: 0,
  1955. age: 8,
  1956. pre: 1,
  1957. name: "great axe",
  1958. desc: "deal more damage and gather more resources",
  1959. src: "great_axe_1",
  1960. length: 140,
  1961. width: 140,
  1962. xOff: -8,
  1963. yOff: 25,
  1964. dmg: 35,
  1965. spdMult: 1,
  1966. range: 75,
  1967. gather: 4,
  1968. speed: 400
  1969. }, {
  1970. id: 3,
  1971. type: 0,
  1972. age: 2,
  1973. name: "short sword",
  1974. desc: "increased attack power but slower move speed",
  1975. src: "sword_1",
  1976. iPad: 1.3,
  1977. length: 130,
  1978. width: 210,
  1979. xOff: -8,
  1980. yOff: 46,
  1981. dmg: 35,
  1982. spdMult: .85,
  1983. range: 110,
  1984. gather: 1,
  1985. speed: 300
  1986. }, {
  1987. id: 4,
  1988. type: 0,
  1989. age: 8,
  1990. pre: 3,
  1991. name: "katana",
  1992. desc: "greater range and damage",
  1993. src: "samurai_1",
  1994. iPad: 1.3,
  1995. length: 130,
  1996. width: 210,
  1997. xOff: -8,
  1998. yOff: 59,
  1999. dmg: 40,
  2000. spdMult: .8,
  2001. range: 118,
  2002. gather: 1,
  2003. speed: 300
  2004. }, {
  2005. id: 5,
  2006. type: 0,
  2007. age: 2,
  2008. name: "polearm",
  2009. desc: "long range melee weapon",
  2010. src: "spear_1",
  2011. iPad: 1.3,
  2012. length: 130,
  2013. width: 210,
  2014. xOff: -8,
  2015. yOff: 53,
  2016. dmg: 45,
  2017. knock: .2,
  2018. spdMult: .82,
  2019. range: 142,
  2020. gather: 1,
  2021. speed: 700
  2022. }, {
  2023. id: 6,
  2024. type: 0,
  2025. age: 2,
  2026. name: "bat",
  2027. desc: "fast long range melee weapon",
  2028. src: "bat_1",
  2029. iPad: 1.3,
  2030. length: 110,
  2031. width: 180,
  2032. xOff: -8,
  2033. yOff: 53,
  2034. dmg: 20,
  2035. knock: .7,
  2036. range: 110,
  2037. gather: 1,
  2038. speed: 300
  2039. }, {
  2040. id: 7,
  2041. type: 0,
  2042. age: 2,
  2043. name: "daggers",
  2044. desc: "really fast short range weapon",
  2045. src: "dagger_1",
  2046. iPad: .8,
  2047. length: 110,
  2048. width: 110,
  2049. xOff: 18,
  2050. yOff: 0,
  2051. dmg: 20,
  2052. knock: .1,
  2053. range: 65,
  2054. gather: 1,
  2055. hitSlow: .1,
  2056. spdMult: 1.13,
  2057. speed: 100
  2058. }, {
  2059. id: 8,
  2060. type: 0,
  2061. age: 2,
  2062. name: "stick",
  2063. desc: "great for gathering but very weak",
  2064. src: "stick_1",
  2065. length: 140,
  2066. width: 140,
  2067. xOff: 3,
  2068. yOff: 24,
  2069. dmg: 1,
  2070. spdMult: 1,
  2071. range: 70,
  2072. gather: 7,
  2073. speed: 400
  2074. }, {
  2075. id: 9,
  2076. type: 1,
  2077. age: 6,
  2078. name: "hunting bow",
  2079. desc: "bow used for ranged combat and hunting",
  2080. src: "bow_1",
  2081. req: ["wood", 4],
  2082. length: 120,
  2083. width: 120,
  2084. xOff: -6,
  2085. yOff: 0,
  2086. projectile: 0,
  2087. spdMult: .75,
  2088. speed: 600
  2089. }, {
  2090. id: 10,
  2091. type: 1,
  2092. age: 6,
  2093. name: "great hammer",
  2094. desc: "hammer used for destroying structures",
  2095. src: "great_hammer_1",
  2096. length: 140,
  2097. width: 140,
  2098. xOff: -9,
  2099. yOff: 25,
  2100. dmg: 10,
  2101. spdMult: .88,
  2102. range: 75,
  2103. sDmg: 7.5,
  2104. gather: 1,
  2105. speed: 400
  2106. }, {
  2107. id: 11,
  2108. type: 1,
  2109. age: 6,
  2110. name: "wooden shield",
  2111. desc: "blocks projectiles and reduces melee damage",
  2112. src: "shield_1",
  2113. length: 120,
  2114. width: 120,
  2115. shield: .2,
  2116. xOff: 6,
  2117. yOff: 0,
  2118. spdMult: .7
  2119. }, {
  2120. id: 12,
  2121. type: 1,
  2122. age: 8,
  2123. pre: 9,
  2124. name: "crossbow",
  2125. desc: "deals more damage and has greater range",
  2126. src: "crossbow_1",
  2127. req: ["wood", 5],
  2128. aboveHand: !0,
  2129. armS: .75,
  2130. length: 120,
  2131. width: 120,
  2132. xOff: -4,
  2133. yOff: 0,
  2134. projectile: 2,
  2135. spdMult: .7,
  2136. speed: 700
  2137. }, {
  2138. id: 13,
  2139. type: 1,
  2140. age: 9,
  2141. pre: 12,
  2142. name: "repeater crossbow",
  2143. desc: "high firerate crossbow with reduced damage",
  2144. src: "crossbow_2",
  2145. req: ["wood", 10],
  2146. aboveHand: !0,
  2147. armS: .75,
  2148. length: 120,
  2149. width: 120,
  2150. xOff: -4,
  2151. yOff: 0,
  2152. projectile: 3,
  2153. spdMult: .7,
  2154. speed: 230
  2155. }, {
  2156. id: 14,
  2157. type: 1,
  2158. age: 6,
  2159. name: "mc grabby",
  2160. desc: "steals resources from enemies",
  2161. src: "grab_1",
  2162. length: 130,
  2163. width: 210,
  2164. xOff: -8,
  2165. yOff: 53,
  2166. dmg: 0,
  2167. steal: 250,
  2168. knock: .2,
  2169. spdMult: 1.05,
  2170. range: 125,
  2171. gather: 0,
  2172. speed: 700
  2173. }, {
  2174. id: 15,
  2175. type: 1,
  2176. age: 9,
  2177. pre: 12,
  2178. name: "musket",
  2179. desc: "slow firerate but high damage and range",
  2180. src: "musket_1",
  2181. req: ["stone", 10],
  2182. aboveHand: !0,
  2183. rec: .35,
  2184. armS: .6,
  2185. hndS: .3,
  2186. hndD: 1.6,
  2187. length: 205,
  2188. width: 205,
  2189. xOff: 25,
  2190. yOff: 0,
  2191. projectile: 5,
  2192. hideProjectile: !0,
  2193. spdMult: .6,
  2194. speed: 1500
  2195. }]);
  2196. /***/
  2197. }),
  2198. /***/
  2199. "./src/hooks.js":
  2200. /*!**********************!*\
  2201. !*** ./src/hooks.js ***!
  2202. \**********************/
  2203. /***/
  2204. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2205. __webpack_require__.r(__webpack_exports__);
  2206. /* harmony import */
  2207. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./constants.js */ "./src/constants.js");
  2208. /* harmony import */
  2209. var _utils_CowUtils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./utils/CowUtils.js */ "./src/utils/CowUtils.js");
  2210. // define codec
  2211. _utils_CowUtils_js__WEBPACK_IMPORTED_MODULE_1__["default"].createHook({
  2212. property: "extensionCodec",
  2213. setter: (instance) => {
  2214. if (typeof _constants_js__WEBPACK_IMPORTED_MODULE_0__.codec.encoder !== 'undefined') {
  2215. _constants_js__WEBPACK_IMPORTED_MODULE_0__.codec.decoder = instance
  2216. _constants_js__WEBPACK_IMPORTED_MODULE_0__.codec.isReady = true
  2217. return
  2218. }
  2219. _constants_js__WEBPACK_IMPORTED_MODULE_0__.codec.encoder = instance
  2220. }
  2221. })
  2222. // define websocket
  2223. WebSocket.prototype.send = new Proxy(window.WebSocket.prototype.send, {
  2224. apply(target, instance, args) {
  2225. if (!_constants_js__WEBPACK_IMPORTED_MODULE_0__.socket.isReady) {
  2226. _constants_js__WEBPACK_IMPORTED_MODULE_0__.socket.setWebSocket(instance)
  2227. }
  2228. return target.apply(instance, args)
  2229. }
  2230. })
  2231. /***/
  2232. }),
  2233. /***/
  2234. "./src/modules/Placement.js":
  2235. /*!**********************************!*\
  2236. !*** ./src/modules/Placement.js ***!
  2237. \**********************************/
  2238. /***/
  2239. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2240. __webpack_require__.r(__webpack_exports__);
  2241. /* harmony import */
  2242. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../constants.js */ "./src/constants.js");
  2243. class Placement {
  2244. constructor() {
  2245. this.delay = 0
  2246. this.lastPlaceTick = 0
  2247. }
  2248. setDelay(_delay) {
  2249. this.delay = _delay
  2250. }
  2251. sendPlace(id, angle) {
  2252. const timeSincePlace = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.ticker.ticks - this.lastPlaceTick
  2253. if (timeSincePlace < this.delay) return
  2254. const {
  2255. packets
  2256. } = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.designations
  2257. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.sendPacket(packets.SELECT_BUILD, id)
  2258. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.sendPacket(packets.ATTACK_STATE, 1, angle)
  2259. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.sendPacket(packets.ATTACK_STATE, 0, angle)
  2260. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.sendPacket(packets.SELECT_BUILD, _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.weapons[0], true)
  2261. this.lastPlaceTick = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.ticker.ticks
  2262. }
  2263. placeItem(groupIndex, {
  2264. angle
  2265. } = {}) {
  2266. if (!_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player?.alive) return
  2267. const itemIndex = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.items[groupIndex]
  2268. if (typeof itemIndex === 'undefined') return
  2269. const item = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.list[itemIndex]
  2270. if (!_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.isCanBuild(item)) return
  2271. angle = typeof angle === 'undefined' ? _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.lookAngle : angle
  2272. const scale = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.scale + item.scale + (item.placeOffset || 0)
  2273. const placeX = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.x2 + (scale * Math.cos(angle))
  2274. const placeY = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.y2 + (scale * Math.sin(angle))
  2275. const isCanPlace = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.objectsManager.checkItemLocation(placeX, placeY, item.scale, 0.6, item.id, false)
  2276. if (!(item.consume && (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.skin && _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.skin?.noEat)) && (item.consume || isCanPlace)) {
  2277. this.sendPlace(item.id, angle)
  2278. }
  2279. }
  2280. }
  2281. /* harmony default export */
  2282. __webpack_exports__["default"] = (Placement);
  2283. /***/
  2284. }),
  2285. /***/
  2286. "./src/modules/Ticker.js":
  2287. /*!*******************************!*\
  2288. !*** ./src/modules/Ticker.js ***!
  2289. \*******************************/
  2290. /***/
  2291. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2292. __webpack_require__.r(__webpack_exports__);
  2293. class Ticker {
  2294. constructor() {
  2295. this.ticks = 0
  2296. this.tickTasks = []
  2297. this.isClear = false
  2298. }
  2299. clear() {
  2300. this.tickTasks = []
  2301. this.isClear = true
  2302. }
  2303. addTickTask(callback) {
  2304. if (!(callback instanceof Function)) return
  2305. this.tasks.push(callback)
  2306. }
  2307. updateTicks() {
  2308. this.ticks += 1
  2309. if (this.isClear) {
  2310. this.isClear = false
  2311. return
  2312. }
  2313. if (this.tickTasks.length) {
  2314. this.tickTasks[0]()
  2315. this.tickTasks.shift()
  2316. }
  2317. }
  2318. }
  2319. /* harmony default export */
  2320. __webpack_exports__["default"] = (Ticker);
  2321. /***/
  2322. }),
  2323. /***/
  2324. "./src/modules/entities/Animal.js":
  2325. /*!****************************************!*\
  2326. !*** ./src/modules/entities/Animal.js ***!
  2327. \****************************************/
  2328. /***/
  2329. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2330. __webpack_require__.r(__webpack_exports__);
  2331. /* harmony import */
  2332. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  2333. /* harmony import */
  2334. var _Entity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./Entity.js */ "./src/modules/entities/Entity.js");
  2335. class Animal extends _Entity_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
  2336. constructor({
  2337. sid,
  2338. index,
  2339. x,
  2340. y,
  2341. dir
  2342. }) {
  2343. super({
  2344. sid
  2345. })
  2346. const {
  2347. CowUtils
  2348. } = window
  2349. const data = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.aiTypes[index]
  2350. if (!data) data = {}
  2351. this.sid = sid
  2352. this.x = x
  2353. this.y = y
  2354. this.name = data.name || data.src
  2355. this.startX = data?.fixedSpawn ? x : null
  2356. this.startY = data?.fixedSpawn ? y : null
  2357. this.xVel = 0
  2358. this.yVel = 0
  2359. this.zIndex = 0
  2360. this.dir = CowUtils.fixAngle(dir)
  2361. this.dirPlus = 0
  2362. this.index = index
  2363. this.src = data.src
  2364. this.weightM = data.weightM
  2365. this.speed = data.speed
  2366. this.killScore = data.killScore
  2367. this.turnSpeed = data.turnSpeed
  2368. this.scale = data.scale
  2369. this.maxHealth = data.health
  2370. this.leapForce = data.leapForce
  2371. this.health = this.maxHealth
  2372. this.chargePlayer = data.chargePlayer
  2373. this.viewRange = data.viewRange
  2374. this.drop = data.drop
  2375. this.dmg = data.dmg
  2376. this.hostile = data.hostile
  2377. this.dontRun = data.dontRun
  2378. this.hitRange = data.hitRange
  2379. this.hitDelay = data.hitDelay
  2380. this.hitScare = data.hitScare
  2381. this.spriteMlt = data.spriteMlt
  2382. this.nameScale = data.nameScale
  2383. this.colDmg = data.colDmg
  2384. this.noTrap = data.noTrap
  2385. this.spawnDelay = data.spawnDelay
  2386. this.hitWait = 0
  2387. this.waitCount = 1000
  2388. this.moveCount = 0
  2389. this.targetDir = 0
  2390. this.runFrom = null
  2391. this.chargeTarget = null
  2392. this.dmgOverTime = {}
  2393. this.visible = true
  2394. }
  2395. disable() {
  2396. this.visible = false
  2397. }
  2398. setTickData(data) {
  2399. const time = Date.now()
  2400. this.index = data[1]
  2401. this.time1 = (this.time2 === undefined) ? time : this.time2
  2402. this.time2 = time
  2403. this.x1 = this.x
  2404. this.y1 = this.y
  2405. this.x2 = data[2]
  2406. this.y2 = data[3]
  2407. this.dir1 = (this.dir2 === undefined) ? data[4] : this.dir2
  2408. this.dir2 = data[4]
  2409. this.dir = this.dir2
  2410. this.health = data[5]
  2411. this.dt = 0
  2412. this.visible = true
  2413. }
  2414. }
  2415. /* harmony default export */
  2416. __webpack_exports__["default"] = (Animal);
  2417. /***/
  2418. }),
  2419. /***/
  2420. "./src/modules/entities/Entity.js":
  2421. /*!****************************************!*\
  2422. !*** ./src/modules/entities/Entity.js ***!
  2423. \****************************************/
  2424. /***/
  2425. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2426. __webpack_require__.r(__webpack_exports__);
  2427. /* harmony import */
  2428. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  2429. class Entity {
  2430. constructor({
  2431. id,
  2432. sid
  2433. }) {
  2434. this.id = id
  2435. this.sid = sid
  2436. this.name = "unknown"
  2437. this.dt = 0
  2438. this.x = 0
  2439. this.y = 0
  2440. this.x1 = this.x
  2441. this.y1 = this.y
  2442. this.x2 = this.x1
  2443. this.y2 = this.y1
  2444. this.dir = 0
  2445. this.dir1 = 0
  2446. this.dir2 = this.dir1
  2447. this.health = 100
  2448. this.maxHealth = this.health
  2449. this.scale = 35
  2450. this.zIndex = 0
  2451. }
  2452. get renderX() {
  2453. return this.x - _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.camera.xOffset
  2454. }
  2455. get renderY() {
  2456. return this.y - _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.camera.yOffset
  2457. }
  2458. setInitData(data) {
  2459. if (!Array.isArray(data) || !data?.length) return
  2460. this.id = data[0]
  2461. this.sid = data[1]
  2462. this.name = data[2]
  2463. this.x = data[3]
  2464. this.y = data[4]
  2465. this.dir = data[5]
  2466. this.health = data[6]
  2467. this.maxHealth = data[7]
  2468. this.scale = data[8]
  2469. if (typeof data[9] !== 'undefined') {
  2470. this.skinColor = data[9]
  2471. }
  2472. this.visible = false
  2473. }
  2474. setTo(x, y) {
  2475. if (typeof x !== 'number' || typeof y !== 'number') return
  2476. if (isNaN(x) || isNaN(y)) return
  2477. this.x = x
  2478. this.y = y
  2479. }
  2480. }
  2481. /* harmony default export */
  2482. __webpack_exports__["default"] = (Entity);
  2483. /***/
  2484. }),
  2485. /***/
  2486. "./src/modules/entities/GameObject.js":
  2487. /*!********************************************!*\
  2488. !*** ./src/modules/entities/GameObject.js ***!
  2489. \********************************************/
  2490. /***/
  2491. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2492. __webpack_require__.r(__webpack_exports__);
  2493. /* harmony import */
  2494. var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants */ "./src/constants.js");
  2495. class GameObject {
  2496. constructor({
  2497. sid
  2498. }) {
  2499. const {
  2500. CowUtils
  2501. } = window
  2502. this.sid = sid
  2503. this.init = function(x, y, dir, scale, type, data, owner) {
  2504. data = typeof data === 'undefined' ? {} : data
  2505. this.x = x
  2506. this.y = y
  2507. this.dir = CowUtils.fixAngle(dir)
  2508. this.xWiggle = 0
  2509. this.yWiggle = 0
  2510. this.scale = scale
  2511. this.type = type
  2512. this.id = data.id
  2513. this.owner = owner
  2514. this.name = data.name
  2515. this.isItem = Boolean(this.id !== undefined)
  2516. this.group = data.group
  2517. this.health = data.health
  2518. this.maxHealth = data.health
  2519. this.layer = this.group !== undefined ? this.group.layer : this.type === 0 ? 3 : this.type === 2 ? 0 : this.type === 4 ? -1 : 2
  2520. this.sentTo = {}
  2521. this.gridLocations = []
  2522. this.doUpdate = data.doUpdate
  2523. this.colDiv = data.colDiv || 1
  2524. this.blocker = data.blocker
  2525. this.ignoreCollision = data.ignoreCollision
  2526. this.dontGather = data.dontGather
  2527. this.hideFromEnemy = data.hideFromEnemy
  2528. this.friction = data.friction
  2529. this.projDmg = data.projDmg
  2530. this.dmg = data.dmg
  2531. this.pDmg = data.pDmg
  2532. this.pps = data.pps
  2533. this.zIndex = data.zIndex || 0
  2534. this.turnSpeed = data.turnSpeed
  2535. this.req = data.req
  2536. this.trap = data.trap
  2537. this.healCol = data.healCol
  2538. this.teleport = data.teleport
  2539. this.boostSpeed = data.boostSpeed
  2540. this.projectile = data.projectile
  2541. this.shootRange = data.shootRange
  2542. this.shootRate = data.shootRate
  2543. this.shootCount = this.shootRate
  2544. this.spawnPoint = data.spawnPoint
  2545. this.visible = true
  2546. this.active = true
  2547. }
  2548. }
  2549. get renderX() {
  2550. return this.x + Number(this.xWiggle) - _constants__WEBPACK_IMPORTED_MODULE_0__.cow.camera.xOffset
  2551. }
  2552. get renderY() {
  2553. return this.y + Number(this.yWiggle) - _constants__WEBPACK_IMPORTED_MODULE_0__.cow.camera.yOffset
  2554. }
  2555. setVisible(_visible) {
  2556. if (typeof _visible !== 'boolean') return
  2557. this.visible = _visible
  2558. }
  2559. setActive(_active) {
  2560. if (typeof _active !== 'boolean') return
  2561. this.active = _active
  2562. }
  2563. getScale(scaleMult, hasColDiv) {
  2564. scaleMult = scaleMult || 1
  2565. const isVolume = this.isItem || this.type == 2 || this.type == 3 || this.type == 4
  2566. return this.scale * (isVolume ? 1 : (0.6 * scaleMult)) * (hasColDiv ? 1 : this.colDiv)
  2567. }
  2568. changeHealth(amount) {
  2569. amount = parseInt(amount)
  2570. this.health += amount
  2571. return this.health <= 0
  2572. }
  2573. doWiggle(dir) {
  2574. this.xWiggle += _constants__WEBPACK_IMPORTED_MODULE_0__.cow.config.gatherWiggle * Math.cos(dir)
  2575. this.yWiggle += _constants__WEBPACK_IMPORTED_MODULE_0__.cow.config.gatherWiggle * Math.sin(dir)
  2576. }
  2577. update() {
  2578. if (!this.visible) return
  2579. const {
  2580. renderer
  2581. } = _constants__WEBPACK_IMPORTED_MODULE_0__.cow
  2582. if (this.xWiggle) {
  2583. this.xWiggle *= Math.pow(0.99, renderer.delta)
  2584. }
  2585. if (this.yWiggle) {
  2586. this.yWiggle *= Math.pow(0.99, renderer.delta)
  2587. }
  2588. if (this.turnSpeed) {
  2589. this.dir += this.turnSpeed * renderer.delta
  2590. }
  2591. }
  2592. }
  2593. /* harmony default export */
  2594. __webpack_exports__["default"] = (GameObject);
  2595. /***/
  2596. }),
  2597. /***/
  2598. "./src/modules/entities/Player.js":
  2599. /*!****************************************!*\
  2600. !*** ./src/modules/entities/Player.js ***!
  2601. \****************************************/
  2602. /***/
  2603. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2604. __webpack_require__.r(__webpack_exports__);
  2605. /* harmony import */
  2606. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  2607. /* harmony import */
  2608. var _Entity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./Entity.js */ "./src/modules/entities/Entity.js");
  2609. /* harmony import */
  2610. var _reloads_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./reloads.js */ "./src/modules/entities/reloads.js");
  2611. class Player extends _Entity_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
  2612. constructor({
  2613. id,
  2614. sid
  2615. }) {
  2616. super({
  2617. id,
  2618. sid
  2619. })
  2620. this.skinColor = void 0
  2621. this.buildIndex = -1
  2622. this.weaponIndex = 0
  2623. this.weaponVariant = 0
  2624. this.team = ""
  2625. this.skinIndex = 0
  2626. this.tailIndex = 0
  2627. this.isLeader = false
  2628. this.iconIndex = 0
  2629. this.items = [0, 3, 6, 10]
  2630. this.weapons = [0]
  2631. this.skins = {}
  2632. this.tails = {}
  2633. const defineFreeCaps = (config, capType) => {
  2634. for (let i = 0; i < config.length; ++i) {
  2635. const cap = config[i]
  2636. if (cap.price > 0) continue
  2637. this[capType][cap.id] = true
  2638. }
  2639. }
  2640. defineFreeCaps(_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.hats, "skins")
  2641. defineFreeCaps(_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.accessories, "tails")
  2642. this.itemCounts = {}
  2643. this.gold = 100
  2644. this.stone = 100
  2645. this.wood = 100
  2646. this.food = 100
  2647. this.reloads = new _reloads_js__WEBPACK_IMPORTED_MODULE_2__["default"]()
  2648. this.maxXP = 300
  2649. this.XP = 0
  2650. this.age = 1
  2651. this.kills = 0
  2652. this.upgrAge = 2
  2653. this.upgradePoints = 0
  2654. this.hitTime = null
  2655. this.shameCount = 0
  2656. this.shameTimer = 0
  2657. this.speed = 0
  2658. this.moveDir = 0
  2659. this.isPlayer = true
  2660. this.lastDeath = {}
  2661. this.createdInstance = {}
  2662. this._updateCreatedInstance()
  2663. }
  2664. get isMe() {
  2665. return Boolean(this.sid === _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player?.sid && _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player?.alive)
  2666. }
  2667. get isAlly() {
  2668. return Boolean((this.sid === _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player?.sid) || (this.team && this.team === _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.team))
  2669. }
  2670. get weapon() {
  2671. return _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.weapons[this.weaponIndex]
  2672. }
  2673. get lookAngle() {
  2674. return this.isMe ? _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.input.mouse.angle : (this.dir || this.dir2)
  2675. }
  2676. get skin() {
  2677. return _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.hats.searchById(this.skinIndex)
  2678. }
  2679. get tail() {
  2680. return _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.accessories.searchById(this.tailIndex)
  2681. }
  2682. _updateCreatedInstance() {
  2683. this.createdInstance = {}
  2684. const ignoreKeys = ["skins", "tails", "sid", "id", "lastDeath", "reloads"]
  2685. for (const key in this) {
  2686. if (key === "createdInstance") continue
  2687. if (ignoreKeys.includes(key)) continue
  2688. this.createdInstance[key] = this[key]
  2689. }
  2690. }
  2691. spawn() {
  2692. this.alive = true
  2693. if (!this.isMe) return
  2694. for (const key in this.createdInstance) {
  2695. const value = this.createdInstance[key]
  2696. this[key] = value
  2697. }
  2698. this._updateCreatedInstance()
  2699. this.reloads = new _reloads_js__WEBPACK_IMPORTED_MODULE_2__["default"]()
  2700. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.setInGame(true)
  2701. }
  2702. kill() {
  2703. if (!this.isMe) return
  2704. this.alive = false
  2705. this.lastDeath = {
  2706. x: this.x,
  2707. y: this.y
  2708. }
  2709. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.setInGame(false)
  2710. }
  2711. disable() {
  2712. this.visible = false
  2713. }
  2714. hasResources(item) {
  2715. for (let i = 0; i < item.req.length; i += 2) {
  2716. if (this[item.req[i]] >= Math.round(item.req[i + 1])) continue
  2717. return false
  2718. }
  2719. return true
  2720. }
  2721. isCanBuild(item) {
  2722. return this.hasResources(item)
  2723. }
  2724. setTickData(data) {
  2725. if (!Array.isArray(data) || !data?.length) return
  2726. const {
  2727. CowUtils
  2728. } = window
  2729. this.dt = 0
  2730. this.x1 = this.x
  2731. this.y1 = this.y
  2732. this.speed = CowUtils.getDistance(this.x2, this.y2, data[1], data[2])
  2733. this.x2 = data[1]
  2734. this.y2 = data[2]
  2735. this.moveDir = CowUtils.getDirection(this.x1, this.y1, this.x2, this.y2)
  2736. this.dir1 = this.dir2 !== null ? this.dir2 : data[3]
  2737. this.dir2 = data[3]
  2738. this.time1 = this.time2 !== null ? this.time2 : Date.now()
  2739. this.time2 = Date.now()
  2740. this.buildIndex = data[4]
  2741. this.weaponIndex = data[5]
  2742. this.weaponVariant = data[6]
  2743. this.team = data[7]
  2744. this.isLeader = data[8]
  2745. this.skinIndex = data[9]
  2746. this.tailIndex = data[10]
  2747. this.iconIndex = data[11]
  2748. this.zIndex = data[12]
  2749. this.visible = true
  2750. this.tick()
  2751. }
  2752. updateShame() {
  2753. const timeSinceHit = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.ticker.ticks - this.hitTime
  2754. if (timeSinceHit < 2) {
  2755. this.shameCount += 1
  2756. if (this.shameCount >= 8) {
  2757. this.shameTimer = 30000
  2758. this.shameCount = 0
  2759. }
  2760. } else {
  2761. this.shameCount = Math.max(0, this.shameCount - 2)
  2762. }
  2763. }
  2764. changeHealth(_health) {
  2765. if (this.health > _health) {
  2766. this.updateShame()
  2767. this.hitTime = 0
  2768. } else {
  2769. this.hitTime = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.ticker.ticks
  2770. }
  2771. this.health = _health
  2772. }
  2773. onGather(didHit, weaponIndex) {
  2774. const reloadType = weaponIndex > 8 ? "secondary" : "primary"
  2775. const currentReload = this.reloads[reloadType]
  2776. currentReload.count = 0
  2777. currentReload.date = Date.now()
  2778. if (didHit) {
  2779. const {
  2780. CowUtils
  2781. } = window
  2782. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.objectsManager.eachVisible((gameObject) => {
  2783. if (!gameObject.isItem || gameObject.dontGather) return
  2784. const scale = gameObject.scale || gameObject.getScale()
  2785. const distance = CowUtils.getDistance(this, gameObject) - scale
  2786. const angle = CowUtils.getDirection(gameObject, this)
  2787. const angleDistance = CowUtils.getAngleDist(angle, this.dir2)
  2788. const isInAngle = angleDistance <= _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.gatherAngle
  2789. const isInRange = distance <= this.weapon.range
  2790. if (!isInAngle || !isInRange) return
  2791. const damage = this.weapon.dmg * _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.variants[this.weaponVariant].val
  2792. const damageAmount = damage * (this.weapon.sDmg || 1) * (this.skin?.id === 40 ? 3.3 : 1)
  2793. gameObject.changeHealth(-damageAmount)
  2794. })
  2795. }
  2796. }
  2797. updateReloads() {
  2798. const reloadType = this.weaponIndex > 8 ? "secondary" : "primary"
  2799. const currentReload = this.reloads[reloadType]
  2800. if (currentReload.id != this.weapon.id) {
  2801. currentReload.setData(this.weapon, this.weaponVariant)
  2802. }
  2803. if (this.weaponVariant != currentReload.rarity) {
  2804. currentReload.rarity = this.weaponVariant
  2805. }
  2806. if (this.weaponIndex === currentReload.id) {
  2807. if (currentReload.count < currentReload.max && this.buildIndex === -1) {
  2808. currentReload.add()
  2809. }
  2810. }
  2811. this.reloads[reloadType] = currentReload
  2812. if (this.reloads.turret.count < this.reloads.turret.max) {
  2813. this.reloads.turret.add()
  2814. }
  2815. }
  2816. tick() {
  2817. this.updateReloads()
  2818. if (this.skinIndex != 45) {
  2819. if (this.shameCount === 8) {
  2820. this.shameTimer = 0
  2821. this.shameCont = 0
  2822. }
  2823. if (this.shameTimer > 0) this.shameTimer = 0
  2824. } else {
  2825. if (this.shameCount != 8) {
  2826. this.shameCount = 8
  2827. this.shameTimer = 270
  2828. }
  2829. if (this.shameTimer > 0) this.shameTimer -= 1
  2830. }
  2831. }
  2832. canSee(other) {
  2833. if (!other) return false
  2834. const dx = Math.abs(other.x - this.x) - other.scale
  2835. const dy = Math.abs(other.y - this.y) - other.scale
  2836. return dx <= (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.maxScreenWidth / 2) * 1.3 && dy <= (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.maxScreenHeight / 2) * 1.3
  2837. }
  2838. }
  2839. /* harmony default export */
  2840. __webpack_exports__["default"] = (Player);
  2841. /***/
  2842. }),
  2843. /***/
  2844. "./src/modules/entities/reloads.js":
  2845. /*!*****************************************!*\
  2846. !*** ./src/modules/entities/reloads.js ***!
  2847. \*****************************************/
  2848. /***/
  2849. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2850. __webpack_require__.r(__webpack_exports__);
  2851. class Reload {
  2852. constructor(id, speed, ticks) {
  2853. const tick = 111
  2854. ticks = ticks || Math.ceil(speed / tick)
  2855. this.id = id
  2856. this.count = ticks
  2857. this.date = 0
  2858. this.date2 = this.date
  2859. this.max = ticks
  2860. this.max2 = speed
  2861. this.rarity = 0
  2862. this.done = true
  2863. this.active = false
  2864. const {
  2865. CowUtils
  2866. } = window
  2867. this._default = CowUtils.removeProto(this)
  2868. }
  2869. get dif() {
  2870. return this.count / this.max
  2871. }
  2872. get smoothValue() {
  2873. if (this.done) return 1
  2874. return (this.date2 - this.date) / this.max2
  2875. }
  2876. setData(weapon, weaponVariant) {
  2877. this.id = weapon.id
  2878. this.max = weapon.speed ? Math.ceil(weapon.speed / (1e3 / 9)) : 0
  2879. this.max2 = weapon.speed
  2880. this.count = parseInt(this.max)
  2881. this.done = true
  2882. this.rarity = weaponVariant
  2883. this.active = true
  2884. }
  2885. add() {
  2886. this.count += 1
  2887. this.count = parseInt(this.count)
  2888. this.done = this.count === this.max
  2889. }
  2890. clear() {
  2891. this.count = 0
  2892. this.done = false
  2893. this.date = Date.now()
  2894. }
  2895. }
  2896. class Reloads {
  2897. constructor() {
  2898. this.primary = new Reload(5, 300),
  2899. this.secondary = new Reload(15, 1500),
  2900. this.turret = new Reload(null, 2500, 23)
  2901. }
  2902. }
  2903. /* harmony default export */
  2904. __webpack_exports__["default"] = (Reloads);
  2905. /***/
  2906. }),
  2907. /***/
  2908. "./src/modules/input/Input.js":
  2909. /*!************************************!*\
  2910. !*** ./src/modules/input/Input.js ***!
  2911. \************************************/
  2912. /***/
  2913. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2914. __webpack_require__.r(__webpack_exports__);
  2915. /* harmony import */
  2916. var _Keyboard_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./Keyboard.js */ "./src/modules/input/Keyboard.js");
  2917. /* harmony import */
  2918. var _Mouse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./Mouse.js */ "./src/modules/input/Mouse.js");
  2919. class Input {
  2920. constructor() {
  2921. this.keyboard = new _Keyboard_js__WEBPACK_IMPORTED_MODULE_0__["default"]()
  2922. this.mouse = new _Mouse_js__WEBPACK_IMPORTED_MODULE_1__["default"]()
  2923. }
  2924. }
  2925. /* harmony default export */
  2926. __webpack_exports__["default"] = (Input);
  2927. /***/
  2928. }),
  2929. /***/
  2930. "./src/modules/input/Keyboard.js":
  2931. /*!***************************************!*\
  2932. !*** ./src/modules/input/Keyboard.js ***!
  2933. \***************************************/
  2934. /***/
  2935. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  2936. __webpack_require__.r(__webpack_exports__);
  2937. class Keyboard {
  2938. constructor() {
  2939. this.activeKeys = new Map()
  2940. this.events = new Map()
  2941. this.init()
  2942. }
  2943. on(keyName, listener, options = {
  2944. repeat: true
  2945. }) {
  2946. if (typeof keyName !== 'string') return
  2947. if (!(listener instanceof Function)) return
  2948. if (!this.events.has(keyName)) {
  2949. this.events.set(keyName, new Map())
  2950. }
  2951. const listeners = this.events.get(keyName)
  2952. const id = parseInt(Date.now() / 1000 + (Math.random() * 100e3))
  2953. const value = {
  2954. listener,
  2955. options
  2956. }
  2957. listeners.set(id, value)
  2958. return {
  2959. rebind: (newKeyName) => {
  2960. const listener = this.events.get(keyName).get(id)
  2961. if (this.events.get(keyName).has(id)) {
  2962. this.events.get(keyName).delete(id)
  2963. }
  2964. return this.on(newKeyName, listener.listener, listener.options)
  2965. }
  2966. }
  2967. }
  2968. trigger(code, doRepeat) {
  2969. this.events.forEach((eventsChunk, keyName) => {
  2970. if (!eventsChunk.size || keyName !== code) return
  2971. eventsChunk.forEach((event) => {
  2972. if (!event?.options?.repeat && doRepeat) return
  2973. event.listener()
  2974. })
  2975. })
  2976. }
  2977. onKeydown(event) {
  2978. if (!this.activeKeys.get(event.code)) {
  2979. this.activeKeys.set(event.code, true)
  2980. this.trigger(event.code)
  2981. }
  2982. }
  2983. onKeyup(event) {
  2984. if (this.activeKeys.get(event.code)) {
  2985. this.activeKeys.set(event.code, false)
  2986. }
  2987. }
  2988. update() {
  2989. this.activeKeys.forEach((state, keyName) => {
  2990. if (!state) return
  2991. this.trigger(keyName, true)
  2992. })
  2993. }
  2994. init() {
  2995. window.addEventListener("keydown", this.onKeydown.bind(this))
  2996. window.addEventListener("keyup", this.onKeyup.bind(this))
  2997. }
  2998. }
  2999. /* harmony default export */
  3000. __webpack_exports__["default"] = (Keyboard);
  3001. /***/
  3002. }),
  3003. /***/
  3004. "./src/modules/input/Mouse.js":
  3005. /*!************************************!*\
  3006. !*** ./src/modules/input/Mouse.js ***!
  3007. \************************************/
  3008. /***/
  3009. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3010. __webpack_require__.r(__webpack_exports__);
  3011. /* harmony import */
  3012. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3013. class Mouse {
  3014. constructor() {
  3015. this.x = void 0
  3016. this.y = void 0
  3017. this.isDown = false
  3018. this.isUp = !this.isDown
  3019. this.lastClick = null
  3020. this.lastMove = null
  3021. window.addEventListener("load", this.init.bind(this))
  3022. }
  3023. get angle() {
  3024. const canvas = document.getElementById("gameCanvas") || _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.renderer.canvas
  3025. if (!canvas) return
  3026. const width = canvas.clientWidth / 2
  3027. const height = canvas.clientHeight / 2
  3028. return Math.atan2(this.y - height, this.x - width)
  3029. }
  3030. setTo(x, y) {
  3031. if (typeof x !== 'number' || typeof y !== 'number') return
  3032. this.x = x
  3033. this.y = y
  3034. this.lastMove = Date.now()
  3035. }
  3036. setState(_isDown) {
  3037. this.isDown = _isDown
  3038. this.isUp = !_isDown
  3039. this.lastClick = Date.now()
  3040. }
  3041. onMousemove(event) {
  3042. this.setTo(event.clientX, event.clientY)
  3043. }
  3044. onMousedown() {
  3045. this.setState(true)
  3046. }
  3047. onMouseup() {
  3048. this.setState(false)
  3049. }
  3050. init() {
  3051. const touchControls = document.getElementById("touch-controls-fullscreen")
  3052. touchControls.addEventListener("mousemove", this.onMousemove.bind(this))
  3053. touchControls.addEventListener("mousedown", this.onMousedown.bind(this))
  3054. touchControls.addEventListener("mouseup", this.onMouseup.bind(this))
  3055. }
  3056. }
  3057. /* harmony default export */
  3058. __webpack_exports__["default"] = (Mouse);
  3059. /***/
  3060. }),
  3061. /***/
  3062. "./src/modules/managers/AnimalsManager.js":
  3063. /*!************************************************!*\
  3064. !*** ./src/modules/managers/AnimalsManager.js ***!
  3065. \************************************************/
  3066. /***/
  3067. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3068. __webpack_require__.r(__webpack_exports__);
  3069. /* harmony import */
  3070. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3071. /* harmony import */
  3072. var _entities_Animal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ../entities/Animal.js */ "./src/modules/entities/Animal.js");
  3073. /* harmony import */
  3074. var _entities_Player_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ../entities/Player.js */ "./src/modules/entities/Player.js");
  3075. class AnimalsManager {
  3076. constructor() {
  3077. this.animals = new Map()
  3078. this.animalsInStream = 0
  3079. }
  3080. get list() {
  3081. return [...this.animals.values()]
  3082. }
  3083. getById(sid) {
  3084. return this.animals.get(sid)
  3085. }
  3086. each(callback) {
  3087. this.animals.forEach(callback)
  3088. }
  3089. eachVisible(callback) {
  3090. this.each((animal) => {
  3091. if (!animal.visible) return
  3092. callback(animal)
  3093. })
  3094. }
  3095. updateAnimals(content) {
  3096. const chunkSize = 7
  3097. this.animalsInStream = 0
  3098. this.each((animal) => {
  3099. animal.disable()
  3100. })
  3101. for (let i = 0; i < content.length; i += chunkSize) {
  3102. const chunk = content.slice(i, i + chunkSize)
  3103. this.animalsInStream += 1
  3104. if (!this.animals.has(chunk[0])) {
  3105. const animal = new _entities_Animal_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
  3106. sid: chunk[0],
  3107. index: chunk[1],
  3108. x: chunk[2],
  3109. y: chunk[3],
  3110. dir: chunk[4]
  3111. })
  3112. this.animals.set(chunk[0], animal)
  3113. continue
  3114. }
  3115. const animal = this.animals.get(chunk[0])
  3116. animal.setTickData(chunk)
  3117. }
  3118. }
  3119. interpolate() {
  3120. const {
  3121. renderer
  3122. } = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow
  3123. const lastTime = renderer.nowUpdate - (1000 / (0 || 10))
  3124. this.eachVisible((animal) => {
  3125. animal.dt += renderer.delta
  3126. const rate = 170
  3127. const tmpRate = Math.min(1.7, animal.dt / rate)
  3128. const xDif = animal.x2 - animal.x1
  3129. const yDif = animal.y2 - animal.y1
  3130. animal.setTo(
  3131. animal.x1 + (xDif * tmpRate),
  3132. animal.y1 + (yDif * tmpRate)
  3133. )
  3134. })
  3135. }
  3136. update() {
  3137. this.interpolate()
  3138. }
  3139. }
  3140. /* harmony default export */
  3141. __webpack_exports__["default"] = (AnimalsManager);
  3142. /***/
  3143. }),
  3144. /***/
  3145. "./src/modules/managers/ObjectsManager.js":
  3146. /*!************************************************!*\
  3147. !*** ./src/modules/managers/ObjectsManager.js ***!
  3148. \************************************************/
  3149. /***/
  3150. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3151. __webpack_require__.r(__webpack_exports__);
  3152. /* harmony import */
  3153. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3154. /* harmony import */
  3155. var _entities_GameObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ../entities/GameObject.js */ "./src/modules/entities/GameObject.js");
  3156. class ObjectsManager {
  3157. constructor() {
  3158. this.objects = new Map()
  3159. this.objectsInStream = 0
  3160. }
  3161. get list() {
  3162. return [...this.objects.values()]
  3163. }
  3164. getById(sid) {
  3165. return this.objects.get(sid)
  3166. }
  3167. each(callback) {
  3168. this.objects.forEach(callback)
  3169. }
  3170. eachVisible(callback) {
  3171. const visibleObjects = this.list.filter((object) => object.active && object.visible)
  3172. for (let i = 0; i < visibleObjects.length; i++) {
  3173. const gameObject = visibleObjects[i]
  3174. if (!gameObject.visible || !gameObject.active) return
  3175. callback(gameObject)
  3176. }
  3177. }
  3178. disableAllObjects(sid) {
  3179. this.each((gameObject) => {
  3180. if (!gameObject.owner || gameObject.owner.sid !== sid) return
  3181. this.objects.delete(gameObject.sid)
  3182. })
  3183. }
  3184. add(sid, x, y, dir, scale, type, data, setSID, owner) {
  3185. let tmpObject = this.getById(sid)
  3186. if (!tmpObject) {
  3187. tmpObject = new _entities_GameObject_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
  3188. sid
  3189. })
  3190. this.objects.set(sid, tmpObject)
  3191. }
  3192. if (setSID) tmpObject.sid = sid
  3193. tmpObject.init(x, y, dir, scale, type, data, setSID, owner)
  3194. }
  3195. checkItemLocation(x, y, scale, scaleMult, indx, ignoreWater) {
  3196. const {
  3197. CowUtils
  3198. } = window
  3199. const position = {
  3200. x,
  3201. y
  3202. }
  3203. let isCanPlace = true
  3204. this.eachVisible((gameObject) => {
  3205. if (!isCanPlace) return
  3206. const blockScale = (gameObject.blocker ? gameObject.blocker : gameObject.getScale(scaleMult, gameObject.isItem))
  3207. if (CowUtils.getDistance(position, gameObject) < (scale + blockScale)) {
  3208. isCanPlace = false
  3209. }
  3210. })
  3211. if (
  3212. !ignoreWater && indx != 18 &&
  3213. y >= (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.mapScale / 2) - (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.riverWidth / 2) &&
  3214. y <= (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.mapScale / 2) + (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.riverWidth / 2)
  3215. ) {
  3216. isCanPlace = false
  3217. }
  3218. return isCanPlace
  3219. }
  3220. update() {
  3221. this.objectsInStream = 0
  3222. this.each((gameObject) => {
  3223. if (!_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.canSee(gameObject)) {
  3224. return gameObject.setVisible(false)
  3225. }
  3226. gameObject.setVisible(true)
  3227. this.objectsInStream += 1
  3228. // if (!gameObject.doUpdate) return
  3229. gameObject.update()
  3230. })
  3231. }
  3232. }
  3233. /* harmony default export */
  3234. __webpack_exports__["default"] = (ObjectsManager);
  3235. /***/
  3236. }),
  3237. /***/
  3238. "./src/modules/managers/PlayersManager.js":
  3239. /*!************************************************!*\
  3240. !*** ./src/modules/managers/PlayersManager.js ***!
  3241. \************************************************/
  3242. /***/
  3243. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3244. __webpack_require__.r(__webpack_exports__);
  3245. /* harmony import */
  3246. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3247. /* harmony import */
  3248. var _entities_Player_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ../entities/Player.js */ "./src/modules/entities/Player.js");
  3249. class PlayersManager {
  3250. constructor() {
  3251. this.players = new Map()
  3252. this.playersInStream = 0
  3253. }
  3254. get list() {
  3255. return [...this.players.values()]
  3256. }
  3257. getById(sid) {
  3258. return this.players.get(sid)
  3259. }
  3260. each(callback) {
  3261. this.players.forEach(callback)
  3262. }
  3263. eachVisible(callback) {
  3264. this.each((player) => {
  3265. if (!player.visible) return
  3266. callback(player)
  3267. })
  3268. }
  3269. addPlayer(content, isYou) {
  3270. if (!this.players.has(content[1])) {
  3271. this.players.set(content[1], new _entities_Player_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
  3272. id: content[0],
  3273. sid: content[1]
  3274. }))
  3275. }
  3276. const player = this.players.get(content[1])
  3277. player.visible = false
  3278. player.x2 = void 0
  3279. player.y2 = void 0
  3280. player.spawn()
  3281. player.setInitData(content)
  3282. if (isYou) {
  3283. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.setPlayer(player)
  3284. }
  3285. }
  3286. removePlayer(sid) {
  3287. if (!this.players.has(sid)) return
  3288. this.players.delete(sid)
  3289. }
  3290. updatePlayers(content) {
  3291. const chunkSize = 13
  3292. this.playersInStream = 0
  3293. this.eachVisible((player) => {
  3294. player.disable()
  3295. })
  3296. for (let i = 0; i < content.length; i += chunkSize) {
  3297. const chunk = content.slice(i, i + chunkSize)
  3298. if (!this.players.has(chunk[0])) continue
  3299. const player = this.players.get(chunk[0])
  3300. player.setTickData(chunk)
  3301. this.playersInStream += 1
  3302. }
  3303. }
  3304. interpolate() {
  3305. const {
  3306. CowUtils
  3307. } = window
  3308. const {
  3309. renderer
  3310. } = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow
  3311. const lastTime = renderer.nowUpdate - (1000 / (0 || 10))
  3312. this.eachVisible((player) => {
  3313. player.dt += renderer.delta
  3314. const total = player.time2 - player.time1
  3315. const fraction = lastTime - player.time1
  3316. const ratio = total / fraction
  3317. const rate = 170
  3318. const tmpRate = Math.min(1.7, player.dt / rate)
  3319. const xDif = player.x2 - player.x1
  3320. const yDif = player.y2 - player.y1
  3321. player.setTo(
  3322. player.x1 + (xDif * tmpRate),
  3323. player.y1 + (yDif * tmpRate)
  3324. )
  3325. player.dir = CowUtils.lerpAngle(player.dir2, player.dir1, Math.min(1.2, ratio))
  3326. })
  3327. }
  3328. update() {
  3329. this.interpolate()
  3330. this.eachVisible((player) => {
  3331. const reloadType = player.weaponIndex > 8 ? "secondary" : "primary"
  3332. const currentReload = player.reloads[reloadType]
  3333. if (player.weaponIndex === currentReload.id) {
  3334. if (currentReload.count < currentReload.max && player.buildIndex === -1) {
  3335. currentReload.date2 = Date.now()
  3336. }
  3337. }
  3338. })
  3339. }
  3340. }
  3341. /* harmony default export */
  3342. __webpack_exports__["default"] = (PlayersManager);
  3343. /***/
  3344. }),
  3345. /***/
  3346. "./src/modules/plugins/AutoReconect.js":
  3347. /*!*********************************************!*\
  3348. !*** ./src/modules/plugins/AutoReconect.js ***!
  3349. \*********************************************/
  3350. /***/
  3351. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3352. __webpack_require__.r(__webpack_exports__);
  3353. /* harmony import */
  3354. var _Plugin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./Plugin.js */ "./src/modules/plugins/Plugin.js");
  3355. class AutoReconect extends _Plugin_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3356. constructor() {
  3357. super({
  3358. name: "auto-reconect",
  3359. description: "Automatically reloads the page after the connection is closed or the game could not be logged in",
  3360. once: true
  3361. })
  3362. }
  3363. execute() {
  3364. super.execute(() => {
  3365. location.reload()
  3366. })
  3367. }
  3368. }
  3369. /* harmony default export */
  3370. __webpack_exports__["default"] = (AutoReconect);
  3371. /***/
  3372. }),
  3373. /***/
  3374. "./src/modules/plugins/Plugin.js":
  3375. /*!***************************************!*\
  3376. !*** ./src/modules/plugins/Plugin.js ***!
  3377. \***************************************/
  3378. /***/
  3379. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3380. __webpack_require__.r(__webpack_exports__);
  3381. class Plugin {
  3382. constructor({
  3383. name,
  3384. description,
  3385. once,
  3386. isCanChangeActiveState = true
  3387. }) {
  3388. this.name = name
  3389. this.description = description
  3390. this.once = once
  3391. this._isCanChangeActiveState = isCanChangeActiveState
  3392. this.isActiveState = false
  3393. this.lastActive = null
  3394. }
  3395. setActiveState(state) {
  3396. if (!this._isCanChangeActiveState) return
  3397. this.isActiveState = state
  3398. }
  3399. execute(callback) {
  3400. if (this.once && this.lastActive) return
  3401. if (callback instanceof Function) {
  3402. callback()
  3403. }
  3404. this.lastActive = Date.now()
  3405. }
  3406. }
  3407. /* harmony default export */
  3408. __webpack_exports__["default"] = (Plugin);
  3409. /***/
  3410. }),
  3411. /***/
  3412. "./src/modules/plugins/index.js":
  3413. /*!**************************************!*\
  3414. !*** ./src/modules/plugins/index.js ***!
  3415. \**************************************/
  3416. /***/
  3417. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3418. __webpack_require__.r(__webpack_exports__);
  3419. /* harmony export */
  3420. __webpack_require__.d(__webpack_exports__, {
  3421. /* harmony export */
  3422. AutoReconect: function() {
  3423. return /* reexport safe */ _AutoReconect_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  3424. }
  3425. /* harmony export */
  3426. });
  3427. /* harmony import */
  3428. var _AutoReconect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./AutoReconect.js */ "./src/modules/plugins/AutoReconect.js");
  3429. /***/
  3430. }),
  3431. /***/
  3432. "./src/modules/render/Camera.js":
  3433. /*!**************************************!*\
  3434. !*** ./src/modules/render/Camera.js ***!
  3435. \**************************************/
  3436. /***/
  3437. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3438. __webpack_require__.r(__webpack_exports__);
  3439. /* harmony import */
  3440. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3441. class Camera {
  3442. constructor() {
  3443. this.x = 0
  3444. this.y = 0
  3445. this.distance = 0
  3446. this.angle = 0
  3447. this.speed = 0
  3448. this.xOffset = 0
  3449. this.yOffset = 0
  3450. }
  3451. setTo(x, y) {
  3452. this.x = x
  3453. this.y = y
  3454. }
  3455. update() {
  3456. if (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player?.alive) {
  3457. const {
  3458. CowUtils
  3459. } = window
  3460. this.distance = CowUtils.getDistance(this, _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player)
  3461. this.angle = CowUtils.getDirection(_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player, this)
  3462. this.speed = Math.min(this.distance * .01 * _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.renderer.delta, this.distance)
  3463. if (this.distance > .05) {
  3464. this.x += this.speed * Math.cos(this.angle)
  3465. this.y += this.speed * Math.sin(this.angle)
  3466. } else {
  3467. this.setTo(
  3468. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.x,
  3469. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.y
  3470. )
  3471. }
  3472. } else {
  3473. this.setTo(
  3474. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.mapScale / 2,
  3475. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.mapScale / 2
  3476. )
  3477. }
  3478. this.xOffset = this.x - _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.maxScreenWidth / 2
  3479. this.yOffset = this.y - _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.maxScreenHeight / 2
  3480. }
  3481. }
  3482. /* harmony default export */
  3483. __webpack_exports__["default"] = (Camera);
  3484. /***/
  3485. }),
  3486. /***/
  3487. "./src/modules/render/Renderer.js":
  3488. /*!****************************************!*\
  3489. !*** ./src/modules/render/Renderer.js ***!
  3490. \****************************************/
  3491. /***/
  3492. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3493. __webpack_require__.r(__webpack_exports__);
  3494. /* harmony import */
  3495. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3496. class Renderer {
  3497. constructor() {
  3498. this.canvas = void 0
  3499. this.context = void 0
  3500. this.renders = new Map()
  3501. this.nowUpdate = void 0
  3502. this.lastUpdate = this.nowUpdate
  3503. this.delta = 0
  3504. window.addEventListener("load", this.init.bind(this))
  3505. }
  3506. addRender(renderKey, renderFunc) {
  3507. if (typeof renderKey !== 'string') return
  3508. if (!(renderFunc instanceof Function)) return
  3509. if (!this.renders.has(renderKey)) {
  3510. this.renders.set(renderKey, new Map())
  3511. }
  3512. const rendersChunk = this.renders.get(renderKey)
  3513. rendersChunk.set(rendersChunk.size + 1, renderFunc)
  3514. }
  3515. _updateAll() {
  3516. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.camera.update()
  3517. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.update()
  3518. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.objectsManager.update()
  3519. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.animalsManager.update()
  3520. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.input.keyboard.update()
  3521. }
  3522. updateFrame() {
  3523. this.nowUpdate = Date.now()
  3524. this.delta = this.nowUpdate - this.lastUpdate
  3525. this.lastUpdate = this.nowUpdate
  3526. requestAnimationFrame(this.updateFrame.bind(this))
  3527. this._updateAll()
  3528. if (!_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player) return
  3529. this.renders.forEach((rendersChunk) => {
  3530. if (!rendersChunk.size) return
  3531. rendersChunk.forEach((render) => {
  3532. render()
  3533. })
  3534. })
  3535. }
  3536. init() {
  3537. this.canvas = document.getElementById("gameCanvas")
  3538. this.context = this.canvas.getContext("2d")
  3539. this.updateFrame()
  3540. }
  3541. }
  3542. /* harmony default export */
  3543. __webpack_exports__["default"] = (Renderer);
  3544. /***/
  3545. }),
  3546. /***/
  3547. "./src/modules/socket/Handler.js":
  3548. /*!***************************************!*\
  3549. !*** ./src/modules/socket/Handler.js ***!
  3550. \***************************************/
  3551. /***/
  3552. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3553. __webpack_require__.r(__webpack_exports__);
  3554. /* harmony import */
  3555. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3556. /* harmony import */
  3557. var _events_getEvents_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./events/getEvents.js */ "./src/modules/socket/events/getEvents.js");
  3558. class Handler {
  3559. static handlerKeys = {
  3560. "socket-open": "onSocketOpen",
  3561. "socket-message": "onSocketMessage",
  3562. "socket-close": "onSocketClose"
  3563. }
  3564. constructor({
  3565. socket
  3566. }) {
  3567. this.socket = socket
  3568. this.packetsListeners = new Map()
  3569. this.firstMessage = false
  3570. }
  3571. onPacket(packetName, listener) {
  3572. if (typeof packetName !== 'string') return
  3573. if (!(listener instanceof Function)) return
  3574. if (!this.packetsListeners.has(packetName)) {
  3575. this.packetsListeners.set(packetName, new Map())
  3576. }
  3577. const listeners = this.packetsListeners.get(packetName)
  3578. listeners.set(listeners.size + 1, listener)
  3579. }
  3580. onSocketOpen() {}
  3581. onSocketMessage(event) {
  3582. if (!this.firstMessage) {
  3583. const events = (0, _events_getEvents_js__WEBPACK_IMPORTED_MODULE_1__["default"])()
  3584. for (const event in events) {
  3585. this.onPacket(event, events[event])
  3586. }
  3587. this.firstMessage = true
  3588. }
  3589. const {
  3590. data
  3591. } = event
  3592. if (!(data instanceof ArrayBuffer)) return
  3593. const binary = new Uint8Array(data)
  3594. const decoded = _constants_js__WEBPACK_IMPORTED_MODULE_0__.codec.decoder.decode(binary)
  3595. if (!decoded.length) return
  3596. const type = decoded[0]
  3597. const content = decoded[1]
  3598. this.packetsListeners.forEach((packetListeners, packetName) => {
  3599. if (!packetListeners.size) return
  3600. if (packetName !== type) return
  3601. packetListeners.forEach((packetListener) => {
  3602. packetListener(...content)
  3603. })
  3604. })
  3605. }
  3606. onSocketClose() {
  3607. const {
  3608. plugins
  3609. } = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.designations
  3610. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.executePlugin(plugins.AUTO_RECONECT)
  3611. }
  3612. handle(handlerKey, event) {
  3613. const listenerName = Handler.handlerKeys[handlerKey]
  3614. if (typeof listenerName === 'undefined') return
  3615. const listener = this[listenerName]
  3616. if (!(listener instanceof Function)) return
  3617. listener.call(this, event)
  3618. }
  3619. }
  3620. /* harmony default export */
  3621. __webpack_exports__["default"] = (Handler);
  3622. /***/
  3623. }),
  3624. /***/
  3625. "./src/modules/socket/Manager.js":
  3626. /*!***************************************!*\
  3627. !*** ./src/modules/socket/Manager.js ***!
  3628. \***************************************/
  3629. /***/
  3630. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3631. __webpack_require__.r(__webpack_exports__);
  3632. class Manager {
  3633. static triggerKeys = {
  3634. "set-websocket": "onWebSocketSetted"
  3635. }
  3636. constructor({
  3637. socket
  3638. }) {
  3639. this.socket = socket
  3640. }
  3641. onWebSocketSetted() {
  3642. const {
  3643. handler
  3644. } = this.socket
  3645. this.socket.onEvent("open", handler.handle.bind(handler, "socket-open"))
  3646. this.socket.onEvent("message", handler.handle.bind(handler, "socket-message"))
  3647. this.socket.onEvent("close", handler.handle.bind(handler, "socket-close"))
  3648. }
  3649. trigger(triggerKey, ...props) {
  3650. const listenerName = Manager.triggerKeys[triggerKey]
  3651. if (typeof listenerName === 'undefined') return
  3652. const listener = this[listenerName]
  3653. if (!(listener instanceof Function)) return
  3654. listener.call(this, ...props)
  3655. }
  3656. }
  3657. /* harmony default export */
  3658. __webpack_exports__["default"] = (Manager);
  3659. /***/
  3660. }),
  3661. /***/
  3662. "./src/modules/socket/Socket.js":
  3663. /*!**************************************!*\
  3664. !*** ./src/modules/socket/Socket.js ***!
  3665. \**************************************/
  3666. /***/
  3667. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3668. __webpack_require__.r(__webpack_exports__);
  3669. /* harmony import */
  3670. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../constants.js */ "./src/constants.js");
  3671. /* harmony import */
  3672. var _Handler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./Handler.js */ "./src/modules/socket/Handler.js");
  3673. /* harmony import */
  3674. var _Manager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./Manager.js */ "./src/modules/socket/Manager.js");
  3675. class Socket {
  3676. constructor() {
  3677. this.websocket = void 0
  3678. this.socketId = void 0
  3679. this.handler = new _Handler_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
  3680. socket: this
  3681. })
  3682. this.manager = new _Manager_js__WEBPACK_IMPORTED_MODULE_2__["default"]({
  3683. socket: this
  3684. })
  3685. }
  3686. get isCreated() {
  3687. return Boolean(typeof this.websocket !== 'undefined')
  3688. }
  3689. get isReady() {
  3690. return Boolean(this.websocket?.readyState === 1)
  3691. }
  3692. send(type, content) {
  3693. if (!this.isReady) return
  3694. const encoded = _constants_js__WEBPACK_IMPORTED_MODULE_0__.codec.encoder.encode([type, content])
  3695. this.websocket.send(encoded)
  3696. }
  3697. onEvent(eventKey, listener) {
  3698. if (!this.isCreated) return
  3699. if (eventKey.startsWith("on")) {
  3700. this.websocket[eventKey] = listener
  3701. return
  3702. }
  3703. this.websocket.addEventListener(eventKey, listener)
  3704. }
  3705. setSocketId(_socketId) {
  3706. if (typeof _socketId !== 'number') return
  3707. this.socketId = _socketId
  3708. }
  3709. setWebSocket(_websocket) {
  3710. if (!_constants_js__WEBPACK_IMPORTED_MODULE_0__.codec.isReady) return
  3711. if (this.websocket instanceof WebSocket) return
  3712. if (!(_websocket instanceof WebSocket)) return
  3713. if (!/moomoo/.test(_websocket.url)) return
  3714. this.websocket = _websocket
  3715. this.manager.trigger("set-websocket")
  3716. }
  3717. }
  3718. /* harmony default export */
  3719. __webpack_exports__["default"] = (Socket);
  3720. /***/
  3721. }),
  3722. /***/
  3723. "./src/modules/socket/events/animals/loadAI.js":
  3724. /*!*****************************************************!*\
  3725. !*** ./src/modules/socket/events/animals/loadAI.js ***!
  3726. \*****************************************************/
  3727. /***/
  3728. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3729. __webpack_require__.r(__webpack_exports__);
  3730. /* harmony import */
  3731. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3732.  
  3733. function loadAI(content) {
  3734. if (!content?.length) return
  3735. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.animalsManager.updateAnimals(content)
  3736. }
  3737. /* harmony default export */
  3738. __webpack_exports__["default"] = (loadAI);
  3739. /***/
  3740. }),
  3741. /***/
  3742. "./src/modules/socket/events/game_object/addProjectile.js":
  3743. /*!****************************************************************!*\
  3744. !*** ./src/modules/socket/events/game_object/addProjectile.js ***!
  3745. \****************************************************************/
  3746. /***/
  3747. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3748. __webpack_require__.r(__webpack_exports__);
  3749. /* harmony import */
  3750. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3751.  
  3752. function addProjectile(x, y, dir, range, speed, indx, layer, sid) {
  3753. const isTurret = Number(range == 700 && speed == 1.5)
  3754. const position = {
  3755. x,
  3756. y
  3757. }
  3758. const {
  3759. CowUtils
  3760. } = window
  3761. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.eachVisible((player) => {
  3762. const distance = Math.round(CowUtils.getDistance(player, position)) - player.scale
  3763. const isSameDir = player.dir2 - dir < .6
  3764. const isProjectileInDistance = distance <= 135
  3765. const isOwnTurret = isTurret && player.reloads.turret.done && player.skinIndex === 53 && distance <= 10
  3766. const isOwnSecondary = !isTurret && player.reloads.secondary.done && player.weapon.projectile !== undefined && isSameDir && isProjectileInDistance
  3767. const reloadType = isTurret ? "turret" : "secondary"
  3768. if (!isOwnTurret && !isOwnSecondary) return
  3769. player.reloads[reloadType].clear()
  3770. })
  3771. }
  3772. /* harmony default export */
  3773. __webpack_exports__["default"] = (addProjectile);
  3774. /***/
  3775. }),
  3776. /***/
  3777. "./src/modules/socket/events/game_object/killObject.js":
  3778. /*!*************************************************************!*\
  3779. !*** ./src/modules/socket/events/game_object/killObject.js ***!
  3780. \*************************************************************/
  3781. /***/
  3782. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3783. __webpack_require__.r(__webpack_exports__);
  3784. /* harmony import */
  3785. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3786.  
  3787. function killObject(sid) {
  3788. const gameObject = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.objectsManager.getById(sid)
  3789. if (!gameObject) return
  3790. gameObject.setActive(false)
  3791. }
  3792. /* harmony default export */
  3793. __webpack_exports__["default"] = (killObject);
  3794. /***/
  3795. }),
  3796. /***/
  3797. "./src/modules/socket/events/game_object/killObjects.js":
  3798. /*!**************************************************************!*\
  3799. !*** ./src/modules/socket/events/game_object/killObjects.js ***!
  3800. \**************************************************************/
  3801. /***/
  3802. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3803. __webpack_require__.r(__webpack_exports__);
  3804. /* harmony import */
  3805. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3806.  
  3807. function killObjects(sid) {
  3808. if (!sid) return
  3809. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.objectsManager.disableAllObjects(sid)
  3810. }
  3811. /* harmony default export */
  3812. __webpack_exports__["default"] = (killObjects);
  3813. /***/
  3814. }),
  3815. /***/
  3816. "./src/modules/socket/events/game_object/loadGameObject.js":
  3817. /*!*****************************************************************!*\
  3818. !*** ./src/modules/socket/events/game_object/loadGameObject.js ***!
  3819. \*****************************************************************/
  3820. /***/
  3821. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3822. __webpack_require__.r(__webpack_exports__);
  3823. /* harmony import */
  3824. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3825.  
  3826. function loadGameObject(content) {
  3827. const chunkSize = 8
  3828. for (let i = 0; i < content.length; i += chunkSize) {
  3829. const chunk = content.slice(i, i + chunkSize)
  3830. chunk[6] = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.items.list[chunk[6]]
  3831. if (chunk[7] >= 0) {
  3832. chunk[7] = {
  3833. sid: chunk[7]
  3834. }
  3835. }
  3836. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.objectsManager.add(...chunk)
  3837. }
  3838. }
  3839. /* harmony default export */
  3840. __webpack_exports__["default"] = (loadGameObject);
  3841. /***/
  3842. }),
  3843. /***/
  3844. "./src/modules/socket/events/game_object/wiggleGameObject.js":
  3845. /*!*******************************************************************!*\
  3846. !*** ./src/modules/socket/events/game_object/wiggleGameObject.js ***!
  3847. \*******************************************************************/
  3848. /***/
  3849. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3850. __webpack_require__.r(__webpack_exports__);
  3851. /* harmony import */
  3852. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3853.  
  3854. function wiggleGameObject(dir, sid) {
  3855. const gameObject = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.objectsManager.getById(sid)
  3856. if (!gameObject) return
  3857. gameObject.doWiggle(dir)
  3858. }
  3859. /* harmony default export */
  3860. __webpack_exports__["default"] = (wiggleGameObject);
  3861. /***/
  3862. }),
  3863. /***/
  3864. "./src/modules/socket/events/getEvents.js":
  3865. /*!************************************************!*\
  3866. !*** ./src/modules/socket/events/getEvents.js ***!
  3867. \************************************************/
  3868. /***/
  3869. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3870. __webpack_require__.r(__webpack_exports__);
  3871. /* harmony import */
  3872. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../constants.js */ "./src/constants.js");
  3873. /* harmony import */
  3874. var _animals_loadAI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./animals/loadAI.js */ "./src/modules/socket/events/animals/loadAI.js");
  3875. /* harmony import */
  3876. var _game_object_addProjectile_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./game_object/addProjectile.js */ "./src/modules/socket/events/game_object/addProjectile.js");
  3877. /* harmony import */
  3878. var _game_object_killObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./game_object/killObject.js */ "./src/modules/socket/events/game_object/killObject.js");
  3879. /* harmony import */
  3880. var _game_object_killObjects_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ./game_object/killObjects.js */ "./src/modules/socket/events/game_object/killObjects.js");
  3881. /* harmony import */
  3882. var _game_object_loadGameObject_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( /*! ./game_object/loadGameObject.js */ "./src/modules/socket/events/game_object/loadGameObject.js");
  3883. /* harmony import */
  3884. var _game_object_wiggleGameObject_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! ./game_object/wiggleGameObject.js */ "./src/modules/socket/events/game_object/wiggleGameObject.js");
  3885. /* harmony import */
  3886. var _player_addPlayer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! ./player/addPlayer.js */ "./src/modules/socket/events/player/addPlayer.js");
  3887. /* harmony import */
  3888. var _player_gatherAnimation_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__( /*! ./player/gatherAnimation.js */ "./src/modules/socket/events/player/gatherAnimation.js");
  3889. /* harmony import */
  3890. var _player_killPlayer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__( /*! ./player/killPlayer.js */ "./src/modules/socket/events/player/killPlayer.js");
  3891. /* harmony import */
  3892. var _player_removePlayer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__( /*! ./player/removePlayer.js */ "./src/modules/socket/events/player/removePlayer.js");
  3893. /* harmony import */
  3894. var _player_updateHealth_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__( /*! ./player/updateHealth.js */ "./src/modules/socket/events/player/updateHealth.js");
  3895. /* harmony import */
  3896. var _player_updatePlayers_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__( /*! ./player/updatePlayers.js */ "./src/modules/socket/events/player/updatePlayers.js");
  3897. /* harmony import */
  3898. var _stats_updateItemCounts_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__( /*! ./stats/updateItemCounts.js */ "./src/modules/socket/events/stats/updateItemCounts.js");
  3899. /* harmony import */
  3900. var _stats_updateItems_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__( /*! ./stats/updateItems.js */ "./src/modules/socket/events/stats/updateItems.js");
  3901. /* harmony import */
  3902. var _stats_updatePlayerValue_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__( /*! ./stats/updatePlayerValue.js */ "./src/modules/socket/events/stats/updatePlayerValue.js");
  3903. /* harmony import */
  3904. var _system_setupGame_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__( /*! ./system/setupGame.js */ "./src/modules/socket/events/system/setupGame.js");
  3905.  
  3906. function getEvents() {
  3907. const events = {}
  3908. const {
  3909. packets
  3910. } = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.designations
  3911. events[packets.SETUP_GAME] = _system_setupGame_js__WEBPACK_IMPORTED_MODULE_16__["default"]
  3912. events[packets.ADD_PLAYER] = _player_addPlayer_js__WEBPACK_IMPORTED_MODULE_7__["default"]
  3913. events[packets.KILL_PLAYER] = _player_killPlayer_js__WEBPACK_IMPORTED_MODULE_9__["default"]
  3914. events[packets.REMOVE_PLAYER] = _player_removePlayer_js__WEBPACK_IMPORTED_MODULE_10__["default"]
  3915. events[packets.UPDATE_PLAYERS] = _player_updatePlayers_js__WEBPACK_IMPORTED_MODULE_12__["default"]
  3916. events[packets.UPDATE_ITEM_COUNTS] = _stats_updateItemCounts_js__WEBPACK_IMPORTED_MODULE_13__["default"]
  3917. events[packets.UPDATE_PLAYER_VALUE] = _stats_updatePlayerValue_js__WEBPACK_IMPORTED_MODULE_15__["default"]
  3918. events[packets.UPDATE_HEALTH] = _player_updateHealth_js__WEBPACK_IMPORTED_MODULE_11__["default"]
  3919. events[packets.UPDATE_ITEMS] = _stats_updateItems_js__WEBPACK_IMPORTED_MODULE_14__["default"]
  3920. events[packets.GATHER_ANIMATION] = _player_gatherAnimation_js__WEBPACK_IMPORTED_MODULE_8__["default"]
  3921. events[packets.ADD_PROJECTILE] = _game_object_addProjectile_js__WEBPACK_IMPORTED_MODULE_2__["default"]
  3922. events[packets.LOAD_GAME_OBJECT] = _game_object_loadGameObject_js__WEBPACK_IMPORTED_MODULE_5__["default"]
  3923. events[packets.KILL_OBJECT] = _game_object_killObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]
  3924. events[packets.KILL_OBJECTS] = _game_object_killObjects_js__WEBPACK_IMPORTED_MODULE_4__["default"]
  3925. events[packets.WIGGLE_GAME_OBJECT] = _game_object_wiggleGameObject_js__WEBPACK_IMPORTED_MODULE_6__["default"]
  3926. events[packets.LOAD_AI] = _animals_loadAI_js__WEBPACK_IMPORTED_MODULE_1__["default"]
  3927. return events
  3928. }
  3929. /* harmony default export */
  3930. __webpack_exports__["default"] = (getEvents);
  3931. /***/
  3932. }),
  3933. /***/
  3934. "./src/modules/socket/events/player/addPlayer.js":
  3935. /*!*******************************************************!*\
  3936. !*** ./src/modules/socket/events/player/addPlayer.js ***!
  3937. \*******************************************************/
  3938. /***/
  3939. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3940. __webpack_require__.r(__webpack_exports__);
  3941. /* harmony import */
  3942. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3943.  
  3944. function addPlayer(content, isYou) {
  3945. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.addPlayer(content, isYou)
  3946. }
  3947. /* harmony default export */
  3948. __webpack_exports__["default"] = (addPlayer);
  3949. /***/
  3950. }),
  3951. /***/
  3952. "./src/modules/socket/events/player/gatherAnimation.js":
  3953. /*!*************************************************************!*\
  3954. !*** ./src/modules/socket/events/player/gatherAnimation.js ***!
  3955. \*************************************************************/
  3956. /***/
  3957. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3958. __webpack_require__.r(__webpack_exports__);
  3959. /* harmony import */
  3960. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3961.  
  3962. function gatherAnimation(sid, didHit, index) {
  3963. const player = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.getById(sid)
  3964. if (!player) return
  3965. player.onGather(didHit, index)
  3966. }
  3967. /* harmony default export */
  3968. __webpack_exports__["default"] = (gatherAnimation);
  3969. /***/
  3970. }),
  3971. /***/
  3972. "./src/modules/socket/events/player/killPlayer.js":
  3973. /*!********************************************************!*\
  3974. !*** ./src/modules/socket/events/player/killPlayer.js ***!
  3975. \********************************************************/
  3976. /***/
  3977. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3978. __webpack_require__.r(__webpack_exports__);
  3979. /* harmony import */
  3980. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3981.  
  3982. function killPlayer() {
  3983. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.kill()
  3984. }
  3985. /* harmony default export */
  3986. __webpack_exports__["default"] = (killPlayer);
  3987. /***/
  3988. }),
  3989. /***/
  3990. "./src/modules/socket/events/player/removePlayer.js":
  3991. /*!**********************************************************!*\
  3992. !*** ./src/modules/socket/events/player/removePlayer.js ***!
  3993. \**********************************************************/
  3994. /***/
  3995. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  3996. __webpack_require__.r(__webpack_exports__);
  3997. /* harmony import */
  3998. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  3999.  
  4000. function removePlayer(id) {
  4001. if (_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.players.size <= 1) return
  4002. const player = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.list.find((player) => player.id === id)
  4003. if (!player) return
  4004. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.removePlayer(player.sid)
  4005. }
  4006. /* harmony default export */
  4007. __webpack_exports__["default"] = (removePlayer);
  4008. /***/
  4009. }),
  4010. /***/
  4011. "./src/modules/socket/events/player/updateHealth.js":
  4012. /*!**********************************************************!*\
  4013. !*** ./src/modules/socket/events/player/updateHealth.js ***!
  4014. \**********************************************************/
  4015. /***/
  4016. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  4017. __webpack_require__.r(__webpack_exports__);
  4018. /* harmony import */
  4019. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  4020.  
  4021. function updateHealth(sid, value) {
  4022. const player = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.getById(sid)
  4023. if (!player) return
  4024. player.changeHealth(value)
  4025. }
  4026. /* harmony default export */
  4027. __webpack_exports__["default"] = (updateHealth);
  4028. /***/
  4029. }),
  4030. /***/
  4031. "./src/modules/socket/events/player/updatePlayers.js":
  4032. /*!***********************************************************!*\
  4033. !*** ./src/modules/socket/events/player/updatePlayers.js ***!
  4034. \***********************************************************/
  4035. /***/
  4036. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  4037. __webpack_require__.r(__webpack_exports__);
  4038. /* harmony import */
  4039. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  4040.  
  4041. function updatePlayers(content) {
  4042. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.playersManager.updatePlayers(content)
  4043. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.ticker.updateTicks()
  4044. }
  4045. /* harmony default export */
  4046. __webpack_exports__["default"] = (updatePlayers);
  4047. /***/
  4048. }),
  4049. /***/
  4050. "./src/modules/socket/events/stats/updateItemCounts.js":
  4051. /*!*************************************************************!*\
  4052. !*** ./src/modules/socket/events/stats/updateItemCounts.js ***!
  4053. \*************************************************************/
  4054. /***/
  4055. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  4056. __webpack_require__.r(__webpack_exports__);
  4057. /* harmony import */
  4058. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  4059.  
  4060. function updateItemCounts(index, value) {
  4061. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player.itemCounts[index] = value
  4062. }
  4063. /* harmony default export */
  4064. __webpack_exports__["default"] = (updateItemCounts);
  4065. /***/
  4066. }),
  4067. /***/
  4068. "./src/modules/socket/events/stats/updateItems.js":
  4069. /*!********************************************************!*\
  4070. !*** ./src/modules/socket/events/stats/updateItems.js ***!
  4071. \********************************************************/
  4072. /***/
  4073. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  4074. __webpack_require__.r(__webpack_exports__);
  4075. /* harmony import */
  4076. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  4077.  
  4078. function updateItems(data, isWeapon) {
  4079. if (!data?.length) return
  4080. const type = isWeapon ? "weapons" : "items"
  4081. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player[type] = data
  4082. }
  4083. /* harmony default export */
  4084. __webpack_exports__["default"] = (updateItems);
  4085. /***/
  4086. }),
  4087. /***/
  4088. "./src/modules/socket/events/stats/updatePlayerValue.js":
  4089. /*!**************************************************************!*\
  4090. !*** ./src/modules/socket/events/stats/updatePlayerValue.js ***!
  4091. \**************************************************************/
  4092. /***/
  4093. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  4094. __webpack_require__.r(__webpack_exports__);
  4095. /* harmony import */
  4096. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  4097.  
  4098. function updatePlayerValue(index, value, updateView) {
  4099. if (!_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player) return
  4100. _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.player[index] = value
  4101. }
  4102. /* harmony default export */
  4103. __webpack_exports__["default"] = (updatePlayerValue);
  4104. /***/
  4105. }),
  4106. /***/
  4107. "./src/modules/socket/events/system/setupGame.js":
  4108. /*!*******************************************************!*\
  4109. !*** ./src/modules/socket/events/system/setupGame.js ***!
  4110. \*******************************************************/
  4111. /***/
  4112. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  4113. __webpack_require__.r(__webpack_exports__);
  4114. /* harmony import */
  4115. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ../../../../constants.js */ "./src/constants.js");
  4116.  
  4117. function setupGame(socketId) {
  4118. _constants_js__WEBPACK_IMPORTED_MODULE_0__.socket.setSocketId(socketId)
  4119. }
  4120. /* harmony default export */
  4121. __webpack_exports__["default"] = (setupGame);
  4122. /***/
  4123. }),
  4124. /***/
  4125. "./src/utils/CowUtils.js":
  4126. /*!*******************************!*\
  4127. !*** ./src/utils/CowUtils.js ***!
  4128. \*******************************/
  4129. /***/
  4130. (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  4131. __webpack_require__.r(__webpack_exports__);
  4132. class CowUtils {
  4133. static removeProto(object) {
  4134. if (!(object instanceof Object)) return
  4135. return JSON.parse(JSON.stringify(object))
  4136. }
  4137. static randInt(min, max) {
  4138. return Math.floor(CowUtils.randFloat(min, max))
  4139. }
  4140. static randFloat(min, max) {
  4141. if (typeof max === 'undefined') {
  4142. max = min
  4143. min = 0
  4144. }
  4145. return (Math.random() * (max - min + 1)) + min
  4146. }
  4147. static lerp(value1, value2, amount) {
  4148. return value1 + (value2 - value1) * amount
  4149. }
  4150. static kFormat(value) {
  4151. value = parseFloat(value)
  4152. return value > 999 ? `${(value / 1000).toFixed(1)}k` : value
  4153. }
  4154. static fixAngle(angle) {
  4155. return Math.atan2(Math.cos(angle), Math.sin(angle))
  4156. }
  4157. static getDistance(x1, y1, x2, y2) {
  4158. if (x1 instanceof Object && y1 instanceof Object) {
  4159. return Math.hypot(x1.y - y1.y, x1.x - y1.x)
  4160. }
  4161. return Math.hypot(y1 - y2, x1 - x2)
  4162. }
  4163. static getDirection(x1, y1, x2, y2) {
  4164. if (x1 instanceof Object && y1 instanceof Object) {
  4165. return Math.atan2(x1.y - y1.y, x1.x - y1.x)
  4166. }
  4167. return Math.atan2(y1 - y2, x1 - x2)
  4168. }
  4169. static getAngleDist(angleBetween, targetLookDir) {
  4170. const difference = Math.abs(targetLookDir - angleBetween) % (Math.PI * 2)
  4171. return (difference > Math.PI ? (Math.PI * 2) - difference : difference)
  4172. }
  4173. static lerpAngle(value1, value2, amount) {
  4174. const difference = Math.abs(value2 - value1)
  4175. if (difference > Math.PI) {
  4176. if (value1 > value2) {
  4177. value2 += Math.PI * 2
  4178. } else {
  4179. value1 += Math.PI * 2
  4180. }
  4181. }
  4182. const value = value2 + ((value1 - value2) * amount)
  4183. if (value >= 0 && value <= (Math.PI * 2)) return value
  4184. return (value % (Math.PI * 2))
  4185. }
  4186. static createHook({
  4187. property,
  4188. proto = Object.prototype,
  4189. setter,
  4190. getter
  4191. }) {
  4192. const symbol = Symbol(property)
  4193. Object.defineProperty(proto, property, {
  4194. get() {
  4195. typeof getter === 'function' && getter(this, this[symbol])
  4196. return this[symbol]
  4197. },
  4198. set(value) {
  4199. typeof setter === 'function' && setter(this, value)
  4200. this[symbol] = value
  4201. }
  4202. })
  4203. return symbol
  4204. }
  4205. }
  4206. /* harmony default export */
  4207. __webpack_exports__["default"] = (CowUtils);
  4208. /***/
  4209. }),
  4210. /***/
  4211. "./src/config.json":
  4212. /*!*************************!*\
  4213. !*** ./src/config.json ***!
  4214. \*************************/
  4215. /***/
  4216. (function(module) {
  4217. module.exports = JSON.parse('{"NAME":"Cow.JS","VERSION":"1.0.0","maxScreenWidth":1920,"maxScreenHeight":1080,"mapScale":14400,"riverWidth":724,"gatherAngle":1.208304866765305,"hitAngle":1.5707963267948966,"shieldAngle":1.0471975511965976,"gatherWiggle":10,"designations":{"plugins":{"AUTO_RECONECT":"auto-reconect","CHECK_PLACEMENT":"check-placement"},"packets":{"INIT_DATA":"A","DISCONNECT":"B","SETUP_GAME":"C","ADD_PLAYER":"D","REMOVE_PLAYER":"E","UPDATE_PLAYERS":"a","UPDATE_LEADERBOARD":"G","LOAD_GAME_OBJECT":"H","LOAD_AI":"I","ANIMATE_AI":"J","GATHER_ANIMATION":"K","WIGGLE_GAME_OBJECT":"L","SHOOT_TURRET":"M","UPDATE_PLAYER_VALUE":"N","UPDATE_HEALTH":"O","KILL_PLAYER":"P","KILL_OBJECT":"Q","KILL_OBJECTS":"R","UPDATE_ITEM_COUNTS":"S","UPDATE_AGE":"T","UPDATE_UPGRADES":"U","UPDATE_ITEMS":"V","ADD_PROJECTILE":"X","REMOVE_PROJECTILE":"Y","SERVER_SHUTDOWN_NOTICE":"Z","ADD_ALLIANCE":"g","DELETE_ALLIANCE":"1","ALLIANCE_NOTIFICATION":"2","SET_PLAYER_TEAM":"3","SET_ALLIANCE_PLAYERS":"4","UPDATE_STORE_ITEMS":"5","RECEIVE_CHAT":"6","UPDATE_MINIMAP":"7","SHOW_TEXT":"8","PING_MAP":"9","PING_SOCKET_RESPONSE":"0","ALLIANCE_JOIN_REQUEST":"P","KICK_FROM_CLAN":"Q","SEND_ALLIANCE_JOIN":"b","CREATE_ALLIANCE":"L","LEAVE_ALLIANCE":"N","STORE_EQUIP":"c","CHAT_MESSAGE":"6","RMD":"E","ATTACK_STATE":"d","MOVE_DIR":"a","MAP_PING":"S","AUTO_ATTACK":"K","SELECT_BUILD":"G","SPAWN":"M","SELECT_UPGRADE":"H","LOOK_DIR":"D","PING_SOCKET":"0"},"items":{"FOOD":0,"WALL":1,"SPIKE":2,"MILL":3,"TRAP":4,"TURRET":5}}}');
  4218. /***/
  4219. })
  4220. /******/
  4221. });
  4222. /************************************************************************/
  4223. /******/ // The module cache
  4224. /******/
  4225. var __webpack_module_cache__ = {};
  4226. /******/
  4227. /******/ // The require function
  4228. /******/
  4229. function __webpack_require__(moduleId) {
  4230. /******/ // Check if module is in cache
  4231. /******/
  4232. var cachedModule = __webpack_module_cache__[moduleId];
  4233. /******/
  4234. if (cachedModule !== undefined) {
  4235. /******/
  4236. return cachedModule.exports;
  4237. /******/
  4238. }
  4239. /******/ // Create a new module (and put it into the cache)
  4240. /******/
  4241. var module = __webpack_module_cache__[moduleId] = {
  4242. /******/ // no module.id needed
  4243. /******/ // no module.loaded needed
  4244. /******/
  4245. exports: {}
  4246. /******/
  4247. };
  4248. /******/
  4249. /******/ // Execute the module function
  4250. /******/
  4251. __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  4252. /******/
  4253. /******/ // Return the exports of the module
  4254. /******/
  4255. return module.exports;
  4256. /******/
  4257. }
  4258. /******/
  4259. /************************************************************************/
  4260. /******/
  4261. /* webpack/runtime/define property getters */
  4262. /******/
  4263. ! function() {
  4264. /******/ // define getter functions for harmony exports
  4265. /******/
  4266. __webpack_require__.d = function(exports, definition) {
  4267. /******/
  4268. for (var key in definition) {
  4269. /******/
  4270. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  4271. /******/
  4272. Object.defineProperty(exports, key, {
  4273. enumerable: true,
  4274. get: definition[key]
  4275. });
  4276. /******/
  4277. }
  4278. /******/
  4279. }
  4280. /******/
  4281. };
  4282. /******/
  4283. }();
  4284. /******/
  4285. /******/
  4286. /* webpack/runtime/hasOwnProperty shorthand */
  4287. /******/
  4288. ! function() {
  4289. /******/
  4290. __webpack_require__.o = function(obj, prop) {
  4291. return Object.prototype.hasOwnProperty.call(obj, prop);
  4292. }
  4293. /******/
  4294. }();
  4295. /******/
  4296. /******/
  4297. /* webpack/runtime/make namespace object */
  4298. /******/
  4299. ! function() {
  4300. /******/ // define __esModule on exports
  4301. /******/
  4302. __webpack_require__.r = function(exports) {
  4303. /******/
  4304. if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  4305. /******/
  4306. Object.defineProperty(exports, Symbol.toStringTag, {
  4307. value: 'Module'
  4308. });
  4309. /******/
  4310. }
  4311. /******/
  4312. Object.defineProperty(exports, '__esModule', {
  4313. value: true
  4314. });
  4315. /******/
  4316. };
  4317. /******/
  4318. }();
  4319. /******/
  4320. /************************************************************************/
  4321. var __webpack_exports__ = {};
  4322. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  4323. ! function() {
  4324. /*!**********************!*\
  4325. !*** ./src/index.js ***!
  4326. \**********************/
  4327. __webpack_require__.r(__webpack_exports__);
  4328. /* harmony import */
  4329. var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! ./constants.js */ "./src/constants.js");
  4330. /* harmony import */
  4331. var _utils_CowUtils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( /*! ./utils/CowUtils.js */ "./src/utils/CowUtils.js");
  4332. /* harmony import */
  4333. var _hooks_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./hooks.js */ "./src/hooks.js");
  4334. const watermark = setInterval(() => {
  4335. const linksContainer = document.getElementById("linksContainer2")
  4336. if (!linksContainer) return
  4337. const html = linksContainer.innerHTML
  4338. linksContainer.innerHTML = html.replace(/(v\d\.\d\.\d)/gi, `$1 </a> | <a href="#" target="_blank" class="menuLink" style="color: #9f1a1a">${_constants_js__WEBPACK_IMPORTED_MODULE_0__.cow.config.NAME}</a>`)
  4339. clearInterval(watermark)
  4340. })
  4341. setTimeout(() => clearInterval(watermark), 30e3)
  4342. window.CowUtils = _utils_CowUtils_js__WEBPACK_IMPORTED_MODULE_1__["default"]
  4343. window.Cow = _constants_js__WEBPACK_IMPORTED_MODULE_0__.cow
  4344. }();
  4345. /******/
  4346. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址