{"version":3,"sources":["../sources/util.ts"],"names":["isElement","node","ownerDocument","defaultView","Element","isHTMLInputElement","HTMLInputElement","isHTMLSelectElement","HTMLSelectElement","isHTMLTextAreaElement","HTMLTextAreaElement","safeWindow","TypeError"],"mappings":"AAAA,OAAO,SAASA,SAAT,CAAmBC,IAAnB,EAAuD;AAC7D,SACC;AACAA,IAAAA,IAAI,KAAK,IAAT,IAAiBA,IAAI,YAAYA,IAAI,CAACC,aAAL,CAAmBC,WAAnB,CAA+BC;AAFjE;AAIA;AAED,OAAO,SAASC,kBAAT,CACNJ,IADM,EAEqB;AAC3B,SACCD,SAAS,CAACC,IAAD,CAAT,IACA;AACAA,EAAAA,IAAI,YAAYA,IAAI,CAACC,aAAL,CAAmBC,WAAnB,CAA+BG,gBAHhD;AAKA;AAED,OAAO,SAASC,mBAAT,CACNN,IADM,EAEsB;AAC5B,SACCD,SAAS,CAACC,IAAD,CAAT,IACA;AACAA,EAAAA,IAAI,YAAYA,IAAI,CAACC,aAAL,CAAmBC,WAAnB,CAA+BK,iBAHhD;AAKA;AAED,OAAO,SAASC,qBAAT,CACNR,IADM,EAEwB;AAC9B,SACCD,SAAS,CAACC,IAAD,CAAT,IACA;AACAA,EAAAA,IAAI,YAAYA,IAAI,CAACC,aAAL,CAAmBC,WAAnB,CAA+BO,mBAHhD;AAKA;AAED,OAAO,SAASC,UAAT,CAAoBV,IAApB,EAAwC;AAAA,aAE7CA,IAAI,CAACC,aAAL,KAAuB,IAAvB,GAA+BD,IAA/B,GAAmDA,IAAI,CAACC,aAFX;AAAA,MACtCC,WADsC,QACtCA,WADsC;;AAI9C,MAAIA,WAAW,KAAK,IAApB,EAA0B;AACzB,UAAM,IAAIS,SAAJ,CAAc,qBAAd,CAAN;AACA;;AACD,SAAOT,WAAP;AACA","sourcesContent":["export function isElement(node: Node | null): node is Element {\n\treturn (\n\t\t// @ts-ignore\n\t\tnode !== null && node instanceof node.ownerDocument.defaultView.Element\n\t);\n}\n\nexport function isHTMLInputElement(\n\tnode: Node | null\n): node is HTMLInputElement {\n\treturn (\n\t\tisElement(node) &&\n\t\t// @ts-ignore\n\t\tnode instanceof node.ownerDocument.defaultView.HTMLInputElement\n\t);\n}\n\nexport function isHTMLSelectElement(\n\tnode: Node | null\n): node is HTMLSelectElement {\n\treturn (\n\t\tisElement(node) &&\n\t\t// @ts-ignore\n\t\tnode instanceof node.ownerDocument.defaultView.HTMLSelectElement\n\t);\n}\n\nexport function isHTMLTextAreaElement(\n\tnode: Node | null\n): node is HTMLTextAreaElement {\n\treturn (\n\t\tisElement(node) &&\n\t\t// @ts-ignore\n\t\tnode instanceof node.ownerDocument.defaultView.HTMLTextAreaElement\n\t);\n}\n\nexport function safeWindow(node: Node): Window {\n\tconst { defaultView } =\n\t\tnode.ownerDocument === null ? (node as Document) : node.ownerDocument;\n\n\tif (defaultView === null) {\n\t\tthrow new TypeError(\"no window available\");\n\t}\n\treturn defaultView;\n}\n"],"file":"util.mjs"}