{"version":3,"file":"omi.cjs","sources":["../src/utils.ts","../src/construct-style-sheets-polyfill.ts","../src/vdom.ts","../src/constants.ts","../src/directive.ts","../src/dom.ts","../src/diff.ts","../src/options.ts","../src/define.ts","../src/component.ts","../src/class.ts","../src/css-tag.ts","../src/render.ts","../src/index.ts"],"sourcesContent":["import { ExtendedElement } from './dom'\nimport { ObjectVNode, VNode } from './vdom'\nimport './construct-style-sheets-polyfill'\nimport { Component } from './component'\n\n/**\n * Check if the environment has native custom elements support\n * and apply a shim for the HTMLElement constructor if needed.\n */\n;(function () {\n  const w = typeof window !== 'undefined' ? window : (global as any)\n  if (\n    w.Reflect === undefined ||\n    w.customElements === undefined ||\n    w.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n  ) {\n    return\n  }\n  const BuiltInHTMLElement = w.HTMLElement\n  w.HTMLElement = function HTMLElement() {\n    return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n  }\n  HTMLElement.prototype = BuiltInHTMLElement.prototype\n  HTMLElement.prototype.constructor = HTMLElement\n  Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\n/**\n * Convert a kebab-case string to camelCase.\n * @param str - The kebab-case string to convert.\n * @returns The camelCase version of the input string.\n */\nexport function camelCase(str: string): string {\n  return str.replace(/-(\\w)/g, (_, $1) => $1.toUpperCase())\n}\n\n/**\n * A functional component that renders its children.\n * @param props - The component's props.\n * @returns The component's children.\n */\nexport function Fragment(props: { children: any }): any {\n  return props.children\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param ref - The ref to apply.\n * @param value - The value to set or pass to the ref.\n */\nexport function applyRef(\n  ref: ((value: any) => void) | { current: any } | null,\n  value: any,\n): void {\n  if (ref != null) {\n    if (typeof ref == 'function') ref(value)\n    else ref.current = value\n  }\n}\n\n/**\n * Check if the given object is an array.\n * @param obj - The object to check.\n * @returns True if the object is an array, false otherwise.\n */\nexport function isArray(obj: unknown): boolean {\n  return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nconst hyphenateRE = /\\B([A-Z])/g\n\n/**\n * Convert a camelCase string to kebab-case.\n * @param str - The camelCase string to convert.\n * @returns The kebab-case version of the input string.\n */\nexport function hyphenate(str: string): string {\n  return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\n/**\n * Capitalize the first letter of each word in a kebab-case string.\n * @param name - The kebab-case string to capitalize.\n * @returns The capitalized version of the input string.\n */\nexport function capitalize(name: string): string {\n  return name\n    .replace(/\\-(\\w)/g, (_, letter) => letter.toUpperCase())\n    .replace(/^\\S/, (s) => s.toUpperCase())\n}\n\n/**\n * Create a new CSSStyleSheet with the given style.\n * @param style - The CSS style to apply to the new stylesheet.\n * @returns The created CSSStyleSheet.\n */\nexport function createStyleSheet(style: string): CSSStyleSheet {\n  const styleSheet = new CSSStyleSheet()\n  styleSheet.replaceSync(style)\n  return styleSheet\n}\n\n/**\n * Check if two nodes are equivalent.\n * @param node - The DOM Node to compare.\n * @param vnode - The virtual DOM node to compare.\n * @param hydrating - If true, ignores component constructors when comparing.\n * @returns True if the nodes are equivalent, false otherwise.\n */\nexport function isSameNodeType(node: ExtendedElement, vnode: VNode): boolean {\n  if (typeof vnode === 'string' || typeof vnode === 'number') {\n    return node.splitText !== undefined\n  }\n\n  return isNamedNode(node, (vnode as ObjectVNode).nodeName as string)\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n * @param node - The DOM Element to inspect the name of.\n * @param nodeName - The unnormalized name to compare against.\n * @returns True if the element has the given nodeName, false otherwise.\n */\nexport function isNamedNode(node: ExtendedElement, nodeName: string): boolean {\n  return (\n    node.normalizedNodeName === nodeName ||\n    node.nodeName.toLowerCase() === nodeName.toLowerCase()\n  )\n}\n\nexport function createRef() {\n  return {}\n}\n\nexport function bind(\n  target: unknown,\n  propertyKey: string,\n  descriptor: PropertyDescriptor,\n) {\n  return {\n    configurable: true,\n    get() {\n      const bound = descriptor.value.bind(this)\n      Object.defineProperty(this, propertyKey, {\n        value: bound,\n        configurable: true,\n        writable: true,\n      })\n      return bound\n    },\n  }\n}\n\nexport function isObject(item: any) {\n  return typeof item === 'object' && !Array.isArray(item) && item !== null\n}\n// 判断对象是否是一个类\nexport function isClass(cls: any): boolean {\n  let result = false\n  if (typeof cls === 'function' && cls.prototype) {\n    try {\n      cls.arguments && cls.caller\n    } catch (e) {\n      result = true\n    }\n  }\n  return result\n}\n\nexport interface GetClassStaticValueOptions {\n  merge?: 'none' | 'merge' | 'uniqueMerge' // 指定合并策略\n  default?: any // 当不存在时提供一个默认值\n}\n/**\n *\n * 获取继承链上指定字段的值\n * 获取类的静态变量值,会沿继承链向上查找,并能自动合并数组和{}值\n *\n * calss A{\n *     static settings={a:1}\n * }\n * calss A1 extends A{\n *     static settings={b:2}\n * }\n *\n * getStaticFieldValue(new A1(),\"settings\") ==== {a:1,b:2}\n *\n * @param instanceOrClass\n * @param fieldName\n * @param options\n */\nexport function getClassStaticValue(\n  instanceOrClass: object,\n  fieldName: string,\n  options?: GetClassStaticValueOptions,\n) {\n  const opts = Object.assign(\n    {\n      // 是否进行合并,0-代表不合并,也就是不会从原型链中读取,1-使用Object.assign合并,2-使用mergeDeepRigth合并\n      // 对数组,0-不合并,1-合并数组,   2-合并且删除重复项\n      merge: 'uniqueMerge',\n      default: null, // 提供默认值,如果{}和[],会使用上述的合并策略\n    },\n    options,\n  ) as Required<GetClassStaticValueOptions>\n\n  let proto = isClass(instanceOrClass)\n    ? instanceOrClass\n    : instanceOrClass.constructor\n  let fieldValue = (proto as any)[fieldName]\n  // 0-{}, 1-[], 2-其他类型\n  let valueType = isObject(fieldValue) ? 0 : Array.isArray(fieldValue) ? 1 : 2\n  // 如果不是数组或者{},则不需要在继承链上进行合并\n  if (opts.merge === 'none' || valueType === 2) {\n    return fieldValue\n  }\n\n  const defaultValue =\n    valueType === 0 ? Object.assign({}, opts.default) : opts.default\n\n  let values = [fieldValue]\n\n  // 依次读取继承链上的所有同名的字段值\n  while (proto) {\n    proto = (proto as any).__proto__\n    if ((proto as any)[fieldName]) {\n      values.push((proto as any)[fieldName])\n    } else {\n      break\n    }\n  }\n  // 进行合并\n  let mergedResult = fieldValue\n  if (valueType === 0) {\n    // Object\n    mergedResult = values.reduce((result, item) => {\n      if (isObject(item)) {\n        // 只能合并字典\n        return opts.merge === 'merge'\n          ? Object.assign({}, defaultValue, item, result)\n          : Object.assign({}, defaultValue, item, result)\n      } else {\n        return result\n      }\n    }, {})\n  } else {\n    // 数组\n    mergedResult = values.reduce((result, item) => {\n      if (Array.isArray(item)) {\n        // 只能合并数组\n        result.push(...item)\n      }\n      return result\n    }, [])\n  }\n  // 删除数组中的重复项\n  if (Array.isArray(mergedResult) && opts.merge === 'uniqueMerge') {\n    mergedResult = Array.from(new Set(mergedResult))\n    // 如果提供defaultValue并且数组成员是一个{},则进行合并\n    if (isObject(defaultValue)) {\n      mergedResult.forEach((value: any, index: number) => {\n        if (isObject(value)) {\n          mergedResult[index] = Object.assign({}, defaultValue, value)\n        }\n      })\n    }\n  }\n  return mergedResult || defaultValue\n}\n","// @ts-nocheck\n\n;(function () {\n  'use strict'\n\n  if (typeof document === 'undefined' || 'adoptedStyleSheets' in document) {\n    return\n  }\n\n  var hasShadyCss = 'ShadyCSS' in window && !ShadyCSS.nativeShadow\n  var bootstrapper = document.implementation.createHTMLDocument('boot')\n  var closedShadowRootRegistry = new WeakMap()\n  var _DOMException = typeof DOMException === 'object' ? Error : DOMException\n\n  var defineProperty = Object.defineProperty\n  var forEach = Array.prototype.forEach\n  var importPattern = /@import.+?;?$/gm\n  function rejectImports(contents) {\n    var _contents = contents.replace(importPattern, '')\n    if (_contents !== contents) {\n      console.warn(\n        '@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418',\n      )\n    }\n    return _contents.trim()\n  }\n  function clearRules(sheet) {\n    for (var i = 0; i < sheet.cssRules.length; i++) {\n      sheet.deleteRule(0)\n    }\n  }\n  function insertAllRules(from, to) {\n    forEach.call(from.cssRules, function (rule, i) {\n      to.insertRule(rule.cssText, i)\n    })\n  }\n  function isElementConnected(element) {\n    return 'isConnected' in element\n      ? element.isConnected\n      : document.contains(element)\n  }\n  function unique(arr) {\n    return arr.filter(function (value, index) {\n      return arr.indexOf(value) === index\n    })\n  }\n  function diff(arr1, arr2) {\n    return arr1.filter(function (value) {\n      return arr2.indexOf(value) === -1\n    })\n  }\n  function removeNode(node) {\n    node.parentNode.removeChild(node)\n  }\n  function getShadowRoot(element) {\n    return element.shadowRoot || closedShadowRootRegistry.get(element)\n  }\n\n  var cssStyleSheetMethods = [\n    'addImport',\n    'addPageRule',\n    'addRule',\n    'deleteRule',\n    'insertRule',\n    'removeImport',\n    'removeRule',\n  ]\n  var NonConstructedStyleSheet = CSSStyleSheet\n  var nonConstructedProto = NonConstructedStyleSheet.prototype\n  nonConstructedProto.replace = function () {\n    return Promise.reject(\n      new _DOMException(\n        'Can\\'t call replace on non-constructed CSSStyleSheets.',\n      ),\n    )\n  }\n  nonConstructedProto.replaceSync = function () {\n    throw new _DOMException(\n      'Failed to execute \\'replaceSync\\' on \\'CSSStyleSheet\\': Can\\'t call replaceSync on non-constructed CSSStyleSheets.',\n    )\n  }\n  function isCSSStyleSheetInstance(instance) {\n    return typeof instance === 'object'\n      ? proto$2.isPrototypeOf(instance) ||\n          nonConstructedProto.isPrototypeOf(instance)\n      : false\n  }\n  function isNonConstructedStyleSheetInstance(instance) {\n    return typeof instance === 'object'\n      ? nonConstructedProto.isPrototypeOf(instance)\n      : false\n  }\n  var $basicStyleSheet = new WeakMap()\n  var $locations = new WeakMap()\n  var $adoptersByLocation = new WeakMap()\n  function addAdopterLocation(sheet, location) {\n    var adopter = document.createElement('style')\n    $adoptersByLocation.get(sheet).set(location, adopter)\n    $locations.get(sheet).push(location)\n    return adopter\n  }\n  function getAdopterByLocation(sheet, location) {\n    return $adoptersByLocation.get(sheet).get(location)\n  }\n  function removeAdopterLocation(sheet, location) {\n    $adoptersByLocation.get(sheet).delete(location)\n    $locations.set(\n      sheet,\n      $locations.get(sheet).filter(function (_location) {\n        return _location !== location\n      }),\n    )\n  }\n  function restyleAdopter(sheet, adopter) {\n    requestAnimationFrame(function () {\n      clearRules(adopter.sheet)\n      insertAllRules($basicStyleSheet.get(sheet), adopter.sheet)\n    })\n  }\n  function checkInvocationCorrectness(self) {\n    if (!$basicStyleSheet.has(self)) {\n      throw new TypeError('Illegal invocation')\n    }\n  }\n  function ConstructedStyleSheet() {\n    var self = this\n    var style = document.createElement('style')\n    bootstrapper.body.appendChild(style)\n    $basicStyleSheet.set(self, style.sheet)\n    $locations.set(self, [])\n    $adoptersByLocation.set(self, new WeakMap())\n  }\n  var proto$2 = ConstructedStyleSheet.prototype\n  proto$2.replace = function replace(contents) {\n    try {\n      this.replaceSync(contents)\n      return Promise.resolve(this)\n    } catch (e) {\n      return Promise.reject(e)\n    }\n  }\n  proto$2.replaceSync = function replaceSync(contents) {\n    checkInvocationCorrectness(this)\n    if (typeof contents === 'string') {\n      var self_1 = this\n      var style = $basicStyleSheet.get(self_1).ownerNode\n      style.textContent = rejectImports(contents)\n      $basicStyleSheet.set(self_1, style.sheet)\n      $locations.get(self_1).forEach(function (location) {\n        if (location.isConnected()) {\n          restyleAdopter(self_1, getAdopterByLocation(self_1, location))\n        }\n      })\n    }\n  }\n  defineProperty(proto$2, 'cssRules', {\n    configurable: true,\n    enumerable: true,\n    get: function cssRules() {\n      checkInvocationCorrectness(this)\n      return $basicStyleSheet.get(this).cssRules\n    },\n  })\n  cssStyleSheetMethods.forEach(function (method) {\n    proto$2[method] = function () {\n      var self = this\n      checkInvocationCorrectness(self)\n      var args = arguments\n      var basic = $basicStyleSheet.get(self)\n      var locations = $locations.get(self)\n      var result = basic[method].apply(basic, args)\n      locations.forEach(function (location) {\n        if (location.isConnected()) {\n          var sheet = getAdopterByLocation(self, location).sheet\n          sheet[method].apply(sheet, args)\n        }\n      })\n      return result\n    }\n  })\n  defineProperty(ConstructedStyleSheet, Symbol.hasInstance, {\n    configurable: true,\n    value: isCSSStyleSheetInstance,\n  })\n\n  var defaultObserverOptions = {\n    childList: true,\n    subtree: true,\n  }\n  var locations = new WeakMap()\n  function getAssociatedLocation(element) {\n    var location = locations.get(element)\n    if (!location) {\n      location = new Location(element)\n      locations.set(element, location)\n    }\n    return location\n  }\n  function attachAdoptedStyleSheetProperty(constructor) {\n    defineProperty(constructor.prototype, 'adoptedStyleSheets', {\n      configurable: true,\n      enumerable: true,\n      get: function () {\n        return getAssociatedLocation(this).sheets\n      },\n      set: function (sheets) {\n        getAssociatedLocation(this).update(sheets)\n      },\n    })\n  }\n  function traverseWebComponents(node, callback) {\n    var iter = document.createNodeIterator(\n      node,\n      NodeFilter.SHOW_ELEMENT,\n      function (foundNode) {\n        return getShadowRoot(foundNode)\n          ? NodeFilter.FILTER_ACCEPT\n          : NodeFilter.FILTER_REJECT\n      },\n      null,\n      false,\n    )\n    for (var next = void 0; (next = iter.nextNode()); ) {\n      callback(getShadowRoot(next))\n    }\n  }\n  var $element = new WeakMap()\n  var $uniqueSheets = new WeakMap()\n  var $observer = new WeakMap()\n  function isExistingAdopter(self, element) {\n    return (\n      element instanceof HTMLStyleElement &&\n      $uniqueSheets.get(self).some(function (sheet) {\n        return getAdopterByLocation(sheet, self)\n      })\n    )\n  }\n  function getAdopterContainer(self) {\n    var element = $element.get(self)\n    return element instanceof Document ? element.body : element\n  }\n  function adopt(self) {\n    var styleList = document.createDocumentFragment()\n    var sheets = $uniqueSheets.get(self)\n    var observer = $observer.get(self)\n    var container = getAdopterContainer(self)\n    observer.disconnect()\n    sheets.forEach(function (sheet) {\n      styleList.appendChild(\n        getAdopterByLocation(sheet, self) || addAdopterLocation(sheet, self),\n      )\n    })\n    container.insertBefore(styleList, null)\n    observer.observe(container, defaultObserverOptions)\n    sheets.forEach(function (sheet) {\n      restyleAdopter(sheet, getAdopterByLocation(sheet, self))\n    })\n  }\n  function Location(element) {\n    var self = this\n    self.sheets = []\n    $element.set(self, element)\n    $uniqueSheets.set(self, [])\n    $observer.set(\n      self,\n      new MutationObserver(function (mutations, observer) {\n        if (!document) {\n          observer.disconnect()\n          return\n        }\n        mutations.forEach(function (mutation) {\n          if (!hasShadyCss) {\n            forEach.call(mutation.addedNodes, function (node) {\n              if (!(node instanceof Element)) {\n                return\n              }\n              traverseWebComponents(node, function (root) {\n                getAssociatedLocation(root).connect()\n              })\n            })\n          }\n          forEach.call(mutation.removedNodes, function (node) {\n            if (!(node instanceof Element)) {\n              return\n            }\n            if (isExistingAdopter(self, node)) {\n              adopt(self)\n            }\n            if (!hasShadyCss) {\n              traverseWebComponents(node, function (root) {\n                getAssociatedLocation(root).disconnect()\n              })\n            }\n          })\n        })\n      }),\n    )\n  }\n  var proto$1 = Location.prototype\n  proto$1.isConnected = function isConnected() {\n    var element = $element.get(this)\n    return element instanceof Document\n      ? element.readyState !== 'loading'\n      : isElementConnected(element.host)\n  }\n  proto$1.connect = function connect() {\n    var container = getAdopterContainer(this)\n    $observer.get(this).observe(container, defaultObserverOptions)\n    if ($uniqueSheets.get(this).length > 0) {\n      adopt(this)\n    }\n    traverseWebComponents(container, function (root) {\n      getAssociatedLocation(root).connect()\n    })\n  }\n  proto$1.disconnect = function disconnect() {\n    $observer.get(this).disconnect()\n  }\n  proto$1.update = function update(sheets) {\n    var self = this\n    var locationType =\n      $element.get(self) === document ? 'Document' : 'ShadowRoot'\n    if (!Array.isArray(sheets)) {\n      throw new TypeError(\n        'Failed to set the \\'adoptedStyleSheets\\' property on ' +\n          locationType +\n          ': Iterator getter is not callable.',\n      )\n    }\n    if (!sheets.every(isCSSStyleSheetInstance)) {\n      throw new TypeError(\n        'Failed to set the \\'adoptedStyleSheets\\' property on ' +\n          locationType +\n          ': Failed to convert value to \\'CSSStyleSheet\\'',\n      )\n    }\n    if (sheets.some(isNonConstructedStyleSheetInstance)) {\n      throw new TypeError(\n        'Failed to set the \\'adoptedStyleSheets\\' property on ' +\n          locationType +\n          ': Can\\'t adopt non-constructed stylesheets',\n      )\n    }\n    self.sheets = sheets\n    var oldUniqueSheets = $uniqueSheets.get(self)\n    var uniqueSheets = unique(sheets)\n    var removedSheets = diff(oldUniqueSheets, uniqueSheets)\n    removedSheets.forEach(function (sheet) {\n      removeNode(getAdopterByLocation(sheet, self))\n      removeAdopterLocation(sheet, self)\n    })\n    $uniqueSheets.set(self, uniqueSheets)\n    if (self.isConnected() && uniqueSheets.length > 0) {\n      adopt(self)\n    }\n  }\n\n  window.CSSStyleSheet = ConstructedStyleSheet\n  attachAdoptedStyleSheetProperty(Document)\n  if ('ShadowRoot' in window) {\n    attachAdoptedStyleSheetProperty(ShadowRoot)\n    var proto = Element.prototype\n    var attach_1 = proto.attachShadow\n    proto.attachShadow = function attachShadow(init) {\n      var root = attach_1.call(this, init)\n      if (init.mode === 'closed') {\n        closedShadowRootRegistry.set(this, root)\n      }\n      return root\n    }\n  }\n  var documentLocation = getAssociatedLocation(document)\n  if (documentLocation.isConnected()) {\n    documentLocation.connect()\n  } else {\n    document.addEventListener(\n      'DOMContentLoaded',\n      documentLocation.connect.bind(documentLocation),\n    )\n  }\n})()\n","import { Component } from './component'\nimport { Fragment } from './utils'\n\nexport type Attributes = {\n  key?: string | number\n  ignoreAttrs?: boolean\n  children?: VNode[] | null\n  [prop: string]: unknown\n}\n\nexport type ObjectVNode = {\n  nodeName: string | Function | Component\n  attributes: Attributes\n  children: VNode[]\n  key?: string | number | undefined\n}\n\nif (!Array.prototype.flat) {\n  Array.prototype.flat = function (depth: number = 1): any[] {\n    const result: any[] = []\n\n    const flatten = (arr: any[], level: number) => {\n      for (const item of arr) {\n        if (Array.isArray(item) && level < depth) {\n          flatten(item, level + 1)\n        } else {\n          result.push(item)\n        }\n      }\n    }\n\n    // @ts-ignore\n    flatten(this, 0)\n    return result\n  }\n}\n\nexport type VNode = ObjectVNode | string | number | boolean | null | undefined\n\nexport function createElement(\n  nodeName: string | Function,\n  attributes: Attributes,\n  ...restChildren: VNode[] | unknown[]\n): VNode | VNode[] {\n  let children: VNode[] | undefined\n\n  // jsx 嵌套的元素自动忽略  attrs\n  if (attributes) {\n    attributes.ignoreAttrs = true\n  } else {\n    attributes = { ignoreAttrs: true }\n  }\n\n  if (arguments.length > 2) {\n    children = restChildren.flat() as VNode[]\n  } else if (attributes.children != null) {\n    children = attributes.children as VNode[]\n    delete attributes.children\n  }\n\n  // fragment component\n  if (nodeName === Fragment) {\n    return children\n  } else if (typeof nodeName === 'function') {\n    if ((nodeName as unknown as Component).tagName) {\n      // class component\n      nodeName = (nodeName as unknown as Component).tagName\n    } else {\n      // function component\n      children && (attributes.children = children)\n      return nodeName(attributes)\n    }\n  }\n\n  const p: VNode = {\n    nodeName,\n    // @ts-ignore\n    children,\n    attributes,\n    key: attributes.key,\n  }\n\n  return p\n}\n\n// h.f or <></>\ncreateElement.f = Fragment\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param vnode The virtual DOM element to clone\n * @param props Attributes/props to add when cloning\n * @param rest Any additional arguments will be used as replacement children.\n */\n\nexport function cloneElement(\n  vnode: ObjectVNode,\n  props: Attributes,\n  ...restChildren: VNode[] | unknown[]\n): VNode | VNode[] {\n  return createElement(\n    vnode.nodeName as string,\n    { ...vnode.attributes, ...props },\n    restChildren.length > 0 ? restChildren.flat() : vnode.children,\n  )\n}\n","export const DOM_EVENT_MAP = {\n  onanimationcancel: 1,\n  oncompositionend: 1,\n  oncompositionstart: 1,\n  oncompositionupdate: 1,\n  onfocusin: 1,\n  onfocusout: 1,\n  onscrollend: 1,\n  ontouchcancel: 1,\n  ontouchend: 1,\n  ontouchmove: 1,\n  ontouchstart: 1,\n}\n\nexport type EventTypes =\n  | 'onanimationcancel'\n  | 'oncompositionend'\n  | 'oncompositionstart'\n  | 'oncompositionupdate'\n  | 'onfocusin'\n  | 'onfocusout'\n  | 'onscrollend'\n  | 'ontouchcancel'\n  | 'ontouchend'\n  | 'ontouchmove'\n  | 'ontouchstart'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL =\n  /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","/**\n * An object containing registered directives.\n */\nexport const directives: { [key: string]: Function } = {}\n\n/**\n * Registers a directive with the specified name and handler.\n * @param name - The name of the directive.\n * @param handler - The handler function for the directive.\n */\nexport function registerDirective(name: string, handler: Function) {\n  directives['o-' + name] = handler\n}\n","import { Component } from './component'\nimport { IS_NON_DIMENSIONAL, DOM_EVENT_MAP, EventTypes } from './constants'\nimport { applyRef } from './utils'\nimport { directives } from './directive'\n\nexport type ExtendedElement = (HTMLElement | SVGAElement | HTMLInputElement) & {\n  receiveProps: Function\n  update: Function\n  queuedUpdate: Function\n  store?: unknown\n  className?: string\n  props: Record<string, unknown>\n  splitText?: Function\n  prevProps?: Record<string, unknown> & {\n    ref?:\n      | {\n          current?: unknown\n        }\n      | Function\n  }\n  attributes: NamedNodeMap\n  _component?: Component\n  _listeners: Record<string, Function>\n} & Record<string, unknown>\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n *  namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName: string, isSvg: boolean) {\n  /** @type {Element} */\n  let node = isSvg\n    ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n    : document.createElement(nodeName)\n  // @ts-ignore\n  node.normalizedNodeName = nodeName\n  return node as ExtendedElement\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node: Element) {\n  let parentNode = node.parentNode\n  if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n *  event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(\n  node: ExtendedElement,\n  name: string,\n  old: any,\n  value: any,\n  isSvg: boolean,\n) {\n  if (name === 'className') name = 'class'\n\n  if (name[0] == 'o' && name[1] == '-') {\n    // 因为需要访问 node 上的属性,所以这里用 Promise.resolve().then\n    Promise.resolve().then(() => {\n      directives[name]?.(node, value)\n    })\n  }\n  if (name === 'key' || name === 'ignoreAttrs') {\n    // ignore\n  } else if (name === 'ref') {\n    applyRef(old, null)\n    applyRef(value, node)\n  } else if (name === 'class' && !isSvg) {\n    node.className = value || ''\n  } else if (name === 'style') {\n    if (typeof value == 'string') {\n      node.style.cssText = value\n    } else {\n      if (typeof old == 'string') {\n        node.style.cssText = old = ''\n      }\n\n      if (old) {\n        for (name in old) {\n          if (!(value && name in value)) {\n            setStyle(node.style, name, '')\n          }\n        }\n      }\n\n      if (value) {\n        for (name in value) {\n          if (!old || value[name] !== old[name]) {\n            setStyle(node.style, name, value[name])\n          }\n        }\n      }\n    }\n  } else if (name === 'unsafeHTML') {\n    if (value) node.innerHTML = value.html || value || ''\n  } else if (name[0] == 'o' && name[1] == 'n') {\n    bindEvent(node, name, value, old)\n  } else if (node.nodeName === 'INPUT' && name === 'value') {\n    ;(node as HTMLInputElement).value = value == null ? '' : value\n  } else if (\n    name !== 'list' &&\n    name !== 'type' &&\n    name !== 'css' &&\n    !isSvg &&\n    name in node\n  ) {\n    //value !== '' fix for selected, disabled, checked with pure element\n    // Attempt to set a DOM property to the given value.\n    // IE & FF throw for certain property-value combinations.\n    try {\n      node[name] = value == null ? '' : value\n    } catch (e) {}\n    if ((value == null || value === false) && name != 'spellcheck')\n      node.removeAttribute(name)\n  } else {\n    let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n    // spellcheck is treated differently than all other boolean values and\n    // should not be removed when the value is `false`. See:\n    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n    if (value == null || value === false) {\n      if (ns)\n        node.removeAttributeNS(\n          'http://www.w3.org/1999/xlink',\n          name.toLowerCase(),\n        )\n      else node.removeAttribute(name)\n    } else if (typeof value !== 'function') {\n      if (ns) {\n        node.setAttributeNS(\n          'http://www.w3.org/1999/xlink',\n          name.toLowerCase(),\n          value,\n        )\n      } else {\n        if ((node.constructor as typeof Component).is === 'Component') {\n          const reflect = (node.constructor as typeof Component).reflectProps?.[\n            name\n          ]\n          if (reflect) {\n            node.setAttribute(\n              name,\n              typeof reflect === 'function' ? reflect(value) : value,\n            )\n          }\n        } else {\n          node.setAttribute(name, value)\n        }\n      }\n    }\n  }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e: Event) {\n  // @ts-ignore\n  return this._listeners[e.type](e)\n}\n\nfunction bindEvent(node: ExtendedElement, name: string, value: any, old: any) {\n  let useCapture = name !== (name = name.replace(/Capture$/, ''))\n  let nameLower = name.toLowerCase()\n  name = (\n    DOM_EVENT_MAP[nameLower as EventTypes] || nameLower in node\n      ? nameLower\n      : name\n  ).slice(2)\n  if (value) {\n    if (!old) {\n      node.addEventListener(name, eventProxy, useCapture)\n    }\n  } else {\n    node.removeEventListener(name, eventProxy, useCapture)\n  }\n  ;(node._listeners || (node._listeners = {}))[name] = value\n}\n\nfunction setStyle(\n  style: CSSStyleDeclaration,\n  key: string,\n  value: string | number | null,\n) {\n  if (key[0] === '-') {\n    style.setProperty(key, value == null ? '' : value.toString())\n  } else if (value == null) {\n    ;(style as any)[key] = ''\n  } else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n    ;(style as any)[key] = value.toString()\n  } else {\n    ;(style as any)[key] = value + 'px'\n  }\n}\n","import { isSameNodeType, isNamedNode, camelCase, isArray } from './utils'\nimport { createNode, setAccessor, removeNode } from './dom'\nimport { ObjectVNode, VNode } from './vdom'\nimport { Component } from './component'\nimport { ExtendedElement } from './dom'\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\nlet isForeignObject = false\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *  @param {Element} [dom=null]    A DOM node to mutate into the shape of the `vnode`\n *  @param {VNode} vnode      A VNode (with descendants forming a tree) representing the desired DOM structure\n *  @returns {Element} dom      The created/mutated element\n *  @private\n */\nexport function diff(\n  dom: ExtendedElement | ExtendedElement[] | null,\n  vnode: VNode | VNode[],\n  parent: ExtendedElement | null,\n  component: Component | null,\n  updateSelf: boolean,\n): ExtendedElement | ExtendedElement[] | null {\n  // first render return undefined\n  if (!dom && !vnode) return null\n  // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n  let ret\n  if (!diffLevel++) {\n    // when first starting the diff, check if we're diffing an SVG or within an SVG\n    isSvgMode =\n      parent != null &&\n      (parent as Element as SVGElement).ownerSVGElement !== undefined\n\n    // hydration is indicated by the existing element to be diffed not having a prop cache\n    // hydrating = dom != null && !('prevProps' in dom)\n\n    // SSR is currently not supported\n    hydrating = false\n  }\n\n  if (isArray(vnode)) {\n    if (parent) {\n      // don't use props.css when using h.f? can we use now?\n      // diff node list and vnode list\n      innerDiffNode(\n        parent,\n        vnode as VNode[],\n        hydrating,\n        component as Component,\n        updateSelf,\n      )\n      ret = parent.childNodes\n    } else {\n      // connectedCallback 的时候 parent 为 null\n      ret = []\n      ;(vnode as unknown as VNode[]).forEach((item, index) => {\n        let ele = idiff(\n          index === 0 ? dom : null,\n          item,\n          component as Component,\n          updateSelf,\n        )\n        // 返回数组的情况下,在 Component 中进行了 shadowRoot.appendChild\n        // 所有不会出现 vnode index 大于 0 丢失的情况\n        ret.push(ele)\n      })\n    }\n  } else {\n    if (isArray(dom) || dom instanceof NodeList) {\n      // recollectNodeTree will remove dom from the DOM, so we need [...dom] to make a copy\n      ;[...(dom as ExtendedElement[])].forEach((child, index) => {\n        if (index === 0) {\n          ret = idiff(child, vnode as VNode, component as Component, updateSelf)\n        } else {\n          recollectNodeTree(child, false)\n        }\n      })\n    } else {\n      ret = idiff(dom, vnode as VNode, component as Component, updateSelf)\n    }\n    // append the element if its a new parent\n    if (parent && (ret as Node)?.parentNode !== parent)\n      parent.appendChild(ret as Node)\n  }\n\n  // diffLevel being reduced to 0 means we're exiting the diff\n  if (!--diffLevel) {\n    hydrating = false\n    // invoke queued componentDidMount lifecycle methods\n  }\n\n  return ret as ExtendedElement | ExtendedElement[] | null\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(\n  dom: ExtendedElement | ExtendedElement[] | null | Text | HTMLElement,\n  vnode: VNode,\n  component: Component,\n  updateSelf: boolean,\n) {\n  if (dom && vnode && (dom as ExtendedElement).props) {\n    ;(dom as ExtendedElement).props.children = (vnode as ObjectVNode).children\n  }\n  let out = dom,\n    prevSvgMode = isSvgMode,\n    prevForeignObject = isForeignObject\n\n  // empty values (null, undefined, booleans) render as empty Text nodes\n  if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n  // Fast case: Strings & Numbers create/update Text nodes.\n  if (typeof vnode === 'string' || typeof vnode === 'number') {\n    // update if it's already a Text node:\n    if (\n      dom &&\n      (dom as ExtendedElement).splitText !== undefined &&\n      (dom as ExtendedElement).parentNode &&\n      (!(dom as ExtendedElement)._component || component)\n    ) {\n      /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n      if ((dom as ExtendedElement).nodeValue != vnode) {\n        ;(dom as ExtendedElement).nodeValue = String(vnode)\n      }\n    } else {\n      // it wasn't a Text node: replace it with one and recycle the old Element\n      out = document.createTextNode(String(vnode))\n      if (dom) {\n        if ((dom as Text).parentNode)\n          (dom as Text).parentNode?.replaceChild(out, dom as Text)\n        recollectNodeTree(dom as ExtendedElement, true)\n      }\n    }\n\n    if (out) {\n      ;(out as ExtendedElement).prevProps = {}\n    }\n\n    return out\n  }\n\n  let vnodeName = vnode.nodeName\n  // if (typeof vnodeName !== 'string') {\n  //   vnodeName = (vnodeName as Component).tagName\n  // }\n\n  // Tracks entering and exiting SVG namespace when descending through the tree.\n  isForeignObject = vnodeName === 'foreignObject'\n  isSvgMode = vnodeName === 'svg' ? true : isForeignObject ? false : isSvgMode\n\n  // If there's no existing element or it's the wrong type, create a new one:\n  vnodeName = String(vnodeName)\n  if (!dom || !isNamedNode(dom as ExtendedElement, vnodeName)) {\n    // foreignObject 自身 isSvgMode 设置成 true,内部设置成 false\n    // 创建 component 时,会执行构造函数\n    out = createNode(vnodeName, isForeignObject || isSvgMode)\n    // 如果是组件,需要把 props 传递给组件,不然 install 里拿不到 props\n    if ((out.constructor as typeof Component)?.is === 'Component') {\n      Object.assign((out as ExtendedElement).props, vnode.attributes)\n    }\n    if (dom) {\n      // move children into the replacement node\n      while ((dom as ExtendedElement).firstChild)\n        (out as HTMLElement).appendChild(\n          (dom as ExtendedElement).firstChild as Node,\n        )\n\n      // if the previous Element was mounted into the DOM, replace it inline\n      if ((dom as ExtendedElement).parentNode)\n        (dom as ExtendedElement).parentNode?.replaceChild(\n          out as HTMLElement,\n          dom as ExtendedElement,\n        )\n\n      // recycle the old element (skips non-Element node types)\n      recollectNodeTree(dom as ExtendedElement, true)\n    }\n  }\n\n  let fc = (out as ExtendedElement).firstChild,\n    props = (out as ExtendedElement).prevProps,\n    vchildren = vnode.children\n\n  if (props == null) {\n    props = (out as ExtendedElement).prevProps = {}\n    for (let a = (out as ExtendedElement).attributes, i = a.length; i--; )\n      props[a[i].name] = a[i].value\n  }\n\n  // Optimization: fast-path for elements containing a single TextNode:\n  if (\n    !hydrating &&\n    vchildren &&\n    vchildren.length === 1 &&\n    typeof vchildren[0] === 'string' &&\n    fc != null &&\n    (fc as Text).splitText !== undefined &&\n    fc.nextSibling == null\n  ) {\n    if (fc.nodeValue != vchildren[0]) {\n      fc.nodeValue = vchildren[0]\n    }\n  }\n  // otherwise, if there are existing or new children, diff them:\n  else if ((vchildren && vchildren.length) || fc != null) {\n    if (\n      !(\n        ((out as ExtendedElement).constructor as typeof Component).is ==\n          'Component' &&\n        ((out as ExtendedElement).constructor as typeof Component).noSlot\n      )\n    ) {\n      innerDiffNode(\n        out as ExtendedElement,\n        vchildren,\n        hydrating || props.unsafeHTML != null,\n        component,\n        updateSelf,\n      )\n    }\n  }\n\n  // Apply attributes/props from VNode to the DOM Element:\n  diffAttributes(\n    out as ExtendedElement,\n    vnode.attributes,\n    props,\n    component,\n    updateSelf,\n  )\n  if ((out as ExtendedElement).props) {\n    ;(out as ExtendedElement).props.children = vnode.children\n  }\n  // restore previous SVG mode: (in case we're exiting an SVG namespace)\n  isSvgMode = prevSvgMode\n  isForeignObject = prevForeignObject\n  return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *  @param {Element} dom      Element whose children should be compared & mutated\n *  @param {Array} vchildren    Array of VNodes to compare to `dom.childNodes`\n *  @param {Boolean} isHydrating  If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(\n  dom: ExtendedElement,\n  vchildren: VNode[],\n  isHydrating: boolean,\n  component: Component,\n  updateSelf: boolean,\n) {\n  let originalChildren = dom.childNodes,\n    children = [],\n    keyed: Record<string, Element | undefined> = {},\n    keyedLen = 0,\n    min = 0,\n    len = originalChildren.length,\n    childrenLen = 0,\n    vlen = vchildren ? vchildren.length : 0,\n    j,\n    c,\n    f,\n    vchild,\n    child\n\n  // Build up a map of keyed children and an Array of unkeyed children:\n  if (len !== 0) {\n    for (let i = 0; i < len; i++) {\n      let child = originalChildren[i],\n        prevProps = (child as ExtendedElement).prevProps,\n        key = vlen && prevProps ? prevProps.key : null\n\n      if (key != null) {\n        keyedLen++\n        keyed[key as string] = child as Element\n      } else if (\n        prevProps || // 拥有 prevProps 的进入 children,进入 children 后面才会被回收\n        ((child as ExtendedElement).splitText !== undefined\n          ? isHydrating\n            ? (child as Text).nodeValue?.trim()\n            : true\n          : isHydrating)\n      ) {\n        children[childrenLen++] = child\n      }\n    }\n  }\n\n  if (vlen !== 0) {\n    for (let i = 0; i < vlen; i++) {\n      vchild = vchildren[i]\n      child = null\n\n      if (vchild) {\n        // attempt to find a node based on key matching\n        let key = (vchild as ObjectVNode).key\n        if (key != null) {\n          if (keyedLen && keyed[key] !== undefined) {\n            child = keyed[key]\n            keyed[key] = undefined\n            keyedLen--\n          }\n        }\n        // attempt to pluck a node of the same type from the existing children\n        else if (min < childrenLen) {\n          for (j = min; j < childrenLen; j++) {\n            if (\n              children[j] !== undefined &&\n              isSameNodeType((c = children[j] as ExtendedElement), vchild)\n            ) {\n              child = c\n              children[j] = undefined\n              if (j === childrenLen - 1) childrenLen--\n              if (j === min) min++\n              break\n            }\n          }\n        }\n      }\n\n      // morph the matched/found/created DOM child to match vchild (deep)\n      child = idiff(child as ExtendedElement, vchild, component, updateSelf)\n\n      f = originalChildren[i]\n      if (child && child !== dom && child !== f) {\n        if (f == null) {\n          dom.appendChild(child as Element)\n        } else if (child === f.nextSibling) {\n          removeNode(f as Element)\n        } else {\n          dom.insertBefore(child as Element, f)\n        }\n      }\n    }\n  }\n\n  // remove unused keyed children:\n  if (keyedLen) {\n    for (let i in keyed)\n      if (keyed[i] !== undefined)\n        recollectNodeTree(keyed[i] as ExtendedElement, false)\n  }\n\n  // remove orphaned unkeyed children:\n  while (min <= childrenLen) {\n    if ((child = children[childrenLen--]) !== undefined)\n      recollectNodeTree(child as ExtendedElement, false)\n  }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *  @param {Node} node            DOM node to start unmount/removal from\n *  @param {Boolean} [unmountOnly=false]  If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node: ExtendedElement, unmountOnly: boolean) {\n  // If the node's VNode had a ref function, invoke it with null here.\n  // (this is part of the React spec, and smart for unsetting references)\n  if (node.prevProps != null && node.prevProps.ref) {\n    if (typeof node.prevProps.ref === 'function') {\n      node.prevProps.ref(null)\n    } else if (node.prevProps.ref.current) {\n      node.prevProps.ref.current = null\n    }\n  }\n\n  if (unmountOnly === false || node.prevProps == null) {\n    removeNode(node)\n  }\n\n  removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *  - we use .lastChild here because it causes less reflow than .firstChild\n *  - it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node: ChildNode | null | undefined) {\n  node = node?.lastChild\n  while (node) {\n    let next = node.previousSibling\n    recollectNodeTree(node as ExtendedElement, true)\n    node = next\n  }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *  @param {Element} dom    Element with attributes to diff `attrs` against\n *  @param {Object} attrs    The desired end-state key-value attribute pairs\n *  @param {Object} old      Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(\n  dom: ExtendedElement,\n  attrs: Record<string, unknown>,\n  old: Record<string, unknown>,\n  component: Component,\n  updateSelf: boolean,\n) {\n  let name\n  // let update = false\n  let isComponent = dom.update\n  let oldClone\n  if (dom.receiveProps) {\n    oldClone = Object.assign({}, old)\n  }\n  // remove attributes no longer present on the vnode by setting them to undefined\n  for (name in old) {\n    if (!(attrs && attrs[name] != null) && old[name] != null) {\n      setAccessor(\n        dom,\n        name,\n        old[name],\n        (old[name] = undefined),\n        isForeignObject || isSvgMode,\n      )\n      if (isComponent) {\n        delete dom.props[name]\n        // update = true\n      }\n    }\n  }\n\n  // add new & update changed attributes\n  for (name in attrs) {\n    if (isComponent && typeof attrs[name] === 'object' && name !== 'ref') {\n      if (name === 'style' || (name[0] === 'o' && name[1] === '-')) {\n        setAccessor(\n          dom,\n          name,\n          old[name],\n          (old[name] = attrs[name]),\n          isForeignObject || isSvgMode,\n        )\n      }\n      let ccName = camelCase(name)\n      dom.props[ccName] = old[ccName] = attrs[name]\n      //update = true\n    } else if (\n      name !== 'children' &&\n      (!(name in old) ||\n        attrs[name] !==\n          (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n    ) {\n      setAccessor(\n        dom,\n        name,\n        old[name],\n        attrs[name],\n        isForeignObject || isSvgMode,\n      )\n      // fix lazy load props missing\n      if (dom.nodeName.indexOf('-') !== -1) {\n        dom.props = dom.props || {}\n        let ccName = camelCase(name)\n        dom.props[ccName] = old[ccName] = attrs[name]\n        // update = true\n      } else {\n        old[name] = attrs[name]\n      }\n    }\n  }\n\n  if (isComponent && !updateSelf && dom.parentNode) {\n    // __hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n    // if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n    if (dom.receiveProps(dom.props, oldClone) !== false) {\n      dom.queuedUpdate()\n    }\n    // }\n  }\n}\n","export const options = {\n  mixin: {} as Record<string, unknown>,\n  // 全局样式\n  globalCSS: [] as CSSStyleSheet[],\n}\n\nexport function mixin(obj: Record<string, unknown>) {\n  Object.assign(options.mixin, obj)\n}\n\n// 注入全局样式\nexport function globalCSS(css: CSSStyleSheet) {\n  if (!options.globalCSS.includes(css)) {\n    options.globalCSS.push(css)\n  }\n}\n","/**\n * Defines a custom element.\n * @param tagName - The tagName of the custom element.\n * @param ctor - The constructor function for the custom element.\n */\nexport function define(tagName: string, ctor: CustomElementConstructor): void {\n  // 重复定义也需要挂载 tagName,防止重复定义时候被使用没有 tagName 当作函数\n  Object.defineProperty(ctor, 'tagName', { value: tagName, writable: false })\n  if (customElements.get(tagName)) {\n    console.warn(\n      `Failed to execute 'define' on 'CustomElementRegistry': the tag name \"${tagName}\" has already been used with this registry`,\n    )\n    return\n  }\n  customElements.define(tagName, ctor)\n}\n\nexport function tag(tagName: string) {\n  return function (target: CustomElementConstructor) {\n    define(tagName, target)\n  }\n}\n","// @ts-nocheck\nimport {\n  isArray,\n  hyphenate,\n  capitalize,\n  createStyleSheet,\n  getClassStaticValue,\n  isObject,\n  createRef\n} from './utils'\nimport { diff } from './diff'\nimport { ExtendedElement } from './dom'\nimport 'weakmap-polyfill'\nimport { ObjectVNode, VNode } from './vdom'\nimport { setActiveComponent, clearActiveComponent } from 'reactive-signal'\nimport { options } from './options'\nimport { define } from './define'\n\nlet id = 0\n\nconst adoptedStyleSheetsMap = new WeakMap()\ntype Module = { default: string }\ntype CSSItem = Module | string\n\ntype PropType = Object | Number | String | Boolean\n\ntype PropTypes = {\n  [key: string]: PropType | Array<PropType>\n}\n\ntype ReflectProps = {\n  [key: string]: boolean | ((propValue: any) => any)\n}\n\nexport class Component<State = any> extends HTMLElement {\n  static is = 'Component'\n  static defaultProps: Record<string, unknown>\n  static reflectProps: ReflectProps\n  static propTypes: PropTypes\n  static css: CSSItem | CSSItem[]\n  static isLightDOM: boolean\n  static noSlot: boolean\n  \n  // 被所有组件继承\n  static props = {\n    ref:{\n      type: Object,\n    }\n  }\n\n  // 可以延迟定义,防止 import { }  被 tree-shaking 掉\n  static define(name: string): void {\n    define(name, this)\n  }\n  // 不能声明 props,不然懒加载的 props 执行完构造函数会变成 udnefined, 会导致元素升级为自定义元素之前的 props 丢失\n  // props: Record<string, unknown>\n  // 不能声明 prevProps,不然懒加载的 prevProps 执行完构造函数会变成 udnefined, 会导致元素升级为自定义元素之前的 prevProps 丢失\n  // prevProps: Record<string, unknown> | null\n  elementId: number\n  isInstalled: boolean\n  inject?: string[]\n  injection?: { [key: string]: unknown }\n  renderRoot?: ExtendedElement | ShadowRoot | Component\n  rootElement: ExtendedElement | ExtendedElement[] | null\n\n  _ref :Partial<Record<'current', any>>= null\n\n  constructor() {\n    super()\n\n    this.handleProps()\n    // if (!this.constructor.defaultProps) {\n    //   this.constructor.defaultProps = {}\n    // }\n    // if (!this.constructor.propTypes) {\n    //   this.constructor.propTypes = {}\n    // }\n    // if (!this.constructor.reflectProps) {\n    //   this.constructor.reflectProps = {}\n    // }\n    // if (this.constructor.props) {\n    //   for (const propName in this.constructor.props) {\n    //     const prop = this.constructor.props[propName]\n    //     this.constructor.defaultProps[propName] = prop.default\n    //     this.constructor.propTypes[propName] = prop.type\n    //     this.constructor.reflectProps[propName] = prop.reflect\n    //   }\n    // }\n\n    // // @ts-ignore fix lazy load props missing\n    // this.props = Object.assign(\n    //   {},\n    //   (this.constructor as typeof Component).defaultProps,\n    //   this.props,\n    // )\n    this.elementId = id++\n    this.isInstalled = false\n    this.rootElement = null\n  }\n\n  get ref(){\n    if(!this._ref){\n      if(this.props.ref && isObject(this.props.ref)){\n        this._ref = this.props.ref \n      }else{\n        this._ref = createRef()\n      }\n    }\n    return this._ref\n  }\n  /**\n   * 处理props\n   *\n   * 为方便组件继承,会读取类继承链上的props、defaultProps、propTypes、reflectProps等属性进行合并\n   * 这样子组件就可以继承父组件的props、defaultProps、propTypes、reflectProps等属性\n   *\n   *\n   */\n  private handleProps() {\n    this.constructor.defaultProps =\n      getClassStaticValue(this, 'defaultProps', { default: {} }) || {}\n    this.constructor.propTypes =\n      getClassStaticValue(this, 'propTypes', { default: {} }) || {}\n    this.constructor.reflectProps =\n      getClassStaticValue(this, 'reflectProps', { default: {} }) || {}\n    const props = getClassStaticValue(this, 'props', {\n      default: {},\n      merge: 'uniqueMerge',\n    })\n\n    if (this.constructor.props) {\n      for (const propName in props) {\n        const prop = props[propName]\n        this.constructor.defaultProps[propName] = prop.default\n        this.constructor.propTypes[propName] = prop.type\n        this.constructor.reflectProps[propName] = prop.reflect\n      }\n    }\n\n    // @ts-ignore fix lazy load props missing\n    this.props = Object.assign({}, this.constructor.defaultProps, this.props)\n  }\n\n  attributeChangedCallback(name, oldValue, newValue) {\n    if (this.constructor.props && this.constructor.props[name]) {\n      const prop = this.constructor.props[name]\n      if (prop.changed) {\n        const newTypeValue = this.getTypeValueOfProp(name, newValue)\n        const oldTypeValue = this.getTypeValueOfProp(name, oldValue)\n        prop.changed.call(this, newTypeValue, oldTypeValue)\n      }\n    }\n  }\n\n  state: State\n\n  setState(partialState: Partial<State>, beforeUpdate = false) {\n    if (typeof partialState !== 'object') {\n      throw new Error('takes an object of state variables to update')\n    }\n\n    Object.keys(partialState).forEach(key => this.state[key] = partialState[key])\n    if (!beforeUpdate) {\n      this.queuedUpdate()\n    }\n  }\n\n  static get observedAttributes() {\n    return this.props ? Object.keys(this.props) : []\n  }\n\n  injectObject() {\n    let p: ExtendedElement = this.parentNode as ExtendedElement\n    // @ts-ignore deprecated\n    while (p && !this.store && !options.mixin.store) {\n      // @ts-ignore deprecated\n      this.store = p.store\n      p = (p.parentNode || p.host) as ExtendedElement\n    }\n\n    if (this.inject) {\n      this.injection = {}\n      p = this.parentNode as ExtendedElement\n      let provide: unknown\n      while (p && !provide) {\n        provide = p.provide\n        p = (p.parentNode || p.host) as ExtendedElement\n      }\n      if (provide) {\n        this.inject.forEach((injectKey) => {\n          // @ts-ignore\n          this.injection[injectKey] = provide[injectKey]\n        })\n      }\n    }\n\n    for (const key in options.mixin) {\n      if (!this.hasOwnProperty(key)) {\n        Object.defineProperty(this, key, {\n          get: () => {\n            return options.mixin[key]\n          },\n        })\n      }\n    }\n  }\n\n  createRenderRoot(): ShadowRoot | Component {\n    if ((this.constructor as typeof Component).isLightDOM) {\n      return this\n    } else {\n      if (this.shadowRoot) {\n        let fc: ChildNode | null\n        while ((fc = this.shadowRoot.firstChild)) {\n          this.shadowRoot.removeChild(fc)\n        }\n        return this.shadowRoot\n      } else {\n        return this.attachShadow({\n          mode: 'open',\n        })\n      }\n    }\n  }\n\n  applyAdoptedStyleSheets() {\n    if (\n      !(this.constructor as typeof Component).isLightDOM &&\n      !adoptedStyleSheetsMap.has(this.constructor)\n    ) {\n      const css = (this.constructor as typeof Component).css\n      if (css) {\n        let styleSheets: CSSStyleSheet[] = []\n        if (typeof css === 'string') {\n          styleSheets = [createStyleSheet(css)]\n        } else if (isArray(css)) {\n          styleSheets = (css as Module[]).map((styleSheet) => {\n            if (typeof styleSheet === 'string') {\n              return createStyleSheet(styleSheet)\n            } else if (\n              (styleSheet as Module).default &&\n              typeof (styleSheet as Module).default === 'string'\n            ) {\n              return createStyleSheet((styleSheet as Module).default)\n            } else {\n              return styleSheet\n            }\n          }) as CSSStyleSheet[]\n        } else if (\n          (css as Module).default &&\n          typeof (css as Module).default === 'string'\n        ) {\n          styleSheets = [createStyleSheet((css as Module).default)]\n        } else {\n          styleSheets = [css as unknown as CSSStyleSheet]\n        }\n\n        // add globalCSS\n        styleSheets = [...options.globalCSS, ...styleSheets]\n        ;(this.renderRoot as ShadowRoot).adoptedStyleSheets = styleSheets\n        adoptedStyleSheetsMap.set(this.constructor, styleSheets)\n      } else {\n        if (options.globalCSS.length) {\n          ;(this.renderRoot as ShadowRoot).adoptedStyleSheets =\n            options.globalCSS\n        }\n      }\n    } else {\n      ;(this.renderRoot as ShadowRoot).adoptedStyleSheets =\n        adoptedStyleSheetsMap.get(this.constructor)\n    }\n  }\n\n  appendStyleVNode(rendered: VNode | VNode[]) {\n    if (this.props.css && rendered) {\n      const styleVNode = {\n        nodeName: 'style',\n        attributes: {},\n        children: [this.props.css],\n      }\n      if ((rendered as VNode[]).push) {\n        ;(rendered as VNode[]).push(styleVNode as ObjectVNode)\n      } else {\n        ;(rendered as ObjectVNode).children.push(styleVNode as ObjectVNode)\n      }\n    }\n  }\n\n  connectedCallback(): void {\n    this.injectObject()\n    this.attrsToProps()\n    this.install()\n    this.fire('install', this)\n    this.renderRoot = this.createRenderRoot()\n    this.applyAdoptedStyleSheets()\n    setActiveComponent(this)\n    this.beforeRender()\n    this.fire('beforeRender', this)\n    // @ts-ignore\n    const rendered = this.render(this.props, this.store)\n    this.appendStyleVNode(rendered)\n    this.rendered(rendered)\n    clearActiveComponent()\n    this.rootElement = diff(null, rendered as VNode, null, this, false)\n\n    if (isArray(this.rootElement)) {\n      ;(this.rootElement as Element[]).forEach((item) => {\n        this.renderRoot?.appendChild(item)\n      })\n    } else {\n      this.rootElement &&\n        this.renderRoot?.appendChild(this.rootElement as Element)\n    }\n    this.installed()\n    this.fire('installed', this)\n    this.isInstalled = true\n\n    Promise.resolve().then(() => {\n      this.ready()\n      this.fire('ready', this)\n    })\n  }\n\n  disconnectedCallback(): void {\n    this.uninstall()\n    this.fire('uninstall', this)\n    this.isInstalled = false\n  }\n\n  update(updateSelf?: boolean): void {\n    this.beforeUpdate()\n    this.fire('beforeUpdate', this)\n    this.attrsToProps()\n    setActiveComponent(this)\n    this.beforeRender()\n    this.fire('beforeRender', this)\n    // @ts-ignore\n    const rendered = this.render(this.props, this.store)\n    this.appendStyleVNode(rendered)\n    this.rendered(rendered)\n    clearActiveComponent(null)\n\n    this.rootElement = diff(\n      this.rootElement,\n      rendered as VNode,\n      this.renderRoot as ExtendedElement,\n      this,\n      !!updateSelf,\n    )\n    this.updated()\n    this.fire('updated', this)\n  }\n\n  private updateQueued = false\n\n  queuedUpdate(): void {\n    if (!this.updateQueued) {\n      this.updateQueued = true\n      Promise.resolve().then(() => {\n        this.update()\n        this.updateQueued = false\n      })\n    }\n  }\n\n  updateProps(obj: Record<string, unknown>): void {\n    Object.keys(obj).forEach((key) => {\n      this.props[key] = obj[key]\n      if (this.prevProps) {\n        this.prevProps[key] = obj[key]\n      }\n    })\n    this.update()\n  }\n\n  updateSelf(): void {\n    this.update(true)\n  }\n\n  removeProp(key: string): void {\n    this.removeAttribute(key)\n    // Avoid executing removeAttribute methods before connectedCallback\n    this.isInstalled && this.update()\n  }\n\n  setProp(key: string, val: string | object): void {\n    if (val && typeof val === 'object') {\n      this.setAttribute(key, JSON.stringify(val))\n    } else {\n      this.setAttribute(key, val)\n    }\n    // Avoid executing setAttribute methods before connectedCallback\n    this.isInstalled && this.update()\n  }\n\n  attrsToProps(): void {\n    if (this.props.ignoreAttrs) return\n    const ele = this\n    ele.props['css'] = ele.getAttribute('css')\n    const attrs = (this.constructor as typeof Component).propTypes\n    if (!attrs) return\n    Object.keys(attrs).forEach((key) => {\n      const val = ele.getAttribute(hyphenate(key))\n      if (val !== null) {\n        ele.props[key] = this.getTypeValueOfProp(key, val)\n      } else {\n        if (\n          (ele.constructor as typeof Component).defaultProps &&\n          (ele.constructor as typeof Component).defaultProps.hasOwnProperty(key)\n        ) {\n          ele.props[key] = (ele.constructor as typeof Component).defaultProps[\n            key\n          ]\n        } else {\n          ele.props[key] = null\n        }\n      }\n    })\n  }\n\n  getTypeValueOfProp(key: string, val: string) {\n    const attrs = (this.constructor as typeof Component).propTypes\n    const types = isArray(attrs[key]) ? attrs[key] : [attrs[key]]\n\n    for (let i = 0; i < (types as Array<PropType>).length; i++) {\n      const type = (types as Array<PropType>)[i]\n      switch (type) {\n        case String:\n          return val\n        case Number:\n          return Number(val)\n        case Boolean:\n          return Boolean(val !== 'false' && val !== '0')\n        case Array:\n        case Object:\n          try {\n            return JSON.parse(val)\n          } catch (e) {\n            console.warn(\n              `The ${key} object prop does not comply with the JSON specification, the incorrect string is [${val}].`,\n            )\n          }\n      }\n    }\n  }\n\n  fire(\n    name: string,\n    data: unknown,\n    options?: { bubbles: boolean; composed: boolean },\n  ): void {\n    const { bubbles, composed } = Object.assign(\n      { bubbles: false, composed: false },\n      options,\n    )\n    const handler = this.props[`on${capitalize(name)}`] as Function\n    if (handler) {\n      handler(\n        new CustomEvent(name, {\n          detail: data,\n          bubbles,\n          composed,\n        }),\n      )\n    } else {\n      this.dispatchEvent(\n        new CustomEvent(name, {\n          detail: data,\n          bubbles,\n          composed,\n        }),\n      )\n    }\n  }\n\n  install() {}\n\n  installed() {}\n\n  ready() {}\n\n  uninstall() {}\n\n  beforeUpdate() {}\n\n  updated() {}\n\n  beforeRender() {}\n\n  rendered(vnode: VNode | VNode[]) {}\n\n  receiveProps() {}\n}\n","/**\n * classNames based on https://github.com/JedWatson/classnames\n * by Jed Watson\n * Licensed under the MIT License\n * https://github.com/JedWatson/classnames/blob/master/LICENSE\n * modified by dntzhang\n */\nconst hasOwn = {}.hasOwnProperty\n\ntype Value = string | number | boolean | undefined | null\ntype Mapping = Record<string, unknown>\ninterface ArgumentArray extends Array<Argument> {}\ninterface ReadonlyArgumentArray extends ReadonlyArray<Argument> {}\ntype Argument = Value | Mapping | ArgumentArray | ReadonlyArgumentArray\n\nexport function classNames(...args: ArgumentArray): string {\n  const classes: (string | number)[] = []\n\n  for (let i = 0; i < args.length; i++) {\n    const arg: Argument = args[i]\n    if (!arg) continue\n\n    const argType = typeof arg\n\n    if (argType === 'string' || argType === 'number') {\n      classes.push(arg as string | number)\n    } else if (Array.isArray(arg) && arg.length) {\n      const inner = classNames(...arg)\n      if (inner) {\n        classes.push(inner)\n      }\n    } else if (argType === 'object') {\n      for (const key in arg as Mapping) {\n        if (hasOwn.call(arg, key) && (arg as Mapping)[key]) {\n          classes.push(key)\n        }\n      }\n    }\n  }\n\n  return classes.join(' ')\n}\n\ntype PropsMapping = {\n  class?: Argument\n  className?: Argument\n} & Mapping\n\nexport function extractClass(\n  props: PropsMapping,\n  ...args: ArgumentArray\n): { class: string } | undefined {\n  if (props.class) {\n    args.unshift(props.class)\n    delete props.class\n  } else if (props.className) {\n    args.unshift(props.className)\n    delete props.className\n  }\n  if (args.length > 0) {\n    return { class: classNames(...args) }\n  }\n}\n","/**\n * Cache for storing created CSSStyleSheets.\n */\nlet styleSheetCache: { [key: string]: CSSStyleSheet } = {}\n\n/**\n * A tagged template function for CSS that supports JavaScript expressions.\n * It concatenates the parts of the template string with the values of the expressions.\n * It also checks if the values are safe to insert into CSS.\n * The function returns a CSSStyleSheet object, which can be shared among multiple elements.\n *\n * @param {TemplateStringsArray} strings - The parts of the template string.\n * @param {...unknown[]} values - The values of the expressions.\n * @returns {CSSStyleSheet} The resulting CSSStyleSheet object.\n * @throws {Error} If a value is not safe to insert into CSS.\n */\nexport function css(\n  strings: TemplateStringsArray,\n  ...values: unknown[]\n): CSSStyleSheet {\n  let str = ''\n  strings.forEach((string, i) => {\n    // Check if the value is safe to insert into CSS\n    if (\n      values[i] !== undefined &&\n      typeof values[i] !== 'string' &&\n      typeof values[i] !== 'number'\n    ) {\n      throw new Error(`Unsupported value in CSS: ${values[i]}`)\n    }\n\n    str += string + (values[i] || '')\n  })\n\n  // Check if the style sheet is in the cache\n  if (styleSheetCache[str]) {\n    // If it is, return the cached style sheet\n    return styleSheetCache[str]\n  } else {\n    // If it's not, create a new style sheet\n    const styleSheet = new CSSStyleSheet()\n    styleSheet.replaceSync(str)\n\n    // Store the new style sheet in the cache\n    styleSheetCache[str] = styleSheet\n\n    // Return the new style sheet\n    return styleSheet\n  }\n}\n","import { diff } from './diff'\nimport { ExtendedElement } from './dom'\nimport { VNode } from './vdom'\n\nexport function render(\n  vnode: unknown,\n  parent: Element | null | string,\n  store?: unknown,\n) {\n  parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n  if (store && parent) {\n    ;(parent as ExtendedElement).store = store\n  }\n  return diff(null, vnode as VNode, parent as ExtendedElement, null, false)\n}\n","export { cloneElement, createElement, createElement as h } from './vdom'\nexport { Component, Component as WeElement } from './component'\nexport { render } from './render'\nexport { define, define as defineElement, tag } from './define'\nexport { classNames, extractClass } from './class'\nexport { createRef, bind } from './utils'\nexport {\n  signal,\n  computed,\n  effect,\n  batch,\n  setActiveComponent,\n  clearActiveComponent,\n  getActiveComponent,\n  signalObject,\n} from 'reactive-signal'\nexport type { SignalValue, SignalObject } from 'reactive-signal'\nexport { Signal } from 'reactive-signal'\nexport { css } from './css-tag'\nexport { mixin, globalCSS } from './options'\nexport { registerDirective } from './directive'\nexport const version = '7.6.11'\n"],"names":["camelCase","str","replace","_","$1","toUpperCase","Fragment","props","children","applyRef","ref","value","current","isArray","obj","Object","prototype","toString","call","document","hasShadyCss","window","ShadyCSS","nativeShadow","bootstrapper","implementation","createHTMLDocument","closedShadowRootRegistry","WeakMap","_DOMException","DOMException","Error","defineProperty","forEach","Array","importPattern","nonConstructedProto","CSSStyleSheet","Promise","reject","replaceSync","$basicStyleSheet","$locations","$adoptersByLocation","proto$2","ConstructedStyleSheet","contents","this","resolve","e","checkInvocationCorrectness","self_1","style","get","ownerNode","textContent","_contents","console","warn","trim","rejectImports","set","sheet","location","isConnected","restyleAdopter","getAdopterByLocation","configurable","enumerable","cssRules","method","self","args","arguments","basic","locations","result","apply","Symbol","hasInstance","isCSSStyleSheetInstance","defaultObserverOptions","childList","subtree","$element","$uniqueSheets","$observer","proto$1","Location","element","Document","readyState","contains","isElementConnected","host","connect","container","getAdopterContainer","observe","length","adopt","traverseWebComponents","root","getAssociatedLocation","disconnect","update","sheets","locationType","TypeError","every","some","isNonConstructedStyleSheetInstance","arr","arr2","oldUniqueSheets","uniqueSheets","filter","index","indexOf","node","parentNode","removeChild","_location","removeAdopterLocation","attachAdoptedStyleSheetProperty","ShadowRoot","proto","Element","attach_1","attachShadow","init","mode","documentLocation","addEventListener","bind","getShadowRoot","shadowRoot","instance","isPrototypeOf","adopter","requestAnimationFrame","from","to","i","deleteRule","clearRules","rule","insertRule","cssText","has","createElement","body","appendChild","constructor","callback","iter","createNodeIterator","NodeFilter","SHOW_ELEMENT","foundNode","FILTER_ACCEPT","FILTER_REJECT","next","nextNode","styleList","createDocumentFragment","observer","push","addAdopterLocation","insertBefore","MutationObserver","mutations","mutation","addedNodes","removedNodes","HTMLStyleElement","isExistingAdopter","w","global","undefined","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","setPrototypeOf","hyphenateRE","createStyleSheet","styleSheet","isNamedNode","nodeName","normalizedNodeName","toLowerCase","isObject","item","getClassStaticValue","instanceOrClass","fieldName","options","opts","assign","merge","default","fieldValue","valueType","defaultValue","values","__proto__","mergedResult","reduce","Set","attributes","ignoreAttrs","slice","flat","tagName","key","depth","flatten","level","_step","_iterator","_createForOfIteratorHelperLoose","done","f","DOM_EVENT_MAP","onanimationcancel","oncompositionend","oncompositionstart","oncompositionupdate","onfocusin","onfocusout","onscrollend","ontouchcancel","ontouchend","ontouchmove","ontouchstart","IS_NON_DIMENSIONAL","directives","removeNode","setAccessor","name","old","isSvg","then","_directives$name","setStyle","innerHTML","html","useCapture","nameLower","eventProxy","removeEventListener","_listeners","bindEvent","removeAttribute","ns","removeAttributeNS","setAttributeNS","is","_node$constructor$ref","reflect","reflectProps","setAttribute","className","type","setProperty","test","diffLevel","isSvgMode","isForeignObject","hydrating","diff","dom","vnode","parent","component","updateSelf","ownerSVGElement","innerDiffNode","ret","childNodes","ele","idiff","NodeList","concat","child","recollectNodeTree","_ret","_dom$parentNode","out","prevSvgMode","prevForeignObject","splitText","_component","nodeValue","String","createTextNode","replaceChild","prevProps","_out$constructor","vnodeName","createElementNS","_dom$parentNode2","firstChild","fc","vchildren","a","nextSibling","noSlot","unsafeHTML","attrs","oldClone","isComponent","receiveProps","ccName","queuedUpdate","diffAttributes","isHydrating","j","c","vchild","originalChildren","keyed","keyedLen","min","len","childrenLen","vlen","_child$nodeValue","unmountOnly","_node","lastChild","previousSibling","removeChildren","mixin","globalCSS","define","ctor","writable","id","adoptedStyleSheetsMap","Component","_HTMLElement","_this","elementId","isInstalled","inject","injection","renderRoot","rootElement","_ref","state","updateQueued","handleProps","_proto","defaultProps","propTypes","propName","prop","attributeChangedCallback","oldValue","newValue","changed","newTypeValue","getTypeValueOfProp","oldTypeValue","setState","partialState","beforeUpdate","_this2","keys","injectObject","_this3","p","store","provide","injectKey","_loop","createRenderRoot","isLightDOM","applyAdoptedStyleSheets","adoptedStyleSheets","css","styleSheets","map","appendStyleVNode","rendered","styleVNode","connectedCallback","_this4","attrsToProps","install","fire","setActiveComponent","beforeRender","_this$renderRoot","render","clearActiveComponent","_this4$renderRoot","installed","ready","disconnectedCallback","uninstall","updated","_this5","updateProps","_this6","removeProp","setProp","val","JSON","stringify","_this7","getAttribute","types","Number","Boolean","parse","data","_Object$assign","bubbles","composed","handler","letter","s","capitalize","CustomEvent","detail","dispatchEvent","_wrapNativeSuper","hasOwn","classNames","classes","arg","argType","inner","join","styleSheetCache","target","propertyKey","descriptor","bound","restChildren","_extends","strings","string","unshift","class","includes","querySelector"],"mappings":"6iEAgCgB,SAAAA,EAAUC,GACxB,OAAOA,EAAIC,QAAQ,SAAU,SAACC,EAAGC,GAAO,OAAAA,EAAGC,aAAa,EAC1D,CAOM,SAAUC,EAASC,GACvB,OAAOA,EAAMC,QACf,CAOgB,SAAAC,EACdC,EACAC,GAEW,MAAPD,IACgB,mBAAPA,EAAmBA,EAAIC,GAC7B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