@plasmicpkgs/commerce-local 0.0.25 → 0.0.28
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/dist/commerce-local.cjs.development.js +18 -17
- package/dist/commerce-local.cjs.development.js.map +1 -1
- package/dist/commerce-local.cjs.production.min.js +1 -1
- package/dist/commerce-local.cjs.production.min.js.map +1 -1
- package/dist/commerce-local.esm.js +18 -17
- package/dist/commerce-local.esm.js.map +1 -1
- package/dist/local.d.ts +1 -0
- package/package.json +4 -4
|
@@ -198,11 +198,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
var IteratorPrototype = {};
|
|
201
|
-
|
|
202
|
-
IteratorPrototype[iteratorSymbol] = function () {
|
|
201
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
203
202
|
return this;
|
|
204
|
-
};
|
|
205
|
-
|
|
203
|
+
});
|
|
206
204
|
var getProto = Object.getPrototypeOf;
|
|
207
205
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
208
206
|
|
|
@@ -213,8 +211,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
213
211
|
}
|
|
214
212
|
|
|
215
213
|
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
216
|
-
GeneratorFunction.prototype =
|
|
217
|
-
|
|
214
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
215
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
216
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
218
217
|
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
|
|
219
218
|
// Iterator interface in terms of a single ._invoke method.
|
|
220
219
|
|
|
@@ -319,11 +318,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
319
318
|
}
|
|
320
319
|
|
|
321
320
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
322
|
-
|
|
323
|
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
321
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
324
322
|
return this;
|
|
325
|
-
};
|
|
326
|
-
|
|
323
|
+
});
|
|
327
324
|
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
|
|
328
325
|
// AsyncIterator objects; they just return a Promise for the value of
|
|
329
326
|
// the final result produced by the iterator.
|
|
@@ -500,13 +497,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
500
497
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
501
498
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
502
499
|
|
|
503
|
-
Gp
|
|
500
|
+
define(Gp, iteratorSymbol, function () {
|
|
504
501
|
return this;
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
Gp.toString = function () {
|
|
502
|
+
});
|
|
503
|
+
define(Gp, "toString", function () {
|
|
508
504
|
return "[object Generator]";
|
|
509
|
-
};
|
|
505
|
+
});
|
|
510
506
|
|
|
511
507
|
function pushTryEntry(locs) {
|
|
512
508
|
var entry = {
|
|
@@ -818,14 +814,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
818
814
|
} catch (accidentalStrictMode) {
|
|
819
815
|
// This module should not be running in strict mode, so the above
|
|
820
816
|
// assignment should always work unless something is misconfigured. Just
|
|
821
|
-
// in case runtime.js accidentally runs in strict mode,
|
|
817
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
818
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
822
819
|
// strict mode using a global Function call. This could conceivably fail
|
|
823
820
|
// if a Content Security Policy forbids using Function, but in that case
|
|
824
821
|
// the proper solution is to fix the accidental strict mode problem. If
|
|
825
822
|
// you've misconfigured your bundler to force strict mode and applied a
|
|
826
823
|
// CSP to forbid Function, and you're not willing to fix either of those
|
|
827
824
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
828
|
-
|
|
825
|
+
if (typeof globalThis === "object") {
|
|
826
|
+
globalThis.regeneratorRuntime = runtime;
|
|
827
|
+
} else {
|
|
828
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
829
|
+
}
|
|
829
830
|
}
|
|
830
831
|
});
|
|
831
832
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.cjs.development.js","sources":["../../../../node_modules/regenerator-runtime/runtime.js","../src/fetcher.ts","../src/const.ts","../src/cart/use-cart.tsx","../src/utils/create-cart.ts","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_ID = 'localCartId'\n\nexport const LOCAL_CART_URL = 'localCartUrl'","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { LOCAL_CART_URL } from '../const'\n\nexport default useCart as UseCart<typeof handler>\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: { cartId }, options, fetch }) {\n if (!cartId) {\n cartId = LOCAL_CART_URL;\n }\n return JSON.parse(localStorage.getItem(cartId) ?? \"null\")\n },\n useHook:\n ({ useData }) =>\n (input) => {\n return useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n },\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\n\nexport const createCart: () => CartType.Cart = () => (\n {\n id: '',\n createdAt: '',\n currency: { code: '' },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n }\n)","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport { CommerceError, useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useCallback } from 'react';\nimport useCart from './use-cart';\nimport data from \"../data.json\";\nimport { LOCAL_CART_URL } from '../const';\nimport { createCart } from '../utils/create-cart';\n\nexport default useAddItem as UseAddItem<typeof handler>\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n\n const lineItem = \n {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n let cart;\n if (!localStorage.getItem(LOCAL_CART_URL)) {\n cart = createCart();\n } else {\n cart = JSON.parse(localStorage.getItem(LOCAL_CART_URL)!);\n }\n \n for (const product of data.products) {\n if (product.id === item.variantId || product.variants.some(productVariant => productVariant.id === item.variantId)) {\n cart.lineItems.push(lineItem);\n cart.totalPrice += product.price.value * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n }\n }\n localStorage.setItem(LOCAL_CART_URL, JSON.stringify(cart));\n return cart;\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce';\nimport { useSearch, UseSearch } from '@plasmicpkgs/commerce';\nexport default useSearch as UseSearch<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return {\n data: {\n products: data.products,\n }\n }\n },\n useHook: () => () => {\n return {\n data: {\n products: data.products,\n },\n }\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useCategories, UseCategories } from '@plasmicpkgs/commerce';\nexport default useCategories as UseCategories<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useBrands, UseBrands } from '@plasmicpkgs/commerce';\nexport default useBrands as UseBrands<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\n\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: 'LOCAL_CART',\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nexport * from \"./registerable\";\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { localProvider, LocalProvider } from './provider'\n\nexport { localProvider }\nexport type { LocalProvider }\n\nexport const CommerceProvider = getCommerceProvider(localProvider)\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>()\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { Registerable } from \"./registerable\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\nexport const commerceProviderMeta: ComponentMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {\n children: {\n type: \"slot\"\n },\n },\n importPath: \"commerce-providers/local\",\n importName: \"LocalProvider\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return (\n <CommerceProvider>\n {props.children}\n </CommerceProvider>\n )\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: ComponentMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(CommerceProviderComponent, customCommerceProviderMeta ?? commerceProviderMeta);\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","constructor","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","toString","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","Function","fetcher","console","log","fetch","res","ok","json","data","LOCAL_CART_URL","handler","fetchOptions","query","cartId","input","options","JSON","parse","localStorage","getItem","useHook","useData","swrOptions","revalidateOnFocus","createCart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","cart","products","product","variants","some","productVariant","price","currencyCode","setItem","stringify","useCart","mutate","useCallback","addItem","removeItem","localProvider","locale","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","props","children","importPath","importName","CommerceProviderComponent","React","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerComponent","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAAM,CAACC,SAAhB;AACA,QAAIC,MAAM,GAAGH,EAAE,CAACI,cAAhB;AACA,QAAIC,WAAJ,CALgC;;AAMhC,QAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,GAA+BA,MAA/B,GAAwC,EAAtD;AACA,QAAIC,cAAc,GAAGF,OAAO,CAACG,QAAR,IAAoB,YAAzC;AACA,QAAIC,mBAAmB,GAAGJ,OAAO,CAACK,aAAR,IAAyB,iBAAnD;AACA,QAAIC,iBAAiB,GAAGN,OAAO,CAACO,WAAR,IAAuB,eAA/C;;AAEA,aAASC,MAAT,CAAgBC,GAAhB,EAAqBC,GAArB,EAA0BC,KAA1B,EAAiC;AAC/BhB,MAAAA,MAAM,CAACiB,cAAP,CAAsBH,GAAtB,EAA2BC,GAA3B,EAAgC;AAC9BC,QAAAA,KAAK,EAAEA,KADuB;AAE9BE,QAAAA,UAAU,EAAE,IAFkB;A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AAA,QAAQ,EAAE;AACRlL,MAAAA,IAAI,EAAE;AADE;AADL,GAHiE;AAQxEmL,EAAAA,UAAU,EAAE,0BAR4D;AASxEC,EAAAA,UAAU,EAAE;AAT4D,CAAnE;;AAYP,SAASC,yBAAT,CAAmCJ,KAAnC;AACE,SACEK,4BAAA,CAACV,gBAAD,MAAA,EACGK,KAAK,CAACC,QADT,CADF;AAKD;;AAED,SAAgBK,yBACdC,QACAC;AAEA,MAAMC,mBAAmB,GAA6B,SAAhDA,mBAAgD;AAAA,WACpDF,MAAM,GAAGA,MAAM,CAACG,iBAAP,OAAAH,MAAM,YAAT,GAAuCG,iBAAiB,MAAjB,mBADO;AAAA,GAAtD;;AAEAD,EAAAA,mBAAmB,CAACL,yBAAD,EAA4BI,0BAA5B,WAA4BA,0BAA5B,GAA0DT,oBAA1D,CAAnB;AACD;;SC/BeY,YAAYJ;AAC1BD,EAAAA,wBAAwB,CAACC,MAAD,CAAxB;AACD;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"commerce-local.cjs.development.js","sources":["../../../../node_modules/regenerator-runtime/runtime.js","../src/fetcher.ts","../src/const.ts","../src/cart/use-cart.tsx","../src/utils/create-cart.ts","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_ID = 'localCartId'\n\nexport const LOCAL_CART_URL = 'localCartUrl'","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { LOCAL_CART_URL } from '../const'\n\nexport default useCart as UseCart<typeof handler>\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: { cartId }, options, fetch }) {\n if (!cartId) {\n cartId = LOCAL_CART_URL;\n }\n return JSON.parse(localStorage.getItem(cartId) ?? \"null\")\n },\n useHook:\n ({ useData }) =>\n (input) => {\n return useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n },\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\n\nexport const createCart: () => CartType.Cart = () => (\n {\n id: '',\n createdAt: '',\n currency: { code: '' },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n }\n)","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport { CommerceError, useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useCallback } from 'react';\nimport useCart from './use-cart';\nimport data from \"../data.json\";\nimport { LOCAL_CART_URL } from '../const';\nimport { createCart } from '../utils/create-cart';\n\nexport default useAddItem as UseAddItem<typeof handler>\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n\n const lineItem = \n {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n let cart;\n if (!localStorage.getItem(LOCAL_CART_URL)) {\n cart = createCart();\n } else {\n cart = JSON.parse(localStorage.getItem(LOCAL_CART_URL)!);\n }\n \n for (const product of data.products) {\n if (product.id === item.variantId || product.variants.some(productVariant => productVariant.id === item.variantId)) {\n cart.lineItems.push(lineItem);\n cart.totalPrice += product.price.value * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n }\n }\n localStorage.setItem(LOCAL_CART_URL, JSON.stringify(cart));\n return cart;\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce';\nimport { useSearch, UseSearch } from '@plasmicpkgs/commerce';\nexport default useSearch as UseSearch<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return {\n data: {\n products: data.products,\n }\n }\n },\n useHook: () => () => {\n return {\n data: {\n products: data.products,\n },\n }\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useCategories, UseCategories } from '@plasmicpkgs/commerce';\nexport default useCategories as UseCategories<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useBrands, UseBrands } from '@plasmicpkgs/commerce';\nexport default useBrands as UseBrands<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\n\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: 'LOCAL_CART',\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nexport * from \"./registerable\";\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { localProvider, LocalProvider } from './provider'\n\nexport { localProvider }\nexport type { LocalProvider }\n\nexport const CommerceProvider = getCommerceProvider(localProvider)\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>()\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { Registerable } from \"./registerable\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\nexport const commerceProviderMeta: ComponentMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {\n children: {\n type: \"slot\"\n },\n },\n importPath: \"commerce-providers/local\",\n importName: \"LocalProvider\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return (\n <CommerceProvider>\n {props.children}\n </CommerceProvider>\n )\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: ComponentMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(CommerceProviderComponent, customCommerceProviderMeta ?? commerceProviderMeta);\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","fetcher","console","log","fetch","res","ok","json","data","LOCAL_CART_URL","handler","fetchOptions","query","cartId","input","options","JSON","parse","localStorage","getItem","useHook","useData","swrOptions","revalidateOnFocus","createCart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","cart","products","product","variants","some","productVariant","price","currencyCode","setItem","stringify","useCart","mutate","useCallback","addItem","removeItem","localProvider","locale","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","props","children","importPath","importName","CommerceProviderComponent","React","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerComponent","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAAM,CAACC,SAAhB;AACA,QAAIC,MAAM,GAAGH,EAAE,CAACI,cAAhB;AACA,QAAIC,WAAJ,CALgC;;AAMhC,QAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,GAA+BA,MA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;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("@plasmicapp/host/registerComponent")),r=require("react"),n=t(r),o=require("@plasmicpkgs/commerce");function i(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,s,"next",t)}function s(t){i(a,n,o,c,s,"throw",t)}c(void 0)}))}}function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(t,e){return t(e={exports:{}},e.exports),e.exports}var p=l((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof p?e:p).prototype),i=new k(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function p(){}function h(){}function f(){}var d={};d[o]=function(){return this};var m=Object.getPrototypeOf,v=m&&m(m(j([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=f.prototype=p.prototype=Object.create(d);function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(p).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function j(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return h.prototype=g.constructor=f,f.constructor=h,h.displayName=c(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},y(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(g),c(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}})),h={products:[{id:"Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",name:"New Short Sleeve T-Shirt",vendor:"Next.js",path:"/new-short-sleeve-t-shirt",slug:"new-short-sleeve-t-shirt",price:{value:25,currencyCode:"USD"},descriptionHtml:"<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",images:[{url:"https://static1.plasmic.app/commerce/drop-shirt-0.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/drop-shirt-1.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/drop-shirt-2.png",altText:"Shirt",width:1e3,height:1e3}],variants:[{id:"Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",options:[{__typename:"MultipleChoiceOption",id:"asd",displayName:"Size",values:[{label:"XL"}]}]}],options:[{id:"option-color",displayName:"Color",values:[{label:"color",hexColors:["#222"]}]},{id:"option-size",displayName:"Size",values:[{label:"S"},{label:"M"},{label:"L"}]}]},{id:"Z2lkOi8vc2hvcGlmeS9Qcm9ksdWN0LzU0NDczMjUwMjQ0MjA=",name:"Lightweight Jacket",vendor:"Next.js",path:"/lightweight-jacket",slug:"lightweight-jacket",price:{value:249.99,currencyCode:"USD"},descriptionHtml:"<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",images:[{url:"https://static1.plasmic.app/commerce/lightweight-jacket-0.png",altText:"Lightweight Jacket",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/lightweight-jacket-1.png",altText:"Lightweight Jacket",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/lightweight-jacket-2.png",altText:"Lightweight Jacket",width:1e3,height:1e3}],variants:[{id:"Z2lkOid8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",options:[{__typename:"MultipleChoiceOption",id:"asd",displayName:"Size",values:[{label:"XL"}]}]}],options:[{id:"option-color",displayName:"Color",values:[{label:"color",hexColors:["#222"]}]},{id:"option-size",displayName:"Size",values:[{label:"S"},{label:"M"},{label:"L"}]}]},{id:"Z2lkOis8vc2hvcGlmsddeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",name:"Shirt",vendor:"Next.js",path:"/shirt",slug:"shirt",price:{value:25,currencyCode:"USD"},descriptionHtml:"<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",images:[{url:"https://static1.plasmic.app/commerce/t-shirt-0.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-1.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-2.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-3.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-4.png",altText:"Shirt",width:1e3,height:1e3}],variants:[{id:"Z2lkOi8vc2hvcGlmeS9Qcms9kdWN0LzU0NDczMjUwMjQ0MjAss=",options:[{__typename:"MultipleChoiceOption",id:"asd",displayName:"Size",values:[{label:"XL"}]}]}],options:[{id:"option-color",displayName:"Color",values:[{label:"color",hexColors:["#222"]}]},{id:"option-size",displayName:"Size",values:[{label:"S"},{label:"M"},{label:"L"}]}]}]},f={locale:"en-us",cartCookie:"LOCAL_CART",fetcher:function(){var t=a(p.mark((function t(){var e;return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("FETCHER"),t.next=3,fetch("./data.json");case 3:if(!(e=t.sent).ok){t.next=10;break}return t.next=7,e.json();case 7:return t.abrupt("return",t.sent.data);case 10:throw e;case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),cart:{useCart:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function e(){var r,n;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t.input.cartId)||(n="localCartUrl"),e.abrupt("return",JSON.parse(null!=(r=localStorage.getItem(n))?r:"null"));case 3:case"end":return e.stop()}}),e)})))()},useHook:function(t){var e=t.useData;return function(t){return e({swrOptions:c({revalidateOnFocus:!1},null==t?void 0:t.swrOptions)})}}},useAddItem:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function e(){var r,n,i,a,c,s,l,f;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.input).quantity||Number.isInteger(n.quantity)&&!(n.quantity<1)){e.next=3;break}throw new o.CommerceError({message:"The item quantity has to be a valid integer greater than 0"});case 3:for(i={variantId:n.variantId,quantity:null!=(r=n.quantity)?r:1},a=localStorage.getItem("localCartUrl")?JSON.parse(localStorage.getItem("localCartUrl")):{id:"",createdAt:"",currency:{code:""},taxesIncluded:!1,lineItems:[],lineItemsSubtotalPrice:0,subtotalPrice:0,totalPrice:0},c=u(h.products);!(s=c()).done;)((l=s.value).id===n.variantId||l.variants.some((function(t){return t.id===n.variantId})))&&(a.lineItems.push(i),a.totalPrice+=l.price.value*(null!=(f=n.quantity)?f:1),a.currency.code=l.price.currencyCode);return localStorage.setItem("localCartUrl",JSON.stringify(a)),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)})))()},useHook:function(t){var e=t.fetch;return function(){var t=o.useCart().mutate;return r.useCallback(function(){var r=a(p.mark((function r(n){var o;return p.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e({input:n});case 2:return o=r.sent,r.next=5,t(o,!1);case 5:return r.abrupt("return",o);case 6:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}(),[e,t])}}},useUpdateItem:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case 1:case"end":return t.stop()}}),t)})))()},useHook:function(t){return function(){return function(){var t=a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}},useRemoveItem:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case 1:case"end":return t.stop()}}),t)})))()},useHook:function(t){return function(){return function(){var t=a(p.mark((function t(e){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}}}},products:{useSearch:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:{products:h.products}});case 2:case"end":return t.stop()}}),t)})))()},useHook:function(){return function(){return{data:{products:h.products}}}}}},site:{useCategories:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",[]);case 2:case"end":return t.stop()}}),t)})))()},useHook:function(){return function(){return[]}}},useBrands:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",[]);case 2:case"end":return t.stop()}}),t)})))()},useHook:function(){return function(){return[]}}}}},d=o.getCommerceProvider(f),m={name:"plasmic-commerce-local-provider",displayName:"Local Provider",props:{children:{type:"slot"}},importPath:"commerce-providers/local",importName:"LocalProvider"};function v(t){return n.createElement(d,null,t.children)}function g(t,r){!function(){t?t.registerComponent.apply(t,arguments):e.apply(void 0,arguments)}(v,null!=r?r:m)}exports.CommerceProvider=d,exports.localProvider=f,exports.registerAll=function(t){g(t)},exports.registerCommerceProvider=g,exports.useCommerce=function(){return o.useCommerce()};
|
|
1
|
+
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("@plasmicapp/host/registerComponent")),r=require("react"),n=t(r),o=require("@plasmicpkgs/commerce");function i(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,s,"next",t)}function s(t){i(a,n,o,c,s,"throw",t)}c(void 0)}))}}function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(t,e){return t(e={exports:{}},e.exports),e.exports}var p=l((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof p?e:p).prototype),i=new j(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function p(){}function h(){}function f(){}var d={};c(d,o,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(k([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=f.prototype=p.prototype=Object.create(d);function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(p).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return h.prototype=f,c(g,"constructor",f),c(f,"constructor",h),h.displayName=c(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},y(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=k,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})),h={products:[{id:"Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",name:"New Short Sleeve T-Shirt",vendor:"Next.js",path:"/new-short-sleeve-t-shirt",slug:"new-short-sleeve-t-shirt",price:{value:25,currencyCode:"USD"},descriptionHtml:"<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",images:[{url:"https://static1.plasmic.app/commerce/drop-shirt-0.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/drop-shirt-1.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/drop-shirt-2.png",altText:"Shirt",width:1e3,height:1e3}],variants:[{id:"Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",options:[{__typename:"MultipleChoiceOption",id:"asd",displayName:"Size",values:[{label:"XL"}]}]}],options:[{id:"option-color",displayName:"Color",values:[{label:"color",hexColors:["#222"]}]},{id:"option-size",displayName:"Size",values:[{label:"S"},{label:"M"},{label:"L"}]}]},{id:"Z2lkOi8vc2hvcGlmeS9Qcm9ksdWN0LzU0NDczMjUwMjQ0MjA=",name:"Lightweight Jacket",vendor:"Next.js",path:"/lightweight-jacket",slug:"lightweight-jacket",price:{value:249.99,currencyCode:"USD"},descriptionHtml:"<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",images:[{url:"https://static1.plasmic.app/commerce/lightweight-jacket-0.png",altText:"Lightweight Jacket",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/lightweight-jacket-1.png",altText:"Lightweight Jacket",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/lightweight-jacket-2.png",altText:"Lightweight Jacket",width:1e3,height:1e3}],variants:[{id:"Z2lkOid8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",options:[{__typename:"MultipleChoiceOption",id:"asd",displayName:"Size",values:[{label:"XL"}]}]}],options:[{id:"option-color",displayName:"Color",values:[{label:"color",hexColors:["#222"]}]},{id:"option-size",displayName:"Size",values:[{label:"S"},{label:"M"},{label:"L"}]}]},{id:"Z2lkOis8vc2hvcGlmsddeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",name:"Shirt",vendor:"Next.js",path:"/shirt",slug:"shirt",price:{value:25,currencyCode:"USD"},descriptionHtml:"<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",images:[{url:"https://static1.plasmic.app/commerce/t-shirt-0.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-1.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-2.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-3.png",altText:"Shirt",width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/t-shirt-4.png",altText:"Shirt",width:1e3,height:1e3}],variants:[{id:"Z2lkOi8vc2hvcGlmeS9Qcms9kdWN0LzU0NDczMjUwMjQ0MjAss=",options:[{__typename:"MultipleChoiceOption",id:"asd",displayName:"Size",values:[{label:"XL"}]}]}],options:[{id:"option-color",displayName:"Color",values:[{label:"color",hexColors:["#222"]}]},{id:"option-size",displayName:"Size",values:[{label:"S"},{label:"M"},{label:"L"}]}]}]},f={locale:"en-us",cartCookie:"LOCAL_CART",fetcher:function(){var t=a(p.mark((function t(){var e;return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("FETCHER"),t.next=3,fetch("./data.json");case 3:if(!(e=t.sent).ok){t.next=10;break}return t.next=7,e.json();case 7:return t.abrupt("return",t.sent.data);case 10:throw e;case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),cart:{useCart:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function e(){var r,n;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t.input.cartId)||(n="localCartUrl"),e.abrupt("return",JSON.parse(null!=(r=localStorage.getItem(n))?r:"null"));case 3:case"end":return e.stop()}}),e)})))()},useHook:function(t){var e=t.useData;return function(t){return e({swrOptions:c({revalidateOnFocus:!1},null==t?void 0:t.swrOptions)})}}},useAddItem:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function e(){var r,n,i,a,c,s,l,f;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.input).quantity||Number.isInteger(n.quantity)&&!(n.quantity<1)){e.next=3;break}throw new o.CommerceError({message:"The item quantity has to be a valid integer greater than 0"});case 3:for(i={variantId:n.variantId,quantity:null!=(r=n.quantity)?r:1},a=localStorage.getItem("localCartUrl")?JSON.parse(localStorage.getItem("localCartUrl")):{id:"",createdAt:"",currency:{code:""},taxesIncluded:!1,lineItems:[],lineItemsSubtotalPrice:0,subtotalPrice:0,totalPrice:0},c=u(h.products);!(s=c()).done;)((l=s.value).id===n.variantId||l.variants.some((function(t){return t.id===n.variantId})))&&(a.lineItems.push(i),a.totalPrice+=l.price.value*(null!=(f=n.quantity)?f:1),a.currency.code=l.price.currencyCode);return localStorage.setItem("localCartUrl",JSON.stringify(a)),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)})))()},useHook:function(t){var e=t.fetch;return function(){var t=o.useCart().mutate;return r.useCallback(function(){var r=a(p.mark((function r(n){var o;return p.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e({input:n});case 2:return o=r.sent,r.next=5,t(o,!1);case 5:return r.abrupt("return",o);case 6:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}(),[e,t])}}},useUpdateItem:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case 1:case"end":return t.stop()}}),t)})))()},useHook:function(t){return function(){return function(){var t=a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}},useRemoveItem:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case 1:case"end":return t.stop()}}),t)})))()},useHook:function(t){return function(){return function(){var t=a(p.mark((function t(e){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}}}},products:{useSearch:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:{products:h.products}});case 2:case"end":return t.stop()}}),t)})))()},useHook:function(){return function(){return{data:{products:h.products}}}}}},site:{useCategories:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",[]);case 2:case"end":return t.stop()}}),t)})))()},useHook:function(){return function(){return[]}}},useBrands:{fetchOptions:{query:""},fetcher:function(t){return a(p.mark((function t(){return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",[]);case 2:case"end":return t.stop()}}),t)})))()},useHook:function(){return function(){return[]}}}}},d=o.getCommerceProvider(f),m={name:"plasmic-commerce-local-provider",displayName:"Local Provider",props:{children:{type:"slot"}},importPath:"commerce-providers/local",importName:"LocalProvider"};function v(t){return n.createElement(d,null,t.children)}function g(t,r){!function(){t?t.registerComponent.apply(t,arguments):e.apply(void 0,arguments)}(v,null!=r?r:m)}exports.CommerceProvider=d,exports.localProvider=f,exports.registerAll=function(t){g(t)},exports.registerCommerceProvider=g,exports.useCommerce=function(){return o.useCommerce()};
|
|
2
2
|
//# sourceMappingURL=commerce-local.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.cjs.production.min.js","sources":["../../../../node_modules/regenerator-runtime/runtime.js","../src/provider.ts","../src/fetcher.ts","../src/cart/use-cart.tsx","../src/const.ts","../src/cart/use-add-item.tsx","../src/utils/create-cart.ts","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\n\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: 'LOCAL_CART',\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { LOCAL_CART_URL } from '../const'\n\nexport default useCart as UseCart<typeof handler>\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: { cartId }, options, fetch }) {\n if (!cartId) {\n cartId = LOCAL_CART_URL;\n }\n return JSON.parse(localStorage.getItem(cartId) ?? \"null\")\n },\n useHook:\n ({ useData }) =>\n (input) => {\n return useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n },\n}\n","export const LOCAL_CART_ID = 'localCartId'\n\nexport const LOCAL_CART_URL = 'localCartUrl'","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport { CommerceError, useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useCallback } from 'react';\nimport useCart from './use-cart';\nimport data from \"../data.json\";\nimport { LOCAL_CART_URL } from '../const';\nimport { createCart } from '../utils/create-cart';\n\nexport default useAddItem as UseAddItem<typeof handler>\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n\n const lineItem = \n {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n let cart;\n if (!localStorage.getItem(LOCAL_CART_URL)) {\n cart = createCart();\n } else {\n cart = JSON.parse(localStorage.getItem(LOCAL_CART_URL)!);\n }\n \n for (const product of data.products) {\n if (product.id === item.variantId || product.variants.some(productVariant => productVariant.id === item.variantId)) {\n cart.lineItems.push(lineItem);\n cart.totalPrice += product.price.value * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n }\n }\n localStorage.setItem(LOCAL_CART_URL, JSON.stringify(cart));\n return cart;\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\n\nexport const createCart: () => CartType.Cart = () => (\n {\n id: '',\n createdAt: '',\n currency: { code: '' },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n }\n)","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce';\nimport { useSearch, UseSearch } from '@plasmicpkgs/commerce';\nexport default useSearch as UseSearch<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return {\n data: {\n products: data.products,\n }\n }\n },\n useHook: () => () => {\n return {\n data: {\n products: data.products,\n },\n }\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useCategories, UseCategories } from '@plasmicpkgs/commerce';\nexport default useCategories as UseCategories<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useBrands, UseBrands } from '@plasmicpkgs/commerce';\nexport default useBrands as UseBrands<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nexport * from \"./registerable\";\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { localProvider, LocalProvider } from './provider'\n\nexport { localProvider }\nexport type { LocalProvider }\n\nexport const CommerceProvider = getCommerceProvider(localProvider)\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>()\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { Registerable } from \"./registerable\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\nexport const commerceProviderMeta: ComponentMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {\n children: {\n type: \"slot\"\n },\n },\n importPath: \"commerce-providers/local\",\n importName: \"LocalProvider\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return (\n <CommerceProvider>\n {props.children}\n </CommerceProvider>\n )\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: ComponentMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(CommerceProviderComponent, customCommerceProviderMeta ?? commerceProviderMeta);\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","Function","localProvider","locale","cartCookie","fetcher","console","log","fetch","res","ok","json","data","cart","useCart","fetchOptions","query","cartId","input","JSON","parse","localStorage","getItem","useHook","useData","swrOptions","revalidateOnFocus","useAddItem","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","products","product","variants","some","productVariant","price","currencyCode","setItem","stringify","mutate","useCallback","useUpdateItem","useRemoveItem","useSearch","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","commerceProviderMeta","props","children","importPath","importName","CommerceProviderComponent","React","registerCommerceProvider","loader","customCommerceProviderMeta","registerComponent","doRegisterComponent","useCoreCommerce"],"mappings":"+pDAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,UACnBF,EAAIC,GAAOC,YAIbM,EAAKC,EAASC,EAASC,EA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M,iBACN,QCCEuC,EAAmBC,sBAAoB7D,GCJvC8D,EAA6D,CACxEjG,KAAM,kCACNJ,YAAa,iBACbsG,MAAO,CACLC,SAAU,CACR1J,KAAM,SAGV2J,WAAY,2BACZC,WAAY,iBAGd,SAASC,EAA0BJ,UAE/BK,gBAACR,OACEG,EAAMC,mBAKGK,EACdC,EACAC,IAEsD,WACpDD,EAASA,EAAOE,wBAAPF,aAAoCE,0BAC/CC,CAAoBN,QAA2BI,EAAAA,EAA8BT,mFC9BnDQ,GAC1BD,EAAyBC,2DFSA,kBAAMI"}
|
|
1
|
+
{"version":3,"file":"commerce-local.cjs.production.min.js","sources":["../../../../node_modules/regenerator-runtime/runtime.js","../src/provider.ts","../src/fetcher.ts","../src/cart/use-cart.tsx","../src/const.ts","../src/cart/use-add-item.tsx","../src/utils/create-cart.ts","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\n\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: 'LOCAL_CART',\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { LOCAL_CART_URL } from '../const'\n\nexport default useCart as UseCart<typeof handler>\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: { cartId }, options, fetch }) {\n if (!cartId) {\n cartId = LOCAL_CART_URL;\n }\n return JSON.parse(localStorage.getItem(cartId) ?? \"null\")\n },\n useHook:\n ({ useData }) =>\n (input) => {\n return useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n },\n}\n","export const LOCAL_CART_ID = 'localCartId'\n\nexport const LOCAL_CART_URL = 'localCartUrl'","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport { CommerceError, useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useCallback } from 'react';\nimport useCart from './use-cart';\nimport data from \"../data.json\";\nimport { LOCAL_CART_URL } from '../const';\nimport { createCart } from '../utils/create-cart';\n\nexport default useAddItem as UseAddItem<typeof handler>\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n\n const lineItem = \n {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n let cart;\n if (!localStorage.getItem(LOCAL_CART_URL)) {\n cart = createCart();\n } else {\n cart = JSON.parse(localStorage.getItem(LOCAL_CART_URL)!);\n }\n \n for (const product of data.products) {\n if (product.id === item.variantId || product.variants.some(productVariant => productVariant.id === item.variantId)) {\n cart.lineItems.push(lineItem);\n cart.totalPrice += product.price.value * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n }\n }\n localStorage.setItem(LOCAL_CART_URL, JSON.stringify(cart));\n return cart;\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\n\nexport const createCart: () => CartType.Cart = () => (\n {\n id: '',\n createdAt: '',\n currency: { code: '' },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n }\n)","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce';\nimport { useSearch, UseSearch } from '@plasmicpkgs/commerce';\nexport default useSearch as UseSearch<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return {\n data: {\n products: data.products,\n }\n }\n },\n useHook: () => () => {\n return {\n data: {\n products: data.products,\n },\n }\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useCategories, UseCategories } from '@plasmicpkgs/commerce';\nexport default useCategories as UseCategories<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useBrands, UseBrands } from '@plasmicpkgs/commerce';\nexport default useBrands as UseBrands<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nexport * from \"./registerable\";\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { localProvider, LocalProvider } from './provider'\n\nexport { localProvider }\nexport type { LocalProvider }\n\nexport const CommerceProvider = getCommerceProvider(localProvider)\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>()\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { Registerable } from \"./registerable\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\nexport const commerceProviderMeta: ComponentMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {\n children: {\n type: \"slot\"\n },\n },\n importPath: \"commerce-providers/local\",\n importName: \"LocalProvider\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return (\n <CommerceProvider>\n {props.children}\n </CommerceProvider>\n )\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: ComponentMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(CommerceProviderComponent, customCommerceProviderMeta ?? commerceProviderMeta);\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","localProvider","locale","cartCookie","fetcher","console","log","fetch","res","ok","json","data","cart","useCart","fetchOptions","query","cartId","input","JSON","parse","localStorage","getItem","useHook","useData","swrOptions","revalidateOnFocus","useAddItem","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","products","product","variants","some","productVariant","price","currencyCode","setItem","stringify","mutate","useCallback","useUpdateItem","useRemoveItem","useSearch","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","commerceProviderMeta","props","children","importPath","importName","CommerceProviderComponent","React","registerCommerceProvider","loader","customCommerceProviderMeta","registerComponent","doRegisterComponent","useCoreCommerce"],"mappings":"+pDAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,UACnBF,EAAIC,GAAOC,YAIbM,EAAKC,EAASC,EAASC,EAAMC,OAGhCC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,WAIzCC,EAAUK,iBAuMcT,EAASE,EAAMK,OACnCG,EAhLuB,wBAkLpB,SAAgBC,EAAQC,MAhLT,cAiLhBF,QACI,IAAIG,MAAM,mCAjLE,cAoLhBH,EAA6B,IAChB,UAAXC,QACIC,QAyQL,CAAEnB,WA1fPqB,EA0fyBC,M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,WACpDD,EAASA,EAAOE,wBAAPF,aAAoCE,0BAC/CC,CAAoBN,QAA2BI,EAAAA,EAA8BT,mFC9BnDQ,GAC1BD,EAAyBC,2DFSA,kBAAMI"}
|
|
@@ -191,11 +191,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
var IteratorPrototype = {};
|
|
194
|
-
|
|
195
|
-
IteratorPrototype[iteratorSymbol] = function () {
|
|
194
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
196
195
|
return this;
|
|
197
|
-
};
|
|
198
|
-
|
|
196
|
+
});
|
|
199
197
|
var getProto = Object.getPrototypeOf;
|
|
200
198
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
201
199
|
|
|
@@ -206,8 +204,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
206
204
|
}
|
|
207
205
|
|
|
208
206
|
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
209
|
-
GeneratorFunction.prototype =
|
|
210
|
-
|
|
207
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
208
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
209
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
211
210
|
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
|
|
212
211
|
// Iterator interface in terms of a single ._invoke method.
|
|
213
212
|
|
|
@@ -312,11 +311,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
312
311
|
}
|
|
313
312
|
|
|
314
313
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
315
|
-
|
|
316
|
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
314
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
317
315
|
return this;
|
|
318
|
-
};
|
|
319
|
-
|
|
316
|
+
});
|
|
320
317
|
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
|
|
321
318
|
// AsyncIterator objects; they just return a Promise for the value of
|
|
322
319
|
// the final result produced by the iterator.
|
|
@@ -493,13 +490,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
493
490
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
494
491
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
495
492
|
|
|
496
|
-
Gp
|
|
493
|
+
define(Gp, iteratorSymbol, function () {
|
|
497
494
|
return this;
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
Gp.toString = function () {
|
|
495
|
+
});
|
|
496
|
+
define(Gp, "toString", function () {
|
|
501
497
|
return "[object Generator]";
|
|
502
|
-
};
|
|
498
|
+
});
|
|
503
499
|
|
|
504
500
|
function pushTryEntry(locs) {
|
|
505
501
|
var entry = {
|
|
@@ -811,14 +807,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
811
807
|
} catch (accidentalStrictMode) {
|
|
812
808
|
// This module should not be running in strict mode, so the above
|
|
813
809
|
// assignment should always work unless something is misconfigured. Just
|
|
814
|
-
// in case runtime.js accidentally runs in strict mode,
|
|
810
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
811
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
815
812
|
// strict mode using a global Function call. This could conceivably fail
|
|
816
813
|
// if a Content Security Policy forbids using Function, but in that case
|
|
817
814
|
// the proper solution is to fix the accidental strict mode problem. If
|
|
818
815
|
// you've misconfigured your bundler to force strict mode and applied a
|
|
819
816
|
// CSP to forbid Function, and you're not willing to fix either of those
|
|
820
817
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
821
|
-
|
|
818
|
+
if (typeof globalThis === "object") {
|
|
819
|
+
globalThis.regeneratorRuntime = runtime;
|
|
820
|
+
} else {
|
|
821
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
822
|
+
}
|
|
822
823
|
}
|
|
823
824
|
});
|
|
824
825
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.esm.js","sources":["../../../../node_modules/regenerator-runtime/runtime.js","../src/fetcher.ts","../src/const.ts","../src/cart/use-cart.tsx","../src/utils/create-cart.ts","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_ID = 'localCartId'\n\nexport const LOCAL_CART_URL = 'localCartUrl'","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { LOCAL_CART_URL } from '../const'\n\nexport default useCart as UseCart<typeof handler>\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: { cartId }, options, fetch }) {\n if (!cartId) {\n cartId = LOCAL_CART_URL;\n }\n return JSON.parse(localStorage.getItem(cartId) ?? \"null\")\n },\n useHook:\n ({ useData }) =>\n (input) => {\n return useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n },\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\n\nexport const createCart: () => CartType.Cart = () => (\n {\n id: '',\n createdAt: '',\n currency: { code: '' },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n }\n)","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport { CommerceError, useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useCallback } from 'react';\nimport useCart from './use-cart';\nimport data from \"../data.json\";\nimport { LOCAL_CART_URL } from '../const';\nimport { createCart } from '../utils/create-cart';\n\nexport default useAddItem as UseAddItem<typeof handler>\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n\n const lineItem = \n {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n let cart;\n if (!localStorage.getItem(LOCAL_CART_URL)) {\n cart = createCart();\n } else {\n cart = JSON.parse(localStorage.getItem(LOCAL_CART_URL)!);\n }\n \n for (const product of data.products) {\n if (product.id === item.variantId || product.variants.some(productVariant => productVariant.id === item.variantId)) {\n cart.lineItems.push(lineItem);\n cart.totalPrice += product.price.value * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n }\n }\n localStorage.setItem(LOCAL_CART_URL, JSON.stringify(cart));\n return cart;\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce';\nimport { useSearch, UseSearch } from '@plasmicpkgs/commerce';\nexport default useSearch as UseSearch<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return {\n data: {\n products: data.products,\n }\n }\n },\n useHook: () => () => {\n return {\n data: {\n products: data.products,\n },\n }\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useCategories, UseCategories } from '@plasmicpkgs/commerce';\nexport default useCategories as UseCategories<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useBrands, UseBrands } from '@plasmicpkgs/commerce';\nexport default useBrands as UseBrands<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\n\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: 'LOCAL_CART',\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nexport * from \"./registerable\";\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { localProvider, LocalProvider } from './provider'\n\nexport { localProvider }\nexport type { LocalProvider }\n\nexport const CommerceProvider = getCommerceProvider(localProvider)\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>()\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { Registerable } from \"./registerable\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\nexport const commerceProviderMeta: ComponentMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {\n children: {\n type: \"slot\"\n },\n },\n importPath: \"commerce-providers/local\",\n importName: \"LocalProvider\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return (\n <CommerceProvider>\n {props.children}\n </CommerceProvider>\n )\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: ComponentMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(CommerceProviderComponent, customCommerceProviderMeta ?? commerceProviderMeta);\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","constructor","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","toString","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","Function","fetcher","console","log","fetch","res","ok","json","data","LOCAL_CART_URL","handler","fetchOptions","query","cartId","input","options","JSON","parse","localStorage","getItem","useHook","useData","swrOptions","revalidateOnFocus","createCart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","cart","products","product","variants","some","productVariant","price","currencyCode","setItem","stringify","useCart","mutate","useCallback","addItem","removeItem","localProvider","locale","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","props","children","importPath","importName","CommerceProviderComponent","React","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerComponent","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAAM,CAACC,SAAhB;AACA,QAAIC,MAAM,GAAGH,EAAE,CAACI,cAAhB;AACA,QAAIC,WAAJ,CALgC;;AAMhC,QAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,GAA+BA,MAA/B,GAAwC,EAAtD;AACA,QAAIC,cAAc,GAAGF,OAAO,CAACG,QAAR,IAAoB,YAAzC;AACA,QAAIC,mBAAmB,GAAGJ,OAAO,CAACK,aAAR,IAAyB,iBAAnD;AACA,QAAIC,iBAAiB,GAAGN,OAAO,CAACO,WAAR,IAAuB,eAA/C;;AAEA,aAASC,MAAT,CAAgBC,GAAhB,EAAqBC,GAArB,EAA0BC,KAA1B,EAAiC;AAC/BhB,MAAAA,MAAM,CAACiB,cAAP,CAAsBH,GAAtB,EAA2BC,GAA3B,EAAgC;AAC9BC,QAAAA,KAAK,EAAEA,KADuB;AAE9BE,QAAAA,UAAU,EAAE,IAFkB;AAG9BC,QAAAA,YAAY,EAAE,IAHgB;AAI9BC,QAAAA,QAAQ,EAAE;AAJoB,OAAhC;AAMA,aAAON,GAAG,CAACC,GAAD,CAAV;AACD;;AACD,QAAI;;AAEFF,MAAAA,MAAM,CAAC,EAAD,EAAK,EAAL,CAAN;AACD,KAHD,CAGE,OAAOQ,GAAP,EAAY;AACZ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AACC,QADT,CADF;AAKD;;AAED,SAAgBK,yBACdC,QACAC;AAEA,MAAMC,mBAAmB,GAA6B,SAAhDA,mBAAgD;AAAA,WACpDF,MAAM,GAAGA,MAAM,CAACG,iBAAP,OAAAH,MAAM,YAAT,GAAuCG,iBAAiB,MAAjB,mBADO;AAAA,GAAtD;;AAEAD,EAAAA,mBAAmB,CAACL,yBAAD,EAA4BI,0BAA5B,WAA4BA,0BAA5B,GAA0DT,oBAA1D,CAAnB;AACD;;SC/BeY,YAAYJ;AAC1BD,EAAAA,wBAAwB,CAACC,MAAD,CAAxB;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"commerce-local.esm.js","sources":["../../../../node_modules/regenerator-runtime/runtime.js","../src/fetcher.ts","../src/const.ts","../src/cart/use-cart.tsx","../src/utils/create-cart.ts","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_ID = 'localCartId'\n\nexport const LOCAL_CART_URL = 'localCartUrl'","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { LOCAL_CART_URL } from '../const'\n\nexport default useCart as UseCart<typeof handler>\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: { cartId }, options, fetch }) {\n if (!cartId) {\n cartId = LOCAL_CART_URL;\n }\n return JSON.parse(localStorage.getItem(cartId) ?? \"null\")\n },\n useHook:\n ({ useData }) =>\n (input) => {\n return useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n },\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\n\nexport const createCart: () => CartType.Cart = () => (\n {\n id: '',\n createdAt: '',\n currency: { code: '' },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n }\n)","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport { CommerceError, useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useCallback } from 'react';\nimport useCart from './use-cart';\nimport data from \"../data.json\";\nimport { LOCAL_CART_URL } from '../const';\nimport { createCart } from '../utils/create-cart';\n\nexport default useAddItem as UseAddItem<typeof handler>\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n\n const lineItem = \n {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n let cart;\n if (!localStorage.getItem(LOCAL_CART_URL)) {\n cart = createCart();\n } else {\n cart = JSON.parse(localStorage.getItem(LOCAL_CART_URL)!);\n }\n \n for (const product of data.products) {\n if (product.id === item.variantId || product.variants.some(productVariant => productVariant.id === item.variantId)) {\n cart.lineItems.push(lineItem);\n cart.totalPrice += product.price.value * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n }\n }\n localStorage.setItem(LOCAL_CART_URL, JSON.stringify(cart));\n return cart;\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook } from '@plasmicpkgs/commerce';\nimport { useSearch, UseSearch } from '@plasmicpkgs/commerce';\nexport default useSearch as UseSearch<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return {\n data: {\n products: data.products,\n }\n }\n },\n useHook: () => () => {\n return {\n data: {\n products: data.products,\n },\n }\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useCategories, UseCategories } from '@plasmicpkgs/commerce';\nexport default useCategories as UseCategories<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","import { SWRHook } from '@plasmicpkgs/commerce';\nimport { useBrands, UseBrands } from '@plasmicpkgs/commerce';\nexport default useBrands as UseBrands<typeof handler>\nimport data from \"../data.json\";\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {\n return [];\n },\n useHook: () => () => {\n return []\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\n\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: 'LOCAL_CART',\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nexport * from \"./registerable\";\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { localProvider, LocalProvider } from './provider'\n\nexport { localProvider }\nexport type { LocalProvider }\n\nexport const CommerceProvider = getCommerceProvider(localProvider)\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>()\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { Registerable } from \"./registerable\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\nexport const commerceProviderMeta: ComponentMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {\n children: {\n type: \"slot\"\n },\n },\n importPath: \"commerce-providers/local\",\n importName: \"LocalProvider\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return (\n <CommerceProvider>\n {props.children}\n </CommerceProvider>\n )\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: ComponentMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(CommerceProviderComponent, customCommerceProviderMeta ?? commerceProviderMeta);\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","fetcher","console","log","fetch","res","ok","json","data","LOCAL_CART_URL","handler","fetchOptions","query","cartId","input","options","JSON","parse","localStorage","getItem","useHook","useData","swrOptions","revalidateOnFocus","createCart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","cart","products","product","variants","some","productVariant","price","currencyCode","setItem","stringify","useCart","mutate","useCallback","addItem","removeItem","localProvider","locale","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","props","children","importPath","importName","CommerceProviderComponent","React","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerComponent","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAAM,CAACC,SAAhB;AACA,QAAIC,MAAM,GAAGH,EAAE,CAACI,cAAhB;AACA,QAAIC,WAAJ,CALgC;;AAMhC,QAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,GAA+BA,MAA/B,GAAwC,EAAtD;AACA,QAAIC,cAAc,GAAGF,OAAO,CAACG,QAAR,IAAoB,YAAzC;AACA,QAAIC,mBAAmB,GAAGJ,OAAO,CAACK,aAAR,IAAyB,iBAAnD;AACA,QAAIC,iBAAiB,GAAGN,OAAO,CAACO,WAAR,IAAuB,eAA/C;;AAEA,aAASC,MAAT,CAAgBC,GAAhB,EAAqBC,G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BC,EAAAA,IAAI,EAAE;AAAEC,IAAAA,aAAa,EAAbA,SAAF;AAAiBC,IAAAA,SAAS,EAATA;AAAjB;AANqB,CAAtB;;ACbP;;;;AAIA,IAUaC,gBAAgB,gBAAGC,mBAAmB,CAACX,aAAD,CAA5C;AAEP,IAAaY,WAAW,GAAG,SAAdA,WAAc;AAAA,SAAMC,aAAe,EAArB;AAAA,CAApB;;ACNA,IAAMC,oBAAoB,GAAyC;AACxEzJ,EAAAA,IAAI,EAAE,iCADkE;AAExER,EAAAA,WAAW,EAAE,gBAF2D;AAGxEkK,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE;AACRlL,MAAAA,IAAI,EAAE;AADE;AADL,GAHiE;AAQxEmL,EAAAA,UAAU,EAAE,0BAR4D;AASxEC,EAAAA,UAAU,EAAE;AAT4D,CAAnE;;AAYP,SAASC,yBAAT,CAAmCJ,KAAnC;AACE,SACEK,mBAAA,CAACV,gBAAD,MAAA,EACGK,KAAK,CAACC,QADT,CADF;AAKD;;AAED,SAAgBK,yBACdC,QACAC;AAEA,MAAMC,mBAAmB,GAA6B,SAAhDA,mBAAgD;AAAA,WACpDF,MAAM,GAAGA,MAAM,CAACG,iBAAP,OAAAH,MAAM,YAAT,GAAuCG,iBAAiB,MAAjB,mBADO;AAAA,GAAtD;;AAEAD,EAAAA,mBAAmB,CAACL,yBAAD,EAA4BI,0BAA5B,WAA4BA,0BAA5B,GAA0DT,oBAA1D,CAAnB;AACD;;SC/BeY,YAAYJ;AAC1BD,EAAAA,wBAAwB,CAACC,MAAD,CAAxB;AACD;;;;"}
|
package/dist/local.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/commerce-local",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "Plasmic registration calls for local provider components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"analyze": "size-limit --why"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@plasmicapp/host": "1.0.
|
|
21
|
+
"@plasmicapp/host": "1.0.48",
|
|
22
22
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
23
23
|
"@types/js-cookie": "^3.0.1",
|
|
24
24
|
"@types/node": "^14.0.26",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"react": ">=16.8.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@plasmicpkgs/commerce": "0.0.
|
|
37
|
+
"@plasmicpkgs/commerce": "0.0.29",
|
|
38
38
|
"@types/react": "^17.0.40"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "e57163897e6ebf84ce69bab6a43a77d66316dd64"
|
|
41
41
|
}
|