"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t0&&e.every(function(e){return e&&"string"==typeof e.Name&&"number"==typeof e.Type&&"number"==typeof e.Index})};exports.isValidMenuList=isValidMenuList;var keepPrevConfigWhenEmpty=function(e,t,r){return isEmptyPlainObject(null==e?void 0:e[t])?_objectSpread(_objectSpread({},e),{},_defineProperty({},t,cloneJsonValue(r))):e};exports.keepPrevConfigWhenEmpty=keepPrevConfigWhenEmpty;var mergeFrontierBase=function e(t,r){return isPlainObject(t)&&isPlainObject(r)?(Object.keys(r).forEach(function(n){var i=r[n];if(null!=i){if(!Array.isArray(i))return isPlainObject(i)?(isPlainObject(t[n])||(t[n]={}),void e(t[n],i)):void(t[n]=i);t[n]=cloneJsonValue(i)}}),t):t};exports.mergeFrontierBase=mergeFrontierBase;var shouldReplaceWithEmptyObject=function(e,t){return!!isPlainObject(e)&&isEmptyPlainObject(e[t])},syncExplicitEmptyMenus=function(e,t){isPlainObject(e)&&isPlainObject(t)&&["Product","ProductV2"].forEach(function(r){shouldReplaceWithEmptyObject(e,r)&&(t[r]={})})};exports.syncExplicitEmptyMenus=syncExplicitEmptyMenus;var getPatchOperation=function(e){var t,r;return String(null!==(t=null!==(r=null==e?void 0:e.Op)&&void 0!==r?r:null==e?void 0:e.op)&&void 0!==t?t:"").toLowerCase()},getPatchPath=function(e){var t,r;return String(null!==(t=null!==(r=null==e?void 0:e.Path)&&void 0!==r?r:null==e?void 0:e.path)&&void 0!==t?t:"").trim()},getPatchValue=function(e){var t;return null!==(t=null==e?void 0:e.Value)&&void 0!==t?t:null==e?void 0:e.value},parseJsonPath=function(e){var t=String(e||"").trim();if(!t.startsWith("$"))return null;for(var r=1,n=[],i=function(){for(;r=t.length)return!1;var e=t[r];if("*"===e)return r+=1,i(),"]"===t[r]&&(r+=1,n.push({kind:"wildcard"}),!0);if('"'===e||"'"===e){var o=e;r+=1;for(var a="";r=t.length)return!1;a+=t[r],r+=1}}return!1}for(var l=r;r=t.length)return null;if("*"===t[r]){r+=1,n.push({kind:"wildcard"});continue}for(var u=r;r