import { a3 as b, U as h, X as g, V as e, a5 as d, dV as f, aG as $, dW as S, H as l, ad as s, I as u, ae as i, af as r, a4 as o, am as y, ag as C, ah as x, aj as V, ai as F } from "./56c67d3b.js";
import { useContext as p } from "react";
import "react-dom";
const P = b.div`
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: ${(a) => a.$style.borderWidth ? a.$style.borderWidth : "1px"}
    solid ${(a) => a.$style.border};
  border-radius: calc(min(${(a) => a.$style.radius}, 20px));
rotate:${(a) => a.$style.rotation};
margin:${(a) => a.$style.margin};
padding:${(a) => a.$style.padding};
${(a) => a.$animationStyle}
  iframe {
    border: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: ${(a) => a.$style.background};
  }
`, c = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)/g;
let m = new h({
  url: g,
  allowDownload: e,
  allowSubmitForm: e,
  allowMicrophone: e,
  allowCamera: e,
  allowPopup: e,
  style: d(f, "style"),
  animationStyle: d($, "animationStyle")
}, (a) => {
  const t = ["allow-scripts", "allow-same-origin"];
  a.allowSubmitForm && t.push("allow-forms"), a.allowDownload && t.push("allow-downloads"), a.allowPopup && t.push("allow-popups");
  const n = [];
  a.allowCamera && n.push("camera"), a.allowMicrophone && n.push("microphone");
  const w = c.test(a.url) ? a.url : "about:blank";
  return S.log(a.url, c.test(a.url) ? a.url : "about:blank", w), /* @__PURE__ */ l(P, {
    $style: a.style,
    $animationStyle: a.animationStyle,
    children: /* @__PURE__ */ l("iframe", {
      src: w,
      sandbox: t.join(" "),
      allow: n.join(";")
    })
  });
}).setPropertyViewFn((a) => /* @__PURE__ */ s(u, {
  children: [/* @__PURE__ */ l(i, {
    name: r.basic,
    children: a.url.propertyView({
      label: "Source URL",
      placeholder: "https://example.com",
      tooltip: o("iframe.URLDesc")
    })
  }), ["logic", "both"].includes(p(y).editorModeStatus) && /* @__PURE__ */ s(i, {
    name: r.interaction,
    children: [C(a), a.allowDownload.propertyView({
      label: o("iframe.allowDownload")
    }), a.allowSubmitForm.propertyView({
      label: o("iframe.allowSubmitForm")
    }), a.allowMicrophone.propertyView({
      label: o("iframe.allowMicrophone")
    }), a.allowCamera.propertyView({
      label: o("iframe.allowCamera")
    }), a.allowPopup.propertyView({
      label: o("iframe.allowPopup")
    })]
  }), ["layout", "both"].includes(p(y).editorModeStatus) && /* @__PURE__ */ s(u, {
    children: [/* @__PURE__ */ l(i, {
      name: r.style,
      children: a.style.getPropertyView()
    }), /* @__PURE__ */ l(i, {
      name: r.animationStyle,
      hasTooltip: !0,
      children: a.animationStyle.getPropertyView()
    })]
  })]
})).build();
m = class extends m {
  autoHeight() {
    return !1;
  }
};
const k = x(m, [new V("url", o("iframe.URLDesc")), F]);
export {
  k as IFrameComp
};
