@commercetools/sync-actions 6.0.0 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lodash.flatten"),require("lodash.isequal"),require("lodash.isnil"),require("diff-match-patch"),require("chalk"),require("lodash.foreach"),require("lodash.uniqwith"),require("lodash.intersection"),require("lodash.without"),require("lodash.sortby")):"function"==typeof define&&define.amd?define(["exports","lodash.flatten","lodash.isequal","lodash.isnil","diff-match-patch","chalk","lodash.foreach","lodash.uniqwith","lodash.intersection","lodash.without","lodash.sortby"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CommercetoolsSyncActions={},t.flatten,t.isEqual,t.isNil,t.dmp,t.chalk,t.forEach,t.uniqWith,t.intersection,t.without,t.sortBy$1)}(this,function(t,e,V,M,F,z,L,K,B,q,U){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var m=n(e),H=n(V),d=n(M),$=n(F),G=n(z),g=n(L),J=n(K),Z=n(B),Q=n(q),W=n(U);function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function b(t,e,n){return(e=function(t){t=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:t+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tt(t,e){if(null==t)return{};var n,i=function(t,e){if(null==t)return{};var n,i={};for(n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(t),o=0;o<r.length;o++)n=r[o],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);return i}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,u=[],s=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=o.call(n)).done)&&(u.push(i.value),u.length!==e);s=!0);}catch(t){c=!0,r=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return u}}(t,e)||et(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||et(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function et(t,e){var n;if(t)return"string"==typeof t?X(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,e):void 0}var nt=["prices"];var it=function(t){return{value:{currencyCode:t.value.currencyCode},channel:t.channel,country:t.country,customerGroup:t.customerGroup,validFrom:t.validFrom,validUntil:t.validUntil}};function rt(n,t){return t&&t.prices.find(function(t){return e=n,t=it(t=t),e=it(e),H.default(e,t);var e})||null}function i(o,a,u,t){var s=3<arguments.length&&void 0!==t?t:{};return function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)throw new Error("Missing either `newObj` or `oldObj` in order to build update actions");e=e,t=t;var r,i=f((i=u)&&"function"==typeof i?i(e,t):[e,t],2),e=i[0],t=i[1],i=(t.variants&&e.variants&&(t.variants=(i=t.variants,r=e.variants,i.map(function(e){var n,t=e.prices,i=tt(e,nt);return t?(n=r.find(function(t){return!d.default(t.id)&&t.id===e.id||!d.default(t.key)&&t.key===e.key||!d.default(t.sku)&&t.sku===e.sku}),h(h({},i),{},{prices:t.map(function(t){var e=h({},t),t=rt(t,n);return t&&(e.id||(e.id=t.id),d.default(e.value.type)&&(e.value.type=t.value.type),d.default(e.value.fractionDigits))&&(e.value.fractionDigits=t.value.fractionDigits),e})})):i}))),o(e,t));return s.withHints||i?a(i,t,e,n):[]}}function r(t){var i=0<arguments.length&&void 0!==t?t:[];return function(e,t){if(!Object.keys(i).length)return t();var n=i.find(function(t){return t.type===e});if(!n)return[];if("ignore"===n.group||"black"===n.group)return[];if("allow"===n.group||"white"===n.group)return t();throw new Error("Action group '".concat(n.group,'\' not supported. Use either "allow" or "ignore".'))}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s="function"==typeof Symbol&&"symbol"===O(Symbol.iterator)?function(t){return O(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":O(t)},e=function(t,e,n){return e&&ot(t.prototype,e),n&&ot(t,n),t};function ot(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function at(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);return void 0!==i?"value"in i?i.value:void 0!==(i=i.get)?i.call(n):void 0:null!==(i=Object.getPrototypeOf(t))?at(i,e,n):void 0}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+O(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){if(t)return!e||"object"!==O(e)&&"function"!=typeof e?t:e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}var ut=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var n=e,i=[],r=!0,e=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(i.push(a.value),!n||i.length!==n);r=!0);}catch(t){e=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(e)throw o}}return i}throw new TypeError("Invalid attempt to destructure non-iterable instance")},st=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},ct=(e(lt,[{key:"options",value:function(t){return t&&(this.selfOptions=t),this.selfOptions}},{key:"pipe",value:function(t,e){if("string"==typeof t){if(void 0===e)return this.pipes[t];this.pipes[t]=e}if(t&&t.name){if((e=t).processor===this)return e;this.pipes[e.name]=e}return e.processor=this,e}},{key:"process",value:function(t,e){for(var n,i,r=t,o=(r.options=this.options(),e||t.pipe||"default");o;)void 0!==r.nextAfterChildren&&(r.next=r.nextAfterChildren,r.nextAfterChildren=null),(o="string"==typeof o?this.pipe(o):o).process(r),n=o,o=null,(i=r)&&r.next&&(r=r.next,o=i.nextPipe||r.pipe||n);return r.hasResult?r.result:void 0}}]),lt);function lt(t){o(this,lt),this.selfOptions=t||{},this.pipes={}}e(dt,[{key:"process",value:function(t){if(!this.processor)throw new Error("add this pipe to a processor before using it");for(var e=this.debug,n=this.filters.length,i=t,r=0;r<n;r++){var o=this.filters[r];if(e&&this.log("filter: "+o.filterName),o(i),"object"===(void 0===i?"undefined":s(i))&&i.exiting){i.exiting=!1;break}}!i.next&&this.resultCheck&&this.resultCheck(i)}},{key:"log",value:function(t){console.log("[jsondiffpatch] "+this.name+" pipe, "+t)}},{key:"append",value:function(){var t;return(t=this.filters).push.apply(t,arguments),this}},{key:"prepend",value:function(){var t;return(t=this.filters).unshift.apply(t,arguments),this}},{key:"indexOf",value:function(t){if(!t)throw new Error("a filter name is required");for(var e=0;e<this.filters.length;e++)if(this.filters[e].filterName===t)return e;throw new Error("filter not found: "+t)}},{key:"list",value:function(){return this.filters.map(function(t){return t.filterName})}},{key:"after",value:function(t){var t=this.indexOf(t),e=Array.prototype.slice.call(arguments,1);if(e.length)return e.unshift(t+1,0),Array.prototype.splice.apply(this.filters,e),this;throw new Error("a filter is required")}},{key:"before",value:function(t){var t=this.indexOf(t),e=Array.prototype.slice.call(arguments,1);if(e.length)return e.unshift(t,0),Array.prototype.splice.apply(this.filters,e),this;throw new Error("a filter is required")}},{key:"replace",value:function(t){var t=this.indexOf(t),e=Array.prototype.slice.call(arguments,1);if(e.length)return e.unshift(t,1),Array.prototype.splice.apply(this.filters,e),this;throw new Error("a filter is required")}},{key:"remove",value:function(t){t=this.indexOf(t);return this.filters.splice(t,1),this}},{key:"clear",value:function(){return this.filters.length=0,this}},{key:"shouldHaveResult",value:function(t){var e;if(!1===t)this.resultCheck=null;else if(!this.resultCheck)return(e=this).resultCheck=function(t){if(!t.hasResult)throw console.log(t),(t=new Error(e.name+" failed")).noResult=!0,t},this}}]);var ft=dt;function dt(t){o(this,dt),this.name=t,this.filters=[]}e(ht,[{key:"setResult",value:function(t){return this.result=t,this.hasResult=!0,this}},{key:"exit",value:function(){return this.exiting=!0,this}},{key:"switchTo",value:function(t,e){return"string"==typeof t||t instanceof ft?this.nextPipe=t:(this.next=t,e&&(this.nextPipe=e)),this}},{key:"push",value:function(t,e){return t.parent=this,void 0!==e&&(t.childName=e),t.root=this.root||this,t.options=t.options||this.options,this.children?(this.children[this.children.length-1].next=t,this.children.push(t)):(this.children=[t],this.nextAfterChildren=this.next||null,this.next=t),t.next=this}}]);var pt=ht;function ht(){o(this,ht)}var yt="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array};function vt(t){if("object"!==(void 0===t?"undefined":s(t)))return t;if(null===t)return null;if(yt(t))return t.map(vt);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return e=/^\/(.*)\/([gimyu]*)$/.exec((e=t).toString()),new RegExp(e[1],e[2]);var e,n,i={};for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=vt(t[n]));return i}a(mt,pt),e(mt,[{key:"setResult",value:function(t){var e;return this.options.cloneDiffValues&&"object"===(void 0===t?"undefined":s(t))&&(e="function"==typeof this.options.cloneDiffValues?this.options.cloneDiffValues:vt,"object"===s(t[0])&&(t[0]=e(t[0])),"object"===s(t[1]))&&(t[1]=e(t[1])),pt.prototype.setResult.apply(this,arguments)}}]);var w=mt;function mt(t,e){o(this,mt);var n=u(this,(mt.__proto__||Object.getPrototypeOf(mt)).call(this));return n.left=t,n.right=e,n.pipe="diff",n}a(bt,pt);var gt=bt;function bt(t,e){o(this,bt);var n=u(this,(bt.__proto__||Object.getPrototypeOf(bt)).call(this));return n.left=t,n.delta=e,n.pipe="patch",n}a(Ot,pt);var kt=Ot;function Ot(t){o(this,Ot);var e=u(this,(Ot.__proto__||Object.getPrototypeOf(Ot)).call(this));return e.delta=t,e.pipe="reverse",e}function jt(t){if(t.left===t.right)t.setResult(void 0).exit();else if(void 0===t.left){if("function"==typeof t.right)throw new Error("functions are not supported");t.setResult([t.right]).exit()}else if(void 0===t.right)t.setResult([t.left,0,0]).exit();else{if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");t.leftType=null===t.left?"null":s(t.left),t.rightType=null===t.right?"null":s(t.right),t.leftType!==t.rightType||"boolean"===t.leftType||"number"===t.leftType||("object"===t.leftType&&(t.leftIsArray=xt(t.left)),"object"===t.rightType&&(t.rightIsArray=xt(t.right)),t.leftIsArray!==t.rightIsArray)?t.setResult([t.left,t.right]).exit():t.left instanceof RegExp&&(t.right instanceof RegExp?t.setResult([t.left.toString(),t.right.toString()]):t.setResult([t.left,t.right])).exit()}}function wt(t){if(void 0===t.delta)t.setResult(t.left).exit();else if(t.nested=!xt(t.delta),!t.nested)if(1===t.delta.length)t.setResult(t.delta[0]).exit();else if(2===t.delta.length){if(t.left instanceof RegExp){var e=/^\/(.*)\/([gimyu]+)$/.exec(t.delta[1]);if(e)return void t.setResult(new RegExp(e[1],e[2])).exit()}t.setResult(t.delta[1]).exit()}else 3===t.delta.length&&0===t.delta[2]&&t.setResult(void 0).exit()}function At(t){void 0===t.delta?t.setResult(t.delta).exit():(t.nested=!xt(t.delta),t.nested||(1===t.delta.length?t.setResult([t.delta[0],0,0]).exit():2===t.delta.length?t.setResult([t.delta[1],t.delta[0]]).exit():3===t.delta.length&&0===t.delta[2]&&t.setResult([t.delta[0]]).exit()))}var xt="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array};function St(t){if(t&&t.children){for(var e,n=t.children.length,i=t.result,r=0;r<n;r++)void 0!==(e=t.children[r]).result&&((i=i||{})[e.childName]=e.result);i&&t.leftIsArray&&(i._t="a"),t.setResult(i).exit()}}function It(t){if(!t.leftIsArray&&"object"===t.leftType){var e=void 0,n=void 0,i=t.options.propertyFilter;for(e in t.left)!Object.prototype.hasOwnProperty.call(t.left,e)||i&&!i(e,t)||(n=new w(t.left[e],t.right[e]),t.push(n,e));for(e in t.right)!Object.prototype.hasOwnProperty.call(t.right,e)||i&&!i(e,t)||void 0===t.left[e]&&(n=new w(void 0,t.right[e]),t.push(n,e));(t.children&&0!==t.children.length?t:t.setResult(void 0)).exit()}}At.filterName=wt.filterName=jt.filterName="trivial",St.filterName="collectChildren";function Et(t){if(t.nested&&!t.delta._t){var e,n=void 0;for(n in t.delta)e=new gt(t.left[n],t.delta[n]),t.push(e,n);t.exit()}}function _t(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,i=0;i<n;i++)e=t.children[i],Object.prototype.hasOwnProperty.call(t.left,e.childName)&&void 0===e.result?delete t.left[e.childName]:t.left[e.childName]!==e.result&&(t.left[e.childName]=e.result);t.setResult(t.left).exit()}}function Ct(t){if(t.nested&&!t.delta._t){var e,n=void 0;for(n in t.delta)e=new kt(t.delta[n]),t.push(e,n);t.exit()}}Et.filterName=It.filterName="objects",_t.filterName="collectChildren";function Nt(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,i={},r=0;r<n;r++)i[(e=t.children[r]).childName]!==e.result&&(i[e.childName]=e.result);t.setResult(i).exit()}}Ct.filterName="objects",Nt.filterName="collectChildren";function Rt(t,e,n,i){return t[n]===e[i]}var Dt=function(t,e,n,i){i=i||{},n=function(t,e,n,i){for(var r,o=e.length,a=n.length,u={sequence:[],indices1:[],indices2:[]};0!==o&&0!==a;)t.match(e,n,o-1,a-1,i)?(u.sequence.unshift(e[o-1]),u.indices1.unshift(o-1),u.indices2.unshift(a-1),--o,--a):(r=t[o][a-1],t[o-1][a]<r?--a:--o);return u}(function(t,e,n,i){for(var r=t.length,o=e.length,a=void 0,u=void 0,s=[r+1],a=0;a<r+1;a++)for(s[a]=[o+1],u=0;u<o+1;u++)s[a][u]=0;for(s.match=n,a=1;a<r+1;a++)for(u=1;u<o+1;u++)n(t,e,a-1,u-1,i)?s[a][u]=s[a-1][u-1]+1:s[a][u]=Math.max(s[a-1][u],s[a][u-1]);return s}(t,e,n||Rt,i),t,e,i);return"string"==typeof t&&"string"==typeof e&&(n.sequence=n.sequence.join("")),n},Pt=3,Tt="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},Vt="function"==typeof Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i]===e)return i;return-1};function Mt(t,e,n,i,r){var o,a,u,t=t[n],e=e[i];return t===e||"object"===(void 0===t?"undefined":s(t))&&"object"===(void 0===e?"undefined":s(e))&&((o=r.objectHash)?(u=a=void 0,"number"==typeof n?(r.hashCache1=r.hashCache1||[],void 0===(a=r.hashCache1[n])&&(r.hashCache1[n]=a=o(t,n))):a=o(t),void 0!==a&&("number"==typeof i?(r.hashCache2=r.hashCache2||[],void 0===(u=r.hashCache2[i])&&(r.hashCache2[i]=u=o(e,i))):u=o(e),void 0!==u)&&a===u):r.matchByPosition&&n===i)}function Ft(t){if(t.leftIsArray){var e={objectHash:t.options&&t.options.objectHash,matchByPosition:t.options&&t.options.matchByPosition},n=0,i=0,r=void 0,o=void 0,a=void 0,u=t.left,s=t.right,c=u.length,l=s.length,f=void 0;for(0<c&&0<l&&!e.objectHash&&"boolean"!=typeof e.matchByPosition&&(e.matchByPosition=!function(t,e,n,i){for(var r=0;r<n;r++)for(var o=t[r],a=0;a<i;a++){var u=e[a];if(r!==a&&o===u)return 1}}(u,s,c,l));n<c&&n<l&&Mt(u,s,n,n,e);)r=n,f=new w(t.left[r],t.right[r]),t.push(f,r),n++;for(;i+n<c&&i+n<l&&Mt(u,s,c-1-i,l-1-i,e);)f=new w(t.left[o=c-1-i],t.right[a=l-1-i]),t.push(f,a),i++;var d=void 0;if(n+i===c)if(c===l)t.setResult(void 0).exit();else{for(d=d||{_t:"a"},r=n;r<l-i;r++)d[r]=[s[r]];t.setResult(d).exit()}else{if(n+i===l)for(d=d||{_t:"a"},r=n;r<c-i;r++)d["_"+r]=[u[r],0,0];else{delete e.hashCache1,delete e.hashCache2;for(var p=u.slice(n,c-i),h=s.slice(n,l-i),y=Dt(p,h,Mt,e),v=[],d=d||{_t:"a"},r=n;r<c-i;r++)Vt(y.indices1,r-n)<0&&(d["_"+r]=[u[r],0,0],v.push(r));var m=!0,g=(t.options&&t.options.arrays&&!1===t.options.arrays.detectMove&&(m=!1),!1),b=(t.options&&t.options.arrays&&t.options.arrays.includeValueOnMove&&(g=!0),v.length);for(r=n;r<l-i;r++){var k=Vt(y.indices2,r-n);if(k<0){var O=!1;if(m&&0<b)for(var j=0;j<b;j++)if(Mt(p,h,(o=v[j])-n,r-n,e)){d["_"+o].splice(1,2,r,Pt),g||(d["_"+o][0]=""),a=r,f=new w(t.left[o],t.right[a]),t.push(f,a),v.splice(j,1),O=!0;break}O||(d[r]=[s[r]])}else o=y.indices1[k]+n,a=y.indices2[k]+n,f=new w(t.left[o],t.right[a]),t.push(f,a)}}t.setResult(d).exit()}}}function zt(t){if(t.nested&&"a"===t.delta._t){var e=void 0,n=t.delta,i=t.left,r=[],o=[],a=[];for(e in n)if("_t"!==e)if("_"===e[0]){if(0!==n[e][2]&&n[e][2]!==Pt)throw new Error("only removal or move can be applied at original array indices, invalid diff type: "+n[e][2]);r.push(parseInt(e.slice(1),10))}else 1===n[e].length?o.push({index:parseInt(e,10),value:n[e][0]}):a.push({index:parseInt(e,10),delta:n[e]});for(e=(r=r.sort(Bt)).length-1;0<=e;e--){var u=n["_"+(s=r[e])],s=i.splice(s,1)[0];u[2]===Pt&&o.push({index:u[1],value:s})}for(var c=(o=o.sort(qt("index"))).length,e=0;e<c;e++){var l=o[e];i.splice(l.index,0,l.value)}var f=a.length;if(0<f)for(e=0;e<f;e++){var d=a[e],p=new gt(t.left[d.index],d.delta);t.push(p,d.index)}(t.children?t:t.setResult(t.left)).exit()}}function Lt(t){if(t&&t.children&&"a"===t.delta._t){for(var e,n=t.children.length,i=0;i<n;i++)e=t.children[i],t.left[e.childName]=e.result;t.setResult(t.left).exit()}}function Kt(t){if(t.nested){if("a"===t.delta._t){var e,n=void 0;for(n in t.delta)"_t"!==n&&(e=new kt(t.delta[n]),t.push(e,n));t.exit()}}else t.delta[2]===Pt&&(t.newName="_"+t.delta[1],t.setResult([t.delta[0],parseInt(t.childName.substr(1),10),Pt]).exit())}var Bt=function(t,e){return t-e},qt=function(n){return function(t,e){return t[n]-e[n]}};zt.filterName=Ft.filterName="arrays",Lt.filterName="arraysCollectChildren",Kt.filterName="arrays";function Ut(t){if(t&&t.children&&"a"===t.delta._t){for(var e=t.children.length,n={_t:"a"},i=0;i<e;i++){var r,o=(r=t.children[i]).newName;n[o=void 0===o?function(t,e,n){if("string"==typeof e&&"_"===e[0])return parseInt(e.substr(1),10);if(Tt(n)&&0===n[2])return"_"+e;var i,r=+e;for(i in t){var o=t[i];if(Tt(o))if(o[2]===Pt){var a=parseInt(i.substr(1),10),u=o[1];if(u===+e)return a;a<=r&&r<u?r++:r<=a&&u<r&&r--}else 0===o[2]?parseInt(i.substr(1),10)<=r&&r++:1===o.length&&i<=r&&r--}return r}(t.delta,r.childName,r.result):o]!==r.result&&(n[o]=r.result)}t.setResult(n).exit()}}Ut.filterName="arraysCollectChildren";function Ht(t){t.left instanceof Date?(!(t.right instanceof Date)||t.left.getTime()!==t.right.getTime()?t.setResult([t.left,t.right]):t.setResult(void 0),t.exit()):t.right instanceof Date&&t.setResult([t.left,t.right]).exit()}Ht.filterName="dates";function $t(t){if(!Qt){var r=void 0;if("undefined"!=typeof diff_match_patch)r=new("function"==typeof diff_match_patch?diff_match_patch:diff_match_patch.diff_match_patch);else if($.default)try{r=$.default&&new $.default}catch(t){r=null}if(!r){if(t)throw(t=new Error("text diff_match_patch library not found")).diff_match_patch_not_found=!0,t;return null}Qt={diff:function(t,e){return r.patch_toText(r.patch_make(t,e))},patch:function(t,e){for(var n=r.patch_apply(r.patch_fromText(e),t),i=0;i<n[1].length;i++)n[1][i]||(new Error("text patch failed").textPatchFailed=!0);return n[0]}}}return Qt}function Gt(t){var e;"string"===t.leftType&&(e=t.options&&t.options.textDiff&&t.options.textDiff.minLength||60,(!(t.left.length<e||t.right.length<e)&&(e=$t())?(e=e.diff,t.setResult([e(t.left,t.right),0,2])):t.setResult([t.left,t.right])).exit())}function Jt(t){var e;t.nested||2===t.delta[2]&&(e=$t(!0).patch,t.setResult(e(t.left,t.delta[0])).exit())}function Zt(t){t.nested||2===t.delta[2]&&t.setResult([function(t){for(var e,n=void 0,i=void 0,r=void 0,o=/^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/,n=0,a=(i=t.split("\n")).length;n<a;n++){var u=(r=i[n]).slice(0,1);"@"===u?(e=o.exec(r),i[n]="@@ -"+e[3]+","+e[4]+" +"+e[1]+","+e[2]+" @@"):"+"===u?(i[n]="-"+i[n].slice(1),"+"===i[n-1].slice(0,1)&&(e=i[n],i[n]=i[n-1],i[n-1]=e)):"-"===u&&(i[n]="+"+i[n].slice(1))}return i.join("\n")}(t.delta[0]),0,2]).exit()}var Qt=null,V=(Zt.filterName=Jt.filterName=Gt.filterName="texts",e(Wt,[{key:"options",value:function(){var t;return(t=this.processor).options.apply(t,arguments)}},{key:"diff",value:function(t,e){return this.processor.process(new w(t,e))}},{key:"patch",value:function(t,e){return this.processor.process(new gt(t,e))}},{key:"reverse",value:function(t){return this.processor.process(new kt(t))}},{key:"unpatch",value:function(t,e){return this.patch(t,this.reverse(e))}},{key:"clone",value:vt}]),Wt);function Wt(t){o(this,Wt),this.processor=new ct(t),this.processor.pipe(new ft("diff").append(St,jt,Ht,Gt,It,Ft).shouldHaveResult()),this.processor.pipe(new ft("patch").append(_t,Lt,wt,Jt,Et,zt).shouldHaveResult()),this.processor.pipe(new ft("reverse").append(Nt,Ut,At,Zt,Ct,Kt).shouldHaveResult())}function Xt(t){return"_t"===t?-1:"_"===t.substr(0,1)?parseInt(t.slice(1),10):parseInt(t,10)+.1}function Yt(t,e){return Xt(t)-Xt(e)}var te="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},ee="function"==typeof Object.keys?function(t){return Object.keys(t)}:function(t){var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},M=(e(ne,[{key:"format",value:function(t,e){var n={};return this.prepareContext(n),this.recurse(n,t,e),this.finalize(n)}},{key:"prepareContext",value:function(t){t.buffer=[],t.out=function(){var t;(t=this.buffer).push.apply(t,arguments)}}},{key:"typeFormattterNotFound",value:function(t,e){throw new Error("cannot format delta type: "+e)}},{key:"typeFormattterErrorFormatter",value:function(t,e){return e.toString()}},{key:"finalize",value:function(t){t=t.buffer;if(te(t))return t.join("")}},{key:"recurse",value:function(e,n,i,r,o,a,t){i=n&&a?a.value:i;if(void 0!==n||void 0!==r){var u=this.getDeltaType(n,a),s="node"===u?"a"===n._t?"array":"object":"";void 0!==r?this.nodeBegin(e,r,o,u,s,t):this.rootBegin(e,u,s);try{(this["format_"+u]||this.typeFormattterNotFound(e,u)).call(this,e,n,i,r,o,a)}catch(t){this.typeFormattterErrorFormatter(e,t,n,i,r,o,a),"undefined"!=typeof console&&console.error&&console.error(t.stack)}void 0!==r?this.nodeEnd(e,r,o,u,s,t):this.rootEnd(e,u,s)}}},{key:"formatDeltaChildren",value:function(r,o,a){var u=this;this.forEachDeltaKey(o,a,function(t,e,n,i){u.recurse(r,o[t],a?a[e]:void 0,t,e,n,i)})}},{key:"forEachDeltaKey",value:function(t,e,n){var i,r=ee(t),o="a"===t._t,a={},u=void 0;if(void 0!==e)for(u in e)!Object.prototype.hasOwnProperty.call(e,u)||void 0!==t[u]||o&&void 0!==t["_"+u]||r.push(u);for(u in t)Object.prototype.hasOwnProperty.call(t,u)&&(i=t[u],te(i))&&3===i[2]&&!(a[i[1].toString()]={key:u,value:e&&e[parseInt(u.substr(1))]})!==this.includeMoveDestinations&&void 0===e&&void 0===t[i[1]]&&r.push(i[1].toString());o?r.sort(Yt):r.sort();for(var s=0,c=r.length;s<c;s++){var l,f=r[s];o&&"_t"===f||(l=!o||"number"==typeof f?f:parseInt("_"===(l=f).substr(0,1)?l.slice(1):l,10),n(f,l,a[l],s===c-1))}}},{key:"getDeltaType",value:function(t,e){if(void 0===t)return void 0!==e?"movedestination":"unchanged";if(te(t)){if(1===t.length)return"added";if(2===t.length)return"modified";if(3===t.length&&0===t[2])return"deleted";if(3===t.length&&2===t[2])return"textdiff";if(3===t.length&&3===t[2])return"moved"}else if("object"===(void 0===t?"undefined":s(t)))return"node";return"unknown"}},{key:"parseTextDiff",value:function(t){for(var e=[],n=t.split("\n@@ "),i=0,r=n.length;i<r;i++){for(var o=n[i],a={pieces:[]},u=/^(?:@@ )?[-+]?(\d+),(\d+)/.exec(o).slice(1),s=(a.location={line:u[0],chr:u[1]},o.split("\n").slice(1)),c=0,l=s.length;c<l;c++){var f,d=s[c];d.length&&(f={type:"context"},"+"===d.substr(0,1)?f.type="added":"-"===d.substr(0,1)&&(f.type="deleted"),f.text=d.slice(1),a.pieces.push(f))}e.push(a)}return e}}]),ne);function ne(){o(this,ne)}var F=Object.freeze({default:M}),ie=(a(re,M),e(re,[{key:"typeFormattterErrorFormatter",value:function(t,e){t.out('<pre class="jsondiffpatch-error">'+e+"</pre>")}},{key:"formatValue",value:function(t,e){t.out("<pre>"+oe(JSON.stringify(e,null,2))+"</pre>")}},{key:"formatTextDiffString",value:function(t,e){var n=this.parseTextDiff(e);t.out('<ul class="jsondiffpatch-textdiff">');for(var i=0,r=n.length;i<r;i++){for(var o=n[i],a=(t.out('<li><div class="jsondiffpatch-textdiff-location"><span class="jsondiffpatch-textdiff-line-number">'+o.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+o.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">'),o.pieces),u=0,s=a.length;u<s;u++){var c=a[u];t.out('<span class="jsondiffpatch-textdiff-'+c.type+'">'+oe(decodeURI(c.text))+"</span>")}t.out("</div></li>")}t.out("</ul>")}},{key:"rootBegin",value:function(t,e,n){t.out('<div class="jsondiffpatch-delta '+("jsondiffpatch-"+e+(n?" jsondiffpatch-child-node-type-"+n:""))+'">')}},{key:"rootEnd",value:function(t){t.out("</div>"+(t.hasArrows?'<script type="text/javascript">setTimeout('+ue.toString()+",10);<\/script>":""))}},{key:"nodeBegin",value:function(t,e,n,i,r){t.out('<li class="'+("jsondiffpatch-"+i+(r?" jsondiffpatch-child-node-type-"+r:""))+'" data-key="'+n+'"><div class="jsondiffpatch-property-name">'+n+"</div>")}},{key:"nodeEnd",value:function(t){t.out("</li>")}},{key:"format_unchanged",value:function(t,e,n){void 0!==n&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,n),t.out("</div>"))}},{key:"format_movedestination",value:function(t,e,n){void 0!==n&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,n),t.out("</div>"))}},{key:"format_node",value:function(t,e,n){var i="a"===e._t?"array":"object";t.out('<ul class="jsondiffpatch-node jsondiffpatch-node-type-'+i+'">'),this.formatDeltaChildren(t,e,n),t.out("</ul>")}},{key:"format_added",value:function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")}},{key:"format_modified",value:function(t,e){t.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">'),this.formatValue(t,e[0]),t.out('</div><div class="jsondiffpatch-value jsondiffpatch-right-value">'),this.formatValue(t,e[1]),t.out("</div>")}},{key:"format_deleted",value:function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")}},{key:"format_moved",value:function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out('</div><div class="jsondiffpatch-moved-destination">'+e[1]+"</div>"),t.out('<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">\n <svg width="30" height="60" style="position: absolute; display: none;">\n <defs>\n <marker id="markerArrow" markerWidth="8" markerHeight="8"\n refx="2" refy="4"\n orient="auto" markerUnits="userSpaceOnUse">\n <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />\n </marker>\n </defs>\n <path d="M30,0 Q-10,25 26,50"\n style="stroke: #88f; stroke-width: 2px; fill: none; stroke-opacity: 0.5; marker-end: url(#markerArrow);"\n ></path>\n </svg>\n </div>'),t.hasArrows=!0}},{key:"format_textdiff",value:function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatTextDiffString(t,e[0]),t.out("</div>")}}]),re);function re(){return o(this,re),u(this,(re.__proto__||Object.getPrototypeOf(re)).apply(this,arguments))}function oe(t){for(var e=t,n=[[/&/g,"&amp;"],[/</g,"&lt;"],[/>/g,"&gt;"],[/'/g,"&apos;"],[/"/g,"&quot;"]],i=0;i<n.length;i++)e=e.replace(n[i][0],n[i][1]);return e}function ae(t,e,n){var i,r=e||document.body,o={showing:(e="jsondiffpatch-unchanged-")+"showing",hiding:e+"hiding",visible:e+"visible",hidden:e+"hidden"},a=r.classList;a&&(n?(!1===t?(a.remove(o.showing),a.add(o.visible),setTimeout(function(){a.add(o.hiding)},10)):(a.remove(o.hiding),a.add(o.showing),a.remove(o.hidden)),i=setInterval(function(){ue(r)},100),setTimeout(function(){a.remove(o.showing),a.remove(o.hiding),!1===t?(a.add(o.hidden),a.remove(o.visible)):(a.add(o.visible),a.remove(o.hidden)),setTimeout(function(){a.remove(o.visible),clearInterval(i)},n+400)},n)):(a.remove(o.showing),a.remove(o.hiding),a.remove(o.visible),a.remove(o.hidden),!1===t&&a.add(o.hidden)))}var ue=function(t){t=t||document;!function(t,e,n){for(var i=t.querySelectorAll(e),r=0,o=i.length;r<o;r++)n(i[r])}(t,".jsondiffpatch-arrow",function(t){var e=t.parentNode,n=t.style,t=t.children[0],i=t.children[1],r=(t.style.display="none",(o=e.querySelector(".jsondiffpatch-moved-destination")).textContent||o.innerText),o=e.parentNode,a=void 0;if(!function(t,e){for(var n=t.children,i=0,r=n.length;i<r;i++)e(n[i],i)}(o,function(t){t.getAttribute("data-key")===r&&(a=t)}),a)try{var u=a.offsetTop-e.offsetTop,s=(t.setAttribute("height",Math.abs(u)+6),n.top=(0<u?0:u)-8+"px",0<u?"M30,0 Q-10,"+Math.round(u/2)+" 26,"+(u-4):"M30,"+-u+" Q-10,"+Math.round(-u/2)+" 26,4");i.setAttribute("d",s),t.style.display=""}catch(t){}})},se=void 0;var z=Object.freeze({showUnchanged:ae,hideUnchanged:function(t,e){return ae(!1,t,e)},default:ie,format:function(t,e){return(se=se||new ie).format(t,e)}}),c=(a(l,M),e(l,[{key:"prepareContext",value:function(n){at(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"prepareContext",this).call(this,n),n.indent=function(t){this.indentLevel=(this.indentLevel||0)+(void 0===t?1:t),this.indentPad=new Array(this.indentLevel+1).join("&nbsp;&nbsp;")},n.row=function(t,e){n.out('<tr><td style="white-space: nowrap;"><pre class="jsondiffpatch-annotated-indent" style="display: inline-block">'),n.out(n.indentPad),n.out('</pre><pre style="display: inline-block">'),n.out(t),n.out('</pre></td><td class="jsondiffpatch-delta-note"><div>'),n.out(e),n.out("</div></td></tr>")}}},{key:"typeFormattterErrorFormatter",value:function(t,e){t.row("",'<pre class="jsondiffpatch-error">'+e+"</pre>")}},{key:"formatTextDiffString",value:function(t,e){var n=this.parseTextDiff(e);t.out('<ul class="jsondiffpatch-textdiff">');for(var i=0,r=n.length;i<r;i++){for(var o=n[i],a=(t.out('<li><div class="jsondiffpatch-textdiff-location"><span class="jsondiffpatch-textdiff-line-number">'+o.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+o.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">'),o.pieces),u=0,s=a.length;u<s;u++){var c=a[u];t.out('<span class="jsondiffpatch-textdiff-'+c.type+'">'+c.text+"</span>")}t.out("</div></li>")}t.out("</ul>")}},{key:"rootBegin",value:function(t,e,n){t.out('<table class="jsondiffpatch-annotated-delta">'),"node"===e&&(t.row("{"),t.indent()),"array"===n&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")}},{key:"rootEnd",value:function(t,e){"node"===e&&(t.indent(-1),t.row("}")),t.out("</table>")}},{key:"nodeBegin",value:function(t,e,n,i,r){t.row("&quot;"+e+"&quot;: {"),"node"===i&&t.indent(),"array"===r&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")}},{key:"nodeEnd",value:function(t,e,n,i,r,o){"node"===i&&t.indent(-1),t.row("}"+(o?"":","))}},{key:"format_unchanged",value:function(){}},{key:"format_movedestination",value:function(){}},{key:"format_node",value:function(t,e,n){this.formatDeltaChildren(t,e,n)}}]),l);function l(){o(this,l);var t=u(this,(l.__proto__||Object.getPrototypeOf(l)).call(this));return t.includeMoveDestinations=!1,t}function ce(t){return'<pre style="display:inline-block">&quot;'+t+"&quot;</pre>"}function le(t,e){var n=this.getDeltaType(e),i=(i=fe[n])&&i.apply(i,Array.prototype.slice.call(arguments,1)),e=JSON.stringify(e,null,2);"textdiff"===n&&(e=e.split("\\n").join('\\n"+\n "')),t.indent(),t.row(e,i),t.indent(-1)}var fe={added:function(t,e,n,i){var r=" <pre>([newValue])</pre>";return void 0===i?"new value"+r:"number"==typeof i?"insert at index "+i+r:"add property "+ce(i)+r},modified:function(t,e,n,i){var r=" <pre>([previousValue, newValue])</pre>";return void 0===i?"modify value"+r:"number"==typeof i?"modify at index "+i+r:"modify property "+ce(i)+r},deleted:function(t,e,n,i){var r=" <pre>([previousValue, 0, 0])</pre>";return void 0===i?"delete value"+r:"number"==typeof i?"remove index "+i+r:"delete property "+ce(i)+r},moved:function(t,e,n,i){return'move from <span title="(position to remove at original state)">index '+i+'</span> to <span title="(position to insert at final state)">index '+t[1]+"</span>"},textdiff:function(t,e,n,i){return"text diff"+(void 0===i?"":"number"==typeof i?" at index "+i:" at property "+ce(i))+', format is <a href="https://code.google.com/p/google-diff-match-patch/wiki/Unidiff">a variation of Unidiff</a>'}},de=(c.prototype.format_added=le,c.prototype.format_modified=le,c.prototype.format_deleted=le,c.prototype.format_moved=le,c.prototype.format_textdiff=le,void 0);var L=Object.freeze({default:c,format:function(t,e){return(de=de||new c).format(t,e)}}),pe="add",he="remove",ye="replace",ve="move",me=(a(p,M),e(p,[{key:"prepareContext",value:function(t){at(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"prepareContext",this).call(this,t),t.result=[],t.path=[],t.pushCurrentOp=function(t){var e=t.op,t=t.value,e={op:e,path:this.currentPath()};void 0!==t&&(e.value=t),this.result.push(e)},t.pushMoveOp=function(t){var e=this.currentPath();this.result.push({op:ve,from:e,path:this.toPath(t)})},t.currentPath=function(){return"/"+this.path.join("/")},t.toPath=function(t){var e=this.path.slice();return e[e.length-1]=t,"/"+e.join("/")}}},{key:"typeFormattterErrorFormatter",value:function(t,e){t.out("[ERROR] "+e)}},{key:"rootBegin",value:function(){}},{key:"rootEnd",value:function(){}},{key:"nodeBegin",value:function(t,e,n){t.path.push(n)}},{key:"nodeEnd",value:function(t){t.path.pop()}},{key:"format_unchanged",value:function(){}},{key:"format_movedestination",value:function(){}},{key:"format_node",value:function(t,e,n){this.formatDeltaChildren(t,e,n)}},{key:"format_added",value:function(t,e){t.pushCurrentOp({op:pe,value:e[0]})}},{key:"format_modified",value:function(t,e){t.pushCurrentOp({op:ye,value:e[1]})}},{key:"format_deleted",value:function(t){t.pushCurrentOp({op:he})}},{key:"format_moved",value:function(t,e){e=e[1];t.pushMoveOp(e)}},{key:"format_textdiff",value:function(){throw new Error("Not implemented")}},{key:"format",value:function(t,e){var n={};return this.prepareContext(n),this.recurse(n,t,e),n.result}}]),p);function p(){o(this,p);var t=u(this,(p.__proto__||Object.getPrototypeOf(p)).call(this));return t.includeMoveDestinations=!0,t}function ge(t,e){return Se=Se||new me,t=Se.format(t,e),t=we(t,[Ae,xe]),t=ut(t,3),e=t[0],n=t[2],t=je(t[1]),[].concat(st(t),st(e),st(n));var n}var be=function(t){return t[t.length-1]},ke=function(t,e){return t.sort(e),t},Oe=function(t,e){t=parseInt(t,10),e=parseInt(e,10);return isNaN(t)||isNaN(e)?0:e-t},je=function(t){return ke(t,function(t,e){t=t.path.split("/"),e=e.path.split("/");return t.length!==e.length?t.length-e.length:Oe(be(t),be(e))})},we=function(t,n){var e=Array(n.length+1).fill().map(function(){return[]});return t.map(function(e){var t=n.map(function(t){return t(e)}).indexOf(!0);return t<0&&(t=n.length),{item:e,position:t}}).reduce(function(t,e){return t[e.position].push(e.item),t},e)},Ae=function(t){return"move"===t.op},xe=function(t){return"remove"===t.op},Se=void 0,K=Object.freeze({default:me,partitionOps:we,format:ge,log:function(t,e){console.log(ge(t,e))}});function y(t){return G.default&&G.default[t]||function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e}}var v={added:y("green"),deleted:y("red"),movedestination:y("gray"),moved:y("yellow"),unchanged:y("gray"),error:y("white.bgRed"),textDiffLine:y("gray")},Ie=(a(j,M),e(j,[{key:"prepareContext",value:function(t){at(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"prepareContext",this).call(this,t),t.indent=function(t){this.indentLevel=(this.indentLevel||0)+(void 0===t?1:t),this.indentPad=new Array(this.indentLevel+1).join(" "),this.outLine()},t.outLine=function(){this.buffer.push("\n"+(this.indentPad||""))},t.out=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var i=0,r=e.length;i<r;i++){var o=e[i].split("\n").join("\n"+(this.indentPad||""));this.color&&this.color[0]&&(o=this.color[0](o)),this.buffer.push(o)}},t.pushColor=function(t){this.color=this.color||[],this.color.unshift(t)},t.popColor=function(){this.color=this.color||[],this.color.shift()}}},{key:"typeFormattterErrorFormatter",value:function(t,e){t.pushColor(v.error),t.out("[ERROR]"+e),t.popColor()}},{key:"formatValue",value:function(t,e){t.out(JSON.stringify(e,null,2))}},{key:"formatTextDiffString",value:function(t,e){var n=this.parseTextDiff(e);t.indent();for(var i=0,r=n.length;i<r;i++){for(var o=n[i],a=(t.pushColor(v.textDiffLine),t.out(o.location.line+","+o.location.chr+" "),t.popColor(),o.pieces),u=0,s=a.length;u<s;u++){var c=a[u];t.pushColor(v[c.type]),t.out(c.text),t.popColor()}i<r-1&&t.outLine()}t.indent(-1)}},{key:"rootBegin",value:function(t,e,n){t.pushColor(v[e]),"node"===e&&(t.out("array"===n?"[":"{"),t.indent())}},{key:"rootEnd",value:function(t,e,n){"node"===e&&(t.indent(-1),t.out("array"===n?"]":"}")),t.popColor()}},{key:"nodeBegin",value:function(t,e,n,i,r){t.pushColor(v[i]),t.out(n+": "),"node"===i&&(t.out("array"===r?"[":"{"),t.indent())}},{key:"nodeEnd",value:function(t,e,n,i,r,o){"node"===i&&(t.indent(-1),t.out("array"===r?"]":"}"+(o?"":","))),o||t.outLine(),t.popColor()}},{key:"format_unchanged",value:function(t,e,n){void 0!==n&&this.formatValue(t,n)}},{key:"format_movedestination",value:function(t,e,n){void 0!==n&&this.formatValue(t,n)}},{key:"format_node",value:function(t,e,n){this.formatDeltaChildren(t,e,n)}},{key:"format_added",value:function(t,e){this.formatValue(t,e[0])}},{key:"format_modified",value:function(t,e){t.pushColor(v.deleted),this.formatValue(t,e[0]),t.popColor(),t.out(" => "),t.pushColor(v.added),this.formatValue(t,e[1]),t.popColor()}},{key:"format_deleted",value:function(t,e){this.formatValue(t,e[0])}},{key:"format_moved",value:function(t,e){t.out("==> "+e[1])}},{key:"format_textdiff",value:function(t,e){this.formatTextDiffString(t,e[0])}}]),j);function j(){o(this,j);var t=u(this,(j.__proto__||Object.getPrototypeOf(j)).call(this));return t.includeMoveDestinations=!1,t}function Ee(t,e){return(_e=_e||new Ie).format(t,e)}var _e=void 0;B=Object.freeze({default:Ie,format:Ee,log:function(t,e){console.log(Ee(t,e))}});Object.freeze({base:F,html:z,annotated:L,jsonpatch:K,console:B});var Ce=new V({objectHash:function(t,e){return e="$$index:".concat(e),"object"===O(t)&&null!==t&&(t.id||t.name||t.url)||e},arrays:{detectMove:!0,includeValueOnMove:!1},textDiff:{minLength:Number.MAX_SAFE_INTEGER}});function A(t,e){return Ce.diff(t,e)}function Ne(t,e){return Ce.patch(t,e)}function x(t,e){if(!Array.isArray(t))throw new Error("Expected array to extract delta value");if(1===t.length)return t[0];if(2===t.length)return t[1];if(3!==t.length||0!==t[2]){if(3===t.length&&2===t[2]){if(e)return Ne(e,t);throw new Error("Cannot apply patch to long text diff. Missing original object.")}if(3===t.length&&3===t[2])throw new Error("Detected an array move, it should not happen as `includeValueOnMove` should be set to false");throw new Error("Got unsupported number ".concat(t[2]," in delta value"))}}var Re=["actions"],De={setCustomType:"setCustomType",setCustomField:"setCustomField"},Pe=function(t){return Array.isArray(t.custom)},Te=function(t){return Boolean(t.custom.fields)},Ve=function(t){return Boolean(t.custom.type)},Me=function(t,e){return Array.isArray(t.custom.type)?x(t.custom.type,e):t.custom.type},Fe=function(t,e){return Array.isArray(t.id)?x(t.id):e.custom.type.id},ze=function(t,e){return Array.isArray(t.key)?x(t.key):e.custom.type.key},Le=function(t,e){return Array.isArray(t)?x(t):e},Ke=function(t,e){return t[e]};function S(t,e,n,i){var i=3<arguments.length&&void 0!==i?i:{actions:{}},r=[],o=i.actions,a=tt(i,Re),u=h(h({},De),o);return t.custom&&(Pe(t)?(i=x(t.custom,n),r.push(h(h({action:u.setCustomType},a),i))):Ve(t)?(o=Me(t,n))?o.id?r.push(h(h({action:u.setCustomType},a),{},{type:{typeId:"type",id:Fe(o,e)},fields:Le(t.custom.fields,e.custom.fields)})):o.key&&r.push(h(h({action:u.setCustomType},a),{},{type:{typeId:"type",key:ze(o,e)},fields:Le(t.custom.fields,e.custom.fields)})):r.push(h({action:u.setCustomType},a)):Te(t)&&(i=Object.keys(t.custom.fields).map(function(t){return h(h({action:u.setCustomField},a),{},{name:t,value:Ke(e.custom.fields,t)})}),r.push.apply(r,k(i)))),r}var Be=new RegExp(/^\d+$/),qe=new RegExp(/^_\d+$/),I="create",E="remove",_="change";function C(f,d){return function(t,o,a){var u,s=[],c=[],l=[];return t[f]&&(u=t[f],Object.keys(u).forEach(function(t){var e,n,i,r;d[I]&&(i=u,r=t,Be.test(r))&&Array.isArray(i[r])&&1===i[r].length?(i=(0,d[I])(a[f][t],parseInt(t,10)))&&s.push(i):d[_]&&(r=u,i=t,Be.test(i))&&("object"===O(r[i])||"string"==typeof r[i])?(e=(0,d[_])(o[f][t],a[f][t],parseInt(t,10)))&&l.push(e):d[E]&&(e=u,n=t,qe.test(n))&&Array.isArray(e[n])&&3===e[n].length&&("object"===O(e[n][0])||"string"==typeof e[n][0])&&0===e[n][1]&&0===e[n][2]&&(n=t.replace("_",""),t=(0,d[E])(o[f][n],parseInt(n,10)))&&c.push(t)})),l.concat(c,s)}}function Ue(t){return t.id?{assetId:t.id}:{assetKey:t.key}}function He(t){return JSON.parse(JSON.stringify(t))}function $e(t){return"string"==typeof t?t.trim():t}var Ge=function(t){return function(e){return t.some(function(t){return t===$e(e)})}};function N(t){var e=t.actions,s=t.diff,c=t.oldObj,l=t.newObj,f=Ge(t.shouldOmitEmptyString?[void 0,null,""]:[void 0,null]);return e.map(function(t){var e=t.key,n=t.actionKey||t.key,i=s[e],r=c[e],o=l[e],a=f(c[e]),u=f(l[e]);if(i&&(!u||!a))return!u&&a?b({action:t.action},n,o):!u||{}.hasOwnProperty.call(l,e)?u&&{}.hasOwnProperty.call(l,e)?{action:t.action}:(a=Ne(He(r),i),b({action:t.action},n,a)):void 0}).filter(function(t){return!d.default(t)})}function Je(t){var e=t.actions,i=t.diff,r=t.newObj;return e.map(function(t){var e,n=t.action,t=t.key;if(i[t]&&(Array.isArray(i[t])||i[t].id))return(e=Array.isArray(i[t])?x(i[t]):r[t])?e.id?b({action:n},t,{typeId:e.typeId,id:e.id}):b({action:n},t,{typeId:e.typeId,key:e.key}):{action:n}}).filter(function(t){return t})}var Ze=[{action:"changeName",key:"name"},{action:"changeSlug",key:"slug"},{action:"setDescription",key:"description"},{action:"changeOrderHint",key:"orderHint"},{action:"setExternalId",key:"externalId"},{action:"setKey",key:"key"}],Qe=[{action:"setMetaTitle",key:"metaTitle"},{action:"setMetaKeywords",key:"metaKeywords"},{action:"setMetaDescription",key:"metaDescription"}],We=[{action:"changeParent",key:"parent"}];var Xe="custom";function Ye(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return d.default(t)||d.default(a)?[t,a]:[t,Object.entries(t).reduce(function(t,e){var e=f(e,2),n=e[0],e=e[1];if(n!==Xe)if(Array.isArray(e)&&a[n]&&1<=a[n].length)for(var i,r=e.reduce(function(t,e){return t[e.id]=e,t},{}),o=0;o<a[n].length;o++)d.default(a[n][o])||"object"!==O(a[n][o])||d.default(a[n][o].id)||(i=r[a[n][o].id],d.default(i))||(i=f(Ye(i,a[n][o]),2)[1],Object.isFrozen(t[n])&&(t[n]=t[n].slice()),t[n][o]=i);else Array.isArray(e)?t[n]=d.default(a[n])?[]:a[n]:d.default(a[n])||"object"!==O(e)||e instanceof Date||(e=f(Ye(e,a[n]),2)[1],t[n]=e);return t},h({},a))]}function tn(e,n){return function(i,r,o){var t=[];return t.push(e("base",function(){return function(t,e,n,i){return N({actions:Ze,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(i,o,r,n)})),t.push(e("references",function(){return Je({actions:We,diff:i,oldObj:o,newObj:r})})),t.push(e("meta",function(){return N({actions:Qe,diff:i,oldObj:o,newObj:r})})),t.push(e("custom",function(){return S(i,r,o)})),t.push(e("assets",function(){return t=i,e=o,n=r,C("assets",b(b(b({},I,function(t){return{action:"addAsset",asset:t}}),E,function(t){return h({action:"removeAsset"},Ue(t))}),_,function(t,e){return[h({action:"removeAsset"},Ue(t)),{action:"addAsset",asset:e}]}))(t,e,n);var t,e,n})),m.default(t)}}var en=Ge([void 0,null,""]),nn=[{action:"setSalutation",key:"salutation"},{action:"changeEmail",key:"email"},{action:"setFirstName",key:"firstName"},{action:"setLastName",key:"lastName"},{action:"setMiddleName",key:"middleName"},{action:"setTitle",key:"title"},{action:"setCustomerNumber",key:"customerNumber"},{action:"setExternalId",key:"externalId"},{action:"setCompanyName",key:"companyName"},{action:"setDateOfBirth",key:"dateOfBirth"},{action:"setLocale",key:"locale"},{action:"setVatId",key:"vatId"},{action:"setStores",key:"stores"},{action:"setKey",key:"key"}],rn=[{action:"setDefaultBillingAddress",key:"defaultBillingAddressId",actionKey:"addressId"},{action:"setDefaultShippingAddress",key:"defaultShippingAddressId",actionKey:"addressId"}],on=[{action:"setCustomerGroup",key:"customerGroup"}],an=[{action:"setAuthenticationMode",key:"authenticationMode",value:"password"}];function un(t,e,n){return e=(t={actions:an,diff:t,oldObj:e,newObj:n}).actions,s=t.diff,c=t.oldObj,l=t.newObj,e.map(function(t){var e=t.key,n=t.value||t.key,i=s[e],r=c[e],o=l[e],a=en(c[e]),u=en(l[e]);if(i&&(!u||!a)){if("Password"===l.authenticationMode&&!l.password)throw new Error("Cannot set to Password authentication mode without password");if("authenticationMode"in l&&!["Password","ExternalAuth"].includes(l.authenticationMode))throw new Error("Invalid Authentication Mode");if(!u&&a)return"ExternalAuth"===l.authenticationMode?{action:t.action,authMode:o}:b({action:t.action,authMode:o},n,l.password);if(!u||{}.hasOwnProperty.call(l,e))if(!u||!{}.hasOwnProperty.call(l,e))return a=Ne(He(r),i),"ExternalAuth"===l.authenticationMode?{action:t.action,authMode:a}:b({action:t.action,authMode:a},n,l.password)}}).filter(function(t){return!d.default(t)});var s,c,l}function sn(e,n){return function(i,r,o){var t=[];return t.push(e("base",function(){return function(t,e,n,i){return N({actions:nn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(i,o,r,n)})),t.push(e("references",function(){return Je({actions:on,diff:i,oldObj:o,newObj:r})})),t.push(e("addresses",function(){return t=i,e=o,n=r,C("addresses",b(b(b({},I,function(t){return{action:"addAddress",address:t}}),E,function(t){return{action:"removeAddress",addressId:t.id}}),_,function(t,e){return{action:"changeAddress",addressId:t.id,address:e}}))(t,e,n);var t,e,n})),t.push(e("base",function(){return function(t,e,n,i){return N({actions:rn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(i,o,r,n)})),t.push(e("billingAddressIds",function(){return t=i,e=o,n=r,C("billingAddressIds",b(b({},I,function(t){return{action:"addBillingAddressId",addressId:t}}),E,function(t){return{action:"removeBillingAddressId",addressId:t}}))(t,e,n);var t,e,n})),t.push(e("shippingAddressIds",function(){return t=i,e=o,n=r,C("shippingAddressIds",b(b({},I,function(t){return{action:"addShippingAddressId",addressId:t}}),E,function(t){return{action:"removeShippingAddressId",addressId:t}}))(t,e,n);var t,e,n})),t.push(e("custom",function(){return S(i,r,o)})),t.push(e("authenticationModes",function(){return un(i,o,r)})),m.default(t)}}var cn=[{action:"changeQuantity",key:"quantityOnStock",actionKey:"quantity"},{action:"setRestockableInDays",key:"restockableInDays"},{action:"setExpectedDelivery",key:"expectedDelivery"}],ln=[{action:"setSupplyChannel",key:"supplyChannel"}];function fn(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:cn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),i.push(r("references",function(){return Je({actions:ln,diff:t,oldObj:n,newObj:e})})),i.push(r("custom",function(){return S(t,e,n)})),m.default(i)}}function R(t,e,n,i){var r,o,a;return t[e]&&(r=t[e][0],t=t[e][1],n&&n[r]&&(o=n[r]),i)&&i[t]&&(a=i[t]),{oldObj:o,newObj:a}}var dn=new RegExp(/^\d+$/),pn=new RegExp(/^_\d+$/);function hn(t,e){var t=0<arguments.length&&void 0!==t?t:[],i=1<arguments.length&&void 0!==e?e:"id";return t.reduce(function(t,e,n){return t.refByIndex[String(n)]=e[i],t.refByIdentifier[e[i]]=String(n),t},{refByIndex:{},refByIdentifier:{}})}function D(t,e,n,i){var e=1<arguments.length&&void 0!==e?e:[],n=2<arguments.length&&void 0!==n?n:[],i=3<arguments.length&&void 0!==i?i:"id",r={},e=hn(e,i),o=e.refByIdentifier,a=e.refByIndex,e=hn(n,i),u=e.refByIdentifier,s=e.refByIndex;return g.default(t,function(t,e){var n,i;dn.test(e)?(n=s[e],r[e]=[o[n],e]):pn.test(e)&&(n=e.substring(1),i=a[n],r[e]=[n,u[i]])}),r}var P=new RegExp(/^\d+$/),T=new RegExp(/^_\d+$/),yn=[{action:"changeName",key:"name"},{action:"changeSlug",key:"slug"},{action:"setDescription",key:"description"},{action:"setSearchKeywords",key:"searchKeywords"},{action:"setKey",key:"key"},{action:"setPriceMode",key:"priceMode"}],vn=[{action:"setAssetKey",key:"key",actionKey:"assetKey"},{action:"changeAssetName",key:"name"},{action:"setAssetDescription",key:"description"},{action:"setAssetTags",key:"tags"},{action:"setAssetSources",key:"sources"}],mn=[{action:"setMetaTitle",key:"metaTitle"},{action:"setMetaDescription",key:"metaDescription"},{action:"setMetaKeywords",key:"metaKeywords"}],gn=[{action:"setTaxCategory",key:"taxCategory"},{action:"transitionState",key:"state"}],bn=function(t,e){return P.test(t)&&Array.isArray(e)&&e.length},kn=function(t,e){return P.test(t)&&Object.keys(e).length},On=function(t,e){return T.test(t)&&0===Number(e[2])},jn=function(t,e){return T.test(t)&&3===Number(e[2])};function wn(t,e,n){var i=e&&e.name;if(i)return t={action:"setAttribute",variantId:t,name:i,value:e.value},-1!==n.indexOf(i)&&delete(t=h(h({},t),{},{action:"setAttributeInAllVariants"})).variantId,t}function An(i,t,e,n){var r;if(e)return r={action:"setAttribute",variantId:t.id,name:e.name},t=t.attributes.find(function(t){return t.name===e.name})||{},-1!==n.indexOf(e.name)&&delete(r=h(h({},r),{},{action:"setAttributeInAllVariants"})).variantId,Array.isArray(i)||"string"==typeof i?r.value=x(i,t.value):i.centAmount||i.currencyCode?r.value={centAmount:i.centAmount?x(i.centAmount):e.value.centAmount,currencyCode:i.currencyCode?x(i.currencyCode):e.value.currencyCode}:i.key?r.value=x(i.key):"object"===O(i)&&(!{}.hasOwnProperty.call(i,"_t")||"a"!==i._t?(n=Object.keys(i).reduce(function(t,e){var n=x(i[e],t[e]);return Object.assign(t,b({},e,n))},h({},t.value)),r.value=n):r=h(h({},r),{},{value:e.value})),r}function xn(t){return t.id?{assetId:t.id}:{assetKey:t.key}}function Sn(t){var e=t.id;return e?{variantId:e}:{sku:t.sku}}function In(t,o,a){var e,u=[],s=D(t,o.assets,a.assets),n=(g.default(t,function(t,e){var n,i=R(s,e,o.assets,a.assets),r=i.oldObj,i=i.newObj;bn(e,t)?u.push(h(h({action:"addAsset",asset:x(t)},Sn(a)),{},{position:Number(e)})):kn(e,t)?(n=N({actions:vn,diff:t,oldObj:r,newObj:i}).map(function(t){return"setAssetKey"===t.action?h(h(h({},t),Sn(o)),{},{assetId:r.id}):h(h(h({},t),Sn(o)),xn(r))}),u.push.apply(u,k(n)),t.custom&&(n=S(t,i,r,h(h({actions:{setCustomType:"setAssetCustomType",setCustomField:"setAssetCustomField"}},Sn(o)),xn(r))),u.push.apply(u,k(n)))):On(e,t)&&u.push(h(h({action:"removeAsset"},xn(r)),Sn(o)))}),t=t,e=o,n=a,Object.entries(t).find(function(t){return jn(t[0],t[1])})?(t=e.assets.map(function(t){return t.id}),n=n.assets.map(function(t){return t.id}).filter(function(t){return void 0!==t}),n=Z.default(n,t),t=Q.default.apply(void 0,[t].concat(k(n))),[h({action:"changeAssetOrder",assetOrder:n.concat(t)},Sn(e))]):[]);return[].concat(k(n),u)}function En(t,l,f,e,n){var d=3<arguments.length&&void 0!==e?e:[],p=4<arguments.length?n:void 0,h=[],e=t.variants;return e&&g.default(e,function(t,e){var i,r,o,a,n,u,s=R(p,e,l.variants,f.variants),c=s.oldObj,s=s.newObj;P.test(e)&&!Array.isArray(t)&&(e=t,u=c,u={}.hasOwnProperty.call(e,"sku")&&((e=x(e.sku))||u.sku)?{action:"setSku",variantId:u.id,sku:e||null}:null,e=t,n=c,n={}.hasOwnProperty.call(e,"key")&&((e=x(e.key))||n.key)?{action:"setProductVariantKey",variantId:n.id,key:e||null}:null,u&&h.push(u),n&&h.push(n),e=t.attributes,i=c,r=s,o=d,a=[],(u=e)&&g.default(u,function(t,e){var n;P.test(e)?Array.isArray(t)?(n=wn(i.id,x(t),o))&&a.push(n):r.attributes&&(n=An(t.value,i,r.attributes[e],o))&&a.push(n):T.test(e)&&(Array.isArray(t)?3===t.length&&3===t[2]||(n=wn(i.id,x(t)||(t[0]&&t[0].name?{name:t[0].name}:void 0),o))&&a.push(n):(n=e.substring(1),r.attributes&&(e=An(t.value,i,r.attributes[n],o))&&a.push(e)))}),n=a,h=h.concat(n))}),J.default(h,function(t,e){return t.action===e.action&&t.name===e.name&&t.variantId===e.variantId})}function _n(t,r,o,a){var u=[],t=t.variants;return t&&g.default(t,function(t,e){var n=R(a,e,r.variants,o.variants),i=n.oldObj,n=n.newObj;(T.test(e)||P.test(e))&&(e=function(t,e,n){var r=1<arguments.length&&void 0!==e?e:{},o=2<arguments.length&&void 0!==n?n:{},a=[],u=D(t,r.images,o.images,"url");return g.default(t,function(t,e){var n=R(u,e,r.images,o.images),i=n.oldObj,n=n.newObj;P.test(e)?Array.isArray(t)&&t.length?a.push({action:"addExternalImage",variantId:r.id,image:x(t)}):"object"===O(t)&&(!{}.hasOwnProperty.call(t,"url")||2!==t.url.length?!{}.hasOwnProperty.call(t,"label")||1!==t.label.length&&2!==t.label.length||a.push({action:"setImageLabel",variantId:r.id,imageUrl:i.url,label:x(t.label)}):(a.push({action:"removeImage",variantId:r.id,imageUrl:i.url}),a.push({action:"addExternalImage",variantId:r.id,image:n}))):T.test(e)&&Array.isArray(t)&&3===t.length&&(3===Number(t[2])?a.push({action:"moveImageToPosition",variantId:r.id,imageUrl:i.url,position:Number(t[1])}):0===Number(t[2])&&a.push({action:"removeImage",variantId:r.id,imageUrl:i.url}))}),a}(t.images,i,n),u=u.concat(e))}),u}function Cn(t,r,o,a,u){var s=[],c=[],l=[],t=t.variants;return t&&g.default(t,function(t,e){var n=R(a,e,r.variants,o.variants),i=n.oldObj,n=n.newObj;(T.test(e)||P.test(e))&&(t=(e=f(function(t,e,n,i){var o=1<arguments.length&&void 0!==e?e:{},a=2<arguments.length&&void 0!==n?n:{},u=3<arguments.length&&void 0!==i&&i,s=[],c=[],l=[],f=D(t,o.prices,a.prices);return g.default(t,function(t,e){var n,i=R(f,e,o.prices,a.prices),r=i.oldObj,i=i.newObj;bn(e,t)?(n=t.map(function(t){t=h({},t);return!0!==u&&delete t.discounted,t}),s.push({action:"addPrice",variantId:o.id,price:x(n)})):kn(e,t)?(n=h({},t),!0!==u&&delete n.discounted,Object.keys(n).length&&(n=h({},i),!0!==u&&delete n.discounted,c.push({action:"changePrice",priceId:r.id,price:n}))):On(e,t)&&l.push({action:"removePrice",priceId:r.id})}),[s,c,l]}(t.prices,i,n,u),3))[0],i=e[1],n=e[2],s=s.concat(t),c=c.concat(i),l=l.concat(n))}),c.concat(l).concat(s)}function Nn(t,e){function n(t){return(t=Array.isArray(t.variants)?t.variants:[])[0]?t[0].id:void 0}e=n(e),t=n(t);return e&&t!==e?[{action:"changeMasterVariant",variantId:e}]:[]}function Rn(o,a){return function(l,f,d){var t=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},e=[],n=t.sameForAllAttributeNames,i=t.enableDiscounted,t=f.publish,r=f.staged,p=D(l.variants,d.variants,f.variants);return e.push(o("attributes",function(){return En(l,d,f,n||[],p)})),e.push(o("variants",function(){return t=l,e=d,n=f,C("variants",b({},I,function(t){return h(h({},t),{},{action:"addVariant"})}))(t,e,n);var t,e,n})),e.push(Nn(d,f)),e.push(o("variants",function(){return t=l,e=d,n=f,C("variants",b({},E,function(t){return{action:"removeVariant",id:t.id}}))(t,e,n);var t,e,n})),e.push(o("base",function(){return function(t,e,n,i){return N({actions:yn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(l,d,f,a)})),e.push(o("meta",function(){return N({actions:mn,diff:l,oldObj:d,newObj:f})})),e.push(o("references",function(){return Je({actions:gn,diff:l,oldObj:d,newObj:f})})),e.push(o("images",function(){return _n(l,d,f,p)})),e.push(o("pricesCustom",function(){return i=d,u=f,s=p,c=[],(t=(t=l).variants)&&g.default(t,function(t,e){var r,n=R(s,e,i.variants,u.variants),o=n.oldObj,a=n.newObj;t&&t.prices&&(T.test(e)||P.test(e))&&(r=D(t.prices,o.prices,a.prices),g.default(t.prices,function(t,e){var n=R(r,e,o.prices,a.prices),i=n.oldObj,n=n.newObj;t.custom&&(T.test(e)||P.test(e))&&(e=S(t,n,i,{actions:{setCustomType:"setProductPriceCustomType",setCustomField:"setProductPriceCustomField"},priceId:i.id}),c=c.concat(e))}))}),c;var t,i,u,s,c})),e.push(o("prices",function(){return Cn(l,d,f,p,i)})),e.push(o("categories",function(){return(t=l).categories?(n=[],i=[],g.default(t.categories,function(t){var e;Array.isArray(t)&&(e={category:t[0]},3===t.length?3!==t[2]&&(e.action="removeFromCategory",i.push(e)):1===t.length&&(e.action="addToCategory",n.push(e)))}),i.concat(n)):[];var t,n,i})),e.push(o("categoryOrderHints",function(){return!(n=l).categoryOrderHints||Array.isArray(n.categoryOrderHints)?[]:Object.keys(n.categoryOrderHints).map(function(t){var e=n.categoryOrderHints[t],t={action:"setCategoryOrderHint",categoryId:t};return 1===e.length?t.orderHint=e[0]:2===e.length&&0!==e[1]&&(t.orderHint=e[1]),t});var n})),e.push(o("assets",function(){return r=d,o=f,a=p,u=[],(t=(t=l).variants)&&g.default(t,function(t,e){var n=R(a,e,r.variants,o.variants),i=n.oldObj,n=n.newObj;t.assets&&(T.test(e)||P.test(e))&&(e=In(t.assets,i,n),u=u.concat(e))}),u;var t,r,o,a,u})),!0===t||!1===r?m.default(e).map(function(t){return h(h({},t),{},{staged:!1})}):m.default(e)}}function Dn(t,e){function n(t){return h(h({},t),{},{masterVariant:void 0,variants:[t.masterVariant].concat(k(t.variants||[]))})}function i(t){return t&&t.masterVariant}t=f(Ye(t,e),2),e=t[0],t=t[1];return[i(e)?n(e):e,i(t)?n(t):t]}var Pn=new RegExp(/^\d+$/),Tn=new RegExp(/^_\d+$/),Vn=function(t,e){return Pn.test(t)&&Array.isArray(e)&&e.length},Mn=function(t,e){return Tn.test(t)&&0===Number(e[2])},Fn=[{action:"changeOrderState",key:"orderState"},{action:"changePaymentState",key:"paymentState"},{action:"changeShipmentState",key:"shipmentState"}];function zn(t,r,o,a){var u,s,t=t.shippingInfo;return(t=t&&t.deliveries)?(u=[],s=[],t&&g.default(t,function(t,e){var n=R(a,e,r.shippingInfo.deliveries,o.shippingInfo.deliveries),i=n.oldObj,n=n.newObj;(Tn.test(e)||Pn.test(e))&&(t=(e=f(function(t,e,n){var i=1<arguments.length&&void 0!==e?e:{},r=2<arguments.length&&void 0!==n?n:{},o=[],a=[],u=D(t,i.parcels,r.parcels);return g.default(t,function(t,e){var n=R(u,e,i.parcels,r.parcels).oldObj;Vn(e,t)?o.push(h({action:"addParcelToDelivery",deliveryId:i.id},x(t))):Mn(e,t)&&a.push({action:"removeParcelFromDelivery",parcelId:n.id})}),[o,a]}(t.parcels,i,n),2))[0],i=e[1],u=u.concat(t),s=s.concat(i))}),s.concat(u)):[]}function Ln(t,i,r,o){var a,t=t.shippingInfo;return(t=t&&t.deliveries)?(a=[],g.default(t,function(t,e){var n=R(o,e,i.shippingInfo.deliveries,r.shippingInfo.deliveries).newObj;(Tn.test(e)||Pn.test(e))&&(e=f(function(t,e){var e=1<arguments.length&&void 0!==e?e:{},n=[];return t&&0<Object.keys(t).length&&n.push({action:"setDeliveryItems",deliveryId:e.id,deliveryKey:e.key,items:e.items}),[n]}(t.items,n),1)[0],a=a.concat(e))}),a):[]}function Kn(n,o){return function(i,r,a){var t,e=[];return i.shippingInfo&&i.shippingInfo.deliveries&&(t=D(i.shippingInfo.deliveries,a.shippingInfo.deliveries,r.shippingInfo.deliveries)),e.push(n("base",function(){return function(t,e,n,i){return N({actions:Fn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(i,a,r,o)})),e.push(n("deliveries",function(){return e=a,n=r,(t=(t=i).shippingInfo)?C("deliveries",b({},I,function(t){return{action:"addDelivery",items:t.items,parcels:t.parcels}}))(t,e.shippingInfo,n.shippingInfo):[];var t,e,n})),e.push(n("parcels",function(){return zn(i,a,r,t)})),e.push(n("items",function(){return Ln(i,a,r,t)})),e.push(m.default(n("returnInfo",function(){return e=a,n=r,(o=(t=i).returnInfo)?C("returnInfo",b(b({},I,function(t){return t.items?[h({action:"addReturnInfo"},t)]:[]}),_,function(t,i,e){var e=o[e].items,r=void 0===e?{}:e;return 0===Object.keys(r).length?[]:Object.keys(r).reduce(function(t,e){var n=i.items[e];return r[e].shipmentState&&t.push({action:"setReturnShipmentState",returnItemId:n.id,shipmentState:n.shipmentState}),r[e].paymentState&&t.push({action:"setReturnPaymentState",returnItemId:n.id,paymentState:n.paymentState}),t},[])}))(t,e,n):[];var t,e,n,o}))),e.push(n("custom",function(){return S(i,r,a)})),m.default(e)}}var Bn=[{action:"changeIsActive",key:"isActive"},{action:"changeName",key:"name"},{action:"changePredicate",key:"predicate"},{action:"changeSortOrder",key:"sortOrder"},{action:"changeValue",key:"value"},{action:"setDescription",key:"description"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"setKey",key:"key"}];var qn=["setValidFrom","setValidUntil"],Un=function(t){return qn.includes(t)};function Hn(t){var t=0<arguments.length&&void 0!==t?t:[],e=f(t.filter(function(t){return Un(t.action)}),2),n=e[0],e=e[1];return n&&e?[].concat(k(t.filter(function(t){return!Un(t.action)})),[{action:"setValidFromAndUntil",validFrom:n.validFrom,validUntil:e.validUntil}]):t}function $n(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:Bn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),Hn(m.default(i))}}var Gn=[{action:"changeIsActive",key:"isActive"},{action:"setName",key:"name"},{action:"setDescription",key:"description"},{action:"setKey",key:"key"},{action:"setCartPredicate",key:"cartPredicate"},{action:"setMaxApplications",key:"maxApplications"},{action:"setMaxApplicationsPerCustomer",key:"maxApplicationsPerCustomer"},{action:"changeCartDiscounts",key:"cartDiscounts"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"changeGroups",key:"groups"}];function Jn(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:Gn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),i.push(r("custom",function(){return S(t,e,n)})),Hn(m.default(i))}}var Zn=[{action:"changeName",key:"name"},{action:"setKey",key:"key"}];function Qn(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:Zn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),i.push(r("custom",function(){return S(t,e,n)})),m.default(i)}}var Wn=[{action:"changeIsActive",key:"isActive"},{action:"changeName",key:"name"},{action:"changeCartPredicate",key:"cartPredicate"},{action:"changeSortOrder",key:"sortOrder"},{action:"changeValue",key:"value"},{action:"changeRequiresDiscountCode",key:"requiresDiscountCode"},{action:"changeTarget",key:"target"},{action:"setDescription",key:"description"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"changeStackingMode",key:"stackingMode"},{action:"setKey",key:"key"}];function Xn(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:Wn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),i.push(r("custom",function(){return S(t,e,n)})),Hn(m.default(i))}}var q="function"==typeof WeakSet,Yn=Object.keys;function ti(t,e){return t===e||t!=t&&e!=e}function ei(t){return t.constructor===Object||null==t.constructor}function ni(t){return t&&"function"==typeof t.then}function ii(t){return!(!t||!t.$$typeof)}function ri(){var e=[];return{add:function(t){e.push(t)},has:function(t){return-1!==e.indexOf(t)}}}var oi=q?function(){return new WeakSet}:ri;function ai(e){return function(t){var u=e||t;return function(t,e,n){void 0===n&&(n=oi());var i=!!t&&"object"===O(t),r=!!e&&"object"===O(e);if(i||r){var o=i&&n.has(t),a=r&&n.has(e);if(o||a)return o&&a;i&&n.add(t),r&&n.add(e)}return u(t,e,n)}}}var ui="_owner",si=Function.prototype.bind.call(Function.prototype.call,Object.prototype.hasOwnProperty);function ci(t,e,n,i){var r=Yn(t),o=r.length;if(Yn(e).length!==o)return!1;if(o)for(var a;0<o--;){if((a=r[o])===ui){var u=ii(t),s=ii(e);if((u||s)&&u!==s)return!1}if(!si(e,a)||!n(t[a],e[a],i))return!1}return!0}var li="function"==typeof Map,fi="function"==typeof Set;function di(t){var m="function"==typeof t?t(e):e;function e(t,e,n){var i,r,o,a,u,s,c,l,f,d,p,h,y,v;return t===e||(t&&e&&"object"===O(t)&&"object"===O(e)?ei(t)&&ei(e)?ci(t,e,m,n):(i=Array.isArray(t),r=Array.isArray(e),i||r?i===r&&function(t,e,n,i){var r=t.length;if(e.length!==r)return!1;for(;0<r--;)if(!n(t[r],e[r],i))return!1;return!0}(t,e,m,n):(i=t instanceof Date,r=e instanceof Date,i||r?i===r&&ti(t.getTime(),e.getTime()):(i=t instanceof RegExp,r=e instanceof RegExp,i||r?i===r&&(v=e,(y=t).source===v.source)&&y.global===v.global&&y.ignoreCase===v.ignoreCase&&y.multiline===v.multiline&&y.unicode===v.unicode&&y.sticky===v.sticky&&y.lastIndex===v.lastIndex:ni(t)||ni(e)?t===e:li&&(i=t instanceof Map,r=e instanceof Map,i||r)?i===r&&(l=e,f=m,d=n,(h=(y=t).size===l.size)&&y.size&&(p={},y.forEach(function(n,i){var r,o;h&&(r=!1,o=0,l.forEach(function(t,e){r||p[o]||(r=f(i,e,d)&&f(n,t,d))&&(p[o]=!0),o++}),h=r)})),h):fi&&(i=t instanceof Set,r=e instanceof Set,i||r)?i===r&&(o=e,a=m,u=n,(c=(v=t).size===o.size)&&v.size&&(s={},v.forEach(function(e){var n,i;c&&(n=!1,i=0,o.forEach(function(t){n||s[i]||(n=a(e,t,u))&&(s[i]=!0),i++}),c=n)})),c):ci(t,e,m,n)))):t!=t&&e!=e)}return e}var pi=di(),hi=(di(function(){return ti}),di(ai()),di(ai(ti)),["__typename"]);function yi(t){return t.__typename,tt(t,hi)}var vi=[{action:"changeName",key:"name"},{action:"setKey",key:"key"},{action:"setDescription",key:"description"}];function mi(e,n){return function(i,r,o){var t=[];return t.push(e("base",function(){return function(t,e,n,i){return N({actions:vi,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(i,o,r,n)})),t.push(e("rates",function(){return t=i,e=o,n=r,C("rates",b(b(b({},I,function(t){return{action:"addTaxRate",taxRate:t}}),E,function(t){return{action:"removeTaxRate",taxRateId:t.id}}),_,function(t,e){var n=yi(t),i=null==(i=t.subRates)?void 0:i.map(yi),n=h(h({},n),{},{subRates:i});return pi(n,e)?null:{action:"replaceTaxRate",taxRateId:(t.id===e.id?t:e).id,taxRate:e}}))(t,e,n);var t,e,n})),m.default(t)}}var gi=[{action:"changeName",key:"name"},{action:"setDescription",key:"description"},{action:"setKey",key:"key"}],bi=function(t,e){return t.some(function(t){return t.country===e.country})};function ki(i,r){return function(e,n,o){var t=[];return t.push(i("base",function(){return function(t,e,n,i){return N({actions:gi,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(e,o,n,r)})),t.push(m.default(i("locations",function(){return t=e,i=o,r=n,C("locations",b(b(b({},I,function(t){return{action:"addLocation",location:t}}),E,function(t){return bi(r.locations,t)?null:{action:"removeLocation",location:t}}),_,function(t,e){var n=[];return bi(r.locations,t)||n.push({action:"removeLocation",location:t}),bi(i.locations,e)||n.push({action:"addLocation",location:e}),n}))(t,i,r);var t,i,r}))),m.default(t)}}var Oi=[{action:"setKey",key:"key"},{action:"changeName",key:"name"},{action:"setLocalizedName",key:"localizedName"},{action:"setDescription",key:"description"},{action:"setLocalizedDescription",key:"localizedDescription"},{action:"changeIsDefault",key:"isDefault"},{action:"setPredicate",key:"predicate"},{action:"changeTaxCategory",key:"taxCategory"},{action:"changeActive",key:"active"}];var ji=function(e){return e.shippingRates?e.shippingRates.map(function(t){return{action:"addShippingRate",zone:e.zone,shippingRate:t}}):[]};function wi(u,t,e){return C("zoneRates",b(b(b({},I,function(t){return[{action:"addZone",zone:t.zone}].concat(k(ji(t)))}),E,function(t){return{action:"removeZone",zone:t.zone}}),_,function(r,o){var a=!1,t=Object.keys(u.zoneRates).reduce(function(t,e){var n,i;return u.zoneRates[e].zone&&(a=!0),u.zoneRates[e].shippingRates?[].concat(k(t),k((e=u.zoneRates[e],n=r,i=o,C("shippingRates",b(b(b({},I,function(t){return{action:"addShippingRate",zone:i.zone,shippingRate:t}}),E,function(t){return{action:"removeShippingRate",zone:n.zone,shippingRate:t}}),_,function(t,e){return[{action:"removeShippingRate",zone:n.zone,shippingRate:t},{action:"addShippingRate",zone:i.zone,shippingRate:e}]}))(e,n,i)))):t},[]);return m.default(a?[].concat(k(t),[{action:"removeZone",zone:r.zone},{action:"addZone",zone:o.zone}]):t)}))(u,t,e)}function Ai(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:Oi,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),i.push(m.default(r("zoneRates",function(){return wi(t,n,e)}))),i.push(r("custom",function(){return S(t,e,n)})),m.default(i)}}var xi=[{action:"changeName",key:"name"},{action:"setKey",key:"key"},{action:"changeDescription",key:"description"}];var Si=function(r,o,t){var a=Ge([void 0,null,""]);return Object.entries(t).reduce(function(t,e){var e=f(e,2),n=e[0],i=e[1];if(!a(r[n])||!a(o[n])){if(!a(r[n])&&a(o[n]))return[].concat(k(t),[i]);if(!pi(r[n],o[n]))switch(n){case"key":return[].concat(k(t),[{action:i.action,attributeName:i.attributeName,key:r[n],newKey:o[n]}]);case"attributeConstraint":case"inputHint":return[].concat(k(t),[{action:i.action,attributeName:i.attributeName,newValue:o[n]}]);default:return[].concat(k(t),[b({action:i.action,attributeName:i.attributeName},n,o[n])])}}return t},[])},Ii=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=t.filter(function(t){return t.previous&&!t.next}),n=t.filter(function(t){return t.previous&&t.next}),t=t.filter(function(t){return!t.previous&&t.next});return[].concat(k(e.map(function(t){return{action:"removeAttributeDefinition",name:t.previous.name}})),k(m.default(n.map(function(t){return Si(t.previous,t.next,{label:{action:"changeLabel",attributeName:t.previous.name},inputTip:{action:"setInputTip",attributeName:t.previous.name},inputHint:{action:"changeInputHint",attributeName:t.previous.name},isSearchable:{action:"changeIsSearchable",attributeName:t.previous.name},attributeConstraint:{action:"changeAttributeConstraint",attributeName:t.previous.name}})}))),k(t.map(function(t){return{action:"addAttributeDefinition",attribute:t.next}})))},Ei=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=t.filter(function(t){return t.previous&&!t.next}),n=t.filter(function(t){return t.next&&t.previous}),t=t.filter(function(t){return!t.previous&&t.next});return[].concat(k(Object.values(e.reduce(function(t,e){var n=t[e.hint.attributeName]||{keys:[],attributeName:e.hint.attributeName,action:"removeEnumValues"};return h(h({},t),{},b({},e.hint.attributeName,h(h({},n),{},{keys:[].concat(k(n.keys),[e.previous.key])})))},{}))),k(m.default(n.map(function(t){var e=Si(t.previous,t.next,{key:{action:"changeEnumKey",attributeName:t.hint.attributeName}});return pi(t.previous.label,t.next.label)?e:t.hint.isLocalized?[].concat(k(e),[{action:"changeLocalizedEnumValueLabel",attributeName:t.hint.attributeName,newValue:t.next}]):[].concat(k(e),[{action:"changePlainEnumValueLabel",attributeName:t.hint.attributeName,newValue:t.next}])}))),k(t.map(function(t){return{action:t.hint.isLocalized?"addLocalizedEnumValue":"addPlainEnumValue",attributeName:t.hint.attributeName,value:t.next}})))},_i=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return t.length&&n.length&&(n=n.map(function(t){return t.name}),e=i.filter(function(t){return"removeAttributeDefinition"===t.action}).map(function(t){return t.name}),i=i.filter(function(t){return"addAttributeDefinition"===t.action}).map(function(t){return t.attribute.name}),t=t.map(function(t){return t.name}).filter(function(t){return!e.includes(t)}).concat(i),n.join(",")!==t.join(","))?{action:"changeAttributeOrderByName",attributeNames:n}:null},Ci=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0,t=[].concat(k(Ii(t.attributeDefinitions)),k(Ei(t.attributeEnumValues))),e=_i(e.attributes,n.attributes,t);return e&&t.push(e),t};function Ni(r,o){return function(t,e,n,i){return m.default([r("base",function(){return function(t,e,n,i){return t?N({diff:t,actions:xi,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString}):[]}(t,n,e,o)}),Ci(i.nestedValuesChanges,n,e)])}}var Ri=[{action:"changeKey",key:"key"},{action:"setName",key:"name"},{action:"setDescription",key:"description"},{action:"changeType",key:"type"},{action:"changeInitial",key:"initial"},{action:"setTransitions",key:"transitions"}];function Di(u,s){return function(i,r,o){var e,n,t=[],a=[];return t.push(u("base",function(){return function(t,e,n,i){return N({actions:Ri,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(i,o,r,s)})),a.push(u("roles",function(){return t=i,e=o,n=r,C("roles",b(b({},I,function(t){return{action:"addRoles",roles:t}}),E,function(t){return{action:"removeRoles",roles:t}}))(t,e,n);var t,e,n})),m.default([].concat(t,k((t=f(t=a,1)[0],e=[],n=[],t.forEach(function(t){"removeRoles"===t.action&&n.push(t.roles),"addRoles"===t.action&&e.push(t.roles)}),[{action:"removeRoles",roles:n},{action:"addRoles",roles:e}].filter(function(t){return t.roles.length})))))}}var Pi=[{action:"changeKey",key:"key"},{action:"changeName",key:"name"},{action:"changeDescription",key:"description"},{action:"setAddress",key:"address"},{action:"setGeoLocation",key:"geoLocation"},{action:"setRoles",key:"roles"}];function Ti(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:Pi,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),i.push(r("custom",function(){return S(t,e,n)})),m.default(i)}}var Vi=new RegExp(/^\d+$/),Mi=new RegExp(/^_\d+$/),Fi=function(t){return Vi.test(t)},zi=function(t){return Mi.test(t)},Li=[{action:"changeKey",key:"key"},{action:"changeName",key:"name"},{action:"setDescription",key:"description"}];function Ki(t,p,h,y){var v=[];return g.default(t,function(t,e){var o,n,i,a,u,s,c,l,r,f,d=R(y,e,p,h);Fi(e)?Array.isArray(t)?(n=x(t)).name&&v.push({action:"addFieldDefinition",fieldDefinition:n}):t.label?v.push({action:"changeLabel",label:d.newObj.label,fieldName:d.oldObj.name}):t.inputHint?v.push({action:"changeInputHint",inputHint:d.newObj.inputHint,fieldName:d.oldObj.name}):null!=t&&null!=(n=t.type)&&n.values&&v.push.apply(v,k((o=d.oldObj.name,n=d.oldObj.type.name,i=t.type,a=d.oldObj.type,u=d.newObj.type,s="Enum"===n?"addEnumValue":"addLocalizedEnumValue",c="Enum"===n?"changeEnumValueLabel":"changeLocalizedEnumValueLabel",l="Enum"===n?"changeEnumValueOrder":"changeLocalizedEnumValueOrder",n=C("values",b(b({},I,function(t){return{fieldName:o,action:s,value:t}}),_,function(e,n){var t,i,r=[];return u.values.find(function(t){return t.key===e.key})?(t=e.key!==n.key,i=a.values.find(function(t){return t.key===n.key}),i=H.default(i.label,n.label),t&&r.push({fieldName:o,action:l,value:n}),i||r.push({fieldName:o,action:c,value:n})):r.push({fieldName:o,action:s,value:n}),r})),r=[],f=[],m.default(n(i,a,u)).forEach(function(t){t.action===l?f=u.values.map(function(t){return t.key}):r.push(t)}),[].concat(r,k(0<f.length?[{fieldName:o,action:l,keys:f}]:[]))))):zi(e)&&Array.isArray(t)&&(3===t.length&&3===t[2]?v.push({action:"changeFieldDefinitionOrder",fieldNames:h.map(function(t){return t.name})}):void 0===x(t)&&t[0].name&&v.push({action:"removeFieldDefinition",fieldName:t[0].name}))}),W.default(v,function(t){return"removeFieldDefinition"!==t.action})}function Bi(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return N({actions:Li,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)}),r("fieldDefinitions",function(){return Ki(t.fieldDefinitions,n.fieldDefinitions,e.fieldDefinitions,D(t.fieldDefinitions,n.fieldDefinitions,e.fieldDefinitions,"name"))})),m.default(i)}}var qi=[{action:"changeName",key:"name"},{action:"changeCurrencies",key:"currencies"},{action:"changeCountries",key:"countries"},{action:"changeLanguages",key:"languages"},{action:"changeMessagesConfiguration",key:"messagesConfiguration"},{action:"setShippingRateInputType",key:"shippingRateInputType"}],Ui=[{action:"changeMyBusinessUnitStatusOnCreation",key:"myBusinessUnitStatusOnCreation",actionKey:"status"},{action:"setMyBusinessUnitAssociateRoleOnCreation",key:"myBusinessUnitAssociateRoleOnCreation",actionKey:"associateRole"}],Hi=[{action:"changeCustomerSearchStatus",key:"status"}];var $i=function(t,e,n){t=t.businessUnits;return t?N({actions:Ui,diff:t,oldObj:e.businessUnits,newObj:n.businessUnits}):[]};function Gi(e,n){return function(r,o,a){var t=[];return t.push(e("base",function(){return function(t,e,n,i){return N({actions:qi,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(r,a,o,n)})),t.push(e("businessUnit",function(){return $i(r,a,o)})),t.push(e("searchIndexingConfiguration",function(){return e=a,n=o,(i=(t=r).searchIndexing)&&i.customers?N({actions:Hi,diff:t.searchIndexing.customers,oldObj:e.searchIndexing.customers,newObj:n.searchIndexing.customers}):[];var t,e,n,i})),m.default(t)}}var Ji=[{action:"setName",key:"name"},{action:"setLanguages",key:"languages"},{action:"setDistributionChannels",key:"distributionChannels"},{action:"setSupplyChannels",key:"supplyChannels"}];function Zi(r){return function(t,e,n){var i=[];return i.push(r("base",function(){return N({actions:Ji,diff:t,oldObj:n,newObj:e})})),i.push(r("custom",function(){return S(t,e,n)})),m.default(i)}}var Qi=[{action:"changeName",key:"name"},{action:"setKey",key:"key"}];function Wi(r){return function(t,e,n){var i=[];return i.push(r("base",function(){return N({actions:Qi,diff:t,oldObj:n,newObj:e})})),i.push(r("custom",function(){return S(t,e,n)})),m.default(i)}}var Xi=[{action:"changeValue",key:"value"},{action:"setDiscountedPrice",key:"discounted"},{action:"setPriceTiers",key:"tiers"},{action:"setKey",key:"key"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"changeActive",key:"active"}];function Yi(o,a){return function(t,e,n){var i=o("base",function(){return function(t,e,n,i){return N({actions:Xi,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,a)}),r=o("custom",function(){return S(t,e,n)});return Hn([].concat(k(i),k(r)))}}var tr=function(t,e){return t.some(function(t){return t.key===e.key})},er=[{action:"changeName",key:"name"},{action:"setKey",key:"key"},{action:"setDescription",key:"description"}];function nr(i,r){return function(e,n,o){var t=[];return t.push(i("base",function(){return function(t,e,n,i){return N({actions:er,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(e,o,n,r)})),t.push(m.default(i("attributes",function(){return t=e,i=o,r=n,C("attributes",b(b(b({},I,function(t){return{action:"addAttribute",attribute:t}}),E,function(t){return tr(r.attributes,t)?null:{action:"removeAttribute",attribute:t}}),_,function(t,e){var n=[];return tr(r.attributes,t)||n.push({action:"removeAttribute",attribute:t}),tr(i.attributes,e)||n.push({action:"addAttribute",attribute:e}),n}))(t,i,r);var t,i,r}))),m.default(t)}}t.createSyncAttributeGroups=function(t,e){return{buildActions:i(A,nr(r(t),e))}},t.createSyncCartDiscounts=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:i(A,Xn(r(t),e))}},t.createSyncCategories=function(t,e){return{buildActions:i(A,tn(r(t),e),Ye)}},t.createSyncChannels=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:i(A,Ti(r(t),e))}},t.createSyncCustomerGroup=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:i(A,Qn(r(t),e))}},t.createSyncCustomers=function(t,e){return{buildActions:i(A,sn(r(t),e),Ye)}},t.createSyncDiscountCodes=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:i(A,Jn(r(t),e))}},t.createSyncInventories=function(t,e){return{buildActions:i(A,fn(r(t),e))}},t.createSyncOrders=function(t,e){return{buildActions:i(A,Kn(r(t),e))}},t.createSyncProductDiscounts=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:i(A,$n(r(t),e))}},t.createSyncProductSelections=function(t){return{buildActions:i(A,Wi(r(t)),null)}},t.createSyncProductTypes=function(t,e){return{buildActions:i(A,Ni(r(t),e),null,{withHints:!0})}},t.createSyncProducts=function(t,e){return{buildActions:i(A,Rn(r(t),e),Dn)}},t.createSyncProjects=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:i(A,Gi(r(t),e))}},t.createSyncShippingMethods=function(t,e){return{buildActions:i(A,Ai(r(t),e))}},t.createSyncStandalonePrices=function(t,e){return{buildActions:i(A,Yi(r(t),e))}},t.createSyncStates=function(t,e){return{buildActions:i(A,Di(r(t),e))}},t.createSyncStores=function(t){return{buildActions:i(A,Zi(r(t)),null)}},t.createSyncTaxCategories=function(t,e){return{buildActions:i(A,mi(r(t),e))}},t.createSyncTypes=function(t,e){return{buildActions:i(A,Bi(r(t),e))}},t.createSyncZones=function(t,e){return{buildActions:i(A,ki(r(t),e))}},Object.defineProperty(t,"__esModule",{value:!0})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lodash.flatten"),require("lodash.isequal"),require("lodash.isnil"),require("jsondiffpatch/dist/jsondiffpatch.cjs"),require("lodash.foreach"),require("lodash.uniqwith"),require("lodash.intersection"),require("lodash.without"),require("lodash.sortby")):"function"==typeof define&&define.amd?define(["exports","lodash.flatten","lodash.isequal","lodash.isnil","jsondiffpatch/dist/jsondiffpatch.cjs","lodash.foreach","lodash.uniqwith","lodash.intersection","lodash.without","lodash.sortby"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CommercetoolsSyncActions={},t.flatten,t.isEqual,t.isNil,t.jsondiffpatch_cjs,t.forEach,t.uniqWith,t.intersection,t.without,t.sortBy)}(this,function(t,q,z,T,M,V,K,L,B,H){function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var v=e(q),_=e(z),h=e(T),g=e(V),$=e(K),G=e(L),Z=e(B),W=e(H);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function b(t,e,n){return(e=function(t){t=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:t+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(t,e){if(null==t)return{};var n,i=function(t,e){if(null==t)return{};var n,i={};for(n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(t),o=0;o<r.length;o++)n=r[o],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);return i}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,u=[],s=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=o.call(n)).done)&&(u.push(i.value),u.length!==e);s=!0);}catch(t){c=!0,r=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return u}}(t,e)||Q(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Q(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Q(t,e){var n;if(t)return"string"==typeof t?i(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}var X=["prices"];var Y=function(t){return{value:{currencyCode:t.value.currencyCode},channel:t.channel,country:t.country,customerGroup:t.customerGroup,validFrom:t.validFrom,validUntil:t.validUntil}};function tt(n,t){return t&&t.prices.find(function(t){return e=n,t=Y(t=t),e=Y(e),_.default(e,t);var e})||null}function n(o,a,u,t){var s=3<arguments.length&&void 0!==t?t:{};return function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)throw new Error("Missing either `newObj` or `oldObj` in order to build update actions");e=e,t=t;var r,i=l((i=u)&&"function"==typeof i?i(e,t):[e,t],2),e=i[0],t=i[1],i=(t.variants&&e.variants&&(t.variants=(i=t.variants,r=e.variants,i.map(function(e){var n,t=e.prices,i=c(e,X);return t?(n=r.find(function(t){return!h.default(t.id)&&t.id===e.id||!h.default(t.key)&&t.key===e.key||!h.default(t.sku)&&t.sku===e.sku}),y(y({},i),{},{prices:t.map(function(t){var e=y({},t),t=tt(t,n);return t&&(e.id||(e.id=t.id),h.default(e.value.type)&&(e.value.type=t.value.type),h.default(e.value.fractionDigits))&&(e.value.fractionDigits=t.value.fractionDigits),e})})):i}))),o(e,t));return s.withHints||i?a(i,t,e,n):[]}}function r(t){var i=0<arguments.length&&void 0!==t?t:[];return function(e,t){if(!Object.keys(i).length)return t();var n=i.find(function(t){return t.type===e});if(!n)return[];if("ignore"===n.group||"black"===n.group)return[];if("allow"===n.group||"white"===n.group)return t();throw new Error("Action group '".concat(n.group,'\' not supported. Use either "allow" or "ignore".'))}}var et=new M.DiffPatcher({objectHash:function(t,e){return e="$$index:".concat(e),"object"===k(t)&&null!==t&&(t.id||t.name||t.url)||e},arrays:{detectMove:!0,includeValueOnMove:!1},textDiff:{minLength:Number.MAX_SAFE_INTEGER}});function o(t,e){return et.diff(t,e)}function m(t,e){return et.patch(t,e)}function j(t,e){if(!Array.isArray(t))throw new Error("Expected array to extract delta value");if(1===t.length)return t[0];if(2===t.length)return t[1];if(3!==t.length||0!==t[2]){if(3===t.length&&2===t[2]){if(e)return m(e,t);throw new Error("Cannot apply patch to long text diff. Missing original object.")}if(3===t.length&&3===t[2])throw new Error("Detected an array move, it should not happen as `includeValueOnMove` should be set to false");throw new Error("Got unsupported number ".concat(t[2]," in delta value"))}}var nt=["actions"],it={setCustomType:"setCustomType",setCustomField:"setCustomField"},rt=function(t){return Array.isArray(t.custom)},ot=function(t){return Boolean(t.custom.fields)},at=function(t){return Boolean(t.custom.type)},ut=function(t,e){return Array.isArray(t.custom.type)?j(t.custom.type,e):t.custom.type},st=function(t,e){return Array.isArray(t.id)?j(t.id):e.custom.type.id},ct=function(t,e){return Array.isArray(t.key)?j(t.key):e.custom.type.key},dt=function(t,e){return Array.isArray(t)?j(t):e},lt=function(t,e){return t[e]};function A(t,e,n,i){var i=3<arguments.length&&void 0!==i?i:{actions:{}},r=[],o=i.actions,a=c(i,nt),u=y(y({},it),o);return t.custom&&(rt(t)?(i=j(t.custom,n),r.push(y(y({action:u.setCustomType},a),i))):at(t)?(o=ut(t,n))?o.id?r.push(y(y({action:u.setCustomType},a),{},{type:{typeId:"type",id:st(o,e)},fields:dt(t.custom.fields,e.custom.fields)})):o.key&&r.push(y(y({action:u.setCustomType},a),{},{type:{typeId:"type",key:ct(o,e)},fields:dt(t.custom.fields,e.custom.fields)})):r.push(y({action:u.setCustomType},a)):ot(t)&&(i=Object.keys(t.custom.fields).map(function(t){return y(y({action:u.setCustomField},a),{},{name:t,value:lt(e.custom.fields,t)})}),r.push.apply(r,O(i)))),r}var ft=new RegExp(/^\d+$/),pt=new RegExp(/^_\d+$/),S="create",P="remove",w="change";function I(l,f){return function(t,o,a){var u,s=[],c=[],d=[];return t[l]&&(u=t[l],Object.keys(u).forEach(function(t){var e,n,i,r;f[S]&&(i=u,r=t,ft.test(r))&&Array.isArray(i[r])&&1===i[r].length?(i=(0,f[S])(a[l][t],parseInt(t,10)))&&s.push(i):f[w]&&(r=u,i=t,ft.test(i))&&("object"===k(r[i])||"string"==typeof r[i])?(e=(0,f[w])(o[l][t],a[l][t],parseInt(t,10)))&&d.push(e):f[P]&&(e=u,n=t,pt.test(n))&&Array.isArray(e[n])&&3===e[n].length&&("object"===k(e[n][0])||"string"==typeof e[n][0])&&0===e[n][1]&&0===e[n][2]&&(n=t.replace("_",""),t=(0,f[P])(o[l][n],parseInt(n,10)))&&c.push(t)})),d.concat(c,s)}}function ht(t){return t.id?{assetId:t.id}:{assetKey:t.key}}function yt(t){return JSON.parse(JSON.stringify(t))}function mt(t){return"string"==typeof t?t.trim():t}var u=function(t){return function(e){return t.some(function(t){return t===mt(e)})}},vt=function(t){return t.startsWith("set")};function U(t){var e=t.actions,s=t.diff,c=t.oldObj,d=t.newObj,l=t.shouldUnsetOmittedProperties,f=t.shouldPreventUnsettingRequiredFields,p=u(t.shouldOmitEmptyString?[void 0,null,""]:[void 0,null]);return e.map(function(t){var e=t.key,n=t.actionKey||t.key,i=s[e],r=c[e],o=d[e],a=p(c[e]),u=p(d[e]),e=!Object.keys(d).includes(e);if(i&&((!u||vt(t.action)||!f)&&(!u||!a)))return!u&&a?b({action:t.action},n,o):u&&e&&!l?void 0:u?{action:t.action}:(a=m(yt(r),i),b({action:t.action},n,a))}).filter(function(t){return!h.default(t)})}function s(t){var e=t.actions,i=t.diff,r=t.newObj;return e.map(function(t){var e,n=t.action,t=t.key;if(i[t]&&(Array.isArray(i[t])||i[t].id))return(e=Array.isArray(i[t])?j(i[t]):r[t])?e.id?b({action:n},t,{typeId:e.typeId,id:e.id}):b({action:n},t,{typeId:e.typeId,key:e.key}):{action:n}}).filter(function(t){return t})}var gt=[{action:"changeName",key:"name"},{action:"changeSlug",key:"slug"},{action:"setDescription",key:"description"},{action:"changeOrderHint",key:"orderHint"},{action:"setExternalId",key:"externalId"},{action:"setKey",key:"key"}],bt=[{action:"setMetaTitle",key:"metaTitle"},{action:"setMetaKeywords",key:"metaKeywords"},{action:"setMetaDescription",key:"metaDescription"}],Ot=[{action:"changeParent",key:"parent"}];var kt="custom";function d(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return h.default(t)||h.default(a)?[t,a]:[t,Object.entries(t).reduce(function(t,e){var e=l(e,2),n=e[0],e=e[1];if(n!==kt)if(Array.isArray(e)&&a[n]&&1<=a[n].length)for(var i,r=e.reduce(function(t,e){return t[e.id]=e,t},{}),o=0;o<a[n].length;o++)h.default(a[n][o])||"object"!==k(a[n][o])||h.default(a[n][o].id)||(i=r[a[n][o].id],h.default(i))||(i=l(d(i,a[n][o]),2)[1],Object.isFrozen(t[n])&&(t[n]=t[n].slice()),t[n][o]=i);else Array.isArray(e)?t[n]=h.default(a[n])?[]:a[n]:h.default(a[n])||"object"!==k(e)||e instanceof Date||(e=l(d(e,a[n]),2)[1],t[n]=e);return t},y({},a))]}function jt(e,n){return function(i,r,o){var t=[];return t.push(e("base",function(){return function(t,e,n,i){return U({actions:gt,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(i,o,r,n)})),t.push(e("references",function(){return s({actions:Ot,diff:i,oldObj:o,newObj:r})})),t.push(e("meta",function(){return U({actions:bt,diff:i,oldObj:o,newObj:r})})),t.push(e("custom",function(){return A(i,r,o)})),t.push(e("assets",function(){return t=i,e=o,n=r,I("assets",b(b(b({},S,function(t){return{action:"addAsset",asset:t}}),P,function(t){return y({action:"removeAsset"},ht(t))}),w,function(t,e){return[y({action:"removeAsset"},ht(t)),{action:"addAsset",asset:e}]}))(t,e,n);var t,e,n})),v.default(t)}}var At=u([void 0,null,""]),St=[{action:"setSalutation",key:"salutation"},{action:"changeEmail",key:"email"},{action:"setFirstName",key:"firstName"},{action:"setLastName",key:"lastName"},{action:"setMiddleName",key:"middleName"},{action:"setTitle",key:"title"},{action:"setCustomerNumber",key:"customerNumber"},{action:"setExternalId",key:"externalId"},{action:"setCompanyName",key:"companyName"},{action:"setDateOfBirth",key:"dateOfBirth"},{action:"setLocale",key:"locale"},{action:"setVatId",key:"vatId"},{action:"setStores",key:"stores"},{action:"setKey",key:"key"}],Pt=[{action:"setDefaultBillingAddress",key:"defaultBillingAddressId",actionKey:"addressId"},{action:"setDefaultShippingAddress",key:"defaultShippingAddressId",actionKey:"addressId"}],wt=[{action:"setCustomerGroup",key:"customerGroup"}],It=[{action:"setAuthenticationMode",key:"authenticationMode",value:"password"}];function Ut(t,e,n){return e=(t={actions:It,diff:t,oldObj:e,newObj:n}).actions,s=t.diff,c=t.oldObj,d=t.newObj,e.map(function(t){var e=t.key,n=t.value||t.key,i=s[e],r=c[e],o=d[e],a=At(c[e]),u=At(d[e]);if(i&&(!u||!a)){if("Password"===d.authenticationMode&&!d.password)throw new Error("Cannot set to Password authentication mode without password");if("authenticationMode"in d&&!["Password","ExternalAuth"].includes(d.authenticationMode))throw new Error("Invalid Authentication Mode");if(!u&&a)return"ExternalAuth"===d.authenticationMode?{action:t.action,authMode:o}:b({action:t.action,authMode:o},n,d.password);if(!u||{}.hasOwnProperty.call(d,e))if(!u||!{}.hasOwnProperty.call(d,e))return a=m(yt(r),i),"ExternalAuth"===d.authenticationMode?{action:t.action,authMode:a}:b({action:t.action,authMode:a},n,d.password)}}).filter(function(t){return!h.default(t)});var s,c,d}function Et(e,n){return function(i,r,o){var t=[];return t.push(e("base",function(){return function(t,e,n,i){return U({actions:St,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(i,o,r,n)})),t.push(e("references",function(){return s({actions:wt,diff:i,oldObj:o,newObj:r})})),t.push(e("addresses",function(){return t=i,e=o,n=r,I("addresses",b(b(b({},S,function(t){return{action:"addAddress",address:t}}),P,function(t){return{action:"removeAddress",addressId:t.id}}),w,function(t,e){return{action:"changeAddress",addressId:t.id,address:e}}))(t,e,n);var t,e,n})),t.push(e("base",function(){return function(t,e,n,i){return U({actions:Pt,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(i,o,r,n)})),t.push(e("billingAddressIds",function(){return t=i,e=o,n=r,I("billingAddressIds",b(b({},S,function(t){return{action:"addBillingAddressId",addressId:t}}),P,function(t){return{action:"removeBillingAddressId",addressId:t}}))(t,e,n);var t,e,n})),t.push(e("shippingAddressIds",function(){return t=i,e=o,n=r,I("shippingAddressIds",b(b({},S,function(t){return{action:"addShippingAddressId",addressId:t}}),P,function(t){return{action:"removeShippingAddressId",addressId:t}}))(t,e,n);var t,e,n})),t.push(e("custom",function(){return A(i,r,o)})),t.push(e("authenticationModes",function(){return Ut(i,o,r)})),v.default(t)}}var Rt=[{action:"changeQuantity",key:"quantityOnStock",actionKey:"quantity"},{action:"setRestockableInDays",key:"restockableInDays"},{action:"setExpectedDelivery",key:"expectedDelivery"}],Nt=[{action:"setSupplyChannel",key:"supplyChannel"}];function xt(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:Rt,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)})),i.push(r("references",function(){return s({actions:Nt,diff:t,oldObj:n,newObj:e})})),i.push(r("custom",function(){return A(t,e,n)})),v.default(i)}}function E(t,e,n,i){var r,o,a;return t[e]&&(r=t[e][0],t=t[e][1],n&&n[r]&&(o=n[r]),i)&&i[t]&&(a=i[t]),{oldObj:o,newObj:a}}var Ct=new RegExp(/^\d+$/),Ft=new RegExp(/^_\d+$/);function Dt(t,e){var t=0<arguments.length&&void 0!==t?t:[],i=1<arguments.length&&void 0!==e?e:"id";return t.reduce(function(t,e,n){return t.refByIndex[String(n)]=e[i],t.refByIdentifier[e[i]]=String(n),t},{refByIndex:{},refByIdentifier:{}})}function R(t,e,n,i){var e=1<arguments.length&&void 0!==e?e:[],n=2<arguments.length&&void 0!==n?n:[],i=3<arguments.length&&void 0!==i?i:"id",r={},e=Dt(e,i),o=e.refByIdentifier,a=e.refByIndex,e=Dt(n,i),u=e.refByIdentifier,s=e.refByIndex;return g.default(t,function(t,e){var n,i;Ct.test(e)?(n=s[e],r[e]=[o[n],e]):Ft.test(e)&&(n=e.substring(1),i=a[n],r[e]=[n,u[i]])}),r}var N=new RegExp(/^\d+$/),x=new RegExp(/^_\d+$/),qt=[{action:"changeName",key:"name"},{action:"changeSlug",key:"slug"},{action:"setDescription",key:"description"},{action:"setSearchKeywords",key:"searchKeywords"},{action:"setKey",key:"key"},{action:"setPriceMode",key:"priceMode"}],zt=[{action:"setAssetKey",key:"key",actionKey:"assetKey"},{action:"changeAssetName",key:"name"},{action:"setAssetDescription",key:"description"},{action:"setAssetTags",key:"tags"},{action:"setAssetSources",key:"sources"}],Tt=[{action:"setMetaTitle",key:"metaTitle"},{action:"setMetaDescription",key:"metaDescription"},{action:"setMetaKeywords",key:"metaKeywords"}],Mt=[{action:"setTaxCategory",key:"taxCategory"},{action:"transitionState",key:"state"}],Vt=function(t,e){return N.test(t)&&Array.isArray(e)&&e.length},Kt=function(t,e){return N.test(t)&&Object.keys(e).length},Lt=function(t,e){return x.test(t)&&0===Number(e[2])},Bt=function(t,e){return x.test(t)&&3===Number(e[2])};function Ht(t,e,n){var i=e&&e.name;if(i)return t={action:"setAttribute",variantId:t,name:i,value:e.value},-1!==n.indexOf(i)&&delete(t=y(y({},t),{},{action:"setAttributeInAllVariants"})).variantId,t}function _t(i,t,e,n){var r;if(e)return r={action:"setAttribute",variantId:t.id,name:e.name},t=t.attributes.find(function(t){return t.name===e.name})||{},-1!==n.indexOf(e.name)&&delete(r=y(y({},r),{},{action:"setAttributeInAllVariants"})).variantId,Array.isArray(i)||"string"==typeof i?r.value=j(i,t.value):i.centAmount||i.currencyCode?r.value={centAmount:i.centAmount?j(i.centAmount):e.value.centAmount,currencyCode:i.currencyCode?j(i.currencyCode):e.value.currencyCode}:i.key?r.value=j(i.key):"object"===k(i)&&(!{}.hasOwnProperty.call(i,"_t")||"a"!==i._t?(n=Object.keys(i).reduce(function(t,e){var n=j(i[e],t[e]);return Object.assign(t,b({},e,n))},y({},t.value)),r.value=n):r=y(y({},r),{},{value:e.value})),r}function f(t){return t.id?{assetId:t.id}:{assetKey:t.key}}function p(t){var e=t.id;return e?{variantId:e}:{sku:t.sku}}function $t(t,o,a){var e,u=[],s=R(t,o.assets,a.assets),n=(g.default(t,function(t,e){var n,i=E(s,e,o.assets,a.assets),r=i.oldObj,i=i.newObj;Vt(e,t)?u.push(y(y({action:"addAsset",asset:j(t)},p(a)),{},{position:Number(e)})):Kt(e,t)?(n=U({actions:zt,diff:t,oldObj:r,newObj:i}).map(function(t){return"setAssetKey"===t.action?y(y(y({},t),p(o)),{},{assetId:r.id}):y(y(y({},t),p(o)),f(r))}),u.push.apply(u,O(n)),t.custom&&(n=A(t,i,r,y(y({actions:{setCustomType:"setAssetCustomType",setCustomField:"setAssetCustomField"}},p(o)),f(r))),u.push.apply(u,O(n)))):Lt(e,t)&&u.push(y(y({action:"removeAsset"},f(r)),p(o)))}),t=t,e=o,n=a,Object.entries(t).find(function(t){return Bt(t[0],t[1])})?(t=e.assets.map(function(t){return t.id}),n=n.assets.map(function(t){return t.id}).filter(function(t){return void 0!==t}),n=G.default(n,t),t=Z.default.apply(void 0,[t].concat(O(n))),[y({action:"changeAssetOrder",assetOrder:n.concat(t)},p(e))]):[]);return[].concat(O(n),u)}function Gt(t,d,l,e,n){var f=3<arguments.length&&void 0!==e?e:[],p=4<arguments.length?n:void 0,h=[],e=t.variants;return e&&g.default(e,function(t,e){var i,r,o,a,n,u,s=E(p,e,d.variants,l.variants),c=s.oldObj,s=s.newObj;N.test(e)&&!Array.isArray(t)&&(e=t,u=c,u={}.hasOwnProperty.call(e,"sku")&&((e=j(e.sku))||u.sku)?{action:"setSku",variantId:u.id,sku:e||null}:null,e=t,n=c,n={}.hasOwnProperty.call(e,"key")&&((e=j(e.key))||n.key)?{action:"setProductVariantKey",variantId:n.id,key:e||null}:null,u&&h.push(u),n&&h.push(n),e=t.attributes,i=c,r=s,o=f,a=[],(u=e)&&g.default(u,function(t,e){var n;N.test(e)?Array.isArray(t)?(n=Ht(i.id,j(t),o))&&a.push(n):r.attributes&&(n=_t(t.value,i,r.attributes[e],o))&&a.push(n):x.test(e)&&(Array.isArray(t)?3===t.length&&3===t[2]||(n=Ht(i.id,j(t)||(t[0]&&t[0].name?{name:t[0].name}:void 0),o))&&a.push(n):(n=e.substring(1),r.attributes&&(e=_t(t.value,i,r.attributes[n],o))&&a.push(e)))}),n=a,h=h.concat(n))}),$.default(h,function(t,e){return t.action===e.action&&t.name===e.name&&t.variantId===e.variantId})}function Zt(t,r,o,a){var u=[],t=t.variants;return t&&g.default(t,function(t,e){var n=E(a,e,r.variants,o.variants),i=n.oldObj,n=n.newObj;(x.test(e)||N.test(e))&&(e=function(t,e,n){var r=1<arguments.length&&void 0!==e?e:{},o=2<arguments.length&&void 0!==n?n:{},a=[],u=R(t,r.images,o.images,"url");return g.default(t,function(t,e){var n=E(u,e,r.images,o.images),i=n.oldObj,n=n.newObj;N.test(e)?Array.isArray(t)&&t.length?a.push({action:"addExternalImage",variantId:r.id,image:j(t)}):"object"===k(t)&&(!{}.hasOwnProperty.call(t,"url")||2!==t.url.length?!{}.hasOwnProperty.call(t,"label")||1!==t.label.length&&2!==t.label.length||a.push({action:"setImageLabel",variantId:r.id,imageUrl:i.url,label:j(t.label)}):(a.push({action:"removeImage",variantId:r.id,imageUrl:i.url}),a.push({action:"addExternalImage",variantId:r.id,image:n}))):x.test(e)&&Array.isArray(t)&&3===t.length&&(3===Number(t[2])?a.push({action:"moveImageToPosition",variantId:r.id,imageUrl:i.url,position:Number(t[1])}):0===Number(t[2])&&a.push({action:"removeImage",variantId:r.id,imageUrl:i.url}))}),a}(t.images,i,n),u=u.concat(e))}),u}function Wt(t,r,o,a,u){var s=[],c=[],d=[],t=t.variants;return t&&g.default(t,function(t,e){var n=E(a,e,r.variants,o.variants),i=n.oldObj,n=n.newObj;(x.test(e)||N.test(e))&&(t=(e=l(function(t,e,n,i){var o=1<arguments.length&&void 0!==e?e:{},a=2<arguments.length&&void 0!==n?n:{},u=3<arguments.length&&void 0!==i&&i,s=[],c=[],d=[],l=R(t,o.prices,a.prices);return g.default(t,function(t,e){var n,i=E(l,e,o.prices,a.prices),r=i.oldObj,i=i.newObj;Vt(e,t)?(n=t.map(function(t){t=y({},t);return!0!==u&&delete t.discounted,t}),s.push({action:"addPrice",variantId:o.id,price:j(n)})):Kt(e,t)?(n=y({},t),!0!==u&&delete n.discounted,Object.keys(n).length&&(n=y({},i),!0!==u&&delete n.discounted,c.push({action:"changePrice",priceId:r.id,price:n}))):Lt(e,t)&&d.push({action:"removePrice",priceId:r.id})}),[s,c,d]}(t.prices,i,n,u),3))[0],i=e[1],n=e[2],s=s.concat(t),c=c.concat(i),d=d.concat(n))}),c.concat(d).concat(s)}function Jt(t,e){function n(t){return(t=Array.isArray(t.variants)?t.variants:[])[0]?t[0].id:void 0}e=n(e),t=n(t);return e&&t!==e?[{action:"changeMasterVariant",variantId:e}]:[]}function Qt(o,a){return function(d,l,f){var t=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},e=[],n=t.sameForAllAttributeNames,i=t.enableDiscounted,t=l.publish,r=l.staged,p=R(d.variants,f.variants,l.variants);return e.push(o("attributes",function(){return Gt(d,f,l,n||[],p)})),e.push(o("variants",function(){return t=d,e=f,n=l,I("variants",b({},S,function(t){return y(y({},t),{},{action:"addVariant"})}))(t,e,n);var t,e,n})),e.push(Jt(f,l)),e.push(o("variants",function(){return t=d,e=f,n=l,I("variants",b({},P,function(t){return{action:"removeVariant",id:t.id}}))(t,e,n);var t,e,n})),e.push(o("base",function(){return function(t,e,n,i){return U({actions:qt,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties})}(d,f,l,a)})),e.push(o("meta",function(){return function(t,e,n,i){return U({actions:Tt,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties})}(d,f,l)})),e.push(o("references",function(){return s({actions:Mt,diff:d,oldObj:f,newObj:l})})),e.push(o("images",function(){return Zt(d,f,l,p)})),e.push(o("pricesCustom",function(){return i=f,u=l,s=p,c=[],(t=(t=d).variants)&&g.default(t,function(t,e){var r,n=E(s,e,i.variants,u.variants),o=n.oldObj,a=n.newObj;t&&t.prices&&(x.test(e)||N.test(e))&&(r=R(t.prices,o.prices,a.prices),g.default(t.prices,function(t,e){var n=E(r,e,o.prices,a.prices),i=n.oldObj,n=n.newObj;t.custom&&(x.test(e)||N.test(e))&&(e=A(t,n,i,{actions:{setCustomType:"setProductPriceCustomType",setCustomField:"setProductPriceCustomField"},priceId:i.id}),c=c.concat(e))}))}),c;var t,i,u,s,c})),e.push(o("prices",function(){return Wt(d,f,l,p,i)})),e.push(o("categories",function(){return(t=d).categories?(n=[],i=[],g.default(t.categories,function(t){var e;Array.isArray(t)&&(e={category:t[0]},3===t.length?3!==t[2]&&(e.action="removeFromCategory",i.push(e)):1===t.length&&(e.action="addToCategory",n.push(e)))}),i.concat(n)):[];var t,n,i})),e.push(o("categoryOrderHints",function(){return!(n=d).categoryOrderHints||Array.isArray(n.categoryOrderHints)?[]:Object.keys(n.categoryOrderHints).map(function(t){var e=n.categoryOrderHints[t],t={action:"setCategoryOrderHint",categoryId:t};return 1===e.length?t.orderHint=e[0]:2===e.length&&0!==e[1]&&(t.orderHint=e[1]),t});var n})),e.push(o("assets",function(){return r=f,o=l,a=p,u=[],(t=(t=d).variants)&&g.default(t,function(t,e){var n=E(a,e,r.variants,o.variants),i=n.oldObj,n=n.newObj;t.assets&&(x.test(e)||N.test(e))&&(e=$t(t.assets,i,n),u=u.concat(e))}),u;var t,r,o,a,u})),!0===t||!1===r?v.default(e).map(function(t){return y(y({},t),{},{staged:!1})}):v.default(e)}}function Xt(t,e){function n(t){return y(y({},t),{},{masterVariant:void 0,variants:[t.masterVariant].concat(O(t.variants||[]))})}function i(t){return t&&t.masterVariant}t=l(d(t,e),2),e=t[0],t=t[1];return[i(e)?n(e):e,i(t)?n(t):t]}var C=new RegExp(/^\d+$/),F=new RegExp(/^_\d+$/),Yt=function(t,e){return C.test(t)&&Array.isArray(e)&&e.length},te=function(t,e){return F.test(t)&&0===Number(e[2])},ee=[{action:"changeOrderState",key:"orderState"},{action:"changePaymentState",key:"paymentState"},{action:"changeShipmentState",key:"shipmentState"}];function ne(t,r,o,a){var u,s,t=t.shippingInfo;return(t=t&&t.deliveries)?(u=[],s=[],t&&g.default(t,function(t,e){var n=E(a,e,r.shippingInfo.deliveries,o.shippingInfo.deliveries),i=n.oldObj,n=n.newObj;(F.test(e)||C.test(e))&&(t=(e=l(function(t,e,n){var i=1<arguments.length&&void 0!==e?e:{},r=2<arguments.length&&void 0!==n?n:{},o=[],a=[],u=R(t,i.parcels,r.parcels);return g.default(t,function(t,e){var n=E(u,e,i.parcels,r.parcels).oldObj;Yt(e,t)?o.push(y({action:"addParcelToDelivery",deliveryId:i.id},j(t))):te(e,t)&&a.push({action:"removeParcelFromDelivery",parcelId:n.id})}),[o,a]}(t.parcels,i,n),2))[0],i=e[1],u=u.concat(t),s=s.concat(i))}),s.concat(u)):[]}function ie(t,i,r,o){var a,t=t.shippingInfo;return(t=t&&t.deliveries)?(a=[],g.default(t,function(t,e){var n=E(o,e,i.shippingInfo.deliveries,r.shippingInfo.deliveries).newObj;(F.test(e)||C.test(e))&&(e=l(function(t,e){var e=1<arguments.length&&void 0!==e?e:{},n=[];return t&&0<Object.keys(t).length&&n.push({action:"setDeliveryItems",deliveryId:e.id,deliveryKey:e.key,items:e.items}),[n]}(t.items,n),1)[0],a=a.concat(e))}),a):[]}function re(n,o){return function(i,r,a){var t,e=[];return i.shippingInfo&&i.shippingInfo.deliveries&&(t=R(i.shippingInfo.deliveries,a.shippingInfo.deliveries,r.shippingInfo.deliveries)),e.push(n("base",function(){return function(t,e,n,i){return U({actions:ee,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(i,a,r,o)})),e.push(n("deliveries",function(){return e=a,n=r,(t=(t=i).shippingInfo)?I("deliveries",b({},S,function(t){return{action:"addDelivery",items:t.items,parcels:t.parcels}}))(t,e.shippingInfo,n.shippingInfo):[];var t,e,n})),e.push(n("parcels",function(){return ne(i,a,r,t)})),e.push(n("items",function(){return ie(i,a,r,t)})),e.push(v.default(n("returnInfo",function(){return e=a,n=r,(o=(t=i).returnInfo)?I("returnInfo",b(b({},S,function(t){return t.items?[y({action:"addReturnInfo"},t)]:[]}),w,function(t,i,e){var e=o[e].items,r=void 0===e?{}:e;return 0===Object.keys(r).length?[]:Object.keys(r).reduce(function(t,e){var n=i.items[e];return r[e].shipmentState&&t.push({action:"setReturnShipmentState",returnItemId:n.id,shipmentState:n.shipmentState}),r[e].paymentState&&t.push({action:"setReturnPaymentState",returnItemId:n.id,paymentState:n.paymentState}),t},[])}))(t,e,n):[];var t,e,n,o}))),e.push(n("custom",function(){return A(i,r,a)})),v.default(e)}}var oe=[{action:"changeIsActive",key:"isActive"},{action:"changeName",key:"name"},{action:"changePredicate",key:"predicate"},{action:"changeSortOrder",key:"sortOrder"},{action:"changeValue",key:"value"},{action:"setDescription",key:"description"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"setKey",key:"key"}];var ae=["setValidFrom","setValidUntil"],ue=function(t){return ae.includes(t)};function D(t){var t=0<arguments.length&&void 0!==t?t:[],e=l(t.filter(function(t){return ue(t.action)}),2),n=e[0],e=e[1];return n&&e?[].concat(O(t.filter(function(t){return!ue(t.action)})),[{action:"setValidFromAndUntil",validFrom:n.validFrom,validUntil:e.validUntil}]):t}function se(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:oe,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)})),D(v.default(i))}}var ce=[{action:"changeIsActive",key:"isActive"},{action:"setName",key:"name"},{action:"setDescription",key:"description"},{action:"setKey",key:"key"},{action:"setCartPredicate",key:"cartPredicate"},{action:"setMaxApplications",key:"maxApplications"},{action:"setMaxApplicationsPerCustomer",key:"maxApplicationsPerCustomer"},{action:"changeCartDiscounts",key:"cartDiscounts"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"changeGroups",key:"groups"}];function de(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:ce,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)})),i.push(r("custom",function(){return A(t,e,n)})),D(v.default(i))}}var le=[{action:"changeName",key:"name"},{action:"setKey",key:"key"}];function fe(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:le,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)})),i.push(r("custom",function(){return A(t,e,n)})),v.default(i)}}var pe=[{action:"changeIsActive",key:"isActive"},{action:"changeName",key:"name"},{action:"changeCartPredicate",key:"cartPredicate"},{action:"changeSortOrder",key:"sortOrder"},{action:"changeValue",key:"value"},{action:"changeRequiresDiscountCode",key:"requiresDiscountCode"},{action:"changeTarget",key:"target"},{action:"setDescription",key:"description"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"changeStackingMode",key:"stackingMode"},{action:"setKey",key:"key"}];function he(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:pe,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)})),i.push(r("custom",function(){return A(t,e,n)})),D(v.default(i))}}var q="function"==typeof WeakSet,ye=Object.keys;function me(t,e){return t===e||t!=t&&e!=e}function ve(t){return t.constructor===Object||null==t.constructor}function ge(t){return t&&"function"==typeof t.then}function be(t){return!(!t||!t.$$typeof)}function Oe(){var e=[];return{add:function(t){e.push(t)},has:function(t){return-1!==e.indexOf(t)}}}var ke=q?function(){return new WeakSet}:Oe;function je(e){return function(t){var u=e||t;return function(t,e,n){void 0===n&&(n=ke());var i=!!t&&"object"===k(t),r=!!e&&"object"===k(e);if(i||r){var o=i&&n.has(t),a=r&&n.has(e);if(o||a)return o&&a;i&&n.add(t),r&&n.add(e)}return u(t,e,n)}}}var Ae="_owner",Se=Function.prototype.bind.call(Function.prototype.call,Object.prototype.hasOwnProperty);function Pe(t,e,n,i){var r=ye(t),o=r.length;if(ye(e).length!==o)return!1;if(o)for(var a;0<o--;){if((a=r[o])===Ae){var u=be(t),s=be(e);if((u||s)&&u!==s)return!1}if(!Se(e,a)||!n(t[a],e[a],i))return!1}return!0}var we="function"==typeof Map,Ie="function"==typeof Set;function a(t){var v="function"==typeof t?t(e):e;function e(t,e,n){var i,r,o,a,u,s,c,d,l,f,p,h,y,m;return t===e||(t&&e&&"object"===k(t)&&"object"===k(e)?ve(t)&&ve(e)?Pe(t,e,v,n):(i=Array.isArray(t),r=Array.isArray(e),i||r?i===r&&function(t,e,n,i){var r=t.length;if(e.length!==r)return!1;for(;0<r--;)if(!n(t[r],e[r],i))return!1;return!0}(t,e,v,n):(i=t instanceof Date,r=e instanceof Date,i||r?i===r&&me(t.getTime(),e.getTime()):(i=t instanceof RegExp,r=e instanceof RegExp,i||r?i===r&&(m=e,(y=t).source===m.source)&&y.global===m.global&&y.ignoreCase===m.ignoreCase&&y.multiline===m.multiline&&y.unicode===m.unicode&&y.sticky===m.sticky&&y.lastIndex===m.lastIndex:ge(t)||ge(e)?t===e:we&&(i=t instanceof Map,r=e instanceof Map,i||r)?i===r&&(d=e,l=v,f=n,(h=(y=t).size===d.size)&&y.size&&(p={},y.forEach(function(n,i){var r,o;h&&(r=!1,o=0,d.forEach(function(t,e){r||p[o]||(r=l(i,e,f)&&l(n,t,f))&&(p[o]=!0),o++}),h=r)})),h):Ie&&(i=t instanceof Set,r=e instanceof Set,i||r)?i===r&&(o=e,a=v,u=n,(c=(m=t).size===o.size)&&m.size&&(s={},m.forEach(function(e){var n,i;c&&(n=!1,i=0,o.forEach(function(t){n||s[i]||(n=a(e,t,u))&&(s[i]=!0),i++}),c=n)})),c):Pe(t,e,v,n)))):t!=t&&e!=e)}return e}var Ue=a(),Ee=(a(function(){return me}),a(je()),a(je(me)),["__typename"]);function Re(t){return t.__typename,c(t,Ee)}var Ne=[{action:"changeName",key:"name"},{action:"setKey",key:"key"},{action:"setDescription",key:"description"}];function xe(e,n){return function(i,r,o){var t=[];return t.push(e("base",function(){return function(t,e,n,i){return U({actions:Ne,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(i,o,r,n)})),t.push(e("rates",function(){return t=i,e=o,n=r,I("rates",b(b(b({},S,function(t){return{action:"addTaxRate",taxRate:t}}),P,function(t){return{action:"removeTaxRate",taxRateId:t.id}}),w,function(t,e){var n=Re(t),i=null==(i=t.subRates)?void 0:i.map(Re),n=y(y({},n),{},{subRates:i});return Ue(n,e)?null:{action:"replaceTaxRate",taxRateId:(t.id===e.id?t:e).id,taxRate:e}}))(t,e,n);var t,e,n})),v.default(t)}}var Ce=[{action:"changeName",key:"name"},{action:"setDescription",key:"description"},{action:"setKey",key:"key"}],Fe=function(t,e){return t.some(function(t){return t.country===e.country})};function De(i,r){return function(e,n,o){var t=[];return t.push(i("base",function(){return function(t,e,n,i){return U({actions:Ce,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(e,o,n,r)})),t.push(v.default(i("locations",function(){return t=e,i=o,r=n,I("locations",b(b(b({},S,function(t){return{action:"addLocation",location:t}}),P,function(t){return Fe(r.locations,t)?null:{action:"removeLocation",location:t}}),w,function(t,e){var n=[];return Fe(r.locations,t)||n.push({action:"removeLocation",location:t}),Fe(i.locations,e)||n.push({action:"addLocation",location:e}),n}))(t,i,r);var t,i,r}))),v.default(t)}}var qe=[{action:"setKey",key:"key"},{action:"changeName",key:"name"},{action:"setLocalizedName",key:"localizedName"},{action:"setDescription",key:"description"},{action:"setLocalizedDescription",key:"localizedDescription"},{action:"changeIsDefault",key:"isDefault"},{action:"setPredicate",key:"predicate"},{action:"changeTaxCategory",key:"taxCategory"},{action:"changeActive",key:"active"}];var ze=function(e){return e.shippingRates?e.shippingRates.map(function(t){return{action:"addShippingRate",zone:e.zone,shippingRate:t}}):[]};function Te(u,t,e){return I("zoneRates",b(b(b({},S,function(t){return[{action:"addZone",zone:t.zone}].concat(O(ze(t)))}),P,function(t){return{action:"removeZone",zone:t.zone}}),w,function(r,o){var a=!1,t=Object.keys(u.zoneRates).reduce(function(t,e){var n,i;return u.zoneRates[e].zone&&(a=!0),u.zoneRates[e].shippingRates?[].concat(O(t),O((e=u.zoneRates[e],n=r,i=o,I("shippingRates",b(b(b({},S,function(t){return{action:"addShippingRate",zone:i.zone,shippingRate:t}}),P,function(t){return{action:"removeShippingRate",zone:n.zone,shippingRate:t}}),w,function(t,e){return[{action:"removeShippingRate",zone:n.zone,shippingRate:t},{action:"addShippingRate",zone:i.zone,shippingRate:e}]}))(e,n,i)))):t},[]);return v.default(a?[].concat(O(t),[{action:"removeZone",zone:r.zone},{action:"addZone",zone:o.zone}]):t)}))(u,t,e)}function Me(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:qe,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)})),i.push(v.default(r("zoneRates",function(){return Te(t,n,e)}))),i.push(r("custom",function(){return A(t,e,n)})),v.default(i)}}var Ve=[{action:"changeName",key:"name"},{action:"setKey",key:"key"},{action:"changeDescription",key:"description"}];var Ke=function(r,o,t){var a=u([void 0,null,""]);return Object.entries(t).reduce(function(t,e){var e=l(e,2),n=e[0],i=e[1];if(!a(r[n])||!a(o[n])){if(!a(r[n])&&a(o[n]))return[].concat(O(t),[i]);if(!Ue(r[n],o[n]))switch(n){case"key":return[].concat(O(t),[{action:i.action,attributeName:i.attributeName,key:r[n],newKey:o[n]}]);case"attributeConstraint":case"inputHint":return[].concat(O(t),[{action:i.action,attributeName:i.attributeName,newValue:o[n]}]);default:return[].concat(O(t),[b({action:i.action,attributeName:i.attributeName},n,o[n])])}}return t},[])},Le=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=t.filter(function(t){return t.previous&&!t.next}),n=t.filter(function(t){return t.previous&&t.next}),t=t.filter(function(t){return!t.previous&&t.next});return[].concat(O(e.map(function(t){return{action:"removeAttributeDefinition",name:t.previous.name}})),O(v.default(n.map(function(t){return Ke(t.previous,t.next,{label:{action:"changeLabel",attributeName:t.previous.name},inputTip:{action:"setInputTip",attributeName:t.previous.name},inputHint:{action:"changeInputHint",attributeName:t.previous.name},isSearchable:{action:"changeIsSearchable",attributeName:t.previous.name},attributeConstraint:{action:"changeAttributeConstraint",attributeName:t.previous.name}})}))),O(t.map(function(t){return{action:"addAttributeDefinition",attribute:t.next}})))},Be=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=t.filter(function(t){return t.previous&&!t.next}),n=t.filter(function(t){return t.next&&t.previous}),t=t.filter(function(t){return!t.previous&&t.next});return[].concat(O(Object.values(e.reduce(function(t,e){var n=t[e.hint.attributeName]||{keys:[],attributeName:e.hint.attributeName,action:"removeEnumValues"};return y(y({},t),{},b({},e.hint.attributeName,y(y({},n),{},{keys:[].concat(O(n.keys),[e.previous.key])})))},{}))),O(v.default(n.map(function(t){var e=Ke(t.previous,t.next,{key:{action:"changeEnumKey",attributeName:t.hint.attributeName}});return Ue(t.previous.label,t.next.label)?e:t.hint.isLocalized?[].concat(O(e),[{action:"changeLocalizedEnumValueLabel",attributeName:t.hint.attributeName,newValue:t.next}]):[].concat(O(e),[{action:"changePlainEnumValueLabel",attributeName:t.hint.attributeName,newValue:t.next}])}))),O(t.map(function(t){return{action:t.hint.isLocalized?"addLocalizedEnumValue":"addPlainEnumValue",attributeName:t.hint.attributeName,value:t.next}})))},He=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return t.length&&n.length&&(n=n.map(function(t){return t.name}),e=i.filter(function(t){return"removeAttributeDefinition"===t.action}).map(function(t){return t.name}),i=i.filter(function(t){return"addAttributeDefinition"===t.action}).map(function(t){return t.attribute.name}),t=t.map(function(t){return t.name}).filter(function(t){return!e.includes(t)}).concat(i),n.join(",")!==t.join(","))?{action:"changeAttributeOrderByName",attributeNames:n}:null},_e=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0,t=[].concat(O(Le(t.attributeDefinitions)),O(Be(t.attributeEnumValues))),e=He(e.attributes,n.attributes,t);return e&&t.push(e),t};function $e(r,o){return function(t,e,n,i){return v.default([r("base",function(){return function(t,e,n,i){return i=3<arguments.length&&void 0!==i?i:{},t?U({diff:t,actions:Ve,oldObj:e,newObj:n,shouldOmitEmptyString:i.shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties}):[]}(t,n,e,o)}),_e(i.nestedValuesChanges,n,e)])}}var Ge=[{action:"changeKey",key:"key"},{action:"setName",key:"name"},{action:"setDescription",key:"description"},{action:"changeType",key:"type"},{action:"changeInitial",key:"initial"},{action:"setTransitions",key:"transitions"}];function Ze(u,s){return function(i,r,o){var e,n,t=[],a=[];return t.push(u("base",function(){return function(t,e,n,i){return U({actions:Ge,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(i,o,r,s)})),a.push(u("roles",function(){return t=i,e=o,n=r,I("roles",b(b({},S,function(t){return{action:"addRoles",roles:t}}),P,function(t){return{action:"removeRoles",roles:t}}))(t,e,n);var t,e,n})),v.default([].concat(t,O((t=l(t=a,1)[0],e=[],n=[],t.forEach(function(t){"removeRoles"===t.action&&n.push(t.roles),"addRoles"===t.action&&e.push(t.roles)}),[{action:"removeRoles",roles:n},{action:"addRoles",roles:e}].filter(function(t){return t.roles.length})))))}}var We=[{action:"changeKey",key:"key"},{action:"changeName",key:"name"},{action:"changeDescription",key:"description"},{action:"setAddress",key:"address"},{action:"setGeoLocation",key:"geoLocation"},{action:"setRoles",key:"roles"}];function Je(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:We,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)})),i.push(r("custom",function(){return A(t,e,n)})),v.default(i)}}var Qe=new RegExp(/^\d+$/),Xe=new RegExp(/^_\d+$/),Ye=function(t){return Qe.test(t)},tn=function(t){return Xe.test(t)},en=[{action:"changeKey",key:"key"},{action:"changeName",key:"name"},{action:"setDescription",key:"description"}];function nn(t,p,h,y){var m=[];return g.default(t,function(t,e){var o,n,i,a,u,s,c,d,r,l,f=E(y,e,p,h);Ye(e)?Array.isArray(t)?(n=j(t)).name&&m.push({action:"addFieldDefinition",fieldDefinition:n}):t.label?m.push({action:"changeLabel",label:f.newObj.label,fieldName:f.oldObj.name}):t.inputHint?m.push({action:"changeInputHint",inputHint:f.newObj.inputHint,fieldName:f.oldObj.name}):null!=t&&null!=(n=t.type)&&n.values&&m.push.apply(m,O((o=f.oldObj.name,n=f.oldObj.type.name,i=t.type,a=f.oldObj.type,u=f.newObj.type,s="Enum"===n?"addEnumValue":"addLocalizedEnumValue",c="Enum"===n?"changeEnumValueLabel":"changeLocalizedEnumValueLabel",d="Enum"===n?"changeEnumValueOrder":"changeLocalizedEnumValueOrder",n=I("values",b(b({},S,function(t){return{fieldName:o,action:s,value:t}}),w,function(e,n){var t,i,r=[];return u.values.find(function(t){return t.key===e.key})?(t=e.key!==n.key,i=a.values.find(function(t){return t.key===n.key}),i=_.default(i.label,n.label),t&&r.push({fieldName:o,action:d,value:n}),i||r.push({fieldName:o,action:c,value:n})):r.push({fieldName:o,action:s,value:n}),r})),r=[],l=[],v.default(n(i,a,u)).forEach(function(t){t.action===d?l=u.values.map(function(t){return t.key}):r.push(t)}),[].concat(r,O(0<l.length?[{fieldName:o,action:d,keys:l}]:[]))))):tn(e)&&Array.isArray(t)&&(3===t.length&&3===t[2]?m.push({action:"changeFieldDefinitionOrder",fieldNames:h.map(function(t){return t.name})}):void 0===j(t)&&t[0].name&&m.push({action:"removeFieldDefinition",fieldName:t[0].name}))}),W.default(m,function(t){return"removeFieldDefinition"!==t.action})}function rn(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:en,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,o)}),r("fieldDefinitions",function(){return nn(t.fieldDefinitions,n.fieldDefinitions,e.fieldDefinitions,R(t.fieldDefinitions,n.fieldDefinitions,e.fieldDefinitions,"name"))})),v.default(i)}}var on=[{action:"changeName",key:"name"},{action:"changeCurrencies",key:"currencies"},{action:"changeCountries",key:"countries"},{action:"changeLanguages",key:"languages"},{action:"changeMessagesConfiguration",key:"messagesConfiguration"},{action:"setShippingRateInputType",key:"shippingRateInputType"}],an=[{action:"changeMyBusinessUnitStatusOnCreation",key:"myBusinessUnitStatusOnCreation",actionKey:"status"},{action:"setMyBusinessUnitAssociateRoleOnCreation",key:"myBusinessUnitAssociateRoleOnCreation",actionKey:"associateRole"}],un=[{action:"changeCustomerSearchStatus",key:"status"}];var sn=function(t,e,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},t=t.businessUnits;return t?U({actions:an,diff:t,oldObj:e.businessUnits,newObj:n.businessUnits,shouldOmitEmptyString:i.shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties}):[]};function cn(r,o){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:on,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString})}(t,n,e,o)})),i.push(r("businessUnit",function(){return sn(t,n,e)})),i.push(r("searchIndexingConfiguration",function(){return function(t,e,n,i){var i=3<arguments.length&&void 0!==i?i:{},r=t.searchIndexing;return r&&r.customers?U({actions:un,diff:t.searchIndexing.customers,oldObj:e.searchIndexing.customers,newObj:n.searchIndexing.customers,shouldOmitEmptyString:i.shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields}):[]}(t,n,e)})),v.default(i)}}var dn=[{action:"setName",key:"name"},{action:"setLanguages",key:"languages"},{action:"setDistributionChannels",key:"distributionChannels"},{action:"setSupplyChannels",key:"supplyChannels"}];function ln(r){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:dn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e)})),i.push(r("custom",function(){return A(t,e,n)})),v.default(i)}}var fn=[{action:"changeName",key:"name"},{action:"setKey",key:"key"}];function pn(r){return function(t,e,n){var i=[];return i.push(r("base",function(){return function(t,e,n,i){return U({actions:fn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e)})),i.push(r("custom",function(){return A(t,e,n)})),v.default(i)}}var hn=[{action:"changeValue",key:"value"},{action:"setDiscountedPrice",key:"discounted"},{action:"setPriceTiers",key:"tiers"},{action:"setKey",key:"key"},{action:"setValidFrom",key:"validFrom"},{action:"setValidUntil",key:"validUntil"},{action:"changeActive",key:"active"}];function yn(o,a){return function(t,e,n){var i=o("base",function(){return function(t,e,n,i){return U({actions:hn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(t,n,e,a)}),r=o("custom",function(){return A(t,e,n)});return D([].concat(O(i),O(r)))}}var mn=function(t,e){return t.some(function(t){return t.key===e.key})},vn=[{action:"changeName",key:"name"},{action:"setKey",key:"key"},{action:"setDescription",key:"description"}];function gn(i,r){return function(e,n,o){var t=[];return t.push(i("base",function(){return function(t,e,n,i){return U({actions:vn,diff:t,oldObj:e,newObj:n,shouldOmitEmptyString:(i=3<arguments.length&&void 0!==i?i:{}).shouldOmitEmptyString,shouldUnsetOmittedProperties:i.shouldUnsetOmittedProperties,shouldPreventUnsettingRequiredFields:i.shouldPreventUnsettingRequiredFields})}(e,o,n,r)})),t.push(v.default(i("attributes",function(){return t=e,i=o,r=n,I("attributes",b(b(b({},S,function(t){return{action:"addAttribute",attribute:t}}),P,function(t){return mn(r.attributes,t)?null:{action:"removeAttribute",attribute:t}}),w,function(t,e){var n=[];return mn(r.attributes,t)||n.push({action:"removeAttribute",attribute:t}),mn(i.attributes,e)||n.push({action:"addAttribute",attribute:e}),n}))(t,i,r);var t,i,r}))),v.default(t)}}t.createSyncAttributeGroups=function(t,e){return{buildActions:n(o,gn(r(t),e))}},t.createSyncCartDiscounts=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:n(o,he(r(t),e))}},t.createSyncCategories=function(t,e){return{buildActions:n(o,jt(r(t),e),d)}},t.createSyncChannels=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:n(o,Je(r(t),e))}},t.createSyncCustomerGroup=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:n(o,fe(r(t),e))}},t.createSyncCustomers=function(t,e){return{buildActions:n(o,Et(r(t),e),d)}},t.createSyncDiscountCodes=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:n(o,de(r(t),e))}},t.createSyncInventories=function(t,e){return{buildActions:n(o,xt(r(t),e))}},t.createSyncOrders=function(t,e){return{buildActions:n(o,re(r(t),e))}},t.createSyncProductDiscounts=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:n(o,se(r(t),e))}},t.createSyncProductSelections=function(t){return{buildActions:n(o,pn(r(t)),null)}},t.createSyncProductTypes=function(t,e){return{buildActions:n(o,$e(r(t),e),null,{withHints:!0})}},t.createSyncProducts=function(t,e){return{buildActions:n(o,Qt(r(t),e),Xt)}},t.createSyncProjects=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:n(o,cn(r(t),e))}},t.createSyncShippingMethods=function(t,e){return{buildActions:n(o,Me(r(t),e))}},t.createSyncStandalonePrices=function(t,e){return{buildActions:n(o,yn(r(t),e))}},t.createSyncStates=function(t,e){return{buildActions:n(o,Ze(r(t),e))}},t.createSyncStores=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return{buildActions:n(o,ln(r(t)),null,e)}},t.createSyncTaxCategories=function(t,e){return{buildActions:n(o,xe(r(t),e))}},t.createSyncTypes=function(t,e){return{buildActions:n(o,rn(r(t),e))}},t.createSyncZones=function(t,e){return{buildActions:n(o,De(r(t),e))}},Object.defineProperty(t,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "node": ">=14"
8
8
  },
9
9
  "name": "@commercetools/sync-actions",
10
- "version": "6.0.0",
10
+ "version": "6.1.1",
11
11
  "description": "Build API update actions for the commercetools platform.",
12
12
  "keywords": [
13
13
  "commercetools",