hookery 0.0.1 → 1.0.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/README.md +72 -11
- package/dist/bridges/auth0.d.mts +16 -0
- package/dist/bridges/auth0.d.ts +16 -0
- package/dist/bridges/auth0.js +3015 -0
- package/dist/bridges/auth0.js.map +1 -0
- package/dist/bridges/auth0.mjs +2977 -0
- package/dist/bridges/auth0.mjs.map +1 -0
- package/dist/bridges/axios.d.mts +17 -0
- package/dist/bridges/axios.d.ts +17 -0
- package/dist/bridges/axios.js +15351 -0
- package/dist/bridges/axios.js.map +1 -0
- package/dist/bridges/axios.mjs +15347 -0
- package/dist/bridges/axios.mjs.map +1 -0
- package/dist/bridges/clerk.d.mts +1 -0
- package/dist/bridges/clerk.d.ts +1 -0
- package/dist/bridges/clerk.js +5991 -0
- package/dist/bridges/clerk.js.map +1 -0
- package/dist/bridges/clerk.mjs +5985 -0
- package/dist/bridges/clerk.mjs.map +1 -0
- package/dist/bridges/firebase.d.mts +14 -0
- package/dist/bridges/firebase.d.ts +14 -0
- package/dist/bridges/firebase.js +52 -0
- package/dist/bridges/firebase.js.map +1 -0
- package/dist/bridges/firebase.mjs +25 -0
- package/dist/bridges/firebase.mjs.map +1 -0
- package/dist/bridges/jotai.d.mts +11 -0
- package/dist/bridges/jotai.d.ts +11 -0
- package/dist/bridges/jotai.js +870 -0
- package/dist/bridges/jotai.js.map +1 -0
- package/dist/bridges/jotai.mjs +827 -0
- package/dist/bridges/jotai.mjs.map +1 -0
- package/dist/bridges/motion.d.mts +6 -0
- package/dist/bridges/motion.d.ts +6 -0
- package/dist/bridges/motion.js +3752 -0
- package/dist/bridges/motion.js.map +1 -0
- package/dist/bridges/motion.mjs +3721 -0
- package/dist/bridges/motion.mjs.map +1 -0
- package/dist/bridges/next.d.mts +10 -0
- package/dist/bridges/next.d.ts +10 -0
- package/dist/bridges/next.js +2588 -0
- package/dist/bridges/next.js.map +1 -0
- package/dist/bridges/next.mjs +2582 -0
- package/dist/bridges/next.mjs.map +1 -0
- package/dist/bridges/redux.d.mts +15 -0
- package/dist/bridges/redux.d.ts +15 -0
- package/dist/bridges/redux.js +410 -0
- package/dist/bridges/redux.js.map +1 -0
- package/dist/bridges/redux.mjs +402 -0
- package/dist/bridges/redux.mjs.map +1 -0
- package/dist/bridges/remix.d.mts +1 -0
- package/dist/bridges/remix.d.ts +1 -0
- package/dist/bridges/remix.js +2215 -0
- package/dist/bridges/remix.js.map +1 -0
- package/dist/bridges/remix.mjs +2174 -0
- package/dist/bridges/remix.mjs.map +1 -0
- package/dist/bridges/stripe.d.mts +15 -0
- package/dist/bridges/stripe.d.ts +15 -0
- package/dist/bridges/stripe.js +1572 -0
- package/dist/bridges/stripe.js.map +1 -0
- package/dist/bridges/stripe.mjs +1556 -0
- package/dist/bridges/stripe.mjs.map +1 -0
- package/dist/bridges/supabase.d.mts +13 -0
- package/dist/bridges/supabase.d.ts +13 -0
- package/dist/bridges/supabase.js +51 -0
- package/dist/bridges/supabase.js.map +1 -0
- package/dist/bridges/supabase.mjs +24 -0
- package/dist/bridges/supabase.mjs.map +1 -0
- package/dist/bridges/tanstack.d.mts +3 -0
- package/dist/bridges/tanstack.d.ts +3 -0
- package/dist/bridges/tanstack.js +1319 -0
- package/dist/bridges/tanstack.js.map +1 -0
- package/dist/bridges/tanstack.mjs +1281 -0
- package/dist/bridges/tanstack.mjs.map +1 -0
- package/dist/bridges/yup.d.mts +16 -0
- package/dist/bridges/yup.d.ts +16 -0
- package/dist/bridges/yup.js +80 -0
- package/dist/bridges/yup.js.map +1 -0
- package/dist/bridges/yup.mjs +43 -0
- package/dist/bridges/yup.mjs.map +1 -0
- package/dist/bridges/zod.d.mts +19 -0
- package/dist/bridges/zod.d.ts +19 -0
- package/dist/bridges/zod.js +66 -0
- package/dist/bridges/zod.js.map +1 -0
- package/dist/bridges/zod.mjs +39 -0
- package/dist/bridges/zod.mjs.map +1 -0
- package/dist/bridges/zustand.d.mts +14 -0
- package/dist/bridges/zustand.d.ts +14 -0
- package/dist/bridges/zustand.js +58 -0
- package/dist/bridges/zustand.js.map +1 -0
- package/dist/bridges/zustand.mjs +21 -0
- package/dist/bridges/zustand.mjs.map +1 -0
- package/dist/index.d.mts +3124 -8
- package/dist/index.d.ts +3124 -8
- package/dist/index.js +4290 -10
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4172 -7
- package/dist/index.mjs.map +1 -0
- package/package.json +131 -6
|
@@ -0,0 +1,1572 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
34
|
+
var require_react_is_production_min = __commonJS({
|
|
35
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
|
38
|
+
var c = b ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
39
|
+
var d = b ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
40
|
+
var e = b ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
41
|
+
var f = b ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
42
|
+
var g = b ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
43
|
+
var h = b ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
44
|
+
var k = b ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
45
|
+
var l = b ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
46
|
+
var m = b ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
47
|
+
var n = b ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
48
|
+
var p = b ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
49
|
+
var q = b ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
50
|
+
var r = b ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
51
|
+
var t = b ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
52
|
+
var v = b ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
53
|
+
var w = b ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
54
|
+
var x = b ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
55
|
+
var y = b ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
56
|
+
function z(a) {
|
|
57
|
+
if ("object" === typeof a && null !== a) {
|
|
58
|
+
var u = a.$$typeof;
|
|
59
|
+
switch (u) {
|
|
60
|
+
case c:
|
|
61
|
+
switch (a = a.type, a) {
|
|
62
|
+
case l:
|
|
63
|
+
case m:
|
|
64
|
+
case e:
|
|
65
|
+
case g:
|
|
66
|
+
case f:
|
|
67
|
+
case p:
|
|
68
|
+
return a;
|
|
69
|
+
default:
|
|
70
|
+
switch (a = a && a.$$typeof, a) {
|
|
71
|
+
case k:
|
|
72
|
+
case n:
|
|
73
|
+
case t:
|
|
74
|
+
case r:
|
|
75
|
+
case h:
|
|
76
|
+
return a;
|
|
77
|
+
default:
|
|
78
|
+
return u;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
case d:
|
|
82
|
+
return u;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function A(a) {
|
|
87
|
+
return z(a) === m;
|
|
88
|
+
}
|
|
89
|
+
exports2.AsyncMode = l;
|
|
90
|
+
exports2.ConcurrentMode = m;
|
|
91
|
+
exports2.ContextConsumer = k;
|
|
92
|
+
exports2.ContextProvider = h;
|
|
93
|
+
exports2.Element = c;
|
|
94
|
+
exports2.ForwardRef = n;
|
|
95
|
+
exports2.Fragment = e;
|
|
96
|
+
exports2.Lazy = t;
|
|
97
|
+
exports2.Memo = r;
|
|
98
|
+
exports2.Portal = d;
|
|
99
|
+
exports2.Profiler = g;
|
|
100
|
+
exports2.StrictMode = f;
|
|
101
|
+
exports2.Suspense = p;
|
|
102
|
+
exports2.isAsyncMode = function(a) {
|
|
103
|
+
return A(a) || z(a) === l;
|
|
104
|
+
};
|
|
105
|
+
exports2.isConcurrentMode = A;
|
|
106
|
+
exports2.isContextConsumer = function(a) {
|
|
107
|
+
return z(a) === k;
|
|
108
|
+
};
|
|
109
|
+
exports2.isContextProvider = function(a) {
|
|
110
|
+
return z(a) === h;
|
|
111
|
+
};
|
|
112
|
+
exports2.isElement = function(a) {
|
|
113
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
114
|
+
};
|
|
115
|
+
exports2.isForwardRef = function(a) {
|
|
116
|
+
return z(a) === n;
|
|
117
|
+
};
|
|
118
|
+
exports2.isFragment = function(a) {
|
|
119
|
+
return z(a) === e;
|
|
120
|
+
};
|
|
121
|
+
exports2.isLazy = function(a) {
|
|
122
|
+
return z(a) === t;
|
|
123
|
+
};
|
|
124
|
+
exports2.isMemo = function(a) {
|
|
125
|
+
return z(a) === r;
|
|
126
|
+
};
|
|
127
|
+
exports2.isPortal = function(a) {
|
|
128
|
+
return z(a) === d;
|
|
129
|
+
};
|
|
130
|
+
exports2.isProfiler = function(a) {
|
|
131
|
+
return z(a) === g;
|
|
132
|
+
};
|
|
133
|
+
exports2.isStrictMode = function(a) {
|
|
134
|
+
return z(a) === f;
|
|
135
|
+
};
|
|
136
|
+
exports2.isSuspense = function(a) {
|
|
137
|
+
return z(a) === p;
|
|
138
|
+
};
|
|
139
|
+
exports2.isValidElementType = function(a) {
|
|
140
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
141
|
+
};
|
|
142
|
+
exports2.typeOf = z;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
147
|
+
var require_react_is_development = __commonJS({
|
|
148
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports2) {
|
|
149
|
+
"use strict";
|
|
150
|
+
if (process.env.NODE_ENV !== "production") {
|
|
151
|
+
(function() {
|
|
152
|
+
"use strict";
|
|
153
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
154
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
155
|
+
var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
156
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
157
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
158
|
+
var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
159
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
160
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
161
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
162
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
163
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
164
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
165
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
166
|
+
var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
167
|
+
var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
168
|
+
var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
169
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
170
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
171
|
+
var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
172
|
+
function isValidElementType(type) {
|
|
173
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
174
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
175
|
+
}
|
|
176
|
+
function typeOf(object) {
|
|
177
|
+
if (typeof object === "object" && object !== null) {
|
|
178
|
+
var $$typeof = object.$$typeof;
|
|
179
|
+
switch ($$typeof) {
|
|
180
|
+
case REACT_ELEMENT_TYPE:
|
|
181
|
+
var type = object.type;
|
|
182
|
+
switch (type) {
|
|
183
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
184
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
185
|
+
case REACT_FRAGMENT_TYPE:
|
|
186
|
+
case REACT_PROFILER_TYPE:
|
|
187
|
+
case REACT_STRICT_MODE_TYPE:
|
|
188
|
+
case REACT_SUSPENSE_TYPE:
|
|
189
|
+
return type;
|
|
190
|
+
default:
|
|
191
|
+
var $$typeofType = type && type.$$typeof;
|
|
192
|
+
switch ($$typeofType) {
|
|
193
|
+
case REACT_CONTEXT_TYPE:
|
|
194
|
+
case REACT_FORWARD_REF_TYPE:
|
|
195
|
+
case REACT_LAZY_TYPE:
|
|
196
|
+
case REACT_MEMO_TYPE:
|
|
197
|
+
case REACT_PROVIDER_TYPE:
|
|
198
|
+
return $$typeofType;
|
|
199
|
+
default:
|
|
200
|
+
return $$typeof;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
case REACT_PORTAL_TYPE:
|
|
204
|
+
return $$typeof;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
210
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
211
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
212
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
213
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
214
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
215
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
216
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
217
|
+
var Memo = REACT_MEMO_TYPE;
|
|
218
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
219
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
220
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
221
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
222
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
223
|
+
function isAsyncMode(object) {
|
|
224
|
+
{
|
|
225
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
226
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
227
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
231
|
+
}
|
|
232
|
+
function isConcurrentMode(object) {
|
|
233
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
234
|
+
}
|
|
235
|
+
function isContextConsumer(object) {
|
|
236
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
237
|
+
}
|
|
238
|
+
function isContextProvider(object) {
|
|
239
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
240
|
+
}
|
|
241
|
+
function isElement(object) {
|
|
242
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
243
|
+
}
|
|
244
|
+
function isForwardRef(object) {
|
|
245
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
246
|
+
}
|
|
247
|
+
function isFragment(object) {
|
|
248
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
249
|
+
}
|
|
250
|
+
function isLazy(object) {
|
|
251
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
252
|
+
}
|
|
253
|
+
function isMemo(object) {
|
|
254
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
255
|
+
}
|
|
256
|
+
function isPortal(object) {
|
|
257
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
258
|
+
}
|
|
259
|
+
function isProfiler(object) {
|
|
260
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
261
|
+
}
|
|
262
|
+
function isStrictMode(object) {
|
|
263
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
264
|
+
}
|
|
265
|
+
function isSuspense(object) {
|
|
266
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
267
|
+
}
|
|
268
|
+
exports2.AsyncMode = AsyncMode;
|
|
269
|
+
exports2.ConcurrentMode = ConcurrentMode;
|
|
270
|
+
exports2.ContextConsumer = ContextConsumer;
|
|
271
|
+
exports2.ContextProvider = ContextProvider;
|
|
272
|
+
exports2.Element = Element;
|
|
273
|
+
exports2.ForwardRef = ForwardRef;
|
|
274
|
+
exports2.Fragment = Fragment;
|
|
275
|
+
exports2.Lazy = Lazy;
|
|
276
|
+
exports2.Memo = Memo;
|
|
277
|
+
exports2.Portal = Portal;
|
|
278
|
+
exports2.Profiler = Profiler;
|
|
279
|
+
exports2.StrictMode = StrictMode;
|
|
280
|
+
exports2.Suspense = Suspense;
|
|
281
|
+
exports2.isAsyncMode = isAsyncMode;
|
|
282
|
+
exports2.isConcurrentMode = isConcurrentMode;
|
|
283
|
+
exports2.isContextConsumer = isContextConsumer;
|
|
284
|
+
exports2.isContextProvider = isContextProvider;
|
|
285
|
+
exports2.isElement = isElement;
|
|
286
|
+
exports2.isForwardRef = isForwardRef;
|
|
287
|
+
exports2.isFragment = isFragment;
|
|
288
|
+
exports2.isLazy = isLazy;
|
|
289
|
+
exports2.isMemo = isMemo;
|
|
290
|
+
exports2.isPortal = isPortal;
|
|
291
|
+
exports2.isProfiler = isProfiler;
|
|
292
|
+
exports2.isStrictMode = isStrictMode;
|
|
293
|
+
exports2.isSuspense = isSuspense;
|
|
294
|
+
exports2.isValidElementType = isValidElementType;
|
|
295
|
+
exports2.typeOf = typeOf;
|
|
296
|
+
})();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// node_modules/prop-types/node_modules/react-is/index.js
|
|
302
|
+
var require_react_is = __commonJS({
|
|
303
|
+
"node_modules/prop-types/node_modules/react-is/index.js"(exports2, module2) {
|
|
304
|
+
"use strict";
|
|
305
|
+
if (process.env.NODE_ENV === "production") {
|
|
306
|
+
module2.exports = require_react_is_production_min();
|
|
307
|
+
} else {
|
|
308
|
+
module2.exports = require_react_is_development();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
// node_modules/object-assign/index.js
|
|
314
|
+
var require_object_assign = __commonJS({
|
|
315
|
+
"node_modules/object-assign/index.js"(exports2, module2) {
|
|
316
|
+
"use strict";
|
|
317
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
318
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
319
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
320
|
+
function toObject(val) {
|
|
321
|
+
if (val === null || val === void 0) {
|
|
322
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
323
|
+
}
|
|
324
|
+
return Object(val);
|
|
325
|
+
}
|
|
326
|
+
function shouldUseNative() {
|
|
327
|
+
try {
|
|
328
|
+
if (!Object.assign) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
var test1 = new String("abc");
|
|
332
|
+
test1[5] = "de";
|
|
333
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
var test2 = {};
|
|
337
|
+
for (var i = 0; i < 10; i++) {
|
|
338
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
339
|
+
}
|
|
340
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
341
|
+
return test2[n];
|
|
342
|
+
});
|
|
343
|
+
if (order2.join("") !== "0123456789") {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
var test3 = {};
|
|
347
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
348
|
+
test3[letter] = letter;
|
|
349
|
+
});
|
|
350
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
return true;
|
|
354
|
+
} catch (err) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
359
|
+
var from;
|
|
360
|
+
var to = toObject(target);
|
|
361
|
+
var symbols;
|
|
362
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
363
|
+
from = Object(arguments[s]);
|
|
364
|
+
for (var key in from) {
|
|
365
|
+
if (hasOwnProperty.call(from, key)) {
|
|
366
|
+
to[key] = from[key];
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
if (getOwnPropertySymbols) {
|
|
370
|
+
symbols = getOwnPropertySymbols(from);
|
|
371
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
372
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
373
|
+
to[symbols[i]] = from[symbols[i]];
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return to;
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
384
|
+
var require_ReactPropTypesSecret = __commonJS({
|
|
385
|
+
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports2, module2) {
|
|
386
|
+
"use strict";
|
|
387
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
388
|
+
module2.exports = ReactPropTypesSecret;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
// node_modules/prop-types/lib/has.js
|
|
393
|
+
var require_has = __commonJS({
|
|
394
|
+
"node_modules/prop-types/lib/has.js"(exports2, module2) {
|
|
395
|
+
"use strict";
|
|
396
|
+
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// node_modules/prop-types/checkPropTypes.js
|
|
401
|
+
var require_checkPropTypes = __commonJS({
|
|
402
|
+
"node_modules/prop-types/checkPropTypes.js"(exports2, module2) {
|
|
403
|
+
"use strict";
|
|
404
|
+
var printWarning = function() {
|
|
405
|
+
};
|
|
406
|
+
if (process.env.NODE_ENV !== "production") {
|
|
407
|
+
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
408
|
+
loggedTypeFailures = {};
|
|
409
|
+
has = require_has();
|
|
410
|
+
printWarning = function(text) {
|
|
411
|
+
var message = "Warning: " + text;
|
|
412
|
+
if (typeof console !== "undefined") {
|
|
413
|
+
console.error(message);
|
|
414
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
throw new Error(message);
|
|
417
|
+
} catch (x) {
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
var ReactPropTypesSecret;
|
|
422
|
+
var loggedTypeFailures;
|
|
423
|
+
var has;
|
|
424
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
425
|
+
if (process.env.NODE_ENV !== "production") {
|
|
426
|
+
for (var typeSpecName in typeSpecs) {
|
|
427
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
428
|
+
var error;
|
|
429
|
+
try {
|
|
430
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
431
|
+
var err = Error(
|
|
432
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
433
|
+
);
|
|
434
|
+
err.name = "Invariant Violation";
|
|
435
|
+
throw err;
|
|
436
|
+
}
|
|
437
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
438
|
+
} catch (ex) {
|
|
439
|
+
error = ex;
|
|
440
|
+
}
|
|
441
|
+
if (error && !(error instanceof Error)) {
|
|
442
|
+
printWarning(
|
|
443
|
+
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
447
|
+
loggedTypeFailures[error.message] = true;
|
|
448
|
+
var stack = getStack ? getStack() : "";
|
|
449
|
+
printWarning(
|
|
450
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
checkPropTypes.resetWarningCache = function() {
|
|
458
|
+
if (process.env.NODE_ENV !== "production") {
|
|
459
|
+
loggedTypeFailures = {};
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
module2.exports = checkPropTypes;
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
467
|
+
var require_factoryWithTypeCheckers = __commonJS({
|
|
468
|
+
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports2, module2) {
|
|
469
|
+
"use strict";
|
|
470
|
+
var ReactIs = require_react_is();
|
|
471
|
+
var assign = require_object_assign();
|
|
472
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
473
|
+
var has = require_has();
|
|
474
|
+
var checkPropTypes = require_checkPropTypes();
|
|
475
|
+
var printWarning = function() {
|
|
476
|
+
};
|
|
477
|
+
if (process.env.NODE_ENV !== "production") {
|
|
478
|
+
printWarning = function(text) {
|
|
479
|
+
var message = "Warning: " + text;
|
|
480
|
+
if (typeof console !== "undefined") {
|
|
481
|
+
console.error(message);
|
|
482
|
+
}
|
|
483
|
+
try {
|
|
484
|
+
throw new Error(message);
|
|
485
|
+
} catch (x) {
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function emptyFunctionThatReturnsNull() {
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
module2.exports = function(isValidElement, throwOnDirectAccess) {
|
|
493
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
494
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
495
|
+
function getIteratorFn(maybeIterable) {
|
|
496
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
497
|
+
if (typeof iteratorFn === "function") {
|
|
498
|
+
return iteratorFn;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
502
|
+
var ReactPropTypes = {
|
|
503
|
+
array: createPrimitiveTypeChecker("array"),
|
|
504
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
505
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
506
|
+
func: createPrimitiveTypeChecker("function"),
|
|
507
|
+
number: createPrimitiveTypeChecker("number"),
|
|
508
|
+
object: createPrimitiveTypeChecker("object"),
|
|
509
|
+
string: createPrimitiveTypeChecker("string"),
|
|
510
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
511
|
+
any: createAnyTypeChecker(),
|
|
512
|
+
arrayOf: createArrayOfTypeChecker,
|
|
513
|
+
element: createElementTypeChecker(),
|
|
514
|
+
elementType: createElementTypeTypeChecker(),
|
|
515
|
+
instanceOf: createInstanceTypeChecker,
|
|
516
|
+
node: createNodeChecker(),
|
|
517
|
+
objectOf: createObjectOfTypeChecker,
|
|
518
|
+
oneOf: createEnumTypeChecker,
|
|
519
|
+
oneOfType: createUnionTypeChecker,
|
|
520
|
+
shape: createShapeTypeChecker,
|
|
521
|
+
exact: createStrictShapeTypeChecker
|
|
522
|
+
};
|
|
523
|
+
function is(x, y) {
|
|
524
|
+
if (x === y) {
|
|
525
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
526
|
+
} else {
|
|
527
|
+
return x !== x && y !== y;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function PropTypeError(message, data) {
|
|
531
|
+
this.message = message;
|
|
532
|
+
this.data = data && typeof data === "object" ? data : {};
|
|
533
|
+
this.stack = "";
|
|
534
|
+
}
|
|
535
|
+
PropTypeError.prototype = Error.prototype;
|
|
536
|
+
function createChainableTypeChecker(validate) {
|
|
537
|
+
if (process.env.NODE_ENV !== "production") {
|
|
538
|
+
var manualPropTypeCallCache = {};
|
|
539
|
+
var manualPropTypeWarningCount = 0;
|
|
540
|
+
}
|
|
541
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
542
|
+
componentName = componentName || ANONYMOUS;
|
|
543
|
+
propFullName = propFullName || propName;
|
|
544
|
+
if (secret !== ReactPropTypesSecret) {
|
|
545
|
+
if (throwOnDirectAccess) {
|
|
546
|
+
var err = new Error(
|
|
547
|
+
"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"
|
|
548
|
+
);
|
|
549
|
+
err.name = "Invariant Violation";
|
|
550
|
+
throw err;
|
|
551
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
552
|
+
var cacheKey = componentName + ":" + propName;
|
|
553
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
554
|
+
manualPropTypeWarningCount < 3) {
|
|
555
|
+
printWarning(
|
|
556
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
557
|
+
);
|
|
558
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
559
|
+
manualPropTypeWarningCount++;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
if (props[propName] == null) {
|
|
564
|
+
if (isRequired) {
|
|
565
|
+
if (props[propName] === null) {
|
|
566
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
567
|
+
}
|
|
568
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
569
|
+
}
|
|
570
|
+
return null;
|
|
571
|
+
} else {
|
|
572
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
576
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
577
|
+
return chainedCheckType;
|
|
578
|
+
}
|
|
579
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
580
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
581
|
+
var propValue = props[propName];
|
|
582
|
+
var propType = getPropType(propValue);
|
|
583
|
+
if (propType !== expectedType) {
|
|
584
|
+
var preciseType = getPreciseType(propValue);
|
|
585
|
+
return new PropTypeError(
|
|
586
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
587
|
+
{ expectedType }
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
return createChainableTypeChecker(validate);
|
|
593
|
+
}
|
|
594
|
+
function createAnyTypeChecker() {
|
|
595
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
596
|
+
}
|
|
597
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
598
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
599
|
+
if (typeof typeChecker !== "function") {
|
|
600
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
601
|
+
}
|
|
602
|
+
var propValue = props[propName];
|
|
603
|
+
if (!Array.isArray(propValue)) {
|
|
604
|
+
var propType = getPropType(propValue);
|
|
605
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
606
|
+
}
|
|
607
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
608
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
609
|
+
if (error instanceof Error) {
|
|
610
|
+
return error;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return null;
|
|
614
|
+
}
|
|
615
|
+
return createChainableTypeChecker(validate);
|
|
616
|
+
}
|
|
617
|
+
function createElementTypeChecker() {
|
|
618
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
619
|
+
var propValue = props[propName];
|
|
620
|
+
if (!isValidElement(propValue)) {
|
|
621
|
+
var propType = getPropType(propValue);
|
|
622
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
623
|
+
}
|
|
624
|
+
return null;
|
|
625
|
+
}
|
|
626
|
+
return createChainableTypeChecker(validate);
|
|
627
|
+
}
|
|
628
|
+
function createElementTypeTypeChecker() {
|
|
629
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
630
|
+
var propValue = props[propName];
|
|
631
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
632
|
+
var propType = getPropType(propValue);
|
|
633
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
634
|
+
}
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
return createChainableTypeChecker(validate);
|
|
638
|
+
}
|
|
639
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
640
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
641
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
642
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
643
|
+
var actualClassName = getClassName(props[propName]);
|
|
644
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
645
|
+
}
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
return createChainableTypeChecker(validate);
|
|
649
|
+
}
|
|
650
|
+
function createEnumTypeChecker(expectedValues) {
|
|
651
|
+
if (!Array.isArray(expectedValues)) {
|
|
652
|
+
if (process.env.NODE_ENV !== "production") {
|
|
653
|
+
if (arguments.length > 1) {
|
|
654
|
+
printWarning(
|
|
655
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
656
|
+
);
|
|
657
|
+
} else {
|
|
658
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return emptyFunctionThatReturnsNull;
|
|
662
|
+
}
|
|
663
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
664
|
+
var propValue = props[propName];
|
|
665
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
666
|
+
if (is(propValue, expectedValues[i])) {
|
|
667
|
+
return null;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
671
|
+
var type = getPreciseType(value);
|
|
672
|
+
if (type === "symbol") {
|
|
673
|
+
return String(value);
|
|
674
|
+
}
|
|
675
|
+
return value;
|
|
676
|
+
});
|
|
677
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
678
|
+
}
|
|
679
|
+
return createChainableTypeChecker(validate);
|
|
680
|
+
}
|
|
681
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
682
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
683
|
+
if (typeof typeChecker !== "function") {
|
|
684
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
685
|
+
}
|
|
686
|
+
var propValue = props[propName];
|
|
687
|
+
var propType = getPropType(propValue);
|
|
688
|
+
if (propType !== "object") {
|
|
689
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
690
|
+
}
|
|
691
|
+
for (var key in propValue) {
|
|
692
|
+
if (has(propValue, key)) {
|
|
693
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
694
|
+
if (error instanceof Error) {
|
|
695
|
+
return error;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
return createChainableTypeChecker(validate);
|
|
702
|
+
}
|
|
703
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
704
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
705
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
706
|
+
return emptyFunctionThatReturnsNull;
|
|
707
|
+
}
|
|
708
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
709
|
+
var checker = arrayOfTypeCheckers[i];
|
|
710
|
+
if (typeof checker !== "function") {
|
|
711
|
+
printWarning(
|
|
712
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
713
|
+
);
|
|
714
|
+
return emptyFunctionThatReturnsNull;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
718
|
+
var expectedTypes = [];
|
|
719
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
720
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
721
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
722
|
+
if (checkerResult == null) {
|
|
723
|
+
return null;
|
|
724
|
+
}
|
|
725
|
+
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
726
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
730
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
731
|
+
}
|
|
732
|
+
return createChainableTypeChecker(validate);
|
|
733
|
+
}
|
|
734
|
+
function createNodeChecker() {
|
|
735
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
736
|
+
if (!isNode(props[propName])) {
|
|
737
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
738
|
+
}
|
|
739
|
+
return null;
|
|
740
|
+
}
|
|
741
|
+
return createChainableTypeChecker(validate);
|
|
742
|
+
}
|
|
743
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
744
|
+
return new PropTypeError(
|
|
745
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
749
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
750
|
+
var propValue = props[propName];
|
|
751
|
+
var propType = getPropType(propValue);
|
|
752
|
+
if (propType !== "object") {
|
|
753
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
754
|
+
}
|
|
755
|
+
for (var key in shapeTypes) {
|
|
756
|
+
var checker = shapeTypes[key];
|
|
757
|
+
if (typeof checker !== "function") {
|
|
758
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
759
|
+
}
|
|
760
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
761
|
+
if (error) {
|
|
762
|
+
return error;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return null;
|
|
766
|
+
}
|
|
767
|
+
return createChainableTypeChecker(validate);
|
|
768
|
+
}
|
|
769
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
770
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
771
|
+
var propValue = props[propName];
|
|
772
|
+
var propType = getPropType(propValue);
|
|
773
|
+
if (propType !== "object") {
|
|
774
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
775
|
+
}
|
|
776
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
777
|
+
for (var key in allKeys) {
|
|
778
|
+
var checker = shapeTypes[key];
|
|
779
|
+
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
780
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
781
|
+
}
|
|
782
|
+
if (!checker) {
|
|
783
|
+
return new PropTypeError(
|
|
784
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
788
|
+
if (error) {
|
|
789
|
+
return error;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
return null;
|
|
793
|
+
}
|
|
794
|
+
return createChainableTypeChecker(validate);
|
|
795
|
+
}
|
|
796
|
+
function isNode(propValue) {
|
|
797
|
+
switch (typeof propValue) {
|
|
798
|
+
case "number":
|
|
799
|
+
case "string":
|
|
800
|
+
case "undefined":
|
|
801
|
+
return true;
|
|
802
|
+
case "boolean":
|
|
803
|
+
return !propValue;
|
|
804
|
+
case "object":
|
|
805
|
+
if (Array.isArray(propValue)) {
|
|
806
|
+
return propValue.every(isNode);
|
|
807
|
+
}
|
|
808
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
809
|
+
return true;
|
|
810
|
+
}
|
|
811
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
812
|
+
if (iteratorFn) {
|
|
813
|
+
var iterator = iteratorFn.call(propValue);
|
|
814
|
+
var step;
|
|
815
|
+
if (iteratorFn !== propValue.entries) {
|
|
816
|
+
while (!(step = iterator.next()).done) {
|
|
817
|
+
if (!isNode(step.value)) {
|
|
818
|
+
return false;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
} else {
|
|
822
|
+
while (!(step = iterator.next()).done) {
|
|
823
|
+
var entry = step.value;
|
|
824
|
+
if (entry) {
|
|
825
|
+
if (!isNode(entry[1])) {
|
|
826
|
+
return false;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
} else {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
return true;
|
|
835
|
+
default:
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
function isSymbol(propType, propValue) {
|
|
840
|
+
if (propType === "symbol") {
|
|
841
|
+
return true;
|
|
842
|
+
}
|
|
843
|
+
if (!propValue) {
|
|
844
|
+
return false;
|
|
845
|
+
}
|
|
846
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
847
|
+
return true;
|
|
848
|
+
}
|
|
849
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
850
|
+
return true;
|
|
851
|
+
}
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
function getPropType(propValue) {
|
|
855
|
+
var propType = typeof propValue;
|
|
856
|
+
if (Array.isArray(propValue)) {
|
|
857
|
+
return "array";
|
|
858
|
+
}
|
|
859
|
+
if (propValue instanceof RegExp) {
|
|
860
|
+
return "object";
|
|
861
|
+
}
|
|
862
|
+
if (isSymbol(propType, propValue)) {
|
|
863
|
+
return "symbol";
|
|
864
|
+
}
|
|
865
|
+
return propType;
|
|
866
|
+
}
|
|
867
|
+
function getPreciseType(propValue) {
|
|
868
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
869
|
+
return "" + propValue;
|
|
870
|
+
}
|
|
871
|
+
var propType = getPropType(propValue);
|
|
872
|
+
if (propType === "object") {
|
|
873
|
+
if (propValue instanceof Date) {
|
|
874
|
+
return "date";
|
|
875
|
+
} else if (propValue instanceof RegExp) {
|
|
876
|
+
return "regexp";
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
return propType;
|
|
880
|
+
}
|
|
881
|
+
function getPostfixForTypeWarning(value) {
|
|
882
|
+
var type = getPreciseType(value);
|
|
883
|
+
switch (type) {
|
|
884
|
+
case "array":
|
|
885
|
+
case "object":
|
|
886
|
+
return "an " + type;
|
|
887
|
+
case "boolean":
|
|
888
|
+
case "date":
|
|
889
|
+
case "regexp":
|
|
890
|
+
return "a " + type;
|
|
891
|
+
default:
|
|
892
|
+
return type;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
function getClassName(propValue) {
|
|
896
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
897
|
+
return ANONYMOUS;
|
|
898
|
+
}
|
|
899
|
+
return propValue.constructor.name;
|
|
900
|
+
}
|
|
901
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
902
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
903
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
904
|
+
return ReactPropTypes;
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
// node_modules/prop-types/factoryWithThrowingShims.js
|
|
910
|
+
var require_factoryWithThrowingShims = __commonJS({
|
|
911
|
+
"node_modules/prop-types/factoryWithThrowingShims.js"(exports2, module2) {
|
|
912
|
+
"use strict";
|
|
913
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
914
|
+
function emptyFunction() {
|
|
915
|
+
}
|
|
916
|
+
function emptyFunctionWithReset() {
|
|
917
|
+
}
|
|
918
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
919
|
+
module2.exports = function() {
|
|
920
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
921
|
+
if (secret === ReactPropTypesSecret) {
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
var err = new Error(
|
|
925
|
+
"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"
|
|
926
|
+
);
|
|
927
|
+
err.name = "Invariant Violation";
|
|
928
|
+
throw err;
|
|
929
|
+
}
|
|
930
|
+
;
|
|
931
|
+
shim.isRequired = shim;
|
|
932
|
+
function getShim() {
|
|
933
|
+
return shim;
|
|
934
|
+
}
|
|
935
|
+
;
|
|
936
|
+
var ReactPropTypes = {
|
|
937
|
+
array: shim,
|
|
938
|
+
bigint: shim,
|
|
939
|
+
bool: shim,
|
|
940
|
+
func: shim,
|
|
941
|
+
number: shim,
|
|
942
|
+
object: shim,
|
|
943
|
+
string: shim,
|
|
944
|
+
symbol: shim,
|
|
945
|
+
any: shim,
|
|
946
|
+
arrayOf: getShim,
|
|
947
|
+
element: shim,
|
|
948
|
+
elementType: shim,
|
|
949
|
+
instanceOf: getShim,
|
|
950
|
+
node: shim,
|
|
951
|
+
objectOf: getShim,
|
|
952
|
+
oneOf: getShim,
|
|
953
|
+
oneOfType: getShim,
|
|
954
|
+
shape: getShim,
|
|
955
|
+
exact: getShim,
|
|
956
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
957
|
+
resetWarningCache: emptyFunction
|
|
958
|
+
};
|
|
959
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
960
|
+
return ReactPropTypes;
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
// node_modules/prop-types/index.js
|
|
966
|
+
var require_prop_types = __commonJS({
|
|
967
|
+
"node_modules/prop-types/index.js"(exports2, module2) {
|
|
968
|
+
"use strict";
|
|
969
|
+
if (process.env.NODE_ENV !== "production") {
|
|
970
|
+
ReactIs = require_react_is();
|
|
971
|
+
throwOnDirectAccess = true;
|
|
972
|
+
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
973
|
+
} else {
|
|
974
|
+
module2.exports = require_factoryWithThrowingShims()();
|
|
975
|
+
}
|
|
976
|
+
var ReactIs;
|
|
977
|
+
var throwOnDirectAccess;
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
// src/bridges/stripe/index.ts
|
|
982
|
+
var stripe_exports = {};
|
|
983
|
+
__export(stripe_exports, {
|
|
984
|
+
useElements: () => useElements,
|
|
985
|
+
useStripe: () => useStripe,
|
|
986
|
+
useStripePayment: () => useStripePayment
|
|
987
|
+
});
|
|
988
|
+
module.exports = __toCommonJS(stripe_exports);
|
|
989
|
+
|
|
990
|
+
// node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs
|
|
991
|
+
var import_react = __toESM(require("react"), 1);
|
|
992
|
+
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
993
|
+
function ownKeys(object, enumerableOnly) {
|
|
994
|
+
var keys = Object.keys(object);
|
|
995
|
+
if (Object.getOwnPropertySymbols) {
|
|
996
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
997
|
+
if (enumerableOnly) {
|
|
998
|
+
symbols = symbols.filter(function(sym) {
|
|
999
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
keys.push.apply(keys, symbols);
|
|
1003
|
+
}
|
|
1004
|
+
return keys;
|
|
1005
|
+
}
|
|
1006
|
+
function _objectSpread2(target) {
|
|
1007
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1008
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
1009
|
+
if (i % 2) {
|
|
1010
|
+
ownKeys(Object(source), true).forEach(function(key) {
|
|
1011
|
+
_defineProperty(target, key, source[key]);
|
|
1012
|
+
});
|
|
1013
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
1014
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1015
|
+
} else {
|
|
1016
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
1017
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
return target;
|
|
1022
|
+
}
|
|
1023
|
+
function _typeof(obj) {
|
|
1024
|
+
"@babel/helpers - typeof";
|
|
1025
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
1026
|
+
_typeof = function(obj2) {
|
|
1027
|
+
return typeof obj2;
|
|
1028
|
+
};
|
|
1029
|
+
} else {
|
|
1030
|
+
_typeof = function(obj2) {
|
|
1031
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
return _typeof(obj);
|
|
1035
|
+
}
|
|
1036
|
+
function _defineProperty(obj, key, value) {
|
|
1037
|
+
if (key in obj) {
|
|
1038
|
+
Object.defineProperty(obj, key, {
|
|
1039
|
+
value,
|
|
1040
|
+
enumerable: true,
|
|
1041
|
+
configurable: true,
|
|
1042
|
+
writable: true
|
|
1043
|
+
});
|
|
1044
|
+
} else {
|
|
1045
|
+
obj[key] = value;
|
|
1046
|
+
}
|
|
1047
|
+
return obj;
|
|
1048
|
+
}
|
|
1049
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1050
|
+
if (source == null) return {};
|
|
1051
|
+
var target = {};
|
|
1052
|
+
var sourceKeys = Object.keys(source);
|
|
1053
|
+
var key, i;
|
|
1054
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1055
|
+
key = sourceKeys[i];
|
|
1056
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1057
|
+
target[key] = source[key];
|
|
1058
|
+
}
|
|
1059
|
+
return target;
|
|
1060
|
+
}
|
|
1061
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1062
|
+
if (source == null) return {};
|
|
1063
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
1064
|
+
var key, i;
|
|
1065
|
+
if (Object.getOwnPropertySymbols) {
|
|
1066
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1067
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1068
|
+
key = sourceSymbolKeys[i];
|
|
1069
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1070
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1071
|
+
target[key] = source[key];
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
return target;
|
|
1075
|
+
}
|
|
1076
|
+
function _slicedToArray(arr, i) {
|
|
1077
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1078
|
+
}
|
|
1079
|
+
function _arrayWithHoles(arr) {
|
|
1080
|
+
if (Array.isArray(arr)) return arr;
|
|
1081
|
+
}
|
|
1082
|
+
function _iterableToArrayLimit(arr, i) {
|
|
1083
|
+
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
|
|
1084
|
+
if (_i == null) return;
|
|
1085
|
+
var _arr = [];
|
|
1086
|
+
var _n = true;
|
|
1087
|
+
var _d = false;
|
|
1088
|
+
var _s, _e;
|
|
1089
|
+
try {
|
|
1090
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
1091
|
+
_arr.push(_s.value);
|
|
1092
|
+
if (i && _arr.length === i) break;
|
|
1093
|
+
}
|
|
1094
|
+
} catch (err) {
|
|
1095
|
+
_d = true;
|
|
1096
|
+
_e = err;
|
|
1097
|
+
} finally {
|
|
1098
|
+
try {
|
|
1099
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
1100
|
+
} finally {
|
|
1101
|
+
if (_d) throw _e;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
return _arr;
|
|
1105
|
+
}
|
|
1106
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
1107
|
+
if (!o) return;
|
|
1108
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1109
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1110
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1111
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1112
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1113
|
+
}
|
|
1114
|
+
function _arrayLikeToArray(arr, len) {
|
|
1115
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1116
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1117
|
+
return arr2;
|
|
1118
|
+
}
|
|
1119
|
+
function _nonIterableRest() {
|
|
1120
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1121
|
+
}
|
|
1122
|
+
var useAttachEvent = function useAttachEvent2(element, event, cb) {
|
|
1123
|
+
var cbDefined = !!cb;
|
|
1124
|
+
var cbRef = import_react.default.useRef(cb);
|
|
1125
|
+
import_react.default.useEffect(function() {
|
|
1126
|
+
cbRef.current = cb;
|
|
1127
|
+
}, [cb]);
|
|
1128
|
+
import_react.default.useEffect(function() {
|
|
1129
|
+
if (!cbDefined || !element) {
|
|
1130
|
+
return function() {
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
var decoratedCb = function decoratedCb2() {
|
|
1134
|
+
if (cbRef.current) {
|
|
1135
|
+
cbRef.current.apply(cbRef, arguments);
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
element.on(event, decoratedCb);
|
|
1139
|
+
return function() {
|
|
1140
|
+
element.off(event, decoratedCb);
|
|
1141
|
+
};
|
|
1142
|
+
}, [cbDefined, event, element, cbRef]);
|
|
1143
|
+
};
|
|
1144
|
+
var usePrevious = function usePrevious2(value) {
|
|
1145
|
+
var ref = import_react.default.useRef(value);
|
|
1146
|
+
import_react.default.useEffect(function() {
|
|
1147
|
+
ref.current = value;
|
|
1148
|
+
}, [value]);
|
|
1149
|
+
return ref.current;
|
|
1150
|
+
};
|
|
1151
|
+
var isUnknownObject = function isUnknownObject2(raw) {
|
|
1152
|
+
return raw !== null && _typeof(raw) === "object";
|
|
1153
|
+
};
|
|
1154
|
+
var isPromise = function isPromise2(raw) {
|
|
1155
|
+
return isUnknownObject(raw) && typeof raw.then === "function";
|
|
1156
|
+
};
|
|
1157
|
+
var isStripe = function isStripe2(raw) {
|
|
1158
|
+
return isUnknownObject(raw) && typeof raw.elements === "function" && typeof raw.createToken === "function" && typeof raw.createPaymentMethod === "function" && typeof raw.confirmCardPayment === "function";
|
|
1159
|
+
};
|
|
1160
|
+
var PLAIN_OBJECT_STR = "[object Object]";
|
|
1161
|
+
var isEqual = function isEqual2(left, right) {
|
|
1162
|
+
if (!isUnknownObject(left) || !isUnknownObject(right)) {
|
|
1163
|
+
return left === right;
|
|
1164
|
+
}
|
|
1165
|
+
var leftArray = Array.isArray(left);
|
|
1166
|
+
var rightArray = Array.isArray(right);
|
|
1167
|
+
if (leftArray !== rightArray) return false;
|
|
1168
|
+
var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;
|
|
1169
|
+
var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;
|
|
1170
|
+
if (leftPlainObject !== rightPlainObject) return false;
|
|
1171
|
+
if (!leftPlainObject && !leftArray) return left === right;
|
|
1172
|
+
var leftKeys = Object.keys(left);
|
|
1173
|
+
var rightKeys = Object.keys(right);
|
|
1174
|
+
if (leftKeys.length !== rightKeys.length) return false;
|
|
1175
|
+
var keySet = {};
|
|
1176
|
+
for (var i = 0; i < leftKeys.length; i += 1) {
|
|
1177
|
+
keySet[leftKeys[i]] = true;
|
|
1178
|
+
}
|
|
1179
|
+
for (var _i = 0; _i < rightKeys.length; _i += 1) {
|
|
1180
|
+
keySet[rightKeys[_i]] = true;
|
|
1181
|
+
}
|
|
1182
|
+
var allKeys = Object.keys(keySet);
|
|
1183
|
+
if (allKeys.length !== leftKeys.length) {
|
|
1184
|
+
return false;
|
|
1185
|
+
}
|
|
1186
|
+
var l = left;
|
|
1187
|
+
var r = right;
|
|
1188
|
+
var pred = function pred2(key) {
|
|
1189
|
+
return isEqual2(l[key], r[key]);
|
|
1190
|
+
};
|
|
1191
|
+
return allKeys.every(pred);
|
|
1192
|
+
};
|
|
1193
|
+
var extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates2(options, prevOptions, immutableKeys) {
|
|
1194
|
+
if (!isUnknownObject(options)) {
|
|
1195
|
+
return null;
|
|
1196
|
+
}
|
|
1197
|
+
return Object.keys(options).reduce(function(newOptions, key) {
|
|
1198
|
+
var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);
|
|
1199
|
+
if (immutableKeys.includes(key)) {
|
|
1200
|
+
if (isUpdated) {
|
|
1201
|
+
console.warn("Unsupported prop change: options.".concat(key, " is not a mutable property."));
|
|
1202
|
+
}
|
|
1203
|
+
return newOptions;
|
|
1204
|
+
}
|
|
1205
|
+
if (!isUpdated) {
|
|
1206
|
+
return newOptions;
|
|
1207
|
+
}
|
|
1208
|
+
return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));
|
|
1209
|
+
}, null);
|
|
1210
|
+
};
|
|
1211
|
+
var INVALID_STRIPE_ERROR$1 = "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.";
|
|
1212
|
+
var validateStripe = function validateStripe2(maybeStripe) {
|
|
1213
|
+
var errorMsg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : INVALID_STRIPE_ERROR$1;
|
|
1214
|
+
if (maybeStripe === null || isStripe(maybeStripe)) {
|
|
1215
|
+
return maybeStripe;
|
|
1216
|
+
}
|
|
1217
|
+
throw new Error(errorMsg);
|
|
1218
|
+
};
|
|
1219
|
+
var parseStripeProp = function parseStripeProp2(raw) {
|
|
1220
|
+
var errorMsg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : INVALID_STRIPE_ERROR$1;
|
|
1221
|
+
if (isPromise(raw)) {
|
|
1222
|
+
return {
|
|
1223
|
+
tag: "async",
|
|
1224
|
+
stripePromise: Promise.resolve(raw).then(function(result) {
|
|
1225
|
+
return validateStripe(result, errorMsg);
|
|
1226
|
+
})
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
var stripe = validateStripe(raw, errorMsg);
|
|
1230
|
+
if (stripe === null) {
|
|
1231
|
+
return {
|
|
1232
|
+
tag: "empty"
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
return {
|
|
1236
|
+
tag: "sync",
|
|
1237
|
+
stripe
|
|
1238
|
+
};
|
|
1239
|
+
};
|
|
1240
|
+
var registerWithStripeJs = function registerWithStripeJs2(stripe) {
|
|
1241
|
+
if (!stripe || !stripe._registerWrapper || !stripe.registerAppInfo) {
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1244
|
+
stripe._registerWrapper({
|
|
1245
|
+
name: "react-stripe-js",
|
|
1246
|
+
version: "5.6.0"
|
|
1247
|
+
});
|
|
1248
|
+
stripe.registerAppInfo({
|
|
1249
|
+
name: "react-stripe-js",
|
|
1250
|
+
version: "5.6.0",
|
|
1251
|
+
url: "https://stripe.com/docs/stripe-js/react"
|
|
1252
|
+
});
|
|
1253
|
+
};
|
|
1254
|
+
var ElementsContext = /* @__PURE__ */ import_react.default.createContext(null);
|
|
1255
|
+
ElementsContext.displayName = "ElementsContext";
|
|
1256
|
+
var parseElementsContext = function parseElementsContext2(ctx, useCase) {
|
|
1257
|
+
if (!ctx) {
|
|
1258
|
+
throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(useCase, " in an <Elements> provider."));
|
|
1259
|
+
}
|
|
1260
|
+
return ctx;
|
|
1261
|
+
};
|
|
1262
|
+
var Elements = function Elements2(_ref) {
|
|
1263
|
+
var rawStripeProp = _ref.stripe, options = _ref.options, children = _ref.children;
|
|
1264
|
+
var parsed = import_react.default.useMemo(function() {
|
|
1265
|
+
return parseStripeProp(rawStripeProp);
|
|
1266
|
+
}, [rawStripeProp]);
|
|
1267
|
+
var _React$useState = import_react.default.useState(function() {
|
|
1268
|
+
return {
|
|
1269
|
+
stripe: parsed.tag === "sync" ? parsed.stripe : null,
|
|
1270
|
+
elements: parsed.tag === "sync" ? parsed.stripe.elements(options) : null
|
|
1271
|
+
};
|
|
1272
|
+
}), _React$useState2 = _slicedToArray(_React$useState, 2), ctx = _React$useState2[0], setContext = _React$useState2[1];
|
|
1273
|
+
import_react.default.useEffect(function() {
|
|
1274
|
+
var isMounted = true;
|
|
1275
|
+
var safeSetContext = function safeSetContext2(stripe) {
|
|
1276
|
+
setContext(function(ctx2) {
|
|
1277
|
+
if (ctx2.stripe) return ctx2;
|
|
1278
|
+
return {
|
|
1279
|
+
stripe,
|
|
1280
|
+
elements: stripe.elements(options)
|
|
1281
|
+
};
|
|
1282
|
+
});
|
|
1283
|
+
};
|
|
1284
|
+
if (parsed.tag === "async" && !ctx.stripe) {
|
|
1285
|
+
parsed.stripePromise.then(function(stripe) {
|
|
1286
|
+
if (stripe && isMounted) {
|
|
1287
|
+
safeSetContext(stripe);
|
|
1288
|
+
}
|
|
1289
|
+
});
|
|
1290
|
+
} else if (parsed.tag === "sync" && !ctx.stripe) {
|
|
1291
|
+
safeSetContext(parsed.stripe);
|
|
1292
|
+
}
|
|
1293
|
+
return function() {
|
|
1294
|
+
isMounted = false;
|
|
1295
|
+
};
|
|
1296
|
+
}, [parsed, ctx, options]);
|
|
1297
|
+
var prevStripe = usePrevious(rawStripeProp);
|
|
1298
|
+
import_react.default.useEffect(function() {
|
|
1299
|
+
if (prevStripe !== null && prevStripe !== rawStripeProp) {
|
|
1300
|
+
console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
|
|
1301
|
+
}
|
|
1302
|
+
}, [prevStripe, rawStripeProp]);
|
|
1303
|
+
var prevOptions = usePrevious(options);
|
|
1304
|
+
import_react.default.useEffect(function() {
|
|
1305
|
+
if (!ctx.elements) {
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
var updates = extractAllowedOptionsUpdates(options, prevOptions, ["clientSecret", "fonts"]);
|
|
1309
|
+
if (updates) {
|
|
1310
|
+
ctx.elements.update(updates);
|
|
1311
|
+
}
|
|
1312
|
+
}, [options, prevOptions, ctx.elements]);
|
|
1313
|
+
import_react.default.useEffect(function() {
|
|
1314
|
+
registerWithStripeJs(ctx.stripe);
|
|
1315
|
+
}, [ctx.stripe]);
|
|
1316
|
+
return /* @__PURE__ */ import_react.default.createElement(ElementsContext.Provider, {
|
|
1317
|
+
value: ctx
|
|
1318
|
+
}, children);
|
|
1319
|
+
};
|
|
1320
|
+
Elements.propTypes = {
|
|
1321
|
+
stripe: import_prop_types.default.any,
|
|
1322
|
+
options: import_prop_types.default.object
|
|
1323
|
+
};
|
|
1324
|
+
var useElementsContextWithUseCase = function useElementsContextWithUseCase2(useCaseMessage) {
|
|
1325
|
+
var ctx = import_react.default.useContext(ElementsContext);
|
|
1326
|
+
return parseElementsContext(ctx, useCaseMessage);
|
|
1327
|
+
};
|
|
1328
|
+
var useElements = function useElements2() {
|
|
1329
|
+
var _useElementsContextWi = useElementsContextWithUseCase("calls useElements()"), elements = _useElementsContextWi.elements;
|
|
1330
|
+
return elements;
|
|
1331
|
+
};
|
|
1332
|
+
var ElementsConsumer = function ElementsConsumer2(_ref2) {
|
|
1333
|
+
var children = _ref2.children;
|
|
1334
|
+
var ctx = useElementsContextWithUseCase("mounts <ElementsConsumer>");
|
|
1335
|
+
return children(ctx);
|
|
1336
|
+
};
|
|
1337
|
+
ElementsConsumer.propTypes = {
|
|
1338
|
+
children: import_prop_types.default.func.isRequired
|
|
1339
|
+
};
|
|
1340
|
+
var CheckoutContext = /* @__PURE__ */ import_react.default.createContext(null);
|
|
1341
|
+
CheckoutContext.displayName = "CheckoutContext";
|
|
1342
|
+
({
|
|
1343
|
+
stripe: import_prop_types.default.any,
|
|
1344
|
+
options: import_prop_types.default.shape({
|
|
1345
|
+
clientSecret: import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.instanceOf(Promise)]).isRequired,
|
|
1346
|
+
elementsOptions: import_prop_types.default.object
|
|
1347
|
+
}).isRequired
|
|
1348
|
+
});
|
|
1349
|
+
var useElementsOrCheckoutContextWithUseCase = function useElementsOrCheckoutContextWithUseCase2(useCaseString) {
|
|
1350
|
+
var checkout = import_react.default.useContext(CheckoutContext);
|
|
1351
|
+
var elements = import_react.default.useContext(ElementsContext);
|
|
1352
|
+
if (checkout) {
|
|
1353
|
+
if (elements) {
|
|
1354
|
+
throw new Error("You cannot wrap the part of your app that ".concat(useCaseString, " in both <CheckoutProvider> and <Elements> providers."));
|
|
1355
|
+
} else {
|
|
1356
|
+
return checkout;
|
|
1357
|
+
}
|
|
1358
|
+
} else {
|
|
1359
|
+
return parseElementsContext(elements, useCaseString);
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
var _excluded = ["mode"];
|
|
1363
|
+
var capitalized = function capitalized2(str) {
|
|
1364
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1365
|
+
};
|
|
1366
|
+
var createElementComponent = function createElementComponent2(type, isServer2) {
|
|
1367
|
+
var displayName = "".concat(capitalized(type), "Element");
|
|
1368
|
+
var ClientElement = function ClientElement2(_ref) {
|
|
1369
|
+
var id = _ref.id, className = _ref.className, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options, onBlur = _ref.onBlur, onFocus = _ref.onFocus, onReady = _ref.onReady, onChange = _ref.onChange, onEscape = _ref.onEscape, onClick = _ref.onClick, onLoadError = _ref.onLoadError, onLoaderStart = _ref.onLoaderStart, onNetworksChange = _ref.onNetworksChange, onConfirm = _ref.onConfirm, onCancel = _ref.onCancel, onShippingAddressChange = _ref.onShippingAddressChange, onShippingRateChange = _ref.onShippingRateChange, onSavedPaymentMethodRemove = _ref.onSavedPaymentMethodRemove, onSavedPaymentMethodUpdate = _ref.onSavedPaymentMethodUpdate;
|
|
1370
|
+
var ctx = useElementsOrCheckoutContextWithUseCase("mounts <".concat(displayName, ">"));
|
|
1371
|
+
var elements = "elements" in ctx ? ctx.elements : null;
|
|
1372
|
+
var checkoutState = "checkoutState" in ctx ? ctx.checkoutState : null;
|
|
1373
|
+
var checkoutSdk = (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === "success" || (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === "loading" ? checkoutState.sdk : null;
|
|
1374
|
+
var _React$useState = import_react.default.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), element = _React$useState2[0], setElement = _React$useState2[1];
|
|
1375
|
+
var elementRef = import_react.default.useRef(null);
|
|
1376
|
+
var domNode = import_react.default.useRef(null);
|
|
1377
|
+
useAttachEvent(element, "blur", onBlur);
|
|
1378
|
+
useAttachEvent(element, "focus", onFocus);
|
|
1379
|
+
useAttachEvent(element, "escape", onEscape);
|
|
1380
|
+
useAttachEvent(element, "click", onClick);
|
|
1381
|
+
useAttachEvent(element, "loaderror", onLoadError);
|
|
1382
|
+
useAttachEvent(element, "loaderstart", onLoaderStart);
|
|
1383
|
+
useAttachEvent(element, "networkschange", onNetworksChange);
|
|
1384
|
+
useAttachEvent(element, "confirm", onConfirm);
|
|
1385
|
+
useAttachEvent(element, "cancel", onCancel);
|
|
1386
|
+
useAttachEvent(element, "shippingaddresschange", onShippingAddressChange);
|
|
1387
|
+
useAttachEvent(element, "shippingratechange", onShippingRateChange);
|
|
1388
|
+
useAttachEvent(element, "savedpaymentmethodremove", onSavedPaymentMethodRemove);
|
|
1389
|
+
useAttachEvent(element, "savedpaymentmethodupdate", onSavedPaymentMethodUpdate);
|
|
1390
|
+
useAttachEvent(element, "change", onChange);
|
|
1391
|
+
var readyCallback;
|
|
1392
|
+
if (onReady) {
|
|
1393
|
+
if (type === "expressCheckout") {
|
|
1394
|
+
readyCallback = onReady;
|
|
1395
|
+
} else {
|
|
1396
|
+
readyCallback = function readyCallback2() {
|
|
1397
|
+
onReady(element);
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
useAttachEvent(element, "ready", readyCallback);
|
|
1402
|
+
import_react.default.useLayoutEffect(function() {
|
|
1403
|
+
if (elementRef.current === null && domNode.current !== null && (elements || checkoutSdk)) {
|
|
1404
|
+
var newElement = null;
|
|
1405
|
+
if (checkoutSdk) {
|
|
1406
|
+
switch (type) {
|
|
1407
|
+
case "paymentForm":
|
|
1408
|
+
newElement = checkoutSdk.createPaymentFormElement(options);
|
|
1409
|
+
break;
|
|
1410
|
+
case "payment":
|
|
1411
|
+
newElement = checkoutSdk.createPaymentElement(options);
|
|
1412
|
+
break;
|
|
1413
|
+
case "address":
|
|
1414
|
+
if ("mode" in options) {
|
|
1415
|
+
var mode = options.mode, restOptions = _objectWithoutProperties(options, _excluded);
|
|
1416
|
+
if (mode === "shipping") {
|
|
1417
|
+
newElement = checkoutSdk.createShippingAddressElement(restOptions);
|
|
1418
|
+
} else if (mode === "billing") {
|
|
1419
|
+
newElement = checkoutSdk.createBillingAddressElement(restOptions);
|
|
1420
|
+
} else {
|
|
1421
|
+
throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
1422
|
+
}
|
|
1423
|
+
} else {
|
|
1424
|
+
throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
|
|
1425
|
+
}
|
|
1426
|
+
break;
|
|
1427
|
+
case "expressCheckout":
|
|
1428
|
+
newElement = checkoutSdk.createExpressCheckoutElement(options);
|
|
1429
|
+
break;
|
|
1430
|
+
case "currencySelector":
|
|
1431
|
+
newElement = checkoutSdk.createCurrencySelectorElement();
|
|
1432
|
+
break;
|
|
1433
|
+
case "taxId":
|
|
1434
|
+
newElement = checkoutSdk.createTaxIdElement(options);
|
|
1435
|
+
break;
|
|
1436
|
+
default:
|
|
1437
|
+
throw new Error("Invalid Element type ".concat(displayName, ". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."));
|
|
1438
|
+
}
|
|
1439
|
+
} else if (elements) {
|
|
1440
|
+
newElement = elements.create(type, options);
|
|
1441
|
+
}
|
|
1442
|
+
elementRef.current = newElement;
|
|
1443
|
+
setElement(newElement);
|
|
1444
|
+
if (newElement) {
|
|
1445
|
+
newElement.mount(domNode.current);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
}, [elements, checkoutSdk, options]);
|
|
1449
|
+
var prevOptions = usePrevious(options);
|
|
1450
|
+
import_react.default.useEffect(function() {
|
|
1451
|
+
if (!elementRef.current) {
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
var updates = extractAllowedOptionsUpdates(options, prevOptions, ["paymentRequest"]);
|
|
1455
|
+
if (updates && "update" in elementRef.current) {
|
|
1456
|
+
elementRef.current.update(updates);
|
|
1457
|
+
}
|
|
1458
|
+
}, [options, prevOptions]);
|
|
1459
|
+
import_react.default.useLayoutEffect(function() {
|
|
1460
|
+
return function() {
|
|
1461
|
+
if (elementRef.current && typeof elementRef.current.destroy === "function") {
|
|
1462
|
+
try {
|
|
1463
|
+
elementRef.current.destroy();
|
|
1464
|
+
elementRef.current = null;
|
|
1465
|
+
} catch (error) {
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
}, []);
|
|
1470
|
+
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
1471
|
+
id,
|
|
1472
|
+
className,
|
|
1473
|
+
ref: domNode
|
|
1474
|
+
});
|
|
1475
|
+
};
|
|
1476
|
+
var ServerElement = function ServerElement2(props) {
|
|
1477
|
+
useElementsOrCheckoutContextWithUseCase("mounts <".concat(displayName, ">"));
|
|
1478
|
+
var id = props.id, className = props.className;
|
|
1479
|
+
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
1480
|
+
id,
|
|
1481
|
+
className
|
|
1482
|
+
});
|
|
1483
|
+
};
|
|
1484
|
+
var Element = isServer2 ? ServerElement : ClientElement;
|
|
1485
|
+
Element.propTypes = {
|
|
1486
|
+
id: import_prop_types.default.string,
|
|
1487
|
+
className: import_prop_types.default.string,
|
|
1488
|
+
onChange: import_prop_types.default.func,
|
|
1489
|
+
onBlur: import_prop_types.default.func,
|
|
1490
|
+
onFocus: import_prop_types.default.func,
|
|
1491
|
+
onReady: import_prop_types.default.func,
|
|
1492
|
+
onEscape: import_prop_types.default.func,
|
|
1493
|
+
onClick: import_prop_types.default.func,
|
|
1494
|
+
onLoadError: import_prop_types.default.func,
|
|
1495
|
+
onLoaderStart: import_prop_types.default.func,
|
|
1496
|
+
onNetworksChange: import_prop_types.default.func,
|
|
1497
|
+
onConfirm: import_prop_types.default.func,
|
|
1498
|
+
onCancel: import_prop_types.default.func,
|
|
1499
|
+
onShippingAddressChange: import_prop_types.default.func,
|
|
1500
|
+
onShippingRateChange: import_prop_types.default.func,
|
|
1501
|
+
onSavedPaymentMethodRemove: import_prop_types.default.func,
|
|
1502
|
+
onSavedPaymentMethodUpdate: import_prop_types.default.func,
|
|
1503
|
+
options: import_prop_types.default.object
|
|
1504
|
+
};
|
|
1505
|
+
Element.displayName = displayName;
|
|
1506
|
+
Element.__elementType = type;
|
|
1507
|
+
return Element;
|
|
1508
|
+
};
|
|
1509
|
+
var isServer = typeof window === "undefined";
|
|
1510
|
+
var EmbeddedCheckoutContext = /* @__PURE__ */ import_react.default.createContext(null);
|
|
1511
|
+
EmbeddedCheckoutContext.displayName = "EmbeddedCheckoutProviderContext";
|
|
1512
|
+
var useStripe = function useStripe2() {
|
|
1513
|
+
var _useElementsOrCheckou = useElementsOrCheckoutContextWithUseCase("calls useStripe()"), stripe = _useElementsOrCheckou.stripe;
|
|
1514
|
+
return stripe;
|
|
1515
|
+
};
|
|
1516
|
+
var AuBankAccountElement = createElementComponent("auBankAccount", isServer);
|
|
1517
|
+
var CardElement = createElementComponent("card", isServer);
|
|
1518
|
+
var CardNumberElement = createElementComponent("cardNumber", isServer);
|
|
1519
|
+
var CardExpiryElement = createElementComponent("cardExpiry", isServer);
|
|
1520
|
+
var CardCvcElement = createElementComponent("cardCvc", isServer);
|
|
1521
|
+
var IbanElement = createElementComponent("iban", isServer);
|
|
1522
|
+
var PaymentElement = createElementComponent("payment", isServer);
|
|
1523
|
+
var ExpressCheckoutElement = createElementComponent("expressCheckout", isServer);
|
|
1524
|
+
var PaymentRequestButtonElement = createElementComponent("paymentRequestButton", isServer);
|
|
1525
|
+
var LinkAuthenticationElement = createElementComponent("linkAuthentication", isServer);
|
|
1526
|
+
var AddressElement = createElementComponent("address", isServer);
|
|
1527
|
+
var ShippingAddressElement = createElementComponent("shippingAddress", isServer);
|
|
1528
|
+
var PaymentMethodMessagingElement = createElementComponent("paymentMethodMessaging", isServer);
|
|
1529
|
+
var TaxIdElement = createElementComponent("taxId", isServer);
|
|
1530
|
+
|
|
1531
|
+
// src/bridges/stripe/index.ts
|
|
1532
|
+
function useStripePayment() {
|
|
1533
|
+
const stripe = useStripe();
|
|
1534
|
+
const elements = useElements();
|
|
1535
|
+
return { stripe, elements, ready: !!stripe && !!elements };
|
|
1536
|
+
}
|
|
1537
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1538
|
+
0 && (module.exports = {
|
|
1539
|
+
useElements,
|
|
1540
|
+
useStripe,
|
|
1541
|
+
useStripePayment
|
|
1542
|
+
});
|
|
1543
|
+
/*! Bundled license information:
|
|
1544
|
+
|
|
1545
|
+
react-is/cjs/react-is.production.min.js:
|
|
1546
|
+
(** @license React v16.13.1
|
|
1547
|
+
* react-is.production.min.js
|
|
1548
|
+
*
|
|
1549
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1550
|
+
*
|
|
1551
|
+
* This source code is licensed under the MIT license found in the
|
|
1552
|
+
* LICENSE file in the root directory of this source tree.
|
|
1553
|
+
*)
|
|
1554
|
+
|
|
1555
|
+
react-is/cjs/react-is.development.js:
|
|
1556
|
+
(** @license React v16.13.1
|
|
1557
|
+
* react-is.development.js
|
|
1558
|
+
*
|
|
1559
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1560
|
+
*
|
|
1561
|
+
* This source code is licensed under the MIT license found in the
|
|
1562
|
+
* LICENSE file in the root directory of this source tree.
|
|
1563
|
+
*)
|
|
1564
|
+
|
|
1565
|
+
object-assign/index.js:
|
|
1566
|
+
(*
|
|
1567
|
+
object-assign
|
|
1568
|
+
(c) Sindre Sorhus
|
|
1569
|
+
@license MIT
|
|
1570
|
+
*)
|
|
1571
|
+
*/
|
|
1572
|
+
//# sourceMappingURL=stripe.js.map
|