@primer-io/primer-js 1.7.0 → 1.8.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 +44 -0
- package/dist/custom-elements.json +580 -521
- package/dist/jsx/index.d.ts +0 -2
- package/dist/primer-loader.d.ts +232 -54
- package/dist/primer-loader.js +19 -17
- package/dist/web-types.json +1 -2
- package/package.json +1 -1
|
@@ -2,35 +2,6 @@
|
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"readme": "",
|
|
4
4
|
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"kind": "javascript-module",
|
|
7
|
-
"path": "e2e/utils.ts",
|
|
8
|
-
"declarations": [
|
|
9
|
-
{
|
|
10
|
-
"kind": "variable",
|
|
11
|
-
"name": "test",
|
|
12
|
-
"default": "chromaticTest"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"exports": [
|
|
16
|
-
{
|
|
17
|
-
"kind": "js",
|
|
18
|
-
"name": "expect",
|
|
19
|
-
"declaration": {
|
|
20
|
-
"name": "expect",
|
|
21
|
-
"package": "@chromatic-com/playwright"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"kind": "js",
|
|
26
|
-
"name": "test",
|
|
27
|
-
"declaration": {
|
|
28
|
-
"name": "test",
|
|
29
|
-
"module": "e2e/utils.ts"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
5
|
{
|
|
35
6
|
"kind": "javascript-module",
|
|
36
7
|
"path": "dist/primer-loader.js",
|
|
@@ -98,268 +69,268 @@
|
|
|
98
69
|
},
|
|
99
70
|
{
|
|
100
71
|
"kind": "variable",
|
|
101
|
-
"name": "
|
|
102
|
-
"default": "class extends b{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.darkMode=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=()=>{this.open=!1,this.removeEventListener(\"primer:dialog-close\",e)};this.addEventListener(\"primer:dialog-close\",e),this.dialog.startExitAnimation()}connectedCallback(){super.connectedCallback(),this.darkMode&&this.classList.add(\"primer-dark-theme\"),this.open||this.openDialog()}updated(e){super.updated(e),e.has(\"darkMode\")&&(this.darkMode?this.classList.add(\"primer-dark-theme\"):this.classList.remove(\"primer-dark-theme\")),e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return this.open?
|
|
72
|
+
"name": "X",
|
|
73
|
+
"default": "class extends b{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.darkMode=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=()=>{this.open=!1,this.removeEventListener(\"primer:dialog-close\",e)};this.addEventListener(\"primer:dialog-close\",e),this.dialog.startExitAnimation()}connectedCallback(){super.connectedCallback(),this.darkMode&&this.classList.add(\"primer-dark-theme\"),this.open||this.openDialog()}updated(e){super.updated(e),e.has(\"darkMode\")&&(this.darkMode?this.classList.add(\"primer-dark-theme\"):this.classList.remove(\"primer-dark-theme\")),e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return this.open?u`<primer-dialog class=\"${this.darkMode?\"primer-dark-theme\":\"\"}\" .open=${this.open} size=${this.size} .showCloseButton=${this.showCloseButton} @primer:dialog-close=\"${()=>{this.open=!1}}\" ><slot></slot>${this.cta?u`<primer-button @click=${this.cta.onClick} class=\"cta-button\">${this.cta.icon?u`<primer-icon name=\"${this.cta.icon}\" size=\"sm\" color=\"var(--primer-color-background-outlined-default)\" ></primer-icon>`:y} ${this.cta.label}</primer-button>`:y}</primer-dialog>`:y}}"
|
|
103
74
|
},
|
|
104
75
|
{
|
|
105
76
|
"kind": "variable",
|
|
106
|
-
"name": "
|
|
107
|
-
"default": "class extends b{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this.
|
|
77
|
+
"name": "Me",
|
|
78
|
+
"default": "class extends b{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this.jsInitialized=!1;this.hasAssignedContent=!1;this._eventListenerController=null;this._classObserver=null;this.locale=ar(xi());this.onSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=a.length>0,this.requestUpdate()};this.sdkContextController=new vi(this),this.primerEventsController=new tr(this),this.styleProcessingController=new Si(this),this.vaultManagerController=new Nr(this),this.headlessSdkController=new Zi(this)}get primerJS(){return this.headlessSdkController?.primerJSInstance??void 0}connectedCallback(){super.connectedCallback(),this.sdkContextController.setEventsController(this.primerEventsController),this._eventListenerController=new AbortController,document.addEventListener(\"primer:card-submit\",this.handleExternalCardSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:vault-submit\",this.handleExternalVaultSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:show-other-payments-toggle\",this.handleExternalShowOtherPaymentsToggle.bind(this),{signal:this._eventListenerController.signal}),this._classObserver=new MutationObserver(()=>{this.requestUpdate()}),this._classObserver.observe(this,{attributes:!0,attributeFilter:[\"class\"]})}attributeChangedCallback(e,i,a){e===\"custom-styles\"?this.styleProcessingController.processCustomStyles(a):super.attributeChangedCallback(e,i,a)}disconnectedCallback(){this._eventListenerController&&(this._eventListenerController.abort(),this._eventListenerController=null),this._classObserver&&(this._classObserver.disconnect(),this._classObserver=null),super.disconnectedCallback()}willUpdate(e){e.has(\"options\")&&(this.options?.locale&&(Rn(this.options?.locale)?this.locale=ar(this.options?.locale):x.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to system locale\")),wn(this.locale))}updated(){let e=getComputedStyle(this);this.sdkContextController.setComputedStyles(e),this.jsInitialized=!this.sdkContextController.contextProvider.value.sdkState.isLoading}handleExternalCardSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:card-submit\",e.detail)}handleExternalVaultSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:vault-submit\",e.detail)}handleExternalShowOtherPaymentsToggle(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:show-other-payments-toggle\",e.detail)}render(){return u`<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${L(!this.hasAssignedContent,()=>u`<primer-main></primer-main>`)} `}addEventListener(e,i,a){super.addEventListener(e,i,a)}removeEventListener(e,i,a){super.removeEventListener(e,i,a)}}"
|
|
108
79
|
},
|
|
109
80
|
{
|
|
110
81
|
"kind": "function",
|
|
111
|
-
"name": "
|
|
82
|
+
"name": "vd"
|
|
112
83
|
},
|
|
113
84
|
{
|
|
114
85
|
"kind": "function",
|
|
115
|
-
"name": "
|
|
86
|
+
"name": "Sd"
|
|
116
87
|
},
|
|
117
88
|
{
|
|
118
89
|
"kind": "function",
|
|
119
|
-
"name": "
|
|
90
|
+
"name": "oy"
|
|
120
91
|
},
|
|
121
92
|
{
|
|
122
93
|
"kind": "function",
|
|
123
|
-
"name": "
|
|
94
|
+
"name": "sy"
|
|
124
95
|
},
|
|
125
96
|
{
|
|
126
97
|
"kind": "variable",
|
|
127
|
-
"name": "
|
|
128
|
-
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in
|
|
98
|
+
"name": "Ke",
|
|
99
|
+
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in qn)return qn[this.size];let e=parseInt(this.size,10);return isNaN(e)?qn.medium:e}render(){let e=this.getSize(),i=20,a=`0 0 ${i} ${i}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),u`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${a}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"status\" aria-label=\"Loading\" ><path d=\"M4.27827 10.002C4.27827 6.84166 6.84019 4.27973 10.0005 4.27973C10.7676 4.27973 11.3894 3.6579 11.3894 2.89084C11.3894 2.12378 10.7676 1.50195 10.0005 1.50195C5.30607 1.50195 1.50049 5.30753 1.50049 10.002C1.50049 14.6964 5.30607 18.502 10.0005 18.502C14.6949 18.502 18.5005 14.6964 18.5005 10.002C18.5005 9.23489 17.8787 8.61306 17.1116 8.61306C16.3445 8.61306 15.7227 9.23489 15.7227 10.002C15.7227 13.1622 13.1608 15.7242 10.0005 15.7242C6.84019 15.7242 4.27827 13.1622 4.27827 10.002Z\" fill=\"currentColor\" class=\"path\" /></svg></div>`}}"
|
|
129
100
|
},
|
|
130
101
|
{
|
|
131
102
|
"kind": "variable",
|
|
132
|
-
"name": "
|
|
133
|
-
"default": "class extends b{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let
|
|
103
|
+
"name": "Fe",
|
|
104
|
+
"default": "class extends b{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let i=this.findSlottedPrimerInput();i?i.focus():this.dispatchEvent(new CustomEvent(\"wrapper-click\",{bubbles:!0,composed:!0}))}}findSlottedPrimerInput(){if(!this.inputSlot)return null;let e=this.inputSlot.assignedElements({flatten:!0}),i=e.find(a=>a.tagName.toLowerCase()===\"primer-input\");if(i)return i;for(let a of e){let n=a.querySelector(\"primer-input\");if(n)return n}return null}render(){let e={\"input-slot\":!0,\"focus-within\":this.focusWithin};return u`<div class=\"input-wrapper\"><slot name=\"label\"></slot><div class=\"${J(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
|
|
134
105
|
},
|
|
135
106
|
{
|
|
136
107
|
"kind": "variable",
|
|
137
|
-
"name": "
|
|
138
|
-
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.disabled=!1}render(){return
|
|
108
|
+
"name": "tt",
|
|
109
|
+
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.disabled=!1}render(){return u`<label for=${this.for}><slot></slot></label>`}}"
|
|
139
110
|
},
|
|
140
111
|
{
|
|
141
112
|
"kind": "variable",
|
|
142
|
-
"name": "
|
|
143
|
-
"default": "class extends b{constructor(){super(...arguments);this.variant=\"primary\";this.disabled=!1;this.loading=!1;this.buttonType=\"button\";this.selectionState=\"default\";this.selectable=!1;this.flex=!0;this.handleClick=()=>{!this.selectable||this.disabled||this.loading||(this.selectionState=this.selectionState===\"default\"?\"checked\":\"default\",this.dispatchEvent(new CustomEvent(\"selection-change\",{bubbles:!0,composed:!0,detail:{state:this.selectionState}})))}}renderCheckmark(){return!this.selectable||this.selectionState!==\"checked\"||this.loading?y:
|
|
113
|
+
"name": "se",
|
|
114
|
+
"default": "class extends b{constructor(){super(...arguments);this.variant=\"primary\";this.disabled=!1;this.loading=!1;this.buttonType=\"button\";this.selectionState=\"default\";this.selectable=!1;this.flex=!0;this.handleClick=()=>{!this.selectable||this.disabled||this.loading||(this.selectionState=this.selectionState===\"default\"?\"checked\":\"default\",this.dispatchEvent(new CustomEvent(\"selection-change\",{bubbles:!0,composed:!0,detail:{state:this.selectionState}})))}}renderCheckmark(){return!this.selectable||this.selectionState!==\"checked\"||this.loading?y:u`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return y;let e;return this.variant===\"primary\"?e=\"var(--primer-color-background-outlined-default)\":(this.variant===\"secondary\"||this.variant===\"tertiary\")&&(e=\"var(--primer-color-gray-900)\"),u`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return u`<button type=${this.buttonType} ?disabled=${this.disabled||this.loading} @click=${this.handleClick} part=\"button\" aria-checked=${this.selectionState===\"checked\"} aria-busy=${this.loading} aria-label=${this.ariaLabel?this.ariaLabel:y} >${this.renderSpinner()} ${this.flex?u`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:u`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
|
|
144
115
|
},
|
|
145
116
|
{
|
|
146
117
|
"kind": "variable",
|
|
147
|
-
"name": "
|
|
148
|
-
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.active=!0}render(){return
|
|
118
|
+
"name": "rt",
|
|
119
|
+
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.active=!0}render(){return u`<span class=\"error\" role=\"alert\" aria-live=\"polite\" id=\"${this.for||\"\"}\" ><slot></slot></span>`}}"
|
|
149
120
|
},
|
|
150
121
|
{
|
|
151
122
|
"kind": "variable",
|
|
152
|
-
"name": "
|
|
153
|
-
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?
|
|
123
|
+
"name": "Ue",
|
|
124
|
+
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?Wi[this.name]:null;return u`<div style=\"--internal-icon-color: ${this.color}\">${e||u`<slot></slot>`}</div>`}}"
|
|
154
125
|
},
|
|
155
126
|
{
|
|
156
127
|
"kind": "variable",
|
|
157
|
-
"name": "
|
|
158
|
-
"default": "class extends b{constructor(){super(...arguments);this.type=\"complete\"}render(){return this.type===\"complete\"?
|
|
128
|
+
"name": "it",
|
|
129
|
+
"default": "class extends b{constructor(){super(...arguments);this.type=\"complete\"}render(){return this.type===\"complete\"?u`<primer-icon size=\"lg\" name=\"successful-check\" color=\"var(--primer-color-icon-positive)\" ></primer-icon><p>Checkout complete!</p><p class=\"secondary\"> You'll be redirected to the order confirmation page soon. </p>`:u`<primer-icon size=\"lg\" name=\"failure-icon\" color=\"var(--primer-color-icon-negative)\" ></primer-icon><p>Payment failed</p>${this.description?u`<p class=\"secondary\">${this.description}</p>`:u`<p class=\"secondary\">Something went wrong.</p>`} `}}"
|
|
159
130
|
},
|
|
160
131
|
{
|
|
161
132
|
"kind": "variable",
|
|
162
|
-
"name": "
|
|
163
|
-
"default": "class extends b{constructor(){super(...arguments);this.value=\"\";this.placeholder=\"\";this.disabled=!1;this.name=\"\";this.type=\"text\";this.required=!1;this.readonly=!1;this.pattern=\"\";this.min=\"\";this.max=\"\";this.step=\"\";this.autocomplete=\"\";this._id=\"\";this.hasFocus=!1;this.hasError=!1;this.handleInput=e=>{e.stopPropagation();let
|
|
133
|
+
"name": "$",
|
|
134
|
+
"default": "class extends b{constructor(){super(...arguments);this.value=\"\";this.placeholder=\"\";this.disabled=!1;this.name=\"\";this.type=\"text\";this.required=!1;this.readonly=!1;this.pattern=\"\";this.min=\"\";this.max=\"\";this.step=\"\";this.autocomplete=\"\";this._id=\"\";this.hasFocus=!1;this.hasError=!1;this.handleInput=e=>{e.stopPropagation();let i=e.target;this.value=i.value;let a=new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(a)};this.handleChange=e=>{e.stopPropagation();let i=e.target;this.value=i.value;let a=new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(a)};this.handleFocus=()=>{this.hasFocus=!0,this.dispatchEvent(new FocusEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.hasFocus=!1,this.dispatchEvent(new FocusEvent(\"blur\",{bubbles:!0,composed:!0}))};this.handleInvalid=e=>{e.stopPropagation(),this.hasError=!0,this.dispatchEvent(new Event(\"invalid\",{bubbles:!0,composed:!0}))}}get id(){return this._id}set id(e){this._id=e,this.setAttribute(\"id\",e)}focus(e){this.inputElement?.focus(e)}blur(){this.inputElement?.blur()}select(){this.inputElement?.select()}setSelectionRange(e,i,a){this.inputElement?.setSelectionRange(e,i,a)}get validity(){return this.inputElement?.validity||{}}get validationMessage(){return this.inputElement?.validationMessage||\"\"}checkValidity(){return this.inputElement?.checkValidity()||!1}reportValidity(){return this.inputElement?.reportValidity()||!1}render(){let e={input:!0,\"input--focused\":this.hasFocus,\"input--disabled\":this.disabled,\"input--error\":this.hasError,\"input--readonly\":this.readonly},i=Object.entries(e).filter(([,a])=>a).map(([a])=>a).join(\" \");return u`<input part=\"input\" class=${i} .value=${this.value} .type=${this.type} ?disabled=${this.disabled} ?required=${this.required} ?readonly=${this.readonly} placeholder=${this.placeholder} pattern=${this.pattern} minlength=${this.minlength??\"\"} maxlength=${this.maxlength??\"\"} min=${this.min} max=${this.max} step=${this.step} autocomplete=${this.autocomplete} name=${this.name} id=${this.id} @input=${this.handleInput} @change=${this.handleChange} @focus=${this.handleFocus} @blur=${this.handleBlur} @invalid=${this.handleInvalid} />`}addEventListener(e,i,a){super.addEventListener(e,i,a)}removeEventListener(e,i,a){super.removeEventListener(e,i,a)}}"
|
|
164
135
|
},
|
|
165
136
|
{
|
|
166
137
|
"kind": "variable",
|
|
167
138
|
"name": "te",
|
|
168
|
-
"default": "class extends b{constructor(){super(...arguments);this.prefix=\"+351\";this.value=\"\";this.placeholder=\"\";this.inputId=\"primer-pt-phone-number-input\";this.maxLength=15;this.minLength=9;this.disabled=!1;this.hasErrors=!1;this.handleInput=e=>{e.stopPropagation();let
|
|
139
|
+
"default": "class extends b{constructor(){super(...arguments);this.prefix=\"+351\";this.value=\"\";this.placeholder=\"\";this.inputId=\"primer-pt-phone-number-input\";this.maxLength=15;this.minLength=9;this.disabled=!1;this.hasErrors=!1;this.handleInput=e=>{e.stopPropagation();let i=e.target,n=i.value.replace(/\\D/g,\"\").slice(0,this.maxLocalDigits);i.value!==n&&(i.value=n),this.dispatchValueEvent(\"input\",n)};this.handleChange=e=>{e.stopPropagation();let a=e.target.value.replace(/\\D/g,\"\");this.dispatchValueEvent(\"change\",a)};this.handleHostClick=()=>{this.inputEl?.focus()}}get localDigits(){let i=(this.value==null?\"\":String(this.value)).replace(/[^\\d+]/g,\"\");return i.startsWith(this.prefix)?i.slice(this.prefix.length):i.replace(/^\\+/,\"\")}get maxLocalDigits(){return Math.max(this.maxLength-this.prefix.length,0)}updated(e){if(!e.has(\"value\")&&!e.has(\"prefix\"))return;let i=this.inputEl;if(!i)return;let a=this.localDigits;i.value!==a&&(i.value=a)}dispatchValueEvent(e,i){let a=i.length?`${this.prefix}${i}`:\"\";this.dispatchEvent(new CustomEvent(e,{detail:a,bubbles:!0,composed:!0}))}focus(){this.inputEl?.focus()}render(){return u`<div @click=${this.handleHostClick} style=\"display: contents;\"><span class=\"flag\" aria-hidden=\"true\">${cy}</span><span class=\"prefix\">${this.prefix}</span><input id=${this.inputId} type=\"tel\" inputmode=\"numeric\" autocomplete=\"tel-national\" ?disabled=${this.disabled} placeholder=${this.placeholder} @input=${this.handleInput} @change=${this.handleChange} /></div>`}}"
|
|
169
140
|
},
|
|
170
141
|
{
|
|
171
142
|
"kind": "variable",
|
|
172
143
|
"name": "ye",
|
|
173
|
-
"default": "class extends b{constructor(){super(...arguments);this.name=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[];this.handleChange=e=>{let
|
|
144
|
+
"default": "class extends b{constructor(){super(...arguments);this.name=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[];this.handleChange=e=>{let a=e.target.value;this.dispatchEvent(new CustomEvent(\"change\",{detail:a,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:a,bubbles:!0,composed:!0}))};this.handleFocus=()=>{this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))};this.stopNativeEvent=e=>{e.stopPropagation()}}renderSelectOptions(){let e=[];for(let i of this.options)e.push(u`<option value=${i.value} ?selected=${this.value===i.value} >${i.label}</option>`);return e}render(){return u`<select id=${this.id} name=${this.name} ?disabled=${this.disabled} ?required=${!this.value} @change=${this.handleChange} @input=${this.stopNativeEvent} @focus=${this.handleFocus} @blur=${this.handleBlur} aria-invalid=${this.hasError?\"true\":\"false\"} ><option value=\"\" disabled ?selected=${!this.value}>${this.placeholder||\"Select an option\"}</option>${this.renderSelectOptions()}</select>`}}"
|
|
174
145
|
},
|
|
175
146
|
{
|
|
176
147
|
"kind": "variable",
|
|
177
|
-
"name": "
|
|
178
|
-
"default": "class extends b{constructor(){super(...arguments);this.header=\"\";this.expanded=!1;this.expandText=\"Expand\";this.collapseText=\"Collapse\";this.ariaLabel=\"\";this.buttonVariant=\"primary\";this.isExpanded=!1;this.toggleExpanded=()=>{this.isExpanded=!this.isExpanded,this.dispatchExpandedChangedEvent(this.isExpanded)}}connectedCallback(){super.connectedCallback(),this.isExpanded=this.expanded}dispatchExpandedChangedEvent(e){this.dispatchEvent(new CustomEvent(\"expanded-changed\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedChangedEvent(!0))}collapse(){this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedChangedEvent(!1))}render(){let e=this.isExpanded?this.collapseText:this.expandText,
|
|
148
|
+
"name": "le",
|
|
149
|
+
"default": "class extends b{constructor(){super(...arguments);this.header=\"\";this.expanded=!1;this.expandText=\"Expand\";this.collapseText=\"Collapse\";this.ariaLabel=\"\";this.buttonVariant=\"primary\";this.isExpanded=!1;this.toggleExpanded=()=>{this.isExpanded=!this.isExpanded,this.dispatchExpandedChangedEvent(this.isExpanded)}}connectedCallback(){super.connectedCallback(),this.isExpanded=this.expanded}dispatchExpandedChangedEvent(e){this.dispatchEvent(new CustomEvent(\"expanded-changed\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedChangedEvent(!0))}collapse(){this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedChangedEvent(!1))}render(){let e=this.isExpanded?this.collapseText:this.expandText,i=this.ariaLabel||this.header||e,a=this.header||e;return u`<div class=\"collapsable\"><primer-button variant=${this.buttonVariant} buttonType=\"button\" @click=${this.toggleExpanded} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${i} ><span>${a}</span></primer-button><div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" id=\"collapsable-content\" role=\"region\" aria-labelledby=\"collapsable-header\" ><div class=\"collapsable-content\"><slot></slot></div></div></div>`}}"
|
|
179
150
|
},
|
|
180
151
|
{
|
|
181
152
|
"kind": "variable",
|
|
182
|
-
"name": "
|
|
183
|
-
"default": "class extends b{constructor(){super();this.message=\"\";this.visible=!1;this._role=\"alert\";this.showMessage=!1;this.role=\"alert\"}get role(){return this._role}set role(e){this._role=e,this.setAttribute(\"role\",e)}updated(e){e.has(\"visible\")&&this.handleVisibilityChange()}handleVisibilityChange(){this.visible?(this.showMessage=!0,this.setAttribute(\"aria-hidden\",\"false\")):setTimeout(()=>{this.showMessage=!1,this.setAttribute(\"aria-hidden\",\"true\")},200)}render(){if(!this.showMessage&&!this.visible)return y;let e={\"error-message\":!0,hidden:!this.visible};return
|
|
153
|
+
"name": "Ve",
|
|
154
|
+
"default": "class extends b{constructor(){super();this.message=\"\";this.visible=!1;this._role=\"alert\";this.showMessage=!1;this.role=\"alert\"}get role(){return this._role}set role(e){this._role=e,this.setAttribute(\"role\",e)}updated(e){e.has(\"visible\")&&this.handleVisibilityChange()}handleVisibilityChange(){this.visible?(this.showMessage=!0,this.setAttribute(\"aria-hidden\",\"false\")):setTimeout(()=>{this.showMessage=!1,this.setAttribute(\"aria-hidden\",\"true\")},200)}render(){if(!this.showMessage&&!this.visible)return y;let e={\"error-message\":!0,hidden:!this.visible};return u`<div part=\"error-message\" class=${J(e)} aria-live=\"assertive\" aria-atomic=\"true\" ><div part=\"error-icon\" class=\"error-icon\"><primer-icon name=\"failure-icon\" size=\"sm\" color=\"var(--primer-color-icon-negative)\" ></primer-icon></div><div part=\"error-content\" class=\"error-content\">${this.message}</div></div>`}}"
|
|
184
155
|
},
|
|
185
156
|
{
|
|
186
157
|
"kind": "variable",
|
|
187
|
-
"name": "
|
|
188
|
-
"default": "class extends b{constructor(){super(...arguments);this.size=\"flex\";this.showCloseButton=!0;this._animationState=\"entering\";this._isVisible=!1;this._handleCloseClick=()=>{this._startExitAnimation()}}startExitAnimation(){this._startExitAnimation()}connectedCallback(){super.connectedCallback(),document.body.style.overflow=\"hidden\",this._startEnterAnimation()}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow=\"\",this._animationTimeout&&clearTimeout(this._animationTimeout)}_startEnterAnimation(){this._animationState=\"entering\",this._isVisible=!0,requestAnimationFrame(()=>{this._animationTimeout=window.setTimeout(()=>{this._animationState=\"entered\",this.dispatchEvent(new CustomEvent(\"primer:dialog-open\",{bubbles:!0,composed:!0}))},500)})}_startExitAnimation(){this._animationTimeout&&clearTimeout(this._animationTimeout),this._animationState=\"exiting\",this._animationTimeout=window.setTimeout(()=>{this._animationState=\"exited\",this._isVisible=!1,this.dispatchEvent(new CustomEvent(\"primer:dialog-close\",{bubbles:!0,composed:!0}))},500)}render(){return this._isVisible?
|
|
158
|
+
"name": "Re",
|
|
159
|
+
"default": "class extends b{constructor(){super(...arguments);this.size=\"flex\";this.showCloseButton=!0;this._animationState=\"entering\";this._isVisible=!1;this._handleCloseClick=()=>{this._startExitAnimation()}}startExitAnimation(){this._startExitAnimation()}connectedCallback(){super.connectedCallback(),document.body.style.overflow=\"hidden\",this._startEnterAnimation()}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow=\"\",this._animationTimeout&&clearTimeout(this._animationTimeout)}_startEnterAnimation(){this._animationState=\"entering\",this._isVisible=!0,requestAnimationFrame(()=>{this._animationTimeout=window.setTimeout(()=>{this._animationState=\"entered\",this.dispatchEvent(new CustomEvent(\"primer:dialog-open\",{bubbles:!0,composed:!0}))},500)})}_startExitAnimation(){this._animationTimeout&&clearTimeout(this._animationTimeout),this._animationState=\"exiting\",this._animationTimeout=window.setTimeout(()=>{this._animationState=\"exited\",this._isVisible=!1,this.dispatchEvent(new CustomEvent(\"primer:dialog-close\",{bubbles:!0,composed:!0}))},500)}render(){return this._isVisible?u`<div class=${J({backdrop:!0,\"backdrop--entering\":this._animationState===\"entering\",\"backdrop--entered\":this._animationState===\"entered\",\"backdrop--exiting\":this._animationState===\"exiting\"})} @click=${e=>{e.preventDefault()}} ><div class=${J({dialog:!0,[this.size]:!0,\"dialog--entering\":this._animationState===\"entering\",\"dialog--entered\":this._animationState===\"entered\",\"dialog--exiting\":this._animationState===\"exiting\"})} ><div class=\"header\">${this.showCloseButton?u`<primer-button class=\"close\" variant=\"tertiary\" @click=${this._handleCloseClick} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:\"\"}</div><div class=\"content\"><slot></slot></div></div></div>`:u``}}"
|
|
189
160
|
},
|
|
190
161
|
{
|
|
191
162
|
"kind": "variable",
|
|
192
163
|
"name": "fe",
|
|
193
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.categoryLoading=!1;this._setupTask=new
|
|
164
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.categoryLoading=!1;this._setupTask=new H(this,{task:async([e,i])=>{let a=e?.find(n=>n.type===w.KLARNA);return a?.type!==w.KLARNA||!i?V:{method:a}},args:()=>[this.primerContext?.paymentMethods,this.primerContext?.headlessUtils]});this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded||(this.selectedCategory=null,this.categoryLoading=!1,this.klarnaContainer&&(this.klarnaContainer.innerHTML=\"\"))};this.klarnaPaymentInProgress=!1}async startKlarnaPayment(){if(!(!this._setupTask.value||!this.selectedCategory||this.klarnaPaymentInProgress)){this.klarnaPaymentInProgress=!0;try{this._setupTask.value.method.setSelectedCategory(this.selectedCategory),await this._setupTask.value.method.start()}catch{}finally{this.klarnaPaymentInProgress=!1}}}async renderSelectedCategory(){if(!(!this._setupTask.value||!this.selectedCategory||!this.klarnaContainer))try{this.klarnaContainer.innerHTML=\"\",this.categoryLoading=!0,await this._setupTask.value.method.renderCategory({containerId:this.klarnaContainer,paymentMethodCategoryId:this.selectedCategory,onHeightChange:()=>{}})}catch{}finally{this.categoryLoading=!1}}selectCategory(e){this.disabled||(this.selectedCategory=e)}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this._setupTask?.value?.method.getCategories()||[];return e.length>0&&!this.selectedCategory&&this.selectCategory(e[0].identifier),e.length===1?y:u`<div class=\"category-selection\">${e.map(i=>u`<button class=${J({\"category-button\":!0,selected:i.identifier===this.selectedCategory,loading:this.categoryLoading&&i.identifier===this.selectedCategory})} @click=${()=>{this.selectCategory(i.identifier)}} ?disabled=${this.disabled} ><span class=${J({\"category-label\":!0,hidden:this.categoryLoading&&i.identifier===this.selectedCategory})} >${i.name}</span >${this.categoryLoading&&i.identifier===this.selectedCategory?u`<primer-spinner class=\"category-spinner\" size=\"small\" compact ></primer-spinner>`:y}</button>`)}</div>`}renderExpandedContent(){return u` ${this.renderCategorySelection()}<div class=\"klarna-category-container ${!this.categoryLoading&&this.selectedCategory?\"visible\":\"\"}\" ><div id=\"klarna-category-container\" class=\"klarna-category-content\" ></div></div><primer-payment-method-accordion-confirm-button ?disabled=${!this.selectedCategory||this.disabled} ?loading=${yt(this.primerContext?.sdkState)} @confirm=${()=>this.startKlarnaPayment()} ></primer-payment-method-accordion-confirm-button>`}render(){return this._setupTask.render({error:e=>{let i=e instanceof Error?e.message:\"Unknown error in Klarna\";return u`<div class=\"error\"> Error loading Klarna: ${i}</div>`},complete:({method:e})=>e?u`<primer-payment-method-accordion .type=${w.KLARNA} ?disabled=${this.disabled} .expanded=${this.isExpanded} ?suppress-blur-collapse=${this.klarnaPaymentInProgress} @expanded-change=${this.handleExpandedChange} >${this.renderExpandedContent()}</primer-payment-method-accordion>`:y})}}"
|
|
194
165
|
},
|
|
195
166
|
{
|
|
196
167
|
"kind": "variable",
|
|
197
168
|
"name": "xe",
|
|
198
|
-
"default": "class extends b{constructor(){super();this.type=void 0;this.disabled=!1;this.buttonContainerRef=
|
|
169
|
+
"default": "class extends b{constructor(){super();this.type=void 0;this.disabled=!1;this.buttonContainerRef=Yr();this.renderButtonTask=new H(this,{args:()=>[this.paymentMethod],task:async([e])=>{if(!e)return V;await this.updateComplete;let i=this.buttonContainerRef.value;if(!i)throw new j({origin:\"integration\",message:\"Button container not found\",code:bi.CONTAINER_NOT_FOUND});let a=e.type===\"GOOGLE_PAY\"?{shadowRoot:this.shadowRoot}:e.type===\"APPLE_PAY\"?{buttonHeight:Gd(i)}:{buttonHeight:gy(Gd(this))};return await e.render(i,{style:a}),this.disabled&&await e.setDisabled(this.disabled),e}})}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===\"disabled\"&&i!==a){let n=a!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}willUpdate(e){e.has(\"paymentMethod\")&&(this.type=this.paymentMethod?.type)}render(){return u`<div class=\"native-button-container\" ${pr(this.buttonContainerRef)} ></div>`}}"
|
|
199
170
|
},
|
|
200
171
|
{
|
|
201
172
|
"kind": "variable",
|
|
202
173
|
"name": "ve",
|
|
203
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod){this.errorMessage=
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
"kind": "variable",
|
|
207
|
-
"name": "Te",
|
|
208
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.phoneNumber=\"\";this.errorMessage=\"\";this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod){this.errorMessage=E(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",R.error(\"Payment method not available when expanding MB WAY form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.phoneNumber=\"\",this.errorMessage=\"\"};this.handleInput=e=>{this.phoneNumber=e.detail,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\")};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.phoneNumber=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}get isPhoneValid(){return this.phoneNumber.length>=Ed&&this.phoneNumber.length<=Ad&&/^\\+\\d+$/.test(this.phoneNumber)}async submit(){if(this.currentState===\"loading\")return;if(!this.isPhoneValid){this.errorMessage=E(\"telephoneNumberErrorTooShort\",{id:\"telephoneNumberErrorTooShort\"}),this.currentState=\"error\";return}let e=this.paymentMethod;if(!e){this.errorMessage=\"MB WAY payment method not initialized\",this.currentState=\"error\",R.error(\"MB WAY payment method not available\");return}this.currentState=\"loading\",this.errorMessage=\"\";try{e.setPhoneNumber(this.phoneNumber),await e.start(),this.currentState=\"collapsed\",this.phoneNumber=\"\"}catch(a){this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:E(\"tokenizationError\",{id:\"tokenizationError\"})}}renderExpandedInput(){return p`<div class=\"mbway-input-wrapper\"><label class=\"mbway-label\" for=\"primer-mbway-phone\">${E(\"telephoneNumberLabel\",{id:\"telephoneNumberLabel\"})}</label><primer-pt-phone-number-input input-id=\"primer-mbway-phone\" .value=${this.phoneNumber} .placeholder=${E(\"telephoneNumberPlaceholder\",{id:\"telephoneNumberPlaceholder\"})} .maxLength=${Ad} .minLength=${Ed} ?disabled=${this.disabled} ?has-errors=${!!this.errorMessage} @input=${this.handleInput} ></primer-pt-phone-number-input><button class=\"mbway-submit-button\" @click=${()=>void this.submit()} ?disabled=${this.disabled||!this.isPhoneValid} >${E(\"pay\",{id:\"pay\"})}</button></div>`}renderLoading(){let e=E(\"Complete your payment in {appName}\",{id:\"completeYourPaymentInTheApp\"}).replace(\"{appName}\",\"MB WAY\");return p`<div class=\"mbway-loading\"><primer-spinner size=\"medium\"></primer-spinner><div class=\"mbway-loading-message\">${e}</div></div>`}renderError(){return p`<div class=\"mbway-error\"><div class=\"mbway-error-message\" role=\"alert\">${this.errorMessage||E(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"mbway-retry-button\" @click=${this.handleRetry} ?disabled=${this.disabled} >${E(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return y}}render(){return p`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():y}</primer-payment-method-accordion>`}}"
|
|
174
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod){this.errorMessage=M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",x.error(\"Payment method not available when expanding BLIK form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.blikCode=\"\",this.errorMessage=\"\",this.stopPollingTimer()};this.handleInput=e=>{let i=e.target,a=i.value,o=a.replace(/\\D/g,\"\").slice(0,6);a!==o&&(i.value=o),this.blikCode=o,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),o.length===6&&this.submitBlikCode()};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.blikCode=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}startPollingTimer(){this.pollingDuration=0,this.pollingTimer=window.setInterval(()=>{this.pollingDuration+=1},1e3)}stopPollingTimer(){this.pollingTimer!==null&&(window.clearInterval(this.pollingTimer),this.pollingTimer=null),this.pollingDuration=0}async submitBlikCode(){if(this.currentState!==\"loading\"){if(this.blikCode.length!==6){this.errorMessage=M(\"sixDigitCodeErrorTooShort\",{id:\"sixDigitCodeErrorTooShort\"}),this.currentState=\"error\";return}if(!this.paymentMethod){this.errorMessage=\"BLIK payment method not initialized\",this.currentState=\"error\",x.error(\"BLIK payment method not available\");return}this.currentState=\"loading\",this.errorMessage=\"\",this.startPollingTimer();try{this.paymentMethod.setBlikCode(this.blikCode),await this.paymentMethod.start(),this.stopPollingTimer(),this.currentState=\"collapsed\",this.blikCode=\"\"}catch(e){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=e instanceof Error?e.message:M(\"tokenizationError\",{id:\"tokenizationError\"})}}}renderExpandedInput(){return u`<div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${M(\"getCodeFromBankingApp\",{id:\"getCodeFromBankingApp\"})}</label><input id=\"blik-code\" type=\"text\" inputmode=\"numeric\" pattern=\"[0-9]*\" maxlength=\"6\" class=\"blik-input\" .value=\"${this.blikCode}\" @input=\"${this.handleInput}\" ?disabled=\"${this.disabled}\" placeholder=\"000000\" aria-label=\"${M(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div>`}renderLoading(){return u`<div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?u`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:y}</div>`}renderError(){return u`<div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${M(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return y}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():y}</primer-payment-method-accordion>`}}"
|
|
209
175
|
},
|
|
210
176
|
{
|
|
211
177
|
"kind": "variable",
|
|
212
|
-
"name": "
|
|
213
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.
|
|
178
|
+
"name": "Pe",
|
|
179
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.phoneNumber=\"\";this.errorMessage=\"\";this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod){this.errorMessage=M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",x.error(\"Payment method not available when expanding MB WAY form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.phoneNumber=\"\",this.errorMessage=\"\"};this.handleInput=e=>{this.phoneNumber=e.detail,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\")};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.phoneNumber=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}get isPhoneValid(){return this.phoneNumber.length>=Vd&&this.phoneNumber.length<=Hd&&/^\\+\\d+$/.test(this.phoneNumber)}async submit(){if(this.currentState===\"loading\")return;if(!this.isPhoneValid){this.errorMessage=M(\"telephoneNumberErrorTooShort\",{id:\"telephoneNumberErrorTooShort\"}),this.currentState=\"error\";return}let e=this.paymentMethod;if(!e){this.errorMessage=\"MB WAY payment method not initialized\",this.currentState=\"error\",x.error(\"MB WAY payment method not available\");return}this.currentState=\"loading\",this.errorMessage=\"\";try{e.setPhoneNumber(this.phoneNumber),await e.start(),this.currentState=\"collapsed\",this.phoneNumber=\"\"}catch(i){this.currentState=\"error\",this.errorMessage=i instanceof Error?i.message:M(\"tokenizationError\",{id:\"tokenizationError\"})}}renderExpandedInput(){return u`<div class=\"mbway-input-wrapper\"><label class=\"mbway-label\" for=\"primer-mbway-phone\">${M(\"telephoneNumberLabel\",{id:\"telephoneNumberLabel\"})}</label><primer-pt-phone-number-input input-id=\"primer-mbway-phone\" .value=${this.phoneNumber} .placeholder=${M(\"telephoneNumberPlaceholder\",{id:\"telephoneNumberPlaceholder\"})} .maxLength=${Hd} .minLength=${Vd} ?disabled=${this.disabled} ?has-errors=${!!this.errorMessage} @input=${this.handleInput} ></primer-pt-phone-number-input><button class=\"mbway-submit-button\" @click=${()=>void this.submit()} ?disabled=${this.disabled||!this.isPhoneValid} >${M(\"pay\",{id:\"pay\"})}</button></div>`}renderLoading(){let e=M(\"Complete your payment in {appName}\",{id:\"completeYourPaymentInTheApp\"}).replace(\"{appName}\",\"MB WAY\");return u`<div class=\"mbway-loading\"><primer-spinner size=\"medium\"></primer-spinner><div class=\"mbway-loading-message\">${e}</div></div>`}renderError(){return u`<div class=\"mbway-error\"><div class=\"mbway-error-message\" role=\"alert\">${this.errorMessage||M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"mbway-retry-button\" @click=${this.handleRetry} ?disabled=${this.disabled} >${M(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return y}}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():y}</primer-payment-method-accordion>`}}"
|
|
214
180
|
},
|
|
215
181
|
{
|
|
216
182
|
"kind": "variable",
|
|
217
|
-
"name": "
|
|
218
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.
|
|
183
|
+
"name": "Se",
|
|
184
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.isExpanded=!1;this.isLoading=!1;this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded?this.loadQRCode():(this.paymentMethod?.stop(),this.qrCodeUrl=void 0,this.isLoading=!1)}}disconnectedCallback(){super.disconnectedCallback(),this.isExpanded&&this.paymentMethod?.stop()}async loadQRCode(){!this.paymentMethod||this.isLoading||(this.isLoading=!0,this.paymentMethod.setOnQRCodeReceived(e=>{this.qrCodeUrl=e,this.isLoading=!1}),await this.paymentMethod.start())}willUpdate(e){e.has(\"primerContext\")&&this.isLoading&&this.isExpanded&&this.primerContext?.sdkState.paymentFailure&&(this.isLoading=!1,this.isExpanded=!1,this.qrCodeUrl=void 0)}renderQRCode(){return this.isLoading?u`<div class=\"qrcode-loading\"><primer-spinner size=\"medium\"></primer-spinner></div>`:u`<div class=\"qrcode-content\"><div class=\"qrcode-labels\"><h3 class=\"qrcode-title\">${M(\"scanToPay\",{id:\"scanToPay\"})}</h3><p class=\"qrcode-description\">${M(\"uploadScreenshot\",{id:\"uploadScreenshot\"})}</p></div><div class=\"qrcode-image\">${this.qrCodeUrl?u`<img src=${this.qrCodeUrl} alt=${M(\"qrCode\",{id:\"qrCode\"})} />`:y}</div></div>`}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled&&!this.isExpanded} ?loading=${this.isLoading} .expanded=${this.isExpanded} suppress-blur-collapse @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderQRCode():y}</primer-payment-method-accordion>`}}"
|
|
219
185
|
},
|
|
220
186
|
{
|
|
221
187
|
"kind": "variable",
|
|
222
188
|
"name": "He",
|
|
223
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1
|
|
189
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this._setupTask=new H(this,{task:([e,i])=>{if(!e||!i)return V;let a=i.getPaymentMethodConfiguration(e);if(!a)return V;let n=Yd(e)?this.primerContext?.clientOptions?.giftCard:void 0,o=a.displayMetadata.button,s=this._getBackgroundColor(e,o,n?.background),l=this._getTextColor(s);return{backgroundColor:s,textColor:l,name:a.name,alt:n?.logoAlt??a.name,displayName:this._getDisplayName(e,o.text,n?.text),iconUrl:this._getIconUrl(e,o,s,n?.logoSrc),iconPosition:this._getIconPosition(e,o)}},args:()=>[this.type,this.primerContext?.headlessUtils]})}_legacyGetButtonLabel(e){if(!e)return;let i=e?eo(e):\"\";return i===\"payWith\"&&(i=\"pay_with\"),M(i,{id:i})}_getBackgroundColor(e,i,a){switch(e){case w.KLARNA:case w.ADYEN_KLARNA:return i.backgroundColor.light??i.backgroundColor.colored;default:return a??i.backgroundColor.colored??i.backgroundColor.light}}_getIconUrl(e,i,a,n){if(n)return n;switch(e){case w.KLARNA:case w.ADYEN_KLARNA:return Cy;case w.PAY_NL_PAYCONIQ:return a===i.backgroundColor.light?vy:Sy;case w.ADYEN_CASHAPP:return i.iconUrl.dark??i.iconUrl.colored??i.iconUrl.light;default:return e===\"TRIPLE_A\"?by:i.iconUrl.colored??i.iconUrl.light}}_getIconPosition(e,i){switch(e){case w.KLARNA:case w.ADYEN_KLARNA:return\"END\";default:return i.iconPositionRelativeToText||\"START\"}}_getTextColor(e){let i=e.replace(\"#\",\"\");if(i.length<6)return;let a=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);return isNaN(a)||isNaN(n)||isNaN(o)?void 0:(.2126*a+.7152*n+.0722*o)/255>.6?\"#000000\":\"#FFFFFF\"}_getDisplayName(e,i,a){switch(e){case w.KLARNA:return this.primerContext?.clientOptions?.klarna?.buttonOptions?.text??a??this._legacyGetButtonLabel(i)??this._legacyGetButtonLabel(\"Pay with\");case w.ADYEN_KLARNA:return this.primerContext?.clientOptions?.adyenKlarna?.buttonOptions?.text??a??this._legacyGetButtonLabel(i)??this._legacyGetButtonLabel(\"Pay with\");default:return a??this._legacyGetButtonLabel(i)}}_handleClick(){this.disabled||this.dispatchEvent(new Event(\"payment-method-click\",{bubbles:!0,composed:!0}))}render(){return this._setupTask.render({error:()=>y,complete:e=>{this.style.setProperty(\"--payment-method-button-bg-color\",e.backgroundColor),e.textColor&&this.style.setProperty(\"--payment-method-button-text-color\",e.textColor);let i={loading:yt(this.primerContext?.sdkState),\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName};return u`<primer-button @click=\"${()=>this._handleClick()}\" class=${J(i)} title=\"${M(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} ><img src=\"${e.iconUrl}\" alt=\"${e.alt}\" />${L(e.displayName,()=>u`<span class=\"button-text\">${e.displayName}</span>`)}</primer-button>`}})}}"
|
|
224
190
|
},
|
|
225
191
|
{
|
|
226
192
|
"kind": "variable",
|
|
227
|
-
"name": "
|
|
228
|
-
"default": "class extends b{constructor(){super(...arguments);this.
|
|
193
|
+
"name": "$e",
|
|
194
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}_handleClick(){this.disabled||!this.paymentMethod||this.primerContext?.sdkState.isProcessing||(this.primerContext?.setProcessing?.(!0),this.paymentMethod.start())}render(){return u`<primer-payment-method-button .type=${this.paymentMethod?.type} ?disabled=${this.disabled} @payment-method-click=${()=>this._handleClick()} ></primer-payment-method-button>`}}"
|
|
229
195
|
},
|
|
230
196
|
{
|
|
231
197
|
"kind": "variable",
|
|
232
198
|
"name": "Be",
|
|
233
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1
|
|
199
|
+
"default": "class extends b{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.isActive=!1;this.handleClick=()=>{this.disabled||this.primerContext?.paymentMethods?.find(i=>i.type===this.type)?.managerType===\"CARD\"||this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}}updated(){let e=!!this.primerContext?.sdkState?.isProcessing;this.toggleAttribute(\"processing-inactive\",e&&!this.isActive)}render(){if(!this.type)return y;let e=this.primerContext?.paymentMethods.find(a=>a.type===this.type);if(!e)return y;let i;switch(e?.managerType){case\"CARD\":i=u`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":i=u`<primer-native-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-native-payment>`;break;case\"QRCODE\":i=u`<primer-qrcode .paymentMethod=${e} ?disabled=${this.disabled} ></primer-qrcode>`;break;case\"BLIK\":i=u`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`;break;case\"BACKEND_DRIVEN\":i=u`<primer-backend-driven .paymentMethod=${e} ?disabled=${this.disabled} ></primer-backend-driven>`;break;case\"REDIRECT\":i=u`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":i=u`<primer-klarna .paymentMethod=${e} ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ADYEN_KLARNA\":i=u`<primer-adyen-klarna .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-klarna>`;break;case\"MBWAY\":i=u`<primer-adyen-mbway .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-mbway>`;break;default:return y}return u`<div @click=${this.handleClick} @expanded-change=${a=>{this.isActive=a.detail.expanded}} >${i}</div>`}}"
|
|
234
200
|
},
|
|
235
201
|
{
|
|
236
202
|
"kind": "variable",
|
|
237
|
-
"name": "
|
|
238
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}
|
|
203
|
+
"name": "Oe",
|
|
204
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}getFilteredMethods(){if(!this.primerContext?.paymentMethods)return[];let e=[...this.primerContext.paymentMethods];if(this.include){let i=this.include.split(\",\").map(a=>a.trim());e=e.filter(a=>i.includes(a.type))}if(this.exclude){let i=this.exclude.split(\",\").map(a=>a.trim());e=e.filter(a=>!i.includes(a.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?y:u`<div class=\"payment-methods-container\">${e.map(i=>u`<primer-payment-method type=\"${i.type}\" ?disabled=\"${this.disabled||this.primerContext?.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
|
|
239
205
|
},
|
|
240
206
|
{
|
|
241
207
|
"kind": "variable",
|
|
242
|
-
"name": "
|
|
243
|
-
"default": "class extends b{constructor(){super(...arguments);this.
|
|
208
|
+
"name": "ze",
|
|
209
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}_handleClick(){this.disabled||!this.paymentMethod||this.primerContext?.sdkState.isProcessing||(this.primerContext?.setProcessing?.(!0),this.paymentMethod.start())}render(){return u`<primer-payment-method-button .type=${this.paymentMethod?.type} ?disabled=${this.disabled} @payment-method-click=${()=>this._handleClick()} ></primer-payment-method-button>`}}"
|
|
244
210
|
},
|
|
245
211
|
{
|
|
246
212
|
"kind": "variable",
|
|
247
213
|
"name": "ie",
|
|
248
|
-
"default": "class extends b{constructor(){super();this.
|
|
214
|
+
"default": "class extends b{constructor(){super(...arguments);this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new H(this,{task:async([e,i])=>{if(!e||!i)return V;let a=this.extractFieldConfig(e);return await this.initializeCountryOptions(),a},args:()=>[this.primerContext?.configuration??null,this.primerContext?.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let i=e.checkoutModules.find(a=>a.type===\"BILLING_ADDRESS\");if(i?.options){let a=i.options;return Object.keys(ao).reduce((n,o)=>({...n,[o]:a[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=io(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let i=Ln();if(i===\"en\"||i===\"en-GB\"||i.startsWith(\"en-\"))return;if(await Lc(i)){let n=io(i);this.countryOptions=[...n.map(([o,s])=>({value:o,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){ir(this.primerContext?.telemetry,\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.primerContext?.configuration)}get defaultFieldConfig(){return Object.keys(ao).reduce((e,i)=>({...e,[i]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,i){this.formData={...this.formData,[e]:i},this.dirtyFields.add(e),(this.submitted||this.dirtyFields.has(e)&&this.touchedFields.has(e))&&this.validateField(e),this.dispatchEvent(new CustomEvent(\"primer-billing-address-change\",{detail:this.formData,bubbles:!0,composed:!0}))}handleFocus(e){this.focusedField=e}handleBlur(e){this.focusedField=null,this.touchedFields.add(e),this.validateField(e)}validateField(e){let i=this.formData[e],a=this.fieldConfig[e];if(!a){delete this.errors[e];return}if(a&&(!i||i.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:M(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(ao).forEach(e=>{let i=e;this.fieldConfig[i]&&this.validateField(i)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(i=>{this.fieldConfig[i]&&this.touchedFields.add(i)});let e=this.validateForm();return this.requestUpdate(),await this.updateComplete,e}async submitToSDK(){if(this.primerContext?.headlessUtils?.setBillingAddress)try{return await this.primerContext?.headlessUtils.setBillingAddress(this.formData),this.dispatchEvent(new CustomEvent(\"primer-billing-address-submit\",{detail:this.formData,bubbles:!0,composed:!0})),!0}catch{return!1}return!0}shouldShowError(e){let i=!!this.errors[e],a=this.dirtyFields.has(e),n=this.touchedFields.has(e);return i&&(this.submitted||a&&n)}render(){return this._initializationTask.render({pending:()=>y,error:()=>y,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),u`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${M(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${L(this.fieldConfig.countryCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${M(\"Country code\",{id:\"countryCodeLabel\"})}</primer-input-label><primer-select slot=\"input\" id=\"countryCode\" name=\"countryCode\" .value=${this.formData.countryCode||\"\"} .options=${this.countryOptions} .hasError=${this.shouldShowError(\"countryCode\")} placeholder=${M(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${L(this.shouldShowError(\"countryCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>u`<div class=\"billing-address-row\">${L(this.fieldConfig.firstName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${M(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${M(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${L(this.shouldShowError(\"firstName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.lastName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${M(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${M(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${L(this.shouldShowError(\"lastName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${L(this.fieldConfig.addressLine1,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${M(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${M(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${L(this.shouldShowError(\"addressLine1\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.addressLine2,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${M(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${M(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${L(this.shouldShowError(\"addressLine2\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.postalCode||this.fieldConfig.city,()=>u`<div class=\"billing-address-row\">${L(this.fieldConfig.postalCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${M(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${M(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${L(this.shouldShowError(\"postalCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.city,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${M(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${M(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${L(this.shouldShowError(\"city\"),()=>u`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${L(this.fieldConfig.state,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${M(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${M(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${L(this.shouldShowError(\"state\"),()=>u`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),y)})}}"
|
|
249
215
|
},
|
|
250
216
|
{
|
|
251
217
|
"kind": "variable",
|
|
252
|
-
"name": "
|
|
253
|
-
"default": "class extends b{constructor(){super(
|
|
218
|
+
"name": "ae",
|
|
219
|
+
"default": "class extends b{constructor(){super();this.hasSlottedSubmit=!1;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this._isHandlingContextEvent=!1;this._contextVaultSubmitListener=null;this.deleteAssetConfig=null;this.handleSubmitSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasSlottedSubmit=a.length>0};this.handleToggleEditMode=e=>{this.isEditMode=e.detail,this.deletePaymentMethodId=null,this.isEditMode&&this.primerContext?.vaultItem&&this.primerContext?.vaultItem.setSelectedVaultedPaymentMethod(null)};this.handleDeletePaymentMethod=async e=>{if(this.deletePaymentMethodId=e.detail,this.deletePaymentMethodId&&this.primerContext?.vaultManager&&this.primerContext?.headlessUtils){let i=this.primerContext?.vaultManager.vaultedPaymentMethods.find(a=>a.id===this.deletePaymentMethodId);i&&(this.deleteAssetConfig=await Qi(i,this.primerContext?.headlessUtils,this.primerContext?.vaultManager))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.primerContext?.vaultManager?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"});return}try{this.isDeleting=!0,await this.primerContext?.vaultManager.deleteVaultedPaymentMethod(this.deletePaymentMethodId),this.deletePaymentMethodId=null,this.deleteAssetConfig=null}catch(e){this.errorMessage=e instanceof Error?e.message:M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let i=e.detail?.error;this.errorMessage=i instanceof Error?i.message:M(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};this.handleSlotButtonClick=e=>{let a=e.target.closest(\"button, primer-button\");if(!a)return;let n=a;this.isSubmitButton(n)&&(e.preventDefault(),this.submitVaultPayment())};this.handleDirectSubmit=()=>{this.submitVaultPayment()};this.handleContextVaultSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitVaultPayment())}finally{this._isHandlingContextEvent=!1}}};new ur(this,{defaultOptions:{keyframeOptions:{duration:Number(getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-duration\").trim().replace(\"ms\",\"\")),easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim()}}})}getAnimationConfig(){return{keyframeOptions:{duration:this.animationDuration,easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim(),fill:\"both\"}}}isSubmitButton(e){let i=e.tagName.toLowerCase(),a=i===\"button\",n=i===\"primer-button\";return a&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitVaultPayment(){if(this.primerContext?.vaultManager)try{await this.primerContext?.vaultManager.startVaultedPaymentFlow()}catch(e){this.dispatchEvent(new CustomEvent(\"primer-vault-payment-error\",{detail:{error:e},bubbles:!0,composed:!0}))}}getPaymentMethodName(e){if(!this.primerContext?.vaultManager)return\"\";let i=this.primerContext?.vaultManager.vaultedPaymentMethods.find(a=>a.id===e);if(!i)return\"\";try{return oo(i,this.primerContext?.telemetry).description||\"\"}catch{return\"\"}}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextVaultSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextVaultSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this._contextVaultSubmitListener=e=>{this.handleContextVaultSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}renderLoadingOverlay(){return u`<div class=\"loading-overlay\" ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ><primer-spinner size=\"medium\" color=\"var(--primer-color-loader)\" ></primer-spinner></div>`}renderDeleteConfirmation(){if(!this.deletePaymentMethodId||!this.deleteAssetConfig)return y;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return u`<div class=\"delete-confirmation-container\"><primer-button disabled variant=\"secondary\"><primer-payment-method-content .assetConfig=${this.deleteAssetConfig} ></primer-payment-method-content></primer-button><primer-vault-delete-confirmation .isDeleting=${this.isDeleting} .paymentMethodId=${this.deletePaymentMethodId} .paymentMethodName=${e} @confirm-delete=${this.handleConfirmDelete} @cancel-delete=${this.handleCancelDelete} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-delete-confirmation></div>`}renderPaymentMethodItem(e){return this.deletePaymentMethodId===e.id?y:u`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-method-item>`}renderPaymentMethodList(){let e=this.primerContext?.vaultManager?.vaultedPaymentMethods||[],i=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return u`<div class=\"payment-methods-list\">${e.map(a=>this.renderPaymentMethodItem(a))} ${L(i,()=>u`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></slot>${L(!this.hasSlottedSubmit,()=>u`<primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ></primer-vault-payment-submit>`)}</div>`,()=>y)}</div>`}render(){if(!this.primerContext?.vaultManager?.enabled||this.primerContext?.vaultManager?.headless)return y;let e=this.primerContext?.vaultManager.vaultedPaymentMethods.length>0,i=this.primerContext?.vaultManager.isLoading,a=this.primerContext?.vaultManager.isUpdating;return u` ${L(!this.primerContext?.vaultManager?.showEmptyState&&!e,()=>y,()=>u`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${a?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${L(this.errorMessage,()=>u`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>y)}<div class=\"vault-manager-content\">${L(!i&&!e,()=>u`<div class=\"content-container\"><primer-vault-empty-state ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>y)} ${L(!i&&e,()=>u`<div class=\"content-container\">${L(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>y)}</div>${L(a,()=>this.renderLoadingOverlay(),()=>y)}</div></slot>`)} `}}"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"kind": "variable",
|
|
223
|
+
"name": "Ie",
|
|
224
|
+
"default": "class extends b{constructor(){super(...arguments);this.paymentMethod=void 0;this.isEditMode=!1;this._getAssetsTask=new H(this,{task:async([e,i,a])=>await Qi(e,i,a),args:()=>[this.paymentMethod,this.primerContext?.headlessUtils,this.primerContext?.vaultManager]});this.handleClick=()=>{this.isEditMode||!this.primerContext?.vaultManager||!this.paymentMethod||(this.isSelected()?this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(null):this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(this.paymentMethod))};this.handleDeleteClick=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(\"delete-payment-method\",{detail:this.paymentMethod?.id,bubbles:!0,composed:!0}))}}isSelected(){if(!this.primerContext?.vaultManager||!this.paymentMethod)return!1;let e=this.primerContext?.vaultItem?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod.id}render(){return this._getAssetsTask.render({error:()=>y,complete:e=>{let i=this.isSelected()?\"checked\":\"default\",a=!1,n=e?.description;return u`<div class=\"payment-method-wrapper\"><div class=\"payment-method-container\"><primer-button variant=\"secondary\" class=\"payment-method-button ${e.shouldShowCVV?\"with-cvv\":\"\"}\" selectable ?disabled=${this.isEditMode} selectionState=${i} .flex=${a} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${L(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>u`<div class=\"payment-method-row mt-2\"><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\"> Input the card CVV for a secure payment</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>y)}</primer-button>${this.isEditMode?u`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${M(\"delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:y}</div></div>`}})}}"
|
|
254
225
|
},
|
|
255
226
|
{
|
|
256
227
|
"kind": "variable",
|
|
257
228
|
"name": "De",
|
|
258
|
-
"default": "class extends b{constructor(){super(...arguments);this.isEditMode=!1;this.hasPaymentMethods=!1;this.toggleEditMode=()=>{this.dispatchEvent(new CustomEvent(\"toggle-edit-mode\",{detail:!this.isEditMode,bubbles:!0,composed:!0}))}}render(){return
|
|
229
|
+
"default": "class extends b{constructor(){super(...arguments);this.isEditMode=!1;this.hasPaymentMethods=!1;this.toggleEditMode=()=>{this.dispatchEvent(new CustomEvent(\"toggle-edit-mode\",{detail:!this.isEditMode,bubbles:!0,composed:!0}))}}render(){return u`<div class=\"vault-manager-header\"><h3>${M(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?u`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?M(\"confirm\",{id:\"confirm\"}):M(\"editPaymentMethods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?u`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:u`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:y}</div>`}}"
|
|
259
230
|
},
|
|
260
231
|
{
|
|
261
232
|
"kind": "variable",
|
|
262
233
|
"name": "ke",
|
|
263
|
-
"default": "class extends b{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";this.handleConfirmClick=()=>{this.dispatchEvent(new CustomEvent(\"confirm-delete\",{bubbles:!0,composed:!0}))};this.handleCancelClick=()=>{this.dispatchEvent(new CustomEvent(\"cancel-delete\",{bubbles:!0,composed:!0}))}}render(){return
|
|
234
|
+
"default": "class extends b{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";this.handleConfirmClick=()=>{this.dispatchEvent(new CustomEvent(\"confirm-delete\",{bubbles:!0,composed:!0}))};this.handleCancelClick=()=>{this.dispatchEvent(new CustomEvent(\"cancel-delete\",{bubbles:!0,composed:!0}))}}render(){return u`<div class=\"delete-confirmation\"><p class=\"delete-confirmation-text\"> Are you sure you want to delete this payment method? </p><div class=\"delete-actions\"><primer-button variant=\"secondary\" @click=${this.handleCancelClick} ?disabled=${this.isDeleting} >${M(\"cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?M(\"deleting\",{id:\"deleting\"}):M(\"confirmVaultedPaymentMethodDeletion\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
|
|
264
235
|
},
|
|
265
236
|
{
|
|
266
237
|
"kind": "variable",
|
|
267
238
|
"name": "at",
|
|
268
|
-
"default": "class extends b{render(){return
|
|
239
|
+
"default": "class extends b{render(){return u`<div class=\"empty-state\"><p>${M(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
|
|
269
240
|
},
|
|
270
241
|
{
|
|
271
242
|
"kind": "variable",
|
|
272
|
-
"name": "
|
|
273
|
-
"default": "class extends b{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return
|
|
243
|
+
"name": "Ye",
|
|
244
|
+
"default": "class extends b{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return u`<div class=\"error-message\"><div class=\"error-content\"><primer-icon name=\"warning\" size=\"sm\" color=\"var(--primer-color-red-500)\" ></primer-icon><p>${this.errorMessage}</p></div><button @click=${this.handleDismiss} aria-label=${M(\"closeErrorMessage\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
|
|
274
245
|
},
|
|
275
246
|
{
|
|
276
247
|
"kind": "variable",
|
|
277
|
-
"name": "
|
|
278
|
-
"default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.primerContext?.vaultManager?.startVaultedPaymentFlow()}catch(
|
|
248
|
+
"name": "be",
|
|
249
|
+
"default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.primerContext?.vaultManager?.startVaultedPaymentFlow()}catch(i){let a=new CustomEvent(\"primer-vault-payment-error\",{bubbles:!0,composed:!0,detail:{error:i}});this.dispatchEvent(a)}}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:M(\"pay\",{id:\"pay\"})}set buttonText(e){let i=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",i)}get isButtonDisabled(){return!!(this.disabled||!this.primerContext?.vaultItem?.selectedVaultedPaymentMethod||this.primerContext?.vaultManager?.isLoading)}render(){let e=this.primerContext?.clientOptions?.submitButton?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,i=e?` ${e}`:y;return u`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${yt(this.primerContext?.sdkState)} data-submit >${this.buttonText}${i}</primer-button>`}}"
|
|
279
250
|
},
|
|
280
251
|
{
|
|
281
252
|
"kind": "variable",
|
|
282
253
|
"name": "re",
|
|
283
|
-
"default": "class extends b{constructor(){super();this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new
|
|
254
|
+
"default": "class extends b{constructor(){super();this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new H(this,{task:([e,i])=>!e||!i||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||i.createCvvInput===null?V:{network:e.paymentInstrumentData.network,createCvvInput:i.createCvvInput},args:()=>[this.paymentMethod,this.primerContext?.vaultManager]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new H(this,{task:async([e])=>{if(!e)return V;await this.updateComplete;let i=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!i)return;let a=jr(this.primerContext?.computedStyles??null),n=a?{input:{base:a}}:void 0,o={cardNetwork:e.network,container:i,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:M(\"CVV\",{id:\"cardCVV\"})};this.cvvInput=await e.createCvvInput?.(o)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.primerContext?.vaultItem?.setCvvInput(this.cvvInput),this.cvvInput.addListener(\"change\",()=>{this.onCvvInputChange()}),this.cvvInput.addListener(\"blur\",()=>{this.onBlur()}),this.cvvInput.addListener(\"focus\",()=>{this.onFocus()}))},args:()=>[this._setupCVVIframe.value]})}disconnectedCallback(){super.disconnectedCallback(),this.cvvInput&&(this.cvvInput.remove(),this.cvvInput=null,this.cvvError=null,this.primerContext?.vaultItem?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.primerContext?.vaultItem||(this.cvvInputIsDirty=!0,this.cvvError=this.cvvInput.metadata.errorCode||null)}onBlur(){this.cvvInput&&(this.cvvInputIsBlurred=!0,this.cvvError=this.cvvInput.metadata.errorCode||null,this.isFocused=!1)}onFocus(){this.isFocused=!0}render(){return this._setupCVVIframe.render({error:()=>y,complete:()=>u`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.cvvError&&(this.primerContext?.vaultItem?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred)} ><slot name=\"label\" slot=\"label\"><primer-input-label>CVV</primer-input-label></slot><div slot=\"input\" id=\"${this.cvvContainerId}\"></div>${L(this.cvvError&&(this.primerContext?.vaultItem?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>u`<primer-input-error slot=\"error\">${M(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
|
|
284
255
|
},
|
|
285
256
|
{
|
|
286
257
|
"kind": "variable",
|
|
287
|
-
"name": "
|
|
288
|
-
"default": "class extends b{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return y;let e=this.assetConfig.description,
|
|
258
|
+
"name": "je",
|
|
259
|
+
"default": "class extends b{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return y;let e=this.assetConfig.description,i=this.assetConfig.icon,a=L(this.assetConfig.icon,()=>u`<img class=\"payment-method-icon\" src=${i} alt=${e} />`,()=>u`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"paypal\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></span></div></span>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?u`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></div></div><div class=\"payment-method-right-column-text\">${this.assetConfig.email||`\\u2022\\u2022\\u2022\\u2022 ${this.assetConfig.last4}`}</div></div>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType===\"ACH\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.bankName}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.accountType}</span ></div></span>`:this.assetConfig.type===\"card\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.cardholderName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:this.assetConfig.type===\"GOOGLE_PAY\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\">${a}<span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:y}}"
|
|
289
260
|
},
|
|
290
261
|
{
|
|
291
262
|
"kind": "variable",
|
|
292
263
|
"name": "Ce",
|
|
293
|
-
"default": "class extends b{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.cardFormProvider=new gt(this,{context:
|
|
264
|
+
"default": "class extends b{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.cardFormProvider=new gt(this,{context:mr,initialValue:null});this.eventsController=new tr(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new H(this,{task:([e])=>{let i=e?.find(l=>l.type===w.PAYMENT_CARD);if(!i)return V;let{cardNumber:a,cardExpiryDate:n,cardSecurityCode:o,cardholderName:s}=i.iframes;return this.cardFormProvider.setValue({cardholderNameInput:s,cardNumberInput:a,expiryInput:n,cvvInput:o,setCardholderName:l=>{i.setCardholderName(l),this.shouldRequireCardholderName&&i.validate().then(c=>{let h=c?.validationErrors?.find(A=>A.name===ep.cardholderName),g=this.inputControllers.get(\"cardholderName\");g&&g.updateMetaFromValidation({valid:!1,error:h?.message||h?.error||null,errorCode:h?.message||h?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>i.validate(),submit:l=>i.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let p=c.field||c.name,h=c.message||c.error,g=ep[p];if(g){let A=this.inputControllers.get(g);if(A){let _={valid:!1,error:h,errorCode:h};A.updateMetaFromValidation(_)}}})},registerInputController:(l,c)=>{this.inputControllers.set(l,c)},unregisterInputController:l=>{this.inputControllers.delete(l)},onUserInteraction:()=>{this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.primerContext?.paymentMethods]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let a=e.target.closest(\"button, primer-button\");if(!a)return;let n=a;this.isSubmitButton(n)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=a.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"context\")){let a=e.get(\"context\")?.events??null;a?.host&&this._contextCardSubmitListener&&a.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),i=this.inputControllers.get(\"expire\"),a=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=i?.meta?.dirty===!0,s=a?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&o&&s&&l&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_DETAILS_ENTERED\",paymentMethod:\"PAYMENT_CARD\"})}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:card-submit\",this.handleDirectSubmit),this._contextCardSubmitListener=e=>{this.handleContextCardSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:card-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let i=e.tagName.toLowerCase(),a=i===\"button\",n=i===\"primer-button\";return a&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value,i=this.primerContext?.sdkState.isProcessing;if(!e||this.disabled||i)return;this.primerContext?.setProcessing?.(!0),this.formErrorMessage=null,e.setSubmissionState?.(!0);let a=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),n=!0;a&&(n=await a.validateForSubmission());let o=await e.validate?.();if(o?.valid&&n){if(a&&!await a.submitToSDK()){let p=M(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=p,this.primerContext?.setProcessing?.(!1),this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:p}]);return}let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s);let l=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(l)}else{this.primerContext?.setProcessing?.(!1);let s=o?.validationErrors;e.propagateValidationErrors?.(s||[]),this.cardFormProvider.setValue({...e,errors:s}),this.eventsController.dispatchFormSubmitErrors(s)}}render(){return this.setupCardFormTask.status===St.ERROR||this.setupCardFormTask.status===St.INITIAL?y:u`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>L(this.hasAssignedContent,()=>y,()=>u`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${L(this.shouldShowCardholderName,()=>u`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>y)}<primer-billing-address></primer-billing-address></div><primer-card-form-submit></primer-card-form-submit><primer-error-message message=\"${this.formErrorMessage||\"\"}\" ?visible=\"${!!this.formErrorMessage}\" ></primer-error-message>`)})}</form>`}}"
|
|
294
265
|
},
|
|
295
266
|
{
|
|
296
267
|
"kind": "variable",
|
|
297
|
-
"name": "
|
|
298
|
-
"default": "class extends ne{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:
|
|
268
|
+
"name": "nt",
|
|
269
|
+
"default": "class extends ne{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:i}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(i)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===St.ERROR)return y;let e=this.getError();return u`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${L(!this.cardFormContext?.hideLabels,()=>u`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>y)}<div slot=\"input\" class=\"card-number-container\" aria-label=\"${this.ariaLabel}\" ><div id=\"${this.config.containerSelector.substring(1)}\"></div><div class=\"network-selector-container\"><primer-card-network-selector @network-selected=${this.handleNetworkSelected} ></primer-card-network-selector></div></div>${L(e,i=>u`<primer-input-error slot=\"error\">${M(i,{id:i})}</primer-input-error>`,()=>y)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
|
|
299
270
|
},
|
|
300
271
|
{
|
|
301
272
|
"kind": "variable",
|
|
302
|
-
"name": "
|
|
273
|
+
"name": "ot",
|
|
303
274
|
"default": "class extends ne{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
304
275
|
},
|
|
305
276
|
{
|
|
306
277
|
"kind": "variable",
|
|
307
|
-
"name": "
|
|
278
|
+
"name": "st",
|
|
308
279
|
"default": "class extends ne{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
309
280
|
},
|
|
310
281
|
{
|
|
311
282
|
"kind": "variable",
|
|
312
|
-
"name": "
|
|
283
|
+
"name": "lt",
|
|
313
284
|
"default": "class extends ne{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
|
|
314
285
|
},
|
|
315
286
|
{
|
|
316
287
|
"kind": "variable",
|
|
317
|
-
"name": "
|
|
318
|
-
"default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.cardFormContext=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=e=>{if(e.preventDefault(),this.disabled)return;this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_SUBMITTED\",paymentMethod:\"PAYMENT_CARD\"});let
|
|
288
|
+
"name": "de",
|
|
289
|
+
"default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.cardFormContext=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=e=>{if(e.preventDefault(),this.disabled)return;this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_SUBMITTED\",paymentMethod:\"PAYMENT_CARD\"});let i=new CustomEvent(\"primer:card-submit\",{bubbles:!0,composed:!0,detail:{source:\"primer-card-form-submit\"}});this.dispatchEvent(i)}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:M(\"pay\",{id:\"pay\"})}set buttonText(e){let i=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",i)}get submitButtonConfig(){return this.primerContext?.clientOptions?.submitButton??null}get shouldShowBuiltInButton(){return this.submitButtonConfig?.useBuiltInButton??!0}render(){if(!this.shouldShowBuiltInButton)return y;let e=this.submitButtonConfig?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,i=e?` ${e}`:y,a=this.disabled||this.cardFormContext?.disabled||!1;return u`<primer-button type=\"submit\" variant=${this.variant} ?disabled=${a} @click=${this.handleClick} .loading=${yt(this.primerContext?.sdkState)} data-submit >${this.buttonText}${i}</primer-button>`}}"
|
|
319
290
|
},
|
|
320
291
|
{
|
|
321
292
|
"kind": "variable",
|
|
322
|
-
"name": "
|
|
323
|
-
"default": "class extends b{constructor(){super(...arguments);this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=
|
|
293
|
+
"name": "ce",
|
|
294
|
+
"default": "class extends b{constructor(){super(...arguments);this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=Yr();this.dropdownRef=Yr();this.networkOptionRefs=[];this.toggleDropdown=e=>{this.isKeyboardNavigation=!1,e.stopPropagation(),this.getSelectableNetworks().length>1&&(this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))};this.handleClickOutside=e=>{this.isDropdownOpen&&(this.contains(e.target)||(this.isDropdownOpen=!1,this.isKeyboardNavigation=!1))};this.handleMouseMove=()=>{this.isKeyboardNavigation&&(this.isKeyboardNavigation=!1)};this.handleKeyDown=e=>{if(!(!(this.getSelectableNetworks().length>1)||!(this.contains(e.target)||this===e.target||this.isDropdownOpen&&e.target===document.body)))switch(this.isKeyboardNavigation=!0,e.key){case\"ArrowDown\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex+1)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"ArrowUp\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex-1+this.getSelectableNetworks().length)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Enter\":case\" \":this.isDropdownOpen&&this.focusedNetworkIndex>=0?(e.preventDefault(),this.selectNetwork(e,this.getSelectableNetworks()[this.focusedNetworkIndex])):!this.isDropdownOpen&&this.buttonRef.value===document.activeElement&&(e.preventDefault(),this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Escape\":this.isDropdownOpen&&(e.preventDefault(),this.isDropdownOpen=!1,this.buttonRef.value?.focus());break;case\"Tab\":this.isDropdownOpen&&(this.isDropdownOpen=!1);break}};this.handleDocumentKeyDown=e=>{this.isDropdownOpen&&this.handleKeyDown(e)}}getNetworkIconUrl(e){return this.primerContext?.headlessUtils?.getCardNetworkAsset(e.network)?.cardUrl}renderDefaultCardIcon(){return u`<div class=\"network-icon\">${Wi[\"payment-card\"]}</div>`}getSelectableNetworks(){return this.primerContext?.cardNetworks?.selectableCardNetworks||[]}getDetectedNetwork(){return this.selectedCardNetwork??(this.primerContext?.cardNetworks?.detectedCardNetwork||null)}getSelectedNetworkIndex(){let e=this.getDetectedNetwork();if(!e)return 0;let i=this.getSelectableNetworks().findIndex(a=>a.network===e.network);return i>=0?i:0}selectNetwork(e,i){e.stopPropagation(),this.selectedCardNetwork=i,this.isDropdownOpen=!1,this.buttonRef.value?.focus(),this.primerContext?.cardNetworks&&this.dispatchEvent(new CustomEvent(\"network-selected\",{detail:{network:i.network},bubbles:!0,composed:!0}))}focusNetworkOption(){requestAnimationFrame(()=>{this.networkOptionRefs[this.focusedNetworkIndex]&&this.networkOptionRefs[this.focusedNetworkIndex].focus()})}setNetworkOptionRef(e,i){this.networkOptionRefs[i]=e}connectedCallback(){super.connectedCallback(),setTimeout(()=>{document.addEventListener(\"click\",this.handleClickOutside),document.addEventListener(\"mousemove\",this.handleMouseMove),this.addEventListener(\"keydown\",this.handleKeyDown),document.addEventListener(\"keydown\",this.handleDocumentKeyDown)},0)}disconnectedCallback(){document.removeEventListener(\"click\",this.handleClickOutside),document.removeEventListener(\"keydown\",this.handleDocumentKeyDown),document.removeEventListener(\"mousemove\",this.handleMouseMove),this.removeEventListener(\"keydown\",this.handleKeyDown),super.disconnectedCallback()}render(){if(this.primerContext?.cardNetworks?.isLoading)return u`<primer-spinner size=\"small\" compact></primer-spinner>`;let e=this.getSelectableNetworks();if(!this.getDetectedNetwork()&&e.length===0)return this.renderDefaultCardIcon();let i=this.getDetectedNetwork()||(e.length>0?e[0]:null);if(!i)return this.renderDefaultCardIcon();let a=e.length>1;return a&&!Lp(e.map(o=>o.network))?u`<div class=\"network-selector-inline\">${e.map(o=>u`<div class=\"network-icon-container\"><img class=\"network-icon\" src=${this.getNetworkIconUrl(o)??\"\"} alt=${o.displayName} /></div>`)}</div>`:u`<button ${pr(this.buttonRef)} class=\"network-selector ${a?\"\":\"static\"}\" tabindex=${a?\"0\":\"-1\"} @click=${this.toggleDropdown} @keydown=${o=>{(o.key===\" \"||o.key===\"Enter\")&&a&&(o.preventDefault(),this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))}} aria-label=${a?`Selected card network: ${i.displayName}. Click to change.`:`Card network: ${i.displayName}`} aria-expanded=${a?this.isDropdownOpen:y} aria-haspopup=${a?\"true\":y} aria-controls=${a?\"network-dropdown\":y} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(i)} alt=${i.displayName} />${L(a,()=>u`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>y)}</button>${L(this.isDropdownOpen,()=>u`<div ${pr(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((o,s)=>u`<div ${pr(l=>this.setNetworkOptionRef(l,s))} class=\"network-option ${this.isKeyboardNavigation&&s===this.focusedNetworkIndex?\"focused\":\"\"}\" @click=${l=>this.selectNetwork(l,o)} @keydown=${l=>{(l.key===\"Enter\"||l.key===\" \")&&this.selectNetwork(l,o)}} role=\"option\" aria-selected=${o.network===i.network} tabindex=\"${s===this.focusedNetworkIndex?\"0\":\"-1\"}\" ><img class=\"network-option-icon\" src=${this.getNetworkIconUrl(o)} alt=${o.displayName} /><span class=\"network-name\">${o.displayName}</span>${L(o.network===i.network,()=>u`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>y)}</div>`)}</div>`,()=>y)} `}}"
|
|
324
295
|
},
|
|
325
296
|
{
|
|
326
297
|
"kind": "variable",
|
|
327
298
|
"name": "_e",
|
|
328
|
-
"default": "class extends b{constructor(){super(...arguments);this.hasSlottedToggle=!1;this.isExpanded=!1;this._isHandlingContextEvent=!1;this._contextToggleListener=null;this.handleToggleSlotChange=e=>{let
|
|
299
|
+
"default": "class extends b{constructor(){super(...arguments);this.hasSlottedToggle=!1;this.isExpanded=!1;this._isHandlingContextEvent=!1;this._contextToggleListener=null;this.handleToggleSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasSlottedToggle=a.length>0};this.handleSlotButtonClick=e=>{let a=e.target.closest(\"button, primer-button\");if(!a)return;let n=a;this.isToggleButton(n)&&(e.preventDefault(),this.toggleAccordion())};this.handleDirectToggle=e=>{let i=e.detail?.action;i===\"expand\"?this.expand():i===\"collapse\"?this.collapse():this.toggleAccordion()};this.handleContextToggle=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{if(e.target!==this){e.stopPropagation();let i=e.detail?.action;i===\"expand\"?this.expand():i===\"collapse\"?this.collapse():this.toggleAccordion()}}finally{this._isHandlingContextEvent=!1}}}}isToggleButton(e){let i=this.shadowRoot?.querySelector('slot[name=\"show-other-payments-toggle-button\"]');return i?i.assignedElements({flatten:!0}).some(n=>n===e||n.contains(e)):!1}toggleAccordion(){this.hasSlottedToggle?(this.isExpanded=!this.isExpanded,this.dispatchExpandedEvent(this.isExpanded)):this.collapsableElement&&(this.collapsableElement.isExpanded?this.collapsableElement.collapse():this.collapsableElement.expand())}dispatchExpandedEvent(e){this.dispatchEvent(new CustomEvent(\"primer:show-other-payments-toggled\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.hasSlottedToggle?this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedEvent(!0)):this.collapsableElement?.expand()}collapse(){this.hasSlottedToggle?this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedEvent(!1)):this.collapsableElement?.collapse()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.addEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.removeEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}connectedCallback(){super.connectedCallback(),this.isExpanded=this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0,this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this._contextToggleListener=e=>{this.handleContextToggle(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this.cleanupContextEventListeners(),super.disconnectedCallback()}render(){if(this.primerContext?.vaultManager?.isLoading)return y;let e=this.primerContext?.vaultManager?.showEmptyState||this.primerContext?.vaultManager?.vaultedPaymentMethods.length;return!this.primerContext?.vaultManager||!this.primerContext?.vaultManager.enabled||this.primerContext?.vaultManager.headless||!e?u`<slot name=\"other-payments\"></slot>`:u`<div class=\"other-payment-methods-container\"><slot name=\"show-other-payments-toggle-button\" @slotchange=${this.handleToggleSlotChange} ></slot>${L(!this.hasSlottedToggle,()=>u`<primer-collapsable buttonVariant=\"secondary\" .expanded=\"${this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0}\" .header=\"${M(\"navigateToPaymentMethods\",{id:\"navigateToPaymentMethods\"})}\" ><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></primer-collapsable>`,()=>u`<div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" role=\"region\" aria-labelledby=\"custom-toggle-button\" ><div class=\"collapsable-content\"><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></div></div>`)}</div>`}}"
|
|
329
300
|
},
|
|
330
301
|
{
|
|
331
302
|
"kind": "variable",
|
|
332
|
-
"name": "
|
|
333
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.expanded=!1;this.suppressBlurCollapse=!1;this.loading=!1;this._handleDocumentClick=e=>{this.expanded&&(this.suppressBlurCollapse||this.loading||e.composedPath().includes(this)||this._collapseFromOutsideInteraction())};this._handleWindowBlur=()=>{!this.expanded||this.suppressBlurCollapse||this.loading||setTimeout(()=>{document.hasFocus()&&this._collapseFromOutsideInteraction()},100)}}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),window.addEventListener(\"blur\",this._handleWindowBlur)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),window.removeEventListener(\"blur\",this._handleWindowBlur)}_collapseFromOutsideInteraction(){this.expanded&&(this.expanded=!1,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:!1},bubbles:!0,composed:!0})))}_handleButtonClick(){this.disabled||this.loading||(this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}render(){return
|
|
303
|
+
"name": "Ne",
|
|
304
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.expanded=!1;this.suppressBlurCollapse=!1;this.loading=!1;this._handleDocumentClick=e=>{this.expanded&&(this.suppressBlurCollapse||this.loading||e.composedPath().includes(this)||this._collapseFromOutsideInteraction())};this._handleWindowBlur=()=>{!this.expanded||this.suppressBlurCollapse||this.loading||setTimeout(()=>{document.hasFocus()&&this._collapseFromOutsideInteraction()},100)}}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),window.addEventListener(\"blur\",this._handleWindowBlur)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),window.removeEventListener(\"blur\",this._handleWindowBlur)}_collapseFromOutsideInteraction(){this.expanded&&(this.expanded=!1,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:!1},bubbles:!0,composed:!0})))}_handleButtonClick(){this.disabled||this.loading||(this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}render(){return u`<div class=\"container ${this.expanded?\"expanded\":\"\"}\"><primer-payment-method-button .type=${this.type} ?disabled=${this.disabled||this.loading} @payment-method-click=${()=>this._handleButtonClick()} ></primer-payment-method-button><div class=\"expanded-content\"><div class=\"content-wrapper\"><slot></slot></div></div></div>`}}"
|
|
334
305
|
},
|
|
335
306
|
{
|
|
336
307
|
"kind": "variable",
|
|
337
|
-
"name": "
|
|
338
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return
|
|
308
|
+
"name": "dt",
|
|
309
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return u`<button class=${J({loading:this.loading})} ?disabled=${this.disabled||this.loading} @click=${()=>this.dispatchEvent(new Event(\"confirm\",{bubbles:!0,composed:!0}))} >${this.loading?u`<primer-spinner size=\"small\" compact></primer-spinner>`:M(\"confirm\",{id:\"confirm\"})}</button>`}}"
|
|
339
310
|
},
|
|
340
311
|
{
|
|
341
312
|
"kind": "variable",
|
|
342
|
-
"name": "
|
|
343
|
-
"default": "class extends b{render(){return
|
|
313
|
+
"name": "yr",
|
|
314
|
+
"default": "class extends b{render(){return u`<primer-checkout-state type=\"complete\"></primer-checkout-state>`}}"
|
|
344
315
|
},
|
|
345
316
|
{
|
|
346
317
|
"kind": "variable",
|
|
347
318
|
"name": "zt",
|
|
348
|
-
"default": "class extends b{render(){return
|
|
319
|
+
"default": "class extends b{render(){return u`<primer-checkout-state type=\"failure\" description=${this.primerContext?.sdkState?.primerJsError?.message||\"\"} ></primer-checkout-state>`}}"
|
|
349
320
|
},
|
|
350
321
|
{
|
|
351
322
|
"kind": "variable",
|
|
352
|
-
"name": "
|
|
353
|
-
"default": "class extends b{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.primerContext?.sdkState||this.primerContext.sdkState.isProcessing?!1:!!(this.primerContext.sdkState.paymentFailure&&this.showProcessingErrors)}render(){return this.primerContext?.sdkState?
|
|
323
|
+
"name": "ct",
|
|
324
|
+
"default": "class extends b{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.primerContext?.sdkState||this.primerContext.sdkState.isProcessing?!1:!!(this.primerContext.sdkState.paymentFailure&&this.showProcessingErrors)}render(){return this.primerContext?.sdkState?u`<primer-error-message message=\"${M(this.primerContext.sdkState.paymentFailure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:y}}"
|
|
354
325
|
},
|
|
355
326
|
{
|
|
356
327
|
"kind": "variable",
|
|
357
|
-
"name": "
|
|
358
|
-
"default": "class extends b{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let
|
|
328
|
+
"name": "wt",
|
|
329
|
+
"default": "class extends b{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=a.length>0,this.requestUpdate()}}render(){return this.primerContext?.sdkState?.isLoading?y:this.primerContext?.sdkState?.primerJsError?u`<slot name=\"checkout-error\"><primer-checkout-state type=\"failure\" description=${this.primerContext.sdkState.primerJsError.message||\"\"} ></primer-checkout-state></slot>`:this.primerContext?.sdkState?.isSuccessful?u`<slot name=\"checkout-complete\"><primer-checkout-state type=\"complete\"></primer-checkout-state></slot>`:u`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${L(this.hasAssignedContent,()=>y,()=>u`<div class=${J({\"primer-is-processing\":!!this.primerContext?.sdkState?.isProcessing})} ><primer-vault-manager></primer-vault-manager><primer-show-other-payments><div slot=\"other-payments\" class=\"primer-main-list\">${this.primerContext?.paymentMethods.map(e=>u`<primer-payment-method type=${e.type} ?disabled=${this.primerContext?.clientOptions?.disabledPayments===!0} ></primer-payment-method>`)}</div></primer-show-other-payments><primer-error-message-container></primer-error-message-container></div>`)} `}}"
|
|
359
330
|
},
|
|
360
331
|
{
|
|
361
332
|
"kind": "function",
|
|
362
|
-
"name": "
|
|
333
|
+
"name": "gO"
|
|
363
334
|
}
|
|
364
335
|
],
|
|
365
336
|
"exports": [
|
|
@@ -383,7 +354,7 @@
|
|
|
383
354
|
"kind": "js",
|
|
384
355
|
"name": "AdyenMbway",
|
|
385
356
|
"declaration": {
|
|
386
|
-
"name": "
|
|
357
|
+
"name": "Pe",
|
|
387
358
|
"module": "dist/primer-loader.js"
|
|
388
359
|
}
|
|
389
360
|
},
|
|
@@ -391,7 +362,7 @@
|
|
|
391
362
|
"kind": "js",
|
|
392
363
|
"name": "BackendDriven",
|
|
393
364
|
"declaration": {
|
|
394
|
-
"name": "
|
|
365
|
+
"name": "$e",
|
|
395
366
|
"module": "dist/primer-loader.js"
|
|
396
367
|
}
|
|
397
368
|
},
|
|
@@ -399,7 +370,7 @@
|
|
|
399
370
|
"kind": "js",
|
|
400
371
|
"name": "BillingAddress",
|
|
401
372
|
"declaration": {
|
|
402
|
-
"name": "
|
|
373
|
+
"name": "ie",
|
|
403
374
|
"module": "dist/primer-loader.js"
|
|
404
375
|
}
|
|
405
376
|
},
|
|
@@ -415,7 +386,7 @@
|
|
|
415
386
|
"kind": "js",
|
|
416
387
|
"name": "Button",
|
|
417
388
|
"declaration": {
|
|
418
|
-
"name": "
|
|
389
|
+
"name": "se",
|
|
419
390
|
"module": "dist/primer-loader.js"
|
|
420
391
|
}
|
|
421
392
|
},
|
|
@@ -431,7 +402,7 @@
|
|
|
431
402
|
"kind": "js",
|
|
432
403
|
"name": "CardFormCVV",
|
|
433
404
|
"declaration": {
|
|
434
|
-
"name": "
|
|
405
|
+
"name": "ot",
|
|
435
406
|
"module": "dist/primer-loader.js"
|
|
436
407
|
}
|
|
437
408
|
},
|
|
@@ -439,7 +410,7 @@
|
|
|
439
410
|
"kind": "js",
|
|
440
411
|
"name": "CardFormCardNetworkSelector",
|
|
441
412
|
"declaration": {
|
|
442
|
-
"name": "
|
|
413
|
+
"name": "ce",
|
|
443
414
|
"module": "dist/primer-loader.js"
|
|
444
415
|
}
|
|
445
416
|
},
|
|
@@ -447,7 +418,7 @@
|
|
|
447
418
|
"kind": "js",
|
|
448
419
|
"name": "CardFormCardNumber",
|
|
449
420
|
"declaration": {
|
|
450
|
-
"name": "
|
|
421
|
+
"name": "nt",
|
|
451
422
|
"module": "dist/primer-loader.js"
|
|
452
423
|
}
|
|
453
424
|
},
|
|
@@ -455,7 +426,7 @@
|
|
|
455
426
|
"kind": "js",
|
|
456
427
|
"name": "CardFormError",
|
|
457
428
|
"declaration": {
|
|
458
|
-
"name": "
|
|
429
|
+
"name": "rt",
|
|
459
430
|
"module": "dist/primer-loader.js"
|
|
460
431
|
}
|
|
461
432
|
},
|
|
@@ -463,7 +434,7 @@
|
|
|
463
434
|
"kind": "js",
|
|
464
435
|
"name": "CardFormExpiry",
|
|
465
436
|
"declaration": {
|
|
466
|
-
"name": "
|
|
437
|
+
"name": "st",
|
|
467
438
|
"module": "dist/primer-loader.js"
|
|
468
439
|
}
|
|
469
440
|
},
|
|
@@ -471,7 +442,7 @@
|
|
|
471
442
|
"kind": "js",
|
|
472
443
|
"name": "CardFormName",
|
|
473
444
|
"declaration": {
|
|
474
|
-
"name": "
|
|
445
|
+
"name": "lt",
|
|
475
446
|
"module": "dist/primer-loader.js"
|
|
476
447
|
}
|
|
477
448
|
},
|
|
@@ -479,7 +450,7 @@
|
|
|
479
450
|
"kind": "js",
|
|
480
451
|
"name": "CardFormSubmit",
|
|
481
452
|
"declaration": {
|
|
482
|
-
"name": "
|
|
453
|
+
"name": "de",
|
|
483
454
|
"module": "dist/primer-loader.js"
|
|
484
455
|
}
|
|
485
456
|
},
|
|
@@ -487,7 +458,7 @@
|
|
|
487
458
|
"kind": "js",
|
|
488
459
|
"name": "Collapsable",
|
|
489
460
|
"declaration": {
|
|
490
|
-
"name": "
|
|
461
|
+
"name": "le",
|
|
491
462
|
"module": "dist/primer-loader.js"
|
|
492
463
|
}
|
|
493
464
|
},
|
|
@@ -495,7 +466,7 @@
|
|
|
495
466
|
"kind": "js",
|
|
496
467
|
"name": "Dialog",
|
|
497
468
|
"declaration": {
|
|
498
|
-
"name": "
|
|
469
|
+
"name": "Re",
|
|
499
470
|
"module": "dist/primer-loader.js"
|
|
500
471
|
}
|
|
501
472
|
},
|
|
@@ -503,7 +474,7 @@
|
|
|
503
474
|
"kind": "js",
|
|
504
475
|
"name": "ErrorMessage",
|
|
505
476
|
"declaration": {
|
|
506
|
-
"name": "
|
|
477
|
+
"name": "Ve",
|
|
507
478
|
"module": "dist/primer-loader.js"
|
|
508
479
|
}
|
|
509
480
|
},
|
|
@@ -511,7 +482,7 @@
|
|
|
511
482
|
"kind": "js",
|
|
512
483
|
"name": "ErrorMessageContainer",
|
|
513
484
|
"declaration": {
|
|
514
|
-
"name": "
|
|
485
|
+
"name": "ct",
|
|
515
486
|
"module": "dist/primer-loader.js"
|
|
516
487
|
}
|
|
517
488
|
},
|
|
@@ -519,7 +490,7 @@
|
|
|
519
490
|
"kind": "js",
|
|
520
491
|
"name": "Input",
|
|
521
492
|
"declaration": {
|
|
522
|
-
"name": "
|
|
493
|
+
"name": "$",
|
|
523
494
|
"module": "dist/primer-loader.js"
|
|
524
495
|
}
|
|
525
496
|
},
|
|
@@ -527,7 +498,7 @@
|
|
|
527
498
|
"kind": "js",
|
|
528
499
|
"name": "InputLabel",
|
|
529
500
|
"declaration": {
|
|
530
|
-
"name": "
|
|
501
|
+
"name": "tt",
|
|
531
502
|
"module": "dist/primer-loader.js"
|
|
532
503
|
}
|
|
533
504
|
},
|
|
@@ -535,7 +506,7 @@
|
|
|
535
506
|
"kind": "js",
|
|
536
507
|
"name": "InputWrapper",
|
|
537
508
|
"declaration": {
|
|
538
|
-
"name": "
|
|
509
|
+
"name": "Fe",
|
|
539
510
|
"module": "dist/primer-loader.js"
|
|
540
511
|
}
|
|
541
512
|
},
|
|
@@ -551,7 +522,7 @@
|
|
|
551
522
|
"kind": "js",
|
|
552
523
|
"name": "PaymentMethod",
|
|
553
524
|
"declaration": {
|
|
554
|
-
"name": "
|
|
525
|
+
"name": "Be",
|
|
555
526
|
"module": "dist/primer-loader.js"
|
|
556
527
|
}
|
|
557
528
|
},
|
|
@@ -559,7 +530,7 @@
|
|
|
559
530
|
"kind": "js",
|
|
560
531
|
"name": "PaymentMethodAccordion",
|
|
561
532
|
"declaration": {
|
|
562
|
-
"name": "
|
|
533
|
+
"name": "Ne",
|
|
563
534
|
"module": "dist/primer-loader.js"
|
|
564
535
|
}
|
|
565
536
|
},
|
|
@@ -567,7 +538,7 @@
|
|
|
567
538
|
"kind": "js",
|
|
568
539
|
"name": "PaymentMethodAccordionConfirmButton",
|
|
569
540
|
"declaration": {
|
|
570
|
-
"name": "
|
|
541
|
+
"name": "dt",
|
|
571
542
|
"module": "dist/primer-loader.js"
|
|
572
543
|
}
|
|
573
544
|
},
|
|
@@ -575,7 +546,7 @@
|
|
|
575
546
|
"kind": "js",
|
|
576
547
|
"name": "PaymentMethodButton",
|
|
577
548
|
"declaration": {
|
|
578
|
-
"name": "
|
|
549
|
+
"name": "He",
|
|
579
550
|
"module": "dist/primer-loader.js"
|
|
580
551
|
}
|
|
581
552
|
},
|
|
@@ -583,7 +554,7 @@
|
|
|
583
554
|
"kind": "js",
|
|
584
555
|
"name": "PaymentMethodContainer",
|
|
585
556
|
"declaration": {
|
|
586
|
-
"name": "
|
|
557
|
+
"name": "Oe",
|
|
587
558
|
"module": "dist/primer-loader.js"
|
|
588
559
|
}
|
|
589
560
|
},
|
|
@@ -591,7 +562,7 @@
|
|
|
591
562
|
"kind": "js",
|
|
592
563
|
"name": "PaymentMethodContentComponent",
|
|
593
564
|
"declaration": {
|
|
594
|
-
"name": "
|
|
565
|
+
"name": "je",
|
|
595
566
|
"module": "dist/primer-loader.js"
|
|
596
567
|
}
|
|
597
568
|
},
|
|
@@ -599,7 +570,7 @@
|
|
|
599
570
|
"kind": "js",
|
|
600
571
|
"name": "PortalDialog",
|
|
601
572
|
"declaration": {
|
|
602
|
-
"name": "
|
|
573
|
+
"name": "X",
|
|
603
574
|
"module": "dist/primer-loader.js"
|
|
604
575
|
}
|
|
605
576
|
},
|
|
@@ -607,7 +578,7 @@
|
|
|
607
578
|
"kind": "js",
|
|
608
579
|
"name": "PrimerCheckoutComplete",
|
|
609
580
|
"declaration": {
|
|
610
|
-
"name": "
|
|
581
|
+
"name": "yr",
|
|
611
582
|
"module": "dist/primer-loader.js"
|
|
612
583
|
}
|
|
613
584
|
},
|
|
@@ -615,7 +586,7 @@
|
|
|
615
586
|
"kind": "js",
|
|
616
587
|
"name": "PrimerCheckoutComponent",
|
|
617
588
|
"declaration": {
|
|
618
|
-
"name": "
|
|
589
|
+
"name": "Me",
|
|
619
590
|
"module": "dist/primer-loader.js"
|
|
620
591
|
}
|
|
621
592
|
},
|
|
@@ -631,7 +602,7 @@
|
|
|
631
602
|
"kind": "js",
|
|
632
603
|
"name": "PrimerCheckoutState",
|
|
633
604
|
"declaration": {
|
|
634
|
-
"name": "
|
|
605
|
+
"name": "it",
|
|
635
606
|
"module": "dist/primer-loader.js"
|
|
636
607
|
}
|
|
637
608
|
},
|
|
@@ -639,7 +610,7 @@
|
|
|
639
610
|
"kind": "js",
|
|
640
611
|
"name": "PrimerIcon",
|
|
641
612
|
"declaration": {
|
|
642
|
-
"name": "
|
|
613
|
+
"name": "Ue",
|
|
643
614
|
"module": "dist/primer-loader.js"
|
|
644
615
|
}
|
|
645
616
|
},
|
|
@@ -655,7 +626,7 @@
|
|
|
655
626
|
"kind": "js",
|
|
656
627
|
"name": "PrimerMain",
|
|
657
628
|
"declaration": {
|
|
658
|
-
"name": "
|
|
629
|
+
"name": "wt",
|
|
659
630
|
"module": "dist/primer-loader.js"
|
|
660
631
|
}
|
|
661
632
|
},
|
|
@@ -671,7 +642,7 @@
|
|
|
671
642
|
"kind": "js",
|
|
672
643
|
"name": "QRCode",
|
|
673
644
|
"declaration": {
|
|
674
|
-
"name": "
|
|
645
|
+
"name": "Se",
|
|
675
646
|
"module": "dist/primer-loader.js"
|
|
676
647
|
}
|
|
677
648
|
},
|
|
@@ -679,7 +650,7 @@
|
|
|
679
650
|
"kind": "js",
|
|
680
651
|
"name": "RedirectPayment",
|
|
681
652
|
"declaration": {
|
|
682
|
-
"name": "
|
|
653
|
+
"name": "ze",
|
|
683
654
|
"module": "dist/primer-loader.js"
|
|
684
655
|
}
|
|
685
656
|
},
|
|
@@ -703,7 +674,7 @@
|
|
|
703
674
|
"kind": "js",
|
|
704
675
|
"name": "Spinner",
|
|
705
676
|
"declaration": {
|
|
706
|
-
"name": "
|
|
677
|
+
"name": "Ke",
|
|
707
678
|
"module": "dist/primer-loader.js"
|
|
708
679
|
}
|
|
709
680
|
},
|
|
@@ -735,7 +706,7 @@
|
|
|
735
706
|
"kind": "js",
|
|
736
707
|
"name": "VaultErrorMessage",
|
|
737
708
|
"declaration": {
|
|
738
|
-
"name": "
|
|
709
|
+
"name": "Ye",
|
|
739
710
|
"module": "dist/primer-loader.js"
|
|
740
711
|
}
|
|
741
712
|
},
|
|
@@ -743,7 +714,7 @@
|
|
|
743
714
|
"kind": "js",
|
|
744
715
|
"name": "VaultManager",
|
|
745
716
|
"declaration": {
|
|
746
|
-
"name": "
|
|
717
|
+
"name": "ae",
|
|
747
718
|
"module": "dist/primer-loader.js"
|
|
748
719
|
}
|
|
749
720
|
},
|
|
@@ -759,7 +730,7 @@
|
|
|
759
730
|
"kind": "js",
|
|
760
731
|
"name": "VaultPaymentMethodItem",
|
|
761
732
|
"declaration": {
|
|
762
|
-
"name": "
|
|
733
|
+
"name": "Ie",
|
|
763
734
|
"module": "dist/primer-loader.js"
|
|
764
735
|
}
|
|
765
736
|
},
|
|
@@ -767,7 +738,7 @@
|
|
|
767
738
|
"kind": "js",
|
|
768
739
|
"name": "VaultPaymentSubmit",
|
|
769
740
|
"declaration": {
|
|
770
|
-
"name": "
|
|
741
|
+
"name": "be",
|
|
771
742
|
"module": "dist/primer-loader.js"
|
|
772
743
|
}
|
|
773
744
|
},
|
|
@@ -775,7 +746,7 @@
|
|
|
775
746
|
"kind": "js",
|
|
776
747
|
"name": "injectDarkTheme",
|
|
777
748
|
"declaration": {
|
|
778
|
-
"name": "
|
|
749
|
+
"name": "sy",
|
|
779
750
|
"module": "dist/primer-loader.js"
|
|
780
751
|
}
|
|
781
752
|
},
|
|
@@ -783,7 +754,7 @@
|
|
|
783
754
|
"kind": "js",
|
|
784
755
|
"name": "injectLightTheme",
|
|
785
756
|
"declaration": {
|
|
786
|
-
"name": "
|
|
757
|
+
"name": "oy",
|
|
787
758
|
"module": "dist/primer-loader.js"
|
|
788
759
|
}
|
|
789
760
|
},
|
|
@@ -791,7 +762,7 @@
|
|
|
791
762
|
"kind": "js",
|
|
792
763
|
"name": "injectLoaderStyles",
|
|
793
764
|
"declaration": {
|
|
794
|
-
"name": "
|
|
765
|
+
"name": "vd",
|
|
795
766
|
"module": "dist/primer-loader.js"
|
|
796
767
|
}
|
|
797
768
|
},
|
|
@@ -799,7 +770,7 @@
|
|
|
799
770
|
"kind": "js",
|
|
800
771
|
"name": "injectThemeStyles",
|
|
801
772
|
"declaration": {
|
|
802
|
-
"name": "
|
|
773
|
+
"name": "Sd",
|
|
803
774
|
"module": "dist/primer-loader.js"
|
|
804
775
|
}
|
|
805
776
|
},
|
|
@@ -807,12 +778,41 @@
|
|
|
807
778
|
"kind": "js",
|
|
808
779
|
"name": "loadPrimer",
|
|
809
780
|
"declaration": {
|
|
810
|
-
"name": "
|
|
781
|
+
"name": "gO",
|
|
811
782
|
"module": "dist/primer-loader.js"
|
|
812
783
|
}
|
|
813
784
|
}
|
|
814
785
|
]
|
|
815
786
|
},
|
|
787
|
+
{
|
|
788
|
+
"kind": "javascript-module",
|
|
789
|
+
"path": "e2e/utils.ts",
|
|
790
|
+
"declarations": [
|
|
791
|
+
{
|
|
792
|
+
"kind": "variable",
|
|
793
|
+
"name": "test",
|
|
794
|
+
"default": "chromaticTest"
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
"exports": [
|
|
798
|
+
{
|
|
799
|
+
"kind": "js",
|
|
800
|
+
"name": "expect",
|
|
801
|
+
"declaration": {
|
|
802
|
+
"name": "expect",
|
|
803
|
+
"package": "@chromatic-com/playwright"
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"kind": "js",
|
|
808
|
+
"name": "test",
|
|
809
|
+
"declaration": {
|
|
810
|
+
"name": "test",
|
|
811
|
+
"module": "e2e/utils.ts"
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
]
|
|
815
|
+
},
|
|
816
816
|
{
|
|
817
817
|
"kind": "javascript-module",
|
|
818
818
|
"path": "src/consts.ts",
|
|
@@ -994,6 +994,22 @@
|
|
|
994
994
|
"module": "./contexts/context"
|
|
995
995
|
}
|
|
996
996
|
},
|
|
997
|
+
{
|
|
998
|
+
"kind": "js",
|
|
999
|
+
"name": "SdkError",
|
|
1000
|
+
"declaration": {
|
|
1001
|
+
"name": "SdkError",
|
|
1002
|
+
"package": "@primer-io/sdk-core"
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
"kind": "js",
|
|
1007
|
+
"name": "SdkErrorOrigin",
|
|
1008
|
+
"declaration": {
|
|
1009
|
+
"name": "SdkErrorOrigin",
|
|
1010
|
+
"package": "@primer-io/sdk-core"
|
|
1011
|
+
}
|
|
1012
|
+
},
|
|
997
1013
|
{
|
|
998
1014
|
"kind": "js",
|
|
999
1015
|
"name": "PaymentApprovalRequiredData",
|
|
@@ -1053,13 +1069,6 @@
|
|
|
1053
1069
|
"description": "PrimerCheckoutComponent implements the main checkout experience.\nThis component includes a CSS-only loader that displays before the JavaScript\nis fully loaded, ensuring users see a loading indicator immediately.\n\nThe loader can be disabled by:\n1. Adding the 'loader-disabled' attribute to the component\n2. Setting the CSS custom property --primer-loader-disabled: 1",
|
|
1054
1070
|
"name": "PrimerCheckoutComponent",
|
|
1055
1071
|
"members": [
|
|
1056
|
-
{
|
|
1057
|
-
"kind": "field",
|
|
1058
|
-
"name": "jsInitialized",
|
|
1059
|
-
"type": {
|
|
1060
|
-
"text": "boolean"
|
|
1061
|
-
}
|
|
1062
|
-
},
|
|
1063
1072
|
{
|
|
1064
1073
|
"kind": "field",
|
|
1065
1074
|
"name": "primerJS",
|
|
@@ -1105,7 +1114,7 @@
|
|
|
1105
1114
|
},
|
|
1106
1115
|
{
|
|
1107
1116
|
"kind": "field",
|
|
1108
|
-
"name": "
|
|
1117
|
+
"name": "jsInitialized",
|
|
1109
1118
|
"type": {
|
|
1110
1119
|
"text": "boolean"
|
|
1111
1120
|
},
|
|
@@ -1122,15 +1131,6 @@
|
|
|
1122
1131
|
"text": "HTMLSlotElement"
|
|
1123
1132
|
}
|
|
1124
1133
|
},
|
|
1125
|
-
{
|
|
1126
|
-
"kind": "field",
|
|
1127
|
-
"name": "previousLoadingState",
|
|
1128
|
-
"type": {
|
|
1129
|
-
"text": "boolean"
|
|
1130
|
-
},
|
|
1131
|
-
"privacy": "private",
|
|
1132
|
-
"default": "true"
|
|
1133
|
-
},
|
|
1134
1134
|
{
|
|
1135
1135
|
"kind": "field",
|
|
1136
1136
|
"name": "hasAssignedContent",
|
|
@@ -1140,15 +1140,6 @@
|
|
|
1140
1140
|
"privacy": "private",
|
|
1141
1141
|
"default": "false"
|
|
1142
1142
|
},
|
|
1143
|
-
{
|
|
1144
|
-
"kind": "field",
|
|
1145
|
-
"name": "_loadingTimeoutId",
|
|
1146
|
-
"type": {
|
|
1147
|
-
"text": "number | null"
|
|
1148
|
-
},
|
|
1149
|
-
"privacy": "private",
|
|
1150
|
-
"default": "null"
|
|
1151
|
-
},
|
|
1152
1143
|
{
|
|
1153
1144
|
"kind": "field",
|
|
1154
1145
|
"name": "_eventListenerController",
|
|
@@ -1276,17 +1267,6 @@
|
|
|
1276
1267
|
],
|
|
1277
1268
|
"description": "Handle external primer:show-other-payments-toggle events by forwarding them through the events controller\nUses AbortController signal to prevent circular event loops more safely"
|
|
1278
1269
|
},
|
|
1279
|
-
{
|
|
1280
|
-
"kind": "method",
|
|
1281
|
-
"name": "checkLoadingStateChange",
|
|
1282
|
-
"privacy": "private",
|
|
1283
|
-
"return": {
|
|
1284
|
-
"type": {
|
|
1285
|
-
"text": "void"
|
|
1286
|
-
}
|
|
1287
|
-
},
|
|
1288
|
-
"description": "Check if the loading state has changed and update the CSS loader visibility accordingly.\nThis method is called after each update cycle to detect when loading is complete."
|
|
1289
|
-
},
|
|
1290
1270
|
{
|
|
1291
1271
|
"kind": "method",
|
|
1292
1272
|
"name": "addEventListener",
|
|
@@ -1620,7 +1600,7 @@
|
|
|
1620
1600
|
},
|
|
1621
1601
|
"default": "false",
|
|
1622
1602
|
"description": "Whether the component has completed initialization and loading\nThis is used to control the CSS-only loader visibility",
|
|
1623
|
-
"fieldName": "
|
|
1603
|
+
"fieldName": "jsInitialized"
|
|
1624
1604
|
}
|
|
1625
1605
|
],
|
|
1626
1606
|
"superclass": {
|
|
@@ -1686,227 +1666,36 @@
|
|
|
1686
1666
|
},
|
|
1687
1667
|
{
|
|
1688
1668
|
"kind": "javascript-module",
|
|
1689
|
-
"path": "
|
|
1669
|
+
"path": "dist/chunks/ar.BIHRX5RF.js",
|
|
1690
1670
|
"declarations": [
|
|
1691
1671
|
{
|
|
1692
1672
|
"kind": "variable",
|
|
1693
|
-
"name": "
|
|
1694
|
-
"
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1673
|
+
"name": "o",
|
|
1674
|
+
"default": "e"
|
|
1675
|
+
}
|
|
1676
|
+
],
|
|
1677
|
+
"exports": [
|
|
1678
|
+
{
|
|
1679
|
+
"kind": "js",
|
|
1680
|
+
"name": "templates",
|
|
1681
|
+
"declaration": {
|
|
1682
|
+
"name": "o",
|
|
1683
|
+
"module": "dist/chunks/ar.BIHRX5RF.js"
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
]
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
"kind": "javascript-module",
|
|
1690
|
+
"path": "dist/chunks/bg.FGU6YCAF.js",
|
|
1691
|
+
"declarations": [
|
|
1699
1692
|
{
|
|
1700
1693
|
"kind": "variable",
|
|
1701
|
-
"name": "
|
|
1702
|
-
"
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
},
|
|
1707
|
-
{
|
|
1708
|
-
"kind": "function",
|
|
1709
|
-
"name": "mockBinData",
|
|
1710
|
-
"parameters": [
|
|
1711
|
-
{
|
|
1712
|
-
"name": "page",
|
|
1713
|
-
"type": {
|
|
1714
|
-
"text": "Page"
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
]
|
|
1718
|
-
},
|
|
1719
|
-
{
|
|
1720
|
-
"kind": "function",
|
|
1721
|
-
"name": "mockPaymentInstruments",
|
|
1722
|
-
"parameters": [
|
|
1723
|
-
{
|
|
1724
|
-
"name": "page",
|
|
1725
|
-
"type": {
|
|
1726
|
-
"text": "Page"
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
]
|
|
1730
|
-
},
|
|
1731
|
-
{
|
|
1732
|
-
"kind": "function",
|
|
1733
|
-
"name": "mockPayments",
|
|
1734
|
-
"parameters": [
|
|
1735
|
-
{
|
|
1736
|
-
"name": "page",
|
|
1737
|
-
"type": {
|
|
1738
|
-
"text": "Page"
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
]
|
|
1742
|
-
}
|
|
1743
|
-
],
|
|
1744
|
-
"exports": [
|
|
1745
|
-
{
|
|
1746
|
-
"kind": "js",
|
|
1747
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1748
|
-
"declaration": {
|
|
1749
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1750
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1751
|
-
}
|
|
1752
|
-
},
|
|
1753
|
-
{
|
|
1754
|
-
"kind": "js",
|
|
1755
|
-
"name": "CARD_NUMBER",
|
|
1756
|
-
"declaration": {
|
|
1757
|
-
"name": "CARD_NUMBER",
|
|
1758
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1759
|
-
}
|
|
1760
|
-
},
|
|
1761
|
-
{
|
|
1762
|
-
"kind": "js",
|
|
1763
|
-
"name": "mockBinData",
|
|
1764
|
-
"declaration": {
|
|
1765
|
-
"name": "mockBinData",
|
|
1766
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1767
|
-
}
|
|
1768
|
-
},
|
|
1769
|
-
{
|
|
1770
|
-
"kind": "js",
|
|
1771
|
-
"name": "mockPaymentInstruments",
|
|
1772
|
-
"declaration": {
|
|
1773
|
-
"name": "mockPaymentInstruments",
|
|
1774
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1775
|
-
}
|
|
1776
|
-
},
|
|
1777
|
-
{
|
|
1778
|
-
"kind": "js",
|
|
1779
|
-
"name": "mockPayments",
|
|
1780
|
-
"declaration": {
|
|
1781
|
-
"name": "mockPayments",
|
|
1782
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
]
|
|
1786
|
-
},
|
|
1787
|
-
{
|
|
1788
|
-
"kind": "javascript-module",
|
|
1789
|
-
"path": "e2e/mocks/paypal.ts",
|
|
1790
|
-
"declarations": [
|
|
1791
|
-
{
|
|
1792
|
-
"kind": "variable",
|
|
1793
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1794
|
-
"type": {
|
|
1795
|
-
"text": "object"
|
|
1796
|
-
},
|
|
1797
|
-
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
1798
|
-
}
|
|
1799
|
-
],
|
|
1800
|
-
"exports": [
|
|
1801
|
-
{
|
|
1802
|
-
"kind": "js",
|
|
1803
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1804
|
-
"declaration": {
|
|
1805
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1806
|
-
"module": "e2e/mocks/paypal.ts"
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
]
|
|
1810
|
-
},
|
|
1811
|
-
{
|
|
1812
|
-
"kind": "javascript-module",
|
|
1813
|
-
"path": "e2e/mocks/shared.ts",
|
|
1814
|
-
"declarations": [
|
|
1815
|
-
{
|
|
1816
|
-
"kind": "function",
|
|
1817
|
-
"name": "mockConfigurationCall",
|
|
1818
|
-
"parameters": [
|
|
1819
|
-
{
|
|
1820
|
-
"name": "page",
|
|
1821
|
-
"type": {
|
|
1822
|
-
"text": "Page"
|
|
1823
|
-
}
|
|
1824
|
-
},
|
|
1825
|
-
{
|
|
1826
|
-
"name": "config",
|
|
1827
|
-
"type": {
|
|
1828
|
-
"text": "unknown"
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
]
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
"kind": "function",
|
|
1835
|
-
"name": "mockDemoUrl",
|
|
1836
|
-
"parameters": [
|
|
1837
|
-
{
|
|
1838
|
-
"name": "primerCheckoutOptions",
|
|
1839
|
-
"optional": true,
|
|
1840
|
-
"type": {
|
|
1841
|
-
"text": "PrimerCheckoutOptions"
|
|
1842
|
-
}
|
|
1843
|
-
}
|
|
1844
|
-
]
|
|
1845
|
-
}
|
|
1846
|
-
],
|
|
1847
|
-
"exports": [
|
|
1848
|
-
{
|
|
1849
|
-
"kind": "js",
|
|
1850
|
-
"name": "mockConfigurationCall",
|
|
1851
|
-
"declaration": {
|
|
1852
|
-
"name": "mockConfigurationCall",
|
|
1853
|
-
"module": "e2e/mocks/shared.ts"
|
|
1854
|
-
}
|
|
1855
|
-
},
|
|
1856
|
-
{
|
|
1857
|
-
"kind": "js",
|
|
1858
|
-
"name": "mockDemoUrl",
|
|
1859
|
-
"declaration": {
|
|
1860
|
-
"name": "mockDemoUrl",
|
|
1861
|
-
"module": "e2e/mocks/shared.ts"
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
]
|
|
1865
|
-
},
|
|
1866
|
-
{
|
|
1867
|
-
"kind": "javascript-module",
|
|
1868
|
-
"path": "e2e/tests/card-form-billing-address.spec.ts",
|
|
1869
|
-
"declarations": [],
|
|
1870
|
-
"exports": []
|
|
1871
|
-
},
|
|
1872
|
-
{
|
|
1873
|
-
"kind": "javascript-module",
|
|
1874
|
-
"path": "e2e/tests/paypal.spec.ts",
|
|
1875
|
-
"declarations": [],
|
|
1876
|
-
"exports": []
|
|
1877
|
-
},
|
|
1878
|
-
{
|
|
1879
|
-
"kind": "javascript-module",
|
|
1880
|
-
"path": "dist/chunks/ar.BIHRX5RF.js",
|
|
1881
|
-
"declarations": [
|
|
1882
|
-
{
|
|
1883
|
-
"kind": "variable",
|
|
1884
|
-
"name": "o",
|
|
1885
|
-
"default": "e"
|
|
1886
|
-
}
|
|
1887
|
-
],
|
|
1888
|
-
"exports": [
|
|
1889
|
-
{
|
|
1890
|
-
"kind": "js",
|
|
1891
|
-
"name": "templates",
|
|
1892
|
-
"declaration": {
|
|
1893
|
-
"name": "o",
|
|
1894
|
-
"module": "dist/chunks/ar.BIHRX5RF.js"
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
]
|
|
1898
|
-
},
|
|
1899
|
-
{
|
|
1900
|
-
"kind": "javascript-module",
|
|
1901
|
-
"path": "dist/chunks/bg.FGU6YCAF.js",
|
|
1902
|
-
"declarations": [
|
|
1903
|
-
{
|
|
1904
|
-
"kind": "variable",
|
|
1905
|
-
"name": "o",
|
|
1906
|
-
"default": "e"
|
|
1907
|
-
}
|
|
1908
|
-
],
|
|
1909
|
-
"exports": [
|
|
1694
|
+
"name": "o",
|
|
1695
|
+
"default": "e"
|
|
1696
|
+
}
|
|
1697
|
+
],
|
|
1698
|
+
"exports": [
|
|
1910
1699
|
{
|
|
1911
1700
|
"kind": "js",
|
|
1912
1701
|
"name": "templates",
|
|
@@ -2895,118 +2684,309 @@
|
|
|
2895
2684
|
"exports": [
|
|
2896
2685
|
{
|
|
2897
2686
|
"kind": "js",
|
|
2898
|
-
"name": "templates",
|
|
2687
|
+
"name": "templates",
|
|
2688
|
+
"declaration": {
|
|
2689
|
+
"name": "o",
|
|
2690
|
+
"module": "dist/chunks/uk-UA.QYJJIGTW.js"
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
]
|
|
2694
|
+
},
|
|
2695
|
+
{
|
|
2696
|
+
"kind": "javascript-module",
|
|
2697
|
+
"path": "dist/chunks/vi.YGBNA3NJ.js",
|
|
2698
|
+
"declarations": [
|
|
2699
|
+
{
|
|
2700
|
+
"kind": "variable",
|
|
2701
|
+
"name": "a",
|
|
2702
|
+
"default": "n"
|
|
2703
|
+
}
|
|
2704
|
+
],
|
|
2705
|
+
"exports": [
|
|
2706
|
+
{
|
|
2707
|
+
"kind": "js",
|
|
2708
|
+
"name": "templates",
|
|
2709
|
+
"declaration": {
|
|
2710
|
+
"name": "a",
|
|
2711
|
+
"module": "dist/chunks/vi.YGBNA3NJ.js"
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
]
|
|
2715
|
+
},
|
|
2716
|
+
{
|
|
2717
|
+
"kind": "javascript-module",
|
|
2718
|
+
"path": "dist/chunks/zf.LNP32XVM.js",
|
|
2719
|
+
"declarations": [
|
|
2720
|
+
{
|
|
2721
|
+
"kind": "variable",
|
|
2722
|
+
"name": "a",
|
|
2723
|
+
"default": "t"
|
|
2724
|
+
}
|
|
2725
|
+
],
|
|
2726
|
+
"exports": [
|
|
2727
|
+
{
|
|
2728
|
+
"kind": "js",
|
|
2729
|
+
"name": "templates",
|
|
2730
|
+
"declaration": {
|
|
2731
|
+
"name": "a",
|
|
2732
|
+
"module": "dist/chunks/zf.LNP32XVM.js"
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
]
|
|
2736
|
+
},
|
|
2737
|
+
{
|
|
2738
|
+
"kind": "javascript-module",
|
|
2739
|
+
"path": "dist/chunks/zh-CN.SRN7TXMD.js",
|
|
2740
|
+
"declarations": [
|
|
2741
|
+
{
|
|
2742
|
+
"kind": "variable",
|
|
2743
|
+
"name": "o",
|
|
2744
|
+
"default": "e"
|
|
2745
|
+
}
|
|
2746
|
+
],
|
|
2747
|
+
"exports": [
|
|
2748
|
+
{
|
|
2749
|
+
"kind": "js",
|
|
2750
|
+
"name": "templates",
|
|
2751
|
+
"declaration": {
|
|
2752
|
+
"name": "o",
|
|
2753
|
+
"module": "dist/chunks/zh-CN.SRN7TXMD.js"
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
]
|
|
2757
|
+
},
|
|
2758
|
+
{
|
|
2759
|
+
"kind": "javascript-module",
|
|
2760
|
+
"path": "dist/chunks/zh-HK.3JAKYZ5N.js",
|
|
2761
|
+
"declarations": [
|
|
2762
|
+
{
|
|
2763
|
+
"kind": "variable",
|
|
2764
|
+
"name": "o",
|
|
2765
|
+
"default": "e"
|
|
2766
|
+
}
|
|
2767
|
+
],
|
|
2768
|
+
"exports": [
|
|
2769
|
+
{
|
|
2770
|
+
"kind": "js",
|
|
2771
|
+
"name": "templates",
|
|
2772
|
+
"declaration": {
|
|
2773
|
+
"name": "o",
|
|
2774
|
+
"module": "dist/chunks/zh-HK.3JAKYZ5N.js"
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
]
|
|
2778
|
+
},
|
|
2779
|
+
{
|
|
2780
|
+
"kind": "javascript-module",
|
|
2781
|
+
"path": "dist/chunks/zh-TW.WTNQLAHV.js",
|
|
2782
|
+
"declarations": [
|
|
2783
|
+
{
|
|
2784
|
+
"kind": "variable",
|
|
2785
|
+
"name": "o",
|
|
2786
|
+
"default": "e"
|
|
2787
|
+
}
|
|
2788
|
+
],
|
|
2789
|
+
"exports": [
|
|
2790
|
+
{
|
|
2791
|
+
"kind": "js",
|
|
2792
|
+
"name": "templates",
|
|
2793
|
+
"declaration": {
|
|
2794
|
+
"name": "o",
|
|
2795
|
+
"module": "dist/chunks/zh-TW.WTNQLAHV.js"
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
]
|
|
2799
|
+
},
|
|
2800
|
+
{
|
|
2801
|
+
"kind": "javascript-module",
|
|
2802
|
+
"path": "e2e/mocks/billing-address.ts",
|
|
2803
|
+
"declarations": [
|
|
2804
|
+
{
|
|
2805
|
+
"kind": "variable",
|
|
2806
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2807
|
+
"type": {
|
|
2808
|
+
"text": "object"
|
|
2809
|
+
},
|
|
2810
|
+
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [ { type: 'BILLING_ADDRESS', options: { firstName: false, lastName: false, city: true, countryCode: true, postalCode: true, addressLine1: true, addressLine2: true, state: false, }, }, ], clientSession: { clientSessionId: '0ad5b471-5b80-436b-ad03-57850585e3fd', order: { orderId: '12577', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 1050, merchantAmount: 1050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer123', billingAddress: { firstName: 'testt', lastName: 'test', postalCode: '51662', addressLine1: 'aksjlkajl', addressLine2: 'jfjkahk', countryCode: 'PL', city: 'wroclaw', state: 'test', }, shippingAddress: {}, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '75dc7012-785c-443a-80b1-0e1f88fd4fad', env: 'SANDBOX', paymentMethods: [ { id: '42e32c6e-7faa-4f5a-97d0-9c4f7b848ae1', type: 'APPLE_PAY', options: { merchantId: '75dc7012785c443a80b10e1f88fd4fad', merchantName: 'Primer', merchantDomains: [], }, implementationType: 'NATIVE_SDK', name: 'Apple Pay', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
2811
|
+
},
|
|
2812
|
+
{
|
|
2813
|
+
"kind": "variable",
|
|
2814
|
+
"name": "CARD_NUMBER",
|
|
2815
|
+
"type": {
|
|
2816
|
+
"text": "string"
|
|
2817
|
+
},
|
|
2818
|
+
"default": "'4242 4242 4242 4242'"
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
"kind": "function",
|
|
2822
|
+
"name": "mockBinData",
|
|
2823
|
+
"parameters": [
|
|
2824
|
+
{
|
|
2825
|
+
"name": "page",
|
|
2826
|
+
"type": {
|
|
2827
|
+
"text": "Page"
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
]
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
"kind": "function",
|
|
2834
|
+
"name": "mockPaymentInstruments",
|
|
2835
|
+
"parameters": [
|
|
2836
|
+
{
|
|
2837
|
+
"name": "page",
|
|
2838
|
+
"type": {
|
|
2839
|
+
"text": "Page"
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
]
|
|
2843
|
+
},
|
|
2844
|
+
{
|
|
2845
|
+
"kind": "function",
|
|
2846
|
+
"name": "mockPayments",
|
|
2847
|
+
"parameters": [
|
|
2848
|
+
{
|
|
2849
|
+
"name": "page",
|
|
2850
|
+
"type": {
|
|
2851
|
+
"text": "Page"
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
]
|
|
2855
|
+
}
|
|
2856
|
+
],
|
|
2857
|
+
"exports": [
|
|
2858
|
+
{
|
|
2859
|
+
"kind": "js",
|
|
2860
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2861
|
+
"declaration": {
|
|
2862
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2863
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2864
|
+
}
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
"kind": "js",
|
|
2868
|
+
"name": "CARD_NUMBER",
|
|
2869
|
+
"declaration": {
|
|
2870
|
+
"name": "CARD_NUMBER",
|
|
2871
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2872
|
+
}
|
|
2873
|
+
},
|
|
2874
|
+
{
|
|
2875
|
+
"kind": "js",
|
|
2876
|
+
"name": "mockBinData",
|
|
2877
|
+
"declaration": {
|
|
2878
|
+
"name": "mockBinData",
|
|
2879
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2880
|
+
}
|
|
2881
|
+
},
|
|
2882
|
+
{
|
|
2883
|
+
"kind": "js",
|
|
2884
|
+
"name": "mockPaymentInstruments",
|
|
2885
|
+
"declaration": {
|
|
2886
|
+
"name": "mockPaymentInstruments",
|
|
2887
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2888
|
+
}
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
"kind": "js",
|
|
2892
|
+
"name": "mockPayments",
|
|
2899
2893
|
"declaration": {
|
|
2900
|
-
"name": "
|
|
2901
|
-
"module": "
|
|
2894
|
+
"name": "mockPayments",
|
|
2895
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2902
2896
|
}
|
|
2903
2897
|
}
|
|
2904
2898
|
]
|
|
2905
2899
|
},
|
|
2906
2900
|
{
|
|
2907
2901
|
"kind": "javascript-module",
|
|
2908
|
-
"path": "
|
|
2902
|
+
"path": "e2e/mocks/paypal.ts",
|
|
2909
2903
|
"declarations": [
|
|
2910
2904
|
{
|
|
2911
2905
|
"kind": "variable",
|
|
2912
|
-
"name": "
|
|
2913
|
-
"
|
|
2906
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2907
|
+
"type": {
|
|
2908
|
+
"text": "object"
|
|
2909
|
+
},
|
|
2910
|
+
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
2914
2911
|
}
|
|
2915
2912
|
],
|
|
2916
2913
|
"exports": [
|
|
2917
2914
|
{
|
|
2918
2915
|
"kind": "js",
|
|
2919
|
-
"name": "
|
|
2916
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2920
2917
|
"declaration": {
|
|
2921
|
-
"name": "
|
|
2922
|
-
"module": "
|
|
2918
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2919
|
+
"module": "e2e/mocks/paypal.ts"
|
|
2923
2920
|
}
|
|
2924
2921
|
}
|
|
2925
2922
|
]
|
|
2926
2923
|
},
|
|
2927
2924
|
{
|
|
2928
2925
|
"kind": "javascript-module",
|
|
2929
|
-
"path": "
|
|
2926
|
+
"path": "e2e/mocks/shared.ts",
|
|
2930
2927
|
"declarations": [
|
|
2931
2928
|
{
|
|
2932
|
-
"kind": "
|
|
2933
|
-
"name": "
|
|
2934
|
-
"
|
|
2929
|
+
"kind": "function",
|
|
2930
|
+
"name": "mockConfigurationCall",
|
|
2931
|
+
"parameters": [
|
|
2932
|
+
{
|
|
2933
|
+
"name": "page",
|
|
2934
|
+
"type": {
|
|
2935
|
+
"text": "Page"
|
|
2936
|
+
}
|
|
2937
|
+
},
|
|
2938
|
+
{
|
|
2939
|
+
"name": "config",
|
|
2940
|
+
"type": {
|
|
2941
|
+
"text": "unknown"
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
]
|
|
2945
|
+
},
|
|
2946
|
+
{
|
|
2947
|
+
"kind": "function",
|
|
2948
|
+
"name": "mockDemoUrl",
|
|
2949
|
+
"parameters": [
|
|
2950
|
+
{
|
|
2951
|
+
"name": "primerCheckoutOptions",
|
|
2952
|
+
"optional": true,
|
|
2953
|
+
"type": {
|
|
2954
|
+
"text": "PrimerCheckoutOptions"
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
]
|
|
2935
2958
|
}
|
|
2936
2959
|
],
|
|
2937
2960
|
"exports": [
|
|
2938
2961
|
{
|
|
2939
2962
|
"kind": "js",
|
|
2940
|
-
"name": "
|
|
2963
|
+
"name": "mockConfigurationCall",
|
|
2941
2964
|
"declaration": {
|
|
2942
|
-
"name": "
|
|
2943
|
-
"module": "
|
|
2965
|
+
"name": "mockConfigurationCall",
|
|
2966
|
+
"module": "e2e/mocks/shared.ts"
|
|
2944
2967
|
}
|
|
2945
|
-
}
|
|
2946
|
-
]
|
|
2947
|
-
},
|
|
2948
|
-
{
|
|
2949
|
-
"kind": "javascript-module",
|
|
2950
|
-
"path": "dist/chunks/zh-CN.SRN7TXMD.js",
|
|
2951
|
-
"declarations": [
|
|
2952
|
-
{
|
|
2953
|
-
"kind": "variable",
|
|
2954
|
-
"name": "o",
|
|
2955
|
-
"default": "e"
|
|
2956
|
-
}
|
|
2957
|
-
],
|
|
2958
|
-
"exports": [
|
|
2968
|
+
},
|
|
2959
2969
|
{
|
|
2960
2970
|
"kind": "js",
|
|
2961
|
-
"name": "
|
|
2971
|
+
"name": "mockDemoUrl",
|
|
2962
2972
|
"declaration": {
|
|
2963
|
-
"name": "
|
|
2964
|
-
"module": "
|
|
2973
|
+
"name": "mockDemoUrl",
|
|
2974
|
+
"module": "e2e/mocks/shared.ts"
|
|
2965
2975
|
}
|
|
2966
2976
|
}
|
|
2967
2977
|
]
|
|
2968
2978
|
},
|
|
2969
2979
|
{
|
|
2970
2980
|
"kind": "javascript-module",
|
|
2971
|
-
"path": "
|
|
2972
|
-
"declarations": [
|
|
2973
|
-
|
|
2974
|
-
"kind": "variable",
|
|
2975
|
-
"name": "o",
|
|
2976
|
-
"default": "e"
|
|
2977
|
-
}
|
|
2978
|
-
],
|
|
2979
|
-
"exports": [
|
|
2980
|
-
{
|
|
2981
|
-
"kind": "js",
|
|
2982
|
-
"name": "templates",
|
|
2983
|
-
"declaration": {
|
|
2984
|
-
"name": "o",
|
|
2985
|
-
"module": "dist/chunks/zh-HK.3JAKYZ5N.js"
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
]
|
|
2981
|
+
"path": "e2e/tests/card-form-billing-address.spec.ts",
|
|
2982
|
+
"declarations": [],
|
|
2983
|
+
"exports": []
|
|
2989
2984
|
},
|
|
2990
2985
|
{
|
|
2991
2986
|
"kind": "javascript-module",
|
|
2992
|
-
"path": "
|
|
2993
|
-
"declarations": [
|
|
2994
|
-
|
|
2995
|
-
"kind": "variable",
|
|
2996
|
-
"name": "o",
|
|
2997
|
-
"default": "e"
|
|
2998
|
-
}
|
|
2999
|
-
],
|
|
3000
|
-
"exports": [
|
|
3001
|
-
{
|
|
3002
|
-
"kind": "js",
|
|
3003
|
-
"name": "templates",
|
|
3004
|
-
"declaration": {
|
|
3005
|
-
"name": "o",
|
|
3006
|
-
"module": "dist/chunks/zh-TW.WTNQLAHV.js"
|
|
3007
|
-
}
|
|
3008
|
-
}
|
|
3009
|
-
]
|
|
2987
|
+
"path": "e2e/tests/paypal.spec.ts",
|
|
2988
|
+
"declarations": [],
|
|
2989
|
+
"exports": []
|
|
3010
2990
|
},
|
|
3011
2991
|
{
|
|
3012
2992
|
"kind": "javascript-module",
|
|
@@ -3546,24 +3526,6 @@
|
|
|
3546
3526
|
"privacy": "private",
|
|
3547
3527
|
"default": "null"
|
|
3548
3528
|
},
|
|
3549
|
-
{
|
|
3550
|
-
"kind": "field",
|
|
3551
|
-
"name": "loadingTimeout",
|
|
3552
|
-
"type": {
|
|
3553
|
-
"text": "ReturnType<typeof setTimeout> | null"
|
|
3554
|
-
},
|
|
3555
|
-
"privacy": "private",
|
|
3556
|
-
"default": "null"
|
|
3557
|
-
},
|
|
3558
|
-
{
|
|
3559
|
-
"kind": "field",
|
|
3560
|
-
"name": "isDisconnected",
|
|
3561
|
-
"type": {
|
|
3562
|
-
"text": "boolean"
|
|
3563
|
-
},
|
|
3564
|
-
"privacy": "private",
|
|
3565
|
-
"default": "false"
|
|
3566
|
-
},
|
|
3567
3529
|
{
|
|
3568
3530
|
"kind": "field",
|
|
3569
3531
|
"name": "telemetry",
|
|
@@ -3600,26 +3562,6 @@
|
|
|
3600
3562
|
}
|
|
3601
3563
|
}
|
|
3602
3564
|
},
|
|
3603
|
-
{
|
|
3604
|
-
"kind": "method",
|
|
3605
|
-
"name": "setupLoadingTimeout",
|
|
3606
|
-
"privacy": "private",
|
|
3607
|
-
"return": {
|
|
3608
|
-
"type": {
|
|
3609
|
-
"text": "void"
|
|
3610
|
-
}
|
|
3611
|
-
}
|
|
3612
|
-
},
|
|
3613
|
-
{
|
|
3614
|
-
"kind": "method",
|
|
3615
|
-
"name": "clearLoadingTimeout",
|
|
3616
|
-
"privacy": "private",
|
|
3617
|
-
"return": {
|
|
3618
|
-
"type": {
|
|
3619
|
-
"text": "void"
|
|
3620
|
-
}
|
|
3621
|
-
}
|
|
3622
|
-
},
|
|
3623
3565
|
{
|
|
3624
3566
|
"kind": "method",
|
|
3625
3567
|
"name": "cleanupResources",
|
|
@@ -3670,6 +3612,34 @@
|
|
|
3670
3612
|
],
|
|
3671
3613
|
"description": "MANUAL approval flow: on a `:pay` 202, sdk-core invokes this. Keep the SDK\nin the processing state (so the checkout shows its loading UI and stays\nlocked while the merchant approves/aborts), then surface the approval\nrequest to the merchant. State is set BEFORE dispatching so listeners that\nsynchronously read state see `isProcessing: true`."
|
|
3672
3614
|
},
|
|
3615
|
+
{
|
|
3616
|
+
"kind": "method",
|
|
3617
|
+
"name": "handleShippingAddressChange",
|
|
3618
|
+
"privacy": "private",
|
|
3619
|
+
"parameters": [
|
|
3620
|
+
{
|
|
3621
|
+
"name": "[data, handler]",
|
|
3622
|
+
"type": {
|
|
3623
|
+
"text": "Parameters<ShippingAddressChangeCallback>"
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
],
|
|
3627
|
+
"description": "Bridges sdk-core's shipping-address-change callback to the\nprimer:shipping-address-change DOM event, auto-resolving with no\noptions so sdk-core's promise doesn't time out if nothing responds."
|
|
3628
|
+
},
|
|
3629
|
+
{
|
|
3630
|
+
"kind": "method",
|
|
3631
|
+
"name": "handleShippingOptionChange",
|
|
3632
|
+
"privacy": "private",
|
|
3633
|
+
"parameters": [
|
|
3634
|
+
{
|
|
3635
|
+
"name": "[data, handler]",
|
|
3636
|
+
"type": {
|
|
3637
|
+
"text": "Parameters<ShippingOptionChangeCallback>"
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
],
|
|
3641
|
+
"description": "Express Checkout (Apple Pay / Google Pay): sdk-core invokes this when the\nshopper selects one of the shipping options previously supplied via\nonShippingAddressChange. Same bridge/auto-resolve shape as\nhandleShippingAddressChange above."
|
|
3642
|
+
},
|
|
3673
3643
|
{
|
|
3674
3644
|
"kind": "method",
|
|
3675
3645
|
"name": "initializeHeadless"
|
|
@@ -4196,6 +4166,40 @@
|
|
|
4196
4166
|
],
|
|
4197
4167
|
"description": "Dispatch payment approval required event (MANUAL approval flow).\nCalled when `:pay` returns 202 and the attempt awaits merchant approval.\n\nThe detail carries clientSessionId + paymentAttemptId for the merchant's\nbackend to call /approve or /abort, and continueFlow() to resume the SDK."
|
|
4198
4168
|
},
|
|
4169
|
+
{
|
|
4170
|
+
"kind": "method",
|
|
4171
|
+
"name": "dispatchShippingAddressChange",
|
|
4172
|
+
"return": {
|
|
4173
|
+
"type": {
|
|
4174
|
+
"text": ""
|
|
4175
|
+
}
|
|
4176
|
+
},
|
|
4177
|
+
"parameters": [
|
|
4178
|
+
{
|
|
4179
|
+
"name": "detail",
|
|
4180
|
+
"type": {
|
|
4181
|
+
"text": "{\n paymentMethodType: PaymentMethodType;\n shippingAddress: NullableAddress;\n setShippingOptions: (options: ShippingOption[]) => void;\n }"
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
]
|
|
4185
|
+
},
|
|
4186
|
+
{
|
|
4187
|
+
"kind": "method",
|
|
4188
|
+
"name": "dispatchShippingOptionChange",
|
|
4189
|
+
"return": {
|
|
4190
|
+
"type": {
|
|
4191
|
+
"text": ""
|
|
4192
|
+
}
|
|
4193
|
+
},
|
|
4194
|
+
"parameters": [
|
|
4195
|
+
{
|
|
4196
|
+
"name": "detail",
|
|
4197
|
+
"type": {
|
|
4198
|
+
"text": "{\n paymentMethodType: PaymentMethodType;\n selectedShippingOption: ShippingOption;\n continue: () => void;\n }"
|
|
4199
|
+
}
|
|
4200
|
+
}
|
|
4201
|
+
]
|
|
4202
|
+
},
|
|
4199
4203
|
{
|
|
4200
4204
|
"kind": "method",
|
|
4201
4205
|
"name": "dispatchVaultMethodsUpdate",
|
|
@@ -4552,6 +4556,53 @@
|
|
|
4552
4556
|
}
|
|
4553
4557
|
],
|
|
4554
4558
|
"description": "Sets the cardholder name value in the card payment form.\n\n⚠️ Must be called after card hosted inputs have been rendered.\nCalling too early will log a warning and fail gracefully."
|
|
4559
|
+
},
|
|
4560
|
+
{
|
|
4561
|
+
"kind": "method",
|
|
4562
|
+
"name": "resumeAppSwitch",
|
|
4563
|
+
"return": {
|
|
4564
|
+
"type": {
|
|
4565
|
+
"text": "Promise<void>"
|
|
4566
|
+
}
|
|
4567
|
+
},
|
|
4568
|
+
"parameters": [
|
|
4569
|
+
{
|
|
4570
|
+
"name": "orderId",
|
|
4571
|
+
"type": {
|
|
4572
|
+
"text": "string"
|
|
4573
|
+
}
|
|
4574
|
+
}
|
|
4575
|
+
],
|
|
4576
|
+
"description": "PayPal host-app App Switch: finishes the payment after the buyer returns\nfrom the PayPal app, with the `orderId` the host app read from the return\ndeep link's `token` param. The outcome arrives through the usual\nonCheckoutComplete/onCheckoutFail callbacks.\n\nDoes not need the PayPal button to have rendered."
|
|
4577
|
+
},
|
|
4578
|
+
{
|
|
4579
|
+
"kind": "method",
|
|
4580
|
+
"name": "cancelAppSwitch",
|
|
4581
|
+
"return": {
|
|
4582
|
+
"type": {
|
|
4583
|
+
"text": "Promise<void>"
|
|
4584
|
+
}
|
|
4585
|
+
},
|
|
4586
|
+
"description": "PayPal host-app App Switch: cancels when the buyer returns without approving."
|
|
4587
|
+
},
|
|
4588
|
+
{
|
|
4589
|
+
"kind": "method",
|
|
4590
|
+
"name": "findPayPalMethod",
|
|
4591
|
+
"privacy": "private",
|
|
4592
|
+
"return": {
|
|
4593
|
+
"type": {
|
|
4594
|
+
"text": "PayPalPaymentMethod | undefined"
|
|
4595
|
+
}
|
|
4596
|
+
},
|
|
4597
|
+
"parameters": [
|
|
4598
|
+
{
|
|
4599
|
+
"name": "caller",
|
|
4600
|
+
"type": {
|
|
4601
|
+
"text": "string"
|
|
4602
|
+
}
|
|
4603
|
+
}
|
|
4604
|
+
],
|
|
4605
|
+
"description": "Warns rather than throwing when PayPal is absent: the host app calls these\non a deep-link return, where whether PayPal is in the session is not its\nbusiness."
|
|
4555
4606
|
}
|
|
4556
4607
|
]
|
|
4557
4608
|
}
|
|
@@ -5070,7 +5121,7 @@
|
|
|
5070
5121
|
{
|
|
5071
5122
|
"kind": "variable",
|
|
5072
5123
|
"name": "cssLoaderStyles",
|
|
5073
|
-
"default": "` @keyframes primer-css-spinner-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Hide primer-main
|
|
5124
|
+
"default": "` @keyframes primer-css-spinner-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Hide primer-main while it is loading to prevent FOUC. Only check for undefined primer-* elements, ignoring browser extensions. Slotted light-DOM content (including custom checkout-error content) is already hidden pre-init by the [slot=\"main\"] rule below. */ primer-main:not(:defined) { visibility: hidden; } primer-checkout:not([js-initialized]) [slot=\"main\"] { display: none; } primer-checkout:not([js-initialized]) { display: block; position: relative; width: 100%; min-height: 64px; } primer-checkout:not([js-initialized]):not([loader-disabled])::after { content: \"\"; display: block; box-sizing: border-box; position: absolute; inset: 0; margin: auto; width: var(--primer-size-xlarge); height: var(--primer-size-xlarge); border-radius: 50%; border: 3px solid #f5f5f5; border-top-color: var(--primer-color-loader); animation: primer-css-spinner-rotate 1.2s linear infinite; z-index: 9999; } `",
|
|
5074
5125
|
"description": "This module exports the CSS loader styles as a string for inline injection.\nThese styles are injected into the page before any JavaScript loads,\nensuring the loading indicator appears immediately."
|
|
5075
5126
|
}
|
|
5076
5127
|
],
|
|
@@ -5404,6 +5455,14 @@
|
|
|
5404
5455
|
"package": "@primer-io/sdk-core"
|
|
5405
5456
|
}
|
|
5406
5457
|
},
|
|
5458
|
+
{
|
|
5459
|
+
"kind": "js",
|
|
5460
|
+
"name": "ShippingOption",
|
|
5461
|
+
"declaration": {
|
|
5462
|
+
"name": "ShippingOption",
|
|
5463
|
+
"package": "@primer-io/sdk-core"
|
|
5464
|
+
}
|
|
5465
|
+
},
|
|
5407
5466
|
{
|
|
5408
5467
|
"kind": "js",
|
|
5409
5468
|
"name": "Validation",
|