(function(){ var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e};!function(){"use strict";const e="Pagar con",t="dark",n="boldPaymentButton",o="boldEmbeddedCheckout",i="boldPaymentButtonStyles",d="boldPaymentIframeStyles",c="boldLogo",r=[`${n}--${t}`,`${n}--L`],a="bold-payment-button",u="bold-embedded-checkout",s="library",l="script",M="no-amount",g="embedded",h=["https://stg.checkout.bold.co","https://qa.checkout.bold.co","https://checkout.bold.co","http://localhost:3000"],N='@import"https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap";[id^=boldPaymentButton]{position:relative;display:flex;justify-content:center;align-items:center;border:none;font-family:Montserrat,sans-serif;font-weight:500;cursor:pointer;gap:8px;user-select:none}.boldPaymentButton--dark{background:linear-gradient(270deg,#ee424e 13.86%,#121e6c 83.33%);color:#fff;.boldLogo{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTkiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCA1OSAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE4LjA3NDEgMTMuNTY2NEgzMi4zNDlDMzIuMDA1OCAxNy4xNzAxIDI4LjkzNjUgMTkuOTk5NCAyNS4yMTA5IDE5Ljk5OTRDMjEuNDg1NCAxOS45OTk0IDE4LjQxNjcgMTcuMTcwMSAxOC4wNzM1IDEzLjU2NjRIMTguMDc0MVpNNy44ODk2NyA1LjgyNDV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zdG9wIG9mZnNldD0iMC4xMzg2MTQiIHN0b3AtY29sb3I9IiNFRTQyNEUiLz4KPHN0b3Agb2Zmc2V0PSIwLjgzMzMzMyIgc3RvcC1jb2xvcj0iIzEyMUU2QyIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPg==)}}.boldPaymentButton--L{height:48px;padding:16px 32px;border-radius:32px;font-size:14px;line-height:20px}.boldPaymentButton--M{height:40px;padding:12px 28px;border-radius:26.667px;font-size:12px;line-height:16px;.boldLogo{width:46px}}.boldPaymentButton--S{height:32px;padding:8px 20px;border-radius:21.333px;font-size:11px;line-height:12px;.boldLogo{width:40px}}';class m extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._addButtonHTMLToShadowDOM()}_addButtonHTMLToShadowDOM(){this.shadowRoot&&(this.shadowRoot.innerHTML=`\n \n \n `)}}function p(e){!function(e){e.originUrl||(e.originUrl=window.location.href)}(e),function(e){e.openingTime||(e.openingTime=String(Date.now()))}(e),function(e){if(!e.integrationType){const t="boldButton"in e?l:s,n=!e.amount||"0"===e.amount;e.integrationType=n?`${M}-${t}`:t}}(e)}function j(){return"customElements"in window&&"attachShadow"in Element.prototype}const D="#boldEmbeddedCheckout{position:fixed;z-index:2147483647;margin:auto;width:100%;height:100vh;display:flex;justify-content:center;align-items:center;background-color:#0009;inset:0}#boldEmbeddedCheckout iframe{max-width:1200px;background-color:#fff;border-radius:16px;border:none}@supports (max-height: 100dvh){#boldEmbeddedCheckout iframe{max-height:100dvh}}@supports not (max-height: 100vh){#boldEmbeddedCheckout iframe{max-height:100vh}}@media screen and (max-width: 430px){#boldEmbeddedCheckout iframe{width:calc(100% - 20px)}@supports (height: 100dvh){#boldEmbeddedCheckout iframe{height:calc(100dvh - 20px)}}@supports not (height: 100dvh){#boldEmbeddedCheckout iframe{height:calc(100vh - 20px)}}}@media screen and (min-width: 431px) and (max-width: 768px){#boldEmbeddedCheckout iframe{width:calc(100% - 20px)}@supports (height: 100dvh){#boldEmbeddedCheckout iframe{height:calc(100dvh - 200px)}}@supports not (height: 100dvh){#boldEmbeddedCheckout iframe{height:calc(100vh - 200px)}}}@media screen and (min-width: 769px) and (max-width: 1024px){#boldEmbeddedCheckout iframe{width:calc(100% - 50px);height:700px}}@media screen and (min-width: 1025px){#boldEmbeddedCheckout iframe{width:1024px;height:750px}}";class I extends HTMLElement{constructor(){super(),this._shadow=this.attachShadow({mode:"closed"})}connectedCallback(){const{_shadow:e}=this;this._addIframeHTMLToShadowDOM(e),this._shadow=null}_addIframeHTMLToShadowDOM(e){var t;if(!e)return;const n=null!=(t=this.getAttribute("src"))?t:"";e.innerHTML=`\n \n
\n \n
\n `}}function T(e){!function(){if(null!==document.head.querySelector(`#${d}`))return;const e=document.createElement("style");e.innerHTML=D,e.id=d,document.head.appendChild(e)}();const t=document.createElement("iframe");t.allow="clipboard-write *",t.src=e;const n=document.createElement("div");return n.id=o,n.appendChild(t),n}function b(e){const t=j(),n=(o=u,Boolean(customElements.get(o)));var o;t&&!n&&customElements.define(u,I);const i=t?function(e){const t=document.createElement(u);return t.setAttribute("src",e),t}(e):T(e);var d;return d=i,document.body.appendChild(d),i}function f(e){const t=[...h,window.location.origin],n=o=>{const{origin:i,data:d}=o;t.includes(i)&&"BOLD_CHECKOUT_EVENT"===(null==d?void 0:d.type)&&(e.remove(),window.removeEventListener("message",n))};window.addEventListener("message",n)}const y="BoldPaymentButton",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~=&";function k(e){const t=__spreadValues({},e);p(t);const n=function(e){return Object.keys(e).map((t=>{return`${n=t,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}=${e[t]}`;var n})).join("")}(t),o=function(e){let t="";for(let n=0;ne instanceof m))}(e);return Boolean(n)?n.previousElementSibling:t.previousElementSibling}function x(e){return b(k(e))}function O(e){window.location.href=k(e)}function A(e){const t=function(e){return e.dataset}(L(e)),{renderMode:n}=t;if(n!==g)O(t);else{f(x(t))}}function C(e){if(!e||!function(e){return new RegExp(`^(${t}|light)(-(S|M|L))?$`).test(e)}(e))return r;const o=e.split("-")[0],i=e.split("-")[1];return i?[`${n}--${o}`,`${n}--${i}`]:[`${n}--${o}`,`${n}--L`]}function S(t,o){const d=j(),r=Boolean(document.head.querySelector(`#${i}`)),u=Boolean(customElements.get(a));d&&!u&&customElements.define(a,m),d||r||function(){const e=document.createElement("style");e.innerHTML=N,e.id=i,document.head.appendChild(e)}();const s=d?document.createElement(a):function(t){const o=document.createElement("button");return o.type="button",o.id=t?`${n}-${t}`:n,o.innerHTML=`${e}`,o}(o),l=d?s.shadowRoot.querySelector(`#${n}`):s,M=C(t.dataset.boldButton);return l.classList.add(...M),l.addEventListener("click",A),s}class z{constructor(e){this.checkoutIframe=document.createElement("div"),this._config=e}open(){this.getCheckoutIframe().isConnected?console.warn("A payment is currently running, please wait for it to be completed or cancelled."):this.checkoutManagement()}getConfig(e){return this._config[e]}updateConfig(e,t){this._config[e]=t}getCheckoutIframe(){return this.checkoutIframe}setCheckoutIframe(e){this.checkoutIframe=e}checkoutManagement(){this.getConfig("renderMode")!==g?O(this._config):this.startEmbeddedCheckout()}startEmbeddedCheckout(){const e=x(this._config);this.setCheckoutIframe(e),f(e)}}var v;window&&void 0!==window.document&&(v=function(){document.querySelectorAll("script[data-bold-button]").forEach(((e,t)=>{var o,i,d;(function(e){const{nextElementSibling:t}=e;if(!t)return!1;const o=t.nodeName.toLowerCase(),i=o===a,d="button"===o&&t.id===n;return i||d})(e)||(i=o=e,d=S(o,t),i.insertAdjacentElement("afterend",d))}))},"complete"===document.readyState?v():window.attachEvent?window.attachEvent("onload",v):window.addEventListener("load",v,!1),window.BoldCheckout||(window.BoldCheckout=z))}(); })();