!function(){var t={487:function(t){var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=e},184:function(t,e){var r;
/*!
  Copyright (c) 2017 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&t.push(a)}else if("object"===i)for(var u in r)n.call(r,u)&&r[u]&&t.push(u)}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()},12:function(t){var e,r;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=r.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},t.exports=r},738:function(t){function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},568:function(t,e,r){var n,o,i,a,u;n=r(12),o=r(487).utf8,i=r(738),a=r(487).bin,(u=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?a.stringToBytes(t):o.stringToBytes(t):i(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var r=n.bytesToWords(t),c=8*t.length,s=1732584193,l=-271733879,f=-1732584194,p=271733878,h=0;h<r.length;h++)r[h]=16711935&(r[h]<<8|r[h]>>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[c>>>5]|=128<<c%32,r[14+(c+64>>>9<<4)]=c;var m=u._ff,y=u._gg,d=u._hh,v=u._ii;for(h=0;h<r.length;h+=16){var g=s,b=l,w=f,x=p;s=m(s,l,f,p,r[h+0],7,-680876936),p=m(p,s,l,f,r[h+1],12,-389564586),f=m(f,p,s,l,r[h+2],17,606105819),l=m(l,f,p,s,r[h+3],22,-1044525330),s=m(s,l,f,p,r[h+4],7,-176418897),p=m(p,s,l,f,r[h+5],12,1200080426),f=m(f,p,s,l,r[h+6],17,-1473231341),l=m(l,f,p,s,r[h+7],22,-45705983),s=m(s,l,f,p,r[h+8],7,1770035416),p=m(p,s,l,f,r[h+9],12,-1958414417),f=m(f,p,s,l,r[h+10],17,-42063),l=m(l,f,p,s,r[h+11],22,-1990404162),s=m(s,l,f,p,r[h+12],7,1804603682),p=m(p,s,l,f,r[h+13],12,-40341101),f=m(f,p,s,l,r[h+14],17,-1502002290),s=y(s,l=m(l,f,p,s,r[h+15],22,1236535329),f,p,r[h+1],5,-165796510),p=y(p,s,l,f,r[h+6],9,-1069501632),f=y(f,p,s,l,r[h+11],14,643717713),l=y(l,f,p,s,r[h+0],20,-373897302),s=y(s,l,f,p,r[h+5],5,-701558691),p=y(p,s,l,f,r[h+10],9,38016083),f=y(f,p,s,l,r[h+15],14,-660478335),l=y(l,f,p,s,r[h+4],20,-405537848),s=y(s,l,f,p,r[h+9],5,568446438),p=y(p,s,l,f,r[h+14],9,-1019803690),f=y(f,p,s,l,r[h+3],14,-187363961),l=y(l,f,p,s,r[h+8],20,1163531501),s=y(s,l,f,p,r[h+13],5,-1444681467),p=y(p,s,l,f,r[h+2],9,-51403784),f=y(f,p,s,l,r[h+7],14,1735328473),s=d(s,l=y(l,f,p,s,r[h+12],20,-1926607734),f,p,r[h+5],4,-378558),p=d(p,s,l,f,r[h+8],11,-2022574463),f=d(f,p,s,l,r[h+11],16,1839030562),l=d(l,f,p,s,r[h+14],23,-35309556),s=d(s,l,f,p,r[h+1],4,-1530992060),p=d(p,s,l,f,r[h+4],11,1272893353),f=d(f,p,s,l,r[h+7],16,-155497632),l=d(l,f,p,s,r[h+10],23,-1094730640),s=d(s,l,f,p,r[h+13],4,681279174),p=d(p,s,l,f,r[h+0],11,-358537222),f=d(f,p,s,l,r[h+3],16,-722521979),l=d(l,f,p,s,r[h+6],23,76029189),s=d(s,l,f,p,r[h+9],4,-640364487),p=d(p,s,l,f,r[h+12],11,-421815835),f=d(f,p,s,l,r[h+15],16,530742520),s=v(s,l=d(l,f,p,s,r[h+2],23,-995338651),f,p,r[h+0],6,-198630844),p=v(p,s,l,f,r[h+7],10,1126891415),f=v(f,p,s,l,r[h+14],15,-1416354905),l=v(l,f,p,s,r[h+5],21,-57434055),s=v(s,l,f,p,r[h+12],6,1700485571),p=v(p,s,l,f,r[h+3],10,-1894986606),f=v(f,p,s,l,r[h+10],15,-1051523),l=v(l,f,p,s,r[h+1],21,-2054922799),s=v(s,l,f,p,r[h+8],6,1873313359),p=v(p,s,l,f,r[h+15],10,-30611744),f=v(f,p,s,l,r[h+6],15,-1560198380),l=v(l,f,p,s,r[h+13],21,1309151649),s=v(s,l,f,p,r[h+4],6,-145523070),p=v(p,s,l,f,r[h+11],10,-1120210379),f=v(f,p,s,l,r[h+2],15,718787259),l=v(l,f,p,s,r[h+9],21,-343485551),s=s+g>>>0,l=l+b>>>0,f=f+w>>>0,p=p+x>>>0}return n.endian([s,l,f,p])})._ff=function(t,e,r,n,o,i,a){var u=t+(e&r|~e&n)+(o>>>0)+a;return(u<<i|u>>>32-i)+e},u._gg=function(t,e,r,n,o,i,a){var u=t+(e&n|r&~n)+(o>>>0)+a;return(u<<i|u>>>32-i)+e},u._hh=function(t,e,r,n,o,i,a){var u=t+(e^r^n)+(o>>>0)+a;return(u<<i|u>>>32-i)+e},u._ii=function(t,e,r,n,o,i,a){var u=t+(r^(e|~n))+(o>>>0)+a;return(u<<i|u>>>32-i)+e},u._blocksize=16,u._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(u(t,e));return e&&e.asBytes?r:e&&e.asString?a.bytesToString(r):n.bytesToHex(r)}},61:function(t,e,r){var n=r(698).default;function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new N(n||[]);return u(i,"_invoke",{value:k(t,r,a)}),i}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var y="suspendedStart",d="suspendedYield",v="executing",g="completed",b={};function w(){}function x(){}function _(){}var O={};p(O,s,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(B([])));j&&j!==i&&a.call(j,s)&&(O=j);var E=_.prototype=w.prototype=Object.create(O);function T(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,u,c){var s=m(t[o],t,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return r("throw",t,u,c)}))}c(s.arg)}var o;u(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=A(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=m(t,r,n);if("normal"===s.type){if(o=n.done?g:d,s.arg===b)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function A(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=m(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function B(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return x.prototype=_,u(E,"constructor",{value:_,configurable:!0}),u(_,"constructor",{value:x,configurable:!0}),x.displayName=p(_,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,p(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},T(L.prototype),p(L.prototype,l,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new L(h(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(E),p(E,f,"Generator"),p(E,s,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=B,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:B(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},r}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},698:function(t){function e(r){return t.exports=e="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.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:function(t,e,r){var n=r(61)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function e(e,r){if(e){if("string"==typeof e)return t(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}function n(r){return function(e){if(Array.isArray(e))return t(e)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||e(r)||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.")}()}var o=window.wp.i18n,i=window.wp.element,a=window.blocksyOptions,u=window.jQuery,c=r.n(u);function s(t){return s="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},s(t)}function l(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s(e)?e:e+""}function f(t,e,r){return(e=l(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){p(i,n,o,a,u,"next",t)}function u(t){p(i,n,o,a,u,"throw",t)}a(void 0)}))}}function m(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,r)||e(t,r)||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.")}()}var y=r(687),d=r.n(y),v=window.ctEvents,g=r.n(v),b=r(184),w=r.n(b),x=r(568),_=r.n(x);function O(t){if(Array.isArray(t))return"[".concat(t.map((function(t){return O(t)})).join(","),"]");if("object"===s(t)&&null!==t){var e="",r=Object.keys(t).sort();e+="{".concat(JSON.stringify(r));for(var n=0;n<r.length;n++)e+="".concat(O(t[r[n]]),",");return"".concat(e,"}")}return"".concat(JSON.stringify(t))}var S=function(t){return _()(O(t))};function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var T={},L=function(){var t=m((0,i.useState)({itemTitle:"Name",itemId:null,depth:0,data:null,parentData:null}),2),e=t[0],r=t[1],n=m((0,i.useState)(null),2),u=n[0],c=n[1],s=m((0,i.useState)(!1),2),l=s[0],p=s[1],y=(0,i.useMemo)((function(){return u||e.data}),[u,e.data]),v=(0,i.useMemo)((function(){return!(!e.itemId||!y)}),[e.itemId,y]),b=(0,i.useRef)(),x=function(){var t=h(d().mark((function t(e,r,n){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:T[S({itemId:e,depth:n})]=r,p(!0),fetch("".concat(wp.ajax.settings.url,"?action=blocksy_ext_mega_menu_update_nav_item_setting&item_id=").concat(e),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(r)}).then((function(){setTimeout((function(){p(!1)}),500)}));case 3:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),_=function(){var t=h(d().mark((function t(e,n,o){var i,a,u,s,l,f,p,h;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c(null),i="",n>=1&&(a=document.querySelector("#menu-item-".concat(e)),(u=jQuery(a).prevAll(".menu-item-depth-0")[0])&&(i=u.id.replace("menu-item-",""))),s=S({itemId:e,depth:n}),l=S({itemId:i,depth:0}),!T[s]){t.next=10;break}return r((function(t){return E(E({},t),{},{itemTitle:o,itemId:e,depth:n,data:T[s]},i&&T[l]?{parentData:T[l]}:{})})),t.abrupt("return");case 10:r((function(t){return E(E({},t),{},{itemTitle:o,itemId:e,depth:n,data:null,parentData:null})}));case 11:return(f=new FormData).append("action","blocksy_ext_mega_menu_get_nav_item_settings"),f.append("item_id",e),i&&f.append("parent_item_id",i),t.next=17,fetch(wp.ajax.settings.url,{method:"POST",body:f});case 17:if(200!==(p=t.sent).status){t.next=23;break}return t.next=21,p.json();case 21:(h=t.sent).success&&(h.data.additional_items&&Object.keys(h.data.additional_items).map((function(t){T[S({itemId:t.toString(),depth:0})]=h.data.additional_items[t]})),T[s]=h.data.settings,r((function(t){return E(E({},t),{},{itemTitle:o,itemId:e,depth:n,data:T[s]},i&&T[l]?{parentData:T[l]}:{})})));case 23:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();(0,i.useEffect)((function(){g().on("blocksy:mega-menu:edit-item-settings",(function(t){var e=t.itemId,r=t.depth,n=t.itemTitle;e&&_(e,r,n)}))}),[]);var O=function(){r((function(t){return E(E({},t),{},{itemId:null})}))};return(0,i.createElement)("div",null,(0,i.createElement)(a.Overlay,{items:v,className:"ct-admin-modal ct-mega-menu-modal",initialFocusRef:b,onDismiss:function(){u||O()},onCloseButtonClick:function(){O()},render:function(){return(0,i.createElement)("div",{className:"ct-modal-content",ref:b},(0,i.createElement)("h2",null,e.itemTitle," -"," ",(0,o.__)("Item Settings","blocksy-companion")),null,(0,i.createElement)("div",{className:"ct-options-container ct-tabs-scroll"},(0,i.createElement)(a.OptionsPanel,{onChange:function(t,e){c((function(r){return E(E({},r||y),{},f({},t,e))}))},options:blocksy_ext_mega_menu_localization.mega_menu_options,value:E(E(E({},Array.isArray(y)||!y?{}:y),e.parentData?{parentData:e.parentData}:{}),{},{menu_item_level:e.depth+1}),hasRevertButton:!1})),(0,i.createElement)("div",{className:"ct-modal-actions has-divider"},(0,i.createElement)("button",{className:w()("button-primary ct-large-button"),disabled:l||!u,onClick:function(){x(e.itemId,y,e.depth),r((function(t){return E(E({},t),{},{data:y})})),c(null)}},l?(0,i.createElement)("svg",{width:"15",height:"15",viewBox:"0 0 100 100"},(0,i.createElement)("g",{transform:"translate(50,50)"},(0,i.createElement)("g",{transform:"scale(1)"},(0,i.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"#687c93"}),(0,i.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"#ffffff",transform:"rotate(161.634)"},(0,i.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))))):(0,o.__)("Save Settings","blocksy-companion"))))}}))};(0,a.onDocumentLoaded)((function(){var t=document.createElement("div");document.body.appendChild(t),(0,i.createRoot)(t).render((0,i.createElement)(L,null))})),c()(document).on("click.ctMegaMenu",".blocksy-mega-menu-trigger",(function(t){t.preventDefault();var e=t.target.closest(".blocksy-mega-menu-trigger");g().trigger("blocksy:mega-menu:edit-item-settings",{el:e,depth:parseFloat(n(t.target.closest(".menu-item").classList).find((function(t){return t.indexOf("menu-item-depth")>-1})).replace("menu-item-depth-","")),itemTitle:t.target.closest(".menu-item").querySelector(".edit-menu-item-title").value,itemId:e.dataset.itemId})}))}()}();