"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ValidNode=exports.ValidInput=exports.VTreeLike=exports.VTreeAttributes=exports.VTree=exports.TransitionStateNames=exports.TransitionStateName=exports.TransitionCache=exports.TransactionState=exports.TransactionConfig=exports.SyncTreeHookCache=exports.Supplemental=exports.StateCache=exports.ReleaseHookCache=exports.ParserConfig=exports.ParseHookCache=exports.PATCH_TYPE=exports.NodeCache=exports.NODE_TYPE=exports.Mount=exports.MiddlewareCache=exports.Middleware=exports.Internals=exports.GlobalConfig=exports.EMPTY=exports.CreateTreeHookCache=exports.CreateNodeHookCache=exports.Config=void 0;/**
 * @enum {number}
 */const NODE_TYPE={ELEMENT:1,ATTR:2,TEXT:3,COMMENT:8,FRAGMENT:11};/**
 * @enum {any}
 */exports.NODE_TYPE=NODE_TYPE;const EMPTY={STR:"",NUM:1,OBJ:/** @type {any} */{},ARR:[],MAP:new Map,SET:new Set,DOM:/** @type {HTMLElement} */{},FUN:()=>{}};/**
 * @enum {number}
 */exports.EMPTY=EMPTY;const PATCH_TYPE={SET_ATTRIBUTE:0,REMOVE_ATTRIBUTE:1,NODE_VALUE:2,INSERT_BEFORE:3,REPLACE_CHILD:4,REMOVE_CHILD:5};/**
 * @typedef {TransitionStateName[]} TransitionStateNames
 * @type {TransitionStateNames}
 */exports.PATCH_TYPE=PATCH_TYPE;const TransitionStateNames=["attached","detached","replaced","attributeChanged","textChanged"];/**
 * Creates a mapping of TransitionState
 *
 * @typedef {Map<TransitionStateName, Set<Function>>} TransitionCache
 */exports.TransitionStateNames=TransitionStateNames;const TransitionCache=new Map([["attached",new Set],["detached",new Set],["replaced",new Set],["attributeChanged",new Set],["textChanged",new Set]]);/**
 * Associates active transaction mount with state.
 *
 * @typedef {Map<Mount, TransactionState>} StateCache
 */exports.TransitionCache=TransitionCache;const StateCache=new Map;/**
 * Associates a VTree with a distinctive DOM Node.
 *
 * @typedef {Map<VTree, ValidNode>} NodeCache
 */exports.StateCache=StateCache;const NodeCache=new Map;/**
 * Stores middleware functions/objects which hook into the render flow.
 *
 * @typedef {Set<Function>} MiddlewareCache
 */exports.NodeCache=NodeCache;const MiddlewareCache=new Set;/**
 * @typedef {Set<Function>} CreateTreeHookCache
 */exports.MiddlewareCache=MiddlewareCache;const CreateTreeHookCache=new Set;/**
 * @typedef {(vTree: VTree) => ValidNode | void} CreateNodeHookCallback
 * @typedef {Set<CreateNodeHookCallback>} CreateNodeHookCache
 */exports.CreateTreeHookCache=CreateTreeHookCache;const CreateNodeHookCache=new Set;/**
 * @typedef {Set<Function>} SyncTreeHookCache
 */exports.CreateNodeHookCache=CreateNodeHookCache;const SyncTreeHookCache=new Set;/**
 * @typedef {Set<Function>} ReleaseHookCache
 */exports.SyncTreeHookCache=SyncTreeHookCache;const ReleaseHookCache=new Set;/**
 * @typedef {Set<Function>} ParseHookCache
 */exports.ReleaseHookCache=ReleaseHookCache;const ParseHookCache=new Set;/**
 * @typedef {'attached' | 'detached' | 'replaced' | 'attributeChanged' | 'textChanged'} TransitionStateName
 */exports.ParseHookCache=ParseHookCache;const TransitionStateName=EMPTY.OBJ;/**
 * @typedef {{ [key: string]: any }} VTreeAttributes
 *
 */exports.TransitionStateName=TransitionStateName;const VTreeAttributes=EMPTY.OBJ;/**
 * @typedef {Object} VTree
 *
 * @property {any} rawNodeName - unaltered extracted nodeName
 * @property {string} nodeName - lowercased, string, nodeName
 * @property {string} nodeValue - defines the text value associated
 * @property {number} nodeType - the type of Node this is representing
 * @property {string} key - A unique identifier for the children
 * @property {VTree[]} childNodes - Any nested elements
 * @property {VTreeAttributes} attributes - Any key/val attributes for the Node
 */exports.VTreeAttributes=VTreeAttributes;const VTree=EMPTY.OBJ;/**
 * @typedef {Object} VTreeLike

 * @property {any=} rawNodeName - unaltered extracted nodeName
 * @property {string=} nodeName - lowercased, string, nodeName, only required value
 * @property {string=} elementName - lowercased, string, elementName
 * @property {string=} nodeValue - defines the text value associated
 * @property {number=} nodeType - the type of Node this is representing
 * @property {string=} key - A unique identifier for the children
 * @property {VTreeLike[]=} childNodes - Any nested elements
 * @property {VTreeLike[]=} children - Any nested elements
 * @property {any=} attributes - Any key/val attributes for the Node
 */exports.VTree=VTree;const VTreeLike=EMPTY.OBJ;/**
 * @typedef {HTMLElement | ChildNode | Element | Text | Comment | DocumentFragment | Function | string | string[] | VTree | VTree[] | VTreeLike | VTreeLike[]} ValidInput
 */exports.VTreeLike=VTreeLike;const ValidInput=EMPTY.OBJ;/**
 * @typedef {Element | HTMLElement | Text | DocumentFragment | ChildNode} ValidNode
 */exports.ValidInput=ValidInput;const ValidNode=EMPTY.OBJ;/**
 * @typedef {ValidNode | VTree | VTree[] | VTreeLike | VTreeLike[]} Mount
 */exports.ValidNode=ValidNode;const Mount=EMPTY.OBJ;/**
 * @typedef {Object} Middleware
 *
 * @property {string=} displayName
 * @property {Function=} subscribe
 * @property {Function=} unsubscribe
 * @property {Function=} createTreeHook
 * @property {CreateNodeHookCallback=} createNodeHook
 * @property {Function=} syncTreeHook
 * @property {Function=} releaseHook
 * @property {Function=} parseHook
 */exports.Mount=Mount;const Middleware=EMPTY.OBJ;/**
 * @typedef {Object} ParserConfig
 *
 * @property {Boolean=} strict - Should the parser operate in strict mode
 * @property {Boolean=} trim - Trim surrounding whitespace nodes
 * @property {string[]=} rawElements - Set of raw element tagNames, empty is all
 * @property {string[]=} selfClosingElements - Set of self closing element tagNames, empty is all
 */exports.Middleware=Middleware;const ParserConfig=EMPTY.OBJ;/**
 * @typedef {Object} TransactionConfig
 *
 * @property {Boolean=} inner - to diff children or root
 * @property {Boolean=} executeScripts - to execute scripts or not
 * @property {Function[]=} tasks - to override tasks
 * @property {ParserConfig=} parser - override parser options
 * @property {Boolean=} disableMutationObserver - to disable mutation observer (enabled by default if available)
 */exports.ParserConfig=ParserConfig;const TransactionConfig=EMPTY.OBJ;/**
 * @typedef {Object} GlobalConfig
 *
 * @property {string=} NODE_ENV - To set the runtime execution mode
 * @property {Boolean=} collectMetrics - to collect performance metrics, defaults to false
 */exports.TransactionConfig=TransactionConfig;const GlobalConfig=EMPTY.OBJ;/**
 * @typedef {TransactionConfig & GlobalConfig & { [key: string]: unknown }} Config
 */exports.GlobalConfig=GlobalConfig;const Config={};/**
 * @typedef {Object} Supplemental
 *
 * @property {{ [key: string]: any }} tags
 * @property {{ [key: string]: any }} attributes
 * @property {{ [key: string]: any }} children
 */exports.Config=Config;const Supplemental=EMPTY.OBJ;/**
 * @typedef {Object} TransactionState
 *
 * @property {Function} measure
 * @property {Set<VTree>} svgElements
 * @property {Map<VTree, string | undefined>} scriptsToExecute
 * @property {VTree=} oldTree
 * @property {Boolean=} isRendering
 * @property {Boolean=} isDirty
 * @property {MutationObserver=} mutationObserver
 * @property {import('../transaction').default} activeTransaction
 * @property {import('../transaction').default=} nextTransaction
 * @property {Document=} ownerDocument
*/exports.Supplemental=Supplemental;const TransactionState=EMPTY.OBJ;/**
 * @typedef {Object} Internals
 *
 * @property {string=} VERSION
 * @property {GlobalConfig=} globalConfig
 * @property {Function} decodeEntities
 * @property {Function} escape
 * @property {Function} makeMeasure
 * @property {any} memory
 * @property {any} Pool
 * @property {any} process
 * @property {{ [key: string]: any }} PATCH_TYPE
 * @property {Function=} parse
 * @property {Function} createNode
 * @property {Function} syncTree
 * @property {unknown} Transaction
 * @property {Function[]} defaultTasks
 * @property {{ [key: string]: any }} tasks
 * @property {StateCache} StateCache
 * @property {NodeCache} NodeCache
 * @property {TransitionCache} TransitionCache
 * @property {MiddlewareCache} MiddlewareCache
 * @property {CreateTreeHookCache} CreateTreeHookCache
 * @property {CreateNodeHookCache} CreateNodeHookCache
 * @property {SyncTreeHookCache} SyncTreeHookCache
 * @property {ReleaseHookCache} ReleaseHookCache
 * @property {ParseHookCache} ParseHookCache
 */exports.TransactionState=TransactionState;const Internals=EMPTY.OBJ;exports.Internals=Internals;