"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("@gem-sdk/system"),s=require("../common/attrs.js"),a=require("../common/styles.js"),l=require("../common/classes.js"),r=require("../../helpers.js");exports.default=i=>{let{setting:o,children:n,builderProps:c,style:d,advanced:g,builderAttrs:y,pageContext:C}=i,p=g?.d,{frequency:$=3,triggerPercentage:S=0,trigger:u,triggerTime:v,frequencyMode:f="once",mobileTrigger:b,mobileTriggerTime:m,closeOnClickOutside:A}=o??{},{name:L,fullScreen:B,width:j,height:q,position:O,overlayColor:x,overlayOpacity:E,iconSize:h,closeButtonPosition:k,iconSvg:D}=o??{},I=o?.dialogId??c?.uid,P=t.createStateOrContext({dialogId:I,trigger:u,triggerTime:v,frequency:$,triggerPercentage:S,mobileTrigger:b,mobileTriggerTime:m,closeOnClickOutside:A,frequencyMode:f,display:p}),_=t.createAttr({...s.getAttr({uid:c?.uid||""})}),M=t.createStyle({...a.getWrapperStyle(p)}),R=t.createClass({...l.getContainClasses(g?.cssClass,E,x)}),z=t.createAttr({...s.getAttrContainer({uid:I||""})}),G=t.createStyle({...a.getContainStyle()}),N=t.createClass({...l.getBackdropClasses(O)}),w=t.createStyle({...a.getBackdropStyle(d)}),H=t.createAttr({...s.getAttrOverlay()}),J=t.createClass({...l.getOverlayClasses()}),T=t.createStyle({...a.getOverlayStyle(E,x,d)}),U=t.createStyle({...a.getDialogContentStyle({style:d,width:j,height:q,fullScreen:B})}),V=t.createClass({...l.getDialogContentClasses({setting:o,enableEffect:!0,isILP:!1})}),W=t.createAttr({...s.getAttrClose()}),F=t.createClass({...l.getHeadContentClasses()}),K=t.createStyle({...a.getButtonContentStyle(o)}),Q=t.createClass({...l.getButtonContentClasses(k)}),X=t.createStyle({...a.getSvgContentStyle(h)}),Y=t.createClass({...l.getSvgContentClasses()}),Z=t.createStyle({...a.getBodyContentStyle({setting:o,style:d,uid:c?.uid,pageContext:C??{},type:"Liquid"})}),ee=t.createClass({...l.getBodyContentClasses()});return e.template`
    <gp-dialog
      ${{..._}}
      class="${r.getSettingPreloadData("gps-lazy")}"
      style="${M}"
      data-gp-setting='${JSON.stringify(P)}'>
      <dialog
        aria-label="${L}"
        ${{...z}}
        class="${R}"
        style="${G}"
      >
        <div aria-label="Backdrop" class="${N}" style="${w}">
        ${t.If(!!x,e.template`
            <div
              ${{...H}}
              class="${J}"
              style="${T}"
              aria-hidden=true
            ></div>
        `)}
          <span class="${F}"></span>
          <div
            role="dialog"
            aria-label="Dialog content"
            ${{...y}}
            class="${V}"
            style="${U}"
          >
            <button
              ${{...W}}
              type="button"
              tabindex="-1"
              class="${Q}"
              style="${K}"
            >
              <span style="${X}" class="${Y}">
              ${D??`<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
                <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
              </svg>`}
              </span>
            </button>
            <div
              aria-label="Dialog body"
              style="${Z}"
              class="${ee}">
                <div>
                  ${n??""}
                </div>
            </div>
          </div>
        </div>
      </dialog>
    </gp-dialog>
    ${e.RenderIf(e.isLocalEnv,'<script src="{{ \'gp-dialog-v7-5.js\' | asset_url }}" defer="defer"></script>',`<script src="${e.baseAssetURL}/assets-v2/gp-dialog-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};
