/*!
 * KoliBri - The accessible HTML-Standard
 */
import{a9 as e,K as n,a0 as t,h as o}from"./index-c3ae175d.js";const i=e=>{for(t()&&(o("↓ Search form element start."),console.log(e));e instanceof HTMLElement&&"FORM"!==e.tagName&&"KOL-FORM"!==e.tagName;){try{e=e.parentElement instanceof HTMLElement?e.parentElement:e.parentNode instanceof ShadowRoot?e.parentNode.host:null}catch(e){}t()&&(console.log(e),o("↑ Search form element finished."))}return e},s=(t={})=>{var o,a;const s=i(t.form);if(s instanceof HTMLElement){const t=new Event("reset",{bubbles:!0,cancelable:!0});if("FORM"===s.tagName)e(t,s),s.dispatchEvent(t);else if("KOL-FORM"===s.tagName){e(t,n.querySelector("form",s));const i=s;"function"==typeof(null===(o=i._on)||void 0===o?void 0:o.onReset)&&(null===(a=i._on)||void 0===a||a.onReset(t))}}},l=(t={})=>{var o,a;const s=i(t.form);if(s instanceof HTMLElement){const t=new SubmitEvent("submit",{bubbles:!0,cancelable:!0,submitter:s});if("FORM"===s.tagName)e(t,s),s.dispatchEvent(t),s.submit();else if("KOL-FORM"===s.tagName){e(t,n.querySelector("form",s));const i=s;"function"==typeof(null===(o=i._on)||void 0===o?void 0:o.onSubmit)&&(null===(a=i._on)||void 0===a||a.onSubmit(t))}}};export{s as a,l as p};