@shopware-ag/meteor-component-library
Version:
The meteor component library is a Vue component library developed by Shopware. It is based on the [Meteor Design System](https://shopware.design/).
1 lines • 108 kB
Source Map (JSON)
{"version":3,"file":"channel-e8be2d79.mjs","sources":["../../../node_modules/lodash-es/_baseHas.js","../../../node_modules/lodash-es/isSymbol.js","../../../node_modules/lodash-es/_isKey.js","../../../node_modules/lodash-es/memoize.js","../../../node_modules/lodash-es/_memoizeCapped.js","../../../node_modules/lodash-es/_stringToPath.js","../../../node_modules/lodash-es/_arrayMap.js","../../../node_modules/lodash-es/_baseToString.js","../../../node_modules/lodash-es/toString.js","../../../node_modules/lodash-es/_castPath.js","../../../node_modules/lodash-es/_toKey.js","../../../node_modules/lodash-es/_hasPath.js","../../../node_modules/lodash-es/has.js","../../admin-sdk/es/_internals/utils.js","../../admin-sdk/es/_internals/privileges/missing-privileges-error.js","../../admin-sdk/es/_internals/serializer/function-serializer.js","../../admin-sdk/es/_internals/serializer/criteria-serializer.js","../../admin-sdk/es/_internals/data/Entity.js","../../admin-sdk/es/_internals/serializer/entity-serializer.js","../../admin-sdk/es/_internals/data/EntityCollection.js","../../admin-sdk/es/_internals/serializer/entity-collection-serializer.js","../../admin-sdk/es/_internals/error-handling/HandleError.js","../../admin-sdk/es/_internals/serializer/handle-error-serializer.js","../../../node_modules/lodash-es/cloneDeepWith.js","../../../node_modules/lodash-es/_baseGet.js","../../../node_modules/lodash-es/get.js","../../../node_modules/lodash-es/_baseSet.js","../../../node_modules/lodash-es/set.js","../../admin-sdk/es/_internals/serializer/missing-priviliges-error-serializer.js","../../admin-sdk/es/_internals/serializer/index.js","../../admin-sdk/es/_internals/error-handling/error-factory.js","../../admin-sdk/es/_internals/validator/index.js","../../admin-sdk/es/_internals/data/selectData.js","../../admin-sdk/es/_internals/sdkVersion.js","../../admin-sdk/es/channel.js"],"sourcesContent":["/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nexport default baseHas;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n","import baseHas from './_baseHas.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nexport default has;\n","import has from 'lodash-es/has';\nexport function generateUniqueId() {\n return String(Date.now().toString(36) + Math.random().toString(36).substr(2));\n}\n/* eslint-disable */\nexport function isObject(value) {\n return value !== null && typeof value === 'object';\n}\nexport function getLocationId() {\n const params = new URLSearchParams(window.location.search);\n return params.get('location-id');\n}\nexport function getWindowSrc() {\n const location = window.location;\n const urlObject = new URL(location.pathname, location.origin);\n return urlObject.toString();\n}\nexport function hasType(type, obj) {\n return isObject(obj) && obj.__type__ && obj.__type__ === type;\n}\nexport function hasOwnProperty(obj, path) {\n return has(obj, path);\n}\nexport function traverseObject(traversableObject, processor, previousKey = 'root') {\n for (let index in traversableObject) {\n const currentEntry = traversableObject[index];\n processor.apply(this, [traversableObject, index, currentEntry, previousKey]);\n if (isObject(currentEntry)) {\n let pk = previousKey + '.' + index;\n traverseObject(currentEntry, processor, pk);\n }\n }\n}\nexport function isPrimitive(value) {\n return value !== Object(value) || value === null || value === undefined;\n}\n/**\n * Removes the root prefix from a path\n */\nexport function removeRoot(path) {\n if (typeof path !== 'string') {\n return path;\n }\n return path.replace(/^root\\./, '');\n}\nexport function findExtensionByBaseUrl(baseUrl) {\n if (typeof baseUrl !== 'string') {\n return undefined;\n }\n if (baseUrl === '') {\n return undefined;\n }\n const comparedBaseUrl = new URL(baseUrl);\n /*\n * Check if baseUrl is the same as the current window location\n * If so, return the dummy extension with all privileges available\n */\n if (comparedBaseUrl.origin === window.location.origin) {\n return {\n baseUrl: comparedBaseUrl.hostname,\n permissions: {\n additional: ['*'],\n create: ['*'],\n read: ['*'],\n update: ['*'],\n delete: ['*'],\n },\n };\n }\n return Object.values(window._swsdk.adminExtensions)\n .find((ext) => {\n const extensionBaseUrl = new URL(ext.baseUrl);\n return extensionBaseUrl.hostname === comparedBaseUrl.hostname;\n });\n}\n//# sourceMappingURL=utils.js.map","export default class MissingPrivilegesError extends Error {\n constructor(messageType, missingPrivileges) {\n super(`Your app is missing the privileges ${missingPrivileges.join(', ')} for action \"${messageType}\".`);\n Object.defineProperty(this, \"missingPrivileges\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"messageType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.missingPrivileges = missingPrivileges;\n this.messageType = messageType;\n // Set prototype explicitly\n Object.setPrototypeOf(this, MissingPrivilegesError.prototype);\n }\n toJSON() {\n return {\n __type__: '__MissingPrivilegesError__',\n __messageType__: this.messageType,\n __data__: this.missingPrivileges,\n };\n }\n}\n//# sourceMappingURL=missing-privileges-error.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { isObject, generateUniqueId } from '../utils';\n/* eslint-disable */\nconst FunctionSerializerFactory = ({ send, handle }) => {\n // only available on sender side\n const methodRegistry = {};\n let isMethodHandlerStarted = false;\n function startMethodHandler() {\n if (isMethodHandlerStarted)\n return;\n isMethodHandlerStarted = true;\n handle('__function__', ({ args, id }) => __awaiter(this, void 0, void 0, function* () {\n return yield Promise.resolve(methodRegistry[id](...args));\n }));\n }\n return {\n name: 'function',\n serialize: ({ value }) => {\n if (typeof value === 'function') {\n const id = generateUniqueId();\n // add the method reference to the methodRegistry\n methodRegistry[id] = value;\n // start a general function listener which calls the method when the handler calls the method\n startMethodHandler();\n // replace function with a object containing the type and id\n return {\n __type__: '__function__',\n id: id,\n origin: window.origin,\n };\n }\n },\n deserialize: ({ value, event }) => {\n var _a;\n // @ts-expect-error\n const targetWindow = (_a = event === null || event === void 0 ? void 0 : event.source) !== null && _a !== void 0 ? _a : window;\n // when object is containing a method wrapper\n if (isObject(value)\n && value['__type__']\n && value['__type__'] === '__function__'\n && typeof value['id'] === 'string') {\n const id = value['id'];\n const origin = value['origin'];\n // convert wrapper to a callable method\n return (...args) => {\n return send('__function__', {\n args: args,\n id: id,\n }, targetWindow, origin);\n };\n }\n }\n };\n};\nexport default FunctionSerializerFactory;\n//# sourceMappingURL=function-serializer.js.map","import { hasType } from '../utils';\nimport Criteria from '../../data/Criteria';\n/* eslint-disable */\nconst CriteriaSerializer = () => ({\n name: 'criteria',\n serialize: ({ value, customizerMethod, seen, path }) => {\n if (value instanceof Criteria) {\n return {\n __type__: '__Criteria__',\n data: customizerMethod(value.getCriteriaData(), seen, path),\n };\n }\n },\n deserialize: ({ value, customizerMethod }) => {\n // When object is containing a criteria wrapper\n if (hasType('__Criteria__', value) && typeof value['data'] === 'object') {\n // The original values\n const serializedData = value.data;\n // Create new criteria object\n const deserializedCriteria = new Criteria();\n // Hydrate the criteria with the orignal values\n deserializedCriteria.setPage(serializedData.page);\n deserializedCriteria.setLimit(serializedData.limit);\n deserializedCriteria.setTerm(serializedData.term);\n if (serializedData.title !== null) {\n deserializedCriteria.setTitle(serializedData.title);\n }\n // @ts-expect-error\n serializedData.filters.forEach((filter) => {\n deserializedCriteria.addFilter(filter);\n });\n deserializedCriteria.setIds(serializedData.ids);\n // @ts-expect-error\n serializedData.queries.forEach(({ query, score }) => {\n deserializedCriteria.addQuery(query, score);\n });\n // @ts-expect-error\n serializedData.associations.forEach((association) => {\n // Associations need also to be deserialized\n deserializedCriteria.associations.push(customizerMethod(association));\n });\n // @ts-expect-error\n serializedData.postFilter.forEach((filter) => {\n deserializedCriteria.addPostFilter(filter);\n });\n // @ts-expect-error\n serializedData.sortings.forEach((sorting) => {\n deserializedCriteria.addSorting(sorting);\n });\n // @ts-expect-error\n serializedData.aggregations.forEach((aggregation) => {\n deserializedCriteria.addAggregation(aggregation);\n });\n // @ts-expect-error\n serializedData.grouping.forEach((group) => {\n deserializedCriteria.addGrouping(group);\n });\n // @ts-expect-error\n serializedData.fields.forEach((field) => {\n deserializedCriteria.addFields(field);\n });\n // @ts-expect-error\n serializedData.groupFields.forEach((groupField) => {\n deserializedCriteria.addGroupField(groupField);\n });\n if (serializedData.includes) {\n deserializedCriteria.addIncludes(serializedData.includes);\n }\n deserializedCriteria.setTotalCountMode(serializedData.totalCountMode);\n // Return new Criteria object\n return deserializedCriteria;\n }\n }\n});\nexport default CriteriaSerializer;\n//# sourceMappingURL=criteria-serializer.js.map","import cloneDeep from 'lodash-es/cloneDeep';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet setterMethod = (draft, property, value) => {\n draft[property] = value;\n};\n/**\n * @internal\n */\nexport function assignSetterMethod(newSetterMethod) {\n setterMethod = newSetterMethod;\n}\nclass EntityClass {\n constructor(id, entityName, data, options = {}) {\n var _a, _b;\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_origin\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_entityName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_draft\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_isDirty\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_isNew\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.id = id;\n this._origin = options.originData ? cloneDeep(options.originData) : cloneDeep(data);\n this._entityName = entityName;\n this._draft = data;\n this._isDirty = (_a = options.isDirty) !== null && _a !== void 0 ? _a : false;\n this._isNew = (_b = options.isNew) !== null && _b !== void 0 ? _b : false;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n // @ts-expect-error - the proxy contains the draft and the entity class\n return new Proxy(this._draft, {\n get(_, property) {\n if (property in that._draft) {\n // @ts-expect-error - the proxy contains the draft and the entity class\n return that._draft[property];\n }\n // @ts-expect-error Its unsure if the property exists on the this alias\n return that[property];\n },\n set(_, property, value) {\n setterMethod(that._draft, property, value);\n that._isDirty = true;\n return true;\n },\n });\n }\n /**\n * Identifier method for the entity class. Needed when some reactive data layer (Vue) converts the EntityClass to a\n * plain object. With this identifier method we can (de)serialie it back to the correct entity class.\n */\n __identifier__() {\n return 'Entity';\n }\n /**\n * Marks the entity as new. New entities will be provided as create request to the server\n */\n markAsNew() {\n this._isNew = true;\n }\n /**\n * Allows to check if the entity is a new entity and should be provided as create request to the server\n */\n isNew() {\n return this._isNew;\n }\n /**\n * Allows to check if the entity changed\n */\n getIsDirty() {\n return this._isDirty;\n }\n /**\n * Allows access the origin entity value. The origin value contains the server values\n */\n getOrigin() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this._origin;\n }\n /**\n * Allows to access the draft value. The draft value contains all local changes of the entity\n */\n getDraft() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this._draft;\n }\n /**\n * Allows to access the entity name. The entity name is used as unique identifier `product`, `media`, ...\n */\n getEntityName() {\n return this._entityName;\n }\n}\nconst Entity = function Entity(id, entityName, data, options) {\n return new EntityClass(id, entityName, data, options);\n};\nexport default Entity;\n//# sourceMappingURL=Entity.js.map","import { isObject, hasType } from '../utils';\nimport EntityClass from '../data/Entity';\n/* eslint-disable */\nconst EntitySerializerFactory = () => ({\n name: 'entity',\n serialize: ({ value, customizerMethod, seen, path }) => {\n if (!isObject(value) || typeof value.__identifier__ !== 'function' || value.__identifier__() !== 'Entity') {\n return;\n }\n return {\n __type__: '__Entity__',\n __id__: value.id,\n __entityName__: value._entityName,\n __isDirty__: value._isDirty,\n __isNew__: value._isNew,\n __origin__: customizerMethod(value._origin, seen, path),\n __draft__: customizerMethod(value._draft, seen, path),\n };\n },\n deserialize: ({ value, customizerMethod }) => {\n if (hasType('__Entity__', value) && typeof value.__origin__ === 'object') {\n return new EntityClass(value.__id__, value.__entityName__, customizerMethod(value.__draft__), {\n originData: customizerMethod(value.__origin__),\n isDirty: value.__isDirty__,\n isNew: value.__isNew__,\n });\n }\n },\n});\nexport default EntitySerializerFactory;\n//# sourceMappingURL=entity-serializer.js.map","import Criteria from '../../data/Criteria';\nexport default class EntityCollection extends Array {\n constructor(source, entityName, context, criteria = null, entities = [], total = null, aggregations = null) {\n super();\n Object.defineProperty(this, \"entity\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"source\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"context\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"criteria\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"aggregations\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"total\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"first\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"last\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"remove\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"has\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"get\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"getAt\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"getIds\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"add\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"addAt\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"moveItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"__identifier__\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.entity = entityName;\n this.source = source;\n this.context = context;\n this.criteria = criteria;\n this.aggregations = aggregations;\n this.total = total;\n this.push(...entities);\n /**\n * Identifier method for the EntityCollection class. Needed when some reactive data layer (Vue) converts the EntityCollection to a\n * plain array. With this identifier method we can (de)serialie it back to the correct EntityCollection.\n */\n this.__identifier__ = () => {\n return 'EntityCollection';\n };\n /**\n * Returns the first item of the collection.\n * Returns null if the collection is empty\n */\n this.first = function firstEntityOfCollection() {\n if (this.length <= 0) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this[0];\n };\n /**\n * Returns the last item of the collection.\n * Returns null if the collection is empty.\n */\n this.last = function lastEntityOfCollection() {\n if (this.length <= 0) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this[this.length - 1];\n };\n /**\n * Removes an entity from the collection. The entity is identified by the provided id\n * Returns true if the entity removed, false if the entity wasn't found\n */\n this.remove = function removeEntityFromCollection(id) {\n const itemIndex = this.findIndex(i => i.id === id);\n if (itemIndex < 0) {\n return false;\n }\n this.splice(itemIndex, 1);\n return true;\n };\n /**\n * Checks if the provided id is inside the collection\n */\n this.has = function hasEntityInCollection(id) {\n return this.some(i => i.id === id);\n };\n /**\n * Returns the entity for the provided id, null if the entity is not inside the collection\n */\n this.get = function getEntityByIdOfCollection(id) {\n const item = this.find(i => i.id === id);\n if (typeof item !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return item;\n }\n return null;\n };\n /**\n * Returns the entity at the given index position.\n */\n this.getAt = function getEntityAtIndexOfCollection(index) {\n const item = this[index];\n if (typeof item !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return item;\n }\n return null;\n };\n /**\n * Returns all ids of the internal entities\n */\n this.getIds = function getEntityIdsOfCollection() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.map(i => i.id);\n };\n /**\n * Adds a new item to the collection\n */\n this.add = function addEntityToCollection(e) {\n this.push(e);\n };\n /**\n * Adds an entity to the collection at the given position.\n */\n this.addAt = function addEntityAtIndexOfCollection(e, insertIndex) {\n if (typeof insertIndex === 'undefined') {\n this.add(e);\n return;\n }\n this.splice(insertIndex, 0, e);\n };\n /**\n * Move an item of the collection from an old index to a new index position.\n */\n this.moveItem = function moveEntityToNewIndexInCollection(oldIndex, newIndex = null) {\n if (newIndex === null) {\n newIndex = this.length;\n }\n if (oldIndex < 0 || oldIndex >= this.length) {\n return null;\n }\n if (newIndex === oldIndex) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.getAt(oldIndex);\n }\n const movedItem = this.find((_, index) => index === oldIndex);\n if (typeof movedItem === 'undefined') {\n return null;\n }\n const remainingItems = this.filter((_, index) => index !== oldIndex);\n const orderedItems = [\n ...remainingItems.slice(0, newIndex),\n movedItem,\n ...remainingItems.slice(newIndex),\n ];\n this.splice(0, this.length, ...orderedItems);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return movedItem;\n };\n /**\n * Filters an EntityCollection and preserves its type. Resets criteria and total since it would mismatch.\n */\n // @ts-expect-error Overloads Array function therefore types mismatch\n this.filter = function filterEntityCollection(callback, scope) {\n const filtered = Object.getPrototypeOf(this)\n .filter.call(this, callback, scope);\n return new EntityCollection(this.source, this.entity, this.context, this.criteria, filtered, this.total, this.aggregations);\n };\n }\n /**\n * Returns a new collection from given one with\n */\n static fromCollection(collection) {\n return new EntityCollection(collection.source, collection.entity, collection.context, collection.criteria === null ? collection.criteria : Criteria.fromCriteria(collection.criteria), collection, collection.total, collection.aggregations);\n }\n}\n//# sourceMappingURL=EntityCollection.js.map","import { hasType } from '../utils';\nimport EntityCollection from '../data/EntityCollection';\n/* eslint-disable */\nconst EntityCollectionSerializerFactory = () => ({\n name: 'entity-collection',\n serialize: ({ value, customizerMethod, seen, path }) => {\n if (value instanceof EntityCollection || ((value === null || value === void 0 ? void 0 : value.__identifier__) && value.__identifier__() === 'EntityCollection')) {\n return customizerMethod({\n __type__: '__EntityCollection__',\n __source__: value.source,\n __entityName__: value.entity,\n __context__: value.context,\n __criteria__: value.criteria,\n __entities__: Array.from(value),\n __total__: value.total,\n __aggregations__: value.aggregations,\n }, seen, path);\n }\n },\n deserialize: ({ value, customizerMethod }) => {\n if (hasType('__EntityCollection__', value)) {\n return new EntityCollection(value.__source__, value.__entityName__, value.__context__, customizerMethod(value.__criteria__), customizerMethod(value.__entities__), value.__total__, value.__aggregations__);\n }\n },\n});\nexport default EntityCollectionSerializerFactory;\n//# sourceMappingURL=entity-collection-serializer.js.map","export default class HandleError extends Error {\n constructor(msg, code) {\n super(msg);\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 500\n });\n if (!code) {\n return;\n }\n this.code = code;\n }\n toJSON() {\n return {\n __type__: '__HandleError__',\n __code__: this.code,\n __message__: this.message,\n };\n }\n}\n//# sourceMappingURL=HandleError.js.map","import { hasType } from '../utils';\nimport HandleError from '../error-handling/HandleError';\n/* eslint-disable */\nconst HandleErrorSerializerFactory = () => ({\n name: 'handle-error',\n // serialize is empty because the error contains a toJSON function\n serialize: () => { },\n deserialize: ({ value }) => {\n if (hasType('__HandleError__', value)) {\n return new HandleError(value.__message__, value.__code__);\n }\n },\n});\nexport default HandleErrorSerializerFactory;\n//# sourceMappingURL=handle-error-serializer.js.map","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\nfunction cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n}\n\nexport default cloneDeepWith;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","import assignValue from './_assignValue.js';\nimport castPath from './_castPath.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nexport default baseSet;\n","import baseSet from './_baseSet.js';\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nexport default set;\n","import { hasType } from '../utils';\nimport MissingPrivilegesError from '../privileges/missing-privileges-error';\n/* eslint-disable */\nconst MissingPrivilegesErrorSerializer = () => ({\n name: 'handle-error',\n // serialize is empty because the error contains a toJSON function\n serialize: () => { },\n deserialize: ({ value }) => {\n if (hasType('__MissingPrivilegesError__', value)) {\n return new MissingPrivilegesError(value.__messageType__, value.__data__);\n }\n },\n});\nexport default MissingPrivilegesErrorSerializer;\n//# sourceMappingURL=missing-priviliges-error-serializer.js.map","import FunctionSerializer from './function-serializer';\nimport CriteriaSerializer from './criteria-serializer';\nimport EntitySerializer from './entity-serializer';\nimport EntityCollectionSerializer from './entity-collection-serializer';\nimport HandleErrorSerializer from './handle-error-serializer';\nimport cloneDeepWith from 'lodash-es/cloneDeepWith';\nimport get from 'lodash-es/get';\nimport set from 'lodash-es/set';\nimport MissingPrivilegesErrorSerializer from './missing-priviliges-error-serializer';\nimport { isPrimitive, traverseObject, removeRoot } from '../utils';\n/**\n * Collect all single serializer/deserializer. The first matching result\n * will be used as the customizer in cloneDeepWith\n */\nconst serializerFactories = [\n CriteriaSerializer,\n EntityCollectionSerializer,\n EntitySerializer,\n FunctionSerializer,\n HandleErrorSerializer,\n MissingPrivilegesErrorSerializer,\n];\n/**\n * The main serializer factory. It returns a general serializer/deserializer which combines\n * all single serializer\n */\nexport default function mainSerializerFactory(dependencies) {\n const serializers = serializerFactories.map(serializerFactory => serializerFactory(dependencies));\n function getSerializers() {\n return serializers;\n }\n function getSerializerByName(name) {\n var _a;\n return (_a = serializers.find(serializer => serializer.name === name)) !== null && _a !== void 0 ? _a : null;\n }\n /* eslint-disable */\n function serialize(messageData, seen = new Map(), path = 'root') {\n return cloneDeepWith(messageData, (value, key, object, stack) => {\n // track the path to the current value\n let p = path + '.' + key;\n // early return for primitives to save some computation\n if (isPrimitive(value)) {\n return value;\n }\n // encountered this value before === circular reference\n if (seen.has(value)) {\n // replace the circular reference with a reference object containing its origin\n return {\n __$CR__: seen.get(value),\n };\n }\n // save the path to the current value\n seen.set(value, p);\n // return first matching serializer result\n for (const serializer of serializers) {\n const result = serializer.serialize({\n value,\n key,\n object,\n stack,\n customizerMethod: serialize,\n seen,\n path: p,\n });\n if (result) {\n return result;\n }\n ;\n }\n });\n }\n function deserialize(messageData, event) {\n // restore all entities, collections and other serialized objects\n const desirialized = _deserialize(messageData, event);\n // restore circular references\n traverseObject(desirialized, (_, key, value, previousKey) => {\n // check if the current key is a circular reference identifier\n if (key !== '__$CR__') {\n return;\n }\n // the path to the value going to be restored as a circular reference\n const path = removeRoot(value);\n // the path where the circular reference should be restored\n const reference = removeRoot(pr