// modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles

(function(modules, cache, entry, mainEntry, parcelRequireName, globalName) {
  /* eslint-disable no-undef */
  var globalObject =
    typeof globalThis !== 'undefined'
      ? globalThis
      : typeof self !== 'undefined'
      ? self
      : typeof window !== 'undefined'
      ? window
      : typeof global !== 'undefined'
      ? global
      : {};
  /* eslint-enable no-undef */

  // Save the require from previous bundle to this closure if any
  var previousRequire =
    typeof globalObject[parcelRequireName] === 'function' &&
    globalObject[parcelRequireName];
  // Do not use `require` to prevent Webpack from trying to bundle this call
  var nodeRequire =
    typeof module !== 'undefined' &&
    typeof module.require === 'function' &&
    module.require.bind(module);

  function newRequire(name, jumped) {
    if (!cache[name]) {
      if (!modules[name]) {
        // if we cannot find the module within our internal map or
        // cache jump to the current global require ie. the last bundle
        // that was added to the page.
        var currentRequire =
          typeof globalObject[parcelRequireName] === 'function' &&
          globalObject[parcelRequireName];
        if (!jumped && currentRequire) {
          return currentRequire(name, true);
        }

        // If there are other bundles on this page the require from the
        // previous one is saved to 'previousRequire'. Repeat this as
        // many times as there are bundles until the module is found or
        // we exhaust the require chain.
        if (previousRequire) {
          return previousRequire(name, true);
        }

        // Try the node require function if it exists.
        if (nodeRequire && typeof name === 'string') {
          return nodeRequire(name);
        }

        var err = new Error("Cannot find module '" + name + "'");
        err.code = 'MODULE_NOT_FOUND';
        throw err;
      }

      localRequire.resolve = resolve;
      localRequire.cache = {};

      var module = (cache[name] = new newRequire.Module(name));

      modules[name][0].call(
        module.exports,
        localRequire,
        module,
        module.exports,
        this
      );
    }

    return cache[name].exports;

    function localRequire(x) {
      return newRequire(localRequire.resolve(x));
    }

    function resolve(x) {
      return modules[name][1][x] || x;
    }
  }

  function Module(moduleName) {
    this.id = moduleName;
    this.bundle = newRequire;
    this.exports = {};
  }

  newRequire.isParcelRequire = true;
  newRequire.Module = Module;
  newRequire.modules = modules;
  newRequire.cache = cache;
  newRequire.parent = previousRequire;
  newRequire.register = function(id, exports) {
    modules[id] = [
      function(require, module) {
        module.exports = exports;
      },
      {},
    ];
  };

  Object.defineProperty(newRequire, 'root', {
    get: function() {
      return globalObject[parcelRequireName];
    },
  });

  globalObject[parcelRequireName] = newRequire;

  for (var i = 0; i < entry.length; i++) {
    newRequire(entry[i]);
  }

  if (mainEntry) {
    // Expose entry point to Node, AMD or browser globals
    // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
    var mainExports = newRequire(mainEntry);

    // CommonJS
    if (typeof exports === 'object' && typeof module !== 'undefined') {
      module.exports = mainExports;

      // RequireJS
    } else if (typeof define === 'function' && define.amd) {
      define(function() {
        return mainExports;
      });

      // <script>
    } else if (globalName) {
      this[globalName] = mainExports;
    }
  }
})({"6VwQK":[function(require,module,exports) {
var HMR_HOST = null;
var HMR_PORT = 1234;
var HMR_ENV_HASH = "d751713988987e9331980363e24189ce";
module.bundle.HMR_BUNDLE_ID = "81136bcf347aa0543043b8a4f0a6817d";
/* global HMR_HOST, HMR_PORT, HMR_ENV_HASH */

var OVERLAY_ID = '__parcel__error__overlay__';
var OldModule = module.bundle.Module;

function Module(moduleName) {
  OldModule.call(this, moduleName);
  this.hot = {
    data: module.bundle.hotData,
    _acceptCallbacks: [],
    _disposeCallbacks: [],
    accept: function (fn) {
      this._acceptCallbacks.push(fn || function () {});
    },
    dispose: function (fn) {
      this._disposeCallbacks.push(fn);
    }
  };
  module.bundle.hotData = null;
}

module.bundle.Module = Module;
var checkedAssets, assetsToAccept, acceptedAssets;

function getHostname() {
  return HMR_HOST || (location.protocol.indexOf('http') === 0 ? location.hostname : 'localhost');
}

function getPort() {
  return HMR_PORT || location.port;
} // eslint-disable-next-line no-redeclare


var parent = module.bundle.parent;

if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
  var hostname = getHostname();
  var port = getPort();
  var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
  var ws = new WebSocket(protocol + '://' + hostname + (port ? ':' + port : '') + '/');

  ws.onmessage = function (event) {
    checkedAssets = {};
    assetsToAccept = [];
    acceptedAssets = {};
    var data = JSON.parse(event.data);

    if (data.type === 'update') {
      // Remove error overlay if there is one
      removeErrorOverlay();
      let assets = data.assets.filter(asset => asset.envHash === HMR_ENV_HASH); // Handle HMR Update

      var handled = false;
      assets.forEach(asset => {
        var didAccept = asset.type === 'css' || hmrAcceptCheck(module.bundle.root, asset.id);

        if (didAccept) {
          handled = true;
        }
      });

      if (handled) {
        console.clear();
        assets.forEach(function (asset) {
          hmrApply(module.bundle.root, asset);
        });

        for (var i = 0; i < assetsToAccept.length; i++) {
          var id = assetsToAccept[i][1];

          if (!acceptedAssets[id]) {
            hmrAcceptRun(assetsToAccept[i][0], id);
          }
        }
      } else {
        window.location.reload();
      }
    }

    if (data.type === 'error') {
      // Log parcel errors to console
      for (let ansiDiagnostic of data.diagnostics.ansi) {
        let stack = ansiDiagnostic.codeframe ? ansiDiagnostic.codeframe : ansiDiagnostic.stack;
        console.error('🚨 [parcel]: ' + ansiDiagnostic.message + '\n' + stack + '\n\n' + ansiDiagnostic.hints.join('\n'));
      } // Render the fancy html overlay


      removeErrorOverlay();
      var overlay = createErrorOverlay(data.diagnostics.html);
      document.body.appendChild(overlay);
    }
  };

  ws.onerror = function (e) {
    console.error(e.message);
  };

  ws.onclose = function (e) {
    console.warn('[parcel] 🚨 Connection to the HMR server was lost');
  };
}

function removeErrorOverlay() {
  var overlay = document.getElementById(OVERLAY_ID);

  if (overlay) {
    overlay.remove();
    console.log('[parcel] ✨ Error resolved');
  }
}

function createErrorOverlay(diagnostics) {
  var overlay = document.createElement('div');
  overlay.id = OVERLAY_ID;
  let errorHTML = '<div style="background: black; opacity: 0.85; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; font-family: Menlo, Consolas, monospace; z-index: 9999;">';

  for (let diagnostic of diagnostics) {
    let stack = diagnostic.codeframe ? diagnostic.codeframe : diagnostic.stack;
    errorHTML += "\n      <div>\n        <div style=\"font-size: 18px; font-weight: bold; margin-top: 20px;\">\n          \uD83D\uDEA8 ".concat(diagnostic.message, "\n        </div>\n        <pre>\n          ").concat(stack, "\n        </pre>\n        <div>\n          ").concat(diagnostic.hints.map(hint => '<div>' + hint + '</div>').join(''), "\n        </div>\n      </div>\n    ");
  }

  errorHTML += '</div>';
  overlay.innerHTML = errorHTML;
  return overlay;
}

function getParents(bundle, id) {
  var modules = bundle.modules;

  if (!modules) {
    return [];
  }

  var parents = [];
  var k, d, dep;

  for (k in modules) {
    for (d in modules[k][1]) {
      dep = modules[k][1][d];

      if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {
        parents.push([bundle, k]);
      }
    }
  }

  if (bundle.parent) {
    parents = parents.concat(getParents(bundle.parent, id));
  }

  return parents;
}

function updateLink(link) {
  var newLink = link.cloneNode();

  newLink.onload = function () {
    if (link.parentNode !== null) {
      link.parentNode.removeChild(link);
    }
  };

  newLink.setAttribute('href', link.getAttribute('href').split('?')[0] + '?' + Date.now());
  link.parentNode.insertBefore(newLink, link.nextSibling);
}

var cssTimeout = null;

function reloadCSS() {
  if (cssTimeout) {
    return;
  }

  cssTimeout = setTimeout(function () {
    var links = document.querySelectorAll('link[rel="stylesheet"]');

    for (var i = 0; i < links.length; i++) {
      var href = links[i].getAttribute('href');
      var hostname = getHostname();
      var servedFromHMRServer = hostname === 'localhost' ? new RegExp('^(https?:\\/\\/(0.0.0.0|127.0.0.1)|localhost):' + getPort()).test(href) : href.indexOf(hostname + ':' + getPort());
      var absolute = /^https?:\/\//i.test(href) && href.indexOf(window.location.origin) !== 0 && !servedFromHMRServer;

      if (!absolute) {
        updateLink(links[i]);
      }
    }

    cssTimeout = null;
  }, 50);
}

function hmrApply(bundle, asset) {
  var modules = bundle.modules;

  if (!modules) {
    return;
  }

  if (modules[asset.id] || !bundle.parent) {
    if (asset.type === 'css') {
      reloadCSS();
    } else {
      var fn = new Function('require', 'module', 'exports', asset.output);
      modules[asset.id] = [fn, asset.depsByBundle[bundle.HMR_BUNDLE_ID]];
    }
  } else if (bundle.parent) {
    hmrApply(bundle.parent, asset);
  }
}

function hmrAcceptCheck(bundle, id) {
  var modules = bundle.modules;

  if (!modules) {
    return;
  }

  if (!modules[id] && bundle.parent) {
    return hmrAcceptCheck(bundle.parent, id);
  }

  if (checkedAssets[id]) {
    return;
  }

  checkedAssets[id] = true;
  var cached = bundle.cache[id];
  assetsToAccept.push([bundle, id]);

  if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
    return true;
  }

  return getParents(module.bundle.root, id).some(function (v) {
    return hmrAcceptCheck(v[0], v[1]);
  });
}

function hmrAcceptRun(bundle, id) {
  var cached = bundle.cache[id];
  bundle.hotData = {};

  if (cached && cached.hot) {
    cached.hot.data = bundle.hotData;
  }

  if (cached && cached.hot && cached.hot._disposeCallbacks.length) {
    cached.hot._disposeCallbacks.forEach(function (cb) {
      cb(bundle.hotData);
    });
  }

  delete bundle.cache[id];
  bundle(id);
  cached = bundle.cache[id];

  if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
    cached.hot._acceptCallbacks.forEach(function (cb) {
      var assetsToAlsoAccept = cb(function () {
        return getParents(module.bundle.root, id);
      });

      if (assetsToAlsoAccept && assetsToAccept.length) {
        assetsToAccept.push.apply(assetsToAccept, assetsToAlsoAccept);
      }
    });
  }

  acceptedAssets[id] = true;
}
},{}],"6Fg91":[function(require,module,exports) {
"use strict";

var _vnode = require("../../vm/vnode");

var _view = require("../../vm/view");

var _render = require("../../vm/render");

require("./main");

console.log('vdom', _vnode.VNode.create('FRAGMENT', null, _vnode.VNode.create("h3", null, "Head"), _vnode.VNode.create("div", null, "AAA", _vnode.VNode.create(Z, null))));
console.log('render', (0, _render.render)(_vnode.VNode.create('FRAGMENT', null, _vnode.VNode.create("h3", null, "Head"), _vnode.VNode.create("div", null, "AAA", _vnode.VNode.create(Z, null)))));
},{"../../vm/vnode":"rEOtM","../../vm/view":"7rP3i","../../vm/render":"2RJeN","./main":"18HlE"}],"rEOtM":[function(require,module,exports) {
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VNode = exports.NODETYPE = void 0;

var _collections = require("../core/collections");

var _types = require("../core/types");

var util = _interopRequireWildcard(require("./util"));

var _hscriptEsm = require("./hscript-esm");

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

// import {Component, VText} from "./vm2/vnode";
const NODETYPE = {
  TEXT: 0,
  NODE: 1,
  VIEW: 2
};
/**
 * @property {[VNode|View|String]|VNode|View|String} nodes
 * @property {View} [$view]
 * @property {HTMLElement|Element|Node} [element]
 */

exports.NODETYPE = NODETYPE;

class VNode {
  constructor(tag, props, ...children) {
    this.$tag = tag;

    if (tag === '#text') {
      this.$type = NODETYPE.TEXT;
      this.text = props;
      this.isText = true;
      return;
    }

    this.isNode = true;
    this.$type = NODETYPE.NODE;
    if (tag === 'FRAGMENT') this.isFrag = true;

    if (props) {
      (0, _collections.concat)(this, util.compileProps(props));
    }

    if (children) {
      children = util.prepareChildren(children);
      this.nodes = children;
    }
  }
  /**
   * Create View | VNode | #TEXT
   *
   * @param {View|VNode|String|Number} type
   * @param {Object|undefined} props
   * @param {View|VNode|String|Number} children
   * @returns {any|VNode}
   */


  static create(type, props = {}, ...children) {
    if (props === null) props = {}; // flatten arrays and change str/num to VNode(#text)

    children = util.prepareChildren(children); // View class instance

    if (type.isView) {
      return type.createInstance(props, children);
    } // View class


    if (type.$type === NODETYPE.VIEW) {
      return new type().updateInstance(props, children);
    } // create VNode instance


    return VNode.createTag(type, props, ...children);
  }

  static createText(str) {
    return new VNode('#text', str);
  }

  static createTag(type, props = {}, ...children) {
    return new VNode(type, props, ...children);
  }

}

exports.VNode = VNode;
},{"../core/collections":"1hgia","../core/types":"1EuZy","./util":"2Pcrs","./hscript-esm":"JHwBv"}],"1hgia":[function(require,module,exports) {
var global = arguments[3];

/**
 * @module core/collections
 * @memberOf core
 */
const T = require("./types");

if (!global._X_LOOP_BREAK_) {
  global._X_LOOP_BREAK_ = Symbol("BREAK_LOOP");
  global._X_ANY_ = Symbol("ANY");
  global._X_ALL_ = Symbol("ALL");
}
/**
 * Break from functional loops: forEach, filter, ...
 * @type {symbol}
 */


const BREAK = global._X_LOOP_BREAK_;
/**
 * Match Any: Used as value in predicate object
 * @type {symbol}
 */

const ANY = global._X_ANY_;
const ALL = global._X_ALL_;
const UNSAFE_PROPS = ['__proto__', 'constructor', '__defineGetter__', '__defineSetter__', 'prototype'];
/**
 * Get item by index from multiple source types
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} s - source
 * @param {Number|String} i - item index
 * @returns {any|null|undefined}
 */

function item(s, i) {
  if (!T.isVal(s)) return undefined;
  if (T.isObj(s)) return s[i];
  if (T.isStr(s)) return s[i];
  if (T.isArr(s)) return s[i];else return s.item(i);
}
/**
 * Source contains value or key:value
 *
 * @param {Array|Object|String} src
 * @param {any} value
 * @param {String|undefined} [key]
 * @returns {boolean}
 */


function contains(src, value, key) {
  if (!T.isVal(src)) return false;
  if (!T.isArr(src) && T.isObj(src)) return src[key] === value;
  return src.indexOf(value) >= 0;
}
/**
 * Add item(s) to source
 *
 * @param {Array|{add:Function}} src - source
 * @param {any} v - values
 */


function add(src, ...v) {
  if (T.isArr(src)) {
    forEach(v, vi => src.push(vi));
  } else if (T.isMutableList(src)) {
    src.add(v);
  }
}
/**
 * Remove item(s) from source
 *
 * @param {Array|String} src
 * @param {...any} it
 * @returns {boolean}
 */


function remove(src, ...it) {
  it = flatMap(it);
  let any = false;
  forEach(it, item => {
    let idx = src.indexOf(item);

    if (idx >= 0) {
      any = true;
      src.splice(idx, 1);
    }
  });
  return any;
}
/**
 * Toggles items in source
 *
 * @param {Array} src
 * @param {...any} c
 */


function toggle(src, ...c) {
  if (c.length === 0) return;
  c = flatMap(c);
  let idx = undefined;

  if (c.length === 1) {
    if (!remove(src, c)) {
      add(src, c[0]);
    }
  } else {
    c.push(c[0]);
    let any = false;
    forEach(src, (cl, i) => {
      idx = c.indexOf(cl);

      if (idx >= 0 && c.length > idx + 1) {
        any = true;
        src[i] = c[idx + 1];
      }
    });

    if (!any) {
      src.push(c[0]);
    }
  }
}

function objMatchOne(o, match) {
  let m = Object.keys(match);

  for (let k of m) {
    // if (!T.isObj(o[k])) continue;
    if (match[k] === ANY && o.hasOwnProperty(k)) return true;
    if (match[k] === o[k]) return true;
  }

  return false;
}

function objMatchAll(o, match) {
  let m = Object.keys(match);

  for (let k of m) {
    // if (!T.isObj(o[k])) return false;
    if (match[k] === ANY) continue;
    if (match[k] !== o[k]) return false;
  }

  return true;
}

function predicate(f, def = () => true, inc = true) {
  if (T.isUnd(f)) return def;
  if (T.isFun(f)) return f;else if (f instanceof RegExp) return (v, k, i, s) => !T.isObj(v) ? f.test(v.toString()) : false;else if (T.isObj(f)) {
    if (Object.keys(f).length === 0) return def;
    return inc ? (v, k, i, s) => objMatchOne(v, f) : (v, k, i, s) => objMatchAll(v, f);
  } else return (v, k, i, s) => v === f;
}

function funOrKey(f) {
  if (T.isUnd(f)) return v => v;
  if (T.isFun(f)) return f;

  if (T.isStr(f)) {
    const key = f;

    f = v => v[key];
  }

  throw Error(`Predicate ${f} cannot be of type ${typeof f}`);
}
/**
 * Create empty instance of given source
 *
 * @param {any} src - source object
 * @param {any} def - default value for primitives
 * @returns {any} empty instance of src
 */


function emptyOf(src, def = {}) {
  if (T.isStr(src)) return "";
  if (T.isList(src)) return [];

  if (T.isObj(src)) {
    if (T.isEl(src)) {
      if (src.nodeType === 3 || src.nodeType === 8) {
        return document.createTextNode(src.textContent);
      } else {
        return document.createElement(src.tagName);
      }
    }

    if (src.__proto__) return Object.create(src.__proto__);
    return {};
  }

  return def;
}
/**
 * Type-agnostic concat. !!Mutates target!!
 *
 * @param {Array|String|Object} target
 * @param {Array|String|Object} source
 * @returns {Array|String|Object}
 */


function concat(target, source, override = false) {
  if (T.isStr(target)) {
    return target.concat(source);
  }

  if (T.isArr(target)) {
    return target.concat(source);
  }

  for (let k of Object.keys(source)) {
    if (!target[k] || override) target[k] = source[k];
  }

  return target;
}
/**
 * Polyfill-like for Object.values (uses native method if available)
 *
 * @param {Object} obj
 * @returns {Array|undefined} - array of values
 */


function objectValues(obj) {
  if (Object.values) {
    return Object.values(obj);
  } else {
    return map(obj, v => v);
  }
}
/**
 * Index for loop from "init" to "finish"(included) by "step"
 *
 * @param {Function} func
 * @param {Number} init
 * @param {Number} finish
 * @param {Number} [step]
 */


function forN(func, init = 0, finish = 0, step = init < finish ? 1 : -1) {
  if (step > 0) {
    for (; init <= finish; init += step) {
      func(init);
    }
  }

  for (; init >= finish; init += step) {
    func(init);
  }
}
/**
 * forEach(left) with limited range
 *
 * @param {Array|Object|NodeList|HTMLCollection} src
 * @param {Function} func
 * @param {Number} [start]
 * @param {Number?} [end]
 * @returns {*|number}
 */


function forEachRange(src, func, start = 0, end) {
  if (!T.isArr(src) || !T.isStr(src)) {
    let keys = Object.keys(src);
    end = end || keys.length - 1;

    for (let i = start; i <= end; i++) {
      let r = func(src[keys[i]], keys[i], i, src);
      if (r === BREAK) return i;
    }

    return end;
  }

  end = end || src.length;

  for (let i = start; i < end; i++) {
    let r = func(item(src, i), i, i, src);
    if (r === BREAK) return i;
  }

  return end;
}
/**
 * Type-agnostic forEach loop
 *
 * @param src
 * @param func
 * @returns {number|*}
 */


function forEach(src, func) {
  if (!T.isVal(src)) return -1;

  if (!T.isArr(src) || !T.isStr(src) || !T.isList(src)) {
    let i = 0;
    let keys = Object.keys(src);
    const len = keys.length;

    for (; i < len; i++) {
      // let r = ;
      const k = keys[i],
            v = src[k];
      if (func(v, k, i, src) === BREAK) return i;
    }

    return i;
  }

  const len = src.length;

  if (!T.isArr(src)) {
    for (let i = 0; i < len; i++) {
      const v = src[i];
      let r = func(v, i, i, src);
      if (r === BREAK) return i;
    }
  } else {
    for (let i = 0; i < len; i++) {
      const v = item(src, i);
      let r = func(v, i, i, src);
      if (r === BREAK) return i;
    }
  }

  return src.length;
}
/**
 * Type-agnostic forEachRight loop
 *
 * @param src
 * @param func
 * @param range
 * @returns {number|*}
 */


function forEachRight(src, func, range = []) {
  if (!T.isArr(src) || !T.isStr(src)) {
    let i = 0;
    let keys = Object.keys(src);

    for (let i = keys.length - 1; i >= 0; i--) {
      if (i < range[1]) continue;
      if (i >= range[0]) return i;
      let r = func(src[keys[i]], keys[i], i, src);
      if (r === BREAK) return i;
    }

    return i;
  }

  for (let i = src.length - 1; i >= 0; i--) {
    let r = func(item(src, i), i, i, src);
    if (r === BREAK) return i;
  }

  return src.length;
}
/**
 * Extended version of native indexOf method, using {@link forEach}
 * @see forEach
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Object|Array} pred - predicate function/{key:value}/[keys]
 * @returns {number}
 */


function firstIndex(src, pred) {
  pred = predicate(pred, () => true);
  let r = -1;
  forEach(src, function (v, k, i) {
    r = pred(v, k, i, src);

    if (r === true) {
      r = i;
      return BREAK;
    }
  });
  return r;
}
/**
 * Extended version of native first method, using {@link firstIndex}
 * @see firstIndex
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Object|Array} [pred] - predicate function/{key:value}/[keys]
 * @returns {*}
 */


function first(src, pred) {
  return item(src, firstIndex(src, pred));
}
/**
 * Returns true if first item matches predicate
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Object|Array} [pred] - predicate function/{key:value}/[keys] pred
 * @returns {boolean|*}
 */


function startsWith(src, pred) {
  if (T.isStr(src) && T.isStr(pred)) {
    return src.indexOf(pred) === 0;
  }

  pred = predicate(pred, () => true);
  return pred(first(src));
}
/**
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Array|Object} pred
 * @returns {number}
 */


function lastIndex(src, pred) {
  pred = predicate(pred, () => true);
  let r = -1;
  forEachRight(src, function (v, k, i) {
    r = pred(v, k, i);

    if (r === true) {
      r = i;
      return BREAK;
    }
  });
  return r;
}
/**
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Array|Object} [pred]
 * @returns {*}
 */


function last(src, pred) {
  return src[lastIndex(src, pred)];
}
/**
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Array|Object} pred
 * @returns {boolean|*}
 */


function endsWith(src, pred) {
  if (T.isStr(src) && T.isStr(pred)) {
    return src.indexOf(pred) === src.length - pred.length;
  }

  pred = predicate(pred, () => true);
  return pred(last(src));
}
/**
 * Reverse array-like src
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @returns {Array|Object|String|NodeList|HTMLCollection} - reversed src
 */


function reverse(src) {
  if (T.isArr(src)) return src.reverse();
  let rev = "";
  forEachRight(src, function (it) {
    rev += it;
  });
  return rev;
}
/**
 * A more versatile alternative to native "some" method
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Array|Object} pred
 * @returns {boolean}
 */


function any(src, pred) {
  // if (!func){
  //     if (T.isArr(src) || T.isStr(src)) return src.length>0;
  //     return Object.keys(src).length>0;
  // }
  let fn = predicate(pred);
  let r = false;
  forEach(src, function (v, k, i, src) {
    r = fn(v, k, i, src);
    if (r === true) return BREAK;
  });
  return r;
}
/**
 * A more versatile alternative to native "every" method
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src
 * @param {Function|Array|Object} pred
 * @returns {boolean}
 */


function all(src, pred) {
  pred = predicate(pred, () => true);
  let r = true;
  forEach(src, function (v, k, i, src) {
    r = pred(v, k, i, src);
    if (r === false) return BREAK;
  });
  return r;
}

function filterStr(src, pred, right = false, omit = false) {
  pred = predicate(pred, () => true);
  let res = "";
  let loop = right ? forEachRight : forEach;
  loop(src, function (v, k, i) {
    if (!pred || pred(v, k, i, src) === omit) res += v;
  });
  return res;
}

function filterObj(src, pred, right = false, omit = false) {
  if (T.isArr(pred)) {
    let a = Object.assign({}, pred);
    if (omit) pred = (v, k) => !any(a, k);else pred = (v, k) => any(a, k);
  } else pred = predicate(pred, () => true);

  let res = {}; // let loop = right ? ForEachRight : ForEach;

  const keys = Object.keys(src);
  const len = keys.length;

  if (!right) {
    for (let i = 0; i < len; i++) {
      const k = keys[i];
      const v = src[k];
      if (pred(v, k, i, src) !== omit) res[k] = v;
    }
  } else {
    for (let i = len - 1; i >= 0; i--) {
      const k = keys[i];
      const v = src[k];
      if (pred(v, k, i, src) !== omit) res[k] = v;
    }
  } // loop(src, function (v, k, i) {
  //     if (pred(v, k, i, src) !== omit) res[k] = v;
  // });


  return res;
}

function filterArr(src, pred, right = false, omit = false) {
  if (T.isArr(pred)) {
    let a = Object.assign([], pred);
    if (omit) pred = (v, k, i) => !any(a, i);else pred = (v, k, i) => any(a, i);
  } else pred = predicate(pred, () => true);

  let res = [];
  const len = src.length;

  if (!right) {
    for (let i = 0; i < len; i++) {
      const v = src[i];

      if (pred(v, i, i, src) !== omit) {
        res.push(v);
      }
    }
  } else {
    for (let i = len - 1; i >= 0; i--) {
      const v = src[i];

      if (!pred(v, i, i, src) !== omit) {
        res.push(v);
      }
    }
  }

  return res;
}
/**
 * A more versatile alternative to native "filter" method
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src - source
 * @param {Function|Array|Object} pred - predicate function/{key:value}/[keys]
 * @param {boolean} [right] - reverse loop
 * @returns {Array|Object|String}
 */


function filter(src, pred, right = false) {
  if (T.isStr(src)) return filterStr(src, pred, right);
  if (T.isArr(src) || T.isList(src)) return filterArr(src, pred, right);
  return filterObj(src, pred, right);
}
/**
 * Opposite of filter, returns items not matching predicate
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src - source
 * @param {Function|Array|Object} pred - predicate function/{key:value}/[keys]
 * @param {boolean} [right] - reverse loop
 * @returns {Array|Object|String}
 */


function omit(src, pred, right = false) {
  if (T.isStr(src)) return filterStr(src, pred, right, true);
  if (T.isArr(src) || T.isList(src)) return filterArr(src, pred, right, true);
  return filterObj(src, pred, right, true);
}
/**
 * {@link filter} in reverse order (right)
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src - source
 * @param {Function|Array|Object} pred - predicate function/{key:value}/[keys]
 * @returns {Array|Object|String}
 */


function filterRight(src, pred) {
  return filter(src, pred, true);
}
/**
 * Find max index
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} list
 * @param {Function|String} pred - predicate function/key
 * @return {number}
 */


function maxIndex(list, pred) {
  pred = funOrKey(pred);
  let mx;
  let index = -1;
  forEach(list, function (i, ix) {
    let x = pred(i, ix);

    if (!mx) {
      mx = x;
      index = ix;
    } else if (x >= mx) {
      mx = x;
      index = ix;
    }
  });
  return index;
}
/**
 * Find max
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} list
 * @param {Function|String} pred - predicate function/key
 * @return {number}
 */


function max(list, pred) {
  return list[maxIndex(list, pred)];
}
/**
 * Find min index
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} list
 * @param {Function|String} pred - predicate function/key
 * @return {number}
 */


function minIndex(list, pred) {
  pred = funOrKey(pred);
  let mn;
  let index = -1;
  forEach(list, function (i, ix) {
    let x = pred(i, ix);

    if (!mn) {
      mn = x;
      index = ix;
    } else if (x <= mn) {
      mn = x;
      index = ix;
    }
  });
  return index;
}
/**
 * Find min
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} list
 * @param {Function|String} pred - predicate function/key
 * @return {number}
 */


function min(list, pred) {
  return list[minIndex(list, pred)];
}

function mapArr(src, func, right = false) {
  let res = []; // let loop = right ? ForEachRight : ForEach;

  const len = src.length;

  if (!right) {
    for (let i = 0; i < len; i++) {
      let r = func(src[i], i, src);
      if (r === BREAK) break;
      if (!T.isUnd(r)) res.push(r);
    }
  } else {
    for (let i = len; i >= 0; i--) {
      let r = func(src[i], i, src);
      if (r === BREAK) break;
      if (!T.isUnd(r)) res.push(r);
    }
  } // loop(src, function (a, i) {
  //     let r = func(a, i, src);
  //     if (!T.isUnd(r))
  //         res.push(r);
  // });


  return res;
}

function mapObj(src, func, right = false) {
  let res = {}; // let loop = right ? ForEachRight : ForEach;

  const keys = Object.keys(src);
  const len = src.length;

  if (!right) {
    for (let i = 0; i < len; i++) {
      const k = keys[i];
      const v = src[k];
      let r = func(v, k, i, src);
      if (r === BREAK) break;
      if (!T.isUnd(r)) res[k] = r;
    }
  } else {
    for (let i = len; i >= 0; i--) {
      const k = keys[i];
      const v = src[k];
      let r = func(v, k, i, src);
      if (r === BREAK) break;
      if (!T.isUnd(r)) res[k] = r;
    }
  } // loop(src, function (v, k, i) {
  //     let r = func(v, k, i, src);
  //     if (!T.isUnd(r))
  //         res[k] = r
  // });


  return res;
}
/**
 * A more versatile alternative to native "map" method
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src - source
 * @param {Function|Array|Object} transform - transformer function
 * @param {boolean} [right] - reverse loop
 * @returns {Array|Object|String}
 */


function map(src, transform, right = false) {
  transform = predicate(transform, v => v);
  if (T.isArr(src)) return mapArr(src, transform, right);else if (T.isObj(src)) return mapObj(src, transform, right);
}
/**
 * A more versatile alternative to native "flatMap" method, flattens first level items
 *
 * @param {Array|Object|String|NodeList|HTMLCollection} src - source
 * @param {Function|Array|Object} [transform] - transformer function
 * @returns {Array|Object|String}
 */


function flatMap(src, transform) {
  let res;
  if (T.isStr(src)) res = "";else if (T.isArr(src)) res = [];else res = {};
  forEach(src, function (a, i) {
    let f;

    if (!!transform) {
      f = transform(a, i, src);
    } else {
      if (!T.isArr(res) && T.isObj(res)) {
        f = {};
        f[i] = a;
      } else {
        f = a;
      }
    }

    res = concat(res, f);
  });
  return res;
}
/**
 * A more versatile alternative to native "reduce" method
 *
 * @param {any} src - source
 * @param {Function|Array|Object} func - reducer function
 * @param {any} [acc] - accumulator
 * @returns {any}
 */


function reduce(src, func, acc = src) {
  if (T.isUnd(func)) {
    func = (rs, v) => rs + v;
  }

  forEach(src, (v, k, src) => {
    acc = func(acc, v, k, src);
  });
  return acc;
}
/**
 * {@link reduce} in reverse
 * @see reduce
 * @param {any} src - source
 * @param {Function|Array|Object} func - reducer function
 * @param {any} [acc] - accumulator
 * @returns {any}
 */


function reduceRight(src, func, acc = src) {
  forEachRight(src, (v, k, src) => {
    acc = func(acc, v, k, src);
  });
}
/**
 * Extract single key-value pairs from object
 *
 * @param object
 * @return {Object[]}
 */


function keyValuePairs(object) {
  let entries = [];
  forEach(object, (v, k) => {
    entries.push(T.dict(k, v));
  });
  return entries;
}
/**
 * Like Object.entries extracts key-value pairs as [[key1,value1],[key2,value2],...]
 *
 * @param {Object} object
 * @return {Array[]}
 */


function entries(object) {
  let entries = [];
  forEach(object, (v, k) => {
    entries.push([k, v]);
  });
  return entries;
}
/**
 * Translate(rename) object fields using dict parameter, omitting undefined keys
 * @param {Object} source
 * @param {Object|Array} dict
 * @return {Array|Object|String}
 */


function translateObject(source, dict) {
  if (T.isArr(dict)) {
    filter(source, dict);
  }

  const keys = Object.keys(dict);
  let res = filter(source, keys);

  for (let key of keys) {
    res[dict[key]] = res[key];
    delete res[key];
  }

  return res;
}
/**
 * Recursive deep merge {@param target} with {@param source}
 *
 * @param {Object|Array} target
 * @param {Object|Array} source
 * @param {Array} excludeKeys - keys to be skipped while merging
 * @param maxDepth - maximum recursive depth
 * @param allowUnsafeProps - allow unsafe properties like __proto__
 * @return {Object|Array}
 */


function deepMerge(target, source, {
  excludeKeys = [],
  maxDepth = 999,
  allowUnsafeProps = false
} = {
  excludeKeys: [],
  maxDepth: 999,
  allowUnsafeProps: false
}, depth = 0) {
  if (depth >= maxDepth) return target;
  forEach(source, (v, k) => {
    if (excludeKeys && contains(excludeKeys, k)) return;
    if (allowUnsafeProps && contains(UNSAFE_PROPS, k)) return;

    if (T.isObj(source[k])) {
      target[k] = deepMerge(emptyOf(source[k]), source[k], {
        excludeKeys,
        maxDepth,
        depth: depth + 1
      });
    } else target[k] = v;
  });
  return target;
}
/**
 * Recursive deep clone {@param source}
 * @see deepMerge
 *
 * @param {Object|Array} source
 * @param {Array} excludeKeys - keys to be skipped while merging
 * @param {Number} [maxDepth] - maximum recursive depth
 * @param {boolean} [allowUnsafeProps] - allow unsafe properties like __proto__
 * @return {Object|Array}
 */


function deepClone(source, {
  excludeKeys = [],
  maxDepth = 999,
  allowUnsafeProps = false
} = {
  excludeKeys: [],
  maxDepth: 999,
  allowUnsafeProps: false
}) {
  return deepMerge(emptyOf(source), source, {
    excludeKeys,
    maxDepth,
    allowUnsafeProps
  });
}

function _keyGen(key, fnName) {
  let keyGen = key;

  if (T.isStr(key)) {
    keyGen = item => item[key];
  } else if (T.isArr(key)) {
    keyGen = item => reduce(item, (res, v, k) => {
      if (contains(key, k)) {
        return res + v;
      }
    }, "");
  } else if (!T.isFun(key)) {
    throw Error(`${fnName} key only accepts: String, [String,...], Function`);
  }

  return keyGen;
}
/**
 * Join arrays of objects based on a generated or static key
 *
 * @param {Function|String} key
 * @param {Object[]} lists
 * @return {Object}
 */


function join(key, ...lists) {
  if (lists.length === 0) return [];
  if (!all(lists, T.isArr)) throw Error("Join only accepts arrays of data!");

  let keyGen = _keyGen(key, "Join");

  const joined = {};
  forEach(lists, list => {
    forEach(list, item => {
      const joinKey = keyGen(item);
      const presentValue = joined[joinKey];

      if (!presentValue) {
        joined[joinKey] = item;
      } else {
        joined[joinKey] = concat(presentValue, item);
      }
    });
  });
  return joined;
}
/**
 * Group arrays based on generated or static key(s)
 *
 * @param {Function|String} key
 * @param {Object[]} lists
 * @return {Object}
 */


function groupBy(key, ...lists) {
  if (lists.length === 0) return {};
  if (!all(lists, T.isArr)) throw Error("GroupBy only accepts arrays of data!");

  let keyGen = _keyGen(key, "GroupBy");

  const group = {};
  forEach(lists, list => {
    forEach(list, item => {
      const joinKey = keyGen(item);
      const presentValue = group[joinKey];

      if (!presentValue) {
        group[joinKey] = [item];
      } else {
        group[joinKey] = concat(presentValue, item);
      }
    });
  });
  return group;
} // noinspection JSUnusedGlobalSymbols


module.exports = {
  ANY,
  ALL,
  BREAK,
  item,
  contains,
  add,
  remove,
  toggle,
  concat,
  emptyOf,
  objMatchOne,
  objMatchAll,
  deepMerge,
  deepClone,
  forN,
  forEachRange,
  forEach,
  forEachRight,
  firstIndex,
  first,
  startsWith,
  lastIndex,
  last,
  endsWith,
  reverse,
  any,
  all,
  filter,
  filterRight,
  reduce,
  reduceRight,
  map,
  flatMap,
  keyValuePairs,
  entries,
  maxIndex,
  max,
  minIndex,
  min,
  translateObject,
  omit,
  join,
  groupBy,
  objectValues
};
},{"./types":"1EuZy"}],"1EuZy":[function(require,module,exports) {
/**
 * @module core/types
 * @memberOf core
 */

/**
 * If is class or function return class/function name else returns typeof
 * @param x
 * @return {"undefined"|"object"|"boolean"|"number"|"string"|"function"|"symbol"|"bigint"|*}
 */
function typeName(x) {
  if (x.hasOwnProperty('constructor')) {
    return x.constructor.name;
  }

  return typeof x;
}
/** Is undefined
 * @param x
 * @returns {boolean}
 */


function isUnd(x) {
  return x !== null && x === undefined;
}
/** Is null
 * @param x
 * @return {boolean}
 */


function isNull(x) {
  return x === null;
}
/** Is value !null && !undefined
 * @param x
 * @return {boolean|boolean}
 */


function isVal(x) {
  return !isUnd(x) && !isNull(x);
}
/** Is number
 * @param x
 * @return {boolean}
 */


function isNum(x) {
  return typeof x === "number";
}
/** Is string|String
 * @param x
 * @return {boolean}
 */


function isStr(x) {
  return typeof x === "string" || x instanceof String;
}
/** Is function
 * @param x
 * @return {boolean}
 */


function isFun(x) {
  return typeof x === "function";
}
/** Is object
 * @param x
 * @return {boolean|boolean}
 */


function isObj(x) {
  return x !== null && typeof x === "object";
}
/** Is Array
 * @param x
 * @return {boolean}
 */


function isArr(x) {
  return x instanceof Array;
}
/** Is primitive isVal && !isObj && !isFun
 * @param x
 * @return {boolean}
 */


function isPrim(x) {
  return isVal(x) && !isObj(x) && !isFun(x);
}
/** Is List (has length property and item() function)
 * @param x
 * @return {boolean|boolean}
 */


function isList(x) {
  return isVal(x.length) && isFun(x.item);
}
/** Is MutableList (has length property, item() and add() functions)
 * @param x
 * @return {boolean}
 */


function isMutableList(x) {
  return isVal(x.length) && isFun(x.item) && isFun(x.add);
}
/** Is Set type
 * @param x
 * @return {boolean}
 */


function isSet(x) {
  return x instanceof Set;
}
/** Is Map type
 * @param x
 * @return {boolean}
 */


function isMap(x) {
  return x instanceof Map;
}
/** Is Error type
 * @param x
 * @return {boolean}
 */


function isError(x) {
  return x instanceof Error;
}
/** Is Element/Node
 * @param x
 * @return {boolean}
 */


function isEl(x) {
  return x instanceof Element || x instanceof HTMLElement || x instanceof Node;
}
/** Is NodeList || HTMLCollection
 * @param x
 * @return {boolean}
 */


function isEls(x) {
  return x instanceof HTMLCollection || x instanceof NodeList;
}
/**
 * Object has field
 * @param {Object} obj - source object
 * @param {String} field - field/property name
 * @param {Function} [pred] - optional predicate function to check field
 * @return {boolean}
 */


function hasField(obj, field, pred) {
  if (!isVal(obj)) return false;

  if (isFun(pred)) {
    return pred(obj[field]);
  }

  return obj.hasOwnProperty(field);
}
/** Is Empty Array/List/Object/String
 * @param x
 * @return {boolean}
 */


function isEmpty(x) {
  if (hasField(x, 'length')) return x.length <= 0;
  if (isFun(x)) return false;
  if (isObj(x)) return Object.keys(x).length <= 0;
  return true;
}
/**
 * Custom Enum implementation
 *
 * @param src {Object | String[]}
 * @return {Object}
 * @constructor
 */


function Enum(src) {
  let c = 0;
  let MAP = {};

  for (let i of Object.keys(src)) {
    MAP[MAP[c] = i] = c++;
  }

  return MAP;
}
/**
 * Deserialize sequence of key values (key, value, ...) into an object
 *
 * @param {any} args - key{String}, value{*} sequence
 * @return {Object}
 */


function dict(...args) {
  let o = {};

  for (let i = 0; i < args.length; i++) {
    if (i % 2 !== 0) continue;
    o[args[i]] = args[i + 1];
  }

  return o;
}

module.exports = {
  typeName,
  isUnd,
  isNull,
  isVal,
  isNum,
  isStr,
  isFun,
  isObj,
  isArr,
  isPrim,
  isList,
  isMutableList,
  isSet,
  isMap,
  isError,
  isEl,
  isEls,
  hasField,
  isEmpty,
  Enum,
  dict
};
},{}],"2Pcrs":[function(require,module,exports) {
"use strict";

var _vnode = require("./vnode");

const {
  forEach,
  all
} = require("../core/collections");

const {
  isVal,
  hasField,
  isStr,
  isArr,
  isFun,
  isNum
} = require("../core/types");

const JSS = require("./jss");

function randomId() {
  return Date.now().toString(24).slice(2) + Math.random().toString(24).slice(6);
}

function isComponent(node) {
  return isFun(node.render);
}

function isStatic(node) {
  if (!isComponent(node)) {
    return all(node.nodes, n => isStatic(n));
  } else return false;
}

function isEventPropKey(key) {
  return /on[A-Z]+/.test(key);
}

function normalizeEventName(eventName) {
  return eventName.slice(2).toLowerCase();
}

function compileProps(props) {
  const cats = {
    events: {},
    attrs: {}
  };
  forEach(props, (v, k) => {
    if (isEventPropKey(k)) cats.events[normalizeEventName(k)] = v;else cats.attrs[k] = v;
  });
  return cats;
}

function compileStyles(styles, joinWith) {
  if (!isVal(styles)) return '';else if (isStr(styles)) return styles;else if (isArr(styles)) return styles.join(joinWith);
  return JSS.generateCss(styles, joinWith);
}

function sameClass(t1, t2) {
  let name1 = t1.constructor.name;
  let name2 = t2.name;

  if (hasField(t1, 'prototype')) {
    name1 = t1.prototype.constructor.name;
  }

  if (hasField(t2, 'prototype')) {
    name2 = t2.prototype.constructor.name;
  }

  console.log(name1, name2);
  return name1 === name2;
}

function instanceOf(inst, cls) {
  const instProto = Object.getPrototypeOf(inst);
  const classProto = cls.prototype; // console.log(instProto, classProto)

  return instProto.constructor.name === classProto.constructor.name;
}

function isChildOf(child, parent) {
  const parentProto = parent.prototype || Object.getPrototypeOf(parent);
  const parentName = parentProto.constructor.name;
  let childProto = child.prototype || Object.getPrototypeOf(child);

  while (childProto) {
    if (childProto.name === parentName || childProto.constructor.name === parentName) return true;
    childProto = Object.getPrototypeOf(childProto);
  }

  return false;
}

function renameFunc(fn, name) {
  return new Function("fn", `return function ${name}() {return fn.apply(this, arguments)}`)(fn);
}

function copyPrototype(thing) {
  let props = Object.getOwnPropertyDescriptors(thing);
  let copied = Object.create({});
  Object.defineProperties(copied, props);
  console.log(copied);
  return copied;
}

function prepareChildren(children, after) {
  const flat = [];
  const len = children.length;

  for (let i = 0; i < len; i++) {
    let child = children[i];
    if (child.$tag === 'FRAGMENT') child = child.nodes;

    if (child.constructor.name === 'Array') {
      const clen = child.length;

      for (let j = 0; j < clen; j++) {
        let ch = child[j];

        if (isStr(ch) || isNum(ch)) {
          ch = _vnode.VNode.createText(ch.toString());
        }

        if (after) ch = after(ch);
        flat.push(ch);
      }
    } else {
      if (isStr(child) || isNum(child)) {
        child = _vnode.VNode.createText(child.toString());
      }

      if (after) child = after(child);
      flat.push(child);
    }
  }

  return flat;
}

function swapChildNodes(parent, nodes, newIndex, currentIndex) {
  parent.insertBefore(nodes[newIndex], nodes[currentIndex]);
}

function substituteTextNodes(children) {
  return children.map(ch => {
    if (isStr(ch) || isNum(ch)) {
      return _vnode.VNode.createText(ch.toString());
    } else return ch;
  });
}

module.exports = {
  randomId,
  compileProps,
  compileStyles,
  isComponent,
  isStatic,
  isEventPropKey,
  normalizeEventName,
  sameClass,
  isChildOf,
  instanceOf,
  renameFunc,
  copyPrototype,
  prepareChildren,
  swapChildNodes,
  substituteTextNodes
};
},{"./vnode":"rEOtM","../core/collections":"1hgia","../core/types":"1EuZy","./jss":"3HZBU"}],"3HZBU":[function(require,module,exports) {
const {
  kebab
} = require("../core/cases");

const {
  forEach
} = require("../core/collections");

function generateStyles(jss) {
  let styles = [];
  forEach(jss, (val, prop) => {
    styles.push(`${kebab(prop)}: ${val};`);
  });
  return styles;
}

function generateCss(jss, joinWith = '\n') {
  return generateStyles(jss).sort((a, b) => a[0].localeCompare(b[0])).join(joinWith);
}

module.exports = {
  generateStyles,
  generateCss
};
},{"../core/cases":"4MHLs","../core/collections":"1hgia"}],"4MHLs":[function(require,module,exports) {
/**
 * @module
 * @memberOf core
 */

/**
 * @static
 * @param name
 * @returns {string}
 */
function kebab(name) {
  let kb = "";
  let pres = false;

  for (let i = 0; i < name.length; i++) {
    let c = name.charAt(i);

    if (c === '_') {
      kb += '-';
      pres = true;
      continue;
    }

    if (c >= 'A' && c <= 'Z') {
      if (i > 0 && !pres) {
        kb += '-';
      }
    }

    kb += c.toLowerCase();
    pres = false;
  }

  return kb;
}
/**
 * @static
 * @param name
 * @returns {string}
 */


function snake(name) {
  let snk = "";
  let pres = false;

  for (let i = 0; i < name.length; i++) {
    let c = name.charAt(i);

    if (c === '-') {
      snk += '_';
      pres = true;
      continue;
    }

    if (c >= 'A' && c <= 'Z') {
      if (i > 0 && !pres) {
        snk += '_';
      }
    }

    snk += c.toLowerCase();
    pres = false;
  }

  return snk;
}
/**
 * @static
 * @param name
 * @returns {string}
 */


function camel(name) {
  let cml = "";
  let pres = false;

  for (let i = 0; i < name.length; i++) {
    let c = name.charAt(i);

    if (c === '-' || c === '_') {
      pres = true;
    } else if (pres === true) {
      cml += c.toUpperCase();
      pres = false;
    } else {
      if (i === 0) {
        cml += c.toLowerCase();
      } else {
        cml += c;
      }
    }
  }

  return cml;
}
/**
 * @static
 * @param name
 * @returns {string}
 */


function pascal(name) {
  let psc = "";
  let pres = false;

  for (let i = 0; i < name.length; i++) {
    let c = name.charAt(i);

    if (c === '-' || c === '_') {
      pres = true;
    } else if (pres === true) {
      psc += c.toUpperCase();
      pres = false;
    } else {
      if (i === 0) {
        psc += c.toUpperCase();
      } else {
        psc += c;
      }
    }
  }

  return psc;
}

module.exports = {
  kebab,
  camel,
  pascal,
  snake
};
},{}],"JHwBv":[function(require,module,exports) {
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.a = a;
exports.abbr = abbr;
exports.acronym = acronym;
exports.address = address;
exports.applet = applet;
exports.area = area;
exports.article = article;
exports.aside = aside;
exports.audio = audio;
exports.b = b;
exports.base = base;
exports.basefont = basefont;
exports.bdi = bdi;
exports.bdo = bdo;
exports.bgsound = bgsound;
exports.big = big;
exports.blink = blink;
exports.blockquote = blockquote;
exports.body = body;
exports.br = br;
exports.button = button;
exports.canvas = canvas;
exports.caption = caption;
exports.center = center;
exports.cite = cite;
exports.code = code;
exports.col = col;
exports.colgroup = colgroup;
exports.content = content;
exports.data = data;
exports.datalist = datalist;
exports.dd = dd;
exports.decorator = decorator;
exports.del = del;
exports.details = details;
exports.dfn = dfn;
exports.dir = dir;
exports.div = div;
exports.dl = dl;
exports.dt = dt;
exports.element = element;
exports.em = em;
exports.embed = embed;
exports.fieldset = fieldset;
exports.figcaption = figcaption;
exports.figure = figure;
exports.font = font;
exports.footer = footer;
exports.form = form;
exports.frame = frame;
exports.frameset = frameset;
exports.h1 = h1;
exports.h2 = h2;
exports.h3 = h3;
exports.h4 = h4;
exports.h5 = h5;
exports.h6 = h6;
exports.head = head;
exports.header = header;
exports.hgroup = hgroup;
exports.hr = hr;
exports.html = html;
exports.i = i;
exports.iframe = iframe;
exports.img = img;
exports.input = input;
exports.ins = ins;
exports.isindex = isindex;
exports.kbd = kbd;
exports.keygen = keygen;
exports.label = label;
exports.legend = legend;
exports.li = li;
exports.link = link;
exports.listing = listing;
exports.main = main;
exports.map = map;
exports.mark = mark;
exports.marquee = marquee;
exports.menu = menu;
exports.menuitem = menuitem;
exports.meta = meta;
exports.meter = meter;
exports.nav = nav;
exports.nobr = nobr;
exports.noframes = noframes;
exports.noscript = noscript;
exports.object = object;
exports.ol = ol;
exports.optgroup = optgroup;
exports.option = option;
exports.output = output;
exports.p = p;
exports.param = param;
exports.plaintext = plaintext;
exports.pre = pre;
exports.progress = progress;
exports.q = q;
exports.rp = rp;
exports.rt = rt;
exports.ruby = ruby;
exports.s = s;
exports.samp = samp;
exports.script = script;
exports.section = section;
exports.select = select;
exports.shadow = shadow;
exports.small = small;
exports.source = source;
exports.spacer = spacer;
exports.span = span;
exports.strike = strike;
exports.strong = strong;
exports.style = style;
exports.sub = sub;
exports.summary = summary;
exports.sup = sup;
exports.table = table;
exports.tbody = tbody;
exports.td = td;
exports.template = template;
exports.textarea = textarea;
exports.tfoot = tfoot;
exports.th = th;
exports.thead = thead;
exports.time = time;
exports.title = title;
exports.tr = tr;
exports.track = track;
exports.tt = tt;
exports.u = u;
exports.ul = ul;
exports.video = video;
exports.wbr = wbr;
exports.xmp = xmp;
exports.default = void 0;

var _vnode = require("../vm/vnode");

const e = _vnode.VNode.create;

function a(args, ...children) {
  return e('a', args, ...children);
}

function abbr(args, ...children) {
  return e('abbr', args, ...children);
}

function acronym(args, ...children) {
  return e('acronym', args, ...children);
}

function address(args, ...children) {
  return e('address', args, ...children);
}

function applet(args, ...children) {
  return e('applet', args, ...children);
}

function area(args, ...children) {
  return e('area', args, ...children);
}

function article(args, ...children) {
  return e('article', args, ...children);
}

function aside(args, ...children) {
  return e('aside', args, ...children);
}

function audio(args, ...children) {
  return e('audio', args, ...children);
}

function b(args, ...children) {
  return e('b', args, ...children);
}

function base(args, ...children) {
  return e('base', args, ...children);
}

function basefont(args, ...children) {
  return e('basefont', args, ...children);
}

function bdi(args, ...children) {
  return e('bdi', args, ...children);
}

function bdo(args, ...children) {
  return e('bdo', args, ...children);
}

function bgsound(args, ...children) {
  return e('bgsound', args, ...children);
}

function big(args, ...children) {
  return e('big', args, ...children);
}

function blink(args, ...children) {
  return e('blink', args, ...children);
}

function blockquote(args, ...children) {
  return e('blockquote', args, ...children);
}

function body(args, ...children) {
  return e('body', args, ...children);
}

function br(args, ...children) {
  return e('br', args, ...children);
}

function button(args, ...children) {
  return e('button', args, ...children);
}

function canvas(args, ...children) {
  return e('canvas', args, ...children);
}

function caption(args, ...children) {
  return e('caption', args, ...children);
}

function center(args, ...children) {
  return e('center', args, ...children);
}

function cite(args, ...children) {
  return e('cite', args, ...children);
}

function code(args, ...children) {
  return e('code', args, ...children);
}

function col(args, ...children) {
  return e('col', args, ...children);
}

function colgroup(args, ...children) {
  return e('colgroup', args, ...children);
}

function content(args, ...children) {
  return e('content', args, ...children);
}

function data(args, ...children) {
  return e('data', args, ...children);
}

function datalist(args, ...children) {
  return e('datalist', args, ...children);
}

function dd(args, ...children) {
  return e('dd', args, ...children);
}

function decorator(args, ...children) {
  return e('decorator', args, ...children);
}

function del(args, ...children) {
  return e('del', args, ...children);
}

function details(args, ...children) {
  return e('details', args, ...children);
}

function dfn(args, ...children) {
  return e('dfn', args, ...children);
}

function dir(args, ...children) {
  return e('dir', args, ...children);
}

function div(args, ...children) {
  return e('div', args, ...children);
}

function dl(args, ...children) {
  return e('dl', args, ...children);
}

function dt(args, ...children) {
  return e('dt', args, ...children);
}

function element(args, ...children) {
  return e('element', args, ...children);
}

function em(args, ...children) {
  return e('em', args, ...children);
}

function embed(args, ...children) {
  return e('embed', args, ...children);
}

function fieldset(args, ...children) {
  return e('fieldset', args, ...children);
}

function figcaption(args, ...children) {
  return e('figcaption', args, ...children);
}

function figure(args, ...children) {
  return e('figure', args, ...children);
}

function font(args, ...children) {
  return e('font', args, ...children);
}

function footer(args, ...children) {
  return e('footer', args, ...children);
}

function form(args, ...children) {
  return e('form', args, ...children);
}

function frame(args, ...children) {
  return e('frame', args, ...children);
}

function frameset(args, ...children) {
  return e('frameset', args, ...children);
}

function h1(args, ...children) {
  return e('h1', args, ...children);
}

function h2(args, ...children) {
  return e('h2', args, ...children);
}

function h3(args, ...children) {
  return e('h3', args, ...children);
}

function h4(args, ...children) {
  return e('h4', args, ...children);
}

function h5(args, ...children) {
  return e('h5', args, ...children);
}

function h6(args, ...children) {
  return e('h6', args, ...children);
}

function head(args, ...children) {
  return e('head', args, ...children);
}

function header(args, ...children) {
  return e('header', args, ...children);
}

function hgroup(args, ...children) {
  return e('hgroup', args, ...children);
}

function hr(args, ...children) {
  return e('hr', args, ...children);
}

function html(args, ...children) {
  return e('html', args, ...children);
}

function i(args, ...children) {
  return e('i', args, ...children);
}

function iframe(args, ...children) {
  return e('iframe', args, ...children);
}

function img(args, ...children) {
  return e('img', args, ...children);
}

function input(args, ...children) {
  return e('input', args, ...children);
}

function ins(args, ...children) {
  return e('ins', args, ...children);
}

function isindex(args, ...children) {
  return e('isindex', args, ...children);
}

function kbd(args, ...children) {
  return e('kbd', args, ...children);
}

function keygen(args, ...children) {
  return e('keygen', args, ...children);
}

function label(args, ...children) {
  return e('label', args, ...children);
}

function legend(args, ...children) {
  return e('legend', args, ...children);
}

function li(args, ...children) {
  return e('li', args, ...children);
}

function link(args, ...children) {
  return e('link', args, ...children);
}

function listing(args, ...children) {
  return e('listing', args, ...children);
}

function main(args, ...children) {
  return e('main', args, ...children);
}

function map(args, ...children) {
  return e('map', args, ...children);
}

function mark(args, ...children) {
  return e('mark', args, ...children);
}

function marquee(args, ...children) {
  return e('marquee', args, ...children);
}

function menu(args, ...children) {
  return e('menu', args, ...children);
}

function menuitem(args, ...children) {
  return e('menuitem', args, ...children);
}

function meta(args, ...children) {
  return e('meta', args, ...children);
}

function meter(args, ...children) {
  return e('meter', args, ...children);
}

function nav(args, ...children) {
  return e('nav', args, ...children);
}

function nobr(args, ...children) {
  return e('nobr', args, ...children);
}

function noframes(args, ...children) {
  return e('noframes', args, ...children);
}

function noscript(args, ...children) {
  return e('noscript', args, ...children);
}

function object(args, ...children) {
  return e('object', args, ...children);
}

function ol(args, ...children) {
  return e('ol', args, ...children);
}

function optgroup(args, ...children) {
  return e('optgroup', args, ...children);
}

function option(args, ...children) {
  return e('option', args, ...children);
}

function output(args, ...children) {
  return e('output', args, ...children);
}

function p(args, ...children) {
  return e('p', args, ...children);
}

function param(args, ...children) {
  return e('param', args, ...children);
}

function plaintext(args, ...children) {
  return e('plaintext', args, ...children);
}

function pre(args, ...children) {
  return e('pre', args, ...children);
}

function progress(args, ...children) {
  return e('progress', args, ...children);
}

function q(args, ...children) {
  return e('q', args, ...children);
}

function rp(args, ...children) {
  return e('rp', args, ...children);
}

function rt(args, ...children) {
  return e('rt', args, ...children);
}

function ruby(args, ...children) {
  return e('ruby', args, ...children);
}

function s(args, ...children) {
  return e('s', args, ...children);
}

function samp(args, ...children) {
  return e('samp', args, ...children);
}

function script(args, ...children) {
  return e('script', args, ...children);
}

function section(args, ...children) {
  return e('section', args, ...children);
}

function select(args, ...children) {
  return e('select', args, ...children);
}

function shadow(args, ...children) {
  return e('shadow', args, ...children);
}

function small(args, ...children) {
  return e('small', args, ...children);
}

function source(args, ...children) {
  return e('source', args, ...children);
}

function spacer(args, ...children) {
  return e('spacer', args, ...children);
}

function span(args, ...children) {
  return e('span', args, ...children);
}

function strike(args, ...children) {
  return e('strike', args, ...children);
}

function strong(args, ...children) {
  return e('strong', args, ...children);
}

function style(args, ...children) {
  return e('style', args, ...children);
}

function sub(args, ...children) {
  return e('sub', args, ...children);
}

function summary(args, ...children) {
  return e('summary', args, ...children);
}

function sup(args, ...children) {
  return e('sup', args, ...children);
}

function table(args, ...children) {
  return e('table', args, ...children);
}

function tbody(args, ...children) {
  return e('tbody', args, ...children);
}

function td(args, ...children) {
  return e('td', args, ...children);
}

function template(args, ...children) {
  return e('template', args, ...children);
}

function textarea(args, ...children) {
  return e('textarea', args, ...children);
}

function tfoot(args, ...children) {
  return e('tfoot', args, ...children);
}

function th(args, ...children) {
  return e('th', args, ...children);
}

function thead(args, ...children) {
  return e('thead', args, ...children);
}

function time(args, ...children) {
  return e('time', args, ...children);
}

function title(args, ...children) {
  return e('title', args, ...children);
}

function tr(args, ...children) {
  return e('tr', args, ...children);
}

function track(args, ...children) {
  return e('track', args, ...children);
}

function tt(args, ...children) {
  return e('tt', args, ...children);
}

function u(args, ...children) {
  return e('u', args, ...children);
}

function ul(args, ...children) {
  return e('ul', args, ...children);
}

function video(args, ...children) {
  return e('video', args, ...children);
}

function wbr(args, ...children) {
  return e('wbr', args, ...children);
}

function xmp(args, ...children) {
  return e('xmp', args, ...children);
}

var _default = {
  a,
  abbr,
  acronym,
  address,
  applet,
  area,
  article,
  aside,
  audio,
  b,
  base,
  basefont,
  bdi,
  bdo,
  bgsound,
  big,
  blink,
  blockquote,
  body,
  br,
  button,
  canvas,
  caption,
  center,
  cite,
  code,
  col,
  colgroup,
  content,
  data,
  datalist,
  dd,
  decorator,
  del,
  details,
  dfn,
  dir,
  div,
  dl,
  dt,
  element,
  em,
  embed,
  fieldset,
  figcaption,
  figure,
  font,
  footer,
  form,
  frame,
  frameset,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  head,
  header,
  hgroup,
  hr,
  html,
  i,
  iframe,
  img,
  input,
  ins,
  isindex,
  kbd,
  keygen,
  label,
  legend,
  li,
  link,
  listing,
  main,
  map,
  mark,
  marquee,
  menu,
  menuitem,
  meta,
  meter,
  nav,
  nobr,
  noframes,
  noscript,
  object,
  ol,
  optgroup,
  option,
  output,
  p,
  param,
  plaintext,
  pre,
  progress,
  q,
  rp,
  rt,
  ruby,
  s,
  samp,
  script,
  section,
  select,
  shadow,
  small,
  source,
  spacer,
  span,
  strike,
  strong,
  style,
  sub,
  summary,
  sup,
  table,
  tbody,
  td,
  template,
  textarea,
  tfoot,
  th,
  thead,
  time,
  title,
  tr,
  track,
  tt,
  u,
  ul,
  video,
  wbr,
  xmp,
  e
};
exports.default = _default;
},{"../vm/vnode":"rEOtM"}],"7rP3i":[function(require,module,exports) {
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.View = void 0;

var _vnode = require("./vnode");

var _collections = require("../core/collections");

var _util = require("./util");

var _hscriptEsm = require("./hscript-esm");

var global = arguments[3];

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

class View {
  constructor(opt = {}, construct = opt) {
    this.$name = this.constructor.name;
    this.isView = true;
    this.$constructor = construct;
    let cons = Object.getOwnPropertyNames(this.$constructor);

    for (let i = 0; i < cons.length; i++) {
      const prop = cons[i];

      if (this.$constructor[prop] instanceof Function) {
        this[prop] = this.$constructor[prop]; // console.log('Func',prop)
      } else
        /*if (typeof prop) */
        {
          this[prop] = (0, _collections.deepClone)(this.$constructor[prop]); // console.log('Val',prop)
        }
    }
  }

  render() {
    return "";
  }

  static create(name, opt) {
    let c = new View(opt);
    if (!opt.render) console.warn("render method is not defined");
    c.$name = name;
  }

  createInstance(props, children) {
    const construct = this.$constructor;
    const name = this.$name;
    let inst = new View(construct, construct);
    inst.$name = name;
    return inst.updateInstance(props, children);
  }

  updateInstance(props, children) {
    if (!this.props) this.props = {};
    if (props) (0, _collections.concat)(this.props, props, true);
    if (children) children = (0, _util.prepareChildren)(children);
    this.children = children;
    return this;
  }

}

exports.View = View;

_defineProperty(View, "$type", _vnode.NODETYPE.VIEW);

global.View = View;
},{"./vnode":"rEOtM","../core/collections":"1hgia","./util":"2Pcrs","./hscript-esm":"JHwBv"}],"2RJeN":[function(require,module,exports) {
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.render = render;
exports.renderView = renderView;

var _util = require("./util");

var _vnode = require("./vnode");

var _core = require("../core");

function render(root) {
  if ((0, _core.isStr)(root)) return _vnode.VNode.createText(root);

  if (root.isView) {
    return renderView(root);
  }

  if (root.nodes) {
    root.nodes = root.nodes.map(n => {
      return render(n);
    });
  }

  return root;
}

function renderView(view) {
  try {
    let rendered = view.render.call(view, view.props);
    view.$node = rendered;
    if (rendered.isView) return renderView(rendered);

    if (rendered.nodes) {
      rendered.nodes = (0, _util.prepareChildren)(rendered.nodes, render);
    }

    return view;
  } catch (e) {
    console.log(view, e);
  }
}
},{"./util":"2Pcrs","./vnode":"rEOtM","../core":"1A9AF"}],"1A9AF":[function(require,module,exports) {
let collections = require('./collections');

let logging = require('./logging');

let types = require('./types');

let cases = require('./cases');

let strings = require('./strings');

let queryable = require('./queryable');

let functions = require('./functions');

module.exports = { ...collections,
  ...logging,
  ...types,
  ...cases,
  ...strings,
  ...queryable,
  ...functions
};
/**
 * @namespace core
 */
},{"./collections":"1hgia","./logging":"3xiP7","./types":"1EuZy","./cases":"4MHLs","./strings":"79MxR","./queryable":"1NgFP","./functions":"3UsB2"}],"3xiP7":[function(require,module,exports) {
const {
  Enum
} = require("./types");
/**
 * @module core/logging
 * @memberOf core
 */

/** @private */


function _logTime() {
  let t = new Date();
  return `${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}:${t.getMilliseconds()}`;
}
/** @private */


function _logTitle(flag) {
  return `[${flag}] [${_logTime()}]`;
}
/** @private */


function _prepareLog(args, lt) {
  args.reverse();
  args.push("display: inline-block; font-weight: bold; color: black", "%c" + lt);
  args.reverse();
}
/**
 * @type {Object}
 */


const LogLevels = {
  TRACE: 0,
  INFO: 0,
  WARN: 0,
  ERROR: 0,
  SILENT: 0
};
/**
 * Log config
 * @type {{LogLevel: *}}
 */

const Config = {
  LogLevel: LogLevels.TRACE
};
/** Set `Config.LogLevel` to TRACE */

function showTrace() {
  Config.LogLevel = LogLevels.TRACE;
}
/** Set `Config.LogLevel` to INFO */


function showInfo() {
  Config.LogLevel = LogLevels.INFO;
}
/** Set `Config.LogLevel` to WARN */


function showWarn() {
  Config.LogLevel = LogLevels.WARN;
}
/** Set `Config.LogLevel` to ERROR */


function showError() {
  Config.LogLevel = LogLevels.ERROR;
}
/** Set `Config.LogLevel` to SILENT */


function silent() {
  Config.LogLevel = LogLevels.SILENT;
}
/** Set Config.LogLevel
 * @param l - LogLevel */


function lvl(l) {
  return Config.LogLevel !== LogLevels.SILENT && Config.LogLevel <= l;
}
/**
 * Log Trace
 * @param {any} args
 */


function trace(...args) {
  if (!lvl(LogLevels.TRACE)) return;
  args.reverse();
  args.push(_logTitle("X-TRACE"));
  args.reverse(); // args.push("\n");

  console.trace.apply(this, args);
}
/**
 * Log Info
 * @param {any} args
 */


function info(...args) {
  if (!lvl(LogLevels.INFO)) return;

  _prepareLog(args, _logTitle("X-INFO"));

  console.log.apply(this, args);
}
/**
 * Log Warning
 * @param {any} args
 */


function warn(...args) {
  if (!lvl(LogLevels.WARN)) return;

  _prepareLog(args, _logTitle("X-WARN"));

  console.warn.apply(this, args);
}
/**
 * Log Error
 * @param {any} args
 */


function error(...args) {
  if (!lvl(LogLevels.ERROR)) return;

  _prepareLog(args, _logTitle("X-ERROR"));

  console.error.apply(this, args);
}

module.exports = {
  Config,
  LogLevels,
  showTrace,
  showInfo,
  showWarn,
  showError,
  silent,
  trace,
  info,
  warn,
  error
};
},{"./types":"1EuZy"}],"79MxR":[function(require,module,exports) {
const decimalRegex = /^[-+]?\d*(\.\d+|\d*)(e[-+]?\d+)?$/;
const hexRegex = /^[-+]?[a-f0-9]+$/;
const octRegex = /^[-+]?[0][0-7]+$/;
const binRegex = /^[-+]?[01]+$/;
const emailRegex = /^[a-z0-9]([a-z0-9._%-+][a-z0-9]|[a-z0-9])*@[a-z0-9]([a-z0-9.-][a-z0-9]|[a-z0-9])*\.[a-z]{2,6}$/i;
/**
 * @module core/strings
 * @memberOf core
 */

/**
 * String is decimal number
 * @param {String} str
 * @return {boolean}
 */

function isDecimal(str) {
  return decimalRegex.test(str);
}
/**
 * String is binary number
 * @param {String} str
 * @return {boolean}
 */


function isBinary(str) {
  return binRegex.test(str);
}
/**
 * String is octal number
 * @param {String} str
 * @return {boolean}
 */


function isOctal(str) {
  return octRegex.test(str);
}
/**
 * String is hexadecimal number
 * @param {String} str
 * @return {boolean}
 */


function isHex(str) {
  return hexRegex.test(str);
}
/**
 * String is valid email address
 * @param {String} str
 * @return {boolean}
 */


function isEmail(str) {
  return emailRegex.test(str);
}
/**
 * String starts with sequence polyfill
 * @param {String} str
 * @param {String} seq
 * @return {boolean}
 */


function startsWith(str, seq) {
  return str.indexOf(seq) === 0;
}
/**
 * String ends with sequence polyfill
 * @param {String} str
 * @param {String} seq
 * @return {boolean}
 */


function endsWith(str, seq) {
  return str.indexOf(seq) === seq.length - 1;
}
/**
 * String contains sequence
 * @param {String} str
 * @param {String} seq
 * @return {boolean}
 */


function contains(str, seq) {
  return str.indexOf(seq) >= 0;
}

module.exports = {
  isDecimal,
  isHex,
  isOctal,
  isBinary,
  isEmail,
  startsWith,
  endsWith,
  contains
};
},{}],"1NgFP":[function(require,module,exports) {
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

const T = require("./types");

class Queryable {
  constructor() {
    _defineProperty(this, "__src__", void 0);

    _defineProperty(this, "keys", void 0);
  }

  get count() {
    return this.keys.length;
  }

  static of(s) {
    let c = new Queryable();
    c.__src__ = s;
    c.keys = Object.keys(s);
    c.len = c.keys.length;
    return c;
  }

  slice(start = 0, end = this.count - 1) {
    this.keys = this.keys.slice(start, end);
  }

  key(i = 0) {
    return this.keys[i];
  }

  value(i = 0) {
    return this.__src__[this.key(i)];
  }

  loop(f, reverse = false) {
    if (reverse) {
      for (let i = this.count - 1; i >= 0; i--) {
        if (f(this.value(i), this.key(i), i) === null) break;
      }
    } else {
      for (let i = 0; i < this.count; i++) {
        if (f(this.value(i), this.key(i), i) === null) break;
      }
    }

    return this;
  }

  values(reverse = false) {
    let vs = [];
    this.loop(function (v, k, i) {
      vs.push(v);
    }, reverse);
    return vs;
  }

  item(i) {
    if (i === undefined) return undefined;
    if (T.isArr(this.__src__)) return this.value(i);
    let o = {};
    o[this.key(i)] = this.value(i);
    return o;
  }

  asObject() {
    // if (T.isArr(this.__src__)) return this.values();
    let o = {};
    this.loop(function (v, k, i) {
      o[k] = v;
    });
    return o;
  }

  asArray(reverse = false) {
    return this.values(reverse);
  }

  filter(f, reverse = false) {
    let nk = [];
    this.loop(function (v, k, i) {
      let r = f(v, k, i);

      if (r === true) {
        nk.push(k);
      } else if (r === null) return null;
    }, reverse);
    this.keys = nk;
    return this;
  }

  map(f, reverse = false) {
    let arr = [];
    this.loop(function (v, k, i) {
      arr.push(f(v, k, i));
    }, reverse);
    return arr;
  }

  any(f) {
    let r = false;
    this.loop(function (v, k, i) {
      r = f(v, k, i);

      if (r === true) {
        return null;
      }
    });
    return r;
  }

  all(f) {
    let r = true;
    this.loop(function (v, k, i) {
      r = f(v, k, i);

      if (r === false) {
        return null;
      }
    });
    return r;
  }

  first(f) {
    if (!f) {
      return this.item(0);
    }

    let it;
    this.loop(function (v, k, i) {
      if (f(v, k, i) === true) {
        it = i;
        return null;
      }
    });
    return this.item(it);
  }

  last(f) {
    if (!f) {
      return this.item(this.count - 1);
    }

    let it;
    this.loop(function (v, k, i) {
      if (f(v, k, i) === true) {
        it = i;
        return null;
      }
    }, true);
    return this.item(it);
  }

}

module.exports = {
  Queryable
};
},{"./types":"1EuZy"}],"3UsB2":[function(require,module,exports) {
/**
 * @module
 * @memberOf core
 */
function bodyOf(func) {
  return func.toString().match(/{[\w\W]*}/)[0];
}
/**
 * Check if function bodies are equal
 * @param {Function} f1
 * @param {Function} f2
 * @return {boolean}
 */


function funcBodyEquals(f1, f2) {
  return bodyOf(f1) === bodyOf(f2);
}
/**
 * Throttle function execution.
 * {@link https://css-tricks.com/debouncing-throttling-explained-examples/}
 *
 * @param {Function} func - function
 * @param {Number} intervalMs
 * @return {Function} - throttled function
 */


function throttle(func, intervalMs) {
  var ___last___ = new Date().getTime();

  function throttled(args) {
    if (new Date().getTime() - ___last___ >= intervalMs) {
      ___last___ = new Date().getTime();
      func.call(this, args);
    }
  }

  return throttled;
}
/**
 * Debounce function execution.
 * {@link https://css-tricks.com/debouncing-throttling-explained-examples/}
 *
 * @param {Function} func - function
 * @param {Number} afterMs - milliseconds after last call
 * @return {Function} - debounced function
 */


function debounce(func, afterMs) {
  var ___timeout___ = null;

  function debounced(...args) {
    clearTimeout(___timeout___);
    ___timeout___ = setTimeout(function (_this) {
      return func.apply(_this, args);
    }, afterMs, this);
  }

  debounced.flush = function (...args) {
    clearTimeout(___timeout___);
    return func.apply(this, args);
  };

  return debounced;
}
/**
 * Bind args to function and return a no-arg function
 * @param {Function} func - source function
 * @param {any[]} args - array of arguments to bind
 * @return {Function}
 */


function bindArgs(func, args) {
  return function () {
    return func.apply(this, args);
  };
}

function once(func) {
  var called = false;
  return function () {
    if (!called) {
      called = true;
      return func.apply(this, arguments);
    }
  };
}

module.exports = {
  funcBodyEquals,
  throttle,
  debounce,
  bindArgs,
  once
};
},{}],"18HlE":[function(require,module,exports) {
"use strict";

require("../../vm/view");

var _vnode = require("../../vm/vnode");

var _hscriptEsm = require("../../vm/hscript-esm");

var global = arguments[3];
let V = new View('Vi', {
  props: {
    a: 0
  },

  onCreate() {
    console.log('hi');
  },

  render() {
    return (0, _hscriptEsm.div)({}, this.props.a);
  }

});

class Z extends View {
  constructor() {
    super();
  }

  render() {
    return _vnode.VNode.create(V, {}, (0, _hscriptEsm.div)({}, "Z tag"));
  }

} // let Zi = new Z()


global.Z = Z;
global.V = V; // console.log(Zi.createInstance({a:2}).createInstance({b: 77}))
},{"../../vm/view":"7rP3i","../../vm/vnode":"rEOtM","../../vm/hscript-esm":"JHwBv"}]},{},["6VwQK","6Fg91"], "6Fg91", "parcelRequire430d")

//# sourceMappingURL=app.js.map
