Guest User

App.js

a guest
Mar 1st, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // modules are defined as an array
  2. // [ module function, map of requires ]
  3. //
  4. // map of requires is short require name -> numeric require
  5. //
  6. // anything defined in a previous bundle is accessed via the
  7. // orig method which is the require for previous bundles
  8.  
  9. // eslint-disable-next-line no-global-assign
  10. parcelRequire = (function (modules, cache, entry, globalName) {
  11.   // Save the require from previous bundle to this closure if any
  12.   var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
  13.   var nodeRequire = typeof require === 'function' && require;
  14.  
  15.   function newRequire(name, jumped) {
  16.     if (!cache[name]) {
  17.       if (!modules[name]) {
  18.         // if we cannot find the module within our internal map or
  19.         // cache jump to the current global require ie. the last bundle
  20.         // that was added to the page.
  21.         var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
  22.         if (!jumped && currentRequire) {
  23.           return currentRequire(name, true);
  24.         }
  25.  
  26.         // If there are other bundles on this page the require from the
  27.         // previous one is saved to 'previousRequire'. Repeat this as
  28.         // many times as there are bundles until the module is found or
  29.         // we exhaust the require chain.
  30.         if (previousRequire) {
  31.           return previousRequire(name, true);
  32.         }
  33.  
  34.         // Try the node require function if it exists.
  35.         if (nodeRequire && typeof name === 'string') {
  36.           return nodeRequire(name);
  37.         }
  38.  
  39.         var err = new Error('Cannot find module \'' + name + '\'');
  40.         err.code = 'MODULE_NOT_FOUND';
  41.         throw err;
  42.       }
  43.  
  44.       localRequire.resolve = resolve;
  45.       localRequire.cache = {};
  46.  
  47.       var module = cache[name] = new newRequire.Module(name);
  48.  
  49.       modules[name][0].call(module.exports, localRequire, module, module.exports, this);
  50.     }
  51.  
  52.     return cache[name].exports;
  53.  
  54.     function localRequire(x){
  55.       return newRequire(localRequire.resolve(x));
  56.     }
  57.  
  58.     function resolve(x){
  59.       return modules[name][1][x] || x;
  60.     }
  61.   }
  62.  
  63.   function Module(moduleName) {
  64.     this.id = moduleName;
  65.     this.bundle = newRequire;
  66.     this.exports = {};
  67.   }
  68.  
  69.   newRequire.isParcelRequire = true;
  70.   newRequire.Module = Module;
  71.   newRequire.modules = modules;
  72.   newRequire.cache = cache;
  73.   newRequire.parent = previousRequire;
  74.   newRequire.register = function (id, exports) {
  75.     modules[id] = [function (require, module) {
  76.       module.exports = exports;
  77.     }, {}];
  78.   };
  79.  
  80.   for (var i = 0; i < entry.length; i++) {
  81.     newRequire(entry[i]);
  82.   }
  83.  
  84.   if (entry.length) {
  85.     // Expose entry point to Node, AMD or browser globals
  86.     // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
  87.     var mainExports = newRequire(entry[entry.length - 1]);
  88.  
  89.     // CommonJS
  90.     if (typeof exports === "object" && typeof module !== "undefined") {
  91.       module.exports = mainExports;
  92.  
  93.     // RequireJS
  94.     } else if (typeof define === "function" && define.amd) {
  95.      define(function () {
  96.        return mainExports;
  97.      });
  98.  
  99.     // <script>
  100.     } else if (globalName) {
  101.       this[globalName] = mainExports;
  102.     }
  103.   }
  104.  
  105.   // Override the current require with this new one
  106.   return newRequire;
  107. })({"../../../../../../../../../usr/local/lib/node_modules/parcel-bundler/src/builtins/bundle-url.js":[function(require,module,exports) {
  108. var bundleURL = null;
  109.  
  110. function getBundleURLCached() {
  111.   if (!bundleURL) {
  112.     bundleURL = getBundleURL();
  113.   }
  114.  
  115.   return bundleURL;
  116. }
  117.  
  118. function getBundleURL() {
  119.   // Attempt to find the URL of the current script and use that as the base URL
  120.   try {
  121.     throw new Error();
  122.   } catch (err) {
  123.     var matches = ('' + err.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g);
  124.  
  125.     if (matches) {
  126.       return getBaseURL(matches[0]);
  127.     }
  128.   }
  129.  
  130.   return '/';
  131. }
  132.  
  133. function getBaseURL(url) {
  134.   return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/';
  135. }
  136.  
  137. exports.getBundleURL = getBundleURLCached;
  138. exports.getBaseURL = getBaseURL;
  139. },{}],"../../../../../../../../../usr/local/lib/node_modules/parcel-bundler/src/builtins/css-loader.js":[function(require,module,exports) {
  140. var bundle = require('./bundle-url');
  141.  
  142. function updateLink(link) {
  143.   var newLink = link.cloneNode();
  144.  
  145.   newLink.onload = function () {
  146.     link.remove();
  147.   };
  148.  
  149.   newLink.href = link.href.split('?')[0] + '?' + Date.now();
  150.   link.parentNode.insertBefore(newLink, link.nextSibling);
  151. }
  152.  
  153. var cssTimeout = null;
  154.  
  155. function reloadCSS() {
  156.   if (cssTimeout) {
  157.     return;
  158.   }
  159.  
  160.   cssTimeout = setTimeout(function () {
  161.     var links = document.querySelectorAll('link[rel="stylesheet"]');
  162.  
  163.     for (var i = 0; i < links.length; i++) {
  164.       if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {
  165.         updateLink(links[i]);
  166.       }
  167.     }
  168.  
  169.     cssTimeout = null;
  170.   }, 50);
  171. }
  172.  
  173. module.exports = reloadCSS;
  174. },{"./bundle-url":"../../../../../../../../../usr/local/lib/node_modules/parcel-bundler/src/builtins/bundle-url.js"}],"App.css":[function(require,module,exports) {
  175. var reloadCSS = require('_css_loader');
  176.  
  177. module.hot.dispose(reloadCSS);
  178. module.hot.accept(reloadCSS);
  179. },{"_css_loader":"../../../../../../../../../usr/local/lib/node_modules/parcel-bundler/src/builtins/css-loader.js"}],"../../../../../../../../../usr/local/lib/node_modules/parcel-bundler/src/builtins/hmr-runtime.js":[function(require,module,exports) {
  180. var global = arguments[3];
  181. var OVERLAY_ID = '__parcel__error__overlay__';
  182. var OldModule = module.bundle.Module;
  183.  
  184. function Module(moduleName) {
  185.   OldModule.call(this, moduleName);
  186.   this.hot = {
  187.     data: module.bundle.hotData,
  188.     _acceptCallbacks: [],
  189.     _disposeCallbacks: [],
  190.     accept: function (fn) {
  191.       this._acceptCallbacks.push(fn || function () {});
  192.     },
  193.     dispose: function (fn) {
  194.       this._disposeCallbacks.push(fn);
  195.     }
  196.   };
  197.   module.bundle.hotData = null;
  198. }
  199.  
  200. module.bundle.Module = Module;
  201. var parent = module.bundle.parent;
  202.  
  203. if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
  204.   var hostname = "" || location.hostname;
  205.   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
  206.   var ws = new WebSocket(protocol + '://' + hostname + ':' + "49405" + '/');
  207.  
  208.   ws.onmessage = function (event) {
  209.     var data = JSON.parse(event.data);
  210.  
  211.     if (data.type === 'update') {
  212.       console.clear();
  213.       data.assets.forEach(function (asset) {
  214.         hmrApply(global.parcelRequire, asset);
  215.       });
  216.       data.assets.forEach(function (asset) {
  217.         if (!asset.isNew) {
  218.           hmrAccept(global.parcelRequire, asset.id);
  219.         }
  220.       });
  221.     }
  222.  
  223.     if (data.type === 'reload') {
  224.       ws.close();
  225.  
  226.       ws.onclose = function () {
  227.         location.reload();
  228.       };
  229.     }
  230.  
  231.     if (data.type === 'error-resolved') {
  232.       console.log('[parcel] ✨ Error resolved');
  233.       removeErrorOverlay();
  234.     }
  235.  
  236.     if (data.type === 'error') {
  237.       console.error('[parcel] 🚨  ' + data.error.message + '\n' + data.error.stack);
  238.       removeErrorOverlay();
  239.       var overlay = createErrorOverlay(data);
  240.       document.body.appendChild(overlay);
  241.     }
  242.   };
  243. }
  244.  
  245. function removeErrorOverlay() {
  246.   var overlay = document.getElementById(OVERLAY_ID);
  247.  
  248.   if (overlay) {
  249.     overlay.remove();
  250.   }
  251. }
  252.  
  253. function createErrorOverlay(data) {
  254.   var overlay = document.createElement('div');
  255.   overlay.id = OVERLAY_ID; // html encode message and stack trace
  256.  
  257.   var message = document.createElement('div');
  258.   var stackTrace = document.createElement('pre');
  259.   message.innerText = data.error.message;
  260.   stackTrace.innerText = data.error.stack;
  261.   overlay.innerHTML = '<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;">' + '<span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span>' + '<span style="top: 2px; margin-left: 5px; position: relative;">🚨</span>' + '<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">' + message.innerHTML + '</div>' + '<pre>' + stackTrace.innerHTML + '</pre>' + '</div>';
  262.   return overlay;
  263. }
  264.  
  265. function getParents(bundle, id) {
  266.   var modules = bundle.modules;
  267.  
  268.   if (!modules) {
  269.     return [];
  270.   }
  271.  
  272.   var parents = [];
  273.   var k, d, dep;
  274.  
  275.   for (k in modules) {
  276.     for (d in modules[k][1]) {
  277.       dep = modules[k][1][d];
  278.  
  279.       if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {
  280.         parents.push(k);
  281.       }
  282.     }
  283.   }
  284.  
  285.   if (bundle.parent) {
  286.     parents = parents.concat(getParents(bundle.parent, id));
  287.   }
  288.  
  289.   return parents;
  290. }
  291.  
  292. function hmrApply(bundle, asset) {
  293.   var modules = bundle.modules;
  294.  
  295.   if (!modules) {
  296.     return;
  297.   }
  298.  
  299.   if (modules[asset.id] || !bundle.parent) {
  300.     var fn = new Function('require', 'module', 'exports', asset.generated.js);
  301.     asset.isNew = !modules[asset.id];
  302.     modules[asset.id] = [fn, asset.deps];
  303.   } else if (bundle.parent) {
  304.     hmrApply(bundle.parent, asset);
  305.   }
  306. }
  307.  
  308. function hmrAccept(bundle, id) {
  309.   var modules = bundle.modules;
  310.  
  311.   if (!modules) {
  312.     return;
  313.   }
  314.  
  315.   if (!modules[id] && bundle.parent) {
  316.     return hmrAccept(bundle.parent, id);
  317.   }
  318.  
  319.   var cached = bundle.cache[id];
  320.   bundle.hotData = {};
  321.  
  322.   if (cached) {
  323.     cached.hot.data = bundle.hotData;
  324.   }
  325.  
  326.   if (cached && cached.hot && cached.hot._disposeCallbacks.length) {
  327.     cached.hot._disposeCallbacks.forEach(function (cb) {
  328.       cb(bundle.hotData);
  329.     });
  330.   }
  331.  
  332.   delete bundle.cache[id];
  333.   bundle(id);
  334.   cached = bundle.cache[id];
  335.  
  336.   if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
  337.     cached.hot._acceptCallbacks.forEach(function (cb) {
  338.       cb();
  339.     });
  340.  
  341.     return true;
  342.   }
  343.  
  344.   return getParents(global.parcelRequire, id).some(function (id) {
  345.     return hmrAccept(global.parcelRequire, id);
  346.   });
  347. }
  348. },{}]},{},["../../../../../../../../../usr/local/lib/node_modules/parcel-bundler/src/builtins/hmr-runtime.js"], null)
Advertisement
Add Comment
Please, Sign In to add comment