import{r as e,c as a,h as o,H as t}from"./p-3f9529e5.js";const r=":host{display:block}dialog{border:none !important;border-radius:var(--klevu-border-radius-m);padding:0;box-shadow:var(--klevu-elevation-1)}main{padding:var(--klevu-spacing-04)}header{padding:var(--klevu-spacing-04);display:flex;justify-content:space-between;align-items:center}button{border:none;background-color:transparent;appearance:none;border-radius:100%;height:30px;width:30px}";var n=undefined&&undefined.__classPrivateFieldGet||function(e,a,o,t){if(o==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof a==="function"?e!==a||!t:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?t:o==="a"?t.call(e):t?t.value:a.get(e)};var i=undefined&&undefined.__classPrivateFieldSet||function(e,a,o,t,r){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof a==="function"?e!==a||!r:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?r.call(e,o):r?r.value=o:a.set(e,o),o};var d,s,l;const c=class{constructor(o){e(this,o);this.klevuCloseModal=a(this,"klevuCloseModal",7);d.add(this);s.set(this,void 0);this.startOpen=false}componentDidLoad(){if(this.startOpen){this.openModal()}}async openModal(){var e;(e=n(this,s,"f"))===null||e===void 0?void 0:e.showModal()}async closeModal(){var e;(e=n(this,s,"f"))===null||e===void 0?void 0:e.close()}render(){return o(t,null,o("div",{part:"modal-base"},o("dialog",{ref:e=>i(this,s,e,"f"),onCancel:n(this,d,"m",l).bind(this),part:"modal-dialog"},o("header",{part:"modal-header"},o("slot",{name:"header"}),o("form",{method:"dialog",onSubmit:n(this,d,"m",l).bind(this)},o("button",null,o("klevu-icon",{name:"close"})))),o("main",{part:"modal-body"},o("slot",null)))))}};s=new WeakMap,d=new WeakSet,l=function e(a){const o=this.klevuCloseModal.emit();if(o.defaultPrevented){a.preventDefault()}};c.style=r;export{c as klevu_modal};
//# sourceMappingURL=p-91963b36.entry.js.map