@rebilly/instruments 4.3.0 → 4.4.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [4.4.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v4.3.0...instruments/core-v4.4.0) (2023-08-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * **recomm:** Add tags to AML checks ([#896](https://github.com/Rebilly/rebilly/issues/896)) ([759822f](https://github.com/Rebilly/rebilly/commit/759822f93cbeef56f54902ff6e2af765bdbc7a8e))
7
+
1
8
  ## [4.3.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v4.2.1...instruments/core-v4.3.0) (2023-08-21)
2
9
 
3
10
 
package/dist/index.js CHANGED
@@ -65,4 +65,4 @@ function L(e){var t=_(e);return null===t?null:("hsl"===t.type&&(t.values=P(t.val
65
65
  * @version v2.1.1
66
66
  * @link http://noeldelgado.github.io/values.js/
67
67
  * @license MIT
68
- */var N=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},O=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 a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var o=_(a);if(!o)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+o.type.toUpperCase()](o.values.concat([o.alpha]))},R={hex:{configurable:!0}};return R.hex.get=function(){return this.hexString().replace(/^#/,"")},O.prototype.setColor=function(e){var t=_(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},O.prototype.tint=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#fff",this.rgbString(),t).rgba+")","tint",t)},O.prototype.shade=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#000",this.rgbString(),t).rgba+")","shade",t)},O.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},O.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},O.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},O.prototype.hexString=function(){return C(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},O.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},O.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},O.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},O.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],o=e[3];return t=[P([n,r,a]).map(Math.round),o],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(O.prototype,R),O.VERSION="v2.1.1",O}()})),Im=Am;const Cm=e=>new Im(e);function jm(e,t=1){if(null===e)return e;const n=Cm(e);return n.alpha=t,n.rgbString()}const Lm=e=>jm(e,.5),Tm=(e,t)=>{if(null===e)return e;return Cm(e).shade(t).hexString()};function Nm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Om{constructor(e){Nm(this,"allStyles",["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"]),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 Rm={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>Lm(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?jm(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',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?Tm(e.buttonColorBackground,20):Tm(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 Om(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 ${Tm(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 Om(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?Lm(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 Om(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?Lm(e.inputErrorColorText):Lm(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 Mm=new Proxy(Rm,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(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 Fm{constructor(e={}){this.overrides=e,this.theme=Mm}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!Fm.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Fm,"nonCssProperties",["labels"]);function Hm(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 Dm=()=>{const{theme:e={},css:t}=Qr.options,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/* Base, Typography\n------------------------------------------------------------ */\n/* Base setup for top level elements */\n.rebilly-instruments-content {\n color: var(--rebilly-colorText);\n background: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeBase);\n font-weight: var(--rebilly-fontWeightBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-fontFamily);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n font-smooth: var(--rebilly-fontSmooth);\n padding: 2px;\n font-display: swap;\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-amount-selector {\n padding: 2px;\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\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 min-height: 48px;\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.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method {\n border-radius: 100px;\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/* Components. Icons\n------------------------------------------------------------ */\n.rebilly-instruments-icon {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n/* Components. Forms. Checkboxes\n------------------------------------------------------------ */\n.rebilly-instruments-form-field-checkbox {\n position: relative;\n opacity: 1;\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-start;\n cursor: pointer;\n transform: none;\n}\n\n.rebilly-instruments-form-field-checkbox > * {\n cursor: pointer;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.rebilly-instruments-form-field-checkbox span {\n position: relative;\n top: 0;\n left: 0;\n width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n min-width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--rebilly-colorMutedBorder);\n margin-right: var(--rebilly-spacingS);\n background-color: transparent;\n transition: all 200ms;\n}\n\n.rebilly-instruments-form-field-checkbox span:after {\n content: '';\n position: absolute;\n border: solid var(--rebilly-colorPrimary);\n width: calc(var(--rebilly-spacingXs) + var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingXs) - var(--rebilly-spacing2xs) + 2px);\n border-width: 2px 2px 0 0;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n opacity: 0;\n transform: translateY(-60%) translateX(-50%) rotate(135deg);\n transition: all 0.2s ease;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {\n opacity: 1;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {\n opacity: 0.6;\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: calc(var(--rebilly-fontLineHeightBase) + 10px);\n height: var(--rebilly-fontLineHeightBase);\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.rebilly-instruments-error-card.not-closeable {\n margin-bottom: 0;\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\n\n/* Bump offer\n------------------------------------------------------------ */\n.rebilly-instruments-bump-offers {\n text-align: left;\n margin-bottom: calc(var(--rebilly-spacingM) + var(--rebilly-fontSizeS));\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-form-field-checkbox {\n margin-bottom: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-bump-offer-label {\n width: 100%;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item {\n border-bottom: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS) 0;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.rebilly-instruments-bump-offer-line-item:first-child {\n padding-top: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure {\n margin: 0 var(--rebilly-spacingS) 0 0;\n flex: 0 0 auto;\n width: 48px;\n height: 48px;\n border-radius: var(--rebilly-borderRadius);\n border: 1px solid var(--rebilly-colorMutedBorder);\n overflow: hidden;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure img {\n width: 100%;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis {\n flex: 1 2 auto;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-title {\n margin: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-description {\n color: var(--rebilly-colorMutedText);\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: var(--rebilly-fontLineHeightS);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown {\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--rebilly-colorMutedText);\n margin: 0 0 0 var(--rebilly-spacingS);\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown .rebilly-instruments-icon {\n fill: var(--rebilly-colorMutedText);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown-unit-price {\n color: var(--rebilly-colorText);\n}\n`)(new Fm(e).build())}\n `;return t})(e||{});return Rd({element:"style",attributes:{type:"text/css"},content:Hm(n),target:"head"}),t&&Rd({element:"style",attributes:{type:"text/css"},content:Hm(t),target:"head"}),n};const Bm=()=>{Qr.translate.init(Qr.options.locale,Qr.options.i18n),Qr.translate.translateItems()};var qm,Vm=()=>{var e;if("auto"===Qr.options.locale&&null!==(e=Qr.data.riskMetadata)&&void 0!==e&&null!==(e=e.browserData)&&void 0!==e&&e.language){const{browserData:{language:e}}=Qr.data.riskMetadata;Qr.options.locale=e}return Qr.translate.init(Qr.options.locale,Qr.options.i18n),Bm},zm=function(e){if("Function"===x(e))return w(e)},Wm=Object.keys||function(e){return xt(e,Et)},Um=l&&!Ce?Object.defineProperties:function(e,t){Te(e);for(var n,r=C(t),a=Wm(t),o=a.length,i=0;o>i;)Be.f(e,n=a[i++],r[n]);return e},Gm={f:Um},Zm=M("document","documentElement"),Xm="prototype",Km="script",Jm=tt("IE_PROTO"),Ym=function(){},Qm=function(e){return"<"+Km+">"+e+"</"+Km+">"},ef=function(e){e.write(Qm("")),e.close();var t=e.parentWindow.Object;return e=null,t},tf=function(){try{qm=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;tf="undefined"!=typeof document?document.domain&&qm?ef(qm):(t=Se("iframe"),n="java"+Km+":",t.style.display="none",Zm.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Qm("document.F=Object")),e.close(),e.F):ef(qm);for(var r=Et.length;r--;)delete tf[Xm][Et[r]];return tf()};nt[Jm]=!0;var nf,rf,af,of=Object.create||function(e,t){var n;return null!==e?(Ym[Xm]=Te(e),n=new Ym,Ym[Xm]=null,n[Jm]=e):n=tf(),void 0===t?n:Gm.f(n,t)},sf=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),lf=tt("IE_PROTO"),cf=Object,uf=cf.prototype,df=sf?cf.getPrototypeOf:function(e){var t=le(e);if(ue(t,lf))return t[lf];var n=t.constructor;return N(n)&&t instanceof n?n.prototype:t instanceof cf?uf:null},pf=ve("iterator"),mf=!1;[].keys&&("next"in(af=[].keys())?(rf=df(df(af)))!==Object.prototype&&(nf=rf):mf=!0);var ff=!R(nf)||s((function(){var e={};return nf[pf].call(e)!==e}));ff&&(nf={}),N(nf[pf])||ut(nf,pf,(function(){return this}));var hf={IteratorPrototype:nf,BUGGY_SAFARI_ITERATORS:mf},yf=Be.f,gf=ve("toStringTag"),vf=function(e,t,n){e&&!n&&(e=e.prototype),e&&!ue(e,gf)&&yf(e,gf,{configurable:!0,value:t})},bf=hf.IteratorPrototype,wf=function(e,t){return{value:e,done:t}},kf=ve("match"),$f=function(){var e=Te(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},xf=RegExp.prototype,Ef=function(e){var t=e.flags;return void 0!==t||"flags"in xf||ue(e,"flags")||!F(xf,e)?t:d($f,e)},Sf=function(){},_f=[],Pf=M("Reflect","construct"),Af=/^\s*(?:class|function)\b/,If=w(Af.exec),Cf=!Af.exec(Sf),jf=function(e){if(!N(e))return!1;try{return Pf(Sf,_f,e),!0}catch(e){return!1}},Lf=function(e){if(!N(e))return!1;switch(Yt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Cf||!!If(Af,Je(e))}catch(e){return!0}};Lf.sham=!0;var Tf,Nf,Of=!Pf||s((function(){var e;return jf(jf.call)||!jf(Object)||!jf((function(){e=!0}))||e}))?Lf:jf,Rf=TypeError,Mf=ve("species"),Ff=function(e,t){var n,r=Te(e).constructor;return void 0===r||P(n=Te(r)[Mf])?t:function(e){if(Of(e))return e;throw Rf(J(e)+" is not a constructor")}(n)},Hf=w("".charAt),Df=w("".charCodeAt),Bf=w("".slice),qf=function(e){return function(t,n){var r,a,o=en(I(t)),i=ft(n),s=o.length;return i<0||i>=s?e?"":void 0:(r=Df(o,i))<55296||r>56319||i+1===s||(a=Df(o,i+1))<56320||a>57343?e?Hf(o,i):r:e?Bf(o,i,i+2):a-56320+(r-55296<<10)+65536}},Vf={codeAt:qf(!1),charAt:qf(!0)}.charAt,zf=i.RegExp,Wf=s((function(){var e=zf("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Uf=Wf||s((function(){return!zf("a","y").sticky})),Gf={BROKEN_CARET:Wf||s((function(){var e=zf("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Uf,UNSUPPORTED_Y:Wf},Zf=i.RegExp,Xf=s((function(){var e=Zf(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Kf=i.RegExp,Jf=s((function(){var e=Kf("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Yf=lt.get,Qf=ie("native-string-replace",String.prototype.replace),eh=RegExp.prototype.exec,th=eh,nh=w("".charAt),rh=w("".indexOf),ah=w("".replace),oh=w("".slice),ih=(Nf=/b*/g,d(eh,Tf=/a/,"a"),d(eh,Nf,"a"),0!==Tf.lastIndex||0!==Nf.lastIndex),sh=Gf.BROKEN_CARET,lh=void 0!==/()??/.exec("")[1];(ih||lh||sh||Xf||Jf)&&(th=function(e){var t,n,r,a,o,i,s,l=this,c=Yf(l),u=en(e),p=c.raw;if(p)return p.lastIndex=l.lastIndex,t=d(th,p,u),l.lastIndex=p.lastIndex,t;var m=c.groups,f=sh&&l.sticky,h=d($f,l),y=l.source,g=0,v=u;if(f&&(h=ah(h,"y",""),-1===rh(h,"g")&&(h+="g"),v=oh(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==nh(u,l.lastIndex-1))&&(y="(?: "+y+")",v=" "+v,g++),n=new RegExp("^(?:"+y+")",h)),lh&&(n=new RegExp("^"+y+"$(?!\\s)",h)),ih&&(r=l.lastIndex),a=d(eh,f?n:l,v),f?a?(a.input=oh(a.input,g),a[0]=oh(a[0],g),a.index=l.lastIndex,l.lastIndex+=a[0].length):l.lastIndex=0:ih&&a&&(l.lastIndex=l.global?a.index+a[0].length:r),lh&&a&&a.length>1&&d(Qf,a[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(a[o]=void 0)})),a&&m)for(a.groups=i=of(null),o=0;o<m.length;o++)i[(s=m[o])[0]]=a[s[1]];return a});var ch=th,uh=TypeError,dh=ve("matchAll"),ph="RegExp String",mh=ph+" Iterator",fh=lt.set,hh=lt.getterFor(mh),yh=RegExp.prototype,gh=TypeError,vh=zm("".indexOf),bh=zm("".matchAll),wh=!!bh&&!s((function(){bh("a",/./)})),kh=function(e,t,n,r){var a=t+" Iterator";return e.prototype=of(bf,{next:y(+!r,n)}),vf(e,a,!1),e}((function(e,t,n,r){fh(this,{type:mh,regexp:e,string:t,global:n,unicode:r,done:!1})}),ph,(function(){var e=hh(this);if(e.done)return wf(void 0,!0);var t=e.regexp,n=e.string,r=function(e,t){var n=e.exec;if(N(n)){var r=d(n,e,t);return null!==r&&Te(r),r}if("RegExp"===x(e))return d(ch,e,t);throw uh("RegExp#exec called on incompatible receiver")}(t,n);return null===r?(e.done=!0,wf(void 0,!0)):e.global?(""===en(r[0])&&(t.lastIndex=function(e,t,n){return t+(n?Vf(e,t).length:1)}(n,vt(t.lastIndex),e.unicode)),wf(r,!1)):(e.done=!0,wf(r,!1))})),$h=function(e){var t,n,r,a=Te(this),o=en(e),i=Ff(a,RegExp),s=en(Ef(a));return t=new i(i===RegExp?a.source:a,s),n=!!~vh(s,"g"),r=!!~vh(s,"u"),t.lastIndex=vt(a.lastIndex),new kh(t,o,n,r)};function xh(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}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}Dt({target:"String",proto:!0,forced:wh},{matchAll:function(e){var t,n,r,a=I(this);if(P(e)){if(wh)return bh(a,e)}else{if(function(e){var t;return R(e)&&(void 0!==(t=e[kf])?!!t:"RegExp"===x(e))}(e)&&(t=en(I(Ef(e))),!~vh(t,"g")))throw gh("`.matchAll` does not allow non-global regexes");if(wh)return bh(a,e);if(r=ee(e,dh))return d(r,e,a)}return n=en(a),new RegExp(e,"g")[dh](n)}}),dh in yh||ut(yh,dh,$h);const Eh=(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`]});var Sh=()=>{var e;const t=xh(`\n ${Qr.mainStyleVars}\n ${(null===(e=Qr.options)||void 0===e?void 0:e.css)||""}\n `);return{base:{...Eh(t,"input"),":hover":Eh(t,"inputHover"),":focus":Eh(t,"inputFocus"),"::placeholder":Eh(t,"inputPlaceholder"),"::selection":Eh(t,"inputSelection")},invalid:{...Eh(t,"inputError"),":hover":Eh(t,"inputErrorHover"),":focus":Eh(t,"inputErrorFocus"),"::placeholder":Eh(t,"inputErrorPlaceholder"),"::selection":Eh(t,"inputErrorSelection")},buttons:{base:{...Eh(t,"buttonSecondary"),":hover":Eh(t,"buttonSecondaryHover"),":focus":Eh(t,"buttonSecondaryActive")},active:{...Eh(t,"button"),":hover":Eh(t,"buttonHover"),":focus":Eh(t,"buttonActive")}}}};function _h({eventName:e,callback:t}){if(!ji.includes(e))throw new Error(`${e} is not a supported event`);const n=vo(e);Ci[n].addEventListener(t)}const Ph=(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`;async function Ah({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{})}={}){var o,i;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;Qr.form.insertAdjacentHTML("beforeend",Ph(l,s));const c=document.querySelector(".rebilly-instruments-modal-overlay"),u=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((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),Qr.loader.addDOMElement({section:"modal",el:p}),Qr.loader.startLoading({section:"modal",id:e});const m={options:Qr.toModel().options,...n},f=await new Hi({name:e,url:t,model:m,classListArray:r,container:p}),h=(...e)=>{u.classList.remove("is-visible"),c.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto";const t=c.children;for(let e=0;e<t.length;e+=1)t[e].remove();c.remove(),a(...e),f.destroy()}),300)};return f.bindEventListeners({close:h,loader:Qr.loader}),l||d.addEventListener("click",h),null===(i=f.component)||void 0===i||i.call("route",{name:"approval-url"}),f}async function Ih({payload:e}){var t,n,r,a,o;const{_raw:{id:i},isExistingInstrument:s}=e;delete e.isExistingInstrument,delete e._raw;const l={...e};s?l.paymentInstrumentId=i:l.token=i,null!==(t=Qr.options)&&void 0!==t&&t.invoiceId&&(l.invoiceId=Qr.options.invoiceId),null!==(n=Qr.options)&&void 0!==n&&n.transactionId&&(l.transactionId=Qr.options.transactionId),null!==(r=Qr.options)&&void 0!==r&&r.money&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.options.money.amount,l.currency=Qr.options.money.currency),null!==(a=Qr.options)&&void 0!==a&&a.deposit&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.data.amountAndCurrency.amount,l.currency=Qr.data.amountAndCurrency.currency),null!==(o=Qr.data)&&void 0!==o&&o.couponIds&&Array.isArray(Qr.data.couponIds)&&(l.couponIds=Qr.data.couponIds);let{fields:c}=await async function({data:e}){return pc((async()=>{const{token:t,transactionId:n,invoiceId:r,websiteId:a,paymentInstrumentId:o}=e,i=["riskMetadata","redirectUrl"];return t&&i.push("token"),o&&i.push("paymentInstrumentId"),n&&i.push("transactionId"),r&&i.push("invoiceId"),a&&i.push("amount","currency","websiteId"),Object.keys(e).forEach((t=>{i.includes(t)||delete e[t]})),Qr.storefront.purchase.payment({data:e})}))}({state:Qr,data:l});return c={transaction:c,token:c.token||Qr.options.jwt},Qr.data.invoice&&(c.invoice=Qr.data.invoice),c}async function Ch({payload:e}){const t={websiteId:Qr.options.websiteId,paymentInstruction:{token:e._raw.id},...e};Qr.data.acceptBumpOffer?t.items=Qr.options.bumpOffer:t.items=vc(Qr.options.items),Qr.data.couponIds&&Array.isArray(Qr.data.couponIds)&&(t.couponIds=Qr.data.couponIds),Qr.options.addons&&Qr.data.addons&&Array.isArray(Qr.data.addons)&&Qr.options.addons.forEach((e=>{Qr.data.addons.includes(e.planId)&&t.items.push(e)}));const{fields:n}=await async function({data:e}){return pc((async()=>{const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),Qr.storefront.purchase.purchase({data:e})}))}({state:Qr,data:t});return n}async function jh({payload:e}){Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{var t,n;let r;return r=Qr.data.isPayment?await Ih({state:Qr,payload:e}):await Ch({state:Qr,payload:e}),null!==(t=r.transaction)&&void 0!==t&&t.approvalUrl&&"unknown"===(null===(n=r.transaction)||void 0===n?void 0:n.result)?function({fields:e,payload:t}){var n,r;if(t.redirectUrl||null===(n=e.transaction)||void 0===n||!n.approvalUrl){const{paymentMethodsUrl:t}=Qr.options._computed,n=JSON.parse(JSON.stringify(e)),r={};Qr.data.isPayment?r.payment=n:r.purchase=n,Qr.data=new wd({...e});const a="rebilly-instruments-approval-url";Ah({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ci.purchaseCompleted.dispatch(e)}})}else if(null!==(r=e.transaction)&&void 0!==r&&r.approvalUrl){var a;window.location=null===(a=e.transaction)||void 0===a?void 0:a.approvalUrl}}({state:Qr,fields:r,payload:e}):Ci.purchaseCompleted.dispatch(r),r}catch(e){return Oi(e),e}}async function Lh({payload:e}){try{var t;const{_raw:{id:n},isExistingInstrument:r}=e;delete e.isExistingInstrument,delete e._raw;const a={...e};r?a.paymentInstrumentId=n:a.token=n;const{instrument:o,transaction:i}=await async function({data:e}){return pc((async()=>{var t;const{fields:n}=await Qr.storefront.paymentInstruments.create({data:e});Qr.storefront.setSessionToken(n.token||Qr.options.jwt);const r={id:n.id,data:{websiteId:Qr.options.websiteId,...e}};Qr.data.amountAndCurrency&&(r.data={...r.data,...Qr.data.amountAndCurrency}),null!==(t=Qr.data)&&void 0!==t&&null!==(t=t.transaction)&&void 0!==t&&t.redirectUrl&&(r.data.redirectUrl=`${r.data.redirectUrl}&originalRedirectUrl=${Qr.data.transaction.redirectUrl}`);const{fields:a}=await Qr.storefront.paymentInstruments.setup(r);return{instrument:n,transaction:a}}))}({data:{websiteId:null===(t=Qr.options)||void 0===t?void 0:t.websiteId,...a}});if(Qr.data=new wd({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result){const{paymentMethodsUrl:e}=Qr.options._computed;Ah({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ci.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ci.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(e){return Oi(e),e}}async function Th({componentName:e,payload:t}){switch(e){case"result":Ld(),async function({payload:e}){var t,n;const r=Yr.form;r||await Od();const a=Qr.toModel(),o={options:a.options,mainStyleVars:a.mainStyleVars,[Qr.options.transactionType]:e};null==r||null===(t=r.component)||void 0===t||t.call("route",{name:"result"}),null==r||null===(n=r.component)||void 0===n||n.call("update",o)}({payload:t});break;case"confirmation":Ld(),async function({payload:e}){var t,n,r,a;e.billingAddress&&Qr.summary&&Qr.data.isPurchase&&xc({instrument:e});const o=Yr.form;o||await Od();const i=Qr.toModel(),s={options:i.options,data:i.data,mainStyleVars:i.mainStyleVars,instrument:e};null==o||null===(t=o.component)||void 0===t||t.call("update",s),null==o||null===(n=o.component)||void 0===n||n.call("route",{name:"confirmation"}),null==o||null===(r=o.component)||void 0===r||r.on(`${o.name}-confirm-purchase`,(e=>{jh({payload:e})})),null==o||null===(a=o.component)||void 0===a||a.on(`${o.name}-confirm-setup`,(e=>{Lh({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function Nh({state:e,payload:t}){Th({componentName:"result",payload:t,state:e})}var Oh=({state:e={}})=>{e.options.features.autoConfirmation&&_h({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?Lh({state:e,payload:t}):jh({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Th({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&(_h({eventName:"purchase-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}),_h({eventName:"setup-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}))};async function Rh({setupFramepay:e=Pm,...t}={}){try{var n,r,a,o,i,s;Qr.data={},Qr.options={},Qr.options=_m({options:t}),Qr.form=Md({element:"form"}),Qr.summary=Md({element:"summary"}),Qr.form.style.maxWidth="750px",Qr.summary&&(Qr.summary.style.maxWidth="750px"),Qr.storefront=Fd(),Qr.mainStyleVars=Dm(),Qr.options.themeFramepay=Sh(),Qr.loader.addDOMElement({el:Qr.form}),Qr.loader.addDOMElement({section:"summary",el:Qr.summary}),Qr.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),Qr.loader.startLoading({id:"rebilly-instruments-form"});const[l]=await Promise.all([kd(),e()]);Qr.data=l,Ci.dataReady.dispatch(Qr.data),Qr.i18n=Vm(),!Qr.options.websiteId&&null!==(n=Qr.data.transaction)&&void 0!==n&&n.websiteId?Qr.options.websiteId=Qr.data.transaction.websiteId:!Qr.options.websiteId&&null!==(r=Qr.data.invoice)&&void 0!==r&&r.websiteId&&(Qr.options.websiteId=Qr.data.invoice.websiteId),Qr.data.transaction&&"setup"===(null===(a=Qr.data.transaction)||void 0===a?void 0:a.type)&&(Qr.options.transactionType="setup"),Qr.form&&Od().then((()=>{var e;null!==(e=Qr.options)&&void 0!==e&&e.deposit?Pd():Td()})),Qr.summary&&$c(),Qr.i18n({state:Qr}),Qr.hasMounted=!0;((null===(o=Qr.options)||void 0===o?void 0:o.invoiceId)||(null===(i=Qr.data)||void 0===i||null===(i=i.transaction)||void 0===i?void 0:i.invoiceId))&&Qr.data.invoice.isPaid&&(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),document.querySelector('[data-rebilly-instruments="form"]').remove(),Oi(Qr.translate.getTranslation("form.error.invoiceIsPaid"),!1)),null!==(s=l.readyToPay)&&void 0!==s&&s.length||(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),Oi(Qr.translate.getTranslation("form.error.noPaymentMethods")))}catch(e){throw Oi(e),e}Oh({state:Qr})}async function Mh(){var e;await(e=1e3,new Promise((t=>setTimeout(t,e)))),Object.keys(Yr).forEach((e=>{Yr.hasFrame(e)&&(Yr[e].destroy(),Yr[e]=null)})),Ai.removeAll(document),Qr.hasMounted=!1,Qr.summary&&(Qr.summary.textContent=""),Qr.form.textContent="",Yl.cancelAll(),Qr.loader.clearAll()}var Fh=new class{constructor(){this.state=Qr,this.iframes=Yr}async mount(e){await Rh(e)}async destroy(){await Mh()}async update(e){await async function({newOptions:e={}}){if(!Qr.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=Zr({...Qr.options},e);await Mh(),Rh({form:Qr.form,summary:Qr.summary,...t})}({newOptions:e})}async purchase(e){await jh({payload:e})}async setup(e){await Lh({payload:e})}async show(e,t){await Th({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.4.2.1"}on(e,t){_h({eventName:e,callback:t})}};export{Fh as default};
68
+ */var N=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},O=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 a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var o=_(a);if(!o)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+o.type.toUpperCase()](o.values.concat([o.alpha]))},R={hex:{configurable:!0}};return R.hex.get=function(){return this.hexString().replace(/^#/,"")},O.prototype.setColor=function(e){var t=_(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},O.prototype.tint=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#fff",this.rgbString(),t).rgba+")","tint",t)},O.prototype.shade=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#000",this.rgbString(),t).rgba+")","shade",t)},O.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},O.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},O.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},O.prototype.hexString=function(){return C(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},O.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},O.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},O.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},O.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],o=e[3];return t=[P([n,r,a]).map(Math.round),o],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(O.prototype,R),O.VERSION="v2.1.1",O}()})),Im=Am;const Cm=e=>new Im(e);function jm(e,t=1){if(null===e)return e;const n=Cm(e);return n.alpha=t,n.rgbString()}const Lm=e=>jm(e,.5),Tm=(e,t)=>{if(null===e)return e;return Cm(e).shade(t).hexString()};function Nm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Om{constructor(e){Nm(this,"allStyles",["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"]),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 Rm={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>Lm(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?jm(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',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?Tm(e.buttonColorBackground,20):Tm(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 Om(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 ${Tm(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 Om(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?Lm(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 Om(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?Lm(e.inputErrorColorText):Lm(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 Mm=new Proxy(Rm,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(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 Fm{constructor(e={}){this.overrides=e,this.theme=Mm}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!Fm.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Fm,"nonCssProperties",["labels"]);function Hm(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 Dm=()=>{const{theme:e={},css:t}=Qr.options,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/* Base, Typography\n------------------------------------------------------------ */\n/* Base setup for top level elements */\n.rebilly-instruments-content {\n color: var(--rebilly-colorText);\n background: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeBase);\n font-weight: var(--rebilly-fontWeightBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-fontFamily);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n font-smooth: var(--rebilly-fontSmooth);\n padding: 2px;\n font-display: swap;\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-amount-selector {\n padding: 2px;\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\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 min-height: 48px;\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.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method {\n border-radius: 100px;\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/* Components. Icons\n------------------------------------------------------------ */\n.rebilly-instruments-icon {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n/* Components. Forms. Checkboxes\n------------------------------------------------------------ */\n.rebilly-instruments-form-field-checkbox {\n position: relative;\n opacity: 1;\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-start;\n cursor: pointer;\n transform: none;\n}\n\n.rebilly-instruments-form-field-checkbox > * {\n cursor: pointer;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.rebilly-instruments-form-field-checkbox span {\n position: relative;\n top: 0;\n left: 0;\n width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n min-width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--rebilly-colorMutedBorder);\n margin-right: var(--rebilly-spacingS);\n background-color: transparent;\n transition: all 200ms;\n}\n\n.rebilly-instruments-form-field-checkbox span:after {\n content: '';\n position: absolute;\n border: solid var(--rebilly-colorPrimary);\n width: calc(var(--rebilly-spacingXs) + var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingXs) - var(--rebilly-spacing2xs) + 2px);\n border-width: 2px 2px 0 0;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n opacity: 0;\n transform: translateY(-60%) translateX(-50%) rotate(135deg);\n transition: all 0.2s ease;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {\n opacity: 1;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {\n opacity: 0.6;\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: calc(var(--rebilly-fontLineHeightBase) + 10px);\n height: var(--rebilly-fontLineHeightBase);\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.rebilly-instruments-error-card.not-closeable {\n margin-bottom: 0;\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\n\n/* Bump offer\n------------------------------------------------------------ */\n.rebilly-instruments-bump-offers {\n text-align: left;\n margin-bottom: calc(var(--rebilly-spacingM) + var(--rebilly-fontSizeS));\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-form-field-checkbox {\n margin-bottom: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-bump-offer-label {\n width: 100%;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item {\n border-bottom: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS) 0;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.rebilly-instruments-bump-offer-line-item:first-child {\n padding-top: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure {\n margin: 0 var(--rebilly-spacingS) 0 0;\n flex: 0 0 auto;\n width: 48px;\n height: 48px;\n border-radius: var(--rebilly-borderRadius);\n border: 1px solid var(--rebilly-colorMutedBorder);\n overflow: hidden;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure img {\n width: 100%;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis {\n flex: 1 2 auto;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-title {\n margin: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-description {\n color: var(--rebilly-colorMutedText);\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: var(--rebilly-fontLineHeightS);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown {\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--rebilly-colorMutedText);\n margin: 0 0 0 var(--rebilly-spacingS);\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown .rebilly-instruments-icon {\n fill: var(--rebilly-colorMutedText);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown-unit-price {\n color: var(--rebilly-colorText);\n}\n`)(new Fm(e).build())}\n `;return t})(e||{});return Rd({element:"style",attributes:{type:"text/css"},content:Hm(n),target:"head"}),t&&Rd({element:"style",attributes:{type:"text/css"},content:Hm(t),target:"head"}),n};const Bm=()=>{Qr.translate.init(Qr.options.locale,Qr.options.i18n),Qr.translate.translateItems()};var qm,Vm=()=>{var e;if("auto"===Qr.options.locale&&null!==(e=Qr.data.riskMetadata)&&void 0!==e&&null!==(e=e.browserData)&&void 0!==e&&e.language){const{browserData:{language:e}}=Qr.data.riskMetadata;Qr.options.locale=e}return Qr.translate.init(Qr.options.locale,Qr.options.i18n),Bm},zm=function(e){if("Function"===x(e))return w(e)},Wm=Object.keys||function(e){return xt(e,Et)},Um=l&&!Ce?Object.defineProperties:function(e,t){Te(e);for(var n,r=C(t),a=Wm(t),o=a.length,i=0;o>i;)Be.f(e,n=a[i++],r[n]);return e},Gm={f:Um},Zm=M("document","documentElement"),Xm="prototype",Km="script",Jm=tt("IE_PROTO"),Ym=function(){},Qm=function(e){return"<"+Km+">"+e+"</"+Km+">"},ef=function(e){e.write(Qm("")),e.close();var t=e.parentWindow.Object;return e=null,t},tf=function(){try{qm=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;tf="undefined"!=typeof document?document.domain&&qm?ef(qm):(t=Se("iframe"),n="java"+Km+":",t.style.display="none",Zm.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Qm("document.F=Object")),e.close(),e.F):ef(qm);for(var r=Et.length;r--;)delete tf[Xm][Et[r]];return tf()};nt[Jm]=!0;var nf,rf,af,of=Object.create||function(e,t){var n;return null!==e?(Ym[Xm]=Te(e),n=new Ym,Ym[Xm]=null,n[Jm]=e):n=tf(),void 0===t?n:Gm.f(n,t)},sf=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),lf=tt("IE_PROTO"),cf=Object,uf=cf.prototype,df=sf?cf.getPrototypeOf:function(e){var t=le(e);if(ue(t,lf))return t[lf];var n=t.constructor;return N(n)&&t instanceof n?n.prototype:t instanceof cf?uf:null},pf=ve("iterator"),mf=!1;[].keys&&("next"in(af=[].keys())?(rf=df(df(af)))!==Object.prototype&&(nf=rf):mf=!0);var ff=!R(nf)||s((function(){var e={};return nf[pf].call(e)!==e}));ff&&(nf={}),N(nf[pf])||ut(nf,pf,(function(){return this}));var hf={IteratorPrototype:nf,BUGGY_SAFARI_ITERATORS:mf},yf=Be.f,gf=ve("toStringTag"),vf=function(e,t,n){e&&!n&&(e=e.prototype),e&&!ue(e,gf)&&yf(e,gf,{configurable:!0,value:t})},bf=hf.IteratorPrototype,wf=function(e,t){return{value:e,done:t}},kf=ve("match"),$f=function(){var e=Te(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},xf=RegExp.prototype,Ef=function(e){var t=e.flags;return void 0!==t||"flags"in xf||ue(e,"flags")||!F(xf,e)?t:d($f,e)},Sf=function(){},_f=[],Pf=M("Reflect","construct"),Af=/^\s*(?:class|function)\b/,If=w(Af.exec),Cf=!Af.exec(Sf),jf=function(e){if(!N(e))return!1;try{return Pf(Sf,_f,e),!0}catch(e){return!1}},Lf=function(e){if(!N(e))return!1;switch(Yt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Cf||!!If(Af,Je(e))}catch(e){return!0}};Lf.sham=!0;var Tf,Nf,Of=!Pf||s((function(){var e;return jf(jf.call)||!jf(Object)||!jf((function(){e=!0}))||e}))?Lf:jf,Rf=TypeError,Mf=ve("species"),Ff=function(e,t){var n,r=Te(e).constructor;return void 0===r||P(n=Te(r)[Mf])?t:function(e){if(Of(e))return e;throw Rf(J(e)+" is not a constructor")}(n)},Hf=w("".charAt),Df=w("".charCodeAt),Bf=w("".slice),qf=function(e){return function(t,n){var r,a,o=en(I(t)),i=ft(n),s=o.length;return i<0||i>=s?e?"":void 0:(r=Df(o,i))<55296||r>56319||i+1===s||(a=Df(o,i+1))<56320||a>57343?e?Hf(o,i):r:e?Bf(o,i,i+2):a-56320+(r-55296<<10)+65536}},Vf={codeAt:qf(!1),charAt:qf(!0)}.charAt,zf=i.RegExp,Wf=s((function(){var e=zf("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Uf=Wf||s((function(){return!zf("a","y").sticky})),Gf={BROKEN_CARET:Wf||s((function(){var e=zf("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Uf,UNSUPPORTED_Y:Wf},Zf=i.RegExp,Xf=s((function(){var e=Zf(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Kf=i.RegExp,Jf=s((function(){var e=Kf("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Yf=lt.get,Qf=ie("native-string-replace",String.prototype.replace),eh=RegExp.prototype.exec,th=eh,nh=w("".charAt),rh=w("".indexOf),ah=w("".replace),oh=w("".slice),ih=(Nf=/b*/g,d(eh,Tf=/a/,"a"),d(eh,Nf,"a"),0!==Tf.lastIndex||0!==Nf.lastIndex),sh=Gf.BROKEN_CARET,lh=void 0!==/()??/.exec("")[1];(ih||lh||sh||Xf||Jf)&&(th=function(e){var t,n,r,a,o,i,s,l=this,c=Yf(l),u=en(e),p=c.raw;if(p)return p.lastIndex=l.lastIndex,t=d(th,p,u),l.lastIndex=p.lastIndex,t;var m=c.groups,f=sh&&l.sticky,h=d($f,l),y=l.source,g=0,v=u;if(f&&(h=ah(h,"y",""),-1===rh(h,"g")&&(h+="g"),v=oh(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==nh(u,l.lastIndex-1))&&(y="(?: "+y+")",v=" "+v,g++),n=new RegExp("^(?:"+y+")",h)),lh&&(n=new RegExp("^"+y+"$(?!\\s)",h)),ih&&(r=l.lastIndex),a=d(eh,f?n:l,v),f?a?(a.input=oh(a.input,g),a[0]=oh(a[0],g),a.index=l.lastIndex,l.lastIndex+=a[0].length):l.lastIndex=0:ih&&a&&(l.lastIndex=l.global?a.index+a[0].length:r),lh&&a&&a.length>1&&d(Qf,a[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(a[o]=void 0)})),a&&m)for(a.groups=i=of(null),o=0;o<m.length;o++)i[(s=m[o])[0]]=a[s[1]];return a});var ch=th,uh=TypeError,dh=ve("matchAll"),ph="RegExp String",mh=ph+" Iterator",fh=lt.set,hh=lt.getterFor(mh),yh=RegExp.prototype,gh=TypeError,vh=zm("".indexOf),bh=zm("".matchAll),wh=!!bh&&!s((function(){bh("a",/./)})),kh=function(e,t,n,r){var a=t+" Iterator";return e.prototype=of(bf,{next:y(+!r,n)}),vf(e,a,!1),e}((function(e,t,n,r){fh(this,{type:mh,regexp:e,string:t,global:n,unicode:r,done:!1})}),ph,(function(){var e=hh(this);if(e.done)return wf(void 0,!0);var t=e.regexp,n=e.string,r=function(e,t){var n=e.exec;if(N(n)){var r=d(n,e,t);return null!==r&&Te(r),r}if("RegExp"===x(e))return d(ch,e,t);throw uh("RegExp#exec called on incompatible receiver")}(t,n);return null===r?(e.done=!0,wf(void 0,!0)):e.global?(""===en(r[0])&&(t.lastIndex=function(e,t,n){return t+(n?Vf(e,t).length:1)}(n,vt(t.lastIndex),e.unicode)),wf(r,!1)):(e.done=!0,wf(r,!1))})),$h=function(e){var t,n,r,a=Te(this),o=en(e),i=Ff(a,RegExp),s=en(Ef(a));return t=new i(i===RegExp?a.source:a,s),n=!!~vh(s,"g"),r=!!~vh(s,"u"),t.lastIndex=vt(a.lastIndex),new kh(t,o,n,r)};function xh(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}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}Dt({target:"String",proto:!0,forced:wh},{matchAll:function(e){var t,n,r,a=I(this);if(P(e)){if(wh)return bh(a,e)}else{if(function(e){var t;return R(e)&&(void 0!==(t=e[kf])?!!t:"RegExp"===x(e))}(e)&&(t=en(I(Ef(e))),!~vh(t,"g")))throw gh("`.matchAll` does not allow non-global regexes");if(wh)return bh(a,e);if(r=ee(e,dh))return d(r,e,a)}return n=en(a),new RegExp(e,"g")[dh](n)}}),dh in yh||ut(yh,dh,$h);const Eh=(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`]});var Sh=()=>{var e;const t=xh(`\n ${Qr.mainStyleVars}\n ${(null===(e=Qr.options)||void 0===e?void 0:e.css)||""}\n `);return{base:{...Eh(t,"input"),":hover":Eh(t,"inputHover"),":focus":Eh(t,"inputFocus"),"::placeholder":Eh(t,"inputPlaceholder"),"::selection":Eh(t,"inputSelection")},invalid:{...Eh(t,"inputError"),":hover":Eh(t,"inputErrorHover"),":focus":Eh(t,"inputErrorFocus"),"::placeholder":Eh(t,"inputErrorPlaceholder"),"::selection":Eh(t,"inputErrorSelection")},buttons:{base:{...Eh(t,"buttonSecondary"),":hover":Eh(t,"buttonSecondaryHover"),":focus":Eh(t,"buttonSecondaryActive")},active:{...Eh(t,"button"),":hover":Eh(t,"buttonHover"),":focus":Eh(t,"buttonActive")}}}};function _h({eventName:e,callback:t}){if(!ji.includes(e))throw new Error(`${e} is not a supported event`);const n=vo(e);Ci[n].addEventListener(t)}const Ph=(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`;async function Ah({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{})}={}){var o,i;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;Qr.form.insertAdjacentHTML("beforeend",Ph(l,s));const c=document.querySelector(".rebilly-instruments-modal-overlay"),u=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((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),Qr.loader.addDOMElement({section:"modal",el:p}),Qr.loader.startLoading({section:"modal",id:e});const m={options:Qr.toModel().options,...n},f=await new Hi({name:e,url:t,model:m,classListArray:r,container:p}),h=(...e)=>{u.classList.remove("is-visible"),c.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto";const t=c.children;for(let e=0;e<t.length;e+=1)t[e].remove();c.remove(),a(...e),f.destroy()}),300)};return f.bindEventListeners({close:h,loader:Qr.loader}),l||d.addEventListener("click",h),null===(i=f.component)||void 0===i||i.call("route",{name:"approval-url"}),f}async function Ih({payload:e}){var t,n,r,a,o;const{_raw:{id:i},isExistingInstrument:s}=e;delete e.isExistingInstrument,delete e._raw;const l={...e};s?l.paymentInstrumentId=i:l.token=i,null!==(t=Qr.options)&&void 0!==t&&t.invoiceId&&(l.invoiceId=Qr.options.invoiceId),null!==(n=Qr.options)&&void 0!==n&&n.transactionId&&(l.transactionId=Qr.options.transactionId),null!==(r=Qr.options)&&void 0!==r&&r.money&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.options.money.amount,l.currency=Qr.options.money.currency),null!==(a=Qr.options)&&void 0!==a&&a.deposit&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.data.amountAndCurrency.amount,l.currency=Qr.data.amountAndCurrency.currency),null!==(o=Qr.data)&&void 0!==o&&o.couponIds&&Array.isArray(Qr.data.couponIds)&&(l.couponIds=Qr.data.couponIds);let{fields:c}=await async function({data:e}){return pc((async()=>{const{token:t,transactionId:n,invoiceId:r,websiteId:a,paymentInstrumentId:o}=e,i=["riskMetadata","redirectUrl"];return t&&i.push("token"),o&&i.push("paymentInstrumentId"),n&&i.push("transactionId"),r&&i.push("invoiceId"),a&&i.push("amount","currency","websiteId"),Object.keys(e).forEach((t=>{i.includes(t)||delete e[t]})),Qr.storefront.purchase.payment({data:e})}))}({state:Qr,data:l});return c={transaction:c,token:c.token||Qr.options.jwt},Qr.data.invoice&&(c.invoice=Qr.data.invoice),c}async function Ch({payload:e}){const t={websiteId:Qr.options.websiteId,paymentInstruction:{token:e._raw.id},...e};Qr.data.acceptBumpOffer?t.items=Qr.options.bumpOffer:t.items=vc(Qr.options.items),Qr.data.couponIds&&Array.isArray(Qr.data.couponIds)&&(t.couponIds=Qr.data.couponIds),Qr.options.addons&&Qr.data.addons&&Array.isArray(Qr.data.addons)&&Qr.options.addons.forEach((e=>{Qr.data.addons.includes(e.planId)&&t.items.push(e)}));const{fields:n}=await async function({data:e}){return pc((async()=>{const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),Qr.storefront.purchase.purchase({data:e})}))}({state:Qr,data:t});return n}async function jh({payload:e}){Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{var t,n;let r;return r=Qr.data.isPayment?await Ih({state:Qr,payload:e}):await Ch({state:Qr,payload:e}),null!==(t=r.transaction)&&void 0!==t&&t.approvalUrl&&"unknown"===(null===(n=r.transaction)||void 0===n?void 0:n.result)?function({fields:e,payload:t}){var n,r;if(t.redirectUrl||null===(n=e.transaction)||void 0===n||!n.approvalUrl){const{paymentMethodsUrl:t}=Qr.options._computed,n=JSON.parse(JSON.stringify(e)),r={};Qr.data.isPayment?r.payment=n:r.purchase=n,Qr.data=new wd({...e});const a="rebilly-instruments-approval-url";Ah({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ci.purchaseCompleted.dispatch(e)}})}else if(null!==(r=e.transaction)&&void 0!==r&&r.approvalUrl){var a;window.location=null===(a=e.transaction)||void 0===a?void 0:a.approvalUrl}}({state:Qr,fields:r,payload:e}):Ci.purchaseCompleted.dispatch(r),r}catch(e){return Oi(e),e}}async function Lh({payload:e}){try{var t;const{_raw:{id:n},isExistingInstrument:r}=e;delete e.isExistingInstrument,delete e._raw;const a={...e};r?a.paymentInstrumentId=n:a.token=n;const{instrument:o,transaction:i}=await async function({data:e}){return pc((async()=>{var t;const{fields:n}=await Qr.storefront.paymentInstruments.create({data:e});Qr.storefront.setSessionToken(n.token||Qr.options.jwt);const r={id:n.id,data:{websiteId:Qr.options.websiteId,...e}};Qr.data.amountAndCurrency&&(r.data={...r.data,...Qr.data.amountAndCurrency}),null!==(t=Qr.data)&&void 0!==t&&null!==(t=t.transaction)&&void 0!==t&&t.redirectUrl&&(r.data.redirectUrl=`${r.data.redirectUrl}&originalRedirectUrl=${Qr.data.transaction.redirectUrl}`);const{fields:a}=await Qr.storefront.paymentInstruments.setup(r);return{instrument:n,transaction:a}}))}({data:{websiteId:null===(t=Qr.options)||void 0===t?void 0:t.websiteId,...a}});if(Qr.data=new wd({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result){const{paymentMethodsUrl:e}=Qr.options._computed;Ah({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ci.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ci.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(e){return Oi(e),e}}async function Th({componentName:e,payload:t}){switch(e){case"result":Ld(),async function({payload:e}){var t,n;const r=Yr.form;r||await Od();const a=Qr.toModel(),o={options:a.options,mainStyleVars:a.mainStyleVars,[Qr.options.transactionType]:e};null==r||null===(t=r.component)||void 0===t||t.call("route",{name:"result"}),null==r||null===(n=r.component)||void 0===n||n.call("update",o)}({payload:t});break;case"confirmation":Ld(),async function({payload:e}){var t,n,r,a;e.billingAddress&&Qr.summary&&Qr.data.isPurchase&&xc({instrument:e});const o=Yr.form;o||await Od();const i=Qr.toModel(),s={options:i.options,data:i.data,mainStyleVars:i.mainStyleVars,instrument:e};null==o||null===(t=o.component)||void 0===t||t.call("update",s),null==o||null===(n=o.component)||void 0===n||n.call("route",{name:"confirmation"}),null==o||null===(r=o.component)||void 0===r||r.on(`${o.name}-confirm-purchase`,(e=>{jh({payload:e})})),null==o||null===(a=o.component)||void 0===a||a.on(`${o.name}-confirm-setup`,(e=>{Lh({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function Nh({state:e,payload:t}){Th({componentName:"result",payload:t,state:e})}var Oh=({state:e={}})=>{e.options.features.autoConfirmation&&_h({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?Lh({state:e,payload:t}):jh({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Th({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&(_h({eventName:"purchase-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}),_h({eventName:"setup-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}))};async function Rh({setupFramepay:e=Pm,...t}={}){try{var n,r,a,o,i,s;Qr.data={},Qr.options={},Qr.options=_m({options:t}),Qr.form=Md({element:"form"}),Qr.summary=Md({element:"summary"}),Qr.form.style.maxWidth="750px",Qr.summary&&(Qr.summary.style.maxWidth="750px"),Qr.storefront=Fd(),Qr.mainStyleVars=Dm(),Qr.options.themeFramepay=Sh(),Qr.loader.addDOMElement({el:Qr.form}),Qr.loader.addDOMElement({section:"summary",el:Qr.summary}),Qr.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),Qr.loader.startLoading({id:"rebilly-instruments-form"});const[l]=await Promise.all([kd(),e()]);Qr.data=l,Ci.dataReady.dispatch(Qr.data),Qr.i18n=Vm(),!Qr.options.websiteId&&null!==(n=Qr.data.transaction)&&void 0!==n&&n.websiteId?Qr.options.websiteId=Qr.data.transaction.websiteId:!Qr.options.websiteId&&null!==(r=Qr.data.invoice)&&void 0!==r&&r.websiteId&&(Qr.options.websiteId=Qr.data.invoice.websiteId),Qr.data.transaction&&"setup"===(null===(a=Qr.data.transaction)||void 0===a?void 0:a.type)&&(Qr.options.transactionType="setup"),Qr.form&&Od().then((()=>{var e;null!==(e=Qr.options)&&void 0!==e&&e.deposit?Pd():Td()})),Qr.summary&&$c(),Qr.i18n({state:Qr}),Qr.hasMounted=!0;((null===(o=Qr.options)||void 0===o?void 0:o.invoiceId)||(null===(i=Qr.data)||void 0===i||null===(i=i.transaction)||void 0===i?void 0:i.invoiceId))&&Qr.data.invoice.isPaid&&(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),document.querySelector('[data-rebilly-instruments="form"]').remove(),Oi(Qr.translate.getTranslation("form.error.invoiceIsPaid"),!1)),null!==(s=l.readyToPay)&&void 0!==s&&s.length||(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),Oi(Qr.translate.getTranslation("form.error.noPaymentMethods")))}catch(e){throw Oi(e),e}Oh({state:Qr})}async function Mh(){var e;await(e=1e3,new Promise((t=>setTimeout(t,e)))),Object.keys(Yr).forEach((e=>{Yr.hasFrame(e)&&(Yr[e].destroy(),Yr[e]=null)})),Ai.removeAll(document),Qr.hasMounted=!1,Qr.summary&&(Qr.summary.textContent=""),Qr.form.textContent="",Yl.cancelAll(),Qr.loader.clearAll()}var Fh=new class{constructor(){this.state=Qr,this.iframes=Yr}async mount(e){await Rh(e)}async destroy(){await Mh()}async update(e){await async function({newOptions:e={}}){if(!Qr.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=Zr({...Qr.options},e);await Mh(),Rh({form:Qr.form,summary:Qr.summary,...t})}({newOptions:e})}async purchase(e){await jh({payload:e})}async setup(e){await Lh({payload:e})}async show(e,t){await Th({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.4.3.0"}on(e,t){_h({eventName:e,callback:t})}};export{Fh as default};
package/dist/index.min.js CHANGED
@@ -65,4 +65,4 @@ function L(e){var t=_(e);return null===t?null:("hsl"===t.type&&(t.values=P(t.val
65
65
  * @version v2.1.1
66
66
  * @link http://noeldelgado.github.io/values.js/
67
67
  * @license MIT
68
- */var N=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},O=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 a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var o=_(a);if(!o)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+o.type.toUpperCase()](o.values.concat([o.alpha]))},R={hex:{configurable:!0}};return R.hex.get=function(){return this.hexString().replace(/^#/,"")},O.prototype.setColor=function(e){var t=_(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},O.prototype.tint=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#fff",this.rgbString(),t).rgba+")","tint",t)},O.prototype.shade=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#000",this.rgbString(),t).rgba+")","shade",t)},O.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},O.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},O.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},O.prototype.hexString=function(){return C(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},O.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},O.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},O.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},O.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],o=e[3];return t=[P([n,r,a]).map(Math.round),o],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(O.prototype,R),O.VERSION="v2.1.1",O}()})),Im=Am;const Cm=e=>new Im(e);function jm(e,t=1){if(null===e)return e;const n=Cm(e);return n.alpha=t,n.rgbString()}const Lm=e=>jm(e,.5),Tm=(e,t)=>{if(null===e)return e;return Cm(e).shade(t).hexString()};function Nm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Om{constructor(e){Nm(this,"allStyles",["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"]),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 Rm={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>Lm(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?jm(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',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?Tm(e.buttonColorBackground,20):Tm(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 Om(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 ${Tm(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 Om(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?Lm(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 Om(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?Lm(e.inputErrorColorText):Lm(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 Mm=new Proxy(Rm,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(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 Fm{constructor(e={}){this.overrides=e,this.theme=Mm}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!Fm.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Fm,"nonCssProperties",["labels"]);function Hm(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 Dm=()=>{const{theme:e={},css:t}=Qr.options,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/* Base, Typography\n------------------------------------------------------------ */\n/* Base setup for top level elements */\n.rebilly-instruments-content {\n color: var(--rebilly-colorText);\n background: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeBase);\n font-weight: var(--rebilly-fontWeightBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-fontFamily);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n font-smooth: var(--rebilly-fontSmooth);\n padding: 2px;\n font-display: swap;\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-amount-selector {\n padding: 2px;\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\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 min-height: 48px;\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.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method {\n border-radius: 100px;\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/* Components. Icons\n------------------------------------------------------------ */\n.rebilly-instruments-icon {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n/* Components. Forms. Checkboxes\n------------------------------------------------------------ */\n.rebilly-instruments-form-field-checkbox {\n position: relative;\n opacity: 1;\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-start;\n cursor: pointer;\n transform: none;\n}\n\n.rebilly-instruments-form-field-checkbox > * {\n cursor: pointer;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.rebilly-instruments-form-field-checkbox span {\n position: relative;\n top: 0;\n left: 0;\n width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n min-width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--rebilly-colorMutedBorder);\n margin-right: var(--rebilly-spacingS);\n background-color: transparent;\n transition: all 200ms;\n}\n\n.rebilly-instruments-form-field-checkbox span:after {\n content: '';\n position: absolute;\n border: solid var(--rebilly-colorPrimary);\n width: calc(var(--rebilly-spacingXs) + var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingXs) - var(--rebilly-spacing2xs) + 2px);\n border-width: 2px 2px 0 0;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n opacity: 0;\n transform: translateY(-60%) translateX(-50%) rotate(135deg);\n transition: all 0.2s ease;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {\n opacity: 1;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {\n opacity: 0.6;\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: calc(var(--rebilly-fontLineHeightBase) + 10px);\n height: var(--rebilly-fontLineHeightBase);\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.rebilly-instruments-error-card.not-closeable {\n margin-bottom: 0;\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\n\n/* Bump offer\n------------------------------------------------------------ */\n.rebilly-instruments-bump-offers {\n text-align: left;\n margin-bottom: calc(var(--rebilly-spacingM) + var(--rebilly-fontSizeS));\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-form-field-checkbox {\n margin-bottom: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-bump-offer-label {\n width: 100%;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item {\n border-bottom: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS) 0;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.rebilly-instruments-bump-offer-line-item:first-child {\n padding-top: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure {\n margin: 0 var(--rebilly-spacingS) 0 0;\n flex: 0 0 auto;\n width: 48px;\n height: 48px;\n border-radius: var(--rebilly-borderRadius);\n border: 1px solid var(--rebilly-colorMutedBorder);\n overflow: hidden;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure img {\n width: 100%;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis {\n flex: 1 2 auto;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-title {\n margin: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-description {\n color: var(--rebilly-colorMutedText);\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: var(--rebilly-fontLineHeightS);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown {\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--rebilly-colorMutedText);\n margin: 0 0 0 var(--rebilly-spacingS);\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown .rebilly-instruments-icon {\n fill: var(--rebilly-colorMutedText);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown-unit-price {\n color: var(--rebilly-colorText);\n}\n`)(new Fm(e).build())}\n `;return t})(e||{});return Rd({element:"style",attributes:{type:"text/css"},content:Hm(n),target:"head"}),t&&Rd({element:"style",attributes:{type:"text/css"},content:Hm(t),target:"head"}),n};const Bm=()=>{Qr.translate.init(Qr.options.locale,Qr.options.i18n),Qr.translate.translateItems()};var qm,Vm=()=>{var e;if("auto"===Qr.options.locale&&null!==(e=Qr.data.riskMetadata)&&void 0!==e&&null!==(e=e.browserData)&&void 0!==e&&e.language){const{browserData:{language:e}}=Qr.data.riskMetadata;Qr.options.locale=e}return Qr.translate.init(Qr.options.locale,Qr.options.i18n),Bm},zm=function(e){if("Function"===x(e))return w(e)},Wm=Object.keys||function(e){return xt(e,Et)},Um=l&&!Ce?Object.defineProperties:function(e,t){Te(e);for(var n,r=C(t),a=Wm(t),o=a.length,i=0;o>i;)Be.f(e,n=a[i++],r[n]);return e},Gm={f:Um},Zm=M("document","documentElement"),Xm="prototype",Km="script",Jm=tt("IE_PROTO"),Ym=function(){},Qm=function(e){return"<"+Km+">"+e+"</"+Km+">"},ef=function(e){e.write(Qm("")),e.close();var t=e.parentWindow.Object;return e=null,t},tf=function(){try{qm=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;tf="undefined"!=typeof document?document.domain&&qm?ef(qm):(t=Se("iframe"),n="java"+Km+":",t.style.display="none",Zm.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Qm("document.F=Object")),e.close(),e.F):ef(qm);for(var r=Et.length;r--;)delete tf[Xm][Et[r]];return tf()};nt[Jm]=!0;var nf,rf,af,of=Object.create||function(e,t){var n;return null!==e?(Ym[Xm]=Te(e),n=new Ym,Ym[Xm]=null,n[Jm]=e):n=tf(),void 0===t?n:Gm.f(n,t)},sf=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),lf=tt("IE_PROTO"),cf=Object,uf=cf.prototype,df=sf?cf.getPrototypeOf:function(e){var t=le(e);if(ue(t,lf))return t[lf];var n=t.constructor;return N(n)&&t instanceof n?n.prototype:t instanceof cf?uf:null},pf=ve("iterator"),mf=!1;[].keys&&("next"in(af=[].keys())?(rf=df(df(af)))!==Object.prototype&&(nf=rf):mf=!0);var ff=!R(nf)||s((function(){var e={};return nf[pf].call(e)!==e}));ff&&(nf={}),N(nf[pf])||ut(nf,pf,(function(){return this}));var hf={IteratorPrototype:nf,BUGGY_SAFARI_ITERATORS:mf},yf=Be.f,gf=ve("toStringTag"),vf=function(e,t,n){e&&!n&&(e=e.prototype),e&&!ue(e,gf)&&yf(e,gf,{configurable:!0,value:t})},bf=hf.IteratorPrototype,wf=function(e,t){return{value:e,done:t}},kf=ve("match"),$f=function(){var e=Te(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},xf=RegExp.prototype,Ef=function(e){var t=e.flags;return void 0!==t||"flags"in xf||ue(e,"flags")||!F(xf,e)?t:d($f,e)},Sf=function(){},_f=[],Pf=M("Reflect","construct"),Af=/^\s*(?:class|function)\b/,If=w(Af.exec),Cf=!Af.exec(Sf),jf=function(e){if(!N(e))return!1;try{return Pf(Sf,_f,e),!0}catch(e){return!1}},Lf=function(e){if(!N(e))return!1;switch(Yt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Cf||!!If(Af,Je(e))}catch(e){return!0}};Lf.sham=!0;var Tf,Nf,Of=!Pf||s((function(){var e;return jf(jf.call)||!jf(Object)||!jf((function(){e=!0}))||e}))?Lf:jf,Rf=TypeError,Mf=ve("species"),Ff=function(e,t){var n,r=Te(e).constructor;return void 0===r||P(n=Te(r)[Mf])?t:function(e){if(Of(e))return e;throw Rf(J(e)+" is not a constructor")}(n)},Hf=w("".charAt),Df=w("".charCodeAt),Bf=w("".slice),qf=function(e){return function(t,n){var r,a,o=en(I(t)),i=ft(n),s=o.length;return i<0||i>=s?e?"":void 0:(r=Df(o,i))<55296||r>56319||i+1===s||(a=Df(o,i+1))<56320||a>57343?e?Hf(o,i):r:e?Bf(o,i,i+2):a-56320+(r-55296<<10)+65536}},Vf={codeAt:qf(!1),charAt:qf(!0)}.charAt,zf=i.RegExp,Wf=s((function(){var e=zf("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Uf=Wf||s((function(){return!zf("a","y").sticky})),Gf={BROKEN_CARET:Wf||s((function(){var e=zf("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Uf,UNSUPPORTED_Y:Wf},Zf=i.RegExp,Xf=s((function(){var e=Zf(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Kf=i.RegExp,Jf=s((function(){var e=Kf("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Yf=lt.get,Qf=ie("native-string-replace",String.prototype.replace),eh=RegExp.prototype.exec,th=eh,nh=w("".charAt),rh=w("".indexOf),ah=w("".replace),oh=w("".slice),ih=(Nf=/b*/g,d(eh,Tf=/a/,"a"),d(eh,Nf,"a"),0!==Tf.lastIndex||0!==Nf.lastIndex),sh=Gf.BROKEN_CARET,lh=void 0!==/()??/.exec("")[1];(ih||lh||sh||Xf||Jf)&&(th=function(e){var t,n,r,a,o,i,s,l=this,c=Yf(l),u=en(e),p=c.raw;if(p)return p.lastIndex=l.lastIndex,t=d(th,p,u),l.lastIndex=p.lastIndex,t;var m=c.groups,f=sh&&l.sticky,h=d($f,l),y=l.source,g=0,v=u;if(f&&(h=ah(h,"y",""),-1===rh(h,"g")&&(h+="g"),v=oh(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==nh(u,l.lastIndex-1))&&(y="(?: "+y+")",v=" "+v,g++),n=new RegExp("^(?:"+y+")",h)),lh&&(n=new RegExp("^"+y+"$(?!\\s)",h)),ih&&(r=l.lastIndex),a=d(eh,f?n:l,v),f?a?(a.input=oh(a.input,g),a[0]=oh(a[0],g),a.index=l.lastIndex,l.lastIndex+=a[0].length):l.lastIndex=0:ih&&a&&(l.lastIndex=l.global?a.index+a[0].length:r),lh&&a&&a.length>1&&d(Qf,a[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(a[o]=void 0)})),a&&m)for(a.groups=i=of(null),o=0;o<m.length;o++)i[(s=m[o])[0]]=a[s[1]];return a});var ch=th,uh=TypeError,dh=ve("matchAll"),ph="RegExp String",mh=ph+" Iterator",fh=lt.set,hh=lt.getterFor(mh),yh=RegExp.prototype,gh=TypeError,vh=zm("".indexOf),bh=zm("".matchAll),wh=!!bh&&!s((function(){bh("a",/./)})),kh=function(e,t,n,r){var a=t+" Iterator";return e.prototype=of(bf,{next:y(+!r,n)}),vf(e,a,!1),e}((function(e,t,n,r){fh(this,{type:mh,regexp:e,string:t,global:n,unicode:r,done:!1})}),ph,(function(){var e=hh(this);if(e.done)return wf(void 0,!0);var t=e.regexp,n=e.string,r=function(e,t){var n=e.exec;if(N(n)){var r=d(n,e,t);return null!==r&&Te(r),r}if("RegExp"===x(e))return d(ch,e,t);throw uh("RegExp#exec called on incompatible receiver")}(t,n);return null===r?(e.done=!0,wf(void 0,!0)):e.global?(""===en(r[0])&&(t.lastIndex=function(e,t,n){return t+(n?Vf(e,t).length:1)}(n,vt(t.lastIndex),e.unicode)),wf(r,!1)):(e.done=!0,wf(r,!1))})),$h=function(e){var t,n,r,a=Te(this),o=en(e),i=Ff(a,RegExp),s=en(Ef(a));return t=new i(i===RegExp?a.source:a,s),n=!!~vh(s,"g"),r=!!~vh(s,"u"),t.lastIndex=vt(a.lastIndex),new kh(t,o,n,r)};function xh(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}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}Dt({target:"String",proto:!0,forced:wh},{matchAll:function(e){var t,n,r,a=I(this);if(P(e)){if(wh)return bh(a,e)}else{if(function(e){var t;return R(e)&&(void 0!==(t=e[kf])?!!t:"RegExp"===x(e))}(e)&&(t=en(I(Ef(e))),!~vh(t,"g")))throw gh("`.matchAll` does not allow non-global regexes");if(wh)return bh(a,e);if(r=ee(e,dh))return d(r,e,a)}return n=en(a),new RegExp(e,"g")[dh](n)}}),dh in yh||ut(yh,dh,$h);const Eh=(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`]});var Sh=()=>{var e;const t=xh(`\n ${Qr.mainStyleVars}\n ${(null===(e=Qr.options)||void 0===e?void 0:e.css)||""}\n `);return{base:{...Eh(t,"input"),":hover":Eh(t,"inputHover"),":focus":Eh(t,"inputFocus"),"::placeholder":Eh(t,"inputPlaceholder"),"::selection":Eh(t,"inputSelection")},invalid:{...Eh(t,"inputError"),":hover":Eh(t,"inputErrorHover"),":focus":Eh(t,"inputErrorFocus"),"::placeholder":Eh(t,"inputErrorPlaceholder"),"::selection":Eh(t,"inputErrorSelection")},buttons:{base:{...Eh(t,"buttonSecondary"),":hover":Eh(t,"buttonSecondaryHover"),":focus":Eh(t,"buttonSecondaryActive")},active:{...Eh(t,"button"),":hover":Eh(t,"buttonHover"),":focus":Eh(t,"buttonActive")}}}};function _h({eventName:e,callback:t}){if(!ji.includes(e))throw new Error(`${e} is not a supported event`);const n=vo(e);Ci[n].addEventListener(t)}const Ph=(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`;async function Ah({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{})}={}){var o,i;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;Qr.form.insertAdjacentHTML("beforeend",Ph(l,s));const c=document.querySelector(".rebilly-instruments-modal-overlay"),u=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((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),Qr.loader.addDOMElement({section:"modal",el:p}),Qr.loader.startLoading({section:"modal",id:e});const m={options:Qr.toModel().options,...n},f=await new Hi({name:e,url:t,model:m,classListArray:r,container:p}),h=(...e)=>{u.classList.remove("is-visible"),c.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto";const t=c.children;for(let e=0;e<t.length;e+=1)t[e].remove();c.remove(),a(...e),f.destroy()}),300)};return f.bindEventListeners({close:h,loader:Qr.loader}),l||d.addEventListener("click",h),null===(i=f.component)||void 0===i||i.call("route",{name:"approval-url"}),f}async function Ih({payload:e}){var t,n,r,a,o;const{_raw:{id:i},isExistingInstrument:s}=e;delete e.isExistingInstrument,delete e._raw;const l={...e};s?l.paymentInstrumentId=i:l.token=i,null!==(t=Qr.options)&&void 0!==t&&t.invoiceId&&(l.invoiceId=Qr.options.invoiceId),null!==(n=Qr.options)&&void 0!==n&&n.transactionId&&(l.transactionId=Qr.options.transactionId),null!==(r=Qr.options)&&void 0!==r&&r.money&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.options.money.amount,l.currency=Qr.options.money.currency),null!==(a=Qr.options)&&void 0!==a&&a.deposit&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.data.amountAndCurrency.amount,l.currency=Qr.data.amountAndCurrency.currency),null!==(o=Qr.data)&&void 0!==o&&o.couponIds&&Array.isArray(Qr.data.couponIds)&&(l.couponIds=Qr.data.couponIds);let{fields:c}=await async function({data:e}){return pc((async()=>{const{token:t,transactionId:n,invoiceId:r,websiteId:a,paymentInstrumentId:o}=e,i=["riskMetadata","redirectUrl"];return t&&i.push("token"),o&&i.push("paymentInstrumentId"),n&&i.push("transactionId"),r&&i.push("invoiceId"),a&&i.push("amount","currency","websiteId"),Object.keys(e).forEach((t=>{i.includes(t)||delete e[t]})),Qr.storefront.purchase.payment({data:e})}))}({state:Qr,data:l});return c={transaction:c,token:c.token||Qr.options.jwt},Qr.data.invoice&&(c.invoice=Qr.data.invoice),c}async function Ch({payload:e}){const t={websiteId:Qr.options.websiteId,paymentInstruction:{token:e._raw.id},...e};Qr.data.acceptBumpOffer?t.items=Qr.options.bumpOffer:t.items=vc(Qr.options.items),Qr.data.couponIds&&Array.isArray(Qr.data.couponIds)&&(t.couponIds=Qr.data.couponIds),Qr.options.addons&&Qr.data.addons&&Array.isArray(Qr.data.addons)&&Qr.options.addons.forEach((e=>{Qr.data.addons.includes(e.planId)&&t.items.push(e)}));const{fields:n}=await async function({data:e}){return pc((async()=>{const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),Qr.storefront.purchase.purchase({data:e})}))}({state:Qr,data:t});return n}async function jh({payload:e}){Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{var t,n;let r;return r=Qr.data.isPayment?await Ih({state:Qr,payload:e}):await Ch({state:Qr,payload:e}),null!==(t=r.transaction)&&void 0!==t&&t.approvalUrl&&"unknown"===(null===(n=r.transaction)||void 0===n?void 0:n.result)?function({fields:e,payload:t}){var n,r;if(t.redirectUrl||null===(n=e.transaction)||void 0===n||!n.approvalUrl){const{paymentMethodsUrl:t}=Qr.options._computed,n=JSON.parse(JSON.stringify(e)),r={};Qr.data.isPayment?r.payment=n:r.purchase=n,Qr.data=new wd({...e});const a="rebilly-instruments-approval-url";Ah({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ci.purchaseCompleted.dispatch(e)}})}else if(null!==(r=e.transaction)&&void 0!==r&&r.approvalUrl){var a;window.location=null===(a=e.transaction)||void 0===a?void 0:a.approvalUrl}}({state:Qr,fields:r,payload:e}):Ci.purchaseCompleted.dispatch(r),r}catch(e){return Oi(e),e}}async function Lh({payload:e}){try{var t;const{_raw:{id:n},isExistingInstrument:r}=e;delete e.isExistingInstrument,delete e._raw;const a={...e};r?a.paymentInstrumentId=n:a.token=n;const{instrument:o,transaction:i}=await async function({data:e}){return pc((async()=>{var t;const{fields:n}=await Qr.storefront.paymentInstruments.create({data:e});Qr.storefront.setSessionToken(n.token||Qr.options.jwt);const r={id:n.id,data:{websiteId:Qr.options.websiteId,...e}};Qr.data.amountAndCurrency&&(r.data={...r.data,...Qr.data.amountAndCurrency}),null!==(t=Qr.data)&&void 0!==t&&null!==(t=t.transaction)&&void 0!==t&&t.redirectUrl&&(r.data.redirectUrl=`${r.data.redirectUrl}&originalRedirectUrl=${Qr.data.transaction.redirectUrl}`);const{fields:a}=await Qr.storefront.paymentInstruments.setup(r);return{instrument:n,transaction:a}}))}({data:{websiteId:null===(t=Qr.options)||void 0===t?void 0:t.websiteId,...a}});if(Qr.data=new wd({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result){const{paymentMethodsUrl:e}=Qr.options._computed;Ah({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ci.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ci.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(e){return Oi(e),e}}async function Th({componentName:e,payload:t}){switch(e){case"result":Ld(),async function({payload:e}){var t,n;const r=Yr.form;r||await Od();const a=Qr.toModel(),o={options:a.options,mainStyleVars:a.mainStyleVars,[Qr.options.transactionType]:e};null==r||null===(t=r.component)||void 0===t||t.call("route",{name:"result"}),null==r||null===(n=r.component)||void 0===n||n.call("update",o)}({payload:t});break;case"confirmation":Ld(),async function({payload:e}){var t,n,r,a;e.billingAddress&&Qr.summary&&Qr.data.isPurchase&&xc({instrument:e});const o=Yr.form;o||await Od();const i=Qr.toModel(),s={options:i.options,data:i.data,mainStyleVars:i.mainStyleVars,instrument:e};null==o||null===(t=o.component)||void 0===t||t.call("update",s),null==o||null===(n=o.component)||void 0===n||n.call("route",{name:"confirmation"}),null==o||null===(r=o.component)||void 0===r||r.on(`${o.name}-confirm-purchase`,(e=>{jh({payload:e})})),null==o||null===(a=o.component)||void 0===a||a.on(`${o.name}-confirm-setup`,(e=>{Lh({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function Nh({state:e,payload:t}){Th({componentName:"result",payload:t,state:e})}var Oh=({state:e={}})=>{e.options.features.autoConfirmation&&_h({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?Lh({state:e,payload:t}):jh({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Th({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&(_h({eventName:"purchase-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}),_h({eventName:"setup-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}))};async function Rh({setupFramepay:e=Pm,...t}={}){try{var n,r,a,o,i,s;Qr.data={},Qr.options={},Qr.options=_m({options:t}),Qr.form=Md({element:"form"}),Qr.summary=Md({element:"summary"}),Qr.form.style.maxWidth="750px",Qr.summary&&(Qr.summary.style.maxWidth="750px"),Qr.storefront=Fd(),Qr.mainStyleVars=Dm(),Qr.options.themeFramepay=Sh(),Qr.loader.addDOMElement({el:Qr.form}),Qr.loader.addDOMElement({section:"summary",el:Qr.summary}),Qr.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),Qr.loader.startLoading({id:"rebilly-instruments-form"});const[l]=await Promise.all([kd(),e()]);Qr.data=l,Ci.dataReady.dispatch(Qr.data),Qr.i18n=Vm(),!Qr.options.websiteId&&null!==(n=Qr.data.transaction)&&void 0!==n&&n.websiteId?Qr.options.websiteId=Qr.data.transaction.websiteId:!Qr.options.websiteId&&null!==(r=Qr.data.invoice)&&void 0!==r&&r.websiteId&&(Qr.options.websiteId=Qr.data.invoice.websiteId),Qr.data.transaction&&"setup"===(null===(a=Qr.data.transaction)||void 0===a?void 0:a.type)&&(Qr.options.transactionType="setup"),Qr.form&&Od().then((()=>{var e;null!==(e=Qr.options)&&void 0!==e&&e.deposit?Pd():Td()})),Qr.summary&&$c(),Qr.i18n({state:Qr}),Qr.hasMounted=!0;((null===(o=Qr.options)||void 0===o?void 0:o.invoiceId)||(null===(i=Qr.data)||void 0===i||null===(i=i.transaction)||void 0===i?void 0:i.invoiceId))&&Qr.data.invoice.isPaid&&(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),document.querySelector('[data-rebilly-instruments="form"]').remove(),Oi(Qr.translate.getTranslation("form.error.invoiceIsPaid"),!1)),null!==(s=l.readyToPay)&&void 0!==s&&s.length||(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),Oi(Qr.translate.getTranslation("form.error.noPaymentMethods")))}catch(e){throw Oi(e),e}Oh({state:Qr})}async function Mh(){var e;await(e=1e3,new Promise((t=>setTimeout(t,e)))),Object.keys(Yr).forEach((e=>{Yr.hasFrame(e)&&(Yr[e].destroy(),Yr[e]=null)})),Ai.removeAll(document),Qr.hasMounted=!1,Qr.summary&&(Qr.summary.textContent=""),Qr.form.textContent="",Yl.cancelAll(),Qr.loader.clearAll()}var Fh=new class{constructor(){this.state=Qr,this.iframes=Yr}async mount(e){await Rh(e)}async destroy(){await Mh()}async update(e){await async function({newOptions:e={}}){if(!Qr.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=Zr({...Qr.options},e);await Mh(),Rh({form:Qr.form,summary:Qr.summary,...t})}({newOptions:e})}async purchase(e){await jh({payload:e})}async setup(e){await Lh({payload:e})}async show(e,t){await Th({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.4.2.1"}on(e,t){_h({eventName:e,callback:t})}};return Fh}();
68
+ */var N=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},O=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 a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var o=_(a);if(!o)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+o.type.toUpperCase()](o.values.concat([o.alpha]))},R={hex:{configurable:!0}};return R.hex.get=function(){return this.hexString().replace(/^#/,"")},O.prototype.setColor=function(e){var t=_(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},O.prototype.tint=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#fff",this.rgbString(),t).rgba+")","tint",t)},O.prototype.shade=function(e,t){return void 0===t&&(t=N(e,50)),new O("rgb("+T("#000",this.rgbString(),t).rgba+")","shade",t)},O.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},O.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=N(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},O.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},O.prototype.hexString=function(){return C(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},O.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},O.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},O.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},O.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],o=e[3];return t=[P([n,r,a]).map(Math.round),o],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(O.prototype,R),O.VERSION="v2.1.1",O}()})),Im=Am;const Cm=e=>new Im(e);function jm(e,t=1){if(null===e)return e;const n=Cm(e);return n.alpha=t,n.rgbString()}const Lm=e=>jm(e,.5),Tm=(e,t)=>{if(null===e)return e;return Cm(e).shade(t).hexString()};function Nm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Om{constructor(e){Nm(this,"allStyles",["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"]),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 Rm={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>Lm(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?jm(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',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?Tm(e.buttonColorBackground,20):Tm(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 Om(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 ${Tm(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 Om(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?Lm(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 Om(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?Lm(e.inputErrorColorText):Lm(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 Mm=new Proxy(Rm,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(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 Fm{constructor(e={}){this.overrides=e,this.theme=Mm}overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!Fm.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Fm,"nonCssProperties",["labels"]);function Hm(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 Dm=()=>{const{theme:e={},css:t}=Qr.options,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/* Base, Typography\n------------------------------------------------------------ */\n/* Base setup for top level elements */\n.rebilly-instruments-content {\n color: var(--rebilly-colorText);\n background: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeBase);\n font-weight: var(--rebilly-fontWeightBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-fontFamily);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n font-smooth: var(--rebilly-fontSmooth);\n padding: 2px;\n font-display: swap;\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-amount-selector {\n padding: 2px;\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\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 min-height: 48px;\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.rebilly-instruments-express-methods .rebilly-instruments-google-pay-method {\n border-radius: 100px;\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/* Components. Icons\n------------------------------------------------------------ */\n.rebilly-instruments-icon {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n/* Components. Forms. Checkboxes\n------------------------------------------------------------ */\n.rebilly-instruments-form-field-checkbox {\n position: relative;\n opacity: 1;\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-start;\n cursor: pointer;\n transform: none;\n}\n\n.rebilly-instruments-form-field-checkbox > * {\n cursor: pointer;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.rebilly-instruments-form-field-checkbox span {\n position: relative;\n top: 0;\n left: 0;\n width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n min-width: calc(var(--rebilly-spacingM) - var(--rebilly-spacing2xs));\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--rebilly-colorMutedBorder);\n margin-right: var(--rebilly-spacingS);\n background-color: transparent;\n transition: all 200ms;\n}\n\n.rebilly-instruments-form-field-checkbox span:after {\n content: '';\n position: absolute;\n border: solid var(--rebilly-colorPrimary);\n width: calc(var(--rebilly-spacingXs) + var(--rebilly-spacing2xs));\n height: calc(var(--rebilly-spacingXs) - var(--rebilly-spacing2xs) + 2px);\n border-width: 2px 2px 0 0;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n opacity: 0;\n transform: translateY(-60%) translateX(-50%) rotate(135deg);\n transition: all 0.2s ease;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {\n box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {\n opacity: 1;\n}\n\n.rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {\n opacity: 0.6;\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: calc(var(--rebilly-fontLineHeightBase) + 10px);\n height: var(--rebilly-fontLineHeightBase);\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.rebilly-instruments-error-card.not-closeable {\n margin-bottom: 0;\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\n\n/* Bump offer\n------------------------------------------------------------ */\n.rebilly-instruments-bump-offers {\n text-align: left;\n margin-bottom: calc(var(--rebilly-spacingM) + var(--rebilly-fontSizeS));\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-form-field-checkbox {\n margin-bottom: var(--rebilly-spacingS);\n}\n\n.rebilly-instruments-bump-offers .rebilly-instruments-bump-offer-label {\n width: 100%;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item {\n border-bottom: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS) 0;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.rebilly-instruments-bump-offer-line-item:first-child {\n padding-top: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure {\n margin: 0 var(--rebilly-spacingS) 0 0;\n flex: 0 0 auto;\n width: 48px;\n height: 48px;\n border-radius: var(--rebilly-borderRadius);\n border: 1px solid var(--rebilly-colorMutedBorder);\n overflow: hidden;\n}\n\n.rebilly-instruments-bump-offer-line-item-figure img {\n width: 100%;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis {\n flex: 1 2 auto;\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-title {\n margin: 0;\n}\n\n.rebilly-instruments-bump-offer-line-item-synopsis-description {\n color: var(--rebilly-colorMutedText);\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: var(--rebilly-fontLineHeightS);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown {\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--rebilly-colorMutedText);\n margin: 0 0 0 var(--rebilly-spacingS);\n font-weight: var(--rebilly-fontWeightBase);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown .rebilly-instruments-icon {\n fill: var(--rebilly-colorMutedText);\n}\n\n.rebilly-instruments-bump-offer-line-item-price-breakdown-unit-price {\n color: var(--rebilly-colorText);\n}\n`)(new Fm(e).build())}\n `;return t})(e||{});return Rd({element:"style",attributes:{type:"text/css"},content:Hm(n),target:"head"}),t&&Rd({element:"style",attributes:{type:"text/css"},content:Hm(t),target:"head"}),n};const Bm=()=>{Qr.translate.init(Qr.options.locale,Qr.options.i18n),Qr.translate.translateItems()};var qm,Vm=()=>{var e;if("auto"===Qr.options.locale&&null!==(e=Qr.data.riskMetadata)&&void 0!==e&&null!==(e=e.browserData)&&void 0!==e&&e.language){const{browserData:{language:e}}=Qr.data.riskMetadata;Qr.options.locale=e}return Qr.translate.init(Qr.options.locale,Qr.options.i18n),Bm},zm=function(e){if("Function"===x(e))return w(e)},Wm=Object.keys||function(e){return xt(e,Et)},Um=l&&!Ce?Object.defineProperties:function(e,t){Te(e);for(var n,r=C(t),a=Wm(t),o=a.length,i=0;o>i;)Be.f(e,n=a[i++],r[n]);return e},Gm={f:Um},Zm=M("document","documentElement"),Xm="prototype",Km="script",Jm=tt("IE_PROTO"),Ym=function(){},Qm=function(e){return"<"+Km+">"+e+"</"+Km+">"},ef=function(e){e.write(Qm("")),e.close();var t=e.parentWindow.Object;return e=null,t},tf=function(){try{qm=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;tf="undefined"!=typeof document?document.domain&&qm?ef(qm):(t=Se("iframe"),n="java"+Km+":",t.style.display="none",Zm.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Qm("document.F=Object")),e.close(),e.F):ef(qm);for(var r=Et.length;r--;)delete tf[Xm][Et[r]];return tf()};nt[Jm]=!0;var nf,rf,af,of=Object.create||function(e,t){var n;return null!==e?(Ym[Xm]=Te(e),n=new Ym,Ym[Xm]=null,n[Jm]=e):n=tf(),void 0===t?n:Gm.f(n,t)},sf=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),lf=tt("IE_PROTO"),cf=Object,uf=cf.prototype,df=sf?cf.getPrototypeOf:function(e){var t=le(e);if(ue(t,lf))return t[lf];var n=t.constructor;return N(n)&&t instanceof n?n.prototype:t instanceof cf?uf:null},pf=ve("iterator"),mf=!1;[].keys&&("next"in(af=[].keys())?(rf=df(df(af)))!==Object.prototype&&(nf=rf):mf=!0);var ff=!R(nf)||s((function(){var e={};return nf[pf].call(e)!==e}));ff&&(nf={}),N(nf[pf])||ut(nf,pf,(function(){return this}));var hf={IteratorPrototype:nf,BUGGY_SAFARI_ITERATORS:mf},yf=Be.f,gf=ve("toStringTag"),vf=function(e,t,n){e&&!n&&(e=e.prototype),e&&!ue(e,gf)&&yf(e,gf,{configurable:!0,value:t})},bf=hf.IteratorPrototype,wf=function(e,t){return{value:e,done:t}},kf=ve("match"),$f=function(){var e=Te(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},xf=RegExp.prototype,Ef=function(e){var t=e.flags;return void 0!==t||"flags"in xf||ue(e,"flags")||!F(xf,e)?t:d($f,e)},Sf=function(){},_f=[],Pf=M("Reflect","construct"),Af=/^\s*(?:class|function)\b/,If=w(Af.exec),Cf=!Af.exec(Sf),jf=function(e){if(!N(e))return!1;try{return Pf(Sf,_f,e),!0}catch(e){return!1}},Lf=function(e){if(!N(e))return!1;switch(Yt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Cf||!!If(Af,Je(e))}catch(e){return!0}};Lf.sham=!0;var Tf,Nf,Of=!Pf||s((function(){var e;return jf(jf.call)||!jf(Object)||!jf((function(){e=!0}))||e}))?Lf:jf,Rf=TypeError,Mf=ve("species"),Ff=function(e,t){var n,r=Te(e).constructor;return void 0===r||P(n=Te(r)[Mf])?t:function(e){if(Of(e))return e;throw Rf(J(e)+" is not a constructor")}(n)},Hf=w("".charAt),Df=w("".charCodeAt),Bf=w("".slice),qf=function(e){return function(t,n){var r,a,o=en(I(t)),i=ft(n),s=o.length;return i<0||i>=s?e?"":void 0:(r=Df(o,i))<55296||r>56319||i+1===s||(a=Df(o,i+1))<56320||a>57343?e?Hf(o,i):r:e?Bf(o,i,i+2):a-56320+(r-55296<<10)+65536}},Vf={codeAt:qf(!1),charAt:qf(!0)}.charAt,zf=i.RegExp,Wf=s((function(){var e=zf("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Uf=Wf||s((function(){return!zf("a","y").sticky})),Gf={BROKEN_CARET:Wf||s((function(){var e=zf("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Uf,UNSUPPORTED_Y:Wf},Zf=i.RegExp,Xf=s((function(){var e=Zf(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Kf=i.RegExp,Jf=s((function(){var e=Kf("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Yf=lt.get,Qf=ie("native-string-replace",String.prototype.replace),eh=RegExp.prototype.exec,th=eh,nh=w("".charAt),rh=w("".indexOf),ah=w("".replace),oh=w("".slice),ih=(Nf=/b*/g,d(eh,Tf=/a/,"a"),d(eh,Nf,"a"),0!==Tf.lastIndex||0!==Nf.lastIndex),sh=Gf.BROKEN_CARET,lh=void 0!==/()??/.exec("")[1];(ih||lh||sh||Xf||Jf)&&(th=function(e){var t,n,r,a,o,i,s,l=this,c=Yf(l),u=en(e),p=c.raw;if(p)return p.lastIndex=l.lastIndex,t=d(th,p,u),l.lastIndex=p.lastIndex,t;var m=c.groups,f=sh&&l.sticky,h=d($f,l),y=l.source,g=0,v=u;if(f&&(h=ah(h,"y",""),-1===rh(h,"g")&&(h+="g"),v=oh(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==nh(u,l.lastIndex-1))&&(y="(?: "+y+")",v=" "+v,g++),n=new RegExp("^(?:"+y+")",h)),lh&&(n=new RegExp("^"+y+"$(?!\\s)",h)),ih&&(r=l.lastIndex),a=d(eh,f?n:l,v),f?a?(a.input=oh(a.input,g),a[0]=oh(a[0],g),a.index=l.lastIndex,l.lastIndex+=a[0].length):l.lastIndex=0:ih&&a&&(l.lastIndex=l.global?a.index+a[0].length:r),lh&&a&&a.length>1&&d(Qf,a[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(a[o]=void 0)})),a&&m)for(a.groups=i=of(null),o=0;o<m.length;o++)i[(s=m[o])[0]]=a[s[1]];return a});var ch=th,uh=TypeError,dh=ve("matchAll"),ph="RegExp String",mh=ph+" Iterator",fh=lt.set,hh=lt.getterFor(mh),yh=RegExp.prototype,gh=TypeError,vh=zm("".indexOf),bh=zm("".matchAll),wh=!!bh&&!s((function(){bh("a",/./)})),kh=function(e,t,n,r){var a=t+" Iterator";return e.prototype=of(bf,{next:y(+!r,n)}),vf(e,a,!1),e}((function(e,t,n,r){fh(this,{type:mh,regexp:e,string:t,global:n,unicode:r,done:!1})}),ph,(function(){var e=hh(this);if(e.done)return wf(void 0,!0);var t=e.regexp,n=e.string,r=function(e,t){var n=e.exec;if(N(n)){var r=d(n,e,t);return null!==r&&Te(r),r}if("RegExp"===x(e))return d(ch,e,t);throw uh("RegExp#exec called on incompatible receiver")}(t,n);return null===r?(e.done=!0,wf(void 0,!0)):e.global?(""===en(r[0])&&(t.lastIndex=function(e,t,n){return t+(n?Vf(e,t).length:1)}(n,vt(t.lastIndex),e.unicode)),wf(r,!1)):(e.done=!0,wf(r,!1))})),$h=function(e){var t,n,r,a=Te(this),o=en(e),i=Ff(a,RegExp),s=en(Ef(a));return t=new i(i===RegExp?a.source:a,s),n=!!~vh(s,"g"),r=!!~vh(s,"u"),t.lastIndex=vt(a.lastIndex),new kh(t,o,n,r)};function xh(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}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}Dt({target:"String",proto:!0,forced:wh},{matchAll:function(e){var t,n,r,a=I(this);if(P(e)){if(wh)return bh(a,e)}else{if(function(e){var t;return R(e)&&(void 0!==(t=e[kf])?!!t:"RegExp"===x(e))}(e)&&(t=en(I(Ef(e))),!~vh(t,"g")))throw gh("`.matchAll` does not allow non-global regexes");if(wh)return bh(a,e);if(r=ee(e,dh))return d(r,e,a)}return n=en(a),new RegExp(e,"g")[dh](n)}}),dh in yh||ut(yh,dh,$h);const Eh=(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`]});var Sh=()=>{var e;const t=xh(`\n ${Qr.mainStyleVars}\n ${(null===(e=Qr.options)||void 0===e?void 0:e.css)||""}\n `);return{base:{...Eh(t,"input"),":hover":Eh(t,"inputHover"),":focus":Eh(t,"inputFocus"),"::placeholder":Eh(t,"inputPlaceholder"),"::selection":Eh(t,"inputSelection")},invalid:{...Eh(t,"inputError"),":hover":Eh(t,"inputErrorHover"),":focus":Eh(t,"inputErrorFocus"),"::placeholder":Eh(t,"inputErrorPlaceholder"),"::selection":Eh(t,"inputErrorSelection")},buttons:{base:{...Eh(t,"buttonSecondary"),":hover":Eh(t,"buttonSecondaryHover"),":focus":Eh(t,"buttonSecondaryActive")},active:{...Eh(t,"button"),":hover":Eh(t,"buttonHover"),":focus":Eh(t,"buttonActive")}}}};function _h({eventName:e,callback:t}){if(!ji.includes(e))throw new Error(`${e} is not a supported event`);const n=vo(e);Ci[n].addEventListener(t)}const Ph=(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`;async function Ah({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{})}={}){var o,i;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;Qr.form.insertAdjacentHTML("beforeend",Ph(l,s));const c=document.querySelector(".rebilly-instruments-modal-overlay"),u=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((()=>{c.classList.add("is-visible"),u.classList.add("is-visible")}),240),Qr.loader.addDOMElement({section:"modal",el:p}),Qr.loader.startLoading({section:"modal",id:e});const m={options:Qr.toModel().options,...n},f=await new Hi({name:e,url:t,model:m,classListArray:r,container:p}),h=(...e)=>{u.classList.remove("is-visible"),c.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto";const t=c.children;for(let e=0;e<t.length;e+=1)t[e].remove();c.remove(),a(...e),f.destroy()}),300)};return f.bindEventListeners({close:h,loader:Qr.loader}),l||d.addEventListener("click",h),null===(i=f.component)||void 0===i||i.call("route",{name:"approval-url"}),f}async function Ih({payload:e}){var t,n,r,a,o;const{_raw:{id:i},isExistingInstrument:s}=e;delete e.isExistingInstrument,delete e._raw;const l={...e};s?l.paymentInstrumentId=i:l.token=i,null!==(t=Qr.options)&&void 0!==t&&t.invoiceId&&(l.invoiceId=Qr.options.invoiceId),null!==(n=Qr.options)&&void 0!==n&&n.transactionId&&(l.transactionId=Qr.options.transactionId),null!==(r=Qr.options)&&void 0!==r&&r.money&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.options.money.amount,l.currency=Qr.options.money.currency),null!==(a=Qr.options)&&void 0!==a&&a.deposit&&(l.websiteId=Qr.options.websiteId,l.amount=Qr.data.amountAndCurrency.amount,l.currency=Qr.data.amountAndCurrency.currency),null!==(o=Qr.data)&&void 0!==o&&o.couponIds&&Array.isArray(Qr.data.couponIds)&&(l.couponIds=Qr.data.couponIds);let{fields:c}=await async function({data:e}){return pc((async()=>{const{token:t,transactionId:n,invoiceId:r,websiteId:a,paymentInstrumentId:o}=e,i=["riskMetadata","redirectUrl"];return t&&i.push("token"),o&&i.push("paymentInstrumentId"),n&&i.push("transactionId"),r&&i.push("invoiceId"),a&&i.push("amount","currency","websiteId"),Object.keys(e).forEach((t=>{i.includes(t)||delete e[t]})),Qr.storefront.purchase.payment({data:e})}))}({state:Qr,data:l});return c={transaction:c,token:c.token||Qr.options.jwt},Qr.data.invoice&&(c.invoice=Qr.data.invoice),c}async function Ch({payload:e}){const t={websiteId:Qr.options.websiteId,paymentInstruction:{token:e._raw.id},...e};Qr.data.acceptBumpOffer?t.items=Qr.options.bumpOffer:t.items=vc(Qr.options.items),Qr.data.couponIds&&Array.isArray(Qr.data.couponIds)&&(t.couponIds=Qr.data.couponIds),Qr.options.addons&&Qr.data.addons&&Array.isArray(Qr.data.addons)&&Qr.options.addons.forEach((e=>{Qr.data.addons.includes(e.planId)&&t.items.push(e)}));const{fields:n}=await async function({data:e}){return pc((async()=>{const t=["websiteId","paymentInstruction","items","billingAddress","deliveryAddress","shippingRateId","couponIds","password","redirectUrl"];return Object.keys(e).forEach((n=>{t.includes(n)||delete e[n]})),Qr.storefront.purchase.purchase({data:e})}))}({state:Qr,data:t});return n}async function jh({payload:e}){Object.keys(e).forEach((t=>{null===e[t]&&delete e[t]}));try{var t,n;let r;return r=Qr.data.isPayment?await Ih({state:Qr,payload:e}):await Ch({state:Qr,payload:e}),null!==(t=r.transaction)&&void 0!==t&&t.approvalUrl&&"unknown"===(null===(n=r.transaction)||void 0===n?void 0:n.result)?function({fields:e,payload:t}){var n,r;if(t.redirectUrl||null===(n=e.transaction)||void 0===n||!n.approvalUrl){const{paymentMethodsUrl:t}=Qr.options._computed,n=JSON.parse(JSON.stringify(e)),r={};Qr.data.isPayment?r.payment=n:r.purchase=n,Qr.data=new wd({...e});const a="rebilly-instruments-approval-url";Ah({name:a,url:`${t}?name=${a}`,model:r,close:e=>{Ci.purchaseCompleted.dispatch(e)}})}else if(null!==(r=e.transaction)&&void 0!==r&&r.approvalUrl){var a;window.location=null===(a=e.transaction)||void 0===a?void 0:a.approvalUrl}}({state:Qr,fields:r,payload:e}):Ci.purchaseCompleted.dispatch(r),r}catch(e){return Oi(e),e}}async function Lh({payload:e}){try{var t;const{_raw:{id:n},isExistingInstrument:r}=e;delete e.isExistingInstrument,delete e._raw;const a={...e};r?a.paymentInstrumentId=n:a.token=n;const{instrument:o,transaction:i}=await async function({data:e}){return pc((async()=>{var t;const{fields:n}=await Qr.storefront.paymentInstruments.create({data:e});Qr.storefront.setSessionToken(n.token||Qr.options.jwt);const r={id:n.id,data:{websiteId:Qr.options.websiteId,...e}};Qr.data.amountAndCurrency&&(r.data={...r.data,...Qr.data.amountAndCurrency}),null!==(t=Qr.data)&&void 0!==t&&null!==(t=t.transaction)&&void 0!==t&&t.redirectUrl&&(r.data.redirectUrl=`${r.data.redirectUrl}&originalRedirectUrl=${Qr.data.transaction.redirectUrl}`);const{fields:a}=await Qr.storefront.paymentInstruments.setup(r);return{instrument:n,transaction:a}}))}({data:{websiteId:null===(t=Qr.options)||void 0===t?void 0:t.websiteId,...a}});if(Qr.data=new wd({instrument:o,transaction:i}),i.approvalUrl&&"unknown"===i.result){const{paymentMethodsUrl:e}=Qr.options._computed;Ah({name:"rebilly-instruments-approval-url",url:`${e}/approval-url`,model:{setup:{transaction:i}},close:({transaction:e=i})=>{Ci.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ci.setupCompleted.dispatch({instrument:o,transaction:i});return{instrument:o,transaction:i}}catch(e){return Oi(e),e}}async function Th({componentName:e,payload:t}){switch(e){case"result":Ld(),async function({payload:e}){var t,n;const r=Yr.form;r||await Od();const a=Qr.toModel(),o={options:a.options,mainStyleVars:a.mainStyleVars,[Qr.options.transactionType]:e};null==r||null===(t=r.component)||void 0===t||t.call("route",{name:"result"}),null==r||null===(n=r.component)||void 0===n||n.call("update",o)}({payload:t});break;case"confirmation":Ld(),async function({payload:e}){var t,n,r,a;e.billingAddress&&Qr.summary&&Qr.data.isPurchase&&xc({instrument:e});const o=Yr.form;o||await Od();const i=Qr.toModel(),s={options:i.options,data:i.data,mainStyleVars:i.mainStyleVars,instrument:e};null==o||null===(t=o.component)||void 0===t||t.call("update",s),null==o||null===(n=o.component)||void 0===n||n.call("route",{name:"confirmation"}),null==o||null===(r=o.component)||void 0===r||r.on(`${o.name}-confirm-purchase`,(e=>{jh({payload:e})})),null==o||null===(a=o.component)||void 0===a||a.on(`${o.name}-confirm-setup`,(e=>{Lh({payload:e})}))}({payload:t});break;default:throw new Error(`'${e}' not a supported component`)}}function Nh({state:e,payload:t}){Th({componentName:"result",payload:t,state:e})}var Oh=({state:e={}})=>{e.options.features.autoConfirmation&&_h({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?Lh({state:e,payload:t}):jh({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Th({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&(_h({eventName:"purchase-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}),_h({eventName:"setup-completed",callback:t=>{t=JSON.parse(JSON.stringify(t)),Nh({state:e,payload:t})}}))};async function Rh({setupFramepay:e=Pm,...t}={}){try{var n,r,a,o,i,s;Qr.data={},Qr.options={},Qr.options=_m({options:t}),Qr.form=Md({element:"form"}),Qr.summary=Md({element:"summary"}),Qr.form.style.maxWidth="750px",Qr.summary&&(Qr.summary.style.maxWidth="750px"),Qr.storefront=Fd(),Qr.mainStyleVars=Dm(),Qr.options.themeFramepay=Sh(),Qr.loader.addDOMElement({el:Qr.form}),Qr.loader.addDOMElement({section:"summary",el:Qr.summary}),Qr.loader.startLoading({section:"summary",id:"rebilly-instruments-summary"}),Qr.loader.startLoading({id:"rebilly-instruments-form"});const[l]=await Promise.all([kd(),e()]);Qr.data=l,Ci.dataReady.dispatch(Qr.data),Qr.i18n=Vm(),!Qr.options.websiteId&&null!==(n=Qr.data.transaction)&&void 0!==n&&n.websiteId?Qr.options.websiteId=Qr.data.transaction.websiteId:!Qr.options.websiteId&&null!==(r=Qr.data.invoice)&&void 0!==r&&r.websiteId&&(Qr.options.websiteId=Qr.data.invoice.websiteId),Qr.data.transaction&&"setup"===(null===(a=Qr.data.transaction)||void 0===a?void 0:a.type)&&(Qr.options.transactionType="setup"),Qr.form&&Od().then((()=>{var e;null!==(e=Qr.options)&&void 0!==e&&e.deposit?Pd():Td()})),Qr.summary&&$c(),Qr.i18n({state:Qr}),Qr.hasMounted=!0;((null===(o=Qr.options)||void 0===o?void 0:o.invoiceId)||(null===(i=Qr.data)||void 0===i||null===(i=i.transaction)||void 0===i?void 0:i.invoiceId))&&Qr.data.invoice.isPaid&&(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),document.querySelector('[data-rebilly-instruments="form"]').remove(),Oi(Qr.translate.getTranslation("form.error.invoiceIsPaid"),!1)),null!==(s=l.readyToPay)&&void 0!==s&&s.length||(Qr.loader.stopLoading({id:"rebilly-instruments-form"}),Oi(Qr.translate.getTranslation("form.error.noPaymentMethods")))}catch(e){throw Oi(e),e}Oh({state:Qr})}async function Mh(){var e;await(e=1e3,new Promise((t=>setTimeout(t,e)))),Object.keys(Yr).forEach((e=>{Yr.hasFrame(e)&&(Yr[e].destroy(),Yr[e]=null)})),Ai.removeAll(document),Qr.hasMounted=!1,Qr.summary&&(Qr.summary.textContent=""),Qr.form.textContent="",Yl.cancelAll(),Qr.loader.clearAll()}var Fh=new class{constructor(){this.state=Qr,this.iframes=Yr}async mount(e){await Rh(e)}async destroy(){await Mh()}async update(e){await async function({newOptions:e={}}){if(!Qr.hasMounted)throw Error("Update method cannot be called before mounting instruments");const t=Zr({...Qr.options},e);await Mh(),Rh({form:Qr.form,summary:Qr.summary,...t})}({newOptions:e})}async purchase(e){await jh({payload:e})}async setup(e){await Lh({payload:e})}async show(e,t){await Th({componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.4.3.0"}on(e,t){_h({eventName:e,callback:t})}};return Fh}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/instruments",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "author": "Rebilly",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",