/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@litejs/dom@26.4.3/dom.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/*! litejs.com/MIT-LICENSE.txt */
"use strict";var boolAttrs={async:1,autoplay:1,loop:1,checked:2,defer:1,disabled:1,muted:1,multiple:1,nomodule:1,playsinline:1,readonly:1,required:1,selected:2},numAttrs="height size tabIndex width",numAttrsNeg="maxLength minLength",strAttrs="accept accesskey autocapitalize autofocus capture class contenteditable crossorigin dir for hidden href id integrity lang name nonce rel slot spellcheck src title type translate",defaultAttrs={"form method get":1,"input type text":1,"script type text/javascript":1,"style type text/css":1},voidElements={AREA:1,BASE:1,BR:1,COL:1,EMBED:1,HR:1,IMG:1,INPUT:1,KEYGEN:1,LINK:1,MENUITEM:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1},svgVoidElements={circle:1,ellipse:1,image:1,line:1,path:1,polygon:1,polyline:1,rect:1,stop:1,use:1},listeners=new WeakMap,rawTextElements={SCRIPT:/<(?=\/script)/i,STYLE:/<(?=\/style)/i},rawTextEscape={SCRIPT:/<(?=\/script|!--)/gi,STYLE:/<(?=\/style|!--)/gi},hasOwn=voidElements.hasOwnProperty,{CSS:CSS,CSSStyleDeclaration:CSSStyleDeclaration,CSSStyleSheet:CSSStyleSheet}=require("./css.js"),selector=require("./selector.js"),Node={ELEMENT_NODE:1,TEXT_NODE:3,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32,nodeName:null,parentNode:null,ownerDocument:null,childNodes:null,get nodeValue(){return 3===this.nodeType||8===this.nodeType?this.data:null},set nodeValue(e){3!==this.nodeType&&8!==this.nodeType||(this.data=e)},get textContent(){return 3===this.nodeType||8===this.nodeType?this.data:this.childNodes.map((e=>e.textContent)).join("")},set textContent(e){3===this.nodeType||8===this.nodeType?this.data=e:(removeChilds(this),this.appendChild(this.ownerDocument.createTextNode(rawTextEscape[this.tagName]?e.replace(rawTextEscape[this.tagName],"<\\"):e)))},get firstChild(){return this.childNodes&&this.childNodes[0]||null},get lastChild(){return this.childNodes&&this.childNodes[this.childNodes.length-1]||null},get nextSibling(){return getSibling(this,1,0)},get previousSibling(){return getSibling(this,-1,0)},get innerHTML(){return Node.toString.call(this)},set innerHTML(e){for(var t,n,r,s,i=this,o=i.ownerDocument||i,a=/<(!--([\s\S]*?)--!?|!\[CDATA\[([\s\S]*?)\]\]|[?!][\s\S]*?)>|<(\/?)([^ \/>]+)((?:("|')(?:\\\7|[\s\S])*?\7|[^>])*?)(\/?)>|[^<]+|</g,l=/([^=\s]+)(?:\s*=\s*(("|')((?:\\\3|[\s\S])*?)\3|[^\s"'`=<>]+)|)/g,d=o.createDocumentFragment(),c=d,h="svg"===o.documentElement.tagName?svgVoidElements:voidElements;n=a.exec(e);)if(n[4])c=c.parentNode||c;else if(n[5])if(t="text/html"===o.contentType?o.createElement(n[5]):o.createElementNS(null,n[5]),n[6]&&n[6].replace(l,u),c.appendChild(t),r=rawTextElements[t.tagName]){for(s="";(n=a.exec(e))&&!r.test(n[0]);s+=n[3]||n[0]);if(t.textContent=s.replace(unescRe,unescFn),!n)break}else h[t.tagName]||n[8]||(c=t);else c.appendChild(n[2]?o.createComment(n[2].replace(unescRe,unescFn)):n[1]?o.createDocumentType(n[1]):o.createTextNode(n[0].replace(unescRe,unescFn)));function u(e,n,r,s,i){t.setAttribute(n,(s?i:r||"").replace(unescRe,unescFn))}removeChilds(i),i.appendChild(d)},get style(){return this._style||(this._style=CSSStyleDeclaration(this.getAttribute("style")||""))},set style(e){this.style.cssText=e},appendChild(e){return this.insertBefore(e)},cloneNode(e){var t=this,n=new t.constructor(t.tagName||t.data);return n.ownerDocument=t.ownerDocument,mergeAttributes(t,n),e&&t.hasChildNodes()&&t.childNodes.forEach((t=>n.appendChild(t.cloneNode(e)))),n},compareDocumentPosition(e){var t=this;if(t===e)return 0;if(t.getRootNode()!==e.getRootNode())return Node.DOCUMENT_POSITION_DISCONNECTED;if(t.contains(e))return Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING;if(e.contains(t))return Node.DOCUMENT_POSITION_CONTAINS|Node.DOCUMENT_POSITION_PRECEDING;for(;t;t=t.nextSibling||t.parentNode&&t.parentNode.nextSibling)if(t===e)return Node.DOCUMENT_POSITION_FOLLOWING;return Node.DOCUMENT_POSITION_PRECEDING},contains(e){for(;e;e=e.parentNode)if(e===this)return!0;return!1},getRootNode(){for(var e=this;e.parentNode;)e=e.parentNode;return e},hasChildNodes(){return!!this.firstChild},insertBefore(e,t){var n=this,r=n.childNodes;if(11===e.nodeType)for(;e.firstChild;)n.insertBefore(e.firstChild,t);else e.parentNode&&e.parentNode.removeChild(e),e.parentNode=n,r.splice(t?r.indexOf(t):r.length,0,e),9===n.nodeType&&1===e.nodeType&&(n.documentElement=e,n.body=e.querySelector("body"));return e},removeChild(e){var t=this.childNodes.indexOf(e);if(-1===t)throw Error("NOT_FOUND_ERR");return this.childNodes.splice(t,1),e.parentNode=null,e},replaceChild(e,t){return this.insertBefore(e,t),this.removeChild(t)},querySelector(e){return selector.find(this,e,1)},querySelectorAll(e){return selector.find(this,e)},toString(e){return rawTextElements[this.tagName]?"STYLE"===this.tagName&&(!0===e||e&&e.css)?"\n"+CSS.minify(makeSheet(this),"object"==typeof e.css?e.css:null)+"\n":this.textContent:this.childNodes.map((t=>t.toString(e))).join("")},toJSON(){var e=this,t={name:e.nodeName};return 1===e.nodeType&&(t.attributes={},e.attributes.names().forEach((n=>t.attributes[n]=e.getAttribute(n)))),1===e.nodeType||9===e.nodeType?t.children=e.childNodes.map((e=>e.toJSON())):t.data=e.data,t}},Element={get children(){return this.childNodes.filter((e=>1===e.nodeType))},get firstElementChild(){return getElement(this.childNodes,0,1)},get lastElementChild(){return getElement(this.childNodes,this.childNodes.length-1,-1)},get nextElementSibling(){return getSibling(this,1,1)},get previousElementSibling(){return getSibling(this,-1,1)},get outerHTML(){return this.toString()},set outerHTML(e){var t=this.ownerDocument.createDocumentFragment();t.innerHTML=e,this.parentNode.replaceChild(t,this)},replaceChildren(){removeChilds(this);for(var e=0,t=arguments.length;e<t;)this.insertBefore(arguments[e++])},hasAttribute(e){return null!=this.attributes.getNamedItem(e)},getAttribute(e){var t=this.attributes.getNamedItem(e);return t?t.value:null},setAttribute(e,t){this.attributes.setNamedItem(new Attr(this,e,t))},removeAttribute(e){this.attributes.removeNamedItem(e)},getElementsByTagName(e){return selector.find(this,e)},getElementsByClassName(e){return selector.find(this,"."+e.replace(/\s+/g,"."))}},quotedAttrRe=/[\s"'`=<>]/,escRe=/<|&(?=[a-z#])/gi,escFn=e=>"<"===e?"&lt;":"&amp;",unescRe=/&[a-z]{1,31};?|&#(x|)([\da-f]+);/gi,unescFn=(e,t,n)=>n?String.fromCharCode(parseInt(n,""===t?10:16)):entities[e]||e,entities={"&amp;":"&","&apos;":"'","&cent;":"¢","&copy;":"©","&curren;":"¤","&deg;":"°","&euro;":"€","&gt;":">","&lt;":"<","&nbsp;":" ","&plusmn;":"±","&pound;":"£","&quot;":'"',"&reg;":"®","&sect;":"§","&sup2;":"²","&sup3;":"³","&yen;":"¥"};function addGetter(e,t){var n=e.toLowerCase();Object.defineProperty(Element,t[e]||e,{configurable:!0,enumerable:!0,get:t.isDirty?function(){return"_"+n in this?this["_"+n]:this.hasAttribute(n)}:t.isBool?function(){return this.hasAttribute(n)}:t.isNum?function(){var e=this.getAttribute(n);return null!=e?+e||0:t.numDefault||0}:function(){return this.getAttribute(n)||""},set(e){t.isDirty?this["_"+n]=!!e:t.isBool&&!e?this.removeAttribute(n):this.setAttribute(n,e)}})}function Attr(e,t,n){this.ownerElement=e,this.name=t,this.value=""+n}function Event(e,t){Object.assign(this,{type:e,bubbles:!1,cancelable:!1,defaultPrevented:!1},t)}function NamedNodeMap(e){Object.defineProperties(this,{length:{get(){return this.names().length}},ownerElement:{value:e}})}function DocumentFragment(){this.childNodes=[]}function HTMLElement(e){var t=this;t.attributes=new NamedNodeMap(t),t.childNodes=[],t.localName=e.toLowerCase(),t.nodeName=t.tagName=e.toUpperCase()}function ElementNS(e,t){var n=this;n.attributes=new NamedNodeMap(n),n.childNodes=[],n.namespaceURI=e,n.nodeName=n.tagName=n.localName=t}function Text(e){this.data=""+e}function Comment(e){this.data=e}function DocumentType(e){this.data=e}function Document(){this.childNodes=[],this.attributes=new NamedNodeMap(this),this.appendChild(this.createElement("html")).appendChild(this.body=this.createElement("body"))}function DOMParser(){}function XMLSerializer(){}function own(e){return function(t,n){var r=new e(t,n);return r.ownerDocument=this,r}}function extendNode(e,t){e.prototype=Object.create(Node);for(var n=1;t=arguments[n++];)Object.defineProperties(e.prototype,Object.getOwnPropertyDescriptors(t));e.prototype.constructor=e}function removeChilds(e){e.childNodes.forEach((e=>e.parentNode=null)),e.childNodes.length=0}function getElement(e,t,n){if(e&&t>-1)for(;e[t];t+=n)if(1===e[t].nodeType)return e[t];return null}function getSibling(e,t,n){var r=e.parentNode&&e.parentNode.childNodes,s=r?r.indexOf(e):-1;return n?getElement(r,s+t,t):r&&r[s+t]||null}function makeSheet(e){if("STYLE"===e.tagName||"LINK"===e.tagName&&"stylesheet"===e.rel&&e.href)return new CSSStyleSheet({href:e.href,ownerNode:e},"STYLE"===e.tagName&&e.textContent)}function mergeAttributes(e,t){e&&t&&e.attributes&&e.attributes.names().forEach((n=>t.setAttribute(n,e.getAttribute(n))))}Object.keys(boolAttrs).forEach((e=>addGetter(e,{isBool:!0,isDirty:boolAttrs[e]>1,readonly:"readOnly"}))),numAttrs.split(" ").forEach((e=>addGetter(e,{isNum:!0}))),numAttrsNeg.split(" ").forEach((e=>addGetter(e,{isNum:!0,numDefault:-1}))),strAttrs.split(" ").forEach((e=>addGetter(e,{for:"htmlFor",class:"className"}))),["hasAttribute","getAttribute","setAttribute","removeAttribute"].forEach((e=>{Element[e+"NS"]=function(t,n,r){if("setAttribute"!==e&&t){var s=(":"+n).toLowerCase();for(var i in this.attributes)if(i.endsWith(s))return this[e](i)}return this[e](n,r)}})),Event.prototype={stopPropagation(){this.bubbles=!1},preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}},NamedNodeMap.prototype={names(){return this.getNamedItem("style"),Object.keys(this)},getNamedItem(e){var t=e.toLowerCase(),n=this[t]||null;return"style"===t&&this.ownerElement._style&&(null===n&&(n=this[t]=new Attr(this.ownerElement,e,"")),n.value=this.ownerElement._style.cssText),n},removeNamedItem(e){var t=e.toLowerCase(),n=this[t]||null;return"style"===t&&delete this.ownerElement._style,null!==n&&delete this[t],n},setNamedItem(e){var t=this.getNamedItem(e.name);return this[e.name.toLowerCase()]=e,t},toString(e){var t=this,n=t.ownerElement.tagName,r="application/xml"===t.ownerElement.ownerDocument.contentType;return t.names().map((s=>{"style"===s&&e&&t.ownerElement.style;var i=t.getNamedItem(s),o=i.name,a=i.value.replace(escRe,escFn);if(!r){if(hasOwn.call(boolAttrs,s))return o;if(e){if(a="on"===s.slice(0,2)?a.replace(/^[\s\uFEFF\xA0;]+|[\s\uFEFF\xA0;]+$/g,""):a.replace(/\s+/g," ").trim(),hasOwn.call(defaultAttrs,(n+" "+o+" "+a).toLowerCase()))return;if(!quotedAttrRe.test(a))return o+"="+a;if(a.split('"').length>a.split("'").length)return o+"='"+a.replace(/'/g,"&#39;")+"'"}o=s}return o+'="'+a.replace(/"/g,"&quot;")+'"'})).filter(Boolean).join(" ")}},extendNode(DocumentFragment,Node,{nodeType:11,nodeName:"#document-fragment"}),extendNode(HTMLElement,Element,{localName:null,namespaceURI:"http://www.w3.org/1999/xhtml",nodeType:1,tagName:null,get elements(){return"FORM"===this.tagName?selector.find(this,"input,select,textarea,button"):void 0},get labels(){if(selector.matches(this,"input,select,textarea,button")){var e=this.id?selector.find(this.ownerDocument,"label[for='"+this.id+"']"):[],t=selector.closest(this,"label");return t&&e.indexOf(t)<0&&e.push(t),e}},get sheet(){return makeSheet(this)},blur(){this.ownerDocument.activeElement=this.ownerDocument.body||null},click(){this.dispatchEvent(new Event("click",{bubbles:!0,cancelable:!0}))},closest(e){return selector.closest(this,e)},addEventListener(e,t){var n=listeners.get(this);n||listeners.set(this,n={}),(n[e]||(n[e]=[])).push(t)},dispatchEvent(e){e.target||(e.target=this);var t=(listeners.get(this)||{})[e.type];t&&t.forEach((function(t){t.call(this,e)}),this),e.bubbles&&this.parentNode&&this.parentNode.dispatchEvent&&this.parentNode.dispatchEvent(e)},removeEventListener(e,t){var n=(listeners.get(this)||{})[e],r=n?n.indexOf(t):-1;r>-1&&n.splice(r,1)},focus(){this.ownerDocument.activeElement=this},matches(e){return selector.matches(this,e)},toString(e){var t=this.attributes.toString(e),n="application/xml"===this.ownerDocument.contentType,r="svg"===this.ownerDocument.documentElement.tagName?svgVoidElements:voidElements,s=r[this.tagName]?null:Node.toString.call(this,e);return e&&"STYLE"===this.tagName&&!s.trim()?"":"<"+this.localName+(t?" "+("/"===t.slice(-1)?t+" ":t):"")+(r[this.tagName]?n?"/>":">":">"+s+"</"+this.localName+">")}}),ElementNS.prototype=HTMLElement.prototype,extendNode(Text,{nodeType:3,nodeName:"#text",toString(e){return(e?(""+this.data).trim():""+this.data).replace(escRe,escFn)}}),extendNode(Comment,{nodeType:8,nodeName:"#comment",toString(e){return e?"":"\x3c!--"+this.data+"--\x3e"}}),extendNode(DocumentType,{nodeType:10,toString(){return"<"+this.data+">"}}),extendNode(Document,Element,{get styleSheets(){return selector.find(this,"style,link[rel=stylesheet][href]").map((e=>e.sheet))},get title(){var e=selector.find(this,"title",1);return e&&e.textContent||""},set title(e){(selector.find(this,"title",1)||this.appendChild(this.createElement("title"))).textContent=e},nodeType:9,nodeName:"#document",contentType:"text/html",createElement:own(HTMLElement),createElementNS:own(ElementNS),createTextNode:own(Text),createComment:own(Comment),createDocumentType:own(DocumentType),createDocumentFragment:own(DocumentFragment),getElementById(e){return selector.find(this,"#"+e,1)}}),DOMParser.prototype.parseFromString=(e,t)=>{var n=new Document;return n.contentType=t||"text/html",n.documentElement.outerHTML=e,n},XMLSerializer.prototype.serializeToString=e=>e.toString(),exports.document=new Document,exports.entities=entities,exports.mergeAttributes=mergeAttributes,exports.selectorSplit=selector.selectorSplit,exports.CSS=CSS,exports.CSSStyleDeclaration=CSSStyleDeclaration,exports.CSSStyleSheet=CSSStyleSheet,exports.DOMParser=DOMParser,exports.Document=Document,exports.DocumentFragment=DocumentFragment,exports.Event=Event,exports.HTMLElement=HTMLElement,exports.Node=Node,exports.XMLSerializer=XMLSerializer;
//# sourceMappingURL=/sm/58434385c5f21f08e0e333c81d6f3ec17b08688fadafc10ea2731bbc3b7dae10.map