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