Changeset 3261172
- Timestamp:
- 03/25/2025 03:07:07 AM (12 months ago)
- Location:
- menu-manager-ultra/trunk
- Files:
-
- 14 edited
-
build/index.asset.php (modified) (1 diff)
-
build/index.js (modified) (1 diff)
-
menu-manager-ultra.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
-
src/API/Endpoints/MenuItems.php (modified) (16 diffs)
-
src/API/Endpoints/Posts.php (modified) (1 diff)
-
src/API/Endpoints/Taxonomy.php (modified) (1 diff)
-
src/lib/Constants.php (modified) (1 diff)
-
src/lib/MenuItem/MenuItemFormatter.php (modified) (2 diffs)
-
src/lib/MenuItems/ArrayOperations.php (modified) (2 diffs)
-
src/script/components/SaveBar.js (modified) (2 diffs)
-
src/script/services/MenuItemService.js (modified) (2 diffs)
-
src/util/menu-manager-array-utils.php (modified) (3 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
menu-manager-ultra/trunk/build/index.asset.php
r3245090 r3261172 1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-url'), 'version' => 'c e1a263d6a3e32381e67');1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-url'), 'version' => 'c25a61a1a9a48ff6d1e5'); -
menu-manager-ultra/trunk/build/index.js
r3245090 r3261172 1 !function(){var e={487:function(e){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=t},184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},12:function(e){var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}},e.exports=n},227:function(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=""),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(447)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},447:function(e,t,n){e.exports=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},875:function(e,t,n){var r;!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},738:function(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},568:function(e,t,n){var r,o,i,a,s;r=n(12),o=n(487).utf8,i=n(738),a=n(487).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):o.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=r.bytesToWords(e),l=8*e.length,c=1732584193,u=-271733879,d=-1732584194,f=271733878,p=0;p<n.length;p++)n[p]=16711935&(n[p]<<8|n[p]>>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[l>>>5]|=128<<l%32,n[14+(l+64>>>9<<4)]=l;var m=s._ff,h=s._gg,v=s._hh,g=s._ii;for(p=0;p<n.length;p+=16){var y=c,b=u,w=d,C=f;c=m(c,u,d,f,n[p+0],7,-680876936),f=m(f,c,u,d,n[p+1],12,-389564586),d=m(d,f,c,u,n[p+2],17,606105819),u=m(u,d,f,c,n[p+3],22,-1044525330),c=m(c,u,d,f,n[p+4],7,-176418897),f=m(f,c,u,d,n[p+5],12,1200080426),d=m(d,f,c,u,n[p+6],17,-1473231341),u=m(u,d,f,c,n[p+7],22,-45705983),c=m(c,u,d,f,n[p+8],7,1770035416),f=m(f,c,u,d,n[p+9],12,-1958414417),d=m(d,f,c,u,n[p+10],17,-42063),u=m(u,d,f,c,n[p+11],22,-1990404162),c=m(c,u,d,f,n[p+12],7,1804603682),f=m(f,c,u,d,n[p+13],12,-40341101),d=m(d,f,c,u,n[p+14],17,-1502002290),c=h(c,u=m(u,d,f,c,n[p+15],22,1236535329),d,f,n[p+1],5,-165796510),f=h(f,c,u,d,n[p+6],9,-1069501632),d=h(d,f,c,u,n[p+11],14,643717713),u=h(u,d,f,c,n[p+0],20,-373897302),c=h(c,u,d,f,n[p+5],5,-701558691),f=h(f,c,u,d,n[p+10],9,38016083),d=h(d,f,c,u,n[p+15],14,-660478335),u=h(u,d,f,c,n[p+4],20,-405537848),c=h(c,u,d,f,n[p+9],5,568446438),f=h(f,c,u,d,n[p+14],9,-1019803690),d=h(d,f,c,u,n[p+3],14,-187363961),u=h(u,d,f,c,n[p+8],20,1163531501),c=h(c,u,d,f,n[p+13],5,-1444681467),f=h(f,c,u,d,n[p+2],9,-51403784),d=h(d,f,c,u,n[p+7],14,1735328473),c=v(c,u=h(u,d,f,c,n[p+12],20,-1926607734),d,f,n[p+5],4,-378558),f=v(f,c,u,d,n[p+8],11,-2022574463),d=v(d,f,c,u,n[p+11],16,1839030562),u=v(u,d,f,c,n[p+14],23,-35309556),c=v(c,u,d,f,n[p+1],4,-1530992060),f=v(f,c,u,d,n[p+4],11,1272893353),d=v(d,f,c,u,n[p+7],16,-155497632),u=v(u,d,f,c,n[p+10],23,-1094730640),c=v(c,u,d,f,n[p+13],4,681279174),f=v(f,c,u,d,n[p+0],11,-358537222),d=v(d,f,c,u,n[p+3],16,-722521979),u=v(u,d,f,c,n[p+6],23,76029189),c=v(c,u,d,f,n[p+9],4,-640364487),f=v(f,c,u,d,n[p+12],11,-421815835),d=v(d,f,c,u,n[p+15],16,530742520),c=g(c,u=v(u,d,f,c,n[p+2],23,-995338651),d,f,n[p+0],6,-198630844),f=g(f,c,u,d,n[p+7],10,1126891415),d=g(d,f,c,u,n[p+14],15,-1416354905),u=g(u,d,f,c,n[p+5],21,-57434055),c=g(c,u,d,f,n[p+12],6,1700485571),f=g(f,c,u,d,n[p+3],10,-1894986606),d=g(d,f,c,u,n[p+10],15,-1051523),u=g(u,d,f,c,n[p+1],21,-2054922799),c=g(c,u,d,f,n[p+8],6,1873313359),f=g(f,c,u,d,n[p+15],10,-30611744),d=g(d,f,c,u,n[p+6],15,-1560198380),u=g(u,d,f,c,n[p+13],21,1309151649),c=g(c,u,d,f,n[p+4],6,-145523070),f=g(f,c,u,d,n[p+11],10,-1120210379),d=g(d,f,c,u,n[p+2],15,718787259),u=g(u,d,f,c,n[p+9],21,-343485551),c=c+y>>>0,u=u+b>>>0,d=d+w>>>0,f=f+C>>>0}return r.endian([c,u,d,f])})._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(s(e,t));return t&&t.asBytes?n:t&&t.asString?a.bytesToString(n):r.bytesToHex(n)}},824:function(e){var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,a){a=a||{};var s,l,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===c&&isFinite(e))return a.long?(s=e,(l=Math.abs(s))>=o?i(s,l,o,"day"):l>=r?i(s,l,r,"hour"):l>=n?i(s,l,n,"minute"):l>=t?i(s,l,t,"second"):s+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},703:function(e,t,n){"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},697:function(e,t,n){e.exports=n(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},921:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),h=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case s:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case h:case m:case l:return e;default:return t}}case o:return t}}}t.isMemo=function(e){return v(e)===m}},864:function(e,t,n){"use strict";e.exports=n(921)},871:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,s=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?s="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==s){var l=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+l+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return a}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},983:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(196),a=m(i),s=m(n(850)),l=m(n(697)),c=m(n(747)),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(149)),d=n(112),f=m(d),p=n(871);function m(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=t.portalClassName="ReactModalPortal",y=t.bodyOpenClassName="ReactModal__Body--open",b=d.canUseDOM&&void 0!==s.default.createPortal,w=function(e){return document.createElement(e)},C=function(){return b?s.default.createPortal:s.default.unstable_renderSubtreeIntoContainer};function E(e){return e()}var x=function(e){function t(){var e,n,o;h(this,t);for(var i=arguments.length,l=Array(i),u=0;u<i;u++)l[u]=arguments[u];return n=o=v(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),o.removePortal=function(){!b&&s.default.unmountComponentAtNode(o.node);var e=E(o.props.parentSelector);e&&e.contains(o.node)?e.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(e){o.portal=e},o.renderPortal=function(e){var n=C()(o,a.default.createElement(c.default,r({defaultStyles:t.defaultStyles},e)),o.node);o.portalRef(n)},v(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){d.canUseDOM&&(b||(this.node=w("div")),this.node.className=this.props.portalClassName,E(this.props.parentSelector).appendChild(this.node),!b&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:E(e.parentSelector),nextParent:E(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(d.canUseDOM){var r=this.props,o=r.isOpen,i=r.portalClassName;e.portalClassName!==i&&(this.node.className=i);var a=n.prevParent,s=n.nextParent;s!==a&&(a.removeChild(this.node),s.appendChild(this.node)),(e.isOpen||o)&&!b&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(d.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return d.canUseDOM&&b?(!this.node&&b&&(this.node=w("div")),C()(a.default.createElement(c.default,r({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){u.setElement(e)}}]),t}(i.Component);x.propTypes={isOpen:l.default.bool.isRequired,style:l.default.shape({content:l.default.object,overlay:l.default.object}),portalClassName:l.default.string,bodyOpenClassName:l.default.string,htmlOpenClassName:l.default.string,className:l.default.oneOfType([l.default.string,l.default.shape({base:l.default.string.isRequired,afterOpen:l.default.string.isRequired,beforeClose:l.default.string.isRequired})]),overlayClassName:l.default.oneOfType([l.default.string,l.default.shape({base:l.default.string.isRequired,afterOpen:l.default.string.isRequired,beforeClose:l.default.string.isRequired})]),appElement:l.default.oneOfType([l.default.instanceOf(f.default),l.default.instanceOf(d.SafeHTMLCollection),l.default.instanceOf(d.SafeNodeList),l.default.arrayOf(l.default.instanceOf(f.default))]),onAfterOpen:l.default.func,onRequestClose:l.default.func,closeTimeoutMS:l.default.number,ariaHideApp:l.default.bool,shouldFocusAfterRender:l.default.bool,shouldCloseOnOverlayClick:l.default.bool,shouldReturnFocusAfterClose:l.default.bool,preventScroll:l.default.bool,parentSelector:l.default.func,aria:l.default.object,data:l.default.object,role:l.default.string,contentLabel:l.default.string,shouldCloseOnEsc:l.default.bool,overlayRef:l.default.func,contentRef:l.default.func,id:l.default.string,overlayElement:l.default.func,contentElement:l.default.func},x.defaultProps={isOpen:!1,portalClassName:g,bodyOpenClassName:y,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,t){return a.default.createElement("div",e,t)},contentElement:function(e,t){return a.default.createElement("div",e,t)}},x.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,p.polyfill)(x),t.default=x},747:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="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},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(196),s=v(n(697)),l=h(n(685)),c=v(n(338)),u=h(n(149)),d=h(n(409)),f=n(112),p=v(f),m=v(n(623));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function v(e){return e&&e.__esModule?e:{default:e}}n(63);var g={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},y=0,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,r=e.ariaHideApp,o=e.htmlOpenClassName,i=e.bodyOpenClassName,a=e.parentSelector,s=a&&a().ownerDocument||document;i&&d.remove(s.body,i),o&&d.remove(s.getElementsByTagName("html")[0],o),r&&y>0&&0==(y-=1)&&u.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(l.returnFocus(n.props.preventScroll),l.teardownScopedFocus()):l.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),m.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(l.setupScopedFocus(n.node),l.markForFocusLater()),n.setState({isOpen:!0},(function(){n.openAnimationFrame=requestAnimationFrame((function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})}))})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){(function(e){return"Tab"===e.code||9===e.keyCode})(e)&&(0,c.default)(n.content,e),n.props.shouldCloseOnEsc&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===(void 0===t?"undefined":o(t))?t:{base:g[e],afterOpen:g[e]+"--after-open",beforeClose:g[e]+"--before-close"},i=r.base;return n.state.afterOpen&&(i=i+" "+r.afterOpen),n.state.beforeClose&&(i=i+" "+r.beforeClose),"string"==typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,o=e.bodyOpenClassName,i=e.parentSelector,a=i&&i().ownerDocument||document;o&&d.add(a.body,o),r&&d.add(a.getElementsByTagName("html")[0],r),n&&(y+=1,u.hide(t)),m.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.overlayClassName,i=e.defaultStyles,a=e.children,s=n?{}:i.content,l=o?{}:i.overlay;if(this.shouldBeClosed())return null;var c={ref:this.setOverlayRef,className:this.buildClassName("overlay",o),style:r({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},u=r({id:t,ref:this.setContentRef,style:r({},s,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(u,a);return this.props.overlayElement(c,d)}}]),t}(a.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),parentSelector:s.default.func,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(p.default),s.default.instanceOf(f.SafeHTMLCollection),s.default.instanceOf(f.SafeNodeList),s.default.arrayOf(s.default.instanceOf(p.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=b,e.exports=t.default},149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){a&&(a.removeAttribute?a.removeAttribute("aria-hidden"):null!=a.length?a.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(a).forEach((function(e){return e.removeAttribute("aria-hidden")}))),a=null},t.log=function(){},t.assertNodeList=s,t.setElement=function(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);s(n,t),t=n}return a=t||a},t.validateElement=l,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=l(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.setAttribute("aria-hidden","true")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=l(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.removeAttribute("aria-hidden")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){a=null};var r,o=(r=n(473))&&r.__esModule?r:{default:r},i=n(112),a=null;function s(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function l(e){var t=e||a;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,o.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},63:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[i,a],t=0;t<e.length;t++){var n=e[t];n&&n.parentNode&&n.parentNode.removeChild(n)}i=a=null,s=[]},t.log=function(){console.log("bodyTrap ----------"),console.log(s.length);for(var e=[i,a],t=0;t<e.length;t++){var n=e[t]||{};console.log(n.nodeName,n.className,n.id)}console.log("edn bodyTrap ----------")};var r,o=(r=n(623))&&r.__esModule?r:{default:r},i=void 0,a=void 0,s=[];function l(){0!==s.length&&s[s.length-1].focusContent()}o.default.subscribe((function(e,t){i||a||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",l),(a=i.cloneNode()).addEventListener("focus",l)),(s=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==a&&document.body.appendChild(a)):(i.parentElement&&i.parentElement.removeChild(i),a.parentElement&&a.parentElement.removeChild(a))}))},409:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)o(e,n[t]);var i=document.body;for(var a in r)o(i,r[a]);n={},r={}},t.log=function(){};var n={},r={};function o(e,t){e.classList.remove(t)}t.add=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),o.add(e)}));var o,i},t.remove=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&o.remove(e)}));var o,i}},685:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){i=[]},t.log=function(){},t.handleBlur=l,t.handleFocus=c,t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){i.length>0&&i.pop()},t.setupScopedFocus=function(e){a=e,window.addEventListener?(window.addEventListener("blur",l,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",l),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){a=null,window.addEventListener?(window.removeEventListener("blur",l),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",l),document.detachEvent("onFocus",c))};var r,o=(r=n(845))&&r.__esModule?r:{default:r},i=[],a=null,s=!1;function l(){s=!0}function c(){if(s){if(s=!1,!a)return;setTimeout((function(){a.contains(document.activeElement)||((0,o.default)(a)[0]||a).focus()}),0)}}},623:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(r.openInstances.length),r.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){r=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},r=new n;t.default=r},112:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r,o=((r=n(875))&&r.__esModule?r:{default:r}).default,i=o.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=o.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=o.canUseDOM?window.NodeList:{},t.canUseDOM=o.canUseDOM,t.default=i},338:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e);if(n.length){var r=void 0,a=t.shiftKey,s=n[0],l=n[n.length-1],c=i();if(e===c){if(!a)return;r=l}if(l!==c||a||(r=s),s===c&&a&&(r=l),r)return t.preventDefault(),void r.focus();var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null!=u&&"Chrome"!=u[1]&&null==/\biPod\b|\biPad\b/g.exec(navigator.userAgent)){var d=n.indexOf(c);if(d>-1&&(d+=a?-1:1),void 0===(r=n[d]))return t.preventDefault(),void(r=a?l:s).focus();t.preventDefault(),r.focus()}}else t.preventDefault()};var r,o=(r=n(845))&&r.__esModule?r:{default:r};function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?i(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},845:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){return[].slice.call(t.querySelectorAll("*"),0).reduce((function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])}),[]).filter(o)};var n=/input|select|textarea|button|object|iframe/;function r(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var n=window.getComputedStyle(e),r=n.getPropertyValue("display");return t?"contents"!==r&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,n):"none"===r}catch(e){return console.warn("Failed to inspect element style"),!1}}function o(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var o=isNaN(t);return(o||t>=0)&&function(e,t){var o=e.nodeName.toLowerCase();return(n.test(o)&&!e.disabled||"a"===o&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),r(t))return!1;t=t.parentNode}return!0}(e)}(e,!o)}e.exports=t.default},253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(983))&&r.__esModule?r:{default:r};t.default=o.default,e.exports=t.default},358:function(e,t,n){var r;r=e=>(()=>{var t={703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},98:t=>{"use strict";t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>C});var e=r(98),t=r.n(e),n=r(697),i=r.n(n);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}var s=function(e){var n=e.pageClassName,r=e.pageLinkClassName,o=e.page,i=e.selected,s=e.activeClassName,l=e.activeLinkClassName,c=e.getEventListener,u=e.pageSelectedHandler,d=e.href,f=e.extraAriaContext,p=e.pageLabelBuilder,m=e.rel,h=e.ariaLabel||"Page "+o+(f?" "+f:""),v=null;return i&&(v="page",h=e.ariaLabel||"Page "+o+" is your current page",n=void 0!==n?n+" "+s:s,void 0!==r?void 0!==l&&(r=r+" "+l):r=l),t().createElement("li",{className:n},t().createElement("a",a({rel:m,role:d?void 0:"button",className:r,href:d,tabIndex:i?"-1":"0","aria-label":h,"aria-current":v,onKeyPress:u},c(u)),p(o)))};s.propTypes={pageSelectedHandler:i().func.isRequired,selected:i().bool.isRequired,pageClassName:i().string,pageLinkClassName:i().string,activeClassName:i().string,activeLinkClassName:i().string,extraAriaContext:i().string,href:i().string,ariaLabel:i().string,page:i().number.isRequired,getEventListener:i().func.isRequired,pageLabelBuilder:i().func.isRequired,rel:i().string};const l=s;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var u=function(e){var n=e.breakLabel,r=e.breakClassName,o=e.breakLinkClassName,i=e.breakHandler,a=e.getEventListener,s=r||"break";return t().createElement("li",{className:s},t().createElement("a",c({className:o,role:"button",tabIndex:"0",onKeyPress:i},a(i)),n))};u.propTypes={breakLabel:i().oneOfType([i().string,i().node]),breakClassName:i().string,breakLinkClassName:i().string,breakHandler:i().func.isRequired,getEventListener:i().func.isRequired};const d=u;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!=e?e:t}function p(e){return p="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},p(e)}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(s,e);var n,r,o,i,a=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(o);if(i){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function s(e){var n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),b(g(n=a.call(this,e)),"handlePreviousPage",(function(e){var t=n.state.selected;n.handleClick(e,null,t>0?t-1:void 0,{isPrevious:!0})})),b(g(n),"handleNextPage",(function(e){var t=n.state.selected,r=n.props.pageCount;n.handleClick(e,null,t<r-1?t+1:void 0,{isNext:!0})})),b(g(n),"handlePageSelected",(function(e,t){if(n.state.selected===e)return n.callActiveCallback(e),void n.handleClick(t,null,void 0,{isActive:!0});n.handleClick(t,null,e)})),b(g(n),"handlePageChange",(function(e){n.state.selected!==e&&(n.setState({selected:e}),n.callCallback(e))})),b(g(n),"getEventListener",(function(e){return b({},n.props.eventListener,e)})),b(g(n),"handleClick",(function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=o.isPrevious,a=void 0!==i&&i,s=o.isNext,l=void 0!==s&&s,c=o.isBreak,u=void 0!==c&&c,d=o.isActive,f=void 0!==d&&d;e.preventDefault?e.preventDefault():e.returnValue=!1;var p=n.state.selected,m=n.props.onClick,h=r;if(m){var v=m({index:t,selected:p,nextSelectedPage:r,event:e,isPrevious:a,isNext:l,isBreak:u,isActive:f});if(!1===v)return;Number.isInteger(v)&&(h=v)}void 0!==h&&n.handlePageChange(h)})),b(g(n),"handleBreakClick",(function(e,t){var r=n.state.selected;n.handleClick(t,e,r<e?n.getForwardJump():n.getBackwardJump(),{isBreak:!0})})),b(g(n),"callCallback",(function(e){void 0!==n.props.onPageChange&&"function"==typeof n.props.onPageChange&&n.props.onPageChange({selected:e})})),b(g(n),"callActiveCallback",(function(e){void 0!==n.props.onPageActive&&"function"==typeof n.props.onPageActive&&n.props.onPageActive({selected:e})})),b(g(n),"getElementPageRel",(function(e){var t=n.state.selected,r=n.props,o=r.nextPageRel,i=r.prevPageRel,a=r.selectedPageRel;return t-1===e?i:t===e?a:t+1===e?o:void 0})),b(g(n),"pagination",(function(){var e=[],r=n.props,o=r.pageRangeDisplayed,i=r.pageCount,a=r.marginPagesDisplayed,s=r.breakLabel,l=r.breakClassName,c=r.breakLinkClassName,u=n.state.selected;if(i<=o)for(var f=0;f<i;f++)e.push(n.getPageElement(f));else{var p=o/2,m=o-p;u>i-o/2?p=o-(m=i-u):u<o/2&&(m=o-(p=u));var h,v,g=function(e){return n.getPageElement(e)},y=[];for(h=0;h<i;h++){var b=h+1;b<=a||b>i-a||h>=u-p&&h<=u+(0===u&&o>1?m-1:m)?y.push({type:"page",index:h,display:g(h)}):s&&y.length>0&&y[y.length-1].display!==v&&(o>0||a>0)&&(v=t().createElement(d,{key:h,breakLabel:s,breakClassName:l,breakLinkClassName:c,breakHandler:n.handleBreakClick.bind(null,h),getEventListener:n.getEventListener}),y.push({type:"break",index:h,display:v}))}y.forEach((function(t,n){var r=t;"break"===t.type&&y[n-1]&&"page"===y[n-1].type&&y[n+1]&&"page"===y[n+1].type&&y[n+1].index-y[n-1].index<=2&&(r={type:"page",index:t.index,display:g(t.index)}),e.push(r.display)}))}return e})),void 0!==e.initialPage&&void 0!==e.forcePage&&console.warn("(react-paginate): Both initialPage (".concat(e.initialPage,") and forcePage (").concat(e.forcePage,") props are provided, which is discouraged.")+" Use exclusively forcePage prop for a controlled component.\nSee https://reactjs.org/docs/forms.html#controlled-components"),r=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,n.state={selected:r},n}return n=s,(r=[{key:"componentDidMount",value:function(){var e=this.props,t=e.initialPage,n=e.disableInitialCallback,r=e.extraAriaContext,o=e.pageCount,i=e.forcePage;void 0===t||n||this.callCallback(t),r&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(o)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(o,"). Did you forget a Math.ceil()?")),void 0!==t&&t>o-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(t," > ").concat(o-1,").")),void 0!==i&&i>o-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(i," > ").concat(o-1,")."))}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&(this.props.forcePage>this.props.pageCount-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(this.props.forcePage," > ").concat(this.props.pageCount-1,").")),this.setState({selected:this.props.forcePage})),Number.isInteger(e.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var e=this.state.selected,t=this.props,n=t.pageCount,r=e+t.pageRangeDisplayed;return r>=n?n-1:r}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"getElementHref",value:function(e){var t=this.props,n=t.hrefBuilder,r=t.pageCount,o=t.hrefAllControls;if(n)return o||e>=0&&e<r?n(e+1,r,this.state.selected):void 0}},{key:"ariaLabelBuilder",value:function(e){var t=e===this.state.selected;if(this.props.ariaLabelBuilder&&e>=0&&e<this.props.pageCount){var n=this.props.ariaLabelBuilder(e+1,t);return this.props.extraAriaContext&&!t&&(n=n+" "+this.props.extraAriaContext),n}}},{key:"getPageElement",value:function(e){var n=this.state.selected,r=this.props,o=r.pageClassName,i=r.pageLinkClassName,a=r.activeClassName,s=r.activeLinkClassName,c=r.extraAriaContext,u=r.pageLabelBuilder;return t().createElement(l,{key:e,pageSelectedHandler:this.handlePageSelected.bind(null,e),selected:n===e,rel:this.getElementPageRel(e),pageClassName:o,pageLinkClassName:i,activeClassName:a,activeLinkClassName:s,extraAriaContext:c,href:this.getElementHref(e),ariaLabel:this.ariaLabelBuilder(e),page:e+1,pageLabelBuilder:u,getEventListener:this.getEventListener})}},{key:"render",value:function(){var e=this.props.renderOnZeroPageCount;if(0===this.props.pageCount&&void 0!==e)return e?e(this.props):e;var n=this.props,r=n.disabledClassName,o=n.disabledLinkClassName,i=n.pageCount,a=n.className,s=n.containerClassName,l=n.previousLabel,c=n.previousClassName,u=n.previousLinkClassName,d=n.previousAriaLabel,p=n.prevRel,h=n.nextLabel,v=n.nextClassName,g=n.nextLinkClassName,y=n.nextAriaLabel,b=n.nextRel,w=this.state.selected,C=0===w,E=w===i-1,x="".concat(f(c)).concat(C?" ".concat(f(r)):""),O="".concat(f(v)).concat(E?" ".concat(f(r)):""),k="".concat(f(u)).concat(C?" ".concat(f(o)):""),_="".concat(f(g)).concat(E?" ".concat(f(o)):""),S=C?"true":"false",N=E?"true":"false";return t().createElement("ul",{className:a||s,role:"navigation","aria-label":"Pagination"},t().createElement("li",{className:x},t().createElement("a",m({className:k,href:this.getElementHref(w-1),tabIndex:C?"-1":"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":S,"aria-label":d,rel:p},this.getEventListener(this.handlePreviousPage)),l)),this.pagination(),t().createElement("li",{className:O},t().createElement("a",m({className:_,href:this.getElementHref(w+1),tabIndex:E?"-1":"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":N,"aria-label":y,rel:b},this.getEventListener(this.handleNextPage)),h)))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(e.Component);b(w,"propTypes",{pageCount:i().number.isRequired,pageRangeDisplayed:i().number,marginPagesDisplayed:i().number,previousLabel:i().node,previousAriaLabel:i().string,prevPageRel:i().string,prevRel:i().string,nextLabel:i().node,nextAriaLabel:i().string,nextPageRel:i().string,nextRel:i().string,breakLabel:i().oneOfType([i().string,i().node]),hrefBuilder:i().func,hrefAllControls:i().bool,onPageChange:i().func,onPageActive:i().func,onClick:i().func,initialPage:i().number,forcePage:i().number,disableInitialCallback:i().bool,containerClassName:i().string,className:i().string,pageClassName:i().string,pageLinkClassName:i().string,pageLabelBuilder:i().func,activeClassName:i().string,activeLinkClassName:i().string,previousClassName:i().string,nextClassName:i().string,previousLinkClassName:i().string,nextLinkClassName:i().string,disabledClassName:i().string,disabledLinkClassName:i().string,breakClassName:i().string,breakLinkClassName:i().string,extraAriaContext:i().string,ariaLabelBuilder:i().func,eventListener:i().string,renderOnZeroPageCount:i().func,selectedPageRel:i().string}),b(w,"defaultProps",{pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevPageRel:"prev",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextPageRel:"next",nextRel:"next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(e){return e},eventListener:"onClick",renderOnZeroPageCount:void 0,selectedPageRel:"canonical",hrefAllControls:!1});const C=w})(),o})(),e.exports=r(n(196))},666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:k(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",p="executing",m="completed",h={};function v(){}function g(){}function y(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(D([])));C&&C!==n&&r.call(C,a)&&(b=C);var E=y.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,i,a,s){var l=d(e[o],e,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function k(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var l=d(e,t,n);if("normal"===l.type){if(r=n.done?m:"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=m,n.method="throw",n.arg=l.arg)}}}function _(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,_(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=d(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function D(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:I}}function I(){return{value:t,done:!0}}return g.prototype=y,o(E,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},x(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(E),c(E,l,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},473:function(e){"use strict";e.exports=function(){}},196:function(e){"use strict";e.exports=window.React},850:function(e){"use strict";e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=window.wp.element,t=n(196),r=n.n(t),o=n(697),i=n.n(o);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}var s=n(850),l=n.n(s);const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function u(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function d(e){return"nodeType"in e}function f(e){var t,n;return e?u(e)?e:d(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function p(e){const{Document:t}=f(e);return e instanceof t}function m(e){return!u(e)&&e instanceof f(e).HTMLElement}function h(e){return e?u(e)?e.document:d(e)?p(e)?e:m(e)?e.ownerDocument:document:document:document}const v=c?t.useLayoutEffect:t.useEffect;function g(e){const n=(0,t.useRef)(e);return v((()=>{n.current=e})),(0,t.useCallback)((function(...e){return null==n.current?void 0:n.current(...e)}),[])}function y(e,n=[e]){const r=(0,t.useRef)(e);return v((()=>{r.current!==e&&(r.current=e)}),n),r}function b(e,n){const r=(0,t.useRef)();return(0,t.useMemo)((()=>{const t=e(r.current);return r.current=t,t}),[...n])}function w(e){const n=g(e),r=(0,t.useRef)(null),o=(0,t.useCallback)((e=>{e!==r.current&&(null==n||n(e,r.current)),r.current=e}),[]);return[r,o]}function C(e){const n=(0,t.useRef)();return(0,t.useEffect)((()=>{n.current=e}),[e]),n.current}let E={};function x(e,n){return(0,t.useMemo)((()=>{if(n)return n;const t=null==E[e]?0:E[e]+1;return E[e]=t,`${e}-${t}`}),[e,n])}function O(e){return(t,...n)=>n.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}const k=O(1),_=O(-1);function S(e){if(!e)return!1;const{KeyboardEvent:t}=f(e.target);return t&&e instanceof t}function N(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=f(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const T=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return`translate3d(${t?Math.round(t):0}px, ${n?Math.round(n):0}px, 0)`}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return`scaleX(${t}) scaleY(${n})`}},Transform:{toString(e){if(e)return[T.Translate.toString(e),T.Scale.toString(e)].join(" ")}},Transition:{toString({property:e,duration:t,easing:n}){return`${e} ${t}ms ${n}`}}}),D="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function I(e){return e.matches(D)?e:e.querySelector(D)}const P={display:"none"};function M(e){let{id:t,value:n}=e;return r().createElement("div",{id:t,style:P},n)}const R={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function A(e){let{id:t,announcement:n}=e;return r().createElement("div",{id:t,style:R,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const L=(0,t.createContext)(null);function j(e){const n=(0,t.useContext)(L);(0,t.useEffect)((()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)}),[e,n])}const F={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},B={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function H(e){let{announcements:n=B,container:o,hiddenTextDescribedById:i,screenReaderInstructions:a=F}=e;const{announce:l,announcement:c}=function(){const[e,n]=(0,t.useState)("");return{announce:(0,t.useCallback)((e=>{null!=e&&n(e)}),[]),announcement:e}}(),u=x("DndLiveRegion"),[d,f]=(0,t.useState)(!1);if((0,t.useEffect)((()=>{f(!0)}),[]),j((0,t.useMemo)((()=>({onDragStart(e){let{active:t}=e;l(n.onDragStart({active:t}))},onDragMove(e){let{active:t,over:r}=e;n.onDragMove&&l(n.onDragMove({active:t,over:r}))},onDragOver(e){let{active:t,over:r}=e;l(n.onDragOver({active:t,over:r}))},onDragEnd(e){let{active:t,over:r}=e;l(n.onDragEnd({active:t,over:r}))},onDragCancel(e){let{active:t,over:r}=e;l(n.onDragCancel({active:t,over:r}))}})),[l,n])),!d)return null;const p=r().createElement(r().Fragment,null,r().createElement(M,{id:i,value:a.draggable}),r().createElement(A,{id:u,announcement:c}));return o?(0,s.createPortal)(p,o):p}var V;function W(){}function U(e,n){return(0,t.useMemo)((()=>({sensor:e,options:null!=n?n:{}})),[e,n])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(V||(V={}));const z=Object.freeze({x:0,y:0});function q(e,t){const n=N(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Y(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const X=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=$(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Y)};function K(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:z}function G(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const J=G(1);function Z(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Q={ignoreTransform:!1};function ee(e,t){void 0===t&&(t=Q);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:t}=f(e),{transform:r,transformOrigin:o}=t(e);r&&(n=function(e,t,n){const r=Z(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}(n,r,o))}const{top:r,left:o,width:i,height:a,bottom:s,right:l}=n;return{top:r,left:o,width:i,height:a,bottom:s,right:l}}function te(e){return ee(e,{ignoreTransform:!0})}function ne(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(p(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!m(o)||function(e){return e instanceof f(e).SVGElement}(o))return n;if(n.includes(o))return n;const{getComputedStyle:i}=f(o),a=i(o);return o!==e&&function(e,t){void 0===t&&(t=f(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=f(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function re(e){const[t]=ne(e,1);return null!=t?t:null}function oe(e){return c&&e?u(e)?e:d(e)?p(e)||e===h(e).scrollingElement?window:m(e)?e:null:null:null}function ie(e){return u(e)?e.scrollX:e.scrollLeft}function ae(e){return u(e)?e.scrollY:e.scrollTop}function se(e){return{x:ie(e),y:ae(e)}}var le;function ce(e){return!(!c||!e)&&e===document.scrollingElement}function ue(e){const t={x:0,y:0},n=ce(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(le||(le={}));const de={x:.2,y:.2};function fe(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=de);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=ue(e),p={x:0,y:0},m={x:0,y:0},h=t.height*o.y,v=t.width*o.x;return!c&&i<=t.top+h?(p.y=le.Backward,m.y=r*Math.abs((t.top+h-i)/h)):!u&&l>=t.bottom-h&&(p.y=le.Forward,m.y=r*Math.abs((t.bottom-h-l)/h)),!f&&s>=t.right-v?(p.x=le.Forward,m.x=r*Math.abs((t.right-v-s)/v)):!d&&a<=t.left+v&&(p.x=le.Backward,m.x=r*Math.abs((t.left+v-a)/v)),{direction:p,speed:m}}function pe(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function me(e){return e.reduce(((e,t)=>k(e,se(t))),z)}function he(e,t){if(void 0===t&&(t=ee),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);re(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ve=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+ie(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+ae(t)),0)}]];class ge{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ne(t),r=me(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ve)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ye{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function be(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var we,Ce;function Ee(e){e.preventDefault()}function xe(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(we||(we={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Ce||(Ce={}));const Oe={start:[Ce.Space,Ce.Enter],cancel:[Ce.Esc],end:[Ce.Space,Ce.Enter]},ke=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ce.Right:return{...n,x:n.x+25};case Ce.Left:return{...n,x:n.x-25};case Ce.Down:return{...n,y:n.y+25};case Ce.Up:return{...n,y:n.y-25}}};class _e{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ye(h(t)),this.windowListeners=new ye(f(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(we.Resize,this.handleCancel),this.windowListeners.add(we.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(we.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&he(n),t(z)}handleKeyDown(e){if(S(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Oe,coordinateGetter:i=ke,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:z;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=_(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:d,minScroll:f}=ue(n),p=pe(n),m={x:Math.min(o===Ce.Right?p.right-p.width/2:p.right,Math.max(o===Ce.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===Ce.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Ce.Down?p.top:p.top+p.height/2,u.y))},h=o===Ce.Right&&!s||o===Ce.Left&&!l,v=o===Ce.Down&&!c||o===Ce.Up&&!i;if(h&&m.x!==u.x){const e=n.scrollLeft+t.x,i=o===Ce.Right&&e<=d.x||o===Ce.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Ce.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(v&&m.y!==u.y){const e=n.scrollTop+t.y,i=o===Ce.Down&&e<=d.y||o===Ce.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Ce.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,k(_(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Se(e){return Boolean(e&&"distance"in e)}function Ne(e){return Boolean(e&&"delay"in e)}_e.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Oe,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Te{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=f(e);return e instanceof t?e:h(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=h(i),this.documentListeners=new ye(this.document),this.listeners=new ye(n),this.windowListeners=new ye(f(i)),this.initialCoordinates=null!=(r=N(o))?r:z,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(we.Resize,this.handleCancel),this.windowListeners.add(we.DragStart,Ee),this.windowListeners.add(we.VisibilityChange,this.handleCancel),this.windowListeners.add(we.ContextMenu,Ee),this.documentListeners.add(we.Keydown,this.handleKeydown),t){if(Se(t))return;if(Ne(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(we.Click,xe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(we.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=N(e))?t:z,l=_(r,s);if(!n&&a){if(Ne(a))return be(l,a.tolerance)?this.handleCancel():void 0;if(Se(a))return null!=a.tolerance&&be(l,a.tolerance)?this.handleCancel():be(l,a.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Ce.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const De={move:{name:"pointermove"},end:{name:"pointerup"}};class Ie extends Te{constructor(e){const{event:t}=e,n=h(t.target);super(e,De,n)}}Ie.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const Pe={move:{name:"mousemove"},end:{name:"mouseup"}};var Me;!function(e){e[e.RightClick=2]="RightClick"}(Me||(Me={})),class extends Te{constructor(e){super(e,Pe,h(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Me.RightClick&&(null==r||r({event:n}),!0)}}];const Re={move:{name:"touchmove"},end:{name:"touchend"}};var Ae,Le;(class extends Te{constructor(e){super(e,Re)}static setup(){return window.addEventListener(Re.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Re.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ae||(Ae={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Le||(Le={}));const je={x:{[le.Backward]:!1,[le.Forward]:!1},y:{[le.Backward]:!1,[le.Forward]:!1}};var Fe,Be;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Fe||(Fe={})),function(e){e.Optimized="optimized"}(Be||(Be={}));const He=new Map;function Ve(e,t){return b((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function We(e){let{callback:n,disabled:r}=e;const o=g(n),i=(0,t.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[r]);return(0,t.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function Ue(e){return new ge(ee(e),e)}function ze(e,n,r){void 0===n&&(n=Ue);const[o,i]=(0,t.useReducer)((function(t){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=t?t:r)?o:null;const i=n(e);return JSON.stringify(t)===JSON.stringify(i)?t:i}),null),a=function(e){let{callback:n,disabled:r}=e;const o=g(n),i=(0,t.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,r]);return(0,t.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),s=We({callback:i});return v((()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())}),[e]),o}const qe=[];function Ye(e,n){void 0===n&&(n=[]);const r=(0,t.useRef)(null);return(0,t.useEffect)((()=>{r.current=null}),n),(0,t.useEffect)((()=>{const t=e!==z;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)}),[e]),r.current?_(e,r.current):z}function $e(e){return(0,t.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Xe=[];function Ke(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return m(t)?t:e}const Ge=[{sensor:Ie,options:{}},{sensor:_e,options:{}}],Je={current:{}},Ze={draggable:{measure:te},droppable:{measure:te,strategy:Fe.WhileDragging,frequency:Be.Optimized},dragOverlay:{measure:ee}};class Qe extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const et={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Qe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:W},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ze,measureDroppableContainers:W,windowRect:null,measuringScheduled:!1},tt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:W,draggableNodes:new Map,over:null,measureDroppableContainers:W},nt=(0,t.createContext)(tt),rt=(0,t.createContext)(et);function ot(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Qe}}}function it(e,t){switch(t.type){case V.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case V.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case V.DragEnd:case V.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case V.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Qe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case V.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Qe(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case V.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Qe(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function at(e){let{disabled:n}=e;const{active:r,activatorEvent:o,draggableNodes:i}=(0,t.useContext)(nt),a=C(o),s=C(null==r?void 0:r.id);return(0,t.useEffect)((()=>{if(!n&&!o&&a&&null!=s){if(!S(a))return;if(document.activeElement===a.target)return;const e=i.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=I(e);if(t){t.focus();break}}}))}}),[o,n,i,s,a]),null}function st(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const lt=(0,t.createContext)({...z,scaleX:1,scaleY:1});var ct;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ct||(ct={}));const ut=(0,t.memo)((function(e){var n,o,i,a;let{id:l,accessibility:u,autoScroll:d=!0,children:p,sensors:h=Ge,collisionDetection:g=X,measuring:E,modifiers:O,..._}=e;const S=(0,t.useReducer)(it,void 0,ot),[T,D]=S,[I,P]=function(){const[e]=(0,t.useState)((()=>new Set)),n=(0,t.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,t.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),n]}(),[M,R]=(0,t.useState)(ct.Uninitialized),A=M===ct.Initialized,{draggable:{active:j,nodes:F,translate:B},droppable:{containers:W}}=T,U=j?F.get(j):null,q=(0,t.useRef)({initial:null,translated:null}),Y=(0,t.useMemo)((()=>{var e;return null!=j?{id:j,data:null!=(e=null==U?void 0:U.data)?e:Je,rect:q}:null}),[j,U]),$=(0,t.useRef)(null),[G,Z]=(0,t.useState)(null),[Q,te]=(0,t.useState)(null),ie=y(_,Object.values(_)),ae=x("DndDescribedBy",l),ue=(0,t.useMemo)((()=>W.getEnabled()),[W]),de=(pe=E,(0,t.useMemo)((()=>({draggable:{...Ze.draggable,...null==pe?void 0:pe.draggable},droppable:{...Ze.droppable,...null==pe?void 0:pe.droppable},dragOverlay:{...Ze.dragOverlay,...null==pe?void 0:pe.dragOverlay}})),[null==pe?void 0:pe.draggable,null==pe?void 0:pe.droppable,null==pe?void 0:pe.dragOverlay]));var pe;const{droppableRects:he,measureDroppableContainers:ve,measuringScheduled:ye}=function(e,n){let{dragging:r,dependencies:o,config:i}=n;const[a,s]=(0,t.useState)(null),l=null!=a,{frequency:c,measure:u,strategy:d}=i,f=(0,t.useRef)(e),p=function(){switch(d){case Fe.Always:return!1;case Fe.BeforeDragging:return r;default:return!r}}(),m=y(p),h=(0,t.useCallback)((function(e){void 0===e&&(e=[]),m.current||s((t=>t?t.concat(e):e))}),[m]),v=(0,t.useRef)(null),g=b((t=>{if(p&&!r)return He;const n=a;if(!t||t===He||f.current!==e||null!=n){const t=new Map;for(let r of e){if(!r)continue;if(n&&n.length>0&&!n.includes(r.id)&&r.rect.current){t.set(r.id,r.rect.current);continue}const e=r.node.current,o=e?new ge(u(e),e):null;r.rect.current=o,o&&t.set(r.id,o)}return t}return t}),[e,a,r,p,u]);return(0,t.useEffect)((()=>{f.current=e}),[e]),(0,t.useEffect)((()=>{p||requestAnimationFrame((()=>h()))}),[r,p]),(0,t.useEffect)((()=>{l&&s(null)}),[l]),(0,t.useEffect)((()=>{p||"number"!=typeof c||null!==v.current||(v.current=setTimeout((()=>{h(),v.current=null}),c))}),[c,p,h,...o]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:l}}(ue,{dragging:A,dependencies:[B.x,B.y],config:de.droppable}),be=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return b((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(F,j),we=(0,t.useMemo)((()=>Q?N(Q):null),[Q]),Ce=function(){const e=!1===(null==G?void 0:G.autoScrollEnabled),t="object"==typeof d?!1===d.enabled:!1===d,n=A&&!e&&!t;return"object"==typeof d?{...d,enabled:n}:{enabled:n}}(),Ee=function(e,t){return Ve(e,t)}(be,de.draggable.measure);!function(e){let{activeNode:n,measure:r,initialRect:o,config:i=!0}=e;const a=(0,t.useRef)(!1),{x:s,y:l}="boolean"==typeof i?{x:i,y:i}:i;v((()=>{if(!s&&!l||!n)return void(a.current=!1);if(a.current||!o)return;const e=null==n?void 0:n.node.current;if(!e||!1===e.isConnected)return;const t=K(r(e),o);if(s||(t.x=0),l||(t.y=0),a.current=!0,Math.abs(t.x)>0||Math.abs(t.y)>0){const n=re(e);n&&n.scrollBy({top:t.y,left:t.x})}}),[n,s,l,o,r])}({activeNode:j?F.get(j):null,config:Ce.layoutShiftCompensation,initialRect:Ee,measure:de.draggable.measure});const xe=ze(be,de.draggable.measure,Ee),Oe=ze(be?be.parentElement:null),ke=(0,t.useRef)({activatorEvent:null,active:null,activeNode:be,collisionRect:null,collisions:null,droppableRects:he,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=W.getNodeFor(null==(n=ke.current.over)?void 0:n.id),Se=function(e){let{measure:n}=e;const[r,o]=(0,t.useState)(null),i=(0,t.useCallback)((e=>{for(const{target:t}of e)if(m(t)){o((e=>{const r=n(t);return e?{...e,width:r.width,height:r.height}:r}));break}}),[n]),a=We({callback:i}),s=(0,t.useCallback)((e=>{const t=Ke(e);null==a||a.disconnect(),t&&(null==a||a.observe(t)),o(t?n(t):null)}),[n,a]),[l,c]=w(s);return(0,t.useMemo)((()=>({nodeRef:l,rect:r,setRef:c})),[r,l,c])}({measure:de.dragOverlay.measure}),Ne=null!=(o=Se.nodeRef.current)?o:be,Te=A?null!=(i=Se.rect)?i:xe:null,De=Boolean(Se.nodeRef.current&&Se.rect),Ie=K(Pe=De?null:xe,Ve(Pe));var Pe;const Me=$e(Ne?f(Ne):null),Re=function(e){const n=(0,t.useRef)(e),r=b((t=>e?t&&t!==qe&&e&&n.current&&e.parentNode===n.current.parentNode?t:ne(e):qe),[e]);return(0,t.useEffect)((()=>{n.current=e}),[e]),r}(A?null!=_e?_e:be:null),Be=function(e,n){void 0===n&&(n=ee);const[r]=e,o=$e(r?f(r):null),[i,a]=(0,t.useReducer)((function(){return e.length?e.map((e=>ce(e)?o:new ge(n(e),e))):Xe}),Xe),s=We({callback:a});return e.length>0&&i===Xe&&a(),v((()=>{e.length?e.forEach((e=>null==s?void 0:s.observe(e))):(null==s||s.disconnect(),a())}),[e]),i}(Re),Ue=st(O,{transform:{x:B.x-Ie.x,y:B.y-Ie.y,scaleX:1,scaleY:1},activatorEvent:Q,active:Y,activeNodeRect:xe,containerNodeRect:Oe,draggingNodeRect:Te,over:ke.current.over,overlayNodeRect:Se.rect,scrollableAncestors:Re,scrollableAncestorRects:Be,windowRect:Me}),Qe=we?k(we,B):null,et=function(e){const[n,r]=(0,t.useState)(null),o=(0,t.useRef)(e),i=(0,t.useCallback)((e=>{const t=oe(e.target);t&&r((e=>e?(e.set(t,se(t)),new Map(e)):null))}),[]);return(0,t.useEffect)((()=>{const t=o.current;if(e!==t){n(t);const a=e.map((e=>{const t=oe(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,se(t)]):null})).filter((e=>null!=e));r(a.length?new Map(a):null),o.current=e}return()=>{n(e),n(t)};function n(e){e.forEach((e=>{const t=oe(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),(0,t.useMemo)((()=>e.length?n?Array.from(n.values()).reduce(((e,t)=>k(e,t)),z):me(e):z),[e,n])}(Re),tt=Ye(et),ut=Ye(et,[xe]),dt=k(Ue,tt),ft=Te?J(Te,Ue):null,pt=Y&&ft?g({active:Y,collisionRect:ft,droppableRects:he,droppableContainers:ue,pointerCoordinates:Qe}):null,mt=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n.id}(pt),[ht,vt]=(0,t.useState)(null),gt=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(De?Ue:k(Ue,ut),null!=(a=null==ht?void 0:ht.rect)?a:null,xe),yt=(0,t.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==$.current)return;const o=F.get($.current);if(!o)return;const i=e.nativeEvent,a=new n({active:$.current,activeNode:o,event:i,options:r,context:ke,onStart(e){const t=$.current;if(null==t)return;const n=F.get(t);if(!n)return;const{onDragStart:r}=ie.current,o={active:{id:t,data:n.data,rect:q}};(0,s.unstable_batchedUpdates)((()=>{null==r||r(o),R(ct.Initializing),D({type:V.DragStart,initialCoordinates:e,active:t}),I({type:"onDragStart",event:o})}))},onMove(e){D({type:V.DragMove,coordinates:e})},onEnd:l(V.DragEnd),onCancel:l(V.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ke.current;let a=null;if(t&&o){const{cancelDrop:s}=ie.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===V.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=V.DragCancel)}$.current=null,(0,s.unstable_batchedUpdates)((()=>{D({type:e}),R(ct.Uninitialized),vt(null),Z(null),te(null);const t=e===V.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=ie.current[t];null==e||e(a),I({type:t,event:a})}}))}}(0,s.unstable_batchedUpdates)((()=>{Z(a),te(e.nativeEvent)}))}),[F]),bt=(0,t.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=F.get(r);if(null!==$.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},$.current=r,yt(n,t))}),[F,yt]),wt=function(e,n){return(0,t.useMemo)((()=>e.reduce(((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:n(e.handler,t)})))]}),[])),[e,n])}(h,bt);!function(e){(0,t.useEffect)((()=>{if(!c)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(h),v((()=>{xe&&M===ct.Initializing&&R(ct.Initialized)}),[xe,M]),(0,t.useEffect)((()=>{const{onDragMove:e}=ie.current,{active:t,activatorEvent:n,collisions:r,over:o}=ke.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:dt.x,y:dt.y},over:o};(0,s.unstable_batchedUpdates)((()=>{null==e||e(i),I({type:"onDragMove",event:i})}))}),[dt.x,dt.y]),(0,t.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ke.current;if(!e||null==$.current||!t||!o)return;const{onDragOver:i}=ie.current,a=r.get(mt),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,s.unstable_batchedUpdates)((()=>{vt(l),null==i||i(c),I({type:"onDragOver",event:c})}))}),[mt]),v((()=>{ke.current={activatorEvent:Q,active:Y,activeNode:be,collisionRect:ft,collisions:pt,droppableRects:he,draggableNodes:F,draggingNode:Ne,draggingNodeRect:Te,droppableContainers:W,over:ht,scrollableAncestors:Re,scrollAdjustedTranslate:dt},q.current={initial:Te,translated:ft}}),[Y,be,pt,ft,F,Ne,Te,he,W,ht,Re,dt]),function(e){let{acceleration:n,activator:r=Ae.Pointer,canScroll:o,draggingRect:i,enabled:a,interval:s=5,order:l=Le.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e;const m=function(e){let{delta:t,disabled:n}=e;const r=C(t);return b((e=>{if(n||!r||!e)return je;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[le.Backward]:e.x[le.Backward]||-1===o,[le.Forward]:e.x[le.Forward]||1===o},y:{[le.Backward]:e.y[le.Backward]||-1===i,[le.Forward]:e.y[le.Forward]||1===i}}}),[n,t,r])}({delta:f,disabled:!a}),[h,v]=function(){const e=(0,t.useRef)(null);return[(0,t.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,t.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),g=(0,t.useRef)({x:0,y:0}),y=(0,t.useRef)({x:0,y:0}),w=(0,t.useMemo)((()=>{switch(r){case Ae.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ae.DraggableRect:return i}}),[r,i,c]),E=(0,t.useRef)(null),x=(0,t.useCallback)((()=>{const e=E.current;if(!e)return;const t=g.current.x*y.current.x,n=g.current.y*y.current.y;e.scrollBy(t,n)}),[]),O=(0,t.useMemo)((()=>l===Le.TreeOrder?[...u].reverse():u),[l,u]);(0,t.useEffect)((()=>{if(a&&u.length&&w){for(const e of O){if(!1===(null==o?void 0:o(e)))continue;const t=u.indexOf(e),r=d[t];if(!r)continue;const{direction:i,speed:a}=fe(e,r,w,n,p);for(const e of["x","y"])m[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return v(),E.current=e,h(x,s),g.current=a,void(y.current=i)}g.current={x:0,y:0},y.current={x:0,y:0},v()}else v()}),[n,x,o,v,a,s,JSON.stringify(w),JSON.stringify(m),h,u,O,d,JSON.stringify(p)])}({...Ce,delta:B,draggingRect:ft,pointerCoordinates:Qe,scrollableAncestors:Re,scrollableAncestorRects:Be});const Ct=(0,t.useMemo)((()=>({active:Y,activeNode:be,activeNodeRect:xe,activatorEvent:Q,collisions:pt,containerNodeRect:Oe,dragOverlay:Se,draggableNodes:F,droppableContainers:W,droppableRects:he,over:ht,measureDroppableContainers:ve,scrollableAncestors:Re,scrollableAncestorRects:Be,measuringConfiguration:de,measuringScheduled:ye,windowRect:Me})),[Y,be,xe,Q,pt,Oe,Se,F,W,he,ht,ve,Re,Be,de,ye,Me]),Et=(0,t.useMemo)((()=>({activatorEvent:Q,activators:wt,active:Y,activeNodeRect:xe,ariaDescribedById:{draggable:ae},dispatch:D,draggableNodes:F,over:ht,measureDroppableContainers:ve})),[Q,wt,Y,xe,D,ae,F,ht,ve]);return r().createElement(L.Provider,{value:P},r().createElement(nt.Provider,{value:Et},r().createElement(rt.Provider,{value:Ct},r().createElement(lt.Provider,{value:gt},p)),r().createElement(at,{disabled:!1===(null==u?void 0:u.restoreFocus)})),r().createElement(H,{...u,hiddenTextDescribedById:ae}))})),dt=(0,t.createContext)(null),ft="button";const pt={timeout:25};function mt(e){let{animation:n,children:o}=e;const[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)(null),c=C(o);return o||i||!c||a(c),v((()=>{if(!s)return;const e=null==i?void 0:i.key,t=null==i?void 0:i.props.id;null!=e&&null!=t?Promise.resolve(n(t,s)).then((()=>{a(null)})):a(null)}),[n,i,s]),r().createElement(r().Fragment,null,o,i?(0,t.cloneElement)(i,{ref:l}):null)}const ht={x:0,y:0,scaleX:1,scaleY:1};function vt(e){let{children:t}=e;return r().createElement(nt.Provider,{value:tt},r().createElement(lt.Provider,{value:ht},t))}const gt={position:"fixed",touchAction:"none"},yt=e=>S(e)?"transform 250ms ease":void 0,bt=(0,t.forwardRef)(((e,t)=>{let{as:n,activatorEvent:o,adjustScale:i,children:a,className:s,rect:l,style:c,transform:u,transition:d=yt}=e;if(!l)return null;const f=i?u:{...u,scaleX:1,scaleY:1},p={...gt,width:l.width,height:l.height,top:l.top,left:l.left,transform:T.Transform.toString(f),transformOrigin:i&&o?q(o,l):void 0,transition:"function"==typeof d?d(o):d,...c};return r().createElement(n,{className:s,style:p,ref:t},a)})),wt=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},Ct={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:T.Transform.toString(t)},{transform:T.Transform.toString(n)}]},sideEffects:wt({styles:{active:{opacity:"0"}}})};let Et=0;function xt(e){return(0,t.useMemo)((()=>{if(null!=e)return Et++,Et}),[e])}const Ot=r().memo((e=>{let{adjustScale:n=!1,children:o,dropAnimation:i,style:a,transition:s,modifiers:l,wrapperElement:c="div",className:u,zIndex:d=999}=e;const{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:v,draggableNodes:y,droppableContainers:b,dragOverlay:w,over:C,measuringConfiguration:E,scrollableAncestors:x,scrollableAncestorRects:O,windowRect:k}=(0,t.useContext)(rt),_=(0,t.useContext)(lt),S=xt(null==m?void 0:m.id),N=st(l,{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:v,draggingNodeRect:w.rect,over:C,overlayNodeRect:w.rect,scrollableAncestors:x,scrollableAncestorRects:O,transform:_,windowRect:k}),T=Ve(h),D=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return g(((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Ke(i);if(!l)return;const{transform:c}=f(i).getComputedStyle(i),u=Z(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ct,...e};return e=>{let{active:i,dragOverlay:a,transform:s,...l}=e;if(!t)return;const c=a.rect.left-i.rect.left,u=a.rect.top-i.rect.top,d={scaleX:1!==s.scaleX?i.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?i.rect.height*s.scaleY/a.rect.height:1},f={x:s.x-c,y:s.y-u,...d},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:f}}),[m]=p,h=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(h))return;const v=null==r?void 0:r({active:i,dragOverlay:a,...l}),g=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{g.onfinish=()=>{null==v||v(),e()}}))}}(t);return he(s,o.draggable.measure),d({active:{id:e,data:a.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:u})}))}({config:i,draggableNodes:y,droppableContainers:b,measuringConfiguration:E}),I=T?w.setRef:void 0;return r().createElement(vt,null,r().createElement(mt,{animation:D},m&&S?r().createElement(bt,{key:S,id:m.id,ref:I,as:c,activatorEvent:p,adjustScale:n,className:u,transition:s,rect:T,style:{zIndex:d,...a},transform:N},o):null))})),kt=r().createContext(null);var _t=n=>{const{position:r,item:o,...i}=n,s=(0,t.useMemo)((()=>`droppable-${r.toString()}-${o.ID.toString()}`),[r,o.ID]),{setNodeRef:l,isOver:c,over:u}=function(e){let{data:n,disabled:r=!1,id:o,resizeObserverConfig:i}=e;const a=x("Droppable"),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=(0,t.useContext)(nt),d=(0,t.useRef)({disabled:r}),f=(0,t.useRef)(!1),p=(0,t.useRef)(null),m=(0,t.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:b}={...pt,...i},C=y(null!=g?g:o),E=We({callback:(0,t.useCallback)((()=>{f.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{u(Array.isArray(C.current)?C.current:[C.current]),m.current=null}),b)):f.current=!0}),[b]),disabled:h||!s}),O=(0,t.useCallback)(((e,t)=>{E&&(t&&(E.unobserve(t),f.current=!1),e&&E.observe(e))}),[E]),[k,_]=w(O),S=y(n);return(0,t.useEffect)((()=>{E&&k.current&&(E.disconnect(),f.current=!1,E.observe(k.current))}),[k,E]),v((()=>(l({type:V.RegisterDroppable,element:{id:o,key:a,disabled:r,node:k,rect:p,data:S}}),()=>l({type:V.UnregisterDroppable,key:a,id:o}))),[o]),(0,t.useEffect)((()=>{r!==d.current.disabled&&(l({type:V.SetDroppableDisabled,id:o,key:a,disabled:r}),d.current.disabled=r)}),[o,a,r,l]),{active:s,rect:p,isOver:(null==c?void 0:c.id)===o,node:k,over:c,setNodeRef:_}}({id:s,data:{item:o}});return(0,e.createElement)("div",a({ref:l,id:s,className:`mmu-droppable-container mmu-droppable-container--${r} `+(c?` mmu-droppable-container--active mmu-droppable-container--${r}--active`:"")},i),(0,e.createElement)("div",{className:`mmu-droppable-inner mmu-droppable-inner--${r}`}))};function St(e){return St="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},St(e)}function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(n),!0).forEach((function(t){Nt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function It(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rt(e,t,n){return t&&Mt(e.prototype,t),n&&Mt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function At(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lt(e,t){return Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lt(e,t)}function jt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lt(e,t)}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ft(e)}function Bt(e,t){if(t&&("object"===St(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return At(e)}function Ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ft(e);if(t){var o=Ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Bt(this,n)}}var Vt=function(e){return+setTimeout(e,16)},Wt=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Vt=function(e){return window.requestAnimationFrame(e)},Wt=function(e){return window.cancelAnimationFrame(e)});var Ut=0,zt=new Map;function qt(e){zt.delete(e)}var Yt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Ut+=1;function r(t){if(0===t)qt(n),e();else{var o=Vt((function(){r(t-1)}));zt.set(n,o)}}return r(t),n};Yt.cancel=function(e){var t=zt.get(e);return qt(t),Wt(t)};var $t=Yt;function Xt(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function Kt(e){return e instanceof HTMLElement?e:l().findDOMNode(e)}var Gt=n(864);function Jt(e,t){"function"==typeof e?e(t):"object"===St(e)&&e&&"current"in e&&(e.current=t)}function Zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter((function(e){return e}));return r.length<=1?r[0]:function(e){t.forEach((function(t){Jt(t,e)}))}}function Qt(e){var t,n,r=(0,Gt.isMemo)(e)?e.type.type:e.type;return!("function"==typeof r&&!(null===(t=r.prototype)||void 0===t?void 0:t.render)||"function"==typeof e&&!(null===(n=e.prototype)||void 0===n?void 0:n.render))}function en(e,t,n,r){var o=l().unstable_batchedUpdates?function(e){l().unstable_batchedUpdates(n,e)}:n;return e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){e.removeEventListener&&e.removeEventListener(t,o,r)}}}function tn(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var nn=(0,t.forwardRef)((function(e,n){var r=e.didUpdate,o=e.getContainer,i=e.children,a=(0,t.useRef)(),s=(0,t.useRef)();(0,t.useImperativeHandle)(n,(function(){return{}}));var c=(0,t.useRef)(!1);return!c.current&&tn()&&(s.current=o(),a.current=s.current.parentNode,c.current=!0),(0,t.useEffect)((function(){null==r||r(e)})),(0,t.useEffect)((function(){return null===s.current.parentNode&&null!==a.current&&a.current.appendChild(s.current),function(){var e,t;null===(e=s.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(s.current)}}),[]),s.current?l().createPortal(i,s.current):null})),rn=n(184),on=n.n(rn);function an(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function sn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ln(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sn(e,t);var n=Object.prototype.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)?sn(e,t):void 0}}(e,t)||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 cn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var un,dn,fn,pn=(un=tn(),dn="undefined"!=typeof window?window:{},fn={animationend:cn("Animation","AnimationEnd"),transitionend:cn("Transition","TransitionEnd")},un&&("AnimationEvent"in dn||delete fn.animationend.animation,"TransitionEvent"in dn||delete fn.transitionend.transition),fn),mn={};if(tn()){var hn=document.createElement("div");mn=hn.style}var vn={};function gn(e){if(vn[e])return vn[e];var t=pn[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o<r;o+=1){var i=n[o];if(Object.prototype.hasOwnProperty.call(t,i)&&i in mn)return vn[e]=t[i],vn[e]}return""}var yn=gn("animationend"),bn=gn("transitionend"),wn=!(!yn||!bn),Cn=yn||"animationend",En=bn||"transitionend";function xn(e,t){return e?"object"===St(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var On="none",kn="appear",Sn="enter",Nn="leave",Tn="none",Dn="prepare",In="start",Pn="active",Mn="end";function Rn(e){var n=t.useRef(!1),r=ln(t.useState(e),2),o=r[0],i=r[1];return t.useEffect((function(){return n.current=!1,function(){n.current=!0}}),[]),[o,function(e,t){t&&n.current||i(e)}]}var An=tn()?t.useLayoutEffect:t.useEffect,Ln=[Dn,In,Pn,Mn];function jn(e){return e===Pn||e===Mn}function Fn(e,n,r,o){var i=o.motionEnter,a=void 0===i||i,s=o.motionAppear,l=void 0===s||s,c=o.motionLeave,u=void 0===c||c,d=o.motionDeadline,f=o.motionLeaveImmediately,p=o.onAppearPrepare,m=o.onEnterPrepare,h=o.onLeavePrepare,v=o.onAppearStart,g=o.onEnterStart,y=o.onLeaveStart,b=o.onAppearActive,w=o.onEnterActive,C=o.onLeaveActive,E=o.onAppearEnd,x=o.onEnterEnd,O=o.onLeaveEnd,k=o.onVisibleChanged,_=ln(Rn(),2),S=_[0],N=_[1],T=ln(Rn(On),2),D=T[0],I=T[1],P=ln(Rn(null),2),M=P[0],R=P[1],A=(0,t.useRef)(!1),L=(0,t.useRef)(null);function j(){return r()}var F=(0,t.useRef)(!1);function B(e){var t=j();if(!e||e.deadline||e.target===t){var n,r=F.current;D===kn&&r?n=null==E?void 0:E(t,e):D===Sn&&r?n=null==x?void 0:x(t,e):D===Nn&&r&&(n=null==O?void 0:O(t,e)),D!==On&&r&&!1!==n&&(I(On,!0),R(null,!0))}}var H=function(e){var n=(0,t.useRef)(),r=(0,t.useRef)(e);r.current=e;var o=t.useCallback((function(e){r.current(e)}),[]);function i(e){e&&(e.removeEventListener(En,o),e.removeEventListener(Cn,o))}return t.useEffect((function(){return function(){i(n.current)}}),[]),[function(e){n.current&&n.current!==e&&i(n.current),e&&e!==n.current&&(e.addEventListener(En,o),e.addEventListener(Cn,o),n.current=e)},i]}(B),V=ln(H,1)[0],W=t.useMemo((function(){var e,t,n;switch(D){case kn:return Nt(e={},Dn,p),Nt(e,In,v),Nt(e,Pn,b),e;case Sn:return Nt(t={},Dn,m),Nt(t,In,g),Nt(t,Pn,w),t;case Nn:return Nt(n={},Dn,h),Nt(n,In,y),Nt(n,Pn,C),n;default:return{}}}),[D]),U=ln(function(e,n){var r=ln(Rn(Tn),2),o=r[0],i=r[1],a=function(){var e=t.useRef(null);function n(){$t.cancel(e.current)}return t.useEffect((function(){return function(){n()}}),[]),[function t(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;n();var i=$t((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):t(r,o-1)}));e.current=i},n]}(),s=ln(a,2),l=s[0],c=s[1];return An((function(){if(o!==Tn&&o!==Mn){var e=Ln.indexOf(o),t=Ln[e+1],r=n(o);!1===r?i(t,!0):l((function(e){function n(){e.isCanceled()||i(t,!0)}!0===r?n():Promise.resolve(r).then(n)}))}}),[e,o]),t.useEffect((function(){return function(){c()}}),[]),[function(){i(Dn,!0)},o]}(D,(function(e){if(e===Dn){var t=W.prepare;return!!t&&t(j())}var n;return q in W&&R((null===(n=W[q])||void 0===n?void 0:n.call(W,j(),null))||null),q===Pn&&(V(j()),d>0&&(clearTimeout(L.current),L.current=setTimeout((function(){B({deadline:!0})}),d))),!0})),2),z=U[0],q=U[1],Y=jn(q);F.current=Y,An((function(){N(n);var t,r=A.current;A.current=!0,e&&(!r&&n&&l&&(t=kn),r&&n&&a&&(t=Sn),(r&&!n&&u||!r&&f&&!n&&u)&&(t=Nn),t&&(I(t),z()))}),[n]),(0,t.useEffect)((function(){(D===kn&&!l||D===Sn&&!a||D===Nn&&!u)&&I(On)}),[l,a,u]),(0,t.useEffect)((function(){return function(){A.current=!1,clearTimeout(L.current)}}),[]);var $=t.useRef(!1);(0,t.useEffect)((function(){S&&($.current=!0),void 0!==S&&D===On&&(($.current||S)&&(null==k||k(S)),$.current=!0)}),[S,D]);var X=M;return W.prepare&&q===In&&(X=Dt({transition:"none"},X)),[D,q,X,null!=S?S:n]}var Bn=function(e){jt(n,e);var t=Ht(n);function n(){return Pt(this,n),t.apply(this,arguments)}return Rt(n,[{key:"render",value:function(){return this.props.children}}]),n}(t.Component),Hn=Bn,Vn=function(e){var n=e;function r(e){return!(!e.motionName||!n)}"object"===St(e)&&(n=e.transitionSupport);var o=t.forwardRef((function(e,n){var o=e.visible,i=void 0===o||o,a=e.removeOnLeave,s=void 0===a||a,l=e.forceRender,c=e.children,u=e.motionName,d=e.leavedClassName,f=e.eventProps,p=r(e),m=(0,t.useRef)(),h=(0,t.useRef)(),v=ln(Fn(p,i,(function(){try{return m.current instanceof HTMLElement?m.current:Kt(h.current)}catch(e){return null}}),e),4),g=v[0],y=v[1],b=v[2],w=v[3],C=t.useRef(w);w&&(C.current=!0);var E,x=t.useCallback((function(e){m.current=e,Jt(n,e)}),[n]),O=Dt(Dt({},f),{},{visible:i});if(c)if(g!==On&&r(e)){var k,_;y===Dn?_="prepare":jn(y)?_="active":y===In&&(_="start"),E=c(Dt(Dt({},O),{},{className:on()(xn(u,g),(k={},Nt(k,xn(u,"".concat(g,"-").concat(_)),_),Nt(k,u,"string"==typeof u),k)),style:b}),x)}else E=w?c(Dt({},O),x):!s&&C.current?c(Dt(Dt({},O),{},{className:d}),x):l?c(Dt(Dt({},O),{},{style:{display:"none"}}),x):null;else E=null;return t.isValidElement(E)&&Qt(E)&&(E.ref||(E=t.cloneElement(E,{ref:x}))),t.createElement(Hn,{ref:h},E)}));return o.displayName="CSSMotion",o}(wn),Wn="add",Un="keep",zn="remove",qn="removed";function Yn(e){var t;return Dt(Dt({},t=e&&"object"===St(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function $n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(Yn)}function Xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=$n(e),a=$n(t);i.forEach((function(e){for(var t=!1,i=r;i<o;i+=1){var s=a[i];if(s.key===e.key){r<i&&(n=n.concat(a.slice(r,i).map((function(e){return Dt(Dt({},e),{},{status:Wn})}))),r=i),n.push(Dt(Dt({},s),{},{status:Un})),r+=1,t=!0;break}}t||n.push(Dt(Dt({},e),{},{status:zn}))})),r<o&&(n=n.concat(a.slice(r).map((function(e){return Dt(Dt({},e),{},{status:Wn})}))));var s={};n.forEach((function(e){var t=e.key;s[t]=(s[t]||0)+1}));var l=Object.keys(s).filter((function(e){return s[e]>1}));return l.forEach((function(e){n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==zn})),n.forEach((function(t){t.key===e&&(t.status=Un)}))})),n}var Kn=["component","children","onVisibleChanged","onAllRemoved"],Gn=["status"],Jn=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vn,r=function(e){jt(o,e);var r=Ht(o);function o(){var e;Pt(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r.call.apply(r,[this].concat(n))).state={keyEntities:[]},e.removeKey=function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:Dt(Dt({},e),{},{status:qn})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==qn})).length},e}return Rt(o,[{key:"render",value:function(){var e=this,r=this.state.keyEntities,o=this.props,i=o.component,s=o.children,l=o.onVisibleChanged,c=o.onAllRemoved,u=It(o,Kn),d=i||t.Fragment,f={};return Jn.forEach((function(e){f[e]=u[e],delete u[e]})),delete u.keys,t.createElement(d,u,r.map((function(r){var o=r.status,i=It(r,Gn),u=o===Wn||o===Un;return t.createElement(n,a({},f,{key:i.key,visible:u,eventProps:i,onVisibleChanged:function(t){null==l||l(t,{key:i.key}),t||0===e.removeKey(i.key)&&c&&c()}}),s)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,o=$n(n);return{keyEntities:Xn(r,o).filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==qn||e.status!==zn}))}}}]),o}(t.Component);r.defaultProps={component:"div"}}(wn);var Zn,Qn=Vn;function er(e){var t=e.prefixCls,n=e.motion,r=e.animation,o=e.transitionName;return n||(r?{motionName:"".concat(t,"-").concat(r)}:o?{motionName:o}:null)}function tr(e){var n=e.prefixCls,r=e.visible,o=e.zIndex,i=e.mask,s=e.maskMotion,l=e.maskAnimation,c=e.maskTransitionName;if(!i)return null;var u={};return(s||c||l)&&(u=Dt({motionAppear:!0},er({motion:s,prefixCls:n,transitionName:c,animation:l}))),t.createElement(Qn,a({},u,{visible:r,removeOnLeave:!0}),(function(e){var r=e.className;return t.createElement("div",{style:{zIndex:o},className:on()("".concat(n,"-mask"),r)})}))}function nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(n),!0).forEach((function(t){ir(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function or(e){return or="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},or(e)}function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ar={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function sr(){if(void 0!==Zn)return Zn;Zn="";var e=document.createElement("p").style;for(var t in ar)t+"Transform"in e&&(Zn=t);return Zn}function lr(){return sr()?"".concat(sr(),"TransitionProperty"):"transitionProperty"}function cr(){return sr()?"".concat(sr(),"Transform"):"transform"}function ur(e,t){var n=lr();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function dr(e,t){var n=cr();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var fr,pr=/matrix\((.*)\)/,mr=/matrix3d\((.*)\)/;function hr(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function vr(e,t,n){var r=n;if("object"!==or(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):fr(e,t);for(var o in t)t.hasOwnProperty(o)&&vr(e,o,t[o])}function gr(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[r])&&(n=o.body[r])}return n}function yr(e){return gr(e)}function br(e){return gr(e,!0)}function wr(e){var t=function(e){var t,n,r,o=e.ownerDocument,i=o.body,a=o&&o.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),r=Math.floor(t.top),{left:n-=a.clientLeft||i.clientLeft||0,top:r-=a.clientTop||i.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=yr(r),t.top+=br(r),t}function Cr(e){return null!=e&&e==e.window}function Er(e){return Cr(e)?e.document:9===e.nodeType?e:e.ownerDocument}var xr=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Or=/^(top|right|bottom|left)$/;function kr(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function _r(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function Sr(e,t,n){"static"===vr(e,"position")&&(e.style.position="relative");var r=-999,o=-999,i=kr("left",n),a=kr("top",n),s=_r(i),l=_r(a);"left"!==i&&(r=999),"top"!==a&&(o=999);var c,u="",d=wr(e);("left"in t||"top"in t)&&(u=(c=e).style.transitionProperty||c.style[lr()]||"",ur(e,"none")),"left"in t&&(e.style[s]="",e.style[i]="".concat(r,"px")),"top"in t&&(e.style[l]="",e.style[a]="".concat(o,"px")),hr(e);var f=wr(e),p={};for(var m in t)if(t.hasOwnProperty(m)){var h=kr(m,n),v="left"===m?r:o,g=d[m]-f[m];p[h]=h===m?v+g:v-g}vr(e,p),hr(e),("left"in t||"top"in t)&&ur(e,u);var y={};for(var b in t)if(t.hasOwnProperty(b)){var w=kr(b,n),C=t[b]-d[b];y[w]=b===w?p[w]+C:p[w]-C}vr(e,y)}function Nr(e,t){for(var n=0;n<e.length;n++)t(e[n])}function Tr(e){return"border-box"===fr(e,"boxSizing")}"undefined"!=typeof window&&(fr=window.getComputedStyle?function(e,t,n){var r=n,o="",i=Er(e);return(r=r||i.defaultView.getComputedStyle(e,null))&&(o=r.getPropertyValue(t)||r[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(xr.test(n)&&!Or.test(t)){var r=e.style,o=r.left,i=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,r.left="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r.left=o,e.runtimeStyle.left=i}return""===n?"auto":n});var Dr=["margin","border","padding"];function Ir(e,t,n){var r,o={},i=e.style;for(r in t)t.hasOwnProperty(r)&&(o[r]=i[r],i[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(i[r]=o[r])}function Pr(e,t,n){var r,o,i,a=0;for(o=0;o<t.length;o++)if(r=t[o])for(i=0;i<n.length;i++){var s;s="border"===r?"".concat(r).concat(n[i],"Width"):r+n[i],a+=parseFloat(fr(e,s))||0}return a}var Mr={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function Rr(e,t,n){var r=n;if(Cr(e))return"width"===t?Mr.viewportWidth(e):Mr.viewportHeight(e);if(9===e.nodeType)return"width"===t?Mr.docWidth(e):Mr.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],i="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),a=Tr(e),s=0;(null==i||i<=0)&&(i=void 0,(null==(s=fr(e,t))||Number(s)<0)&&(s=e.style[t]||0),s=Math.floor(parseFloat(s))||0),void 0===r&&(r=a?1:-1);var l=void 0!==i||a,c=i||s;return-1===r?l?c-Pr(e,["border","padding"],o):s:l?1===r?c:c+(2===r?-Pr(e,["border"],o):Pr(e,["margin"],o)):s+Pr(e,Dr.slice(r),o)}Nr(["Width","Height"],(function(e){Mr["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],Mr["viewport".concat(e)](n))},Mr["viewport".concat(e)]=function(t){var n="client".concat(e),r=t.document,o=r.body,i=r.documentElement[n];return"CSS1Compat"===r.compatMode&&i||o&&o[n]||i}}));var Ar={position:"absolute",visibility:"hidden",display:"block"};function Lr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=t[0];return 0!==o.offsetWidth?r=Rr.apply(void 0,t):Ir(o,Ar,(function(){r=Rr.apply(void 0,t)})),r}function jr(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Nr(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Mr["outer".concat(t)]=function(t,n){return t&&Lr(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];Mr[e]=function(t,r){var o=r;return void 0!==o?t?(Tr(t)&&(o+=Pr(t,["padding","border"],n)),vr(t,e,o)):void 0:t&&Lr(t,e,-1)}}));var Fr={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Er,offset:function(e,t,n){if(void 0===t)return wr(e);!function(e,t,n){if(n.ignoreShake){var r=wr(e),o=r.left.toFixed(0),i=r.top.toFixed(0),a=t.left.toFixed(0),s=t.top.toFixed(0);if(o===a&&i===s)return}n.useCssRight||n.useCssBottom?Sr(e,t,n):n.useCssTransform&&cr()in document.body.style?function(e,t){var n=wr(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(cr());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}(e),o={x:r.x,y:r.y};"left"in t&&(o.x=r.x+t.left-n.left),"top"in t&&(o.y=r.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),r=n.getPropertyValue("transform")||n.getPropertyValue(cr());if(r&&"none"!==r){var o,i=r.match(pr);i?((o=(i=i[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,o[5]=t.y,dr(e,"matrix(".concat(o.join(","),")"))):((o=r.match(mr)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,o[13]=t.y,dr(e,"matrix3d(".concat(o.join(","),")")))}else dr(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,o)}(e,t):Sr(e,t,n)}(e,t,n||{})},isWindow:Cr,each:Nr,css:vr,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:jr,getWindowScrollLeft:function(e){return yr(e)},getWindowScrollTop:function(e){return br(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)Fr.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};jr(Fr,Mr);var Br=Fr.getParent;function Hr(e){if(Fr.isWindow(e)||9===e.nodeType)return null;var t,n=Fr.getDocument(e).body,r=Fr.css(e,"position");if("fixed"!==r&&"absolute"!==r)return"html"===e.nodeName.toLowerCase()?null:Br(e);for(t=Br(e);t&&t!==n&&9!==t.nodeType;t=Br(t))if("static"!==(r=Fr.css(t,"position")))return t;return null}var Vr=Fr.getParent;function Wr(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=Hr(e),o=Fr.getDocument(e),i=o.defaultView||o.parentWindow,a=o.body,s=o.documentElement;r;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===r.clientWidth||r===a||r===s||"visible"===Fr.css(r,"overflow")){if(r===a||r===s)break}else{var l=Fr.offset(r);l.left+=r.clientLeft,l.top+=r.clientTop,n.top=Math.max(n.top,l.top),n.right=Math.min(n.right,l.left+r.clientWidth),n.bottom=Math.min(n.bottom,l.top+r.clientHeight),n.left=Math.max(n.left,l.left)}r=Hr(r)}var c=null;Fr.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===Fr.css(e,"position")&&(e.style.position="fixed"));var u=Fr.getWindowScrollLeft(i),d=Fr.getWindowScrollTop(i),f=Fr.viewportWidth(i),p=Fr.viewportHeight(i),m=s.scrollWidth,h=s.scrollHeight,v=window.getComputedStyle(a);if("hidden"===v.overflowX&&(m=i.innerWidth),"hidden"===v.overflowY&&(h=i.innerHeight),e.style&&(e.style.position=c),t||function(e){if(Fr.isWindow(e)||9===e.nodeType)return!1;var t=Fr.getDocument(e),n=t.body,r=null;for(r=Vr(e);r&&r!==n&&r!==t;r=Vr(r))if("fixed"===Fr.css(r,"position"))return!0;return!1}(e))n.left=Math.max(n.left,u),n.top=Math.max(n.top,d),n.right=Math.min(n.right,u+f),n.bottom=Math.min(n.bottom,d+p);else{var g=Math.max(m,u+f);n.right=Math.min(n.right,g);var y=Math.max(h,d+p);n.bottom=Math.min(n.bottom,y)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Ur(e){var t,n,r;if(Fr.isWindow(e)||9===e.nodeType){var o=Fr.getWindow(e);t={left:Fr.getWindowScrollLeft(o),top:Fr.getWindowScrollTop(o)},n=Fr.viewportWidth(o),r=Fr.viewportHeight(o)}else t=Fr.offset(e),n=Fr.outerWidth(e),r=Fr.outerHeight(e);return t.width=n,t.height=r,t}function zr(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,i=e.height,a=e.left,s=e.top;return"c"===n?s+=i/2:"b"===n&&(s+=i),"c"===r?a+=o/2:"r"===r&&(a+=o),{left:a,top:s}}function qr(e,t,n,r,o){var i=zr(t,n[1]),a=zr(e,n[0]),s=[a.left-i.left,a.top-i.top];return{left:Math.round(e.left-s[0]+r[0]-o[0]),top:Math.round(e.top-s[1]+r[1]-o[1])}}function Yr(e,t,n){return e.left<n.left||e.left+t.width>n.right}function $r(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function Xr(e,t,n){var r=[];return Fr.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Kr(e,t){return e[t]=-e[t],e}function Gr(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Jr(e,t){e[0]=Gr(e[0],t.width),e[1]=Gr(e[1],t.height)}function Zr(e,t,n,r){var o=n.points,i=n.offset||[0,0],a=n.targetOffset||[0,0],s=n.overflow,l=n.source||e;i=[].concat(i),a=[].concat(a);var c={},u=0,d=Wr(l,!(!(s=s||{})||!s.alwaysByViewport)),f=Ur(l);Jr(i,f),Jr(a,t);var p=qr(f,t,o,i,a),m=Fr.merge(f,p);if(d&&(s.adjustX||s.adjustY)&&r){if(s.adjustX&&Yr(p,f,d)){var h=Xr(o,/[lr]/gi,{l:"r",r:"l"}),v=Kr(i,0),g=Kr(a,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(qr(f,t,h,v,g),f,d)||(u=1,o=h,i=v,a=g)}if(s.adjustY&&$r(p,f,d)){var y=Xr(o,/[tb]/gi,{t:"b",b:"t"}),b=Kr(i,1),w=Kr(a,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(qr(f,t,y,b,w),f,d)||(u=1,o=y,i=b,a=w)}u&&(p=qr(f,t,o,i,a),Fr.mix(m,p));var C=Yr(p,f,d),E=$r(p,f,d);if(C||E){var x=o;C&&(x=Xr(o,/[lr]/gi,{l:"r",r:"l"})),E&&(x=Xr(o,/[tb]/gi,{t:"b",b:"t"})),o=x,i=n.offset||[0,0],a=n.targetOffset||[0,0]}c.adjustX=s.adjustX&&C,c.adjustY=s.adjustY&&E,(c.adjustX||c.adjustY)&&(m=function(e,t,n,r){var o=Fr.clone(e),i={width:t.width,height:t.height};return r.adjustX&&o.left<n.left&&(o.left=n.left),r.resizeWidth&&o.left>=n.left&&o.left+i.width>n.right&&(i.width-=o.left+i.width-n.right),r.adjustX&&o.left+i.width>n.right&&(o.left=Math.max(n.right-i.width,n.left)),r.adjustY&&o.top<n.top&&(o.top=n.top),r.resizeHeight&&o.top>=n.top&&o.top+i.height>n.bottom&&(i.height-=o.top+i.height-n.bottom),r.adjustY&&o.top+i.height>n.bottom&&(o.top=Math.max(n.bottom-i.height,n.top)),Fr.mix(o,i)}(p,f,d,c))}return m.width!==f.width&&Fr.css(l,"width",Fr.width(l)+m.width-f.width),m.height!==f.height&&Fr.css(l,"height",Fr.height(l)+m.height-f.height),Fr.offset(l,{left:m.left,top:m.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:i,targetOffset:a,overflow:c}}function Qr(e,t,n){var r=n.target||t,o=Ur(r),i=!function(e,t){var n=Wr(e,t),r=Ur(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return Zr(e,o,n,i)}Qr.__getOffsetParent=Hr,Qr.__getVisibleRectForElement=Wr;var eo={};function to(e,t){}var no=function(e,t){!function(e,t,n){t||eo[n]||(e(!1,n),eo[n]=!0)}(to,e,t)},ro=tn()?t.useLayoutEffect:t.useEffect,oo=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}()}(),io="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,ao=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),so="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(ao):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},lo=["top","right","bottom","left","width","height","size","weight"],co="undefined"!=typeof MutationObserver,uo=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){so(i)}function s(){var e=Date.now();if(n){if(e-o<2)return;r=!0}else n=!0,r=!1,setTimeout(a,20);o=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){io&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),co?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){io&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=lo.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),fo=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},po=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||ao},mo=bo(0,0,0,0);function ho(e){return parseFloat(e)||0}function vo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+ho(e["border-"+n+"-width"])}),0)}var go="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof po(e).SVGGraphicsElement}:function(e){return e instanceof po(e).SVGElement&&"function"==typeof e.getBBox};function yo(e){return io?go(e)?function(e){var t=e.getBBox();return bo(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return mo;var r=po(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=ho(i)}return t}(r),i=o.left+o.right,a=o.top+o.bottom,s=ho(r.width),l=ho(r.height);if("border-box"===r.boxSizing&&(Math.round(s+i)!==t&&(s-=vo(r,"left","right")+i),Math.round(l+a)!==n&&(l-=vo(r,"top","bottom")+a)),!function(e){return e===po(e).document.documentElement}(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return bo(o.left,o.top,s,l)}(e):mo}function bo(e,t,n,r){return{x:e,y:t,width:n,height:r}}var wo=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=bo(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=yo(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),Co=function(e,t){var n,r,o,i,a,s,l,c=(r=(n=t).x,o=n.y,i=n.width,a=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),fo(l,{x:r,y:o,width:i,height:a,top:o,right:r+i,bottom:a+o,left:r}),l);fo(this,{target:e,contentRect:c})},Eo=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new oo,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof po(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new wo(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof po(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new Co(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),xo="undefined"!=typeof WeakMap?new WeakMap:new oo,Oo=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=uo.getInstance(),r=new Eo(t,n,this);xo.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Oo.prototype[e]=function(){var t;return(t=xo.get(this))[e].apply(t,arguments)}}));var ko=void 0!==ao.ResizeObserver?ao.ResizeObserver:Oo;function _o(e,t){var n=null,r=null,o=new ko((function(e){var o=ln(e,1)[0].target;if(document.documentElement.contains(o)){var i=o.getBoundingClientRect(),a=i.width,s=i.height,l=Math.floor(a),c=Math.floor(s);n===l&&r===c||Promise.resolve().then((function(){t({width:l,height:c})})),n=l,r=c}}));return e&&o.observe(e),function(){o.disconnect()}}function So(e){return"function"!=typeof e?null:e()}function No(e){return"object"===St(e)&&e?e:null}var To=function(e,t){var n=e.children,o=e.disabled,i=e.target,a=e.align,s=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,u=void 0===c?0:c,d=r().useRef({}),f=r().useRef(),p=r().Children.only(n),m=r().useRef({});m.current.disabled=o,m.current.target=i,m.current.align=a,m.current.onAlign=s;var h=function(e,t){var n=r().useRef(!1),o=r().useRef(null);function i(){window.clearTimeout(o.current)}return[function e(r){if(i(),n.current&&!0!==r)o.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=m.current,t=e.disabled,n=e.target,r=e.align,o=e.onAlign,i=f.current;if(!t&&n&&i){var a,s=So(n),l=No(n);d.current.element=s,d.current.point=l,d.current.align=r;var c=document.activeElement;return s&&function(e){if(!e)return!1;if(e instanceof HTMLElement&&e.offsetParent)return!0;if(e instanceof SVGGraphicsElement&&e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e instanceof HTMLElement&&e.getBoundingClientRect){var o=e.getBoundingClientRect(),i=o.width,a=o.height;if(i||a)return!0}return!1}(s)?a=Qr(i,s,r):l&&(a=function(e,t,n){var r,o,i=Fr.getDocument(e),a=i.defaultView||i.parentWindow,s=Fr.getWindowScrollLeft(a),l=Fr.getWindowScrollTop(a),c=Fr.viewportWidth(a),u=Fr.viewportHeight(a),d={left:r="pageX"in t?t.pageX:s+t.clientX,top:o="pageY"in t?t.pageY:l+t.clientY,width:0,height:0},f=r>=0&&r<=s+c&&o>=0&&o<=l+u,p=[n.points[0],"cc"];return Zr(e,d,rr(rr({},n),{},{points:p}),f)}(i,l,r)),function(e,t){e!==document.activeElement&&Xt(t,e)&&"function"==typeof e.focus&&e.focus()}(c,i),o&&a&&o(i,a),!0}return!1}())return;n.current=!0,o.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,i()}]}(0,u),v=ln(h,2),g=v[0],y=v[1],b=ln(r().useState(),2),w=b[0],C=b[1],E=ln(r().useState(),2),x=E[0],O=E[1];return ro((function(){C(So(i)),O(No(i))})),r().useEffect((function(){var e,t;d.current.element===w&&((e=d.current.point)===(t=x)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;function o(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=r.has(e);if(no(!a,"Warning: There may be circular references"),a)return!1;if(e===t)return!0;if(n&&i>1)return!1;r.add(e);var s=i+1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var l=0;l<e.length;l++)if(!o(e[l],t[l],s))return!1;return!0}if(e&&t&&"object"===St(e)&&"object"===St(t)){var c=Object.keys(e);return c.length===Object.keys(t).length&&c.every((function(n){return o(e[n],t[n],s)}))}return!1}return o(e,t)}(d.current.align,a)||g()})),r().useEffect((function(){return _o(f.current,g)}),[f.current]),r().useEffect((function(){return _o(w,g)}),[w]),r().useEffect((function(){o?y():g()}),[o]),r().useEffect((function(){if(l)return en(window,"resize",g).remove}),[l]),r().useEffect((function(){return function(){y()}}),[]),r().useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),r().isValidElement(p)&&(p=r().cloneElement(p,{ref:Zt(p.ref,f)})),p},Do=r().forwardRef(To);Do.displayName="Align";var Io=Do;function Po(){Po=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new x(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function f(){}function p(){}var m={};s(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(O([])));v&&v!==t&&n.call(v,o)&&(m=v);var g=p.prototype=d.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(o,i,a,s){var l=c(e[o],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==St(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=p,s(g,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),s(g,a,"Generator"),s(g,o,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Mo(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Ro(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Mo(i,r,o,a,s,"next",e)}function s(e){Mo(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Ao=["measure","alignPre","align",null,"motion"],Lo=t.forwardRef((function(e,n){var r=e.visible,o=e.prefixCls,i=e.className,s=e.style,l=e.children,c=e.zIndex,u=e.stretch,d=e.destroyPopupOnHide,f=e.forceRender,p=e.align,m=e.point,h=e.getRootDomNode,v=e.getClassNameFromAlign,g=e.onAlign,y=e.onMouseEnter,b=e.onMouseLeave,w=e.onMouseDown,C=e.onTouchStart,E=e.onClick,x=(0,t.useRef)(),O=(0,t.useRef)(),k=ln((0,t.useState)(),2),_=k[0],S=k[1],N=function(e){var n=ln(t.useState({width:0,height:0}),2),r=n[0],o=n[1];return[t.useMemo((function(){var t={};if(e){var n=r.width,o=r.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,r]),function(e){var t=e.offsetWidth,n=e.offsetHeight,r=e.getBoundingClientRect(),i=r.width,a=r.height;Math.abs(t-i)<1&&Math.abs(n-a)<1&&(t=i,n=a),o({width:t,height:n})}]}(u),T=ln(N,2),D=T[0],I=T[1],P=function(e,n){var r=ln(Rn(null),2),o=r[0],i=r[1],a=(0,t.useRef)();function s(e){i(e,!0)}function l(){$t.cancel(a.current)}return(0,t.useEffect)((function(){s("measure")}),[e]),(0,t.useEffect)((function(){"measure"===o&&(u&&I(h())),o&&(a.current=$t(Ro(Po().mark((function e(){var t,n;return Po().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Ao.indexOf(o),(n=Ao[t+1])&&-1!==t&&s(n);case 3:case"end":return e.stop()}}),e)})))))}),[o]),(0,t.useEffect)((function(){return function(){l()}}),[]),[o,function(e){l(),a.current=$t((function(){s((function(e){switch(o){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r),M=ln(P,2),R=M[0],A=M[1],L=ln((0,t.useState)(0),2),j=L[0],F=L[1],B=(0,t.useRef)();function H(){var e;null===(e=x.current)||void 0===e||e.forceAlign()}function V(e,t){var n=v(t);_!==n&&S(n),F((function(e){return e+1})),"align"===R&&(null==g||g(e,t))}ro((function(){"alignPre"===R&&F(0)}),[R]),ro((function(){"align"===R&&(j<3?H():A((function(){var e;null===(e=B.current)||void 0===e||e.call(B)})))}),[j]);var W=Dt({},er(e));function U(){return new Promise((function(e){B.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=W[e];W[e]=function(e,n){return A(),null==t?void 0:t(e,n)}})),t.useEffect((function(){W.motionName||"motion"!==R||A()}),[W.motionName,R]),t.useImperativeHandle(n,(function(){return{forceAlign:H,getElement:function(){return O.current}}}));var z=Dt(Dt({},D),{},{zIndex:c,opacity:"motion"!==R&&"stable"!==R&&r?0:void 0,pointerEvents:r||"stable"===R?void 0:"none"},s),q=!0;null==p||!p.points||"align"!==R&&"stable"!==R||(q=!1);var Y=l;return t.Children.count(l)>1&&(Y=t.createElement("div",{className:"".concat(o,"-content")},l)),t.createElement(Qn,a({visible:r,ref:O,leavedClassName:"".concat(o,"-hidden")},W,{onAppearPrepare:U,onEnterPrepare:U,removeOnLeave:d,forceRender:f}),(function(e,n){var r=e.className,a=e.style,s=on()(o,i,_,r);return t.createElement(Io,{target:m||h,key:"popup",ref:x,monitorWindowResize:!0,disabled:q,align:p,onAlign:V},t.createElement("div",{ref:n,className:s,onMouseEnter:y,onMouseLeave:b,onMouseDownCapture:w,onTouchStartCapture:C,onClick:E,style:Dt(Dt({},a),z)},Y))}))}));Lo.displayName="PopupInner";var jo=Lo,Fo=t.forwardRef((function(e,n){var r=e.prefixCls,o=e.visible,i=e.zIndex,s=e.children,l=e.mobile,c=(l=void 0===l?{}:l).popupClassName,u=l.popupStyle,d=l.popupMotion,f=void 0===d?{}:d,p=l.popupRender,m=e.onClick,h=t.useRef();t.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return h.current}}}));var v=Dt({zIndex:i},u),g=s;return t.Children.count(s)>1&&(g=t.createElement("div",{className:"".concat(r,"-content")},s)),p&&(g=p(g)),t.createElement(Qn,a({visible:o,ref:h,removeOnLeave:!0},f),(function(e,n){var o=e.className,i=e.style,a=on()(r,c,o);return t.createElement("div",{ref:n,className:a,onClick:m,style:Dt(Dt({},i),v)},g)}))}));Fo.displayName="MobilePopupInner";var Bo=Fo,Ho=["visible","mobile"],Vo=t.forwardRef((function(e,n){var r=e.visible,o=e.mobile,i=It(e,Ho),s=ln((0,t.useState)(r),2),l=s[0],c=s[1],u=ln((0,t.useState)(!1),2),d=u[0],f=u[1],p=Dt(Dt({},i),{},{visible:l});(0,t.useEffect)((function(){c(r),r&&o&&f(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[r,o]);var m=d?t.createElement(Bo,a({},p,{mobile:o,ref:n})):t.createElement(jo,a({},p,{ref:n}));return t.createElement("div",null,t.createElement(tr,p),m)}));Vo.displayName="Popup";var Wo=Vo,Uo=t.createContext(null);function zo(){}var qo,Yo,$o=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],Xo=(qo=nn,Yo=function(e){jt(r,e);var n=Ht(r);function r(e){var o,i;return Pt(this,r),Nt(At(o=n.call(this,e)),"popupRef",t.createRef()),Nt(At(o),"triggerRef",t.createRef()),Nt(At(o),"portalContainer",void 0),Nt(At(o),"attachId",void 0),Nt(At(o),"clickOutsideHandler",void 0),Nt(At(o),"touchOutsideHandler",void 0),Nt(At(o),"contextMenuOutsideHandler1",void 0),Nt(At(o),"contextMenuOutsideHandler2",void 0),Nt(At(o),"mouseDownTimeout",void 0),Nt(At(o),"focusTime",void 0),Nt(At(o),"preClickTime",void 0),Nt(At(o),"preTouchTime",void 0),Nt(At(o),"delayTimer",void 0),Nt(At(o),"hasPopupMouseDown",void 0),Nt(At(o),"onMouseEnter",(function(e){var t=o.props.mouseEnterDelay;o.fireEvents("onMouseEnter",e),o.delaySetPopupVisible(!0,t,t?null:e)})),Nt(At(o),"onMouseMove",(function(e){o.fireEvents("onMouseMove",e),o.setPoint(e)})),Nt(At(o),"onMouseLeave",(function(e){o.fireEvents("onMouseLeave",e),o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)})),Nt(At(o),"onPopupMouseEnter",(function(){o.clearDelayTimer()})),Nt(At(o),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&Xt(null===(t=o.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)})),Nt(At(o),"onFocus",(function(e){o.fireEvents("onFocus",e),o.clearDelayTimer(),o.isFocusToShow()&&(o.focusTime=Date.now(),o.delaySetPopupVisible(!0,o.props.focusDelay))})),Nt(At(o),"onMouseDown",(function(e){o.fireEvents("onMouseDown",e),o.preClickTime=Date.now()})),Nt(At(o),"onTouchStart",(function(e){o.fireEvents("onTouchStart",e),o.preTouchTime=Date.now()})),Nt(At(o),"onBlur",(function(e){o.fireEvents("onBlur",e),o.clearDelayTimer(),o.isBlurToHide()&&o.delaySetPopupVisible(!1,o.props.blurDelay)})),Nt(At(o),"onContextMenu",(function(e){e.preventDefault(),o.fireEvents("onContextMenu",e),o.setPopupVisible(!0,e)})),Nt(At(o),"onContextMenuClose",(function(){o.isContextMenuToShow()&&o.close()})),Nt(At(o),"onClick",(function(e){if(o.fireEvents("onClick",e),o.focusTime){var t;if(o.preClickTime&&o.preTouchTime?t=Math.min(o.preClickTime,o.preTouchTime):o.preClickTime?t=o.preClickTime:o.preTouchTime&&(t=o.preTouchTime),Math.abs(t-o.focusTime)<20)return;o.focusTime=0}o.preClickTime=0,o.preTouchTime=0,o.isClickToShow()&&(o.isClickToHide()||o.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!o.state.popupVisible;(o.isClickToHide()&&!n||n&&o.isClickToShow())&&o.setPopupVisible(!o.state.popupVisible,e)})),Nt(At(o),"onPopupMouseDown",(function(){var e;o.hasPopupMouseDown=!0,clearTimeout(o.mouseDownTimeout),o.mouseDownTimeout=window.setTimeout((function(){o.hasPopupMouseDown=!1}),0),o.context&&(e=o.context).onPopupMouseDown.apply(e,arguments)})),Nt(At(o),"onDocumentClick",(function(e){if(!o.props.mask||o.props.maskClosable){var t=e.target,n=o.getRootDomNode(),r=o.getPopupDomNode();Xt(n,t)&&!o.isContextMenuOnly()||Xt(r,t)||o.hasPopupMouseDown||o.close()}})),Nt(At(o),"getRootDomNode",(function(){var e=o.props.getTriggerDOMNode;if(e)return e(o.triggerRef.current);try{var t=Kt(o.triggerRef.current);if(t)return t}catch(e){}return l().findDOMNode(At(o))})),Nt(At(o),"getPopupClassNameFromAlign",(function(e){var t=[],n=o.props,r=n.popupPlacement,i=n.builtinPlacements,a=n.prefixCls,s=n.alignPoint,l=n.getPopupClassNameFromAlign;return r&&i&&t.push(function(e,t,n,r){for(var o=n.points,i=Object.keys(e),a=0;a<i.length;a+=1){var s=i[a];if(an(e[s].points,o,r))return"".concat(t,"-placement-").concat(s)}return""}(i,a,e,s)),l&&t.push(l(e)),t.join(" ")})),Nt(At(o),"getComponent",(function(){var e=o.props,n=e.prefixCls,r=e.destroyPopupOnHide,i=e.popupClassName,s=e.onPopupAlign,l=e.popupMotion,c=e.popupAnimation,u=e.popupTransitionName,d=e.popupStyle,f=e.mask,p=e.maskAnimation,m=e.maskTransitionName,h=e.maskMotion,v=e.zIndex,g=e.popup,y=e.stretch,b=e.alignPoint,w=e.mobile,C=e.forceRender,E=e.onPopupClick,x=o.state,O=x.popupVisible,k=x.point,_=o.getPopupAlign(),S={};return o.isMouseEnterToShow()&&(S.onMouseEnter=o.onPopupMouseEnter),o.isMouseLeaveToHide()&&(S.onMouseLeave=o.onPopupMouseLeave),S.onMouseDown=o.onPopupMouseDown,S.onTouchStart=o.onPopupMouseDown,t.createElement(Wo,a({prefixCls:n,destroyPopupOnHide:r,visible:O,point:b&&k,className:i,align:_,onAlign:s,animation:c,getClassNameFromAlign:o.getPopupClassNameFromAlign},S,{stretch:y,getRootDomNode:o.getRootDomNode,style:d,mask:f,zIndex:v,transitionName:u,maskAnimation:p,maskTransitionName:m,maskMotion:h,ref:o.popupRef,motion:l,mobile:w,forceRender:C,onClick:E}),"function"==typeof g?g():g)})),Nt(At(o),"attachParent",(function(e){$t.cancel(o.attachId);var t,n=o.props,r=n.getPopupContainer,i=n.getDocument,a=o.getRootDomNode();r?(a||0===r.length)&&(t=r(a)):t=i(o.getRootDomNode()).body,t?t.appendChild(e):o.attachId=$t((function(){o.attachParent(e)}))})),Nt(At(o),"getContainer",(function(){if(!o.portalContainer){var e=(0,o.props.getDocument)(o.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",o.portalContainer=e}return o.attachParent(o.portalContainer),o.portalContainer})),Nt(At(o),"setPoint",(function(e){o.props.alignPoint&&e&&o.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Nt(At(o),"handlePortalUpdate",(function(){o.state.prevPopupVisible!==o.state.popupVisible&&o.props.afterPopupVisibleChange(o.state.popupVisible)})),Nt(At(o),"triggerContextValue",{onPopupMouseDown:o.onPopupMouseDown}),i="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,o.state={prevPopupVisible:i,popupVisible:i},$o.forEach((function(e){o["fire".concat(e)]=function(t){o.fireEvents(e,t)}})),o}return Rt(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=en(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=en(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=en(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=en(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),$t.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,r=e.builtinPlacements;return t&&r?function(e,t,n){return Dt(Dt({},e[t]||{}),n)}(r,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,r=this.state.popupVisible;this.clearDelayTimer(),r!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:r}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var r=this,o=1e3*t;if(this.clearDelayTimer(),o){var i=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){r.setPopupVisible(e,i),r.clearDelayTimer()}),o)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var r=this.props[e];r&&r(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var e=this.state.popupVisible,n=this.props,r=n.children,o=n.forceRender,i=n.alignPoint,a=n.className,s=n.autoDestroy,l=t.Children.only(r),c={key:"trigger"};this.isContextMenuToShow()?c.onContextMenu=this.onContextMenu:c.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(c.onClick=this.onClick,c.onMouseDown=this.onMouseDown,c.onTouchStart=this.onTouchStart):(c.onClick=this.createTwoChains("onClick"),c.onMouseDown=this.createTwoChains("onMouseDown"),c.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(c.onMouseEnter=this.onMouseEnter,i&&(c.onMouseMove=this.onMouseMove)):c.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?c.onMouseLeave=this.onMouseLeave:c.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(c.onFocus=this.onFocus,c.onBlur=this.onBlur):(c.onFocus=this.createTwoChains("onFocus"),c.onBlur=this.createTwoChains("onBlur"));var u=on()(l&&l.props&&l.props.className,a);u&&(c.className=u);var d=Dt({},c);Qt(l)&&(d.ref=Zt(this.triggerRef,l.ref));var f,p=t.cloneElement(l,d);return(e||this.popupRef.current||o)&&(f=t.createElement(qo,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!e&&s&&(f=null),t.createElement(Uo.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,r={};return void 0!==n&&t.popupVisible!==n&&(r.popupVisible=n,r.prevPopupVisible=t.popupVisible),r}}]),r}(t.Component),Nt(Yo,"contextType",Uo),Nt(Yo,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:function(){return""},getDocument:function(e){return e?e.ownerDocument:window.document},onPopupVisibleChange:zo,afterPopupVisibleChange:zo,onPopupAlign:zo,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),Yo),Ko={adjustX:1,adjustY:1},Go=[0,0],Jo={left:{points:["cr","cl"],overflow:Ko,offset:[-4,0],targetOffset:Go},right:{points:["cl","cr"],overflow:Ko,offset:[4,0],targetOffset:Go},top:{points:["bc","tc"],overflow:Ko,offset:[0,-4],targetOffset:Go},bottom:{points:["tc","bc"],overflow:Ko,offset:[0,4],targetOffset:Go},topLeft:{points:["bl","tl"],overflow:Ko,offset:[0,-4],targetOffset:Go},leftTop:{points:["tr","tl"],overflow:Ko,offset:[-4,0],targetOffset:Go},topRight:{points:["br","tr"],overflow:Ko,offset:[0,-4],targetOffset:Go},rightTop:{points:["tl","tr"],overflow:Ko,offset:[4,0],targetOffset:Go},bottomRight:{points:["tr","br"],overflow:Ko,offset:[0,4],targetOffset:Go},rightBottom:{points:["bl","br"],overflow:Ko,offset:[4,0],targetOffset:Go},bottomLeft:{points:["tl","bl"],overflow:Ko,offset:[0,4],targetOffset:Go},leftBottom:{points:["br","bl"],overflow:Ko,offset:[-4,0],targetOffset:Go}};function Zo(e){var n=e.showArrow,r=e.arrowContent,o=e.children,i=e.prefixCls,a=e.id,s=e.overlayInnerStyle,l=e.className,c=e.style;return t.createElement("div",{className:on()("".concat(i,"-content"),l),style:c},!1!==n&&t.createElement("div",{className:"".concat(i,"-arrow"),key:"arrow"},r),t.createElement("div",{className:"".concat(i,"-inner"),id:a,role:"tooltip",style:s},"function"==typeof o?o():o))}var Qo=function(e,n){var r=e.overlayClassName,o=e.trigger,i=void 0===o?["hover"]:o,s=e.mouseEnterDelay,l=void 0===s?0:s,c=e.mouseLeaveDelay,u=void 0===c?.1:c,d=e.overlayStyle,f=e.prefixCls,p=void 0===f?"rc-tooltip":f,m=e.children,h=e.onVisibleChange,v=e.afterVisibleChange,g=e.transitionName,y=e.animation,b=e.motion,w=e.placement,C=void 0===w?"right":w,E=e.align,x=void 0===E?{}:E,O=e.destroyTooltipOnHide,k=void 0!==O&&O,_=e.defaultVisible,S=e.getTooltipContainer,N=e.overlayInnerStyle,T=e.arrowContent,D=e.overlay,I=e.id,P=e.showArrow,M=It(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),R=(0,t.useRef)(null);(0,t.useImperativeHandle)(n,(function(){return R.current}));var A=Dt({},M);"visible"in e&&(A.popupVisible=e.visible);var L=!1,j=!1;if("boolean"==typeof k)L=k;else if(k&&"object"===St(k)){var F=k.keepParent;L=!0===F,j=!1===F}return t.createElement(Xo,a({popupClassName:r,prefixCls:p,popup:function(){return t.createElement(Zo,{showArrow:P,arrowContent:T,key:"content",prefixCls:p,id:I,overlayInnerStyle:N},D)},action:i,builtinPlacements:Jo,popupPlacement:C,ref:R,popupAlign:x,getPopupContainer:S,onPopupVisibleChange:h,afterPopupVisibleChange:v,popupTransitionName:g,popupAnimation:y,popupMotion:b,defaultPopupVisible:_,destroyPopupOnHide:L,autoDestroy:j,mouseLeaveDelay:u,popupStyle:d,mouseEnterDelay:l},A),m)},ei=(0,t.forwardRef)(Qo),ti=t=>{var n,r;const{item:o,index:i,parent:a}=t;return(0,e.createElement)("div",{className:"mmu-menu-item-details"},(0,e.createElement)("div",{className:"mmu-menu-item-summary"},(0,e.createElement)("div",{className:"mmu-menu-item-meta mmu-menu-item-title "+(o.markedForDelete?" mmu-menu-item-title--delete":"")},o.title),(0,e.createElement)("div",{className:"mmu-menu-item-meta mmu-menu-item-url"},(0,e.createElement)(ei,{placement:"right",mouseEnterDelay:0,mouseLeaveDelay:.1,trigger:null!==(n=window.MMU)&&void 0!==n&&n.can_use_premium_code?["click"]:["none"],overlay:(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"mmu-menu-item-tooltop-options"},(0,e.createElement)("div",null,(0,e.createElement)("a",{href:o.goto_link,target:"_blank"},"View")),o.edit_link&&(0,e.createElement)("div",null,(0,e.createElement)("a",{target:"_blank",href:o.edit_link},"Edit"))))},(0,e.createElement)("div",null,o.display_link)),null!==(r=window.MMU)&&void 0!==r&&r.debug?(0,e.createElement)("div",null,"INDEX: ",i," | ",o.ID,":",o.title," | parent id: ",a?a.ID:"null"," | parent expanded: ",a&&a.expanded?"true":"false"," | expanded: ",o.expanded?"true":"false"," | depth: ",o.depth):""),Array.isArray(o.object_fields)&&o.object_fields.map((t=>{if(void 0!==t.field_label&&""!=t.field_label&&void 0!==t.field_value&&null!=t.field_value&&""!=t.field_value&&"object"!=typeof t.field_value&&!Array.isArray(t.field_value))return(0,e.createElement)("div",{key:t.field_key,className:"mmu-menu-item-meta mmu-menu-item-"+t.field_key},(0,e.createElement)("span",{className:"mmu-menu-item-meta-label"},t.field_label,": "),(0,e.createElement)("span",{className:"mmu-menu-item-meta-value"},t.field_value))}))))};n(227);const ni="false",ri="app",oi=(ni.toLowerCase(),"/mm_ultra/v1");var ii=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]},ai=void 0;const si="utils",li=function(e,t){ii(si,"processing new items",t);let n=[...e];for(const e of t){let t=-1;if(e.parentItem=null,e.markedForDelete=!1,!e.list_initialized){e.list_initialized=!0;const r=parseInt(e.menu_item_parent)||0;if(r>0&&(t=n.findIndex((e=>e.ID==r)),t>-1&&(e.parentItem=n[t])),e.depth=0,e.childCount=0,n.push(e),null!=e.parentItem){let t;[t,n]=fi(n,e.parentItem)}}}return ii(si,"new items processed",n),n},ci=(e,t)=>{let n=[...e];const r=mi(e,t),o=pi(e,t);return n[o].childCount=r.length,0==n[o].childCount&&(n[o].has_fetchable_children=!1,n[o].expanded=!1),n},ui=(e,t,n)=>{let r=[...e];const o=pi(r,t),i=pi(r,n);if(i>-1){t.depth=n.depth+1,t.parentItem=n,t.menu_item_parent=n.ID;const e=mi(r,n);r[i].childCount=e.length,r[o]=t}return r},di=function(e,t){let n=[...e];const r=pi(n,t);if(r>-1){const e=n[r].parentItem;n[r].depth=0,n[r].menu_item_parent=0,n[r].parentItem=null,null!=e&&(n[pi(n,e)].childCount=ci(n,e))}return n},fi=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;const r=hi(e,t);let o,i=[...e],a=-1,s=pi(e,t);if(-1==n&&(n=s),ii(si,"moving children into place",t,s,r),r.length>0)for(t.childCount=r.length,o=0;o<r.length;o++)a=pi(i,r[o]),a>-1&&(a>n&&n++,ii(si,"child item / parent item",r[o],t),i[a].depth=t.depth+1,i[a].parentItem=t,i[a].menu_item_parent=t.ID,ii(si,"Moving item "+r[o].ID.toString()+" as child: index "+a.toString()+" to next insertion point: "+n.toString()),Ci(i,a,n),hi(i,r[o]).length>0&&(ii(si,"recursing child move"),[n,i]=fi(i,r[o],n)));return[n,i]},pi=(e,t)=>e.findIndex((e=>e.ID==t.ID)),mi=(e,t)=>gi(e,(e=>e.menu_item_parent==t.ID)),hi=(e,t)=>e.filter((e=>e.menu_item_parent==t.ID)),vi=(e,t)=>{if(t.menu_item_parent){const n=e.findIndex((e=>e.ID==t.menu_item_parent));if(n>-1)return e[n]}return null},gi=(e,t)=>e.reduce(((e,n,r)=>t.call(void 0,n)?[...e,r]:[...e]),[]),yi=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{applyToChildren:!1},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const{applyToChildren:i}=r;let a=[...e];if(t.ID){const s=e.findIndex((e=>e.ID===t.ID));if(s>-1&&(a[s]=n.call(ai,t,o),i)){const e=gi(a,(e=>e&&e.menu_item_parent==t.ID));if(e.length>0){let t,i;for(t=0;t<e.length;t++)i=a[e[t]],o++,a=yi(a,i,n,r,o),o--}}}return a},bi=function(e,t){const n=e.findIndex((e=>e.ID==t));return n>-1?e[n]:null},wi=function(e,t){const n=e.findIndex((e=>e.ID==t.ID));if(n>-1){const r=[...e];return r[n]=t,r}return e};function Ci(e,t,n){const r=t<0?e.length+t:t;if(r>=0&&r<e.length){const r=n<0?e.length+n:n,[o]=e.splice(t,1);ii(si,"moved out item",o),e.splice(r,0,o)}}const Ei=()=>"xxxx-xxxx".replace(/x/g,(()=>Math.floor(12*Math.random()).toString(12)));function xi(e){return function(t){return!!t.type&&t.type.tabsRole===e}}var Oi=xi("Tab"),ki=xi("TabList"),_i=xi("TabPanel");function Si(){return Si=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Si.apply(this,arguments)}function Ni(e,n){return t.Children.map(e,(function(e){return null===e?null:function(e){return Oi(e)||ki(e)||_i(e)}(e)?n(e):e.props&&e.props.children&&"object"==typeof e.props.children?(0,t.cloneElement)(e,Si({},e.props,{children:Ni(e.props.children,n)})):e}))}function Ti(e,n){return t.Children.forEach(e,(function(e){null!==e&&(Oi(e)||_i(e)?n(e):e.props&&e.props.children&&"object"==typeof e.props.children&&(ki(e)&&n(e),Ti(e.props.children,n)))}))}function Di(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Di(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var Ii=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Di(e))&&(r&&(r+=" "),r+=t);return r},Pi=0;function Mi(){return"react-tabs-"+Pi++}function Ri(e){var t=0;return Ti(e,(function(e){Oi(e)&&t++})),t}var Ai,Li=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function ji(){return ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(this,arguments)}function Fi(e){return e&&"getAttribute"in e}function Bi(e){return Fi(e)&&e.getAttribute("data-rttab")}function Hi(e){return Fi(e)&&"true"===e.getAttribute("aria-disabled")}var Vi=function(e){var n=(0,t.useRef)([]),o=(0,t.useRef)([]),i=(0,t.useRef)([]),a=(0,t.useRef)();function s(t,n){t<0||t>=u()||(0,e.onSelect)(t,e.selectedIndex,n)}function l(e){for(var t=u(),n=e+1;n<t;n++)if(!Hi(d(n)))return n;for(var r=0;r<e;r++)if(!Hi(d(r)))return r;return e}function c(e){for(var t=e;t--;)if(!Hi(d(t)))return t;for(t=u();t-- >e;)if(!Hi(d(t)))return t;return e}function u(){return Ri(e.children)}function d(e){return n.current["tabs-"+e]}function f(e){var t=e.target;do{if(p(t)){if(Hi(t))return;return void s([].slice.call(t.parentNode.children).filter(Bi).indexOf(t),e)}}while(null!=(t=t.parentNode))}function p(e){if(!Bi(e))return!1;var t=e.parentElement;do{if(t===a.current)return!0;if(t.getAttribute("data-rttabs"))break;t=t.parentElement}while(t);return!1}e.children;var m=e.className,h=(e.disabledTabClassName,e.domRef),v=(e.focus,e.forceRenderTabPanel,e.onSelect,e.selectedIndex,e.selectedTabClassName,e.selectedTabPanelClassName,e.environment,e.disableUpDownKeys,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Li));return r().createElement("div",ji({},v,{className:Ii(m),onClick:f,onKeyDown:function(t){var n=e.direction,r=e.disableUpDownKeys;if(p(t.target)){var o=e.selectedIndex,i=!1,a=!1;"Space"!==t.code&&32!==t.keyCode&&"Enter"!==t.code&&13!==t.keyCode||(i=!0,a=!1,f(t)),"ArrowLeft"!==t.code&&37!==t.keyCode&&(r||38!==t.keyCode&&"ArrowUp"!==t.code)?"ArrowRight"!==t.code&&39!==t.keyCode&&(r||40!==t.keyCode&&"ArrowDown"!==t.code)?35===t.keyCode||"End"===t.code?(o=function(){for(var e=u();e--;)if(!Hi(d(e)))return e;return null}(),i=!0,a=!0):36!==t.keyCode&&"Home"!==t.code||(o=function(){for(var e=u(),t=0;t<e;t++)if(!Hi(d(t)))return t;return null}(),i=!0,a=!0):(o="rtl"===n?c(o):l(o),i=!0,a=!0):(o="rtl"===n?l(o):c(o),i=!0,a=!0),i&&t.preventDefault(),a&&s(o,t)}},ref:function(e){a.current=e,h&&h(e)},"data-rttabs":!0}),function(){var a=0,s=e.children,l=e.disabledTabClassName,c=e.focus,f=e.forceRenderTabPanel,p=e.selectedIndex,m=e.selectedTabClassName,h=e.selectedTabPanelClassName,v=e.environment;o.current=o.current||[],i.current=i.current||[];for(var g=o.current.length-u();g++<0;)o.current.push(Mi()),i.current.push(Mi());return Ni(s,(function(e){var s=e;if(ki(e)){var u=0,g=!1;null==Ai&&function(e){var t=e||("undefined"!=typeof window?window:void 0);try{Ai=!(void 0===t||!t.document||!t.document.activeElement)}catch(e){Ai=!1}}(v);var y=v||("undefined"!=typeof window?window:void 0);Ai&&y&&(g=r().Children.toArray(e.props.children).filter(Oi).some((function(e,t){return y.document.activeElement===d(t)}))),s=(0,t.cloneElement)(e,{children:Ni(e.props.children,(function(e){var r="tabs-"+u,a=p===u,s={tabRef:function(e){n.current[r]=e},id:o.current[u],panelId:i.current[u],selected:a,focus:a&&(c||g)};return m&&(s.selectedClassName=m),l&&(s.disabledClassName=l),u++,(0,t.cloneElement)(e,s)}))})}else if(_i(e)){var b={id:i.current[a],tabId:o.current[a],selected:p===a};f&&(b.forceRender=f),h&&(b.selectedClassName=h),a++,s=(0,t.cloneElement)(e,b)}return s}))}())};Vi.defaultProps={className:"react-tabs",focus:!1},Vi.propTypes={};var Wi=Vi;function Ui(){return Ui=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ui.apply(this,arguments)}var zi=function(e){var n=e.children,o=e.defaultFocus,i=e.defaultIndex,a=e.focusTabOnClick,s=e.onSelect,l=(0,t.useState)(o),c=l[0],u=l[1],d=(0,t.useState)(function(e){return null===e.selectedIndex?1:0}(e)),f=d[0],p=(0,t.useState)(1===f?i||0:null),m=p[0],h=p[1];if((0,t.useEffect)((function(){u(!1)}),[]),1===f){var v=Ri(n);(0,t.useEffect)((function(){if(null!=m){var e=Math.max(0,v-1);h(Math.min(m,e))}}),[v])}var g=Ui({},e);return g.focus=c,g.onSelect=function(e,t,n){"function"==typeof s&&!1===s(e,t,n)||(a&&u(!0),1===f&&h(e))},null!=m&&(g.selectedIndex=m),delete g.defaultFocus,delete g.defaultIndex,delete g.focusTabOnClick,r().createElement(Wi,g,n)};zi.propTypes={},zi.defaultProps={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1},zi.tabsRole="Tabs";var qi=zi,Yi=["children","className"];function $i(){return $i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$i.apply(this,arguments)}var Xi=function(e){var t=e.children,n=e.className,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Yi);return r().createElement("ul",$i({},o,{className:Ii(n),role:"tablist"}),t)};Xi.tabsRole="TabList",Xi.propTypes={},Xi.defaultProps={className:"react-tabs__tab-list"};var Ki=Xi,Gi=["children","className","disabled","disabledClassName","focus","id","panelId","selected","selectedClassName","tabIndex","tabRef"];function Ji(){return Ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ji.apply(this,arguments)}var Zi="react-tabs__tab",Qi={className:Zi,disabledClassName:Zi+"--disabled",focus:!1,id:null,panelId:null,selected:!1,selectedClassName:Zi+"--selected"},ea=function(e){var n,o=(0,t.useRef)(),i=e.children,a=e.className,s=e.disabled,l=e.disabledClassName,c=e.focus,u=e.id,d=e.panelId,f=e.selected,p=e.selectedClassName,m=e.tabIndex,h=e.tabRef,v=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Gi);return(0,t.useEffect)((function(){f&&c&&o.current.focus()}),[f,c]),r().createElement("li",Ji({},v,{className:Ii(a,(n={},n[p]=f,n[l]=s,n)),ref:function(e){o.current=e,h&&h(e)},role:"tab",id:u,"aria-selected":f?"true":"false","aria-disabled":s?"true":"false","aria-controls":d,tabIndex:m||(f?"0":null),"data-rttab":!0}),i)};ea.propTypes={},ea.tabsRole="Tab",ea.defaultProps=Qi;var ta=ea,na=["children","className","forceRender","id","selected","selectedClassName","tabId"];function ra(){return ra=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ra.apply(this,arguments)}var oa={className:"react-tabs__tab-panel",forceRender:!1,selectedClassName:"react-tabs__tab-panel--selected"},ia=function(e){var t,n=e.children,o=e.className,i=e.forceRender,a=e.id,s=e.selected,l=e.selectedClassName,c=e.tabId,u=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,na);return r().createElement("div",ra({},u,{className:Ii(o,(t={},t[l]=s,t)),role:"tabpanel",id:a,"aria-labelledby":c}),i||s?n:null)};ia.tabsRole="TabPanel",ia.propTypes={},ia.defaultProps=oa;var aa=ia,sa=n(568),la=n.n(sa);const ca={main:"Main",advanced:"Advanced"};var ua=n=>{const r=(0,t.useContext)(kt),{forItemType:o,item:i,origItem:a,fieldEditEventHandler:s}=n,l=(0,t.useRef)([{name:"object_id",key:"post_object_id",label:"Page/Post ID",input_type:"none",show_for_item_type:["post_type"],fieldset:ca.main},{name:"object_title",key:"post_object_title",label:"Page/Post Title",input_type:"none",show_for_item_type:["post_type"],fieldset:ca.main},{name:"object_id",key:"taxonomy_object_id",label:"Category ID",input_type:"none",show_for_item_type:["taxonomy"],fieldset:ca.main},{name:"object_title",key:"taxonomy_object_title",label:"Category Title",input_type:"none",show_for_item_type:["taxonomy"],fieldset:ca.main},{name:"title",key:"title",label:"Menu Item Title",input_type:"text",fieldset:ca.main},{name:"description",key:"description",label:"Description",input_type:"text",fieldset:ca.advanced},{name:"title_attr",key:"title_attr",label:"Title Attribute",input_type:"text",fieldset:ca.advanced},{name:"target",key:"target",label:"Open in New Window",input_type:"checkbox",value_unset:"",value:"_blank",fieldset:ca.advanced},{name:"classes",key:"classes",label:"CSS Classes",input_type:"text",editable_data_type:"string",fieldset:ca.advanced},{name:"url",key:"url",label:"URL",input_type:"text",editable_data_type:"string",fieldset:ca.main,show_for_item_type:["custom"]}]);(0,t.useEffect)((()=>{r.isSaving||u()}),[r.menuItems,a,i]);const c=e=>{let t={};for(const n of l.current)t[n.key]=f(e,n);return t},u=()=>{if(a&&null!=a.current){const e=c(a.current),t=c(i);la()(JSON.stringify(e))==la()(JSON.stringify(t))?(ii(ri,"item fully reverted"),r.unMarkChangedItem(i,r.menuItemChangeTypes.edit)):r.markChangedItem(i,r.menuItemChangeTypes.edit)}},d=(0,t.useCallback)((e=>l.current.filter((t=>t.fieldset==ca[e]&&(!(null!=t&&t.show_for_item_type)||(null==t?void 0:t.show_for_item_type.includes(i.type)))))),[l.current,i.type]),f=(e,t)=>{const n=t.name;if(n){const t=void 0!==e[n]?e[n]:null;return ii(ri,"Item field value for ",n,t),t}return null},p=e=>s(e),m=e=>{var t,n;const o=null!==(t=null===(n=e.target)||void 0===n?void 0:n.getAttribute("data-field-key"))&&void 0!==t?t:null;if(o){const t=l.current.findIndex((e=>e.key==o));if(t<=-1)ii(ri,`Could not find key ${o} in editableFields`);else{const n=l.current[t];if("array"==n.storage_type){var a,s;const t=null===(a=e.target)||void 0===a||null===(s=a.value)||void 0===s?void 0:s.toString().split(" ");i[o]=t}else{let t;t="checkbox"==n.input_type?e.target.checked?n.value:void 0!==n.value_unset?n.value_unset:null:e.target.value,i[o]=t}r.setMenuItems(wi(r.menuItems,i)),r.markChangedItem(i,r.menuItemChangeTypes.edit),ii(ri,"updated items after field change",r.menuItems)}}else ii(ri,"Invalid or missing field key when editing")};return(0,e.createElement)("div",{className:"mmu-editor-form"},(0,e.createElement)("div",{className:"mmu-editor-form-fields"},Object.keys(ca).map((t=>{let n=[];return"main"!=t&&n.push(),n.push(d(t).map((t=>{let n=f(i,t),s=((e,t)=>{if(a&&null!=a.current&&t.show_for_item_type&&a.current.type!=t.show_for_item_type&&!r.itemWasChanged(e))return null;let n=f(e,t);return"string"==t.editable_data_type&&Array.isArray(n)?n=n.join(" "):"checkbox"==t.input_type&&(n=t.value),n})(i,t),l="checkbox"==t.input_type&&n==s;return t.label,(0,e.createElement)("div",{key:t.key,className:"mmu-editor-field"},(0,e.createElement)("label",{htmlFor:"mmu-input-"+o+"-"+t.key},t.label),"none"!=t.input_type?(0,e.createElement)("input",{"data-field-key":t.key,id:"mmu-input-"+o+"-"+t.key,type:t.input_type,name:t.name,defaultChecked:l,onKeyDown:p,onChange:m,defaultValue:s}):(0,e.createElement)("span",{className:"mmu-editor-field-value-static"},s))}))),"main"!=t?(0,e.createElement)("details",null,(0,e.createElement)("summary",null,ca[t]),(0,e.createElement)("div",{className:"mmu-editor-form-fields"},n)):n}))))},da=window.wp.apiFetch,fa=n.n(da);n(666);const pa="Error fetching data from backend",ma=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{debug_category:n="API",messages:r=[],message_base:o=pa}=t;Array.isArray(r)||(r=[r]),e.response&&(ii(n,"Data",e.response.data),ii(n,"Status",e.response.status),ii(n,"Headers",e.response.headers)),e.request&&ii(n,"Request",e.request),e.message&&ii(n,e.message);const i=o+"\n"+r.join("\n")+"\n";throw new Error(i,{originalError:e})},ha=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{assertFieldValues:n}=t;let r=!1;if(e&&void 0!==e.status&&"success"==e.status&&(r=!0),!r){let t=pa;throw e&&(void 0!==e.message&&e.message&&(t=t+"\n"+e.message),void 0!==e.messages&&e.messages&&(t=Array.isArray(e.messages)?t+"\n"+e.messages.join("\n"):t+"\n"+e.messages)),new Error(t)}if(null!=n){let t;for(t in n)if(void 0===e[n[t]])throw new Error("Missing field key '"+n[t].toString()+"' in response")}return r},va="PostService",ga={fetchResults:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=await fa()({path:"/mm_ultra/v1/posts/search",method:"POST",data:{search_key:e,type_filter:n,offset:t}}).catch((e=>{ma(e)}));if(ii(va,"response",r),void 0!==r.results&&Array.isArray(r.results))return r;throw ii(va,"Invalid results returned from API",r),new Error("Invalid response data from API")},fetchPost:async(e,t)=>{t||(t="/mm_ultra/v1"),ii(va,"endpoint is",`${t}/post/${e}`);const n=await fa()({path:`${t}/post/${e}/get`,method:"GET"}).catch((e=>{ma(e)}));if(ii(va,"response",n),void 0!==n.post)return n.post;throw ii(va,"Invalid results returned from API",n),new Error("Invalid response data from API")}};var ya=ga;const ba="TaxonomyService",wa={fetchResults:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=await fa()({path:"/mm_ultra/v1/taxonomy/search",method:"POST",data:{search_key:e,type_filter:n,offset:t}}).catch((e=>{ma(e)}));if(ii(ba,"response",r),void 0!==r.results&&Array.isArray(r.results))return r;throw ii(ba,"Invalid results returned from API",r),new Error("Invalid response data from API")}};var Ca=wa,Ea=n(358),xa=n.n(Ea),Oa=n=>{const{itemType:r,selectAction:o}=n,[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)([]),[c,u]=(0,t.useState)(""),[d,f]=(0,t.useState)(0),[p,m]=(0,t.useState)(0),h=(0,t.useRef)(null),v=(0,t.useContext)(kt);(0,t.useEffect)((()=>{v.postTypes.length<=0&&y(),v.taxonomyTypes.length<=0&&b()}),[]);const g=(e,t)=>{l(e);const n=t?Math.ceil(t/20):0;f(n),m(t)},y=()=>{fa()({path:"/mm_ultra/v1/posts/types"}).then((e=>{v.setPostTypes(e.sort(((e,t)=>{const n=e.labels.name.toLowerCase(),r=t.labels.name.toLowerCase();return n.localeCompare(r)})))}))},b=()=>{fa()({path:"/mm_ultra/v1/taxonomy/types"}).then((e=>{v.setTaxonomyTypes(e.sort(((e,t)=>{const n=e.labels.name.toLowerCase(),r=t.labels.name.toLowerCase();return n.localeCompare(r)})))}))};return(0,e.createElement)("div",{className:"mmu-menu-item-post-search-container"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search-interface"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search-type-container"},(0,e.createElement)("select",{className:"mmu-menu-item-post-search-interface-element mmu-menu-item-post-search-type",value:i,onChange:e=>{a(e.target.value)}},(0,e.createElement)("option",{value:""},"Search all Types"),(e=>"taxonomy"==e?v.taxonomyTypes:v.postTypes)(r).map(((t,n)=>(0,e.createElement)("option",{key:t.name,value:t.type_slug},t.labels.name))))),(0,e.createElement)("div",{className:"mmu-menu-item-post-search-keyword-container"},(0,e.createElement)("input",{ref:h,type:"text",className:"mmu-menu-item-post-search-interface-element mm-ultra-search-input mm-ultra-search-input--posts",name:"search_posts"}),(0,e.createElement)("button",{onClick:()=>(async()=>{let e;ii(ri,"search value",h.current.value),u(h.current.value),e="taxonomy"==r?await Ca.fetchResults(h.current.value,0,i):await ya.fetchResults(h.current.value,0,i),ii(ri,"search returnedData",e),g(e.results,e.total_results)})(),className:"mmu-menu-item-post-search-interface-element mmu-button mmu-button--search"},"Search"))),(0,e.createElement)("div",{className:"mmu-menu-item-editor-help-text"},"Use the search to find content. Click a result to apply it to this menu item."),window.MMU.can_use_premium_code?"":(0,e.createElement)("div",{className:"notice notice-info"},(0,e.createElement)("p",null,(0,e.createElement)("a",{href:window.MMU.upgrade_url},"Upgrade to Pro today")," to search custom post types and taxonomy types")),(0,e.createElement)("div",{className:"mmu-menu-item-post-search-results"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search-results-list"},s.length>0?(0,e.createElement)("table",{className:"mm-ultra-search-results mm-ultra-search-results--post"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"mmu-table-col--ID",scope:"col"},"ID"),(0,e.createElement)("th",{scope:"col"},"Title")),s.map(((t,n)=>(0,e.createElement)("tr",{key:t.ID,onClick:e=>o(s,t.ID)},(0,e.createElement)("td",{className:"mmu-table-col--ID"},t.ID),(0,e.createElement)("td",null,(0,e.createElement)("div",{className:"mmu-post-results-field-value mmu-post-results-field-value--title"},t.display_title),(0,e.createElement)("div",{className:"mmu-post-results-field-value mmu-post-results-field-value--url"},t.display_link)))))):""),(0,e.createElement)(xa(),{breakLabel:"...",nextLabel:"Next >",onPageChange:async e=>{const t=20*e.selected%p;ii(ri,"new page offset",t);const n=await ya.fetchResults(h.current.value,t,i);ii(ri,"search returnedData",n),g(n.results,n.total_results)},pageCount:d,previousLabel:"< Previous",renderOnZeroPageCount:null,className:"mmu-pager",disabledClassName:"mmu-pager-action--disabled"}))))};const ka={post:"post_type",link:"custom",taxonomy:"taxonomy"};var _a=n=>{const{item:r,index:o,parent:i}=n,[a,s]=(0,t.useState)(0),[l,c]=(0,t.useState)(!1),u=(0,t.useContext)(kt),d=(0,t.useRef)(null);(0,t.useEffect)((()=>{d.current||(ii(ri,"resetting origItem"),d.current={...r},r.type==ka.link?s(2):r.type==ka.taxonomy&&s(1))}),[]);const f=(e,t,n,o)=>{var i,a;const s=n.findIndex((e=>e.ID==o)),c=n[s],d=c.type_slug,f=e.findIndex((e=>e.type_slug==d)),p=null!==(i=e[f])&&void 0!==i&&null!==(a=i.labels)&&void 0!==a&&a.singular_name?e[f].labels.singular_name:e[f].labels.name;r.object=c.type_slug,r.object_id=c.ID,r.object_title=c.display_title,r.display_link=c.display_link,r.goto_link=c.goto_link,r.edit_link=c.edit_link,l||(r.title=c.display_title),r.type=t,r.type_label=p,u.setMenuItems(wi(u.menuItems,r)),u.markChangedItem(r,u.menuItemChangeTypes.edit)},p=e=>{var t,n;"title"==(null!==(t=null===(n=e.target)||void 0===n?void 0:n.getAttribute("name"))&&void 0!==t?t:null)&&c(!0)};return(0,e.createElement)("div",{className:"mmu-menu-item-editor"},(0,e.createElement)(qi,{onSelect:(e,t,n)=>{var o;ii(ri,"tab changed",n,n.target.getAttribute("item_type")),s(e);const i=ka[n.target.getAttribute("item_type")];d.current&&i==(null===(o=d.current)||void 0===o?void 0:o.type)?u.setMenuItems(wi(u.menuItems,d.current)):u.setMenuItems(wi(u.menuItems,{...r,type:i}))},selectedIndex:a},(0,e.createElement)(Ki,null,(0,e.createElement)(ta,{item_type:"post"},"Content"),(0,e.createElement)(ta,{item_type:"taxonomy"},"Taxonomy/Categories"),(0,e.createElement)(ta,{item_type:"link"},"Custom Link")),(0,e.createElement)(aa,null,(0,e.createElement)("div",{className:"mmu-menu-item-editor-mode--content"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Menu Item Settings")),(0,e.createElement)(ua,{forItemType:"post",item:r,origItem:d,fieldEditEventHandler:p})),(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Find Content")),(0,e.createElement)(Oa,{itemType:"post",selectAction:(e,t)=>f(u.postTypes,"post_type",e,t)})))),(0,e.createElement)(aa,null,(0,e.createElement)("div",{className:"mmu-menu-item-editor-mode--taxonomy"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Menu Item Settings")),(0,e.createElement)(ua,{forItemType:"taxonomy",item:r,origItem:d,fieldEditEventHandler:p})),(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Find Terms")),(0,e.createElement)(Oa,{itemType:"taxonomy",selectAction:(e,t)=>f(u.taxonomyTypes,"taxonomy",e,t)})))),(0,e.createElement)(aa,null,(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("h2",null,"Custom Link"),(0,e.createElement)(ua,{forItemType:"custom",item:r,origItem:d,fieldEditEventHandler:p,item:r})))),(0,e.createElement)("div",{className:"mmu-menu-item-editor-actions mmu-menu-item-editor-actions--secondary"},(0,e.createElement)("a",{className:"mmu-button mmu-button--secondary",onClick:e=>(e=>{if(u.unMarkChangedItem(r,u.menuItemChangeTypes.edit),r.isNewAddition)u.setMenuItems(function(e,t){let n=null;const r=e.findIndex((e=>e.ID==t.ID));if(r>-1){t.menu_item_parent&&(n=t.menu_item_parent);let o=[...e];if(o.splice(r,1),n){const e=bi(o,n);ii(si,"in remove and update, parent is",e,"parent ID is",n),o=ci(o,e)}return o}return e}(u.menuItems,r));else{const e={...d.current};e.showEditor=!1,u.setMenuItems(wi(u.menuItems,e))}})()},"Cancel ",r.isNewAddition?"Add":"Edit")))};window.wp.url;const Sa="MenuItemService",Na=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=`${oi}/menu/${e}/items`;return t&&!isNaN(t)&&(n+="/"+t.toString()),e?fa()({path:n}).then((e=>(ii(Sa,"returned top level menu items",null==e?void 0:e.items),ha(e),e))).catch((e=>(console.warn(e),e))):Promise.resolve(null)},Ta=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;ii(Sa,"fetching menu subitems",e,t,n);let r=`${oi}/menu/${e}/item/${t}/children`;if(n&&(r+="/"+n.toString()),e){const e=await fa()({path:r}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(e),e}return Promise.resolve(null)},Da=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)throw new Error("Missing MenuID in SaveItem s");const r=await fa()({path:`${oi}/menu/update`,method:"POST",data:{menu_id:e,revision_id:t,last_item_id:n}}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(r),r},Ia=(e,t,n)=>(ii(ri,"setting item to expanded value",t,n),yi(e,t,((e,t)=>({...e,expanded:n})),{applyToChildren:0==n})),Pa=(e,t)=>Ia(e,t,!0),Ma=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{skipSetWasFetched:o}=r;let i=!0,a=[],s=[],l=-1,c=null,u={};for(console.log("fetch and insert");i;){const t=await Ta(e,n.ID,c);console.log("result",t),s=[...s,...t.items],ii(ri,"updated item after insert",u),null!=t&&t.last_item_id?c=t.last_item_id:i=!1}return a=li(t,s),l=a.findIndex((e=>e.ID==n.ID)),u={},l>-1&&(u=a[l],o||(a[l].wasFetched=!0)),Promise.resolve(a)},Ra=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=await Ma(e,t,n,r);return n.deleteTree&&(o=yi(o,n,(function(e){return{...e,markedForDelete:!0,deleteTree:!0}}),{applyToChildren:!0})),Promise.resolve(Pa(o,n))},Aa=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{parentItem:n,newIndex:r}=t;let o={ID:Ei(),isNewAddition:!0,showEditor:!0,depth:0,title:""},i=r>-1?r:0;n&&(i=r>-1?r:pi(e,n)+1,o.parentItem=n,o.menu_item_parent=n.ID,o.depth=n.depth+1);let a=[...e];return a.splice(i,0,o),n&&(a=ci(a,n)),a},La=n=>{const{name:r,children:o,icon:i,disabled:s,border:l=!0,background:c=!0,clickHandler:u,...d}=n,[f,p]=(0,t.useState)([]),m=null!=i?i:r;return(0,t.useEffect)((()=>{const e=["mmu-button","mmu-button--with-icon","mmu-button--with-icon--"+(r?r.replace(/[^A-Za-z0-9-]/,"-"):"default")];s&&e.push("mmu-button--disabled mmu-button--with-icon--disabled"),l||e.push("mmu-button--without-border"),c||e.push("mmu-button--without-background"),p(e)}),[r,i,s]),(0,e.createElement)("button",a({className:f.join(" "),onClick:e=>(e=>{s||u(e)})(e)},d),(0,e.createElement)("i",{className:"dashicons dashicons-"+m}),(0,e.createElement)("i",{className:"mmu-button-text"},o))};La.propTypes={name:i().string,children:i().node,icon:i().string,disabled:i().bool,border:i().bool,background:i().bool,clickHandler:i().func};var ja=La,Fa=n(253),Ba=n.n(Fa);const Ha=t=>{const{name:n,children:r,...o}=t;return(0,e.createElement)("button",a({className:"mmu-button "+(n?"mmu-button--"+n.replace(/[^A-Za-z0-9-]/,"-"):"")},o),r)};Ha.propTypes={name:i().string,children:i().node};var Va=Ha;const Wa=n=>{var r,o;Ba().setAppElement("#menu-manager-ultra");const[i,a]=(0,t.useState)({}),{handleConfirm:s,handleCancel:l,isOpen:c}=n,u=(0,t.useRef)(document.getElementById("wpcontent"));(0,t.useEffect)((()=>{a(d())}),[]);const d=()=>{const e=getComputedStyle(u.current);return{content:{"margin-left":"auto","margin-right":"auto","max-height":"250px","max-width":"500px",top:"calc(50% - 250px)"},overlay:{"padding-left":e.paddingLeft,"margin-left":e.marginLeft,"background-color":"rgba(0, 0, 0, 0.8)"}}};return(0,e.createElement)(Ba(),{id:"modal_menu_item_delete_confirm",isOpen:c,contentLabel:"modalB",shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,onRequestClose:l,style:i},(0,e.createElement)("div",{className:"mmu-modal-message"},"This item has items beneath it.",null!==(r=window.MMU)&&void 0!==r&&r.can_use_premium_code?(0,e.createElement)("div",null,"How would you like to treat those items when deleting?"):""),(0,e.createElement)("div",{className:"mmu-modal-actions"},(0,e.createElement)(Va,{onClick:e=>s(e,1)},"Delete all sub-items as well"),null!==(o=window.MMU)&&void 0!==o&&o.can_use_premium_code?(0,e.createElement)(Va,{onClick:e=>s(e,0)},"Move sub-items one level up"):(0,e.createElement)("div",{className:"notice notice-info notice-pro-upgrade"},(0,e.createElement)("p",null,"The ",(0,e.createElement)("a",{href:window.MMU.upgrade_url},"Pro version")," has a feature for moving children of deleted items up one level."))))};Wa.propTypes={handleConfirm:i().func,handleCancel:i().func,isOpen:i().bool};var Ua=Wa,za=n=>{const r=(0,t.useContext)(kt),[o,i]=(0,t.useState)(!1),{item:a}=n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"mmu-menu-item-actions"},(0,e.createElement)(ja,{clickHandler:e=>(async e=>{a.showEditor=!0,r.setMenuItems(wi(r.menuItems,a))})(),name:"edit",icon:"edit",disabled:!!a.markedForDelete},"Edit"),(0,e.createElement)(ja,{clickHandler:e=>{((e,t)=>{if(1!=t.markedForDelete)t.childCount>0||t.has_fetchable_children>0?i(!0):(r.setMenuItems(wi(r.menuItems,{...t,markedForDelete:!0})),r.markChangedItem(t,r.menuItemChangeTypes.delete));else{let e=wi(r.menuItems,t),n=!1;t.deleteTree&&(n=!0),e=yi(e,t,(function(e){return r.unMarkChangedItem(e,r.menuItemChangeTypes.delete),{...e,markedForDelete:!1,deleteTree:!1}}),{applyToChildren:n}),r.setMenuItems(e)}})(0,a)},name:a.markedForDelete?"restore":"delete",icon:a.markedForDelete?"undo":"no"},a.markedForDelete?"Restore":"Remove"),(0,e.createElement)(ja,{clickHandler:e=>(async e=>{let t;!a.wasFetched&&a.has_fetchable_children?(t=await Ra(r.menuID,r.menuItems,a),t=Aa(t,{parentItem:a})):(t=Aa(r.menuItems,{parentItem:a}),t=Pa(t,a)),r.setMenuItems(t)})(),name:"add",icon:"plus",disabled:!!a.markedForDelete},"Add")),(0,e.createElement)(Ua,{isOpen:o,handleCancel:e=>{i(!1)},handleConfirm:(e,t)=>{const n=t>0,o=yi(r.menuItems,a,(function(e){return ii(ri,"delete confirm for item",e),r.markChangedItem(e,r.menuItemChangeTypes.delete),{...e,markedForDelete:!0,deleteTree:n}}),{applyToChildren:n});r.setMenuItems(o),i(!1)}}))};const qa=27;var Ya=n=>{var r;const o=(0,t.useContext)(kt),{item:i,parent:s}=n,[l,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)({marginLeft:(i.depth*qa).toString()+"px"}),f=function(e){let{id:n,data:r,disabled:o=!1,attributes:i}=e;const a=x("Droppable"),{activators:s,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=(0,t.useContext)(nt),{role:m=ft,roleDescription:h="draggable",tabIndex:g=0}=null!=i?i:{},b=(null==c?void 0:c.id)===n,C=(0,t.useContext)(b?lt:dt),[E,O]=w(),[k,_]=w(),S=function(e,n){return(0,t.useMemo)((()=>e.reduce(((e,t)=>{let{eventName:r,handler:o}=t;return e[r]=e=>{o(e,n)},e}),{})),[e,n])}(s,n),N=y(r);return v((()=>(f.set(n,{id:n,key:a,node:E,activatorNode:k,data:N}),()=>{const e=f.get(n);e&&e.key===a&&f.delete(n)})),[f,n]),{active:c,activatorEvent:l,activeNodeRect:u,attributes:(0,t.useMemo)((()=>({role:m,tabIndex:g,"aria-disabled":o,"aria-pressed":!(!b||m!==ft)||void 0,"aria-roledescription":h,"aria-describedby":d.draggable})),[o,m,g,b,h,d.draggable]),isDragging:b,listeners:o?void 0:S,node:E,over:p,setNodeRef:O,setActivatorNodeRef:_,transform:C}}({id:i.ID}),p=f.transition,m={transform:T.Translate.toString(f.transform),transition:p,visibility:f.isDragging?"hidden":"visible",marginLeft:(i.depth*qa).toString()+"px"},h=()=>!(!s||0!=s.expanded);return j({onDragMove:e=>{var t,n;const{over:r,delta:a}=e;if(null!=r&&r.id&&null!=r&&null!==(t=r.data)&&void 0!==t&&null!==(n=t.current)&&void 0!==n&&n.item){const e=r.data.current.item,t=e.depth;let n=a.x,s=!1,l=qa;1==e.expanded&&(s=!0);const c=i.depth-t;0!=c&&(l-=c*qa),s||n>l?o.setNestedDragID(e.ID):o.setNestedDragID(null)}}}),(0,t.useEffect)((()=>{let e={},t=i.depth*qa;o.nestedDragID&&o.nestedDragID==i.ID&&(ii(ri,"applying nested style"),t+=qa),e={...e,marginLeft:t.toString()+"px"},d(e)}),[o.nestedDragID]),(0,e.createElement)(e.Fragment,null,0==n.index?(0,e.createElement)(_t,{position:"top",item:i}):"",(0,e.createElement)("div",{className:on()("mmu-menu-item-container",{"mmu-menu-item-container--hidden":h()},{"mmu-menu-item-container--drag-hover":l},{"mmu-menu-item-container--with-children":i.childCount>0||i.has_fetchable_children>0},{"mmu-menu-item-container--without-children":!i.isNewAddition&&i.childCount<=0&&!i.has_fetchable_children}),ref:f.setNodeRef,style:m},(0,e.createElement)("div",{className:"mmu-menu-item-stage"},(0,e.createElement)("div",a({className:"mmu-menu-item-drag-handle"},f.attributes,f.listeners),(0,e.createElement)("div",{className:"mmu-gripper","aria-label":"Move up or down"})),(0,e.createElement)("div",{className:"mmu-menu-item-rows"},i.isNewAddition?"":(0,e.createElement)("div",{className:"mmu-menu-item-row mmu-menu-item-row--details "+(i.expanded?"mmu-menu-item-row--expanded":"")},i.childCount>0||i.has_fetchable_children>0?(0,e.createElement)("button",{className:on()("dashicons",{"dashicons-update mmu-icon-button--item-loading":i.isLoading},{"dashicons-arrow-down":!i.isLoading&&i.expanded},{"dashicons-arrow-right":!i.isLoading&&!i.expanded},{"mmu-icon-button--expand-item":!i.isLoading}),"aria-label":"Expand Sub Items",onClick:()=>{(async e=>{if(ii(ri,"expandCollapse called",e),e.expanded)o.setMenuItems(((e,t)=>Ia(e,t,!1))(o.menuItems,e));else if(e.has_fetchable_children&&!e.wasFetched){o.setMenuItems(wi(o.menuItems,{...e,isLoading:!0}));const t=await Ra(o.menuID,o.menuItems,e);let n=bi(t,e.ID);o.setMenuItems(wi(t,{...n,isLoading:!1})),ii(ri,"first fetch")}else o.setMenuItems(Pa(o.menuItems,e))})(n.item)}}):"",(0,e.createElement)(ti,{item:i,index:n.index,parent:s}),i.showEditor?"":(0,e.createElement)(za,{item:i})),i.showEditor?(0,e.createElement)("div",{className:"mmu-menu-item-row mmu-menu-item-row--editor"},(0,e.createElement)(_a,{item:i,index:n.index,parent:s})):""))),h()||(null===(r=f.active)||void 0===r?void 0:r.id)==i.ID?"":(0,e.createElement)(_t,{position:"after",item:i,style:u}))},$a=()=>{const n=(0,t.useContext)(kt),[r,o]=(0,t.useState)(!1),[i,a]=(0,t.useState)(!1),[s,l]=(0,t.useState)(null),[c,u]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{n.isAnyItemChanged?(l("You have unsaved changes"),o(!1),a(!0)):(o(!0),setTimeout((()=>{a(!1),u(!1)}),c?2500:0))}),[n.isAnyItemChanged]),(0,e.createElement)("div",{className:"mmu-save-bar "+(n.isAnyItemChanged||i?"mmu-save-bar--active":"")},i?(0,e.createElement)("div",{className:"mmu-save-bar-message"},s):"",n.isAnyItemChanged||i?(0,e.createElement)(e.Fragment,null,r?"":(0,e.createElement)(Va,{onClick:async e=>{try{n.setIsSaving(!0),l("Preparing to Save..."),a(!0);const e=1e3,t=await(async(e,t)=>{if(!e)throw new Error("Missing MenuID in SaveItems");const n=await fa()({path:`${oi}/menu/prepare-revision`,method:"POST",data:{items:t,menu_id:e}}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(n),n})(n.menuID,n.menuItems),r=[];l("Saving...");let i=!0,s=1,c=null,d={};for(;i;){if(d=await Da(n.menuID,t.revision_id,c),d.items){let e=d.items.map((e=>({...e,isNewAddition:!1,showEditor:!1})));r.push(...e)}if(s++,s>=e)throw new Error("Too many batches processed; Stopping Save");d.last_item_id?(c=d.last_item_id,l(`Saving Batch ${s}...`)):i=!1}ii(ri,"Save result",d),l("Performing After-Save Operations..."),await(async e=>{const t=await fa()({path:`${oi}/menu/${e}/post-save-actions`,method:"GET"}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(t),t})(n.menuID),u(!0),n.clearChangedItems(),n.setMenuItems(r,{skipCheckForChanged:!0}),l("Menu Items Saved"),n.setIsSaving(!1),o(!0)}catch(e){l(e.message)}finally{n.setIsSaving(!1)}},name:"save"},n.isSaving?(0,e.createElement)("span",{className:"dashicons dashicons-update mmu-icon-button--item-loading"}):"Save")):"")};const Xa=(0,t.forwardRef)(((t,n)=>{let{id:r,item:o,...i}=t;return(0,e.createElement)("div",a({style:{padding:"20px",width:"60%","background-color":"#f1f1f1",border:"2px dashed #CCC"},className:"mmu-menu-item-container mmu-menu-item-container--is-being-dragged"},i,{ref:n}),(0,e.createElement)("div",{className:"mmu-menu-item-single"},(0,e.createElement)("div",{className:"mmu-menu-item-summary"},(0,e.createElement)("div",{className:"mmu-menu-item-title"},o.title))))}));var Ka=async()=>{const e=await fa()({path:`${oi}/fields/custom/list`,method:"GET"}).catch((e=>{ma(e)}));return ha(e,{assertFieldValues:["fields"]}),e.fields},Ga=async()=>{const e=await fa()({path:`${oi}/fields/custom/settings`,method:"GET"}).catch((e=>{ma(e)}));return ha(e,{assertFieldValues:["fields"]}),e.fields},Ja=async e=>{ii(ri,"saveFieldSettings",e);const t=await fa()({path:`${oi}/fields/custom/settings/save`,method:"POST",data:{fields:e}}).catch((e=>{ma(e,{debug_category:"FieldItemService"})}));return ha(t),t};const Za="nested",Qa="top",es=n=>{var r;const o=(0,t.useContext)(kt),[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)(null),[c,u]=(0,t.useState)(null),{menuID:d}=n,f=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(0,t.useMemo)((()=>[...n].filter((e=>null!=e))),[...n])}(U(Ie,{}),U(_e,{}));(0,t.useEffect)((()=>{(async()=>{if(null!=d){let e=[],t=null,n=!0;ii(ri,"fetching items",d);const r=await Ga();for(o.setActiveCustomFields(r);n;){ii(ri,"custom fields",r);const o=await Na(d,t);e=[...e,...o.items],o.last_item_id?t=o.last_item_id:n=!1}e.length>0?o.setMenuItems(li([],e)):o.setMenuItems([])}})()}),[d]);const p=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.menuItems;n=Aa(n,t),o.setMenuItems(n)};return(0,e.createElement)(e.Fragment,null,o.menuID?(0,e.createElement)("div",{className:"mmu-list-actions mmu-list-actions--top"},(0,e.createElement)("div",{className:"mmu-actions-container"},(0,e.createElement)(ja,{onClick:e=>p(e),name:"add",icon:"plus"},"Add Item"))):"",(0,e.createElement)("div",{id:"mmu-items-list",className:"mmu-items-list"},(0,e.createElement)(ut,{sensors:f,collisionDetection:X,onDragEnd:async e=>{const{active:t,over:n}=e;if(!t||!n)return!1;ii(ri,"active id",t.id),ii(ri,"over id",n.id);const r=parseInt(n.id.substring(n.id.lastIndexOf("-")+1));if(ii(ri,"overID",r),t.id!=r){const n=(e=>{const{over:t}=e;if(null!=t&&t.id){const e=t.id.toString().match(/droppable-([A-Za-z]+)-([A-Za-z0-9]+)/);if(e.length>1){let t=e[1],n=e[2];return ii(ri,"drop position id is",n),ii(ri,"nested drop id is",o.nestedDragID),t!=Qa&&n==o.nestedDragID&&(ii(ri,"Nested Drop"),t=Za),t}}return null})(e);let i=o.menuItems.findIndex((e=>e.ID==t.id)),a=o.menuItems.findIndex((e=>e.ID==r)),s=a,l=!1,c=[...o.menuItems],u=!1;n==Za?(ii(ri,"moving into new parent"),c[a].has_fetchable_children&&!c[a].wasFetched&&(ii(ri,"need to fetch items"),c=await Ra(o.menuID,o.menuItems,o.menuItems[a]),i=c.findIndex((e=>e.ID==t.id)),a=c.findIndex((e=>e.ID==r))),u=c[a],s=a,ii(ri,"setting menu item parent to",u.ID),c[i].menu_item_parent=u.ID,c[a].expanded=!0,c=ci(c,c[a])):"after"==n?(ii(ri,"dragging after"),void 0!==c[a].parentItem&&null!=c[a].parentItem&&void 0!==c[a].parentItem.ID?u=c[a].parentItem:(ii(ri,"dragging after -> setting newParentItem null"),u=null)):n==Qa?(s=0,u=null):"bottom"==n?(ii(ri,"dragging to bottom"),u=null,s=c.length-1):l=!0,n!=Qa&&i>a&&s++,l||(ii(ri,"updatedItems[activeIndex]",c[i]),ii(ri,"active index -> new position",i,s),c=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[...e];const i=o[t].parentItem,a=o[t];var s;ii(si,"in moveItem",o,t,n),null===r?(ii(si,"new parent item is null)"),o=di(o,o[t])):(null===(s=o[t].parentItem)||void 0===s?void 0:s.ID)!=r.ID&&(ii(si,"assigning new parent"),o=ui(o,o[t],r)),Ci(o,t,n);const l=pi(o,a);ii(si,"updated index after move",l),ii(si,"after array move",o);let c,u=o[l];return null!==o[l].parentItem&&(u=o[pi(o,o[l].parentItem)]),[c,o]=fi(o,u),i&&(o=ci(o,i)),ii(si,"final version inside moveItems",o),o}(c,i,s,u),o.setMenuItems(c),o.markChangedItem(c[s],o.menuItemChangeTypes.position),u&&o.markChangedItem(u,o.menuItemChangeTypes.children),ii(ri,"final updateditems",c))}o.setNestedDragID(null)},onDragStart:e=>{const{active:t}=e;ii(ri,"dragStart",e),a(t.id),ii(ri,"active id",t.id);const n=o.menuItems.findIndex((e=>e.ID===t.id));ii(ri,"active index",n);const r=o.menuItems[n],i=yi(o.menuItems,r,(e=>({...e,expanded:!1})),{applyToChildren:!0});o.setMenuItems(i),u(i[n])},onDragOver:function(e){var t;let{over:n}=e;l(null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null)}},o.menuItems.map(((t,n)=>(0,e.createElement)(Ya,{key:t.ID,parent:vi(o.menuItems,t),item:t,index:n}))),(0,e.createElement)(Ot,null,i?(0,e.createElement)(Xa,{id:i,item:c}):null)),(0,e.createElement)($a,null)),(null===(r=o.menuItems)||void 0===r?void 0:r.length)>0?(0,e.createElement)("div",{className:"mmu-list-actions mmu-list-actions--bottom"},(0,e.createElement)("div",{className:"mmu-actions-container"},(0,e.createElement)(ja,{onClick:e=>p(e,{newIndex:o.menuItems.length}),name:"add",icon:"plus"},"Add Item"))):"")};es.propTypes={menuID:i().string};var ts=es,ns=n=>{Ba().setAppElement("#menu-manager-ultra");const[r,o]=(0,t.useState)({}),{handleSave:i,handleCancel:a,isOpen:s,inputRef:l,message:c}=n,u=(0,t.useRef)(document.getElementById("wpcontent"));(0,t.useEffect)((()=>{o(d())}),[]);const d=()=>{const e=getComputedStyle(u.current);return{content:{"margin-left":"auto","margin-right":"auto","max-height":"200px","max-width":"400px",top:"calc(50% - 250px)"},overlay:{"padding-left":e.paddingLeft,"margin-left":e.marginLeft,"background-color":"rgba(0, 0, 0, 0.8)"}}};return(0,e.createElement)(Ba(),{id:"modal_menu_add",isOpen:s,contentLabel:"modalMenuAdd",shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,onRequestClose:a,style:r},c?(0,e.createElement)("div",{class:"mmu-modal-message"},c):"",(0,e.createElement)("div",{className:"mmu-modal-input-container"},(0,e.createElement)("label",{htmlFor:"input_new_menu_name"},"Menu Name"),(0,e.createElement)("input",{ref:l,type:"text",defaultValue:"",id:"input_new_menu_name",name:"new_menu_name"})),(0,e.createElement)("div",{className:"mmu-modal-actions"},(0,e.createElement)(Va,{onClick:e=>i(e)},"Save"),(0,e.createElement)("a",{onClick:e=>a(e)},"Cancel")))},rs=n=>{var r;const{setShowSettings:o}=n,i=(0,t.useContext)(kt),[a,s]=(0,t.useState)([]),[l,c]=(0,t.useState)([]),u=((0,t.useRef)(!1),(0,t.useRef)(!1)),d=(0,t.useCallback)((()=>new Promise((async(e,t)=>{e(await Ka())})))),f=(e,t)=>{if(ii(ri,"applying field settings",e),void 0!==t&&t.length>0){let n=t.map((t=>{ii(ri,"customField",t);let n=0;if(Array.isArray(e)&&e.length>0){const r=e.find((e=>e.field_key==t.field_key));r&&void 0!==r.enabled&&1==r.enabled&&(n=1)}return{...t,enabled:n}}));s(n),ii(ri,"updated fields",n)}};(0,t.useEffect)((()=>{0==u.current&&(u.current=!0,d().then((e=>{ii(ri,"fields result",e),new Promise((async(e,t)=>{e(await Ga())})).then((t=>{c(t),f(t,e)}))})))}),[]);const p=e=>{let t=l;const n=a.find((t=>t.field_key==e.target.name)),r=t.findIndex((t=>t.field_key==e.target.name));r>-1&&t.splice(r,1),1==e.target.checked?t.push({...n,enabled:1}):t.push({...n,enabled:0}),c(t),f(t,a),ii(ri,"updated field settings",t)};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"mmu-settings-heading"},"Settings"),null!==(r=window.MMU)&&void 0!==r&&r.can_use_premium_code?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"mmu-settings-section"},(0,e.createElement)("div",{className:"mmu-settings-section-heading"},"Custom Fields"),(0,e.createElement)("div",{className:"mmu-settings-section-description"},"Choose which fields to display in addition to the page title when browsing menu items"),(0,e.createElement)("div",{className:"mmu-settings-form"},(0,e.createElement)("div",{className:"mmu-settings-form-checkbox-group"},a.map(((t,n)=>{if(void 0!==t.field_key&&null!=t.field_key){const n="checkbox-settings-fields-"+t.field_key.toString();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"mmu-settings-option mmu-settings-option-custom-field"},(0,e.createElement)("input",{id:n,type:"checkbox",onChange:p,name:t.field_key,checked:1==t.enabled,value:"1"}),(0,e.createElement)("label",{htmlFor:n},t.field_label)))}}))))),(0,e.createElement)(Va,{onClick:async()=>{if(ii(ri,"Saving settings",l),await Ja(l),null!=i.menuID){const e=await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)throw new Error("Missing menuID in refreshItems");ii(Sa,"refreshed menu items",t);const r=await fa()({path:`${oi}/menu/${e}/items/refresh`,method:"POST",data:{items:t,override_fields:n}}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(r,{assertFieldValues:["items"]}),r.items}(i.menuID,i.menuItems,"object_fields");i.setMenuItems(e)}o(!1)},name:"save"},"Save")):(0,e.createElement)("div",{className:"mmu-settings-section"},(0,e.createElement)("div",{className:"notice notice-info"},(0,e.createElement)("p",null,(0,e.createElement)("a",{href:window.MMU.upgrade_url},"Upgrade to Pro today")," to see custom fields in your menu items!"))))},os=n=>{Ba().setAppElement("#menu-manager-ultra");const[r,o]=(0,t.useState)({}),{handleCancel:i,isOpen:s,inputRef:l,message:c,name:u,width:d="600px",height:f="600px",children:p,...m}=n,h=(0,t.useRef)(document.getElementById("wpcontent"));(0,t.useEffect)((()=>{o(v())}),[]);const v=()=>{const e=getComputedStyle(h.current);return{content:{"margin-left":"auto","margin-right":"auto","max-height":f,"max-width":d,top:"calc(50% - 250px)"},overlay:{"padding-left":e.paddingLeft,"margin-left":e.marginLeft,"background-color":"rgba(0, 0, 0, 0.8)"}}};return(0,e.createElement)(Ba(),a({id:"modal"+u,isOpen:s,contentLabel:"modal"+u,shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,onRequestClose:i,style:r},m),p)};const is=t=>{const{setShowSettings:n,handleCancel:r,isOpen:o}=t;return(0,e.createElement)(os,{name:"settings",isOpen:o,onRequestClose:r},(0,e.createElement)(rs,{setShowSettings:n}))};is.propTypes={setShowSettings:i().func,handleCancel:i().func,isOpen:i().bool};var as=is;var ss=()=>{var n;const[r,o]=(0,t.useState)([]),[i,a]=(0,t.useState)(!1),[s,l]=(0,t.useState)(""),[c,u]=(0,t.useState)(!1),d=(0,t.useRef)(null),f=(0,t.useContext)(kt),p=async()=>{let e=await(async()=>{const e=await fa()({path:`${oi}/menus/list`,method:"GET"}).catch((e=>{ma(e,{debug_category:"MenuService"})}));return ha(e,{assertFieldValues:["menus"]}),e.menus})();o(e.map((e=>({label:e.name,value:e.id}))))};return(0,t.useEffect)((()=>{p()}),[]),(0,e.createElement)("div",{className:"mmu-dashboard"},(0,e.createElement)("div",{className:"mmu-settings-bar"},(0,e.createElement)(ja,{clickHandler:()=>u(!0),border:!1,background:!1,name:"settings",icon:"admin-generic"},"Custom Fields")),(0,e.createElement)("div",{className:"mmu-toolbar"},(0,e.createElement)("div",{className:"mmu-option-container"},(0,e.createElement)("label",{htmlFor:"select-menu"},"Choose a Menu to Edit"),(0,e.createElement)("select",{value:null!==(n=f.menuID)&&void 0!==n?n:"",onChange:e=>{f.reset(),f.setMenuID(e.target.value)}},(0,e.createElement)("option",{value:""},"Choose"),r.map((t=>(0,e.createElement)("option",{key:t.value,value:t.value},t.label))))),(0,e.createElement)("div",{className:"mmu-actions-container"},(0,e.createElement)(ja,{onClick:()=>a(!0),name:"add",icon:"plus"},"Add Menu"))),(0,e.createElement)(ts,{menuID:f.menuID}),(0,e.createElement)(ns,{message:s,inputRef:d,isOpen:i,handleCancel:()=>{a(!1)},handleSave:async()=>{if(ii(ri,"save menu item",d.current.value),d.current.value)try{const e=await(async e=>{const t=await fa()({path:`${oi}/menu/add`,method:"POST",data:{menu_name:e}});if(!t||!t.status||"error"==t.status){let e="Error adding menu item: ";throw t&&t.message&&(e+=t.message.toString()),new Error(e)}return t.menu_id})(d.current.value);p(),f.setMenuID(e),a(!1)}catch(e){ii(ri,"Error saving menu",e),l(e.message)}}}),(0,e.createElement)(as,{handleCancel:()=>u(!1),setShowSettings:u,isOpen:c}))};document.getElementById("menu-manager-ultra")&&(0,e.render)((0,e.createElement)((n=>{let{children:r}=n;const o={menuItems:[],menuID:null,addingItemToID:null,changedItems:[],isAnyItemChanged:!1,postTypes:[],taxonomyTypes:[],activeCustomFields:[],nestedDragID:null,isSaving:!1},[i,a]=(0,t.useState)(o),s=(0,t.useMemo)((()=>({getValue(e){return i[e]},setValue(e,t){let n={};return n[e]=t,a((e=>({...e,...n})))},setMenuItems:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipCheckForChanged:n=!1}=t;s.setValue("menuItems",e),n||d()},setMenuID:e=>{s.setValue("menuID",e),s.clearChangedItems()},menuItemChangeTypes:{any:"any",delete:"delete",edit:"edit",position:"position",children:"children"},markChangedItem:(e,t)=>{let n=s.getValue("changedItems");return n.findIndex((n=>n.ID==e.ID&&n.changeType==t))<=-1&&(n.push({ID:e.ID,changeType:t}),s.setValue("changedItems",n),d()),n},unMarkChangedItem:(e,t)=>{let n=s.getValue("changedItems");const r=n.findIndex((n=>n.ID==e.ID&&n.changeType==t));return r>-1&&(n.splice(r,1),s.setValue("changedItems",n),d()),n},itemWasChanged:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s.getValue("changedItems");const r=n.findIndex((n=>n.ID==e.ID&&(!t||n.changeType==t)));return r>-1},clearChangedItems(){s.setValue("changedItems",[]),s.setValue("isAnyItemChanged",!1)},reset:()=>{s.clearChangedItems()}}))),l=(0,t.useMemo)((()=>({getTargetFunctionResult(e,t,n){if("function"!=typeof e[t])throw new Error("Function doesn't exist on target object");return new Proxy(e[t],{apply:(e,t,n)=>Reflect.apply(e,t,n)})},shouldTriggerSetter(e){return"set"==e.substr(0,3)},magicSetter(e,t,n){const r=t.substr(3,1).toLowerCase()+t.substring(4);if(void 0===e[t]&&r in o)return e[t]=new Proxy(new Function,{apply:(e,t,n)=>{t[r]=n[0]}}),e[t]}}))),c=(0,t.useMemo)((()=>({get(e,t,n){return"function"==typeof e[t]?l.getTargetFunctionResult(e,t,n):t in o?s.getValue(t):l.shouldTriggerSetter(t)?l.magicSetter(e,t,n):Reflect.get(e,t,n)},set(e,t,n){if(t in o)return s.setValue(t,n),!0;throw new Error("trying to set invalid state property: "+t.toString())},has(e,t){return t in o||Reflect.has(e,t)}}))),u=(0,t.useMemo)((()=>new Proxy(s,c)),[i]),d=()=>{const e=s.getValue("changedItems").length>0;s.setValue("isAnyItemChanged",e)};return(0,e.createElement)(kt.Provider,{value:u},r)}),null,(0,e.createElement)((()=>(0,e.createElement)("div",null,(0,e.createElement)("h2",{className:"app-title"},"Menu Manager Ultra"),(0,e.createElement)("hr",null),(0,e.createElement)(ss,null))),null)),document.getElementById("menu-manager-ultra"))}()}();1 !function(){var e={487:function(e){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=t},184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},12:function(e){var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}},e.exports=n},227:function(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=""),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(447)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},447:function(e,t,n){e.exports=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},875:function(e,t,n){var r;!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},738:function(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},568:function(e,t,n){var r,o,i,a,s;r=n(12),o=n(487).utf8,i=n(738),a=n(487).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):o.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=r.bytesToWords(e),l=8*e.length,c=1732584193,u=-271733879,d=-1732584194,f=271733878,p=0;p<n.length;p++)n[p]=16711935&(n[p]<<8|n[p]>>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[l>>>5]|=128<<l%32,n[14+(l+64>>>9<<4)]=l;var m=s._ff,h=s._gg,v=s._hh,g=s._ii;for(p=0;p<n.length;p+=16){var y=c,b=u,w=d,C=f;c=m(c,u,d,f,n[p+0],7,-680876936),f=m(f,c,u,d,n[p+1],12,-389564586),d=m(d,f,c,u,n[p+2],17,606105819),u=m(u,d,f,c,n[p+3],22,-1044525330),c=m(c,u,d,f,n[p+4],7,-176418897),f=m(f,c,u,d,n[p+5],12,1200080426),d=m(d,f,c,u,n[p+6],17,-1473231341),u=m(u,d,f,c,n[p+7],22,-45705983),c=m(c,u,d,f,n[p+8],7,1770035416),f=m(f,c,u,d,n[p+9],12,-1958414417),d=m(d,f,c,u,n[p+10],17,-42063),u=m(u,d,f,c,n[p+11],22,-1990404162),c=m(c,u,d,f,n[p+12],7,1804603682),f=m(f,c,u,d,n[p+13],12,-40341101),d=m(d,f,c,u,n[p+14],17,-1502002290),c=h(c,u=m(u,d,f,c,n[p+15],22,1236535329),d,f,n[p+1],5,-165796510),f=h(f,c,u,d,n[p+6],9,-1069501632),d=h(d,f,c,u,n[p+11],14,643717713),u=h(u,d,f,c,n[p+0],20,-373897302),c=h(c,u,d,f,n[p+5],5,-701558691),f=h(f,c,u,d,n[p+10],9,38016083),d=h(d,f,c,u,n[p+15],14,-660478335),u=h(u,d,f,c,n[p+4],20,-405537848),c=h(c,u,d,f,n[p+9],5,568446438),f=h(f,c,u,d,n[p+14],9,-1019803690),d=h(d,f,c,u,n[p+3],14,-187363961),u=h(u,d,f,c,n[p+8],20,1163531501),c=h(c,u,d,f,n[p+13],5,-1444681467),f=h(f,c,u,d,n[p+2],9,-51403784),d=h(d,f,c,u,n[p+7],14,1735328473),c=v(c,u=h(u,d,f,c,n[p+12],20,-1926607734),d,f,n[p+5],4,-378558),f=v(f,c,u,d,n[p+8],11,-2022574463),d=v(d,f,c,u,n[p+11],16,1839030562),u=v(u,d,f,c,n[p+14],23,-35309556),c=v(c,u,d,f,n[p+1],4,-1530992060),f=v(f,c,u,d,n[p+4],11,1272893353),d=v(d,f,c,u,n[p+7],16,-155497632),u=v(u,d,f,c,n[p+10],23,-1094730640),c=v(c,u,d,f,n[p+13],4,681279174),f=v(f,c,u,d,n[p+0],11,-358537222),d=v(d,f,c,u,n[p+3],16,-722521979),u=v(u,d,f,c,n[p+6],23,76029189),c=v(c,u,d,f,n[p+9],4,-640364487),f=v(f,c,u,d,n[p+12],11,-421815835),d=v(d,f,c,u,n[p+15],16,530742520),c=g(c,u=v(u,d,f,c,n[p+2],23,-995338651),d,f,n[p+0],6,-198630844),f=g(f,c,u,d,n[p+7],10,1126891415),d=g(d,f,c,u,n[p+14],15,-1416354905),u=g(u,d,f,c,n[p+5],21,-57434055),c=g(c,u,d,f,n[p+12],6,1700485571),f=g(f,c,u,d,n[p+3],10,-1894986606),d=g(d,f,c,u,n[p+10],15,-1051523),u=g(u,d,f,c,n[p+1],21,-2054922799),c=g(c,u,d,f,n[p+8],6,1873313359),f=g(f,c,u,d,n[p+15],10,-30611744),d=g(d,f,c,u,n[p+6],15,-1560198380),u=g(u,d,f,c,n[p+13],21,1309151649),c=g(c,u,d,f,n[p+4],6,-145523070),f=g(f,c,u,d,n[p+11],10,-1120210379),d=g(d,f,c,u,n[p+2],15,718787259),u=g(u,d,f,c,n[p+9],21,-343485551),c=c+y>>>0,u=u+b>>>0,d=d+w>>>0,f=f+C>>>0}return r.endian([c,u,d,f])})._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(s(e,t));return t&&t.asBytes?n:t&&t.asString?a.bytesToString(n):r.bytesToHex(n)}},824:function(e){var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,a){a=a||{};var s,l,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===c&&isFinite(e))return a.long?(s=e,(l=Math.abs(s))>=o?i(s,l,o,"day"):l>=r?i(s,l,r,"hour"):l>=n?i(s,l,n,"minute"):l>=t?i(s,l,t,"second"):s+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},703:function(e,t,n){"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},697:function(e,t,n){e.exports=n(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},921:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),h=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case s:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case h:case m:case l:return e;default:return t}}case o:return t}}}t.isMemo=function(e){return v(e)===m}},864:function(e,t,n){"use strict";e.exports=n(921)},871:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,s=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?s="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==s){var l=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+l+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return a}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},983:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(196),a=m(i),s=m(n(850)),l=m(n(697)),c=m(n(747)),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(149)),d=n(112),f=m(d),p=n(871);function m(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=t.portalClassName="ReactModalPortal",y=t.bodyOpenClassName="ReactModal__Body--open",b=d.canUseDOM&&void 0!==s.default.createPortal,w=function(e){return document.createElement(e)},C=function(){return b?s.default.createPortal:s.default.unstable_renderSubtreeIntoContainer};function E(e){return e()}var x=function(e){function t(){var e,n,o;h(this,t);for(var i=arguments.length,l=Array(i),u=0;u<i;u++)l[u]=arguments[u];return n=o=v(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),o.removePortal=function(){!b&&s.default.unmountComponentAtNode(o.node);var e=E(o.props.parentSelector);e&&e.contains(o.node)?e.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(e){o.portal=e},o.renderPortal=function(e){var n=C()(o,a.default.createElement(c.default,r({defaultStyles:t.defaultStyles},e)),o.node);o.portalRef(n)},v(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){d.canUseDOM&&(b||(this.node=w("div")),this.node.className=this.props.portalClassName,E(this.props.parentSelector).appendChild(this.node),!b&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:E(e.parentSelector),nextParent:E(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(d.canUseDOM){var r=this.props,o=r.isOpen,i=r.portalClassName;e.portalClassName!==i&&(this.node.className=i);var a=n.prevParent,s=n.nextParent;s!==a&&(a.removeChild(this.node),s.appendChild(this.node)),(e.isOpen||o)&&!b&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(d.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return d.canUseDOM&&b?(!this.node&&b&&(this.node=w("div")),C()(a.default.createElement(c.default,r({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){u.setElement(e)}}]),t}(i.Component);x.propTypes={isOpen:l.default.bool.isRequired,style:l.default.shape({content:l.default.object,overlay:l.default.object}),portalClassName:l.default.string,bodyOpenClassName:l.default.string,htmlOpenClassName:l.default.string,className:l.default.oneOfType([l.default.string,l.default.shape({base:l.default.string.isRequired,afterOpen:l.default.string.isRequired,beforeClose:l.default.string.isRequired})]),overlayClassName:l.default.oneOfType([l.default.string,l.default.shape({base:l.default.string.isRequired,afterOpen:l.default.string.isRequired,beforeClose:l.default.string.isRequired})]),appElement:l.default.oneOfType([l.default.instanceOf(f.default),l.default.instanceOf(d.SafeHTMLCollection),l.default.instanceOf(d.SafeNodeList),l.default.arrayOf(l.default.instanceOf(f.default))]),onAfterOpen:l.default.func,onRequestClose:l.default.func,closeTimeoutMS:l.default.number,ariaHideApp:l.default.bool,shouldFocusAfterRender:l.default.bool,shouldCloseOnOverlayClick:l.default.bool,shouldReturnFocusAfterClose:l.default.bool,preventScroll:l.default.bool,parentSelector:l.default.func,aria:l.default.object,data:l.default.object,role:l.default.string,contentLabel:l.default.string,shouldCloseOnEsc:l.default.bool,overlayRef:l.default.func,contentRef:l.default.func,id:l.default.string,overlayElement:l.default.func,contentElement:l.default.func},x.defaultProps={isOpen:!1,portalClassName:g,bodyOpenClassName:y,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,t){return a.default.createElement("div",e,t)},contentElement:function(e,t){return a.default.createElement("div",e,t)}},x.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,p.polyfill)(x),t.default=x},747:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="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},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(196),s=v(n(697)),l=h(n(685)),c=v(n(338)),u=h(n(149)),d=h(n(409)),f=n(112),p=v(f),m=v(n(623));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function v(e){return e&&e.__esModule?e:{default:e}}n(63);var g={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},y=0,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,r=e.ariaHideApp,o=e.htmlOpenClassName,i=e.bodyOpenClassName,a=e.parentSelector,s=a&&a().ownerDocument||document;i&&d.remove(s.body,i),o&&d.remove(s.getElementsByTagName("html")[0],o),r&&y>0&&0==(y-=1)&&u.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(l.returnFocus(n.props.preventScroll),l.teardownScopedFocus()):l.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),m.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(l.setupScopedFocus(n.node),l.markForFocusLater()),n.setState({isOpen:!0},(function(){n.openAnimationFrame=requestAnimationFrame((function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})}))})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){(function(e){return"Tab"===e.code||9===e.keyCode})(e)&&(0,c.default)(n.content,e),n.props.shouldCloseOnEsc&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===(void 0===t?"undefined":o(t))?t:{base:g[e],afterOpen:g[e]+"--after-open",beforeClose:g[e]+"--before-close"},i=r.base;return n.state.afterOpen&&(i=i+" "+r.afterOpen),n.state.beforeClose&&(i=i+" "+r.beforeClose),"string"==typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,o=e.bodyOpenClassName,i=e.parentSelector,a=i&&i().ownerDocument||document;o&&d.add(a.body,o),r&&d.add(a.getElementsByTagName("html")[0],r),n&&(y+=1,u.hide(t)),m.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.overlayClassName,i=e.defaultStyles,a=e.children,s=n?{}:i.content,l=o?{}:i.overlay;if(this.shouldBeClosed())return null;var c={ref:this.setOverlayRef,className:this.buildClassName("overlay",o),style:r({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},u=r({id:t,ref:this.setContentRef,style:r({},s,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(u,a);return this.props.overlayElement(c,d)}}]),t}(a.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),parentSelector:s.default.func,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(p.default),s.default.instanceOf(f.SafeHTMLCollection),s.default.instanceOf(f.SafeNodeList),s.default.arrayOf(s.default.instanceOf(p.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=b,e.exports=t.default},149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){a&&(a.removeAttribute?a.removeAttribute("aria-hidden"):null!=a.length?a.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(a).forEach((function(e){return e.removeAttribute("aria-hidden")}))),a=null},t.log=function(){},t.assertNodeList=s,t.setElement=function(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);s(n,t),t=n}return a=t||a},t.validateElement=l,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=l(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.setAttribute("aria-hidden","true")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=l(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.removeAttribute("aria-hidden")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){a=null};var r,o=(r=n(473))&&r.__esModule?r:{default:r},i=n(112),a=null;function s(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function l(e){var t=e||a;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,o.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},63:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[i,a],t=0;t<e.length;t++){var n=e[t];n&&n.parentNode&&n.parentNode.removeChild(n)}i=a=null,s=[]},t.log=function(){console.log("bodyTrap ----------"),console.log(s.length);for(var e=[i,a],t=0;t<e.length;t++){var n=e[t]||{};console.log(n.nodeName,n.className,n.id)}console.log("edn bodyTrap ----------")};var r,o=(r=n(623))&&r.__esModule?r:{default:r},i=void 0,a=void 0,s=[];function l(){0!==s.length&&s[s.length-1].focusContent()}o.default.subscribe((function(e,t){i||a||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",l),(a=i.cloneNode()).addEventListener("focus",l)),(s=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==a&&document.body.appendChild(a)):(i.parentElement&&i.parentElement.removeChild(i),a.parentElement&&a.parentElement.removeChild(a))}))},409:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)o(e,n[t]);var i=document.body;for(var a in r)o(i,r[a]);n={},r={}},t.log=function(){};var n={},r={};function o(e,t){e.classList.remove(t)}t.add=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),o.add(e)}));var o,i},t.remove=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&o.remove(e)}));var o,i}},685:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){i=[]},t.log=function(){},t.handleBlur=l,t.handleFocus=c,t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){i.length>0&&i.pop()},t.setupScopedFocus=function(e){a=e,window.addEventListener?(window.addEventListener("blur",l,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",l),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){a=null,window.addEventListener?(window.removeEventListener("blur",l),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",l),document.detachEvent("onFocus",c))};var r,o=(r=n(845))&&r.__esModule?r:{default:r},i=[],a=null,s=!1;function l(){s=!0}function c(){if(s){if(s=!1,!a)return;setTimeout((function(){a.contains(document.activeElement)||((0,o.default)(a)[0]||a).focus()}),0)}}},623:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(r.openInstances.length),r.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){r=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},r=new n;t.default=r},112:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r,o=((r=n(875))&&r.__esModule?r:{default:r}).default,i=o.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=o.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=o.canUseDOM?window.NodeList:{},t.canUseDOM=o.canUseDOM,t.default=i},338:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e);if(n.length){var r=void 0,a=t.shiftKey,s=n[0],l=n[n.length-1],c=i();if(e===c){if(!a)return;r=l}if(l!==c||a||(r=s),s===c&&a&&(r=l),r)return t.preventDefault(),void r.focus();var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null!=u&&"Chrome"!=u[1]&&null==/\biPod\b|\biPad\b/g.exec(navigator.userAgent)){var d=n.indexOf(c);if(d>-1&&(d+=a?-1:1),void 0===(r=n[d]))return t.preventDefault(),void(r=a?l:s).focus();t.preventDefault(),r.focus()}}else t.preventDefault()};var r,o=(r=n(845))&&r.__esModule?r:{default:r};function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?i(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},845:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){return[].slice.call(t.querySelectorAll("*"),0).reduce((function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])}),[]).filter(o)};var n=/input|select|textarea|button|object|iframe/;function r(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var n=window.getComputedStyle(e),r=n.getPropertyValue("display");return t?"contents"!==r&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,n):"none"===r}catch(e){return console.warn("Failed to inspect element style"),!1}}function o(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var o=isNaN(t);return(o||t>=0)&&function(e,t){var o=e.nodeName.toLowerCase();return(n.test(o)&&!e.disabled||"a"===o&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),r(t))return!1;t=t.parentNode}return!0}(e)}(e,!o)}e.exports=t.default},253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(983))&&r.__esModule?r:{default:r};t.default=o.default,e.exports=t.default},358:function(e,t,n){var r;r=e=>(()=>{var t={703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},98:t=>{"use strict";t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>C});var e=r(98),t=r.n(e),n=r(697),i=r.n(n);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}var s=function(e){var n=e.pageClassName,r=e.pageLinkClassName,o=e.page,i=e.selected,s=e.activeClassName,l=e.activeLinkClassName,c=e.getEventListener,u=e.pageSelectedHandler,d=e.href,f=e.extraAriaContext,p=e.pageLabelBuilder,m=e.rel,h=e.ariaLabel||"Page "+o+(f?" "+f:""),v=null;return i&&(v="page",h=e.ariaLabel||"Page "+o+" is your current page",n=void 0!==n?n+" "+s:s,void 0!==r?void 0!==l&&(r=r+" "+l):r=l),t().createElement("li",{className:n},t().createElement("a",a({rel:m,role:d?void 0:"button",className:r,href:d,tabIndex:i?"-1":"0","aria-label":h,"aria-current":v,onKeyPress:u},c(u)),p(o)))};s.propTypes={pageSelectedHandler:i().func.isRequired,selected:i().bool.isRequired,pageClassName:i().string,pageLinkClassName:i().string,activeClassName:i().string,activeLinkClassName:i().string,extraAriaContext:i().string,href:i().string,ariaLabel:i().string,page:i().number.isRequired,getEventListener:i().func.isRequired,pageLabelBuilder:i().func.isRequired,rel:i().string};const l=s;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var u=function(e){var n=e.breakLabel,r=e.breakClassName,o=e.breakLinkClassName,i=e.breakHandler,a=e.getEventListener,s=r||"break";return t().createElement("li",{className:s},t().createElement("a",c({className:o,role:"button",tabIndex:"0",onKeyPress:i},a(i)),n))};u.propTypes={breakLabel:i().oneOfType([i().string,i().node]),breakClassName:i().string,breakLinkClassName:i().string,breakHandler:i().func.isRequired,getEventListener:i().func.isRequired};const d=u;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!=e?e:t}function p(e){return p="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},p(e)}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(s,e);var n,r,o,i,a=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(o);if(i){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function s(e){var n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),b(g(n=a.call(this,e)),"handlePreviousPage",(function(e){var t=n.state.selected;n.handleClick(e,null,t>0?t-1:void 0,{isPrevious:!0})})),b(g(n),"handleNextPage",(function(e){var t=n.state.selected,r=n.props.pageCount;n.handleClick(e,null,t<r-1?t+1:void 0,{isNext:!0})})),b(g(n),"handlePageSelected",(function(e,t){if(n.state.selected===e)return n.callActiveCallback(e),void n.handleClick(t,null,void 0,{isActive:!0});n.handleClick(t,null,e)})),b(g(n),"handlePageChange",(function(e){n.state.selected!==e&&(n.setState({selected:e}),n.callCallback(e))})),b(g(n),"getEventListener",(function(e){return b({},n.props.eventListener,e)})),b(g(n),"handleClick",(function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=o.isPrevious,a=void 0!==i&&i,s=o.isNext,l=void 0!==s&&s,c=o.isBreak,u=void 0!==c&&c,d=o.isActive,f=void 0!==d&&d;e.preventDefault?e.preventDefault():e.returnValue=!1;var p=n.state.selected,m=n.props.onClick,h=r;if(m){var v=m({index:t,selected:p,nextSelectedPage:r,event:e,isPrevious:a,isNext:l,isBreak:u,isActive:f});if(!1===v)return;Number.isInteger(v)&&(h=v)}void 0!==h&&n.handlePageChange(h)})),b(g(n),"handleBreakClick",(function(e,t){var r=n.state.selected;n.handleClick(t,e,r<e?n.getForwardJump():n.getBackwardJump(),{isBreak:!0})})),b(g(n),"callCallback",(function(e){void 0!==n.props.onPageChange&&"function"==typeof n.props.onPageChange&&n.props.onPageChange({selected:e})})),b(g(n),"callActiveCallback",(function(e){void 0!==n.props.onPageActive&&"function"==typeof n.props.onPageActive&&n.props.onPageActive({selected:e})})),b(g(n),"getElementPageRel",(function(e){var t=n.state.selected,r=n.props,o=r.nextPageRel,i=r.prevPageRel,a=r.selectedPageRel;return t-1===e?i:t===e?a:t+1===e?o:void 0})),b(g(n),"pagination",(function(){var e=[],r=n.props,o=r.pageRangeDisplayed,i=r.pageCount,a=r.marginPagesDisplayed,s=r.breakLabel,l=r.breakClassName,c=r.breakLinkClassName,u=n.state.selected;if(i<=o)for(var f=0;f<i;f++)e.push(n.getPageElement(f));else{var p=o/2,m=o-p;u>i-o/2?p=o-(m=i-u):u<o/2&&(m=o-(p=u));var h,v,g=function(e){return n.getPageElement(e)},y=[];for(h=0;h<i;h++){var b=h+1;b<=a||b>i-a||h>=u-p&&h<=u+(0===u&&o>1?m-1:m)?y.push({type:"page",index:h,display:g(h)}):s&&y.length>0&&y[y.length-1].display!==v&&(o>0||a>0)&&(v=t().createElement(d,{key:h,breakLabel:s,breakClassName:l,breakLinkClassName:c,breakHandler:n.handleBreakClick.bind(null,h),getEventListener:n.getEventListener}),y.push({type:"break",index:h,display:v}))}y.forEach((function(t,n){var r=t;"break"===t.type&&y[n-1]&&"page"===y[n-1].type&&y[n+1]&&"page"===y[n+1].type&&y[n+1].index-y[n-1].index<=2&&(r={type:"page",index:t.index,display:g(t.index)}),e.push(r.display)}))}return e})),void 0!==e.initialPage&&void 0!==e.forcePage&&console.warn("(react-paginate): Both initialPage (".concat(e.initialPage,") and forcePage (").concat(e.forcePage,") props are provided, which is discouraged.")+" Use exclusively forcePage prop for a controlled component.\nSee https://reactjs.org/docs/forms.html#controlled-components"),r=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,n.state={selected:r},n}return n=s,(r=[{key:"componentDidMount",value:function(){var e=this.props,t=e.initialPage,n=e.disableInitialCallback,r=e.extraAriaContext,o=e.pageCount,i=e.forcePage;void 0===t||n||this.callCallback(t),r&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(o)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(o,"). Did you forget a Math.ceil()?")),void 0!==t&&t>o-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(t," > ").concat(o-1,").")),void 0!==i&&i>o-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(i," > ").concat(o-1,")."))}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&(this.props.forcePage>this.props.pageCount-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(this.props.forcePage," > ").concat(this.props.pageCount-1,").")),this.setState({selected:this.props.forcePage})),Number.isInteger(e.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var e=this.state.selected,t=this.props,n=t.pageCount,r=e+t.pageRangeDisplayed;return r>=n?n-1:r}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"getElementHref",value:function(e){var t=this.props,n=t.hrefBuilder,r=t.pageCount,o=t.hrefAllControls;if(n)return o||e>=0&&e<r?n(e+1,r,this.state.selected):void 0}},{key:"ariaLabelBuilder",value:function(e){var t=e===this.state.selected;if(this.props.ariaLabelBuilder&&e>=0&&e<this.props.pageCount){var n=this.props.ariaLabelBuilder(e+1,t);return this.props.extraAriaContext&&!t&&(n=n+" "+this.props.extraAriaContext),n}}},{key:"getPageElement",value:function(e){var n=this.state.selected,r=this.props,o=r.pageClassName,i=r.pageLinkClassName,a=r.activeClassName,s=r.activeLinkClassName,c=r.extraAriaContext,u=r.pageLabelBuilder;return t().createElement(l,{key:e,pageSelectedHandler:this.handlePageSelected.bind(null,e),selected:n===e,rel:this.getElementPageRel(e),pageClassName:o,pageLinkClassName:i,activeClassName:a,activeLinkClassName:s,extraAriaContext:c,href:this.getElementHref(e),ariaLabel:this.ariaLabelBuilder(e),page:e+1,pageLabelBuilder:u,getEventListener:this.getEventListener})}},{key:"render",value:function(){var e=this.props.renderOnZeroPageCount;if(0===this.props.pageCount&&void 0!==e)return e?e(this.props):e;var n=this.props,r=n.disabledClassName,o=n.disabledLinkClassName,i=n.pageCount,a=n.className,s=n.containerClassName,l=n.previousLabel,c=n.previousClassName,u=n.previousLinkClassName,d=n.previousAriaLabel,p=n.prevRel,h=n.nextLabel,v=n.nextClassName,g=n.nextLinkClassName,y=n.nextAriaLabel,b=n.nextRel,w=this.state.selected,C=0===w,E=w===i-1,x="".concat(f(c)).concat(C?" ".concat(f(r)):""),O="".concat(f(v)).concat(E?" ".concat(f(r)):""),k="".concat(f(u)).concat(C?" ".concat(f(o)):""),_="".concat(f(g)).concat(E?" ".concat(f(o)):""),S=C?"true":"false",N=E?"true":"false";return t().createElement("ul",{className:a||s,role:"navigation","aria-label":"Pagination"},t().createElement("li",{className:x},t().createElement("a",m({className:k,href:this.getElementHref(w-1),tabIndex:C?"-1":"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":S,"aria-label":d,rel:p},this.getEventListener(this.handlePreviousPage)),l)),this.pagination(),t().createElement("li",{className:O},t().createElement("a",m({className:_,href:this.getElementHref(w+1),tabIndex:E?"-1":"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":N,"aria-label":y,rel:b},this.getEventListener(this.handleNextPage)),h)))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(e.Component);b(w,"propTypes",{pageCount:i().number.isRequired,pageRangeDisplayed:i().number,marginPagesDisplayed:i().number,previousLabel:i().node,previousAriaLabel:i().string,prevPageRel:i().string,prevRel:i().string,nextLabel:i().node,nextAriaLabel:i().string,nextPageRel:i().string,nextRel:i().string,breakLabel:i().oneOfType([i().string,i().node]),hrefBuilder:i().func,hrefAllControls:i().bool,onPageChange:i().func,onPageActive:i().func,onClick:i().func,initialPage:i().number,forcePage:i().number,disableInitialCallback:i().bool,containerClassName:i().string,className:i().string,pageClassName:i().string,pageLinkClassName:i().string,pageLabelBuilder:i().func,activeClassName:i().string,activeLinkClassName:i().string,previousClassName:i().string,nextClassName:i().string,previousLinkClassName:i().string,nextLinkClassName:i().string,disabledClassName:i().string,disabledLinkClassName:i().string,breakClassName:i().string,breakLinkClassName:i().string,extraAriaContext:i().string,ariaLabelBuilder:i().func,eventListener:i().string,renderOnZeroPageCount:i().func,selectedPageRel:i().string}),b(w,"defaultProps",{pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevPageRel:"prev",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextPageRel:"next",nextRel:"next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(e){return e},eventListener:"onClick",renderOnZeroPageCount:void 0,selectedPageRel:"canonical",hrefAllControls:!1});const C=w})(),o})(),e.exports=r(n(196))},666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:k(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",p="executing",m="completed",h={};function v(){}function g(){}function y(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(D([])));C&&C!==n&&r.call(C,a)&&(b=C);var E=y.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,i,a,s){var l=d(e[o],e,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function k(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var l=d(e,t,n);if("normal"===l.type){if(r=n.done?m:"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=m,n.method="throw",n.arg=l.arg)}}}function _(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,_(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=d(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function D(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:I}}function I(){return{value:t,done:!0}}return g.prototype=y,o(E,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},x(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(E),c(E,l,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},473:function(e){"use strict";e.exports=function(){}},196:function(e){"use strict";e.exports=window.React},850:function(e){"use strict";e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=window.wp.element,t=n(196),r=n.n(t),o=n(697),i=n.n(o);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}var s=n(850),l=n.n(s);const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function u(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function d(e){return"nodeType"in e}function f(e){var t,n;return e?u(e)?e:d(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function p(e){const{Document:t}=f(e);return e instanceof t}function m(e){return!u(e)&&e instanceof f(e).HTMLElement}function h(e){return e?u(e)?e.document:d(e)?p(e)?e:m(e)?e.ownerDocument:document:document:document}const v=c?t.useLayoutEffect:t.useEffect;function g(e){const n=(0,t.useRef)(e);return v((()=>{n.current=e})),(0,t.useCallback)((function(...e){return null==n.current?void 0:n.current(...e)}),[])}function y(e,n=[e]){const r=(0,t.useRef)(e);return v((()=>{r.current!==e&&(r.current=e)}),n),r}function b(e,n){const r=(0,t.useRef)();return(0,t.useMemo)((()=>{const t=e(r.current);return r.current=t,t}),[...n])}function w(e){const n=g(e),r=(0,t.useRef)(null),o=(0,t.useCallback)((e=>{e!==r.current&&(null==n||n(e,r.current)),r.current=e}),[]);return[r,o]}function C(e){const n=(0,t.useRef)();return(0,t.useEffect)((()=>{n.current=e}),[e]),n.current}let E={};function x(e,n){return(0,t.useMemo)((()=>{if(n)return n;const t=null==E[e]?0:E[e]+1;return E[e]=t,`${e}-${t}`}),[e,n])}function O(e){return(t,...n)=>n.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}const k=O(1),_=O(-1);function S(e){if(!e)return!1;const{KeyboardEvent:t}=f(e.target);return t&&e instanceof t}function N(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=f(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const T=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return`translate3d(${t?Math.round(t):0}px, ${n?Math.round(n):0}px, 0)`}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return`scaleX(${t}) scaleY(${n})`}},Transform:{toString(e){if(e)return[T.Translate.toString(e),T.Scale.toString(e)].join(" ")}},Transition:{toString({property:e,duration:t,easing:n}){return`${e} ${t}ms ${n}`}}}),D="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function I(e){return e.matches(D)?e:e.querySelector(D)}const P={display:"none"};function M(e){let{id:t,value:n}=e;return r().createElement("div",{id:t,style:P},n)}const R={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function A(e){let{id:t,announcement:n}=e;return r().createElement("div",{id:t,style:R,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const L=(0,t.createContext)(null);function j(e){const n=(0,t.useContext)(L);(0,t.useEffect)((()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)}),[e,n])}const F={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},B={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function H(e){let{announcements:n=B,container:o,hiddenTextDescribedById:i,screenReaderInstructions:a=F}=e;const{announce:l,announcement:c}=function(){const[e,n]=(0,t.useState)("");return{announce:(0,t.useCallback)((e=>{null!=e&&n(e)}),[]),announcement:e}}(),u=x("DndLiveRegion"),[d,f]=(0,t.useState)(!1);if((0,t.useEffect)((()=>{f(!0)}),[]),j((0,t.useMemo)((()=>({onDragStart(e){let{active:t}=e;l(n.onDragStart({active:t}))},onDragMove(e){let{active:t,over:r}=e;n.onDragMove&&l(n.onDragMove({active:t,over:r}))},onDragOver(e){let{active:t,over:r}=e;l(n.onDragOver({active:t,over:r}))},onDragEnd(e){let{active:t,over:r}=e;l(n.onDragEnd({active:t,over:r}))},onDragCancel(e){let{active:t,over:r}=e;l(n.onDragCancel({active:t,over:r}))}})),[l,n])),!d)return null;const p=r().createElement(r().Fragment,null,r().createElement(M,{id:i,value:a.draggable}),r().createElement(A,{id:u,announcement:c}));return o?(0,s.createPortal)(p,o):p}var V;function W(){}function U(e,n){return(0,t.useMemo)((()=>({sensor:e,options:null!=n?n:{}})),[e,n])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(V||(V={}));const z=Object.freeze({x:0,y:0});function q(e,t){const n=N(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Y(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const X=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=$(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Y)};function K(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:z}function G(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const J=G(1);function Z(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Q={ignoreTransform:!1};function ee(e,t){void 0===t&&(t=Q);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:t}=f(e),{transform:r,transformOrigin:o}=t(e);r&&(n=function(e,t,n){const r=Z(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}(n,r,o))}const{top:r,left:o,width:i,height:a,bottom:s,right:l}=n;return{top:r,left:o,width:i,height:a,bottom:s,right:l}}function te(e){return ee(e,{ignoreTransform:!0})}function ne(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(p(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!m(o)||function(e){return e instanceof f(e).SVGElement}(o))return n;if(n.includes(o))return n;const{getComputedStyle:i}=f(o),a=i(o);return o!==e&&function(e,t){void 0===t&&(t=f(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=f(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function re(e){const[t]=ne(e,1);return null!=t?t:null}function oe(e){return c&&e?u(e)?e:d(e)?p(e)||e===h(e).scrollingElement?window:m(e)?e:null:null:null}function ie(e){return u(e)?e.scrollX:e.scrollLeft}function ae(e){return u(e)?e.scrollY:e.scrollTop}function se(e){return{x:ie(e),y:ae(e)}}var le;function ce(e){return!(!c||!e)&&e===document.scrollingElement}function ue(e){const t={x:0,y:0},n=ce(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(le||(le={}));const de={x:.2,y:.2};function fe(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=de);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=ue(e),p={x:0,y:0},m={x:0,y:0},h=t.height*o.y,v=t.width*o.x;return!c&&i<=t.top+h?(p.y=le.Backward,m.y=r*Math.abs((t.top+h-i)/h)):!u&&l>=t.bottom-h&&(p.y=le.Forward,m.y=r*Math.abs((t.bottom-h-l)/h)),!f&&s>=t.right-v?(p.x=le.Forward,m.x=r*Math.abs((t.right-v-s)/v)):!d&&a<=t.left+v&&(p.x=le.Backward,m.x=r*Math.abs((t.left+v-a)/v)),{direction:p,speed:m}}function pe(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function me(e){return e.reduce(((e,t)=>k(e,se(t))),z)}function he(e,t){if(void 0===t&&(t=ee),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);re(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ve=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+ie(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+ae(t)),0)}]];class ge{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ne(t),r=me(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ve)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ye{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function be(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var we,Ce;function Ee(e){e.preventDefault()}function xe(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(we||(we={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Ce||(Ce={}));const Oe={start:[Ce.Space,Ce.Enter],cancel:[Ce.Esc],end:[Ce.Space,Ce.Enter]},ke=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ce.Right:return{...n,x:n.x+25};case Ce.Left:return{...n,x:n.x-25};case Ce.Down:return{...n,y:n.y+25};case Ce.Up:return{...n,y:n.y-25}}};class _e{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ye(h(t)),this.windowListeners=new ye(f(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(we.Resize,this.handleCancel),this.windowListeners.add(we.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(we.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&he(n),t(z)}handleKeyDown(e){if(S(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Oe,coordinateGetter:i=ke,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:z;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=_(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:d,minScroll:f}=ue(n),p=pe(n),m={x:Math.min(o===Ce.Right?p.right-p.width/2:p.right,Math.max(o===Ce.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===Ce.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Ce.Down?p.top:p.top+p.height/2,u.y))},h=o===Ce.Right&&!s||o===Ce.Left&&!l,v=o===Ce.Down&&!c||o===Ce.Up&&!i;if(h&&m.x!==u.x){const e=n.scrollLeft+t.x,i=o===Ce.Right&&e<=d.x||o===Ce.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Ce.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(v&&m.y!==u.y){const e=n.scrollTop+t.y,i=o===Ce.Down&&e<=d.y||o===Ce.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Ce.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,k(_(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Se(e){return Boolean(e&&"distance"in e)}function Ne(e){return Boolean(e&&"delay"in e)}_e.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Oe,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Te{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=f(e);return e instanceof t?e:h(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=h(i),this.documentListeners=new ye(this.document),this.listeners=new ye(n),this.windowListeners=new ye(f(i)),this.initialCoordinates=null!=(r=N(o))?r:z,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(we.Resize,this.handleCancel),this.windowListeners.add(we.DragStart,Ee),this.windowListeners.add(we.VisibilityChange,this.handleCancel),this.windowListeners.add(we.ContextMenu,Ee),this.documentListeners.add(we.Keydown,this.handleKeydown),t){if(Se(t))return;if(Ne(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(we.Click,xe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(we.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=N(e))?t:z,l=_(r,s);if(!n&&a){if(Ne(a))return be(l,a.tolerance)?this.handleCancel():void 0;if(Se(a))return null!=a.tolerance&&be(l,a.tolerance)?this.handleCancel():be(l,a.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Ce.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const De={move:{name:"pointermove"},end:{name:"pointerup"}};class Ie extends Te{constructor(e){const{event:t}=e,n=h(t.target);super(e,De,n)}}Ie.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const Pe={move:{name:"mousemove"},end:{name:"mouseup"}};var Me;!function(e){e[e.RightClick=2]="RightClick"}(Me||(Me={})),class extends Te{constructor(e){super(e,Pe,h(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Me.RightClick&&(null==r||r({event:n}),!0)}}];const Re={move:{name:"touchmove"},end:{name:"touchend"}};var Ae,Le;(class extends Te{constructor(e){super(e,Re)}static setup(){return window.addEventListener(Re.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Re.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ae||(Ae={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Le||(Le={}));const je={x:{[le.Backward]:!1,[le.Forward]:!1},y:{[le.Backward]:!1,[le.Forward]:!1}};var Fe,Be;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Fe||(Fe={})),function(e){e.Optimized="optimized"}(Be||(Be={}));const He=new Map;function Ve(e,t){return b((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function We(e){let{callback:n,disabled:r}=e;const o=g(n),i=(0,t.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[r]);return(0,t.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function Ue(e){return new ge(ee(e),e)}function ze(e,n,r){void 0===n&&(n=Ue);const[o,i]=(0,t.useReducer)((function(t){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=t?t:r)?o:null;const i=n(e);return JSON.stringify(t)===JSON.stringify(i)?t:i}),null),a=function(e){let{callback:n,disabled:r}=e;const o=g(n),i=(0,t.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,r]);return(0,t.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),s=We({callback:i});return v((()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())}),[e]),o}const qe=[];function Ye(e,n){void 0===n&&(n=[]);const r=(0,t.useRef)(null);return(0,t.useEffect)((()=>{r.current=null}),n),(0,t.useEffect)((()=>{const t=e!==z;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)}),[e]),r.current?_(e,r.current):z}function $e(e){return(0,t.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Xe=[];function Ke(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return m(t)?t:e}const Ge=[{sensor:Ie,options:{}},{sensor:_e,options:{}}],Je={current:{}},Ze={draggable:{measure:te},droppable:{measure:te,strategy:Fe.WhileDragging,frequency:Be.Optimized},dragOverlay:{measure:ee}};class Qe extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const et={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Qe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:W},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ze,measureDroppableContainers:W,windowRect:null,measuringScheduled:!1},tt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:W,draggableNodes:new Map,over:null,measureDroppableContainers:W},nt=(0,t.createContext)(tt),rt=(0,t.createContext)(et);function ot(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Qe}}}function it(e,t){switch(t.type){case V.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case V.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case V.DragEnd:case V.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case V.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Qe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case V.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Qe(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case V.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Qe(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function at(e){let{disabled:n}=e;const{active:r,activatorEvent:o,draggableNodes:i}=(0,t.useContext)(nt),a=C(o),s=C(null==r?void 0:r.id);return(0,t.useEffect)((()=>{if(!n&&!o&&a&&null!=s){if(!S(a))return;if(document.activeElement===a.target)return;const e=i.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=I(e);if(t){t.focus();break}}}))}}),[o,n,i,s,a]),null}function st(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const lt=(0,t.createContext)({...z,scaleX:1,scaleY:1});var ct;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ct||(ct={}));const ut=(0,t.memo)((function(e){var n,o,i,a;let{id:l,accessibility:u,autoScroll:d=!0,children:p,sensors:h=Ge,collisionDetection:g=X,measuring:E,modifiers:O,..._}=e;const S=(0,t.useReducer)(it,void 0,ot),[T,D]=S,[I,P]=function(){const[e]=(0,t.useState)((()=>new Set)),n=(0,t.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,t.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),n]}(),[M,R]=(0,t.useState)(ct.Uninitialized),A=M===ct.Initialized,{draggable:{active:j,nodes:F,translate:B},droppable:{containers:W}}=T,U=j?F.get(j):null,q=(0,t.useRef)({initial:null,translated:null}),Y=(0,t.useMemo)((()=>{var e;return null!=j?{id:j,data:null!=(e=null==U?void 0:U.data)?e:Je,rect:q}:null}),[j,U]),$=(0,t.useRef)(null),[G,Z]=(0,t.useState)(null),[Q,te]=(0,t.useState)(null),ie=y(_,Object.values(_)),ae=x("DndDescribedBy",l),ue=(0,t.useMemo)((()=>W.getEnabled()),[W]),de=(pe=E,(0,t.useMemo)((()=>({draggable:{...Ze.draggable,...null==pe?void 0:pe.draggable},droppable:{...Ze.droppable,...null==pe?void 0:pe.droppable},dragOverlay:{...Ze.dragOverlay,...null==pe?void 0:pe.dragOverlay}})),[null==pe?void 0:pe.draggable,null==pe?void 0:pe.droppable,null==pe?void 0:pe.dragOverlay]));var pe;const{droppableRects:he,measureDroppableContainers:ve,measuringScheduled:ye}=function(e,n){let{dragging:r,dependencies:o,config:i}=n;const[a,s]=(0,t.useState)(null),l=null!=a,{frequency:c,measure:u,strategy:d}=i,f=(0,t.useRef)(e),p=function(){switch(d){case Fe.Always:return!1;case Fe.BeforeDragging:return r;default:return!r}}(),m=y(p),h=(0,t.useCallback)((function(e){void 0===e&&(e=[]),m.current||s((t=>t?t.concat(e):e))}),[m]),v=(0,t.useRef)(null),g=b((t=>{if(p&&!r)return He;const n=a;if(!t||t===He||f.current!==e||null!=n){const t=new Map;for(let r of e){if(!r)continue;if(n&&n.length>0&&!n.includes(r.id)&&r.rect.current){t.set(r.id,r.rect.current);continue}const e=r.node.current,o=e?new ge(u(e),e):null;r.rect.current=o,o&&t.set(r.id,o)}return t}return t}),[e,a,r,p,u]);return(0,t.useEffect)((()=>{f.current=e}),[e]),(0,t.useEffect)((()=>{p||requestAnimationFrame((()=>h()))}),[r,p]),(0,t.useEffect)((()=>{l&&s(null)}),[l]),(0,t.useEffect)((()=>{p||"number"!=typeof c||null!==v.current||(v.current=setTimeout((()=>{h(),v.current=null}),c))}),[c,p,h,...o]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:l}}(ue,{dragging:A,dependencies:[B.x,B.y],config:de.droppable}),be=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return b((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(F,j),we=(0,t.useMemo)((()=>Q?N(Q):null),[Q]),Ce=function(){const e=!1===(null==G?void 0:G.autoScrollEnabled),t="object"==typeof d?!1===d.enabled:!1===d,n=A&&!e&&!t;return"object"==typeof d?{...d,enabled:n}:{enabled:n}}(),Ee=function(e,t){return Ve(e,t)}(be,de.draggable.measure);!function(e){let{activeNode:n,measure:r,initialRect:o,config:i=!0}=e;const a=(0,t.useRef)(!1),{x:s,y:l}="boolean"==typeof i?{x:i,y:i}:i;v((()=>{if(!s&&!l||!n)return void(a.current=!1);if(a.current||!o)return;const e=null==n?void 0:n.node.current;if(!e||!1===e.isConnected)return;const t=K(r(e),o);if(s||(t.x=0),l||(t.y=0),a.current=!0,Math.abs(t.x)>0||Math.abs(t.y)>0){const n=re(e);n&&n.scrollBy({top:t.y,left:t.x})}}),[n,s,l,o,r])}({activeNode:j?F.get(j):null,config:Ce.layoutShiftCompensation,initialRect:Ee,measure:de.draggable.measure});const xe=ze(be,de.draggable.measure,Ee),Oe=ze(be?be.parentElement:null),ke=(0,t.useRef)({activatorEvent:null,active:null,activeNode:be,collisionRect:null,collisions:null,droppableRects:he,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=W.getNodeFor(null==(n=ke.current.over)?void 0:n.id),Se=function(e){let{measure:n}=e;const[r,o]=(0,t.useState)(null),i=(0,t.useCallback)((e=>{for(const{target:t}of e)if(m(t)){o((e=>{const r=n(t);return e?{...e,width:r.width,height:r.height}:r}));break}}),[n]),a=We({callback:i}),s=(0,t.useCallback)((e=>{const t=Ke(e);null==a||a.disconnect(),t&&(null==a||a.observe(t)),o(t?n(t):null)}),[n,a]),[l,c]=w(s);return(0,t.useMemo)((()=>({nodeRef:l,rect:r,setRef:c})),[r,l,c])}({measure:de.dragOverlay.measure}),Ne=null!=(o=Se.nodeRef.current)?o:be,Te=A?null!=(i=Se.rect)?i:xe:null,De=Boolean(Se.nodeRef.current&&Se.rect),Ie=K(Pe=De?null:xe,Ve(Pe));var Pe;const Me=$e(Ne?f(Ne):null),Re=function(e){const n=(0,t.useRef)(e),r=b((t=>e?t&&t!==qe&&e&&n.current&&e.parentNode===n.current.parentNode?t:ne(e):qe),[e]);return(0,t.useEffect)((()=>{n.current=e}),[e]),r}(A?null!=_e?_e:be:null),Be=function(e,n){void 0===n&&(n=ee);const[r]=e,o=$e(r?f(r):null),[i,a]=(0,t.useReducer)((function(){return e.length?e.map((e=>ce(e)?o:new ge(n(e),e))):Xe}),Xe),s=We({callback:a});return e.length>0&&i===Xe&&a(),v((()=>{e.length?e.forEach((e=>null==s?void 0:s.observe(e))):(null==s||s.disconnect(),a())}),[e]),i}(Re),Ue=st(O,{transform:{x:B.x-Ie.x,y:B.y-Ie.y,scaleX:1,scaleY:1},activatorEvent:Q,active:Y,activeNodeRect:xe,containerNodeRect:Oe,draggingNodeRect:Te,over:ke.current.over,overlayNodeRect:Se.rect,scrollableAncestors:Re,scrollableAncestorRects:Be,windowRect:Me}),Qe=we?k(we,B):null,et=function(e){const[n,r]=(0,t.useState)(null),o=(0,t.useRef)(e),i=(0,t.useCallback)((e=>{const t=oe(e.target);t&&r((e=>e?(e.set(t,se(t)),new Map(e)):null))}),[]);return(0,t.useEffect)((()=>{const t=o.current;if(e!==t){n(t);const a=e.map((e=>{const t=oe(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,se(t)]):null})).filter((e=>null!=e));r(a.length?new Map(a):null),o.current=e}return()=>{n(e),n(t)};function n(e){e.forEach((e=>{const t=oe(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),(0,t.useMemo)((()=>e.length?n?Array.from(n.values()).reduce(((e,t)=>k(e,t)),z):me(e):z),[e,n])}(Re),tt=Ye(et),ut=Ye(et,[xe]),dt=k(Ue,tt),ft=Te?J(Te,Ue):null,pt=Y&&ft?g({active:Y,collisionRect:ft,droppableRects:he,droppableContainers:ue,pointerCoordinates:Qe}):null,mt=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n.id}(pt),[ht,vt]=(0,t.useState)(null),gt=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(De?Ue:k(Ue,ut),null!=(a=null==ht?void 0:ht.rect)?a:null,xe),yt=(0,t.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==$.current)return;const o=F.get($.current);if(!o)return;const i=e.nativeEvent,a=new n({active:$.current,activeNode:o,event:i,options:r,context:ke,onStart(e){const t=$.current;if(null==t)return;const n=F.get(t);if(!n)return;const{onDragStart:r}=ie.current,o={active:{id:t,data:n.data,rect:q}};(0,s.unstable_batchedUpdates)((()=>{null==r||r(o),R(ct.Initializing),D({type:V.DragStart,initialCoordinates:e,active:t}),I({type:"onDragStart",event:o})}))},onMove(e){D({type:V.DragMove,coordinates:e})},onEnd:l(V.DragEnd),onCancel:l(V.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ke.current;let a=null;if(t&&o){const{cancelDrop:s}=ie.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===V.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=V.DragCancel)}$.current=null,(0,s.unstable_batchedUpdates)((()=>{D({type:e}),R(ct.Uninitialized),vt(null),Z(null),te(null);const t=e===V.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=ie.current[t];null==e||e(a),I({type:t,event:a})}}))}}(0,s.unstable_batchedUpdates)((()=>{Z(a),te(e.nativeEvent)}))}),[F]),bt=(0,t.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=F.get(r);if(null!==$.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},$.current=r,yt(n,t))}),[F,yt]),wt=function(e,n){return(0,t.useMemo)((()=>e.reduce(((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:n(e.handler,t)})))]}),[])),[e,n])}(h,bt);!function(e){(0,t.useEffect)((()=>{if(!c)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(h),v((()=>{xe&&M===ct.Initializing&&R(ct.Initialized)}),[xe,M]),(0,t.useEffect)((()=>{const{onDragMove:e}=ie.current,{active:t,activatorEvent:n,collisions:r,over:o}=ke.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:dt.x,y:dt.y},over:o};(0,s.unstable_batchedUpdates)((()=>{null==e||e(i),I({type:"onDragMove",event:i})}))}),[dt.x,dt.y]),(0,t.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ke.current;if(!e||null==$.current||!t||!o)return;const{onDragOver:i}=ie.current,a=r.get(mt),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,s.unstable_batchedUpdates)((()=>{vt(l),null==i||i(c),I({type:"onDragOver",event:c})}))}),[mt]),v((()=>{ke.current={activatorEvent:Q,active:Y,activeNode:be,collisionRect:ft,collisions:pt,droppableRects:he,draggableNodes:F,draggingNode:Ne,draggingNodeRect:Te,droppableContainers:W,over:ht,scrollableAncestors:Re,scrollAdjustedTranslate:dt},q.current={initial:Te,translated:ft}}),[Y,be,pt,ft,F,Ne,Te,he,W,ht,Re,dt]),function(e){let{acceleration:n,activator:r=Ae.Pointer,canScroll:o,draggingRect:i,enabled:a,interval:s=5,order:l=Le.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e;const m=function(e){let{delta:t,disabled:n}=e;const r=C(t);return b((e=>{if(n||!r||!e)return je;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[le.Backward]:e.x[le.Backward]||-1===o,[le.Forward]:e.x[le.Forward]||1===o},y:{[le.Backward]:e.y[le.Backward]||-1===i,[le.Forward]:e.y[le.Forward]||1===i}}}),[n,t,r])}({delta:f,disabled:!a}),[h,v]=function(){const e=(0,t.useRef)(null);return[(0,t.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,t.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),g=(0,t.useRef)({x:0,y:0}),y=(0,t.useRef)({x:0,y:0}),w=(0,t.useMemo)((()=>{switch(r){case Ae.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ae.DraggableRect:return i}}),[r,i,c]),E=(0,t.useRef)(null),x=(0,t.useCallback)((()=>{const e=E.current;if(!e)return;const t=g.current.x*y.current.x,n=g.current.y*y.current.y;e.scrollBy(t,n)}),[]),O=(0,t.useMemo)((()=>l===Le.TreeOrder?[...u].reverse():u),[l,u]);(0,t.useEffect)((()=>{if(a&&u.length&&w){for(const e of O){if(!1===(null==o?void 0:o(e)))continue;const t=u.indexOf(e),r=d[t];if(!r)continue;const{direction:i,speed:a}=fe(e,r,w,n,p);for(const e of["x","y"])m[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return v(),E.current=e,h(x,s),g.current=a,void(y.current=i)}g.current={x:0,y:0},y.current={x:0,y:0},v()}else v()}),[n,x,o,v,a,s,JSON.stringify(w),JSON.stringify(m),h,u,O,d,JSON.stringify(p)])}({...Ce,delta:B,draggingRect:ft,pointerCoordinates:Qe,scrollableAncestors:Re,scrollableAncestorRects:Be});const Ct=(0,t.useMemo)((()=>({active:Y,activeNode:be,activeNodeRect:xe,activatorEvent:Q,collisions:pt,containerNodeRect:Oe,dragOverlay:Se,draggableNodes:F,droppableContainers:W,droppableRects:he,over:ht,measureDroppableContainers:ve,scrollableAncestors:Re,scrollableAncestorRects:Be,measuringConfiguration:de,measuringScheduled:ye,windowRect:Me})),[Y,be,xe,Q,pt,Oe,Se,F,W,he,ht,ve,Re,Be,de,ye,Me]),Et=(0,t.useMemo)((()=>({activatorEvent:Q,activators:wt,active:Y,activeNodeRect:xe,ariaDescribedById:{draggable:ae},dispatch:D,draggableNodes:F,over:ht,measureDroppableContainers:ve})),[Q,wt,Y,xe,D,ae,F,ht,ve]);return r().createElement(L.Provider,{value:P},r().createElement(nt.Provider,{value:Et},r().createElement(rt.Provider,{value:Ct},r().createElement(lt.Provider,{value:gt},p)),r().createElement(at,{disabled:!1===(null==u?void 0:u.restoreFocus)})),r().createElement(H,{...u,hiddenTextDescribedById:ae}))})),dt=(0,t.createContext)(null),ft="button";const pt={timeout:25};function mt(e){let{animation:n,children:o}=e;const[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)(null),c=C(o);return o||i||!c||a(c),v((()=>{if(!s)return;const e=null==i?void 0:i.key,t=null==i?void 0:i.props.id;null!=e&&null!=t?Promise.resolve(n(t,s)).then((()=>{a(null)})):a(null)}),[n,i,s]),r().createElement(r().Fragment,null,o,i?(0,t.cloneElement)(i,{ref:l}):null)}const ht={x:0,y:0,scaleX:1,scaleY:1};function vt(e){let{children:t}=e;return r().createElement(nt.Provider,{value:tt},r().createElement(lt.Provider,{value:ht},t))}const gt={position:"fixed",touchAction:"none"},yt=e=>S(e)?"transform 250ms ease":void 0,bt=(0,t.forwardRef)(((e,t)=>{let{as:n,activatorEvent:o,adjustScale:i,children:a,className:s,rect:l,style:c,transform:u,transition:d=yt}=e;if(!l)return null;const f=i?u:{...u,scaleX:1,scaleY:1},p={...gt,width:l.width,height:l.height,top:l.top,left:l.left,transform:T.Transform.toString(f),transformOrigin:i&&o?q(o,l):void 0,transition:"function"==typeof d?d(o):d,...c};return r().createElement(n,{className:s,style:p,ref:t},a)})),wt=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},Ct={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:T.Transform.toString(t)},{transform:T.Transform.toString(n)}]},sideEffects:wt({styles:{active:{opacity:"0"}}})};let Et=0;function xt(e){return(0,t.useMemo)((()=>{if(null!=e)return Et++,Et}),[e])}const Ot=r().memo((e=>{let{adjustScale:n=!1,children:o,dropAnimation:i,style:a,transition:s,modifiers:l,wrapperElement:c="div",className:u,zIndex:d=999}=e;const{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:v,draggableNodes:y,droppableContainers:b,dragOverlay:w,over:C,measuringConfiguration:E,scrollableAncestors:x,scrollableAncestorRects:O,windowRect:k}=(0,t.useContext)(rt),_=(0,t.useContext)(lt),S=xt(null==m?void 0:m.id),N=st(l,{activatorEvent:p,active:m,activeNodeRect:h,containerNodeRect:v,draggingNodeRect:w.rect,over:C,overlayNodeRect:w.rect,scrollableAncestors:x,scrollableAncestorRects:O,transform:_,windowRect:k}),T=Ve(h),D=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return g(((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Ke(i);if(!l)return;const{transform:c}=f(i).getComputedStyle(i),u=Z(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ct,...e};return e=>{let{active:i,dragOverlay:a,transform:s,...l}=e;if(!t)return;const c=a.rect.left-i.rect.left,u=a.rect.top-i.rect.top,d={scaleX:1!==s.scaleX?i.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?i.rect.height*s.scaleY/a.rect.height:1},f={x:s.x-c,y:s.y-u,...d},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:f}}),[m]=p,h=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(h))return;const v=null==r?void 0:r({active:i,dragOverlay:a,...l}),g=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{g.onfinish=()=>{null==v||v(),e()}}))}}(t);return he(s,o.draggable.measure),d({active:{id:e,data:a.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:u})}))}({config:i,draggableNodes:y,droppableContainers:b,measuringConfiguration:E}),I=T?w.setRef:void 0;return r().createElement(vt,null,r().createElement(mt,{animation:D},m&&S?r().createElement(bt,{key:S,id:m.id,ref:I,as:c,activatorEvent:p,adjustScale:n,className:u,transition:s,rect:T,style:{zIndex:d,...a},transform:N},o):null))})),kt=r().createContext(null);var _t=n=>{const{position:r,item:o,...i}=n,s=(0,t.useMemo)((()=>`droppable-${r.toString()}-${o.ID.toString()}`),[r,o.ID]),{setNodeRef:l,isOver:c,over:u}=function(e){let{data:n,disabled:r=!1,id:o,resizeObserverConfig:i}=e;const a=x("Droppable"),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=(0,t.useContext)(nt),d=(0,t.useRef)({disabled:r}),f=(0,t.useRef)(!1),p=(0,t.useRef)(null),m=(0,t.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:b}={...pt,...i},C=y(null!=g?g:o),E=We({callback:(0,t.useCallback)((()=>{f.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{u(Array.isArray(C.current)?C.current:[C.current]),m.current=null}),b)):f.current=!0}),[b]),disabled:h||!s}),O=(0,t.useCallback)(((e,t)=>{E&&(t&&(E.unobserve(t),f.current=!1),e&&E.observe(e))}),[E]),[k,_]=w(O),S=y(n);return(0,t.useEffect)((()=>{E&&k.current&&(E.disconnect(),f.current=!1,E.observe(k.current))}),[k,E]),v((()=>(l({type:V.RegisterDroppable,element:{id:o,key:a,disabled:r,node:k,rect:p,data:S}}),()=>l({type:V.UnregisterDroppable,key:a,id:o}))),[o]),(0,t.useEffect)((()=>{r!==d.current.disabled&&(l({type:V.SetDroppableDisabled,id:o,key:a,disabled:r}),d.current.disabled=r)}),[o,a,r,l]),{active:s,rect:p,isOver:(null==c?void 0:c.id)===o,node:k,over:c,setNodeRef:_}}({id:s,data:{item:o}});return(0,e.createElement)("div",a({ref:l,id:s,className:`mmu-droppable-container mmu-droppable-container--${r} `+(c?` mmu-droppable-container--active mmu-droppable-container--${r}--active`:"")},i),(0,e.createElement)("div",{className:`mmu-droppable-inner mmu-droppable-inner--${r}`}))};function St(e){return St="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},St(e)}function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(n),!0).forEach((function(t){Nt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function It(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rt(e,t,n){return t&&Mt(e.prototype,t),n&&Mt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function At(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lt(e,t){return Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lt(e,t)}function jt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lt(e,t)}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ft(e)}function Bt(e,t){if(t&&("object"===St(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return At(e)}function Ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ft(e);if(t){var o=Ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Bt(this,n)}}var Vt=function(e){return+setTimeout(e,16)},Wt=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Vt=function(e){return window.requestAnimationFrame(e)},Wt=function(e){return window.cancelAnimationFrame(e)});var Ut=0,zt=new Map;function qt(e){zt.delete(e)}var Yt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Ut+=1;function r(t){if(0===t)qt(n),e();else{var o=Vt((function(){r(t-1)}));zt.set(n,o)}}return r(t),n};Yt.cancel=function(e){var t=zt.get(e);return qt(t),Wt(t)};var $t=Yt;function Xt(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function Kt(e){return e instanceof HTMLElement?e:l().findDOMNode(e)}var Gt=n(864);function Jt(e,t){"function"==typeof e?e(t):"object"===St(e)&&e&&"current"in e&&(e.current=t)}function Zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter((function(e){return e}));return r.length<=1?r[0]:function(e){t.forEach((function(t){Jt(t,e)}))}}function Qt(e){var t,n,r=(0,Gt.isMemo)(e)?e.type.type:e.type;return!("function"==typeof r&&!(null===(t=r.prototype)||void 0===t?void 0:t.render)||"function"==typeof e&&!(null===(n=e.prototype)||void 0===n?void 0:n.render))}function en(e,t,n,r){var o=l().unstable_batchedUpdates?function(e){l().unstable_batchedUpdates(n,e)}:n;return e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){e.removeEventListener&&e.removeEventListener(t,o,r)}}}function tn(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var nn=(0,t.forwardRef)((function(e,n){var r=e.didUpdate,o=e.getContainer,i=e.children,a=(0,t.useRef)(),s=(0,t.useRef)();(0,t.useImperativeHandle)(n,(function(){return{}}));var c=(0,t.useRef)(!1);return!c.current&&tn()&&(s.current=o(),a.current=s.current.parentNode,c.current=!0),(0,t.useEffect)((function(){null==r||r(e)})),(0,t.useEffect)((function(){return null===s.current.parentNode&&null!==a.current&&a.current.appendChild(s.current),function(){var e,t;null===(e=s.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(s.current)}}),[]),s.current?l().createPortal(i,s.current):null})),rn=n(184),on=n.n(rn);function an(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function sn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ln(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sn(e,t);var n=Object.prototype.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)?sn(e,t):void 0}}(e,t)||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 cn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var un,dn,fn,pn=(un=tn(),dn="undefined"!=typeof window?window:{},fn={animationend:cn("Animation","AnimationEnd"),transitionend:cn("Transition","TransitionEnd")},un&&("AnimationEvent"in dn||delete fn.animationend.animation,"TransitionEvent"in dn||delete fn.transitionend.transition),fn),mn={};if(tn()){var hn=document.createElement("div");mn=hn.style}var vn={};function gn(e){if(vn[e])return vn[e];var t=pn[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o<r;o+=1){var i=n[o];if(Object.prototype.hasOwnProperty.call(t,i)&&i in mn)return vn[e]=t[i],vn[e]}return""}var yn=gn("animationend"),bn=gn("transitionend"),wn=!(!yn||!bn),Cn=yn||"animationend",En=bn||"transitionend";function xn(e,t){return e?"object"===St(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var On="none",kn="appear",Sn="enter",Nn="leave",Tn="none",Dn="prepare",In="start",Pn="active",Mn="end";function Rn(e){var n=t.useRef(!1),r=ln(t.useState(e),2),o=r[0],i=r[1];return t.useEffect((function(){return n.current=!1,function(){n.current=!0}}),[]),[o,function(e,t){t&&n.current||i(e)}]}var An=tn()?t.useLayoutEffect:t.useEffect,Ln=[Dn,In,Pn,Mn];function jn(e){return e===Pn||e===Mn}function Fn(e,n,r,o){var i=o.motionEnter,a=void 0===i||i,s=o.motionAppear,l=void 0===s||s,c=o.motionLeave,u=void 0===c||c,d=o.motionDeadline,f=o.motionLeaveImmediately,p=o.onAppearPrepare,m=o.onEnterPrepare,h=o.onLeavePrepare,v=o.onAppearStart,g=o.onEnterStart,y=o.onLeaveStart,b=o.onAppearActive,w=o.onEnterActive,C=o.onLeaveActive,E=o.onAppearEnd,x=o.onEnterEnd,O=o.onLeaveEnd,k=o.onVisibleChanged,_=ln(Rn(),2),S=_[0],N=_[1],T=ln(Rn(On),2),D=T[0],I=T[1],P=ln(Rn(null),2),M=P[0],R=P[1],A=(0,t.useRef)(!1),L=(0,t.useRef)(null);function j(){return r()}var F=(0,t.useRef)(!1);function B(e){var t=j();if(!e||e.deadline||e.target===t){var n,r=F.current;D===kn&&r?n=null==E?void 0:E(t,e):D===Sn&&r?n=null==x?void 0:x(t,e):D===Nn&&r&&(n=null==O?void 0:O(t,e)),D!==On&&r&&!1!==n&&(I(On,!0),R(null,!0))}}var H=function(e){var n=(0,t.useRef)(),r=(0,t.useRef)(e);r.current=e;var o=t.useCallback((function(e){r.current(e)}),[]);function i(e){e&&(e.removeEventListener(En,o),e.removeEventListener(Cn,o))}return t.useEffect((function(){return function(){i(n.current)}}),[]),[function(e){n.current&&n.current!==e&&i(n.current),e&&e!==n.current&&(e.addEventListener(En,o),e.addEventListener(Cn,o),n.current=e)},i]}(B),V=ln(H,1)[0],W=t.useMemo((function(){var e,t,n;switch(D){case kn:return Nt(e={},Dn,p),Nt(e,In,v),Nt(e,Pn,b),e;case Sn:return Nt(t={},Dn,m),Nt(t,In,g),Nt(t,Pn,w),t;case Nn:return Nt(n={},Dn,h),Nt(n,In,y),Nt(n,Pn,C),n;default:return{}}}),[D]),U=ln(function(e,n){var r=ln(Rn(Tn),2),o=r[0],i=r[1],a=function(){var e=t.useRef(null);function n(){$t.cancel(e.current)}return t.useEffect((function(){return function(){n()}}),[]),[function t(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;n();var i=$t((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):t(r,o-1)}));e.current=i},n]}(),s=ln(a,2),l=s[0],c=s[1];return An((function(){if(o!==Tn&&o!==Mn){var e=Ln.indexOf(o),t=Ln[e+1],r=n(o);!1===r?i(t,!0):l((function(e){function n(){e.isCanceled()||i(t,!0)}!0===r?n():Promise.resolve(r).then(n)}))}}),[e,o]),t.useEffect((function(){return function(){c()}}),[]),[function(){i(Dn,!0)},o]}(D,(function(e){if(e===Dn){var t=W.prepare;return!!t&&t(j())}var n;return q in W&&R((null===(n=W[q])||void 0===n?void 0:n.call(W,j(),null))||null),q===Pn&&(V(j()),d>0&&(clearTimeout(L.current),L.current=setTimeout((function(){B({deadline:!0})}),d))),!0})),2),z=U[0],q=U[1],Y=jn(q);F.current=Y,An((function(){N(n);var t,r=A.current;A.current=!0,e&&(!r&&n&&l&&(t=kn),r&&n&&a&&(t=Sn),(r&&!n&&u||!r&&f&&!n&&u)&&(t=Nn),t&&(I(t),z()))}),[n]),(0,t.useEffect)((function(){(D===kn&&!l||D===Sn&&!a||D===Nn&&!u)&&I(On)}),[l,a,u]),(0,t.useEffect)((function(){return function(){A.current=!1,clearTimeout(L.current)}}),[]);var $=t.useRef(!1);(0,t.useEffect)((function(){S&&($.current=!0),void 0!==S&&D===On&&(($.current||S)&&(null==k||k(S)),$.current=!0)}),[S,D]);var X=M;return W.prepare&&q===In&&(X=Dt({transition:"none"},X)),[D,q,X,null!=S?S:n]}var Bn=function(e){jt(n,e);var t=Ht(n);function n(){return Pt(this,n),t.apply(this,arguments)}return Rt(n,[{key:"render",value:function(){return this.props.children}}]),n}(t.Component),Hn=Bn,Vn=function(e){var n=e;function r(e){return!(!e.motionName||!n)}"object"===St(e)&&(n=e.transitionSupport);var o=t.forwardRef((function(e,n){var o=e.visible,i=void 0===o||o,a=e.removeOnLeave,s=void 0===a||a,l=e.forceRender,c=e.children,u=e.motionName,d=e.leavedClassName,f=e.eventProps,p=r(e),m=(0,t.useRef)(),h=(0,t.useRef)(),v=ln(Fn(p,i,(function(){try{return m.current instanceof HTMLElement?m.current:Kt(h.current)}catch(e){return null}}),e),4),g=v[0],y=v[1],b=v[2],w=v[3],C=t.useRef(w);w&&(C.current=!0);var E,x=t.useCallback((function(e){m.current=e,Jt(n,e)}),[n]),O=Dt(Dt({},f),{},{visible:i});if(c)if(g!==On&&r(e)){var k,_;y===Dn?_="prepare":jn(y)?_="active":y===In&&(_="start"),E=c(Dt(Dt({},O),{},{className:on()(xn(u,g),(k={},Nt(k,xn(u,"".concat(g,"-").concat(_)),_),Nt(k,u,"string"==typeof u),k)),style:b}),x)}else E=w?c(Dt({},O),x):!s&&C.current?c(Dt(Dt({},O),{},{className:d}),x):l?c(Dt(Dt({},O),{},{style:{display:"none"}}),x):null;else E=null;return t.isValidElement(E)&&Qt(E)&&(E.ref||(E=t.cloneElement(E,{ref:x}))),t.createElement(Hn,{ref:h},E)}));return o.displayName="CSSMotion",o}(wn),Wn="add",Un="keep",zn="remove",qn="removed";function Yn(e){var t;return Dt(Dt({},t=e&&"object"===St(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function $n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(Yn)}function Xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=$n(e),a=$n(t);i.forEach((function(e){for(var t=!1,i=r;i<o;i+=1){var s=a[i];if(s.key===e.key){r<i&&(n=n.concat(a.slice(r,i).map((function(e){return Dt(Dt({},e),{},{status:Wn})}))),r=i),n.push(Dt(Dt({},s),{},{status:Un})),r+=1,t=!0;break}}t||n.push(Dt(Dt({},e),{},{status:zn}))})),r<o&&(n=n.concat(a.slice(r).map((function(e){return Dt(Dt({},e),{},{status:Wn})}))));var s={};n.forEach((function(e){var t=e.key;s[t]=(s[t]||0)+1}));var l=Object.keys(s).filter((function(e){return s[e]>1}));return l.forEach((function(e){n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==zn})),n.forEach((function(t){t.key===e&&(t.status=Un)}))})),n}var Kn=["component","children","onVisibleChanged","onAllRemoved"],Gn=["status"],Jn=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vn,r=function(e){jt(o,e);var r=Ht(o);function o(){var e;Pt(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r.call.apply(r,[this].concat(n))).state={keyEntities:[]},e.removeKey=function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:Dt(Dt({},e),{},{status:qn})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==qn})).length},e}return Rt(o,[{key:"render",value:function(){var e=this,r=this.state.keyEntities,o=this.props,i=o.component,s=o.children,l=o.onVisibleChanged,c=o.onAllRemoved,u=It(o,Kn),d=i||t.Fragment,f={};return Jn.forEach((function(e){f[e]=u[e],delete u[e]})),delete u.keys,t.createElement(d,u,r.map((function(r){var o=r.status,i=It(r,Gn),u=o===Wn||o===Un;return t.createElement(n,a({},f,{key:i.key,visible:u,eventProps:i,onVisibleChanged:function(t){null==l||l(t,{key:i.key}),t||0===e.removeKey(i.key)&&c&&c()}}),s)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,o=$n(n);return{keyEntities:Xn(r,o).filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==qn||e.status!==zn}))}}}]),o}(t.Component);r.defaultProps={component:"div"}}(wn);var Zn,Qn=Vn;function er(e){var t=e.prefixCls,n=e.motion,r=e.animation,o=e.transitionName;return n||(r?{motionName:"".concat(t,"-").concat(r)}:o?{motionName:o}:null)}function tr(e){var n=e.prefixCls,r=e.visible,o=e.zIndex,i=e.mask,s=e.maskMotion,l=e.maskAnimation,c=e.maskTransitionName;if(!i)return null;var u={};return(s||c||l)&&(u=Dt({motionAppear:!0},er({motion:s,prefixCls:n,transitionName:c,animation:l}))),t.createElement(Qn,a({},u,{visible:r,removeOnLeave:!0}),(function(e){var r=e.className;return t.createElement("div",{style:{zIndex:o},className:on()("".concat(n,"-mask"),r)})}))}function nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(n),!0).forEach((function(t){ir(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function or(e){return or="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},or(e)}function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ar={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function sr(){if(void 0!==Zn)return Zn;Zn="";var e=document.createElement("p").style;for(var t in ar)t+"Transform"in e&&(Zn=t);return Zn}function lr(){return sr()?"".concat(sr(),"TransitionProperty"):"transitionProperty"}function cr(){return sr()?"".concat(sr(),"Transform"):"transform"}function ur(e,t){var n=lr();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function dr(e,t){var n=cr();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var fr,pr=/matrix\((.*)\)/,mr=/matrix3d\((.*)\)/;function hr(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function vr(e,t,n){var r=n;if("object"!==or(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):fr(e,t);for(var o in t)t.hasOwnProperty(o)&&vr(e,o,t[o])}function gr(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[r])&&(n=o.body[r])}return n}function yr(e){return gr(e)}function br(e){return gr(e,!0)}function wr(e){var t=function(e){var t,n,r,o=e.ownerDocument,i=o.body,a=o&&o.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),r=Math.floor(t.top),{left:n-=a.clientLeft||i.clientLeft||0,top:r-=a.clientTop||i.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=yr(r),t.top+=br(r),t}function Cr(e){return null!=e&&e==e.window}function Er(e){return Cr(e)?e.document:9===e.nodeType?e:e.ownerDocument}var xr=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Or=/^(top|right|bottom|left)$/;function kr(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function _r(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function Sr(e,t,n){"static"===vr(e,"position")&&(e.style.position="relative");var r=-999,o=-999,i=kr("left",n),a=kr("top",n),s=_r(i),l=_r(a);"left"!==i&&(r=999),"top"!==a&&(o=999);var c,u="",d=wr(e);("left"in t||"top"in t)&&(u=(c=e).style.transitionProperty||c.style[lr()]||"",ur(e,"none")),"left"in t&&(e.style[s]="",e.style[i]="".concat(r,"px")),"top"in t&&(e.style[l]="",e.style[a]="".concat(o,"px")),hr(e);var f=wr(e),p={};for(var m in t)if(t.hasOwnProperty(m)){var h=kr(m,n),v="left"===m?r:o,g=d[m]-f[m];p[h]=h===m?v+g:v-g}vr(e,p),hr(e),("left"in t||"top"in t)&&ur(e,u);var y={};for(var b in t)if(t.hasOwnProperty(b)){var w=kr(b,n),C=t[b]-d[b];y[w]=b===w?p[w]+C:p[w]-C}vr(e,y)}function Nr(e,t){for(var n=0;n<e.length;n++)t(e[n])}function Tr(e){return"border-box"===fr(e,"boxSizing")}"undefined"!=typeof window&&(fr=window.getComputedStyle?function(e,t,n){var r=n,o="",i=Er(e);return(r=r||i.defaultView.getComputedStyle(e,null))&&(o=r.getPropertyValue(t)||r[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(xr.test(n)&&!Or.test(t)){var r=e.style,o=r.left,i=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,r.left="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r.left=o,e.runtimeStyle.left=i}return""===n?"auto":n});var Dr=["margin","border","padding"];function Ir(e,t,n){var r,o={},i=e.style;for(r in t)t.hasOwnProperty(r)&&(o[r]=i[r],i[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(i[r]=o[r])}function Pr(e,t,n){var r,o,i,a=0;for(o=0;o<t.length;o++)if(r=t[o])for(i=0;i<n.length;i++){var s;s="border"===r?"".concat(r).concat(n[i],"Width"):r+n[i],a+=parseFloat(fr(e,s))||0}return a}var Mr={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function Rr(e,t,n){var r=n;if(Cr(e))return"width"===t?Mr.viewportWidth(e):Mr.viewportHeight(e);if(9===e.nodeType)return"width"===t?Mr.docWidth(e):Mr.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],i="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),a=Tr(e),s=0;(null==i||i<=0)&&(i=void 0,(null==(s=fr(e,t))||Number(s)<0)&&(s=e.style[t]||0),s=Math.floor(parseFloat(s))||0),void 0===r&&(r=a?1:-1);var l=void 0!==i||a,c=i||s;return-1===r?l?c-Pr(e,["border","padding"],o):s:l?1===r?c:c+(2===r?-Pr(e,["border"],o):Pr(e,["margin"],o)):s+Pr(e,Dr.slice(r),o)}Nr(["Width","Height"],(function(e){Mr["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],Mr["viewport".concat(e)](n))},Mr["viewport".concat(e)]=function(t){var n="client".concat(e),r=t.document,o=r.body,i=r.documentElement[n];return"CSS1Compat"===r.compatMode&&i||o&&o[n]||i}}));var Ar={position:"absolute",visibility:"hidden",display:"block"};function Lr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=t[0];return 0!==o.offsetWidth?r=Rr.apply(void 0,t):Ir(o,Ar,(function(){r=Rr.apply(void 0,t)})),r}function jr(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Nr(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Mr["outer".concat(t)]=function(t,n){return t&&Lr(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];Mr[e]=function(t,r){var o=r;return void 0!==o?t?(Tr(t)&&(o+=Pr(t,["padding","border"],n)),vr(t,e,o)):void 0:t&&Lr(t,e,-1)}}));var Fr={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Er,offset:function(e,t,n){if(void 0===t)return wr(e);!function(e,t,n){if(n.ignoreShake){var r=wr(e),o=r.left.toFixed(0),i=r.top.toFixed(0),a=t.left.toFixed(0),s=t.top.toFixed(0);if(o===a&&i===s)return}n.useCssRight||n.useCssBottom?Sr(e,t,n):n.useCssTransform&&cr()in document.body.style?function(e,t){var n=wr(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(cr());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}(e),o={x:r.x,y:r.y};"left"in t&&(o.x=r.x+t.left-n.left),"top"in t&&(o.y=r.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),r=n.getPropertyValue("transform")||n.getPropertyValue(cr());if(r&&"none"!==r){var o,i=r.match(pr);i?((o=(i=i[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,o[5]=t.y,dr(e,"matrix(".concat(o.join(","),")"))):((o=r.match(mr)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,o[13]=t.y,dr(e,"matrix3d(".concat(o.join(","),")")))}else dr(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,o)}(e,t):Sr(e,t,n)}(e,t,n||{})},isWindow:Cr,each:Nr,css:vr,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:jr,getWindowScrollLeft:function(e){return yr(e)},getWindowScrollTop:function(e){return br(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)Fr.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};jr(Fr,Mr);var Br=Fr.getParent;function Hr(e){if(Fr.isWindow(e)||9===e.nodeType)return null;var t,n=Fr.getDocument(e).body,r=Fr.css(e,"position");if("fixed"!==r&&"absolute"!==r)return"html"===e.nodeName.toLowerCase()?null:Br(e);for(t=Br(e);t&&t!==n&&9!==t.nodeType;t=Br(t))if("static"!==(r=Fr.css(t,"position")))return t;return null}var Vr=Fr.getParent;function Wr(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=Hr(e),o=Fr.getDocument(e),i=o.defaultView||o.parentWindow,a=o.body,s=o.documentElement;r;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===r.clientWidth||r===a||r===s||"visible"===Fr.css(r,"overflow")){if(r===a||r===s)break}else{var l=Fr.offset(r);l.left+=r.clientLeft,l.top+=r.clientTop,n.top=Math.max(n.top,l.top),n.right=Math.min(n.right,l.left+r.clientWidth),n.bottom=Math.min(n.bottom,l.top+r.clientHeight),n.left=Math.max(n.left,l.left)}r=Hr(r)}var c=null;Fr.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===Fr.css(e,"position")&&(e.style.position="fixed"));var u=Fr.getWindowScrollLeft(i),d=Fr.getWindowScrollTop(i),f=Fr.viewportWidth(i),p=Fr.viewportHeight(i),m=s.scrollWidth,h=s.scrollHeight,v=window.getComputedStyle(a);if("hidden"===v.overflowX&&(m=i.innerWidth),"hidden"===v.overflowY&&(h=i.innerHeight),e.style&&(e.style.position=c),t||function(e){if(Fr.isWindow(e)||9===e.nodeType)return!1;var t=Fr.getDocument(e),n=t.body,r=null;for(r=Vr(e);r&&r!==n&&r!==t;r=Vr(r))if("fixed"===Fr.css(r,"position"))return!0;return!1}(e))n.left=Math.max(n.left,u),n.top=Math.max(n.top,d),n.right=Math.min(n.right,u+f),n.bottom=Math.min(n.bottom,d+p);else{var g=Math.max(m,u+f);n.right=Math.min(n.right,g);var y=Math.max(h,d+p);n.bottom=Math.min(n.bottom,y)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Ur(e){var t,n,r;if(Fr.isWindow(e)||9===e.nodeType){var o=Fr.getWindow(e);t={left:Fr.getWindowScrollLeft(o),top:Fr.getWindowScrollTop(o)},n=Fr.viewportWidth(o),r=Fr.viewportHeight(o)}else t=Fr.offset(e),n=Fr.outerWidth(e),r=Fr.outerHeight(e);return t.width=n,t.height=r,t}function zr(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,i=e.height,a=e.left,s=e.top;return"c"===n?s+=i/2:"b"===n&&(s+=i),"c"===r?a+=o/2:"r"===r&&(a+=o),{left:a,top:s}}function qr(e,t,n,r,o){var i=zr(t,n[1]),a=zr(e,n[0]),s=[a.left-i.left,a.top-i.top];return{left:Math.round(e.left-s[0]+r[0]-o[0]),top:Math.round(e.top-s[1]+r[1]-o[1])}}function Yr(e,t,n){return e.left<n.left||e.left+t.width>n.right}function $r(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function Xr(e,t,n){var r=[];return Fr.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Kr(e,t){return e[t]=-e[t],e}function Gr(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Jr(e,t){e[0]=Gr(e[0],t.width),e[1]=Gr(e[1],t.height)}function Zr(e,t,n,r){var o=n.points,i=n.offset||[0,0],a=n.targetOffset||[0,0],s=n.overflow,l=n.source||e;i=[].concat(i),a=[].concat(a);var c={},u=0,d=Wr(l,!(!(s=s||{})||!s.alwaysByViewport)),f=Ur(l);Jr(i,f),Jr(a,t);var p=qr(f,t,o,i,a),m=Fr.merge(f,p);if(d&&(s.adjustX||s.adjustY)&&r){if(s.adjustX&&Yr(p,f,d)){var h=Xr(o,/[lr]/gi,{l:"r",r:"l"}),v=Kr(i,0),g=Kr(a,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(qr(f,t,h,v,g),f,d)||(u=1,o=h,i=v,a=g)}if(s.adjustY&&$r(p,f,d)){var y=Xr(o,/[tb]/gi,{t:"b",b:"t"}),b=Kr(i,1),w=Kr(a,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(qr(f,t,y,b,w),f,d)||(u=1,o=y,i=b,a=w)}u&&(p=qr(f,t,o,i,a),Fr.mix(m,p));var C=Yr(p,f,d),E=$r(p,f,d);if(C||E){var x=o;C&&(x=Xr(o,/[lr]/gi,{l:"r",r:"l"})),E&&(x=Xr(o,/[tb]/gi,{t:"b",b:"t"})),o=x,i=n.offset||[0,0],a=n.targetOffset||[0,0]}c.adjustX=s.adjustX&&C,c.adjustY=s.adjustY&&E,(c.adjustX||c.adjustY)&&(m=function(e,t,n,r){var o=Fr.clone(e),i={width:t.width,height:t.height};return r.adjustX&&o.left<n.left&&(o.left=n.left),r.resizeWidth&&o.left>=n.left&&o.left+i.width>n.right&&(i.width-=o.left+i.width-n.right),r.adjustX&&o.left+i.width>n.right&&(o.left=Math.max(n.right-i.width,n.left)),r.adjustY&&o.top<n.top&&(o.top=n.top),r.resizeHeight&&o.top>=n.top&&o.top+i.height>n.bottom&&(i.height-=o.top+i.height-n.bottom),r.adjustY&&o.top+i.height>n.bottom&&(o.top=Math.max(n.bottom-i.height,n.top)),Fr.mix(o,i)}(p,f,d,c))}return m.width!==f.width&&Fr.css(l,"width",Fr.width(l)+m.width-f.width),m.height!==f.height&&Fr.css(l,"height",Fr.height(l)+m.height-f.height),Fr.offset(l,{left:m.left,top:m.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:i,targetOffset:a,overflow:c}}function Qr(e,t,n){var r=n.target||t,o=Ur(r),i=!function(e,t){var n=Wr(e,t),r=Ur(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return Zr(e,o,n,i)}Qr.__getOffsetParent=Hr,Qr.__getVisibleRectForElement=Wr;var eo={};function to(e,t){}var no=function(e,t){!function(e,t,n){t||eo[n]||(e(!1,n),eo[n]=!0)}(to,e,t)},ro=tn()?t.useLayoutEffect:t.useEffect,oo=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}()}(),io="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,ao=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),so="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(ao):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},lo=["top","right","bottom","left","width","height","size","weight"],co="undefined"!=typeof MutationObserver,uo=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){so(i)}function s(){var e=Date.now();if(n){if(e-o<2)return;r=!0}else n=!0,r=!1,setTimeout(a,20);o=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){io&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),co?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){io&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=lo.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),fo=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},po=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||ao},mo=bo(0,0,0,0);function ho(e){return parseFloat(e)||0}function vo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+ho(e["border-"+n+"-width"])}),0)}var go="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof po(e).SVGGraphicsElement}:function(e){return e instanceof po(e).SVGElement&&"function"==typeof e.getBBox};function yo(e){return io?go(e)?function(e){var t=e.getBBox();return bo(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return mo;var r=po(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=ho(i)}return t}(r),i=o.left+o.right,a=o.top+o.bottom,s=ho(r.width),l=ho(r.height);if("border-box"===r.boxSizing&&(Math.round(s+i)!==t&&(s-=vo(r,"left","right")+i),Math.round(l+a)!==n&&(l-=vo(r,"top","bottom")+a)),!function(e){return e===po(e).document.documentElement}(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return bo(o.left,o.top,s,l)}(e):mo}function bo(e,t,n,r){return{x:e,y:t,width:n,height:r}}var wo=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=bo(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=yo(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),Co=function(e,t){var n,r,o,i,a,s,l,c=(r=(n=t).x,o=n.y,i=n.width,a=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),fo(l,{x:r,y:o,width:i,height:a,top:o,right:r+i,bottom:a+o,left:r}),l);fo(this,{target:e,contentRect:c})},Eo=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new oo,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof po(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new wo(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof po(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new Co(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),xo="undefined"!=typeof WeakMap?new WeakMap:new oo,Oo=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=uo.getInstance(),r=new Eo(t,n,this);xo.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Oo.prototype[e]=function(){var t;return(t=xo.get(this))[e].apply(t,arguments)}}));var ko=void 0!==ao.ResizeObserver?ao.ResizeObserver:Oo;function _o(e,t){var n=null,r=null,o=new ko((function(e){var o=ln(e,1)[0].target;if(document.documentElement.contains(o)){var i=o.getBoundingClientRect(),a=i.width,s=i.height,l=Math.floor(a),c=Math.floor(s);n===l&&r===c||Promise.resolve().then((function(){t({width:l,height:c})})),n=l,r=c}}));return e&&o.observe(e),function(){o.disconnect()}}function So(e){return"function"!=typeof e?null:e()}function No(e){return"object"===St(e)&&e?e:null}var To=function(e,t){var n=e.children,o=e.disabled,i=e.target,a=e.align,s=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,u=void 0===c?0:c,d=r().useRef({}),f=r().useRef(),p=r().Children.only(n),m=r().useRef({});m.current.disabled=o,m.current.target=i,m.current.align=a,m.current.onAlign=s;var h=function(e,t){var n=r().useRef(!1),o=r().useRef(null);function i(){window.clearTimeout(o.current)}return[function e(r){if(i(),n.current&&!0!==r)o.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=m.current,t=e.disabled,n=e.target,r=e.align,o=e.onAlign,i=f.current;if(!t&&n&&i){var a,s=So(n),l=No(n);d.current.element=s,d.current.point=l,d.current.align=r;var c=document.activeElement;return s&&function(e){if(!e)return!1;if(e instanceof HTMLElement&&e.offsetParent)return!0;if(e instanceof SVGGraphicsElement&&e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e instanceof HTMLElement&&e.getBoundingClientRect){var o=e.getBoundingClientRect(),i=o.width,a=o.height;if(i||a)return!0}return!1}(s)?a=Qr(i,s,r):l&&(a=function(e,t,n){var r,o,i=Fr.getDocument(e),a=i.defaultView||i.parentWindow,s=Fr.getWindowScrollLeft(a),l=Fr.getWindowScrollTop(a),c=Fr.viewportWidth(a),u=Fr.viewportHeight(a),d={left:r="pageX"in t?t.pageX:s+t.clientX,top:o="pageY"in t?t.pageY:l+t.clientY,width:0,height:0},f=r>=0&&r<=s+c&&o>=0&&o<=l+u,p=[n.points[0],"cc"];return Zr(e,d,rr(rr({},n),{},{points:p}),f)}(i,l,r)),function(e,t){e!==document.activeElement&&Xt(t,e)&&"function"==typeof e.focus&&e.focus()}(c,i),o&&a&&o(i,a),!0}return!1}())return;n.current=!0,o.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,i()}]}(0,u),v=ln(h,2),g=v[0],y=v[1],b=ln(r().useState(),2),w=b[0],C=b[1],E=ln(r().useState(),2),x=E[0],O=E[1];return ro((function(){C(So(i)),O(No(i))})),r().useEffect((function(){var e,t;d.current.element===w&&((e=d.current.point)===(t=x)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;function o(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=r.has(e);if(no(!a,"Warning: There may be circular references"),a)return!1;if(e===t)return!0;if(n&&i>1)return!1;r.add(e);var s=i+1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var l=0;l<e.length;l++)if(!o(e[l],t[l],s))return!1;return!0}if(e&&t&&"object"===St(e)&&"object"===St(t)){var c=Object.keys(e);return c.length===Object.keys(t).length&&c.every((function(n){return o(e[n],t[n],s)}))}return!1}return o(e,t)}(d.current.align,a)||g()})),r().useEffect((function(){return _o(f.current,g)}),[f.current]),r().useEffect((function(){return _o(w,g)}),[w]),r().useEffect((function(){o?y():g()}),[o]),r().useEffect((function(){if(l)return en(window,"resize",g).remove}),[l]),r().useEffect((function(){return function(){y()}}),[]),r().useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),r().isValidElement(p)&&(p=r().cloneElement(p,{ref:Zt(p.ref,f)})),p},Do=r().forwardRef(To);Do.displayName="Align";var Io=Do;function Po(){Po=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new x(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function f(){}function p(){}var m={};s(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(O([])));v&&v!==t&&n.call(v,o)&&(m=v);var g=p.prototype=d.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(o,i,a,s){var l=c(e[o],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==St(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=p,s(g,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),s(g,a,"Generator"),s(g,o,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Mo(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Ro(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Mo(i,r,o,a,s,"next",e)}function s(e){Mo(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Ao=["measure","alignPre","align",null,"motion"],Lo=t.forwardRef((function(e,n){var r=e.visible,o=e.prefixCls,i=e.className,s=e.style,l=e.children,c=e.zIndex,u=e.stretch,d=e.destroyPopupOnHide,f=e.forceRender,p=e.align,m=e.point,h=e.getRootDomNode,v=e.getClassNameFromAlign,g=e.onAlign,y=e.onMouseEnter,b=e.onMouseLeave,w=e.onMouseDown,C=e.onTouchStart,E=e.onClick,x=(0,t.useRef)(),O=(0,t.useRef)(),k=ln((0,t.useState)(),2),_=k[0],S=k[1],N=function(e){var n=ln(t.useState({width:0,height:0}),2),r=n[0],o=n[1];return[t.useMemo((function(){var t={};if(e){var n=r.width,o=r.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,r]),function(e){var t=e.offsetWidth,n=e.offsetHeight,r=e.getBoundingClientRect(),i=r.width,a=r.height;Math.abs(t-i)<1&&Math.abs(n-a)<1&&(t=i,n=a),o({width:t,height:n})}]}(u),T=ln(N,2),D=T[0],I=T[1],P=function(e,n){var r=ln(Rn(null),2),o=r[0],i=r[1],a=(0,t.useRef)();function s(e){i(e,!0)}function l(){$t.cancel(a.current)}return(0,t.useEffect)((function(){s("measure")}),[e]),(0,t.useEffect)((function(){"measure"===o&&(u&&I(h())),o&&(a.current=$t(Ro(Po().mark((function e(){var t,n;return Po().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Ao.indexOf(o),(n=Ao[t+1])&&-1!==t&&s(n);case 3:case"end":return e.stop()}}),e)})))))}),[o]),(0,t.useEffect)((function(){return function(){l()}}),[]),[o,function(e){l(),a.current=$t((function(){s((function(e){switch(o){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r),M=ln(P,2),R=M[0],A=M[1],L=ln((0,t.useState)(0),2),j=L[0],F=L[1],B=(0,t.useRef)();function H(){var e;null===(e=x.current)||void 0===e||e.forceAlign()}function V(e,t){var n=v(t);_!==n&&S(n),F((function(e){return e+1})),"align"===R&&(null==g||g(e,t))}ro((function(){"alignPre"===R&&F(0)}),[R]),ro((function(){"align"===R&&(j<3?H():A((function(){var e;null===(e=B.current)||void 0===e||e.call(B)})))}),[j]);var W=Dt({},er(e));function U(){return new Promise((function(e){B.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=W[e];W[e]=function(e,n){return A(),null==t?void 0:t(e,n)}})),t.useEffect((function(){W.motionName||"motion"!==R||A()}),[W.motionName,R]),t.useImperativeHandle(n,(function(){return{forceAlign:H,getElement:function(){return O.current}}}));var z=Dt(Dt({},D),{},{zIndex:c,opacity:"motion"!==R&&"stable"!==R&&r?0:void 0,pointerEvents:r||"stable"===R?void 0:"none"},s),q=!0;null==p||!p.points||"align"!==R&&"stable"!==R||(q=!1);var Y=l;return t.Children.count(l)>1&&(Y=t.createElement("div",{className:"".concat(o,"-content")},l)),t.createElement(Qn,a({visible:r,ref:O,leavedClassName:"".concat(o,"-hidden")},W,{onAppearPrepare:U,onEnterPrepare:U,removeOnLeave:d,forceRender:f}),(function(e,n){var r=e.className,a=e.style,s=on()(o,i,_,r);return t.createElement(Io,{target:m||h,key:"popup",ref:x,monitorWindowResize:!0,disabled:q,align:p,onAlign:V},t.createElement("div",{ref:n,className:s,onMouseEnter:y,onMouseLeave:b,onMouseDownCapture:w,onTouchStartCapture:C,onClick:E,style:Dt(Dt({},a),z)},Y))}))}));Lo.displayName="PopupInner";var jo=Lo,Fo=t.forwardRef((function(e,n){var r=e.prefixCls,o=e.visible,i=e.zIndex,s=e.children,l=e.mobile,c=(l=void 0===l?{}:l).popupClassName,u=l.popupStyle,d=l.popupMotion,f=void 0===d?{}:d,p=l.popupRender,m=e.onClick,h=t.useRef();t.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return h.current}}}));var v=Dt({zIndex:i},u),g=s;return t.Children.count(s)>1&&(g=t.createElement("div",{className:"".concat(r,"-content")},s)),p&&(g=p(g)),t.createElement(Qn,a({visible:o,ref:h,removeOnLeave:!0},f),(function(e,n){var o=e.className,i=e.style,a=on()(r,c,o);return t.createElement("div",{ref:n,className:a,onClick:m,style:Dt(Dt({},i),v)},g)}))}));Fo.displayName="MobilePopupInner";var Bo=Fo,Ho=["visible","mobile"],Vo=t.forwardRef((function(e,n){var r=e.visible,o=e.mobile,i=It(e,Ho),s=ln((0,t.useState)(r),2),l=s[0],c=s[1],u=ln((0,t.useState)(!1),2),d=u[0],f=u[1],p=Dt(Dt({},i),{},{visible:l});(0,t.useEffect)((function(){c(r),r&&o&&f(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[r,o]);var m=d?t.createElement(Bo,a({},p,{mobile:o,ref:n})):t.createElement(jo,a({},p,{ref:n}));return t.createElement("div",null,t.createElement(tr,p),m)}));Vo.displayName="Popup";var Wo=Vo,Uo=t.createContext(null);function zo(){}var qo,Yo,$o=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],Xo=(qo=nn,Yo=function(e){jt(r,e);var n=Ht(r);function r(e){var o,i;return Pt(this,r),Nt(At(o=n.call(this,e)),"popupRef",t.createRef()),Nt(At(o),"triggerRef",t.createRef()),Nt(At(o),"portalContainer",void 0),Nt(At(o),"attachId",void 0),Nt(At(o),"clickOutsideHandler",void 0),Nt(At(o),"touchOutsideHandler",void 0),Nt(At(o),"contextMenuOutsideHandler1",void 0),Nt(At(o),"contextMenuOutsideHandler2",void 0),Nt(At(o),"mouseDownTimeout",void 0),Nt(At(o),"focusTime",void 0),Nt(At(o),"preClickTime",void 0),Nt(At(o),"preTouchTime",void 0),Nt(At(o),"delayTimer",void 0),Nt(At(o),"hasPopupMouseDown",void 0),Nt(At(o),"onMouseEnter",(function(e){var t=o.props.mouseEnterDelay;o.fireEvents("onMouseEnter",e),o.delaySetPopupVisible(!0,t,t?null:e)})),Nt(At(o),"onMouseMove",(function(e){o.fireEvents("onMouseMove",e),o.setPoint(e)})),Nt(At(o),"onMouseLeave",(function(e){o.fireEvents("onMouseLeave",e),o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)})),Nt(At(o),"onPopupMouseEnter",(function(){o.clearDelayTimer()})),Nt(At(o),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&Xt(null===(t=o.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)})),Nt(At(o),"onFocus",(function(e){o.fireEvents("onFocus",e),o.clearDelayTimer(),o.isFocusToShow()&&(o.focusTime=Date.now(),o.delaySetPopupVisible(!0,o.props.focusDelay))})),Nt(At(o),"onMouseDown",(function(e){o.fireEvents("onMouseDown",e),o.preClickTime=Date.now()})),Nt(At(o),"onTouchStart",(function(e){o.fireEvents("onTouchStart",e),o.preTouchTime=Date.now()})),Nt(At(o),"onBlur",(function(e){o.fireEvents("onBlur",e),o.clearDelayTimer(),o.isBlurToHide()&&o.delaySetPopupVisible(!1,o.props.blurDelay)})),Nt(At(o),"onContextMenu",(function(e){e.preventDefault(),o.fireEvents("onContextMenu",e),o.setPopupVisible(!0,e)})),Nt(At(o),"onContextMenuClose",(function(){o.isContextMenuToShow()&&o.close()})),Nt(At(o),"onClick",(function(e){if(o.fireEvents("onClick",e),o.focusTime){var t;if(o.preClickTime&&o.preTouchTime?t=Math.min(o.preClickTime,o.preTouchTime):o.preClickTime?t=o.preClickTime:o.preTouchTime&&(t=o.preTouchTime),Math.abs(t-o.focusTime)<20)return;o.focusTime=0}o.preClickTime=0,o.preTouchTime=0,o.isClickToShow()&&(o.isClickToHide()||o.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!o.state.popupVisible;(o.isClickToHide()&&!n||n&&o.isClickToShow())&&o.setPopupVisible(!o.state.popupVisible,e)})),Nt(At(o),"onPopupMouseDown",(function(){var e;o.hasPopupMouseDown=!0,clearTimeout(o.mouseDownTimeout),o.mouseDownTimeout=window.setTimeout((function(){o.hasPopupMouseDown=!1}),0),o.context&&(e=o.context).onPopupMouseDown.apply(e,arguments)})),Nt(At(o),"onDocumentClick",(function(e){if(!o.props.mask||o.props.maskClosable){var t=e.target,n=o.getRootDomNode(),r=o.getPopupDomNode();Xt(n,t)&&!o.isContextMenuOnly()||Xt(r,t)||o.hasPopupMouseDown||o.close()}})),Nt(At(o),"getRootDomNode",(function(){var e=o.props.getTriggerDOMNode;if(e)return e(o.triggerRef.current);try{var t=Kt(o.triggerRef.current);if(t)return t}catch(e){}return l().findDOMNode(At(o))})),Nt(At(o),"getPopupClassNameFromAlign",(function(e){var t=[],n=o.props,r=n.popupPlacement,i=n.builtinPlacements,a=n.prefixCls,s=n.alignPoint,l=n.getPopupClassNameFromAlign;return r&&i&&t.push(function(e,t,n,r){for(var o=n.points,i=Object.keys(e),a=0;a<i.length;a+=1){var s=i[a];if(an(e[s].points,o,r))return"".concat(t,"-placement-").concat(s)}return""}(i,a,e,s)),l&&t.push(l(e)),t.join(" ")})),Nt(At(o),"getComponent",(function(){var e=o.props,n=e.prefixCls,r=e.destroyPopupOnHide,i=e.popupClassName,s=e.onPopupAlign,l=e.popupMotion,c=e.popupAnimation,u=e.popupTransitionName,d=e.popupStyle,f=e.mask,p=e.maskAnimation,m=e.maskTransitionName,h=e.maskMotion,v=e.zIndex,g=e.popup,y=e.stretch,b=e.alignPoint,w=e.mobile,C=e.forceRender,E=e.onPopupClick,x=o.state,O=x.popupVisible,k=x.point,_=o.getPopupAlign(),S={};return o.isMouseEnterToShow()&&(S.onMouseEnter=o.onPopupMouseEnter),o.isMouseLeaveToHide()&&(S.onMouseLeave=o.onPopupMouseLeave),S.onMouseDown=o.onPopupMouseDown,S.onTouchStart=o.onPopupMouseDown,t.createElement(Wo,a({prefixCls:n,destroyPopupOnHide:r,visible:O,point:b&&k,className:i,align:_,onAlign:s,animation:c,getClassNameFromAlign:o.getPopupClassNameFromAlign},S,{stretch:y,getRootDomNode:o.getRootDomNode,style:d,mask:f,zIndex:v,transitionName:u,maskAnimation:p,maskTransitionName:m,maskMotion:h,ref:o.popupRef,motion:l,mobile:w,forceRender:C,onClick:E}),"function"==typeof g?g():g)})),Nt(At(o),"attachParent",(function(e){$t.cancel(o.attachId);var t,n=o.props,r=n.getPopupContainer,i=n.getDocument,a=o.getRootDomNode();r?(a||0===r.length)&&(t=r(a)):t=i(o.getRootDomNode()).body,t?t.appendChild(e):o.attachId=$t((function(){o.attachParent(e)}))})),Nt(At(o),"getContainer",(function(){if(!o.portalContainer){var e=(0,o.props.getDocument)(o.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",o.portalContainer=e}return o.attachParent(o.portalContainer),o.portalContainer})),Nt(At(o),"setPoint",(function(e){o.props.alignPoint&&e&&o.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Nt(At(o),"handlePortalUpdate",(function(){o.state.prevPopupVisible!==o.state.popupVisible&&o.props.afterPopupVisibleChange(o.state.popupVisible)})),Nt(At(o),"triggerContextValue",{onPopupMouseDown:o.onPopupMouseDown}),i="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,o.state={prevPopupVisible:i,popupVisible:i},$o.forEach((function(e){o["fire".concat(e)]=function(t){o.fireEvents(e,t)}})),o}return Rt(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=en(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=en(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=en(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=en(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),$t.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,r=e.builtinPlacements;return t&&r?function(e,t,n){return Dt(Dt({},e[t]||{}),n)}(r,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,r=this.state.popupVisible;this.clearDelayTimer(),r!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:r}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var r=this,o=1e3*t;if(this.clearDelayTimer(),o){var i=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){r.setPopupVisible(e,i),r.clearDelayTimer()}),o)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var r=this.props[e];r&&r(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var e=this.state.popupVisible,n=this.props,r=n.children,o=n.forceRender,i=n.alignPoint,a=n.className,s=n.autoDestroy,l=t.Children.only(r),c={key:"trigger"};this.isContextMenuToShow()?c.onContextMenu=this.onContextMenu:c.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(c.onClick=this.onClick,c.onMouseDown=this.onMouseDown,c.onTouchStart=this.onTouchStart):(c.onClick=this.createTwoChains("onClick"),c.onMouseDown=this.createTwoChains("onMouseDown"),c.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(c.onMouseEnter=this.onMouseEnter,i&&(c.onMouseMove=this.onMouseMove)):c.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?c.onMouseLeave=this.onMouseLeave:c.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(c.onFocus=this.onFocus,c.onBlur=this.onBlur):(c.onFocus=this.createTwoChains("onFocus"),c.onBlur=this.createTwoChains("onBlur"));var u=on()(l&&l.props&&l.props.className,a);u&&(c.className=u);var d=Dt({},c);Qt(l)&&(d.ref=Zt(this.triggerRef,l.ref));var f,p=t.cloneElement(l,d);return(e||this.popupRef.current||o)&&(f=t.createElement(qo,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!e&&s&&(f=null),t.createElement(Uo.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,r={};return void 0!==n&&t.popupVisible!==n&&(r.popupVisible=n,r.prevPopupVisible=t.popupVisible),r}}]),r}(t.Component),Nt(Yo,"contextType",Uo),Nt(Yo,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:function(){return""},getDocument:function(e){return e?e.ownerDocument:window.document},onPopupVisibleChange:zo,afterPopupVisibleChange:zo,onPopupAlign:zo,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),Yo),Ko={adjustX:1,adjustY:1},Go=[0,0],Jo={left:{points:["cr","cl"],overflow:Ko,offset:[-4,0],targetOffset:Go},right:{points:["cl","cr"],overflow:Ko,offset:[4,0],targetOffset:Go},top:{points:["bc","tc"],overflow:Ko,offset:[0,-4],targetOffset:Go},bottom:{points:["tc","bc"],overflow:Ko,offset:[0,4],targetOffset:Go},topLeft:{points:["bl","tl"],overflow:Ko,offset:[0,-4],targetOffset:Go},leftTop:{points:["tr","tl"],overflow:Ko,offset:[-4,0],targetOffset:Go},topRight:{points:["br","tr"],overflow:Ko,offset:[0,-4],targetOffset:Go},rightTop:{points:["tl","tr"],overflow:Ko,offset:[4,0],targetOffset:Go},bottomRight:{points:["tr","br"],overflow:Ko,offset:[0,4],targetOffset:Go},rightBottom:{points:["bl","br"],overflow:Ko,offset:[4,0],targetOffset:Go},bottomLeft:{points:["tl","bl"],overflow:Ko,offset:[0,4],targetOffset:Go},leftBottom:{points:["br","bl"],overflow:Ko,offset:[-4,0],targetOffset:Go}};function Zo(e){var n=e.showArrow,r=e.arrowContent,o=e.children,i=e.prefixCls,a=e.id,s=e.overlayInnerStyle,l=e.className,c=e.style;return t.createElement("div",{className:on()("".concat(i,"-content"),l),style:c},!1!==n&&t.createElement("div",{className:"".concat(i,"-arrow"),key:"arrow"},r),t.createElement("div",{className:"".concat(i,"-inner"),id:a,role:"tooltip",style:s},"function"==typeof o?o():o))}var Qo=function(e,n){var r=e.overlayClassName,o=e.trigger,i=void 0===o?["hover"]:o,s=e.mouseEnterDelay,l=void 0===s?0:s,c=e.mouseLeaveDelay,u=void 0===c?.1:c,d=e.overlayStyle,f=e.prefixCls,p=void 0===f?"rc-tooltip":f,m=e.children,h=e.onVisibleChange,v=e.afterVisibleChange,g=e.transitionName,y=e.animation,b=e.motion,w=e.placement,C=void 0===w?"right":w,E=e.align,x=void 0===E?{}:E,O=e.destroyTooltipOnHide,k=void 0!==O&&O,_=e.defaultVisible,S=e.getTooltipContainer,N=e.overlayInnerStyle,T=e.arrowContent,D=e.overlay,I=e.id,P=e.showArrow,M=It(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),R=(0,t.useRef)(null);(0,t.useImperativeHandle)(n,(function(){return R.current}));var A=Dt({},M);"visible"in e&&(A.popupVisible=e.visible);var L=!1,j=!1;if("boolean"==typeof k)L=k;else if(k&&"object"===St(k)){var F=k.keepParent;L=!0===F,j=!1===F}return t.createElement(Xo,a({popupClassName:r,prefixCls:p,popup:function(){return t.createElement(Zo,{showArrow:P,arrowContent:T,key:"content",prefixCls:p,id:I,overlayInnerStyle:N},D)},action:i,builtinPlacements:Jo,popupPlacement:C,ref:R,popupAlign:x,getPopupContainer:S,onPopupVisibleChange:h,afterPopupVisibleChange:v,popupTransitionName:g,popupAnimation:y,popupMotion:b,defaultPopupVisible:_,destroyPopupOnHide:L,autoDestroy:j,mouseLeaveDelay:u,popupStyle:d,mouseEnterDelay:l},A),m)},ei=(0,t.forwardRef)(Qo),ti=t=>{var n,r;const{item:o,index:i,parent:a}=t;return(0,e.createElement)("div",{className:"mmu-menu-item-details"},(0,e.createElement)("div",{className:"mmu-menu-item-summary"},(0,e.createElement)("div",{className:"mmu-menu-item-meta mmu-menu-item-title "+(o.markedForDelete?" mmu-menu-item-title--delete":"")},o.title),(0,e.createElement)("div",{className:"mmu-menu-item-meta mmu-menu-item-url"},(0,e.createElement)(ei,{placement:"right",mouseEnterDelay:0,mouseLeaveDelay:.1,trigger:null!==(n=window.MMU)&&void 0!==n&&n.can_use_premium_code?["click"]:["none"],overlay:(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"mmu-menu-item-tooltop-options"},(0,e.createElement)("div",null,(0,e.createElement)("a",{href:o.goto_link,target:"_blank"},"View")),o.edit_link&&(0,e.createElement)("div",null,(0,e.createElement)("a",{target:"_blank",href:o.edit_link},"Edit"))))},(0,e.createElement)("div",null,o.display_link)),null!==(r=window.MMU)&&void 0!==r&&r.debug?(0,e.createElement)("div",null,"INDEX: ",i," | ",o.ID,":",o.title," | parent id: ",a?a.ID:"null"," | parent expanded: ",a&&a.expanded?"true":"false"," | expanded: ",o.expanded?"true":"false"," | depth: ",o.depth):""),Array.isArray(o.object_fields)&&o.object_fields.map((t=>{if(void 0!==t.field_label&&""!=t.field_label&&void 0!==t.field_value&&null!=t.field_value&&""!=t.field_value&&"object"!=typeof t.field_value&&!Array.isArray(t.field_value))return(0,e.createElement)("div",{key:t.field_key,className:"mmu-menu-item-meta mmu-menu-item-"+t.field_key},(0,e.createElement)("span",{className:"mmu-menu-item-meta-label"},t.field_label,": "),(0,e.createElement)("span",{className:"mmu-menu-item-meta-value"},t.field_value))}))))};n(227);const ni="false",ri="app",oi=(ni.toLowerCase(),"/mm_ultra/v1");var ii=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]},ai=void 0;const si="utils",li=function(e,t){ii(si,"processing new items",t);let n=[...e];for(const e of t){let t=-1;if(e.parentItem=null,e.markedForDelete=!1,!e.list_initialized){e.list_initialized=!0;const r=parseInt(e.menu_item_parent)||0;if(r>0&&(t=n.findIndex((e=>e.ID==r)),t>-1&&(e.parentItem=n[t])),e.depth=0,e.childCount=0,n.push(e),null!=e.parentItem){let t;[t,n]=fi(n,e.parentItem)}}}return ii(si,"new items processed",n),n},ci=(e,t)=>{let n=[...e];const r=mi(e,t),o=pi(e,t);return n[o].childCount=r.length,0==n[o].childCount&&(n[o].has_fetchable_children=!1,n[o].expanded=!1),n},ui=(e,t,n)=>{let r=[...e];const o=pi(r,t),i=pi(r,n);if(i>-1){t.depth=n.depth+1,t.parentItem=n,t.menu_item_parent=n.ID;const e=mi(r,n);r[i].childCount=e.length,r[o]=t}return r},di=function(e,t){let n=[...e];const r=pi(n,t);if(r>-1){const e=n[r].parentItem;n[r].depth=0,n[r].menu_item_parent=0,n[r].parentItem=null,null!=e&&(n[pi(n,e)].childCount=ci(n,e))}return n},fi=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;const r=hi(e,t);let o,i=[...e],a=-1,s=pi(e,t);if(-1==n&&(n=s),ii(si,"moving children into place",t,s,r),r.length>0)for(t.childCount=r.length,o=0;o<r.length;o++)a=pi(i,r[o]),a>-1&&(a>n&&n++,ii(si,"child item / parent item",r[o],t),i[a].depth=t.depth+1,i[a].parentItem=t,i[a].menu_item_parent=t.ID,ii(si,"Moving item "+r[o].ID.toString()+" as child: index "+a.toString()+" to next insertion point: "+n.toString()),Ci(i,a,n),hi(i,r[o]).length>0&&(ii(si,"recursing child move"),[n,i]=fi(i,r[o],n)));return[n,i]},pi=(e,t)=>e.findIndex((e=>e.ID==t.ID)),mi=(e,t)=>gi(e,(e=>e.menu_item_parent==t.ID)),hi=(e,t)=>e.filter((e=>e.menu_item_parent==t.ID)),vi=(e,t)=>{if(t.menu_item_parent){const n=e.findIndex((e=>e.ID==t.menu_item_parent));if(n>-1)return e[n]}return null},gi=(e,t)=>e.reduce(((e,n,r)=>t.call(void 0,n)?[...e,r]:[...e]),[]),yi=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{applyToChildren:!1},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const{applyToChildren:i}=r;let a=[...e];if(t.ID){const s=e.findIndex((e=>e.ID===t.ID));if(s>-1&&(a[s]=n.call(ai,t,o),i)){const e=gi(a,(e=>e&&e.menu_item_parent==t.ID));if(e.length>0){let t,i;for(t=0;t<e.length;t++)i=a[e[t]],o++,a=yi(a,i,n,r,o),o--}}}return a},bi=function(e,t){const n=e.findIndex((e=>e.ID==t));return n>-1?e[n]:null},wi=function(e,t){const n=e.findIndex((e=>e.ID==t.ID));if(n>-1){const r=[...e];return r[n]=t,r}return e};function Ci(e,t,n){const r=t<0?e.length+t:t;if(r>=0&&r<e.length){const r=n<0?e.length+n:n,[o]=e.splice(t,1);ii(si,"moved out item",o),e.splice(r,0,o)}}const Ei=()=>"xxxx-xxxx".replace(/x/g,(()=>Math.floor(12*Math.random()).toString(12)));function xi(e){return function(t){return!!t.type&&t.type.tabsRole===e}}var Oi=xi("Tab"),ki=xi("TabList"),_i=xi("TabPanel");function Si(){return Si=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Si.apply(this,arguments)}function Ni(e,n){return t.Children.map(e,(function(e){return null===e?null:function(e){return Oi(e)||ki(e)||_i(e)}(e)?n(e):e.props&&e.props.children&&"object"==typeof e.props.children?(0,t.cloneElement)(e,Si({},e.props,{children:Ni(e.props.children,n)})):e}))}function Ti(e,n){return t.Children.forEach(e,(function(e){null!==e&&(Oi(e)||_i(e)?n(e):e.props&&e.props.children&&"object"==typeof e.props.children&&(ki(e)&&n(e),Ti(e.props.children,n)))}))}function Di(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Di(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var Ii=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Di(e))&&(r&&(r+=" "),r+=t);return r},Pi=0;function Mi(){return"react-tabs-"+Pi++}function Ri(e){var t=0;return Ti(e,(function(e){Oi(e)&&t++})),t}var Ai,Li=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function ji(){return ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(this,arguments)}function Fi(e){return e&&"getAttribute"in e}function Bi(e){return Fi(e)&&e.getAttribute("data-rttab")}function Hi(e){return Fi(e)&&"true"===e.getAttribute("aria-disabled")}var Vi=function(e){var n=(0,t.useRef)([]),o=(0,t.useRef)([]),i=(0,t.useRef)([]),a=(0,t.useRef)();function s(t,n){t<0||t>=u()||(0,e.onSelect)(t,e.selectedIndex,n)}function l(e){for(var t=u(),n=e+1;n<t;n++)if(!Hi(d(n)))return n;for(var r=0;r<e;r++)if(!Hi(d(r)))return r;return e}function c(e){for(var t=e;t--;)if(!Hi(d(t)))return t;for(t=u();t-- >e;)if(!Hi(d(t)))return t;return e}function u(){return Ri(e.children)}function d(e){return n.current["tabs-"+e]}function f(e){var t=e.target;do{if(p(t)){if(Hi(t))return;return void s([].slice.call(t.parentNode.children).filter(Bi).indexOf(t),e)}}while(null!=(t=t.parentNode))}function p(e){if(!Bi(e))return!1;var t=e.parentElement;do{if(t===a.current)return!0;if(t.getAttribute("data-rttabs"))break;t=t.parentElement}while(t);return!1}e.children;var m=e.className,h=(e.disabledTabClassName,e.domRef),v=(e.focus,e.forceRenderTabPanel,e.onSelect,e.selectedIndex,e.selectedTabClassName,e.selectedTabPanelClassName,e.environment,e.disableUpDownKeys,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Li));return r().createElement("div",ji({},v,{className:Ii(m),onClick:f,onKeyDown:function(t){var n=e.direction,r=e.disableUpDownKeys;if(p(t.target)){var o=e.selectedIndex,i=!1,a=!1;"Space"!==t.code&&32!==t.keyCode&&"Enter"!==t.code&&13!==t.keyCode||(i=!0,a=!1,f(t)),"ArrowLeft"!==t.code&&37!==t.keyCode&&(r||38!==t.keyCode&&"ArrowUp"!==t.code)?"ArrowRight"!==t.code&&39!==t.keyCode&&(r||40!==t.keyCode&&"ArrowDown"!==t.code)?35===t.keyCode||"End"===t.code?(o=function(){for(var e=u();e--;)if(!Hi(d(e)))return e;return null}(),i=!0,a=!0):36!==t.keyCode&&"Home"!==t.code||(o=function(){for(var e=u(),t=0;t<e;t++)if(!Hi(d(t)))return t;return null}(),i=!0,a=!0):(o="rtl"===n?c(o):l(o),i=!0,a=!0):(o="rtl"===n?l(o):c(o),i=!0,a=!0),i&&t.preventDefault(),a&&s(o,t)}},ref:function(e){a.current=e,h&&h(e)},"data-rttabs":!0}),function(){var a=0,s=e.children,l=e.disabledTabClassName,c=e.focus,f=e.forceRenderTabPanel,p=e.selectedIndex,m=e.selectedTabClassName,h=e.selectedTabPanelClassName,v=e.environment;o.current=o.current||[],i.current=i.current||[];for(var g=o.current.length-u();g++<0;)o.current.push(Mi()),i.current.push(Mi());return Ni(s,(function(e){var s=e;if(ki(e)){var u=0,g=!1;null==Ai&&function(e){var t=e||("undefined"!=typeof window?window:void 0);try{Ai=!(void 0===t||!t.document||!t.document.activeElement)}catch(e){Ai=!1}}(v);var y=v||("undefined"!=typeof window?window:void 0);Ai&&y&&(g=r().Children.toArray(e.props.children).filter(Oi).some((function(e,t){return y.document.activeElement===d(t)}))),s=(0,t.cloneElement)(e,{children:Ni(e.props.children,(function(e){var r="tabs-"+u,a=p===u,s={tabRef:function(e){n.current[r]=e},id:o.current[u],panelId:i.current[u],selected:a,focus:a&&(c||g)};return m&&(s.selectedClassName=m),l&&(s.disabledClassName=l),u++,(0,t.cloneElement)(e,s)}))})}else if(_i(e)){var b={id:i.current[a],tabId:o.current[a],selected:p===a};f&&(b.forceRender=f),h&&(b.selectedClassName=h),a++,s=(0,t.cloneElement)(e,b)}return s}))}())};Vi.defaultProps={className:"react-tabs",focus:!1},Vi.propTypes={};var Wi=Vi;function Ui(){return Ui=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ui.apply(this,arguments)}var zi=function(e){var n=e.children,o=e.defaultFocus,i=e.defaultIndex,a=e.focusTabOnClick,s=e.onSelect,l=(0,t.useState)(o),c=l[0],u=l[1],d=(0,t.useState)(function(e){return null===e.selectedIndex?1:0}(e)),f=d[0],p=(0,t.useState)(1===f?i||0:null),m=p[0],h=p[1];if((0,t.useEffect)((function(){u(!1)}),[]),1===f){var v=Ri(n);(0,t.useEffect)((function(){if(null!=m){var e=Math.max(0,v-1);h(Math.min(m,e))}}),[v])}var g=Ui({},e);return g.focus=c,g.onSelect=function(e,t,n){"function"==typeof s&&!1===s(e,t,n)||(a&&u(!0),1===f&&h(e))},null!=m&&(g.selectedIndex=m),delete g.defaultFocus,delete g.defaultIndex,delete g.focusTabOnClick,r().createElement(Wi,g,n)};zi.propTypes={},zi.defaultProps={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1},zi.tabsRole="Tabs";var qi=zi,Yi=["children","className"];function $i(){return $i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$i.apply(this,arguments)}var Xi=function(e){var t=e.children,n=e.className,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Yi);return r().createElement("ul",$i({},o,{className:Ii(n),role:"tablist"}),t)};Xi.tabsRole="TabList",Xi.propTypes={},Xi.defaultProps={className:"react-tabs__tab-list"};var Ki=Xi,Gi=["children","className","disabled","disabledClassName","focus","id","panelId","selected","selectedClassName","tabIndex","tabRef"];function Ji(){return Ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ji.apply(this,arguments)}var Zi="react-tabs__tab",Qi={className:Zi,disabledClassName:Zi+"--disabled",focus:!1,id:null,panelId:null,selected:!1,selectedClassName:Zi+"--selected"},ea=function(e){var n,o=(0,t.useRef)(),i=e.children,a=e.className,s=e.disabled,l=e.disabledClassName,c=e.focus,u=e.id,d=e.panelId,f=e.selected,p=e.selectedClassName,m=e.tabIndex,h=e.tabRef,v=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Gi);return(0,t.useEffect)((function(){f&&c&&o.current.focus()}),[f,c]),r().createElement("li",Ji({},v,{className:Ii(a,(n={},n[p]=f,n[l]=s,n)),ref:function(e){o.current=e,h&&h(e)},role:"tab",id:u,"aria-selected":f?"true":"false","aria-disabled":s?"true":"false","aria-controls":d,tabIndex:m||(f?"0":null),"data-rttab":!0}),i)};ea.propTypes={},ea.tabsRole="Tab",ea.defaultProps=Qi;var ta=ea,na=["children","className","forceRender","id","selected","selectedClassName","tabId"];function ra(){return ra=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ra.apply(this,arguments)}var oa={className:"react-tabs__tab-panel",forceRender:!1,selectedClassName:"react-tabs__tab-panel--selected"},ia=function(e){var t,n=e.children,o=e.className,i=e.forceRender,a=e.id,s=e.selected,l=e.selectedClassName,c=e.tabId,u=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,na);return r().createElement("div",ra({},u,{className:Ii(o,(t={},t[l]=s,t)),role:"tabpanel",id:a,"aria-labelledby":c}),i||s?n:null)};ia.tabsRole="TabPanel",ia.propTypes={},ia.defaultProps=oa;var aa=ia,sa=n(568),la=n.n(sa);const ca={main:"Main",advanced:"Advanced"};var ua=n=>{const r=(0,t.useContext)(kt),{forItemType:o,item:i,origItem:a,fieldEditEventHandler:s}=n,l=(0,t.useRef)([{name:"object_id",key:"post_object_id",label:"Page/Post ID",input_type:"none",show_for_item_type:["post_type"],fieldset:ca.main},{name:"object_title",key:"post_object_title",label:"Page/Post Title",input_type:"none",show_for_item_type:["post_type"],fieldset:ca.main},{name:"object_id",key:"taxonomy_object_id",label:"Category ID",input_type:"none",show_for_item_type:["taxonomy"],fieldset:ca.main},{name:"object_title",key:"taxonomy_object_title",label:"Category Title",input_type:"none",show_for_item_type:["taxonomy"],fieldset:ca.main},{name:"title",key:"title",label:"Menu Item Title",input_type:"text",fieldset:ca.main},{name:"description",key:"description",label:"Description",input_type:"text",fieldset:ca.advanced},{name:"title_attr",key:"title_attr",label:"Title Attribute",input_type:"text",fieldset:ca.advanced},{name:"target",key:"target",label:"Open in New Window",input_type:"checkbox",value_unset:"",value:"_blank",fieldset:ca.advanced},{name:"classes",key:"classes",label:"CSS Classes",input_type:"text",editable_data_type:"string",fieldset:ca.advanced},{name:"url",key:"url",label:"URL",input_type:"text",editable_data_type:"string",fieldset:ca.main,show_for_item_type:["custom"]}]);(0,t.useEffect)((()=>{r.isSaving||u()}),[r.menuItems,a,i]);const c=e=>{let t={};for(const n of l.current)t[n.key]=f(e,n);return t},u=()=>{if(a&&null!=a.current){const e=c(a.current),t=c(i);la()(JSON.stringify(e))==la()(JSON.stringify(t))?(ii(ri,"item fully reverted"),r.unMarkChangedItem(i,r.menuItemChangeTypes.edit)):r.markChangedItem(i,r.menuItemChangeTypes.edit)}},d=(0,t.useCallback)((e=>l.current.filter((t=>t.fieldset==ca[e]&&(!(null!=t&&t.show_for_item_type)||(null==t?void 0:t.show_for_item_type.includes(i.type)))))),[l.current,i.type]),f=(e,t)=>{const n=t.name;if(n){const t=void 0!==e[n]?e[n]:null;return ii(ri,"Item field value for ",n,t),t}return null},p=e=>s(e),m=e=>{var t,n;const o=null!==(t=null===(n=e.target)||void 0===n?void 0:n.getAttribute("data-field-key"))&&void 0!==t?t:null;if(o){const t=l.current.findIndex((e=>e.key==o));if(t<=-1)ii(ri,`Could not find key ${o} in editableFields`);else{const n=l.current[t];if("array"==n.storage_type){var a,s;const t=null===(a=e.target)||void 0===a||null===(s=a.value)||void 0===s?void 0:s.toString().split(" ");i[o]=t}else{let t;t="checkbox"==n.input_type?e.target.checked?n.value:void 0!==n.value_unset?n.value_unset:null:e.target.value,i[o]=t}r.setMenuItems(wi(r.menuItems,i)),r.markChangedItem(i,r.menuItemChangeTypes.edit),ii(ri,"updated items after field change",r.menuItems)}}else ii(ri,"Invalid or missing field key when editing")};return(0,e.createElement)("div",{className:"mmu-editor-form"},(0,e.createElement)("div",{className:"mmu-editor-form-fields"},Object.keys(ca).map((t=>{let n=[];return"main"!=t&&n.push(),n.push(d(t).map((t=>{let n=f(i,t),s=((e,t)=>{if(a&&null!=a.current&&t.show_for_item_type&&a.current.type!=t.show_for_item_type&&!r.itemWasChanged(e))return null;let n=f(e,t);return"string"==t.editable_data_type&&Array.isArray(n)?n=n.join(" "):"checkbox"==t.input_type&&(n=t.value),n})(i,t),l="checkbox"==t.input_type&&n==s;return t.label,(0,e.createElement)("div",{key:t.key,className:"mmu-editor-field"},(0,e.createElement)("label",{htmlFor:"mmu-input-"+o+"-"+t.key},t.label),"none"!=t.input_type?(0,e.createElement)("input",{"data-field-key":t.key,id:"mmu-input-"+o+"-"+t.key,type:t.input_type,name:t.name,defaultChecked:l,onKeyDown:p,onChange:m,defaultValue:s}):(0,e.createElement)("span",{className:"mmu-editor-field-value-static"},s))}))),"main"!=t?(0,e.createElement)("details",null,(0,e.createElement)("summary",null,ca[t]),(0,e.createElement)("div",{className:"mmu-editor-form-fields"},n)):n}))))},da=window.wp.apiFetch,fa=n.n(da);n(666);const pa="Error fetching data from backend",ma=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{debug_category:n="API",messages:r=[],message_base:o=pa}=t;Array.isArray(r)||(r=[r]),e.response&&(ii(n,"Data",e.response.data),ii(n,"Status",e.response.status),ii(n,"Headers",e.response.headers)),e.request&&ii(n,"Request",e.request),e.message&&ii(n,e.message);const i=o+"\n"+r.join("\n")+"\n";throw new Error(i,{originalError:e})},ha=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{assertFieldValues:n}=t;let r=!1;if(e&&void 0!==e.status&&"success"==e.status&&(r=!0),!r){let t=pa;throw e&&(void 0!==e.message&&e.message&&(t=t+"\n"+e.message),void 0!==e.messages&&e.messages&&(t=Array.isArray(e.messages)?t+"\n"+e.messages.join("\n"):t+"\n"+e.messages)),new Error(t)}if(null!=n){let t;for(t in n)if(void 0===e[n[t]])throw new Error("Missing field key '"+n[t].toString()+"' in response")}return r},va="PostService",ga={fetchResults:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=await fa()({path:"/mm_ultra/v1/posts/search",method:"POST",data:{search_key:e,type_filter:n,offset:t}}).catch((e=>{ma(e)}));if(ii(va,"response",r),void 0!==r.results&&Array.isArray(r.results))return r;throw ii(va,"Invalid results returned from API",r),new Error("Invalid response data from API")},fetchPost:async(e,t)=>{t||(t="/mm_ultra/v1"),ii(va,"endpoint is",`${t}/post/${e}`);const n=await fa()({path:`${t}/post/${e}/get`,method:"GET"}).catch((e=>{ma(e)}));if(ii(va,"response",n),void 0!==n.post)return n.post;throw ii(va,"Invalid results returned from API",n),new Error("Invalid response data from API")}};var ya=ga;const ba="TaxonomyService",wa={fetchResults:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=await fa()({path:"/mm_ultra/v1/taxonomy/search",method:"POST",data:{search_key:e,type_filter:n,offset:t}}).catch((e=>{ma(e)}));if(ii(ba,"response",r),void 0!==r.results&&Array.isArray(r.results))return r;throw ii(ba,"Invalid results returned from API",r),new Error("Invalid response data from API")}};var Ca=wa,Ea=n(358),xa=n.n(Ea),Oa=n=>{const{itemType:r,selectAction:o}=n,[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)([]),[c,u]=(0,t.useState)(""),[d,f]=(0,t.useState)(0),[p,m]=(0,t.useState)(0),h=(0,t.useRef)(null),v=(0,t.useContext)(kt);(0,t.useEffect)((()=>{v.postTypes.length<=0&&y(),v.taxonomyTypes.length<=0&&b()}),[]);const g=(e,t)=>{l(e);const n=t?Math.ceil(t/20):0;f(n),m(t)},y=()=>{fa()({path:"/mm_ultra/v1/posts/types"}).then((e=>{v.setPostTypes(e.sort(((e,t)=>{const n=e.labels.name.toLowerCase(),r=t.labels.name.toLowerCase();return n.localeCompare(r)})))}))},b=()=>{fa()({path:"/mm_ultra/v1/taxonomy/types"}).then((e=>{v.setTaxonomyTypes(e.sort(((e,t)=>{const n=e.labels.name.toLowerCase(),r=t.labels.name.toLowerCase();return n.localeCompare(r)})))}))};return(0,e.createElement)("div",{className:"mmu-menu-item-post-search-container"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search-interface"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search-type-container"},(0,e.createElement)("select",{className:"mmu-menu-item-post-search-interface-element mmu-menu-item-post-search-type",value:i,onChange:e=>{a(e.target.value)}},(0,e.createElement)("option",{value:""},"Search all Types"),(e=>"taxonomy"==e?v.taxonomyTypes:v.postTypes)(r).map(((t,n)=>(0,e.createElement)("option",{key:t.name,value:t.type_slug},t.labels.name))))),(0,e.createElement)("div",{className:"mmu-menu-item-post-search-keyword-container"},(0,e.createElement)("input",{ref:h,type:"text",className:"mmu-menu-item-post-search-interface-element mm-ultra-search-input mm-ultra-search-input--posts",name:"search_posts"}),(0,e.createElement)("button",{onClick:()=>(async()=>{let e;ii(ri,"search value",h.current.value),u(h.current.value),e="taxonomy"==r?await Ca.fetchResults(h.current.value,0,i):await ya.fetchResults(h.current.value,0,i),ii(ri,"search returnedData",e),g(e.results,e.total_results)})(),className:"mmu-menu-item-post-search-interface-element mmu-button mmu-button--search"},"Search"))),(0,e.createElement)("div",{className:"mmu-menu-item-editor-help-text"},"Use the search to find content. Click a result to apply it to this menu item."),window.MMU.can_use_premium_code?"":(0,e.createElement)("div",{className:"notice notice-info"},(0,e.createElement)("p",null,(0,e.createElement)("a",{href:window.MMU.upgrade_url},"Upgrade to Pro today")," to search custom post types and taxonomy types")),(0,e.createElement)("div",{className:"mmu-menu-item-post-search-results"},(0,e.createElement)("div",{className:"mmu-menu-item-post-search-results-list"},s.length>0?(0,e.createElement)("table",{className:"mm-ultra-search-results mm-ultra-search-results--post"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"mmu-table-col--ID",scope:"col"},"ID"),(0,e.createElement)("th",{scope:"col"},"Title")),s.map(((t,n)=>(0,e.createElement)("tr",{key:t.ID,onClick:e=>o(s,t.ID)},(0,e.createElement)("td",{className:"mmu-table-col--ID"},t.ID),(0,e.createElement)("td",null,(0,e.createElement)("div",{className:"mmu-post-results-field-value mmu-post-results-field-value--title"},t.display_title),(0,e.createElement)("div",{className:"mmu-post-results-field-value mmu-post-results-field-value--url"},t.display_link)))))):""),(0,e.createElement)(xa(),{breakLabel:"...",nextLabel:"Next >",onPageChange:async e=>{const t=20*e.selected%p;ii(ri,"new page offset",t);const n=await ya.fetchResults(h.current.value,t,i);ii(ri,"search returnedData",n),g(n.results,n.total_results)},pageCount:d,previousLabel:"< Previous",renderOnZeroPageCount:null,className:"mmu-pager",disabledClassName:"mmu-pager-action--disabled"}))))};const ka={post:"post_type",link:"custom",taxonomy:"taxonomy"};var _a=n=>{const{item:r,index:o,parent:i}=n,[a,s]=(0,t.useState)(0),[l,c]=(0,t.useState)(!1),u=(0,t.useContext)(kt),d=(0,t.useRef)(null);(0,t.useEffect)((()=>{d.current||(ii(ri,"resetting origItem"),d.current={...r},r.type==ka.link?s(2):r.type==ka.taxonomy&&s(1))}),[]);const f=(e,t,n,o)=>{var i,a;const s=n.findIndex((e=>e.ID==o)),c=n[s],d=c.type_slug,f=e.findIndex((e=>e.type_slug==d)),p=null!==(i=e[f])&&void 0!==i&&null!==(a=i.labels)&&void 0!==a&&a.singular_name?e[f].labels.singular_name:e[f].labels.name;r.object=c.type_slug,r.object_id=c.ID,r.object_title=c.display_title,r.display_link=c.display_link,r.goto_link=c.goto_link,r.edit_link=c.edit_link,l||(r.title=c.display_title),r.type=t,r.type_label=p,u.setMenuItems(wi(u.menuItems,r)),u.markChangedItem(r,u.menuItemChangeTypes.edit)},p=e=>{var t,n;"title"==(null!==(t=null===(n=e.target)||void 0===n?void 0:n.getAttribute("name"))&&void 0!==t?t:null)&&c(!0)};return(0,e.createElement)("div",{className:"mmu-menu-item-editor"},(0,e.createElement)(qi,{onSelect:(e,t,n)=>{var o;ii(ri,"tab changed",n,n.target.getAttribute("item_type")),s(e);const i=ka[n.target.getAttribute("item_type")];d.current&&i==(null===(o=d.current)||void 0===o?void 0:o.type)?u.setMenuItems(wi(u.menuItems,d.current)):u.setMenuItems(wi(u.menuItems,{...r,type:i}))},selectedIndex:a},(0,e.createElement)(Ki,null,(0,e.createElement)(ta,{item_type:"post"},"Content"),(0,e.createElement)(ta,{item_type:"taxonomy"},"Taxonomy/Categories"),(0,e.createElement)(ta,{item_type:"link"},"Custom Link")),(0,e.createElement)(aa,null,(0,e.createElement)("div",{className:"mmu-menu-item-editor-mode--content"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Menu Item Settings")),(0,e.createElement)(ua,{forItemType:"post",item:r,origItem:d,fieldEditEventHandler:p})),(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Find Content")),(0,e.createElement)(Oa,{itemType:"post",selectAction:(e,t)=>f(u.postTypes,"post_type",e,t)})))),(0,e.createElement)(aa,null,(0,e.createElement)("div",{className:"mmu-menu-item-editor-mode--taxonomy"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Menu Item Settings")),(0,e.createElement)(ua,{forItemType:"taxonomy",item:r,origItem:d,fieldEditEventHandler:p})),(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("div",{className:"mmu-menu-item-editor-section-header"},(0,e.createElement)("h2",{className:"mmu-menu-item-editor-section-heading"},"Find Terms")),(0,e.createElement)(Oa,{itemType:"taxonomy",selectAction:(e,t)=>f(u.taxonomyTypes,"taxonomy",e,t)})))),(0,e.createElement)(aa,null,(0,e.createElement)("div",{className:"mmu-menu-item-editor-section"},(0,e.createElement)("h2",null,"Custom Link"),(0,e.createElement)(ua,{forItemType:"custom",item:r,origItem:d,fieldEditEventHandler:p,item:r})))),(0,e.createElement)("div",{className:"mmu-menu-item-editor-actions mmu-menu-item-editor-actions--secondary"},(0,e.createElement)("a",{className:"mmu-button mmu-button--secondary",onClick:e=>(e=>{if(u.unMarkChangedItem(r,u.menuItemChangeTypes.edit),r.isNewAddition)u.setMenuItems(function(e,t){let n=null;const r=e.findIndex((e=>e.ID==t.ID));if(r>-1){t.menu_item_parent&&(n=t.menu_item_parent);let o=[...e];if(o.splice(r,1),n){const e=bi(o,n);ii(si,"in remove and update, parent is",e,"parent ID is",n),o=ci(o,e)}return o}return e}(u.menuItems,r));else{const e={...d.current};e.showEditor=!1,u.setMenuItems(wi(u.menuItems,e))}})()},"Cancel ",r.isNewAddition?"Add":"Edit")))};window.wp.url;const Sa="MenuItemService",Na=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=`${oi}/menu/${e}/items`;return t&&!isNaN(t)&&(n+="/"+t.toString()),e?fa()({path:n}).then((e=>(ii(Sa,"returned top level menu items",null==e?void 0:e.items),ha(e),e))).catch((e=>(console.warn(e),e))):Promise.resolve(null)},Ta=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;ii(Sa,"fetching menu subitems",e,t,n);let r=`${oi}/menu/${e}/item/${t}/children`;if(n&&(r+="/"+n.toString()),e){const e=await fa()({path:r}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(e),e}return Promise.resolve(null)},Da=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)throw new Error("Missing MenuID in SaveItemRevision");const r=await fa()({path:`${oi}/menu/update`,method:"POST",data:{menu_id:e,revision_id:t,last_item_id:n}}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(r),r},Ia=(e,t,n)=>(ii(ri,"setting item to expanded value",t,n),yi(e,t,((e,t)=>({...e,expanded:n})),{applyToChildren:0==n})),Pa=(e,t)=>Ia(e,t,!0),Ma=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{skipSetWasFetched:o}=r;let i=!0,a=[],s=[],l=-1,c=null,u={};for(console.log("fetch and insert");i;){const t=await Ta(e,n.ID,c);console.log("result",t),s=[...s,...t.items],ii(ri,"updated item after insert",u),null!=t&&t.last_item_id?c=t.last_item_id:i=!1}return a=li(t,s),l=a.findIndex((e=>e.ID==n.ID)),u={},l>-1&&(u=a[l],o||(a[l].wasFetched=!0)),Promise.resolve(a)},Ra=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=await Ma(e,t,n,r);return n.deleteTree&&(o=yi(o,n,(function(e){return{...e,markedForDelete:!0,deleteTree:!0}}),{applyToChildren:!0})),Promise.resolve(Pa(o,n))},Aa=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{parentItem:n,newIndex:r}=t;let o={ID:Ei(),isNewAddition:!0,showEditor:!0,depth:0,title:""},i=r>-1?r:0;n&&(i=r>-1?r:pi(e,n)+1,o.parentItem=n,o.menu_item_parent=n.ID,o.depth=n.depth+1);let a=[...e];return a.splice(i,0,o),n&&(a=ci(a,n)),a},La=n=>{const{name:r,children:o,icon:i,disabled:s,border:l=!0,background:c=!0,clickHandler:u,...d}=n,[f,p]=(0,t.useState)([]),m=null!=i?i:r;return(0,t.useEffect)((()=>{const e=["mmu-button","mmu-button--with-icon","mmu-button--with-icon--"+(r?r.replace(/[^A-Za-z0-9-]/,"-"):"default")];s&&e.push("mmu-button--disabled mmu-button--with-icon--disabled"),l||e.push("mmu-button--without-border"),c||e.push("mmu-button--without-background"),p(e)}),[r,i,s]),(0,e.createElement)("button",a({className:f.join(" "),onClick:e=>(e=>{s||u(e)})(e)},d),(0,e.createElement)("i",{className:"dashicons dashicons-"+m}),(0,e.createElement)("i",{className:"mmu-button-text"},o))};La.propTypes={name:i().string,children:i().node,icon:i().string,disabled:i().bool,border:i().bool,background:i().bool,clickHandler:i().func};var ja=La,Fa=n(253),Ba=n.n(Fa);const Ha=t=>{const{name:n,children:r,...o}=t;return(0,e.createElement)("button",a({className:"mmu-button "+(n?"mmu-button--"+n.replace(/[^A-Za-z0-9-]/,"-"):"")},o),r)};Ha.propTypes={name:i().string,children:i().node};var Va=Ha;const Wa=n=>{var r,o;Ba().setAppElement("#menu-manager-ultra");const[i,a]=(0,t.useState)({}),{handleConfirm:s,handleCancel:l,isOpen:c}=n,u=(0,t.useRef)(document.getElementById("wpcontent"));(0,t.useEffect)((()=>{a(d())}),[]);const d=()=>{const e=getComputedStyle(u.current);return{content:{"margin-left":"auto","margin-right":"auto","max-height":"250px","max-width":"500px",top:"calc(50% - 250px)"},overlay:{"padding-left":e.paddingLeft,"margin-left":e.marginLeft,"background-color":"rgba(0, 0, 0, 0.8)"}}};return(0,e.createElement)(Ba(),{id:"modal_menu_item_delete_confirm",isOpen:c,contentLabel:"modalB",shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,onRequestClose:l,style:i},(0,e.createElement)("div",{className:"mmu-modal-message"},"This item has items beneath it.",null!==(r=window.MMU)&&void 0!==r&&r.can_use_premium_code?(0,e.createElement)("div",null,"How would you like to treat those items when deleting?"):""),(0,e.createElement)("div",{className:"mmu-modal-actions"},(0,e.createElement)(Va,{onClick:e=>s(e,1)},"Delete all sub-items as well"),null!==(o=window.MMU)&&void 0!==o&&o.can_use_premium_code?(0,e.createElement)(Va,{onClick:e=>s(e,0)},"Move sub-items one level up"):(0,e.createElement)("div",{className:"notice notice-info notice-pro-upgrade"},(0,e.createElement)("p",null,"The ",(0,e.createElement)("a",{href:window.MMU.upgrade_url},"Pro version")," has a feature for moving children of deleted items up one level."))))};Wa.propTypes={handleConfirm:i().func,handleCancel:i().func,isOpen:i().bool};var Ua=Wa,za=n=>{const r=(0,t.useContext)(kt),[o,i]=(0,t.useState)(!1),{item:a}=n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"mmu-menu-item-actions"},(0,e.createElement)(ja,{clickHandler:e=>(async e=>{a.showEditor=!0,r.setMenuItems(wi(r.menuItems,a))})(),name:"edit",icon:"edit",disabled:!!a.markedForDelete},"Edit"),(0,e.createElement)(ja,{clickHandler:e=>{((e,t)=>{if(1!=t.markedForDelete)t.childCount>0||t.has_fetchable_children>0?i(!0):(r.setMenuItems(wi(r.menuItems,{...t,markedForDelete:!0})),r.markChangedItem(t,r.menuItemChangeTypes.delete));else{let e=wi(r.menuItems,t),n=!1;t.deleteTree&&(n=!0),e=yi(e,t,(function(e){return r.unMarkChangedItem(e,r.menuItemChangeTypes.delete),{...e,markedForDelete:!1,deleteTree:!1}}),{applyToChildren:n}),r.setMenuItems(e)}})(0,a)},name:a.markedForDelete?"restore":"delete",icon:a.markedForDelete?"undo":"no"},a.markedForDelete?"Restore":"Remove"),(0,e.createElement)(ja,{clickHandler:e=>(async e=>{let t;!a.wasFetched&&a.has_fetchable_children?(t=await Ra(r.menuID,r.menuItems,a),t=Aa(t,{parentItem:a})):(t=Aa(r.menuItems,{parentItem:a}),t=Pa(t,a)),r.setMenuItems(t)})(),name:"add",icon:"plus",disabled:!!a.markedForDelete},"Add")),(0,e.createElement)(Ua,{isOpen:o,handleCancel:e=>{i(!1)},handleConfirm:(e,t)=>{const n=t>0,o=yi(r.menuItems,a,(function(e){return ii(ri,"delete confirm for item",e),r.markChangedItem(e,r.menuItemChangeTypes.delete),{...e,markedForDelete:!0,deleteTree:n}}),{applyToChildren:n});r.setMenuItems(o),i(!1)}}))};const qa=27;var Ya=n=>{var r;const o=(0,t.useContext)(kt),{item:i,parent:s}=n,[l,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)({marginLeft:(i.depth*qa).toString()+"px"}),f=function(e){let{id:n,data:r,disabled:o=!1,attributes:i}=e;const a=x("Droppable"),{activators:s,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=(0,t.useContext)(nt),{role:m=ft,roleDescription:h="draggable",tabIndex:g=0}=null!=i?i:{},b=(null==c?void 0:c.id)===n,C=(0,t.useContext)(b?lt:dt),[E,O]=w(),[k,_]=w(),S=function(e,n){return(0,t.useMemo)((()=>e.reduce(((e,t)=>{let{eventName:r,handler:o}=t;return e[r]=e=>{o(e,n)},e}),{})),[e,n])}(s,n),N=y(r);return v((()=>(f.set(n,{id:n,key:a,node:E,activatorNode:k,data:N}),()=>{const e=f.get(n);e&&e.key===a&&f.delete(n)})),[f,n]),{active:c,activatorEvent:l,activeNodeRect:u,attributes:(0,t.useMemo)((()=>({role:m,tabIndex:g,"aria-disabled":o,"aria-pressed":!(!b||m!==ft)||void 0,"aria-roledescription":h,"aria-describedby":d.draggable})),[o,m,g,b,h,d.draggable]),isDragging:b,listeners:o?void 0:S,node:E,over:p,setNodeRef:O,setActivatorNodeRef:_,transform:C}}({id:i.ID}),p=f.transition,m={transform:T.Translate.toString(f.transform),transition:p,visibility:f.isDragging?"hidden":"visible",marginLeft:(i.depth*qa).toString()+"px"},h=()=>!(!s||0!=s.expanded);return j({onDragMove:e=>{var t,n;const{over:r,delta:a}=e;if(null!=r&&r.id&&null!=r&&null!==(t=r.data)&&void 0!==t&&null!==(n=t.current)&&void 0!==n&&n.item){const e=r.data.current.item,t=e.depth;let n=a.x,s=!1,l=qa;1==e.expanded&&(s=!0);const c=i.depth-t;0!=c&&(l-=c*qa),s||n>l?o.setNestedDragID(e.ID):o.setNestedDragID(null)}}}),(0,t.useEffect)((()=>{let e={},t=i.depth*qa;o.nestedDragID&&o.nestedDragID==i.ID&&(ii(ri,"applying nested style"),t+=qa),e={...e,marginLeft:t.toString()+"px"},d(e)}),[o.nestedDragID]),(0,e.createElement)(e.Fragment,null,0==n.index?(0,e.createElement)(_t,{position:"top",item:i}):"",(0,e.createElement)("div",{className:on()("mmu-menu-item-container",{"mmu-menu-item-container--hidden":h()},{"mmu-menu-item-container--drag-hover":l},{"mmu-menu-item-container--with-children":i.childCount>0||i.has_fetchable_children>0},{"mmu-menu-item-container--without-children":!i.isNewAddition&&i.childCount<=0&&!i.has_fetchable_children}),ref:f.setNodeRef,style:m},(0,e.createElement)("div",{className:"mmu-menu-item-stage"},(0,e.createElement)("div",a({className:"mmu-menu-item-drag-handle"},f.attributes,f.listeners),(0,e.createElement)("div",{className:"mmu-gripper","aria-label":"Move up or down"})),(0,e.createElement)("div",{className:"mmu-menu-item-rows"},i.isNewAddition?"":(0,e.createElement)("div",{className:"mmu-menu-item-row mmu-menu-item-row--details "+(i.expanded?"mmu-menu-item-row--expanded":"")},i.childCount>0||i.has_fetchable_children>0?(0,e.createElement)("button",{className:on()("dashicons",{"dashicons-update mmu-icon-button--item-loading":i.isLoading},{"dashicons-arrow-down":!i.isLoading&&i.expanded},{"dashicons-arrow-right":!i.isLoading&&!i.expanded},{"mmu-icon-button--expand-item":!i.isLoading}),"aria-label":"Expand Sub Items",onClick:()=>{(async e=>{if(ii(ri,"expandCollapse called",e),e.expanded)o.setMenuItems(((e,t)=>Ia(e,t,!1))(o.menuItems,e));else if(e.has_fetchable_children&&!e.wasFetched){o.setMenuItems(wi(o.menuItems,{...e,isLoading:!0}));const t=await Ra(o.menuID,o.menuItems,e);let n=bi(t,e.ID);o.setMenuItems(wi(t,{...n,isLoading:!1})),ii(ri,"first fetch")}else o.setMenuItems(Pa(o.menuItems,e))})(n.item)}}):"",(0,e.createElement)(ti,{item:i,index:n.index,parent:s}),i.showEditor?"":(0,e.createElement)(za,{item:i})),i.showEditor?(0,e.createElement)("div",{className:"mmu-menu-item-row mmu-menu-item-row--editor"},(0,e.createElement)(_a,{item:i,index:n.index,parent:s})):""))),h()||(null===(r=f.active)||void 0===r?void 0:r.id)==i.ID?"":(0,e.createElement)(_t,{position:"after",item:i,style:u}))},$a=()=>{const n=(0,t.useContext)(kt),[r,o]=(0,t.useState)(!1),[i,a]=(0,t.useState)(!1),[s,l]=(0,t.useState)(null),[c,u]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{n.isAnyItemChanged?(l("You have unsaved changes"),o(!1),a(!0)):(o(!0),setTimeout((()=>{a(!1),u(!1)}),c?2500:0))}),[n.isAnyItemChanged]),(0,e.createElement)("div",{className:"mmu-save-bar "+(n.isAnyItemChanged||i?"mmu-save-bar--active":"")},i?(0,e.createElement)("div",{className:"mmu-save-bar-message"},s):"",n.isAnyItemChanged||i?(0,e.createElement)(e.Fragment,null,r?"":(0,e.createElement)(Va,{onClick:async e=>{try{const e=1e3,t=[];let r=!0,i=1,s=null,c={};n.setIsSaving(!0),l("Preparing to Save..."),a(!0);const d=await(async(e,t)=>{if(!e)throw new Error("Missing MenuID in SaveItems");const n=await fa()({path:`${oi}/menu/prepare-revision`,method:"POST",data:{items:t,menu_id:e}}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(n),n})(n.menuID,n.menuItems);l("Processing Deletions...");const f=await(async(e,t)=>{if(!e)throw new Error("Missing MenuID in processDeletions");if(!t)throw new Error("Missing revisionID in processDeletions");const n=await fa()({path:`${oi}/menu/process-deletions`,method:"POST",data:{menu_id:e,revision_id:t}}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(n),n})(n.menuID,d.revision_id);for(l("Saving...");r;){if(c=await Da(n.menuID,f.revision_id,s),c.items){let e=c.items.map((e=>({...e,isNewAddition:!1,showEditor:!1})));t.push(...e)}if(i++,i>=e)throw new Error("Too many batches processed; Stopping Save");c.last_item_id?(s=c.last_item_id,l(`Saving Batch ${i}...`)):r=!1}ii(ri,"Save result",c),l("Performing After-Save Operations..."),await(async e=>{const t=await fa()({path:`${oi}/menu/${e}/post-save-actions`,method:"GET"}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(t),t})(n.menuID),u(!0),n.clearChangedItems(),n.setMenuItems(t,{skipCheckForChanged:!0}),l("Menu Items Saved"),n.setIsSaving(!1),o(!0)}catch(e){l(e.message)}finally{n.setIsSaving(!1)}},name:"save"},n.isSaving?(0,e.createElement)("span",{className:"dashicons dashicons-update mmu-icon-button--item-loading"}):"Save")):"")};const Xa=(0,t.forwardRef)(((t,n)=>{let{id:r,item:o,...i}=t;return(0,e.createElement)("div",a({style:{padding:"20px",width:"60%","background-color":"#f1f1f1",border:"2px dashed #CCC"},className:"mmu-menu-item-container mmu-menu-item-container--is-being-dragged"},i,{ref:n}),(0,e.createElement)("div",{className:"mmu-menu-item-single"},(0,e.createElement)("div",{className:"mmu-menu-item-summary"},(0,e.createElement)("div",{className:"mmu-menu-item-title"},o.title))))}));var Ka=async()=>{const e=await fa()({path:`${oi}/fields/custom/list`,method:"GET"}).catch((e=>{ma(e)}));return ha(e,{assertFieldValues:["fields"]}),e.fields},Ga=async()=>{const e=await fa()({path:`${oi}/fields/custom/settings`,method:"GET"}).catch((e=>{ma(e)}));return ha(e,{assertFieldValues:["fields"]}),e.fields},Ja=async e=>{ii(ri,"saveFieldSettings",e);const t=await fa()({path:`${oi}/fields/custom/settings/save`,method:"POST",data:{fields:e}}).catch((e=>{ma(e,{debug_category:"FieldItemService"})}));return ha(t),t};const Za="nested",Qa="top",es=n=>{var r;const o=(0,t.useContext)(kt),[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)(null),[c,u]=(0,t.useState)(null),{menuID:d}=n,f=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(0,t.useMemo)((()=>[...n].filter((e=>null!=e))),[...n])}(U(Ie,{}),U(_e,{}));(0,t.useEffect)((()=>{(async()=>{if(null!=d){let e=[],t=null,n=!0;ii(ri,"fetching items",d);const r=await Ga();for(o.setActiveCustomFields(r);n;){ii(ri,"custom fields",r);const o=await Na(d,t);e=[...e,...o.items],o.last_item_id?t=o.last_item_id:n=!1}e.length>0?o.setMenuItems(li([],e)):o.setMenuItems([])}})()}),[d]);const p=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.menuItems;n=Aa(n,t),o.setMenuItems(n)};return(0,e.createElement)(e.Fragment,null,o.menuID?(0,e.createElement)("div",{className:"mmu-list-actions mmu-list-actions--top"},(0,e.createElement)("div",{className:"mmu-actions-container"},(0,e.createElement)(ja,{onClick:e=>p(e),name:"add",icon:"plus"},"Add Item"))):"",(0,e.createElement)("div",{id:"mmu-items-list",className:"mmu-items-list"},(0,e.createElement)(ut,{sensors:f,collisionDetection:X,onDragEnd:async e=>{const{active:t,over:n}=e;if(!t||!n)return!1;ii(ri,"active id",t.id),ii(ri,"over id",n.id);const r=parseInt(n.id.substring(n.id.lastIndexOf("-")+1));if(ii(ri,"overID",r),t.id!=r){const n=(e=>{const{over:t}=e;if(null!=t&&t.id){const e=t.id.toString().match(/droppable-([A-Za-z]+)-([A-Za-z0-9]+)/);if(e.length>1){let t=e[1],n=e[2];return ii(ri,"drop position id is",n),ii(ri,"nested drop id is",o.nestedDragID),t!=Qa&&n==o.nestedDragID&&(ii(ri,"Nested Drop"),t=Za),t}}return null})(e);let i=o.menuItems.findIndex((e=>e.ID==t.id)),a=o.menuItems.findIndex((e=>e.ID==r)),s=a,l=!1,c=[...o.menuItems],u=!1;n==Za?(ii(ri,"moving into new parent"),c[a].has_fetchable_children&&!c[a].wasFetched&&(ii(ri,"need to fetch items"),c=await Ra(o.menuID,o.menuItems,o.menuItems[a]),i=c.findIndex((e=>e.ID==t.id)),a=c.findIndex((e=>e.ID==r))),u=c[a],s=a,ii(ri,"setting menu item parent to",u.ID),c[i].menu_item_parent=u.ID,c[a].expanded=!0,c=ci(c,c[a])):"after"==n?(ii(ri,"dragging after"),void 0!==c[a].parentItem&&null!=c[a].parentItem&&void 0!==c[a].parentItem.ID?u=c[a].parentItem:(ii(ri,"dragging after -> setting newParentItem null"),u=null)):n==Qa?(s=0,u=null):"bottom"==n?(ii(ri,"dragging to bottom"),u=null,s=c.length-1):l=!0,n!=Qa&&i>a&&s++,l||(ii(ri,"updatedItems[activeIndex]",c[i]),ii(ri,"active index -> new position",i,s),c=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[...e];const i=o[t].parentItem,a=o[t];var s;ii(si,"in moveItem",o,t,n),null===r?(ii(si,"new parent item is null)"),o=di(o,o[t])):(null===(s=o[t].parentItem)||void 0===s?void 0:s.ID)!=r.ID&&(ii(si,"assigning new parent"),o=ui(o,o[t],r)),Ci(o,t,n);const l=pi(o,a);ii(si,"updated index after move",l),ii(si,"after array move",o);let c,u=o[l];return null!==o[l].parentItem&&(u=o[pi(o,o[l].parentItem)]),[c,o]=fi(o,u),i&&(o=ci(o,i)),ii(si,"final version inside moveItems",o),o}(c,i,s,u),o.setMenuItems(c),o.markChangedItem(c[s],o.menuItemChangeTypes.position),u&&o.markChangedItem(u,o.menuItemChangeTypes.children),ii(ri,"final updateditems",c))}o.setNestedDragID(null)},onDragStart:e=>{const{active:t}=e;ii(ri,"dragStart",e),a(t.id),ii(ri,"active id",t.id);const n=o.menuItems.findIndex((e=>e.ID===t.id));ii(ri,"active index",n);const r=o.menuItems[n],i=yi(o.menuItems,r,(e=>({...e,expanded:!1})),{applyToChildren:!0});o.setMenuItems(i),u(i[n])},onDragOver:function(e){var t;let{over:n}=e;l(null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null)}},o.menuItems.map(((t,n)=>(0,e.createElement)(Ya,{key:t.ID,parent:vi(o.menuItems,t),item:t,index:n}))),(0,e.createElement)(Ot,null,i?(0,e.createElement)(Xa,{id:i,item:c}):null)),(0,e.createElement)($a,null)),(null===(r=o.menuItems)||void 0===r?void 0:r.length)>0?(0,e.createElement)("div",{className:"mmu-list-actions mmu-list-actions--bottom"},(0,e.createElement)("div",{className:"mmu-actions-container"},(0,e.createElement)(ja,{onClick:e=>p(e,{newIndex:o.menuItems.length}),name:"add",icon:"plus"},"Add Item"))):"")};es.propTypes={menuID:i().string};var ts=es,ns=n=>{Ba().setAppElement("#menu-manager-ultra");const[r,o]=(0,t.useState)({}),{handleSave:i,handleCancel:a,isOpen:s,inputRef:l,message:c}=n,u=(0,t.useRef)(document.getElementById("wpcontent"));(0,t.useEffect)((()=>{o(d())}),[]);const d=()=>{const e=getComputedStyle(u.current);return{content:{"margin-left":"auto","margin-right":"auto","max-height":"200px","max-width":"400px",top:"calc(50% - 250px)"},overlay:{"padding-left":e.paddingLeft,"margin-left":e.marginLeft,"background-color":"rgba(0, 0, 0, 0.8)"}}};return(0,e.createElement)(Ba(),{id:"modal_menu_add",isOpen:s,contentLabel:"modalMenuAdd",shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,onRequestClose:a,style:r},c?(0,e.createElement)("div",{class:"mmu-modal-message"},c):"",(0,e.createElement)("div",{className:"mmu-modal-input-container"},(0,e.createElement)("label",{htmlFor:"input_new_menu_name"},"Menu Name"),(0,e.createElement)("input",{ref:l,type:"text",defaultValue:"",id:"input_new_menu_name",name:"new_menu_name"})),(0,e.createElement)("div",{className:"mmu-modal-actions"},(0,e.createElement)(Va,{onClick:e=>i(e)},"Save"),(0,e.createElement)("a",{onClick:e=>a(e)},"Cancel")))},rs=n=>{var r;const{setShowSettings:o}=n,i=(0,t.useContext)(kt),[a,s]=(0,t.useState)([]),[l,c]=(0,t.useState)([]),u=((0,t.useRef)(!1),(0,t.useRef)(!1)),d=(0,t.useCallback)((()=>new Promise((async(e,t)=>{e(await Ka())})))),f=(e,t)=>{if(ii(ri,"applying field settings",e),void 0!==t&&t.length>0){let n=t.map((t=>{ii(ri,"customField",t);let n=0;if(Array.isArray(e)&&e.length>0){const r=e.find((e=>e.field_key==t.field_key));r&&void 0!==r.enabled&&1==r.enabled&&(n=1)}return{...t,enabled:n}}));s(n),ii(ri,"updated fields",n)}};(0,t.useEffect)((()=>{0==u.current&&(u.current=!0,d().then((e=>{ii(ri,"fields result",e),new Promise((async(e,t)=>{e(await Ga())})).then((t=>{c(t),f(t,e)}))})))}),[]);const p=e=>{let t=l;const n=a.find((t=>t.field_key==e.target.name)),r=t.findIndex((t=>t.field_key==e.target.name));r>-1&&t.splice(r,1),1==e.target.checked?t.push({...n,enabled:1}):t.push({...n,enabled:0}),c(t),f(t,a),ii(ri,"updated field settings",t)};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"mmu-settings-heading"},"Settings"),null!==(r=window.MMU)&&void 0!==r&&r.can_use_premium_code?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"mmu-settings-section"},(0,e.createElement)("div",{className:"mmu-settings-section-heading"},"Custom Fields"),(0,e.createElement)("div",{className:"mmu-settings-section-description"},"Choose which fields to display in addition to the page title when browsing menu items"),(0,e.createElement)("div",{className:"mmu-settings-form"},(0,e.createElement)("div",{className:"mmu-settings-form-checkbox-group"},a.map(((t,n)=>{if(void 0!==t.field_key&&null!=t.field_key){const n="checkbox-settings-fields-"+t.field_key.toString();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"mmu-settings-option mmu-settings-option-custom-field"},(0,e.createElement)("input",{id:n,type:"checkbox",onChange:p,name:t.field_key,checked:1==t.enabled,value:"1"}),(0,e.createElement)("label",{htmlFor:n},t.field_label)))}}))))),(0,e.createElement)(Va,{onClick:async()=>{if(ii(ri,"Saving settings",l),await Ja(l),null!=i.menuID){const e=await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)throw new Error("Missing menuID in refreshItems");ii(Sa,"refreshed menu items",t);const r=await fa()({path:`${oi}/menu/${e}/items/refresh`,method:"POST",data:{items:t,override_fields:n}}).catch((e=>{ma(e,{debug_category:Sa})}));return ha(r,{assertFieldValues:["items"]}),r.items}(i.menuID,i.menuItems,"object_fields");i.setMenuItems(e)}o(!1)},name:"save"},"Save")):(0,e.createElement)("div",{className:"mmu-settings-section"},(0,e.createElement)("div",{className:"notice notice-info"},(0,e.createElement)("p",null,(0,e.createElement)("a",{href:window.MMU.upgrade_url},"Upgrade to Pro today")," to see custom fields in your menu items!"))))},os=n=>{Ba().setAppElement("#menu-manager-ultra");const[r,o]=(0,t.useState)({}),{handleCancel:i,isOpen:s,inputRef:l,message:c,name:u,width:d="600px",height:f="600px",children:p,...m}=n,h=(0,t.useRef)(document.getElementById("wpcontent"));(0,t.useEffect)((()=>{o(v())}),[]);const v=()=>{const e=getComputedStyle(h.current);return{content:{"margin-left":"auto","margin-right":"auto","max-height":f,"max-width":d,top:"calc(50% - 250px)"},overlay:{"padding-left":e.paddingLeft,"margin-left":e.marginLeft,"background-color":"rgba(0, 0, 0, 0.8)"}}};return(0,e.createElement)(Ba(),a({id:"modal"+u,isOpen:s,contentLabel:"modal"+u,shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,onRequestClose:i,style:r},m),p)};const is=t=>{const{setShowSettings:n,handleCancel:r,isOpen:o}=t;return(0,e.createElement)(os,{name:"settings",isOpen:o,onRequestClose:r},(0,e.createElement)(rs,{setShowSettings:n}))};is.propTypes={setShowSettings:i().func,handleCancel:i().func,isOpen:i().bool};var as=is;var ss=()=>{var n;const[r,o]=(0,t.useState)([]),[i,a]=(0,t.useState)(!1),[s,l]=(0,t.useState)(""),[c,u]=(0,t.useState)(!1),d=(0,t.useRef)(null),f=(0,t.useContext)(kt),p=async()=>{let e=await(async()=>{const e=await fa()({path:`${oi}/menus/list`,method:"GET"}).catch((e=>{ma(e,{debug_category:"MenuService"})}));return ha(e,{assertFieldValues:["menus"]}),e.menus})();o(e.map((e=>({label:e.name,value:e.id}))))};return(0,t.useEffect)((()=>{p()}),[]),(0,e.createElement)("div",{className:"mmu-dashboard"},(0,e.createElement)("div",{className:"mmu-settings-bar"},(0,e.createElement)(ja,{clickHandler:()=>u(!0),border:!1,background:!1,name:"settings",icon:"admin-generic"},"Custom Fields")),(0,e.createElement)("div",{className:"mmu-toolbar"},(0,e.createElement)("div",{className:"mmu-option-container"},(0,e.createElement)("label",{htmlFor:"select-menu"},"Choose a Menu to Edit"),(0,e.createElement)("select",{value:null!==(n=f.menuID)&&void 0!==n?n:"",onChange:e=>{f.reset(),f.setMenuID(e.target.value)}},(0,e.createElement)("option",{value:""},"Choose"),r.map((t=>(0,e.createElement)("option",{key:t.value,value:t.value},t.label))))),(0,e.createElement)("div",{className:"mmu-actions-container"},(0,e.createElement)(ja,{onClick:()=>a(!0),name:"add",icon:"plus"},"Add Menu"))),(0,e.createElement)(ts,{menuID:f.menuID}),(0,e.createElement)(ns,{message:s,inputRef:d,isOpen:i,handleCancel:()=>{a(!1)},handleSave:async()=>{if(ii(ri,"save menu item",d.current.value),d.current.value)try{const e=await(async e=>{const t=await fa()({path:`${oi}/menu/add`,method:"POST",data:{menu_name:e}});if(!t||!t.status||"error"==t.status){let e="Error adding menu item: ";throw t&&t.message&&(e+=t.message.toString()),new Error(e)}return t.menu_id})(d.current.value);p(),f.setMenuID(e),a(!1)}catch(e){ii(ri,"Error saving menu",e),l(e.message)}}}),(0,e.createElement)(as,{handleCancel:()=>u(!1),setShowSettings:u,isOpen:c}))};document.getElementById("menu-manager-ultra")&&(0,e.render)((0,e.createElement)((n=>{let{children:r}=n;const o={menuItems:[],menuID:null,addingItemToID:null,changedItems:[],isAnyItemChanged:!1,postTypes:[],taxonomyTypes:[],activeCustomFields:[],nestedDragID:null,isSaving:!1},[i,a]=(0,t.useState)(o),s=(0,t.useMemo)((()=>({getValue(e){return i[e]},setValue(e,t){let n={};return n[e]=t,a((e=>({...e,...n})))},setMenuItems:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipCheckForChanged:n=!1}=t;s.setValue("menuItems",e),n||d()},setMenuID:e=>{s.setValue("menuID",e),s.clearChangedItems()},menuItemChangeTypes:{any:"any",delete:"delete",edit:"edit",position:"position",children:"children"},markChangedItem:(e,t)=>{let n=s.getValue("changedItems");return n.findIndex((n=>n.ID==e.ID&&n.changeType==t))<=-1&&(n.push({ID:e.ID,changeType:t}),s.setValue("changedItems",n),d()),n},unMarkChangedItem:(e,t)=>{let n=s.getValue("changedItems");const r=n.findIndex((n=>n.ID==e.ID&&n.changeType==t));return r>-1&&(n.splice(r,1),s.setValue("changedItems",n),d()),n},itemWasChanged:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s.getValue("changedItems");const r=n.findIndex((n=>n.ID==e.ID&&(!t||n.changeType==t)));return r>-1},clearChangedItems(){s.setValue("changedItems",[]),s.setValue("isAnyItemChanged",!1)},reset:()=>{s.clearChangedItems()}}))),l=(0,t.useMemo)((()=>({getTargetFunctionResult(e,t,n){if("function"!=typeof e[t])throw new Error("Function doesn't exist on target object");return new Proxy(e[t],{apply:(e,t,n)=>Reflect.apply(e,t,n)})},shouldTriggerSetter(e){return"set"==e.substr(0,3)},magicSetter(e,t,n){const r=t.substr(3,1).toLowerCase()+t.substring(4);if(void 0===e[t]&&r in o)return e[t]=new Proxy(new Function,{apply:(e,t,n)=>{t[r]=n[0]}}),e[t]}}))),c=(0,t.useMemo)((()=>({get(e,t,n){return"function"==typeof e[t]?l.getTargetFunctionResult(e,t,n):t in o?s.getValue(t):l.shouldTriggerSetter(t)?l.magicSetter(e,t,n):Reflect.get(e,t,n)},set(e,t,n){if(t in o)return s.setValue(t,n),!0;throw new Error("trying to set invalid state property: "+t.toString())},has(e,t){return t in o||Reflect.has(e,t)}}))),u=(0,t.useMemo)((()=>new Proxy(s,c)),[i]),d=()=>{const e=s.getValue("changedItems").length>0;s.setValue("isAnyItemChanged",e)};return(0,e.createElement)(kt.Provider,{value:u},r)}),null,(0,e.createElement)((()=>(0,e.createElement)("div",null,(0,e.createElement)("h2",{className:"app-title"},"Menu Manager Ultra"),(0,e.createElement)("hr",null),(0,e.createElement)(ss,null))),null)),document.getElementById("menu-manager-ultra"))}()}(); -
menu-manager-ultra/trunk/menu-manager-ultra.php
r3245097 r3261172 1 1 <?php 2 2 3 /** 3 4 * Menu Manager Ultra … … 10 11 * Requires at least: 5.8 11 12 * Requires PHP: 7.0 12 * Version: 1.2. 113 * Version: 1.2.4 13 14 * Author: JK Plugins 14 15 * Text Domain: mm_ultra … … 17 18 * @package jk-plugins 18 19 */ 19 20 define( 'MMU_PLUGIN_VERSION', '1.2.4' ); 20 21 require __DIR__ . '/vendor/autoload.php'; 21 22 23 $this_dir_base_path = dirname(__FILE__). DIRECTORY_SEPARATOR; 24 25 require_once($this_dir_base_path . 'src' . DIRECTORY_SEPARATOR . 'util' . DIRECTORY_SEPARATOR . 'constants.php'); 26 require_once($this_dir_base_path . 'src' . DIRECTORY_SEPARATOR . 'util' . DIRECTORY_SEPARATOR . 'menu-manager-array-utils.php'); 27 require_once($this_dir_base_path . DIRECTORY_SEPARATOR . 'menu-manager-routes.php'); 28 22 $this_dir_base_path = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; 23 require_once $this_dir_base_path . 'src' . DIRECTORY_SEPARATOR . 'util' . DIRECTORY_SEPARATOR . 'constants.php'; 24 require_once $this_dir_base_path . 'src' . DIRECTORY_SEPARATOR . 'util' . DIRECTORY_SEPARATOR . 'menu-manager-array-utils.php'; 25 require_once $this_dir_base_path . DIRECTORY_SEPARATOR . 'menu-manager-routes.php'; 29 26 add_action( 'admin_menu', 'mmultra_init_menu' ); 30 31 27 /** 32 28 * Init Admin Menu. … … 35 31 */ 36 32 function mmultra_init_menu() { 37 38 add_theme_page( 39 "Menu Manager Ultra", 40 "Menu Manager Ultra", 41 'edit_theme_options', 42 'menu-manager-ultra', 43 'mmultra_admin_page' 44 ); 45 33 add_theme_page( 34 "Menu Manager Ultra", 35 "Menu Manager Ultra", 36 'edit_theme_options', 37 'menu-manager-ultra', 38 'mmultra_admin_page' 39 ); 46 40 } 47 41 … … 56 50 57 51 add_action( 'admin_enqueue_scripts', 'mmultra_admin_enqueue_scripts' ); 58 59 52 /** 60 53 * Enqueue scripts and styles. … … 63 56 */ 64 57 function mmultra_admin_enqueue_scripts() { 58 $script_version = ( defined( 'MMU_PLUGIN_VERSION' ) ? constant( 'MMU_PLUGIN_VERSION' ) : "1.2.4" ); 65 59 wp_enqueue_style( 'mm-ultra-style', plugin_dir_url( __FILE__ ) . 'build/main.css' ); 66 60 wp_enqueue_script( 67 'mm-ultra-script', plugin_dir_url( __FILE__ ) . 'build/index.js', 61 'mm-ultra-script', 62 plugin_dir_url( __FILE__ ) . 'build/index.js', 68 63 array('wp-element', 'wp-api-fetch'), 69 '1.0.0', true 64 $script_version, 65 true 70 66 ); 71 67 } … … 75 71 */ 76 72 function mmultra_custom_post_types() { 77 78 register_post_type( 'mmu_revision', 79 array( 80 'labels' => array( 81 'name' => __( 'Menu Revisions' ), 82 'singular_name' => __( 'Menu Revision' ) 83 ), 84 'public' => false, 85 'has_archive' => false, 86 'show_in_rest' => true, 87 88 ) 89 ); 73 register_post_type( 'mmu_revision', array( 74 'labels' => array( 75 'name' => __( 'Menu Revisions' ), 76 'singular_name' => __( 'Menu Revision' ), 77 ), 78 'public' => false, 79 'has_archive' => false, 80 'show_in_rest' => true, 81 ) ); 90 82 } 91 83 92 84 add_action( 'init', 'mmultra_custom_post_types' ); 93 94 85 /** 95 86 * Freemius integration code 96 87 */ 97 if ( ! function_exists( 'mmultra_fs' ) ) { 98 // Create a helper function for easy SDK access. 99 function mmultra_fs() { 100 global $mmultra_fs; 88 if ( !function_exists( 'mmultra_fs' ) ) { 89 // Create a helper function for easy SDK access. 90 function mmultra_fs() { 91 global $mmultra_fs; 92 if ( !isset( $mmultra_fs ) ) { 93 // Include Freemius SDK. 94 require_once dirname( __FILE__ ) . '/freemius/start.php'; 95 $mmultra_fs = fs_dynamic_init( array( 96 'id' => '11982', 97 'slug' => 'menu-manager-ultra', 98 'type' => 'plugin', 99 'public_key' => 'pk_a6319041fb80c1585655b9be45407', 100 'is_premium' => false, 101 'premium_suffix' => 'Pro', 102 'has_addons' => false, 103 'has_paid_plans' => true, 104 'trial' => array( 105 'days' => 14, 106 'is_require_payment' => false, 107 ), 108 'menu' => array( 109 'slug' => 'menu-manager-ultra', 110 'support' => false, 111 'parent' => array( 112 'slug' => 'themes.php', 113 ), 114 ), 115 'is_live' => true, 116 ) ); 117 } 118 return $mmultra_fs; 119 } 101 120 102 if ( ! isset( $mmultra_fs ) ) { 103 // Include Freemius SDK. 104 require_once dirname(__FILE__) . '/freemius/start.php'; 105 106 $mmultra_fs = fs_dynamic_init( array( 107 'id' => '11982', 108 'slug' => 'menu-manager-ultra', 109 'type' => 'plugin', 110 'public_key' => 'pk_a6319041fb80c1585655b9be45407', 111 'is_premium' => true, 112 'premium_suffix' => 'Pro', 113 // If your plugin is a serviceware, set this option to false. 114 'has_premium_version' => true, 115 'has_addons' => false, 116 'has_paid_plans' => true, 117 'trial' => array( 118 'days' => 14, 119 'is_require_payment' => false, 120 ), 121 'menu' => array( 122 'slug' => 'menu-manager-ultra', 123 'support' => false, 124 'parent' => array( 125 'slug' => 'themes.php', 126 ), 127 ), 128 // Set the SDK to work in a sandbox mode (for development & testing). 129 // IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT. 130 'secret_key' => '02bde5c1c82defa33991f01dbad5f00e', 131 ) ); 132 } 133 134 return $mmultra_fs; 135 } 136 137 // Init Freemius. 138 mmultra_fs(); 139 // Signal that SDK was initiated. 140 do_action( 'mmultra_fs_loaded' ); 141 142 function mmultra_add_licensing_helper() { 143 echo '<script type="text/javascript"> 121 // Init Freemius. 122 mmultra_fs(); 123 // Signal that SDK was initiated. 124 do_action( 'mmultra_fs_loaded' ); 125 function mmultra_add_licensing_helper() { 126 echo '<script type="text/javascript"> 144 127 (function(){ 145 128 window.MMU = {}; 146 window.MMU.upgrade_url = ' . json_encode( mmultra_fs()->get_upgrade_url()) . ';129 window.MMU.upgrade_url = ' . json_encode( mmultra_fs()->get_upgrade_url() ) . '; 147 130 window.MMU.can_use_premium_code = ' . json_encode( mmultra_fs()->can_use_premium_code() ) . '; 148 131 })(); 149 132 </script>'; 150 }151 152 add_action('admin_head', 'mmultra_add_licensing_helper');133 } 134 135 add_action( 'admin_head', 'mmultra_add_licensing_helper' ); 153 136 } 154 155 -
menu-manager-ultra/trunk/readme.txt
r3245097 r3261172 12 12 License: GPLv3 or later 13 13 License URI: http://www.gnu.org/licenses/gpl-3.0.html 14 Stable tag: 1.2. 114 Stable tag: 1.2.4 15 15 16 16 Better menu management for administrators. Works with very large menus and custom page types -
menu-manager-ultra/trunk/src/API/Endpoints/MenuItems.php
r3245090 r3261172 64 64 'last_id' => array( 65 65 'validate_callback' => function($param, $request, $key) { 66 return is_numeric( $param);66 return preg_match('/^[A-Za-z0-9_\-]+$', $param); 67 67 } 68 68 ), … … 88 88 } 89 89 )); 90 91 register_rest_route( Constants::ROUTE_BASE , '/menu/process-deletions', array( 92 'methods' => 'POST', 93 'callback' => [$this, 'endpointProcessDeletions'], 94 'permission_callback' => function($request) { 95 return current_user_can('edit_theme_options'); 96 } 97 )); 90 98 91 99 register_rest_route( Constants::ROUTE_BASE , '/menu/(?P<menu_id>\d+)/post-save-actions', array( … … 197 205 foreach($posts as $post) { 198 206 $menu_item = $this->enrichMenuItem($post); 199 $menu_item = MenuItemFormatter::applyChildData($menu_item, $menu_id); 200 207 $menu_item = MenuItemFormatter::applyChildDataToItem($menu_item, $menu_id); 201 208 $enriched_items[] = $menu_item; 202 209 … … 219 226 } 220 227 221 // return array_map(222 // function ($post) use ($menu_id) {223 // $menu_item = $this->enrichMenuItem($post);224 // return MenuItemFormatter::applyChildData($menu_item, $menu_id);225 // },226 // $posts227 // );228 229 228 } 230 229 … … 297 296 } 298 297 298 public function applyUniqueIDsToItems($items_arr) { 299 300 return array_map( 301 function($item) { 302 $item['mmu_unique_id'] = uniqid(); 303 return $item; 304 }, 305 $items_arr 306 ); 307 308 } 309 299 310 public function prepareRevisionForSave($menu_id, $items_arr) { 300 311 … … 302 313 $items_arr = $this->markItemsAsSeenByFrontend($items_arr); 303 314 $items_arr = $this->loadItemsNotSeenByFrontend($menu_id, $items_arr); 304 305 // 306 // Save an initial revision before we do anything 307 // 308 $this->saveMenuItemsRevision($items_arr); 309 310 if ($this->anyItemMarkedForDeletion($items_arr)) { 311 $items_arr = $this->processDeletions($items_arr); 312 } 313 315 $items_arr = $this->applyUniqueIDsToItems($items_arr); 316 $items_arr = $this->itemsAssignDeleteActions($items_arr); 314 317 $items_arr = ArrayOperations::order_parents_and_children($items_arr); 315 318 $items_arr = $this->itemsApplyPositionByOrder($items_arr); 316 319 317 320 return $this->saveMenuItemsRevision($items_arr); 318 319 } 321 322 } 323 324 public function endpointProcessDeletions( $request ) { 325 326 global $wpdb; 327 328 $ret_status = ReturnValue::STATUS_ERROR; 329 $ret_revision_id = null; 330 $ret_messages = []; 331 332 if (empty($request['menu_id']) || !is_numeric($request['menu_id'])) { 333 return $this->InvalidSaveRequestReturnData(); 334 } 335 336 if (empty($request['revision_id']) || !is_numeric($request['revision_id'])) { 337 return $this->InvalidSaveRequestReturnData(); 338 } 339 340 $revision = $this->loadMenuItemsRevision($request['revision_id']); 341 342 if (!$revision || is_wp_error($revision)) { 343 $message = is_wp_error($revision) ? $revision->get_error_messages() : 'Error loading revision'; 344 $ret_messages = [$message]; 345 } 346 else { 347 348 try { 349 $items_arr = unserialize($revision->post_content); 350 351 if (!$items_arr) { 352 $ret_messages = ['Error retrieving menu data from revision']; 353 } 354 else { 355 356 if ($this->anyItemMarkedForDeletion($items_arr)) { 357 358 $wpdb->query('START TRANSACTION'); 359 360 $items_arr = $this->processDeletions($items_arr, $request['menu_id'], false); 361 362 $ret_revision_id = $this->saveMenuItemsRevision($items_arr); 363 $ret_messages[] = 'Deletions Processed'; 364 $ret_status = ReturnValue::STATUS_SUCCESS; 365 366 $wpdb->query('COMMIT'); 367 368 } 369 else { 370 $ret_revision_id = $request['revision_id']; 371 $ret_messages[] = 'No Deletions Found'; 372 $ret_status = ReturnValue::STATUS_SUCCESS; 373 } 374 } 375 } 376 catch(\Exception $e) { 377 $wpdb->query('ROLLBACK'); 378 return $this->errorReturnData($e->getMessage()); 379 } 380 } 381 382 return [ 383 'status' => $ret_status, 384 'messages' => $ret_messages, 385 'revision_id' => $ret_revision_id 386 ]; 387 } 388 389 320 390 321 391 /** … … 342 412 } 343 413 344 if (!empty($request['last_item_id']) && is_numeric($request['last_item_id'])) {414 if (!empty($request['last_item_id'])) { 345 415 $given_last_item_id = $request['last_item_id']; 346 416 } … … 361 431 362 432 if ($given_last_item_id) { 363 $last_item_index = \MenuManagerUltra\util\flat_tree\find_item_index_by_id($items_arr, $given_last_item_id); 433 $last_item_index = \MenuManagerUltra\util\flat_tree\find_item_index_by_id_field($items_arr, $given_last_item_id, Constants::FIELD_KEY_MMU_UNIQUE_ID ); 434 435 if ($last_item_index < 0) { 436 throw new \Exception("Could not find index for item id {$given_last_item_id}"); 437 } 438 364 439 $items_arr = array_slice($items_arr, $last_item_index + 1); 365 440 } … … 375 450 catch(TimeoutException $timeout) { 376 451 377 $updated_last_item_id = !empty($timeout->last_item_processed[ 'ID']) ? $timeout->last_item_processed['ID'] : null ;452 $updated_last_item_id = !empty($timeout->last_item_processed[Constants::FIELD_KEY_MMU_UNIQUE_ID]) ? $timeout->last_item_processed[Constants::FIELD_KEY_MMU_UNIQUE_ID] : null ; 378 453 $items_arr = $timeout->items; 379 454 … … 423 498 424 499 $items_arr = unserialize($revision->post_content); 500 $items_arr = $this->applyUniqueIDsToItems($items_arr); 425 501 426 502 if (!$items_arr) { … … 488 564 $timeout = min($max_execution_time, $timeout); 489 565 490 if ($timeout >= $buffer ) {491 $timeout -= $buffer ;566 if ($timeout >= $buffer_time) { 567 $timeout -= $buffer_time; 492 568 } 493 569 } … … 551 627 } 552 628 else { 553 554 $item_index = \MenuManagerUltra\util\flat_tree\find_item_index_by_id($items_arr, $item['ID']); 555 556 MenuManagerUltra_Logger::Debug("Item index for new or updated item with id {$item['ID']}: {$item_index}\n"); 629 $item_unique_id = $item[Constants::FIELD_KEY_MMU_UNIQUE_ID]; 630 $item_index = \MenuManagerUltra\util\flat_tree\find_item_index_by_id_field($items_arr, $item_unique_id, Constants::FIELD_KEY_MMU_UNIQUE_ID); 631 632 if ($item_index < 0) { 633 throw new \Exception("Could not find item {$item_unique_id} in items during save operation"); 634 } 635 636 MenuManagerUltra_Logger::Debug("Item index for new or updated item with unique id {$item_unique_id}: {$item_index}\n"); 557 637 558 638 $updated_item = $items_arr[$item_index]; … … 562 642 $updated_item = (array) $this->loadAndEnrichMenuItem($insert_result); 563 643 $updated_item['isNewAddition'] = false; 644 $updated_item[Constants::FIELD_KEY_MMU_UNIQUE_ID] = $item_unique_id; 564 645 $updated_item[Constants::KEY_ITEM_SEEN_BY_FRONTEND] = true; 565 646 … … 787 868 } 788 869 789 public function processDeletions($items_arr) { 790 791 $items_arr = $this->itemsAssignDeleteActions($items_arr); 870 public function processDeletions($items_arr, $menu_id, $assign_actions = true) { 871 872 if ($assign_actions) { 873 $items_arr = $this->itemsAssignDeleteActions($items_arr); 874 } 875 792 876 $delete_toggle_column_entries = array_column($items_arr, 'markedForDelete', 'ID'); 793 877 … … 806 890 } 807 891 808 $ this->afterProcessDeletions($items_arr);892 $items_arr = $this->afterProcessDeletions($items_arr, $menu_id); 809 893 810 894 return $items_arr; … … 812 896 } 813 897 814 public function afterProcessDeletions($items_arr) { 815 816 return array_map( 817 function($item) { 818 return MenuItemFormatter::applyChildData($item); 819 }, 820 $items_arr 821 ); 822 898 public function afterProcessDeletions($items_arr, $menu_id) { 899 900 $items_arr = ArrayOperations::order_parents_and_children($items_arr); 901 $items_arr = $this->itemsApplyPositionByOrder($items_arr); 902 $items_arr = MenuItemFormatter::applyChildDataToItems($items_arr, $menu_id, true); 903 904 return $items_arr; 823 905 } 824 906 -
menu-manager-ultra/trunk/src/API/Endpoints/Posts.php
r3245097 r3261172 6 6 use MenuManagerUltra\lib\Post\PostDataFormatter; 7 7 use MenuManagerUltra\lib\Constants; 8 9 8 class Posts extends \WP_REST_Controller { 10 11 public function register_routes() { 12 13 register_rest_route( Constants::ROUTE_BASE, '/posts/search', array( 14 'methods' => 'POST', 15 'callback' => [$this, 'searchPosts'], 16 'permission_callback' => function($request) { 17 return current_user_can(Constants::ENDPOINT_PERMISSION_DEFAULT); 18 } 19 ) ); 20 21 register_rest_route( Constants::ROUTE_BASE, '/posts/types', array( 22 'methods' => 'GET', 23 'callback' => [$this, 'getPostTypesAsObjects'], 24 'permission_callback' => function($request) { 25 return current_user_can(Constants::ENDPOINT_PERMISSION_DEFAULT); 26 } 27 ) ); 28 29 register_rest_route( Constants::ROUTE_BASE, '/post/(?P<post_id>\d+)/get', array( 30 'methods' => 'GET', 31 'callback' => [$this, 'getPost'], 32 'args' => array( 33 'post_id' => array( 34 'validate_callback' => function($param, $request, $key) { 35 return is_numeric( $param ); 36 } 37 ), 38 ), 39 'permission_callback' => function($request) { 40 return current_user_can(Constants::ENDPOINT_PERMISSION_DEFAULT); 41 } 42 ) ); 43 } 44 45 /* 46 * Used as a filter for WP_Query to search title & content because certain plugins/hooks 47 * can upset the use of the "s" parameter 48 */ 49 public function applySearchParamToQuery($where, $wp_query) { 50 global $wpdb; 51 52 if ( $search_keys = $wp_query->get('mmu_search_query') ) { 53 $where .= " AND 54 ( 55 {$wpdb->posts}.post_title LIKE '%" . esc_sql($search_keys) . "%' 56 OR 57 {$wpdb->posts}.post_content LIKE '%" . esc_sql($search_keys) . "%' 58 )" ; 9 public function register_routes() { 10 register_rest_route( Constants::ROUTE_BASE, '/posts/search', array( 11 'methods' => 'POST', 12 'callback' => [$this, 'searchPosts'], 13 'permission_callback' => function ( $request ) { 14 return current_user_can( Constants::ENDPOINT_PERMISSION_DEFAULT ); 15 }, 16 ) ); 17 register_rest_route( Constants::ROUTE_BASE, '/posts/types', array( 18 'methods' => 'GET', 19 'callback' => [$this, 'getPostTypesAsObjects'], 20 'permission_callback' => function ( $request ) { 21 return current_user_can( Constants::ENDPOINT_PERMISSION_DEFAULT ); 22 }, 23 ) ); 24 register_rest_route( Constants::ROUTE_BASE, '/post/(?P<post_id>\\d+)/get', array( 25 'methods' => 'GET', 26 'callback' => [$this, 'getPost'], 27 'args' => array( 28 'post_id' => array( 29 'validate_callback' => function ( $param, $request, $key ) { 30 return is_numeric( $param ); 31 }, 32 ), 33 ), 34 'permission_callback' => function ( $request ) { 35 return current_user_can( Constants::ENDPOINT_PERMISSION_DEFAULT ); 36 }, 37 ) ); 59 38 } 60 39 61 return $where; 62 } 40 /* 41 * Used as a filter for WP_Query to search title & content because certain plugins/hooks 42 * can upset the use of the "s" parameter 43 */ 44 public function applySearchParamToQuery( $where, $wp_query ) { 45 global $wpdb; 46 if ( $search_keys = $wp_query->get( 'mmu_search_query' ) ) { 47 $where .= " AND\n (\n {$wpdb->posts}.post_title LIKE '%" . esc_sql( $search_keys ) . "%'\n OR\n {$wpdb->posts}.post_content LIKE '%" . esc_sql( $search_keys ) . "%'\n )"; 48 } 49 return $where; 50 } 63 51 64 public function searchPosts($params) { 52 public function searchPosts( $params ) { 53 add_filter( 54 'posts_where', 55 [$this, 'applySearchParamToQuery'], 56 10, 57 2 58 ); 59 $post_types = $this->getPostTypes( 'names' ); 60 $num_per_page = 20; 61 $page_number = 0; 62 if ( isset( $params['offset'] ) && $params['offset'] > 0 ) { 63 $page_number = ceil( $params['offset'] / $num_per_page ) + 1; 64 } 65 $args = [ 66 'mmu_search_query' => $params['search_key'], 67 ]; 68 if ( !empty( $params['type_filter'] ) ) { 69 $args['post_type'] = $params['type_filter']; 70 } else { 71 $args['post_type'] = $post_types; 72 } 73 /* Query the results for the given search keywords */ 74 $results_query = new \WP_Query(array_merge( $args, [ 75 'posts_per_page' => $num_per_page, 76 'paged' => $page_number, 77 ] )); 78 $results = $results_query->get_posts(); 79 /* Loop through the results and add in the permalink */ 80 $results = array_map( function ( $result ) { 81 return PostDataFormatter::normalizePostData( $result->ID, $result ); 82 }, $results ); 83 /* Issue a query to count all matching results, regardless of pagination */ 84 $count_query = new \WP_Query(array_merge( $args, [ 85 'posts_per_page' => -1, 86 'fields' => 'ids', 87 ] )); 88 $num_results = intval( $count_query->found_posts ); 89 return [ 90 'total_results' => $num_results, 91 'results' => $results, 92 ]; 93 } 65 94 66 add_filter( 'posts_where', [$this, 'applySearchParamToQuery'], 10, 2); 95 public function getPostTypesAsObjects() { 96 return $this->getPostTypes( 'objects' ); 97 } 67 98 68 $post_types = $this->getPostTypes('names'); 69 $num_per_page = 20; 70 $page_number = 0; 71 72 if (isset($params['offset']) && $params['offset'] > 0) { 73 $page_number = (ceil($params['offset'] / $num_per_page) + 1); 99 public function getPostTypes( $return_type = 'objects' ) { 100 $args = [ 101 'public' => true, 102 'show_in_nav_menus' => 1, 103 ]; 104 $types = get_post_types( $args, $return_type ); 105 if ( $return_type == 'objects' ) { 106 $ret = []; 107 foreach ( $types as $name => $obj ) { 108 /* @TODO Move this to PostDataFormatter */ 109 $obj->type_slug = $name; 110 $obj->labels = get_post_type_labels( $obj ); 111 $obj->display_title = $obj->labels->singular_name; 112 $ret[] = $obj; 113 } 114 } else { 115 $ret = $types; 116 } 117 return $this->postTypesApplyPremiumFilter( $ret ); 74 118 } 75 76 $args = [77 'mmu_search_query' => $params['search_key']78 ];79 119 80 if (!empty($params['type_filter'])) { 81 $args['post_type'] = $params['type_filter']; 120 public function postTypesApplyPremiumFilter( $types ) { 121 return array_filter( $types, function ( $val ) { 122 if ( is_object( $val ) ) { 123 if ( !empty( $val->name ) ) { 124 return in_array( $val->name, Constants::POST_TYPES_FREE ); 125 } else { 126 return false; 127 } 128 } else { 129 return in_array( $val, Constants::POST_TYPES_FREE ); 130 } 131 } ); 82 132 } 83 else { 84 $args['post_type'] = $post_types; 133 134 public function getPost( $params ) { 135 $post = null; 136 if ( $post = get_post( $params['post_id'] ) ) { 137 $post = PostDataFormatter::applyLinks( $post ); 138 $post->labels = get_post_type_labels( $post ); 139 } 140 return [ 141 'post' => $post, 142 ]; 85 143 } 86 87 /* Query the results for the given search keywords */88 $results_query = new \WP_Query(89 array_merge(90 $args, [91 'posts_per_page' => $num_per_page,92 'paged' => $page_number,93 ]94 )95 );96 97 $results = $results_query->get_posts();98 99 /* Loop through the results and add in the permalink */100 $results = array_map(101 function($result) {102 return PostDataFormatter::normalizePostData($result->ID, $result);103 },104 $results105 );106 107 /* Issue a query to count all matching results, regardless of pagination */108 $count_query = new \WP_Query(109 array_merge($args, [110 'posts_per_page' => -1,111 'fields' => 'ids',112 ])113 );114 115 $num_results = intval($count_query->found_posts);116 117 return [118 'total_results' => $num_results,119 'results' => $results120 ];121 }122 144 123 public function getPostTypesAsObjects() {124 return $this->getPostTypes('objects');125 }126 127 public function getPostTypes( $return_type = 'objects' ) {128 129 $args = [130 'public' => true,131 'show_in_nav_menus' => 1132 ];133 134 $types = get_post_types( $args, $return_type );135 136 if ($return_type == 'objects') {137 $ret = [];138 139 foreach ($types as $name => $obj) {140 141 /* @TODO Move this to PostDataFormatter */142 $obj->type_slug = $name;143 $obj->labels = get_post_type_labels($obj);144 $obj->display_title = $obj->labels->singular_name;145 146 147 $ret[] = $obj;148 }149 150 }151 else {152 $ret = $types;153 }154 155 return $this->postTypesApplyPremiumFilter($ret);156 157 }158 159 public function postTypesApplyPremiumFilter($types) {160 161 if ( mmultra_fs()->can_use_premium_code__premium_only() ) {162 return $types;163 }164 165 return array_filter(166 $types,167 function($val) {168 if (is_object($val)) {169 if (!empty($val->name)) {170 return in_array($val->name, Constants::POST_TYPES_FREE);171 }172 else {173 return false;174 }175 }176 else {177 return in_array($val, Constants::POST_TYPES_FREE);178 }179 }180 );181 }182 183 public function getPost($params) {184 185 $post = null;186 187 if ($post = get_post($params['post_id'])) {188 189 $post = PostDataFormatter::applyLinks($post);190 $post->labels = get_post_type_labels($post);191 }192 193 return ['post' => $post];194 }195 196 145 } 197 -
menu-manager-ultra/trunk/src/API/Endpoints/Taxonomy.php
r3245097 r3261172 6 6 use MenuManagerUltra\lib\Term\TermDataFormatter; 7 7 use MenuManagerUltra\lib\Constants; 8 9 8 class Taxonomy extends \WP_REST_Controller { 10 11 public function register_routes() { 12 13 register_rest_route( Constants::ROUTE_BASE, '/taxonomy/search', array( 14 'methods' => 'POST', 15 'callback' => [$this, 'searchTaxonomies'], 16 'permission_callback' => function($request) { 17 return current_user_can(Constants::ENDPOINT_PERMISSION_DEFAULT); 18 } 19 ) ); 20 21 register_rest_route( Constants::ROUTE_BASE, '/taxonomy/types', array( 22 'methods' => 'GET', 23 'callback' => [$this, 'getTaxonomyTypesAsObjects'], 24 'permission_callback' => function($request) { 25 return current_user_can(Constants::ENDPOINT_PERMISSION_DEFAULT); 26 } 27 ) ); 28 29 } 30 31 32 public function searchTaxonomies($params) { 33 34 $taxonomies = $this->getTaxonomies('names'); 35 $num_per_page = 20; 36 $offset = 0; 37 38 if (isset($params['offset']) && $params['offset'] > 0) { 39 $offset = intval($params['offset']) * $num_per_page; 40 } 41 42 if (!empty($params['type_filter'])) { 43 $taxonomies = $params['type_filter']; 9 public function register_routes() { 10 register_rest_route( Constants::ROUTE_BASE, '/taxonomy/search', array( 11 'methods' => 'POST', 12 'callback' => [$this, 'searchTaxonomies'], 13 'permission_callback' => function ( $request ) { 14 return current_user_can( Constants::ENDPOINT_PERMISSION_DEFAULT ); 15 }, 16 ) ); 17 register_rest_route( Constants::ROUTE_BASE, '/taxonomy/types', array( 18 'methods' => 'GET', 19 'callback' => [$this, 'getTaxonomyTypesAsObjects'], 20 'permission_callback' => function ( $request ) { 21 return current_user_can( Constants::ENDPOINT_PERMISSION_DEFAULT ); 22 }, 23 ) ); 44 24 } 45 25 46 $args = [ 47 'taxonomy' => $taxonomies, 48 'name__like' => $params['search_key'], 49 'hide_empty' => false, // Include empty categories 50 'number' => $num_per_page, 51 'offset' => $offset 52 ]; 53 54 $terms = get_terms($args); 55 56 if (is_wp_error($terms)) { 57 // @TODO error message/logging 58 return [ 59 'total_results' => 0, 60 'results' => [] 61 ]; 26 public function searchTaxonomies( $params ) { 27 $taxonomies = $this->getTaxonomies( 'names' ); 28 $num_per_page = 20; 29 $offset = 0; 30 if ( isset( $params['offset'] ) && $params['offset'] > 0 ) { 31 $offset = intval( $params['offset'] ) * $num_per_page; 32 } 33 if ( !empty( $params['type_filter'] ) ) { 34 $taxonomies = $params['type_filter']; 35 } 36 $args = [ 37 'taxonomy' => $taxonomies, 38 'name__like' => $params['search_key'], 39 'hide_empty' => false, 40 'number' => $num_per_page, 41 'offset' => $offset, 42 ]; 43 $terms = get_terms( $args ); 44 if ( is_wp_error( $terms ) ) { 45 // @TODO error message/logging 46 return [ 47 'total_results' => 0, 48 'results' => [], 49 ]; 50 } 51 /* Loop through the results and add in the permalink */ 52 $terms = array_map( function ( $term ) { 53 return TermDataFormatter::normalizeTermData( $term ); 54 }, $terms ); 55 /* Issue a query to count all matching results, regardless of pagination */ 56 $terms_all = get_terms( array_merge( $args, [ 57 'number' => false, 58 'offset' => 0, 59 ] ) ); 60 $num_results = intval( count( $terms_all ) ); 61 return [ 62 'total_results' => $num_results, 63 'results' => $terms, 64 ]; 62 65 } 63 66 64 /* Loop through the results and add in the permalink */ 65 $terms = array_map( 66 function($term) { 67 return TermDataFormatter::normalizeTermData($term); 68 }, 69 $terms 70 ); 71 72 /* Issue a query to count all matching results, regardless of pagination */ 73 $terms_all = get_terms( 74 array_merge($args, [ 75 'number' => false, 76 'offset' => 0 77 ]) 78 ); 79 80 $num_results = intval(count($terms_all)); 81 82 return [ 83 'total_results' => $num_results, 84 'results' => $terms 85 ]; 86 87 } 88 89 public function getTaxonomyTypesAsObjects() { 90 return $this->getTaxonomies('objects'); 91 } 92 93 public function getTaxonomies( $return_type = 'objects' ) { 94 95 $args = array( 96 'public' => true, 97 'show_in_nav_menus' => true, 98 ); 99 100 $taxonomies = get_taxonomies($args, $return_type); 101 102 if ($return_type == 'objects') { 103 $ret = []; 104 105 foreach ($taxonomies as $name => $obj) { 106 107 $obj->is_taxonomy = true; 108 $obj->type_slug = $name; 109 $obj->display_title = $obj->label; 110 $ret[] = $obj; 111 } 112 113 } 114 else { 115 $ret = $taxonomies; 67 public function getTaxonomyTypesAsObjects() { 68 return $this->getTaxonomies( 'objects' ); 116 69 } 117 70 118 return $this->taxonomiesApplyPremiumFilter($ret); 119 120 return $ret; 121 122 } 123 124 public function taxonomiesApplyPremiumFilter($tax) { 125 126 if ( mmultra_fs()->can_use_premium_code__premium_only() ) { 127 return $tax; 71 public function getTaxonomies( $return_type = 'objects' ) { 72 $args = array( 73 'public' => true, 74 'show_in_nav_menus' => true, 75 ); 76 $taxonomies = get_taxonomies( $args, $return_type ); 77 if ( $return_type == 'objects' ) { 78 $ret = []; 79 foreach ( $taxonomies as $name => $obj ) { 80 $obj->is_taxonomy = true; 81 $obj->type_slug = $name; 82 $obj->display_title = $obj->label; 83 $ret[] = $obj; 84 } 85 } else { 86 $ret = $taxonomies; 87 } 88 return $this->taxonomiesApplyPremiumFilter( $ret ); 89 return $ret; 128 90 } 129 91 130 return array_filter( 131 $tax, 132 function($val) { 133 if (is_object($val)) { 134 if (!empty($val->name)) { 135 return in_array($val->name, Constants::TAXONOMY_TERMS_FREE); 136 } 137 else { 138 return false; 139 } 140 } 141 else { 142 return in_array($val, Constants::TAXONOMY_TERMS_FREE); 143 } 144 } 145 ); 92 public function taxonomiesApplyPremiumFilter( $tax ) { 93 return array_filter( $tax, function ( $val ) { 94 if ( is_object( $val ) ) { 95 if ( !empty( $val->name ) ) { 96 return in_array( $val->name, Constants::TAXONOMY_TERMS_FREE ); 97 } else { 98 return false; 99 } 100 } else { 101 return in_array( $val, Constants::TAXONOMY_TERMS_FREE ); 102 } 103 } ); 104 } 146 105 147 }148 149 106 } 150 -
menu-manager-ultra/trunk/src/lib/Constants.php
r3245090 r3261172 12 12 const ENDPOINT_PERMISSION_DEFAULT = 'edit_theme_options'; 13 13 const ROUTE_BASE = 'mm_ultra/v1'; 14 14 const FIELD_KEY_MMU_UNIQUE_ID = 'mmu_unique_id'; 15 15 const FIELD_KEY_ID = ID; 16 16 -
menu-manager-ultra/trunk/src/lib/MenuItem/MenuItemFormatter.php
r3245090 r3261172 11 11 public const MENU_ITEM_TYPE_POST = 'post_type'; 12 12 public const MENU_ITEM_TYPE_TAXONOMY = 'taxonomy'; 13 14 public static $menu_items_by_parent = []; 13 15 14 16 public static function applyLinks($menu_item) { … … 92 94 } 93 95 94 public static function applyChildData($menu_item, $menu_id = null) { 96 public static function getMenuItemsByParent($menu_id, $force_refresh = false) { 97 98 self::confirmValidMenuID($menu_id); 99 100 // Load menu items into the cache only if this menu_id hasn't been processed yet 101 if ($force_refresh || !isset(static::$menu_items_by_parent[$menu_id])) { 102 // Fetch all menu items for the given menu_id 103 $args = [ 104 'post_type' => 'nav_menu_item', 105 'posts_per_page' => -1, 106 'fields' => 'ids', // Fetch only IDs for performance 107 'cache_results' => false, 108 'tax_query' => [ 109 [ 110 'taxonomy' => 'nav_menu', 111 'field' => 'term_taxonomy_id', 112 'terms' => $menu_id 113 ] 114 ] 115 ]; 116 117 $all_menu_items = get_posts($args); 118 119 // Organize items by their parent_id for quick lookup 120 static::$menu_items_by_parent[$menu_id] = []; 121 foreach ($all_menu_items as $item) { 122 $parent_id = get_post_meta($item, '_menu_item_menu_item_parent', true); 123 static::$menu_items_by_parent[$menu_id][$parent_id][] = $item; 124 } 125 } 126 127 return static::$menu_items_by_parent; 128 } 129 130 public static function applyChildDataToItems($items_arr, $menu_id, $force_refresh = false) { 131 132 $updated_items = []; 133 134 self::confirmValidMenuID($menu_id); 135 136 $menu_items_by_parent = static::getMenuItemsByParent($menu_id, $force_refresh); 137 138 $updated_items = array_map( 139 function($menu_item) use ($menu_items_by_parent, $menu_id) { 140 $item_id = (is_object($menu_item)) ? $menu_item->ID : $menu_item['ID']; 141 142 // Determine the number of children efficiently using our cache 143 $children_count = isset($menu_items_by_parent[$menu_id][$item_id]) 144 ? count($menu_items_by_parent[$menu_id][$item_id]) 145 : 0; 146 147 // Store the result in the object or array 148 if (is_object($menu_item)) { 149 $menu_item->has_fetchable_children = $children_count; 150 } 151 else { 152 $menu_item['has_fetchable_children'] = $children_count; 153 } 154 155 return $menu_item; 156 }, 157 $items_arr 158 ); 159 160 return $updated_items; 161 162 } 163 164 public static function applyChildDataToItem($menu_item, $menu_id, $force_refresh = false) { 165 166 self::confirmValidMenuItem($menu_item); 167 self::confirmValidMenuID($menu_id); 168 169 $menu_items_by_parent = static::getMenuItemsByParent($menu_id, $force_refresh); 170 171 $item_id = (is_object($menu_item)) ? $menu_item->ID : $menu_item['ID']; 172 173 $children_count = isset($menu_items_by_parent[$menu_id][$item_id]) 174 ? count($menu_items_by_parent[$menu_id][$item_id]) 175 : 0; 176 177 // Store the result in the object or array 178 if (is_object($menu_item)) { 179 $menu_item->has_fetchable_children = $children_count; 180 } 181 else { 182 $menu_item['has_fetchable_children'] = $children_count; 183 } 184 185 return $menu_item; 186 } 187 188 public static function applyChildDataToItemFromDb($menu_item, $menu_id = null) { 95 189 96 190 if ($menu_id !== null) { -
menu-manager-ultra/trunk/src/lib/MenuItems/ArrayOperations.php
r2878581 r3261172 95 95 } 96 96 97 // public static function items_recalculate_depths_by_unique_id($items_arr) { 98 99 // return array_map( 100 // function ($item) use ($items_arr) { 101 // $item['depth'] = self::item_determine_depth($items_arr, $item, Constants::FIELD_KEY_MMU_UNIQUE_ID); 102 // return $item; 103 // } 104 // , $items_arr 105 // ); 106 107 // } 108 97 109 public static function items_recalculate_depths($items_arr) { 98 110 … … 107 119 } 108 120 109 public static function item_determine_depth($items_arr, $item ) {121 public static function item_determine_depth($items_arr, $item, $id_field = null) { 110 122 111 123 $depth = 0; 124 125 if (!$id_field) { 126 $id_field = constant('MMU_FIELD_KEY_ID'); 127 } 112 128 113 129 if (!empty($item['menu_item_parent'])) { 114 130 115 $parent_index = \MenuManagerUltra\util\flat_tree\find_item_index_by_id ($items_arr, $item['menu_item_parent']);131 $parent_index = \MenuManagerUltra\util\flat_tree\find_item_index_by_id_field($items_arr, $item['menu_item_parent'], $id_field); 116 132 117 133 if ($parent_index > -1) { 118 134 $parent_item = $items_arr[$parent_index]; 119 $depth = self::item_determine_depth($items_arr, $parent_item ) + 1;135 $depth = self::item_determine_depth($items_arr, $parent_item, $id_field) + 1; 120 136 } 121 137 -
menu-manager-ultra/trunk/src/script/components/SaveBar.js
r3245090 r3261172 60 60 61 61 try { 62 63 const maxBatches = 1000; 64 const updatedItems = []; 65 66 let continueBatch = true; 67 let batchCount = 1; 68 let lastItemId = null; 69 let saveResult = {}; 70 62 71 store.setIsSaving(true); 63 72 setMessage('Preparing to Save...'); 64 73 setShowMessage(true); 65 74 66 const maxBatches = 1000;67 75 const revisionResult = await MenuItemService.prepareRevisionForSave(store.menuID, store.menuItems); 68 const updatedItems = []; 76 77 setMessage("Processing Deletions..."); 69 78 79 const deletionResult = await MenuItemService.processDeletions(store.menuID, revisionResult.revision_id); 80 70 81 setMessage("Saving..."); 71 72 let continueBatch = true; 73 let batchCount = 1; 74 let lastItemId = null; 75 let saveResult = {}; 76 82 77 83 // 78 84 // If the save process takes too long, it will return with a lastItemID so … … 82 88 while (continueBatch) { 83 89 84 saveResult = await MenuItemService.saveItemRevision(store.menuID, revisionResult.revision_id, lastItemId);90 saveResult = await MenuItemService.saveItemRevision(store.menuID, deletionResult.revision_id, lastItemId); 85 91 86 92 if (saveResult.items) { -
menu-manager-ultra/trunk/src/script/services/MenuItemService.js
r3245090 r3261172 68 68 69 69 if (!menuID) { 70 throw new Error("Missing MenuID in SaveItem s");70 throw new Error("Missing MenuID in SaveItemRevision"); 71 71 } 72 72 … … 90 90 91 91 }, 92 processDeletions: async (menuID, revisionID) => { 93 94 if (!menuID) { 95 throw new Error("Missing MenuID in processDeletions"); 96 } 97 98 if (!revisionID) { 99 throw new Error("Missing revisionID in processDeletions"); 100 } 101 102 const result = await apiFetch( 103 { 104 path: `${AppConfig.endpointBaseUrl}/menu/process-deletions`, 105 method: 'POST', 106 data: { 107 'menu_id': menuID, 108 'revision_id': revisionID 109 } 110 } 111 ).catch((err) => { 112 ServiceErrorHandler.handleError(err, { debug_category: DEBUG_CATEGORY }); 113 }); 114 115 ServiceErrorHandler.assertSuccess(result); 116 117 return result; 118 119 }, 92 120 saveItems: async (menuID, menuItems) => { 93 121 -
menu-manager-ultra/trunk/src/util/menu-manager-array-utils.php
r2878581 r3261172 84 84 } 85 85 86 function find_item_index_by_id($items_arr, $item_id) { 87 return find_item_index_by_id_field($items_arr, $item_id, constant('MMU_FIELD_KEY_ID')); 88 } 89 86 90 /** 87 91 * Find a particular item by its ID column … … 90 94 * @param string $item_id 91 95 */ 92 function find_item_index_by_id ($items_arr, $item_id) {96 function find_item_index_by_id_field($items_arr, $item_id, $id_key = "ID") { 93 97 94 98 /** … … 101 105 102 106 $index = 0; 103 $id_key = constant('MMU_FIELD_KEY_ID'); 104 107 105 108 foreach($items_arr as $item) { 106 109 if (isset($item[$id_key]) && $item[$id_key] == $item_id) { -
menu-manager-ultra/trunk/vendor/composer/installed.php
r3245097 r3261172 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 81411d237fa9ff66b79f697bfd3fe18870949386',6 'reference' => 'aaf444681e92abb8153f5047654c77a322247223', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 81411d237fa9ff66b79f697bfd3fe18870949386',16 'reference' => 'aaf444681e92abb8153f5047654c77a322247223', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.