@ikas/storefront 4.0.29 → 4.1.0-beta.1
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/build/components/checkout/components/stripe/checkout-form.js +1 -1
- package/build/components/checkout/components/stripe/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/package.json +17 -15
- package/build/_virtual/_commonjsHelpers.js +0 -1
- package/build/_virtual/react-stripe.umd.js +0 -1
- package/build/ext/@stripe/react-stripe-js/dist/react-stripe.umd.js +0 -1
- package/build/ext/@stripe/stripe-js/dist/stripe.esm.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import{useStripe as o,useElements as a,PaymentElement as i}from"@stripe/react-stripe-js";import m from"./style.module.scss.js";var s=n((function(n){var s=n.callbackUrl,l=n.vm,c=o(),u=a(),d=r.useState(!0),f=d[0],p=d[1];return r.createElement(r.Fragment,null,r.createElement("form",{className:m.Form,id:"stripe-form",onSubmit:function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return r.preventDefault(),c&&u&&s?(p(!0),[4,c.confirmPayment({elements:u,confirmParams:{return_url:s}})]):[2];case 1:return e.sent().error&&(l.isStepLoading=!1,p(!1)),[2]}}))}))}},r.createElement(i,{onReady:function(){return p(!1)}}),r.createElement("button",{id:"stripe-form-btn",hidden:!0,disabled:!c}),f&&r.createElement("div",{className:m.Disabled},r.createElement("div",{className:m.loader}))))}));export{s as CheckoutForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as o,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as e from"react";import{observer as t}from"mobx-react-lite";import
|
|
1
|
+
import{__awaiter as o,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as e from"react";import{observer as t}from"mobx-react-lite";import{Elements as i}from"@stripe/react-stripe-js";import{loadStripe as n}from"@stripe/stripe-js";import{CheckoutForm as s}from"./checkout-form.js";var l=t((function(t){var l,a,p,c,u,d,m,v,b,f=t.vm;if(!f.stripeResponse)return null;var x=e.useState(null),E=x[0],z=x[1];e.useEffect((function(){!function(){o(this,void 0,void 0,(function(){var o;return r(this,(function(r){switch(r.label){case 0:return f.stripeResponse?[4,n(f.stripeResponse.apiKey,{stripeAccount:f.stripeResponse.accountId})]:[3,2];case 1:o=r.sent(),z(o),r.label=2;case 2:return[2]}}))}))}()}),[f.stripeResponse]);var C={clientSecret:f.stripeResponse.clientSecret,appearance:{variables:{borderRadius:"8px"},labels:"floating",rules:{".Input":{lineHeight:"16px",boxShadow:"0 0 0 1px transparent",transition:"padding .1s, border-color .5s, box-shadow .5s",padding:"8px 16px",border:"1px solid ".concat((null===(l=f.customizationProps)||void 0===l?void 0:l.borderColor)||"#E5E4E9")},".Input::placeholder":{fontSize:"14px",color:(null===(a=f.customizationProps)||void 0===a?void 0:a.secondaryTextColor)||"#8A8B94"},".Input:focus":{boxShadow:"0 0 0 1px ".concat((null===(p=f.customizationProps)||void 0===p?void 0:p.buttonBgColor)||"##272727"),borderColor:(null===(c=f.customizationProps)||void 0===c?void 0:c.buttonBgColor)||"##272727"},".Input--invalid":{boxShadow:"0 0 0 1px ".concat((null===(u=f.customizationProps)||void 0===u?void 0:u.errorColor)||"#FB4E4E"),borderColor:(null===(d=f.customizationProps)||void 0===d?void 0:d.errorColor)||"#FB4E4E",color:(null===(m=f.customizationProps)||void 0===m?void 0:m.errorColor)||"#FB4E4E"},".Label":{fontSize:"14px",color:(null===(v=f.customizationProps)||void 0===v?void 0:v.secondaryTextColor)||"#8A8B94"},".Error":{fontSize:"12px",marginTop:"8px",color:(null===(b=f.customizationProps)||void 0===b?void 0:b.errorColor)||"#FB4E4E"}}}};return e.createElement(e.Fragment,null,e.createElement(i,{stripe:E,options:C},e.createElement(s,{callbackUrl:f.stripeResponse.callbackUrl,vm:f})))}));export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasPaymentMethodType as a,IkasPaymentGatewayTransactionFeeType as n,IkasPaymentGatewayAdditionalPriceType as o,IkasPaymentGatewayType as r}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import{CreditCardForm as m}from"../../../components/credit-card-form/index.js";import{Installments as i}from"./installments/index.js";import d from"../../../components/select-box/index.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as s}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import u from"../../../components/credit-card-form/model.js";import
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasPaymentMethodType as a,IkasPaymentGatewayTransactionFeeType as n,IkasPaymentGatewayAdditionalPriceType as o,IkasPaymentGatewayType as r}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import{CreditCardForm as m}from"../../../components/credit-card-form/index.js";import{Installments as i}from"./installments/index.js";import d from"../../../components/select-box/index.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as s}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import u from"next/dynamic";import y from"../../../components/credit-card-form/model.js";import x from"../../../components/master-pass/credit-card-form/index.js";import{Klarna as f}from"../../../components/klarna/index.js";import{Toggle as v}from"../../../components/toggle/index.js";import j from"../../../components/select-box/style.module.scss.js";import g from"../../../components/master-pass/payment-gateway/svg/master-card.js";import E from"../../../components/master-pass/payment-gateway/svg/troy.js";import h from"../../../components/master-pass/payment-gateway/svg/visa.js";var C=u((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),w=t((function(t){var u=t.vm,w=c().t,P=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},k=function(t){return e.createElement("div",{className:l.AdditionalPrice},t.children)},I=function(e){return 0===e.amount?"":"".concat(e.amountType===n.AMOUNT?s(e.amount,u.checkout.currencyCode,u.checkout.currencySymbol):" %"+e.amount).concat(e.type===o.DECREMENT?" "+w("checkout-page:paymentMethodDiscount"):" "+w("checkout-page:paymentMethodAdditionalPrice"))},N=function(e){var t;return"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(e){return"allow_custom_flow"===e.label&&"1"===e.value})))};return e.createElement(e.Fragment,null,!!u.mpVM.cards.length&&u.mpVM.cards.map((function(t,n){var o,m=u.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),s=e.createElement("button",{className:l.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),u.mpVM.deleteCard({store:u.store,checkout:u.checkout,card:t})}},w("checkout-page:masterPass.paymentGatewaySelectBox.delete")),c=function(e){return t.Value1.startsWith(e)},p=c("4"),x=c("5")||c("6"),f=c("9"),v=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:l.MasterPassSelectBoxLabelLogo},p&&e.createElement(h,null),x&&e.createElement(g,null),f&&e.createElement(E,null)),t.Name," ",t.Value1),j=(null==m?void 0:m.id)&&m.paymentMethodType===a.CREDIT_CARD&&m.type===r.INTERNAL?u.installmentInfo&&e.createElement(i,{vm:u}):void 0;return e.createElement(d,{key:n,isSelected:(null===(o=u.mpVM.selectedCard)||void 0===o?void 0:o.UniqueId)===t.UniqueId,label:v,rightContent:s,bottomContent:j,onClick:function(){var e;(null===(e=u.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(u.checkout.selectedPaymentGateway=null,u.cardData=new y,u.installmentInfo=void 0,u.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&u.checkout.totalFinalPrice&&u.retrieveInstallmentInfo({input:{binNumber:t.Value1.slice(0,6),paymentGatewayId:t.paymentGatewayId,price:u.checkout.totalFinalPrice}}))}})})),u.paymentGateways.filter((function(e){return"in-store"!==u.deliveryMethod||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,n){var o;if(function(e){return"KLARNA"===e.code}(t))return null;var s=t.paymentMethodType===a.CREDIT_CARD&&t.type===r.INTERNAL?e.createElement(e.Fragment,null,N(t)?e.createElement(C,{vm:u,pg:t}):e.createElement("div",null,e.createElement(m,{vm:u}),u.isPaymentGatewayHasMasterPass&&e.createElement(x,{vm:u}),u.installmentInfo&&e.createElement(i,{vm:u}))):t.description?e.createElement(e.Fragment,null,t.type===r.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(d,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===r.INTERNAL?N(t)?" ":w("checkout-page:creditCard"):t.name,isSelected:u.selectedPaymentGatewayIndex===n,rightContent:(null===(o=t.additionalPrices)||void 0===o?void 0:o.length)?e.createElement(k,null,I(t.additionalPrices[0])):e.createElement(P,null,!!t.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:s,onClick:function(){u.selectedPaymentGatewayIndex!==n&&(u.setPaymentGateway(n),u.mpVM.selectedCard=void 0)}})})),u.klarnaPaymentGateway&&function(){var t,a=u.selectedPaymentGatewayIndex===u.klarnaPaymentGatewayIndex;return u.klarnaPaymentGateway?e.createElement("div",{className:j.SelectBoxContainer},e.createElement("div",{className:"".concat(j.SelectBox," ").concat(a?j.Selected:""),onClick:function(){u.setPaymentGateway(u.klarnaPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:j.TopContent},e.createElement(v,{value:a,label:u.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:j.RightContent},(null===(t=u.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(k,null,I(u.klarnaPaymentGateway.additionalPrices[0])):e.createElement(P,null,!!u.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:u.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?j.BottomContent:""," ").concat(a?"":l.Hidden)},e.createElement(f,{vm:u})))):null}())}));export{w as PaymentGateways};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.1.0-beta.1",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,17 +17,15 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@stripe/react-stripe-js": "^1.7.2",
|
|
21
|
-
"@stripe/stripe-js": "^1.29.0",
|
|
22
20
|
"react-tooltip": "^4.2.21",
|
|
23
21
|
"libphonenumber-js": "^1.10.6"
|
|
24
22
|
},
|
|
25
23
|
"devDependencies": {
|
|
26
|
-
"@ikas/storefront-api": "^4.0.
|
|
27
|
-
"@ikas/storefront-config": "^4.0.
|
|
28
|
-
"@ikas/storefront-model-functions": "^4.0.
|
|
29
|
-
"@ikas/storefront-models": "^4.0.
|
|
30
|
-
"@ikas/storefront-providers": "^4.0.
|
|
24
|
+
"@ikas/storefront-api": "^4.1.0-beta.1",
|
|
25
|
+
"@ikas/storefront-config": "^4.1.0-beta.1",
|
|
26
|
+
"@ikas/storefront-model-functions": "^4.1.0-beta.1",
|
|
27
|
+
"@ikas/storefront-models": "^4.1.0-beta.1",
|
|
28
|
+
"@ikas/storefront-providers": "^4.1.0-beta.1",
|
|
31
29
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
32
30
|
"@rollup/plugin-json": "^4.1.0",
|
|
33
31
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -50,14 +48,16 @@
|
|
|
50
48
|
"typescript-transform-paths": "^2.2.2",
|
|
51
49
|
"lodash": "^4.17.21",
|
|
52
50
|
"html-react-parser": "^1.4.0",
|
|
53
|
-
"query-string": "^6.13.8"
|
|
51
|
+
"query-string": "^6.13.8",
|
|
52
|
+
"@stripe/react-stripe-js": "^1.10.0",
|
|
53
|
+
"@stripe/stripe-js": "^1.29.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@ikas/storefront-api": "^4.0.
|
|
57
|
-
"@ikas/storefront-config": "^4.0.
|
|
58
|
-
"@ikas/storefront-model-functions": "^4.0.
|
|
59
|
-
"@ikas/storefront-models": "^4.0.
|
|
60
|
-
"@ikas/storefront-providers": "^4.0.
|
|
56
|
+
"@ikas/storefront-api": "^4.1.0-beta.1",
|
|
57
|
+
"@ikas/storefront-config": "^4.1.0-beta.1",
|
|
58
|
+
"@ikas/storefront-model-functions": "^4.1.0-beta.1",
|
|
59
|
+
"@ikas/storefront-models": "^4.1.0-beta.1",
|
|
60
|
+
"@ikas/storefront-providers": "^4.1.0-beta.1",
|
|
61
61
|
"mobx": "^6.1.3",
|
|
62
62
|
"mobx-react-lite": "^3.1.5",
|
|
63
63
|
"next": "12.2.0",
|
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"react-dom": "17.0.2",
|
|
66
66
|
"lodash": "^4.17.21",
|
|
67
67
|
"html-react-parser": "^1.4.0",
|
|
68
|
-
"query-string": "^6.13.8"
|
|
68
|
+
"query-string": "^6.13.8",
|
|
69
|
+
"@stripe/react-stripe-js": "^1.10.0",
|
|
70
|
+
"@stripe/stripe-js": "^1.29.0"
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};export{e as commonjsGlobal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={exports:{}};export{r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{commonjsGlobal as e}from"../../../../_virtual/_commonjsHelpers.js";import{r as t}from"../../../../_virtual/react-stripe.umd.js";import n from"react";!function(e,t){function n(e,t){return e(t={exports:{}},t.exports),t.exports}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function o(){}function u(){}u.resetWarningCache=o;var c=function(){function e(e,t,n,o,u,c){if(c!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:u,resetWarningCache:o};return n.PropTypes=n,n},i=n((function(e){e.exports=c()}));function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return m(e)||y(e,t)||d(e,t)||b()}function m(e){if(Array.isArray(e))return e}function y(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,u=[],c=!0,i=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(u.push(r.value),!t||u.length!==t);c=!0);}catch(e){i=!0,o=e}finally{try{c||null==n.return||n.return()}finally{if(i)throw o}}return u}}function d(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},g=function(e){return null!==e&&"object"===l(e)},E=function(e){return g(e)&&"function"==typeof e.then},O=function(e){return g(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment},j="[object Object]",P=function e(t,n){if(!g(t)||!g(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o=Object.prototype.toString.call(t)===j;if(o!==(Object.prototype.toString.call(n)===j))return!1;if(!o&&!r)return t===n;var u=Object.keys(t),c=Object.keys(n);if(u.length!==c.length)return!1;for(var i={},a=0;a<u.length;a+=1)i[u[a]]=!0;for(var s=0;s<c.length;s+=1)i[c[s]]=!0;var l=Object.keys(i);if(l.length!==u.length)return!1;var p=t,f=n,m=function(t){return e(p[t],f[t])};return l.every(m)},k=function(e,t,n){return g(e)?Object.keys(e).reduce((function(r,o){var u=!g(t)||!P(e[o],t[o]);return n.includes(o)?(u&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),r):u?s(s({},r||{}),{},p({},o,e[o])):r}),null):null},C="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",S=function(e){if(null===e||O(e))return e;throw new Error(C)},w=function(e){if(E(e))return{tag:"async",stripePromise:Promise.resolve(e).then(S)};var t=S(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}},A=t.createContext(null);A.displayName="ElementsContext";var _=function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},T=function(e){var n=e.stripe,r=e.options,o=e.children,u=t.useMemo((function(){return w(n)}),[n]),c=f(t.useState((function(){return{stripe:"sync"===u.tag?u.stripe:null,elements:"sync"===u.tag?u.stripe.elements(r):null}})),2),i=c[0],a=c[1];t.useEffect((function(){var e=!0,t=function(e){a((function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}}))};return"async"!==u.tag||i.stripe?"sync"!==u.tag||i.stripe||t(u.stripe):u.stripePromise.then((function(n){n&&e&&t(n)})),function(){e=!1}}),[u,i,r]);var s=h(n);t.useEffect((function(){null!==s&&s!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")}),[s,n]);var l=h(r);return t.useEffect((function(){if(i.elements){var e=k(r,l,["clientSecret","fonts"]);e&&i.elements.update(e)}}),[r,l,i.elements]),t.useEffect((function(){var e=i.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.8.1"}),e.registerAppInfo({name:"react-stripe-js",version:"1.8.1",url:"https://stripe.com/docs/stripe-js/react"}))}),[i.stripe]),t.createElement(A.Provider,{value:i},o)};T.propTypes={stripe:i.any,options:i.object};var x=function(e){var n=t.useContext(A);return _(n,e)},B=function(){return x("calls useElements()").elements},R=function(){return x("calls useStripe()").stripe},I=function(e){return(0,e.children)(x("mounts <ElementsConsumer>"))};I.propTypes={children:i.func.isRequired};var N=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},M=function(){},D=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},U=function(e,n){var r="".concat(D(e),"Element"),o=n?function(e){x("mounts <".concat(r,">"));var n=e.id,o=e.className;return t.createElement("div",{id:n,className:o})}:function(n){var o=n.id,u=n.className,c=n.options,i=void 0===c?{}:c,a=n.onBlur,s=void 0===a?M:a,l=n.onFocus,p=void 0===l?M:l,f=n.onReady,m=void 0===f?M:f,y=n.onChange,d=void 0===y?M:y,v=n.onEscape,b=void 0===v?M:v,g=n.onClick,E=void 0===g?M:g,O=x("mounts <".concat(r,">")).elements,j=t.useRef(null),P=t.useRef(null),C=N(m),S=N(s),w=N(p),A=N(E),_=N(d),T=N(b);t.useLayoutEffect((function(){if(null==j.current&&O&&null!=P.current){var t=O.create(e,i);j.current=t,t.mount(P.current),t.on("ready",(function(){return C(t)})),t.on("change",_),t.on("blur",S),t.on("focus",w),t.on("escape",T),t.on("click",A)}}));var B=h(i);return t.useEffect((function(){if(j.current){var e=k(i,B,["paymentRequest"]);e&&j.current.update(e)}}),[i,B]),t.useLayoutEffect((function(){return function(){j.current&&(j.current.destroy(),j.current=null)}}),[]),t.createElement("div",{id:o,className:u,ref:P})};return o.propTypes={id:i.string,className:i.string,onChange:i.func,onBlur:i.func,onFocus:i.func,onReady:i.func,onClick:i.func,options:i.object},o.displayName=r,o.__elementType=e,o},W="undefined"==typeof window,q=U("auBankAccount",W),L=U("card",W),F=U("cardNumber",W),Y=U("cardExpiry",W),H=U("cardCvc",W),V=U("fpxBank",W),$=U("iban",W),z=U("idealBank",W),G=U("p24Bank",W),J=U("epsBank",W),K=U("payment",W),Q=U("paymentRequestButton",W),X=U("linkAuthentication",W),Z=U("shippingAddress",W),ee=U("affirmMessage",W),te=U("afterpayClearpayMessage",W);e.AffirmMessageElement=ee,e.AfterpayClearpayMessageElement=te,e.AuBankAccountElement=q,e.CardCvcElement=H,e.CardElement=L,e.CardExpiryElement=Y,e.CardNumberElement=F,e.Elements=T,e.ElementsConsumer=I,e.EpsBankElement=J,e.FpxBankElement=V,e.IbanElement=$,e.IdealBankElement=z,e.LinkAuthenticationElement=X,e.P24BankElement=G,e.PaymentElement=K,e.PaymentRequestButtonElement=Q,e.ShippingAddressElement=Z,e.useElements=B,e.useStripe=R,Object.defineProperty(e,"__esModule",{value:!0})}(t.exports,n);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e="https://js.stripe.com/v3",r=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,n="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",t=null,i=function(i){return null!==t||(t=new Promise((function(t,o){if("undefined"!=typeof window)if(window.Stripe&&i&&console.warn(n),window.Stripe)t(window.Stripe);else try{var a=function(){for(var n=document.querySelectorAll('script[src^="'.concat(e,'"]')),t=0;t<n.length;t++){var i=n[t];if(r.test(i.src))return i}return null}();a&&i?console.warn(n):a||(a=function(r){var n=r&&!r.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(e).concat(n);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(t),t}(i)),a.addEventListener("load",(function(){window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),a.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),t},o=function(e,r,n){if(null===e)return null;var t=e.apply(void 0,r);return function(e,r){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.31.0",startTime:r})}(t,n),t},a=Promise.resolve().then((function(){return i(null)})),s=!1;a.catch((function(e){s||console.warn(e)}));var c=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];s=!0;var t=Date.now();return a.then((function(e){return o(e,r,t)}))};export{c as loadStripe};
|