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EAAM,MAAO,KAC9D,IAAI,KAAK,KAAK,WAAW,KAAK,KAAM,EAAS,EAAY,GAE7D,CAEA,SAAS,OAAO,GACd,GACF,CAEA,SAAS,cAAc,GACrB,OAAO,OAAS,EAAM,SACxB,CAEA,SAAS,QAAQ,EAAS,EAAY,GACpC,IAAI,EAAK,KACT,GAAK,GAAI,EAAG,YAAa,OAAO,QACzB,EAAK,EAAG,YAEf,OADA,WAAW,WAAW,KAAK,KAAM,EAAS,EAAY,KAC/C,CACT,CA7CK,IAAI,SACP,SAAS,iBAAiB,IAAI,KAAM,KAAK","file":"/npm/hyperhtml-element@3.15.2/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/hyperhtml-element@3.15.2/cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n/*! (C) 2017-2018 Andrea Giammarchi - ISC Style License */\n\nconst {Component, bind, define, hyper, wire} = require('hyperhtml');\n\n// utils to deal with custom elements builtin extends\nconst ATTRIBUTE_CHANGED_CALLBACK = 'attributeChangedCallback';\nconst O = Object;\nconst classes = [];\nconst defineProperty = O.defineProperty;\nconst getOwnPropertyDescriptor = O.getOwnPropertyDescriptor;\nconst getOwnPropertyNames = O.getOwnPropertyNames;\n/* istanbul ignore next */\nconst getOwnPropertySymbols = O.getOwnPropertySymbols || (() => []);\n/* istanbul ignore next */\nconst getPrototypeOf = O.getPrototypeOf || (o => o.__proto__);\n/* istanbul ignore next */\nconst ownKeys = typeof Reflect === 'object' && Reflect.ownKeys ||\n                (o => getOwnPropertyNames(o).concat(getOwnPropertySymbols(o)));\n/* istanbul ignore next */\nconst setPrototypeOf = O.setPrototypeOf ||\n                      ((o, p) => (o.__proto__ = p, o));\n/* istanbul ignore stop */\nconst camel = name => name.replace(/-([a-z])/g, ($0, $1) => $1.toUpperCase());\nconst {attachShadow} = HTMLElement.prototype;\nconst sr = new WeakMap;\n\nclass HyperHTMLElement extends HTMLElement {\n\n  // define a custom-element in the CustomElementsRegistry\n  // class MyEl extends HyperHTMLElement {}\n  // MyEl.define('my-el');\n  static define(name, options) {\n    const Class = this;\n    const proto = Class.prototype;\n\n    const onChanged = proto[ATTRIBUTE_CHANGED_CALLBACK];\n    const hasChange = !!onChanged;\n\n    // Class.booleanAttributes\n    // -----------------------------------------------\n    // attributes defined as boolean will have\n    // an either available or not available attribute\n    // regardless of the value.\n    // All falsy values, or \"false\", mean attribute removed\n    // while truthy values will be set as is.\n    // Boolean attributes are also automatically observed.\n    const booleanAttributes = Class.booleanAttributes || [];\n    booleanAttributes.forEach(attribute => {\n      const name = camel(attribute);\n      if (!(name in proto)) defineProperty(\n        proto,\n        name,\n        {\n          configurable: true,\n          get() {\n            return this.hasAttribute(attribute);\n          },\n          set(value) {\n            if (!value || value === 'false')\n              this.removeAttribute(attribute);\n            else\n              this.setAttribute(attribute, '');\n          }\n        }\n      );\n    });\n\n    // Class.observedAttributes\n    // -------------------------------------------------------\n    // HyperHTMLElement will directly reflect get/setAttribute\n    // operation once these attributes are used, example:\n    // el.observed = 123;\n    // will automatically do\n    // el.setAttribute('observed', 123);\n    // triggering also the attributeChangedCallback\n    const observedAttributes = (Class.observedAttributes || []).filter(\n      attribute => booleanAttributes.indexOf(attribute) < 0\n    );\n    observedAttributes.forEach(attribute => {\n      // it is possible to redefine the behavior at any time\n      // simply overwriting get prop() and set prop(value)\n      const name = camel(attribute);\n      if (!(name in proto)) defineProperty(\n        proto,\n        name,\n        {\n          configurable: true,\n          get() {\n            return this.getAttribute(attribute);\n          },\n          set(value) {\n            if (value == null)\n              this.removeAttribute(attribute);\n            else\n              this.setAttribute(attribute, value);\n          }\n        }\n      );\n    });\n\n    // if these are defined, overwrite the observedAttributes getter\n    // to include also booleanAttributes\n    const attributes = booleanAttributes.concat(observedAttributes);\n    if (attributes.length)\n      defineProperty(Class, 'observedAttributes', {\n        get() { return attributes; }\n      });\n\n    // created() {}\n    // ---------------------------------\n    // an initializer method that grants\n    // the node is fully known to the browser.\n    // It is ensured to run either after DOMContentLoaded,\n    // or once there is a next sibling (stream-friendly) so that\n    // you have full access to element attributes and/or childNodes.\n    const created = proto.created || function () {\n      this.render();\n    };\n\n    // used to ensure create() is called once and once only\n    defineProperty(\n      proto,\n      '_init$',\n      {\n        configurable: true,\n        writable: true,\n        value: true\n      }\n    );\n\n    defineProperty(\n      proto,\n      ATTRIBUTE_CHANGED_CALLBACK,\n      {\n        configurable: true,\n        value: function aCC(name, prev, curr) {\n          if (this._init$) {\n            checkReady.call(this, created, attributes, booleanAttributes);\n            if (this._init$)\n              return this._init$$.push(aCC.bind(this, name, prev, curr));\n          }\n          // ensure setting same value twice\n          // won't trigger twice attributeChangedCallback\n          if (hasChange && prev !== curr) {\n            onChanged.apply(this, arguments);\n          }\n        }\n      }\n    );\n\n    const onConnected = proto.connectedCallback;\n    const hasConnect = !!onConnected;\n    defineProperty(\n      proto,\n      'connectedCallback',\n      {\n        configurable: true,\n        value: function cC() {\n          if (this._init$) {\n            checkReady.call(this, created, attributes, booleanAttributes);\n            if (this._init$)\n              return this._init$$.push(cC.bind(this));\n          }\n          if (hasConnect) {\n            onConnected.apply(this, arguments);\n          }\n        }\n      }\n    );\n\n    // define lazily all handlers\n    // class { handleClick() { ... }\n    // render() { `<a onclick=${this.handleClick}>` } }\n    getOwnPropertyNames(proto).forEach(key => {\n      if (/^handle[A-Z]/.test(key)) {\n        const _key$ = '_' + key + '$';\n        const method = proto[key];\n        defineProperty(proto, key, {\n          configurable: true,\n          get() {\n            return  this[_key$] ||\n                    (this[_key$] = method.bind(this));\n          }\n        });\n      }\n    });\n\n    // whenever you want to directly use the component itself\n    // as EventListener, you can pass it directly.\n    // https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38\n    //  class Reactive extends HyperHTMLElement {\n    //    oninput(e) { console.log(this, 'changed', e.target.value); }\n    //    render() { this.html`<input oninput=\"${this}\">`; }\n    //  }\n    if (!('handleEvent' in proto)) {\n      defineProperty(\n        proto,\n        'handleEvent',\n        {\n          configurable: true,\n          value(event) {\n            this[\n              (event.currentTarget.dataset || {}).call ||\n              ('on' + event.type)\n            ](event);\n          }\n        }\n      );\n    }\n\n    if (options && options.extends) {\n      const Native = document.createElement(options.extends).constructor;\n      const Intermediate = class extends Native {};\n      const ckeys = ['length', 'name', 'arguments', 'caller', 'prototype'];\n      const pkeys = [];\n      let Super = null;\n      let BaseClass = Class;\n      while (Super = getPrototypeOf(BaseClass)) {\n        [\n          {target: Intermediate, base: Super, keys: ckeys},\n          {target: Intermediate.prototype, base: Super.prototype, keys: pkeys}\n        ]\n        .forEach(({target, base, keys}) => {\n          ownKeys(base)\n            .filter(key => keys.indexOf(key) < 0)\n            .forEach((key) => {\n              keys.push(key);\n              defineProperty(\n                target,\n                key,\n                getOwnPropertyDescriptor(base, key)\n              );\n            });\n        });\n\n        BaseClass = Super;\n        if (Super === HyperHTMLElement)\n          break;\n      }\n      setPrototypeOf(Class, Intermediate);\n      setPrototypeOf(proto, Intermediate.prototype);\n      customElements.define(name, Class, options);\n    } else {\n      customElements.define(name, Class);\n    }\n    classes.push(Class);\n    return Class;\n  }\n\n  // weakly relate the shadowRoot for refs usage\n  attachShadow() {\n    const shadowRoot = attachShadow.apply(this, arguments);\n    sr.set(this, shadowRoot);\n    return shadowRoot;\n  }\n\n  // returns elements by ref\n  get refs() {\n    const value = {};\n    if ('_html$' in this) {\n      const all = (sr.get(this) || this).querySelectorAll('[ref]');\n      for (let {length} = all, i = 0; i < length; i++) {\n        const node = all[i];\n        value[node.getAttribute('ref')] = node;\n      }\n      Object.defineProperty(this, 'refs', {value});\n      return value;\n    }\n    return value;\n  }\n\n  // lazily bind once hyperHTML logic\n  // to either the shadowRoot, if present and open,\n  // the _shadowRoot property, if set due closed shadow root,\n  // or the custom-element itself if no Shadow DOM is used.\n  get html() {\n    return this._html$ || (this.html = bind(\n      // in a way or another, bind to the right node\n      // backward compatible, first two could probably go already\n      this.shadowRoot || this._shadowRoot || sr.get(this) || this\n    ));\n  }\n\n  // it can be set too if necessary, it won't invoke render()\n  set html(value) {\n    defineProperty(this, '_html$', {configurable: true, value: value});\n  }\n\n  // overwrite this method with your own render\n  render() {}\n\n  // ---------------------//\n  // Basic State Handling //\n  // ---------------------//\n\n  // define the default state object\n  // you could use observed properties too\n  get defaultState() { return {}; }\n\n  // the state with a default\n  get state() {\n    return this._state$ || (this.state = this.defaultState);\n  }\n\n  // it can be set too if necessary, it won't invoke render()\n  set state(value) {\n    defineProperty(this, '_state$', {configurable: true, value: value});\n  }\n\n  // currently a state is a shallow copy, like in Preact or other libraries.\n  // after the state is updated, the render() method will be invoked.\n  // ⚠️ do not ever call this.setState() inside this.render()\n  setState(state, render) {\n    const target = this.state;\n    const source = typeof state === 'function' ? state.call(this, target) : state;\n    for (const key in source) target[key] = source[key];\n    if (render !== false) this.render();\n    return this;\n  }\n\n};\n\n// exposing hyperHTML utilities\nHyperHTMLElement.Component = Component;\nHyperHTMLElement.bind = bind;\nHyperHTMLElement.intent = define;\nHyperHTMLElement.wire = wire;\nHyperHTMLElement.hyper = hyper;\n\ntry {\n  if (Symbol.hasInstance) classes.push(\n    defineProperty(HyperHTMLElement, Symbol.hasInstance, {\n      enumerable: false,\n      configurable: true,\n      value(instance) {\n        return classes.some(isPrototypeOf, getPrototypeOf(instance));\n      }\n    }));\n} catch(meh) {}\n\nObject.defineProperty(exports, '__esModule', {value: true}).default = HyperHTMLElement;\n\n// ------------------------------//\n// DOMContentLoaded VS created() //\n// ------------------------------//\nconst dom = {\n  type: 'DOMContentLoaded',\n  handleEvent() {\n    if (dom.ready()) {\n      document.removeEventListener(dom.type, dom, false);\n      dom.list.splice(0).forEach(invoke);\n    }\n    else\n      setTimeout(dom.handleEvent);\n  },\n  ready() {\n    return document.readyState === 'complete';\n  },\n  list: []\n};\n\nif (!dom.ready()) {\n  document.addEventListener(dom.type, dom, false);\n}\n\nfunction checkReady(created, attributes, booleanAttributes) {\n  if (dom.ready() || isReady.call(this, created, attributes, booleanAttributes)) {\n    if (this._init$) {\n      const list = this._init$$ || [];\n      delete this._init$$;\n      const self = defineProperty(this, '_init$', {value: false});\n      booleanAttributes.forEach(name => {\n        if (self.getAttribute(name) === 'false')\n          self.removeAttribute(name);\n      });\n      attributes.forEach(name => {\n        if (self.hasOwnProperty(name)) {\n          const curr = self[name];\n          delete self[name];\n          list.unshift(() => { self[name] = curr; });\n        }\n      });\n      created.call(self);\n      list.forEach(invoke);\n    }\n  } else {\n    if (!this.hasOwnProperty('_init$$'))\n      defineProperty(this, '_init$$', {configurable: true, value: []});\n    dom.list.push(checkReady.bind(this, created, attributes, booleanAttributes));\n  }\n}\n\nfunction invoke(fn) {\n  fn();\n}\n\nfunction isPrototypeOf(Class) {\n  return this === Class.prototype;\n}\n\nfunction isReady(created, attributes, booleanAttributes) {\n  let el = this;\n  do { if (el.nextSibling) return true; }\n  while (el = el.parentNode);\n  setTimeout(checkReady.bind(this, created, attributes, booleanAttributes));\n  return false;\n}\n"]}