@rebilly/instruments 3.14.2-beta.0 → 3.14.5-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  @author Jacob Kelley <jakie8@gmail.com>
6
6
  @license MIT
7
7
  **/
8
- var e="application/x-postmate-v1+json",t=0,n=0;var r={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},i=function(t,n){return("string"!=typeof n||t.origin===n)&&(!!t.data&&(("object"!=typeof t.data||"postmate"in t.data)&&(t.data.type===e&&!!r[t.data.postmate])))},a=function(){function n(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.childId=e.childId,this.events={},this.listener=function(e){if(!i(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,a=n.name;"emit"===e.data.postmate&&e.data.childId===t.childId&&a in t.events&&t.events[a].forEach((function(e){e.call(t,r)}))},this.parent.addEventListener("message",this.listener,!1)}var r=n.prototype;return r.get=function(n){var r=this;return new s.Promise((function(i){var a=++t;r.parent.addEventListener("message",(function e(t){t.data.uid===a&&"reply"===t.data.postmate&&t.data.childId===r.childId&&(r.parent.removeEventListener("message",e,!1),i(t.data.value))}),!1),r.child.postMessage({postmate:"request",type:e,property:n,uid:a},r.childOrigin)}))},r.call=function(t,n){this.child.postMessage({postmate:"call",type:e,property:t,data:n},this.childOrigin)},r.on=function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)},r.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},n}(),o=function(){function t(t){var n=this;this.model=t.model,this.parent=t.parent,this.parentOrigin=t.parentOrigin,this.child=t.child,this.childId=t.childId,this.child.addEventListener("message",(function(t){if(i(t,n.parentOrigin)){var r=t.data,a=r.property,o=r.uid,l=r.data;"call"!==t.data.postmate?function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return s.Promise.resolve(n)}(n.model,a).then((function(r){return t.source.postMessage({property:a,postmate:"reply",type:e,childId:n.childId,uid:o,value:r},t.origin)})):a in n.model&&"function"==typeof n.model[a]&&n.model[a](l)}}))}return t.prototype.emit=function(t,n){this.parent.postMessage({postmate:"emit",type:e,childId:this.childId,value:{name:t,data:n}},this.parentOrigin)},t}(),s=function(){function t(e){var t=e.container,r=void 0===t?void 0!==r?r:document.body:t,i=e.model,a=e.url,o=e.name,s=e.classListArray,l=void 0===s?[]:s;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",l.length>0&&this.frame.classList.add.apply(this.frame.classList,l),r.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=i||{},this.childId=++n,this.sendHandshake(a)}return t.prototype.sendHandshake=function(n){var r,o=this,s=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r}(n),l=0;return new t.Promise((function(t,u){o.parent.addEventListener("message",(function e(n){return!!i(n,s)&&(n.data.childId===o.childId&&("handshake-reply"===n.data.postmate?(clearInterval(r),o.parent.removeEventListener("message",e,!1),o.childOrigin=n.origin,t(new a(o))):u("Failed handshake")))}),!1);var c=function(){if(++l>5)return clearInterval(r),u("Handshake Timeout Reached");o.child.postMessage({postmate:"handshake",type:e,model:o.model,childId:o.childId},s)},d=function(){c(),r=setInterval(c,500)};o.frame.attachEvent?o.frame.attachEvent("onload",d):o.frame.addEventListener("load",d),o.frame.src=n}))},t}();s.debug=!1,s.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),s.Model=function(){function t(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return t.prototype.sendHandshakeReply=function(){var t=this;return new s.Promise((function(n,r){t.child.addEventListener("message",(function i(a){if(a.data.postmate){if("handshake"===a.data.postmate){t.child.removeEventListener("message",i,!1),a.source.postMessage({postmate:"handshake-reply",type:e,childId:a.data.childId},a.origin),t.childId=a.data.childId,t.parentOrigin=a.origin;var s=a.data.model;return s&&Object.keys(s).forEach((function(e){t.model[e]=s[e]})),n(new o(t))}return r("Handshake Reply Failed")}}),!1)}))},t}();const l=["Google Pay","Apple Pay","paypal"],u=["payment-card","ach"];function c({state:e}){var t;const n={EXPRESS_METHODS:[],METHODS:[]};return null===(t=e.data.readyToPay)||void 0===t||t.forEach((e=>{(({method:e,feature:t})=>l.includes(e)||l.includes(null==t?void 0:t.name))(e)?n.EXPRESS_METHODS.push(e):(({method:e})=>u.includes(e))(e)&&n.METHODS.push(e)})),window.ApplePaySession||(n.EXPRESS_METHODS=n.EXPRESS_METHODS.filter((e=>{var t;return"Apple Pay"!==(null==e||null===(t=e.feature)||void 0===t?void 0:t.name)})),e.loader.stopLoading({id:"applePay-express"})),n}function d(e){return e instanceof Element||e instanceof HTMLDocument}const p=(e="0px")=>`\n <div class="rebilly-instruments-loader is-active" style="padding: ${e}"></div>\n`,f='\n <div class="rebilly-instruments-loader-spinner"></div>\n';class m{constructor(){this.summary=[],this.form=[],this.modal=[],this.DOM={loaderContainer:p,summaryLoaderHTML:'\n <div class="rebilly-instruments-summary-loader-total rebilly-instruments-loader-display-flex rebilly-instruments-loader-align-center rebilly-instruments-loader-justify-space-between">\n <div><p class="is-el-loading">Total</p></div>\n <p class="total is-el-loading">$99.99</p>\n </div>\n',methodsLoaderHTML:'\n <div class="rebilly-instruments-methods-loader">\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-divider">\n <span class="rebilly-instruments-divider-label"><span class="is-el-loading">Divi</span></span>\n </div>\n <div class="rebilly-instruments-loader-display-flex rebilly-instruments-loader-justify-end">\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-form-fields">\n <div class="rebilly-instruments-loader-form-label"><small class="is-el-loading">Card holder name</small></div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-button">Continue</div> \n </div>\n',basicLoaderHTML:f}}addDOMElement({section:e="form",el:t=null}={}){d(t)&&(t.style.position="relative",this.DOM[e]=t)}startLoading({section:e="form",id:t=""}={}){var n;this[e].push(t);const r=document.querySelector(":root");let i="240px";if(null!==(n=this.DOM)&&void 0!==n&&n[e]){var a;let n=this.DOM[e].querySelector(".rebilly-instruments-loader");const{padding:o,paddingTop:s,paddingBottom:l}=getComputedStyle(null===(a=this.DOM)||void 0===a?void 0:a[e]);n?((t.includes("confirmation")||t.includes("result")||t.includes("modal"))&&(n.innerHTML=this.DOM.basicLoaderHTML),n.classList.add("is-active")):(this.DOM[e].innerHTML=p(`${parseFloat(o)+2}px`),n=this.DOM[e].querySelector(".rebilly-instruments-loader"),"form"===e?(n.insertAdjacentHTML("afterbegin",this.DOM.methodsLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-methodLoaderMinHeight")):"summary"===e&&(n.insertAdjacentHTML("afterbegin",this.DOM.summaryLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-summaryLoaderMinHeight"))),this.DOM[e].style.minHeight=`calc(${i} + ${s} + ${l} + 4px)`}}stopLoading({section:e="form",id:t=""}={}){const n=this[e].indexOf(t);-1!==n&&this[e].splice(n,1),!this[e].length&&this.DOM[e].querySelector(".rebilly-instruments-loader")&&(this.DOM[e].querySelector(".rebilly-instruments-loader").classList.remove("is-active"),this.DOM[e].style.minHeight="")}clearAll(){this.form.forEach((e=>{this.stopLoading({id:e})})),this.summary.forEach((e=>{this.stopLoading({section:"summary",id:e})})),this.modal.forEach((e=>{this.stopLoading({section:"modal",id:e})}))}}class h{constructor({state:e={},name:t="",url:n="",model:r={},container:i=null,classListArray:a=[]}={}){return(a=Array.isArray(a)?a:[]).includes("rebilly-instruments-iframe")||a.push("rebilly-instruments-iframe"),this.state=e,this.container=i,this.classListArray=a,this.name=t,this.url=n,this.model=r,this.component=null,(async()=>(this.component=await this.createComponent(),this))()}async destroy(){this.component.frame.parentNode&&await this.component.destroy()}async createComponent(){const e={appendChild:e=>{e.setAttribute("loading","lazy"),e.setAttribute("allow","payment"),e.setAttribute("scrolling","no"),e.allowPaymentRequest=!0,this.container.appendChild(e)}};u.includes(this.name)&&this.container.insertAdjacentHTML("beforeend",f);return await new s({name:this.name,url:this.url,container:e,classListArray:this.classListArray,model:this.model})}}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var v=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,b=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,w="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",x="[\\ud800-\\udfff]",k="["+w+"]",S="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",A="\\d+",E="[\\u2700-\\u27bf]",$="[^\\ud800-\\udfff"+w+A+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",T="\\ud83c[\\udffb-\\udfff]",C="[^\\ud800-\\udfff]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",H="[\\ud800-\\udbff][\\udc00-\\udfff]",F="[A-Z\\xc0-\\xd6\\xd8-\\xde]",j="(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|"+$+")",P="(?:"+F+"|"+$+")",L="(?:"+S+"|"+T+")"+"?",R="[\\ufe0e\\ufe0f]?"+L+("(?:\\u200d(?:"+[C,I,H].join("|")+")[\\ufe0e\\ufe0f]?"+L+")*"),M="(?:"+[E,I,H].join("|")+")"+R,O="(?:"+[C+S+"?",S,I,H,x].join("|")+")",q=RegExp("['’]","g"),B=RegExp(S,"g"),_=RegExp(T+"(?="+T+")|"+O+R,"g"),z=RegExp([F+"?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[k,F,"$"].join("|")+")",P+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[k,F+j,"$"].join("|")+")",F+"?"+j+"+(?:['’](?:d|ll|m|re|s|t|ve))?",F+"+(?:['’](?:D|LL|M|RE|S|T|VE))?",A,M].join("|"),"g"),D=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),N=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,U="object"==typeof g&&g&&g.Object===Object&&g,W="object"==typeof self&&self&&self.Object===Object&&self,V=U||W||Function("return this")();var G,K=(G={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(e){return null==G?void 0:G[e]});function J(e){return D.test(e)}function X(e){return J(e)?function(e){return e.match(_)||[]}(e):function(e){return e.split("")}(e)}var Z=Object.prototype.toString,Y=V.Symbol,Q=Y?Y.prototype:void 0,ee=Q?Q.toString:void 0;function te(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==Z.call(e)}(e))return ee?ee.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function ne(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}(e,t,n)}function re(e){return null==e?"":te(e)}var ie,ae=(ie=function(e,t,n){return t=t.toLowerCase(),e+(n?se(re(t).toLowerCase()):t)},function(e){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){return e=re(e),void 0===(t=n?void 0:t)?function(e){return N.test(e)}(e)?function(e){return e.match(z)||[]}(e):function(e){return e.match(v)||[]}(e):e.match(t)||[]}(function(e){return(e=re(e))&&e.replace(b,K).replace(B,"")}(e).replace(q,"")),ie,"")});var oe,se=(oe="toUpperCase",function(e){var t=J(e=re(e))?X(e):void 0,n=t?t[0]:e.charAt(0),r=t?ne(t,1).join(""):e.slice(1);return n[oe]()+r});var le=ae,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",fe="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",me="\\d+",he="[\\u2700-\\u27bf]",ge="[a-z\\xdf-\\xf6\\xf8-\\xff]",ye="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ve="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",we="[A-Z\\xc0-\\xd6\\xd8-\\xde]",xe="(?:"+ge+"|"+ye+")",ke="(?:"+we+"|"+ye+")",Se="(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?",Ae="[\\ufe0e\\ufe0f]?"+Se+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",ve,be].join("|")+")[\\ufe0e\\ufe0f]?"+Se+")*"),Ee="(?:"+[he,ve,be].join("|")+")"+Ae,$e=RegExp("['’]","g"),Te=RegExp(fe,"g"),Ce=RegExp([we+"?"+ge+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,we,"$"].join("|")+")",ke+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,we+xe,"$"].join("|")+")",we+"?"+xe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",we+"+(?:['’](?:D|LL|M|RE|S|T|VE))?",me,Ee].join("|"),"g"),Ie=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,He="object"==typeof g&&g&&g.Object===Object&&g,Fe="object"==typeof self&&self&&self.Object===Object&&self,je=He||Fe||Function("return this")();var Pe=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});var Le=Object.prototype.toString,Re=je.Symbol,Me=Re?Re.prototype:void 0,Oe=Me?Me.toString:void 0;function qe(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==Le.call(e)}(e))return Oe?Oe.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function Be(e){return null==e?"":qe(e)}var _e=function(e){return function(t){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){if(e=Be(e),void 0===(t=n?void 0:t))return function(e){return Ie.test(e)}(e)?function(e){return e.match(Ce)||[]}(e):function(e){return e.match(ue)||[]}(e);return e.match(t)||[]}(function(e){return(e=Be(e))&&e.replace(ce,Pe).replace(Te,"")}(t).replace($e,"")),e,"")}}((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}));var ze=_e;const De=new class{_listeners={};add(e,t){document.addEventListener(e,t,!1),e in this._listeners||(this._listeners[e]=[]),this._listeners[e].push(t)}removeAll(){Object.keys(this._listeners).forEach((e=>{this._listeners[e].forEach((t=>document.removeEventListener(e,t,!1)))})),this._listeners={}}};class Ne{constructor(e){this.internalName="rebilly-instruments-"+e}addEventListener(e){De.add(this.internalName,(({detail:t})=>e(t)))}dispatch(e){const t=new CustomEvent(this.internalName,{bubbles:!0,detail:e});document.dispatchEvent(t)}}const Ue={dataReady:new Ne("data-ready"),instrumentReady:new Ne("instrument-ready"),purchaseCompleted:new Ne("purchase-completed"),setupCompleted:new Ne("setup-completed")},We=Object.keys(Ue).map((e=>ze(e)));function Ve(){const e=document.querySelector("#rebilly-instruments-error");e&&(e.innerHTML="")}function Ge(e){const t=document.querySelector("#rebilly-instruments-error");if(!t)return;t.innerHTML=(e=>{function t(t=null){return null===t&&(t="An unexpected error occurred","string"==typeof e&&(t=e),e.error&&(t=e.error),e.message&&(t=e.message)),`<p class="rebilly-instruments-error-card-message">${t}</p>`}return`<div class="rebilly-instruments-error-card">\n <header class="rebilly-instruments-error-card-header">\n <p class="rebilly-instruments-error-card-title">Error</p>\n <button class="rebilly-instruments-error-card-close-button">\n <svg class="rebilly-instruments-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 10.5858l2.8284-2.8284c.3906-.3906 1.0237-.3906 1.4142 0 .3906.3905.3906 1.0236 0 1.4142L13.4142 12l2.8284 2.8284c.3906.3906.3906 1.0237 0 1.4142-.3905.3906-1.0236.3906-1.4142 0L12 13.4142l-2.8284 2.8284c-.3906.3906-1.0237.3906-1.4142 0-.3906-.3905-.3906-1.0236 0-1.4142L10.5858 12 7.7574 9.1716c-.3906-.3906-.3906-1.0237 0-1.4142.3905-.3906 1.0236-.3906 1.4142 0L12 10.5858z" fill-rule="nonzero"/>\n </svg>\n </button>\n </header>\n ${e.details?function(){function n(e){let t=e;return e["data-rebilly"]&&(t=`"${e["data-rebilly"]}" ${e.error}`),t}return e.details.length>1?`<ul class="rebilly-instruments-error-card-details">\n ${e.details.map((e=>`<li>${n(e)}</li>`)).join("")}\n </ul>`:t(n(e.details[0]))}():t()}\n</div>`})(e);document.querySelector(".rebilly-instruments-error-card-close-button").addEventListener("click",Ve),window.addEventListener("click",(function e(n){t.contains(n.target)||(window.removeEventListener("click",e,!1),Ve())})),window.addEventListener("blur",(function e(){setTimeout((()=>{"IFRAME"===document.activeElement.tagName&&(window.removeEventListener("click",e,!1),Ve())}))}),{once:!0}),t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),console.error("Rebilly Instruments Error",e),window.focus()}function Ke(e){e.component.on(`${e.name}-dispatch`,(({event:e,detail:t})=>{Ue[le(e).replace(/-/,"")].dispatch(t)}))}function Je(e){e.component.on(`${e.name}-resize-frame`,(t=>{e.component.frame.style.height=t}))}function Xe(e,t){e.component.on(`${e.name}-stop-loading`,(e=>{var n;let{section:r}=t;r||(r=e.includes("summary")?"summary":"form"),null===(n=t.loader)||void 0===n||n.stopLoading({section:r,id:e})}))}function Ze(e){e.component.on(`${e.name}-show-error`,Ge)}const Ye=class extends h{constructor(e={}){super(e)}bindEventListeners({loader:e}={}){Ke(this),Je(this),Xe(this,{loader:e}),Ze(this)}},Qe=class extends h{constructor(e={}){super(e)}bindEventListeners({close:e=(()=>{}),loader:t}={}){var n;Ke(this),Je(this),(n=this).component.on(`${n.name}-change-iframe-src`,((e=null)=>{n.component.frame.src=e,n.component.frame.style.height="75vh"})),Xe(this,{loader:t,section:"modal",id:this.name}),Ze(this),this.component.on(`${this.name}-close`,((...t)=>{e(...t)})),window.addEventListener("message",(async t=>{if("rebilly-instruments-approval-url-close"===t.data)if("purchase"===this.state.options.transactionType){var n;this.state.storefront.setSessionToken(this.state.data.token||this.state.options.jwt);const[{fields:t},{fields:r}]=await Promise.all([this.state.storefront.transactions.get({id:this.state.data.transaction.id}),null!==(n=this.state.data.invoice)&&void 0!==n&&n.id?this.state.storefront.invoices.get({id:this.state.data.invoice.id}):{fields:null}]),i={orderId:this.state.data.orderId,token:this.state.data.token,transaction:t};r&&(i.invoice=r),e(i)}else if("setup"===this.state.options.transactionType){this.state.storefront.setSessionToken(this.state.data.instrument.token||this.state.options.jwt);const{fields:t}=await this.state.storefront.transactions.get({id:this.state.data.transaction.id});e({transaction:t,instrument:this.state.data.instrument})}else e()}),!1)}};class et{constructor({...e}={}){Object.entries(e).forEach((([e,t])=>{this[e]=t}))}}class tt extends et{constructor({unitPrice:e=0,quantity:t=0,price:n=0,...r}={}){super(r),this.unitPrice=e,this.quantity=t,this.price=n}}class nt extends et{}class rt extends et{constructor({amount:e=0,...t}){super(t),this.amount=e}}class it{constructor({currency:e="",lineItems:t=[],taxes:n=[],discounts:r=[],subtotalAmount:i=0,taxAmount:a=0,shippingAmount:o=0,discountsAmount:s=0,total:l=0}={}){function u(e){const t=Array.isArray(e)?e:[];return{to:e=>t.map((t=>new e(t)))}}this.currency=e,this.lineItems=u(t).to(tt),this.taxes=u(n).to(nt),this.discounts=u(r).to(rt),this.subtotalAmount=i,this.taxAmount=a,this.shippingAmount=o,this.discountsAmount=s,this.total=l}}var at="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function ot(){throw new Error("setTimeout has not been defined")}function st(){throw new Error("clearTimeout has not been defined")}var lt=ot,ut=st;function ct(e){if(lt===setTimeout)return setTimeout(e,0);if((lt===ot||!lt)&&setTimeout)return lt=setTimeout,setTimeout(e,0);try{return lt(e,0)}catch(t){try{return lt.call(null,e,0)}catch(t){return lt.call(this,e,0)}}}"function"==typeof at.setTimeout&&(lt=setTimeout),"function"==typeof at.clearTimeout&&(ut=clearTimeout);var dt,pt=[],ft=!1,mt=-1;function ht(){ft&&dt&&(ft=!1,dt.length?pt=dt.concat(pt):mt=-1,pt.length&&gt())}function gt(){if(!ft){var e=ct(ht);ft=!0;for(var t=pt.length;t;){for(dt=pt,pt=[];++mt<t;)dt&&dt[mt].run();mt=-1,t=pt.length}dt=null,ft=!1,function(e){if(ut===clearTimeout)return clearTimeout(e);if((ut===st||!ut)&&clearTimeout)return ut=clearTimeout,clearTimeout(e);try{ut(e)}catch(t){try{return ut.call(null,e)}catch(t){return ut.call(this,e)}}}(e)}}function yt(e,t){this.fun=e,this.array=t}yt.prototype.run=function(){this.fun.apply(null,this.array)};function vt(){}var bt=vt,wt=vt,xt=vt,kt=vt,St=vt,At=vt,Et=vt;var $t=at.performance||{},Tt=$t.now||$t.mozNow||$t.msNow||$t.oNow||$t.webkitNow||function(){return(new Date).getTime()};var Ct=new Date;var It={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];pt.push(new yt(e,t)),1!==pt.length||ft||ct(gt)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:bt,addListener:wt,once:xt,off:kt,removeListener:St,removeAllListeners:At,emit:Et,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Tt.call($t),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Ct)/1e3}},Ht=Object.defineProperty,Ft=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,Lt=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t)=>{for(var n in t||(t={}))jt.call(t,n)&&Lt(e,n,t[n]);if(Ft)for(var n of Ft(t))Pt.call(t,n)&&Lt(e,n,t[n]);return e},Mt=(e,t,n)=>(Lt(e,"symbol"!=typeof t?t+"":t,n),n),Ot={exports:{}},qt=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},Bt=qt,_t=Object.prototype.toString;function zt(e){return Array.isArray(e)}function Dt(e){return void 0===e}function Nt(e){return"[object ArrayBuffer]"===_t.call(e)}function Ut(e){return null!==e&&"object"==typeof e}function Wt(e){if("[object Object]"!==_t.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Vt(e){return"[object Function]"===_t.call(e)}function Gt(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),zt(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var Kt={isArray:zt,isArrayBuffer:Nt,isBuffer:function(e){return null!==e&&!Dt(e)&&null!==e.constructor&&!Dt(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===_t.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Nt(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Ut,isPlainObject:Wt,isUndefined:Dt,isDate:function(e){return"[object Date]"===_t.call(e)},isFile:function(e){return"[object File]"===_t.call(e)},isBlob:function(e){return"[object Blob]"===_t.call(e)},isFunction:Vt,isStream:function(e){return Ut(e)&&Vt(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===_t.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:Gt,merge:function e(){var t={};function n(n,r){Wt(t[r])&&Wt(n)?t[r]=e(t[r],n):Wt(n)?t[r]=e({},n):zt(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)Gt(arguments[r],n);return t},extend:function(e,t,n){return Gt(t,(function(t,r){e[r]=n&&"function"==typeof t?Bt(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},Jt=Kt;function Xt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Zt=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(Jt.isURLSearchParams(t))r=t.toString();else{var i=[];Jt.forEach(t,(function(e,t){null!=e&&(Jt.isArray(e)?t+="[]":e=[e],Jt.forEach(e,(function(e){Jt.isDate(e)?e=e.toISOString():Jt.isObject(e)&&(e=JSON.stringify(e)),i.push(Xt(t)+"="+Xt(e))})))})),r=i.join("&")}if(r){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},Yt=Kt;function Qt(){this.handlers=[]}Qt.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},Qt.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Qt.prototype.forEach=function(e){Yt.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var en=Qt,tn=Kt,nn=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},an=nn,on=function(e,t,n,r,i){var a=new Error(e);return an(a,t,n,r,i)},sn=on,ln=Kt,un=ln.isStandardBrowserEnv()?{write:function(e,t,n,r,i,a){var o=[];o.push(e+"="+encodeURIComponent(t)),ln.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),ln.isString(r)&&o.push("path="+r),ln.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},cn=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},dn=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},pn=Kt,fn=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],mn=Kt,hn=mn.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=mn.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function gn(e){this.message=e}gn.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},gn.prototype.__CANCEL__=!0;var yn=gn,vn=Kt,bn=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(sn("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},wn=un,xn=Zt,kn=function(e,t){return e&&!cn(t)?dn(e,t):t},Sn=function(e){var t,n,r,i={};return e?(pn.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=pn.trim(e.substr(0,r)).toLowerCase(),n=pn.trim(e.substr(r+1)),t){if(i[t]&&fn.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i},An=hn,En=on,$n=rn,Tn=yn,Cn=function(e){return new Promise((function(t,n){var r,i=e.data,a=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}vn.isFormData(i)&&delete a["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(u+":"+c)}var d=kn(e.baseURL,e.url);function p(){if(l){var r="getAllResponseHeaders"in l?Sn(l.getAllResponseHeaders()):null,i={data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l};bn((function(e){t(e),s()}),(function(e){n(e),s()}),i),l=null}}if(l.open(e.method.toUpperCase(),xn(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=p:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(p)},l.onabort=function(){l&&(n(En("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(En("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||$n;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(En(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},vn.isStandardBrowserEnv()){var f=(e.withCredentials||An(d))&&e.xsrfCookieName?wn.read(e.xsrfCookieName):void 0;f&&(a[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&vn.forEach(a,(function(e,t){void 0===i&&"content-type"===t.toLowerCase()?delete a[t]:l.setRequestHeader(t,e)})),vn.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(r=function(e){l&&(n(!e||e&&e.type?new Tn("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r))),i||(i=null),l.send(i)}))},In=Kt,Hn=function(e,t){tn.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},Fn=nn,jn={"Content-Type":"application/x-www-form-urlencoded"};function Pn(e,t){!In.isUndefined(e)&&In.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Ln,Rn={transitional:rn,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==It&&"[object process]"===Object.prototype.toString.call(It))&&(Ln=Cn),Ln),transformRequest:[function(e,t){return Hn(t,"Accept"),Hn(t,"Content-Type"),In.isFormData(e)||In.isArrayBuffer(e)||In.isBuffer(e)||In.isStream(e)||In.isFile(e)||In.isBlob(e)?e:In.isArrayBufferView(e)?e.buffer:In.isURLSearchParams(e)?(Pn(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):In.isObject(e)||t&&"application/json"===t["Content-Type"]?(Pn(t,"application/json"),function(e,t,n){if(In.isString(e))try{return(t||JSON.parse)(e),In.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Rn.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&In.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Fn(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};In.forEach(["delete","get","head"],(function(e){Rn.headers[e]={}})),In.forEach(["post","put","patch"],(function(e){Rn.headers[e]=In.merge(jn)}));var Mn=Rn,On=Kt,qn=Mn,Bn=function(e){return!(!e||!e.__CANCEL__)},_n=Kt,zn=function(e,t,n){var r=this||qn;return On.forEach(n,(function(n){e=n.call(r,e,t)})),e},Dn=Bn,Nn=Mn,Un=yn;function Wn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Un("canceled")}var Vn=Kt,Gn=function(e,t){t=t||{};var n={};function r(e,t){return Vn.isPlainObject(e)&&Vn.isPlainObject(t)?Vn.merge(e,t):Vn.isPlainObject(t)?Vn.merge({},t):Vn.isArray(t)?t.slice():t}function i(n){return Vn.isUndefined(t[n])?Vn.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function a(e){if(!Vn.isUndefined(t[e]))return r(void 0,t[e])}function o(n){return Vn.isUndefined(t[n])?Vn.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function s(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return Vn.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||i,r=t(e);Vn.isUndefined(r)&&t!==s||(n[e]=r)})),n},Kn="0.26.1",Jn=Kn,Xn={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Xn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var Zn={};Xn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Jn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new Error(r(i," has been removed"+(t?" in "+t:"")));return t&&!Zn[i]&&(Zn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Yn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=t[a];if(o){var s=e[a],l=void 0===s||o(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:Xn},Qn=Kt,er=Zt,tr=en,nr=function(e){return Wn(e),e.headers=e.headers||{},e.data=zn.call(e,e.data,e.headers,e.transformRequest),e.headers=_n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),_n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Nn.adapter)(e).then((function(t){return Wn(e),t.data=zn.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return Dn(t)||(Wn(e),t&&t.response&&(t.response.data=zn.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},rr=Gn,ir=Yn,ar=ir.validators;function or(e){this.defaults=e,this.interceptors={request:new tr,response:new tr}}or.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=rr(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&ir.assertOptions(n,{silentJSONParsing:ar.transitional(ar.boolean),forcedJSONParsing:ar.transitional(ar.boolean),clarifyTimeoutError:ar.transitional(ar.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!i){var s=[nr,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(o),a=Promise.resolve(t);s.length;)a=a.then(s.shift(),s.shift());return a}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{a=nr(l)}catch(e){return Promise.reject(e)}for(;o.length;)a=a.then(o.shift(),o.shift());return a},or.prototype.getUri=function(e){return e=rr(this.defaults,e),er(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Qn.forEach(["delete","get","head","options"],(function(e){or.prototype[e]=function(t,n){return this.request(rr(n||{},{method:e,url:t,data:(n||{}).data}))}})),Qn.forEach(["post","put","patch"],(function(e){or.prototype[e]=function(t,n,r){return this.request(rr(r||{},{method:e,url:t,data:n}))}}));var sr=or,lr=yn;function ur(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new lr(e),t(n.reason))}))}ur.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ur.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},ur.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},ur.source=function(){var e,t=new ur((function(t){e=t}));return{token:t,cancel:e}};var cr=ur,dr=Kt,pr=Kt,fr=qt,mr=sr,hr=Gn;var gr=function e(t){var n=new mr(t),r=fr(mr.prototype.request,n);return pr.extend(r,mr.prototype,n),pr.extend(r,n),r.create=function(n){return e(hr(t,n))},r}(Mn);gr.Axios=mr,gr.Cancel=yn,gr.CancelToken=cr,gr.isCancel=Bn,gr.VERSION=Kn,gr.all=function(e){return Promise.all(e)},gr.spread=function(e){return function(t){return e.apply(null,t)}},gr.isAxiosError=function(e){return dr.isObject(e)&&!0===e.isAxiosError},Ot.exports=gr,Ot.exports.default=gr;var yr=Ot.exports;function vr(e,{exclude:t=[]}={}){Object.freeze(e);const n="function"==typeof e;return Object.getOwnPropertyNames(e).forEach((r=>{n&&("caller"===r||"callee"===r||"arguments"===r)||null===e[r]||t.includes(r)||"object"!=typeof e[r]&&"function"!=typeof e[r]||Object.isFrozen(e[r])||vr(e[r],{exclude:t})})),e}class br{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.fields=Rt({},e),this.config=i,vr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({fields:this.fields}))}}const wr={limit:"pagination-limit",offset:"pagination-offset",total:"pagination-total"};class xr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.limit=null,this.offset=null,this.total=null,Object.keys(wr).forEach((e=>{const t=r[wr[e]];this[e]=t?Number(t):null})),this.response={status:t,statusText:n,headers:r},this.items=e.map((e=>new br({data:e,status:t,statusText:n,headers:r}))),this.config=i,vr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class kr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.data=e,this.config=i}}class Sr extends Error{constructor({error:e,name:t=null}){let{config:n=null,response:r=null,request:i=null,message:a=null}=e,o=a||"Request Error";r&&r.data&&r.data.error&&(o=r.data.error),super(o),this.name=t||"RebillyError",this.response=r,this.request=i,this.config=n,this.status=r&&r.status?r.status:null,this.statusText=r&&r.statusText?r.statusText:null,this.details=r&&r.data&&r.data.details?r.data.details:null,this.invalidFields=r&&r.data&&r.data.invalidFields?r.data.invalidFields:null}}const Ar={RebillyError:Sr,RebillyRequestError:class extends Sr{constructor(e){super({error:e,name:"RebillyRequestError"})}},RebillyValidationError:class extends Sr{constructor(e){super({error:e,name:"RebillyValidationError"})}},RebillyNotFoundError:class extends Sr{constructor(e){super({error:e,name:"RebillyNotFoundError"})}},RebillyConflictError:class extends Sr{constructor(e){super({error:e,name:"RebillyConflictError"})}},RebillyForbiddenError:class extends Sr{constructor(e){super({error:e,name:"RebillyForbiddenError"})}},RebillyMethodNotAllowedError:class extends Sr{constructor(e){super({error:e,name:"RebillyMethodNotAllowedError"})}},RebillyTimeoutError:class extends Sr{constructor(e){super({error:e,name:"RebillyTimeoutError"})}},RebillyCanceledError:class extends Sr{constructor(e){super({error:e,name:"RebillyCanceledError"})}}};
8
+ var e="application/x-postmate-v1+json",t=0,n=0;var r={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},i=function(t,n){return("string"!=typeof n||t.origin===n)&&(!!t.data&&(("object"!=typeof t.data||"postmate"in t.data)&&(t.data.type===e&&!!r[t.data.postmate])))},a=function(){function n(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.childId=e.childId,this.events={},this.listener=function(e){if(!i(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,a=n.name;"emit"===e.data.postmate&&e.data.childId===t.childId&&a in t.events&&t.events[a].forEach((function(e){e.call(t,r)}))},this.parent.addEventListener("message",this.listener,!1)}var r=n.prototype;return r.get=function(n){var r=this;return new s.Promise((function(i){var a=++t;r.parent.addEventListener("message",(function e(t){t.data.uid===a&&"reply"===t.data.postmate&&t.data.childId===r.childId&&(r.parent.removeEventListener("message",e,!1),i(t.data.value))}),!1),r.child.postMessage({postmate:"request",type:e,property:n,uid:a},r.childOrigin)}))},r.call=function(t,n){this.child.postMessage({postmate:"call",type:e,property:t,data:n},this.childOrigin)},r.on=function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)},r.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},n}(),o=function(){function t(t){var n=this;this.model=t.model,this.parent=t.parent,this.parentOrigin=t.parentOrigin,this.child=t.child,this.childId=t.childId,this.child.addEventListener("message",(function(t){if(i(t,n.parentOrigin)){var r=t.data,a=r.property,o=r.uid,l=r.data;"call"!==t.data.postmate?function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return s.Promise.resolve(n)}(n.model,a).then((function(r){return t.source.postMessage({property:a,postmate:"reply",type:e,childId:n.childId,uid:o,value:r},t.origin)})):a in n.model&&"function"==typeof n.model[a]&&n.model[a](l)}}))}return t.prototype.emit=function(t,n){this.parent.postMessage({postmate:"emit",type:e,childId:this.childId,value:{name:t,data:n}},this.parentOrigin)},t}(),s=function(){function t(e){var t=e.container,r=void 0===t?void 0!==r?r:document.body:t,i=e.model,a=e.url,o=e.name,s=e.classListArray,l=void 0===s?[]:s;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",l.length>0&&this.frame.classList.add.apply(this.frame.classList,l),r.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=i||{},this.childId=++n,this.sendHandshake(a)}return t.prototype.sendHandshake=function(n){var r,o=this,s=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r}(n),l=0;return new t.Promise((function(t,u){o.parent.addEventListener("message",(function e(n){return!!i(n,s)&&(n.data.childId===o.childId&&("handshake-reply"===n.data.postmate?(clearInterval(r),o.parent.removeEventListener("message",e,!1),o.childOrigin=n.origin,t(new a(o))):u("Failed handshake")))}),!1);var c=function(){if(++l>5)return clearInterval(r),u("Handshake Timeout Reached");o.child.postMessage({postmate:"handshake",type:e,model:o.model,childId:o.childId},s)},d=function(){c(),r=setInterval(c,500)};o.frame.attachEvent?o.frame.attachEvent("onload",d):o.frame.addEventListener("load",d),o.frame.src=n}))},t}();s.debug=!1,s.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),s.Model=function(){function t(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return t.prototype.sendHandshakeReply=function(){var t=this;return new s.Promise((function(n,r){t.child.addEventListener("message",(function i(a){if(a.data.postmate){if("handshake"===a.data.postmate){t.child.removeEventListener("message",i,!1),a.source.postMessage({postmate:"handshake-reply",type:e,childId:a.data.childId},a.origin),t.childId=a.data.childId,t.parentOrigin=a.origin;var s=a.data.model;return s&&Object.keys(s).forEach((function(e){t.model[e]=s[e]})),n(new o(t))}return r("Handshake Reply Failed")}}),!1)}))},t}();const l=["Google Pay","Apple Pay","paypal"],u=["payment-card","ach"];function c({state:e}){var t;const n={EXPRESS_METHODS:[],METHODS:[]};return null===(t=e.data.readyToPay)||void 0===t||t.forEach((e=>{(({method:e,feature:t})=>l.includes(e)||l.includes(null==t?void 0:t.name))(e)?n.EXPRESS_METHODS.push(e):(({method:e})=>u.includes(e))(e)&&n.METHODS.push(e)})),window.ApplePaySession||(n.EXPRESS_METHODS=n.EXPRESS_METHODS.filter((e=>{var t;return"Apple Pay"!==(null==e||null===(t=e.feature)||void 0===t?void 0:t.name)})),e.loader.stopLoading({id:"applePay-express"})),n}function d(e){return e instanceof Element||e instanceof HTMLDocument}const p=(e="0px")=>`\n <div class="rebilly-instruments-loader is-active" style="padding: ${e}"></div>\n`,f='\n <div class="rebilly-instruments-loader-spinner"></div>\n';class m{constructor(){this.summary=[],this.form=[],this.modal=[],this.DOM={loaderContainer:p,summaryLoaderHTML:'\n <div class="rebilly-instruments-summary-loader-total rebilly-instruments-loader-display-flex rebilly-instruments-loader-align-center rebilly-instruments-loader-justify-space-between">\n <div><p class="is-el-loading">Total</p></div>\n <p class="total is-el-loading">$99.99</p>\n </div>\n',methodsLoaderHTML:'\n <div class="rebilly-instruments-methods-loader">\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-divider">\n <span class="rebilly-instruments-divider-label"><span class="is-el-loading">Divi</span></span>\n </div>\n <div class="rebilly-instruments-loader-display-flex rebilly-instruments-loader-justify-end">\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-form-fields">\n <div class="rebilly-instruments-loader-form-label"><small class="is-el-loading">Card holder name</small></div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-button">Continue</div> \n </div>\n',basicLoaderHTML:f}}addDOMElement({section:e="form",el:t=null}={}){d(t)&&(t.style.position="relative",this.DOM[e]=t)}startLoading({section:e="form",id:t=""}={}){var n;this[e].push(t);const r=document.querySelector(":root");let i="240px";if(null!==(n=this.DOM)&&void 0!==n&&n[e]){var a;let n=this.DOM[e].querySelector(".rebilly-instruments-loader");const{padding:o,paddingTop:s,paddingBottom:l}=getComputedStyle(null===(a=this.DOM)||void 0===a?void 0:a[e]);n?((t.includes("confirmation")||t.includes("result")||t.includes("modal"))&&(n.innerHTML=this.DOM.basicLoaderHTML),n.classList.add("is-active")):(this.DOM[e].innerHTML=p(`${parseFloat(o)+2}px`),n=this.DOM[e].querySelector(".rebilly-instruments-loader"),"form"===e?(n.insertAdjacentHTML("afterbegin",this.DOM.methodsLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-methodLoaderMinHeight")):"summary"===e&&(n.insertAdjacentHTML("afterbegin",this.DOM.summaryLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-summaryLoaderMinHeight"))),this.DOM[e].style.minHeight=`calc(${i} + ${s} + ${l} + 4px)`}}stopLoading({section:e="form",id:t=""}={}){const n=this[e].indexOf(t);-1!==n&&this[e].splice(n,1),!this[e].length&&this.DOM[e].querySelector(".rebilly-instruments-loader")&&(this.DOM[e].querySelector(".rebilly-instruments-loader").classList.remove("is-active"),this.DOM[e].style.minHeight="")}clearAll(){this.form.forEach((e=>{this.stopLoading({id:e})})),this.summary.forEach((e=>{this.stopLoading({section:"summary",id:e})})),this.modal.forEach((e=>{this.stopLoading({section:"modal",id:e})}))}}class h{constructor({state:e={},name:t="",url:n="",model:r={},container:i=null,classListArray:a=[]}={}){return(a=Array.isArray(a)?a:[]).includes("rebilly-instruments-iframe")||a.push("rebilly-instruments-iframe"),this.state=e,this.container=i,this.classListArray=a,this.name=t,this.url=n,this.model=r,this.component=null,(async()=>(this.component=await this.createComponent(),this))()}async destroy(){this.component.frame.parentNode&&await this.component.destroy()}async createComponent(){const e={appendChild:e=>{e.setAttribute("loading","lazy"),e.setAttribute("allow","payment"),e.setAttribute("scrolling","no"),e.allowPaymentRequest=!0,this.container.appendChild(e)}};u.includes(this.name)&&this.container.insertAdjacentHTML("beforeend",f);return await new s({name:this.name,url:this.url,container:e,classListArray:this.classListArray,model:this.model})}}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var v=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,b=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,w="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",x="[\\ud800-\\udfff]",k="["+w+"]",S="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",A="\\d+",E="[\\u2700-\\u27bf]",$="[^\\ud800-\\udfff"+w+A+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",T="\\ud83c[\\udffb-\\udfff]",C="[^\\ud800-\\udfff]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",H="[\\ud800-\\udbff][\\udc00-\\udfff]",F="[A-Z\\xc0-\\xd6\\xd8-\\xde]",j="(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|"+$+")",P="(?:"+F+"|"+$+")",L="(?:"+S+"|"+T+")"+"?",R="[\\ufe0e\\ufe0f]?"+L+("(?:\\u200d(?:"+[C,I,H].join("|")+")[\\ufe0e\\ufe0f]?"+L+")*"),M="(?:"+[E,I,H].join("|")+")"+R,O="(?:"+[C+S+"?",S,I,H,x].join("|")+")",q=RegExp("['’]","g"),B=RegExp(S,"g"),_=RegExp(T+"(?="+T+")|"+O+R,"g"),z=RegExp([F+"?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[k,F,"$"].join("|")+")",P+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[k,F+j,"$"].join("|")+")",F+"?"+j+"+(?:['’](?:d|ll|m|re|s|t|ve))?",F+"+(?:['’](?:D|LL|M|RE|S|T|VE))?",A,M].join("|"),"g"),D=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),N=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,U="object"==typeof g&&g&&g.Object===Object&&g,W="object"==typeof self&&self&&self.Object===Object&&self,V=U||W||Function("return this")();var G,K=(G={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(e){return null==G?void 0:G[e]});function J(e){return D.test(e)}function X(e){return J(e)?function(e){return e.match(_)||[]}(e):function(e){return e.split("")}(e)}var Z=Object.prototype.toString,Y=V.Symbol,Q=Y?Y.prototype:void 0,ee=Q?Q.toString:void 0;function te(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==Z.call(e)}(e))return ee?ee.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function ne(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}(e,t,n)}function re(e){return null==e?"":te(e)}var ie,ae=(ie=function(e,t,n){return t=t.toLowerCase(),e+(n?se(re(t).toLowerCase()):t)},function(e){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){return e=re(e),void 0===(t=n?void 0:t)?function(e){return N.test(e)}(e)?function(e){return e.match(z)||[]}(e):function(e){return e.match(v)||[]}(e):e.match(t)||[]}(function(e){return(e=re(e))&&e.replace(b,K).replace(B,"")}(e).replace(q,"")),ie,"")});var oe,se=(oe="toUpperCase",function(e){var t=J(e=re(e))?X(e):void 0,n=t?t[0]:e.charAt(0),r=t?ne(t,1).join(""):e.slice(1);return n[oe]()+r});var le=ae,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",fe="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",me="\\d+",he="[\\u2700-\\u27bf]",ge="[a-z\\xdf-\\xf6\\xf8-\\xff]",ye="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ve="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",we="[A-Z\\xc0-\\xd6\\xd8-\\xde]",xe="(?:"+ge+"|"+ye+")",ke="(?:"+we+"|"+ye+")",Se="(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?",Ae="[\\ufe0e\\ufe0f]?"+Se+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",ve,be].join("|")+")[\\ufe0e\\ufe0f]?"+Se+")*"),Ee="(?:"+[he,ve,be].join("|")+")"+Ae,$e=RegExp("['’]","g"),Te=RegExp(fe,"g"),Ce=RegExp([we+"?"+ge+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,we,"$"].join("|")+")",ke+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,we+xe,"$"].join("|")+")",we+"?"+xe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",we+"+(?:['’](?:D|LL|M|RE|S|T|VE))?",me,Ee].join("|"),"g"),Ie=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,He="object"==typeof g&&g&&g.Object===Object&&g,Fe="object"==typeof self&&self&&self.Object===Object&&self,je=He||Fe||Function("return this")();var Pe=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});var Le=Object.prototype.toString,Re=je.Symbol,Me=Re?Re.prototype:void 0,Oe=Me?Me.toString:void 0;function qe(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==Le.call(e)}(e))return Oe?Oe.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function Be(e){return null==e?"":qe(e)}var _e=function(e){return function(t){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){if(e=Be(e),void 0===(t=n?void 0:t))return function(e){return Ie.test(e)}(e)?function(e){return e.match(Ce)||[]}(e):function(e){return e.match(ue)||[]}(e);return e.match(t)||[]}(function(e){return(e=Be(e))&&e.replace(ce,Pe).replace(Te,"")}(t).replace($e,"")),e,"")}}((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}));var ze=_e;const De=new class{_listeners={};add(e,t){document.addEventListener(e,t,!1),e in this._listeners||(this._listeners[e]=[]),this._listeners[e].push(t)}removeAll(){Object.keys(this._listeners).forEach((e=>{this._listeners[e].forEach((t=>document.removeEventListener(e,t,!1)))})),this._listeners={}}};class Ne{constructor(e){this.internalName="rebilly-instruments-"+e}addEventListener(e){De.add(this.internalName,(({detail:t})=>e(t)))}dispatch(e){const t=new CustomEvent(this.internalName,{bubbles:!0,detail:e});document.dispatchEvent(t)}}const Ue={dataReady:new Ne("data-ready"),instrumentReady:new Ne("instrument-ready"),purchaseCompleted:new Ne("purchase-completed"),setupCompleted:new Ne("setup-completed")},We=Object.keys(Ue).map((e=>ze(e)));function Ve(){const e=document.querySelector("#rebilly-instruments-error");e&&(e.innerHTML="")}function Ge(e){const t=document.querySelector("#rebilly-instruments-error");if(!t)return;t.innerHTML=(e=>{function t(t=null){return null===t&&(t="An unexpected error occurred","string"==typeof e&&(t=e),e.error&&(t=e.error),e.message&&(t=e.message)),`<p class="rebilly-instruments-error-card-message">${t}</p>`}return`<div class="rebilly-instruments-error-card">\n <header class="rebilly-instruments-error-card-header">\n <p class="rebilly-instruments-error-card-title">Error</p>\n <button class="rebilly-instruments-error-card-close-button">\n <svg class="rebilly-instruments-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 10.5858l2.8284-2.8284c.3906-.3906 1.0237-.3906 1.4142 0 .3906.3905.3906 1.0236 0 1.4142L13.4142 12l2.8284 2.8284c.3906.3906.3906 1.0237 0 1.4142-.3905.3906-1.0236.3906-1.4142 0L12 13.4142l-2.8284 2.8284c-.3906.3906-1.0237.3906-1.4142 0-.3906-.3905-.3906-1.0236 0-1.4142L10.5858 12 7.7574 9.1716c-.3906-.3906-.3906-1.0237 0-1.4142.3905-.3906 1.0236-.3906 1.4142 0L12 10.5858z" fill-rule="nonzero"/>\n </svg>\n </button>\n </header>\n ${e.details?function(){function n(e){let t=e;return e["data-rebilly"]&&(t=`"${e["data-rebilly"]}" ${e.error}`),t}return e.details.length>1?`<ul class="rebilly-instruments-error-card-details">\n ${e.details.map((e=>`<li>${n(e)}</li>`)).join("")}\n </ul>`:t(n(e.details[0]))}():t()}\n</div>`})(e);document.querySelector(".rebilly-instruments-error-card-close-button").addEventListener("click",Ve),window.addEventListener("click",(function e(n){t.contains(n.target)||(window.removeEventListener("click",e,!1),Ve())})),window.addEventListener("blur",(function e(){setTimeout((()=>{"IFRAME"===document.activeElement.tagName&&(window.removeEventListener("click",e,!1),Ve())}))}),{once:!0}),t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),console.error("Rebilly Instruments Error",e),window.focus()}function Ke(e){e.component.on(`${e.name}-dispatch`,(({event:e,detail:t})=>{Ue[le(e).replace(/-/,"")].dispatch(t)}))}function Je(e){let t="";e.component.on(`${e.name}-resize-frame`,(n=>{n!==t&&(t=n,e.component.frame.style.height=n)}))}function Xe(e,t){e.component.on(`${e.name}-stop-loading`,(e=>{var n;let{section:r}=t;r||(r=e.includes("summary")?"summary":"form"),null===(n=t.loader)||void 0===n||n.stopLoading({section:r,id:e})}))}function Ze(e){e.component.on(`${e.name}-show-error`,Ge)}const Ye=class extends h{constructor(e={}){super(e)}bindEventListeners({loader:e}={}){Ke(this),Je(this),Xe(this,{loader:e}),Ze(this)}},Qe=class extends h{constructor(e={}){super(e)}bindEventListeners({close:e=(()=>{}),loader:t}={}){var n;Ke(this),Je(this),(n=this).component.on(`${n.name}-change-iframe-src`,((e=null)=>{n.component.frame.src=e,n.component.frame.style.height="75vh"})),Xe(this,{loader:t,section:"modal",id:this.name}),Ze(this),this.component.on(`${this.name}-close`,((...t)=>{e(...t)})),window.addEventListener("message",(async t=>{if("rebilly-instruments-approval-url-close"===t.data)if("purchase"===this.state.options.transactionType){var n;this.state.storefront.setSessionToken(this.state.data.token||this.state.options.jwt);const[{fields:t},{fields:r}]=await Promise.all([this.state.storefront.transactions.get({id:this.state.data.transaction.id}),null!==(n=this.state.data.invoice)&&void 0!==n&&n.id?this.state.storefront.invoices.get({id:this.state.data.invoice.id}):{fields:null}]),i={orderId:this.state.data.orderId,token:this.state.data.token,transaction:t};r&&(i.invoice=r),e(i)}else if("setup"===this.state.options.transactionType){this.state.storefront.setSessionToken(this.state.data.instrument.token||this.state.options.jwt);const{fields:t}=await this.state.storefront.transactions.get({id:this.state.data.transaction.id});e({transaction:t,instrument:this.state.data.instrument})}else e()}),!1)}};class et{constructor({...e}={}){Object.entries(e).forEach((([e,t])=>{this[e]=t}))}}class tt extends et{constructor({unitPrice:e=0,quantity:t=0,price:n=0,...r}={}){super(r),this.unitPrice=e,this.quantity=t,this.price=n}}class nt extends et{}class rt extends et{constructor({amount:e=0,...t}){super(t),this.amount=e}}class it{constructor({currency:e="",lineItems:t=[],taxes:n=[],discounts:r=[],subtotalAmount:i=0,taxAmount:a=0,shippingAmount:o=0,discountsAmount:s=0,total:l=0}={}){function u(e){const t=Array.isArray(e)?e:[];return{to:e=>t.map((t=>new e(t)))}}this.currency=e,this.lineItems=u(t).to(tt),this.taxes=u(n).to(nt),this.discounts=u(r).to(rt),this.subtotalAmount=i,this.taxAmount=a,this.shippingAmount=o,this.discountsAmount=s,this.total=l}}var at="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function ot(){throw new Error("setTimeout has not been defined")}function st(){throw new Error("clearTimeout has not been defined")}var lt=ot,ut=st;function ct(e){if(lt===setTimeout)return setTimeout(e,0);if((lt===ot||!lt)&&setTimeout)return lt=setTimeout,setTimeout(e,0);try{return lt(e,0)}catch(t){try{return lt.call(null,e,0)}catch(t){return lt.call(this,e,0)}}}"function"==typeof at.setTimeout&&(lt=setTimeout),"function"==typeof at.clearTimeout&&(ut=clearTimeout);var dt,pt=[],ft=!1,mt=-1;function ht(){ft&&dt&&(ft=!1,dt.length?pt=dt.concat(pt):mt=-1,pt.length&&gt())}function gt(){if(!ft){var e=ct(ht);ft=!0;for(var t=pt.length;t;){for(dt=pt,pt=[];++mt<t;)dt&&dt[mt].run();mt=-1,t=pt.length}dt=null,ft=!1,function(e){if(ut===clearTimeout)return clearTimeout(e);if((ut===st||!ut)&&clearTimeout)return ut=clearTimeout,clearTimeout(e);try{ut(e)}catch(t){try{return ut.call(null,e)}catch(t){return ut.call(this,e)}}}(e)}}function yt(e,t){this.fun=e,this.array=t}yt.prototype.run=function(){this.fun.apply(null,this.array)};function vt(){}var bt=vt,wt=vt,xt=vt,kt=vt,St=vt,At=vt,Et=vt;var $t=at.performance||{},Tt=$t.now||$t.mozNow||$t.msNow||$t.oNow||$t.webkitNow||function(){return(new Date).getTime()};var Ct=new Date;var It={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];pt.push(new yt(e,t)),1!==pt.length||ft||ct(gt)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:bt,addListener:wt,once:xt,off:kt,removeListener:St,removeAllListeners:At,emit:Et,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Tt.call($t),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Ct)/1e3}},Ht=Object.defineProperty,Ft=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,Lt=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t)=>{for(var n in t||(t={}))jt.call(t,n)&&Lt(e,n,t[n]);if(Ft)for(var n of Ft(t))Pt.call(t,n)&&Lt(e,n,t[n]);return e},Mt=(e,t,n)=>(Lt(e,"symbol"!=typeof t?t+"":t,n),n),Ot={exports:{}},qt=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},Bt=qt,_t=Object.prototype.toString;function zt(e){return Array.isArray(e)}function Dt(e){return void 0===e}function Nt(e){return"[object ArrayBuffer]"===_t.call(e)}function Ut(e){return null!==e&&"object"==typeof e}function Wt(e){if("[object Object]"!==_t.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Vt(e){return"[object Function]"===_t.call(e)}function Gt(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),zt(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var Kt={isArray:zt,isArrayBuffer:Nt,isBuffer:function(e){return null!==e&&!Dt(e)&&null!==e.constructor&&!Dt(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===_t.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Nt(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Ut,isPlainObject:Wt,isUndefined:Dt,isDate:function(e){return"[object Date]"===_t.call(e)},isFile:function(e){return"[object File]"===_t.call(e)},isBlob:function(e){return"[object Blob]"===_t.call(e)},isFunction:Vt,isStream:function(e){return Ut(e)&&Vt(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===_t.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:Gt,merge:function e(){var t={};function n(n,r){Wt(t[r])&&Wt(n)?t[r]=e(t[r],n):Wt(n)?t[r]=e({},n):zt(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)Gt(arguments[r],n);return t},extend:function(e,t,n){return Gt(t,(function(t,r){e[r]=n&&"function"==typeof t?Bt(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},Jt=Kt;function Xt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Zt=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(Jt.isURLSearchParams(t))r=t.toString();else{var i=[];Jt.forEach(t,(function(e,t){null!=e&&(Jt.isArray(e)?t+="[]":e=[e],Jt.forEach(e,(function(e){Jt.isDate(e)?e=e.toISOString():Jt.isObject(e)&&(e=JSON.stringify(e)),i.push(Xt(t)+"="+Xt(e))})))})),r=i.join("&")}if(r){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},Yt=Kt;function Qt(){this.handlers=[]}Qt.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},Qt.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Qt.prototype.forEach=function(e){Yt.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var en=Qt,tn=Kt,nn=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},an=nn,on=function(e,t,n,r,i){var a=new Error(e);return an(a,t,n,r,i)},sn=on,ln=Kt,un=ln.isStandardBrowserEnv()?{write:function(e,t,n,r,i,a){var o=[];o.push(e+"="+encodeURIComponent(t)),ln.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),ln.isString(r)&&o.push("path="+r),ln.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},cn=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},dn=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},pn=Kt,fn=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],mn=Kt,hn=mn.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=mn.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function gn(e){this.message=e}gn.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},gn.prototype.__CANCEL__=!0;var yn=gn,vn=Kt,bn=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(sn("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},wn=un,xn=Zt,kn=function(e,t){return e&&!cn(t)?dn(e,t):t},Sn=function(e){var t,n,r,i={};return e?(pn.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=pn.trim(e.substr(0,r)).toLowerCase(),n=pn.trim(e.substr(r+1)),t){if(i[t]&&fn.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i},An=hn,En=on,$n=rn,Tn=yn,Cn=function(e){return new Promise((function(t,n){var r,i=e.data,a=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}vn.isFormData(i)&&delete a["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(u+":"+c)}var d=kn(e.baseURL,e.url);function p(){if(l){var r="getAllResponseHeaders"in l?Sn(l.getAllResponseHeaders()):null,i={data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l};bn((function(e){t(e),s()}),(function(e){n(e),s()}),i),l=null}}if(l.open(e.method.toUpperCase(),xn(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=p:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(p)},l.onabort=function(){l&&(n(En("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(En("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||$n;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(En(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},vn.isStandardBrowserEnv()){var f=(e.withCredentials||An(d))&&e.xsrfCookieName?wn.read(e.xsrfCookieName):void 0;f&&(a[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&vn.forEach(a,(function(e,t){void 0===i&&"content-type"===t.toLowerCase()?delete a[t]:l.setRequestHeader(t,e)})),vn.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(r=function(e){l&&(n(!e||e&&e.type?new Tn("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r))),i||(i=null),l.send(i)}))},In=Kt,Hn=function(e,t){tn.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},Fn=nn,jn={"Content-Type":"application/x-www-form-urlencoded"};function Pn(e,t){!In.isUndefined(e)&&In.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Ln,Rn={transitional:rn,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==It&&"[object process]"===Object.prototype.toString.call(It))&&(Ln=Cn),Ln),transformRequest:[function(e,t){return Hn(t,"Accept"),Hn(t,"Content-Type"),In.isFormData(e)||In.isArrayBuffer(e)||In.isBuffer(e)||In.isStream(e)||In.isFile(e)||In.isBlob(e)?e:In.isArrayBufferView(e)?e.buffer:In.isURLSearchParams(e)?(Pn(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):In.isObject(e)||t&&"application/json"===t["Content-Type"]?(Pn(t,"application/json"),function(e,t,n){if(In.isString(e))try{return(t||JSON.parse)(e),In.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Rn.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&In.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Fn(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};In.forEach(["delete","get","head"],(function(e){Rn.headers[e]={}})),In.forEach(["post","put","patch"],(function(e){Rn.headers[e]=In.merge(jn)}));var Mn=Rn,On=Kt,qn=Mn,Bn=function(e){return!(!e||!e.__CANCEL__)},_n=Kt,zn=function(e,t,n){var r=this||qn;return On.forEach(n,(function(n){e=n.call(r,e,t)})),e},Dn=Bn,Nn=Mn,Un=yn;function Wn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Un("canceled")}var Vn=Kt,Gn=function(e,t){t=t||{};var n={};function r(e,t){return Vn.isPlainObject(e)&&Vn.isPlainObject(t)?Vn.merge(e,t):Vn.isPlainObject(t)?Vn.merge({},t):Vn.isArray(t)?t.slice():t}function i(n){return Vn.isUndefined(t[n])?Vn.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function a(e){if(!Vn.isUndefined(t[e]))return r(void 0,t[e])}function o(n){return Vn.isUndefined(t[n])?Vn.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function s(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return Vn.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||i,r=t(e);Vn.isUndefined(r)&&t!==s||(n[e]=r)})),n},Kn="0.26.1",Jn=Kn,Xn={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Xn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var Zn={};Xn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Jn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new Error(r(i," has been removed"+(t?" in "+t:"")));return t&&!Zn[i]&&(Zn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Yn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=t[a];if(o){var s=e[a],l=void 0===s||o(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:Xn},Qn=Kt,er=Zt,tr=en,nr=function(e){return Wn(e),e.headers=e.headers||{},e.data=zn.call(e,e.data,e.headers,e.transformRequest),e.headers=_n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),_n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Nn.adapter)(e).then((function(t){return Wn(e),t.data=zn.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return Dn(t)||(Wn(e),t&&t.response&&(t.response.data=zn.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},rr=Gn,ir=Yn,ar=ir.validators;function or(e){this.defaults=e,this.interceptors={request:new tr,response:new tr}}or.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=rr(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&ir.assertOptions(n,{silentJSONParsing:ar.transitional(ar.boolean),forcedJSONParsing:ar.transitional(ar.boolean),clarifyTimeoutError:ar.transitional(ar.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!i){var s=[nr,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(o),a=Promise.resolve(t);s.length;)a=a.then(s.shift(),s.shift());return a}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{a=nr(l)}catch(e){return Promise.reject(e)}for(;o.length;)a=a.then(o.shift(),o.shift());return a},or.prototype.getUri=function(e){return e=rr(this.defaults,e),er(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Qn.forEach(["delete","get","head","options"],(function(e){or.prototype[e]=function(t,n){return this.request(rr(n||{},{method:e,url:t,data:(n||{}).data}))}})),Qn.forEach(["post","put","patch"],(function(e){or.prototype[e]=function(t,n,r){return this.request(rr(r||{},{method:e,url:t,data:n}))}}));var sr=or,lr=yn;function ur(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new lr(e),t(n.reason))}))}ur.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ur.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},ur.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},ur.source=function(){var e,t=new ur((function(t){e=t}));return{token:t,cancel:e}};var cr=ur,dr=Kt,pr=Kt,fr=qt,mr=sr,hr=Gn;var gr=function e(t){var n=new mr(t),r=fr(mr.prototype.request,n);return pr.extend(r,mr.prototype,n),pr.extend(r,n),r.create=function(n){return e(hr(t,n))},r}(Mn);gr.Axios=mr,gr.Cancel=yn,gr.CancelToken=cr,gr.isCancel=Bn,gr.VERSION=Kn,gr.all=function(e){return Promise.all(e)},gr.spread=function(e){return function(t){return e.apply(null,t)}},gr.isAxiosError=function(e){return dr.isObject(e)&&!0===e.isAxiosError},Ot.exports=gr,Ot.exports.default=gr;var yr=Ot.exports;function vr(e,{exclude:t=[]}={}){Object.freeze(e);const n="function"==typeof e;return Object.getOwnPropertyNames(e).forEach((r=>{n&&("caller"===r||"callee"===r||"arguments"===r)||null===e[r]||t.includes(r)||"object"!=typeof e[r]&&"function"!=typeof e[r]||Object.isFrozen(e[r])||vr(e[r],{exclude:t})})),e}class br{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.fields=Rt({},e),this.config=i,vr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({fields:this.fields}))}}const wr={limit:"pagination-limit",offset:"pagination-offset",total:"pagination-total"};class xr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.limit=null,this.offset=null,this.total=null,Object.keys(wr).forEach((e=>{const t=r[wr[e]];this[e]=t?Number(t):null})),this.response={status:t,statusText:n,headers:r},this.items=e.map((e=>new br({data:e,status:t,statusText:n,headers:r}))),this.config=i,vr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class kr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.data=e,this.config=i}}class Sr extends Error{constructor({error:e,name:t=null}){let{config:n=null,response:r=null,request:i=null,message:a=null}=e,o=a||"Request Error";r&&r.data&&r.data.error&&(o=r.data.error),super(o),this.name=t||"RebillyError",this.response=r,this.request=i,this.config=n,this.status=r&&r.status?r.status:null,this.statusText=r&&r.statusText?r.statusText:null,this.details=r&&r.data&&r.data.details?r.data.details:null,this.invalidFields=r&&r.data&&r.data.invalidFields?r.data.invalidFields:null}}const Ar={RebillyError:Sr,RebillyRequestError:class extends Sr{constructor(e){super({error:e,name:"RebillyRequestError"})}},RebillyValidationError:class extends Sr{constructor(e){super({error:e,name:"RebillyValidationError"})}},RebillyNotFoundError:class extends Sr{constructor(e){super({error:e,name:"RebillyNotFoundError"})}},RebillyConflictError:class extends Sr{constructor(e){super({error:e,name:"RebillyConflictError"})}},RebillyForbiddenError:class extends Sr{constructor(e){super({error:e,name:"RebillyForbiddenError"})}},RebillyMethodNotAllowedError:class extends Sr{constructor(e){super({error:e,name:"RebillyMethodNotAllowedError"})}},RebillyTimeoutError:class extends Sr{constructor(e){super({error:e,name:"RebillyTimeoutError"})}},RebillyCanceledError:class extends Sr{constructor(e){super({error:e,name:"RebillyCanceledError"})}}};
9
9
  /*!
10
10
  * isobject <https://github.com/jonschlinkert/isobject>
11
11
  *
@@ -62,4 +62,4 @@ function j(e){var t=$(e);return null===t?null:("hsl"===t.type&&(t.values=T(t.val
62
62
  * @version v2.0.0
63
63
  * @link http://noeldelgado.github.io/values.js/
64
64
  * @license MIT
65
- */var L=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},R=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var i=null===e?"#000":e;if("string"!=typeof i)throw new TypeError("Input should be a string: "+i);var a=$(i);if(!a)throw new Error("Unable to parse color from string: "+i);return this["_setFrom"+a.type.toUpperCase()](a.values.concat([a.alpha]))},M={hex:{configurable:!0}};return M.hex.get=function(){return this.hexString().replace(/^#/,"")},R.prototype.setColor=function(e){var t=$(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},R.prototype.tint=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#fff",this.rgbString(),t).rgba+")","tint",t)},R.prototype.shade=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#000",this.rgbString(),t).rgba+")","shade",t)},R.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},R.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},R.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},R.prototype.hexString=function(){return H(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},R.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},R.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},R.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},R.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],i=e[2],a=e[3];return t=[T([n,r,i]).map(Math.round),a],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(R.prototype,M),R.VERSION="v2.0.0",R}()})),mo=fo;const ho=e=>new mo(e);function go(e,t=1){if(null===e)return e;const n=ho(e);return n.alpha=t,n.rgbString()}const yo=e=>go(e,.5),vo=(e,t)=>{if(null===e)return e;return ho(e).shade(t).hexString()};class bo{allStyles=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"];constructor(e){this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const wo={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>yo(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?go(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"Avenir, Helvetica, Arial, sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?vo(e.buttonColorBackground,20):vo(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new bo(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${vo(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new bo(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?yo(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new bo(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?yo(e.inputErrorColorText):yo(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var xo=new Proxy(wo,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:i}=e[t].fallback;if("static"===r)return i;if("variable"===r)return`var(--rebilly-${i})`;if("func"===r)return i(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class ko{constructor(e={}){this.overrides=e,this.theme=xo}static nonCssProperties=["labels"];overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!ko.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}function So(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var Ao=({options:{theme:e={},css:t}}={})=>{const n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n height: 44px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: 32px;\n height: 22px;\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n`)(new ko(e).build())}\n `;return t})(e||{});return no({element:"style",attributes:{type:"text/css"},content:So(n),target:"head"}),t&&no({element:"style",attributes:{type:"text/css"},content:So(t),target:"head"}),n};const Eo=({state:e})=>{e.translate.init(e.options.locale,e.options.i18n),e.translate.translateItems()};function $o(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let i=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];i=e.replace(n,t[r])})),n(i)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}const To=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});function Co({eventName:e,callback:t}){if(!We.includes(e))throw new Error(`${e} is not a supported event`);const n=le(e);Ue[n].addEventListener(t)}async function Io({name:e="",url:t="",model:n={},classListArray:r=[],close:i=(()=>{}),state:a=null}={}){var o;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;a.form.insertAdjacentHTML("beforeend",((e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`)(l,s));const u=document.querySelector(".rebilly-instruments-modal-overlay"),c=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{u.classList.add("is-visible"),c.classList.add("is-visible")}),240),a.loader.addDOMElement({section:"modal",el:p}),a.loader.startLoading({section:"modal",id:e});const f={options:a.options,...n},m=await new Qe({state:a,name:e,url:t,model:f,classListArray:r,container:p}),h=(...e)=>{c.classList.remove("is-visible"),u.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto",u.children.forEach((e=>e.remove())),u.remove(),i(...e),m.destroy()}),300)};return m.bindEventListeners({close:h,loader:a.loader}),l||d.addEventListener("click",h),m}async function Ho({state:e,payload:t}){const{_raw:{id:n},isExistingInstrument:r}=t;delete t.isExistingInstrument,delete t._raw;const i={...t};r?i.paymentInstrumentId=n:i.token=n,e.options.invoiceId&&(i.invoiceId=e.options.invoiceId),e.options.transactionId&&(i.transactionId=e.options.transactionId),e.options.money&&(i.websiteId=e.options.websiteId,i.amount=e.options.money.amount,i.currency=e.options.money.currency);let{fields:a}=await async function({data:e,state:t}){return di({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.payment({data:e}))))}({state:e,data:i});return a={transaction:a,token:a.token||e.options.jwt},e.data.invoice&&(a.invoice=e.data.invoice),a}async function Fo({state:e,payload:t}){const{fields:n}=await async function({data:e,state:t}){return di({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.purchase({data:e}))))}({state:e,data:{websiteId:e.options.websiteId,items:e.options.items,paymentInstruction:{token:t._raw.id},...t}});return n}async function jo({state:e,payload:t}){try{var n,r;let i;return i=e.data.isPayment?await Ho({state:e,payload:t}):await Fo({state:e,payload:t}),null!==(n=i.transaction)&&void 0!==n&&n.approvalUrl&&"unknown"===(null===(r=i.transaction)||void 0===r?void 0:r.result)?function({state:e,fields:t}){const{paymentMethodsUrl:n}=e.options._computed,r={};e.data.isPayment?r.payment=t:r.purchase=t,e.data=new Ja({state:e,...t}),Io({state:e,name:"rebilly-instruments-approval-url",url:`${n}/approval-url`,model:r,close:e=>{Ue.purchaseCompleted.dispatch(e)}})}({state:e,fields:i}):Ue.purchaseCompleted.dispatch(i),i}catch(e){return Ge(e),e}}async function Po({state:e,payload:t}){try{var n;const{_raw:{id:r},isExistingInstrument:i}=t;delete t.isExistingInstrument,delete t._raw;const a={...t};i?a.paymentInstrumentId=r:a.token=r;const{instrument:o,transaction:s}=await async function({data:e,state:t}){return di({state:t},(async()=>{var n,r;const{fields:i}=await t.storefront.paymentInstruments.create({data:e});t.storefront.setSessionToken(i.token||t.options.jwt);const a={id:i.id,data:{websiteId:t.options.websiteId,...e}};t.data.amountAndCurrency&&(a.data={...a.data,...t.data.amountAndCurrency}),null!==(n=t.data)&&void 0!==n&&null!==(r=n.transaction)&&void 0!==r&&r.redirectUrl&&(a.data.redirectUrl=`${a.data.redirectUrl}&originalRedirectUrl=${t.data.transaction.redirectUrl}`);const{fields:o}=await t.storefront.paymentInstruments.setup(a);return{instrument:i,transaction:o}}))}({state:e,data:{websiteId:null===(n=e.options)||void 0===n?void 0:n.websiteId,...a}});if(e.data=new Ja({state:e,instrument:o,transaction:s}),s.approvalUrl&&"unknown"===s.result){const{paymentMethodsUrl:t}=e.options._computed;Io({state:e,name:"rebilly-instruments-approval-url",url:`${t}/approval-url`,model:{setup:{transaction:s}},close:({transaction:e=s})=>{Ue.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ue.setupCompleted.dispatch({instrument:o,transaction:s});return{instrument:o,transaction:s}}catch(e){return Ge(e),e}}async function Lo({payload:e,state:t}){e.billingAddress&&t.summary&&t.data.isPurchase&&mi({state:t,instrument:e});t.form.querySelector(".rebilly-instruments-content").insertAdjacentHTML("afterend",'<div class="rebilly-instruments-confirmation"></div>');const n=t.form.querySelector(".rebilly-instruments-method-selector");n.style.visibility="hidden",n.style.height="0px",t.loader.startLoading({id:"rebilly-instruments-confirmation"});const r=document.querySelector(".rebilly-instruments-confirmation"),{paymentMethodsUrl:i}=t.options._computed,a={options:t.options,data:t.data.toPostmatesModel(),mainStyleVars:t.mainStyleVars,instrument:e},o="rebilly-instruments-confirmation",s=await new Ye({name:o,url:`${i}/confirmation`,container:r,model:a});s.bindEventListeners({loader:t.loader}),s.component.on(`${o}-confirm-purchase`,(e=>{jo({state:t,payload:e})})),s.component.on(`${o}-confirm-setup`,(e=>{Po({state:t,payload:e})})),s.component.on("choose-another-method",(()=>{t.iframeComponents.form=t.iframeComponents.form.filter((e=>e.name!==s.name||(e.destroy(),!1))),t.data.isPurchase&&mi({state:t}),async function({state:e}){var t;e.loader.startLoading({id:"rebilly-instruments-methods"});const{riskMetadata:n}=await Pa();e.data=await Xa({state:e,riskMetadata:n}),e.data.transaction&&"setup"===(null===(t=e.data.transaction)||void 0===t?void 0:t.type)&&(e.options.transactionType="setup"),to({state:e})}({state:t,mainStyleVars:t.mainStyleVars}),t.form.querySelector(".rebilly-instruments-confirmation").remove()})),t.iframeComponents.form.push(s)}async function Ro({componentName:e,payload:t,state:n}){switch(e){case"result":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),async function({payload:e,state:t}){var n,r;n=t.form,r='<div class="rebilly-instruments-result"></div>',n.querySelector(".rebilly-instruments-content").innerHTML=r,t.loader.startLoading({id:"rebilly-instruments-result"}),t.loader.stopLoading({id:"express-purchase"});const i=document.querySelector(".rebilly-instruments-result"),{paymentMethodsUrl:a}=t.options._computed,o={options:t.options,mainStyleVars:t.mainStyleVars,[t.options.transactionType]:e},s=await new Ye({name:"rebilly-instruments-result",url:`${a}/result`,container:i,model:o});s.bindEventListeners({loader:t.loader}),t.iframeComponents.form.push(s)}({payload:t,state:n});break;case"confirmation":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),Lo({payload:t,state:n});break;default:throw new Error(`'${e}' not a supported component`)}}var Mo=({state:e={}})=>{e.options.features.autoConfirmation&&Co({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?Po({state:e,payload:t}):jo({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Ro({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&Co({eventName:"setup"===e.options.transactionType?"setup-completed":"purchase-completed",callback:t=>{!function({state:e,payload:t}){Ro({componentName:"result",payload:t,state:e})}({state:e,payload:t})}})};async function Oo({state:e,setupFramepay:t=po,...n}={}){try{var r,i,a;e.data={},e.options={},e.form=ro({element:"form",options:n}),e.summary=ro({element:"summary",options:n}),e.form.style.maxWidth="750px",e.summary.style.maxWidth="750px",e.options=co({options:n}),e.storefront=io({options:n}),e.mainStyleVars=Ao({options:n}),e.options.themeFramepay=(({state:e,options:t={}})=>{const n=$o(`\n ${e.mainStyleVars}\n ${t.css||""}\n `);return{base:{...To(n,"input"),":hover":To(n,"inputHover"),":focus":To(n,"inputFocus"),"::placeholder":To(n,"inputPlaceholder"),"::selection":To(n,"inputSelection")},invalid:{...To(n,"inputError"),":hover":To(n,"inputErrorHover"),":focus":To(n,"inputErrorFocus"),"::placeholder":To(n,"inputErrorPlaceholder"),"::selection":To(n,"inputErrorSelection")},buttons:{base:{...To(n,"buttonSecondary"),":hover":To(n,"buttonSecondaryHover"),":focus":To(n,"buttonSecondaryActive")},active:{...To(n,"button"),":hover":To(n,"buttonHover"),":focus":To(n,"buttonActive")}}}})({state:e,options:n}),e.loader.addDOMElement({el:e.form}),e.loader.addDOMElement({section:"summary",el:e.summary}),e.loader.startLoading({state:e,section:"summary",id:"rebilly-instruments-summary"}),e.loader.startLoading({state:e,id:"rebilly-instruments-methods"}),e.data=await Xa({state:e}),Ue.dataReady.dispatch(e.data),e.i18n=(({state:e={}})=>{var t,n;if("auto"===e.options.locale&&null!==(t=e.data.riskMetadata)&&void 0!==t&&null!==(n=t.browserData)&&void 0!==n&&n.language){const{browserData:{language:t}}=e.data.riskMetadata;e.options.locale=t}return e.translate.init(e.options.locale,e.options.i18n),Eo})({state:e}),await t(e),!e.options.websiteId&&null!==(r=e.data.transaction)&&void 0!==r&&r.websiteId?e.options.websiteId=e.data.transaction.websiteId:!e.options.websiteId&&null!==(i=e.data.invoice)&&void 0!==i&&i.websiteId&&(e.options.websiteId=e.data.invoice.websiteId),e.data.transaction&&"setup"===(null===(a=e.data.transaction)||void 0===a?void 0:a.type)&&(e.options.transactionType="setup"),e.form&&to({state:e}),e.summary&&async function({state:e}){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r=await new Ye({name:"rebilly-instruments-summary",url:`${n}/summary`,container:e.summary,model:t});r.bindEventListeners({loader:e.loader}),e.iframeComponents.summary.push(r)}({state:e}),e.i18n({state:e}),e.hasMounted=!0}catch(e){throw Ge(e),e}Mo({state:e})}async function qo({state:e}){var t,n;var r;await(r=1e3,new Promise((e=>setTimeout(e,r)))),[...(null===(t=e.iframeComponents)||void 0===t?void 0:t.form)||[],...(null===(n=e.iframeComponents)||void 0===n?void 0:n.summary)||[]].forEach((e=>{e.destroy()})),De.removeAll(document),e.iframeComponents={summary:[],form:[]},e.hasMounted=!1,e.summary.textContent="",e.form.textContent="",Zr(),e.loader.clearAll()}function Bo({newOptions:e}){let t={};return t=Object.keys(e).some((e=>["items","money","invoiceId","transactionId"].includes(e)))?{items:null,money:null,invoiceId:null,transactionId:null}:t,t}var _o={en:{summary:{subTotal:"Sub Total",discounts:"Discounts",taxes:"Taxes",shipping:"Shipping",total:"Total"},form:{expressCheckout:"Express checkout",or:"Or",popupOverlayText:"Click here to show popup window",andMore:"and more",error:{noPaymentMethods:"No payment methods available for this transaction, please contact support."},loaderMessages:{processingPayment:"Processing payment instrument."}},paymentMethods:{"payment-card":"Payment card",ach:"Bank account"}}},zo={es:{summary:{subTotal:"Sub Total",discounts:"Descuentos",taxes:"Impuestos",shipping:"Envío",total:"Total"},form:{expressCheckout:"Chequeo rápido",or:"O pague con",andMore:"y más",popupOverlayText:"Haga clic aquí para mostrar la ventana emergente",error:{noPaymentMethods:"No hay métodos de pago disponibles para esta transacción, por favor, póngase en contacto con el servicio de asistencia."}},paymentMethods:{"payment-card":"Tarjeta de crédito",ach:"Cuenta bancaria"}}};class Do{constructor(){this.locale="",this.items=[],this.languages={}}init(e,t){this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale=this.getLocale(e),this.languages=Ya({},{..._o,...zo},t)}translateItems(){return this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale in this.languages&&this.items.forEach((e=>{const t=this.getTranslation(this.languages[this.locale],e.dataset.rebillyI18n);t&&(e.innerHTML=t)}))}updateTranslationsToNewLocale(e){this.locale=e,this.translateItems()}getLocale(e=this.locale){return!e.includes("-")||e in this.languages?e:(e=e.replace(/[-._]\w+$/gi,""),this.getLocale(e))}translateItem(e){const t=this.getLocale();return this.getTranslation(this.languages[t],e.dataset.rebillyI18n)}getTranslation(e=this.locale,t){return t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e)}}class No{constructor(){this.options=null,this.data={},this.mountingPoints=null,this.storefront=null,this.form=null,this.summary=null,this.loader=new m,this.translate=new Do,this.iframeComponents={summary:[],form:[]},this.hasMounted=!1}}var Uo=new class{constructor(){this.state=new No}async mount(e){await Oo({state:this.state,...e})}async destroy(){await qo({state:this.state})}async update(e){await async function({state:e,newOptions:t={}}){if(!e.hasMounted)throw Error("Update method cannot be called before mounting instruments");const n={...e.options,...Bo({newOptions:t})},r=Ya({...n},t);await qo({state:e}),Oo({state:e,form:e.form,summary:e.summary,...r})}({state:this.state,newOptions:e})}async purchase(e){await jo({state:this.state,payload:e})}async setup(e){await Po({state:this.state,payload:e})}async show(e,t){await Ro({state:this.state,componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.3.14.2-beta.0"}on(e,t){Co({state:this.state,eventName:e,callback:t})}};export{Uo as default};
65
+ */var L=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},R=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var i=null===e?"#000":e;if("string"!=typeof i)throw new TypeError("Input should be a string: "+i);var a=$(i);if(!a)throw new Error("Unable to parse color from string: "+i);return this["_setFrom"+a.type.toUpperCase()](a.values.concat([a.alpha]))},M={hex:{configurable:!0}};return M.hex.get=function(){return this.hexString().replace(/^#/,"")},R.prototype.setColor=function(e){var t=$(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},R.prototype.tint=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#fff",this.rgbString(),t).rgba+")","tint",t)},R.prototype.shade=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#000",this.rgbString(),t).rgba+")","shade",t)},R.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},R.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},R.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},R.prototype.hexString=function(){return H(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},R.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},R.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},R.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},R.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],i=e[2],a=e[3];return t=[T([n,r,i]).map(Math.round),a],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(R.prototype,M),R.VERSION="v2.0.0",R}()})),mo=fo;const ho=e=>new mo(e);function go(e,t=1){if(null===e)return e;const n=ho(e);return n.alpha=t,n.rgbString()}const yo=e=>go(e,.5),vo=(e,t)=>{if(null===e)return e;return ho(e).shade(t).hexString()};class bo{allStyles=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"];constructor(e){this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const wo={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>yo(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?go(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"Avenir, Helvetica, Arial, sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?vo(e.buttonColorBackground,20):vo(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new bo(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${vo(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new bo(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?yo(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new bo(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?yo(e.inputErrorColorText):yo(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var xo=new Proxy(wo,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:i}=e[t].fallback;if("static"===r)return i;if("variable"===r)return`var(--rebilly-${i})`;if("func"===r)return i(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class ko{constructor(e={}){this.overrides=e,this.theme=xo}static nonCssProperties=["labels"];overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!ko.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}function So(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var Ao=({options:{theme:e={},css:t}}={})=>{const n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n height: 44px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: 32px;\n height: 22px;\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n`)(new ko(e).build())}\n `;return t})(e||{});return no({element:"style",attributes:{type:"text/css"},content:So(n),target:"head"}),t&&no({element:"style",attributes:{type:"text/css"},content:So(t),target:"head"}),n};const Eo=({state:e})=>{e.translate.init(e.options.locale,e.options.i18n),e.translate.translateItems()};function $o(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let i=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];i=e.replace(n,t[r])})),n(i)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}const To=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});function Co({eventName:e,callback:t}){if(!We.includes(e))throw new Error(`${e} is not a supported event`);const n=le(e);Ue[n].addEventListener(t)}async function Io({name:e="",url:t="",model:n={},classListArray:r=[],close:i=(()=>{}),state:a=null}={}){var o;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;a.form.insertAdjacentHTML("beforeend",((e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`)(l,s));const u=document.querySelector(".rebilly-instruments-modal-overlay"),c=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{u.classList.add("is-visible"),c.classList.add("is-visible")}),240),a.loader.addDOMElement({section:"modal",el:p}),a.loader.startLoading({section:"modal",id:e});const f={options:a.options,...n},m=await new Qe({state:a,name:e,url:t,model:f,classListArray:r,container:p}),h=(...e)=>{c.classList.remove("is-visible"),u.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto",u.children.forEach((e=>e.remove())),u.remove(),i(...e),m.destroy()}),300)};return m.bindEventListeners({close:h,loader:a.loader}),l||d.addEventListener("click",h),m}async function Ho({state:e,payload:t}){const{_raw:{id:n},isExistingInstrument:r}=t;delete t.isExistingInstrument,delete t._raw;const i={...t};r?i.paymentInstrumentId=n:i.token=n,e.options.invoiceId&&(i.invoiceId=e.options.invoiceId),e.options.transactionId&&(i.transactionId=e.options.transactionId),e.options.money&&(i.websiteId=e.options.websiteId,i.amount=e.options.money.amount,i.currency=e.options.money.currency);let{fields:a}=await async function({data:e,state:t}){return di({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.payment({data:e}))))}({state:e,data:i});return a={transaction:a,token:a.token||e.options.jwt},e.data.invoice&&(a.invoice=e.data.invoice),a}async function Fo({state:e,payload:t}){const{fields:n}=await async function({data:e,state:t}){return di({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.purchase({data:e}))))}({state:e,data:{websiteId:e.options.websiteId,items:e.options.items,paymentInstruction:{token:t._raw.id},...t}});return n}async function jo({state:e,payload:t}){try{var n,r;let i;return i=e.data.isPayment?await Ho({state:e,payload:t}):await Fo({state:e,payload:t}),null!==(n=i.transaction)&&void 0!==n&&n.approvalUrl&&"unknown"===(null===(r=i.transaction)||void 0===r?void 0:r.result)?function({state:e,fields:t}){const{paymentMethodsUrl:n}=e.options._computed,r={};e.data.isPayment?r.payment=t:r.purchase=t,e.data=new Ja({state:e,...t}),Io({state:e,name:"rebilly-instruments-approval-url",url:`${n}/approval-url`,model:r,close:e=>{Ue.purchaseCompleted.dispatch(e)}})}({state:e,fields:i}):Ue.purchaseCompleted.dispatch(i),i}catch(e){return Ge(e),e}}async function Po({state:e,payload:t}){try{var n;const{_raw:{id:r},isExistingInstrument:i}=t;delete t.isExistingInstrument,delete t._raw;const a={...t};i?a.paymentInstrumentId=r:a.token=r;const{instrument:o,transaction:s}=await async function({data:e,state:t}){return di({state:t},(async()=>{var n,r;const{fields:i}=await t.storefront.paymentInstruments.create({data:e});t.storefront.setSessionToken(i.token||t.options.jwt);const a={id:i.id,data:{websiteId:t.options.websiteId,...e}};t.data.amountAndCurrency&&(a.data={...a.data,...t.data.amountAndCurrency}),null!==(n=t.data)&&void 0!==n&&null!==(r=n.transaction)&&void 0!==r&&r.redirectUrl&&(a.data.redirectUrl=`${a.data.redirectUrl}&originalRedirectUrl=${t.data.transaction.redirectUrl}`);const{fields:o}=await t.storefront.paymentInstruments.setup(a);return{instrument:i,transaction:o}}))}({state:e,data:{websiteId:null===(n=e.options)||void 0===n?void 0:n.websiteId,...a}});if(e.data=new Ja({state:e,instrument:o,transaction:s}),s.approvalUrl&&"unknown"===s.result){const{paymentMethodsUrl:t}=e.options._computed;Io({state:e,name:"rebilly-instruments-approval-url",url:`${t}/approval-url`,model:{setup:{transaction:s}},close:({transaction:e=s})=>{Ue.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ue.setupCompleted.dispatch({instrument:o,transaction:s});return{instrument:o,transaction:s}}catch(e){return Ge(e),e}}async function Lo({payload:e,state:t}){e.billingAddress&&t.summary&&t.data.isPurchase&&mi({state:t,instrument:e});t.form.querySelector(".rebilly-instruments-content").insertAdjacentHTML("afterend",'<div class="rebilly-instruments-confirmation"></div>');const n=t.form.querySelector(".rebilly-instruments-method-selector");n.style.visibility="hidden",n.style.height="0px",t.loader.startLoading({id:"rebilly-instruments-confirmation"});const r=document.querySelector(".rebilly-instruments-confirmation"),{paymentMethodsUrl:i}=t.options._computed,a={options:t.options,data:t.data.toPostmatesModel(),mainStyleVars:t.mainStyleVars,instrument:e},o="rebilly-instruments-confirmation",s=await new Ye({name:o,url:`${i}/confirmation`,container:r,model:a});s.bindEventListeners({loader:t.loader}),s.component.on(`${o}-confirm-purchase`,(e=>{jo({state:t,payload:e})})),s.component.on(`${o}-confirm-setup`,(e=>{Po({state:t,payload:e})})),s.component.on("choose-another-method",(()=>{t.iframeComponents.form=t.iframeComponents.form.filter((e=>e.name!==s.name||(e.destroy(),!1))),t.data.isPurchase&&mi({state:t}),async function({state:e}){var t;e.loader.startLoading({id:"rebilly-instruments-methods"});const{riskMetadata:n}=await Pa();e.data=await Xa({state:e,riskMetadata:n}),e.data.transaction&&"setup"===(null===(t=e.data.transaction)||void 0===t?void 0:t.type)&&(e.options.transactionType="setup"),to({state:e})}({state:t,mainStyleVars:t.mainStyleVars}),t.form.querySelector(".rebilly-instruments-confirmation").remove()})),t.iframeComponents.form.push(s)}async function Ro({componentName:e,payload:t,state:n}){switch(e){case"result":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),async function({payload:e,state:t}){var n,r;n=t.form,r='<div class="rebilly-instruments-result"></div>',n.querySelector(".rebilly-instruments-content").innerHTML=r,t.loader.startLoading({id:"rebilly-instruments-result"}),t.loader.stopLoading({id:"express-purchase"});const i=document.querySelector(".rebilly-instruments-result"),{paymentMethodsUrl:a}=t.options._computed,o={options:t.options,mainStyleVars:t.mainStyleVars,[t.options.transactionType]:e},s=await new Ye({name:"rebilly-instruments-result",url:`${a}/result`,container:i,model:o});s.bindEventListeners({loader:t.loader}),t.iframeComponents.form.push(s)}({payload:t,state:n});break;case"confirmation":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),Lo({payload:t,state:n});break;default:throw new Error(`'${e}' not a supported component`)}}var Mo=({state:e={}})=>{e.options.features.autoConfirmation&&Co({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?Po({state:e,payload:t}):jo({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Ro({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&Co({eventName:"setup"===e.options.transactionType?"setup-completed":"purchase-completed",callback:t=>{!function({state:e,payload:t}){Ro({componentName:"result",payload:t,state:e})}({state:e,payload:t})}})};async function Oo({state:e,setupFramepay:t=po,...n}={}){try{var r,i,a;e.data={},e.options={},e.form=ro({element:"form",options:n}),e.summary=ro({element:"summary",options:n}),e.form.style.maxWidth="750px",e.summary&&(e.summary.style.maxWidth="750px"),e.options=co({options:n}),e.storefront=io({options:n}),e.mainStyleVars=Ao({options:n}),e.options.themeFramepay=(({state:e,options:t={}})=>{const n=$o(`\n ${e.mainStyleVars}\n ${t.css||""}\n `);return{base:{...To(n,"input"),":hover":To(n,"inputHover"),":focus":To(n,"inputFocus"),"::placeholder":To(n,"inputPlaceholder"),"::selection":To(n,"inputSelection")},invalid:{...To(n,"inputError"),":hover":To(n,"inputErrorHover"),":focus":To(n,"inputErrorFocus"),"::placeholder":To(n,"inputErrorPlaceholder"),"::selection":To(n,"inputErrorSelection")},buttons:{base:{...To(n,"buttonSecondary"),":hover":To(n,"buttonSecondaryHover"),":focus":To(n,"buttonSecondaryActive")},active:{...To(n,"button"),":hover":To(n,"buttonHover"),":focus":To(n,"buttonActive")}}}})({state:e,options:n}),e.loader.addDOMElement({el:e.form}),e.loader.addDOMElement({section:"summary",el:e.summary}),e.loader.startLoading({state:e,section:"summary",id:"rebilly-instruments-summary"}),e.loader.startLoading({state:e,id:"rebilly-instruments-methods"}),e.data=await Xa({state:e}),Ue.dataReady.dispatch(e.data),e.i18n=(({state:e={}})=>{var t,n;if("auto"===e.options.locale&&null!==(t=e.data.riskMetadata)&&void 0!==t&&null!==(n=t.browserData)&&void 0!==n&&n.language){const{browserData:{language:t}}=e.data.riskMetadata;e.options.locale=t}return e.translate.init(e.options.locale,e.options.i18n),Eo})({state:e}),await t(e),!e.options.websiteId&&null!==(r=e.data.transaction)&&void 0!==r&&r.websiteId?e.options.websiteId=e.data.transaction.websiteId:!e.options.websiteId&&null!==(i=e.data.invoice)&&void 0!==i&&i.websiteId&&(e.options.websiteId=e.data.invoice.websiteId),e.data.transaction&&"setup"===(null===(a=e.data.transaction)||void 0===a?void 0:a.type)&&(e.options.transactionType="setup"),e.form&&to({state:e}),e.summary&&async function({state:e}){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r=await new Ye({name:"rebilly-instruments-summary",url:`${n}/summary`,container:e.summary,model:t});r.bindEventListeners({loader:e.loader}),e.iframeComponents.summary.push(r)}({state:e}),e.i18n({state:e}),e.hasMounted=!0}catch(e){throw Ge(e),e}Mo({state:e})}async function qo({state:e}){var t,n;var r;await(r=1e3,new Promise((e=>setTimeout(e,r)))),[...(null===(t=e.iframeComponents)||void 0===t?void 0:t.form)||[],...(null===(n=e.iframeComponents)||void 0===n?void 0:n.summary)||[]].forEach((e=>{e.destroy()})),De.removeAll(document),e.iframeComponents={summary:[],form:[]},e.hasMounted=!1,e.summary.textContent="",e.form.textContent="",Zr(),e.loader.clearAll()}function Bo({newOptions:e}){let t={};return t=Object.keys(e).some((e=>["items","money","invoiceId","transactionId"].includes(e)))?{items:null,money:null,invoiceId:null,transactionId:null}:t,t}var _o={en:{summary:{subTotal:"Sub Total",discounts:"Discounts",taxes:"Taxes",shipping:"Shipping",total:"Total"},form:{expressCheckout:"Express checkout",or:"Or",popupOverlayText:"Click here to show popup window",andMore:"and more",error:{noPaymentMethods:"No payment methods available for this transaction, please contact support."},loaderMessages:{processingPayment:"Processing payment instrument."}},paymentMethods:{"payment-card":"Payment card",ach:"Bank account"}}},zo={es:{summary:{subTotal:"Sub Total",discounts:"Descuentos",taxes:"Impuestos",shipping:"Envío",total:"Total"},form:{expressCheckout:"Chequeo rápido",or:"O pague con",andMore:"y más",popupOverlayText:"Haga clic aquí para mostrar la ventana emergente",error:{noPaymentMethods:"No hay métodos de pago disponibles para esta transacción, por favor, póngase en contacto con el servicio de asistencia."}},paymentMethods:{"payment-card":"Tarjeta de crédito",ach:"Cuenta bancaria"}}};class Do{constructor(){this.locale="",this.items=[],this.languages={}}init(e,t){this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale=this.getLocale(e),this.languages=Ya({},{..._o,...zo},t)}translateItems(){return this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale in this.languages&&this.items.forEach((e=>{const t=this.getTranslation(this.languages[this.locale],e.dataset.rebillyI18n);t&&(e.innerHTML=t)}))}updateTranslationsToNewLocale(e){this.locale=e,this.translateItems()}getLocale(e=this.locale){return!e.includes("-")||e in this.languages?e:(e=e.replace(/[-._]\w+$/gi,""),this.getLocale(e))}translateItem(e){const t=this.getLocale();return this.getTranslation(this.languages[t],e.dataset.rebillyI18n)}getTranslation(e=this.locale,t){return t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e)}}class No{constructor(){this.options=null,this.data={},this.mountingPoints=null,this.storefront=null,this.form=null,this.summary=null,this.loader=new m,this.translate=new Do,this.iframeComponents={summary:[],form:[]},this.hasMounted=!1}}var Uo=new class{constructor(){this.state=new No}async mount(e){await Oo({state:this.state,...e})}async destroy(){await qo({state:this.state})}async update(e){await async function({state:e,newOptions:t={}}){if(!e.hasMounted)throw Error("Update method cannot be called before mounting instruments");const n={...e.options,...Bo({newOptions:t})},r=Ya({...n},t);await qo({state:e}),Oo({state:e,form:e.form,summary:e.summary,...r})}({state:this.state,newOptions:e})}async purchase(e){await jo({state:this.state,payload:e})}async setup(e){await Po({state:this.state,payload:e})}async show(e,t){await Ro({state:this.state,componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.3.14.5-beta.0"}on(e,t){Co({state:this.state,eventName:e,callback:t})}};export{Uo as default};
package/dist/index.min.js CHANGED
@@ -5,7 +5,7 @@ var RebillyInstruments=function(){"use strict";
5
5
  @link https://github.com/vpopolin/postmate
6
6
  @author Jacob Kelley <jakie8@gmail.com>
7
7
  @license MIT
8
- **/var e="application/x-postmate-v1+json",t=0,n=0;var r={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},i=function(t,n){return("string"!=typeof n||t.origin===n)&&(!!t.data&&(("object"!=typeof t.data||"postmate"in t.data)&&(t.data.type===e&&!!r[t.data.postmate])))},a=function(){function n(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.childId=e.childId,this.events={},this.listener=function(e){if(!i(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,a=n.name;"emit"===e.data.postmate&&e.data.childId===t.childId&&a in t.events&&t.events[a].forEach((function(e){e.call(t,r)}))},this.parent.addEventListener("message",this.listener,!1)}var r=n.prototype;return r.get=function(n){var r=this;return new s.Promise((function(i){var a=++t;r.parent.addEventListener("message",(function e(t){t.data.uid===a&&"reply"===t.data.postmate&&t.data.childId===r.childId&&(r.parent.removeEventListener("message",e,!1),i(t.data.value))}),!1),r.child.postMessage({postmate:"request",type:e,property:n,uid:a},r.childOrigin)}))},r.call=function(t,n){this.child.postMessage({postmate:"call",type:e,property:t,data:n},this.childOrigin)},r.on=function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)},r.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},n}(),o=function(){function t(t){var n=this;this.model=t.model,this.parent=t.parent,this.parentOrigin=t.parentOrigin,this.child=t.child,this.childId=t.childId,this.child.addEventListener("message",(function(t){if(i(t,n.parentOrigin)){var r=t.data,a=r.property,o=r.uid,l=r.data;"call"!==t.data.postmate?function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return s.Promise.resolve(n)}(n.model,a).then((function(r){return t.source.postMessage({property:a,postmate:"reply",type:e,childId:n.childId,uid:o,value:r},t.origin)})):a in n.model&&"function"==typeof n.model[a]&&n.model[a](l)}}))}return t.prototype.emit=function(t,n){this.parent.postMessage({postmate:"emit",type:e,childId:this.childId,value:{name:t,data:n}},this.parentOrigin)},t}(),s=function(){function t(e){var t=e.container,r=void 0===t?void 0!==r?r:document.body:t,i=e.model,a=e.url,o=e.name,s=e.classListArray,l=void 0===s?[]:s;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",l.length>0&&this.frame.classList.add.apply(this.frame.classList,l),r.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=i||{},this.childId=++n,this.sendHandshake(a)}return t.prototype.sendHandshake=function(n){var r,o=this,s=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r}(n),l=0;return new t.Promise((function(t,u){o.parent.addEventListener("message",(function e(n){return!!i(n,s)&&(n.data.childId===o.childId&&("handshake-reply"===n.data.postmate?(clearInterval(r),o.parent.removeEventListener("message",e,!1),o.childOrigin=n.origin,t(new a(o))):u("Failed handshake")))}),!1);var c=function(){if(++l>5)return clearInterval(r),u("Handshake Timeout Reached");o.child.postMessage({postmate:"handshake",type:e,model:o.model,childId:o.childId},s)},d=function(){c(),r=setInterval(c,500)};o.frame.attachEvent?o.frame.attachEvent("onload",d):o.frame.addEventListener("load",d),o.frame.src=n}))},t}();s.debug=!1,s.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),s.Model=function(){function t(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return t.prototype.sendHandshakeReply=function(){var t=this;return new s.Promise((function(n,r){t.child.addEventListener("message",(function i(a){if(a.data.postmate){if("handshake"===a.data.postmate){t.child.removeEventListener("message",i,!1),a.source.postMessage({postmate:"handshake-reply",type:e,childId:a.data.childId},a.origin),t.childId=a.data.childId,t.parentOrigin=a.origin;var s=a.data.model;return s&&Object.keys(s).forEach((function(e){t.model[e]=s[e]})),n(new o(t))}return r("Handshake Reply Failed")}}),!1)}))},t}();const l=["Google Pay","Apple Pay","paypal"],u=["payment-card","ach"];function c({state:e}){var t;const n={EXPRESS_METHODS:[],METHODS:[]};return null===(t=e.data.readyToPay)||void 0===t||t.forEach((e=>{(({method:e,feature:t})=>l.includes(e)||l.includes(null==t?void 0:t.name))(e)?n.EXPRESS_METHODS.push(e):(({method:e})=>u.includes(e))(e)&&n.METHODS.push(e)})),window.ApplePaySession||(n.EXPRESS_METHODS=n.EXPRESS_METHODS.filter((e=>{var t;return"Apple Pay"!==(null==e||null===(t=e.feature)||void 0===t?void 0:t.name)})),e.loader.stopLoading({id:"applePay-express"})),n}function d(e){return e instanceof Element||e instanceof HTMLDocument}const p=(e="0px")=>`\n <div class="rebilly-instruments-loader is-active" style="padding: ${e}"></div>\n`,f='\n <div class="rebilly-instruments-loader-spinner"></div>\n';class m{constructor(){this.summary=[],this.form=[],this.modal=[],this.DOM={loaderContainer:p,summaryLoaderHTML:'\n <div class="rebilly-instruments-summary-loader-total rebilly-instruments-loader-display-flex rebilly-instruments-loader-align-center rebilly-instruments-loader-justify-space-between">\n <div><p class="is-el-loading">Total</p></div>\n <p class="total is-el-loading">$99.99</p>\n </div>\n',methodsLoaderHTML:'\n <div class="rebilly-instruments-methods-loader">\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-divider">\n <span class="rebilly-instruments-divider-label"><span class="is-el-loading">Divi</span></span>\n </div>\n <div class="rebilly-instruments-loader-display-flex rebilly-instruments-loader-justify-end">\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-form-fields">\n <div class="rebilly-instruments-loader-form-label"><small class="is-el-loading">Card holder name</small></div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-button">Continue</div> \n </div>\n',basicLoaderHTML:f}}addDOMElement({section:e="form",el:t=null}={}){d(t)&&(t.style.position="relative",this.DOM[e]=t)}startLoading({section:e="form",id:t=""}={}){var n;this[e].push(t);const r=document.querySelector(":root");let i="240px";if(null!==(n=this.DOM)&&void 0!==n&&n[e]){var a;let n=this.DOM[e].querySelector(".rebilly-instruments-loader");const{padding:o,paddingTop:s,paddingBottom:l}=getComputedStyle(null===(a=this.DOM)||void 0===a?void 0:a[e]);n?((t.includes("confirmation")||t.includes("result")||t.includes("modal"))&&(n.innerHTML=this.DOM.basicLoaderHTML),n.classList.add("is-active")):(this.DOM[e].innerHTML=p(`${parseFloat(o)+2}px`),n=this.DOM[e].querySelector(".rebilly-instruments-loader"),"form"===e?(n.insertAdjacentHTML("afterbegin",this.DOM.methodsLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-methodLoaderMinHeight")):"summary"===e&&(n.insertAdjacentHTML("afterbegin",this.DOM.summaryLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-summaryLoaderMinHeight"))),this.DOM[e].style.minHeight=`calc(${i} + ${s} + ${l} + 4px)`}}stopLoading({section:e="form",id:t=""}={}){const n=this[e].indexOf(t);-1!==n&&this[e].splice(n,1),!this[e].length&&this.DOM[e].querySelector(".rebilly-instruments-loader")&&(this.DOM[e].querySelector(".rebilly-instruments-loader").classList.remove("is-active"),this.DOM[e].style.minHeight="")}clearAll(){this.form.forEach((e=>{this.stopLoading({id:e})})),this.summary.forEach((e=>{this.stopLoading({section:"summary",id:e})})),this.modal.forEach((e=>{this.stopLoading({section:"modal",id:e})}))}}class h{constructor({state:e={},name:t="",url:n="",model:r={},container:i=null,classListArray:a=[]}={}){return(a=Array.isArray(a)?a:[]).includes("rebilly-instruments-iframe")||a.push("rebilly-instruments-iframe"),this.state=e,this.container=i,this.classListArray=a,this.name=t,this.url=n,this.model=r,this.component=null,(async()=>(this.component=await this.createComponent(),this))()}async destroy(){this.component.frame.parentNode&&await this.component.destroy()}async createComponent(){const e={appendChild:e=>{e.setAttribute("loading","lazy"),e.setAttribute("allow","payment"),e.setAttribute("scrolling","no"),e.allowPaymentRequest=!0,this.container.appendChild(e)}};u.includes(this.name)&&this.container.insertAdjacentHTML("beforeend",f);return await new s({name:this.name,url:this.url,container:e,classListArray:this.classListArray,model:this.model})}}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var v="[object Symbol]",b=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,w=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,x="\\u2700-\\u27bf",k="a-z\\xdf-\\xf6\\xf8-\\xff",S="A-Z\\xc0-\\xd6\\xd8-\\xde",A="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",E="['’]",$="[\\ud800-\\udfff]",T="["+A+"]",C="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",I="\\d+",H="[\\u2700-\\u27bf]",F="["+k+"]",j="[^\\ud800-\\udfff"+A+I+x+k+S+"]",P="\\ud83c[\\udffb-\\udfff]",L="[^\\ud800-\\udfff]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",M="[\\ud800-\\udbff][\\udc00-\\udfff]",O="["+S+"]",q="(?:"+F+"|"+j+")",B="(?:"+O+"|"+j+")",_="(?:['’](?:d|ll|m|re|s|t|ve))?",z="(?:['’](?:D|LL|M|RE|S|T|VE))?",D="(?:"+C+"|"+P+")"+"?",N="[\\ufe0e\\ufe0f]?",U=N+D+("(?:\\u200d(?:"+[L,R,M].join("|")+")"+N+D+")*"),W="(?:"+[H,R,M].join("|")+")"+U,V="(?:"+[L+C+"?",C,R,M,$].join("|")+")",G=RegExp(E,"g"),K=RegExp(C,"g"),J=RegExp(P+"(?="+P+")|"+V+U,"g"),X=RegExp([O+"?"+F+"+"+_+"(?="+[T,O,"$"].join("|")+")",B+"+"+z+"(?="+[T,O+q,"$"].join("|")+")",O+"?"+q+"+"+_,O+"+"+z,I,W].join("|"),"g"),Z=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Y=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Q="object"==typeof g&&g&&g.Object===Object&&g,ee="object"==typeof self&&self&&self.Object===Object&&self,te=Q||ee||Function("return this")();var ne,re=(ne={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(e){return null==ne?void 0:ne[e]});function ie(e){return Z.test(e)}function ae(e){return ie(e)?function(e){return e.match(J)||[]}(e):function(e){return e.split("")}(e)}var oe=Object.prototype.toString,se=te.Symbol,le=se?se.prototype:void 0,ue=le?le.toString:void 0;function ce(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&oe.call(e)==v}(e))return ue?ue.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function de(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}(e,t,n)}function pe(e){return null==e?"":ce(e)}var fe,me=(fe=function(e,t,n){return t=t.toLowerCase(),e+(n?ge(pe(t).toLowerCase()):t)},function(e){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){return e=pe(e),void 0===(t=n?void 0:t)?function(e){return Y.test(e)}(e)?function(e){return e.match(X)||[]}(e):function(e){return e.match(b)||[]}(e):e.match(t)||[]}(function(e){return(e=pe(e))&&e.replace(w,re).replace(K,"")}(e).replace(G,"")),fe,"")});var he,ge=(he="toUpperCase",function(e){var t=ie(e=pe(e))?ae(e):void 0,n=t?t[0]:e.charAt(0),r=t?de(t,1).join(""):e.slice(1);return n[he]()+r});var ye=me,ve="[object Symbol]",be=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xe="\\u2700-\\u27bf",ke="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ee="['’]",$e="["+Ae+"]",Te="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",Ce="\\d+",Ie="[\\u2700-\\u27bf]",He="["+ke+"]",Fe="[^\\ud800-\\udfff"+Ae+Ce+xe+ke+Se+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Pe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Se+"]",Re="(?:"+He+"|"+Fe+")",Me="(?:"+Le+"|"+Fe+")",Oe="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Be="(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?",_e="[\\ufe0e\\ufe0f]?",ze=_e+Be+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",je,Pe].join("|")+")"+_e+Be+")*"),De="(?:"+[Ie,je,Pe].join("|")+")"+ze,Ne=RegExp(Ee,"g"),Ue=RegExp(Te,"g"),We=RegExp([Le+"?"+He+"+"+Oe+"(?="+[$e,Le,"$"].join("|")+")",Me+"+"+qe+"(?="+[$e,Le+Re,"$"].join("|")+")",Le+"?"+Re+"+"+Oe,Le+"+"+qe,Ce,De].join("|"),"g"),Ve=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ge="object"==typeof g&&g&&g.Object===Object&&g,Ke="object"==typeof self&&self&&self.Object===Object&&self,Je=Ge||Ke||Function("return this")();var Xe=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});var Ze=Object.prototype.toString,Ye=Je.Symbol,Qe=Ye?Ye.prototype:void 0,et=Qe?Qe.toString:void 0;function tt(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Ze.call(e)==ve}(e))return et?et.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function nt(e){return null==e?"":tt(e)}var rt=function(e){return function(t){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){if(e=nt(e),void 0===(t=n?void 0:t))return function(e){return Ve.test(e)}(e)?function(e){return e.match(We)||[]}(e):function(e){return e.match(be)||[]}(e);return e.match(t)||[]}(function(e){return(e=nt(e))&&e.replace(we,Xe).replace(Ue,"")}(t).replace(Ne,"")),e,"")}}((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}));var it=rt;const at=new class{_listeners={};add(e,t){document.addEventListener(e,t,!1),e in this._listeners||(this._listeners[e]=[]),this._listeners[e].push(t)}removeAll(){Object.keys(this._listeners).forEach((e=>{this._listeners[e].forEach((t=>document.removeEventListener(e,t,!1)))})),this._listeners={}}};class ot{constructor(e){this.internalName="rebilly-instruments-"+e}addEventListener(e){at.add(this.internalName,(({detail:t})=>e(t)))}dispatch(e){const t=new CustomEvent(this.internalName,{bubbles:!0,detail:e});document.dispatchEvent(t)}}const st={dataReady:new ot("data-ready"),instrumentReady:new ot("instrument-ready"),purchaseCompleted:new ot("purchase-completed"),setupCompleted:new ot("setup-completed")},lt=Object.keys(st).map((e=>it(e)));function ut(){const e=document.querySelector("#rebilly-instruments-error");e&&(e.innerHTML="")}function ct(e){const t=document.querySelector("#rebilly-instruments-error");if(!t)return;t.innerHTML=(e=>{function t(t=null){return null===t&&(t="An unexpected error occurred","string"==typeof e&&(t=e),e.error&&(t=e.error),e.message&&(t=e.message)),`<p class="rebilly-instruments-error-card-message">${t}</p>`}return`<div class="rebilly-instruments-error-card">\n <header class="rebilly-instruments-error-card-header">\n <p class="rebilly-instruments-error-card-title">Error</p>\n <button class="rebilly-instruments-error-card-close-button">\n <svg class="rebilly-instruments-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 10.5858l2.8284-2.8284c.3906-.3906 1.0237-.3906 1.4142 0 .3906.3905.3906 1.0236 0 1.4142L13.4142 12l2.8284 2.8284c.3906.3906.3906 1.0237 0 1.4142-.3905.3906-1.0236.3906-1.4142 0L12 13.4142l-2.8284 2.8284c-.3906.3906-1.0237.3906-1.4142 0-.3906-.3905-.3906-1.0236 0-1.4142L10.5858 12 7.7574 9.1716c-.3906-.3906-.3906-1.0237 0-1.4142.3905-.3906 1.0236-.3906 1.4142 0L12 10.5858z" fill-rule="nonzero"/>\n </svg>\n </button>\n </header>\n ${e.details?function(){function n(e){let t=e;return e["data-rebilly"]&&(t=`"${e["data-rebilly"]}" ${e.error}`),t}return e.details.length>1?`<ul class="rebilly-instruments-error-card-details">\n ${e.details.map((e=>`<li>${n(e)}</li>`)).join("")}\n </ul>`:t(n(e.details[0]))}():t()}\n</div>`})(e);document.querySelector(".rebilly-instruments-error-card-close-button").addEventListener("click",ut),window.addEventListener("click",(function e(n){t.contains(n.target)||(window.removeEventListener("click",e,!1),ut())})),window.addEventListener("blur",(function e(){setTimeout((()=>{"IFRAME"===document.activeElement.tagName&&(window.removeEventListener("click",e,!1),ut())}))}),{once:!0}),t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),console.error("Rebilly Instruments Error",e),window.focus()}function dt(e){e.component.on(`${e.name}-dispatch`,(({event:e,detail:t})=>{st[ye(e).replace(/-/,"")].dispatch(t)}))}function pt(e){e.component.on(`${e.name}-resize-frame`,(t=>{e.component.frame.style.height=t}))}function ft(e,t){e.component.on(`${e.name}-stop-loading`,(e=>{var n;let{section:r}=t;r||(r=e.includes("summary")?"summary":"form"),null===(n=t.loader)||void 0===n||n.stopLoading({section:r,id:e})}))}function mt(e){e.component.on(`${e.name}-show-error`,ct)}const ht=class extends h{constructor(e={}){super(e)}bindEventListeners({loader:e}={}){dt(this),pt(this),ft(this,{loader:e}),mt(this)}},gt=class extends h{constructor(e={}){super(e)}bindEventListeners({close:e=(()=>{}),loader:t}={}){var n;dt(this),pt(this),(n=this).component.on(`${n.name}-change-iframe-src`,((e=null)=>{n.component.frame.src=e,n.component.frame.style.height="75vh"})),ft(this,{loader:t,section:"modal",id:this.name}),mt(this),this.component.on(`${this.name}-close`,((...t)=>{e(...t)})),window.addEventListener("message",(async t=>{if("rebilly-instruments-approval-url-close"===t.data)if("purchase"===this.state.options.transactionType){var n;this.state.storefront.setSessionToken(this.state.data.token||this.state.options.jwt);const[{fields:t},{fields:r}]=await Promise.all([this.state.storefront.transactions.get({id:this.state.data.transaction.id}),null!==(n=this.state.data.invoice)&&void 0!==n&&n.id?this.state.storefront.invoices.get({id:this.state.data.invoice.id}):{fields:null}]),i={orderId:this.state.data.orderId,token:this.state.data.token,transaction:t};r&&(i.invoice=r),e(i)}else if("setup"===this.state.options.transactionType){this.state.storefront.setSessionToken(this.state.data.instrument.token||this.state.options.jwt);const{fields:t}=await this.state.storefront.transactions.get({id:this.state.data.transaction.id});e({transaction:t,instrument:this.state.data.instrument})}else e()}),!1)}};class yt{constructor({...e}={}){Object.entries(e).forEach((([e,t])=>{this[e]=t}))}}class vt extends yt{constructor({unitPrice:e=0,quantity:t=0,price:n=0,...r}={}){super(r),this.unitPrice=e,this.quantity=t,this.price=n}}class bt extends yt{}class wt extends yt{constructor({amount:e=0,...t}){super(t),this.amount=e}}class xt{constructor({currency:e="",lineItems:t=[],taxes:n=[],discounts:r=[],subtotalAmount:i=0,taxAmount:a=0,shippingAmount:o=0,discountsAmount:s=0,total:l=0}={}){function u(e){const t=Array.isArray(e)?e:[];return{to:e=>t.map((t=>new e(t)))}}this.currency=e,this.lineItems=u(t).to(vt),this.taxes=u(n).to(bt),this.discounts=u(r).to(wt),this.subtotalAmount=i,this.taxAmount=a,this.shippingAmount=o,this.discountsAmount=s,this.total=l}}var kt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function St(){throw new Error("setTimeout has not been defined")}function At(){throw new Error("clearTimeout has not been defined")}var Et=St,$t=At;function Tt(e){if(Et===setTimeout)return setTimeout(e,0);if((Et===St||!Et)&&setTimeout)return Et=setTimeout,setTimeout(e,0);try{return Et(e,0)}catch(t){try{return Et.call(null,e,0)}catch(t){return Et.call(this,e,0)}}}"function"==typeof kt.setTimeout&&(Et=setTimeout),"function"==typeof kt.clearTimeout&&($t=clearTimeout);var Ct,It=[],Ht=!1,Ft=-1;function jt(){Ht&&Ct&&(Ht=!1,Ct.length?It=Ct.concat(It):Ft=-1,It.length&&Pt())}function Pt(){if(!Ht){var e=Tt(jt);Ht=!0;for(var t=It.length;t;){for(Ct=It,It=[];++Ft<t;)Ct&&Ct[Ft].run();Ft=-1,t=It.length}Ct=null,Ht=!1,function(e){if($t===clearTimeout)return clearTimeout(e);if(($t===At||!$t)&&clearTimeout)return $t=clearTimeout,clearTimeout(e);try{$t(e)}catch(t){try{return $t.call(null,e)}catch(t){return $t.call(this,e)}}}(e)}}function Lt(e,t){this.fun=e,this.array=t}Lt.prototype.run=function(){this.fun.apply(null,this.array)};function Rt(){}var Mt=Rt,Ot=Rt,qt=Rt,Bt=Rt,_t=Rt,zt=Rt,Dt=Rt;var Nt=kt.performance||{},Ut=Nt.now||Nt.mozNow||Nt.msNow||Nt.oNow||Nt.webkitNow||function(){return(new Date).getTime()};var Wt=new Date;var Vt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];It.push(new Lt(e,t)),1!==It.length||Ht||Tt(Pt)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Mt,addListener:Ot,once:qt,off:Bt,removeListener:_t,removeAllListeners:zt,emit:Dt,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Ut.call(Nt),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Wt)/1e3}},Gt=Object.defineProperty,Kt=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable,Zt=(e,t,n)=>t in e?Gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yt=(e,t)=>{for(var n in t||(t={}))Jt.call(t,n)&&Zt(e,n,t[n]);if(Kt)for(var n of Kt(t))Xt.call(t,n)&&Zt(e,n,t[n]);return e},Qt=(e,t,n)=>(Zt(e,"symbol"!=typeof t?t+"":t,n),n),en={exports:{}},tn=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},nn=tn,rn=Object.prototype.toString;function an(e){return Array.isArray(e)}function on(e){return void 0===e}function sn(e){return"[object ArrayBuffer]"===rn.call(e)}function ln(e){return null!==e&&"object"==typeof e}function un(e){if("[object Object]"!==rn.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function cn(e){return"[object Function]"===rn.call(e)}function dn(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),an(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var pn={isArray:an,isArrayBuffer:sn,isBuffer:function(e){return null!==e&&!on(e)&&null!==e.constructor&&!on(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===rn.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sn(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:ln,isPlainObject:un,isUndefined:on,isDate:function(e){return"[object Date]"===rn.call(e)},isFile:function(e){return"[object File]"===rn.call(e)},isBlob:function(e){return"[object Blob]"===rn.call(e)},isFunction:cn,isStream:function(e){return ln(e)&&cn(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===rn.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:dn,merge:function e(){var t={};function n(n,r){un(t[r])&&un(n)?t[r]=e(t[r],n):un(n)?t[r]=e({},n):an(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)dn(arguments[r],n);return t},extend:function(e,t,n){return dn(t,(function(t,r){e[r]=n&&"function"==typeof t?nn(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},fn=pn;function mn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var hn=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(fn.isURLSearchParams(t))r=t.toString();else{var i=[];fn.forEach(t,(function(e,t){null!=e&&(fn.isArray(e)?t+="[]":e=[e],fn.forEach(e,(function(e){fn.isDate(e)?e=e.toISOString():fn.isObject(e)&&(e=JSON.stringify(e)),i.push(mn(t)+"="+mn(e))})))})),r=i.join("&")}if(r){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},gn=pn;function yn(){this.handlers=[]}yn.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},yn.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},yn.prototype.forEach=function(e){gn.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var vn=yn,bn=pn,wn=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},xn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kn=wn,Sn=function(e,t,n,r,i){var a=new Error(e);return kn(a,t,n,r,i)},An=Sn,En=pn,$n=En.isStandardBrowserEnv()?{write:function(e,t,n,r,i,a){var o=[];o.push(e+"="+encodeURIComponent(t)),En.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),En.isString(r)&&o.push("path="+r),En.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Tn=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Cn=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},In=pn,Hn=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Fn=pn,jn=Fn.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=Fn.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function Pn(e){this.message=e}Pn.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Pn.prototype.__CANCEL__=!0;var Ln=Pn,Rn=pn,Mn=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(An("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},On=$n,qn=hn,Bn=function(e,t){return e&&!Tn(t)?Cn(e,t):t},_n=function(e){var t,n,r,i={};return e?(In.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=In.trim(e.substr(0,r)).toLowerCase(),n=In.trim(e.substr(r+1)),t){if(i[t]&&Hn.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i},zn=jn,Dn=Sn,Nn=xn,Un=Ln,Wn=function(e){return new Promise((function(t,n){var r,i=e.data,a=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}Rn.isFormData(i)&&delete a["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(u+":"+c)}var d=Bn(e.baseURL,e.url);function p(){if(l){var r="getAllResponseHeaders"in l?_n(l.getAllResponseHeaders()):null,i={data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l};Mn((function(e){t(e),s()}),(function(e){n(e),s()}),i),l=null}}if(l.open(e.method.toUpperCase(),qn(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=p:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(p)},l.onabort=function(){l&&(n(Dn("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(Dn("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||Nn;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Dn(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},Rn.isStandardBrowserEnv()){var f=(e.withCredentials||zn(d))&&e.xsrfCookieName?On.read(e.xsrfCookieName):void 0;f&&(a[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&Rn.forEach(a,(function(e,t){void 0===i&&"content-type"===t.toLowerCase()?delete a[t]:l.setRequestHeader(t,e)})),Rn.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(r=function(e){l&&(n(!e||e&&e.type?new Un("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r))),i||(i=null),l.send(i)}))},Vn=pn,Gn=function(e,t){bn.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},Kn=wn,Jn={"Content-Type":"application/x-www-form-urlencoded"};function Xn(e,t){!Vn.isUndefined(e)&&Vn.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Zn,Yn={transitional:xn,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==Vt&&"[object process]"===Object.prototype.toString.call(Vt))&&(Zn=Wn),Zn),transformRequest:[function(e,t){return Gn(t,"Accept"),Gn(t,"Content-Type"),Vn.isFormData(e)||Vn.isArrayBuffer(e)||Vn.isBuffer(e)||Vn.isStream(e)||Vn.isFile(e)||Vn.isBlob(e)?e:Vn.isArrayBufferView(e)?e.buffer:Vn.isURLSearchParams(e)?(Xn(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Vn.isObject(e)||t&&"application/json"===t["Content-Type"]?(Xn(t,"application/json"),function(e,t,n){if(Vn.isString(e))try{return(t||JSON.parse)(e),Vn.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Yn.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&Vn.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Kn(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Vn.forEach(["delete","get","head"],(function(e){Yn.headers[e]={}})),Vn.forEach(["post","put","patch"],(function(e){Yn.headers[e]=Vn.merge(Jn)}));var Qn=Yn,er=pn,tr=Qn,nr=function(e){return!(!e||!e.__CANCEL__)},rr=pn,ir=function(e,t,n){var r=this||tr;return er.forEach(n,(function(n){e=n.call(r,e,t)})),e},ar=nr,or=Qn,sr=Ln;function lr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new sr("canceled")}var ur=pn,cr=function(e,t){t=t||{};var n={};function r(e,t){return ur.isPlainObject(e)&&ur.isPlainObject(t)?ur.merge(e,t):ur.isPlainObject(t)?ur.merge({},t):ur.isArray(t)?t.slice():t}function i(n){return ur.isUndefined(t[n])?ur.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function a(e){if(!ur.isUndefined(t[e]))return r(void 0,t[e])}function o(n){return ur.isUndefined(t[n])?ur.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function s(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return ur.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||i,r=t(e);ur.isUndefined(r)&&t!==s||(n[e]=r)})),n},dr="0.26.1",pr=dr,fr={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){fr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var mr={};fr.transitional=function(e,t,n){function r(e,t){return"[Axios v"+pr+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new Error(r(i," has been removed"+(t?" in "+t:"")));return t&&!mr[i]&&(mr[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var hr={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=t[a];if(o){var s=e[a],l=void 0===s||o(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:fr},gr=pn,yr=hn,vr=vn,br=function(e){return lr(e),e.headers=e.headers||{},e.data=ir.call(e,e.data,e.headers,e.transformRequest),e.headers=rr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),rr.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||or.adapter)(e).then((function(t){return lr(e),t.data=ir.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return ar(t)||(lr(e),t&&t.response&&(t.response.data=ir.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},wr=cr,xr=hr,kr=xr.validators;function Sr(e){this.defaults=e,this.interceptors={request:new vr,response:new vr}}Sr.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=wr(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&xr.assertOptions(n,{silentJSONParsing:kr.transitional(kr.boolean),forcedJSONParsing:kr.transitional(kr.boolean),clarifyTimeoutError:kr.transitional(kr.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!i){var s=[br,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(o),a=Promise.resolve(t);s.length;)a=a.then(s.shift(),s.shift());return a}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{a=br(l)}catch(e){return Promise.reject(e)}for(;o.length;)a=a.then(o.shift(),o.shift());return a},Sr.prototype.getUri=function(e){return e=wr(this.defaults,e),yr(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},gr.forEach(["delete","get","head","options"],(function(e){Sr.prototype[e]=function(t,n){return this.request(wr(n||{},{method:e,url:t,data:(n||{}).data}))}})),gr.forEach(["post","put","patch"],(function(e){Sr.prototype[e]=function(t,n,r){return this.request(wr(r||{},{method:e,url:t,data:n}))}}));var Ar=Sr,Er=Ln;function $r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new Er(e),t(n.reason))}))}$r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},$r.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},$r.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},$r.source=function(){var e,t=new $r((function(t){e=t}));return{token:t,cancel:e}};var Tr=$r,Cr=pn,Ir=pn,Hr=tn,Fr=Ar,jr=cr;var Pr=function e(t){var n=new Fr(t),r=Hr(Fr.prototype.request,n);return Ir.extend(r,Fr.prototype,n),Ir.extend(r,n),r.create=function(n){return e(jr(t,n))},r}(Qn);Pr.Axios=Fr,Pr.Cancel=Ln,Pr.CancelToken=Tr,Pr.isCancel=nr,Pr.VERSION=dr,Pr.all=function(e){return Promise.all(e)},Pr.spread=function(e){return function(t){return e.apply(null,t)}},Pr.isAxiosError=function(e){return Cr.isObject(e)&&!0===e.isAxiosError},en.exports=Pr,en.exports.default=Pr;var Lr=en.exports;function Rr(e,{exclude:t=[]}={}){Object.freeze(e);const n="function"==typeof e;return Object.getOwnPropertyNames(e).forEach((r=>{n&&("caller"===r||"callee"===r||"arguments"===r)||null===e[r]||t.includes(r)||"object"!=typeof e[r]&&"function"!=typeof e[r]||Object.isFrozen(e[r])||Rr(e[r],{exclude:t})})),e}class Mr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.fields=Yt({},e),this.config=i,Rr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({fields:this.fields}))}}const Or={limit:"pagination-limit",offset:"pagination-offset",total:"pagination-total"};class qr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.limit=null,this.offset=null,this.total=null,Object.keys(Or).forEach((e=>{const t=r[Or[e]];this[e]=t?Number(t):null})),this.response={status:t,statusText:n,headers:r},this.items=e.map((e=>new Mr({data:e,status:t,statusText:n,headers:r}))),this.config=i,Rr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class Br{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.data=e,this.config=i}}class _r extends Error{constructor({error:e,name:t=null}){let{config:n=null,response:r=null,request:i=null,message:a=null}=e,o=a||"Request Error";r&&r.data&&r.data.error&&(o=r.data.error),super(o),this.name=t||"RebillyError",this.response=r,this.request=i,this.config=n,this.status=r&&r.status?r.status:null,this.statusText=r&&r.statusText?r.statusText:null,this.details=r&&r.data&&r.data.details?r.data.details:null,this.invalidFields=r&&r.data&&r.data.invalidFields?r.data.invalidFields:null}}const zr={RebillyError:_r,RebillyRequestError:class extends _r{constructor(e){super({error:e,name:"RebillyRequestError"})}},RebillyValidationError:class extends _r{constructor(e){super({error:e,name:"RebillyValidationError"})}},RebillyNotFoundError:class extends _r{constructor(e){super({error:e,name:"RebillyNotFoundError"})}},RebillyConflictError:class extends _r{constructor(e){super({error:e,name:"RebillyConflictError"})}},RebillyForbiddenError:class extends _r{constructor(e){super({error:e,name:"RebillyForbiddenError"})}},RebillyMethodNotAllowedError:class extends _r{constructor(e){super({error:e,name:"RebillyMethodNotAllowedError"})}},RebillyTimeoutError:class extends _r{constructor(e){super({error:e,name:"RebillyTimeoutError"})}},RebillyCanceledError:class extends _r{constructor(e){super({error:e,name:"RebillyCanceledError"})}}};
8
+ **/var e="application/x-postmate-v1+json",t=0,n=0;var r={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},i=function(t,n){return("string"!=typeof n||t.origin===n)&&(!!t.data&&(("object"!=typeof t.data||"postmate"in t.data)&&(t.data.type===e&&!!r[t.data.postmate])))},a=function(){function n(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.childId=e.childId,this.events={},this.listener=function(e){if(!i(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,a=n.name;"emit"===e.data.postmate&&e.data.childId===t.childId&&a in t.events&&t.events[a].forEach((function(e){e.call(t,r)}))},this.parent.addEventListener("message",this.listener,!1)}var r=n.prototype;return r.get=function(n){var r=this;return new s.Promise((function(i){var a=++t;r.parent.addEventListener("message",(function e(t){t.data.uid===a&&"reply"===t.data.postmate&&t.data.childId===r.childId&&(r.parent.removeEventListener("message",e,!1),i(t.data.value))}),!1),r.child.postMessage({postmate:"request",type:e,property:n,uid:a},r.childOrigin)}))},r.call=function(t,n){this.child.postMessage({postmate:"call",type:e,property:t,data:n},this.childOrigin)},r.on=function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)},r.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},n}(),o=function(){function t(t){var n=this;this.model=t.model,this.parent=t.parent,this.parentOrigin=t.parentOrigin,this.child=t.child,this.childId=t.childId,this.child.addEventListener("message",(function(t){if(i(t,n.parentOrigin)){var r=t.data,a=r.property,o=r.uid,l=r.data;"call"!==t.data.postmate?function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return s.Promise.resolve(n)}(n.model,a).then((function(r){return t.source.postMessage({property:a,postmate:"reply",type:e,childId:n.childId,uid:o,value:r},t.origin)})):a in n.model&&"function"==typeof n.model[a]&&n.model[a](l)}}))}return t.prototype.emit=function(t,n){this.parent.postMessage({postmate:"emit",type:e,childId:this.childId,value:{name:t,data:n}},this.parentOrigin)},t}(),s=function(){function t(e){var t=e.container,r=void 0===t?void 0!==r?r:document.body:t,i=e.model,a=e.url,o=e.name,s=e.classListArray,l=void 0===s?[]:s;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",l.length>0&&this.frame.classList.add.apply(this.frame.classList,l),r.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=i||{},this.childId=++n,this.sendHandshake(a)}return t.prototype.sendHandshake=function(n){var r,o=this,s=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r}(n),l=0;return new t.Promise((function(t,u){o.parent.addEventListener("message",(function e(n){return!!i(n,s)&&(n.data.childId===o.childId&&("handshake-reply"===n.data.postmate?(clearInterval(r),o.parent.removeEventListener("message",e,!1),o.childOrigin=n.origin,t(new a(o))):u("Failed handshake")))}),!1);var c=function(){if(++l>5)return clearInterval(r),u("Handshake Timeout Reached");o.child.postMessage({postmate:"handshake",type:e,model:o.model,childId:o.childId},s)},d=function(){c(),r=setInterval(c,500)};o.frame.attachEvent?o.frame.attachEvent("onload",d):o.frame.addEventListener("load",d),o.frame.src=n}))},t}();s.debug=!1,s.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),s.Model=function(){function t(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return t.prototype.sendHandshakeReply=function(){var t=this;return new s.Promise((function(n,r){t.child.addEventListener("message",(function i(a){if(a.data.postmate){if("handshake"===a.data.postmate){t.child.removeEventListener("message",i,!1),a.source.postMessage({postmate:"handshake-reply",type:e,childId:a.data.childId},a.origin),t.childId=a.data.childId,t.parentOrigin=a.origin;var s=a.data.model;return s&&Object.keys(s).forEach((function(e){t.model[e]=s[e]})),n(new o(t))}return r("Handshake Reply Failed")}}),!1)}))},t}();const l=["Google Pay","Apple Pay","paypal"],u=["payment-card","ach"];function c({state:e}){var t;const n={EXPRESS_METHODS:[],METHODS:[]};return null===(t=e.data.readyToPay)||void 0===t||t.forEach((e=>{(({method:e,feature:t})=>l.includes(e)||l.includes(null==t?void 0:t.name))(e)?n.EXPRESS_METHODS.push(e):(({method:e})=>u.includes(e))(e)&&n.METHODS.push(e)})),window.ApplePaySession||(n.EXPRESS_METHODS=n.EXPRESS_METHODS.filter((e=>{var t;return"Apple Pay"!==(null==e||null===(t=e.feature)||void 0===t?void 0:t.name)})),e.loader.stopLoading({id:"applePay-express"})),n}function d(e){return e instanceof Element||e instanceof HTMLDocument}const p=(e="0px")=>`\n <div class="rebilly-instruments-loader is-active" style="padding: ${e}"></div>\n`,f='\n <div class="rebilly-instruments-loader-spinner"></div>\n';class m{constructor(){this.summary=[],this.form=[],this.modal=[],this.DOM={loaderContainer:p,summaryLoaderHTML:'\n <div class="rebilly-instruments-summary-loader-total rebilly-instruments-loader-display-flex rebilly-instruments-loader-align-center rebilly-instruments-loader-justify-space-between">\n <div><p class="is-el-loading">Total</p></div>\n <p class="total is-el-loading">$99.99</p>\n </div>\n',methodsLoaderHTML:'\n <div class="rebilly-instruments-methods-loader">\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-divider">\n <span class="rebilly-instruments-divider-label"><span class="is-el-loading">Divi</span></span>\n </div>\n <div class="rebilly-instruments-loader-display-flex rebilly-instruments-loader-justify-end">\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-card-icon is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n <div class="rebilly-instruments-methods-loader-form-fields">\n <div class="rebilly-instruments-loader-form-label"><small class="is-el-loading">Card holder name</small></div>\n <div class="rebilly-instruments-loader-form-el is-el-loading"></div>\n </div>\n <div class="rebilly-instruments-loader-form-el is-button">Continue</div> \n </div>\n',basicLoaderHTML:f}}addDOMElement({section:e="form",el:t=null}={}){d(t)&&(t.style.position="relative",this.DOM[e]=t)}startLoading({section:e="form",id:t=""}={}){var n;this[e].push(t);const r=document.querySelector(":root");let i="240px";if(null!==(n=this.DOM)&&void 0!==n&&n[e]){var a;let n=this.DOM[e].querySelector(".rebilly-instruments-loader");const{padding:o,paddingTop:s,paddingBottom:l}=getComputedStyle(null===(a=this.DOM)||void 0===a?void 0:a[e]);n?((t.includes("confirmation")||t.includes("result")||t.includes("modal"))&&(n.innerHTML=this.DOM.basicLoaderHTML),n.classList.add("is-active")):(this.DOM[e].innerHTML=p(`${parseFloat(o)+2}px`),n=this.DOM[e].querySelector(".rebilly-instruments-loader"),"form"===e?(n.insertAdjacentHTML("afterbegin",this.DOM.methodsLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-methodLoaderMinHeight")):"summary"===e&&(n.insertAdjacentHTML("afterbegin",this.DOM.summaryLoaderHTML),i=getComputedStyle(r).getPropertyValue("--rebilly-summaryLoaderMinHeight"))),this.DOM[e].style.minHeight=`calc(${i} + ${s} + ${l} + 4px)`}}stopLoading({section:e="form",id:t=""}={}){const n=this[e].indexOf(t);-1!==n&&this[e].splice(n,1),!this[e].length&&this.DOM[e].querySelector(".rebilly-instruments-loader")&&(this.DOM[e].querySelector(".rebilly-instruments-loader").classList.remove("is-active"),this.DOM[e].style.minHeight="")}clearAll(){this.form.forEach((e=>{this.stopLoading({id:e})})),this.summary.forEach((e=>{this.stopLoading({section:"summary",id:e})})),this.modal.forEach((e=>{this.stopLoading({section:"modal",id:e})}))}}class h{constructor({state:e={},name:t="",url:n="",model:r={},container:i=null,classListArray:a=[]}={}){return(a=Array.isArray(a)?a:[]).includes("rebilly-instruments-iframe")||a.push("rebilly-instruments-iframe"),this.state=e,this.container=i,this.classListArray=a,this.name=t,this.url=n,this.model=r,this.component=null,(async()=>(this.component=await this.createComponent(),this))()}async destroy(){this.component.frame.parentNode&&await this.component.destroy()}async createComponent(){const e={appendChild:e=>{e.setAttribute("loading","lazy"),e.setAttribute("allow","payment"),e.setAttribute("scrolling","no"),e.allowPaymentRequest=!0,this.container.appendChild(e)}};u.includes(this.name)&&this.container.insertAdjacentHTML("beforeend",f);return await new s({name:this.name,url:this.url,container:e,classListArray:this.classListArray,model:this.model})}}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var v="[object Symbol]",b=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,w=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,x="\\u2700-\\u27bf",k="a-z\\xdf-\\xf6\\xf8-\\xff",S="A-Z\\xc0-\\xd6\\xd8-\\xde",A="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",E="['’]",$="[\\ud800-\\udfff]",T="["+A+"]",C="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",I="\\d+",H="[\\u2700-\\u27bf]",F="["+k+"]",j="[^\\ud800-\\udfff"+A+I+x+k+S+"]",P="\\ud83c[\\udffb-\\udfff]",L="[^\\ud800-\\udfff]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",M="[\\ud800-\\udbff][\\udc00-\\udfff]",O="["+S+"]",q="(?:"+F+"|"+j+")",B="(?:"+O+"|"+j+")",_="(?:['’](?:d|ll|m|re|s|t|ve))?",z="(?:['’](?:D|LL|M|RE|S|T|VE))?",D="(?:"+C+"|"+P+")"+"?",N="[\\ufe0e\\ufe0f]?",U=N+D+("(?:\\u200d(?:"+[L,R,M].join("|")+")"+N+D+")*"),W="(?:"+[H,R,M].join("|")+")"+U,V="(?:"+[L+C+"?",C,R,M,$].join("|")+")",G=RegExp(E,"g"),K=RegExp(C,"g"),J=RegExp(P+"(?="+P+")|"+V+U,"g"),X=RegExp([O+"?"+F+"+"+_+"(?="+[T,O,"$"].join("|")+")",B+"+"+z+"(?="+[T,O+q,"$"].join("|")+")",O+"?"+q+"+"+_,O+"+"+z,I,W].join("|"),"g"),Z=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Y=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Q="object"==typeof g&&g&&g.Object===Object&&g,ee="object"==typeof self&&self&&self.Object===Object&&self,te=Q||ee||Function("return this")();var ne,re=(ne={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(e){return null==ne?void 0:ne[e]});function ie(e){return Z.test(e)}function ae(e){return ie(e)?function(e){return e.match(J)||[]}(e):function(e){return e.split("")}(e)}var oe=Object.prototype.toString,se=te.Symbol,le=se?se.prototype:void 0,ue=le?le.toString:void 0;function ce(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&oe.call(e)==v}(e))return ue?ue.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function de(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}(e,t,n)}function pe(e){return null==e?"":ce(e)}var fe,me=(fe=function(e,t,n){return t=t.toLowerCase(),e+(n?ge(pe(t).toLowerCase()):t)},function(e){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){return e=pe(e),void 0===(t=n?void 0:t)?function(e){return Y.test(e)}(e)?function(e){return e.match(X)||[]}(e):function(e){return e.match(b)||[]}(e):e.match(t)||[]}(function(e){return(e=pe(e))&&e.replace(w,re).replace(K,"")}(e).replace(G,"")),fe,"")});var he,ge=(he="toUpperCase",function(e){var t=ie(e=pe(e))?ae(e):void 0,n=t?t[0]:e.charAt(0),r=t?de(t,1).join(""):e.slice(1);return n[he]()+r});var ye=me,ve="[object Symbol]",be=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xe="\\u2700-\\u27bf",ke="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ee="['’]",$e="["+Ae+"]",Te="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",Ce="\\d+",Ie="[\\u2700-\\u27bf]",He="["+ke+"]",Fe="[^\\ud800-\\udfff"+Ae+Ce+xe+ke+Se+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Pe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Se+"]",Re="(?:"+He+"|"+Fe+")",Me="(?:"+Le+"|"+Fe+")",Oe="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Be="(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?",_e="[\\ufe0e\\ufe0f]?",ze=_e+Be+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",je,Pe].join("|")+")"+_e+Be+")*"),De="(?:"+[Ie,je,Pe].join("|")+")"+ze,Ne=RegExp(Ee,"g"),Ue=RegExp(Te,"g"),We=RegExp([Le+"?"+He+"+"+Oe+"(?="+[$e,Le,"$"].join("|")+")",Me+"+"+qe+"(?="+[$e,Le+Re,"$"].join("|")+")",Le+"?"+Re+"+"+Oe,Le+"+"+qe,Ce,De].join("|"),"g"),Ve=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ge="object"==typeof g&&g&&g.Object===Object&&g,Ke="object"==typeof self&&self&&self.Object===Object&&self,Je=Ge||Ke||Function("return this")();var Xe=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});var Ze=Object.prototype.toString,Ye=Je.Symbol,Qe=Ye?Ye.prototype:void 0,et=Qe?Qe.toString:void 0;function tt(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Ze.call(e)==ve}(e))return et?et.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function nt(e){return null==e?"":tt(e)}var rt=function(e){return function(t){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}(function(e,t,n){if(e=nt(e),void 0===(t=n?void 0:t))return function(e){return Ve.test(e)}(e)?function(e){return e.match(We)||[]}(e):function(e){return e.match(be)||[]}(e);return e.match(t)||[]}(function(e){return(e=nt(e))&&e.replace(we,Xe).replace(Ue,"")}(t).replace(Ne,"")),e,"")}}((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}));var it=rt;const at=new class{_listeners={};add(e,t){document.addEventListener(e,t,!1),e in this._listeners||(this._listeners[e]=[]),this._listeners[e].push(t)}removeAll(){Object.keys(this._listeners).forEach((e=>{this._listeners[e].forEach((t=>document.removeEventListener(e,t,!1)))})),this._listeners={}}};class ot{constructor(e){this.internalName="rebilly-instruments-"+e}addEventListener(e){at.add(this.internalName,(({detail:t})=>e(t)))}dispatch(e){const t=new CustomEvent(this.internalName,{bubbles:!0,detail:e});document.dispatchEvent(t)}}const st={dataReady:new ot("data-ready"),instrumentReady:new ot("instrument-ready"),purchaseCompleted:new ot("purchase-completed"),setupCompleted:new ot("setup-completed")},lt=Object.keys(st).map((e=>it(e)));function ut(){const e=document.querySelector("#rebilly-instruments-error");e&&(e.innerHTML="")}function ct(e){const t=document.querySelector("#rebilly-instruments-error");if(!t)return;t.innerHTML=(e=>{function t(t=null){return null===t&&(t="An unexpected error occurred","string"==typeof e&&(t=e),e.error&&(t=e.error),e.message&&(t=e.message)),`<p class="rebilly-instruments-error-card-message">${t}</p>`}return`<div class="rebilly-instruments-error-card">\n <header class="rebilly-instruments-error-card-header">\n <p class="rebilly-instruments-error-card-title">Error</p>\n <button class="rebilly-instruments-error-card-close-button">\n <svg class="rebilly-instruments-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 10.5858l2.8284-2.8284c.3906-.3906 1.0237-.3906 1.4142 0 .3906.3905.3906 1.0236 0 1.4142L13.4142 12l2.8284 2.8284c.3906.3906.3906 1.0237 0 1.4142-.3905.3906-1.0236.3906-1.4142 0L12 13.4142l-2.8284 2.8284c-.3906.3906-1.0237.3906-1.4142 0-.3906-.3905-.3906-1.0236 0-1.4142L10.5858 12 7.7574 9.1716c-.3906-.3906-.3906-1.0237 0-1.4142.3905-.3906 1.0236-.3906 1.4142 0L12 10.5858z" fill-rule="nonzero"/>\n </svg>\n </button>\n </header>\n ${e.details?function(){function n(e){let t=e;return e["data-rebilly"]&&(t=`"${e["data-rebilly"]}" ${e.error}`),t}return e.details.length>1?`<ul class="rebilly-instruments-error-card-details">\n ${e.details.map((e=>`<li>${n(e)}</li>`)).join("")}\n </ul>`:t(n(e.details[0]))}():t()}\n</div>`})(e);document.querySelector(".rebilly-instruments-error-card-close-button").addEventListener("click",ut),window.addEventListener("click",(function e(n){t.contains(n.target)||(window.removeEventListener("click",e,!1),ut())})),window.addEventListener("blur",(function e(){setTimeout((()=>{"IFRAME"===document.activeElement.tagName&&(window.removeEventListener("click",e,!1),ut())}))}),{once:!0}),t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),console.error("Rebilly Instruments Error",e),window.focus()}function dt(e){e.component.on(`${e.name}-dispatch`,(({event:e,detail:t})=>{st[ye(e).replace(/-/,"")].dispatch(t)}))}function pt(e){let t="";e.component.on(`${e.name}-resize-frame`,(n=>{n!==t&&(t=n,e.component.frame.style.height=n)}))}function ft(e,t){e.component.on(`${e.name}-stop-loading`,(e=>{var n;let{section:r}=t;r||(r=e.includes("summary")?"summary":"form"),null===(n=t.loader)||void 0===n||n.stopLoading({section:r,id:e})}))}function mt(e){e.component.on(`${e.name}-show-error`,ct)}const ht=class extends h{constructor(e={}){super(e)}bindEventListeners({loader:e}={}){dt(this),pt(this),ft(this,{loader:e}),mt(this)}},gt=class extends h{constructor(e={}){super(e)}bindEventListeners({close:e=(()=>{}),loader:t}={}){var n;dt(this),pt(this),(n=this).component.on(`${n.name}-change-iframe-src`,((e=null)=>{n.component.frame.src=e,n.component.frame.style.height="75vh"})),ft(this,{loader:t,section:"modal",id:this.name}),mt(this),this.component.on(`${this.name}-close`,((...t)=>{e(...t)})),window.addEventListener("message",(async t=>{if("rebilly-instruments-approval-url-close"===t.data)if("purchase"===this.state.options.transactionType){var n;this.state.storefront.setSessionToken(this.state.data.token||this.state.options.jwt);const[{fields:t},{fields:r}]=await Promise.all([this.state.storefront.transactions.get({id:this.state.data.transaction.id}),null!==(n=this.state.data.invoice)&&void 0!==n&&n.id?this.state.storefront.invoices.get({id:this.state.data.invoice.id}):{fields:null}]),i={orderId:this.state.data.orderId,token:this.state.data.token,transaction:t};r&&(i.invoice=r),e(i)}else if("setup"===this.state.options.transactionType){this.state.storefront.setSessionToken(this.state.data.instrument.token||this.state.options.jwt);const{fields:t}=await this.state.storefront.transactions.get({id:this.state.data.transaction.id});e({transaction:t,instrument:this.state.data.instrument})}else e()}),!1)}};class yt{constructor({...e}={}){Object.entries(e).forEach((([e,t])=>{this[e]=t}))}}class vt extends yt{constructor({unitPrice:e=0,quantity:t=0,price:n=0,...r}={}){super(r),this.unitPrice=e,this.quantity=t,this.price=n}}class bt extends yt{}class wt extends yt{constructor({amount:e=0,...t}){super(t),this.amount=e}}class xt{constructor({currency:e="",lineItems:t=[],taxes:n=[],discounts:r=[],subtotalAmount:i=0,taxAmount:a=0,shippingAmount:o=0,discountsAmount:s=0,total:l=0}={}){function u(e){const t=Array.isArray(e)?e:[];return{to:e=>t.map((t=>new e(t)))}}this.currency=e,this.lineItems=u(t).to(vt),this.taxes=u(n).to(bt),this.discounts=u(r).to(wt),this.subtotalAmount=i,this.taxAmount=a,this.shippingAmount=o,this.discountsAmount=s,this.total=l}}var kt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function St(){throw new Error("setTimeout has not been defined")}function At(){throw new Error("clearTimeout has not been defined")}var Et=St,$t=At;function Tt(e){if(Et===setTimeout)return setTimeout(e,0);if((Et===St||!Et)&&setTimeout)return Et=setTimeout,setTimeout(e,0);try{return Et(e,0)}catch(t){try{return Et.call(null,e,0)}catch(t){return Et.call(this,e,0)}}}"function"==typeof kt.setTimeout&&(Et=setTimeout),"function"==typeof kt.clearTimeout&&($t=clearTimeout);var Ct,It=[],Ht=!1,Ft=-1;function jt(){Ht&&Ct&&(Ht=!1,Ct.length?It=Ct.concat(It):Ft=-1,It.length&&Pt())}function Pt(){if(!Ht){var e=Tt(jt);Ht=!0;for(var t=It.length;t;){for(Ct=It,It=[];++Ft<t;)Ct&&Ct[Ft].run();Ft=-1,t=It.length}Ct=null,Ht=!1,function(e){if($t===clearTimeout)return clearTimeout(e);if(($t===At||!$t)&&clearTimeout)return $t=clearTimeout,clearTimeout(e);try{$t(e)}catch(t){try{return $t.call(null,e)}catch(t){return $t.call(this,e)}}}(e)}}function Lt(e,t){this.fun=e,this.array=t}Lt.prototype.run=function(){this.fun.apply(null,this.array)};function Rt(){}var Mt=Rt,Ot=Rt,qt=Rt,Bt=Rt,_t=Rt,zt=Rt,Dt=Rt;var Nt=kt.performance||{},Ut=Nt.now||Nt.mozNow||Nt.msNow||Nt.oNow||Nt.webkitNow||function(){return(new Date).getTime()};var Wt=new Date;var Vt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];It.push(new Lt(e,t)),1!==It.length||Ht||Tt(Pt)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Mt,addListener:Ot,once:qt,off:Bt,removeListener:_t,removeAllListeners:zt,emit:Dt,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Ut.call(Nt),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Wt)/1e3}},Gt=Object.defineProperty,Kt=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable,Zt=(e,t,n)=>t in e?Gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yt=(e,t)=>{for(var n in t||(t={}))Jt.call(t,n)&&Zt(e,n,t[n]);if(Kt)for(var n of Kt(t))Xt.call(t,n)&&Zt(e,n,t[n]);return e},Qt=(e,t,n)=>(Zt(e,"symbol"!=typeof t?t+"":t,n),n),en={exports:{}},tn=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},nn=tn,rn=Object.prototype.toString;function an(e){return Array.isArray(e)}function on(e){return void 0===e}function sn(e){return"[object ArrayBuffer]"===rn.call(e)}function ln(e){return null!==e&&"object"==typeof e}function un(e){if("[object Object]"!==rn.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function cn(e){return"[object Function]"===rn.call(e)}function dn(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),an(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var pn={isArray:an,isArrayBuffer:sn,isBuffer:function(e){return null!==e&&!on(e)&&null!==e.constructor&&!on(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===rn.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sn(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:ln,isPlainObject:un,isUndefined:on,isDate:function(e){return"[object Date]"===rn.call(e)},isFile:function(e){return"[object File]"===rn.call(e)},isBlob:function(e){return"[object Blob]"===rn.call(e)},isFunction:cn,isStream:function(e){return ln(e)&&cn(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===rn.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:dn,merge:function e(){var t={};function n(n,r){un(t[r])&&un(n)?t[r]=e(t[r],n):un(n)?t[r]=e({},n):an(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)dn(arguments[r],n);return t},extend:function(e,t,n){return dn(t,(function(t,r){e[r]=n&&"function"==typeof t?nn(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},fn=pn;function mn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var hn=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(fn.isURLSearchParams(t))r=t.toString();else{var i=[];fn.forEach(t,(function(e,t){null!=e&&(fn.isArray(e)?t+="[]":e=[e],fn.forEach(e,(function(e){fn.isDate(e)?e=e.toISOString():fn.isObject(e)&&(e=JSON.stringify(e)),i.push(mn(t)+"="+mn(e))})))})),r=i.join("&")}if(r){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},gn=pn;function yn(){this.handlers=[]}yn.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},yn.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},yn.prototype.forEach=function(e){gn.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var vn=yn,bn=pn,wn=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},xn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kn=wn,Sn=function(e,t,n,r,i){var a=new Error(e);return kn(a,t,n,r,i)},An=Sn,En=pn,$n=En.isStandardBrowserEnv()?{write:function(e,t,n,r,i,a){var o=[];o.push(e+"="+encodeURIComponent(t)),En.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),En.isString(r)&&o.push("path="+r),En.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Tn=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Cn=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},In=pn,Hn=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Fn=pn,jn=Fn.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=Fn.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function Pn(e){this.message=e}Pn.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Pn.prototype.__CANCEL__=!0;var Ln=Pn,Rn=pn,Mn=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(An("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},On=$n,qn=hn,Bn=function(e,t){return e&&!Tn(t)?Cn(e,t):t},_n=function(e){var t,n,r,i={};return e?(In.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=In.trim(e.substr(0,r)).toLowerCase(),n=In.trim(e.substr(r+1)),t){if(i[t]&&Hn.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i},zn=jn,Dn=Sn,Nn=xn,Un=Ln,Wn=function(e){return new Promise((function(t,n){var r,i=e.data,a=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}Rn.isFormData(i)&&delete a["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(u+":"+c)}var d=Bn(e.baseURL,e.url);function p(){if(l){var r="getAllResponseHeaders"in l?_n(l.getAllResponseHeaders()):null,i={data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l};Mn((function(e){t(e),s()}),(function(e){n(e),s()}),i),l=null}}if(l.open(e.method.toUpperCase(),qn(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=p:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(p)},l.onabort=function(){l&&(n(Dn("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(Dn("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||Nn;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Dn(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},Rn.isStandardBrowserEnv()){var f=(e.withCredentials||zn(d))&&e.xsrfCookieName?On.read(e.xsrfCookieName):void 0;f&&(a[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&Rn.forEach(a,(function(e,t){void 0===i&&"content-type"===t.toLowerCase()?delete a[t]:l.setRequestHeader(t,e)})),Rn.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(r=function(e){l&&(n(!e||e&&e.type?new Un("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r))),i||(i=null),l.send(i)}))},Vn=pn,Gn=function(e,t){bn.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},Kn=wn,Jn={"Content-Type":"application/x-www-form-urlencoded"};function Xn(e,t){!Vn.isUndefined(e)&&Vn.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Zn,Yn={transitional:xn,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==Vt&&"[object process]"===Object.prototype.toString.call(Vt))&&(Zn=Wn),Zn),transformRequest:[function(e,t){return Gn(t,"Accept"),Gn(t,"Content-Type"),Vn.isFormData(e)||Vn.isArrayBuffer(e)||Vn.isBuffer(e)||Vn.isStream(e)||Vn.isFile(e)||Vn.isBlob(e)?e:Vn.isArrayBufferView(e)?e.buffer:Vn.isURLSearchParams(e)?(Xn(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Vn.isObject(e)||t&&"application/json"===t["Content-Type"]?(Xn(t,"application/json"),function(e,t,n){if(Vn.isString(e))try{return(t||JSON.parse)(e),Vn.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Yn.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&Vn.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Kn(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Vn.forEach(["delete","get","head"],(function(e){Yn.headers[e]={}})),Vn.forEach(["post","put","patch"],(function(e){Yn.headers[e]=Vn.merge(Jn)}));var Qn=Yn,er=pn,tr=Qn,nr=function(e){return!(!e||!e.__CANCEL__)},rr=pn,ir=function(e,t,n){var r=this||tr;return er.forEach(n,(function(n){e=n.call(r,e,t)})),e},ar=nr,or=Qn,sr=Ln;function lr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new sr("canceled")}var ur=pn,cr=function(e,t){t=t||{};var n={};function r(e,t){return ur.isPlainObject(e)&&ur.isPlainObject(t)?ur.merge(e,t):ur.isPlainObject(t)?ur.merge({},t):ur.isArray(t)?t.slice():t}function i(n){return ur.isUndefined(t[n])?ur.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function a(e){if(!ur.isUndefined(t[e]))return r(void 0,t[e])}function o(n){return ur.isUndefined(t[n])?ur.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function s(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return ur.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||i,r=t(e);ur.isUndefined(r)&&t!==s||(n[e]=r)})),n},dr="0.26.1",pr=dr,fr={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){fr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var mr={};fr.transitional=function(e,t,n){function r(e,t){return"[Axios v"+pr+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new Error(r(i," has been removed"+(t?" in "+t:"")));return t&&!mr[i]&&(mr[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var hr={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=t[a];if(o){var s=e[a],l=void 0===s||o(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:fr},gr=pn,yr=hn,vr=vn,br=function(e){return lr(e),e.headers=e.headers||{},e.data=ir.call(e,e.data,e.headers,e.transformRequest),e.headers=rr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),rr.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||or.adapter)(e).then((function(t){return lr(e),t.data=ir.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return ar(t)||(lr(e),t&&t.response&&(t.response.data=ir.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},wr=cr,xr=hr,kr=xr.validators;function Sr(e){this.defaults=e,this.interceptors={request:new vr,response:new vr}}Sr.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=wr(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&xr.assertOptions(n,{silentJSONParsing:kr.transitional(kr.boolean),forcedJSONParsing:kr.transitional(kr.boolean),clarifyTimeoutError:kr.transitional(kr.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!i){var s=[br,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(o),a=Promise.resolve(t);s.length;)a=a.then(s.shift(),s.shift());return a}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{a=br(l)}catch(e){return Promise.reject(e)}for(;o.length;)a=a.then(o.shift(),o.shift());return a},Sr.prototype.getUri=function(e){return e=wr(this.defaults,e),yr(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},gr.forEach(["delete","get","head","options"],(function(e){Sr.prototype[e]=function(t,n){return this.request(wr(n||{},{method:e,url:t,data:(n||{}).data}))}})),gr.forEach(["post","put","patch"],(function(e){Sr.prototype[e]=function(t,n,r){return this.request(wr(r||{},{method:e,url:t,data:n}))}}));var Ar=Sr,Er=Ln;function $r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new Er(e),t(n.reason))}))}$r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},$r.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},$r.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},$r.source=function(){var e,t=new $r((function(t){e=t}));return{token:t,cancel:e}};var Tr=$r,Cr=pn,Ir=pn,Hr=tn,Fr=Ar,jr=cr;var Pr=function e(t){var n=new Fr(t),r=Hr(Fr.prototype.request,n);return Ir.extend(r,Fr.prototype,n),Ir.extend(r,n),r.create=function(n){return e(jr(t,n))},r}(Qn);Pr.Axios=Fr,Pr.Cancel=Ln,Pr.CancelToken=Tr,Pr.isCancel=nr,Pr.VERSION=dr,Pr.all=function(e){return Promise.all(e)},Pr.spread=function(e){return function(t){return e.apply(null,t)}},Pr.isAxiosError=function(e){return Cr.isObject(e)&&!0===e.isAxiosError},en.exports=Pr,en.exports.default=Pr;var Lr=en.exports;function Rr(e,{exclude:t=[]}={}){Object.freeze(e);const n="function"==typeof e;return Object.getOwnPropertyNames(e).forEach((r=>{n&&("caller"===r||"callee"===r||"arguments"===r)||null===e[r]||t.includes(r)||"object"!=typeof e[r]&&"function"!=typeof e[r]||Object.isFrozen(e[r])||Rr(e[r],{exclude:t})})),e}class Mr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.fields=Yt({},e),this.config=i,Rr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({fields:this.fields}))}}const Or={limit:"pagination-limit",offset:"pagination-offset",total:"pagination-total"};class qr{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.limit=null,this.offset=null,this.total=null,Object.keys(Or).forEach((e=>{const t=r[Or[e]];this[e]=t?Number(t):null})),this.response={status:t,statusText:n,headers:r},this.items=e.map((e=>new Mr({data:e,status:t,statusText:n,headers:r}))),this.config=i,Rr(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class Br{constructor({data:e,status:t,statusText:n,headers:r},i={}){this.response={status:t,statusText:n,headers:r},this.data=e,this.config=i}}class _r extends Error{constructor({error:e,name:t=null}){let{config:n=null,response:r=null,request:i=null,message:a=null}=e,o=a||"Request Error";r&&r.data&&r.data.error&&(o=r.data.error),super(o),this.name=t||"RebillyError",this.response=r,this.request=i,this.config=n,this.status=r&&r.status?r.status:null,this.statusText=r&&r.statusText?r.statusText:null,this.details=r&&r.data&&r.data.details?r.data.details:null,this.invalidFields=r&&r.data&&r.data.invalidFields?r.data.invalidFields:null}}const zr={RebillyError:_r,RebillyRequestError:class extends _r{constructor(e){super({error:e,name:"RebillyRequestError"})}},RebillyValidationError:class extends _r{constructor(e){super({error:e,name:"RebillyValidationError"})}},RebillyNotFoundError:class extends _r{constructor(e){super({error:e,name:"RebillyNotFoundError"})}},RebillyConflictError:class extends _r{constructor(e){super({error:e,name:"RebillyConflictError"})}},RebillyForbiddenError:class extends _r{constructor(e){super({error:e,name:"RebillyForbiddenError"})}},RebillyMethodNotAllowedError:class extends _r{constructor(e){super({error:e,name:"RebillyMethodNotAllowedError"})}},RebillyTimeoutError:class extends _r{constructor(e){super({error:e,name:"RebillyTimeoutError"})}},RebillyCanceledError:class extends _r{constructor(e){super({error:e,name:"RebillyCanceledError"})}}};
9
9
  /*!
10
10
  * isobject <https://github.com/jonschlinkert/isobject>
11
11
  *
@@ -62,4 +62,4 @@ function j(e){var t=$(e);return null===t?null:("hsl"===t.type&&(t.values=T(t.val
62
62
  * @version v2.0.0
63
63
  * @link http://noeldelgado.github.io/values.js/
64
64
  * @license MIT
65
- */var L=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},R=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var i=null===e?"#000":e;if("string"!=typeof i)throw new TypeError("Input should be a string: "+i);var a=$(i);if(!a)throw new Error("Unable to parse color from string: "+i);return this["_setFrom"+a.type.toUpperCase()](a.values.concat([a.alpha]))},M={hex:{configurable:!0}};return M.hex.get=function(){return this.hexString().replace(/^#/,"")},R.prototype.setColor=function(e){var t=$(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},R.prototype.tint=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#fff",this.rgbString(),t).rgba+")","tint",t)},R.prototype.shade=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#000",this.rgbString(),t).rgba+")","shade",t)},R.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},R.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},R.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},R.prototype.hexString=function(){return H(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},R.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},R.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},R.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},R.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],i=e[2],a=e[3];return t=[T([n,r,i]).map(Math.round),a],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(R.prototype,M),R.VERSION="v2.0.0",R}()})),Fo=Ho;const jo=e=>new Fo(e);function Po(e,t=1){if(null===e)return e;const n=jo(e);return n.alpha=t,n.rgbString()}const Lo=e=>Po(e,.5),Ro=(e,t)=>{if(null===e)return e;return jo(e).shade(t).hexString()};class Mo{allStyles=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"];constructor(e){this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const Oo={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>Lo(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?Po(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"Avenir, Helvetica, Arial, sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?Ro(e.buttonColorBackground,20):Ro(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new Mo(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${Ro(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new Mo(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?Lo(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new Mo(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?Lo(e.inputErrorColorText):Lo(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var qo=new Proxy(Oo,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:i}=e[t].fallback;if("static"===r)return i;if("variable"===r)return`var(--rebilly-${i})`;if("func"===r)return i(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class Bo{constructor(e={}){this.overrides=e,this.theme=qo}static nonCssProperties=["labels"];overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!Bo.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}function _o(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var zo=({options:{theme:e={},css:t}}={})=>{const n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n height: 44px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: 32px;\n height: 22px;\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n`)(new Bo(e).build())}\n `;return t})(e||{});return wo({element:"style",attributes:{type:"text/css"},content:_o(n),target:"head"}),t&&wo({element:"style",attributes:{type:"text/css"},content:_o(t),target:"head"}),n};const Do=({state:e})=>{e.translate.init(e.options.locale,e.options.i18n),e.translate.translateItems()};function No(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let i=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];i=e.replace(n,t[r])})),n(i)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}const Uo=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});function Wo({eventName:e,callback:t}){if(!lt.includes(e))throw new Error(`${e} is not a supported event`);const n=ye(e);st[n].addEventListener(t)}async function Vo({name:e="",url:t="",model:n={},classListArray:r=[],close:i=(()=>{}),state:a=null}={}){var o;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;a.form.insertAdjacentHTML("beforeend",((e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`)(l,s));const u=document.querySelector(".rebilly-instruments-modal-overlay"),c=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{u.classList.add("is-visible"),c.classList.add("is-visible")}),240),a.loader.addDOMElement({section:"modal",el:p}),a.loader.startLoading({section:"modal",id:e});const f={options:a.options,...n},m=await new gt({state:a,name:e,url:t,model:f,classListArray:r,container:p}),h=(...e)=>{c.classList.remove("is-visible"),u.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto",u.children.forEach((e=>e.remove())),u.remove(),i(...e),m.destroy()}),300)};return m.bindEventListeners({close:h,loader:a.loader}),l||d.addEventListener("click",h),m}async function Go({state:e,payload:t}){const{_raw:{id:n},isExistingInstrument:r}=t;delete t.isExistingInstrument,delete t._raw;const i={...t};r?i.paymentInstrumentId=n:i.token=n,e.options.invoiceId&&(i.invoiceId=e.options.invoiceId),e.options.transactionId&&(i.transactionId=e.options.transactionId),e.options.money&&(i.websiteId=e.options.websiteId,i.amount=e.options.money.amount,i.currency=e.options.money.currency);let{fields:a}=await async function({data:e,state:t}){return Ci({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.payment({data:e}))))}({state:e,data:i});return a={transaction:a,token:a.token||e.options.jwt},e.data.invoice&&(a.invoice=e.data.invoice),a}async function Ko({state:e,payload:t}){const{fields:n}=await async function({data:e,state:t}){return Ci({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.purchase({data:e}))))}({state:e,data:{websiteId:e.options.websiteId,items:e.options.items,paymentInstruction:{token:t._raw.id},...t}});return n}async function Jo({state:e,payload:t}){try{var n,r;let i;return i=e.data.isPayment?await Go({state:e,payload:t}):await Ko({state:e,payload:t}),null!==(n=i.transaction)&&void 0!==n&&n.approvalUrl&&"unknown"===(null===(r=i.transaction)||void 0===r?void 0:r.result)?function({state:e,fields:t}){const{paymentMethodsUrl:n}=e.options._computed,r={};e.data.isPayment?r.payment=t:r.purchase=t,e.data=new fo({state:e,...t}),Vo({state:e,name:"rebilly-instruments-approval-url",url:`${n}/approval-url`,model:r,close:e=>{st.purchaseCompleted.dispatch(e)}})}({state:e,fields:i}):st.purchaseCompleted.dispatch(i),i}catch(e){return ct(e),e}}async function Xo({state:e,payload:t}){try{var n;const{_raw:{id:r},isExistingInstrument:i}=t;delete t.isExistingInstrument,delete t._raw;const a={...t};i?a.paymentInstrumentId=r:a.token=r;const{instrument:o,transaction:s}=await async function({data:e,state:t}){return Ci({state:t},(async()=>{var n,r;const{fields:i}=await t.storefront.paymentInstruments.create({data:e});t.storefront.setSessionToken(i.token||t.options.jwt);const a={id:i.id,data:{websiteId:t.options.websiteId,...e}};t.data.amountAndCurrency&&(a.data={...a.data,...t.data.amountAndCurrency}),null!==(n=t.data)&&void 0!==n&&null!==(r=n.transaction)&&void 0!==r&&r.redirectUrl&&(a.data.redirectUrl=`${a.data.redirectUrl}&originalRedirectUrl=${t.data.transaction.redirectUrl}`);const{fields:o}=await t.storefront.paymentInstruments.setup(a);return{instrument:i,transaction:o}}))}({state:e,data:{websiteId:null===(n=e.options)||void 0===n?void 0:n.websiteId,...a}});if(e.data=new fo({state:e,instrument:o,transaction:s}),s.approvalUrl&&"unknown"===s.result){const{paymentMethodsUrl:t}=e.options._computed;Vo({state:e,name:"rebilly-instruments-approval-url",url:`${t}/approval-url`,model:{setup:{transaction:s}},close:({transaction:e=s})=>{st.setupCompleted.dispatch({instrument:o,transaction:e})}})}else st.setupCompleted.dispatch({instrument:o,transaction:s});return{instrument:o,transaction:s}}catch(e){return ct(e),e}}async function Zo({payload:e,state:t}){e.billingAddress&&t.summary&&t.data.isPurchase&&Fi({state:t,instrument:e});t.form.querySelector(".rebilly-instruments-content").insertAdjacentHTML("afterend",'<div class="rebilly-instruments-confirmation"></div>');const n=t.form.querySelector(".rebilly-instruments-method-selector");n.style.visibility="hidden",n.style.height="0px",t.loader.startLoading({id:"rebilly-instruments-confirmation"});const r=document.querySelector(".rebilly-instruments-confirmation"),{paymentMethodsUrl:i}=t.options._computed,a={options:t.options,data:t.data.toPostmatesModel(),mainStyleVars:t.mainStyleVars,instrument:e},o="rebilly-instruments-confirmation",s=await new ht({name:o,url:`${i}/confirmation`,container:r,model:a});s.bindEventListeners({loader:t.loader}),s.component.on(`${o}-confirm-purchase`,(e=>{Jo({state:t,payload:e})})),s.component.on(`${o}-confirm-setup`,(e=>{Xo({state:t,payload:e})})),s.component.on("choose-another-method",(()=>{t.iframeComponents.form=t.iframeComponents.form.filter((e=>e.name!==s.name||(e.destroy(),!1))),t.data.isPurchase&&Fi({state:t}),async function({state:e}){var t;e.loader.startLoading({id:"rebilly-instruments-methods"});const{riskMetadata:n}=await Xa();e.data=await mo({state:e,riskMetadata:n}),e.data.transaction&&"setup"===(null===(t=e.data.transaction)||void 0===t?void 0:t.type)&&(e.options.transactionType="setup"),bo({state:e})}({state:t,mainStyleVars:t.mainStyleVars}),t.form.querySelector(".rebilly-instruments-confirmation").remove()})),t.iframeComponents.form.push(s)}async function Yo({componentName:e,payload:t,state:n}){switch(e){case"result":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),async function({payload:e,state:t}){var n,r;n=t.form,r='<div class="rebilly-instruments-result"></div>',n.querySelector(".rebilly-instruments-content").innerHTML=r,t.loader.startLoading({id:"rebilly-instruments-result"}),t.loader.stopLoading({id:"express-purchase"});const i=document.querySelector(".rebilly-instruments-result"),{paymentMethodsUrl:a}=t.options._computed,o={options:t.options,mainStyleVars:t.mainStyleVars,[t.options.transactionType]:e},s=await new ht({name:"rebilly-instruments-result",url:`${a}/result`,container:i,model:o});s.bindEventListeners({loader:t.loader}),t.iframeComponents.form.push(s)}({payload:t,state:n});break;case"confirmation":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),Zo({payload:t,state:n});break;default:throw new Error(`'${e}' not a supported component`)}}var Qo=({state:e={}})=>{e.options.features.autoConfirmation&&Wo({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?Xo({state:e,payload:t}):Jo({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Yo({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&Wo({eventName:"setup"===e.options.transactionType?"setup-completed":"purchase-completed",callback:t=>{!function({state:e,payload:t}){Yo({componentName:"result",payload:t,state:e})}({state:e,payload:t})}})};async function es({state:e,setupFramepay:t=Io,...n}={}){try{var r,i,a;e.data={},e.options={},e.form=xo({element:"form",options:n}),e.summary=xo({element:"summary",options:n}),e.form.style.maxWidth="750px",e.summary.style.maxWidth="750px",e.options=Co({options:n}),e.storefront=ko({options:n}),e.mainStyleVars=zo({options:n}),e.options.themeFramepay=(({state:e,options:t={}})=>{const n=No(`\n ${e.mainStyleVars}\n ${t.css||""}\n `);return{base:{...Uo(n,"input"),":hover":Uo(n,"inputHover"),":focus":Uo(n,"inputFocus"),"::placeholder":Uo(n,"inputPlaceholder"),"::selection":Uo(n,"inputSelection")},invalid:{...Uo(n,"inputError"),":hover":Uo(n,"inputErrorHover"),":focus":Uo(n,"inputErrorFocus"),"::placeholder":Uo(n,"inputErrorPlaceholder"),"::selection":Uo(n,"inputErrorSelection")},buttons:{base:{...Uo(n,"buttonSecondary"),":hover":Uo(n,"buttonSecondaryHover"),":focus":Uo(n,"buttonSecondaryActive")},active:{...Uo(n,"button"),":hover":Uo(n,"buttonHover"),":focus":Uo(n,"buttonActive")}}}})({state:e,options:n}),e.loader.addDOMElement({el:e.form}),e.loader.addDOMElement({section:"summary",el:e.summary}),e.loader.startLoading({state:e,section:"summary",id:"rebilly-instruments-summary"}),e.loader.startLoading({state:e,id:"rebilly-instruments-methods"}),e.data=await mo({state:e}),st.dataReady.dispatch(e.data),e.i18n=(({state:e={}})=>{var t,n;if("auto"===e.options.locale&&null!==(t=e.data.riskMetadata)&&void 0!==t&&null!==(n=t.browserData)&&void 0!==n&&n.language){const{browserData:{language:t}}=e.data.riskMetadata;e.options.locale=t}return e.translate.init(e.options.locale,e.options.i18n),Do})({state:e}),await t(e),!e.options.websiteId&&null!==(r=e.data.transaction)&&void 0!==r&&r.websiteId?e.options.websiteId=e.data.transaction.websiteId:!e.options.websiteId&&null!==(i=e.data.invoice)&&void 0!==i&&i.websiteId&&(e.options.websiteId=e.data.invoice.websiteId),e.data.transaction&&"setup"===(null===(a=e.data.transaction)||void 0===a?void 0:a.type)&&(e.options.transactionType="setup"),e.form&&bo({state:e}),e.summary&&async function({state:e}){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r=await new ht({name:"rebilly-instruments-summary",url:`${n}/summary`,container:e.summary,model:t});r.bindEventListeners({loader:e.loader}),e.iframeComponents.summary.push(r)}({state:e}),e.i18n({state:e}),e.hasMounted=!0}catch(e){throw ct(e),e}Qo({state:e})}async function ts({state:e}){var t,n;var r;await(r=1e3,new Promise((e=>setTimeout(e,r)))),[...(null===(t=e.iframeComponents)||void 0===t?void 0:t.form)||[],...(null===(n=e.iframeComponents)||void 0===n?void 0:n.summary)||[]].forEach((e=>{e.destroy()})),at.removeAll(document),e.iframeComponents={summary:[],form:[]},e.hasMounted=!1,e.summary.textContent="",e.form.textContent="",mi(),e.loader.clearAll()}function ns({newOptions:e}){let t={};return t=Object.keys(e).some((e=>["items","money","invoiceId","transactionId"].includes(e)))?{items:null,money:null,invoiceId:null,transactionId:null}:t,t}var rs={en:{summary:{subTotal:"Sub Total",discounts:"Discounts",taxes:"Taxes",shipping:"Shipping",total:"Total"},form:{expressCheckout:"Express checkout",or:"Or",popupOverlayText:"Click here to show popup window",andMore:"and more",error:{noPaymentMethods:"No payment methods available for this transaction, please contact support."},loaderMessages:{processingPayment:"Processing payment instrument."}},paymentMethods:{"payment-card":"Payment card",ach:"Bank account"}}},is={es:{summary:{subTotal:"Sub Total",discounts:"Descuentos",taxes:"Impuestos",shipping:"Envío",total:"Total"},form:{expressCheckout:"Chequeo rápido",or:"O pague con",andMore:"y más",popupOverlayText:"Haga clic aquí para mostrar la ventana emergente",error:{noPaymentMethods:"No hay métodos de pago disponibles para esta transacción, por favor, póngase en contacto con el servicio de asistencia."}},paymentMethods:{"payment-card":"Tarjeta de crédito",ach:"Cuenta bancaria"}}};class as{constructor(){this.locale="",this.items=[],this.languages={}}init(e,t){this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale=this.getLocale(e),this.languages=go({},{...rs,...is},t)}translateItems(){return this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale in this.languages&&this.items.forEach((e=>{const t=this.getTranslation(this.languages[this.locale],e.dataset.rebillyI18n);t&&(e.innerHTML=t)}))}updateTranslationsToNewLocale(e){this.locale=e,this.translateItems()}getLocale(e=this.locale){return!e.includes("-")||e in this.languages?e:(e=e.replace(/[-._]\w+$/gi,""),this.getLocale(e))}translateItem(e){const t=this.getLocale();return this.getTranslation(this.languages[t],e.dataset.rebillyI18n)}getTranslation(e=this.locale,t){return t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e)}}class os{constructor(){this.options=null,this.data={},this.mountingPoints=null,this.storefront=null,this.form=null,this.summary=null,this.loader=new m,this.translate=new as,this.iframeComponents={summary:[],form:[]},this.hasMounted=!1}}var ss=new class{constructor(){this.state=new os}async mount(e){await es({state:this.state,...e})}async destroy(){await ts({state:this.state})}async update(e){await async function({state:e,newOptions:t={}}){if(!e.hasMounted)throw Error("Update method cannot be called before mounting instruments");const n={...e.options,...ns({newOptions:t})},r=go({...n},t);await ts({state:e}),es({state:e,form:e.form,summary:e.summary,...r})}({state:this.state,newOptions:e})}async purchase(e){await Jo({state:this.state,payload:e})}async setup(e){await Xo({state:this.state,payload:e})}async show(e,t){await Yo({state:this.state,componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.3.14.2-beta.0"}on(e,t){Wo({state:this.state,eventName:e,callback:t})}};return ss}();
65
+ */var L=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},R=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var i=null===e?"#000":e;if("string"!=typeof i)throw new TypeError("Input should be a string: "+i);var a=$(i);if(!a)throw new Error("Unable to parse color from string: "+i);return this["_setFrom"+a.type.toUpperCase()](a.values.concat([a.alpha]))},M={hex:{configurable:!0}};return M.hex.get=function(){return this.hexString().replace(/^#/,"")},R.prototype.setColor=function(e){var t=$(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},R.prototype.tint=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#fff",this.rgbString(),t).rgba+")","tint",t)},R.prototype.shade=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#000",this.rgbString(),t).rgba+")","shade",t)},R.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},R.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},R.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},R.prototype.hexString=function(){return H(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},R.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},R.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},R.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},R.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],i=e[2],a=e[3];return t=[T([n,r,i]).map(Math.round),a],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(R.prototype,M),R.VERSION="v2.0.0",R}()})),Fo=Ho;const jo=e=>new Fo(e);function Po(e,t=1){if(null===e)return e;const n=jo(e);return n.alpha=t,n.rgbString()}const Lo=e=>Po(e,.5),Ro=(e,t)=>{if(null===e)return e;return jo(e).shade(t).hexString()};class Mo{allStyles=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"];constructor(e){this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const Oo={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>Lo(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?Po(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"Avenir, Helvetica, Arial, sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?Ro(e.buttonColorBackground,20):Ro(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new Mo(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${Ro(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new Mo(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?Lo(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new Mo(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?Lo(e.inputErrorColorText):Lo(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var qo=new Proxy(Oo,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:i}=e[t].fallback;if("static"===r)return i;if("variable"===r)return`var(--rebilly-${i})`;if("func"===r)return i(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class Bo{constructor(e={}){this.overrides=e,this.theme=qo}static nonCssProperties=["labels"];overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!Bo.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}function _o(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var zo=({options:{theme:e={},css:t}}={})=>{const n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n height: 44px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: 32px;\n height: 22px;\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n`)(new Bo(e).build())}\n `;return t})(e||{});return wo({element:"style",attributes:{type:"text/css"},content:_o(n),target:"head"}),t&&wo({element:"style",attributes:{type:"text/css"},content:_o(t),target:"head"}),n};const Do=({state:e})=>{e.translate.init(e.options.locale,e.options.i18n),e.translate.translateItems()};function No(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let i=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];i=e.replace(n,t[r])})),n(i)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}const Uo=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});function Wo({eventName:e,callback:t}){if(!lt.includes(e))throw new Error(`${e} is not a supported event`);const n=ye(e);st[n].addEventListener(t)}async function Vo({name:e="",url:t="",model:n={},classListArray:r=[],close:i=(()=>{}),state:a=null}={}){var o;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;a.form.insertAdjacentHTML("beforeend",((e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`)(l,s));const u=document.querySelector(".rebilly-instruments-modal-overlay"),c=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{u.classList.add("is-visible"),c.classList.add("is-visible")}),240),a.loader.addDOMElement({section:"modal",el:p}),a.loader.startLoading({section:"modal",id:e});const f={options:a.options,...n},m=await new gt({state:a,name:e,url:t,model:f,classListArray:r,container:p}),h=(...e)=>{c.classList.remove("is-visible"),u.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto",u.children.forEach((e=>e.remove())),u.remove(),i(...e),m.destroy()}),300)};return m.bindEventListeners({close:h,loader:a.loader}),l||d.addEventListener("click",h),m}async function Go({state:e,payload:t}){const{_raw:{id:n},isExistingInstrument:r}=t;delete t.isExistingInstrument,delete t._raw;const i={...t};r?i.paymentInstrumentId=n:i.token=n,e.options.invoiceId&&(i.invoiceId=e.options.invoiceId),e.options.transactionId&&(i.transactionId=e.options.transactionId),e.options.money&&(i.websiteId=e.options.websiteId,i.amount=e.options.money.amount,i.currency=e.options.money.currency);let{fields:a}=await async function({data:e,state:t}){return Ci({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.payment({data:e}))))}({state:e,data:i});return a={transaction:a,token:a.token||e.options.jwt},e.data.invoice&&(a.invoice=e.data.invoice),a}async function Ko({state:e,payload:t}){const{fields:n}=await async function({data:e,state:t}){return Ci({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.purchase({data:e}))))}({state:e,data:{websiteId:e.options.websiteId,items:e.options.items,paymentInstruction:{token:t._raw.id},...t}});return n}async function Jo({state:e,payload:t}){try{var n,r;let i;return i=e.data.isPayment?await Go({state:e,payload:t}):await Ko({state:e,payload:t}),null!==(n=i.transaction)&&void 0!==n&&n.approvalUrl&&"unknown"===(null===(r=i.transaction)||void 0===r?void 0:r.result)?function({state:e,fields:t}){const{paymentMethodsUrl:n}=e.options._computed,r={};e.data.isPayment?r.payment=t:r.purchase=t,e.data=new fo({state:e,...t}),Vo({state:e,name:"rebilly-instruments-approval-url",url:`${n}/approval-url`,model:r,close:e=>{st.purchaseCompleted.dispatch(e)}})}({state:e,fields:i}):st.purchaseCompleted.dispatch(i),i}catch(e){return ct(e),e}}async function Xo({state:e,payload:t}){try{var n;const{_raw:{id:r},isExistingInstrument:i}=t;delete t.isExistingInstrument,delete t._raw;const a={...t};i?a.paymentInstrumentId=r:a.token=r;const{instrument:o,transaction:s}=await async function({data:e,state:t}){return Ci({state:t},(async()=>{var n,r;const{fields:i}=await t.storefront.paymentInstruments.create({data:e});t.storefront.setSessionToken(i.token||t.options.jwt);const a={id:i.id,data:{websiteId:t.options.websiteId,...e}};t.data.amountAndCurrency&&(a.data={...a.data,...t.data.amountAndCurrency}),null!==(n=t.data)&&void 0!==n&&null!==(r=n.transaction)&&void 0!==r&&r.redirectUrl&&(a.data.redirectUrl=`${a.data.redirectUrl}&originalRedirectUrl=${t.data.transaction.redirectUrl}`);const{fields:o}=await t.storefront.paymentInstruments.setup(a);return{instrument:i,transaction:o}}))}({state:e,data:{websiteId:null===(n=e.options)||void 0===n?void 0:n.websiteId,...a}});if(e.data=new fo({state:e,instrument:o,transaction:s}),s.approvalUrl&&"unknown"===s.result){const{paymentMethodsUrl:t}=e.options._computed;Vo({state:e,name:"rebilly-instruments-approval-url",url:`${t}/approval-url`,model:{setup:{transaction:s}},close:({transaction:e=s})=>{st.setupCompleted.dispatch({instrument:o,transaction:e})}})}else st.setupCompleted.dispatch({instrument:o,transaction:s});return{instrument:o,transaction:s}}catch(e){return ct(e),e}}async function Zo({payload:e,state:t}){e.billingAddress&&t.summary&&t.data.isPurchase&&Fi({state:t,instrument:e});t.form.querySelector(".rebilly-instruments-content").insertAdjacentHTML("afterend",'<div class="rebilly-instruments-confirmation"></div>');const n=t.form.querySelector(".rebilly-instruments-method-selector");n.style.visibility="hidden",n.style.height="0px",t.loader.startLoading({id:"rebilly-instruments-confirmation"});const r=document.querySelector(".rebilly-instruments-confirmation"),{paymentMethodsUrl:i}=t.options._computed,a={options:t.options,data:t.data.toPostmatesModel(),mainStyleVars:t.mainStyleVars,instrument:e},o="rebilly-instruments-confirmation",s=await new ht({name:o,url:`${i}/confirmation`,container:r,model:a});s.bindEventListeners({loader:t.loader}),s.component.on(`${o}-confirm-purchase`,(e=>{Jo({state:t,payload:e})})),s.component.on(`${o}-confirm-setup`,(e=>{Xo({state:t,payload:e})})),s.component.on("choose-another-method",(()=>{t.iframeComponents.form=t.iframeComponents.form.filter((e=>e.name!==s.name||(e.destroy(),!1))),t.data.isPurchase&&Fi({state:t}),async function({state:e}){var t;e.loader.startLoading({id:"rebilly-instruments-methods"});const{riskMetadata:n}=await Xa();e.data=await mo({state:e,riskMetadata:n}),e.data.transaction&&"setup"===(null===(t=e.data.transaction)||void 0===t?void 0:t.type)&&(e.options.transactionType="setup"),bo({state:e})}({state:t,mainStyleVars:t.mainStyleVars}),t.form.querySelector(".rebilly-instruments-confirmation").remove()})),t.iframeComponents.form.push(s)}async function Yo({componentName:e,payload:t,state:n}){switch(e){case"result":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),async function({payload:e,state:t}){var n,r;n=t.form,r='<div class="rebilly-instruments-result"></div>',n.querySelector(".rebilly-instruments-content").innerHTML=r,t.loader.startLoading({id:"rebilly-instruments-result"}),t.loader.stopLoading({id:"express-purchase"});const i=document.querySelector(".rebilly-instruments-result"),{paymentMethodsUrl:a}=t.options._computed,o={options:t.options,mainStyleVars:t.mainStyleVars,[t.options.transactionType]:e},s=await new ht({name:"rebilly-instruments-result",url:`${a}/result`,container:i,model:o});s.bindEventListeners({loader:t.loader}),t.iframeComponents.form.push(s)}({payload:t,state:n});break;case"confirmation":n.iframeComponents.form=n.iframeComponents.form.filter((e=>(e.destroy(),!1))),Zo({payload:t,state:n});break;default:throw new Error(`'${e}' not a supported component`)}}var Qo=({state:e={}})=>{e.options.features.autoConfirmation&&Wo({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?Xo({state:e,payload:t}):Jo({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Yo({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&Wo({eventName:"setup"===e.options.transactionType?"setup-completed":"purchase-completed",callback:t=>{!function({state:e,payload:t}){Yo({componentName:"result",payload:t,state:e})}({state:e,payload:t})}})};async function es({state:e,setupFramepay:t=Io,...n}={}){try{var r,i,a;e.data={},e.options={},e.form=xo({element:"form",options:n}),e.summary=xo({element:"summary",options:n}),e.form.style.maxWidth="750px",e.summary&&(e.summary.style.maxWidth="750px"),e.options=Co({options:n}),e.storefront=ko({options:n}),e.mainStyleVars=zo({options:n}),e.options.themeFramepay=(({state:e,options:t={}})=>{const n=No(`\n ${e.mainStyleVars}\n ${t.css||""}\n `);return{base:{...Uo(n,"input"),":hover":Uo(n,"inputHover"),":focus":Uo(n,"inputFocus"),"::placeholder":Uo(n,"inputPlaceholder"),"::selection":Uo(n,"inputSelection")},invalid:{...Uo(n,"inputError"),":hover":Uo(n,"inputErrorHover"),":focus":Uo(n,"inputErrorFocus"),"::placeholder":Uo(n,"inputErrorPlaceholder"),"::selection":Uo(n,"inputErrorSelection")},buttons:{base:{...Uo(n,"buttonSecondary"),":hover":Uo(n,"buttonSecondaryHover"),":focus":Uo(n,"buttonSecondaryActive")},active:{...Uo(n,"button"),":hover":Uo(n,"buttonHover"),":focus":Uo(n,"buttonActive")}}}})({state:e,options:n}),e.loader.addDOMElement({el:e.form}),e.loader.addDOMElement({section:"summary",el:e.summary}),e.loader.startLoading({state:e,section:"summary",id:"rebilly-instruments-summary"}),e.loader.startLoading({state:e,id:"rebilly-instruments-methods"}),e.data=await mo({state:e}),st.dataReady.dispatch(e.data),e.i18n=(({state:e={}})=>{var t,n;if("auto"===e.options.locale&&null!==(t=e.data.riskMetadata)&&void 0!==t&&null!==(n=t.browserData)&&void 0!==n&&n.language){const{browserData:{language:t}}=e.data.riskMetadata;e.options.locale=t}return e.translate.init(e.options.locale,e.options.i18n),Do})({state:e}),await t(e),!e.options.websiteId&&null!==(r=e.data.transaction)&&void 0!==r&&r.websiteId?e.options.websiteId=e.data.transaction.websiteId:!e.options.websiteId&&null!==(i=e.data.invoice)&&void 0!==i&&i.websiteId&&(e.options.websiteId=e.data.invoice.websiteId),e.data.transaction&&"setup"===(null===(a=e.data.transaction)||void 0===a?void 0:a.type)&&(e.options.transactionType="setup"),e.form&&bo({state:e}),e.summary&&async function({state:e}){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r=await new ht({name:"rebilly-instruments-summary",url:`${n}/summary`,container:e.summary,model:t});r.bindEventListeners({loader:e.loader}),e.iframeComponents.summary.push(r)}({state:e}),e.i18n({state:e}),e.hasMounted=!0}catch(e){throw ct(e),e}Qo({state:e})}async function ts({state:e}){var t,n;var r;await(r=1e3,new Promise((e=>setTimeout(e,r)))),[...(null===(t=e.iframeComponents)||void 0===t?void 0:t.form)||[],...(null===(n=e.iframeComponents)||void 0===n?void 0:n.summary)||[]].forEach((e=>{e.destroy()})),at.removeAll(document),e.iframeComponents={summary:[],form:[]},e.hasMounted=!1,e.summary.textContent="",e.form.textContent="",mi(),e.loader.clearAll()}function ns({newOptions:e}){let t={};return t=Object.keys(e).some((e=>["items","money","invoiceId","transactionId"].includes(e)))?{items:null,money:null,invoiceId:null,transactionId:null}:t,t}var rs={en:{summary:{subTotal:"Sub Total",discounts:"Discounts",taxes:"Taxes",shipping:"Shipping",total:"Total"},form:{expressCheckout:"Express checkout",or:"Or",popupOverlayText:"Click here to show popup window",andMore:"and more",error:{noPaymentMethods:"No payment methods available for this transaction, please contact support."},loaderMessages:{processingPayment:"Processing payment instrument."}},paymentMethods:{"payment-card":"Payment card",ach:"Bank account"}}},is={es:{summary:{subTotal:"Sub Total",discounts:"Descuentos",taxes:"Impuestos",shipping:"Envío",total:"Total"},form:{expressCheckout:"Chequeo rápido",or:"O pague con",andMore:"y más",popupOverlayText:"Haga clic aquí para mostrar la ventana emergente",error:{noPaymentMethods:"No hay métodos de pago disponibles para esta transacción, por favor, póngase en contacto con el servicio de asistencia."}},paymentMethods:{"payment-card":"Tarjeta de crédito",ach:"Cuenta bancaria"}}};class as{constructor(){this.locale="",this.items=[],this.languages={}}init(e,t){this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale=this.getLocale(e),this.languages=go({},{...rs,...is},t)}translateItems(){return this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale in this.languages&&this.items.forEach((e=>{const t=this.getTranslation(this.languages[this.locale],e.dataset.rebillyI18n);t&&(e.innerHTML=t)}))}updateTranslationsToNewLocale(e){this.locale=e,this.translateItems()}getLocale(e=this.locale){return!e.includes("-")||e in this.languages?e:(e=e.replace(/[-._]\w+$/gi,""),this.getLocale(e))}translateItem(e){const t=this.getLocale();return this.getTranslation(this.languages[t],e.dataset.rebillyI18n)}getTranslation(e=this.locale,t){return t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e)}}class os{constructor(){this.options=null,this.data={},this.mountingPoints=null,this.storefront=null,this.form=null,this.summary=null,this.loader=new m,this.translate=new as,this.iframeComponents={summary:[],form:[]},this.hasMounted=!1}}var ss=new class{constructor(){this.state=new os}async mount(e){await es({state:this.state,...e})}async destroy(){await ts({state:this.state})}async update(e){await async function({state:e,newOptions:t={}}){if(!e.hasMounted)throw Error("Update method cannot be called before mounting instruments");const n={...e.options,...ns({newOptions:t})},r=go({...n},t);await ts({state:e}),es({state:e,form:e.form,summary:e.summary,...r})}({state:this.state,newOptions:e})}async purchase(e){await Jo({state:this.state,payload:e})}async setup(e){await Xo({state:this.state,payload:e})}async show(e,t){await Yo({state:this.state,componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.3.14.5-beta.0"}on(e,t){Wo({state:this.state,eventName:e,callback:t})}};return ss}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/instruments",
3
- "version": "3.14.2-beta.0",
3
+ "version": "3.14.5-beta.0",
4
4
  "author": "Rebilly",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -91,7 +91,9 @@ export async function mount({
91
91
  // hardcode max-width to not break UX
92
92
  // PayPal button cannot exceed 750px;
93
93
  state.form.style.maxWidth = '750px';
94
- state.summary.style.maxWidth = '750px';
94
+ if (state.summary) {
95
+ state.summary.style.maxWidth = '750px';
96
+ }
95
97
 
96
98
  // Setup state
97
99
  state.options = setupOptions({ options });
@@ -9,8 +9,12 @@ export function dispatchRebillyInsturmentEventHandler(iframe) {
9
9
  }
10
10
 
11
11
  export function resizeComponentHandler(iframe) {
12
+ let prevHeight = '';
12
13
  iframe.component.on(`${iframe.name}-resize-frame`, (height) => {
13
- iframe.component.frame.style.height = height;
14
+ if (height !== prevHeight) {
15
+ prevHeight = height;
16
+ iframe.component.frame.style.height = height;
17
+ }
14
18
  });
15
19
  }
16
20