{
  "version": 3,
  "sources": ["../index.ts", "../src/array.ts", "../src/options.ts", "../src/error.ts", "../src/async.ts", "../src/compat.ts", "../src/object.ts", "../src/string.ts", "../src/css.ts", "../src/dom/info.ts", "../src/dom/event.ts", "../src/dom/data.ts", "../src/dom/disposal.ts", "../src/dom/manipulation.ts", "../src/dom/fixes.ts", "../src/dom/virtualElements.ts", "../src/dom/html.ts", "../src/dom/selectExtensions.ts", "../src/memoization.ts", "../src/tasks.ts"],
  "sourcesContent": ["export * from './src'\nexport { options as default } from './src'\n", "//\n// Array utilities\n//\n// Note that the array functions may be called with\n// Array-like things, such as NodeList.\n\nconst { isArray } = Array\n\nexport function arrayForEach<T = any>(\n  array: T[],\n  action: (item: T, index?: number, array?: T[]) => void,\n  actionOwner?: any\n): void {\n  if (arguments.length > 2) {\n    action = action.bind(actionOwner)\n  }\n  for (let i = 0, j = array.length; i < j; ++i) {\n    action(array[i], i, array)\n  }\n}\n\nexport function arrayIndexOf<T = any>(array: Array<T>, item: T): number {\n  return (isArray(array) ? array : [...array]).indexOf(item)\n}\n\nexport function arrayFirst<T = any>(\n  array: T[],\n  predicate: (item: T, index?: number) => boolean,\n  predicateOwner?: any\n): T | undefined {\n  return (isArray(array) ? array : [...array]).find(predicate, predicateOwner)\n}\n\nexport function arrayMap<T = any, U = any>(array: ArrayLike<T>, mapping: (item: T, index?: number) => U, thisArg?) {\n  if (arguments.length > 2) {\n    mapping = mapping.bind(thisArg)\n  }\n  return array === null ? [] : Array.from(array, mapping)\n}\n\nexport function arrayRemoveItem<T = any>(array: Array<T>, itemToRemove: T): void {\n  const index = arrayIndexOf(array, itemToRemove)\n  if (index > 0) {\n    array.splice(index, 1)\n  } else if (index === 0) {\n    array.shift()\n  }\n}\n\nexport function arrayGetDistinctValues<T = any>(array: T[]): T[] {\n  const seen = new Set()\n  if (array === null) {\n    return []\n  }\n  return (isArray(array) ? array : [...array]).filter(item => (seen.has(item) ? false : seen.add(item)))\n}\n\nexport function arrayFilter<T = any>(\n  array: T[],\n  predicate: (item: T, index?: number) => boolean,\n  predicateOwner?: any\n): T[] {\n  if (arguments.length > 2) {\n    predicate = predicate.bind(predicateOwner)\n  }\n  return array === null ? [] : (isArray(array) ? array : [...array]).filter(predicate)\n}\n\nexport function arrayPushAll<T = any>(array: Array<T>, valuesToPush: ArrayLike<T>): T[] {\n  if (isArray(valuesToPush)) {\n    array.push.apply(array, valuesToPush)\n  } else {\n    for (let i = 0, j = valuesToPush.length; i < j; i++) {\n      array.push(valuesToPush[i])\n    }\n  }\n  return array\n}\n\nexport function addOrRemoveItem(array, value, included: boolean) {\n  const existingEntryIndex = arrayIndexOf(typeof array.peek === 'function' ? array.peek() : array, value)\n  if (existingEntryIndex < 0) {\n    if (included) {\n      array.push(value)\n    }\n  } else {\n    if (!included) {\n      array.splice(existingEntryIndex, 1)\n    }\n  }\n}\n\nexport function makeArray<T = any>(arrayLikeObject: ArrayLike<T>): T[] {\n  return Array.from(arrayLikeObject)\n}\n\n//TODO May be MaybeSubscribable<number> -> I actually don't want the dependency\nexport function range(min: () => number | number, max: () => number | number): number[] {\n  const minimum = typeof min === 'function' ? (min as () => number)() : (min as number)\n  const maximum = typeof max === 'function' ? (max as () => number)() : (max as number)\n  const result: number[] = []\n  for (let i = minimum as number; i <= maximum; i++) {\n    result.push(i)\n  }\n  return result\n}\n\n// Go through the items that have been added and deleted and try to find matches between them.\nexport function findMovesInArrayComparison(left, right, limitFailedCompares?: number | boolean) {\n  if (left.length && right.length) {\n    let failedCompares, l, r, leftItem, rightItem\n    for (\n      failedCompares = l = 0;\n      (!limitFailedCompares || failedCompares < limitFailedCompares) && (leftItem = left[l]);\n      ++l\n    ) {\n      for (r = 0; (rightItem = right[r]); ++r) {\n        if (leftItem.value === rightItem.value) {\n          leftItem.moved = rightItem.index\n          rightItem.moved = leftItem.index\n          right.splice(r, 1) // This item is marked as moved; so remove it from right list\n          failedCompares = r = 0 // Reset failed compares count because we're checking for consecutive failures\n          break\n        }\n      }\n      failedCompares += r\n    }\n  }\n}\n\nconst statusNotInOld = 'added'\nconst statusNotInNew = 'deleted'\n\nexport interface ArrayChange<T = any> {\n  status: 'added' | 'deleted' | 'retained'\n  value: T\n  index: number\n  moved?: number\n}\n\nexport type ArrayChanges<T = any> = ArrayChange<T>[]\n\nexport interface CompareArraysOptions {\n  dontLimitMoves?: boolean\n  sparse?: boolean\n}\n\n// Simple calculation based on Levenshtein distance.\nexport function compareArrays<T = any>(\n  oldArray: T[],\n  newArray: T[],\n  options?: CompareArraysOptions | boolean\n): ArrayChanges<T> {\n  // For backward compatibility, if the third arg is actually a bool, interpret\n  // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n  options = typeof options === 'boolean' ? { dontLimitMoves: options } : options || {}\n  oldArray = oldArray || []\n  newArray = newArray || []\n\n  if (oldArray.length < newArray.length) {\n    return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options)\n  } else {\n    return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options)\n  }\n}\n\nfunction compareSmallArrayToBigArray<T = any>(\n  smlArray: T[],\n  bigArray: T[],\n  statusNotInSml: 'added' | 'deleted',\n  statusNotInBig: 'added' | 'deleted',\n  options: CompareArraysOptions\n): ArrayChanges<T> {\n  let myMin = Math.min,\n    myMax = Math.max,\n    editDistanceMatrix = new Array(),\n    smlIndex,\n    smlIndexMax = smlArray.length,\n    bigIndex,\n    bigIndexMax = bigArray.length,\n    compareRange = bigIndexMax - smlIndexMax || 1,\n    maxDistance = smlIndexMax + bigIndexMax + 1,\n    thisRow,\n    lastRow,\n    bigIndexMaxForRow,\n    bigIndexMinForRow\n\n  for (smlIndex = 0; smlIndex <= smlIndexMax; smlIndex++) {\n    lastRow = thisRow\n    editDistanceMatrix.push((thisRow = new Array()))\n    bigIndexMaxForRow = myMin(bigIndexMax, smlIndex + compareRange)\n    bigIndexMinForRow = myMax(0, smlIndex - 1)\n    for (bigIndex = bigIndexMinForRow; bigIndex <= bigIndexMaxForRow; bigIndex++) {\n      if (!bigIndex) {\n        thisRow[bigIndex] = smlIndex + 1\n      } else if (!smlIndex) {\n        // Top row - transform empty array into new array via additions\n        thisRow[bigIndex] = bigIndex + 1\n      } else if (smlArray[smlIndex - 1] === bigArray[bigIndex - 1]) {\n        thisRow[bigIndex] = lastRow[bigIndex - 1]\n      } else {\n        // copy value (no edit)\n        const northDistance = lastRow[bigIndex] || maxDistance // not in big (deletion)\n        const westDistance = thisRow[bigIndex - 1] || maxDistance // not in small (addition)\n        thisRow[bigIndex] = myMin(northDistance, westDistance) + 1\n      }\n    }\n  }\n\n  let editScript = new Array(),\n    meMinusOne,\n    notInSml = new Array(),\n    notInBig = new Array()\n  for (smlIndex = smlIndexMax, bigIndex = bigIndexMax; smlIndex || bigIndex; ) {\n    meMinusOne = editDistanceMatrix[smlIndex][bigIndex] - 1\n    if (bigIndex && meMinusOne === editDistanceMatrix[smlIndex][bigIndex - 1]) {\n      notInSml.push(\n        (editScript[editScript.length] = {\n          // added\n          status: statusNotInSml,\n          value: bigArray[--bigIndex],\n          index: bigIndex\n        })\n      )\n    } else if (smlIndex && meMinusOne === editDistanceMatrix[smlIndex - 1][bigIndex]) {\n      notInBig.push(\n        (editScript[editScript.length] = {\n          // deleted\n          status: statusNotInBig,\n          value: smlArray[--smlIndex],\n          index: smlIndex\n        })\n      )\n    } else {\n      --bigIndex\n      --smlIndex\n      if (!options?.sparse) {\n        editScript.push({ status: 'retained', value: bigArray[bigIndex] })\n      }\n    }\n  }\n\n  // Set a limit on the number of consecutive non-matching comparisons; having it a multiple of\n  // smlIndexMax keeps the time complexity of this algorithm linear.\n  findMovesInArrayComparison(notInBig, notInSml, !options.dontLimitMoves && smlIndexMax * 10)\n\n  return editScript.reverse()\n}\n", "import type { Provider } from '@tko/provider'\nimport type { KnockoutInstance } from '@tko/builder'\n\nexport interface CustomBindingGlobalProperties {\n  [customBindingName: string]: any\n}\n\nexport type BindingStringPreparsersFunction = (bindingString: string) => string\n\n//\n// This becomes ko.options\n// --\n//\n// This is the root 'options', which must be extended by others.\nexport class Options {\n  // The following options can be set on ko.options to make a function rewriting or something similar.\n  bindingStringPreparsers: BindingStringPreparsersFunction[] = []\n\n  // Reference to the own knockout instance\n  knockoutInstance: KnockoutInstance | null = null\n\n  deferUpdates: boolean = false\n\n  // Don't set this false, with jquery 3.7+\n  useOnlyNativeEvents: boolean = true\n\n  // Use HTML5 <template> tags if is supported\n  useTemplateTag: boolean = true\n\n  protoProperty: string = '__ko_proto__'\n\n  // Modify the default attribute from `data-bind`.\n  defaultBindingAttribute: string = 'data-bind'\n\n  // Enable/disable <!-- ko binding: ... -> style bindings\n  allowVirtualElements: boolean = true\n\n  // Global variables that can be accessed from bindings.\n  bindingGlobals: object & CustomBindingGlobalProperties = Object.create(null)\n\n  // An instance of the binding provider.\n  bindingProviderInstance: Provider\n\n  // Whether the `with` binding creates a child context when used with `as`.\n  createChildContextWithAs: boolean = false\n\n  // jQuery will be automatically set to globalThis.jQuery in applyBindings\n  // if it is (strictly equal to) undefined.  Set it to true to\n  // disable automatically setting jQuery.\n  disableJQueryUsage: boolean = false\n\n  get jQuery(): JQueryStatic | undefined {\n    if (this.disableJQueryUsage) return undefined\n    return this._jQuery ?? (globalThis as any).jQuery\n  }\n\n  private _jQuery: JQueryStatic | undefined\n  /**\n   * Set jQuery manuall to be used by TKO.\n   * @param jQuery If jQuery set to undefined, TKO will not use jQuery and this.disableJQueryUsage to true.\n   */\n  set jQuery(jQuery: JQueryStatic | undefined) {\n    if (!jQuery) {\n      this.disableJQueryUsage = true\n      this._jQuery = undefined\n    } else {\n      this._jQuery = jQuery\n      this.disableJQueryUsage = false\n    }\n  }\n\n  Promise: PromiseConstructor = globalThis.Promise\n\n  taskScheduler: any = null\n\n  debug: boolean = false\n  /**\n   * The maximum size of template to parse.\n   * Set to 0 to disable the limit.\n   */\n  templateSizeLimit: number = 4096\n\n  /**\n   * Whether or not to allow script tags in templates.\n   * If false, an error will be thrown if a script tag is detected in the template.\n   * It is not recommended to set this to true.\n   */\n  allowScriptTagsInTemplates: boolean = false\n\n  private _sanitizeWarningLogged: boolean = false\n  /**\n   * Sanitize HTML templates before parsing them. Default is a no-op.\n   * Please configure something like DOMPurify or validator.js for your environment.\n   * @param html HTML string to be sanitized\n   * @returns Sanitized HTML string\n   */\n  sanitizeHtmlTemplate(html: string): string {\n    if (!this._sanitizeWarningLogged) {\n      console.warn(\n        \"WARNING -- You don't have a HTML sanitizer configured. Please configure options.sanitizeHtmlTemplate to avoid XSS vulnerabilities.\"\n      )\n      this._sanitizeWarningLogged = true\n    }\n    return html\n  }\n\n  global: any = globalThis\n\n  document: Document = globalThis.document\n\n  // Filters for bindings\n  //   data-bind=\"expression | filter_1 | filter_2\"\n  filters: any = {}\n\n  // Used by the template binding.\n  includeDestroyed: boolean = false\n\n  foreachHidesDestroyed: boolean = false\n\n  onError(e: any, throws: boolean = true): typeof e {\n    if (throws) throw e\n    return e\n  }\n\n  set(name: string, value: any): void {\n    this[name] = value\n  }\n\n  // Overload getBindingHandler to have a custom lookup function.\n  getBindingHandler(key: string): any {\n    return null\n  }\n  cleanExternalData(node: Node, callback?: Function) {}\n}\n\nconst options = new Options()\n\n/**\n * Define a custom option on ko.options with an optional side-effect setter.\n * Plugins use this to register their own configuration properties.\n *\n * Must be called before applyBindings \u2014 setters run side effects at\n * configuration time, not retroactively on already-parsed bindings.\n *\n * @example\n * defineOption('strictEquality', {\n *   default: false,\n *   set(strict) { /* swap operator functions *\\/ }\n * })\n * // Then: ko.options.strictEquality = true\n */\nexport function defineOption<T>(name: string, config: { default: T; set?: (value: T) => void }) {\n  let _value = config.default\n  Object.defineProperty(options, name, {\n    get() {\n      return _value\n    },\n    set(value: T) {\n      _value = value\n      config.set?.(value)\n    },\n    enumerable: true,\n    configurable: true\n  })\n  // Run the setter with the default value to initialize side effects\n  config.set?.(_value)\n}\n\nexport default options\n", "//\n// Error handling\n// ---\n//\n// The default onError handler is to re-throw.\nimport options from './options'\n\nexport function catchFunctionErrors(delegate) {\n  if (!options.onError) {\n    return delegate\n  }\n  return (...args) => {\n    try {\n      return delegate(...args)\n    } catch (err) {\n      options.onError(err)\n    }\n  }\n}\n\nexport function deferError(error) {\n  safeSetTimeout(function () {\n    throw error\n  }, 0)\n}\n\nexport function safeSetTimeout(handler, timeout: number) {\n  return setTimeout(catchFunctionErrors(handler), timeout)\n}\n", "//\n// Asynchronous functionality\n// ---\nimport { safeSetTimeout } from './error'\n\nexport function throttle(callback, timeout) {\n  let timeoutInstance: ReturnType<typeof setTimeout> | undefined\n  return function (...args) {\n    if (!timeoutInstance) {\n      timeoutInstance = safeSetTimeout(function () {\n        timeoutInstance = undefined\n        callback(...args)\n      }, timeout)\n    }\n  }\n}\n\nexport function debounce(callback, timeout: number) {\n  let timeoutInstance: ReturnType<typeof setTimeout>\n  return function (...args) {\n    clearTimeout(timeoutInstance)\n    timeoutInstance = safeSetTimeout(() => callback(...args), timeout)\n  }\n}\n", "// Compat passthroughs preserving the public @tko/utils API after the\n// post-Symbol/post-IE9 polyfill removals. Each function delegates to a\n// native API; kept so consumers importing these names continue to work.\n// All entries here are slated for removal in the next major version.\n\n/**\n * @deprecated Use `Symbol(identifier)` directly. Will be removed in a future major.\n */\nexport function createSymbolOrString(identifier: string): symbol {\n  return Symbol(identifier)\n}\n\n/**\n * @deprecated Use `String(value ?? '').trim()` directly (or `String.prototype.trim`\n * when the input is known to be a string). Will be removed in a future major.\n */\nexport function stringTrim(value: any): string {\n  return String(value ?? '').trim()\n}\n\n/**\n * @deprecated Use `String.prototype.startsWith` directly. Will be removed in a future major.\n */\nexport function stringStartsWith(value: string, prefix: string): boolean {\n  return (value ?? '').startsWith(prefix)\n}\n\n/**\n * @deprecated Use `Object.defineProperty(fn, 'length', descriptor)` directly.\n * Will be removed in a future major.\n */\nexport function overwriteLengthPropertyIfSupported(fn: Function, descriptor: PropertyDescriptor): void {\n  Object.defineProperty(fn, 'length', descriptor)\n}\n", "//\n// Object functions\n//\n\nexport function hasOwnProperty<T = any>(obj: T, propName: keyof T | any): boolean {\n  return Object.prototype.hasOwnProperty.call(obj, propName)\n}\n\n/**\n * True when obj is a non-null object, or a function.\n * @param obj\n * @returns\n */\nexport function isObjectLike(obj) {\n  if (obj === null) {\n    return false\n  }\n  return typeof obj === 'object' || typeof obj === 'function'\n}\n\nexport function extend<T, U>(target: T, source: U): T & U {\n  if (source) {\n    for (const prop of Object.keys(source) as Array<keyof U>) {\n      if (hasOwnProperty(source, prop)) {\n        ;(target as T & U)[prop] = source[prop] as any\n      }\n    }\n  }\n  return target as T & U\n}\n\nexport function objectForEach<T = any>(obj: { [key: string]: T }, action: (key: string, value: T) => void): void {\n  for (const prop in obj) {\n    if (hasOwnProperty(obj, prop)) {\n      action(prop, obj[prop])\n    }\n  }\n}\n\nexport function objectMap(source, mapping, thisArg?: any) {\n  if (!source) {\n    return source\n  }\n  if (arguments.length > 2) {\n    mapping = mapping.bind(thisArg)\n  }\n  const target = {}\n  for (const prop in source) {\n    if (hasOwnProperty(source, prop)) {\n      target[prop] = mapping(source[prop], prop, source)\n    }\n  }\n  return target\n}\nexport function getObjectOwnProperty(obj, propName: string) {\n  return hasOwnProperty(obj, propName) ? obj[propName] : undefined\n}\n\n/**\n * @deprecated Function is unused\n * */\nexport function clonePlainObjectDeep(obj, seen?: any[]) {\n  if (!seen) {\n    seen = new Array()\n  }\n\n  if (!obj || typeof obj !== 'object' || obj.constructor !== Object || seen.indexOf(obj) !== -1) {\n    return obj\n  }\n\n  // Anything that makes it below is a plain object that has not yet\n  // been seen/cloned.\n  seen.push(obj)\n\n  const result = {}\n  for (const prop in obj) {\n    if (hasOwnProperty(obj, prop)) {\n      result[prop] = clonePlainObjectDeep(obj[prop], seen)\n    }\n  }\n  return result\n}\n\n/**\n * JSON.stringify, but inserts `...` for objects that are referenced\n * multiple times, preventing infinite recursion.\n */\nexport function safeStringify(value) {\n  const seen = new Set()\n  return JSON.stringify(value, (k, v) => {\n    if (seen.has(v)) {\n      return '...'\n    }\n    if (typeof v === 'object') {\n      seen.add(v)\n    }\n    return v\n  })\n}\n\n/**\n * Promises/A+ compliant isThenable (per section 1.2)\n */\nexport function isThenable(object: any) {\n  return isObjectLike(object) && typeof object.then === 'function'\n}\n", "//\n// String (and JSON)\n//\n\nexport function parseJson<T = any>(jsonString: string): T | null {\n  if (typeof jsonString === 'string') {\n    const trimmed = jsonString.trim()\n    if (trimmed) {\n      return JSON.parse(trimmed) as T\n    }\n  }\n  return null\n}\n", "//\n// DOM - CSS\n//\n\n// See: https://github.com/knockout/knockout/issues/1597\nconst cssClassNameRegex = /\\S+/g\n\nfunction toggleDomNodeCssClass(node: Element, classNames: string, shouldHaveClass?: boolean): void {\n  if (!classNames) {\n    return\n  }\n  const tokens = classNames.match(cssClassNameRegex)\n  if (!tokens) {\n    return\n  }\n  const method = shouldHaveClass ? 'add' : 'remove'\n  for (const token of tokens) {\n    node.classList[method](token)\n  }\n}\n\nexport { toggleDomNodeCssClass }\n", "//\n// Information about the DOM\n//\nimport { arrayFirst } from '../array'\n\nexport function domNodeIsContainedBy(node: Node, containedByNode: Node) {\n  if (node === containedByNode) {\n    return true\n  }\n  if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n    return false\n  } // Fixes issue #1162 - can't use node.contains for document fragments on IE8\n  if (containedByNode.contains) {\n    return containedByNode.contains(node.nodeType !== Node.ELEMENT_NODE ? node.parentNode : node)\n  }\n  if (containedByNode.compareDocumentPosition) {\n    return (containedByNode.compareDocumentPosition(node) & 16) == 16\n  }\n\n  let parentNode: Node | null = node\n  while (parentNode && parentNode != containedByNode) {\n    parentNode = parentNode.parentNode\n  }\n  return !!parentNode\n}\n\nexport function domNodeIsAttachedToDocument(node) {\n  return domNodeIsContainedBy(node, node.ownerDocument.documentElement)\n}\n\nexport function anyDomNodeIsAttachedToDocument(nodes) {\n  return !!arrayFirst(nodes, domNodeIsAttachedToDocument)\n}\n\nexport function tagNameLower(element: Element) {\n  // For HTML elements, tagName will always be upper case; for XHTML elements, it'll be lower case.\n  // Possible future optimization: If we know it's an element from an XHTML document (not HTML),\n  // we don't need to do the .toLowerCase() as it will always be lower case anyway.\n  return element && element.tagName && element.tagName.toLowerCase()\n}\n\nexport function isDomElement(obj) {\n  if (window.HTMLElement) {\n    return obj instanceof HTMLElement\n  } else {\n    return obj && obj.tagName && obj.nodeType === Node.ELEMENT_NODE\n  }\n}\n\nexport function isDocumentFragment(obj) {\n  if (window.DocumentFragment) {\n    return obj instanceof DocumentFragment\n  } else {\n    return obj && obj.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n  }\n}\n", "//\n// DOM Events\n//\n\nimport { objectForEach } from '../object'\nimport { catchFunctionErrors } from '../error'\nimport { tagNameLower } from './info'\n\nimport options from '../options'\n\n// Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup)\nconst knownEvents = {},\n  knownEventTypesByEventName = {}\n\nknownEvents['UIEvents'] = ['keyup', 'keydown', 'keypress']\n\nknownEvents['MouseEvents'] = [\n  'click',\n  'dblclick',\n  'mousedown',\n  'mouseup',\n  'mousemove',\n  'mouseover',\n  'mouseout',\n  'mouseenter',\n  'mouseleave'\n]\n\nobjectForEach(knownEvents, function (eventType, knownEventsForType) {\n  if (knownEventsForType.length) {\n    for (let i = 0, j = knownEventsForType.length; i < j; i++) {\n      knownEventTypesByEventName[knownEventsForType[i]] = eventType\n    }\n  }\n})\n\nfunction isClickOnCheckableElement(element: Element, eventType: string) {\n  if (tagNameLower(element) !== 'input' || !(element as HTMLInputElement).type) return false\n  if (eventType.toLowerCase() != 'click') return false\n  const inputType = (element as HTMLInputElement).type\n  return inputType == 'checkbox' || inputType == 'radio'\n}\n\nexport function registerEventHandler(\n  element: Element,\n  eventType: string,\n  handler: EventListener,\n  eventOptions = false\n): void {\n  const wrappedHandler = catchFunctionErrors(handler)\n  const mustUseNative = Boolean(eventOptions)\n  const jQuery = options.jQuery\n\n  if (!options.useOnlyNativeEvents && !mustUseNative && jQuery) {\n    jQuery(element).on(eventType, wrappedHandler)\n  } else if (typeof element.addEventListener === 'function') {\n    element.addEventListener(eventType, wrappedHandler, eventOptions)\n  } else {\n    throw new Error(\"Browser doesn't support addEventListener\")\n  }\n}\n\nfunction hasClick(element: Element): element is Element & { click(): void } {\n  return typeof (element as any).click === 'function'\n}\n\nexport function triggerEvent(element: Element, eventType: string): void {\n  if (!(element && element.nodeType)) {\n    throw new Error('element must be a DOM node when calling triggerEvent')\n  }\n\n  // For click events on checkboxes and radio buttons, jQuery toggles the element checked state *after* the\n  // event handler runs instead of *before*. (This was fixed in 1.9 for checkboxes but not for radio buttons.)\n  const useClickWorkaround = isClickOnCheckableElement(element, eventType)\n\n  if (!options.useOnlyNativeEvents && options.jQuery && !useClickWorkaround) {\n    options.jQuery(element).trigger(eventType)\n    return\n  }\n\n  if (typeof element.dispatchEvent !== 'function') {\n    if (useClickWorkaround && hasClick(element)) {\n      element.click()\n      return\n    }\n    throw new Error(\"The supplied element doesn't support dispatchEvent\")\n  }\n\n  const eventCategory = knownEventTypesByEventName[eventType] || 'HTMLEvents'\n  const view = options.global as Window | undefined\n  let event: Event\n  if (eventCategory === 'MouseEvents' && typeof MouseEvent === 'function') {\n    // Preserve the legacy initEvent(...) behavior of passing the element itself\n    // as relatedTarget \u2014 handlers for mouseover/mouseout/mouseenter/mouseleave\n    // observe event.relatedTarget.\n    event = new MouseEvent(eventType, { bubbles: true, cancelable: true, view, relatedTarget: element })\n  } else if (eventCategory === 'UIEvents' && typeof KeyboardEvent === 'function') {\n    event = new KeyboardEvent(eventType, { bubbles: true, cancelable: true, view })\n  } else {\n    event = new Event(eventType, { bubbles: true, cancelable: true })\n  }\n  element.dispatchEvent(event)\n}\n", "//\n// DOM node data\n//\n\nconst datastoreTime = new Date().getTime()\nconst dataStoreKeyExpandoPropertyName = `__ko__${datastoreTime}`\nconst dataStoreSymbol = Symbol('Knockout data')\nconst dataStore = {}\nlet uniqueId = 0\n\n// Prevent prototype pollution by restricting special property names\nfunction isSafeKey(key: string): boolean {\n  return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'\n}\n\n/*\n * We considered using WeakMap, but it has a problem in IE 11 and Edge that\n * prevents using it cross-window, so instead we just store the data directly\n * on the node. See https://github.com/knockout/knockout/issues/2141\n */\nfunction getDataForNode(node: Node, createIfNotFound: boolean): any {\n  let dataForNode = node[dataStoreSymbol]\n  if (!dataForNode && createIfNotFound) {\n    dataForNode = node[dataStoreSymbol] = {}\n  }\n  return dataForNode\n}\n\nfunction clear(node: Node): boolean {\n  if (node[dataStoreSymbol]) {\n    delete node[dataStoreSymbol]\n    return true\n  }\n  return false\n}\n\n/**\n * Create a unique key-string identifier.\n */\nexport function nextKey() {\n  return uniqueId++ + dataStoreKeyExpandoPropertyName\n}\n\nfunction get(node: Node, key: string) {\n  if (!isSafeKey(key)) throw new Error('Unsafe key for DOM data: ' + key)\n\n  const dataForNode = getDataForNode(node, false)\n  return dataForNode && dataForNode[key]\n}\n\nfunction set(node: Node, key: string, value: any) {\n  if (!isSafeKey(key)) throw new Error('Unsafe key for DOM data: ' + key)\n  // Make sure we don't actually create a new domData key if we are actually deleting a value\n  const dataForNode = getDataForNode(node, value !== undefined /* createIfNotFound */)\n  if (dataForNode) {\n    dataForNode[key] = value\n  }\n}\n\nfunction getOrSet(node: Node, key: string, value: any) {\n  if (!isSafeKey(key)) throw new Error('Unsafe key for DOM data: ' + key)\n  const dataForNode = getDataForNode(node, true /* createIfNotFound */)\n  return dataForNode[key] || (dataForNode[key] = value)\n}\n\nexport { get, set, getOrSet, clear }\n", "//\n// DOM node disposal\n//\n/* eslint no-cond-assign: 0 */\nimport * as domData from './data'\nimport { default as options } from '../options'\nimport { arrayRemoveItem, arrayIndexOf } from '../array'\n\nconst domDataKey = domData.nextKey()\n// Node types:\n// 1: Element\n// 8: Comment\n// 9: Document\nconst cleanableNodeTypes = { 1: true, 8: true, 9: true }\nconst cleanableNodeTypesWithDescendants = { 1: true, 9: true }\n\nfunction getDisposeCallbacksCollection(node: Node, createIfNotFound: boolean) {\n  let allDisposeCallbacks = domData.get(node, domDataKey)\n  if (allDisposeCallbacks === undefined && createIfNotFound) {\n    allDisposeCallbacks = new Array()\n    domData.set(node, domDataKey, allDisposeCallbacks)\n  }\n  return allDisposeCallbacks\n}\nfunction destroyCallbacksCollection(node: Node) {\n  domData.set(node, domDataKey, undefined)\n}\n\nfunction cleanSingleNode(node: Node) {\n  // Run all the dispose callbacks\n  let callbacks = getDisposeCallbacksCollection(node, false)\n  if (callbacks) {\n    callbacks = callbacks.slice(0) // Clone, as the array may be modified during iteration (typically, callbacks will remove themselves)\n    for (let i = 0; i < callbacks.length; i++) {\n      callbacks[i](node)\n    }\n  }\n\n  // Erase the DOM data\n  domData.clear(node)\n\n  // Perform cleanup needed by external libraries (currently only jQuery, but can be extended)\n  for (let i = 0, j = otherNodeCleanerFunctions.length; i < j; ++i) {\n    otherNodeCleanerFunctions[i](node)\n  }\n\n  if (options.cleanExternalData) {\n    options.cleanExternalData(node)\n  }\n\n  // Clear any immediate-child comment nodes, as these wouldn't have been found by\n  // node.getElementsByTagName('*') in cleanNode() (comment nodes aren't elements)\n  if (cleanableNodeTypesWithDescendants[node.nodeType]) {\n    cleanNodesInList(node.childNodes, true /* onlyComments */)\n  }\n}\n\nfunction cleanNodesInList(nodeList: NodeList | HTMLCollectionBase, onlyComments?: boolean) {\n  const cleanedNodes = new Array<Node>()\n  let lastCleanedNode\n  for (let i = 0; i < nodeList.length; i++) {\n    if (!onlyComments || nodeList[i].nodeType === Node.COMMENT_NODE) {\n      cleanSingleNode((cleanedNodes[cleanedNodes.length] = lastCleanedNode = nodeList[i]))\n      if (nodeList[i] !== lastCleanedNode) {\n        while (i-- && arrayIndexOf(cleanedNodes, nodeList[i]) === -1) {}\n      }\n    }\n  }\n}\n\n// Exports\nexport function addDisposeCallback(node: Node, callback: (node: Node) => void) {\n  if (typeof callback !== 'function') {\n    throw new Error('Callback must be a function')\n  }\n  getDisposeCallbacksCollection(node, true).push(callback)\n}\n\nexport function removeDisposeCallback(node: Node, callback: (node: Node) => void) {\n  const callbacksCollection = getDisposeCallbacksCollection(node, false)\n  if (callbacksCollection) {\n    arrayRemoveItem(callbacksCollection, callback)\n    if (callbacksCollection.length === 0) {\n      destroyCallbacksCollection(node)\n    }\n  }\n}\n\nexport function cleanNode(node: Node): typeof node {\n  // First clean this node, where applicable\n  if (cleanableNodeTypes[node.nodeType]) {\n    cleanSingleNode(node)\n\n    // ... then its descendants, where applicable\n    if (cleanableNodeTypesWithDescendants[node.nodeType] && node instanceof Element) {\n      cleanNodesInList(node.getElementsByTagName('*'))\n    }\n  }\n  return node\n}\n\nexport function removeNode(node: Node | null) {\n  if (!node) {\n    return\n  }\n\n  cleanNode(node)\n  if (node.parentNode) {\n    node.parentNode.removeChild(node)\n  }\n}\n\n// Expose supplemental node cleaning functions.\nexport const otherNodeCleanerFunctions = new Array<Function>()\n\nexport function addCleaner(fn: Function) {\n  otherNodeCleanerFunctions.push(fn)\n}\n\nexport function removeCleaner(fn: Function) {\n  const fnIndex = otherNodeCleanerFunctions.indexOf(fn)\n  if (fnIndex >= 0) {\n    otherNodeCleanerFunctions.splice(fnIndex, 1)\n  }\n}\n\n// Special support for jQuery here because it's so commonly used.\n// Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData\n// so notify it to tear down any resources associated with the node & descendants here.\nexport function cleanjQueryData(node: Node) {\n  const jQueryCleanNodeFn = options.jQuery ? options.jQuery.cleanData : null\n\n  if (jQueryCleanNodeFn) {\n    jQueryCleanNodeFn([node])\n  }\n}\n\notherNodeCleanerFunctions.push(cleanjQueryData)\n", "//\n// DOM manipulation\n//\n/* eslint no-empty: 0 */\nimport { makeArray } from '../array'\nimport { cleanNode, removeNode } from './disposal'\n\nexport function moveCleanedNodesToContainerElement(nodes: ArrayLike<Node>) {\n  // Ensure it's a real array, as we're about to reparent the nodes and\n  // we don't want the underlying collection to change while we're doing that.\n  const nodesArray = makeArray(nodes) as Node[]\n  const templateDocument = (nodesArray[0] && nodesArray[0].ownerDocument) || document\n\n  const container = templateDocument.createElement('div')\n  for (let i = 0, j = nodesArray.length; i < j; i++) {\n    container.appendChild(cleanNode(nodesArray[i]))\n  }\n  return container\n}\n\nexport function cloneNodes(nodesArray: ArrayLike<Node>, shouldCleanNodes?: boolean) {\n  const newNodesArray = new Array()\n\n  for (let i = 0; i < nodesArray.length; i++) {\n    const clonedNode = nodesArray[i].cloneNode(true)\n    newNodesArray.push(shouldCleanNodes ? cleanNode(clonedNode) : clonedNode)\n  }\n\n  return newNodesArray\n}\n\nexport function setDomNodeChildren(domNode: Node, childNodes: ArrayLike<Node>) {\n  emptyDomNode(domNode)\n  if (childNodes) {\n    for (let i = 0; i < childNodes.length; i++) {\n      domNode.appendChild(childNodes[i])\n    }\n  }\n}\n\nexport function replaceDomNodes(nodeToReplaceOrNodeArray: Node[] | Node, newNodesArray: Node[]) {\n  const nodesToReplaceArray = Array.isArray(nodeToReplaceOrNodeArray)\n    ? nodeToReplaceOrNodeArray\n    : [nodeToReplaceOrNodeArray]\n  if (nodesToReplaceArray.length > 0) {\n    const insertionPoint = nodesToReplaceArray[0]\n    const parent = insertionPoint.parentNode\n\n    for (let i = 0; i < newNodesArray.length; i++) {\n      parent?.insertBefore(newNodesArray[i], insertionPoint)\n    }\n    for (let i = 0; i < nodesToReplaceArray.length; i++) {\n      removeNode(nodesToReplaceArray[i])\n    }\n  }\n}\n\nexport function emptyDomNode(domNode: Node) {\n  while (domNode.firstChild) {\n    removeNode(domNode.firstChild)\n  }\n}\n", "//\n//  DOM node manipulation\n//\n\nexport function fixUpContinuousNodeArray(continuousNodeArray, parentNode) {\n  // Before acting on a set of nodes that were previously outputted by a template function, we have to reconcile\n  // them against what is in the DOM right now. It may be that some of the nodes have already been removed, or that\n  // new nodes might have been inserted in the middle, for example by a binding. Also, there may previously have been\n  // leading comment nodes (created by rewritten string-based templates) that have since been removed during binding.\n  // So, this function translates the old \"map\" output array into its best guess of the set of current DOM nodes.\n  //\n  // Rules:\n  //   [A] Any leading nodes that have been removed should be ignored\n  //       These most likely correspond to memoization nodes that were already removed during binding\n  //       See https://github.com/knockout/knockout/pull/440\n  //   [B] Any trailing nodes that have been remove should be ignored\n  //       This prevents the code here from adding unrelated nodes to the array while processing rule [C]\n  //       See https://github.com/knockout/knockout/pull/1903\n  //   [C] We want to output a continuous series of nodes. So, ignore any nodes that have already been removed,\n  //       and include any nodes that have been inserted among the previous collection\n\n  if (continuousNodeArray.length) {\n    // The parent node can be a virtual element; so get the real parent node\n    parentNode = (parentNode.nodeType === Node.COMMENT_NODE && parentNode.parentNode) || parentNode\n\n    // Rule [A]\n    while (continuousNodeArray.length && continuousNodeArray[0].parentNode !== parentNode) {\n      continuousNodeArray.splice(0, 1)\n    }\n\n    // Rule [B]\n    while (\n      continuousNodeArray.length > 1 &&\n      continuousNodeArray[continuousNodeArray.length - 1].parentNode !== parentNode\n    ) {\n      continuousNodeArray.length--\n    }\n\n    // Rule [C]\n    if (continuousNodeArray.length > 1) {\n      let current = continuousNodeArray[0],\n        last = continuousNodeArray[continuousNodeArray.length - 1]\n      // Replace with the actual new continuous node set\n      continuousNodeArray.length = 0\n      while (current !== last) {\n        continuousNodeArray.push(current)\n        current = current.nextSibling\n      }\n      continuousNodeArray.push(last)\n    }\n  }\n  return continuousNodeArray\n}\n\nexport function setOptionNodeSelectionState(optionNode, isSelected) {\n  optionNode.selected = isSelected\n}\n", "/* eslint no-cond-assign: 0 */\n//\n// Virtual Elements\n//\n//\n// \"Virtual elements\" is an abstraction on top of the usual DOM API which understands the notion that comment nodes\n// may be used to represent hierarchy (in addition to the DOM's natural hierarchy).\n// If you call the DOM-manipulating functions on ko.virtualElements, you will be able to read and write the state\n// of that virtual hierarchy\n//\n// The point of all this is to support containerless templates (e.g., <!-- ko foreach:someCollection -->blah<!-- /ko -->)\n// without having to scatter special cases all over the binding and templating code.\n\nimport { emptyDomNode, setDomNodeChildren as setRegularDomNodeChildren } from './manipulation'\nimport { removeNode } from './disposal'\nimport { tagNameLower } from './info'\nimport * as domData from './data'\nimport options from '../options'\n\nexport const startCommentRegex = /^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/\nexport const endCommentRegex = /^\\s*\\/ko\\s*$/\nconst htmlTagsWithOptionallyClosingChildren = { ul: true, ol: true }\n\nexport function isStartComment(node) {\n  return node.nodeType === Node.COMMENT_NODE && startCommentRegex.test(node.nodeValue)\n}\n\nexport function isEndComment(node) {\n  return node.nodeType === Node.COMMENT_NODE && endCommentRegex.test(node.nodeValue)\n}\n\nfunction isUnmatchedEndComment(node) {\n  return isEndComment(node) && !domData.get(node, matchedEndCommentDataKey)\n}\n\nconst matchedEndCommentDataKey = '__ko_matchedEndComment__'\n\nexport function getVirtualChildren(startComment, allowUnbalanced?) {\n  let currentNode = startComment\n  let depth = 1\n  const children = new Array()\n  while ((currentNode = currentNode.nextSibling)) {\n    if (isEndComment(currentNode)) {\n      domData.set(currentNode, matchedEndCommentDataKey, true)\n      depth--\n      if (depth === 0) {\n        return children\n      }\n    }\n\n    children.push(currentNode)\n\n    if (isStartComment(currentNode)) {\n      depth++\n    }\n  }\n  if (!allowUnbalanced) {\n    throw new Error('Cannot find closing comment tag to match: ' + startComment.nodeValue)\n  }\n  return null\n}\n\nfunction getMatchingEndComment(startComment, allowUnbalanced?) {\n  const allVirtualChildren = getVirtualChildren(startComment, allowUnbalanced)\n  if (allVirtualChildren) {\n    if (allVirtualChildren.length > 0) {\n      return allVirtualChildren[allVirtualChildren.length - 1].nextSibling\n    }\n    return startComment.nextSibling\n  } else {\n    return null\n  } // Must have no matching end comment, and allowUnbalanced is true\n}\n\nfunction getUnbalancedChildTags(node) {\n  // e.g., from <div>OK</div><!-- ko blah --><span>Another</span>, returns: <!-- ko blah --><span>Another</span>\n  //       from <div>OK</div><!-- /ko --><!-- /ko -->,             returns: <!-- /ko --><!-- /ko -->\n  let childNode = node.firstChild,\n    captureRemaining: any = null\n  if (childNode) {\n    do {\n      if (captureRemaining) {\n        // We already hit an unbalanced node and are now just scooping up all subsequent nodes\n        captureRemaining.push(childNode)\n      } else if (isStartComment(childNode)) {\n        const matchingEndComment = getMatchingEndComment(childNode, /* allowUnbalanced: */ true)\n        if (matchingEndComment) {\n          // It's a balanced tag, so skip immediately to the end of this virtual set\n          childNode = matchingEndComment\n        } else {\n          captureRemaining = [childNode]\n        } // It's unbalanced, so start capturing from this point\n      } else if (isEndComment(childNode)) {\n        captureRemaining = [childNode] // It's unbalanced (if it wasn't, we'd have skipped over it already), so start capturing\n      }\n    } while ((childNode = childNode.nextSibling))\n  }\n  return captureRemaining\n}\n\nexport interface VirtualElementsAllowedBindings {\n  text: boolean\n  foreach: boolean\n  if: boolean\n  ifnot: boolean\n  with: boolean\n  let: boolean\n  using: boolean\n  template: boolean\n  component: boolean\n}\n\nexport const allowedBindings: VirtualElementsAllowedBindings = Object.create(null)\nexport const hasBindingValue = isStartComment\n\nexport function childNodes(node: Node): any {\n  return isStartComment(node) ? getVirtualChildren(node) : node.childNodes\n}\n\nexport function emptyNode(node: Node) {\n  if (!isStartComment(node)) {\n    emptyDomNode(node)\n  } else {\n    const virtualChildren = childNodes(node)\n    for (let i = 0, j = virtualChildren.length; i < j; i++) {\n      removeNode(virtualChildren[i])\n    }\n  }\n}\n\nexport function setDomNodeChildren(node: Node, childNodes: Node[]) {\n  if (!isStartComment(node)) {\n    setRegularDomNodeChildren(node, childNodes)\n  } else {\n    emptyNode(node)\n    const endCommentNode = node.nextSibling // Must be the next sibling, as we just emptied the children\n    if (endCommentNode && endCommentNode.parentNode) {\n      const parentNode = endCommentNode.parentNode\n      for (let i = 0, j = childNodes.length; i < j; ++i) {\n        parentNode.insertBefore(childNodes[i], endCommentNode)\n      }\n    }\n  }\n}\n\nexport function prepend(containerNode: Node, nodeToPrepend: Node) {\n  if (!isStartComment(containerNode)) {\n    if (containerNode.firstChild) {\n      containerNode.insertBefore(nodeToPrepend, containerNode.firstChild)\n    } else {\n      containerNode.appendChild(nodeToPrepend)\n    }\n  } else {\n    // Start comments must always have a parent and at least one following sibling (the end comment)\n    containerNode.parentNode?.insertBefore(nodeToPrepend, containerNode.nextSibling)\n  }\n}\n\nexport function insertAfter(containerNode: Node, nodeToInsert: Node, insertAfterNode: Node) {\n  if (!insertAfterNode) {\n    prepend(containerNode, nodeToInsert)\n  } else if (!isStartComment(containerNode)) {\n    // Insert after insertion point\n    if (insertAfterNode.nextSibling) {\n      containerNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling)\n    } else {\n      containerNode.appendChild(nodeToInsert)\n    }\n  } else {\n    // Children of start comments must always have a parent and at least one following sibling (the end comment)\n    containerNode.parentNode?.insertBefore(nodeToInsert, insertAfterNode.nextSibling)\n  }\n}\n\nexport function firstChild(node: Node) {\n  if (!isStartComment(node)) {\n    if (node.firstChild && isEndComment(node.firstChild)) {\n      throw new Error('Found invalid end comment, as the first child of ' + (node as Element).outerHTML)\n    }\n    return node.firstChild\n  }\n  if (!node.nextSibling || isEndComment(node.nextSibling)) {\n    return null\n  }\n  return node.nextSibling\n}\n\nexport function lastChild(node: Node) {\n  let nextChild = firstChild(node)\n  if (!nextChild) return null\n\n  let lastChildNode\n\n  do {\n    lastChildNode = nextChild\n  } while ((nextChild = nextSibling(nextChild)))\n\n  return lastChildNode\n}\n\nexport function nextSibling(node: Node) {\n  if (isStartComment(node)) {\n    node = getMatchingEndComment(node)\n  }\n\n  if (node.nextSibling && isEndComment(node.nextSibling)) {\n    if (isUnmatchedEndComment(node.nextSibling)) {\n      throw Error(\n        'Found end comment without a matching opening comment, as next sibling of ' + (node as Element).outerHTML\n      )\n    }\n    return null\n  } else {\n    return node.nextSibling\n  }\n}\n\nexport function previousSibling(node) {\n  let depth = 0\n  do {\n    if (node.nodeType === Node.COMMENT_NODE) {\n      if (isStartComment(node)) {\n        if (--depth === 0) {\n          return node\n        }\n      } else if (isEndComment(node)) {\n        depth++\n      }\n    } else {\n      if (depth === 0) {\n        return node\n      }\n    }\n  } while ((node = node.previousSibling))\n}\n\nexport function virtualNodeBindingValue(node): string | null {\n  const regexMatch = node.nodeValue.match(startCommentRegex) as RegExpMatchArray\n  return regexMatch ? regexMatch[1] : null\n}\n\nexport function normaliseVirtualElementDomStructure(elementVerified) {\n  // Workaround for https://github.com/SteveSanderson/knockout/issues/155\n  // (IE <= 8 or IE 9 quirks mode parses your HTML weirdly, treating closing </li> tags as if they don't exist, thereby moving comment nodes\n  // that are direct descendants of <ul> into the preceding <li>)\n  if (!htmlTagsWithOptionallyClosingChildren[tagNameLower(elementVerified)]) {\n    return\n  }\n\n  // Scan immediate children to see if they contain unbalanced comment tags. If they do, those comment tags\n  // must be intended to appear *after* that child, so move them there.\n  let childNode = elementVerified.firstChild\n  if (childNode) {\n    do {\n      if (childNode.nodeType === Node.ELEMENT_NODE) {\n        const unbalancedTags = getUnbalancedChildTags(childNode)\n        if (unbalancedTags) {\n          // Fix up the DOM by moving the unbalanced tags to where they most likely were intended to be placed - *after* the child\n          const nodeToInsertBefore = childNode.nextSibling\n          for (let i = 0; i < unbalancedTags.length; i++) {\n            if (nodeToInsertBefore) {\n              elementVerified.insertBefore(unbalancedTags[i], nodeToInsertBefore)\n            } else {\n              elementVerified.appendChild(unbalancedTags[i])\n            }\n          }\n        }\n      }\n    } while ((childNode = childNode.nextSibling))\n  }\n}\n", "//\n// HTML-based manipulation\n//\nimport { makeArray } from '../array'\nimport { emptyDomNode, moveCleanedNodesToContainerElement } from './manipulation'\nimport * as virtualElements from './virtualElements'\nimport options from '../options'\n\n// The canonical way to test that the HTML5 <template> tag is supported\nconst supportsTemplateTag =\n  options.useTemplateTag && options.document && 'content' in options.document.createElement('template')\n\n/** @deprecated HTMLTemplateTag or the jquery-template-function as fallback are enough */\nfunction simpleHtmlParse(html: string, documentContext?: Document): Node[] {\n  if (!documentContext) {\n    documentContext = document\n  }\n  const div = documentContext.createElement('div')\n  div.innerHTML = html\n  return makeArray(div.childNodes)\n}\n\nfunction templateHtmlParse(html: string, documentContext?: Document): Node[] {\n  if (!documentContext) {\n    documentContext = document\n  }\n  const template = documentContext.createElement('template') as HTMLTemplateElement\n  template.innerHTML = html\n  return makeArray(template.content.childNodes)\n}\n\nfunction jQueryHtmlParse(html: string, documentContext?: Document): Node[] {\n  const jQuery = options.jQuery\n\n  // jQuery's \"parseHTML\" function was introduced in jQuery 1.8.0 and is a documented public API.\n  if (jQuery) {\n    return jQuery.parseHTML(html, documentContext) || [] // Ensure we always return an array and never null\n  }\n\n  return []\n}\n\n/**\n * parseHtmlFragment converts a string into an array of DOM Nodes.\n * If supported, it uses <template>-tag parsing, falling back on\n * jQuery parsing (if jQuery is present), and finally on a\n * straightforward parser.\n *\n * @param  {string} html            To be parsed.\n * @param  {Document} documentContext That owns the executing code.\n * @return {[Node]}              Parsed DOM Nodes\n */\nexport function parseHtmlFragment(html: string, documentContext?: Document): Node[] {\n  const saferHtml = validateHTMLInput(html)\n\n  // Prefer <template>-tag based HTML parsing.\n  if (supportsTemplateTag) return templateHtmlParse(saferHtml, documentContext)\n\n  //TODO: It is always true in modern browsers (higher IE11), so we can theoretically remove jQueryHtmlParse and simpleHtmlParse\n  if (options.jQuery) {\n    // Benefit from jQuery's on old browsers, where possible\n    // NOTE: jQuery's HTML parsing fails on element names like tr-*.\n    // See: https://github.com/jquery/jquery/pull/1988\n    return jQueryHtmlParse(saferHtml, documentContext)\n  }\n\n  return simpleHtmlParse(saferHtml, documentContext)\n}\n\nconst scriptTagPattern = /<script\\b[^>]*>([\\s\\S]*?)<\\/script[^>]*>/i\nfunction validateHTMLInput(html: string): string {\n  if (!html) return ''\n\n  if (options.templateSizeLimit > 0 && html.length > options.templateSizeLimit) {\n    throw new Error(\"Template is too long. Please configure the 'templateSizeLimit'\")\n  }\n\n  if (!options.allowScriptTagsInTemplates && scriptTagPattern.test(html)) {\n    throw new Error('Script-tag in template detected.')\n  }\n\n  return options.sanitizeHtmlTemplate(html)\n}\n\nexport function parseHtmlForTemplateNodes(html, documentContext) {\n  const nodes = parseHtmlFragment(html, documentContext)\n  return (nodes.length && nodes[0].parentElement) || moveCleanedNodesToContainerElement(nodes)\n}\n\n/**\n * setHtml empties the node's contents, unwraps the HTML, and\n * sets the node's HTML using jQuery.html or parseHtmlFragment\n *\n * @param {DOMNode} node Node in which HTML needs to be set\n * @param {DOMNode} html HTML to be inserted in node\n * @returns undefined\n */\nexport function setHtml(node: Node, html: Function | string) {\n  emptyDomNode(node)\n\n  // There's few cases where we would want to display a stringified\n  // function, so we unwrap it.\n  if (typeof html === 'function') {\n    html = html()\n  }\n\n  if (html !== null && html !== undefined) {\n    if (typeof html !== 'string') {\n      html = html.toString()\n    }\n\n    const jQuery = options.jQuery\n    // If the browser supports <template> tags, prefer that, as\n    // it obviates all the complex workarounds of jQuery.\n    //\n    // However, jQuery contains a lot of sophisticated code to parse arbitrary HTML fragments,\n    // for example <tr> elements which are not normally allowed to exist on their own.\n    // If you've referenced jQuery (and template tags are not supported) we'll use that rather than duplicating its code.\n    if (jQuery && !supportsTemplateTag) {\n      const saferHtml = validateHTMLInput(html)\n      jQuery(node).html(saferHtml)\n    } else {\n      // ... otherwise, use KO's own parsing logic.\n      let parsedNodes: Node[]\n      if (node.ownerDocument) {\n        parsedNodes = parseHtmlFragment(html, node.ownerDocument)\n      } else {\n        parsedNodes = parseHtmlFragment(html)\n      }\n\n      if (node.nodeType === Node.COMMENT_NODE) {\n        if (html === null) {\n          virtualElements.emptyNode(node)\n        } else {\n          virtualElements.setDomNodeChildren(node, parsedNodes)\n        }\n      } else {\n        for (let i = 0; i < parsedNodes.length; i++) {\n          node.appendChild(parsedNodes[i])\n        }\n      }\n    }\n  }\n}\n\n//TODO May be MaybeSubscribable<string> -> I actually don't want the dependency\ntype TextContent = string | null | undefined | Function\nexport function setTextContent(element: Node, textContent?: TextContent): void {\n  let value = typeof textContent === 'function' ? (textContent as Function)() : textContent\n  if (value === null || value === undefined) {\n    value = ''\n  }\n\n  // We need there to be exactly one child: a text node.\n  // If there are no children, more than one, or if it's not a text node,\n  // we'll clear everything and create a single text node.\n  const innerTextNode = virtualElements.firstChild(element)\n  if (!innerTextNode || innerTextNode.nodeType !== Node.TEXT_NODE || virtualElements.nextSibling(innerTextNode)) {\n    virtualElements.setDomNodeChildren(element, [element.ownerDocument!.createTextNode(value)])\n  } else {\n    ;(innerTextNode as Text).data = value\n  }\n}\n", "import { tagNameLower } from './info'\nimport * as domData from './data'\n\nconst hasDomDataExpandoProperty = Symbol('Knockout selectExtensions hasDomDataProperty')\n\n// Normally, SELECT elements and their OPTIONs can only take value of type 'string' (because the values\n// are stored on DOM attributes). ko.selectExtensions provides a way for SELECTs/OPTIONs to have values\n// that are arbitrary objects. This is very convenient when implementing things like cascading dropdowns.\n//\nexport const selectExtensions = {\n  optionValueDomDataKey: domData.nextKey(),\n\n  readValue: function (element: HTMLElement) {\n    switch (tagNameLower(element)) {\n      case 'option': {\n        if (element[hasDomDataExpandoProperty] === true) {\n          return domData.get(element, selectExtensions.optionValueDomDataKey)\n        }\n        return (element as HTMLOptionElement).value\n      }\n      case 'select': {\n        const selectElement = element as HTMLSelectElement\n        return selectElement.selectedIndex >= 0\n          ? selectExtensions.readValue(selectElement.options[selectElement.selectedIndex])\n          : undefined\n      }\n      default:\n        return (element as HTMLInputElement).value\n    }\n  },\n\n  writeValue: function (element: HTMLElement, value?: any, allowUnset?: boolean) {\n    switch (tagNameLower(element)) {\n      case 'option':\n        if (typeof value === 'string') {\n          domData.set(element, selectExtensions.optionValueDomDataKey, undefined)\n          if (hasDomDataExpandoProperty in element) {\n            // IE <= 8 throws errors if you delete non-existent properties from a DOM node\n            delete element[hasDomDataExpandoProperty]\n          }\n          ;(element as HTMLOptionElement).value = value\n        } else {\n          const el = element as any //TODO Custom-Type with hasDomDataExpandoProperty\n          // Store arbitrary object using DomData\n          domData.set(element, selectExtensions.optionValueDomDataKey, value)\n          el[hasDomDataExpandoProperty] = true\n          // Special treatment of numbers is just for backward compatibility. KO 1.2.1 wrote numerical values to element.value.\n          el.value = typeof value === 'number' ? value : ''\n        }\n\n        break\n      case 'select':\n        {\n          if (value === '' || value === null) {\n            // A blank string or null value will select the caption\n            value = undefined\n          }\n          let selection = -1\n\n          const selectElement = element as HTMLSelectElement\n\n          for (let i = 0, n = selectElement.options.length, optionValue; i < n; ++i) {\n            optionValue = selectExtensions.readValue(selectElement.options[i])\n            // Include special check to handle selecting a caption with a blank string value\n            // Note that the looser == check here is intentional so that integer model values will match string element values.\n            const strictEqual = optionValue === value\n            const blankEqual = optionValue === '' && value === undefined\n            const numericEqual = typeof value === 'number' && Number(optionValue) === value\n            if (strictEqual || blankEqual || numericEqual) {\n              selection = i\n              break\n            }\n          }\n          if (allowUnset || selection >= 0 || (value === undefined && selectElement.size > 1)) {\n            selectElement.selectedIndex = selection\n          }\n        }\n        break\n      default:\n        if (value === null || value === undefined) {\n          value = ''\n        }\n        ;(element as HTMLInputElement).value = value\n        break\n    }\n  }\n}\n", "//\n// Memoization\n//\nimport { arrayPushAll } from './array'\n\nconst memos = {}\n\nfunction randomMax8HexChars() {\n  return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1)\n}\n\nfunction generateRandomId() {\n  return randomMax8HexChars() + randomMax8HexChars()\n}\n\nfunction findMemoNodes(rootNode: Node, appendToArray: any[]) {\n  if (!rootNode) {\n    return\n  }\n  if (rootNode.nodeType === Node.COMMENT_NODE) {\n    const comment = rootNode as Comment\n    const memoId = parseMemoText(comment.nodeValue)\n    if (memoId != null) {\n      appendToArray.push({ domNode: rootNode, memoId: memoId })\n    }\n  } else if (rootNode.nodeType === Node.ELEMENT_NODE) {\n    for (let i = 0, childNodes = rootNode.childNodes, j = childNodes.length; i < j; i++) {\n      findMemoNodes(childNodes[i], appendToArray)\n    }\n  }\n}\n\nexport function memoize(callback: (val: any) => void): string {\n  if (typeof callback !== 'function') {\n    throw new Error('You can only pass a function to memoization.memoize()')\n  }\n  const memoId = generateRandomId()\n  memos[memoId] = callback\n  return '<!--[ko_memo:' + memoId + ']-->'\n}\n\nexport function unmemoize(memoId: string, callbackParams: any[]) {\n  const callback = memos[memoId]\n  if (callback === undefined) {\n    throw new Error(\"Couldn't find any memo with ID \" + memoId + \". Perhaps it's already been unmemoized.\")\n  }\n  try {\n    callback.apply(null, callbackParams || [])\n    return true\n  } finally {\n    delete memos[memoId]\n  }\n}\n\nexport function unmemoizeDomNodeAndDescendants(domNode: Node, extraCallbackParamsArray: any[]) {\n  const memos = new Array()\n  findMemoNodes(domNode, memos)\n  for (let i = 0, j = memos.length; i < j; i++) {\n    const node = memos[i].domNode\n    const combinedParams = [node]\n    if (extraCallbackParamsArray) {\n      arrayPushAll(combinedParams, extraCallbackParamsArray)\n    }\n    unmemoize(memos[i].memoId, combinedParams)\n    node.nodeValue = '' // Neuter this node so we don't try to unmemoize it again\n    if (node.parentNode) {\n      node.parentNode.removeChild(node)\n    } // If possible, erase it totally (not always possible - someone else might just hold a reference to it then call unmemoizeDomNodeAndDescendants again)\n  }\n}\n\nexport function parseMemoText(memoText: string | null): string | null {\n  if (!memoText) {\n    return null\n  }\n\n  const match = memoText.match(/^\\[ko_memo\\:(.*?)\\]$/)\n  return match ? match[1] : null\n}\n", "//\n//  Tasks Micro-scheduler\n//  ===\n//\n/* eslint no-cond-assign: 0 */\nimport options from './options'\nimport { deferError } from './error'\n\nlet taskQueue = new Array(),\n  taskQueueLength = 0,\n  nextHandle = 1,\n  nextIndexToProcess = 0\n\nconst schedulerGlobal = options.global\n\nif (schedulerGlobal && typeof schedulerGlobal.queueMicrotask === 'function') {\n  options.taskScheduler = callback => schedulerGlobal.queueMicrotask(callback)\n} else if (schedulerGlobal?.MutationObserver && schedulerGlobal.document && !schedulerGlobal.navigator?.standalone) {\n  options.taskScheduler = (function () {\n    let scheduledCallback: null | (() => void) = null\n    let toggle = false\n    const div = schedulerGlobal.document.createElement('div')\n\n    new schedulerGlobal.MutationObserver(function () {\n      const callback = scheduledCallback\n      scheduledCallback = null\n      callback?.()\n    }).observe(div, { attributes: true })\n\n    return function (callback: () => void) {\n      scheduledCallback = callback\n      toggle = !toggle\n      div.setAttribute('data-task-scheduler', toggle ? '1' : '0')\n    }\n  })()\n} else {\n  options.taskScheduler = callback => setTimeout(callback, 0)\n}\n\nfunction processTasks() {\n  if (taskQueueLength) {\n    // Each mark represents the end of a logical group of tasks and the number of these groups is\n    // limited to prevent unchecked recursion.\n    let mark = taskQueueLength,\n      countMarks = 0\n\n    // nextIndexToProcess keeps track of where we are in the queue; processTasks can be called recursively without issue\n    for (let task; nextIndexToProcess < taskQueueLength; ) {\n      if ((task = taskQueue[nextIndexToProcess++])) {\n        if (nextIndexToProcess > mark) {\n          if (++countMarks >= 5000) {\n            nextIndexToProcess = taskQueueLength // skip all tasks remaining in the queue since any of them could be causing the recursion\n            deferError(Error(\"'Too much recursion' after processing \" + countMarks + ' task groups.'))\n            break\n          }\n          mark = taskQueueLength\n        }\n        try {\n          task()\n        } catch (ex) {\n          deferError(ex)\n        }\n      }\n    }\n  }\n}\n\nfunction scheduledProcess() {\n  processTasks()\n\n  // Reset the queue\n  nextIndexToProcess = taskQueueLength = taskQueue.length = 0\n}\n\nfunction scheduleTaskProcessing() {\n  options.taskScheduler(scheduledProcess)\n}\n\nexport function schedule(func: () => any): number {\n  if (!taskQueueLength) {\n    scheduleTaskProcessing()\n  }\n\n  taskQueue[taskQueueLength++] = func\n  return nextHandle++\n}\n\nexport function cancel(handle: number) {\n  const index = handle - (nextHandle - taskQueueLength)\n  if (index >= nextIndexToProcess && index < taskQueueLength) {\n    taskQueue[index] = null\n  }\n}\n\n// For testing only: reset the queue and return the previous queue length\nexport function resetForTesting() {\n  const length = taskQueueLength - nextIndexToProcess\n  nextIndexToProcess = taskQueueLength = taskQueue.length = 0\n  return length\n}\n\nexport { processTasks as runEarly }\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAE,cAAc,KAAM;AACxB,iCAAqB;AACrB,uBAAW,MAAM,2CAA2C,aAAa,eAAe,CAAC;AACzF;AAAA,UACF;AACA,iBAAO;AAAA,QACT;AACA,YAAI;AACF,eAAK;AAAA,QACP,SAAS,IAAI;AACX,qBAAW,EAAE;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,mBAAmB;AAC1B,eAAa;AAGb,uBAAqB,kBAAkB,UAAU,SAAS;AAC5D;AAEA,SAAS,yBAAyB;AAChC,kBAAQ,cAAc,gBAAgB;AACxC;AAEO,SAAS,SAAS,MAAyB;AAChD,MAAI,CAAC,iBAAiB;AACpB,2BAAuB;AAAA,EACzB;AAEA,YAAU,iBAAiB,IAAI;AAC/B,SAAO;AACT;AAEO,SAAS,OAAO,QAAgB;AACrC,QAAM,QAAQ,UAAU,aAAa;AACrC,MAAI,SAAS,sBAAsB,QAAQ,iBAAiB;AAC1D,cAAU,KAAK,IAAI;AAAA,EACrB;AACF;AAGO,SAAS,kBAAkB;AAChC,QAAM,SAAS,kBAAkB;AACjC,uBAAqB,kBAAkB,UAAU,SAAS;AAC1D,SAAO;AACT;",
  "names": ["options", "_a", "childNodes", "setDomNodeChildren", "setDomNodeChildren", "childNodes", "_a", "setDomNodeChildren", "childNodes", "memos"]
}
