@valbuild/tanstack 0.124.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/LICENSE.md +7 -0
- package/README.md +380 -0
- package/client/dist/valbuild-tanstack-client.cjs.d.ts +2 -0
- package/client/dist/valbuild-tanstack-client.cjs.dev.js +288 -0
- package/client/dist/valbuild-tanstack-client.cjs.js +7 -0
- package/client/dist/valbuild-tanstack-client.cjs.prod.js +288 -0
- package/client/dist/valbuild-tanstack-client.esm.js +280 -0
- package/client/package.json +4 -0
- package/dist/ValOverlayContext-87cb022d.esm.js +284 -0
- package/dist/ValOverlayContext-abd6ab9a.cjs.prod.js +292 -0
- package/dist/ValOverlayContext-d3bfacb1.cjs.dev.js +292 -0
- package/dist/createForOfIteratorHelper-0324e063.cjs.prod.js +157 -0
- package/dist/createForOfIteratorHelper-485c2ce1.esm.js +151 -0
- package/dist/createForOfIteratorHelper-e75681d7.cjs.dev.js +157 -0
- package/dist/declarations/src/ValApp.d.ts +6 -0
- package/dist/declarations/src/ValImage.d.ts +24 -0
- package/dist/declarations/src/ValModulesClient.d.ts +34 -0
- package/dist/declarations/src/ValProvider.d.ts +6 -0
- package/dist/declarations/src/ValTypes.d.ts +4 -0
- package/dist/declarations/src/client/index.d.ts +1 -0
- package/dist/declarations/src/client/initValClient.d.ts +27 -0
- package/dist/declarations/src/decodeValPathsOfString.d.ts +2 -0
- package/dist/declarations/src/external_exempt_from_val_quickjs.d.ts +41 -0
- package/dist/declarations/src/getUnpatchedUnencodedVal.d.ts +3 -0
- package/dist/declarations/src/index.d.ts +2 -0
- package/dist/declarations/src/initVal.d.ts +74 -0
- package/dist/declarations/src/server/index.d.ts +5 -0
- package/dist/declarations/src/server/initValContent.d.ts +122 -0
- package/dist/declarations/src/server/initValMcp.d.ts +27 -0
- package/dist/declarations/src/server/initValServer.d.ts +41 -0
- package/dist/declarations/src/server/valDraftMode.d.ts +49 -0
- package/dist/declarations/src/version.d.ts +1 -0
- package/dist/routeFromVal-6693e037.cjs.prod.js +218 -0
- package/dist/routeFromVal-728295a0.esm.js +212 -0
- package/dist/routeFromVal-a9147ceb.cjs.dev.js +218 -0
- package/dist/valbuild-tanstack.cjs.d.ts +2 -0
- package/dist/valbuild-tanstack.cjs.dev.js +2005 -0
- package/dist/valbuild-tanstack.cjs.js +7 -0
- package/dist/valbuild-tanstack.cjs.prod.js +2005 -0
- package/dist/valbuild-tanstack.esm.js +1950 -0
- package/dist/version-1a88fd21.cjs.dev.js +229 -0
- package/dist/version-5ac70ccf.cjs.prod.js +229 -0
- package/dist/version-ac8df696.esm.js +225 -0
- package/package.json +84 -0
- package/server/dist/valbuild-tanstack-server.cjs.d.ts +2 -0
- package/server/dist/valbuild-tanstack-server.cjs.dev.js +1032 -0
- package/server/dist/valbuild-tanstack-server.cjs.js +7 -0
- package/server/dist/valbuild-tanstack-server.cjs.prod.js +1032 -0
- package/server/dist/valbuild-tanstack-server.esm.js +1005 -0
- package/server/package.json +4 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createForOfIteratorHelper = require('./createForOfIteratorHelper-e75681d7.cjs.dev.js');
|
|
4
|
+
var patch = require('@valbuild/core/patch');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
+
|
|
12
|
+
function _classCallCheck(a, n) {
|
|
13
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function _defineProperties(e, r) {
|
|
17
|
+
for (var t = 0; t < r.length; t++) {
|
|
18
|
+
var o = r[t];
|
|
19
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, createForOfIteratorHelper._toPropertyKey(o.key), o);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function _createClass(e, r, t) {
|
|
23
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
24
|
+
writable: !1
|
|
25
|
+
}), e;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var LOAD_TIMEOUT_MS = 10000;
|
|
29
|
+
var ValExternalStore = /*#__PURE__*/function () {
|
|
30
|
+
// Path-keyed cache of every source seen via update(). The single source of
|
|
31
|
+
// truth: load state and snapshots are both derived from this, so data can be
|
|
32
|
+
// queried for any combination of paths even before a subscriber registers.
|
|
33
|
+
|
|
34
|
+
// Reference-stable per-subscriberId snapshot cache for useSyncExternalStore.
|
|
35
|
+
// Built lazily from loadedSources in get() and invalidated in update().
|
|
36
|
+
|
|
37
|
+
// One-shot listeners used solely by waitForLoad. Kept separate from the
|
|
38
|
+
// useSyncExternalStore listeners so waitForLoad never has to register (and
|
|
39
|
+
// leak) a subscriberId.
|
|
40
|
+
|
|
41
|
+
function ValExternalStore() {
|
|
42
|
+
var _this = this;
|
|
43
|
+
_classCallCheck(this, ValExternalStore);
|
|
44
|
+
createForOfIteratorHelper._defineProperty(this, "subscribe", function (paths) {
|
|
45
|
+
return function (listener) {
|
|
46
|
+
var subscriberId = createSubscriberId(paths);
|
|
47
|
+
var existing = _this.listeners.get(subscriberId);
|
|
48
|
+
if (existing) {
|
|
49
|
+
existing.push(listener);
|
|
50
|
+
} else {
|
|
51
|
+
_this.listeners.set(subscriberId, [listener]);
|
|
52
|
+
}
|
|
53
|
+
return function () {
|
|
54
|
+
var current = _this.listeners.get(subscriberId);
|
|
55
|
+
if (!current) return;
|
|
56
|
+
var idx = current.indexOf(listener);
|
|
57
|
+
if (idx >= 0) current.splice(idx, 1);
|
|
58
|
+
if (current.length === 0) _this.listeners["delete"](subscriberId);
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
createForOfIteratorHelper._defineProperty(this, "getSnapshot", function (paths) {
|
|
63
|
+
return function () {
|
|
64
|
+
return _this.get(paths);
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
createForOfIteratorHelper._defineProperty(this, "getServerSnapshot", function (paths) {
|
|
68
|
+
return function () {
|
|
69
|
+
return _this.get(paths);
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
createForOfIteratorHelper._defineProperty(this, "get", function (paths) {
|
|
73
|
+
var subscriberId = createSubscriberId(paths);
|
|
74
|
+
if (_this.snapshots.has(subscriberId)) {
|
|
75
|
+
return _this.snapshots.get(subscriberId);
|
|
76
|
+
}
|
|
77
|
+
// Build the snapshot from the path-keyed loadedSources so data that arrived
|
|
78
|
+
// before this subscriber registered is still returned. Cache it for a
|
|
79
|
+
// reference-stable result (required by useSyncExternalStore).
|
|
80
|
+
var record;
|
|
81
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(paths),
|
|
82
|
+
_step;
|
|
83
|
+
try {
|
|
84
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
85
|
+
var p = _step.value;
|
|
86
|
+
// Json never holds `undefined`, so a defined value means the path loaded.
|
|
87
|
+
var loaded = _this.loadedSources.get(p);
|
|
88
|
+
if (loaded !== undefined) {
|
|
89
|
+
if (!record) {
|
|
90
|
+
record = {};
|
|
91
|
+
}
|
|
92
|
+
record[p] = loaded;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
} catch (err) {
|
|
96
|
+
_iterator.e(err);
|
|
97
|
+
} finally {
|
|
98
|
+
_iterator.f();
|
|
99
|
+
}
|
|
100
|
+
_this.snapshots.set(subscriberId, record);
|
|
101
|
+
return record;
|
|
102
|
+
});
|
|
103
|
+
createForOfIteratorHelper._defineProperty(this, "hasAllLoaded", function (paths) {
|
|
104
|
+
var _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(paths),
|
|
105
|
+
_step2;
|
|
106
|
+
try {
|
|
107
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
108
|
+
var p = _step2.value;
|
|
109
|
+
if (!_this.loadedSources.has(p)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} catch (err) {
|
|
114
|
+
_iterator2.e(err);
|
|
115
|
+
} finally {
|
|
116
|
+
_iterator2.f();
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* Returns a cached promise that resolves once `update()` has populated
|
|
122
|
+
* every path in `paths`. The same promise instance is returned for the
|
|
123
|
+
* same paths until it resolves — required so `React.use` / classic
|
|
124
|
+
* Suspense doesn't re-suspend on every render.
|
|
125
|
+
*
|
|
126
|
+
* If the data never arrives (network failure, a path that is never
|
|
127
|
+
* `update()`'d, a typo in a module path) the promise would otherwise hang
|
|
128
|
+
* forever and keep the Suspense boundary in its fallback. To avoid a silent
|
|
129
|
+
* hang it resolves anyway after `LOAD_TIMEOUT_MS`, logging an error so the
|
|
130
|
+
* failure is diagnosable while the page still renders with partial data.
|
|
131
|
+
*/
|
|
132
|
+
createForOfIteratorHelper._defineProperty(this, "waitForLoad", function (paths) {
|
|
133
|
+
if (_this.hasAllLoaded(paths)) {
|
|
134
|
+
return Promise.resolve();
|
|
135
|
+
}
|
|
136
|
+
var subscriberId = createSubscriberId(paths);
|
|
137
|
+
var existing = _this.loadPromises.get(subscriberId);
|
|
138
|
+
if (existing) {
|
|
139
|
+
return existing;
|
|
140
|
+
}
|
|
141
|
+
var promise = new Promise(function (resolve) {
|
|
142
|
+
var cleanup = function cleanup() {
|
|
143
|
+
clearTimeout(timeout);
|
|
144
|
+
_this.loadListeners["delete"](listener);
|
|
145
|
+
_this.loadPromises["delete"](subscriberId);
|
|
146
|
+
};
|
|
147
|
+
var listener = function listener() {
|
|
148
|
+
if (_this.hasAllLoaded(paths)) {
|
|
149
|
+
cleanup();
|
|
150
|
+
resolve();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var timeout = setTimeout(function () {
|
|
154
|
+
var missing = paths.filter(function (p) {
|
|
155
|
+
return !_this.loadedSources.has(p);
|
|
156
|
+
});
|
|
157
|
+
console.error("Val: draft module(s) did not load within ".concat(LOAD_TIMEOUT_MS, "ms; rendering with partial data. Missing: ").concat(missing.join(", ")));
|
|
158
|
+
cleanup();
|
|
159
|
+
resolve();
|
|
160
|
+
}, LOAD_TIMEOUT_MS);
|
|
161
|
+
// Don't let the pending timer keep a Node process (e.g. the test runner
|
|
162
|
+
// or SSR) alive; setTimeout returns a number in the browser, where there
|
|
163
|
+
// is nothing to unref.
|
|
164
|
+
if (typeof timeout !== "number") {
|
|
165
|
+
timeout.unref();
|
|
166
|
+
}
|
|
167
|
+
_this.loadListeners.add(listener);
|
|
168
|
+
});
|
|
169
|
+
_this.loadPromises.set(subscriberId, promise);
|
|
170
|
+
return promise;
|
|
171
|
+
});
|
|
172
|
+
this.listeners = new Map();
|
|
173
|
+
this.loadPromises = new Map();
|
|
174
|
+
this.loadedSources = new Map();
|
|
175
|
+
this.snapshots = new Map();
|
|
176
|
+
this.loadListeners = new Set();
|
|
177
|
+
}
|
|
178
|
+
return _createClass(ValExternalStore, [{
|
|
179
|
+
key: "update",
|
|
180
|
+
value:
|
|
181
|
+
/**
|
|
182
|
+
* Take a module's source from the editor.
|
|
183
|
+
*
|
|
184
|
+
* Returns whether this actually MOVED the value, which the caller needs and
|
|
185
|
+
* cannot work out for itself: the same source arrives more than once by
|
|
186
|
+
* design. The editor sends a catch-up snapshot of everything it holds every
|
|
187
|
+
* time the page becomes a new document — a reload, or the one the dev server does
|
|
188
|
+
* when a publish rewrites the `.val.ts` files — and most of that snapshot is
|
|
189
|
+
* content this page already has.
|
|
190
|
+
*
|
|
191
|
+
* Without the answer, `ValTanStackProvider` armed its `router.invalidate()` loop on
|
|
192
|
+
* the arrival rather than on the change, so every publish bought a whole-route
|
|
193
|
+
* request whether or not the page was out of date. With auto-save on that is
|
|
194
|
+
* one per pause in typing, which in development is a re-render (and sometimes
|
|
195
|
+
* a recompile) of the page — and it is what leaves the canvas looking
|
|
196
|
+
* permanently busy.
|
|
197
|
+
*/
|
|
198
|
+
function update(path, source) {
|
|
199
|
+
// `Json` has no `undefined`, so absent and "stored as undefined" cannot be
|
|
200
|
+
// confused: a miss here means this page has never been given this module.
|
|
201
|
+
var before = this.loadedSources.get(path);
|
|
202
|
+
var changed = before === undefined || !patch.deepEqual(before, source);
|
|
203
|
+
this.loadedSources.set(path, source);
|
|
204
|
+
if (!changed) {
|
|
205
|
+
// Nothing downstream to do: every subscriber's snapshot still answers
|
|
206
|
+
// with the same value, so invalidating them would be a re-render that
|
|
207
|
+
// shows exactly what is already on screen.
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
// Invalidate cached snapshots that include this path so the next get()
|
|
211
|
+
// rebuilds a fresh (new-reference) record, then notify their listeners.
|
|
212
|
+
for (var _i = 0, _Array$from = Array.from(this.snapshots.keys()); _i < _Array$from.length; _i++) {
|
|
213
|
+
var subscriberId = _Array$from[_i];
|
|
214
|
+
if (subscriberId.includes(path)) {
|
|
215
|
+
// TODO: hash paths instead
|
|
216
|
+
this.snapshots["delete"](subscriberId);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
var _iterator3 = createForOfIteratorHelper._createForOfIteratorHelper(this.listeners.keys()),
|
|
220
|
+
_step3;
|
|
221
|
+
try {
|
|
222
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
223
|
+
var _subscriberId = _step3.value;
|
|
224
|
+
if (_subscriberId.includes(path)) {
|
|
225
|
+
this.emitChange(_subscriberId);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
} catch (err) {
|
|
229
|
+
_iterator3.e(err);
|
|
230
|
+
} finally {
|
|
231
|
+
_iterator3.f();
|
|
232
|
+
}
|
|
233
|
+
for (var _i2 = 0, _Array$from2 = Array.from(this.loadListeners); _i2 < _Array$from2.length; _i2++) {
|
|
234
|
+
var listener = _Array$from2[_i2];
|
|
235
|
+
listener();
|
|
236
|
+
}
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "emitChange",
|
|
241
|
+
value: function emitChange(subscriberId) {
|
|
242
|
+
var _this$listeners$get;
|
|
243
|
+
var _iterator4 = createForOfIteratorHelper._createForOfIteratorHelper((_this$listeners$get = this.listeners.get(subscriberId)) !== null && _this$listeners$get !== void 0 ? _this$listeners$get : []),
|
|
244
|
+
_step4;
|
|
245
|
+
try {
|
|
246
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
247
|
+
var listener = _step4.value;
|
|
248
|
+
listener();
|
|
249
|
+
}
|
|
250
|
+
} catch (err) {
|
|
251
|
+
_iterator4.e(err);
|
|
252
|
+
} finally {
|
|
253
|
+
_iterator4.f();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}]);
|
|
257
|
+
}();
|
|
258
|
+
function createSubscriberId(paths) {
|
|
259
|
+
return paths.slice().sort().join("&");
|
|
260
|
+
}
|
|
261
|
+
var ValOverlayContext = /*#__PURE__*/React__default["default"].createContext({
|
|
262
|
+
store: undefined,
|
|
263
|
+
draftMode: false,
|
|
264
|
+
suspend: false,
|
|
265
|
+
draftModeReady: undefined,
|
|
266
|
+
draftSourcesSynced: false
|
|
267
|
+
});
|
|
268
|
+
function ValOverlayProvider(_ref) {
|
|
269
|
+
var store = _ref.store,
|
|
270
|
+
draftMode = _ref.draftMode,
|
|
271
|
+
suspend = _ref.suspend,
|
|
272
|
+
draftModeReady = _ref.draftModeReady,
|
|
273
|
+
draftSourcesSynced = _ref.draftSourcesSynced,
|
|
274
|
+
children = _ref.children;
|
|
275
|
+
return /*#__PURE__*/jsxRuntime.jsx(ValOverlayContext.Provider, {
|
|
276
|
+
value: {
|
|
277
|
+
store: store,
|
|
278
|
+
draftMode: draftMode,
|
|
279
|
+
suspend: suspend,
|
|
280
|
+
draftModeReady: draftModeReady,
|
|
281
|
+
draftSourcesSynced: draftSourcesSynced
|
|
282
|
+
},
|
|
283
|
+
children: children
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
var useValOverlayContext = function useValOverlayContext() {
|
|
287
|
+
return React__default["default"].useContext(ValOverlayContext);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
exports.ValExternalStore = ValExternalStore;
|
|
291
|
+
exports.ValOverlayProvider = ValOverlayProvider;
|
|
292
|
+
exports.useValOverlayContext = useValOverlayContext;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _toPrimitive(t, r) {
|
|
4
|
+
if ("object" != typeof t || !t) return t;
|
|
5
|
+
var e = t[Symbol.toPrimitive];
|
|
6
|
+
if (void 0 !== e) {
|
|
7
|
+
var i = e.call(t, r || "default");
|
|
8
|
+
if ("object" != typeof i) return i;
|
|
9
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
10
|
+
}
|
|
11
|
+
return ("string" === r ? String : Number)(t);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function _toPropertyKey(t) {
|
|
15
|
+
var i = _toPrimitive(t, "string");
|
|
16
|
+
return "symbol" == typeof i ? i : i + "";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _defineProperty(e, r, t) {
|
|
20
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
21
|
+
value: t,
|
|
22
|
+
enumerable: !0,
|
|
23
|
+
configurable: !0,
|
|
24
|
+
writable: !0
|
|
25
|
+
}) : e[r] = t, e;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function ownKeys(e, r) {
|
|
29
|
+
var t = Object.keys(e);
|
|
30
|
+
if (Object.getOwnPropertySymbols) {
|
|
31
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
32
|
+
r && (o = o.filter(function (r) {
|
|
33
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
34
|
+
})), t.push.apply(t, o);
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
}
|
|
38
|
+
function _objectSpread2(e) {
|
|
39
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
40
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
41
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
42
|
+
_defineProperty(e, r, t[r]);
|
|
43
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
44
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return e;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function _arrayWithHoles(r) {
|
|
51
|
+
if (Array.isArray(r)) return r;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _iterableToArrayLimit(r, l) {
|
|
55
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
56
|
+
if (null != t) {
|
|
57
|
+
var e,
|
|
58
|
+
n,
|
|
59
|
+
i,
|
|
60
|
+
u,
|
|
61
|
+
a = [],
|
|
62
|
+
f = !0,
|
|
63
|
+
o = !1;
|
|
64
|
+
try {
|
|
65
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
66
|
+
if (Object(t) !== t) return;
|
|
67
|
+
f = !1;
|
|
68
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
69
|
+
} catch (r) {
|
|
70
|
+
o = !0, n = r;
|
|
71
|
+
} finally {
|
|
72
|
+
try {
|
|
73
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
74
|
+
} finally {
|
|
75
|
+
if (o) throw n;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return a;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function _arrayLikeToArray(r, a) {
|
|
83
|
+
(null == a || a > r.length) && (a = r.length);
|
|
84
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
85
|
+
return n;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _unsupportedIterableToArray(r, a) {
|
|
89
|
+
if (r) {
|
|
90
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
91
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
92
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function _nonIterableRest() {
|
|
97
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function _slicedToArray(r, e) {
|
|
101
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _createForOfIteratorHelper(r, e) {
|
|
105
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
106
|
+
if (!t) {
|
|
107
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
108
|
+
t && (r = t);
|
|
109
|
+
var n = 0,
|
|
110
|
+
F = function () {};
|
|
111
|
+
return {
|
|
112
|
+
s: F,
|
|
113
|
+
n: function () {
|
|
114
|
+
return n >= r.length ? {
|
|
115
|
+
done: !0
|
|
116
|
+
} : {
|
|
117
|
+
done: !1,
|
|
118
|
+
value: r[n++]
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
e: function (r) {
|
|
122
|
+
throw r;
|
|
123
|
+
},
|
|
124
|
+
f: F
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
128
|
+
}
|
|
129
|
+
var o,
|
|
130
|
+
a = !0,
|
|
131
|
+
u = !1;
|
|
132
|
+
return {
|
|
133
|
+
s: function () {
|
|
134
|
+
t = t.call(r);
|
|
135
|
+
},
|
|
136
|
+
n: function () {
|
|
137
|
+
var r = t.next();
|
|
138
|
+
return a = r.done, r;
|
|
139
|
+
},
|
|
140
|
+
e: function (r) {
|
|
141
|
+
u = !0, o = r;
|
|
142
|
+
},
|
|
143
|
+
f: function () {
|
|
144
|
+
try {
|
|
145
|
+
a || null == t.return || t.return();
|
|
146
|
+
} finally {
|
|
147
|
+
if (u) throw o;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
exports._createForOfIteratorHelper = _createForOfIteratorHelper;
|
|
154
|
+
exports._defineProperty = _defineProperty;
|
|
155
|
+
exports._objectSpread2 = _objectSpread2;
|
|
156
|
+
exports._slicedToArray = _slicedToArray;
|
|
157
|
+
exports._toPropertyKey = _toPropertyKey;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
function _toPrimitive(t, r) {
|
|
2
|
+
if ("object" != typeof t || !t) return t;
|
|
3
|
+
var e = t[Symbol.toPrimitive];
|
|
4
|
+
if (void 0 !== e) {
|
|
5
|
+
var i = e.call(t, r || "default");
|
|
6
|
+
if ("object" != typeof i) return i;
|
|
7
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
8
|
+
}
|
|
9
|
+
return ("string" === r ? String : Number)(t);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function _toPropertyKey(t) {
|
|
13
|
+
var i = _toPrimitive(t, "string");
|
|
14
|
+
return "symbol" == typeof i ? i : i + "";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _defineProperty(e, r, t) {
|
|
18
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
19
|
+
value: t,
|
|
20
|
+
enumerable: !0,
|
|
21
|
+
configurable: !0,
|
|
22
|
+
writable: !0
|
|
23
|
+
}) : e[r] = t, e;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function ownKeys(e, r) {
|
|
27
|
+
var t = Object.keys(e);
|
|
28
|
+
if (Object.getOwnPropertySymbols) {
|
|
29
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
30
|
+
r && (o = o.filter(function (r) {
|
|
31
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
32
|
+
})), t.push.apply(t, o);
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
}
|
|
36
|
+
function _objectSpread2(e) {
|
|
37
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
38
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
39
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
40
|
+
_defineProperty(e, r, t[r]);
|
|
41
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
42
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _arrayWithHoles(r) {
|
|
49
|
+
if (Array.isArray(r)) return r;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function _iterableToArrayLimit(r, l) {
|
|
53
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
54
|
+
if (null != t) {
|
|
55
|
+
var e,
|
|
56
|
+
n,
|
|
57
|
+
i,
|
|
58
|
+
u,
|
|
59
|
+
a = [],
|
|
60
|
+
f = !0,
|
|
61
|
+
o = !1;
|
|
62
|
+
try {
|
|
63
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
64
|
+
if (Object(t) !== t) return;
|
|
65
|
+
f = !1;
|
|
66
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
67
|
+
} catch (r) {
|
|
68
|
+
o = !0, n = r;
|
|
69
|
+
} finally {
|
|
70
|
+
try {
|
|
71
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
72
|
+
} finally {
|
|
73
|
+
if (o) throw n;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return a;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function _arrayLikeToArray(r, a) {
|
|
81
|
+
(null == a || a > r.length) && (a = r.length);
|
|
82
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
83
|
+
return n;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _unsupportedIterableToArray(r, a) {
|
|
87
|
+
if (r) {
|
|
88
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
89
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
90
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _nonIterableRest() {
|
|
95
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function _slicedToArray(r, e) {
|
|
99
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function _createForOfIteratorHelper(r, e) {
|
|
103
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
104
|
+
if (!t) {
|
|
105
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
106
|
+
t && (r = t);
|
|
107
|
+
var n = 0,
|
|
108
|
+
F = function () {};
|
|
109
|
+
return {
|
|
110
|
+
s: F,
|
|
111
|
+
n: function () {
|
|
112
|
+
return n >= r.length ? {
|
|
113
|
+
done: !0
|
|
114
|
+
} : {
|
|
115
|
+
done: !1,
|
|
116
|
+
value: r[n++]
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
e: function (r) {
|
|
120
|
+
throw r;
|
|
121
|
+
},
|
|
122
|
+
f: F
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
126
|
+
}
|
|
127
|
+
var o,
|
|
128
|
+
a = !0,
|
|
129
|
+
u = !1;
|
|
130
|
+
return {
|
|
131
|
+
s: function () {
|
|
132
|
+
t = t.call(r);
|
|
133
|
+
},
|
|
134
|
+
n: function () {
|
|
135
|
+
var r = t.next();
|
|
136
|
+
return a = r.done, r;
|
|
137
|
+
},
|
|
138
|
+
e: function (r) {
|
|
139
|
+
u = !0, o = r;
|
|
140
|
+
},
|
|
141
|
+
f: function () {
|
|
142
|
+
try {
|
|
143
|
+
a || null == t.return || t.return();
|
|
144
|
+
} finally {
|
|
145
|
+
if (u) throw o;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { _objectSpread2 as _, _slicedToArray as a, _createForOfIteratorHelper as b, _toPropertyKey as c, _defineProperty as d };
|