import{r as o,h as t,H as s,c as r,g as i}from"./p-890a2f7e.js";import"./p-be8a42cb.js";import{T as l}from"./p-e5ee2c9c.js";import{M as e}from"./p-369e3f59.js";const a=class{constructor(t){o(this,t),this.open=!0,this.closable=!1}TriggerListener(o){l.is(o.detail)&&"close"==o.detail.name&&(this.open=!1)}hostData(){return{style:{display:this.open?"block":"none"}}}__stencil_render(){return[t("header",null,this.closable?t("smoothly-trigger",{fill:"clear",name:"close"},t("smoothly-icon",{name:"close-circle",fill:"solid",color:this.color})):[],this.header?t("h1",null,this.header):t("slot",{name:"header"})),t("main",null,t("slot",null))]}render(){return t(s,this.hostData(),this.__stencil_render())}};a.style=".sc-smoothly-dialog-h{display:block;position:fixed;left:0;top:0;width:100%;height:100%;z-index:1;background:rgba(var(--smoothly-default-color), var(--smoothly-semitransparent)) !important}[hidden].sc-smoothly-dialog-h{display:none}.sc-smoothly-dialog-h>header.sc-smoothly-dialog{border-top-left-radius:8px;border-top-right-radius:8px;margin-top:2em;color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color));border-color:rgb(var(--smoothly-primary-color))}.sc-smoothly-dialog-h:not([header]) header.sc-smoothly-dialog{border:none}.sc-smoothly-dialog-h>*.sc-smoothly-dialog{position:relative;color:rgb(var(--smoothly-default-contrast));background-color:rgb(var(--smoothly-default-color));border-color:rgb(var(--smoothly-color));border-width:1px;border-style:solid;max-width:40em;width:calc(100vw - 4em - 2px);max-height:calc(100vh - 6em - 2px);height:auto;margin-left:auto;margin-right:auto;border-collapse:collapse}.sc-smoothly-dialog-h>main.sc-smoothly-dialog{border-bottom-left-radius:8px;border-bottom-right-radius:8px;margin-bottom:2em;border:1px solid rgb(var(--smoothly-default-contrast));-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.sc-smoothly-dialog-h:not([header]) main.sc-smoothly-dialog{border-radius:8px}.sc-smoothly-dialog-h>*.sc-smoothly-dialog>smoothly-trigger.sc-smoothly-dialog{position:absolute;right:-2em;top:-2em;z-index:1;border-color:transparent}.sc-smoothly-dialog-h>*.sc-smoothly-dialog>smoothly-trigger.sc-smoothly-dialog:hover{border-color:transparent}.sc-smoothly-dialog-h smoothly-icon.sc-smoothly-dialog{background-color:rgb(var(--smoothly-color));border-radius:50%}.sc-smoothly-dialog-h>*.sc-smoothly-dialog>*.sc-smoothly-dialog{margin:10px}";const h=class{constructor(t){o(this,t),this.trigger=r(this,"trigger",7),this.message=r(this,"message",7)}get contentWindow(){const o=this.element&&this.element.firstElementChild?this.element.firstElementChild:void 0;return o&&o.contentWindow||void 0}get defaultOrigin(){const o=this.url.match(/^(([a-z]+\+)*[a-z]+:\/\/)?[^/^\n]+/);return o?o[0]:"*"}componentDidLoad(){var o;this.contentWindow&&e.listen(null!==(o=this.origin)&&void 0!==o?o:this.defaultOrigin,((o,t)=>{o==this.name&&(l.is(t)?this.trigger.emit(t):this.message.emit({destination:o,content:t}))}),window)}async send(o,t){var s,r;"string"==typeof o?e.send((null!==(s=this.origin)&&void 0!==s?s:this.defaultOrigin)+"#"+o,t,this.contentWindow):e.is(o)&&this.contentWindow&&e.send({destination:(null!==(r=this.origin)&&void 0!==r?r:this.defaultOrigin)+"#"+o.destination,content:o.destination},this.contentWindow)}render(){return t("iframe",{src:this.url+"#"+window.location.origin,height:"100%",width:"100%"})}get element(){return i(this)}};h.style=".sc-smoothly-frame-h{display:block;width:100%;height:100%}[hidden].sc-smoothly-frame-h{display:none}.sc-smoothly-frame-h>iframe.sc-smoothly-frame{border:none;padding:none;margin:none}";export{a as smoothly_dialog,h as smoothly_frame}