"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js"),styles=require("./common/styles.js"),DynamicCheckoutBlack_liquid=require("./icons/DynamicCheckoutBlack.liquid.js"),DynamicCheckoutPurple_liquid=require("./icons/DynamicCheckoutPurple.liquid.js"),DynamicCheckoutWhite_liquid=require("./icons/DynamicCheckoutWhite.liquid.js"),ExpressCheckoutBlack_liquid=require("./icons/ExpressCheckoutBlack.liquid.js"),ExpressCheckoutPurple_liquid=require("./icons/ExpressCheckoutPurple.liquid.js"),ExpressCheckoutWhite_liquid=require("./icons/ExpressCheckoutWhite.liquid.js");const ShopPayButton=({style:e,styles:s,setting:t,className:i,builderAttrs:r})=>{let u=helpers.getSPButton({styles:s,buttons:{DynamicCheckoutBlack:DynamicCheckoutBlack_liquid.default({}),DynamicCheckoutPurple:DynamicCheckoutPurple_liquid.default({}),DynamicCheckoutWhite:DynamicCheckoutWhite_liquid.default({}),ExpressCheckoutBlack:ExpressCheckoutBlack_liquid.default({}),ExpressCheckoutPurple:ExpressCheckoutPurple_liquid.default({}),ExpressCheckoutWhite:ExpressCheckoutWhite_liquid.default({})}}),l=system.createStyle({...styles.getButtonWrapperStyles(e,s)}),c=system.createClass({...classes.getButtonClasses()}),a=system.createClass({...classes.getButtonWrapperClasses(i)}),o=system.createAttr({disabled:!1,"aria-label":"Buy with Shop Pay"}),p=system.createStateOrContext({setting:JSON.stringify(t),shop_url:"{{shop.url}}"});return core.template`
    <gp-shop-pay-button
      ${{...r}}
      style="${l}"
      class="${a}"
      gp-data='${p}'
    >
      <button
        ${{...o}}
        class="${c}"
      >
        ${u}
      </button>
    </gp-shop-pay-button>
    ${system.If(core.isLocalEnv,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-shop-pay-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-shop-pay-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};exports.default=ShopPayButton;
