shieldcortex 3.4.17 → 3.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -1
- package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.rsc +3 -3
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/page/react-loadable-manifest.json +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_3051539d._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/404.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/1149b3b44ee773af.css +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/1f5ebabd3b48455f.js +9 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/35cfd40af157bddc.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{39e59c45c12073c2.js → 6f1b8d7e07019f5f.js} +18 -18
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/c8f1a389f6fb4d08.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{1c4b5a3cb7ba11e1.js → ec55aacd8af83909.js} +1 -1
- package/package.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/1a1ee75bed920f98.css +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/387d3a3f012bcb7c.js +0 -9
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/4f54cadaf07fdfca.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/9232a2d99b47b21f.js +0 -3
- /package/dashboard/.next/standalone/dashboard/.next/static/{moz3LdUJ_jb-HMBpzm5Tr → w5g2QLCHvT4o8-6fmh6hX}/_buildManifest.js +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{moz3LdUJ_jb-HMBpzm5Tr → w5g2QLCHvT4o8-6fmh6hX}/_clientMiddlewareManifest.json +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{moz3LdUJ_jb-HMBpzm5Tr → w5g2QLCHvT4o8-6fmh6hX}/_ssgManifest.js +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16813,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isUnsafeProperty=function(e){return"__proto__"===e}},76906,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isDeepKey=function(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}},25483,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.toKey=function(e){return"string"==typeof e||"symbol"==typeof e?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}},41181,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.toString=function e(t){if(null==t)return"";if("string"==typeof t)return t;if(Array.isArray(t))return t.map(e).join(",");let r=String(t);return"0"===r&&Object.is(Number(t),-0)?"-0":r}},2209,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(41181),i=e.r(25483);r.toPath=function(e){if(Array.isArray(e))return e.map(i.toKey);if("symbol"==typeof e)return[e];e=n.toString(e);let t=[],r=e.length;if(0===r)return t;let a=0,s="",o="",l=!1;for(46===e.charCodeAt(0)&&(t.push(""),a++);a<r;){let n=e[a];o?"\\"===n&&a+1<r?s+=e[++a]:n===o?o="":s+=n:l?'"'===n||"'"===n?o=n:"]"===n?(l=!1,t.push(s),s=""):s+=n:"["===n?(l=!0,s&&(t.push(s),s="")):"."===n?s&&(t.push(s),s=""):s+=n,a++}return s&&t.push(s),t}},350,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(16813),i=e.r(76906),a=e.r(25483),s=e.r(2209);r.get=function e(t,r,o){if(null==t)return o;switch(typeof r){case"string":{if(n.isUnsafeProperty(r))return o;let a=t[r];if(void 0===a)if(i.isDeepKey(r))return e(t,s.toPath(r),o);else return o;return a}case"number":case"symbol":{"number"==typeof r&&(r=a.toKey(r));let e=t[r];if(void 0===e)return o;return e}default:{if(Array.isArray(r)){var l=t,c=r,u=o;if(0===c.length)return u;let e=l;for(let t=0;t<c.length;t++){if(null==e||n.isUnsafeProperty(c[t]))return u;e=e[c[t]]}return void 0===e?u:e}if(r=Object.is(r?.valueOf(),-0)?"-0":String(r),n.isUnsafeProperty(r))return o;let e=t[r];if(void 0===e)return o;return e}}}},78712,(e,t,r)=>{t.exports=e.r(350).get},72735,(e,t,r)=>{"use strict";var n=e.r(4),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=n.useSyncExternalStore,s=n.useRef,o=n.useEffect,l=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,u){var d=s(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;var p=a(e,(d=l(function(){function e(e){if(!o){if(o=!0,a=e,e=n(e),void 0!==u&&h.hasValue){var t=h.value;if(u(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var r=n(e);return void 0!==u&&u(t,r)?(a=e,t):(a=e,s=r)}var a,s,o=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,u]))[0],d[1]);return o(function(){h.hasValue=!0,h.value=p},[p]),c(p),p}},8710,(e,t,r)=>{"use strict";t.exports=e.r(72735)},39413,(e,t,r)=>{"use strict";function n(e){return"symbol"==typeof e?1:null===e?2:void 0===e?3:4*(e!=e)}Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.compareValues=(e,t,r)=>{if(e!==t){let i=n(e),a=n(t);if(i===a&&0===i){if(e<t)return"desc"===r?1:-1;if(e>t)return"desc"===r?-1:1}return"desc"===r?a-i:i-a}return 0}},34649,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isSymbol=function(e){return"symbol"==typeof e||e instanceof Symbol}},35462,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(34649),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;r.isKey=function(e,t){return!Array.isArray(e)&&(!!("number"==typeof e||"boolean"==typeof e||null==e||n.isSymbol(e))||"string"==typeof e&&(a.test(e)||!i.test(e))||null!=t&&Object.hasOwn(t,e))}},83230,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(39413),i=e.r(35462),a=e.r(2209);r.orderBy=function(e,t,r,s){if(null==e)return[];r=s?void 0:r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=null==t?[null]:[t]),0===t.length&&(t=[null]),Array.isArray(r)||(r=null==r?[]:[r]),r=r.map(e=>String(e));let o=(e,t)=>{let r=e;for(let e=0;e<t.length&&null!=r;++e)r=r[t[e]];return r},l=t.map(e=>(Array.isArray(e)&&1===e.length&&(e=e[0]),null==e||"function"==typeof e||Array.isArray(e)||i.isKey(e))?e:{key:e,path:a.toPath(e)});return e.map(e=>({original:e,criteria:l.map(t=>{var r,n;return r=t,null==(n=e)||null==r?n:"object"==typeof r&&"key"in r?Object.hasOwn(n,r.key)?n[r.key]:o(n,r.path):"function"==typeof r?r(n):Array.isArray(r)?o(n,r):"object"==typeof n?n[r]:n})})).slice().sort((e,t)=>{for(let i=0;i<l.length;i++){let a=n.compareValues(e.criteria[i],t.criteria[i],r[i]);if(0!==a)return a}return 0}).map(e=>e.original)}},9728,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.flatten=function(e,t=1){let r=[],n=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let s=e[a];Array.isArray(s)&&t<n?i(s,t+1):r.push(s)}};return i(e,0),r}},20272,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=/^(?:0|[1-9]\d*)$/;r.isIndex=function(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return n.test(e)}}},38308,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isLength=function(e){return Number.isSafeInteger(e)&&e>=0}},79087,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(38308);r.isArrayLike=function(e){return null!=e&&"function"!=typeof e&&n.isLength(e.length)}},38180,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isObject=function(e){return null!==e&&("object"==typeof e||"function"==typeof e)}},66480,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isEqualsSameValueZero=function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}},80682,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(20272),i=e.r(79087),a=e.r(38180),s=e.r(66480);r.isIterateeCall=function(e,t,r){return!!a.isObject(r)&&(!!("number"==typeof t&&i.isArrayLike(r)&&n.isIndex(t))&&t<r.length||"string"==typeof t&&t in r)&&s.isEqualsSameValueZero(r[t],e)}},33145,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(83230),i=e.r(9728),a=e.r(80682);r.sortBy=function(e,...t){let r=t.length;return r>1&&a.isIterateeCall(e,t[0],t[1])?t=[]:r>2&&a.isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),n.orderBy(e,i.flatten(t),["asc"])}},28914,(e,t,r)=>{t.exports=e.r(33145).sortBy},50314,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.debounce=function(e,t,{signal:r,edges:n}={}){let i,a=null,s=null!=n&&n.includes("leading"),o=null==n||n.includes("trailing"),l=()=>{null!==a&&(e.apply(i,a),i=void 0,a=null)},c=null,u=()=>{null!=c&&clearTimeout(c),c=setTimeout(()=>{c=null,o&&l(),d()},t)},d=()=>{null!==c&&(clearTimeout(c),c=null),i=void 0,a=null},h=function(...e){if(r?.aborted)return;i=this,a=e;let t=null==c;u(),s&&t&&l()};return h.schedule=u,h.cancel=d,h.flush=()=>{l()},r?.addEventListener("abort",d,{once:!0}),h}},71501,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(50314);r.debounce=function(e,t=0,r={}){let i;"object"!=typeof r&&(r={});let{leading:a=!1,trailing:s=!0,maxWait:o}=r,l=[,,];a&&(l[0]="leading"),s&&(l[1]="trailing");let c=null,u=n.debounce(function(...t){i=e.apply(this,t),c=null},t,{edges:l}),d=function(...t){return null!=o&&(null===c&&(c=Date.now()),Date.now()-c>=o)?(i=e.apply(this,t),c=Date.now(),u.cancel(),u.schedule(),i):(u.apply(this,t),i)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),i),d}},57443,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(71501);r.throttle=function(e,t=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return n.debounce(e,t,{leading:i,maxWait:t,trailing:a})}},15325,(e,t,r)=>{t.exports=e.r(57443).throttle},82249,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(34649);r.toNumber=function(e){return n.isSymbol(e)?NaN:Number(e)}},94881,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(82249);r.toFinite=function(e){return e?(e=n.toNumber(e))===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e==e?e:0:0===e?e:0}},63243,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(80682),i=e.r(94881);r.range=function(e,t,r){r&&"number"!=typeof r&&n.isIterateeCall(e,t,r)&&(t=r=void 0),e=i.toFinite(e),void 0===t?(t=e,e=0):t=i.toFinite(t),r=void 0===r?e<t?1:-1:i.toFinite(r);let a=Math.max(Math.ceil((t-e)/(r||1)),0),s=Array(a);for(let t=0;t<a;t++)s[t]=e,e+=r;return s}},56558,(e,t,r)=>{t.exports=e.r(63243).range},73335,(e,t,r)=>{!function(r){"use strict";var n,i={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},a=!0,s="[DecimalError] ",o=s+"Invalid argument: ",l=s+"Exponent out of range: ",c=Math.floor,u=Math.pow,d=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=c(1286742750677284.5),p={};function m(e,t){var r,n,i,s,o,l,c,u,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),a?k(t,h):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i){for(s<0?(n=c,s=-s,l=u.length):(n=u,i=o,l=c.length),s>(l=(o=Math.ceil(h/7))>l?o+1:l+1)&&(s=l,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for((l=c.length)-(s=u.length)<0&&(s=l,n=u,u=c,c=n),r=0;s;)r=(c[--s]=c[s]+u[s]+r)/1e7|0,c[s]%=1e7;for(r&&(c.unshift(r),++i),l=c.length;0==c[--l];)c.pop();return t.d=c,t.e=i,a?k(t,h):t}function f(e,t,r){if(e!==~~e||e<t||e>r)throw Error(o+e)}function x(e){var t,r,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(a+=j(r)),a+=n;(r=7-(n=(s=e[t])+"").length)&&(a+=j(r))}else if(0===s)return"0";for(;s%10==0;)s/=10;return a+s}p.absoluteValue=p.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},p.comparedTo=p.cmp=function(e){var t,r,n,i;if(e=new this.constructor(e),this.s!==e.s)return this.s||-e.s;if(this.e!==e.e)return this.e>e.e^this.s<0?1:-1;for(t=0,r=(n=this.d.length)<(i=e.d.length)?n:i;t<r;++t)if(this.d[t]!==e.d[t])return this.d[t]>e.d[t]^this.s<0?1:-1;return n===i?0:n>i^this.s<0?1:-1},p.decimalPlaces=p.dp=function(){var e=this.d.length-1,t=(e-this.e)*7;if(e=this.d[e])for(;e%10==0;e/=10)t--;return t<0?0:t},p.dividedBy=p.div=function(e){return y(this,new this.constructor(e))},p.dividedToIntegerBy=p.idiv=function(e){var t=this.constructor;return k(y(this,new t(e),0,1),t.precision)},p.equals=p.eq=function(e){return!this.cmp(e)},p.exponent=function(){return v(this)},p.greaterThan=p.gt=function(e){return this.cmp(e)>0},p.greaterThanOrEqualTo=p.gte=function(e){return this.cmp(e)>=0},p.isInteger=p.isint=function(){return this.e>this.d.length-2},p.isNegative=p.isneg=function(){return this.s<0},p.isPositive=p.ispos=function(){return this.s>0},p.isZero=function(){return 0===this.s},p.lessThan=p.lt=function(e){return 0>this.cmp(e)},p.lessThanOrEqualTo=p.lte=function(e){return 1>this.cmp(e)},p.logarithm=p.log=function(e){var t,r=this.constructor,i=r.precision,o=i+5;if(void 0===e)e=new r(10);else if((e=new r(e)).s<1||e.eq(n))throw Error(s+"NaN");if(this.s<1)throw Error(s+(this.s?"NaN":"-Infinity"));return this.eq(n)?new r(0):(a=!1,t=y(w(this,o),w(e,o),o),a=!0,k(t,i))},p.minus=p.sub=function(e){return e=new this.constructor(e),this.s==e.s?S(this,e):m(this,(e.s=-e.s,e))},p.modulo=p.mod=function(e){var t,r=this.constructor,n=r.precision;if(!(e=new r(e)).s)throw Error(s+"NaN");return this.s?(a=!1,t=y(this,e,0,1).times(e),a=!0,this.minus(t)):k(new r(this),n)},p.naturalExponential=p.exp=function(){return g(this)},p.naturalLogarithm=p.ln=function(){return w(this)},p.negated=p.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},p.plus=p.add=function(e){return e=new this.constructor(e),this.s==e.s?m(this,e):S(this,(e.s=-e.s,e))},p.precision=p.sd=function(e){var t,r,n;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(o+e);if(t=v(this)+1,r=7*(n=this.d.length-1)+1,n=this.d[n]){for(;n%10==0;n/=10)r--;for(n=this.d[0];n>=10;n/=10)r++}return e&&t>r?t:r},p.squareRoot=p.sqrt=function(){var e,t,r,n,i,o,l,u=this.constructor;if(this.s<1){if(!this.s)return new u(0);throw Error(s+"NaN")}for(e=v(this),a=!1,0==(i=Math.sqrt(+this))||i==1/0?(((t=x(this.d)).length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),n=new u(t=i==1/0?"5e"+e:(t=i.toExponential()).slice(0,t.indexOf("e")+1)+e)):n=new u(i.toString()),i=l=(r=u.precision)+3;;)if(n=(o=n).plus(y(this,o,l+2)).times(.5),x(o.d).slice(0,l)===(t=x(n.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&"4999"==t){if(k(o,r+1,0),o.times(o).eq(this)){n=o;break}}else if("9999"!=t)break;l+=4}return a=!0,k(n,r)},p.times=p.mul=function(e){var t,r,n,i,s,o,l,c,u,d=this.constructor,h=this.d,p=(e=new d(e)).d;if(!this.s||!e.s)return new d(0);for(e.s*=this.s,r=this.e+e.e,(c=h.length)<(u=p.length)&&(s=h,h=p,p=s,o=c,c=u,u=o),s=[],n=o=c+u;n--;)s.push(0);for(n=u;--n>=0;){for(t=0,i=c+n;i>n;)l=s[i]+p[n]*h[i-n-1]+t,s[i--]=l%1e7|0,t=l/1e7|0;s[i]=(s[i]+t)%1e7|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,a?k(e,d.precision):e},p.toDecimalPlaces=p.todp=function(e,t){var r=this,n=r.constructor;return(r=new n(r),void 0===e)?r:(f(e,0,1e9),void 0===t?t=n.rounding:f(t,0,8),k(r,e+v(r)+1,t))},p.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=O(n,!0):(f(e,0,1e9),void 0===t?t=i.rounding:f(t,0,8),r=O(n=k(new i(n),e+1,t),!0,e+1)),r},p.toFixed=function(e,t){var r,n,i=this.constructor;return void 0===e?O(this):(f(e,0,1e9),void 0===t?t=i.rounding:f(t,0,8),r=O((n=k(new i(this),e+v(this)+1,t)).abs(),!1,e+v(n)+1),this.isneg()&&!this.isZero()?"-"+r:r)},p.toInteger=p.toint=function(){var e=this.constructor;return k(new e(this),v(this)+1,e.rounding)},p.toNumber=function(){return+this},p.toPower=p.pow=function(e){var t,r,i,o,l,u,d=this,h=d.constructor,p=+(e=new h(e));if(!e.s)return new h(n);if(!(d=new h(d)).s){if(e.s<1)throw Error(s+"Infinity");return d}if(d.eq(n))return d;if(i=h.precision,e.eq(n))return k(d,i);if(u=(t=e.e)>=(r=e.d.length-1),l=d.s,u){if((r=p<0?-p:p)<=0x1fffffffffffff){for(o=new h(n),t=Math.ceil(i/7+4),a=!1;r%2&&P((o=o.times(d)).d,t),0!==(r=c(r/2));)P((d=d.times(d)).d,t);return a=!0,e.s<0?new h(n).div(o):k(o,i)}}else if(l<0)throw Error(s+"NaN");return l=l<0&&1&e.d[Math.max(t,r)]?-1:1,d.s=1,a=!1,o=e.times(w(d,i+12)),a=!0,(o=g(o)).s=l,o},p.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return void 0===e?(r=v(i),n=O(i,r<=a.toExpNeg||r>=a.toExpPos)):(f(e,1,1e9),void 0===t?t=a.rounding:f(t,0,8),r=v(i=k(new a(i),e,t)),n=O(i,e<=r||r<=a.toExpNeg,e)),n},p.toSignificantDigits=p.tosd=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(f(e,1,1e9),void 0===t?t=r.rounding:f(t,0,8)),k(new r(this),e,t)},p.toString=p.valueOf=p.val=p.toJSON=function(){var e=v(this),t=this.constructor;return O(this,e<=t.toExpNeg||e>=t.toExpPos)};var y=function(){function e(e,t){var r,n=0,i=e.length;for(e=e.slice();i--;)r=e[i]*t+n,e[i]=r%1e7|0,n=r/1e7|0;return n&&e.unshift(n),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r){for(var n=0;r--;)e[r]-=n,n=+(e[r]<t[r]),e[r]=1e7*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,a,o){var l,c,u,d,h,p,m,f,x,y,g,b,j,w,N,S,O,P,C=n.constructor,A=n.s==i.s?1:-1,E=n.d,M=i.d;if(!n.s)return new C(n);if(!i.s)throw Error(s+"Division by zero");for(u=0,c=n.e-i.e,O=M.length,N=E.length,f=(m=new C(A)).d=[];M[u]==(E[u]||0);)++u;if(M[u]>(E[u]||0)&&--c,(b=null==a?a=C.precision:o?a+(v(n)-v(i))+1:a)<0)return new C(0);if(b=b/7+2|0,u=0,1==O)for(d=0,M=M[0],b++;(u<N||d)&&b--;u++)j=1e7*d+(E[u]||0),f[u]=j/M|0,d=j%M|0;else{for((d=1e7/(M[0]+1)|0)>1&&(M=e(M,d),E=e(E,d),O=M.length,N=E.length),w=O,y=(x=E.slice(0,O)).length;y<O;)x[y++]=0;(P=M.slice()).unshift(0),S=M[0],M[1]>=1e7/2&&++S;do d=0,(l=t(M,x,O,y))<0?(g=x[0],O!=y&&(g=1e7*g+(x[1]||0)),(d=g/S|0)>1?(d>=1e7&&(d=1e7-1),p=(h=e(M,d)).length,y=x.length,1==(l=t(h,x,p,y))&&(d--,r(h,O<p?P:M,p))):(0==d&&(l=d=1),h=M.slice()),(p=h.length)<y&&h.unshift(0),r(x,h,y),-1==l&&(y=x.length,(l=t(M,x,O,y))<1&&(d++,r(x,O<y?P:M,y))),y=x.length):0===l&&(d++,x=[0]),f[u++]=d,l&&x[0]?x[y++]=E[w]||0:(x=[E[w]],y=1);while((w++<N||void 0!==x[0])&&b--)}return f[0]||f.shift(),m.e=c,k(m,o?a+v(m)+1:a)}}();function g(e,t){var r,i,s,o,c,d=0,h=0,p=e.constructor,m=p.precision;if(v(e)>16)throw Error(l+v(e));if(!e.s)return new p(n);for(null==t?(a=!1,c=m):c=t,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),h+=5;for(c+=Math.log(u(2,h))/Math.LN10*2+5|0,r=i=s=new p(n),p.precision=c;;){if(i=k(i.times(e),c),r=r.times(++d),x((o=s.plus(y(i,r,c))).d).slice(0,c)===x(s.d).slice(0,c)){for(;h--;)s=k(s.times(s),c);return p.precision=m,null==t?(a=!0,k(s,m)):s}s=o}}function v(e){for(var t=7*e.e,r=e.d[0];r>=10;r/=10)t++;return t}function b(e,t,r){if(t>e.LN10.sd())throw a=!0,r&&(e.precision=r),Error(s+"LN10 precision limit exceeded");return k(new e(e.LN10),t)}function j(e){for(var t="";e--;)t+="0";return t}function w(e,t){var r,i,o,l,c,u,d,h,p,m=1,f=e,g=f.d,j=f.constructor,N=j.precision;if(f.s<1)throw Error(s+(f.s?"NaN":"-Infinity"));if(f.eq(n))return new j(0);if(null==t?(a=!1,h=N):h=t,f.eq(10))return null==t&&(a=!0),b(j,h);if(j.precision=h+=10,i=(r=x(g)).charAt(0),!(15e14>Math.abs(l=v(f))))return d=b(j,h+2,N).times(l+""),f=w(new j(i+"."+r.slice(1)),h-10).plus(d),j.precision=N,null==t?(a=!0,k(f,N)):f;for(;i<7&&1!=i||1==i&&r.charAt(1)>3;)i=(r=x((f=f.times(e)).d)).charAt(0),m++;for(l=v(f),i>1?(f=new j("0."+r),l++):f=new j(i+"."+r.slice(1)),u=c=f=y(f.minus(n),f.plus(n),h),p=k(f.times(f),h),o=3;;){if(c=k(c.times(p),h),x((d=u.plus(y(c,new j(o),h))).d).slice(0,h)===x(u.d).slice(0,h))return u=u.times(2),0!==l&&(u=u.plus(b(j,h+2,N).times(l+""))),u=y(u,new j(m),h),j.precision=N,null==t?(a=!0,k(u,N)):u;u=d,o+=2}}function N(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);)++n;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(n,i)){if(i-=n,e.e=c((r=r-n-1)/7),e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),a&&(e.e>h||e.e<-h))throw Error(l+r)}else e.s=0,e.e=0,e.d=[0];return e}function k(e,t,r){var n,i,s,o,d,p,m,f,x=e.d;for(o=1,s=x[0];s>=10;s/=10)o++;if((n=t-o)<0)n+=7,i=t,m=x[f=0];else{if((f=Math.ceil((n+1)/7))>=(s=x.length))return e;for(o=1,m=s=x[f];s>=10;s/=10)o++;n%=7,i=n-7+o}if(void 0!==r&&(d=m/(s=u(10,o-i-1))%10|0,p=t<0||void 0!==x[f+1]||m%s,p=r<4?(d||p)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||p||6==r&&(n>0?i>0?m/u(10,o-i):0:x[f-1])%10&1||r==(e.s<0?8:7))),t<1||!x[0])return p?(s=v(e),x.length=1,t=t-s-1,x[0]=u(10,(7-t%7)%7),e.e=c(-t/7)||0):(x.length=1,x[0]=e.e=e.s=0),e;if(0==n?(x.length=f,s=1,f--):(x.length=f+1,s=u(10,7-n),x[f]=i>0?(m/u(10,o-i)%u(10,i)|0)*s:0),p)for(;;)if(0==f){1e7==(x[0]+=s)&&(x[0]=1,++e.e);break}else{if(x[f]+=s,1e7!=x[f])break;x[f--]=0,s=1}for(n=x.length;0===x[--n];)x.pop();if(a&&(e.e>h||e.e<-h))throw Error(l+v(e));return e}function S(e,t){var r,n,i,s,o,l,c,u,d,h,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),a?k(t,m):t;if(c=e.d,h=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n){for((d=o<0)?(r=c,o=-o,l=h.length):(r=h,n=u,l=c.length),o>(i=Math.max(Math.ceil(m/7),l)+2)&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for((d=(i=c.length)<(l=h.length))&&(l=i),i=0;i<l;i++)if(c[i]!=h[i]){d=c[i]<h[i];break}o=0}for(d&&(r=c,c=h,h=r,t.s=-t.s),l=c.length,i=h.length-l;i>0;--i)c[l++]=0;for(i=h.length;i>o;){if(c[--i]<h[i]){for(s=i;s&&0===c[--s];)c[s]=1e7-1;--c[s],c[i]+=1e7}c[i]-=h[i]}for(;0===c[--l];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(t.d=c,t.e=n,a?k(t,m):t):new p(0)}function O(e,t,r){var n,i=v(e),a=x(e.d),s=a.length;return t?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+j(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+j(-i-1)+a,r&&(n=r-s)>0&&(a+=j(n))):i>=s?(a+=j(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+j(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=j(n))),e.s<0?"-"+a:a}function P(e,t){if(e.length>t)return e.length=t,!0}function C(e){if(!e||"object"!=typeof e)throw Error(s+"Object expected");var t,r,n,i=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if(void 0!==(n=e[r=i[t]]))if(c(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(o+r+": "+n);if(void 0!==(n=e[r="LN10"]))if(n==Math.LN10)this[r]=new this(n);else throw Error(o+r+": "+n);return this}if((i=function e(t){var r,n,i;function a(e){if(!(this instanceof a))return new a(e);if(this.constructor=a,e instanceof a){this.s=e.s,this.e=e.e,this.d=(e=e.d)?e.slice():e;return}if("number"==typeof e){if(0*e!=0)throw Error(o+e);if(e>0)this.s=1;else if(e<0)e=-e,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(e===~~e&&e<1e7){this.e=0,this.d=[e];return}return N(this,e.toString())}if("string"!=typeof e)throw Error(o+e);if(45===e.charCodeAt(0)?(e=e.slice(1),this.s=-1):this.s=1,d.test(e))N(this,e);else throw Error(o+e)}if(a.prototype=p,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=e,a.config=a.set=C,void 0===t&&(t={}),t)for(r=0,i=["precision","rounding","toExpNeg","toExpPos","LN10"];r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return a.config(t),a}(i)).default=i.Decimal=i,n=new i(1),"function"==typeof define&&define.amd){let t;e.r,void 0!==(t=i)&&e.v(t)}else t.exports?t.exports=i:(r||(r="u">typeof self&&self&&self.self==self?self:Function("return this")()),r.Decimal=i)}(e.e)},236,(e,t,r)=>{"use strict";var n=Object.prototype.hasOwnProperty,i="~";function a(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,r,n,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new s(r,n||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new a:delete e._events[t]}function c(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,s=Array(a);n<a;n++)s[n]=r[n].fn;return s},c.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,n,a,s){var o=i?i+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,a),!0;case 6:return u.fn.call(u.context,t,r,n,a,s),!0}for(c=1,l=Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,n);break;default:if(!l)for(h=1,l=Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},c.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},c.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},c.prototype.removeListener=function(e,t,r,n){var a=i?i+e:e;if(!this._events[a])return this;if(!t)return l(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||l(this,a);else{for(var o=0,c=[],u=s.length;o<u;o++)(s[o].fn!==t||n&&!s[o].once||r&&s[o].context!==r)&&c.push(s[o]);c.length?this._events[a]=1===c.length?c[0]:c:l(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&l(this,t)):(this._events=new a,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},5006,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.last=function(e){return e[e.length-1]}},1743,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.toArray=function(e){return Array.isArray(e)?e:Array.from(e)}},15967,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(5006),i=e.r(1743),a=e.r(79087);r.last=function(e){if(a.isArrayLike(e))return n.last(i.toArray(e))}},9944,(e,t,r)=>{t.exports=e.r(15967).last},53919,(e,t,r)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,m=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,x=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,j=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case d:case h:case s:case l:case o:case m:return e;default:switch(e=e&&e.$$typeof){case u:case p:case y:case x:case c:return e;default:return t}}case a:return t}}}function N(e){return w(e)===h}r.AsyncMode=d,r.ConcurrentMode=h,r.ContextConsumer=u,r.ContextProvider=c,r.Element=i,r.ForwardRef=p,r.Fragment=s,r.Lazy=y,r.Memo=x,r.Portal=a,r.Profiler=l,r.StrictMode=o,r.Suspense=m,r.isAsyncMode=function(e){return N(e)||w(e)===d},r.isConcurrentMode=N,r.isContextConsumer=function(e){return w(e)===u},r.isContextProvider=function(e){return w(e)===c},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},r.isForwardRef=function(e){return w(e)===p},r.isFragment=function(e){return w(e)===s},r.isLazy=function(e){return w(e)===y},r.isMemo=function(e){return w(e)===x},r.isPortal=function(e){return w(e)===a},r.isProfiler=function(e){return w(e)===l},r.isStrictMode=function(e){return w(e)===o},r.isSuspense=function(e){return w(e)===m},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===h||e===l||e===o||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===x||e.$$typeof===c||e.$$typeof===u||e.$$typeof===p||e.$$typeof===v||e.$$typeof===b||e.$$typeof===j||e.$$typeof===g)},r.typeOf=w},29095,(e,t,r)=>{"use strict";t.exports=e.r(53919)},8284,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isPlainObject=function(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){let t=e[Symbol.toStringTag];return null!=t&&!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}},91804,(e,t,r)=>{t.exports=e.r(8284).isPlainObject},96249,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.uniqBy=function(e,t){let r=new Map;for(let n=0;n<e.length;n++){let i=e[n],a=t(i,n,e);r.has(a)||r.set(a,i)}return Array.from(r.values())}},82503,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.ary=function(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}},48571,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.identity=function(e){return e}},97977,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isObjectLike=function(e){return"object"==typeof e&&null!==e}},64812,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(79087),i=e.r(97977);r.isArrayLikeObject=function(e){return i.isObjectLike(e)&&n.isArrayLike(e)}},91418,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(350);r.property=function(e){return function(t){return n.get(t,e)}}},38193,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isPrimitive=function(e){return null==e||"object"!=typeof e&&"function"!=typeof e}},27583,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(38180),i=e.r(38193),a=e.r(66480);function s(e,t,r,c){if(t===e)return!0;switch(typeof t){case"object":return function(e,t,r,n){if(null==t)return!0;if(Array.isArray(t))return o(e,t,r,n);if(t instanceof Map){var a=e,s=t,c=r,u=n;if(0===s.size)return!0;if(!(a instanceof Map))return!1;for(let[e,t]of s.entries())if(!1===c(a.get(e),t,e,a,s,u))return!1;return!0}if(t instanceof Set)return l(e,t,r,n);let d=Object.keys(t);if(null==e||i.isPrimitive(e))return 0===d.length;if(0===d.length)return!0;if(n?.has(t))return n.get(t)===e;n?.set(t,e);try{for(let a=0;a<d.length;a++){let s=d[a];if(!i.isPrimitive(e)&&!(s in e)||void 0===t[s]&&void 0!==e[s]||null===t[s]&&null!==e[s]||!r(e[s],t[s],s,e,t,n))return!1}return!0}finally{n?.delete(t)}}(e,t,r,c);case"function":if(Object.keys(t).length>0)return s(e,{...t},r,c);return a.isEqualsSameValueZero(e,t);default:if(!n.isObject(e))return a.isEqualsSameValueZero(e,t);if("string"==typeof t)return""===t;return!0}}function o(e,t,r,n){if(0===t.length)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let s=t[a],o=!1;for(let l=0;l<e.length;l++){if(i.has(l))continue;let c=e[l],u=!1;if(r(c,s,a,e,t,n)&&(u=!0),u){i.add(l),o=!0;break}}if(!o)return!1}return!0}function l(e,t,r,n){return 0===t.size||e instanceof Set&&o([...e],[...t],r,n)}r.isMatchWith=function e(t,r,n){return"function"!=typeof n?e(t,r,()=>void 0):s(t,r,function e(t,r,i,a,o,l){let c=n(t,r,i,a,o,l);return void 0!==c?!!c:s(t,r,e,l)},new Map)},r.isSetMatch=l},90943,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(27583);r.isMatch=function(e,t){return n.isMatchWith(e,t,()=>void 0)}},62005,(e,t,r)=>{var n={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=l(e),s=a[0],o=a[1],c=new i((s+o)*3/4-o),u=0,d=o>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=0,o=n-i;s<o;s+=16383)a.push(function(e,t,n){for(var i,a=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,s,s+16383>o?o:s+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},72:function(e,t,r){"use strict";var n=r(675),i=r(783),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);var a=0|p(n,i),l=s(a),c=l.write(n,i);return c!==a&&(l=l.slice(0,c)),l}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return o.from(u,t,r);var m=function(e){if(o.isBuffer(e)){var t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(m)return m;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),s(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(c(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},o.allocUnsafe=function(e){return u(e)},o.allocUnsafeSlow=function(e){return u(e)};function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(e).length;default:if(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var i,a,s,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=E[e[a]];return i}(this,t,r);case"utf8":case"utf-8":return g(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,a=t,s=r,0===a&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(a,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function f(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){var a;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var a,s=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,o/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var u=-1;for(a=r;a<o;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*s}else -1!==u&&(a-=a-u),u=-1}else for(r+l>o&&(r=o-l),a=r;a>=0;a--){for(var d=!0,h=0;h<l;h++)if(c(e,a+h)!==c(t,h)){d=!1;break}if(d)return a}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(A(a,Uint8Array)&&(a=o.from(a)),!o.isBuffer(a))throw TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?g(this,0,e):m.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(o.prototype[a]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var a=i-n,s=r-t,l=Math.min(a,s),c=this.slice(n,i),u=e.slice(t,r),d=0;d<l;++d)if(c[d]!==u[d]){a=c[d],s=u[d];break}return a<s?-1:+(s<a)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return x(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return x(this,e,t,r,!1)};function g(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,o,l,c=e[i],u=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(u=c);break;case 2:(192&(a=e[i+1]))==128&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=e[i+1],s=e[i+2],(192&a)==128&&(192&s)==128&&(l=(15&c)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],(192&a)==128&&(192&s)==128&&(192&o)==128&&(l=(15&c)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=d}var h=n,p=h.length;if(p<=4096)return String.fromCharCode.apply(String,h);for(var m="",f=0;f<p;)m+=String.fromCharCode.apply(String,h.slice(f,f+=4096));return m}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function b(e,t,r,n,i,a){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function j(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function w(e,t,r,n,a){return t*=1,r>>>=0,a||j(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,a){return t*=1,r>>>=0,a||j(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,a,s,o,l,c,u,d,h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o,l=parseInt(t.substr(2*s,2),16);if((o=l)!=o)break;e[r+s]=l}return s}(this,e,t,r);case"utf8":case"utf-8":return i=t,a=r,C(S(e,this.length-i),this,i,a);case"ascii":return s=t,o=r,C(O(e),this,s,o);case"latin1":case"binary":return function(e,t,r,n){return C(O(t),e,r,n)}(this,e,t,r);case"base64":return l=t,c=r,C(P(e),this,l,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,d=r,C(function(e,t){for(var r,n,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i.push(r%256),i.push(n);return i}(e,this.length-u),this,u,d);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var a=1,s=0;for(this[t]=255&e;++s<r&&(a*=256);)this[t+s]=e/a&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var a=r-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<r&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return w(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var a=i-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=o.isBuffer(e)?e:o.from(e,n),l=s.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%l]}return this};var k=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function O(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function P(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var E=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},783:function(e,t){t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,l=(1<<o)-1,c=l>>1,u=-7,d=r?i-1:0,h=r?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-u)-1,p>>=-u,u+=o;u>0;a=256*a+e[t+d],d+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=c}return(p?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,l,c=8*a-i-1,u=(1<<c)-1,d=u>>1,h=5960464477539062e-23*(23===i),p=n?0:a-1,m=n?1:-1,f=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?t+=h/l:t+=h*Math.pow(2,1-d),t*l>=2&&(s++,l/=2),s+d>=u?(o=0,s=u):s+d>=1?(o=(t*l-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&o,p+=m,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;e[r+p]=255&s,p+=m,s/=256,c-=8);e[r+p-m]|=128*f}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},s=!0;try{n[e](r,r.exports,a),s=!1}finally{s&&delete i[e]}return r.exports}a.ab="/ROOT/dashboard/node_modules/next/dist/compiled/buffer/",t.exports=a(72)},17464,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.getSymbols=function(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}},3377,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.getTag=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}},75430,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.argumentsTag="[object Arguments]",r.arrayBufferTag="[object ArrayBuffer]",r.arrayTag="[object Array]",r.bigInt64ArrayTag="[object BigInt64Array]",r.bigUint64ArrayTag="[object BigUint64Array]",r.booleanTag="[object Boolean]",r.dataViewTag="[object DataView]",r.dateTag="[object Date]",r.errorTag="[object Error]",r.float32ArrayTag="[object Float32Array]",r.float64ArrayTag="[object Float64Array]",r.functionTag="[object Function]",r.int16ArrayTag="[object Int16Array]",r.int32ArrayTag="[object Int32Array]",r.int8ArrayTag="[object Int8Array]",r.mapTag="[object Map]",r.numberTag="[object Number]",r.objectTag="[object Object]",r.regexpTag="[object RegExp]",r.setTag="[object Set]",r.stringTag="[object String]",r.symbolTag="[object Symbol]",r.uint16ArrayTag="[object Uint16Array]",r.uint32ArrayTag="[object Uint32Array]",r.uint8ArrayTag="[object Uint8Array]",r.uint8ClampedArrayTag="[object Uint8ClampedArray]"},74513,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isTypedArray=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}},83673,(e,t,r)=>{"use strict";var n=e.i(62005);Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let i=e.r(17464),a=e.r(3377),s=e.r(75430),o=e.r(38193),l=e.r(74513);function c(e,t,r,i=new Map,d){let h=d?.(e,t,r,i);if(void 0!==h)return h;if(o.isPrimitive(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){let t=Array(e.length);i.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,r,i,d);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;for(let[n,a]of(i.set(e,t),e))t.set(n,c(a,n,r,i,d));return t}if(e instanceof Set){let t=new Set;for(let n of(i.set(e,t),e))t.add(c(n,void 0,r,i,d));return t}if(void 0!==n.Buffer&&n.Buffer.isBuffer(e))return e.subarray();if(l.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,r,i,d);return t}if(e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,t),u(t,e,r,i,d),t}if("u">typeof File&&e instanceof File){let t=new File([e],e.name,{type:e.type});return i.set(e,t),u(t,e,r,i,d),t}if("u">typeof Blob&&e instanceof Blob){let t=new Blob([e],{type:e.type});return i.set(e,t),u(t,e,r,i,d),t}if(e instanceof Error){let t=new e.constructor;return i.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,u(t,e,r,i,d),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return i.set(e,t),u(t,e,r,i,d),t}if(e instanceof Number){let t=new Number(e.valueOf());return i.set(e,t),u(t,e,r,i,d),t}if(e instanceof String){let t=new String(e.valueOf());return i.set(e,t),u(t,e,r,i,d),t}if("object"==typeof e&&function(e){switch(a.getTag(e)){case s.argumentsTag:case s.arrayTag:case s.arrayBufferTag:case s.dataViewTag:case s.booleanTag:case s.dateTag:case s.float32ArrayTag:case s.float64ArrayTag:case s.int8ArrayTag:case s.int16ArrayTag:case s.int32ArrayTag:case s.mapTag:case s.numberTag:case s.objectTag:case s.regexpTag:case s.setTag:case s.stringTag:case s.symbolTag:case s.uint8ArrayTag:case s.uint8ClampedArrayTag:case s.uint16ArrayTag:case s.uint32ArrayTag:return!0;default:return!1}}(e)){let t=Object.create(Object.getPrototypeOf(e));return i.set(e,t),u(t,e,r,i,d),t}return e}function u(e,t,r=e,n,a){let s=[...Object.keys(t),...i.getSymbols(t)];for(let i=0;i<s.length;i++){let o=s[i],l=Object.getOwnPropertyDescriptor(e,o);(null==l||l.writable)&&(e[o]=c(t[o],o,r,n,a))}}r.cloneDeepWith=function(e,t){return c(e,void 0,e,new Map,t)},r.cloneDeepWithImpl=c,r.copyProperties=u},48384,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(83673);r.cloneDeep=function(e){return n.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}},80955,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(90943),i=e.r(48384);r.matches=function(e){return e=i.cloneDeep(e),t=>n.isMatch(t,e)}},47115,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(83673),i=e.r(3377),a=e.r(75430);r.cloneDeepWith=function(e,t){return n.cloneDeepWith(e,(r,s,o,l)=>{let c=t?.(r,s,o,l);if(void 0!==c)return c;if("object"==typeof e){if(i.getTag(e)===a.objectTag&&"function"!=typeof e.constructor){let t={};return l.set(e,t),n.copyProperties(t,e,o,l),t}switch(Object.prototype.toString.call(e)){case a.numberTag:case a.stringTag:case a.booleanTag:{let t=new e.constructor(e?.valueOf());return n.copyProperties(t,e),t}case a.argumentsTag:{let t={};return n.copyProperties(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}},85610,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(47115);r.cloneDeep=function(e){return n.cloneDeepWith(e)}},59235,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(3377);r.isArguments=function(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===n.getTag(e)}},39635,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(76906),i=e.r(20272),a=e.r(59235),s=e.r(2209);r.has=function(e,t){let r;if(0===(r=Array.isArray(t)?t:"string"==typeof t&&n.isDeepKey(t)&&e?.[t]==null?s.toPath(t):[t]).length)return!1;let o=e;for(let e=0;e<r.length;e++){let t=r[e];if((null==o||!Object.hasOwn(o,t))&&!((Array.isArray(o)||a.isArguments(o))&&i.isIndex(t)&&t<o.length))return!1;o=o[t]}return!0}},93660,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(90943),i=e.r(25483),a=e.r(85610),s=e.r(350),o=e.r(39635);r.matchesProperty=function(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=i.toKey(e)}return t=a.cloneDeep(t),function(r){let i=s.get(r,e);return void 0===i?o.has(r,e):void 0===t?void 0===i:n.isMatch(i,t)}}},68077,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(48571),i=e.r(91418),a=e.r(80955),s=e.r(93660);r.iteratee=function(e){if(null==e)return n.identity;switch(typeof e){case"function":return e;case"object":if(Array.isArray(e)&&2===e.length)return s.matchesProperty(e[0],e[1]);return a.matches(e);case"string":case"symbol":case"number":return i.property(e)}}},38953,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(96249),i=e.r(82503),a=e.r(48571),s=e.r(64812),o=e.r(68077);r.uniqBy=function(e,t=a.identity){return s.isArrayLikeObject(e)?n.uniqBy(Array.from(e),i.ary(o.iteratee(t),1)):[]}},40559,(e,t,r)=>{t.exports=e.r(38953).uniqBy},23733,e=>{"use strict";let t,r,n,i,a,s,o,l;var c,u,d,h,p,m,f,x,y,g,v,b,j,w,N,k,S,O,P,C,A,E,M,T,_,D,I,L,z,R,F,$,B,U,q,V,K,W=e.i(27493),H=e.i(4),Y=e.i(22534);let Q=(0,H.createContext)({});function X(e){let t=(0,H.useRef)(null);return null===t.current&&(t.current=e()),t.current}let G="u">typeof window,Z=G?H.useLayoutEffect:H.useEffect,J=(0,H.createContext)(null);function ee(e){return"object"==typeof e&&null!==e}function et(e){return ee(e)&&"offsetHeight"in e}var er=H;let en=(0,H.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ei(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class ea extends er.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,r=et(e)&&e.offsetWidth||0,n=et(e)&&e.offsetHeight||0,i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft,i.right=r-i.width-i.left,i.bottom=n-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}}function es({children:e,isPresent:t,anchorX:r,anchorY:n,root:i}){let a=(0,er.useId)(),s=(0,er.useRef)(null),o=(0,er.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,er.useContext)(en),c=function(...e){return H.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=ei(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():ei(e[t],null)}}}}(...e),e)}(s,e.props?.ref??e?.ref);return(0,er.useInsertionEffect)(()=>{let{width:e,height:c,top:u,left:d,right:h,bottom:p}=o.current;if(t||!s.current||!e||!c)return;let m="left"===r?`left: ${d}`:`right: ${h}`,f="bottom"===n?`bottom: ${p}`:`top: ${u}`;s.current.dataset.motionPopId=a;let x=document.createElement("style");l&&(x.nonce=l);let y=i??document.head;return y.appendChild(x),x.sheet&&x.sheet.insertRule(`
|
|
2
|
-
[data-motion-pop-id="${a}"] {
|
|
3
|
-
position: absolute !important;
|
|
4
|
-
width: ${e}px !important;
|
|
5
|
-
height: ${c}px !important;
|
|
6
|
-
${m}px !important;
|
|
7
|
-
${f}px !important;
|
|
8
|
-
}
|
|
9
|
-
`),()=>{y.contains(x)&&y.removeChild(x)}},[t]),(0,W.jsx)(ea,{isPresent:t,childRef:s,sizeRef:o,children:er.cloneElement(e,{ref:c})})}let eo=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:s,anchorX:o,anchorY:l,root:c})=>{let u=X(el),d=(0,H.useId)(),h=!0,p=(0,H.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:r,custom:i,onExitComplete:e=>{for(let t of(u.set(e,!0),u.values()))if(!t)return;n&&n()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[r,u,n]);return a&&h&&(p={...p}),(0,H.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[r]),H.useEffect(()=>{r||u.size||!n||n()},[r]),"popLayout"===s&&(e=(0,W.jsx)(es,{isPresent:r,anchorX:o,anchorY:l,root:c,children:e})),(0,W.jsx)(J.Provider,{value:p,children:e})};function el(){return new Map}function ec(e=!0){let t=(0,H.useContext)(J);if(null===t)return[!0,null];let{isPresent:r,onExitComplete:n,register:i}=t,a=(0,H.useId)();(0,H.useEffect)(()=>{if(e)return i(a)},[e]);let s=(0,H.useCallback)(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,s]:[!0]}let eu=e=>e.key||"";function ed(e){let t=[];return H.Children.forEach(e,e=>{(0,H.isValidElement)(e)&&t.push(e)}),t}let eh=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1,anchorX:o="left",anchorY:l="top",root:c})=>{let[u,d]=ec(s),h=(0,H.useMemo)(()=>ed(e),[e]),p=s&&!u?[]:h.map(eu),m=(0,H.useRef)(!0),f=(0,H.useRef)(h),x=X(()=>new Map),y=(0,H.useRef)(new Set),[g,v]=(0,H.useState)(h),[b,j]=(0,H.useState)(h);Z(()=>{m.current=!1,f.current=h;for(let e=0;e<b.length;e++){let t=eu(b[e]);p.includes(t)?(x.delete(t),y.current.delete(t)):!0!==x.get(t)&&x.set(t,!1)}},[b,p.length,p.join("-")]);let w=[];if(h!==g){let e=[...h];for(let t=0;t<b.length;t++){let r=b[t],n=eu(r);p.includes(n)||(e.splice(t,0,r),w.push(r))}return"wait"===a&&w.length&&(e=w),j(ed(e)),v(h),null}let{forceRender:N}=(0,H.useContext)(Q);return(0,W.jsx)(W.Fragment,{children:b.map(e=>{let g=eu(e),v=(!s||!!u)&&(h===b||p.includes(g));return(0,W.jsx)(eo,{isPresent:v,initial:(!m.current||!!r)&&void 0,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:v?void 0:()=>{if(y.current.has(g)||(y.current.add(g),!x.has(g)))return;x.set(g,!0);let e=!0;x.forEach(t=>{t||(e=!1)}),e&&(N?.(),j(f.current),s&&d?.(),n&&n())},anchorX:o,anchorY:l,children:e},g)})})},ep=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],em=new Set(ep),ef=(e,t,r)=>r>t?t:r<e?e:r,ex={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ey={...ex,transform:e=>ef(0,1,e)},eg={...ex,default:1},ev=e=>Math.round(1e5*e)/1e5,eb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,ej=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ew=(e,t)=>r=>!!("string"==typeof r&&ej.test(r)&&r.startsWith(e)||t&&null!=r&&Object.prototype.hasOwnProperty.call(r,t)),eN=(e,t,r)=>n=>{if("string"!=typeof n)return n;let[i,a,s,o]=n.match(eb);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==o?parseFloat(o):1}},ek={...ex,transform:e=>Math.round(ef(0,255,e))},eS={test:ew("rgb","red"),parse:eN("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ek.transform(e)+", "+ek.transform(t)+", "+ek.transform(r)+", "+ev(ey.transform(n))+")"},eO={test:ew("#"),parse:function(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:eS.transform},eP=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),eC=eP("deg"),eA=eP("%"),eE=eP("px"),eM=eP("vh"),eT=eP("vw"),e_={...eA,parse:e=>eA.parse(e)/100,transform:e=>eA.transform(100*e)},eD={test:ew("hsl","hue"),parse:eN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+eA.transform(ev(t))+", "+eA.transform(ev(r))+", "+ev(ey.transform(n))+")"},eI={test:e=>eS.test(e)||eO.test(e)||eD.test(e),parse:e=>eS.test(e)?eS.parse(e):eD.test(e)?eD.parse(e):eO.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?eS.transform(e):eD.transform(e),getAnimatableNone:e=>{let t=eI.parse(e);return t.alpha=0,eI.transform(t)}},eL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ez="number",eR="color",eF=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function e$(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[],a=0,s=t.replace(eF,e=>(eI.test(e)?(n.color.push(a),i.push(eR),r.push(eI.parse(e))):e.startsWith("var(")?(n.var.push(a),i.push("var"),r.push(e)):(n.number.push(a),i.push(ez),r.push(parseFloat(e))),++a,"${}")).split("${}");return{values:r,split:s,indexes:n,types:i}}function eB(e){return e$(e).values}function eU(e){let{split:t,types:r}=e$(e),n=t.length;return e=>{let i="";for(let a=0;a<n;a++)if(i+=t[a],void 0!==e[a]){let t=r[a];t===ez?i+=ev(e[a]):t===eR?i+=eI.transform(e[a]):i+=e[a]}return i}}let eq=e=>"number"==typeof e?0:eI.test(e)?eI.getAnimatableNone(e):e,eV={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(eb)?.length||0)+(e.match(eL)?.length||0)>0},parse:eB,createTransformer:eU,getAnimatableNone:function(e){let t=eB(e);return eU(e)(t.map(eq))}},eK=new Set(["brightness","contrast","saturate","opacity"]);function eW(e){let[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[n]=r.match(eb)||[];if(!n)return e;let i=r.replace(n,""),a=+!!eK.has(t);return n!==r&&(a*=100),t+"("+a+i+")"}let eH=/\b([a-z-]*)\(.*?\)/gu,eY={...eV,getAnimatableNone:e=>{let t=e.match(eH);return t?t.map(eW).join(" "):e}},eQ={...ex,transform:Math.round},eX={borderWidth:eE,borderTopWidth:eE,borderRightWidth:eE,borderBottomWidth:eE,borderLeftWidth:eE,borderRadius:eE,borderTopLeftRadius:eE,borderTopRightRadius:eE,borderBottomRightRadius:eE,borderBottomLeftRadius:eE,width:eE,maxWidth:eE,height:eE,maxHeight:eE,top:eE,right:eE,bottom:eE,left:eE,inset:eE,insetBlock:eE,insetBlockStart:eE,insetBlockEnd:eE,insetInline:eE,insetInlineStart:eE,insetInlineEnd:eE,padding:eE,paddingTop:eE,paddingRight:eE,paddingBottom:eE,paddingLeft:eE,paddingBlock:eE,paddingBlockStart:eE,paddingBlockEnd:eE,paddingInline:eE,paddingInlineStart:eE,paddingInlineEnd:eE,margin:eE,marginTop:eE,marginRight:eE,marginBottom:eE,marginLeft:eE,marginBlock:eE,marginBlockStart:eE,marginBlockEnd:eE,marginInline:eE,marginInlineStart:eE,marginInlineEnd:eE,fontSize:eE,backgroundPositionX:eE,backgroundPositionY:eE,rotate:eC,rotateX:eC,rotateY:eC,rotateZ:eC,scale:eg,scaleX:eg,scaleY:eg,scaleZ:eg,skew:eC,skewX:eC,skewY:eC,distance:eE,translateX:eE,translateY:eE,translateZ:eE,x:eE,y:eE,z:eE,perspective:eE,transformPerspective:eE,opacity:ey,originX:e_,originY:e_,originZ:eE,zIndex:eQ,fillOpacity:ey,strokeOpacity:ey,numOctaves:eQ},eG={...eX,color:eI,backgroundColor:eI,outlineColor:eI,fill:eI,stroke:eI,borderColor:eI,borderTopColor:eI,borderRightColor:eI,borderBottomColor:eI,borderLeftColor:eI,filter:eY,WebkitFilter:eY},eZ=e=>eG[e],eJ=()=>({translate:0,scale:1,origin:0,originPoint:0}),e0=()=>({x:eJ(),y:eJ()}),e1=()=>({min:0,max:0}),e2=()=>({x:e1(),y:e1()}),e5=e=>!!(e&&e.getVelocity),e4=new Set(["width","height","top","left","right","bottom",...ep]),e3=e=>t=>t.test(e),e6=[ex,eE,eA,eC,eT,eM,{test:e=>"auto"===e,parse:e=>e}],e8=e=>e6.find(e3(e)),e7=()=>{},e9=()=>{};Y.default;let te=e=>t=>"string"==typeof t&&t.startsWith(e),tt=te("--"),tr=te("var(--"),tn=e=>!!tr(e)&&ti.test(e.split("/*")[0].trim()),ti=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ta(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}let ts=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,to=e=>180*e/Math.PI,tl=e=>tu(to(Math.atan2(e[1],e[0]))),tc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tl,rotateZ:tl,skewX:e=>to(Math.atan(e[1])),skewY:e=>to(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},tu=e=>((e%=360)<0&&(e+=360),e),td=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),th=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),tp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:td,scaleY:th,scale:e=>(td(e)+th(e))/2,rotateX:e=>tu(to(Math.atan2(e[6],e[5]))),rotateY:e=>tu(to(Math.atan2(-e[2],e[0]))),rotateZ:tl,rotate:tl,skewX:e=>to(Math.atan(e[4])),skewY:e=>to(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tm(e){return+!!e.includes("scale")}function tf(e,t){let r,n;if(!e||"none"===e)return tm(t);let i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(i)r=tp,n=i;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=tc,n=t}if(!n)return tm(t);let a=r[t],s=n[1].split(",").map(tx);return"function"==typeof a?a(s):s[a]}function tx(e){return parseFloat(e.trim())}let ty=e=>e===ex||e===eE,tg=new Set(["x","y","z"]),tv=ep.filter(e=>!tg.has(e)),tb={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tf(t,"x"),y:(e,{transform:t})=>tf(t,"y")};tb.translateX=tb.x,tb.translateY=tb.y;let tj=e=>e,tw={},tN=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tk(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,s=tN.reduce((e,r)=>(e[r]=function(e,t){let r=new Set,n=new Set,i=!1,a=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){s.has(t)&&(u.schedule(t),e()),l++,t(o)}let u={schedule:(e,t=!1,a=!1)=>{let o=a&&i?r:n;return t&&s.add(e),o.has(e)||o.add(e),e},cancel:e=>{n.delete(e),s.delete(e)},process:e=>{if(o=e,i){a=!0;return}i=!0,[r,n]=[n,r],r.forEach(c),t,l=0,r.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}(a,t?r:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:m}=s,f=()=>{let a=tw.useManualTiming?i.timestamp:performance.now();r=!1,tw.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),p.process(i),m.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(f))};return{schedule:tN.reduce((t,a)=>{let o=s[a];return t[a]=(t,a=!1,s=!1)=>(!r&&(r=!0,n=!0,i.isProcessing||e(f)),o.schedule(t,a,s)),t},{}),cancel:e=>{for(let t=0;t<tN.length;t++)s[tN[t]].cancel(e)},state:i,steps:s}}let{schedule:tS,cancel:tO,state:tP,steps:tC}=tk("u">typeof requestAnimationFrame?requestAnimationFrame:tj,!0),tA=new Set,tE=!1,tM=!1,tT=!1;function t_(){if(tM){let e=Array.from(tA).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{let t,n=(t=[],tv.forEach(r=>{let n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(+!!r.startsWith("scale")))}),t);n.length&&(r.set(e,n),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,r])=>{e.getValue(t)?.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}tM=!1,tE=!1,tA.forEach(e=>e.complete(tT)),tA.clear()}function tD(){tA.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(tM=!0)})}class tI{constructor(e,t,r,n,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(tA.add(this),tE||(tE=!0,tS.read(tD),tS.resolveKeyframes(t_))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;if(null===e[0]){let i=n?.get(),a=e[e.length-1];if(void 0!==i)e[0]=i;else if(r&&t){let n=r.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===i&&n.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),tA.delete(this)}cancel(){"scheduled"===this.state&&(tA.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function tL(e,t){let r=eZ(e);return r!==eY&&(r=eV),r.getAnimatableNone?r.getAnimatableNone(t):void 0}let tz=new Set(["auto","none","0"]);class tR extends tI{constructor(e,t,r,n,i){super(e,t,r,n,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&tn(n=n.trim())){let i=function e(t,r,n=1){e9(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,a]=function(e){let t=ts.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r??n}`,i]}(t);if(!i)return;let s=window.getComputedStyle(r).getPropertyValue(i);if(s){let e=s.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return tn(a)?e(a,r,n+1):a}(n,t.current);void 0!==i&&(e[r]=i),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!e4.has(r)||2!==e.length)return;let[n,i]=e,a=e8(n),s=e8(i);if(ta(n)!==ta(i)&&tb[r]){this.needsMeasurement=!0;return}if(a!==s)if(ty(a)&&ty(s))for(let t=0;t<e.length;t++){let r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else tb[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&r.push(t);r.length&&function(e,t,r){let n,i=0;for(;i<e.length&&!n;){let t=e[i];"string"==typeof t&&!tz.has(t)&&e$(t).values.length&&(n=e[i]),i++}if(n&&r)for(let i of t)e[i]=tL(r,n)}(e,r,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tb[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:r}=this;if(!e||!e.current)return;let n=e.getValue(t);n&&n.jump(this.measuredOrigin,!1);let i=r.length-1,a=r[i];r[i]=tb[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==a&&void 0===this.finalKeyframe&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,r])=>{e.getValue(t).set(r)}),this.resolveNoneKeyframes()}}function tF(e,t){-1===e.indexOf(t)&&e.push(t)}function t$(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}class tB{constructor(){this.subscriptions=[]}add(e){return tF(this.subscriptions,e),()=>t$(this.subscriptions,e)}notify(e,t,r){let n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let i=0;i<n;i++){let n=this.subscriptions[i];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let{schedule:tU}=tk(queueMicrotask,!1);function tq(){t=void 0}let tV={now:()=>(void 0===t&&tV.set(tP.isProcessing||tw.useManualTiming?tP.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(tq)}};class tK{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=tV.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=tV.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new tB);let r=this.events[e].add(t);return"change"===e?()=>{r(),tS.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return o&&o.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=tV.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),r?1e3/r*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tW(e,t){return new tK(e,t)}let tH=[...e6,eI,eV],tY={current:null},tQ={current:!1},tX="u">typeof window,tG=new WeakMap;function tZ(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function tJ(e){return"string"==typeof e||Array.isArray(e)}let t0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],t1=["initial",...t0];function t2(e){return tZ(e.animate)||t1.some(t=>tJ(e[t]))}function t5(e){return!!(t2(e)||e.variants)}function t4(e){let t=[{},{}];return e?.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function t3(e,t,r,n){if("function"==typeof t){let[i,a]=t4(n);t=t(void 0!==r?r:e.custom,i,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[i,a]=t4(n);t=t(void 0!==r?r:e.custom,i,a)}return t}let t6=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],t8={};class t7{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:i,visualState:a},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tI,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=tV.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,tS.render(this.render,!1,!0))};const{latestValues:o,renderState:l}=a;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.blockInitialAnimation=!!i,this.isControllingVariants=t2(t),this.isVariantNode=t5(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==o[e]&&e5(t)&&t.set(o[e])}}mount(e){this.current=e,tG.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(tQ.current||function(){if(tQ.current=!0,tX)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tY.current=e.matches;e.addEventListener("change",t),t()}else tY.current=!1}(),this.shouldReduceMotion=tY.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),tO(this.notifyUpdate),tO(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let r;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=em.has(e);n&&this.onBindTransform&&this.onBindTransform();let i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&tS.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in t8){let t=t8[e];if(!t)continue;let{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):e2()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<t6.length;t++){let r=t6[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);let n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(let n in t){let i=t[n],a=r[n];if(e5(i))e.addValue(n,i);else if(e5(a))e.addValue(n,tW(i,{owner:e}));else if(a!==i)if(e.hasValue(n)){let t=e.getValue(n);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(n);e.addValue(n,tW(void 0!==t?t:i,{owner:e}))}}for(let n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=tW(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){let r=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=r){let n,i;if("string"==typeof r&&(n=r,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n)||(i=r,/^0[^.\s]+$/u.test(i))))r=parseFloat(r);else{let n;n=r,!tH.find(e3(n))&&eV.test(t)&&(r=tL(e,t))}this.setBaseTarget(e,e5(r)?r.get():r)}return e5(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:r}=this.props;if("string"==typeof r||"object"==typeof r){let n=t3(this.props,r,this.presenceContext?.custom);n&&(t=n[e])}if(r&&void 0!==t)return t;let n=this.getBaseTargetFromProps(this.props,e);return void 0===n||e5(n)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:n}on(e,t){return this.events[e]||(this.events[e]=new tB),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){tU.render(this.render)}}class t9 extends t7{constructor(){super(...arguments),this.KeyframeResolver=tR}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let r=e.style;return r?r[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;e5(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function re(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let rt=(e,t)=>t&&"number"==typeof e?t.transform(e):e,rr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rn=ep.length;function ri(e,t,r){let{style:n,vars:i,transformOrigin:a}=e,s=!1,o=!1;for(let e in t){let r=t[e];if(em.has(e)){s=!0;continue}if(tt(e)){i[e]=r;continue}{let t=rt(r,eX[e]);e.startsWith("origin")?(o=!0,a[e]=t):n[e]=t}}if(!t.transform&&(s||r?n.transform=function(e,t,r){let n="",i=!0;for(let a=0;a<rn;a++){let s=ep[a],o=e[s];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===+!!s.startsWith("scale");else{let e=parseFloat(o);l=s.startsWith("scale")?1===e:0===e}if(!l||r){let e=rt(o,eX[s]);if(!l){i=!1;let t=rr[s]||s;n+=`${t}(${e}) `}r&&(t[s]=e)}}return n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),o){let{originX:e="50%",originY:t="50%",originZ:r=0}=a;n.transformOrigin=`${e} ${t} ${r}`}}let ra={offset:"stroke-dashoffset",array:"stroke-dasharray"},rs={offset:"strokeDashoffset",array:"strokeDasharray"},ro=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function rl(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:s=0,...o},l,c,u){if(ri(e,o,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:h}=e;for(let e of(d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=u?.transformBox??"fill-box",delete d.transformBox),ro))void 0!==d[e]&&(h[e]=d[e],delete d[e]);void 0!==t&&(d.x=t),void 0!==r&&(d.y=r),void 0!==n&&(d.scale=n),void 0!==i&&function(e,t,r=1,n=0,i=!0){e.pathLength=1;let a=i?ra:rs;e[a.offset]=`${-n}`,e[a.array]=`${t} ${r}`}(d,i,a,s,!1)}let rc=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ru=e=>"string"==typeof e&&"svg"===e.toLowerCase();function rd(e,{style:t,vars:r},n,i){let a,s=e.style;for(a in t)s[a]=t[a];for(a in i?.applyProjectionStyles(s,n),r)s.setProperty(a,r[a])}function rh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let rp={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!eE.test(e))return e;else e=parseFloat(e);let r=rh(e,t.target.x),n=rh(e,t.target.y);return`${r}% ${n}%`}},rm=(e,t,r)=>e+(t-e)*r,rf={borderRadius:{...rp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rp,borderTopRightRadius:rp,borderBottomLeftRadius:rp,borderBottomRightRadius:rp,boxShadow:{correct:(e,{treeScale:t,projectionDelta:r})=>{let n=eV.parse(e);if(n.length>5)return e;let i=eV.createTransformer(e),a=+("number"!=typeof n[0]),s=r.x.scale*t.x,o=r.y.scale*t.y;n[0+a]/=s,n[1+a]/=o;let l=rm(s,o,.5);return"number"==typeof n[2+a]&&(n[2+a]/=l),"number"==typeof n[3+a]&&(n[3+a]/=l),i(n)}}};function rx(e,{layout:t,layoutId:r}){return em.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!rf[e]||"opacity"===e)}function ry(e,t,r){let n=e.style,i=t?.style,a={};if(!n)return a;for(let t in n)(e5(n[t])||i&&e5(i[t])||rx(t,e)||r?.getValue(t)?.liveStyle!==void 0)&&(a[t]=n[t]);return a}function rg(e,t,r){let n=ry(e,t,r);for(let r in e)(e5(e[r])||e5(t[r]))&&(n[-1!==ep.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]);return n}class rv extends t9{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=e2}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(em.has(t)){let e=eZ(t);return e&&e.default||0}return t=rc.has(t)?t:re(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return rg(e,t,r)}build(e,t,r){rl(e,t,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,t,r,n){for(let r in rd(e,t,void 0,n),t.attrs)e.setAttribute(rc.has(r)?r:re(r),t.attrs[r])}mount(e){this.isSVGTag=ru(e.tagName),super.mount(e)}}function rb({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function rj(e){return void 0===e||1===e}function rw({scale:e,scaleX:t,scaleY:r}){return!rj(e)||!rj(t)||!rj(r)}function rN(e){return rw(e)||rk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rk(e){var t,r;return(t=e.x)&&"0%"!==t||(r=e.y)&&"0%"!==r}function rS(e,t,r,n,i){return void 0!==i&&(e=n+i*(e-n)),n+r*(e-n)+t}function rO(e,t=0,r=1,n,i){e.min=rS(e.min,t,r,n,i),e.max=rS(e.max,t,r,n,i)}function rP(e,{x:t,y:r}){rO(e.x,t.translate,t.scale,t.originPoint),rO(e.y,r.translate,r.scale,r.originPoint)}function rC(e,t){e.min=e.min+t,e.max=e.max+t}function rA(e,t,r,n,i=.5){let a=rm(e.min,e.max,i);rO(e,t,r,a,n)}function rE(e,t){rA(e.x,t.x,t.scaleX,t.scale,t.originX),rA(e.y,t.y,t.scaleY,t.scale,t.originY)}function rM(e,t){return rb(function(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}class rT extends t9{constructor(){super(...arguments),this.type="html",this.renderInstance=rd}readValueFromInstance(e,t){if(em.has(t))return this.projection?.isProjecting?tm(t):((e,t)=>{let{transform:r="none"}=getComputedStyle(e);return tf(r,t)})(e,t);{let r=window.getComputedStyle(e),n=(tt(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return rM(e,t)}build(e,t,r){ri(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return ry(e,t,r)}}let r_=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rD(e){if("string"!=typeof e||e.includes("-"));else if(r_.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let rI=(0,H.createContext)({strict:!1}),rL=(0,H.createContext)({});function rz(e){return Array.isArray(e)?e.join(" "):e}let rR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rF(e,t,r){for(let n in t)e5(t[n])||rx(n,r)||(e[n]=t[n])}let r$=()=>({...rR(),attrs:{}}),rB=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function rU(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||rB.has(e)}let rq=e=>!rU(e);try{u=(()=>{let e=Error("Cannot find module '@emotion/is-prop-valid'");throw e.code="MODULE_NOT_FOUND",e})().default,"function"==typeof u&&(rq=e=>e.startsWith("on")?!rU(e):u(e))}catch{}function rV(e){return e5(e)?e.get():e}let rK=e=>(t,r)=>{let n=(0,H.useContext)(rL),i=(0,H.useContext)(J),a=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:function(e,t,r,n){let i={},a=n(e,{});for(let e in a)i[e]=rV(a[e]);let{initial:s,animate:o}=e,l=t2(e),c=t5(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===o&&(o=t.animate));let u=!!r&&!1===r.initial,d=(u=u||!1===s)?o:s;if(d&&"boolean"!=typeof d&&!tZ(d)){let t=Array.isArray(d)?d:[d];for(let r=0;r<t.length;r++){let n=t3(e,t[r]);if(n){let{transitionEnd:e,transition:t,...r}=n;for(let e in r){let t=r[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}null!==t&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}(r,n,i,e),renderState:t()}})(e,t,n,i);return r?a():X(a)},rW=rK({scrapeMotionValuesFromProps:ry,createRenderState:rR}),rH=rK({scrapeMotionValuesFromProps:rg,createRenderState:r$}),rY={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},rQ=!1;function rX(){return!function(){if(rQ)return;let e={};for(let t in rY)e[t]={isEnabled:e=>rY[t].some(t=>!!e[t])};t8=e,rQ=!0}(),t8}let rG=Symbol.for("motionComponentSymbol"),rZ="data-"+re("framerAppearId"),rJ=(0,H.createContext)({});function r0(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function r1(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&function(e){let t=rX();for(let r in e)t[r]={...t[r],...e[r]};t8=t}(n);let a=r?"svg"===r:rD(e),s=a?rH:rW;function o(r,n){var o;let l,c,u,d={...(0,H.useContext)(en),...r,layoutId:function({layoutId:e}){let t=(0,H.useContext)(Q).id;return t&&void 0!==e?t+"-"+e:e}(r)},{isStatic:h}=d,p=function(e){let{initial:t,animate:r}=function(e,t){if(t2(e)){let{initial:t,animate:r}=e;return{initial:!1===t||tJ(t)?t:void 0,animate:tJ(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,H.useContext)(rL));return(0,H.useMemo)(()=>({initial:t,animate:r}),[rz(t),rz(r)])}(r),m=s(r,h);if(!h&&G){(0,H.useContext)(rI).strict;let t=function(e){let{drag:t,layout:r}=rX();if(!t&&!r)return{};let n={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(d);l=t.MeasureLayout,p.visualElement=function(e,t,r,n,i,a){let{visualElement:s}=(0,H.useContext)(rL),o=(0,H.useContext)(rI),l=(0,H.useContext)(J),c=(0,H.useContext)(en).reducedMotion,u=(0,H.useRef)(null),d=(0,H.useRef)(!1);n=n||o.renderer,!u.current&&n&&(u.current=n(e,{visualState:t,parent:s,props:r,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,isSVG:a}),d.current&&u.current&&(u.current.manuallyAnimateOnMount=!0));let h=u.current,p=(0,H.useContext)(rJ);h&&!h.projection&&i&&("html"===h.type||"svg"===h.type)&&function(e,t,r,n){let{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&r0(o),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:l,layoutRoot:c})}(u.current,r,i,p);let m=(0,H.useRef)(!1);(0,H.useInsertionEffect)(()=>{h&&m.current&&h.update(r,l)});let f=r[rZ],x=(0,H.useRef)(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return Z(()=>{d.current=!0,h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),x.current&&h.animationState&&h.animationState.animateChanges())}),(0,H.useEffect)(()=>{h&&(!x.current&&h.animationState&&h.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),x.current=!1),h.enteringChildren=void 0)}),h}(e,m,d,i,t.ProjectionNode,a)}return(0,W.jsxs)(rL.Provider,{value:p,children:[l&&p.visualElement?(0,W.jsx)(l,{visualElement:p.visualElement,...d}):null,function(e,t,r,{latestValues:n},i,a=!1,s){let o=(s??rD(e)?function(e,t,r,n){let i=(0,H.useMemo)(()=>{let r=r$();return rl(r,t,ru(n),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){let t={};rF(t,e.style,e),i.style={...t,...i.style}}return i}:function(e,t){let r,n,i={},a=(r=e.style||{},rF(n={},r,e),Object.assign(n,function({transformTemplate:e},t){return(0,H.useMemo)(()=>{let r=rR();return ri(r,t,e),Object.assign({},r.vars,r.style)},[t])}(e,t)),n);return e.drag&&!1!==e.dragListener&&(i.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=a,i})(t,n,i,e),l=function(e,t,r){let n={};for(let i in e)("values"!==i||"object"!=typeof e.values)&&(rq(i)||!0===r&&rU(i)||!t&&!rU(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}(t,"string"==typeof e,a),c=e!==H.Fragment?{...l,...o,ref:r}:{},{children:u}=t,d=(0,H.useMemo)(()=>e5(u)?u.get():u,[u]);return(0,H.createElement)(e,{...c,children:d})}(e,r,(o=p.visualElement,c=(0,H.useRef)(n),(0,H.useInsertionEffect)(()=>{c.current=n}),u=(0,H.useRef)(null),(0,H.useCallback)(e=>{e&&m.onMount?.(e),o&&(e?o.mount(e):o.unmount());let t=c.current;if("function"==typeof t)if(e){let r=t(e);"function"==typeof r&&(u.current=r)}else u.current?(u.current(),u.current=null):t(e);else t&&(t.current=e)},[o])),m,h,t,a)]})}o.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let l=(0,H.forwardRef)(o);return l[rG]=e,l}class r2{constructor(e){this.isMounted=!1,this.node=e}update(){}}function r5(e,t,r){let n=e.getProps();return t3(n,t,void 0!==r?r:n.custom,e)}function r4(e,t){return e?.[t]??e?.default??e}let r3=e=>Array.isArray(e);function r6(e,t){let r=e.getValue("willChange");if(e5(r)&&r.add)return r.add(t);if(!r&&tw.WillChange){let r=new tw.WillChange("auto");e.addValue("willChange",r),r.add(t)}}let r8=e=>1e3*e,r7=(e,t)=>r=>t(e(r)),r9=(...e)=>e.reduce(r7),ne={layout:0,mainThread:0,waapi:0};function nt(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function nr(e,t){return r=>r>0?t:e}let nn=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},ni=[eO,eS,eD];function na(e){let t=ni.find(t=>t.test(e));if(e7(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===eD&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let i=0,a=0,s=0;if(t/=100){let n=r<.5?r*(1+t):r+t-r*t,o=2*r-n;i=nt(o,n,e+1/3),a=nt(o,n,e),s=nt(o,n,e-1/3)}else i=a=s=r;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*s),alpha:n}}(r)),r}let ns=(e,t)=>{let r=na(e),n=na(t);if(!r||!n)return nr(e,t);let i={...r};return e=>(i.red=nn(r.red,n.red,e),i.green=nn(r.green,n.green,e),i.blue=nn(r.blue,n.blue,e),i.alpha=rm(r.alpha,n.alpha,e),eS.transform(i))},no=new Set(["none","hidden"]);function nl(e,t){return r=>rm(e,t,r)}function nc(e){return"number"==typeof e?nl:"string"==typeof e?tn(e)?nr:eI.test(e)?ns:nh:Array.isArray(e)?nu:"object"==typeof e?eI.test(e)?ns:nd:nr}function nu(e,t){let r=[...e],n=r.length,i=e.map((e,r)=>nc(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=i[t](e);return r}}function nd(e,t){let r={...e,...t},n={};for(let i in r)void 0!==e[i]&&void 0!==t[i]&&(n[i]=nc(e[i])(e[i],t[i]));return e=>{for(let t in n)r[t]=n[t](e);return r}}let nh=(e,t)=>{let r=eV.createTransformer(t),n=e$(e),i=e$(t);if(!(n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length))return e7(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),nr(e,t);if(no.has(e)&&!i.values.length||no.has(t)&&!n.values.length)return no.has(e)?r=>r<=0?e:t:r=>r>=1?t:e;return r9(nu(function(e,t){let r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],s=e.indexes[a][n[a]],o=e.values[s]??0;r[i]=o,n[a]++}return r}(n,i),i.values),r)};function np(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?rm(e,t,r):nc(e)(e,t)}let nm=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>tS.update(t,e),stop:()=>tO(t),now:()=>tP.isProcessing?tP.timestamp:tV.now()}},nf=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let t=0;t<i;t++)n+=Math.round(1e4*e(t/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function nx(e){let t=0,r=e.next(t);for(;!r.done&&t<2e4;)t+=50,r=e.next(t);return t>=2e4?1/0:t}function ny(e,t,r){var n,i;let a=Math.max(t-5,0);return n=r-e(a),(i=t-a)?1e3/i*n:0}let ng=.01,nv=2,nb=.005,nj=.5;function nw(e,t){return e*Math.sqrt(1-t*t)}let nN=["duration","bounce"],nk=["stiffness","damping","mass"];function nS(e,t){return t.some(t=>void 0!==e[t])}function nO(e=.3,t=.3){let r,n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:i,restDelta:a}=n,s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:h,velocity:p,isResolvedFromDuration:m}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!nS(e,nk)&&nS(e,nN))if(e.visualDuration){let r=2*Math.PI/(1.2*e.visualDuration),n=r*r,i=2*ef(.05,1,1-(e.bounce||0))*Math.sqrt(n);t={...t,mass:1,stiffness:n,damping:i}}else{let r=function({duration:e=800,bounce:t=.3,velocity:r=0,mass:n=1}){let i,a;e7(e<=r8(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=ef(.05,1,s),e=ef(.01,10,e/1e3),s<1?(i=t=>{let n=t*s,i=n*e;return .001-(n-r)/nw(t,s)*Math.exp(-i)},a=t=>{let n=t*s*e,a=Math.pow(s,2)*Math.pow(t,2)*e,o=Math.exp(-n),l=nw(Math.pow(t,2),s);return(n*r+r-a)*o*(-i(t)+.001>0?-1:1)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-r)*e+1),a=t=>e*e*(r-t)*Math.exp(-t*e));let o=function(e,t,r){let n=r;for(let r=1;r<12;r++)n-=e(n)/t(n);return n}(i,a,5/e);if(e=r8(e),isNaN(o))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(o,2)*n;return{stiffness:t,damping:2*s*Math.sqrt(n*t),duration:e}}}(e);(t={...t,...r,mass:1}).isResolvedFromDuration=!0}return t}({...n,velocity:-((n.velocity||0)/1e3)}),f=p||0,x=u/(2*Math.sqrt(c*d)),y=o-s,g=Math.sqrt(c/d)/1e3,v=5>Math.abs(y);if(i||(i=v?ng:nv),a||(a=v?nb:nj),x<1){let e=nw(g,x);r=t=>o-Math.exp(-x*g*t)*((f+x*g*y)/e*Math.sin(e*t)+y*Math.cos(e*t))}else if(1===x)r=e=>o-Math.exp(-g*e)*(y+(f+g*y)*e);else{let e=g*Math.sqrt(x*x-1);r=t=>{let r=Math.exp(-x*g*t),n=Math.min(e*t,300);return o-r*((f+x*g*y)*Math.sinh(n)+e*y*Math.cosh(n))/e}}let b={calculatedDuration:m&&h||null,next:e=>{let t=r(e);if(m)l.done=e>=h;else{let n=0===e?f:0;x<1&&(n=0===e?r8(f):ny(r,e,t));let s=Math.abs(o-t)<=a;l.done=Math.abs(n)<=i&&s}return l.value=l.done?o:t,l},toString:()=>{let e=Math.min(nx(b),2e4),t=nf(t=>b.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return b}function nP({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:c=.5,restSpeed:u}){let d,h,p=e[0],m={done:!1,value:p},f=r*t,x=p+f,y=void 0===s?x:s(x);y!==x&&(f=y-p);let g=e=>-f*Math.exp(-e/n),v=e=>y+g(e),b=e=>{let t=g(e),r=v(e);m.done=Math.abs(t)<=c,m.value=m.done?y:r},j=e=>{let t;if(t=m.value,void 0!==o&&t<o||void 0!==l&&t>l){var r;d=e,h=nO({keyframes:[m.value,(r=m.value,void 0===o?l:void 0===l||Math.abs(o-r)<Math.abs(l-r)?o:l)],velocity:ny(v,e,m.value),damping:i,stiffness:a,restDelta:c,restSpeed:u})}};return j(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==d||(t=!0,b(e),j(e)),void 0!==d&&e>=d)?h.next(e-d):(t||b(e),m)}}}nO.applyToOptions=e=>{let t=function(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(nx(n),2e4);return{type:"keyframes",ease:e=>n.next(i*e).value/t,duration:i/1e3}}(e,100,nO);return e.ease=t.ease,e.duration=r8(t.duration),e.type="keyframes",e};let nC=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function nA(e,t,r,n){return e===t&&r===n?tj:i=>0===i||1===i?i:nC(function(e,t,r,n,i){let a,s,o=0;do(a=nC(s=t+(r-t)/2,n,i)-e)>0?r=s:t=s;while(Math.abs(a)>1e-7&&++o<12)return s}(i,0,1,e,r),t,n)}let nE=nA(.42,0,1,1),nM=nA(0,0,.58,1),nT=nA(.42,0,.58,1),n_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,nD=e=>t=>1-e(1-t),nI=nA(.33,1.53,.69,.99),nL=nD(nI),nz=n_(nL),nR=e=>(e*=2)<1?.5*nL(e):.5*(2-Math.pow(2,-10*(e-1))),nF=e=>1-Math.sin(Math.acos(e)),n$=nD(nF),nB=n_(nF),nU=e=>Array.isArray(e)&&"number"==typeof e[0],nq={linear:tj,easeIn:nE,easeInOut:nT,easeOut:nM,circIn:nF,circInOut:nB,circOut:n$,backIn:nL,backInOut:nz,backOut:nI,anticipate:nR},nV=e=>{if(nU(e)){e9(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return nA(t,r,n,i)}return"string"==typeof e?(e9(void 0!==nq[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nq[e]):e},nK=(e,t,r)=>{let n=t-e;return 0===n?1:(r-e)/n};function nW({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){var i;let a,s=Array.isArray(n)&&"number"!=typeof n[0]?n.map(nV):nV(n),o={done:!1,value:t[0]},l=function(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let a=e.length;if(e9(a===t.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,r){let n=[],i=r||tw.mix||np,a=e.length-1;for(let r=0;r<a;r++){let a=i(e[r],e[r+1]);t&&(a=r9(Array.isArray(t)?t[r]||tj:t,a)),n.push(a)}return n}(t,n,i),l=o.length,c=r=>{if(s&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);let i=nK(e[n],e[n+1],r);return o[n](i)};return r?t=>c(ef(e[0],e[a-1],t)):c}((i=r&&r.length===t.length?r:(!function(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=nK(0,t,n);e.push(rm(r,1,i))}}(a=[0],t.length-1),a),i.map(t=>t*e)),t,{ease:Array.isArray(s)?s:t.map(()=>s||nT).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(o.value=l(t),o.done=t>=e,o)}}let nH=e=>null!==e;function nY(e,{repeat:t,repeatType:r="loop"},n,i=1){let a=e.filter(nH),s=i<0||t&&"loop"!==r&&t%2==1?0:a.length-1;return s&&void 0!==n?n:a[s]}let nQ={decay:nP,inertia:nP,tween:nW,keyframes:nW,spring:nO};function nX(e){"string"==typeof e.type&&(e.type=nQ[e.type])}class nG{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let nZ=e=>e/100;class nJ extends nG{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==tV.now()&&this.tick(tV.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},ne.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;nX(e);let{type:t=nW,repeat:r=0,repeatDelay:n=0,repeatType:i,velocity:a=0}=e,{keyframes:s}=e,o=t||nW;o!==nW&&"number"!=typeof s[0]&&(this.mixKeyframes=r9(nZ,np(s[0],s[1])),s=[0,100]);let l=o({...e,keyframes:s});"mirror"===i&&(this.mirroredGenerator=o({...e,keyframes:[...s].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=nx(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+n,this.totalDuration=this.resolvedDuration*(r+1)-n,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:r,totalDuration:n,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:s,calculatedDuration:o}=this;if(null===this.startTime)return r.next(0);let{delay:l=0,keyframes:c,repeat:u,repeatType:d,repeatDelay:h,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let x=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?x<0:x>n;this.currentTime=Math.max(x,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let g=this.currentTime,v=r;if(u){let e=Math.min(this.currentTime,n)/s,t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,(t=Math.min(t,u+1))%2&&("reverse"===d?(r=1-r,h&&(r-=h/s)):"mirror"===d&&(v=a)),g=ef(0,1,r)*s}let b=y?{done:!1,value:c[0]}:v.next(g);i&&(b.value=i(b.value));let{done:j}=b;y||null===o||(j=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&j);return w&&p!==nP&&(b.value=nY(c,this.options,f,this.speed)),m&&m(b.value),w&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=r8(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(tV.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=nm,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let r=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=r):null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime||(this.startTime=t??r),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(tV.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,ne.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function n0(e){let t;return()=>(void 0===t&&(t=e()),t)}let n1=n0(()=>void 0!==window.ScrollTimeline),n2={},n5=(r=n0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),()=>n2.linearEasing??r()),n4=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,n3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:n4([0,.65,.55,1]),circOut:n4([.55,0,1,.45]),backIn:n4([.31,.01,.66,-.59]),backOut:n4([.33,1.53,.69,.99])};function n6(e){return"function"==typeof e&&"applyToOptions"in e}class n8 extends nG{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:r,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:s,onComplete:o}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e9("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:e,...t}){return n6(e)&&n5()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeOut",times:l}={},c){let u={[t]:r};l&&(u.offset=l);let d=function e(t,r){if(t)return"function"==typeof t?n5()?nf(t,r):"ease-out":nU(t)?n4(t):Array.isArray(t)?t.map(t=>e(t,r)||n3.easeOut):n3[t]}(o,i);Array.isArray(d)&&(u.easing=d);let h={delay:n,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===s?"alternate":"normal"};c&&(h.pseudoElement=c);let p=e.animate(u,h);return p}(t,r,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=nY(n,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(e):r.startsWith("--")?t.style.setProperty(r,e):t.style[r]=e,this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=r8(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&n1())?(this.animation.timeline=e,tj):t(this)}}let n7={anticipate:nR,backInOut:nz,circInOut:nB};class n9 extends n8{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in n7&&(e.ease=n7[e.ease])}(e),nX(e),super(e),void 0!==e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:r,onComplete:n,element:i,...a}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let s=new nJ({...a,autoplay:!1}),o=Math.max(10,tV.now()-this.startTime),l=ef(0,10,o-10);t.setWithVelocity(s.sample(Math.max(0,o-l)).value,s.sample(o).value,l),s.stop()}}let ie=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(eV.test(e)||"0"===e)&&!e.startsWith("url("));function it(e){e.duration=0,e.type="keyframes"}let ir=new Set(["opacity","clipPath","filter","transform"]),ii=n0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class ia extends nG{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:a="loop",keyframes:s,name:o,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=tV.now();const d={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:i,repeatType:a,name:o,motionValue:l,element:c,...u},h=c?.KeyframeResolver||tI;this.keyframeResolver=new h(s,(e,t,r)=>this.onKeyframesResolved(e,t,d,!r),o,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,r,n){this.keyframeResolver=void 0;let{name:i,type:a,velocity:s,delay:o,isHandoff:l,onUpdate:c}=r;this.resolvedAt=tV.now(),!function(e,t,r,n){let i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;let a=e[e.length-1],s=ie(i,t),o=ie(a,t);return e7(s===o,`You are trying to animate ${t} from "${i}" to "${a}". "${s?a:i}" is not an animatable value.`,"value-not-animatable"),!!s&&!!o&&(function(e){let t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||n6(r))&&n)}(e,i,a,s)&&((tw.instantAnimations||!o)&&c?.(nY(e,r,t)),e[0]=e[e.length-1],it(r),r.repeat=0);let u={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...r,keyframes:e},d=!l&&function(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:a,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=t.owner.getProps();return ii()&&r&&ir.has(r)&&("transform"!==r||!l)&&!o&&!n&&"mirror"!==i&&0!==a&&"inertia"!==s}(u),h=u.motionValue?.owner?.current,p=d?new n9({...u,element:h}):new nJ(u);p.finished.then(()=>{this.notifyFinished()}).catch(tj),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tT=!0,tD(),t_(),tT=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let is={type:"spring",stiffness:500,damping:25,restSpeed:10},io={type:"keyframes",duration:.8},il={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ic=e=>null!==e,iu=(e,t,r,n={},i,a)=>s=>{let o=r4(n,e)||{},l=o.delay||n.delay||0,{elapsed:c=0}=n;c-=r8(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:a?void 0:i};!function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)&&Object.assign(u,((e,{keyframes:t})=>t.length>2?io:em.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:is:il)(e,u)),u.duration&&(u.duration=r8(u.duration)),u.repeatDelay&&(u.repeatDelay=r8(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if(!1!==u.type&&(0!==u.duration||u.repeatDelay)||(it(u),0===u.delay&&(d=!0)),(tw.instantAnimations||tw.skipAnimations)&&(d=!0,it(u),u.delay=0),u.allowFlatten=!o.type&&!o.ease,d&&!a&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:r="loop"},n){let i=e.filter(ic),a=t&&"loop"!==r&&t%2==1?0:i.length-1;return i[a]}(u.keyframes,o);if(void 0!==e)return void tS.update(()=>{u.onUpdate(e),u.onComplete()})}return o.isSync?new nJ(u):new ia(u)};function id(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:s,...o}=t;n&&(a=n);let l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(let t in o){let n=e.getValue(t,e.latestValues[t]??null),i=o[t];if(void 0===i||c&&function({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}(c,t))continue;let s={delay:r,...r4(a||{},t)},u=n.get();if(void 0!==u&&!n.isAnimating&&!Array.isArray(i)&&i===u&&!s.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let r=e.props[rZ];if(r){let e=window.MotionHandoffAnimation(r,t,tS);null!==e&&(s.startTime=e,d=!0)}}r6(e,t),n.start(iu(t,n,i,e.shouldReduceMotion&&e4.has(t)?{type:!1}:s,e,d));let h=n.animation;h&&l.push(h)}return s&&Promise.all(l).then(()=>{tS.update(()=>{s&&function(e,t){let{transitionEnd:r={},transition:n={},...i}=r5(e,t)||{};for(let t in i={...i,...r}){var a;let r=r3(a=i[t])?a[a.length-1]||0:a;e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,tW(r))}}(e,s)})}),l}function ih(e,t,r,n=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),s=e.size,o=(s-1)*n;return"function"==typeof r?r(a,s):1===i?a*n:o-a*n}function ip(e,t,r={}){let n=r5(e,t,"exit"===r.type?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let a=n?()=>Promise.all(id(e,n,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:a=0,staggerChildren:s,staggerDirection:o}=i;return function(e,t,r=0,n=0,i=0,a=1,s){let o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(ip(l,t,{...s,delay:r+("function"==typeof n?0:n)+ih(e.variantChildren,l,n,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,n,a,s,o,r)}:()=>Promise.resolve(),{when:o}=i;if(!o)return Promise.all([a(),s(r.delay)]);{let[e,t]="beforeChildren"===o?[a,s]:[s,a];return e().then(()=>t())}}let im=t1.length;function ix(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}let iy=[...t0].reverse(),ig=t0.length;function iv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ib(){return{animate:iv(!0),whileInView:iv(),whileHover:iv(),whileTap:iv(),whileDrag:iv(),whileFocus:iv(),exit:iv()}}let ij=0;function iw(e){return[e("x"),e("y")]}let iN=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ik(e){return iN.has(e.tagName)||!0===e.isContentEditable}function iS(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}let iO={x:!1,y:!1};function iP(e){return e.max-e.min}function iC(e,t,r,n=.5){e.origin=n,e.originPoint=rm(t.min,t.max,e.origin),e.scale=iP(r)/iP(t),e.translate=rm(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function iA(e,t,r,n){iC(e.x,t.x,r.x,n?n.originX:void 0),iC(e.y,t.y,r.y,n?n.originY:void 0)}function iE(e,t,r){e.min=r.min+t.min,e.max=e.min+iP(t)}function iM(e,t,r){e.min=t.min-r.min,e.max=e.min+iP(t)}function iT(e,t,r){iM(e.x,t.x,r.x),iM(e.y,t.y,r.y)}let i_=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function iD(e){return{point:{x:e.pageX,y:e.pageY}}}function iI(e,t,r,n){return iS(e,t,e=>i_(e)&&r(e,iD(e)),n)}let iL=({current:e})=>e?e.ownerDocument.defaultView:null,iz=(e,t)=>Math.abs(e-t),iR=new Set(["auto","scroll"]);class iF{constructor(e,t,{transformPagePoint:r,contextWindow:n=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=iU(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,i=(e=r.offset,t={x:0,y:0},Math.sqrt(iz(e.x,t.x)**2+iz(e.y,t.y)**2)>=this.distanceThreshold);if(!n&&!i)return;let{point:a}=r,{timestamp:s}=tP;this.history.push({...a,timestamp:s});let{onStart:o,onMove:l}=this.handlers;n||(o&&o(this.lastMoveEvent,r),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,r)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=i$(t,this.transformPagePoint),tS.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:r,onSessionEnd:n,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=iU("pointercancel"===e.type?this.lastMoveEventInfo:i$(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,a),n&&n(e,a)},!i_(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=n||window;const o=i$(iD(e),this.transformPagePoint),{point:l}=o,{timestamp:c}=tP;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=t;u&&u(e,iU(o,this.history)),this.removeListeners=r9(iI(this.contextWindow,"pointermove",this.handlePointerMove),iI(this.contextWindow,"pointerup",this.handlePointerUp),iI(this.contextWindow,"pointercancel",this.handlePointerUp)),s&&this.startScrollTracking(s)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(iR.has(e.overflowX)||iR.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let r=e===window,n=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:n.x-t.x,y:n.y-t.y};(0!==i.x||0!==i.y)&&(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,n),tS.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),tO(this.updatePoint)}}function i$(e,t){return t?{point:t(e.point)}:e}function iB(e,t){return{x:e.x-t.x,y:e.y-t.y}}function iU({point:e},t){return{point:e,delta:iB(e,iq(t)),offset:iB(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=iq(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>r8(.1)));)r--;if(!n)return{x:0,y:0};let a=(i.timestamp-n.timestamp)/1e3;if(0===a)return{x:0,y:0};let s={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}(t,.1)}}function iq(e){return e[e.length-1]}function iV(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function iK(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function iW(e,t,r){return{min:iH(e,t),max:iH(e,r)}}function iH(e,t){return"number"==typeof e?e:e[t]||0}let iY=new WeakMap;class iQ{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=e2(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:r}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let i=e=>{t?(this.stopAnimation(),this.snapToCursor(iD(e).point)):this.pauseAnimation()},a=(e,t)=>{this.stopAnimation();let{drag:r,dragPropagation:n,onDragStart:i}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(iO[e])return null;else return iO[e]=!0,()=>{iO[e]=!1};return iO.x||iO.y?null:(iO.x=iO.y=!0,()=>{iO.x=iO.y=!1})}(r),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iw(e=>{let t=this.getAxisMotionValue(e).get()||0;if(eA.test(t)){let{projection:r}=this.visualElement;if(r&&r.layout){let n=r.layout.layoutBox[e];n&&(t=iP(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&tS.postRender(()=>i(e,t)),r6(this.visualElement,"transform");let{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:r,dragDirectionLock:n,onDirectionLock:i,onDrag:a}=this.getProps();if(!r&&!this.openDragLock)return;let{offset:s}=t;if(n&&null===this.currentDirection){this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(s),null!==this.currentDirection&&i&&i(this.currentDirection);return}this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),a&&a(e,t)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>iw(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new iF(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:iL(this.visualElement),element:this.visualElement.current})}stop(e,t){let r=e||this.latestPointerEvent,n=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!n||!r)return;let{velocity:a}=n;this.startAnimation(a);let{onDragEnd:s}=this.getProps();s&&tS.postRender(()=>s(r,n))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,r){let{drag:n}=this.getProps();if(!r||!iX(e,n,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?rm(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?rm(r,e,n.max):Math.min(e,r)),e}(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;e&&r0(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=function(e,{top:t,left:r,bottom:n,right:i}){return{x:iV(e.x,r,i),y:iV(e.y,t,n)}}(r.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:iW(e,"left","right"),y:iW(e,"top","bottom")}}(t),n!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&iw(e=>{var t,n;let i;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=r.layoutBox[e],n=this.constraints[e],i={},void 0!==n.min&&(i.min=n.min-t.min),void 0!==n.max&&(i.max=n.max-t.min),i))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!r0(t))return!1;let n=t.current;e9(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;let a=function(e,t,r){let n=rM(e,r),{scroll:i}=t;return i&&(rC(n.x,i.offset.x),rC(n.y,i.offset.y)),n}(n,i.root,this.visualElement.getTransformPagePoint()),s=(e=i.layout.layoutBox,{x:iK(e.x,a.x),y:iK(e.y,a.y)});if(r){let e=r(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=rb(e))}return s}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:n,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),o=this.constraints||{};return Promise.all(iw(s=>{if(!iX(s,t,this.currentDirection))return;let l=o&&o[s]||{};a&&(l={min:0,max:0});let c={type:"inertia",velocity:r?e[s]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,c)})).then(s)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return r6(this.visualElement,e),r.start(iu(e,r,0,t,this.visualElement,!1))}stopAnimation(){iw(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){iw(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){iw(t=>{let{drag:r}=this.getProps();if(!iX(t,r,this.currentDirection))return;let{projection:n}=this.visualElement,i=this.getAxisMotionValue(t);if(n&&n.layout){let{min:r,max:a}=n.layout.layoutBox[t],s=i.get()||0;i.set(e[t]-rm(r,a,.5)+s)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!r0(t)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};iw(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var r,i;let a,s,o,l=t.get();n[e]=(r={min:l,max:l},i=this.constraints[e],a=.5,s=iP(r),(o=iP(i))>s?a=nK(i.min,i.max-s,r.min):s>o&&(a=nK(r.min,r.max-o,i.min)),ef(0,1,a))}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),iw(t=>{if(!iX(t,e,null))return;let r=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];r.set(rm(i,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;iY.set(this.visualElement,this);let e=this.visualElement.current,t=iI(e,"pointerdown",t=>{let{drag:r,dragListener:n=!0}=this.getProps(),i=t.target,a=i!==e&&ik(i);r&&n&&!a&&this.start(t)}),r=()=>{let{dragConstraints:e}=this.getProps();r0(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",r);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),tS.read(r);let a=iS(window,"resize",()=>this.scalePositionWithinConstraints()),s=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(iw(t=>{let r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{a(),t(),i(),s&&s()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:a=.35,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:i,dragElastic:a,dragMomentum:s}}}function iX(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}let iG=e=>(t,r)=>{e&&tS.postRender(()=>e(t,r))},iZ={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var iJ=H;let i0=!1;class i1 extends iJ.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),r&&r.register&&n&&r.register(i),i0&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),iZ.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:n,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),i0=!0,n||e.layoutDependency!==t||void 0===t||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||tS.postRender(()=>{let e=a.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tU.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;i0=!0,n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function i2(e){let[t,r]=ec(),n=(0,iJ.useContext)(Q);return(0,W.jsx)(i1,{...e,layoutGroup:n,switchLayoutGroup:(0,iJ.useContext)(rJ),isPresent:t,safeToRemove:r})}function i5(e,t,r,n,i){return e-=t,e=n+1/r*(e-n),void 0!==i&&(e=n+1/i*(e-n)),e}function i4(e,t,[r,n,i],a,s){!function(e,t=0,r=1,n=.5,i,a=e,s=e){if(eA.test(t)&&(t=parseFloat(t),t=rm(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let o=rm(a.min,a.max,n);e===a&&(o-=t),e.min=i5(e.min,t,r,o,i),e.max=i5(e.max,t,r,o,i)}(e,t[r],t[n],t[i],t.scale,a,s)}let i3=["x","scaleX","originX"],i6=["y","scaleY","originY"];function i8(e,t,r,n){i4(e.x,t,i3,r?r.x:void 0,n?n.x:void 0),i4(e.y,t,i6,r?r.y:void 0,n?n.y:void 0)}function i7(e,t){e.min=t.min,e.max=t.max}function i9(e,t){i7(e.x,t.x),i7(e.y,t.y)}function ae(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function at(e){return 0===e.translate&&1===e.scale}function ar(e){return at(e.x)&&at(e.y)}function an(e,t){return e.min===t.min&&e.max===t.max}function ai(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aa(e,t){return ai(e.x,t.x)&&ai(e.y,t.y)}function as(e){return iP(e.x)/iP(e.y)}function ao(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let al=["TopLeft","TopRight","BottomLeft","BottomRight"],ac=al.length,au=e=>"string"==typeof e?parseFloat(e):e,ad=e=>"number"==typeof e||eE.test(e);function ah(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let ap=af(0,.5,n$),am=af(.5,.95,tj);function af(e,t,r){return n=>n<e?0:n>t?1:r(nK(e,t,n))}function ax(e){return ee(e)&&"ownerSVGElement"in e}let ay=(e,t)=>e.depth-t.depth;class ag{constructor(){this.children=[],this.isDirty=!1}add(e){tF(this.children,e),this.isDirty=!0}remove(e){t$(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ay),this.isDirty=!1,this.children.forEach(e)}}class av{constructor(){this.members=[]}add(e){tF(this.members,e),e.scheduleRender()}remove(e){if(t$(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,r=this.members.findIndex(t=>e===t);if(0===r)return!1;for(let e=r;e>=0;e--){let r=this.members[e];if(!1!==r.isPresent){t=r;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender();let n=r.options.layoutDependency,i=e.options.layoutDependency;(void 0===n||void 0===i||n!==i)&&(e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));let{crossfade:a}=e.options;!1===a&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let ab=["","X","Y","Z"],aj=0;function aw(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function aN({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(e={},r=t?.()){this.id=aj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(aO),this.nodes.forEach(a_),this.nodes.forEach(aD),this.nodes.forEach(aP)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new ag)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new tB),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=ax(t)&&!(ax(t)&&"svg"===t.tagName),this.instance=t;let{layoutId:r,layout:n,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||r)&&(this.isLayoutDirty=!0),e){let r,n=0,i=()=>this.root.updateBlockedByResize=!1;tS.read(()=>{n=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==n){let t,a;n=e,this.root.updateBlockedByResize=!0,r&&r(),t=tV.now(),a=({timestamp:e})=>{let r=e-t;r>=250&&(tO(a),i(r-250))},tS.setup(a,!0),r=()=>tO(a),iZ.hasAnimatedSinceResize&&(iZ.hasAnimatedSinceResize=!1,this.nodes.forEach(aT))}})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&i&&(r||n)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||a$,{onLayoutAnimationStart:s,onLayoutAnimationComplete:o}=i.getProps(),l=!this.targetLayout||!aa(this.targetLayout,n),c=!t&&r;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...r4(a,"layout"),onPlay:s,onComplete:o};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c)}else t||aT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),tO(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aI),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:r}=t.options;if(!r)return;let n=r.props[rZ];if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:e,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",tS,!(e||r))}let{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&e(i)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(aA);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(aE);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(aM),this.nodes.forEach(ak),this.nodes.forEach(aS)):this.nodes.forEach(aE),this.clearAllSnapshots();let e=tV.now();tP.delta=ef(0,1e3/60,e-tP.timestamp),tP.timestamp=e,tP.isProcessing=!0,tC.update.process(tP),tC.preRender.process(tP),tC.render.process(tP),tP.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tU.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(aC),this.sharedNodes.forEach(aL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tS.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tS.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||iP(this.snapshot.measuredBox.x)||iP(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=e2(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ar(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&this.instance&&(t||rN(this.latestValues)||a)&&(i(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let r=this.measurePageBox(),n=this.removeElementScroll(r);return e&&(n=this.removeTransform(n)),aq((t=n).x),aq(t.y),{animationId:this.root.animationId,measuredBox:r,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return e2();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(aK))){let{scroll:e}=this.root;e&&(rC(t.x,e.offset.x),rC(t.y,e.offset.y))}return t}removeElementScroll(e){let t=e2();if(i9(t,e),this.scroll?.wasRoot)return t;for(let r=0;r<this.path.length;r++){let n=this.path[r],{scroll:i,options:a}=n;n!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&i9(t,e),rC(t.x,i.offset.x),rC(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let r=e2();i9(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&rE(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),rN(n.latestValues)&&rE(r,n.latestValues)}return rN(this.latestValues)&&rE(r,this.latestValues),r}removeTransform(e){let t=e2();i9(t,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];if(!r.instance||!rN(r.latestValues))continue;rw(r.latestValues)&&r.updateSnapshot();let n=e2();i9(n,r.measurePageBox()),i8(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return rN(this.latestValues)&&i8(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==tP.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let r=!!this.resumingFrom||this!==t;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:n,layoutId:i}=this.options;if(!this.layout||!(n||i))return;this.resolvedRelativeTargetAt=tP.timestamp;let a=this.getClosestProjectingParent();if(a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=e2(),this.targetWithTransforms=e2()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var s,o,l;this.forceRelativeParentToResolveTarget(),s=this.target,o=this.relativeTarget,l=this.relativeParent.target,iE(s.x,o.x,l.x),iE(s.y,o.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):i9(this.target,this.layout.layoutBox),rP(this.target,this.targetDelta)):i9(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&1!==this.animationProgress?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||rw(this.parent.latestValues)||rk(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,r){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=e2(),this.relativeTargetOrigin=e2(),iT(this.relativeTargetOrigin,t,r),i9(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,r=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(r=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===tP.timestamp&&(r=!1),r)return;let{layout:n,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(n||i))return;i9(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,s=this.treeScale.y;!function(e,t,r,n=!1){let i,a,s=r.length;if(s){t.x=t.y=1;for(let o=0;o<s;o++){a=(i=r[o]).projectionDelta;let{visualElement:s}=i.options;(!s||!s.props.style||"contents"!==s.props.style.display)&&(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&rE(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,rP(e,a)),n&&rN(i.latestValues)&&rE(e,i.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=e2());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(ae(this.prevProjectionDelta.x,this.projectionDelta.x),ae(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),iA(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===a&&this.treeScale.y===s&&ao(this.projectionDelta.x,this.prevProjectionDelta.x)&&ao(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=e0(),this.projectionDelta=e0(),this.projectionDeltaWithTransform=e0()}setAnimationOrigin(e,t=!1){let r,n=this.snapshot,i=n?n.latestValues:{},a={...this.latestValues},s=e0();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=e2(),l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,d=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(aF));this.animationProgress=0,this.mixTargetDelta=t=>{let n=t/1e3;if(az(s.x,e.x,n),az(s.y,e.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,h,p,m,f,x;iT(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=o,x=n,aR(p.x,m.x,f.x,x),aR(p.y,m.y,f.y,x),r&&(c=this.relativeTarget,h=r,an(c.x,h.x)&&an(c.y,h.y))&&(this.isProjectionDirty=!1),r||(r=e2()),i9(r,this.relativeTarget)}l&&(this.animationValues=a,function(e,t,r,n,i,a){i?(e.opacity=rm(0,r.opacity??1,ap(n)),e.opacityExit=rm(t.opacity??1,0,am(n))):a&&(e.opacity=rm(t.opacity??1,r.opacity??1,n));for(let i=0;i<ac;i++){let a=`border${al[i]}Radius`,s=ah(t,a),o=ah(r,a);(void 0!==s||void 0!==o)&&(s||(s=0),o||(o=0),0===s||0===o||ad(s)===ad(o)?(e[a]=Math.max(rm(au(s),au(o),n),0),(eA.test(o)||eA.test(s))&&(e[a]+="%")):e[a]=o)}(t.rotate||r.rotate)&&(e.rotate=rm(t.rotate||0,r.rotate||0,n))}(a,i,this.latestValues,n,d,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(tO(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tS.update(()=>{var t,r,n;let i;iZ.hasAnimatedSinceResize=!0,ne.layout++,this.motionValue||(this.motionValue=tW(0)),this.currentAnimation=(t=this.motionValue,r=[0,1e3],n={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{ne.layout--},onComplete:()=>{ne.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}},(i=e5(t)?t:tW(t)).start(iu("",i,r,n)),i.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:r,layout:n,latestValues:i}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&aV(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||e2();let t=iP(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;let n=iP(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}i9(t,r),rE(t,i),iA(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new av),this.sharedNodes.get(e).add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){let n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;let n={};r.z&&aw("z",e,n,this.animationValues);for(let t=0;t<ab.length;t++)aw(`rotate${ab[t]}`,e,n,this.animationValues),aw(`skew${ab[t]}`,e,n,this.animationValues);for(let t in e.render(),n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=rV(t?.pointerEvents)||"",e.transform=r?r(this.latestValues,""):"none";return}let n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=rV(t?.pointerEvents)||""),this.hasProjected&&!rN(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1);return}e.visibility="";let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=function(e,t,r){let n="",i=e.x.translate/t.x,a=e.y.translate/t.y,s=r?.z||0;if((i||a||s)&&(n=`translate3d(${i}px, ${a}px, ${s}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:s,skewY:o}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),i&&(n+=`rotateX(${i}deg) `),a&&(n+=`rotateY(${a}deg) `),s&&(n+=`skewX(${s}deg) `),o&&(n+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(n+=`scale(${o}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:s,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*s.origin}% ${100*o.origin}% 0`,n.animationValues?e.opacity=n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=n===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0,rf){if(void 0===i[t])continue;let{correct:r,applyTo:s,isCSSVariable:o}=rf[t],l="none"===a?i[t]:r(i[t],n);if(s){let t=s.length;for(let r=0;r<t;r++)e[s[r]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=n===this?rV(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(aA),this.root.sharedNodes.clear()}}}function ak(e){e.updateLayout()}function aS(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:n}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;"size"===i?iw(e=>{let n=a?t.measuredBox[e]:t.layoutBox[e],i=iP(n);n.min=r[e].min,n.max=n.min+i}):aV(i,t.layoutBox,r)&&iw(n=>{let i=a?t.measuredBox[n]:t.layoutBox[n],s=iP(r[n]);i.max=i.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+s)});let s=e0();iA(s,r,t.layoutBox);let o=e0();a?iA(o,e.applyTransform(n,!0),t.measuredBox):iA(o,r,t.layoutBox);let l=!ar(s),c=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:i,layout:a}=n;if(i&&a){let s=e2();iT(s,t.layoutBox,i.layoutBox);let o=e2();iT(o,r,a.layoutBox),aa(s,o)||(c=!0),n.options.layoutRoot&&(e.relativeTarget=o,e.relativeTargetOrigin=s,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:o,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function aO(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function aP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function aC(e){e.clearSnapshot()}function aA(e){e.clearMeasurements()}function aE(e){e.isLayoutDirty=!1}function aM(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function aT(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function a_(e){e.resolveTargetDelta()}function aD(e){e.calcProjection()}function aI(e){e.resetSkewAndRotation()}function aL(e){e.removeLeadSnapshot()}function az(e,t,r){e.translate=rm(t.translate,0,r),e.scale=rm(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function aR(e,t,r,n){e.min=rm(t.min,r.min,n),e.max=rm(t.max,r.max,n)}function aF(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let a$={duration:.45,ease:[.4,0,.1,1]},aB=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aU=aB("applewebkit/")&&!aB("chrome/")?Math.round:tj;function aq(e){e.min=aU(e.min),e.max=aU(e.max)}function aV(e,t,r){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(as(t)-as(r)))}function aK(e){return e!==e.root&&e.scroll?.wasRoot}let aW=aN({attachResizeListener:(e,t)=>iS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),aH={current:void 0},aY=aN({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!aH.current){let e=new aW({});e.mount(window),e.setOptions({layoutScroll:!0}),aH.current=e}return aH.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function aQ(e,t){let r=function(e,t,r){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document,r=(void 0)??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(e=>null!=e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function aX(e){return!("touch"===e.pointerType||iO.x||iO.y)}function aG(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);let i=n["onHover"+r];i&&tS.postRender(()=>i(t,iD(t)))}let aZ=(e,t)=>!!t&&(e===t||aZ(e,t.parentElement)),aJ=new WeakSet;function a0(e){return t=>{"Enter"===t.key&&e(t)}}function a1(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function a2(e){return i_(e)&&!(iO.x||iO.y)}function a5(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);let i=n["onTap"+("End"===r?"":r)];i&&tS.postRender(()=>i(t,iD(t)))}let a4=new WeakMap,a3=new WeakMap,a6=e=>{let t=a4.get(e.target);t&&t(e)},a8=e=>{e.forEach(a6)},a7={some:0,all:1},a9=function(e,t){if("u"<typeof Proxy)return r1;let r=new Map,n=(r,n)=>r1(r,n,e,t);return new Proxy((e,t)=>n(e,t),{get:(i,a)=>"create"===a?n:(r.has(a)||r.set(a,r1(a,void 0,e,t)),r.get(a))})}({animation:{Feature:class extends r2{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:r})=>(function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>ip(e,t,r)));else if("string"==typeof t)n=ip(e,t,r);else{let i="function"==typeof t?r5(e,t,r.custom):t;n=Promise.all(id(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})})(e,t,r))),r=ib(),n=!0,i=t=>(r,n)=>{let i=r5(e,n,"exit"===t?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...n}=i;r={...r,...n,...t}}return r};function a(a){let{props:s}=e,o=function e(t){if(!t)return;if(!t.isControllingVariants){let r=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(r.initial=t.props.initial),r}let r={};for(let e=0;e<im;e++){let n=t1[e],i=t.props[n];(tJ(i)||!1===i)&&(r[n]=i)}return r}(e.parent)||{},l=[],c=new Set,u={},d=1/0;for(let t=0;t<ig;t++){var h,p;let m=iy[t],f=r[m],x=void 0!==s[m]?s[m]:o[m],y=tJ(x),g=m===a?f.isActive:null;!1===g&&(d=t);let v=x===o[m]&&x!==s[m]&&y;if(v&&n&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...u},!f.isActive&&null===g||!x&&!f.prevProp||tZ(x)||"boolean"==typeof x)continue;let b=(h=f.prevProp,"string"==typeof(p=x)?p!==h:!!Array.isArray(p)&&!ix(p,h)),j=b||m===a&&f.isActive&&!v&&y||t>d&&y,w=!1,N=Array.isArray(x)?x:[x],k=N.reduce(i(m),{});!1===g&&(k={});let{prevResolvedValues:S={}}=f,O={...S,...k},P=t=>{j=!0,c.has(t)&&(w=!0,c.delete(t)),f.needsAnimating[t]=!0;let r=e.getValue(t);r&&(r.liveStyle=!1)};for(let e in O){let t=k[e],r=S[e];if(!u.hasOwnProperty(e))(r3(t)&&r3(r)?ix(t,r):t===r)?void 0!==t&&c.has(e)?P(e):f.protectedKeys[e]=!0:null!=t?P(e):c.add(e)}f.prevProp=x,f.prevResolvedValues=k,f.isActive&&(u={...u,...k}),n&&e.blockInitialAnimation&&(j=!1);let C=v&&b,A=!C||w;j&&A&&l.push(...N.map(t=>{let r={type:m};if("string"==typeof t&&n&&!C&&e.manuallyAnimateOnMount&&e.parent){let{parent:n}=e,i=r5(n,t);if(n.enteringChildren&&i){let{delayChildren:t}=i.transition||{};r.delay=ih(n.enteringChildren,e,t)}}return{animation:t,options:r}}))}if(c.size){let t={};if("boolean"!=typeof s.initial){let r=r5(e,Array.isArray(s.initial)?s.initial[0]:s.initial);r&&r.transition&&(t.transition=r.transition)}c.forEach(r=>{let n=e.getBaseTarget(r),i=e.getValue(r);i&&(i.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let m=!!l.length;return n&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(m=!1),n=!1,m?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){if(r[t].isActive===n)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,n)),r[t].isActive=n;let i=a(t);for(let e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=ib()}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();tZ(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends r2{constructor(){super(...arguments),this.id=ij++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends r2{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.unmount();let{viewport:r={}}=this.node.getProps(),{root:n,margin:i,amount:a="some",once:s}=r,o={root:n?n.current:void 0,rootMargin:i,threshold:"number"==typeof a?a:a7[a]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,s&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),i=t?r:n;i&&i(e)};return e=this.node.current,t=function({root:e,...t}){let r=e||document;a3.has(r)||a3.set(r,{});let n=a3.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(a8,{root:e,...t})),n[i]}(o),a4.set(e,l),t.observe(e),()=>{a4.delete(e),t.unobserve(e)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends r2{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){let[n,i,a]=aQ(e,r),s=e=>{let n=e.currentTarget;if(!a2(e))return;aJ.add(n);let a=t(n,e),s=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),aJ.has(n)&&aJ.delete(n),a2(e)&&"function"==typeof a&&a(e,{success:t})},o=e=>{s(e,n===window||n===document||r.useGlobalTarget||aZ(n,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",o,i),window.addEventListener("pointercancel",l,i)};return n.forEach(e=>{(r.useGlobalTarget?window:e).addEventListener("pointerdown",s,i),et(e)&&(e.addEventListener("focus",e=>((e,t)=>{let r=e.currentTarget;if(!r)return;let n=a0(()=>{if(aJ.has(r))return;a1(r,"down");let e=a0(()=>{a1(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>a1(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,i)),ik(e)||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}(e,(e,t)=>(a5(this.node,t,"Start"),(e,{success:t})=>a5(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends r2{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=r9(iS(this.node.current,"focus",()=>this.onFocus()),iS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends r2{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){let[n,i,a]=aQ(e,r),s=e=>{if(!aX(e))return;let{target:r}=e,n=t(r,e);if("function"!=typeof n||!r)return;let a=e=>{aX(e)&&(n(e),r.removeEventListener("pointerleave",a))};r.addEventListener("pointerleave",a,i)};return n.forEach(e=>{e.addEventListener("pointerenter",s,i)}),a}(e,(e,t)=>(aG(this.node,t,"Start"),e=>aG(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends r2{constructor(){super(...arguments),this.removePointerDownListener=tj}onPointerDown(e){this.session=new iF(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:iL(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:iG(e),onStart:iG(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&tS.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=iI(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends r2{constructor(e){super(e),this.removeGroupControls=tj,this.removeListeners=tj,this.controls=new iQ(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tj}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:aY,MeasureLayout:i2},layout:{ProjectionNode:aY,MeasureLayout:i2}},(e,t)=>t.isSVG??rD(e)?new rv(t):new rT(t,{allowProjection:e!==H.Fragment}));var se=e.i(13132),st=e.i(88069),sr=e.i(42098);function sn(e,t=300){let[r,n]=(0,H.useState)(e);return(0,H.useEffect)(()=>{let r=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}var si=e.i(45688),sa=e.i(88969);let ss=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function so(e){if(!e||e.length<2)return[];let t=await (0,sa.authFetch)(`${ss}/api/suggestions?q=${encodeURIComponent(e)}&limit=8`);if(!t.ok)throw Error("Failed to fetch suggestions");return(await t.json()).suggestions}var sl=e.i(1235),sc=e.i(71921);let su=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function sd(e){return(e.status??"active")!=="archived"&&(e.status??"active")!=="suppressed"}function sh(e,t){if(!e)return e;let r=(e,r)=>e.map(e=>e.id===t.id?t:e).filter(r),n=e.sections.contradictions.map(e=>({...e,memoryA:e.memoryA.id===t.id?t:e.memoryA,memoryB:e.memoryB.id===t.id?t:e.memoryB})).filter(e=>sd(e.memoryA)&&sd(e.memoryB)),i=e.sections.duplicates.map(e=>({...e,memoryA:e.memoryA.id===t.id?t:e.memoryA,memoryB:e.memoryB.id===t.id?t:e.memoryB})).filter(e=>sd(e.memoryA)&&sd(e.memoryB)),a={stale:r(e.sections.stale,e=>sd(e)&&(e.decayedScore??1)<.3),neverUsed:r(e.sections.neverUsed,e=>{var t;return sd(e)&&0===e.accessCount&&!!(t=e.createdAt)&&Date.now()-new Date(t).getTime()>=864e5}),lowTrust:r(e.sections.lowTrust,e=>sd(e)&&(e.trustScore??1)<.7),noisyAutoExtracted:r(e.sections.noisyAutoExtracted,e=>sd(e)&&("auto"===e.captureMethod||e.tags.includes("auto-extracted"))),projectless:r(e.sections.projectless,e=>sd(e)&&!(e.project&&e.project.trim())&&"global"!==e.scope),duplicates:i,contradictions:n};return{...e,summary:{stale:a.stale.length,neverUsed:a.neverUsed.length,lowTrust:a.lowTrust.length,noisyAutoExtracted:a.noisyAutoExtracted.length,projectless:a.projectless.length,duplicates:a.duplicates.length,contradictions:a.contradictions.length},openClaw:e.openClaw,sections:a}}async function sp(e){let t=e?`?project=${encodeURIComponent(e)}`:"",r=await (0,sa.authFetch)(`${su}/api/review/queue${t}`);if(!r.ok)throw Error(await (0,sa.readApiError)(r,"Failed to fetch review queue"));return r.json()}async function sm(e){let t=await (0,sa.authFetch)(`${su}/api/memories/${e.id}/review`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await (0,sa.readApiError)(t,"Failed to update review state"));return t.json()}async function sf(e){let t=await (0,sa.authFetch)(`${su}/api/memories/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await (0,sa.readApiError)(t,"Failed to merge memories"));return t.json()}function sx(){let e=(0,sl.useQueryClient)();return(0,sc.useMutation)({mutationFn:sm,onSuccess:t=>{e.setQueriesData({queryKey:["review-queue"]},e=>sh(e,t)),e.setQueriesData({queryKey:["memories"]},e=>e?{...e,memories:e.memories.map(e=>e.id===t.id?t:e)}:e),e.invalidateQueries({queryKey:["review-queue"]}),e.invalidateQueries({queryKey:["memories"]}),e.invalidateQueries({queryKey:["quality"]}),e.invalidateQueries({queryKey:["contradictions"]}),e.invalidateQueries({queryKey:["stats"]})}})}var sy=e.i(97358);function sg(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"now";if(t<60)return`${t}m ago`;let r=Math.floor(t/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);if(n<7)return`${n}d ago`;let i=Math.floor(n/7);return`${i}w ago`}function sv({memory:e,isSelected:t,onSelect:r,isChecked:n,onCheck:i}){let a=(0,sy.getCategoryColor)(e.category),s=(0,sy.getTypeColor)(e.type);return(0,W.jsxs)("div",{onClick:()=>r(e),className:`bg-slate-900 border rounded-lg p-3 hover:border-slate-600 cursor-pointer transition-colors relative ${t?"border-cyan-500":"border-slate-800"}`,children:[(0,W.jsx)("div",{className:"h-0.5 rounded-full bg-slate-800 mb-2 overflow-hidden",children:(0,W.jsx)("div",{className:"h-full rounded-full",style:{width:`${100*e.salience}%`,backgroundColor:a}})}),i&&(0,W.jsx)("input",{type:"checkbox",checked:n??!1,onChange:t=>{t.stopPropagation(),i(e.id,t.target.checked)},onClick:e=>e.stopPropagation(),className:"absolute top-3 right-3 w-4 h-4 accent-blue-500"}),(0,W.jsx)("h3",{className:"text-sm font-semibold text-white truncate pr-6",children:e.title}),(0,W.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:a+"22",color:a},children:e.category}),(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:s+"22",color:s},children:e.type.replace("_","-")}),e.status&&"active"!==e.status&&(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium bg-amber-500/15 text-amber-300",children:e.status}),e.pinned&&(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium bg-emerald-500/15 text-emerald-300",children:"pinned"})]}),(0,W.jsxs)("div",{className:"flex items-center gap-1.5 mt-2 flex-wrap",children:[e.sourceKind&&(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-slate-800 text-slate-300",children:e.sourceKind}),e.captureMethod&&(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-slate-800 text-slate-300",children:e.captureMethod}),"number"==typeof e.trustScore&&(0,W.jsxs)("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${e.trustScore<.7?"bg-red-500/15 text-red-300":"bg-emerald-500/15 text-emerald-300"}`,children:["trust ",e.trustScore.toFixed(2)]}),e.cloudExcluded&&(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/15 text-amber-300",children:"cloud excluded"})]}),(0,W.jsx)("p",{className:"text-[13px] text-slate-400 mt-1.5 line-clamp-3 leading-snug",children:e.content}),e.tags.length>0&&(0,W.jsxs)("div",{className:"flex items-center gap-1 mt-2 flex-wrap",children:[e.tags.slice(0,3).map(e=>(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-slate-800 text-slate-400",children:e},e)),e.tags.length>3&&(0,W.jsxs)("span",{className:"text-[10px] text-slate-500",children:["+",e.tags.length-3," more"]})]}),(0,W.jsxs)("div",{className:"flex items-center justify-between mt-2 text-[11px] text-slate-500",children:[(0,W.jsxs)("span",{children:["Created ",sg(e.createdAt)]}),(0,W.jsxs)("span",{children:["Accessed ",sg(e.lastAccessed)]})]})]})}function sb(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var a=t.length;for(r=0;r<a;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n}let sj=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),sw=[],sN=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],i=r.nextPart.get(n);if(i){let r=sN(e,t+1,i);if(r)return r}let a=r.validators;if(null===a)return;let s=0===t?e.join("-"):e.slice(t).join("-"),o=a.length;for(let e=0;e<o;e++){let t=a[e];if(t.validator(s))return t.classGroupId}},sk=(e,t)=>{let r=sj();for(let n in e)sS(e[n],r,n,t);return r},sS=(e,t,r,n)=>{let i=e.length;for(let a=0;a<i;a++)sO(e[a],t,r,n)},sO=(e,t,r,n)=>{"string"==typeof e?sP(e,t,r):"function"==typeof e?sC(e,t,r,n):sA(e,t,r,n)},sP=(e,t,r)=>{(""===e?t:sE(t,e)).classGroupId=r},sC=(e,t,r,n)=>{sM(e)?sS(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},sA=(e,t,r,n)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,s]=i[e];sS(s,sE(t,a),r,n)}},sE=(e,t)=>{let r=e,n=t.split("-"),i=n.length;for(let e=0;e<i;e++){let t=n[e],i=r.nextPart.get(t);i||(i=sj(),r.nextPart.set(t,i)),r=i}return r},sM=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,sT=[],s_=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),sD=/\s+/,sI=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=sI(e[n]))&&(r&&(r+=" "),r+=t);return r},sL=[],sz=e=>{let t=t=>t[e]||sL;return t.isThemeGetter=!0,t},sR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s$=/^\d+\/\d+$/,sB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sW=e=>s$.test(e),sH=e=>!!e&&!Number.isNaN(Number(e)),sY=e=>!!e&&Number.isInteger(Number(e)),sQ=e=>e.endsWith("%")&&sH(e.slice(0,-1)),sX=e=>sB.test(e),sG=()=>!0,sZ=e=>sU.test(e)&&!sq.test(e),sJ=()=>!1,s0=e=>sV.test(e),s1=e=>sK.test(e),s2=e=>!s4(e)&&!oe(e),s5=e=>oo(e,od,sJ),s4=e=>sR.test(e),s3=e=>oo(e,oh,sZ),s6=e=>oo(e,op,sH),s8=e=>oo(e,oc,sJ),s7=e=>oo(e,ou,s1),s9=e=>oo(e,of,s0),oe=e=>sF.test(e),ot=e=>ol(e,oh),or=e=>ol(e,om),on=e=>ol(e,oc),oi=e=>ol(e,od),oa=e=>ol(e,ou),os=e=>ol(e,of,!0),oo=(e,t,r)=>{let n=sR.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},ol=(e,t,r=!1)=>{let n=sF.exec(e);return!!n&&(n[1]?t(n[1]):r)},oc=e=>"position"===e||"percentage"===e,ou=e=>"image"===e||"url"===e,od=e=>"length"===e||"size"===e||"bg-size"===e,oh=e=>"length"===e,op=e=>"number"===e,om=e=>"family-name"===e,of=e=>"shadow"===e,ox=((e,...t)=>{let r,n,i,a,s=e=>{let t=n(e);if(t)return t;let a=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=t,s=[],o=e.trim().split(sD),l="";for(let e=o.length-1;e>=0;e-=1){let t=o[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let m=!!p,f=n(m?h.substring(0,p):h);if(!f){if(!m||!(f=n(h))){l=t+(l.length>0?" "+l:l);continue}m=!1}let x=0===u.length?"":1===u.length?u[0]:a(u).join(":"),y=d?x+"!":x,g=y+f;if(s.indexOf(g)>-1)continue;s.push(g);let v=i(f,m);for(let e=0;e<v.length;++e){let t=v[e];s.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return i(e,a),a};return a=o=>{var l;let c;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),i=(i,a)=>{r[i]=a,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(i(e,t),t):void 0},set(e,t){e in r?r[e]=t:i(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,i=0,a=0,s=e.length;for(let o=0;o<s;o++){let s=e[o];if(0===n&&0===i){if(":"===s){r.push(e.slice(a,o)),a=o+1;continue}if("/"===s){t=o;continue}}"["===s?n++:"]"===s?n--:"("===s?i++:")"===s&&i--}let o=0===r.length?e:e.slice(a),l=o,c=!1;return o.endsWith("!")?(l=o.slice(0,-1),c=!0):o.startsWith("!")&&(l=o.slice(1),c=!0),s_(r,c,l,t&&t>a?t-a:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):s_(sT,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(l),sortModifiers:(c=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],r=[];for(let n=0;n<e.length;n++){let i=e[n],a="["===i[0],s=c.has(i);a||s?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(i)):r.push(i)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return sk(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,i;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(i=t.slice(0,n))?"arbitrary.."+i:void 0)}let n=e.split("-"),i=+(""===n[0]&&n.length>1);return sN(n,i,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],i=r[e];if(t){if(i){let e=Array(i.length+t.length);for(let t=0;t<i.length;t++)e[t]=i[t];for(let r=0;r<t.length;r++)e[i.length+r]=t[r];return e}return t}return i||sw}return r[e]||sw}}})(l)}).cache.get,i=r.cache.set,a=s,s(o)},(...e)=>a(((...e)=>{let t,r,n=0,i="";for(;n<e.length;)(t=e[n++])&&(r=sI(t))&&(i&&(i+=" "),i+=r);return i})(...e))})(()=>{let e=sz("color"),t=sz("font"),r=sz("text"),n=sz("font-weight"),i=sz("tracking"),a=sz("leading"),s=sz("breakpoint"),o=sz("container"),l=sz("spacing"),c=sz("radius"),u=sz("shadow"),d=sz("inset-shadow"),h=sz("text-shadow"),p=sz("drop-shadow"),m=sz("blur"),f=sz("perspective"),x=sz("aspect"),y=sz("ease"),g=sz("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...b(),oe,s4],w=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],k=()=>[oe,s4,l],S=()=>[sW,"full","auto",...k()],O=()=>[sY,"none","subgrid",oe,s4],P=()=>["auto",{span:["full",sY,oe,s4]},sY,oe,s4],C=()=>[sY,"auto",oe,s4],A=()=>["auto","min","max","fr",oe,s4],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...k()],_=()=>[sW,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],D=()=>[e,oe,s4],I=()=>[...b(),on,s8,{position:[oe,s4]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",oi,s5,{size:[oe,s4]}],R=()=>[sQ,ot,s3],F=()=>["","none","full",c,oe,s4],$=()=>["",sH,ot,s3],B=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[sH,sQ,on,s8],V=()=>["","none",m,oe,s4],K=()=>["none",sH,oe,s4],W=()=>["none",sH,oe,s4],H=()=>[sH,oe,s4],Y=()=>[sW,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sX],breakpoint:[sX],color:[sG],container:[sX],"drop-shadow":[sX],ease:["in","out","in-out"],font:[s2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sX],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sX],shadow:[sX],spacing:["px",sH],text:[sX],"text-shadow":[sX],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sW,s4,oe,x]}],container:["container"],columns:[{columns:[sH,s4,oe,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[sY,"auto",oe,s4]}],basis:[{basis:[sW,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[sH,sW,"auto","initial","none",s4]}],grow:[{grow:["",sH,oe,s4]}],shrink:[{shrink:["",sH,oe,s4]}],order:[{order:[sY,"first","last","none",oe,s4]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],w:[{w:[o,"screen",..._()]}],"min-w":[{"min-w":[o,"screen","none",..._()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",r,ot,s3]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,oe,s6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sQ,s4]}],"font-family":[{font:[or,s4,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,oe,s4]}],"line-clamp":[{"line-clamp":[sH,"none",oe,s6]}],leading:[{leading:[a,...k()]}],"list-image":[{"list-image":["none",oe,s4]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",oe,s4]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[sH,"from-font","auto",oe,s3]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[sH,"auto",oe,s4]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe,s4]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe,s4]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sY,oe,s4],radial:["",oe,s4],conic:[sY,oe,s4]},oa,s7]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[sH,oe,s4]}],"outline-w":[{outline:["",sH,ot,s3]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",u,os,s9]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",d,os,s9]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[sH,s3]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",h,os,s9]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[sH,oe,s4]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[sH]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[oe,s4]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[sH]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",oe,s4]}],filter:[{filter:["","none",oe,s4]}],blur:[{blur:V()}],brightness:[{brightness:[sH,oe,s4]}],contrast:[{contrast:[sH,oe,s4]}],"drop-shadow":[{"drop-shadow":["","none",p,os,s9]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",sH,oe,s4]}],"hue-rotate":[{"hue-rotate":[sH,oe,s4]}],invert:[{invert:["",sH,oe,s4]}],saturate:[{saturate:[sH,oe,s4]}],sepia:[{sepia:["",sH,oe,s4]}],"backdrop-filter":[{"backdrop-filter":["","none",oe,s4]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[sH,oe,s4]}],"backdrop-contrast":[{"backdrop-contrast":[sH,oe,s4]}],"backdrop-grayscale":[{"backdrop-grayscale":["",sH,oe,s4]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[sH,oe,s4]}],"backdrop-invert":[{"backdrop-invert":["",sH,oe,s4]}],"backdrop-opacity":[{"backdrop-opacity":[sH,oe,s4]}],"backdrop-saturate":[{"backdrop-saturate":[sH,oe,s4]}],"backdrop-sepia":[{"backdrop-sepia":["",sH,oe,s4]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",oe,s4]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[sH,"initial",oe,s4]}],ease:[{ease:["linear","initial",y,oe,s4]}],delay:[{delay:[sH,oe,s4]}],animate:[{animate:["none",g,oe,s4]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,oe,s4]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:H()}],"skew-x":[{"skew-x":H()}],"skew-y":[{"skew-y":H()}],transform:[{transform:[oe,s4,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe,s4]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",oe,s4]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[sH,ot,s3,s6]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function oy(...e){return ox(sb(e))}function og({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card",className:oy("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function ov({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card-header",className:oy("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function ob({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card-title",className:oy("leading-none font-semibold",e),...t})}function oj({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card-content",className:oy("px-6",e),...t})}function ow(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var oN=Symbol.for("react.lazy"),ok=H[" use ".trim().toString()];function oS(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===oN&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var oO=((l=H.forwardRef((e,t)=>{let{children:r,...n}=e;if(oS(r)&&"function"==typeof ok&&(r=ok(r._payload)),H.isValidElement(r)){var i;let e,a,s=(i=r,(a=(e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(a=(e=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref),o=function(e,t){let r={...t};for(let n in t){let i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...a}:"className"===n&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==H.Fragment&&(o.ref=t?function(...e){return t=>{let r=!1,n=e.map(e=>{let n=ow(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():ow(e[t],null)}}}}(t,s):s),H.cloneElement(r,o)}return H.Children.count(r)>1?H.Children.only(null):null})).displayName="Slot.SlotClone",n=l,(i=H.forwardRef((e,t)=>{let{children:r,...i}=e;oS(r)&&"function"==typeof ok&&(r=ok(r._payload));let a=H.Children.toArray(r),s=a.find(oC);if(s){let e=s.props.children,r=a.map(t=>t!==s?t:H.Children.count(e)>1?H.Children.only(null):H.isValidElement(e)?e.props.children:null);return(0,W.jsx)(n,{...i,ref:t,children:H.isValidElement(e)?H.cloneElement(e,void 0,r):null})}return(0,W.jsx)(n,{...i,ref:t,children:r})})).displayName="Slot.Slot",i),oP=Symbol("radix.slottable");function oC(e){return H.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===oP}let oA=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,oE=(a="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",s={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==s?void 0:s.variants)==null)return sb(a,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:r,defaultVariants:n}=s,i=Object.keys(r).map(t=>{let i=null==e?void 0:e[t],a=null==n?void 0:n[t];if(null===i)return null;let s=oA(i)||oA(a);return r[t][s]}),o=e&&Object.entries(e).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return sb(a,i,null==s||null==(t=s.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:r,className:i,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...o}[t]):({...n,...o})[t]===r})?[...e,r,i]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)});function oM({className:e,variant:t="default",size:r="default",asChild:n=!1,...i}){return(0,W.jsx)(n?oO:"button",{"data-slot":"button","data-variant":t,"data-size":r,className:oy(oE({variant:t,size:r,className:e})),...i})}function oT({className:e,type:t,...r}){return(0,W.jsx)("input",{type:t,"data-slot":"input",className:oy("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var o_=e.i(33368),oD=e.i(24929);let oI=(0,oD.default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),oL=(0,oD.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),oz={references:{color:"#60a5fa",label:"References",icon:"→"},extends:{color:"#34d399",label:"Extends",icon:"⊃"},contradicts:{color:"#f87171",label:"Contradicts",icon:"⊗"},related:{color:"#a78bfa",label:"Related",icon:"~"}},oR=["architecture","pattern","preference","error","context","learning","todo","note","relationship","custom"];function oF({memory:e,links:t=[],memories:r=[],onClose:n,onReinforce:i,onSelectMemory:a,isReinforcing:s=!1,reinforceSuccess:o=!1}){let[l,c]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[h,p]=(0,H.useState)(null),[m,f]=(0,H.useState)(!1),[x,y]=(0,H.useState)(e.title),[g,v]=(0,H.useState)(e.content),[b,j]=(0,H.useState)(e.category),[w,N]=(0,H.useState)((e.tags||[]).join(", ")),[k,S]=(0,H.useState)(!1),O=(0,st.useEditMemory)(),P=(0,st.useDeleteMemory)(),[C,A]=(0,H.useState)(e.id);C!==e.id&&(A(e.id),f(!1),S(!1),y(e.title),v(e.content),j(e.category),N((e.tags||[]).join(", "))),(0,H.useEffect)(()=>{if(o&&h===e.id){let e=setTimeout(()=>c(!0),0),t=setTimeout(()=>c(!1),1500);return()=>{clearTimeout(e),clearTimeout(t)}}},[o,h,e.id]);let E=(0,o_.calculateDecayFactor)(e),M=(0,sy.getCategoryColor)(e.category),T=(0,sy.getTypeColor)(e.type),_=E>.7?{label:"Healthy",color:"#22C55E",bgColor:"rgba(34, 197, 94, 0.15)"}:E>.4?{label:"Fading",color:"#EAB308",bgColor:"rgba(234, 179, 8, 0.15)"}:{label:"Critical",color:"#EF4444",bgColor:"rgba(239, 68, 68, 0.15)"},D=(0,H.useMemo)(()=>{let n=[];for(let i of t)if(i.source_id===e.id){let e=r.find(e=>e.id===i.target_id);e&&n.push({memory:e,relationship:i.relationship,strength:i.strength,direction:"to"})}else if(i.target_id===e.id){let e=r.find(e=>e.id===i.source_id);e&&n.push({memory:e,relationship:i.relationship,strength:i.strength,direction:"from"})}return n.sort((e,t)=>t.strength-e.strength)},[e.id,t,r]),I=e=>{let t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/36e5);if(r<1)return"Just now";if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return n<7?`${n}d ago`:`${Math.floor(n/7)}w ago`},L="canonical"===e.status?"Canonical":"archived"===e.status?"Archived":"suppressed"===e.status?"Suppressed":e.pinned?"Pinned and active":"Active";return(0,W.jsxs)(og,{className:`bg-slate-900 border-slate-700 overflow-auto transition-all duration-300 ${l?"ring-2 ring-green-500 ring-opacity-75":""} ${u?"ring-2 ring-emerald-500 ring-opacity-75":""}`,children:[(0,W.jsxs)(ov,{className:"border-b border-slate-700 pb-3",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[m?(0,W.jsx)(oT,{value:x,onChange:e=>y(e.target.value),className:"bg-slate-800 border-slate-600 text-white text-lg font-semibold"}):(0,W.jsxs)(ob,{className:"text-lg font-semibold text-white leading-tight flex items-center gap-2",children:[u&&(0,W.jsx)(oL,{className:"w-4 h-4 text-emerald-400 shrink-0"}),e.title]}),(0,W.jsxs)("div",{className:"flex items-center gap-1 shrink-0 -mt-1",children:[!m&&(0,W.jsx)(oM,{variant:"ghost",size:"sm",onClick:()=>f(!0),className:"text-slate-400 hover:text-white",title:"Edit memory",children:(0,W.jsx)(oI,{className:"w-4 h-4"})}),(0,W.jsx)(oM,{variant:"ghost",size:"sm",onClick:n,className:"text-slate-400 hover:text-white",children:"✕"})]})]}),(0,W.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[m?(0,W.jsx)("select",{value:b,onChange:e=>j(e.target.value),className:"bg-slate-800 border border-slate-600 text-white text-xs rounded-lg px-2 py-1",children:oR.map(e=>(0,W.jsx)("option",{value:e,children:e},e))}):(0,W.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:M+"20",color:M},children:e.category}),(0,W.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:T+"20",color:T},children:e.type.replace("_","-")})]})]}),(0,W.jsxs)(oj,{className:"p-4 space-y-4",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-1",children:"Content"}),m?(0,W.jsx)("textarea",{value:g,onChange:e=>v(e.target.value),rows:6,className:"w-full bg-slate-800 border border-slate-600 text-sm text-slate-200 rounded-lg p-3 resize-y focus:ring-cyan-500 focus:border-cyan-500"}):(0,W.jsx)("p",{className:"text-sm text-slate-200 whitespace-pre-wrap leading-relaxed",children:e.content})]}),m&&(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-1",children:"Tags (comma-separated)"}),(0,W.jsx)(oT,{value:w,onChange:e=>N(e.target.value),placeholder:"tag1, tag2, tag3",className:"bg-slate-800 border-slate-600 text-white text-sm"})]}),m?(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsx)(oM,{variant:"default",size:"sm",onClick:()=>{let t=w.split(",").map(e=>e.trim()).filter(Boolean),r={};(x!==e.title&&(r.title=x),g!==e.content&&(r.content=g),b!==e.category&&(r.category=b),w!==(e.tags||[]).join(", ")&&(r.tags=t),0===Object.keys(r).length)?f(!1):O.mutate({id:e.id,updates:r},{onSuccess:()=>{f(!1),d(!0),setTimeout(()=>d(!1),1500)}})},disabled:O.isPending,className:"flex-1 bg-emerald-600 hover:bg-emerald-700",children:O.isPending?"Saving...":"Save Changes"}),(0,W.jsx)(oM,{variant:"outline",size:"sm",onClick:()=>{f(!1),y(e.title),v(e.content),j(e.category),N((e.tags||[]).join(", "))},className:"flex-1 border-slate-600 text-slate-300 hover:text-white",children:"Cancel"})]}):null,!m&&(0,W.jsxs)("div",{className:"rounded-lg p-3 flex items-center gap-3",style:{backgroundColor:_.bgColor},children:[(0,W.jsx)("div",{className:"w-3 h-3 rounded-full animate-pulse",style:{backgroundColor:_.color}}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-sm font-medium",style:{color:_.color},children:_.label}),(0,W.jsx)("div",{className:"text-xs text-slate-400",children:E>.7?"Memory is strong and stable":E>.4?"Memory is fading - reinforce to preserve":"Memory at risk of deletion - reinforce now"})]})]}),!m&&(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,W.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,W.jsx)("div",{className:"text-xs text-slate-400",children:"Salience"}),(0,W.jsxs)("div",{className:"text-lg font-bold text-white",children:[(100*e.salience).toFixed(0),"%"]}),(0,W.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,W.jsx)("div",{className:"h-full bg-gradient-to-r from-red-500 via-yellow-500 to-green-500 rounded-full transition-all",style:{width:`${100*e.salience}%`}})})]}),(0,W.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,W.jsx)("div",{className:"text-xs text-slate-400",children:"Decay Factor"}),(0,W.jsxs)("div",{className:"text-lg font-bold text-white",children:[(100*E).toFixed(0),"%"]}),(0,W.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,W.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${100*E}%`,backgroundColor:_.color}})})]})]}),!m&&(0,W.jsxs)("div",{className:`bg-slate-800 rounded-lg p-3 space-y-2 transition-all duration-300 ${l?"ring-1 ring-green-500/50":""}`,children:[(0,W.jsxs)("div",{className:"flex justify-between items-center",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Access Count"}),(0,W.jsxs)("span",{className:`text-sm font-medium transition-all duration-300 ${l?"text-green-400 scale-110":"text-white"}`,children:[e.accessCount," times"]})]}),(0,W.jsxs)("div",{className:"flex justify-between items-center",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Last Accessed"}),(0,W.jsx)("span",{className:`text-sm transition-all duration-300 ${l?"text-green-400":"text-white"}`,children:l?"Just now":I(e.lastAccessed)})]}),(0,W.jsxs)("div",{className:"flex justify-between items-center",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Created"}),(0,W.jsx)("span",{className:"text-sm text-white",children:new Date(e.createdAt).toLocaleString()})]})]}),!m&&(0,W.jsxs)("div",{className:"grid gap-3 md:grid-cols-1",children:[(0,W.jsxs)("div",{className:"rounded-lg bg-slate-800 p-3 space-y-2",children:[(0,W.jsx)("h4",{className:"text-xs font-medium uppercase tracking-[0.18em] text-slate-500",children:"Provenance"}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Source kind"}),(0,W.jsx)("span",{className:"text-white",children:e.sourceKind||"user"})]}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Capture"}),(0,W.jsx)("span",{className:"text-white",children:e.captureMethod||"manual"})]}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Trust"}),(0,W.jsx)("span",{className:"text-white",children:(e.trustScore??1).toFixed(2)})]}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Origin"}),(0,W.jsx)("span",{className:"truncate text-right text-slate-300",children:e.source||"user:direct"})]})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-slate-800 p-3 space-y-2",children:[(0,W.jsx)("h4",{className:"text-xs font-medium uppercase tracking-[0.18em] text-slate-500",children:"Review state"}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Status"}),(0,W.jsx)("span",{className:"text-white",children:L})]}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Pinned"}),(0,W.jsx)("span",{className:"text-white",children:e.pinned?"Yes":"No"})]}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Reviewed"}),(0,W.jsx)("span",{className:"text-white",children:e.reviewedAt?`${I(e.reviewedAt)} by ${e.reviewedBy||"operator"}`:"Not reviewed"})]})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-slate-800 p-3 space-y-2",children:[(0,W.jsx)("h4",{className:"text-xs font-medium uppercase tracking-[0.18em] text-slate-500",children:"Sync state"}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Scope"}),(0,W.jsx)("span",{className:"text-white",children:e.scope||"project"})]}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Cloud"}),(0,W.jsx)("span",{className:"text-white",children:e.cloudExcluded?"Excluded":"Eligible"})]}),(0,W.jsxs)("div",{className:"flex justify-between gap-3 text-sm",children:[(0,W.jsx)("span",{className:"text-slate-400",children:"Sensitivity"}),(0,W.jsx)("span",{className:"text-white",children:e.sensitivityLevel||"INTERNAL"})]})]})]}),!m&&D.length>0&&(0,W.jsxs)("div",{children:[(0,W.jsxs)("h4",{className:"text-xs font-medium text-slate-400 mb-2 flex items-center gap-2",children:[(0,W.jsx)("span",{className:"inline-block w-4 h-4",children:"🔗"}),"Related Memories (",D.length,")"]}),(0,W.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:D.map(({memory:e,relationship:t,strength:r,direction:n})=>{let i=oz[t]||oz.related,s=(0,sy.getCategoryColor)(e.category);return(0,W.jsxs)("button",{onClick:()=>a?.(e.id),className:"w-full text-left p-2 bg-slate-800 hover:bg-slate-750 rounded-lg transition-colors group",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,W.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:i.color}}),(0,W.jsx)("span",{className:"text-[10px] font-medium",style:{color:i.color},children:"to"===n?`${i.icon} ${i.label}`:`${i.label} ${i.icon}`}),(0,W.jsxs)("span",{className:"text-[10px] text-slate-500 ml-auto",children:[(100*r).toFixed(0),"%"]})]}),(0,W.jsx)("div",{className:"text-sm text-white truncate group-hover:text-blue-400 transition-colors",children:e.title}),(0,W.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,W.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{backgroundColor:s+"20",color:s},children:e.category}),(0,W.jsxs)("span",{className:"text-[10px] text-slate-500",children:[(100*e.salience).toFixed(0),"% salience"]})]})]},`${e.id}-${n}`)})})]}),!m&&e.tags&&e.tags.length>0&&(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Tags"}),(0,W.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map((e,t)=>(0,W.jsx)("span",{className:"px-2 py-0.5 bg-slate-700 text-slate-300 rounded text-xs",children:e},t))})]}),!m&&(0,W.jsxs)("div",{className:"space-y-2 pt-2",children:[i&&(0,W.jsx)(oM,{variant:"default",size:"sm",onClick:()=>{p(e.id),i?.(e.id)},disabled:s,className:`w-full transition-all duration-300 ${l?"bg-green-600 hover:bg-green-600":"bg-blue-600 hover:bg-blue-700"}`,children:s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("span",{className:"animate-spin mr-2",children:"⟳"}),"Reinforcing..."]}):l?(0,W.jsx)(W.Fragment,{children:"✓ Reinforced!"}):(0,W.jsx)(W.Fragment,{children:"⚡ Reinforce"})}),k?(0,W.jsxs)("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-3",children:[(0,W.jsx)("p",{className:"text-xs text-red-400 mb-2",children:"Delete this memory permanently?"}),(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsx)(oM,{variant:"default",size:"sm",onClick:()=>{P.mutate(e.id,{onSuccess:()=>{n()}})},disabled:P.isPending,className:"flex-1 bg-red-600 hover:bg-red-700",children:P.isPending?"Deleting...":"Confirm Delete"}),(0,W.jsx)(oM,{variant:"outline",size:"sm",onClick:()=>S(!1),className:"flex-1 border-slate-600 text-slate-300 hover:text-white",children:"Cancel"})]})]}):(0,W.jsx)(oM,{variant:"ghost",size:"sm",onClick:()=>S(!0),className:"w-full text-slate-500 hover:text-red-400 hover:bg-red-500/10",children:"Delete Memory"})]})]})]})}let o$=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function oB(e){return new Date(e).toLocaleString()}function oU({memories:e,selectedMemory:t,onSelectMemory:r,links:n=[],onReinforce:i,onSelectMemoryById:a,isReinforcing:s=!1,reinforceSuccess:o=!1}){let[l,c]=(0,H.useState)("salience"),[u,d]=(0,H.useState)("grid"),[h,p]=(0,H.useState)(!1),[m,f]=(0,H.useState)(new Set),[x,y]=(0,H.useState)(!1),[g,v]=(0,H.useState)(null),b=(0,sl.useQueryClient)(),{data:j}=(0,st.useOpenClawSessions)(),w=sx(),N=(0,H.useMemo)(()=>j?.sessions??[],[j?.sessions]);(0,H.useEffect)(()=>{N.length?g&&N.some(e=>e.sessionId===g)||v(N[0].sessionId):v(null)},[N,g]);let k=(0,H.useMemo)(()=>N.find(e=>e.sessionId===g)??N[0]??null,[N,g]),S=(0,H.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{switch(l){case"salience":return t.salience-e.salience;case"createdAt":return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();case"lastAccessed":return new Date(t.lastAccessed).getTime()-new Date(e.lastAccessed).getTime();case"decayedScore":return(t.decayedScore??t.salience)-(e.decayedScore??e.salience);default:return 0}}),t},[e,l]),O=(0,H.useCallback)((e,t)=>{f(r=>{let n=new Set(r);return t?n.add(e):n.delete(e),n})},[]),P=async()=>{if(0!==m.size){y(!0);try{await Promise.all(Array.from(m).map(e=>(0,sa.authFetch)(`${o$}/api/memories/${e}`,{method:"DELETE"}))),f(new Set),b.invalidateQueries({queryKey:["memories"]})}finally{y(!1)}}},C=(0,H.useCallback)((e,n)=>{w.mutate({id:e.id,action:n,reviewedBy:"capture-session",project:e.project??null,scope:e.scope},{onSuccess:async n=>{t?.id===e.id&&r(n),await Promise.all([b.invalidateQueries({queryKey:["memories"]}),b.invalidateQueries({queryKey:["openclaw-sessions"]}),b.invalidateQueries({queryKey:["review-queue"]})])}})},[r,b,w,t]);return(0,W.jsxs)("div",{className:"h-full overflow-y-auto bg-slate-950 pb-6",children:[(0,W.jsxs)("div",{className:"flex items-center gap-3 border-b border-slate-800 px-4 py-2",children:[(0,W.jsxs)("span",{className:"text-xs text-slate-400",children:[e.length," memories"]}),(0,W.jsx)("div",{className:"w-px h-5 bg-slate-700"}),(0,W.jsxs)("select",{value:l,onChange:e=>c(e.target.value),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded px-2 py-1",children:[(0,W.jsx)("option",{value:"salience",children:"Salience"}),(0,W.jsx)("option",{value:"createdAt",children:"Created"}),(0,W.jsx)("option",{value:"lastAccessed",children:"Last Accessed"}),(0,W.jsx)("option",{value:"decayedScore",children:"Decay Score"})]}),(0,W.jsxs)("div",{className:"flex items-center border border-slate-700 rounded overflow-hidden",children:[(0,W.jsx)("button",{onClick:()=>d("grid"),className:`px-2 py-1 text-xs ${"grid"===u?"bg-slate-700 text-white":"text-slate-400 hover:text-white"}`,children:"Grid"}),(0,W.jsx)("button",{onClick:()=>d("list"),className:`px-2 py-1 text-xs ${"list"===u?"bg-slate-700 text-white":"text-slate-400 hover:text-white"}`,children:"List"})]}),(0,W.jsx)("div",{className:"w-px h-5 bg-slate-700"}),(0,W.jsx)("button",{onClick:()=>{p(!h),f(new Set)},className:`px-2 py-1 text-xs rounded ${h?"bg-blue-600 text-white":"bg-slate-800 text-slate-400 hover:text-white"}`,children:"Select"}),h&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("button",{onClick:()=>f(new Set(S.map(e=>e.id))),className:"px-2 py-1 text-xs text-slate-400 hover:text-white",children:"Select all"}),(0,W.jsx)("button",{onClick:P,disabled:0===m.size||x,className:"px-2 py-1 text-xs rounded bg-red-600/20 text-red-400 hover:bg-red-600/40 disabled:opacity-40",children:x?"Deleting...":`Delete (${m.size})`})]})]}),(0,W.jsx)("div",{className:"px-4 pt-4",children:(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"inline-flex items-center gap-2 rounded-full border border-cyan-500/20 bg-cyan-500/10 px-3 py-1 text-xs uppercase tracking-[0.18em] text-cyan-300",children:"Capture Workflow"}),(0,W.jsx)("h2",{className:"mt-3 text-2xl font-semibold text-white",children:"See what was captured, from where, and how risky it looks."}),(0,W.jsx)("p",{className:"mt-2 max-w-2xl text-sm text-slate-400",children:"Capture is where stored memories, OpenClaw sessions, and source trust come together. Use it to inspect what got saved before it quietly shapes recall."})]}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Memories"}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:e.length})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"OpenClaw sessions"}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:j?.summary.sessions??0})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Auto-saved"}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:j?.summary.saved??0})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Threats"}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:j?.summary.threats??0})]})]})]}),(0,W.jsxs)("div",{className:"mt-6 grid gap-4 xl:grid-cols-[minmax(340px,0.8fr)_minmax(0,1.2fr)]",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"OpenClaw sessions"}),(0,W.jsxs)("div",{className:"text-xs text-slate-500",children:[N.length," recent"]})]}),(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[N.slice(0,8).map(e=>(0,W.jsxs)("button",{onClick:()=>v(e.sessionId),className:`block w-full rounded-xl border p-4 text-left transition-colors ${k?.sessionId===e.sessionId?"border-cyan-400/40 bg-cyan-500/10":"border-slate-800 bg-slate-900/70 hover:border-slate-700"}`,children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e.sessionId}),(0,W.jsxs)("div",{className:"mt-1 text-xs text-slate-500",children:[e.models[0]||"model unknown"," · ",function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let r=Math.floor(t/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return`${n}d ago`}(e.lastSeenAt)]})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-slate-800 px-3 py-2 text-right",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Saved"}),(0,W.jsx)("div",{className:"text-base font-semibold text-white",children:e.saved})]})]}),(0,W.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[(0,W.jsxs)("span",{className:"rounded-full border border-slate-700 px-2 py-1 text-slate-300",children:[e.skipped," skipped"]}),(0,W.jsxs)("span",{className:`rounded-full border px-2 py-1 ${e.threats>0?"border-red-500/40 text-red-300":"border-emerald-500/40 text-emerald-300"}`,children:[e.threats," threat",1===e.threats?"":"s"]}),e.quarantined>0&&(0,W.jsxs)("span",{className:"rounded-full border border-amber-500/40 px-2 py-1 text-amber-300",children:[e.quarantined," quarantined"]}),e.hooks.map(e=>(0,W.jsx)("span",{className:"rounded-full border border-slate-700 px-2 py-1 text-slate-300",children:e},e))]})]},e.sessionId)),!j?.sessions?.length&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"No recent OpenClaw session evidence found."})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Session View"}),(0,W.jsx)("div",{className:"mt-1 text-lg font-semibold text-white",children:k?`OpenClaw session ${k.sessionId}`:"Select a session"})]}),k&&(0,W.jsxs)("div",{className:"text-right text-xs text-slate-500",children:[(0,W.jsxs)("div",{children:["First seen ",oB(k.firstSeenAt)]}),(0,W.jsxs)("div",{children:["Last seen ",oB(k.lastSeenAt)]})]})]}),k?(0,W.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,W.jsxs)("div",{className:"grid gap-3 md:grid-cols-3 xl:grid-cols-6",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Saved"}),(0,W.jsx)("div",{className:"mt-2 text-xl font-semibold text-white",children:k.saved})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Skipped"}),(0,W.jsx)("div",{className:"mt-2 text-xl font-semibold text-white",children:k.skipped})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Threats"}),(0,W.jsx)("div",{className:"mt-2 text-xl font-semibold text-white",children:k.threats})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Auto"}),(0,W.jsx)("div",{className:"mt-2 text-xl font-semibold text-white",children:k.autoExtracted})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Keyword"}),(0,W.jsx)("div",{className:"mt-2 text-xl font-semibold text-white",children:k.keywordTriggered})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Suppressed"}),(0,W.jsx)("div",{className:"mt-2 text-xl font-semibold text-white",children:k.suppressed})]})]}),(0,W.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)]",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Session recap"}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-300",children:"Review the exact memories this session created and decide what should stay hot."})]}),(0,W.jsxs)("div",{className:"text-right text-xs text-slate-500",children:[(0,W.jsx)("div",{children:k.models.join(", ")||"model unknown"}),(0,W.jsx)("div",{children:k.agentIds.join(", ")||"agent unknown"})]})]}),(0,W.jsx)("div",{className:"mt-4 space-y-3",children:k.memories.length>0?k.memories.map(e=>{let t;return(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,W.jsxs)("div",{className:"min-w-0",children:[(0,W.jsx)("button",{onClick:()=>r(e),className:"text-left text-base font-medium text-white hover:text-cyan-300",children:e.title}),(0,W.jsxs)("div",{className:"mt-1 text-xs text-slate-500",children:[e.category," · ",e.captureMethod||"manual"," · trust ",(e.trustScore??1).toFixed(2)]}),(0,W.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:((t=[e.pinned?{label:"Pinned",tone:"emerald"}:null,"canonical"===e.status?{label:"Canonical",tone:"emerald"}:null,"suppressed"===e.status?{label:"Suppressed",tone:"amber"}:null,"archived"===e.status?{label:"Archived",tone:"slate"}:null,e.cloudExcluded?{label:"Cloud excluded",tone:"cyan"}:null,"global"===e.scope?{label:"Global",tone:"violet"}:null].filter(Boolean)).length>0?t:[{label:"Ready for recall",tone:"slate"}]).map(e=>(0,W.jsx)("span",{className:`rounded-full border px-2.5 py-1 text-[11px] ${{emerald:"border-emerald-500/30 bg-emerald-500/10 text-emerald-200",amber:"border-amber-500/30 bg-amber-500/10 text-amber-200",slate:"border-slate-700 bg-slate-800/80 text-slate-300",cyan:"border-cyan-500/30 bg-cyan-500/10 text-cyan-200",violet:"border-violet-500/30 bg-violet-500/10 text-violet-200"}[e.tone]}`,children:e.label},e.label))}),(0,W.jsx)("div",{className:"mt-2 line-clamp-2 text-sm text-slate-400",children:e.content})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-slate-800 px-3 py-2 text-right",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Next move"}),(0,W.jsx)("div",{className:"text-sm text-slate-100",children:"canonical"===e.status?"Keep hot":"suppressed"===e.status?"Restore or leave suppressed":"archived"===e.status?"Restore or leave archived":"Review or keep"})]})]}),(0,W.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,W.jsx)("button",{onClick:()=>r(e),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Inspect"}),(0,W.jsx)("button",{disabled:w.isPending,onClick:()=>C(e,e.pinned?"unpin":"pin"),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:e.pinned?"Unpin":"Pin"}),(0,W.jsx)("button",{disabled:w.isPending,onClick:()=>C(e,"suppressed"===e.status?"restore":"suppress"),className:"rounded-lg border border-amber-500/40 px-3 py-1 text-xs text-amber-300 hover:bg-amber-500/10 disabled:opacity-50",children:"suppressed"===e.status?"Restore":"Discard"}),(0,W.jsx)("button",{disabled:w.isPending,onClick:()=>C(e,"archived"===e.status?"restore":"archive"),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:"archived"===e.status?"Restore":"Archive"}),(0,W.jsx)("button",{disabled:w.isPending,onClick:()=>C(e,"canonicalize"),className:"rounded-lg border border-emerald-500/40 px-3 py-1 text-xs text-emerald-300 hover:bg-emerald-500/10 disabled:opacity-50",children:"Keep as canonical"})]})]},e.id)}):(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"No stored memories were linked back to this session."})})]}),(0,W.jsxs)("div",{className:"space-y-4",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Security cues"}),(0,W.jsxs)("div",{className:"mt-4 space-y-3 text-sm text-slate-400",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:["Threats: ",k.threats," · blocked hints: ",k.blocked," · quarantine hints: ",k.quarantined]}),(0,W.jsx)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:"Low-trust or noisy auto-extracted memories belong in Review before they influence recall too much."}),(0,W.jsx)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:"Shield remains the place to inspect blocked/quarantined operations and policy pressure across sources."})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Event trail"}),(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[k.events.slice(0,8).map((e,t)=>(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-3",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:"memory"===e.type?"Memory capture":"quarantine"===e.type?"Quarantine pressure":"blocked"===e.type?"Blocked signal":"Threat signal"}),(0,W.jsx)("div",{className:"text-xs text-slate-500",children:oB(e.ts)})]}),(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-500",children:[e.hook,e.model].filter(Boolean).join(" · ")||"OpenClaw event"}),"number"==typeof e.count&&(0,W.jsxs)("div",{className:"mt-2 text-xs text-slate-400",children:["saved ",e.count,"number"==typeof e.skipped?` \xb7 skipped ${e.skipped}`:""]}),e.preview&&(0,W.jsx)("div",{className:"mt-2 line-clamp-3 text-xs text-slate-400",children:e.preview})]},`${e.ts}-${e.type}-${t}`)),!k.events.length&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"No event trail was found for this session."})]})]})]})]})]}):(0,W.jsx)("div",{className:"mt-6 text-sm text-slate-400",children:"Choose a session to inspect what OpenClaw learned, skipped, or tripped over."})]})]})]})}),(0,W.jsxs)("div",{className:"p-4",children:[(0,W.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Captured memories"}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:"Inspect the actual memory records that came out of capture, not just the session summary."})]}),(0,W.jsxs)("div",{className:"text-xs text-slate-500",children:[S.length," record",1===S.length?"":"s"]})]}),(0,W.jsxs)("div",{className:t?"grid gap-4 xl:grid-cols-[minmax(0,1fr)_420px] xl:items-start":"",children:[(0,W.jsx)("div",{className:"grid"===u?"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3":"flex max-w-2xl flex-col gap-3",children:S.map(e=>(0,W.jsx)(sv,{memory:e,isSelected:t?.id===e.id,onSelect:r,isChecked:h?m.has(e.id):void 0,onCheck:h?O:void 0},e.id))}),t&&(0,W.jsx)("div",{className:"xl:sticky xl:top-4 xl:self-start",children:(0,W.jsxs)("div",{className:"rounded-xl border border-cyan-500/20 bg-slate-900/50",children:[(0,W.jsxs)("div",{className:"border-b border-slate-800 px-4 py-3",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-cyan-300",children:"Selected memory"}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:"Inspect the selected memory while you move through captured records. Clicking another card updates this panel in place."})]}),(0,W.jsx)("div",{className:"xl:max-h-[calc(100vh-8rem)] xl:overflow-y-auto",children:(0,W.jsx)(oF,{memory:t,links:n,memories:e,onClose:()=>r(null),onReinforce:i,onSelectMemory:a,isReinforcing:s,reinforceSuccess:o})})]})})]})]})]})}var oq=e.i(87353);let oV=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function oK(){let e=await (0,sa.authFetch)(`${oV}/api/license/status`);if(!e.ok)throw Error("Failed to fetch license status");return e.json()}async function oW(e){let t=await (0,sa.authFetch)(`${oV}/api/license/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e})});if(!t.ok)throw Error((await t.json().catch(()=>({error:"Activation failed"}))).error||"Activation failed");return t.json()}async function oH(){let e=await (0,sa.authFetch)(`${oV}/api/license/deactivate`,{method:"POST"});if(!e.ok)throw Error("Failed to deactivate license");return e.json()}function oY(){return(0,si.useQuery)({queryKey:["license-status"],queryFn:oK,refetchInterval:6e4,retry:2})}let oQ=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function oX({data:e,color:t="#22d3ee",width:r=24,height:n=10}){if(!e||0===e.length)return null;if(1===e.length)return(0,W.jsx)("svg",{width:r,height:n,viewBox:`0 0 ${r} ${n}`,children:(0,W.jsx)("circle",{cx:r/2,cy:n/2,r:1,fill:t,opacity:.6})});let i=Math.max(...e,1),a=r-2,s=n-2,o=e.map((t,r)=>{let n=1+r/(e.length-1)*a;return`${n.toFixed(1)},${(1+s-t/i*s).toFixed(1)}`}).join(" ");return(0,W.jsx)("svg",{width:r,height:n,viewBox:`0 0 ${r} ${n}`,className:"shrink-0",children:(0,W.jsx)("polyline",{points:o,fill:"none",stroke:t,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",opacity:.6})})}let oG=(0,oD.default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),oZ=(0,oD.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),oJ=(0,oD.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),o0=(0,oD.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),o1=(0,oD.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),o2=(0,oD.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),o5=(0,oD.default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),o4=(0,oD.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),o3=(0,oD.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]),o6=(0,oD.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),o8=(0,oD.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var o7=e.i(6847);let o9=(0,oD.default)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),le=(0,oD.default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),lt=[{id:"overview",label:"Home",icon:oG},{id:"recall",label:"Recall",icon:o7.Search},{id:"review",label:"Review",icon:o9},{id:"shield",label:"Shield",icon:oZ},{id:"graph",label:"Graph",icon:o5},{id:"cloud",label:"Cloud",icon:le},{id:"audit",label:"Audit",icon:oJ},{id:"memories",label:"Capture",icon:o1},{id:"quarantine",label:"Queue",icon:o0},{id:"agents",label:"Agents",icon:o4},{id:"skills",label:"Skills",icon:o3},{id:"dome",label:"Dome",icon:o6},{id:"timeline",label:"Timeline",icon:o8},{id:"brain",label:"Brain",icon:o2}],lr=new Set(["shield","audit","skills","dome"]);function ln(){let{viewMode:e,setViewMode:t}=(0,sr.useDashboardStore)(),{data:r}=(0,st.useStats)(),{data:n}=(0,oq.useAuditStats)("24h"),{data:i}=(0,st.useVersion)(),{data:a}=oY(),{memoryTrend:s,threatTrend:o}=function(){let{data:e}=(0,si.useQuery)({queryKey:["activity-trend"],queryFn:async()=>{let e=await (0,sa.authFetch)(`${oQ}/api/memories/activity`);if(!e.ok)throw Error("Failed to fetch activity");return e.json()},staleTime:3e5,refetchInterval:3e5}),t=new Date;t.setDate(t.getDate()-7);let r=t.toISOString(),{data:n}=(0,si.useQuery)({queryKey:["threat-trend"],queryFn:async()=>{let e=new URLSearchParams({firewallResult:"BLOCK",startTime:r,limit:"500"}),t=await (0,sa.authFetch)(`${oQ}/api/v1/audit?${e}`);if(!t.ok)throw Error("Failed to fetch audit logs");return t.json()},staleTime:3e5,refetchInterval:3e5}),i=[];for(let e=6;e>=0;e--){let t=new Date;t.setDate(t.getDate()-e),i.push(t.toISOString().slice(0,10))}let a=new Map;if(e?.activity)for(let t of e.activity)a.set(t.date,t.count);let s=i.map(e=>a.get(e)??0),o=new Map;if(n?.logs)for(let e of n.logs){let t=e.timestamp.slice(0,10);o.set(t,(o.get(t)??0)+1)}return{memoryTrend:s,threatTrend:i.map(e=>o.get(e)??0)}}(),l=!a||"free"===a.tier,c=r?.decayDistribution?Math.round(r.decayDistribution.healthy/Math.max(1,r.total)*100):null,u=n?.blockedCount??0;return(0,W.jsxs)("nav",{className:"w-14 border-r border-slate-800 bg-slate-900/50 flex flex-col items-center py-3 shrink-0",children:[(0,W.jsx)("div",{className:"flex-1 flex flex-col items-center gap-1",children:lt.map(({id:r,label:n,icon:i})=>{let a="memories"===r?s:"shield"===r?o:null,c="shield"===r?"#f87171":"#22d3ee",d=a&&a.some(e=>e>0);return(0,W.jsxs)("button",{onClick:()=>t(r),className:`relative w-10 rounded-lg flex flex-col items-center justify-center gap-0.5 transition-colors ${d?"h-12":"h-10"} ${e===r?"dome"===r?"bg-red-600/20 text-red-400":"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300 hover:bg-slate-800"}`,title:n,children:[(0,W.jsx)(i,{size:18}),d&&(0,W.jsx)(oX,{data:a,color:c,width:24,height:10}),(0,W.jsx)("span",{className:"text-[9px] leading-none",children:n}),"shield"===r&&u>0&&(0,W.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] rounded-full bg-red-500 text-white text-[8px] flex items-center justify-center px-0.5",children:u>99?"99+":u}),l&&lr.has(r)&&(0,W.jsx)("span",{className:"absolute -bottom-0.5 -left-0.5 px-1 h-[12px] rounded-full bg-cyan-600/80 text-white text-[7px] font-bold flex items-center justify-center leading-none",children:"PRO"})]},r)})}),(0,W.jsxs)("div",{className:"flex flex-col items-center gap-1 text-[10px] text-slate-500",children:[r&&(0,W.jsx)("span",{children:r.total}),null!==c&&(0,W.jsxs)("span",{children:[c,"%"]}),i?.version&&(0,W.jsxs)("span",{children:["v",i.version]})]})]})}let li=(0,oD.default)("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]),la=(0,oD.default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),ls=(0,oD.default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),lo=(0,oD.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ll=[{key:"trust",label:"Trust",icon:oZ,color:"text-blue-400",bg:"bg-blue-400/10"},{key:"firewall",label:"Firewall",icon:li,color:"text-orange-400",bg:"bg-orange-400/10"},{key:"sensitivity",label:"Sensitivity",icon:la,color:"text-purple-400",bg:"bg-purple-400/10"},{key:"fragmentation",label:"Fragment",icon:ls,color:"text-cyan-400",bg:"bg-cyan-400/10"},{key:"audit",label:"Audit",icon:oJ,color:"text-green-400",bg:"bg-green-400/10"}],lc={strict:{color:"text-red-400",bg:"bg-red-400/10"},balanced:{color:"text-cyan-400",bg:"bg-cyan-400/10"},permissive:{color:"text-green-400",bg:"bg-green-400/10"}};function lu({timeRange:e}){let{projectFilter:t}=(0,sr.useDashboardStore)(),{data:r,isLoading:n,isError:i}=(0,oq.useAuditStats)(e,t||void 0),{data:a}=(0,oq.useDefenceConfig)(),s=(0,oq.useSetDefenceMode)(),[o,l]=(0,H.useState)(!1),c=(0,H.useRef)(null),u=a?.mode??"balanced",d=lc[u];return(0,H.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&l(!1)}return o&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]),(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[a?.tampered&&(0,W.jsxs)("div",{className:"flex items-center gap-2 bg-red-500/10 border border-red-500/30 rounded-lg px-3 py-2 mb-3",children:[(0,W.jsx)(o0,{size:14,className:"text-red-400 shrink-0"}),(0,W.jsx)("span",{className:"text-xs text-red-400",children:"Config integrity check failed — running in strict mode"})]}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Defence Pipeline"}),(0,W.jsx)("div",{className:"flex items-center gap-1 mb-4",children:ll.map(({key:e,label:t,icon:r,color:n,bg:i},a)=>(0,W.jsxs)("div",{className:"flex items-center",children:[(0,W.jsxs)("div",{className:`flex items-center gap-1.5 px-3 py-2 rounded-lg ${i}`,children:[(0,W.jsx)(r,{size:14,className:n}),(0,W.jsx)("span",{className:`text-xs font-medium ${n}`,children:t})]}),a<ll.length-1&&(0,W.jsx)("div",{className:"w-4 h-px bg-slate-700 mx-0.5"})]},e))}),n?(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading stats..."}):i?(0,W.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load stats"}):r?(0,W.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,W.jsxs)("div",{className:"text-center",children:[(0,W.jsx)("div",{className:"text-2xl font-bold text-green-400",children:r.allowedCount}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Allowed"})]}),(0,W.jsxs)("div",{className:"text-center",children:[(0,W.jsx)("div",{className:"text-2xl font-bold text-red-400",children:r.blockedCount}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Blocked"})]}),(0,W.jsxs)("div",{className:"text-center",children:[(0,W.jsx)("div",{className:"text-2xl font-bold text-yellow-400",children:r.quarantinedCount}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Quarantined"})]})]}):(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"No data"}),(0,W.jsx)("button",{onClick:()=>sr.useDashboardStore.getState().setViewMode("audit"),className:"mt-3 w-full text-center text-xs text-cyan-400 hover:text-cyan-300 transition-colors py-1",children:"View full audit log →"}),(0,W.jsxs)("div",{className:"mt-2 pt-3 border-t border-slate-800 flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs text-slate-500",children:"Firewall Mode"}),(0,W.jsxs)("div",{className:"relative",ref:c,children:[(0,W.jsxs)("button",{onClick:()=>l(!o),className:`text-xs font-medium ${d.color} ${d.bg} px-2 py-0.5 rounded flex items-center gap-1 hover:opacity-80 transition-opacity`,children:[u,(0,W.jsx)(lo,{size:10})]}),o&&(0,W.jsx)("div",{className:"absolute right-0 top-full mt-1 bg-slate-800 border border-slate-700 rounded-lg shadow-xl z-50 min-w-[120px] py-1",children:["strict","balanced","permissive"].map(e=>{let t=lc[e];return(0,W.jsxs)("button",{onClick:()=>{s.mutate(e),l(!1)},className:`w-full text-left px-3 py-1.5 text-xs hover:bg-slate-700/50 transition-colors flex items-center justify-between ${e===u?t.color+" font-medium":"text-slate-400"}`,children:[e,e===u&&(0,W.jsx)("span",{className:"text-[10px]",children:"✓"})]},e)})})]})]})]})}function ld(){let{setViewMode:e,projectFilter:t}=(0,sr.useDashboardStore)(),{data:r,isLoading:n,isError:i}=(0,oq.useQuarantine)("pending",3,t||void 0),a=r?.total??0,s=r?.items??[];return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"Quarantine Queue"}),a>0&&(0,W.jsxs)("span",{className:"text-xs font-medium text-yellow-400 bg-yellow-400/10 px-2 py-0.5 rounded-full",children:[a," pending"]})]}),n?(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."}):i?(0,W.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load quarantine"}):0===s.length?(0,W.jsxs)("div",{className:"flex flex-col items-center py-6 text-slate-500",children:[(0,W.jsx)(o0,{size:24,className:"mb-2 text-slate-600"}),(0,W.jsx)("span",{className:"text-xs",children:"No items in quarantine"})]}):(0,W.jsx)("div",{className:"space-y-2",children:s.map(e=>{let t=(()=>{try{return JSON.parse(e.threat_indicators)}catch{return[]}})();return(0,W.jsxs)("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-3",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between",children:[(0,W.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,W.jsx)("div",{className:"text-xs font-medium text-white truncate",children:e.title||"Untitled"}),(0,W.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0.5",children:[e.source_type," · ",new Date(e.created_at).toLocaleTimeString()]})]}),(0,W.jsx)("span",{className:"text-[10px] text-red-400 bg-red-400/10 px-1.5 py-0.5 rounded shrink-0 ml-2",children:e.reason?.slice(0,30)||"Threat detected"})]}),t.length>0&&(0,W.jsx)("div",{className:"flex gap-1 mt-1.5 flex-wrap",children:t.slice(0,3).map((e,t)=>(0,W.jsx)("span",{className:"text-[9px] text-yellow-400 bg-yellow-400/10 px-1 py-0.5 rounded",children:e},t))})]},e.id)})}),a>0&&(0,W.jsxs)("button",{onClick:()=>e("quarantine"),className:"w-full mt-3 text-xs text-cyan-400 hover:text-cyan-300 transition-colors",children:["Review all ",a," items →"]})]})}function lh({timeRange:e}){let{projectFilter:t}=(0,sr.useDashboardStore)(),r={"24h":24,"7d":168,"30d":720},[n,i]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{i(Date.now())},[e]);let a=(0,H.useMemo)(()=>new Date(6e4*Math.floor((n-36e5*r[e])/6e4)).toISOString(),[n,e]),{data:s,isLoading:o,isError:l}=(0,oq.useAuditLogs)({startTime:a,project:t||void 0,limit:500}),c=(0,H.useMemo)(()=>{if(!s?.logs.length)return[];let t="24h"===e?36e5:"7d"===e?216e5:864e5,r="24h"===e?24:"7d"===e?28:30,i=Array.from({length:r},(e,i)=>({time:n-(r-1-i)*t,allowed:0,blocked:0,quarantined:0}));for(let e of s.logs){let a=Math.floor((new Date(e.timestamp).getTime()-(n-r*t))/t),s=Math.min(Math.max(a,0),r-1);a>=0&&a<=r&&("ALLOW"===e.firewall_result?i[s].allowed++:"BLOCK"===e.firewall_result?i[s].blocked++:"QUARANTINE"===e.firewall_result&&i[s].quarantined++)}return i},[s,e,n]),u=Math.max(1,...c.map(e=>e.allowed+e.blocked+e.quarantined));return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Threat Timeline"}),o?(0,W.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading timeline..."})}):l?(0,W.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,W.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load timeline"})}):0===c.length?(0,W.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"No audit data"})}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{className:"flex gap-px h-32",children:c.map((e,t)=>{let r=e.allowed+e.blocked+e.quarantined,n=r>0?e.blocked/r*100:0,i=r>0?e.quarantined/r*100:0;return(0,W.jsx)("div",{className:"flex-1 flex flex-col justify-end",title:`${new Date(e.time).toLocaleString()}: ${e.allowed} allowed, ${e.blocked} blocked, ${e.quarantined} quarantined`,children:(0,W.jsx)("div",{className:"w-full rounded-t-sm overflow-hidden",style:{height:`${Math.max(r/u*100,2*(r>0))}%`},children:(0,W.jsxs)("div",{className:"w-full h-full flex flex-col-reverse",children:[e.blocked>0&&(0,W.jsx)("div",{className:"bg-red-500",style:{height:`${n}%`}}),e.quarantined>0&&(0,W.jsx)("div",{className:"bg-yellow-500",style:{height:`${i}%`}}),(0,W.jsx)("div",{className:"bg-emerald-500/60 flex-1"})]})})},t)})}),(0,W.jsxs)("div",{className:"flex gap-4 mt-3 justify-center",children:[(0,W.jsxs)("div",{className:"flex items-center gap-1",children:[(0,W.jsx)("div",{className:"w-2 h-2 rounded-full bg-emerald-500/60"}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:"Allowed"})]}),(0,W.jsxs)("div",{className:"flex items-center gap-1",children:[(0,W.jsx)("div",{className:"w-2 h-2 rounded-full bg-red-500"}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:"Blocked"})]}),(0,W.jsxs)("div",{className:"flex items-center gap-1",children:[(0,W.jsx)("div",{className:"w-2 h-2 rounded-full bg-yellow-500"}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:"Quarantined"})]})]}),(0,W.jsx)("button",{onClick:()=>sr.useDashboardStore.getState().setViewMode("audit"),className:"mt-3 w-full text-center text-xs text-cyan-400 hover:text-cyan-300 transition-colors py-1",children:"View detailed audit log →"})]})]})}function lp({timeRange:e}){let{projectFilter:t}=(0,sr.useDashboardStore)(),{data:r,isLoading:n,isError:i}=(0,oq.useAuditStats)(e,t||void 0);if(n)return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."})]});if(i)return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,W.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load stats"})]});if(!r)return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"No data"})]});let a=r.totalOperations||1,s=(r.blockedCount/a*100).toFixed(1),o=Object.entries(r.threatBreakdown||{}).sort((e,t)=>t[1]-e[1]).slice(0,5);return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,W.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-3 text-center",children:[(0,W.jsx)("div",{className:"text-2xl font-bold text-white",children:r.totalOperations}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Total Scans"})]}),(0,W.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-3 text-center",children:[(0,W.jsxs)("div",{className:`text-2xl font-bold ${parseFloat(s)>10?"text-red-400":"text-green-400"}`,children:[s,"%"]}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Block Rate"})]})]}),r.topSources.length>0&&(0,W.jsxs)("div",{className:"mb-4",children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-2",children:"Top Sources"}),(0,W.jsx)("div",{className:"space-y-1",children:r.topSources.slice(0,3).map(e=>(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:e.source}),(0,W.jsx)("span",{className:"text-xs text-slate-500",children:e.count})]},e.source))})]}),o.length>0&&(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-2",children:"Threat Types"}),(0,W.jsx)("div",{className:"space-y-1",children:o.map(([e,t])=>(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:e}),(0,W.jsx)("span",{className:"text-xs font-medium text-red-400",children:t})]},e))})]}),(0,W.jsx)("button",{onClick:()=>sr.useDashboardStore.getState().setViewMode("audit"),className:"mt-3 w-full text-center text-xs text-cyan-400 hover:text-cyan-300 transition-colors py-1",children:"View full audit log →"})]})}let lm=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function lf(e){return e>70?"#22c55e":e>=40?"#eab308":"#ef4444"}function lx({score:e,size:t=120,strokeWidth:r=8}){let n=(t-r)/2,i=2*Math.PI*n,a=i-e/100*i,s=lf(e);return(0,W.jsxs)("svg",{width:t,height:t,className:"transform -rotate-90",children:[(0,W.jsx)("circle",{cx:t/2,cy:t/2,r:n,fill:"none",stroke:"rgba(255,255,255,0.06)",strokeWidth:r}),(0,W.jsx)("circle",{cx:t/2,cy:t/2,r:n,fill:"none",stroke:s,strokeWidth:r,strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:a,style:{transition:"stroke-dashoffset 0.6s ease"}})]})}function ly({component:e}){var t,r;return(0,W.jsxs)("div",{className:"group relative",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:e.label}),(0,W.jsx)("span",{className:"text-xs font-medium text-slate-300",children:e.score})]}),(0,W.jsx)("div",{className:`h-1.5 rounded-full ${(t=e.score)>70?"bg-green-500/20":t>=40?"bg-yellow-500/20":"bg-red-500/20"}`,children:(0,W.jsx)("div",{className:`h-full rounded-full ${(r=e.score)>70?"bg-green-500":r>=40?"bg-yellow-500":"bg-red-500"}`,style:{width:`${e.score}%`,transition:"width 0.6s ease"}})}),(0,W.jsx)("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 rounded bg-slate-800 text-[10px] text-slate-300 whitespace-nowrap opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity z-10 border border-white/10",children:e.detail})]})}function lg(){let[e,t]=(0,H.useState)(null),[r,n]=(0,H.useState)(!0),[i,a]=(0,H.useState)(!1),s=(0,H.useCallback)(async()=>{try{let e=await (0,sa.authFetch)(`${lm}/api/health-score`);if(!e.ok)throw Error("Failed to fetch health score");let r=await e.json();t(r),a(!1)}catch{a(!0)}finally{n(!1)}},[]);if((0,H.useEffect)(()=>{s();let e=setInterval(s,6e4);return()=>clearInterval(e)},[s]),r)return(0,W.jsxs)("div",{className:"bg-[#12121a] border border-white/10 rounded-xl p-5 w-[300px]",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Memory Health"}),(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."})]});if(i||!e)return(0,W.jsxs)("div",{className:"bg-[#12121a] border border-white/10 rounded-xl p-5 w-[300px]",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Memory Health"}),(0,W.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load health score"})]});let{overall:o,components:l}=e;return(0,W.jsxs)("div",{className:"bg-[#12121a] border border-white/10 rounded-xl p-5 w-[300px]",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Memory Health"}),(0,W.jsx)("div",{className:"flex justify-center mb-5",children:(0,W.jsxs)("div",{className:"relative",children:[(0,W.jsx)(lx,{score:o}),(0,W.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,W.jsx)("span",{className:"text-3xl font-bold",style:{color:lf(o)},children:o})})]})}),(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsx)(ly,{component:l.freshness}),(0,W.jsx)(ly,{component:l.coverage}),(0,W.jsx)(ly,{component:l.consistency}),(0,W.jsx)(ly,{component:l.consolidation})]})]})}let lv=(0,oD.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),lb=(0,oD.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),lj=(0,oD.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var lw=e.i(17278);let lN=(0,oD.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);function lk(){let{projectFilter:e}=(0,sr.useDashboardStore)(),{data:t}=(0,oq.useAuditStats)("30d",e||void 0),{data:r}=oY(),[n,i]=(0,H.useState)("upsell"),[a,s]=(0,H.useState)(""),[o,l]=(0,H.useState)(null),[c,u]=(0,H.useState)(""),[d,h]=(0,H.useState)(!1);(0,H.useEffect)(()=>{let e=localStorage.getItem("shieldcortex_cloud_dismissed");if(e){let t=new Date(e);(Date.now()-t.getTime())/864e5<30&&i("hidden")}},[]),(0,H.useEffect)(()=>{(0,sa.authFetch)("http://localhost:3001/api/cloud/config").then(e=>e.json()).then(e=>{e.enabled&&e.apiKeySet&&i("hidden")}).catch(()=>{})},[]),(0,H.useEffect)(()=>{if("polling"!==n||!o)return;let e=setInterval(async()=>{try{let t=await fetch(`https://api.shieldcortex.ai/v1/auth/setup-status/${o}`),r=await t.json();"complete"===r.status&&r.api_key?(await (0,sa.authFetch)("http://localhost:3001/api/cloud/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cloudApiKey:r.api_key,cloudEnabled:!0,cloudBaseUrl:"https://api.shieldcortex.ai"})}),i("success"),clearInterval(e),setTimeout(()=>i("hidden"),5e3)):"expired"===r.status&&(u("Setup expired. Please try again."),i("upsell"),clearInterval(e))}catch{}},3e3);return()=>clearInterval(e)},[n,o]);let p=async e=>{if(e.preventDefault(),a&&!d){u(""),h(!0);try{let e=await fetch("https://api.shieldcortex.ai/v1/auth/cloud-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a})}),t=await e.json();t.setup_id?(l(t.setup_id),i("polling")):u(t.error||"Failed to start setup")}catch{u("Could not reach ShieldCortex Cloud. Check your connection.")}finally{h(!1)}}},m=()=>{localStorage.setItem("shieldcortex_cloud_dismissed",new Date().toISOString()),i("hidden")};if("hidden"===n)return null;let f=t?.blockedCount??0,x=t?.totalOperations??0,y=r?.tier??"free";return"team"!==y&&"enterprise"!==y&&"upsell"===n?(0,W.jsxs)("div",{className:"mt-4 bg-gradient-to-br from-slate-900 via-slate-900 to-violet-950/20 border border-violet-800/30 rounded-xl p-5 relative",children:[(0,W.jsx)("button",{onClick:m,className:"absolute top-3 right-3 text-slate-500 hover:text-slate-300 transition-colors",title:"Dismiss for 30 days",children:(0,W.jsx)(lw.X,{size:16})}),(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(le,{size:20,className:"text-violet-400"}),(0,W.jsx)("h3",{className:"text-sm font-semibold text-white",children:"Cloud Sync"}),(0,W.jsx)("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded text-violet-400 bg-violet-400/10",children:"Team"})]}),(0,W.jsx)("p",{className:"text-sm text-slate-300",children:f>0?`You've blocked ${f} threats locally. Upgrade to Team to sync across devices and give your team visibility.`:"Sync defence data across devices, share audit logs with your team, and get centralised alerts."}),(0,W.jsxs)("a",{href:"https://shieldcortex.ai/pricing",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2 bg-violet-600 hover:bg-violet-500 rounded-lg text-sm font-medium text-white transition-colors",children:["Upgrade to Team",(0,W.jsx)(lN,{size:12})]})]})]}):(0,W.jsxs)("div",{className:"mt-4 bg-gradient-to-br from-slate-900 via-slate-900 to-cyan-950/30 border border-cyan-800/30 rounded-xl p-5 relative",children:["upsell"===n&&(0,W.jsx)("button",{onClick:m,className:"absolute top-3 right-3 text-slate-500 hover:text-slate-300 transition-colors",title:"Dismiss for 30 days",children:(0,W.jsx)(lw.X,{size:16})}),"upsell"===n&&(0,W.jsxs)("div",{className:"space-y-4",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(le,{size:20,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-sm font-semibold text-white",children:"ShieldCortex Cloud"})]}),(0,W.jsx)("p",{className:"text-sm text-slate-300",children:f>0?`You've blocked ${f} threats across ${x} scans — your team can't see them yet.`:"Sync your defence data to the cloud for team visibility, audit logs, and alerts."}),(0,W.jsxs)("form",{onSubmit:p,className:"flex gap-2",children:[(0,W.jsx)("input",{type:"email",placeholder:"Enter your email",value:a,onChange:e=>s(e.target.value),required:!0,className:"flex-1 bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white placeholder:text-slate-500 focus:outline-none focus:ring-1 focus:ring-cyan-500 focus:border-cyan-500"}),(0,W.jsxs)("button",{type:"submit",disabled:d,className:"flex items-center gap-1.5 px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 rounded-lg text-sm font-medium text-white transition-colors",children:[d?(0,W.jsx)(lb,{size:14,className:"animate-spin"}):(0,W.jsx)(lv,{size:14}),"Get Started"]})]}),c&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:c}),(0,W.jsx)("p",{className:"text-[10px] text-slate-500",children:"Your Team licence includes cloud sync. Enter your email to connect."})]}),"polling"===n&&(0,W.jsxs)("div",{className:"flex items-center gap-3 py-2",children:[(0,W.jsx)(lb,{size:20,className:"text-cyan-400 animate-spin"}),(0,W.jsxs)("div",{children:[(0,W.jsx)("p",{className:"text-sm text-white font-medium",children:"Check your email"}),(0,W.jsx)("p",{className:"text-xs text-slate-400",children:"Click the link in your inbox to complete setup. We'll auto-configure everything."})]})]}),"success"===n&&(0,W.jsxs)("div",{className:"flex items-center gap-3 py-2",children:[(0,W.jsx)(lj,{size:20,className:"text-emerald-400"}),(0,W.jsxs)("div",{children:[(0,W.jsx)("p",{className:"text-sm text-white font-medium",children:"Connected to ShieldCortex Cloud"}),(0,W.jsx)("p",{className:"text-xs text-slate-400",children:"Your defence data will now sync automatically."})]})]})]})}let lS=(0,oD.default)("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),lO=(0,oD.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),lP=(0,oD.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),lC=[];function lA(){return(0,si.useQuery)({queryKey:["cloud-sync-status"],queryFn:async()=>{var e;let t,r,n,i,a=await (0,sa.authFetch)("http://localhost:3001/api/cloud/sync-status");if(!a.ok)throw Error(await (0,sa.readApiError)(a,"Failed to fetch sync status"));return t=(e=await a.json()).controls&&"object"==typeof e.controls?e.controls:{},n="byKind"in(r=e.queue&&"object"==typeof e.queue?e.queue:{})&&r.byKind&&"object"==typeof r.byKind?r.byKind:{},i=e=>({pending:Number(n[e]?.pending??0),failed:Number(n[e]?.failed??0),synced:Number(n[e]?.synced??0)}),{enabled:!!e.enabled,apiKeySet:!!e.apiKeySet,baseUrl:"string"==typeof e.baseUrl?e.baseUrl:"https://api.shieldcortex.ai",featureEnabled:!!e.featureEnabled,requiredTier:"pro"===e.requiredTier||"team"===e.requiredTier||"enterprise"===e.requiredTier?e.requiredTier:"free",controls:{projectMode:"projectMode"in t&&("include"===t.projectMode||"exclude"===t.projectMode)?t.projectMode:"all",projects:Array.isArray(t.projects)?t.projects.filter(e=>"string"==typeof e):lC,contentMode:"contentMode"in t&&"metadata"===t.contentMode?"metadata":"full",excludeSensitive:"excludeSensitive"in t&&!!t.excludeSensitive},lastSyncAt:"string"==typeof e.lastSyncAt||null===e.lastSyncAt?e.lastSyncAt??null:null,device:{id:e.device&&"object"==typeof e.device&&"id"in e.device&&"string"==typeof e.device.id?e.device.id:"unknown",name:e.device&&"object"==typeof e.device&&"name"in e.device&&"string"==typeof e.device.name?e.device.name:"Unknown device",platform:e.device&&"object"==typeof e.device&&"platform"in e.device&&"string"==typeof e.device.platform?e.device.platform:"unknown"},queue:{pending:Number(r.pending??0),failed:Number(r.failed??0),synced:Number(r.synced??0),byKind:{audit:i("audit"),quarantine:i("quarantine"),memory:i("memory"),graph:i("graph"),unknown:i("unknown")},oldestPendingAt:"string"==typeof r.oldestPendingAt||null===r.oldestPendingAt?r.oldestPendingAt??null:null,nextRetryAt:"string"==typeof r.nextRetryAt||null===r.nextRetryAt?r.nextRetryAt??null:null,lastError:"string"==typeof r.lastError||null===r.lastError?r.lastError??null:null,lastErrorKind:"audit"===r.lastErrorKind||"quarantine"===r.lastErrorKind||"memory"===r.lastErrorKind||"graph"===r.lastErrorKind||"unknown"===r.lastErrorKind?r.lastErrorKind:null,latestFailureAt:"string"==typeof r.latestFailureAt||null===r.latestFailureAt?r.latestFailureAt??null:null}}},refetchInterval:1e4})}function lE(e){let t=Math.max(0,Math.floor((Date.now()-new Date(e).getTime())/1e3));if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return`${i}d ago`}function lM(e){let t=Math.max(0,Math.floor((new Date(e).getTime()-Date.now())/1e3));if(t<60)return`in ${t}s`;let r=Math.floor(t/60);if(r<60)return`in ${r}m`;let n=Math.floor(r/60);if(n<24)return`in ${n}h`;let i=Math.floor(n/24);return`in ${i}d`}function lT(){let{data:e,isLoading:t}=lA(),r=(0,sr.useDashboardStore)(e=>e.setViewMode);if(t||!e)return null;let{enabled:n,apiKeySet:i,lastSyncAt:a,queue:s,device:o}=e,l=s.byKind.memory,c=s.byKind.graph,u=l.pending+c.pending,d=l.failed+c.failed,h=s.byKind.audit.failed+s.byKind.quarantine.failed+s.byKind.unknown.failed,p="disabled",m="Cloud sync disabled",f="Enable cloud sync with a Team+ key to replicate memories.";if(n&&i){let e=!!a&&Date.now()-new Date(a).getTime()>864e5;u>0&&d>0?(p="warning",m="Cloud sync needs attention",f=s.lastError??"One or more sync jobs failed and need retry."):d>0?(p=e?"warning":"queued",m=e?"Cloud sync has unresolved failures":"Cloud sync healthy, with failed history",f=s.lastError?`${s.lastError}${s.latestFailureAt?` • last failure ${lE(s.latestFailureAt)}`:""}`:`${d} failed replication job${1===d?"":"s"} remain in history.`):u>0?(p="queued",m="Cloud sync queued",f=s.nextRetryAt?`Next retry ${lM(s.nextRetryAt)}`:"Waiting to flush queued sync jobs."):e?(p="warning",m="Cloud sync stale",f=a?`Last successful sync ${lE(a)}`:"No successful sync recorded yet."):(p="healthy",m="Cloud sync healthy",f=a?`Last successful sync ${lE(a)}`:"Connected and ready to sync.",h>0&&(f+=` Auxiliary audit/quarantine history: ${h} failed job${1===h?"":"s"}.`))}let x=function(e){switch(e){case"healthy":return{border:"border-emerald-500/20",bg:"bg-emerald-500/10",text:"text-emerald-300",icon:lj};case"queued":return{border:"border-amber-500/20",bg:"bg-amber-500/10",text:"text-amber-300",icon:lO};case"warning":return{border:"border-red-500/20",bg:"bg-red-500/10",text:"text-red-300",icon:o0};default:return{border:"border-slate-700",bg:"bg-slate-800/80",text:"text-slate-300",icon:lP}}}(p),y=x.icon;return(0,W.jsxs)("div",{className:`mb-4 rounded-xl border ${x.border} ${x.bg} p-4`,children:[(0,W.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,W.jsxs)("div",{className:"min-w-0",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(y,{size:16,className:x.text}),(0,W.jsx)("span",{className:`text-sm font-medium ${x.text}`,children:m})]}),(0,W.jsx)("p",{className:"mt-1 text-xs text-slate-400",children:f}),(0,W.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[11px] text-slate-500",children:[(0,W.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-900/70 px-2 py-1",children:[(0,W.jsx)(lP,{size:11}),o.name]}),a&&(0,W.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-900/70 px-2 py-1",children:[(0,W.jsx)(lS,{size:11}),"Synced ",lE(a)]}),s.oldestPendingAt&&(0,W.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-900/70 px-2 py-1",children:["Oldest queued ",lE(s.oldestPendingAt)]})]})]}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs sm:min-w-[260px]",children:[(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Memory queue"}),(0,W.jsx)("div",{className:"mt-1 text-lg font-semibold text-white",children:l.pending}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:"pending writes"})]}),(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Replication failures"}),(0,W.jsx)("div",{className:`mt-1 text-lg font-semibold ${d>0?"text-red-300":"text-white"}`,children:d}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:"memory + graph only"})]}),(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Replicated"}),(0,W.jsx)("div",{className:"mt-1 text-lg font-semibold text-white",children:l.synced}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:"memory sync jobs"})]}),(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Retrying next"}),(0,W.jsx)("div",{className:"mt-1 text-sm font-semibold text-white",children:s.nextRetryAt?lM(s.nextRetryAt):"Idle"}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:s.lastErrorKind?`${s.lastErrorKind} queue`:"no pending retry"})]})]})]}),(0,W.jsx)("div",{className:"mt-4 flex justify-end",children:(0,W.jsx)("button",{onClick:()=>r("cloud"),className:"rounded-lg border border-slate-700 bg-slate-950/70 px-3 py-2 text-xs font-medium text-slate-300 transition-colors hover:border-cyan-500/40 hover:text-white",children:"Open cloud diagnostics"})})]})}let l_=(0,oD.default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),lD=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function lI(e){let t=await (0,sa.authFetch)(`${lD}/api/skills/scan-all`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dir:e})});if(!t.ok)throw Error("Failed to scan skills");return t.json()}async function lL(e){let t=await (0,sa.authFetch)(`${lD}/api/skills/scan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to scan skill content");return t.json()}function lz(){return(0,sc.useMutation)({mutationFn:e=>lI(e)})}async function lR(e){let t=await (0,sa.authFetch)(`${lD}/api/skills/trust`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok)throw Error("Failed to trust skill");return t.json()}async function lF(e){let t=await (0,sa.authFetch)(`${lD}/api/skills/trust`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok)throw Error("Failed to untrust skill");return t.json()}async function l$(e){let t=await (0,sa.authFetch)(`${lD}/api/skills/file`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok)throw Error((await t.json().catch(()=>({}))).error||"Failed to delete skill file");return t.json()}function lB(){let e=lz(),{setViewMode:t}=(0,sr.useDashboardStore)(),[r,n]=(0,H.useState)(null),i=r?r.files.filter(e=>e.safe).length:0,a=r?.threatCount??0;return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"Skill Scanner"}),(0,W.jsxs)("button",{onClick:()=>{e.mutate(void 0,{onSuccess:e=>n(e)})},disabled:e.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 rounded-lg text-xs font-medium text-white transition-colors",children:[e.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):(0,W.jsx)(o3,{size:12}),"Scan All"]})]}),r?(0,W.jsxs)("div",{children:[(0,W.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,W.jsx)(lj,{size:14,className:"text-green-400"}),(0,W.jsx)("span",{className:"text-sm font-medium text-green-400",children:i}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:"safe"})]}),a>0&&(0,W.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,W.jsx)(l_,{size:14,className:"text-red-400"}),(0,W.jsx)("span",{className:"text-sm font-medium text-red-400",children:a}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:"threats"})]}),(0,W.jsx)("span",{className:"text-[10px] text-slate-600",children:new Date(r.scannedAt).toLocaleTimeString()})]}),(0,W.jsxs)("button",{onClick:()=>t("skills"),className:"flex items-center gap-1 text-xs text-cyan-400 hover:text-cyan-300 transition-colors",children:["View all results",(0,W.jsx)(lv,{size:12})]})]}):e.isPending?(0,W.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,W.jsx)(lb,{size:16,className:"text-cyan-400 animate-spin"})}):(0,W.jsxs)("div",{className:"text-center py-3",children:[(0,W.jsx)(o3,{size:20,className:"text-slate-600 mx-auto mb-1.5"}),(0,W.jsx)("p",{className:"text-[10px] text-slate-500",children:"Scan agent instruction files for threats"})]})]})}let lU=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function lq(){let e=await (0,sa.authFetch)(`${lU}/api/iron-dome/status`);if(!e.ok)throw Error(await (0,sa.readApiError)(e,"Failed to fetch Iron Dome status"));return e.json()}async function lV(e){let t=await (0,sa.authFetch)(`${lU}/api/iron-dome/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:e})});if(!t.ok)throw Error(await (0,sa.readApiError)(t,"Failed to activate Iron Dome"));return t.json()}async function lK(){let e=await (0,sa.authFetch)(`${lU}/api/iron-dome/deactivate`,{method:"POST"});if(!e.ok)throw Error(await (0,sa.readApiError)(e,"Failed to deactivate Iron Dome"));return e.json()}async function lW(e){let t=await (0,sa.authFetch)(`${lU}/api/iron-dome/scan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e})});if(!t.ok)throw Error(await (0,sa.readApiError)(t,"Failed to scan text"));return t.json()}async function lH(){let e=await (0,sa.authFetch)(`${lU}/api/iron-dome/emergency-stop`,{method:"POST"});if(!e.ok)throw Error(await (0,sa.readApiError)(e,"Failed to trigger emergency stop"));return e.json()}async function lY(e){let t=await (0,sa.authFetch)(`${lU}/api/iron-dome/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:e||"Resumed via dashboard"})});if(!t.ok)throw Error(await (0,sa.readApiError)(t,"Failed to resume operations"));return t.json()}async function lQ(){let e=await (0,sa.authFetch)(`${lU}/api/control/status`);if(!e.ok)throw Error(await (0,sa.readApiError)(e,"Failed to fetch control status"));return e.json()}async function lX(e){let t=new URLSearchParams;e&&t.set("limit",e.toString());let r=await (0,sa.authFetch)(`${lU}/api/iron-dome/audit?${t}`);if(!r.ok)throw Error(await (0,sa.readApiError)(r,"Failed to fetch Iron Dome audit"));return r.json()}function lG(){return(0,si.useQuery)({queryKey:["iron-dome-status"],queryFn:lq,refetchInterval:3e4,retry:2})}function lZ(e){return(0,si.useQuery)({queryKey:["iron-dome-audit",e],queryFn:()=>lX(e),refetchInterval:3e4,retry:2})}function lJ(){let e=(0,sl.useQueryClient)();return(0,sc.useMutation)({mutationFn:lH,onSuccess:()=>{e.invalidateQueries({queryKey:["iron-dome-status"]}),e.invalidateQueries({queryKey:["iron-dome-audit"]}),e.invalidateQueries({queryKey:["control-status"]})}})}function l0(){let{data:e,isLoading:t}=lG(),{data:r}=lZ(100),n=e?.enabled??!1,i=e?.profile??"custom",a=r?.logs??[],s=a.filter(e=>e.reason?.includes("[iron-dome:")&&"BLOCK"===e.firewall_result).length,o=a.length;return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"Iron Dome"}),(0,W.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${n?"bg-red-500/20 text-red-400 border border-red-500/30":"bg-slate-700/50 text-slate-500"}`,children:n?"ACTIVE":"INACTIVE"})]}),t?(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."}):n?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{className:"text-xs text-slate-500 mb-3",children:["Profile: ",(0,W.jsx)("span",{className:"text-red-400 font-medium",children:i})]}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[(0,W.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-2 text-center",children:[(0,W.jsx)("div",{className:"text-lg font-bold text-red-400",children:s}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Blocks"})]}),(0,W.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-2 text-center",children:[(0,W.jsx)("div",{className:"text-lg font-bold text-slate-300",children:o}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Events"})]})]})]}):(0,W.jsxs)("div",{className:"text-center py-3",children:[(0,W.jsx)(oZ,{size:20,className:"text-slate-600 mx-auto mb-1.5"}),(0,W.jsx)("p",{className:"text-[10px] text-slate-500",children:"Behaviour protection layer — not active"})]}),(0,W.jsx)("button",{onClick:()=>sr.useDashboardStore.getState().setViewMode("dome"),className:"w-full text-center text-xs text-red-400 hover:text-red-300 transition-colors py-1",children:"View Iron Dome →"})]})}let l1=[],l2="http://localhost:3001";function l5(){return(0,si.useQuery)({queryKey:["cloud-config"],queryFn:async()=>{var e;let t,r,n=await (0,sa.authFetch)(`${l2}/api/cloud/config`);if(!n.ok)throw Error(await (0,sa.readApiError)(n,"Failed to fetch cloud config"));return t=(e=await n.json()).syncControls&&"object"==typeof e.syncControls?e.syncControls:{},r=e.openclawMemory&&"object"==typeof e.openclawMemory?e.openclawMemory:{},{enabled:!!e.enabled,apiKeySet:!!e.apiKeySet,baseUrl:"string"==typeof e.baseUrl?e.baseUrl:"https://api.shieldcortex.ai",syncControls:{projectMode:"projectMode"in t&&("include"===t.projectMode||"exclude"===t.projectMode)?t.projectMode:"all",projects:Array.isArray(t.projects)?t.projects.filter(e=>"string"==typeof e):l1,contentMode:"contentMode"in t&&"metadata"===t.contentMode?"metadata":"full",excludeSensitive:"excludeSensitive"in t&&!!t.excludeSensitive},openclawMemory:{autoMemory:"autoMemory"in r&&!!r.autoMemory,dedupe:"dedupe"in r&&!!r.dedupe,noveltyThreshold:"noveltyThreshold"in r&&"number"==typeof r.noveltyThreshold?r.noveltyThreshold:.88,maxRecent:"maxRecent"in r&&"number"==typeof r.maxRecent?r.maxRecent:300}}},refetchInterval:3e4})}function l4(){let e=(0,sl.useQueryClient)();return(0,sc.useMutation)({mutationFn:async e=>{let t=await (0,sa.authFetch)(`${l2}/api/cloud/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await (0,sa.readApiError)(t,"Failed to update cloud config"));return t.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["cloud-config"]}),e.invalidateQueries({queryKey:["cloud-sync-status"]})}})}function l3(e,t,r){return Math.max(t,Math.min(r,e))}function l6({initialAutoMemory:e,initialDedupe:t,initialNoveltyThreshold:r,initialMaxRecent:n}){let i=l4(),[a,s]=(0,H.useState)(e),[o,l]=(0,H.useState)(t),[c,u]=(0,H.useState)(String(r)),[d,h]=(0,H.useState)(String(n)),p=i.isPending;return(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Auto-memory extraction"}),(0,W.jsx)("button",{type:"button",onClick:()=>s(!a),className:`h-6 w-11 rounded-full transition-colors ${a?"bg-cyan-500":"bg-slate-700"}`,children:(0,W.jsx)("span",{className:`block h-5 w-5 rounded-full bg-white transition-transform ${a?"translate-x-5":"translate-x-0.5"}`})})]}),(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Novelty dedupe"}),(0,W.jsx)("button",{type:"button",onClick:()=>l(!o),disabled:!a,className:`h-6 w-11 rounded-full transition-colors ${o&&a?"bg-emerald-500":"bg-slate-700"} ${!a?"opacity-50 cursor-not-allowed":""}`,children:(0,W.jsx)("span",{className:`block h-5 w-5 rounded-full bg-white transition-transform ${o&&a?"translate-x-5":"translate-x-0.5"}`})})]}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("label",{className:"block text-[11px] text-slate-500 mb-1",children:"Novelty threshold"}),(0,W.jsx)(oT,{type:"number",step:"0.01",min:.6,max:.99,value:c,disabled:!a||!o,onChange:e=>u(e.target.value),className:"h-8 text-xs bg-slate-800 border-slate-700"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("label",{className:"block text-[11px] text-slate-500 mb-1",children:"Max recent records"}),(0,W.jsx)(oT,{type:"number",step:"1",min:50,max:1e3,value:d,disabled:!a||!o,onChange:e=>h(e.target.value),className:"h-8 text-xs bg-slate-800 border-slate-700"})]})]}),(0,W.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[(0,W.jsx)("span",{className:"text-[11px] text-slate-500",children:"Default: dedupe on, threshold 0.88, max 300"}),(0,W.jsxs)(oM,{size:"sm",onClick:()=>{let e=l3(Number.parseFloat(c),.6,.99),t=Math.floor(l3(Number.parseInt(d,10),50,1e3));i.mutate({openclawAutoMemory:a,openclawAutoMemoryDedupe:o,openclawAutoMemoryNoveltyThreshold:Number.isFinite(e)?e:.88,openclawAutoMemoryMaxRecent:Number.isFinite(t)?t:300})},disabled:p,className:"h-8 text-xs bg-cyan-600 hover:bg-cyan-500 text-white",children:[p?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):null,"Save"]})]})]})}function l8(){let{data:e,isLoading:t}=l5(),r=e?.openclawMemory,n=r?`${r.autoMemory}-${r.dedupe}-${r.noveltyThreshold}-${r.maxRecent}`:"default";return(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"OpenClaw Memory"}),(0,W.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:"Configure how ShieldCortex complements native OpenClaw memory."}),(0,W.jsx)("p",{className:"text-[11px] text-slate-600 mt-1",children:"Changes apply on next OpenClaw gateway restart."}),t?(0,W.jsx)("div",{className:"text-xs text-slate-500 mt-4 animate-pulse",children:"Loading settings..."}):(0,W.jsx)(l6,{initialAutoMemory:r?.autoMemory??!1,initialDedupe:r?.dedupe??!0,initialNoveltyThreshold:r?.noveltyThreshold??.88,initialMaxRecent:r?.maxRecent??300},n)]})}let l7=(0,oD.default)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);var l9=e.i(13808);let ce=(0,oD.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),ct=(0,oD.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),cr="https://api.shieldcortex.ai",cn=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",ci={free:"Free",pro:"Pro",team:"Team",enterprise:"Enterprise"},ca={free:"text-slate-400",pro:"text-cyan-400",team:"text-violet-400",enterprise:"text-amber-400"},cs={free:"bg-slate-400/10",pro:"bg-cyan-400/10",team:"bg-violet-400/10",enterprise:"bg-amber-400/10"},co={pro:{label:"Pro",price:"£29/mo"},team:{label:"Team",price:"£99/mo"}},cl=["Custom injection patterns","Custom Iron Dome policies","Custom firewall rules","Audit export (JSON/CSV)","Skill scanner deep mode"];function cc(){let e,t,{data:r,isLoading:n}=oY(),i=(e=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>oW(e),onSuccess:()=>{e.invalidateQueries({queryKey:["license-status"]})}})),a=(t=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:oH,onSuccess:()=>{t.invalidateQueries({queryKey:["license-status"]})}})),s=function(){let e=(0,sl.useQueryClient)(),[t,r]=(0,H.useState)("idle"),[n,i]=(0,H.useState)(null),[a,s]=(0,H.useState)(null),o=(0,H.useCallback)(async(e,t)=>{r("submitting"),i(null);try{let n=await fetch(`${cr}/v1/billing/quick-checkout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,plan:t})}),i=await n.json();if(!n.ok||!i.checkout_url||!i.setup_id)throw Error(i.error||"Failed to create checkout session");s(i.setup_id),window.open(i.checkout_url,"_blank"),r("polling")}catch(e){i(e instanceof Error?e.message:"Checkout failed"),r("error")}},[]);return(0,H.useEffect)(()=>{if("polling"!==t||!a)return;let n=setInterval(async()=>{try{let t=await fetch(`${cr}/v1/billing/setup-status/${a}`),s=await t.json();if("complete"===s.status&&s.license_key){clearInterval(n),r("activating");try{if(!(await (0,sa.authFetch)(`${cn}/api/license/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:s.license_key})})).ok)throw Error("Local activation failed");e.invalidateQueries({queryKey:["license-status"]}),r("complete")}catch{i('Payment succeeded but local activation failed. Use "I Have a Key" to activate manually.'),r("error")}}else"expired"===s.status?(clearInterval(n),i("Setup expired. Please try again."),r("error")):"complete"!==s.status||s.license_key||(clearInterval(n),i("Licence key was already retrieved. Check your dashboard or try again."),r("error"))}catch{}},3e3),s=setTimeout(()=>{clearInterval(n),i('Checkout timed out. If you completed payment, use "I Have a Key" or contact support.'),r("error")},9e5);return()=>{clearInterval(n),clearTimeout(s)}},[t,a,e]),{state:t,error:n,startCheckout:o,reset:(0,H.useCallback)(()=>{r("idle"),i(null),s(null)},[])}}(),[o,l]=(0,H.useState)(""),[c,u]=(0,H.useState)("default"),[d,h]=(0,H.useState)(""),[p,m]=(0,H.useState)("pro"),[f,x]=(0,H.useState)(!1);if(n||!r)return(0,W.jsx)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4 mb-4",children:(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oZ,{size:16,className:"text-slate-500"}),(0,W.jsx)("span",{className:"text-xs text-slate-500 animate-pulse",children:"Loading licence..."})]})});let y=r.tier;if("free"===y)return(0,W.jsxs)("div",{className:"relative overflow-hidden rounded-xl mb-4 bg-gradient-to-br from-slate-900 via-slate-900 to-cyan-950/30 border border-cyan-700/30",children:[(0,W.jsx)("div",{className:"absolute top-0 right-0 w-32 h-32 bg-cyan-500/5 rounded-full blur-2xl -translate-y-1/2 translate-x-1/2"}),(0,W.jsxs)("div",{className:"relative p-5",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,W.jsx)("div",{className:"flex items-center justify-center w-8 h-8 rounded-lg bg-cyan-500/10 border border-cyan-500/20",children:(0,W.jsx)(l9.Sparkles,{size:16,className:"text-cyan-400"})}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h3",{className:"text-sm font-semibold text-white",children:"Unlock Pro Features"}),(0,W.jsx)("p",{className:"text-[11px] text-slate-400 mt-0.5",children:"Your defence pipeline is fully active. Upgrade for advanced controls."})]})]}),(0,W.jsx)("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-slate-800 text-slate-400 border border-slate-700",children:"Free"})]}),(0,W.jsx)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5 mb-4",children:cl.map(e=>(0,W.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[(0,W.jsx)(ce,{size:10,className:"text-cyan-500/60 shrink-0"}),(0,W.jsx)("span",{className:"text-slate-400",children:e})]},e))}),"complete"===s.state?(0,W.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-emerald-500/10 border border-emerald-500/20 rounded-lg",children:[(0,W.jsx)(lj,{size:16,className:"text-emerald-400 shrink-0"}),(0,W.jsx)("span",{className:"text-xs text-emerald-300",children:"Pro activated! Your dashboard is refreshing..."})]}):"polling"===s.state||"activating"===s.state?(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-cyan-500/10 border border-cyan-500/20 rounded-lg",children:[(0,W.jsx)(lb,{size:14,className:"text-cyan-400 animate-spin shrink-0"}),(0,W.jsx)("span",{className:"text-xs text-cyan-300",children:"activating"===s.state?"Activating licence...":"Complete payment in the Stripe tab..."})]}),(0,W.jsx)("button",{onClick:()=>{s.reset(),u("default")},className:"text-[10px] text-slate-500 hover:text-slate-300 transition-colors",children:"Cancel"})]}):"checkout"===c?(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("label",{className:"text-[10px] text-slate-500 mb-1 block",children:"Email"}),(0,W.jsx)("input",{type:"email",placeholder:"you@company.com",value:d,onChange:e=>h(e.target.value),className:"w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white placeholder:text-slate-600 focus:outline-none focus:ring-1 focus:ring-cyan-500",autoFocus:!0})]}),(0,W.jsx)("div",{className:"flex gap-2",children:["pro","team"].map(e=>(0,W.jsxs)("button",{type:"button",onClick:()=>m(e),className:`flex-1 px-3 py-2 text-xs font-medium rounded-lg border transition-colors ${p===e?"bg-cyan-600/20 border-cyan-500/50 text-cyan-300":"bg-slate-800 border-slate-700 text-slate-400 hover:border-slate-600"}`,children:[co[e].label," — ",co[e].price]},e))}),(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("button",{onClick:()=>s.startCheckout(d,p),disabled:"submitting"===s.state||!d.trim(),className:"flex-1 inline-flex items-center justify-center gap-1.5 px-4 py-2 text-xs font-medium bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 text-white rounded-lg transition-colors",children:"submitting"===s.state?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):"Continue to Checkout"}),(0,W.jsx)("button",{onClick:()=>{u("default"),s.reset()},className:"px-3 py-2 text-xs text-slate-500 hover:text-slate-300 transition-colors",children:"Back"})]}),s.error&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:s.error})]}):"activate"===c?(0,W.jsxs)("div",{className:"space-y-2",children:[(0,W.jsxs)("form",{onSubmit:e=>{e.preventDefault(),o.trim()&&i.mutate(o.trim(),{onSuccess:()=>{l(""),u("default")}})},className:"flex gap-2",children:[(0,W.jsx)("input",{type:"text",placeholder:"sc_pro_...",value:o,onChange:e=>l(e.target.value),className:"flex-1 bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white placeholder:text-slate-600 focus:outline-none focus:ring-1 focus:ring-cyan-500",autoFocus:!0}),(0,W.jsx)("button",{type:"submit",disabled:i.isPending||!o.trim(),className:"px-4 py-2 text-xs font-medium bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 text-white rounded-lg transition-colors",children:i.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):"Activate"}),(0,W.jsx)("button",{type:"button",onClick:()=>{u("default"),l(""),i.reset()},className:"px-3 py-2 text-xs text-slate-500 hover:text-slate-300 transition-colors",children:"Back"})]}),i.isError&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:i.error instanceof Error?i.error.message:"Activation failed"})]}):(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[(0,W.jsx)("button",{onClick:()=>u("checkout"),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors",children:"Upgrade to Pro"}),(0,W.jsxs)("button",{onClick:()=>u("activate"),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium bg-slate-800 hover:bg-slate-700 text-slate-300 rounded-lg transition-colors border border-slate-700",children:[(0,W.jsx)(l7,{size:12}),"I Have a Key"]})]}),s.error&&(0,W.jsxs)("div",{className:"space-y-2",children:[(0,W.jsx)("p",{className:"text-xs text-red-400",children:s.error}),(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("button",{onClick:()=>{s.reset(),u("checkout")},className:"text-[10px] text-cyan-400 hover:text-cyan-300 transition-colors",children:"Try Again"}),(0,W.jsx)("span",{className:"text-[10px] text-slate-600",children:"·"}),(0,W.jsx)("button",{onClick:()=>{s.reset(),u("activate")},className:"text-[10px] text-slate-400 hover:text-slate-300 transition-colors",children:"I Have a Key"})]})]})]})]})]});let g=r.features.filter(e=>e.enabled).length,v=r.features.length;return(0,W.jsxs)("div",{className:"bg-slate-900 border border-cyan-800/40 rounded-xl p-4 mb-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oZ,{size:16,className:ca[y]}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"Licence"}),(0,W.jsx)("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded ${ca[y]} ${cs[y]}`,children:ci[y]})]}),(0,W.jsxs)("span",{className:"text-[10px] text-slate-500",children:[g,"/",v," features"]})]}),(0,W.jsxs)("div",{className:"space-y-2 mb-3",children:[r.email&&(0,W.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,W.jsx)("span",{className:"text-slate-500",children:"Email"}),(0,W.jsx)("span",{className:"text-slate-300",children:r.email})]}),null!==r.daysUntilExpiry&&(0,W.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,W.jsx)("span",{className:"text-slate-500",children:"Expires"}),(0,W.jsx)("span",{className:r.daysUntilExpiry<=7?"text-yellow-400":"text-slate-300",children:r.daysUntilExpiry<=0?"Expired (grace period)":`${r.daysUntilExpiry} days`})]})]}),(0,W.jsxs)("button",{onClick:()=>x(!f),className:"flex items-center gap-1 text-[10px] text-slate-500 hover:text-slate-300 transition-colors mb-2",children:[f?(0,W.jsx)(ct,{size:12}):(0,W.jsx)(lo,{size:12}),f?"Hide features":"Show features"]}),f&&(0,W.jsx)("div",{className:"space-y-1.5 mb-3",children:r.features.map(e=>(0,W.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[e.enabled?(0,W.jsx)(lj,{size:12,className:"text-emerald-400 shrink-0"}):(0,W.jsx)(l_,{size:12,className:"text-slate-600 shrink-0"}),(0,W.jsx)("span",{className:e.enabled?"text-slate-300":"text-slate-600",children:e.description.split(".")[0]}),!e.enabled&&(0,W.jsx)("span",{className:`text-[9px] px-1 py-0.5 rounded ${ca[e.requiredTier]} ${cs[e.requiredTier]}`,children:ci[e.requiredTier]})]},e.feature))}),(0,W.jsx)("button",{onClick:()=>{confirm(`Remove your ${ci[y]} licence key? You will lose access to paid features.`)&&a.mutate()},disabled:a.isPending,className:"text-[10px] text-slate-600 hover:text-red-400 transition-colors",children:"Deactivate"})]})}let cu=(0,oD.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),cd=(0,oD.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ch=(0,oD.default)("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),cp=(0,oD.default)("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]);function cm({feature:e,children:t,label:r}){let{data:n}=oY();if(!n)return(0,W.jsx)(W.Fragment,{children:t});let i=n.features.find(t=>t.feature===e);if(!i||i.enabled)return(0,W.jsx)(W.Fragment,{children:t});let a=i.requiredTier;return(0,W.jsxs)("div",{className:"relative",children:[(0,W.jsx)("div",{className:"pointer-events-none select-none opacity-30 blur-[2px]",children:t}),(0,W.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-slate-900/60 rounded-xl backdrop-blur-sm",children:[(0,W.jsx)(ce,{size:24,className:"text-slate-500 mb-2"}),(0,W.jsxs)("p",{className:"text-sm font-medium text-slate-300 mb-1",children:[ci[a]," Feature"]}),r&&(0,W.jsx)("p",{className:"text-xs text-slate-500 mb-3 text-center max-w-xs",children:r}),(0,W.jsxs)("a",{href:"https://shieldcortex.ai/pricing",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-4 py-2 text-xs bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors",children:["Upgrade to ",ci[a],(0,W.jsx)(lN,{size:10})]})]})]})}let cf=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",cx=[{id:1,name:"Block API key patterns",priority:1,condition_type:"regex",condition_value:"sk-[a-zA-Z0-9]{32,}",action:"block",enabled:!0},{id:2,name:"Quarantine code injection",priority:2,condition_type:"regex",condition_value:"eval\\(|Function\\(",action:"quarantine",enabled:!0},{id:3,name:"Allow internal docs",priority:10,condition_type:"source",condition_value:"agent:docs-helper",action:"allow",enabled:!1}],cy=[{id:1,name:"Internal tool abuse",category:"tool_misuse",severity:"high",regex:"execute_tool\\(.*?delete|drop|truncate",description:"Detects attempts to use internal tools for destructive operations.",enabled:!0},{id:2,name:"PII exfiltration",category:"data_leak",severity:"critical",regex:"(SSN|social.security|\\d{3}-\\d{2}-\\d{4})",description:"Catches social security number patterns in agent memory writes.",enabled:!0},{id:3,name:"Prompt override attempt",category:"injection",severity:"medium",regex:"ignore.*(previous|above|prior).*instructions",description:"Detects common prompt injection override phrases.",enabled:!0}],cg=[{id:1,name:"Strict Healthcare",description:"Blocks all PII patterns, requires approval for external actions, whitelists only HIPAA-compliant channels.",is_active:!0},{id:2,name:"Dev Sandbox",description:"Permissive mode for development. Allows all channels, logs but does not block. Ideal for testing.",is_active:!1}],cv=[{files:["SKILL.md","handler.js"],finding:"Skill declares read-only but handler writes to filesystem",severity:"high"},{files:["SKILL.md","config.json"],finding:"Config enables network access not mentioned in skill manifest",severity:"medium"},{files:["handler.js","utils.js"],finding:"Dynamic eval() used in utility imported by main handler",severity:"critical"}],cb={"File access":45,"Network calls":30,"Process exec":15,"Memory write":10},cj=["Restrict filesystem writes to a sandboxed directory","Add explicit network permission declarations to SKILL.md"];function cw(){let e,t,r,n,{data:i,isLoading:a,isLocked:s}={...e=(0,si.useQuery)({queryKey:["firewall-rules"],queryFn:()=>(0,sa.gatedFetch)(`${cf}/api/firewall-rules`).then(e=>{if(!e.ok)throw Error("Failed to fetch firewall rules");return e.json()}),retry:(e,t)=>!(t instanceof sa.FeatureLockedError)&&e<2,refetchInterval:3e4}),isLocked:e.error instanceof sa.FeatureLockedError},o=(t=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${cf}/api/firewall-rules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{t.invalidateQueries({queryKey:["firewall-rules"]})}})),l=(r=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:({id:e,...t})=>(0,sa.gatedFetch)(`${cf}/api/firewall-rules/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{r.invalidateQueries({queryKey:["firewall-rules"]})}})),c=(n=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${cf}/api/firewall-rules/${e}`,{method:"DELETE"}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{n.invalidateQueries({queryKey:["firewall-rules"]})}})),[u,d]=(0,H.useState)(!1),[h,p]=(0,H.useState)({name:"",priority:100,condition_type:"regex",condition_value:"",action:"block"}),m=i?.rules??[];return s?(0,W.jsx)(cN,{}):(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oZ,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Custom Firewall Rules"}),(0,W.jsxs)("span",{className:"text-xs text-slate-500",children:[m.length,"/25"]})]}),(0,W.jsxs)("button",{onClick:()=>d(!u),className:"flex items-center gap-1 px-2 py-1 text-xs bg-cyan-600/20 text-cyan-400 rounded hover:bg-cyan-600/30 transition-colors",children:[(0,W.jsx)(cu,{size:12})," Add Rule"]})]}),u&&(0,W.jsxs)("form",{onSubmit:e=>{e.preventDefault(),o.mutate(h,{onSuccess:()=>{d(!1),p({name:"",priority:100,condition_type:"regex",condition_value:"",action:"block"})}})},className:"p-3 bg-slate-800/50 rounded-lg space-y-2",children:[(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,W.jsx)("input",{value:h.name,onChange:e=>p(t=>({...t,name:e.target.value})),placeholder:"Rule name",required:!0,className:"px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200 placeholder:text-slate-600"}),(0,W.jsx)("input",{value:h.priority,onChange:e=>p(t=>({...t,priority:Number(e.target.value)})),type:"number",placeholder:"Priority",className:"px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200"})]}),(0,W.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,W.jsxs)("select",{value:h.condition_type,onChange:e=>p(t=>({...t,condition_type:e.target.value})),className:"px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200",children:[(0,W.jsx)("option",{value:"regex",children:"Regex"}),(0,W.jsx)("option",{value:"source",children:"Source"}),(0,W.jsx)("option",{value:"keyword",children:"Keyword"})]}),(0,W.jsx)("input",{value:h.condition_value,onChange:e=>p(t=>({...t,condition_value:e.target.value})),placeholder:"Condition value",required:!0,className:"px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200 placeholder:text-slate-600"}),(0,W.jsxs)("select",{value:h.action,onChange:e=>p(t=>({...t,action:e.target.value})),className:"px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200",children:[(0,W.jsx)("option",{value:"block",children:"Block"}),(0,W.jsx)("option",{value:"quarantine",children:"Quarantine"}),(0,W.jsx)("option",{value:"allow",children:"Allow"})]})]}),(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsx)("button",{type:"submit",disabled:o.isPending,className:"px-3 py-1 text-xs bg-cyan-600 text-white rounded hover:bg-cyan-500 disabled:opacity-50",children:o.isPending?"Creating...":"Create"}),(0,W.jsx)("button",{type:"button",onClick:()=>d(!1),className:"px-3 py-1 text-xs text-slate-400 hover:text-slate-200",children:"Cancel"})]}),o.error&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:o.error.message})]}),a?(0,W.jsx)("div",{className:"text-xs text-slate-500 py-4 text-center",children:"Loading rules..."}):0===m.length?(0,W.jsx)("div",{className:"text-xs text-slate-500 py-4 text-center",children:'No custom rules yet. Click "Add Rule" to create one.'}):(0,W.jsx)("div",{className:"space-y-1",children:m.map(e=>(0,W.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 bg-slate-800/30 rounded text-xs",children:[(0,W.jsx)("span",{className:"text-slate-400 w-6 text-right",children:e.priority}),(0,W.jsx)("span",{className:"text-slate-200 flex-1",children:e.name}),(0,W.jsx)("code",{className:"text-slate-500 text-[10px] max-w-[120px] truncate",children:e.condition_value}),(0,W.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${"block"===e.action?"bg-red-500/20 text-red-400":"quarantine"===e.action?"bg-yellow-500/20 text-yellow-400":"bg-green-500/20 text-green-400"}`,children:e.action}),(0,W.jsx)("button",{onClick:()=>l.mutate({id:e.id,enabled:+!e.enabled}),className:"text-slate-500 hover:text-slate-300",title:e.enabled?"Disable":"Enable",children:e.enabled?(0,W.jsx)(cp,{size:14,className:"text-cyan-400"}):(0,W.jsx)(ch,{size:14})}),(0,W.jsx)("button",{onClick:()=>c.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(cd,{size:12})})]},e.id))})]})}function cN(){return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oZ,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Custom Firewall Rules"}),(0,W.jsx)("span",{className:"text-xs text-slate-500",children:"0/25"})]}),(0,W.jsx)("div",{className:"space-y-1",children:cx.map(e=>(0,W.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 bg-slate-800/30 rounded text-xs",children:[(0,W.jsx)("span",{className:"text-slate-400 w-6 text-right",children:e.priority}),(0,W.jsx)("span",{className:"text-slate-200 flex-1",children:e.name}),(0,W.jsx)("code",{className:"text-slate-500 text-[10px] max-w-[120px] truncate",children:e.condition_value}),(0,W.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${"block"===e.action?"bg-red-500/20 text-red-400":"quarantine"===e.action?"bg-yellow-500/20 text-yellow-400":"bg-green-500/20 text-green-400"}`,children:e.action})]},e.id))})]})}function ck(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(cm,{feature:"custom_firewall_rules",label:"Add custom rules to control what gets blocked, allowed, or quarantined.",children:(0,W.jsx)(cw,{})})})}function cS(){let[e,t]=(0,H.useState)("24h");return(0,W.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Defence Overview"}),(0,W.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(r=>(0,W.jsx)("button",{onClick:()=>t(r),className:`px-3 py-1 text-xs rounded-md transition-colors ${e===r?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:r},r))})]}),(0,W.jsx)(cc,{}),(0,W.jsx)(lT,{}),(0,W.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,W.jsx)(lu,{timeRange:e}),(0,W.jsx)(ld,{}),(0,W.jsx)(lh,{timeRange:e}),(0,W.jsx)(lp,{timeRange:e})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lg,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lB,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(l0,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(l8,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(ck,{})}),(0,W.jsx)(lk,{})]})}let cO=(0,oD.default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),cP=(0,oD.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);function cC(e){let t=Math.max(0,Math.floor((Date.now()-new Date(e).getTime())/1e3));if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return`${i}d ago`}function cA(e){let t=Math.max(0,Math.floor((new Date(e).getTime()-Date.now())/1e3));if(t<60)return`in ${t}s`;let r=Math.floor(t/60);if(r<60)return`in ${r}m`;let n=Math.floor(r/60);if(n<24)return`in ${n}h`;let i=Math.floor(n/24);return`in ${i}d`}function cE(){var e;let{data:t,isLoading:r}=lA(),{data:n}=oY();if(r||!t)return null;let i="border-slate-700 bg-slate-900/70 text-slate-200",a="Cloud sync disabled",s="Enable cloud sync and activate a Team licence to start replicating local data.",o=le,l=!!(e=t.lastSyncAt)&&Date.now()-new Date(e).getTime()>864e5,c=t.queue.byKind.memory.pending+t.queue.byKind.graph.pending,u=t.queue.byKind.memory.failed+t.queue.byKind.graph.failed,d=t.queue.byKind.audit.failed+t.queue.byKind.quarantine.failed+t.queue.byKind.unknown.failed;return t.enabled&&t.apiKeySet&&!t.featureEnabled?(i="border-amber-500/30 bg-amber-500/10 text-amber-200",a="Cloud configured but licence locked",s=`Cloud sync requires the ${ci[t.requiredTier]} tier. Current tier: ${ci[n?.tier??"free"]}.`,o=cO):t.enabled&&t.apiKeySet&&c>0&&u>0?(i="border-red-500/30 bg-red-500/10 text-red-200",a="Cloud sync needs attention",s=t.queue.lastError??"One or more queued sync jobs are failing.",o=cP):t.enabled&&t.apiKeySet&&u>0?(i=l?"border-red-500/30 bg-red-500/10 text-red-200":"border-amber-500/30 bg-amber-500/10 text-amber-200",a=l?"Cloud sync has unresolved failures":"Cloud sync healthy, with failed history",s=t.queue.lastError?`${t.queue.lastError}${t.queue.latestFailureAt?` Last failure ${cC(t.queue.latestFailureAt)}.`:""}`:`${u} failed replication job${1===u?"":"s"} remain in queue history.`,o=l?cP:o0):t.enabled&&t.apiKeySet&&c>0?(i="border-amber-500/30 bg-amber-500/10 text-amber-200",a="Cloud sync is catching up",s=t.queue.nextRetryAt?`Next retry ${cA(t.queue.nextRetryAt)}.`:"Queued jobs are waiting to flush.",o=lO):t.enabled&&t.apiKeySet&&(i="border-emerald-500/30 bg-emerald-500/10 text-emerald-200",a="Cloud sync healthy",s=t.lastSyncAt?`Last successful sync ${cC(t.lastSyncAt)}.`:"Connected and ready to sync.",d>0&&(s+=` Auxiliary audit/quarantine history: ${d} failed job${1===d?"":"s"}.`),o=lj),(0,W.jsx)("div",{className:`rounded-2xl border p-4 ${i}`,children:(0,W.jsxs)("div",{className:"flex items-start gap-3",children:[(0,W.jsx)(o,{size:18,className:"mt-0.5 shrink-0"}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h2",{className:"text-sm font-semibold",children:a}),(0,W.jsx)("p",{className:"mt-1 text-sm opacity-90",children:s})]})]})})}function cM({label:e,value:t,detail:r,icon:n}){return(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:e}),(0,W.jsx)(n,{size:15,className:"text-slate-500"})]}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:t}),(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:r})]})}function cT({label:e,pending:t,failed:r,synced:n}){return(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-3",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e}),(0,W.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Pending"}),(0,W.jsx)("div",{className:"mt-1 font-semibold text-amber-300",children:t})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Failed"}),(0,W.jsx)("div",{className:"mt-1 font-semibold text-red-300",children:r})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Synced"}),(0,W.jsx)("div",{className:"mt-1 font-semibold text-emerald-300",children:n})]})]})]})}function c_(){let{data:e}=l5(),{data:t}=(0,si.useQuery)({queryKey:["cloud-projects"],queryFn:async()=>{let e=await (0,sa.authFetch)(`${l2}/api/cloud/projects`);if(!e.ok)throw Error(await (0,sa.readApiError)(e,"Failed to fetch cloud projects"));return e.json()},staleTime:3e4}),r=l4(),[n,i]=(0,H.useState)(null),a=t?.projects??[],s=n??e?.syncControls??{projectMode:"all",projects:[],contentMode:"full",excludeSensitive:!1};async function o(){await r.mutateAsync({cloudSyncProjectMode:s.projectMode,cloudSyncProjects:s.projects,cloudSyncContentMode:s.contentMode,cloudSyncExcludeSensitive:s.excludeSensitive}),i(null)}return(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Sync Controls"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Decide what leaves this device before it hits the cloud replica."})]}),(0,W.jsx)("button",{type:"button",onClick:()=>void o(),disabled:r.isPending,className:"rounded-lg border border-cyan-500/30 bg-cyan-500/10 px-3 py-2 text-sm font-medium text-cyan-200 transition hover:bg-cyan-500/20 disabled:cursor-not-allowed disabled:opacity-50",children:r.isPending?"Saving...":"Save controls"})]}),(0,W.jsxs)("div",{className:"mt-5 grid gap-4",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Content mode"}),(0,W.jsxs)("div",{className:"mt-3 grid gap-2 md:grid-cols-2",children:[(0,W.jsxs)("label",{className:`rounded-lg border p-3 text-sm ${"full"===s.contentMode?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-800 text-slate-300"}`,children:[(0,W.jsx)("input",{type:"radio",className:"mr-2",checked:"full"===s.contentMode,onChange:()=>i(e=>({...e??s,contentMode:"full"}))}),"Full content",(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:"Titles and memory bodies replicate to cloud."})]}),(0,W.jsxs)("label",{className:`rounded-lg border p-3 text-sm ${"metadata"===s.contentMode?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-800 text-slate-300"}`,children:[(0,W.jsx)("input",{type:"radio",className:"mr-2",checked:"metadata"===s.contentMode,onChange:()=>i(e=>({...e??s,contentMode:"metadata"}))}),"Metadata only",(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:"Projects, tags, salience, and graph remain; body content is redacted."})]})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Project scope"}),(0,W.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:["all","include","exclude"].map(e=>(0,W.jsx)("button",{type:"button",onClick:()=>i(t=>({...t??s,projectMode:e})),className:`rounded-full border px-3 py-1.5 text-xs font-medium uppercase tracking-wide ${s.projectMode===e?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-700 bg-slate-900/60 text-slate-300"}`,children:e},e))}),(0,W.jsx)("p",{className:"mt-3 text-xs text-slate-400",children:"all"===s.projectMode?"All local projects are eligible for sync.":"include"===s.projectMode?"Only the selected projects will sync.":"Selected projects stay local-only."}),(0,W.jsx)("div",{className:"mt-3 max-h-48 overflow-y-auto rounded-lg border border-slate-800 bg-slate-900/40 p-3",children:0===a.length?(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"No named projects found in local memory yet."}):(0,W.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>{let t=s.projects.includes(e.project);return(0,W.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.project,void i(e=>{let r=e??s,n=r.projects.includes(t)?r.projects.filter(e=>e!==t):[...r.projects,t].sort((e,t)=>e.localeCompare(t));return{...r,projects:n}})},className:`rounded-full border px-3 py-1.5 text-xs ${t?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-700 bg-slate-950/60 text-slate-300"}`,children:[e.project," ",(0,W.jsxs)("span",{className:"text-slate-500",children:["(",e.count,")"]})]},e.project)})})})]}),(0,W.jsxs)("label",{className:"flex items-start gap-3 rounded-xl border border-slate-800 bg-slate-950/60 p-4 text-sm text-slate-200",children:[(0,W.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:s.excludeSensitive,onChange:e=>i(t=>({...t??s,excludeSensitive:e.target.checked}))}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"font-medium text-white",children:"Exclude sensitive memories"}),(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:"Skip memories whose sensitivity level is higher than INTERNAL when syncing to cloud."})]})]}),r.isError&&(0,W.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-200",children:r.error.message})]})]})}function cD(){let{data:e,isLoading:t}=lA(),{data:r,isLoading:n}=l5(),{data:i,isLoading:a}=oY();if(t||n||a||!e||!r||!i)return(0,W.jsx)("div",{className:"h-full overflow-y-auto p-6",children:(0,W.jsx)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-6 text-sm text-slate-400",children:"Loading cloud diagnostics..."})});let s=i.tier,o=e.queue.byKind.memory,l=e.queue.byKind.graph,c=o.failed+l.failed,u=e.queue.byKind.audit.failed+e.queue.byKind.quarantine.failed+e.queue.byKind.unknown.failed,d=e.lastSyncAt?cC(e.lastSyncAt):"Never";return(0,W.jsx)("div",{className:"h-full overflow-y-auto bg-slate-950",children:(0,W.jsxs)("div",{className:"mx-auto flex max-w-7xl flex-col gap-6 p-6",children:[(0,W.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h1",{className:"text-2xl font-semibold text-white",children:"Cloud Diagnostics"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Inspect local-to-cloud replication health, queue pressure, device identity, and Team licence gating."})]}),(0,W.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,W.jsx)("span",{className:`rounded-full px-2.5 py-1 font-medium ${cs[s]} ${ca[s]}`,children:ci[s]}),(0,W.jsxs)("span",{className:"rounded-full border border-slate-700 bg-slate-900/70 px-2.5 py-1 text-slate-300",children:["Last sync: ",d]})]})]}),(0,W.jsx)(cE,{}),(0,W.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,W.jsx)(cM,{label:"Device",value:e.device.name,detail:`${e.device.platform} \xb7 ${e.device.id.slice(0,12)}`,icon:lP}),(0,W.jsx)(cM,{label:"Cloud Target",value:new URL(e.baseUrl).host,detail:e.enabled?"Configured target":"Disabled in config",icon:le}),(0,W.jsx)(cM,{label:"Memory Queue",value:o.pending,detail:`${o.failed} failed \xb7 ${o.synced} synced`,icon:o1}),(0,W.jsx)(cM,{label:"Graph Queue",value:l.pending,detail:`${l.failed} failed \xb7 ${l.synced} synced`,icon:o5})]}),(0,W.jsxs)("div",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[1.35fr_0.95fr]",children:[(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsx)("div",{className:"flex items-center justify-between gap-3",children:(0,W.jsxs)("div",{children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Queue Breakdown"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Pending and failed sync jobs by payload type. This is the fastest way to spot whether memories or graph slices are backing up."})]})}),(0,W.jsxs)("div",{className:"mt-5 grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-4",children:[(0,W.jsx)(cT,{label:"Memory",...o}),(0,W.jsx)(cT,{label:"Graph",...l}),(0,W.jsx)(cT,{label:"Audit",...e.queue.byKind.audit}),(0,W.jsx)(cT,{label:"Quarantine",...e.queue.byKind.quarantine})]}),(0,W.jsx)("div",{className:"mt-5 overflow-hidden rounded-xl border border-slate-800",children:(0,W.jsxs)("table",{className:"min-w-full divide-y divide-slate-800 text-sm",children:[(0,W.jsx)("thead",{className:"bg-slate-950/70 text-slate-400",children:(0,W.jsxs)("tr",{children:[(0,W.jsx)("th",{className:"px-4 py-3 text-left font-medium",children:"Signal"}),(0,W.jsx)("th",{className:"px-4 py-3 text-left font-medium",children:"Current value"}),(0,W.jsx)("th",{className:"px-4 py-3 text-left font-medium",children:"Why it matters"})]})}),(0,W.jsxs)("tbody",{className:"divide-y divide-slate-800 bg-slate-900/40 text-slate-200",children:[(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Oldest queued job"}),(0,W.jsx)("td",{className:"px-4 py-3",children:e.queue.oldestPendingAt?cC(e.queue.oldestPendingAt):"None queued"}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"If this stays old while pending grows, the local worker is falling behind."})]}),(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Next retry"}),(0,W.jsx)("td",{className:"px-4 py-3",children:e.queue.nextRetryAt?cA(e.queue.nextRetryAt):"Idle"}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"Confirms whether failures are retrying normally or the queue is stuck."})]}),(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Failed jobs in history"}),(0,W.jsx)("td",{className:"px-4 py-3",children:c}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"These are retained replication dead-letter records for memory and graph sync."})]}),(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Auxiliary failed history"}),(0,W.jsx)("td",{className:"px-4 py-3",children:u}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"Audit and quarantine retry history is shown here for debugging, but it does not mean memory replication is currently blocked."})]}),(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Latest memory sync"}),(0,W.jsx)("td",{className:"px-4 py-3",children:e.lastSyncAt?cC(e.lastSyncAt):"Not recorded"}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"This is the best quick indicator for whether cloud replication is actually current."})]})]})]})})]}),(0,W.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,W.jsx)(c_,{}),(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Configuration"}),(0,W.jsxs)("div",{className:"mt-4 space-y-3 text-sm",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Cloud endpoint"}),(0,W.jsx)("div",{className:"mt-2 font-medium text-white",children:e.baseUrl})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Feature gate"}),(0,W.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[e.featureEnabled?(0,W.jsx)(lj,{size:16,className:"text-emerald-400"}):(0,W.jsx)(o0,{size:16,className:"text-amber-400"}),(0,W.jsx)("span",{className:"font-medium text-white",children:e.featureEnabled?"Team cloud sync enabled":`Requires ${ci[e.requiredTier]} tier`})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Current sync policy"}),(0,W.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-slate-300",children:[(0,W.jsxs)("span",{children:["Projects: ",e.controls.projectMode]}),(0,W.jsxs)("span",{children:["Content: ",e.controls.contentMode]}),(0,W.jsxs)("span",{children:["Sensitive filter: ",e.controls.excludeSensitive?"Enabled":"Off"]}),(0,W.jsxs)("span",{children:["Selected projects: ",e.controls.projects.length]})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"OpenClaw complement"}),(0,W.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-slate-300",children:[(0,W.jsxs)("span",{children:["Auto-memory: ",r.openclawMemory.autoMemory?"On":"Off"]}),(0,W.jsxs)("span",{children:["Dedupe: ",r.openclawMemory.dedupe?"On":"Off"]}),(0,W.jsxs)("span",{children:["Novelty threshold: ",r.openclawMemory.noveltyThreshold]}),(0,W.jsxs)("span",{children:["Recent window: ",r.openclawMemory.maxRecent]})]})]})]})]}),(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Last actionable error"}),(0,W.jsx)("div",{className:"mt-4 rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:e.queue.lastError?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{className:`flex items-center gap-2 text-sm font-medium ${e.queue.pending>0?"text-red-300":"text-amber-300"}`,children:[(0,W.jsx)(o0,{size:16}),e.queue.lastErrorKind?`${e.queue.lastErrorKind} queue`:"Unknown queue"]}),(0,W.jsx)("p",{className:"mt-2 text-sm text-slate-300",children:e.queue.lastError}),e.queue.latestFailureAt&&(0,W.jsxs)("div",{className:"mt-2 text-xs text-slate-500",children:["Recorded ",cC(e.queue.latestFailureAt)]}),e.queue.nextRetryAt&&(0,W.jsxs)("div",{className:"mt-3 inline-flex items-center gap-1 rounded-full bg-slate-900 px-2 py-1 text-xs text-slate-400",children:[(0,W.jsx)(lS,{size:12}),"Retry ",cA(e.queue.nextRetryAt)]})]}):(0,W.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-300",children:[(0,W.jsx)(lj,{size:16}),"No recent sync errors recorded."]})})]})]})]})]})})}let cI=(0,oD.default)("waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]]),cL=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function cz(e){let t=new URLSearchParams;t.set("query",e.query),e.project&&t.set("project",e.project),e.expectedId&&t.set("expectedId",String(e.expectedId));let r=await (0,sa.authFetch)(`${cL}/api/recall/explain?${t.toString()}`);if(!r.ok)throw Error("Failed to explain recall");return r.json()}async function cR(e,t){let r=new URLSearchParams({mode:"search",query:e,limit:"8"});t&&r.set("project",t);let n=await (0,sa.authFetch)(`${cL}/api/memories?${r.toString()}`);if(!n.ok)throw Error("Failed to fetch memory candidates");return(await n.json()).memories}function cF(){var e;let{projectFilter:t,setSelectedMemory:r,setViewMode:n}=(0,sr.useDashboardStore)(),[i,a]=(0,H.useState)(""),[s,o]=(0,H.useState)(""),[l,c]=(0,H.useState)(""),[u,d]=(0,H.useState)(null),[h,p]=(0,H.useState)(null),[m,f]=(0,H.useState)(()=>JSON.parse(window.localStorage.getItem("shieldcortex:recall-history")??"[]")),x=(0,sc.useMutation)({mutationFn:async e=>{let t="shieldcortex:recall-history",r=[e,...JSON.parse(window.localStorage.getItem(t)??"[]").filter(t=>t!==e)].slice(0,8);return window.localStorage.setItem(t,JSON.stringify(r)),r}}),{data:y,isLoading:g}=(e=(0,H.useMemo)(()=>s.trim()?{query:s.trim(),project:t,expectedId:u}:null,[s,t,u]),(0,si.useQuery)({queryKey:["recall-explain",e],queryFn:()=>cz(e),enabled:!!e?.query?.trim(),staleTime:3e4})),{data:v=[]}=(0,si.useQuery)({queryKey:["memory-candidates",l,t],queryFn:()=>cR(l,t),enabled:l.trim().length>=2,staleTime:3e4});return(0,W.jsx)("div",{className:"h-full overflow-y-auto bg-slate-950",children:(0,W.jsxs)("div",{className:"mx-auto max-w-6xl px-6 py-6 space-y-6",children:[(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-6",children:[(0,W.jsx)("div",{className:"flex items-start justify-between gap-4",children:(0,W.jsxs)("div",{children:[(0,W.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-cyan-500/20 bg-cyan-500/10 px-3 py-1 text-xs uppercase tracking-[0.18em] text-cyan-300",children:[(0,W.jsx)(l9.Sparkles,{size:12}),"Recall Workspace"]}),(0,W.jsx)("h2",{className:"mt-4 text-3xl font-semibold text-white",children:"Debug what the agent would remember."}),(0,W.jsx)("p",{className:"mt-2 max-w-2xl text-sm text-slate-400",children:"Run a recall query, inspect ranking factors, see contradiction pressure, and compare an expected memory against the returned set."})]})}),(0,W.jsxs)("div",{className:"mt-6 grid gap-4 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",children:[(0,W.jsxs)("form",{className:"space-y-3",onSubmit:e=>{e.preventDefault(),i.trim()&&(o(i.trim()),x.mutate(i.trim(),{onSuccess:e=>f(e)}))},children:[(0,W.jsxs)("div",{className:"flex gap-3",children:[(0,W.jsxs)("div",{className:"relative flex-1",children:[(0,W.jsx)(o7.Search,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-500"}),(0,W.jsx)(oT,{value:i,onChange:e=>a(e.target.value),placeholder:"Why did we choose PostgreSQL over SQLite?",className:"h-11 border-slate-700 bg-slate-950 pl-10 text-white"})]}),(0,W.jsx)(oM,{type:"submit",className:"h-11 bg-cyan-600 hover:bg-cyan-500",children:"Explain recall"})]}),m.length>0&&(0,W.jsx)("div",{className:"flex flex-wrap gap-2",children:m.map(e=>(0,W.jsx)("button",{type:"button",onClick:()=>{a(e),o(e)},className:"rounded-full border border-slate-700 bg-slate-900 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 hover:text-white",children:e},e))})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Expected memory"}),(0,W.jsx)(oT,{value:l,onChange:e=>c(e.target.value),placeholder:"Search a memory to compare...",className:"mt-3 border-slate-700 bg-slate-950 text-white"}),(0,W.jsx)("div",{className:"mt-3 space-y-2",children:v.map(e=>(0,W.jsxs)("button",{onClick:()=>{d(e.id),c(e.title)},className:`block w-full rounded-lg border px-3 py-2 text-left text-sm ${u===e.id?"border-cyan-500/50 bg-cyan-500/10 text-white":"border-slate-800 bg-slate-900 text-slate-300 hover:border-slate-600"}`,children:[(0,W.jsx)("div",{className:"font-medium",children:e.title}),(0,W.jsxs)("div",{className:"text-xs text-slate-500",children:[e.category," · ",e.project||"workspace"]})]},e.id))})]})]})]}),(0,W.jsxs)("div",{className:`grid gap-6 ${h?"2xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)_420px]":"xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,0.9fr)]"}`,children:[(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Ranked recall set"}),(0,W.jsxs)("div",{className:"mt-1 text-sm text-slate-400",children:[y?.total??0," results"]})]}),g&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"Explaining…"})]}),(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[y?.results.map((e,t)=>(0,W.jsxs)("div",{className:`rounded-xl border bg-slate-950/70 p-4 text-left ${h?.id===e.memory.id?"border-cyan-500/40":"border-slate-800"}`,children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,W.jsxs)("div",{children:[(0,W.jsxs)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:["Rank #",t+1]}),(0,W.jsx)("div",{className:"mt-1 text-lg font-medium text-white",children:e.memory.title}),(0,W.jsxs)("div",{className:"mt-1 text-xs text-slate-400",children:[e.memory.category," · ",e.memory.captureMethod||"manual"," · trust ",(e.memory.trustScore??1).toFixed(2)]})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-cyan-500/10 px-3 py-2 text-right",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-cyan-300",children:"Score"}),(0,W.jsx)("div",{className:"text-base font-semibold text-cyan-100",children:e.relevanceScore.toFixed(2)})]})]}),(0,W.jsx)("div",{className:"mt-3 flex flex-wrap gap-2 text-xs text-slate-300",children:(e.explanation?.reasons??[]).slice(0,4).map(e=>(0,W.jsx)("span",{className:"rounded-full border border-slate-700 px-2 py-1",children:e},e))}),e.contradictions&&e.contradictions.length>0&&(0,W.jsxs)("div",{className:"mt-3 inline-flex items-center gap-2 rounded-full bg-amber-500/10 px-3 py-1 text-xs text-amber-300",children:[(0,W.jsx)(cP,{size:12}),e.contradictions.length," contradiction link",1===e.contradictions.length?"":"s"]}),(0,W.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,W.jsx)("button",{onClick:()=>p(e.memory),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Inspect in panel"}),(0,W.jsx)("button",{onClick:()=>{r(e.memory),n("memories")},className:"rounded-lg border border-cyan-500/30 bg-cyan-500/10 px-3 py-1 text-xs text-cyan-200 hover:bg-cyan-500/20",children:"Open in memories"})]})]},e.memory.id)),!g&&!y?.results.length&&s&&(0,W.jsx)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-6 text-sm text-slate-400",children:"No recalled memories for this query."})]})]}),(0,W.jsxs)("section",{className:"space-y-6",children:[(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 text-xs uppercase tracking-[0.18em] text-slate-500",children:[(0,W.jsx)(cI,{size:13}),"Expected memory debugger"]}),y?.expectedMemory?(0,W.jsxs)("div",{className:"mt-4 space-y-3 text-sm text-slate-300",children:[(0,W.jsx)("div",{className:"text-lg font-medium text-white",children:y.expectedMemory.title}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-3",children:[(0,W.jsxs)("div",{children:["Rank: ",y.expectedMemory.rank??"not returned"]}),(0,W.jsxs)("div",{children:["Status: ",y.expectedMemory.status]}),(0,W.jsxs)("div",{children:["Capture: ",y.expectedMemory.captureMethod," · ",y.expectedMemory.sourceKind]})]}),(0,W.jsx)("div",{className:"space-y-2",children:y.expectedMemory.reasons.map(e=>(0,W.jsx)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/60 px-3 py-2 text-xs text-slate-400",children:e},e))})]}):(0,W.jsx)("div",{className:"mt-4 text-sm text-slate-400",children:"Pick an expected memory to compare it against the ranked result set."})]}),(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Likely misses"}),(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[(y?.misses??[]).map(e=>(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-3",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e.title}),(0,W.jsxs)("div",{className:"mt-1 text-xs text-slate-500",children:[e.captureMethod," · salience ",e.salience.toFixed(2)]}),(0,W.jsx)("ul",{className:"mt-2 space-y-1 text-xs text-slate-400",children:e.whyNotRecalled.map(e=>(0,W.jsxs)("li",{children:["• ",e]},e))})]},e.id)),!y?.misses?.length&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"No notable misses for this query."})]})]})]}),h&&(0,W.jsx)("aside",{className:"2xl:sticky 2xl:top-6 2xl:self-start",children:(0,W.jsxs)("div",{className:"rounded-2xl border border-cyan-500/20 bg-slate-900/70",children:[(0,W.jsxs)("div",{className:"border-b border-slate-800 px-4 py-3",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-cyan-300",children:"Selected recall memory"}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:"Inspect the selected result here while you keep comparing ranks, misses, and contradictions."})]}),(0,W.jsx)("div",{className:"2xl:max-h-[calc(100vh-8rem)] 2xl:overflow-y-auto",children:(0,W.jsx)(oF,{memory:h,onClose:()=>p(null)})}),(0,W.jsx)("div",{className:"border-t border-slate-800 px-4 py-3",children:(0,W.jsx)("button",{onClick:()=>p(null),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Close panel"})})]})})]})]})})}let c$=(0,oD.default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),cB=(0,oD.default)("cloud-off",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]),cU=(0,oD.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),cq=(0,oD.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);function cV({memory:e}){let t=e.status??"active",r=function(e){if(!e)return null;let t=Math.floor((Date.now()-new Date(e).getTime())/36e5);if(t<1)return"just now";if(t<24)return`${t}h ago`;let r=Math.floor(t/24);return r<7?`${r}d ago`:`${Math.floor(r/7)}w ago`}(e.reviewedAt),n=[e.pinned?{label:"Pinned",tone:"emerald"}:null,"canonical"===t?{label:"Canonical",tone:"emerald"}:null,"suppressed"===t?{label:"Suppressed",tone:"amber"}:null,"archived"===t?{label:"Archived",tone:"slate"}:null,e.cloudExcluded?{label:"Cloud excluded",tone:"cyan"}:null,"global"===e.scope?{label:"Global",tone:"violet"}:null,r?{label:`Reviewed ${r}`,tone:"slate"}:null].filter(Boolean),i={emerald:"border-emerald-500/30 bg-emerald-500/10 text-emerald-200",amber:"border-amber-500/30 bg-amber-500/10 text-amber-200",slate:"border-slate-700 bg-slate-800/80 text-slate-300",cyan:"border-cyan-500/30 bg-cyan-500/10 text-cyan-200",violet:"border-violet-500/30 bg-violet-500/10 text-violet-200"};return(0,W.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:n.length>0?n.map(e=>(0,W.jsx)("span",{className:`rounded-full border px-2.5 py-1 text-[11px] ${i[e.tone]}`,children:e.label},e.label)):(0,W.jsx)("span",{className:"rounded-full border border-slate-700 bg-slate-800/80 px-2.5 py-1 text-[11px] text-slate-300",children:"Ready for recall"})})}function cK({memory:e,onOpen:t,onAct:r,busy:n}){return(0,W.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,W.jsx)("button",{onClick:()=>t(e),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Inspect in panel"}),(0,W.jsxs)("button",{disabled:n,onClick:()=>r(e,e.pinned?"unpin":"pin"),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:[(0,W.jsx)(cU,{className:"mr-1 inline h-3 w-3"}),e.pinned?"Unpin":"Pin"]}),(0,W.jsx)("button",{disabled:n,onClick:()=>r(e,"suppress"),className:"rounded-lg border border-amber-500/40 px-3 py-1 text-xs text-amber-300 hover:bg-amber-500/10 disabled:opacity-50",children:"Suppress"}),(0,W.jsxs)("button",{disabled:n,onClick:()=>r(e,"archived"===e.status||"suppressed"===e.status?"restore":"archive"),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:[(0,W.jsx)(c$,{className:"mr-1 inline h-3 w-3"}),"archived"===e.status||"suppressed"===e.status?"Restore":"Archive"]}),(0,W.jsxs)("button",{disabled:n,onClick:()=>r(e,e.cloudExcluded?"includeCloud":"excludeCloud"),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:[(0,W.jsx)(cB,{className:"mr-1 inline h-3 w-3"}),e.cloudExcluded?"Include cloud":"Exclude cloud"]}),(0,W.jsx)("button",{disabled:n,onClick:()=>r(e,"global"===e.scope?"rescopeProject":"rescopeGlobal"),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:"global"===e.scope?"Project scope":"Make global"}),(0,W.jsx)("button",{disabled:n,onClick:()=>r(e,"canonicalize"),className:"rounded-lg border border-emerald-500/40 px-3 py-1 text-xs text-emerald-300 hover:bg-emerald-500/10 disabled:opacity-50",children:"Canonical"})]})}function cW({title:e,detail:t,items:r,onOpen:n,onAct:i,busy:a}){return(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:e}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:t})]}),(0,W.jsx)("div",{className:"rounded-full bg-slate-800 px-3 py-1 text-xs text-slate-300",children:r.length})]}),(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[r.slice(0,8).map(e=>(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-base font-medium text-white",children:e.title}),(0,W.jsxs)("div",{className:"mt-1 text-xs text-slate-500",children:[e.category," · ",e.captureMethod||"manual"," · trust ",(e.trustScore??1).toFixed(2)]}),(0,W.jsx)(cV,{memory:e})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-slate-800 px-3 py-2 text-right",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Next move"}),(0,W.jsx)("div",{className:"text-sm text-slate-100",children:"canonical"===e.status?"Keep hot":"archived"===e.status?"Restore or leave archived":"suppressed"===e.status?"Restore or leave suppressed":"Review or keep"})]})]}),(0,W.jsx)(cK,{memory:e,onOpen:n,onAct:i,busy:a})]},e.id)),!r.length&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"Nothing to review here."})]})]})}function cH(){let e,{projectFilter:t,reviewFocus:r,setReviewFocus:n,selectedMemory:i,setSelectedMemory:a}=(0,sr.useDashboardStore)(),{data:s,isLoading:o}=(0,si.useQuery)({queryKey:["review-queue",t],queryFn:()=>sp(t),staleTime:3e4}),l=(e=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:sf,onSuccess:(t,r)=>{e.setQueriesData({queryKey:["review-queue"]},e=>{var n,i;return n=r.keptId,i=r.removedId,e?sh({...e,sections:{...e.sections,stale:e.sections.stale.filter(e=>e.id!==i),neverUsed:e.sections.neverUsed.filter(e=>e.id!==i),lowTrust:e.sections.lowTrust.filter(e=>e.id!==i),noisyAutoExtracted:e.sections.noisyAutoExtracted.filter(e=>e.id!==i),projectless:e.sections.projectless.filter(e=>e.id!==i),duplicates:e.sections.duplicates.filter(e=>e.memoryA.id!==i&&e.memoryB.id!==i),contradictions:e.sections.contradictions.filter(e=>e.memoryA.id!==i&&e.memoryB.id!==i)}},{...t,id:n}):e}),e.setQueriesData({queryKey:["memories"]},e=>e?{...e,memories:e.memories.filter(e=>e.id!==r.removedId).map(e=>e.id===r.keptId?t:e)}:e),e.invalidateQueries({queryKey:["review-queue"]}),e.invalidateQueries({queryKey:["memories"]}),e.invalidateQueries({queryKey:["quality"]}),e.invalidateQueries({queryKey:["contradictions"]}),e.invalidateQueries({queryKey:["stats"]}),e.invalidateQueries({queryKey:["graph"]})}})),c=sx(),[u,d]=(0,H.useState)(null),h={lowTrust:(0,H.useRef)(null),noisyAutoExtracted:(0,H.useRef)(null),stale:(0,H.useRef)(null),neverUsed:(0,H.useRef)(null),projectless:(0,H.useRef)(null),duplicates:(0,H.useRef)(null),contradictions:(0,H.useRef)(null)},p=e=>{a(e)};(0,H.useEffect)(()=>{if(!r)return;let e=h[r].current;e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[r]);let m=async(e,t)=>{try{d(null);let r=await c.mutateAsync({id:e.id,action:t,reviewedBy:"dashboard-review",project:e.project??null,scope:e.scope});(i?.id===r.id||i?.id===e.id)&&a(r),d({kind:"success",message:`${{pin:"Pinned",unpin:"Unpinned",suppress:"Suppressed",archive:"Archived",includeCloud:"Included in cloud sync",excludeCloud:"Excluded from cloud sync",rescopeProject:"Moved to project scope",rescopeGlobal:"Moved to global scope",canonicalize:"Marked canonical"}[t]??"Updated"}: ${r.title}`})}catch(t){d({kind:"error",message:t instanceof Error?t.message:`Failed to update ${e.title}`})}},f=async(e,t)=>{try{d(null),await l.mutateAsync({keptId:e.id,removedId:t.id,reviewedBy:"dashboard-merge"}),a(e),d({kind:"success",message:`Merged duplicate into "${e.title}"`})}catch(e){d({kind:"error",message:e instanceof Error?e.message:"Failed to merge duplicate memories"})}},x=async(e,t)=>{try{d(null),await c.mutateAsync({id:e.id,action:"canonicalize",reviewedBy:"dashboard-review"}),await c.mutateAsync({id:t.id,action:"suppress",reviewedBy:"dashboard-review"}),a(e),d({kind:"success",message:`Kept "${e.title}" and suppressed "${t.title}"`})}catch(e){d({kind:"error",message:e instanceof Error?e.message:"Failed to resolve contradiction"})}},y=(0,H.useMemo)(()=>{let e=["lowTrust","noisyAutoExtracted","stale","neverUsed","projectless","duplicates","contradictions"];return r?[r,...e.filter(e=>e!==r)]:e},[r]),g={lowTrust:s?.sections.lowTrust.length??0,noisyAutoExtracted:s?.sections.noisyAutoExtracted.length??0,stale:s?.sections.stale.length??0,neverUsed:s?.sections.neverUsed.length??0,projectless:s?.sections.projectless.length??0,duplicates:s?.sections.duplicates.length??0,contradictions:s?.sections.contradictions.length??0},v={lowTrust:(0,W.jsx)("section",{ref:e=>{h.lowTrust.current=e},className:"scroll-mt-6",children:(0,W.jsx)(cW,{title:"Low trust",detail:"These memories came from weaker or noisier sources.",items:s?.sections.lowTrust??[],onOpen:p,onAct:m,busy:c.isPending||l.isPending})}),noisyAutoExtracted:(0,W.jsx)("section",{ref:e=>{h.noisyAutoExtracted.current=e},className:"scroll-mt-6",children:(0,W.jsx)(cW,{title:"Noisy auto-extracted",detail:"Auto capture is useful, but not every extraction deserves to stay hot.",items:s?.sections.noisyAutoExtracted??[],onOpen:p,onAct:m,busy:c.isPending||l.isPending})}),stale:(0,W.jsx)("section",{ref:e=>{h.stale.current=e},className:"scroll-mt-6",children:(0,W.jsx)(cW,{title:"Stale",detail:"Useful once, maybe. Worth archiving or refreshing now.",items:s?.sections.stale??[],onOpen:p,onAct:m,busy:c.isPending||l.isPending})}),neverUsed:(0,W.jsx)("section",{ref:e=>{h.neverUsed.current=e},className:"scroll-mt-6",children:(0,W.jsx)(cW,{title:"Never used",detail:"Stored but never recalled. High count usually means capture is too noisy.",items:s?.sections.neverUsed??[],onOpen:p,onAct:m,busy:c.isPending||l.isPending})}),projectless:(0,W.jsx)("section",{ref:e=>{h.projectless.current=e},className:"scroll-mt-6",children:(0,W.jsx)(cW,{title:"Projectless",detail:"These memories have no useful project scope and are likely to leak into the wrong context.",items:s?.sections.projectless??[],onOpen:p,onAct:m,busy:c.isPending||l.isPending})}),duplicates:(0,W.jsxs)("section",{ref:e=>{h.duplicates.current=e},className:"scroll-mt-6 rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(cq,{size:16,className:"text-cyan-300"}),(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Duplicate candidates"})]}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"One click keeps the recommended memory, merges unique content, and removes the duplicate."}),(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[(s?.sections.duplicates??[]).slice(0,8).map(e=>{let t=e.recommendedKeepId===e.memoryA.id?e.memoryA:e.memoryB,r=e.recommendedKeepId===e.memoryA.id?e.memoryB:e.memoryA;return(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e.memoryA.title}),(0,W.jsxs)("div",{className:"mt-1 text-xs text-slate-500",children:["paired with ",e.memoryB.title]}),(0,W.jsxs)("div",{className:"mt-2 text-xs text-slate-400",children:[e.similarity," · shared title words ",e.sharedWords]})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-emerald-500/10 px-3 py-2 text-xs text-emerald-300",children:["Keep ",t.id]})]}),(0,W.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,W.jsx)("button",{onClick:()=>p(e.memoryA),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Inspect A"}),(0,W.jsx)("button",{onClick:()=>p(e.memoryB),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Inspect B"}),(0,W.jsx)("button",{onClick:()=>f(t,r),disabled:c.isPending||l.isPending,className:"rounded-lg border border-emerald-500/40 px-3 py-1 text-xs text-emerald-300 hover:bg-emerald-500/10 disabled:opacity-50",children:"Merge into recommended"}),(0,W.jsx)("button",{onClick:()=>f(r,t),disabled:c.isPending||l.isPending,className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:"Keep other instead"})]})]},`${e.memoryA.id}-${e.memoryB.id}`)}),!s?.sections.duplicates?.length&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"No duplicate candidates detected."})]})]}),contradictions:(0,W.jsxs)("section",{ref:e=>{h.contradictions.current=e},className:"scroll-mt-6 rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(cP,{size:16,className:"text-amber-300"}),(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Contradiction clusters"})]}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Compare both sides, keep the stronger memory hot, and suppress the one you no longer want shaping recall."}),(0,W.jsxs)("div",{className:"mt-4 space-y-4",children:[(s?.sections.contradictions??[]).slice(0,8).map(e=>(0,W.jsxs)("div",{className:"rounded-xl border border-amber-500/20 bg-slate-950/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Contradiction score"}),(0,W.jsxs)("div",{className:"mt-1 text-lg font-semibold text-white",children:[Math.round(100*e.score),"%"]})]}),(0,W.jsxs)("div",{className:"text-right",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:"Shared topics"}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-300",children:e.sharedTopics.length?e.sharedTopics.join(" · "):"No obvious shared topic"})]})]}),(0,W.jsx)("div",{className:"mt-3 rounded-xl border border-slate-800 bg-slate-900/60 p-3 text-sm text-slate-300",children:e.reason}),(0,W.jsx)("div",{className:"mt-4 grid gap-4 xl:grid-cols-2",children:[e.memoryA,e.memoryB].map((t,r)=>{let n=0===r?e.memoryB:e.memoryA;return(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:0===r?"Option A":"Option B"}),(0,W.jsx)("div",{className:"mt-1 text-base font-medium text-white",children:t.title}),(0,W.jsxs)("div",{className:"mt-1 text-xs text-slate-500",children:[t.category," · ",t.captureMethod||"manual"," · trust ",(t.trustScore??1).toFixed(2)]})]}),(0,W.jsxs)("div",{className:"rounded-lg bg-slate-800 px-3 py-2 text-right text-sm text-slate-100",children:[(t.trustScore??1).toFixed(2)," trust"]})]}),(0,W.jsx)(cV,{memory:t}),(0,W.jsx)("div",{className:"mt-3 line-clamp-4 text-sm text-slate-400",children:t.content}),(0,W.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,W.jsx)("button",{onClick:()=>p(t),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Inspect"}),(0,W.jsx)("button",{disabled:c.isPending||l.isPending,onClick:()=>m(t,t.pinned?"unpin":"pin"),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500 disabled:opacity-50",children:t.pinned?"Unpin":"Pin"}),(0,W.jsx)("button",{disabled:c.isPending||l.isPending,onClick:()=>x(t,n),className:"rounded-lg border border-emerald-500/40 px-3 py-1 text-xs text-emerald-300 hover:bg-emerald-500/10 disabled:opacity-50",children:"Keep this, suppress other"}),(0,W.jsx)("button",{disabled:c.isPending||l.isPending,onClick:()=>m(t,"suppress"),className:"rounded-lg border border-amber-500/40 px-3 py-1 text-xs text-amber-300 hover:bg-amber-500/10 disabled:opacity-50",children:"Suppress this one"})]})]},t.id)})})]},`${e.memoryA.id}-${e.memoryB.id}`)),!s?.sections.contradictions?.length&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"No contradiction clusters detected."})]})]})};return(0,W.jsx)("div",{className:"h-full overflow-y-auto bg-slate-950",children:(0,W.jsxs)("div",{className:"mx-auto max-w-[1440px] px-6 py-6 space-y-6",children:[(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-6",children:[(0,W.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-amber-500/20 bg-amber-500/10 px-3 py-1 text-xs uppercase tracking-[0.18em] text-amber-300",children:[(0,W.jsx)(cq,{size:12}),"Review Queue"]}),(0,W.jsx)("h2",{className:"mt-4 text-3xl font-semibold text-white",children:"Fix memory quality before it turns into recall debt."}),(0,W.jsx)("p",{className:"mt-2 max-w-2xl text-sm text-slate-400",children:"Review stale, contradictory, low-trust, and noisy auto-extracted memories. Pin the good ones, suppress the noisy ones, and keep cloud sync intentional."}),(0,W.jsx)("div",{className:"mt-6 grid gap-4 md:grid-cols-3 xl:grid-cols-6",children:Object.entries(s?.summary??{}).map(([e,t])=>(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:e}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:t})]},e))}),(0,W.jsxs)("div",{className:"mt-6 rounded-2xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 text-xs uppercase tracking-[0.18em] text-slate-500",children:[(0,W.jsx)(l9.Sparkles,{size:12}),"OpenClaw capture"]}),(0,W.jsxs)("div",{className:"mt-4 grid gap-4 md:grid-cols-5",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"Total"}),(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:s?.openClaw.total??0})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"Auto-extracted"}),(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:s?.openClaw.autoExtracted??0})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"Keyword-triggered"}),(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:s?.openClaw.keywordTriggered??0})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"Suppressed"}),(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:s?.openClaw.suppressed??0})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"Pinned"}),(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:s?.openClaw.pinned??0})]})]})]}),(0,W.jsxs)("div",{className:"mt-6 flex flex-wrap gap-2",children:[[["contradictions","Contradictions"],["duplicates","Duplicates"],["stale","Stale"],["neverUsed","Never used"],["lowTrust","Low trust"],["noisyAutoExtracted","Noisy auto"],["projectless","Projectless"]].map(([e,t])=>(0,W.jsxs)("button",{onClick:()=>n(e),className:`rounded-full border px-3 py-1 text-xs transition-colors ${r===e?"border-cyan-400/50 bg-cyan-500/10 text-cyan-200":"border-slate-700 bg-slate-950/60 text-slate-300 hover:border-slate-500"}`,children:[t," (",g[e],")"]},e)),r&&(0,W.jsx)("button",{onClick:()=>n(null),className:"rounded-full border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Clear focus"})]})]}),o&&(0,W.jsx)("div",{className:"text-sm text-slate-400",children:"Loading review queue…"}),u&&(0,W.jsx)("div",{className:`rounded-2xl border px-4 py-3 text-sm ${"error"===u.kind?"border-red-500/30 bg-red-500/10 text-red-200":"border-emerald-500/30 bg-emerald-500/10 text-emerald-200"}`,children:(0,W.jsxs)("div",{className:"flex items-start gap-2",children:["success"===u.kind&&(0,W.jsx)(lj,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,W.jsx)("span",{children:u.message})]})}),(0,W.jsxs)("div",{className:i?"grid gap-6 xl:grid-cols-[minmax(0,1fr)_420px] xl:items-start":"",children:[(0,W.jsx)("div",{className:"grid gap-6 xl:grid-cols-2",children:y.map(e=>(0,W.jsx)("div",{className:r===e?"ring-1 ring-cyan-400/40 rounded-2xl":"",children:v[e]},e))}),i&&(0,W.jsx)("aside",{className:"xl:sticky xl:top-6 xl:self-start",children:(0,W.jsxs)("div",{className:"rounded-2xl border border-cyan-500/20 bg-slate-900/70",children:[(0,W.jsxs)("div",{className:"border-b border-slate-800 px-4 py-3",children:[(0,W.jsx)("div",{className:"text-[10px] uppercase tracking-[0.18em] text-cyan-300",children:"Selected memory"}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:"Inspect the memory here while you keep resolving duplicates and contradictions in the review queue."})]}),(0,W.jsx)("div",{className:"xl:max-h-[calc(100vh-8rem)] xl:overflow-y-auto",children:(0,W.jsx)(oF,{memory:i,onClose:()=>a(null)})}),(0,W.jsx)("div",{className:"border-t border-slate-800 px-4 py-3",children:(0,W.jsx)("button",{onClick:()=>a(null),className:"rounded-lg border border-slate-700 px-3 py-1 text-xs text-slate-300 hover:border-slate-500",children:"Close panel"})})]})})]})]})})}let cY=(0,oD.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),cQ=(0,oD.default)("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),cX=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function cG(){let e=(0,sc.useMutation)({mutationFn:async({format:e,startTime:t,endTime:r})=>{let n=new URLSearchParams({format:e});t&&n.set("startTime",t),r&&n.set("endTime",r);let i=await (0,sa.gatedFetch)(`${cX}/api/audit/export?${n}`);if(!i.ok)throw Error((await i.json().catch(()=>({}))).error||"Export failed");let a=await i.blob(),s=URL.createObjectURL(a),o=document.createElement("a");return o.href=s,o.download=`shieldcortex-audit-${Date.now()}.${"csv"===e?"csv":"json"}`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s),{success:!0}}}),[t,r]=(0,H.useState)("json");return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(cY,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Export Audit Logs"})]}),(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[(0,W.jsxs)("div",{className:"flex rounded-lg overflow-hidden border border-slate-700",children:[(0,W.jsxs)("button",{onClick:()=>r("json"),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${"json"===t?"bg-cyan-600/20 text-cyan-400":"bg-slate-800 text-slate-400 hover:text-slate-200"}`,children:[(0,W.jsx)(cQ,{size:12})," JSON"]}),(0,W.jsxs)("button",{onClick:()=>r("csv"),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${"csv"===t?"bg-cyan-600/20 text-cyan-400":"bg-slate-800 text-slate-400 hover:text-slate-200"}`,children:[(0,W.jsx)(oJ,{size:12})," CSV"]})]}),(0,W.jsxs)("button",{onClick:()=>e.mutate({format:t}),disabled:e.isPending,className:"flex items-center gap-1.5 px-4 py-1.5 text-xs bg-cyan-600 text-white rounded-lg hover:bg-cyan-500 disabled:opacity-50 transition-colors",children:[(0,W.jsx)(cY,{size:12}),e.isPending?"Exporting...":"Export"]})]}),e.error&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:e.error.message}),e.isSuccess&&(0,W.jsx)("p",{className:"text-xs text-green-400",children:"Export downloaded successfully."})]})}function cZ(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(cm,{feature:"audit_export",label:"Export your full audit trail as JSON or CSV for compliance reporting.",children:(0,W.jsx)(cG,{})})})}let cJ={ALLOW:{color:"#22C55E",bg:"rgba(34, 197, 94, 0.15)",label:"Allowed"},BLOCK:{color:"#EF4444",bg:"rgba(239, 68, 68, 0.15)",label:"Blocked"},QUARANTINE:{color:"#EAB308",bg:"rgba(234, 179, 8, 0.15)",label:"Quarantined"}},c0={PUBLIC:{color:"#94a3b8",bg:"rgba(148, 163, 184, 0.15)"},INTERNAL:{color:"#60a5fa",bg:"rgba(96, 165, 250, 0.15)"},CONFIDENTIAL:{color:"#f59e0b",bg:"rgba(245, 158, 11, 0.15)"},RESTRICTED:{color:"#ef4444",bg:"rgba(239, 68, 68, 0.15)"}},c1={instruction_injection:{color:"#ef4444",bg:"rgba(239, 68, 68, 0.15)"},privilege_escalation:{color:"#ef4444",bg:"rgba(239, 68, 68, 0.15)"},credential_leak:{color:"#ef4444",bg:"rgba(239, 68, 68, 0.15)"},encoding_obfuscation:{color:"#f59e0b",bg:"rgba(245, 158, 11, 0.15)"},fragmented_payload:{color:"#f59e0b",bg:"rgba(245, 158, 11, 0.15)"},external_url:{color:"#f59e0b",bg:"rgba(245, 158, 11, 0.15)"},pipeline_error:{color:"#94a3b8",bg:"rgba(148, 163, 184, 0.15)"}};function c2(e){return e>=.7?"#22C55E":e>=.4?"#EAB308":"#EF4444"}function c5(e){return e>.5?"#EF4444":e>.2?"#EAB308":"#94a3b8"}function c4({entry:e,onClose:t,onViewMemory:r}){let[n,i]=(0,H.useState)(!1),a=cJ[e.firewall_result]||cJ.ALLOW,s=c0[e.sensitivity_level]||c0.PUBLIC,o=function(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}(e.threat_indicators),l=function(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}(e.blocked_patterns),c=(0,H.useCallback)(()=>{let t=JSON.stringify(e,null,2);navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},[e]);return(0,W.jsxs)(og,{className:"bg-slate-900 border-slate-700 overflow-hidden",children:[(0,W.jsxs)(ov,{className:"border-b border-slate-700 pb-3",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[(0,W.jsx)("span",{className:"px-2.5 py-1 rounded-md text-xs font-bold",style:{backgroundColor:a.bg,color:a.color},children:a.label}),(0,W.jsx)("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:s.bg,color:s.color},children:e.sensitivity_level})]}),(0,W.jsx)(oM,{variant:"ghost",size:"sm",onClick:t,className:"text-slate-400 hover:text-white -mt-1",children:"✕"})]}),(0,W.jsx)("div",{className:"text-xs text-slate-400 mt-2",children:new Date(e.timestamp).toLocaleString()}),e.project&&(0,W.jsxs)("div",{className:"text-[10px] text-slate-500 mt-1",children:["Project: ",e.project]})]}),(0,W.jsxs)(oj,{className:"p-4 space-y-4",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Source"}),(0,W.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,W.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,W.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-cyan-500/10 text-cyan-400",children:e.source_type})}),e.source_identifier&&(0,W.jsx)("div",{className:"text-xs text-slate-300 mt-1 font-mono break-all",children:e.source_identifier})]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Scores"}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,W.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:"Trust"}),(0,W.jsxs)("div",{className:"text-lg font-bold",style:{color:c2(e.trust_score)},children:[(100*e.trust_score).toFixed(0),"%"]}),(0,W.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,W.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${100*e.trust_score}%`,backgroundColor:c2(e.trust_score)}})})]}),(0,W.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:"Anomaly"}),(0,W.jsxs)("div",{className:"text-lg font-bold",style:{color:c5(e.anomaly_score)},children:[(100*e.anomaly_score).toFixed(0),"%"]}),(0,W.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,W.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${100*e.anomaly_score}%`,backgroundColor:c5(e.anomaly_score)}})})]}),null!==e.fragmentation_score&&(0,W.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:"Fragmentation"}),(0,W.jsxs)("div",{className:"text-lg font-bold text-slate-300",children:[(100*e.fragmentation_score).toFixed(0),"%"]}),(0,W.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,W.jsx)("div",{className:"h-full rounded-full bg-purple-500 transition-all",style:{width:`${100*e.fragmentation_score}%`}})})]}),null!==e.pipeline_duration_ms&&(0,W.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:"Pipeline"}),(0,W.jsxs)("div",{className:"text-lg font-bold text-slate-300",children:[e.pipeline_duration_ms,"ms"]})]})]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Threat Indicators"}),o.length>0?(0,W.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o.map((e,t)=>{let r=c1[e]||{color:"#94a3b8",bg:"rgba(148, 163, 184, 0.15)"};return(0,W.jsx)("span",{className:"px-2 py-1 rounded text-[11px] font-medium",style:{backgroundColor:r.bg,color:r.color},children:e.replace(/_/g," ")},t)})}):(0,W.jsx)("div",{className:"text-xs text-slate-600",children:"No threats detected"})]}),l.length>0&&(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Blocked Patterns"}),(0,W.jsx)("div",{className:"bg-slate-800 rounded-lg p-3 max-h-32 overflow-y-auto",children:l.map((e,t)=>(0,W.jsx)("div",{className:"text-[11px] text-slate-300 font-mono break-all mb-1 last:mb-0",children:e},t))})]}),e.reason&&(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Reason"}),(0,W.jsx)("div",{className:"bg-slate-800 rounded-lg p-3",children:(0,W.jsx)("p",{className:"text-xs text-slate-300 whitespace-pre-wrap leading-relaxed",children:e.reason})})]}),(0,W.jsxs)("div",{className:"flex gap-2 pt-2",children:[e.memory_id&&r&&(0,W.jsx)(oM,{variant:"default",size:"sm",onClick:()=>r(e.memory_id),className:"flex-1 bg-blue-600 hover:bg-blue-700",children:"View Memory"}),(0,W.jsx)(oM,{variant:"outline",size:"sm",onClick:c,className:`flex-1 border-slate-700 transition-all ${n?"bg-green-600/20 text-green-400 border-green-600/50":"text-slate-300 hover:text-white"}`,children:n?"Copied":"Copy JSON"})]})]})]})}let c3={ALLOW:"bg-green-500/10 text-green-400",BLOCK:"bg-red-500/10 text-red-400",QUARANTINE:"bg-yellow-500/10 text-yellow-400"};function c6(){let{projectFilter:e,selectedAuditEntry:t,setSelectedAuditEntry:r}=(0,sr.useDashboardStore)(),[n,i]=(0,H.useState)("24h"),[a,s]=(0,H.useState)(void 0),[o,l]=(0,H.useState)(void 0),c={"24h":24,"7d":168,"30d":720},[u,d]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{d(Date.now())},[n]);let h=(0,H.useMemo)(()=>new Date(6e4*Math.floor((u-36e5*c[n])/6e4)).toISOString(),[u,n]),{data:p,isLoading:m}=(0,oq.useAuditLogs)({startTime:h,source:a,firewallResult:o,project:e||void 0,limit:200}),f=(0,H.useMemo)(()=>p?.logs??[],[p?.logs]),x=(0,H.useCallback)(e=>{if(!t||0===f.length)return;let n=f.findIndex(e=>e.id===t.id);"Escape"===e.key?r(null):"ArrowDown"===e.key&&n<f.length-1?(e.preventDefault(),r(f[n+1])):"ArrowUp"===e.key&&n>0&&(e.preventDefault(),r(f[n-1]))},[t,f,r]);return(0,H.useEffect)(()=>(window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)),[x]),(0,W.jsx)("div",{className:"h-full overflow-y-auto bg-slate-950",children:(0,W.jsxs)("div",{className:"mx-auto max-w-7xl space-y-6 p-6",children:[(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Audit Log"}),(0,W.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(e=>(0,W.jsx)("button",{onClick:()=>i(e),className:`px-3 py-1 text-xs rounded-md transition-colors ${n===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]}),(0,W.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,W.jsxs)("select",{value:o||"",onChange:e=>l(e.target.value||void 0),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded-lg px-2 py-1",children:[(0,W.jsx)("option",{value:"",children:"All Results"}),(0,W.jsx)("option",{value:"ALLOW",children:"Allowed"}),(0,W.jsx)("option",{value:"BLOCK",children:"Blocked"}),(0,W.jsx)("option",{value:"QUARANTINE",children:"Quarantined"})]}),(0,W.jsxs)("select",{value:a||"",onChange:e=>s(e.target.value||void 0),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded-lg px-2 py-1",children:[(0,W.jsx)("option",{value:"",children:"All Sources"}),(0,W.jsx)("option",{value:"hook",children:"Hook"}),(0,W.jsx)("option",{value:"api",children:"API"}),(0,W.jsx)("option",{value:"agent",children:"Agent"}),(0,W.jsx)("option",{value:"user",children:"User"}),(0,W.jsx)("option",{value:"cli",children:"CLI"})]}),(0,W.jsxs)("span",{className:"text-xs text-slate-500 self-center ml-auto",children:[f.length," entries"]})]})]}),(0,W.jsxs)("div",{className:`grid gap-6 ${t?"xl:grid-cols-[minmax(0,1.35fr)_360px]":""}`,children:[(0,W.jsx)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 overflow-hidden",children:m?(0,W.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading audit logs..."})}):0===f.length?(0,W.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"No audit entries for this period"})}):(0,W.jsx)("div",{className:"overflow-x-auto",children:(0,W.jsxs)("table",{className:"w-full text-xs",children:[(0,W.jsx)("thead",{className:"bg-slate-950/80",children:(0,W.jsxs)("tr",{className:"border-b border-slate-800",children:[(0,W.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Time"}),(0,W.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Source"}),(0,W.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Result"}),(0,W.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Trust"}),(0,W.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Anomaly"}),(0,W.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Reason"})]})}),(0,W.jsx)("tbody",{children:f.map(e=>(0,W.jsxs)("tr",{onClick:()=>{r(t?.id===e.id?null:e)},className:`border-b border-slate-800/50 cursor-pointer transition-colors ${t?.id===e.id?"bg-cyan-500/10 hover:bg-cyan-500/15":"hover:bg-slate-800/30"}`,children:[(0,W.jsx)("td",{className:"px-4 py-2 text-slate-400 whitespace-nowrap",children:new Date(e.timestamp).toLocaleString()}),(0,W.jsx)("td",{className:"px-4 py-2 text-slate-300",children:e.source_type}),(0,W.jsx)("td",{className:"px-4 py-2",children:(0,W.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${c3[e.firewall_result]||"text-slate-400"}`,children:e.firewall_result})}),(0,W.jsx)("td",{className:"px-4 py-2 text-slate-400",children:e.trust_score.toFixed(1)}),(0,W.jsx)("td",{className:"px-4 py-2",children:(0,W.jsx)("span",{className:e.anomaly_score>.5?"text-red-400":e.anomaly_score>.2?"text-yellow-400":"text-slate-400",children:e.anomaly_score.toFixed(2)})}),(0,W.jsx)("td",{className:"px-4 py-2 text-slate-400 max-w-xs truncate",children:e.reason||"—"})]},e.id))})]})})}),t&&(0,W.jsx)("div",{className:"xl:sticky xl:top-6 self-start",children:(0,W.jsx)(c4,{entry:t,onClose:()=>r(null)})})]}),(0,W.jsx)("div",{children:(0,W.jsx)(cZ,{})})]})})}let c8=(0,oD.default)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),c7=(0,oD.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),c9=(0,oD.default)("square-minus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);function ue({action:e,item:t,onConfirm:r,onCancel:n}){let[i,a]=(0,H.useState)(""),s="yes"===i.trim().toLowerCase();return(0,W.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-700 rounded-xl p-6 max-w-md w-full mx-4",children:[(0,W.jsxs)("h3",{className:"text-sm font-semibold text-white mb-2",children:["approve"===e?"Approve":"Reject"," quarantined item?"]}),(0,W.jsx)("p",{className:"text-xs text-slate-400 mb-1",children:(0,W.jsx)("strong",{children:t.title||"Untitled"})}),(0,W.jsx)("p",{className:"text-xs text-slate-500 mb-4",children:"approve"===e?"This will approve the item and promote it into memory.":"This will permanently discard the memory."}),(0,W.jsxs)("div",{className:"mb-4",children:[(0,W.jsxs)("label",{className:"text-xs text-slate-400 block mb-1",children:["Type ",(0,W.jsx)("strong",{className:"text-white",children:"YES"})," to confirm:"]}),(0,W.jsx)("input",{type:"text",value:i,onChange:e=>a(e.target.value),className:"w-full bg-slate-800 border border-slate-700 text-white text-sm rounded-lg px-3 py-2 focus:ring-cyan-500 focus:border-cyan-500",autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&s&&r(),"Escape"===e.key&&n()}})]}),(0,W.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,W.jsx)("button",{onClick:n,className:"px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors",children:"Cancel"}),(0,W.jsx)("button",{onClick:r,disabled:!s,className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${s?"approve"===e?"bg-green-600 text-white hover:bg-green-500":"bg-red-600 text-white hover:bg-red-500":"bg-slate-700 text-slate-500 cursor-not-allowed"}`,children:"approve"===e?"Approve":"Reject"})]})]})})}function ut(){let{projectFilter:e}=(0,sr.useDashboardStore)(),[t,r]=(0,H.useState)("pending"),{data:n,isLoading:i}=(0,oq.useQuarantine)(t,100,e||void 0),a=(0,oq.useApproveQuarantine)(),s=(0,oq.useRejectQuarantine)(),o=(0,oq.useBulkApproveQuarantine)(),l=(0,oq.useBulkRejectQuarantine)(),[c,u]=(0,H.useState)(null),[d,h]=(0,H.useState)(new Set),[p,m]=(0,H.useState)(null),f=a.error?.message||s.error?.message||o.error?.message||l.error?.message||null,x=n?.items??[],y=x.filter(e=>"pending"===e.status),g=y.length>0&&y.every(e=>d.has(e.id)),v=y.some(e=>d.has(e.id)),b=(0,H.useCallback)(e=>{h(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),j=(0,H.useCallback)(()=>{g?h(new Set):h(new Set(y.map(e=>e.id)))},[g,y]);return(0,W.jsxs)("div",{className:"h-full overflow-y-auto bg-slate-950",children:[c&&(0,W.jsx)(ue,{action:c.action,item:c.item,onConfirm:()=>{c&&("approve"===c.action?a.mutate(c.item.id):s.mutate({id:c.item.id}),u(null))},onCancel:()=>u(null)}),p&&(0,W.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-700 rounded-xl p-6 max-w-md w-full mx-4",children:[(0,W.jsxs)("h3",{className:"text-sm font-semibold text-white mb-2",children:["approve"===p?"Approve":"Reject"," ",d.size," item",1!==d.size?"s":"","?"]}),(0,W.jsx)("p",{className:"text-xs text-slate-400 mb-4",children:"approve"===p?"This will approve all selected items and promote them into memory.":"This will permanently discard all selected memories."}),(0,W.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,W.jsx)("button",{onClick:()=>m(null),className:"px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors",children:"Cancel"}),(0,W.jsxs)("button",{onClick:()=>{if(!p||0===d.size)return;let e=Array.from(d);"approve"===p?o.mutate(e):l.mutate(e),h(new Set),m(null)},className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${"approve"===p?"bg-green-600 text-white hover:bg-green-500":"bg-red-600 text-white hover:bg-red-500"}`,children:["approve"===p?"Approve":"Reject"," ",d.size," item",1!==d.size?"s":""]})]})]})}),(0,W.jsxs)("div",{className:"mx-auto max-w-6xl space-y-6 p-6",children:[(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Quarantine Review"}),(0,W.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["pending","approved","rejected"].map(e=>(0,W.jsx)("button",{onClick:()=>{r(e),h(new Set)},className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${t===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]}),"pending"===t&&y.length>0&&(0,W.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,W.jsxs)("button",{onClick:j,className:"flex items-center gap-1.5 text-xs text-slate-400 hover:text-white transition-colors",children:[g?(0,W.jsx)(c8,{size:14,className:"text-cyan-400"}):v?(0,W.jsx)(c9,{size:14,className:"text-cyan-400"}):(0,W.jsx)(c7,{size:14}),g?"Deselect all":"Select all"]}),v&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("span",{className:"text-xs text-slate-500",children:[d.size," selected"]}),(0,W.jsxs)("button",{onClick:()=>m("approve"),className:"flex items-center gap-1 px-2.5 py-1 text-xs bg-green-600/10 text-green-400 rounded-lg hover:bg-green-600/20 transition-colors",children:[(0,W.jsx)(oL,{size:12})," Approve"]}),(0,W.jsxs)("button",{onClick:()=>m("reject"),className:"flex items-center gap-1 px-2.5 py-1 text-xs bg-red-600/10 text-red-400 rounded-lg hover:bg-red-600/20 transition-colors",children:[(0,W.jsx)(lw.X,{size:12})," Reject"]})]})]})]}),f&&(0,W.jsx)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 p-4 text-sm text-red-200",children:f}),(0,W.jsx)("div",{children:i?(0,W.jsx)("div",{className:"flex items-center justify-center rounded-2xl border border-slate-800 bg-slate-900/70 h-32",children:(0,W.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading quarantine items..."})}):0===x.length?(0,W.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-slate-800 bg-slate-900/70 h-32 text-slate-500",children:[(0,W.jsx)(o0,{size:24,className:"mb-2 text-slate-600"}),(0,W.jsxs)("span",{className:"text-xs",children:["No ",t," items"]})]}):(0,W.jsx)("div",{className:"space-y-3",children:x.map(e=>{let t=(()=>{try{return JSON.parse(e.threat_indicators)}catch{return[]}})();return(0,W.jsxs)("div",{className:`bg-slate-900 border rounded-xl p-4 ${d.has(e.id)?"border-cyan-600/50":"border-slate-800"}`,children:[(0,W.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,W.jsxs)("div",{className:"flex items-start gap-2.5",children:["pending"===e.status&&(0,W.jsx)("button",{onClick:()=>b(e.id),className:"mt-0.5 text-slate-500 hover:text-cyan-400 transition-colors shrink-0",children:d.has(e.id)?(0,W.jsx)(c8,{size:14,className:"text-cyan-400"}):(0,W.jsx)(c7,{size:14})}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-sm font-medium text-white",children:e.title||"Untitled"}),(0,W.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0.5",children:[e.source_type," · ",new Date(e.created_at).toLocaleString(),e.anomaly_score>0&&(0,W.jsxs)("span",{className:`ml-2 ${e.anomaly_score>.5?"text-red-400":"text-yellow-400"}`,children:["Anomaly: ",e.anomaly_score.toFixed(2)]})]})]})]}),(0,W.jsx)("span",{className:"text-[10px] text-red-400 bg-red-400/10 px-2 py-0.5 rounded",children:e.reason?.slice(0,50)||"Threat detected"})]}),(0,W.jsx)("div",{className:"bg-slate-800/50 rounded-lg p-3 mb-3 text-xs text-slate-300 whitespace-pre-wrap break-words",children:e.content?.slice(0,500)||"No content"}),t.length>0&&(0,W.jsx)("div",{className:"flex gap-1 mb-3 flex-wrap",children:t.map((e,t)=>(0,W.jsx)("span",{className:"text-[9px] text-yellow-400 bg-yellow-400/10 px-1.5 py-0.5 rounded",children:e},t))}),"pending"===e.status&&(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsxs)("button",{onClick:()=>u({action:"approve",item:e}),disabled:a.isPending||o.isPending,className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-green-600/10 text-green-400 rounded-lg hover:bg-green-600/20 transition-colors",children:[(0,W.jsx)(oL,{size:12})," Approve"]}),(0,W.jsxs)("button",{onClick:()=>u({action:"reject",item:e}),disabled:s.isPending||l.isPending,className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-red-600/10 text-red-400 rounded-lg hover:bg-red-600/20 transition-colors",children:[(0,W.jsx)(lw.X,{size:12})," Reject"]})]}),e.reviewed_at&&(0,W.jsxs)("div",{className:"text-[10px] text-slate-500",children:["approved"===e.status?"Approved":"Rejected"," by ",e.reviewed_by," at ",new Date(e.reviewed_at).toLocaleString()]})]},e.id)})})})]})]})}let ur=(0,oD.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),un=(0,oD.default)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);var ui=e.i(22934);let ua=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function us(e,t){let r=new URLSearchParams({timeRange:e});t&&r.set("project",t);let n=await (0,sa.authFetch)(`${ua}/api/v1/agents?${r}`);if(!n.ok)throw Error("Failed to fetch agent registry");return n.json()}async function uo(e,t,r){let n=encodeURIComponent(e),i=new URLSearchParams({timeRange:t});r&&i.set("project",r);let a=await (0,sa.authFetch)(`${ua}/api/v1/agents/${n}/timeline?${i}`);if(!a.ok)throw Error("Failed to fetch agent timeline");return a.json()}async function ul(e,t){let r=encodeURIComponent(e),n=new URLSearchParams;t?.limit&&n.set("limit",t.limit.toString()),t?.offset&&n.set("offset",t.offset.toString()),t?.firewallResult&&n.set("firewallResult",t.firewallResult),t?.project&&n.set("project",t.project);let i=await (0,sa.authFetch)(`${ua}/api/v1/agents/${r}/operations?${n}`);if(!i.ok)throw Error("Failed to fetch agent operations");return i.json()}function uc(e,t){return(0,si.useQuery)({queryKey:["agent-operations",e,t],queryFn:()=>ul(e,t),enabled:!!e,refetchInterval:3e4,retry:2})}function uu(e){return e>=.7?"full":e>=.5?"limited":"restricted"}let ud={full:"text-green-400",limited:"text-yellow-400",restricted:"text-red-400"},uh={full:"bg-green-500/10",limited:"bg-yellow-500/10",restricted:"bg-red-500/10"},up={full:"Full Access",limited:"Limited",restricted:"Restricted"},um=460,uf=90;function ux({identifier:e,timeRange:t}){let{data:r,isLoading:n}=function(e,t="24h",r){return(0,si.useQuery)({queryKey:["agent-timeline",e,t,void 0],queryFn:()=>uo(e,t,void 0),enabled:!!e,refetchInterval:3e4,retry:2})}(e,t),i=(0,H.useMemo)(()=>r?.points??[],[r?.points]),{linePath:a,dots:s,xLabels:o}=(0,H.useMemo)(()=>{if(0===i.length)return{linePath:"",dots:[],xLabels:[]};let e=i.map(e=>new Date(e.timestamp).getTime()),r=Math.min(...e),n=Math.max(...e)-r||1,a=e=>30+(e-r)/n*um,s=e=>10+(1-e)*uf,o=i.map((t,r)=>{let n=a(e[r]),i=s(t.trust_score);return`${0===r?"M":"L"} ${n} ${i}`}),l=i.map((t,r)=>({x:a(e[r]),y:s(t.trust_score),result:t.firewall_result,score:t.trust_score,time:t.timestamp})).filter(e=>"ALLOW"!==e.result),c=Math.min(5,i.length),u=[];for(let e=0;e<c;e++){let i=r+n*e/(c-1||1),s=new Date(i);u.push({x:a(i),label:"24h"===t?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})})}return{linePath:o.join(" "),dots:l,xLabels:u}},[i,t]);return n?(0,W.jsx)("div",{className:"h-[120px] flex items-center justify-center text-slate-500 text-xs",children:"Loading timeline..."}):0===i.length?(0,W.jsx)("div",{className:"h-[120px] flex items-center justify-center text-slate-500 text-xs",children:"No data for this time range."}):(0,W.jsxs)("svg",{viewBox:"0 0 500 120",className:"w-full",preserveAspectRatio:"xMidYMid meet",children:[(0,W.jsx)("line",{x1:30,y1:10+(1-.7)*uf,x2:30+um,y2:10+(1-.7)*uf,stroke:"#22c55e",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,W.jsx)("line",{x1:30,y1:10+.5*uf,x2:30+um,y2:10+.5*uf,stroke:"#eab308",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,W.jsx)("text",{x:26,y:10+(1-.7)*uf+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.7"}),(0,W.jsx)("text",{x:26,y:10+.5*uf+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.5"}),(0,W.jsx)("text",{x:26,y:13,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"1.0"}),(0,W.jsx)("text",{x:26,y:10+uf+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.0"}),(0,W.jsx)("path",{d:a,fill:"none",stroke:"#06b6d4",strokeWidth:"1.5"}),s.map((e,t)=>(0,W.jsx)("circle",{cx:e.x,cy:e.y,r:"3",fill:"BLOCK"===e.result?"#ef4444":"#eab308",stroke:"#0f172a",strokeWidth:"1",children:(0,W.jsx)("title",{children:`${e.result} — trust: ${e.score.toFixed(2)} — ${new Date(e.time).toLocaleString()}`})},t)),o.map((e,t)=>(0,W.jsx)("text",{x:e.x,y:116,fill:"#64748b",fontSize:"8",textAnchor:"middle",children:e.label},t))]})}let uy={BLOCK:"text-red-400 bg-red-500/10",QUARANTINE:"text-yellow-400 bg-yellow-500/10"};function ug({identifier:e}){let{data:t,isLoading:r}=uc(e,{firewallResult:"BLOCK",limit:20}),{data:n}=uc(e,{firewallResult:"QUARANTINE",limit:20}),i=[...t?.entries??[],...n?.entries??[]].sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime());return r?(0,W.jsx)("div",{className:"text-slate-500 text-xs",children:"Loading..."}):0===i.length?(0,W.jsx)("div",{className:"text-slate-500 text-xs",children:"No flagged operations."}):(0,W.jsx)("div",{className:"space-y-1 max-h-60 overflow-y-auto",children:i.map(e=>{let t=[];try{t=JSON.parse(e.threat_indicators)}catch{}return(0,W.jsxs)("div",{className:"px-2 py-1.5 rounded bg-slate-800/50 border border-slate-800",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:`px-1 py-0.5 rounded text-[10px] font-medium ${uy[e.firewall_result]??"text-slate-400"}`,children:e.firewall_result}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:new Date(e.timestamp).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),e.reason&&(0,W.jsx)("p",{className:"text-[11px] text-slate-400 mt-0.5 truncate",children:e.reason}),t.length>0&&(0,W.jsx)("div",{className:"flex gap-1 mt-1 flex-wrap",children:t.map((e,t)=>(0,W.jsx)("span",{className:"px-1 py-0.5 rounded text-[9px] bg-red-500/10 text-red-400",children:e},t))}),(0,W.jsxs)("div",{className:"flex gap-3 mt-1 text-[10px] text-slate-500",children:[(0,W.jsxs)("span",{children:["Trust: ",e.trust_score.toFixed(2)]}),(0,W.jsxs)("span",{children:["Anomaly: ",e.anomaly_score.toFixed(2)]}),null!==e.pipeline_duration_ms&&(0,W.jsxs)("span",{children:[e.pipeline_duration_ms,"ms"]})]})]},e.id)})})}let uv=(0,oD.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),ub=Y.default.env.NEXT_PUBLIC_WS_URL||"ws://localhost:3001/ws/events";function uj({agentFilter:e}){let[t,r]=(0,H.useState)([]),n=(0,H.useRef)(0),i=(0,H.useRef)(null),a=(0,H.useCallback)(t=>{try{let i=JSON.parse(t.data);if("defence_event"!==i.type)return;let a=i.data;if(e&&a.source_identifier!==e)return;r(e=>[{...a,id:++n.current},...e].slice(0,50))}catch{}},[e]);return((0,H.useEffect)(()=>{try{let e=new WebSocket(ub);return i.current=e,e.onmessage=a,e.onerror=()=>{},()=>{e.close(),i.current=null}}catch{return}},[a]),0===t.length)?(0,W.jsxs)("div",{className:"flex items-center gap-2 text-slate-500 text-xs py-2",children:[(0,W.jsx)(uv,{size:12}),(0,W.jsx)("span",{children:"Listening for defence events..."})]}):(0,W.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:(0,W.jsx)(eh,{initial:!1,children:t.map(e=>(0,W.jsxs)(a9.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},className:`px-2 py-1.5 rounded border text-xs ${"BLOCK"===e.firewall_result?"bg-red-500/5 border-red-500/20":"bg-yellow-500/5 border-yellow-500/20"}`,children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:`font-medium ${"BLOCK"===e.firewall_result?"text-red-400":"text-yellow-400"}`,children:e.firewall_result}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:new Date(e.timestamp).toLocaleTimeString()})]}),(0,W.jsxs)("p",{className:"text-slate-400 text-[11px] truncate mt-0.5",children:[e.source_identifier," — ",e.reason??"No reason"]})]},e.id))})})}function uw({identifier:e,compact:t}){let r=e.split(">").map(e=>e.trim());return 1===r.length?(0,W.jsx)("span",{className:"font-mono text-sm text-white",children:e}):t?(0,W.jsxs)("span",{className:"font-mono text-sm",children:[(0,W.jsxs)("span",{className:"text-slate-500",children:[r.slice(0,-1).join(" › ")," › "]}),(0,W.jsx)("span",{className:"text-white",children:r[r.length-1]})]}):(0,W.jsx)("div",{className:"font-mono text-sm",children:r.map((e,t)=>(0,W.jsxs)("span",{children:[t>0&&(0,W.jsx)(ui.ChevronRight,{size:12,className:"inline text-slate-600 mx-0.5"}),(0,W.jsx)("span",{className:t===r.length-1?"text-white":"text-slate-500",children:e})]},t))})}function uN({score:e}){let t=uu(e);return(0,W.jsxs)("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium ${ud[t]} ${uh[t]}`,children:[e.toFixed(2)," · ",up[t]]})}function uk({type:e}){let t={agent:"text-purple-400 bg-purple-500/10",cli:"text-cyan-400 bg-cyan-500/10",user:"text-green-400 bg-green-500/10",hook:"text-blue-400 bg-blue-500/10",api:"text-orange-400 bg-orange-500/10",web:"text-red-400 bg-red-500/10",file:"text-slate-400 bg-slate-500/10",email:"text-yellow-400 bg-yellow-500/10"}[e]??"text-slate-400 bg-slate-500/10";return(0,W.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${t}`,children:e})}function uS(){let{projectFilter:e}=(0,sr.useDashboardStore)(),[t,r]=(0,H.useState)("24h"),[n,i]=(0,H.useState)(null),[a,s]=(0,H.useState)("operation_count"),[o,l]=(0,H.useState)(!1),[c,u]=(0,H.useState)(null),[d,h]=(0,H.useState)(null),[p,m]=(0,H.useState)(!1),[f]=(0,H.useState)(()=>Date.now()),{data:x,isLoading:y}=function(e="24h",t){return(0,si.useQuery)({queryKey:["agents",e,t],queryFn:()=>us(e,t),refetchInterval:3e4,retry:2})}(t,e??void 0),g=(0,H.useMemo)(()=>x?.agents??[],[x?.agents]),v=(0,H.useMemo)(()=>{let e=g;return c&&(e=e.filter(e=>e.source_type===c)),d&&(e=e.filter(e=>uu(e.avg_trust_score)===d)),p&&(e=e.filter(e=>e.flagged_count>0)),e},[g,c,d,p]),b=(0,H.useMemo)(()=>{let e=[...v];return e.sort((e,t)=>{let r=e[a],n=t[a];return"string"==typeof r&&"string"==typeof n?o?r.localeCompare(n):n.localeCompare(r):o?r-n:n-r}),e},[v,a,o]),j=(0,H.useMemo)(()=>[...new Set(g.map(e=>e.source_type))],[g]),w=e=>{a===e?l(!o):(s(e),l(!1))};return(0,W.jsxs)("div",{className:"flex h-full",children:[(0,W.jsxs)("div",{className:`${n?"w-1/2":"w-full"} border-r border-slate-800 flex flex-col`,children:[(0,W.jsxs)("div",{className:"p-3 border-b border-slate-800 flex items-center justify-between",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(o4,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h2",{className:"text-sm font-medium text-white",children:"Agent Registry"}),(0,W.jsxs)("span",{className:"text-xs text-slate-500",children:[b.length," agents"]})]}),(0,W.jsx)("div",{className:"flex gap-1",children:["24h","7d","30d"].map(e=>(0,W.jsx)("button",{onClick:()=>r(e),className:`px-2 py-0.5 text-[10px] rounded transition-colors ${t===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]}),(0,W.jsxs)("div",{className:"px-3 py-2 border-b border-slate-800 flex items-center gap-2 flex-wrap",children:[(0,W.jsx)(ur,{size:12,className:"text-slate-500"}),j.map(e=>(0,W.jsx)("button",{onClick:()=>u(c===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${c===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,W.jsx)("span",{className:"text-slate-700",children:"|"}),["full","limited","restricted"].map(e=>(0,W.jsx)("button",{onClick:()=>h(d===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${d===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,W.jsx)("span",{className:"text-slate-700",children:"|"}),(0,W.jsxs)("button",{onClick:()=>m(!p),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors flex items-center gap-0.5 ${p?"bg-red-600/20 text-red-400":"text-slate-500 hover:text-slate-300"}`,children:[(0,W.jsx)(o0,{size:10})," flagged"]})]}),(0,W.jsxs)("div",{className:"px-3 py-1.5 border-b border-slate-800 grid grid-cols-[1fr_80px_60px_60px_70px] gap-2 text-[10px] text-slate-500",children:[(0,W.jsx)("span",{children:"Agent"}),(0,W.jsxs)("button",{onClick:()=>w("avg_trust_score"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Trust ",(0,W.jsx)(un,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>w("operation_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Ops ",(0,W.jsx)(un,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>w("flagged_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Flagged ",(0,W.jsx)(un,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>w("last_seen"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Last seen ",(0,W.jsx)(un,{size:8})]})]}),(0,W.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[y&&(0,W.jsx)("div",{className:"p-4 text-center text-slate-500 text-xs",children:"Loading agents..."}),!y&&0===b.length&&(0,W.jsx)("div",{className:"p-4 text-center text-slate-500 text-xs",children:"No agents found in this time range."}),b.map(e=>{let t,r=n?.source_identifier===e.source_identifier&&n?.source_type===e.source_type;return(0,W.jsxs)("button",{onClick:()=>i(r?null:e),className:`w-full px-3 py-2 grid grid-cols-[1fr_80px_60px_60px_70px] gap-2 items-center text-left transition-colors border-b border-slate-800/50 ${r?"bg-cyan-600/10":"hover:bg-slate-800/50"}`,children:[(0,W.jsxs)("div",{className:"min-w-0",children:[(0,W.jsx)(uw,{identifier:e.source_identifier,compact:!0}),(0,W.jsx)("div",{className:"mt-0.5",children:(0,W.jsx)(uk,{type:e.source_type})})]}),(0,W.jsx)(uN,{score:e.avg_trust_score}),(0,W.jsx)("span",{className:"text-xs text-slate-300 tabular-nums",children:e.operation_count}),(0,W.jsx)("span",{className:`text-xs tabular-nums ${e.flagged_count>0?"text-red-400":"text-slate-500"}`,children:e.flagged_count}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:(t=f-new Date(e.last_seen).getTime())<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`})]},`${e.source_type}:${e.source_identifier}`)})]})]}),(0,W.jsx)(eh,{children:n&&(0,W.jsxs)(a9.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"w-1/2 flex flex-col overflow-y-auto",children:[(0,W.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)(uw,{identifier:n.source_identifier}),(0,W.jsx)("button",{onClick:()=>i(null),className:"text-slate-500 hover:text-white text-xs",children:"Close"})]}),(0,W.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,W.jsx)(uk,{type:n.source_type}),(0,W.jsx)(uN,{score:n.avg_trust_score}),(0,W.jsxs)("span",{className:"text-[10px] text-slate-500",children:[n.operation_count," ops · ",n.flagged_count," flagged"]})]})]}),(0,W.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,W.jsx)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:"Trust Score Timeline"}),(0,W.jsx)(ux,{identifier:n.source_identifier,timeRange:t})]}),(0,W.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,W.jsxs)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:["Flagged Operations",n.flagged_count>0&&(0,W.jsxs)("span",{className:"ml-1 text-red-400",children:["(",n.flagged_count,")"]})]}),(0,W.jsx)(ug,{identifier:n.source_identifier})]}),(0,W.jsxs)("div",{className:"p-3",children:[(0,W.jsx)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:"Live Alerts"}),(0,W.jsx)(uj,{agentFilter:n.source_identifier})]})]})})]})}let uO=(0,oD.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),uP={critical:"text-red-400 bg-red-400/10",high:"text-red-400 bg-red-400/10",medium:"text-yellow-400 bg-yellow-400/10",low:"text-slate-400 bg-slate-400/10",safe:"text-green-400 bg-green-400/10"};function uC({level:e}){let t=uP[e]??uP.low;return(0,W.jsx)("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${t}`,children:e.toUpperCase()})}function uA({findings:e}){return 0===e.length?null:(0,W.jsx)("div",{className:"mt-2 space-y-1.5 pl-6",children:e.map((e,t)=>(0,W.jsxs)("div",{className:"flex items-start gap-2",children:[(0,W.jsx)(uC,{level:e.severity}),(0,W.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,W.jsx)("span",{className:"text-xs text-slate-300",children:e.description}),e.matchedText&&(0,W.jsxs)("div",{className:"mt-0.5 text-[10px] text-slate-500 font-mono truncate",children:['Match: "',e.matchedText,'"']})]})]},`${e.pattern}-${t}`))})}function uE(e){let t=e.split(/[/\\]/);return t[t.length-1]||e}function uM({file:e,cloudConnected:t,onTrust:r,onUntrust:n,onRemove:i,onCloudUpsell:a}){let[s,o]=(0,H.useState)(!e.safe),[l,c]=(0,H.useState)(!1);return(0,W.jsxs)("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg overflow-hidden",children:[(0,W.jsxs)("div",{className:"flex items-center",children:[(0,W.jsxs)("button",{onClick:()=>o(!s),className:"flex-1 px-3 py-2.5 flex items-center gap-3 hover:bg-slate-800/80 transition-colors min-w-0",children:[e.trusted?(0,W.jsx)(uO,{size:16,className:"text-cyan-400 shrink-0"}):e.safe?(0,W.jsx)(lj,{size:16,className:"text-green-400 shrink-0"}):(0,W.jsx)(l_,{size:16,className:"text-red-400 shrink-0"}),(0,W.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,W.jsx)("span",{className:"text-xs font-medium text-white truncate block",children:e.skillName||uE(e.path)}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500 truncate block",children:e.path.replace(/^\/Users\/[^/]+/,"~")})]}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500 shrink-0",children:e.format}),e.trusted?(0,W.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-cyan-400/10 text-cyan-400",children:"TRUSTED"}):(0,W.jsx)(uC,{level:e.riskLevel}),(0,W.jsxs)("span",{className:"text-[10px] text-slate-600 shrink-0",children:[e.scanDurationMs,"ms"]}),e.findings.length>0?s?(0,W.jsx)(lo,{size:14,className:"text-slate-500 shrink-0"}):(0,W.jsx)(ui.ChevronRight,{size:14,className:"text-slate-500 shrink-0"}):(0,W.jsx)("div",{className:"w-[14px] shrink-0"})]}),(0,W.jsxs)("div",{className:"flex items-center gap-0.5 pr-2 shrink-0",children:[e.trusted?(0,W.jsx)("button",{onClick:()=>n(e.path),title:"Remove trust",className:"p-1.5 rounded hover:bg-slate-700 transition-colors text-cyan-400 hover:text-cyan-300",children:(0,W.jsx)(uO,{size:14})}):(0,W.jsx)("button",{onClick:()=>r(e.path),title:"Mark as trusted",className:"p-1.5 rounded hover:bg-slate-700 transition-colors text-slate-500 hover:text-cyan-400",children:(0,W.jsx)(oZ,{size:14})}),!e.safe&&!e.trusted&&(0,W.jsx)("button",{onClick:()=>t?c(!0):a(),title:t?"Remove skill file":"Connect to Cloud to remove",className:`p-1.5 rounded transition-colors ${t?"hover:bg-red-500/10 text-slate-500 hover:text-red-400":"text-slate-600 hover:text-slate-400 cursor-not-allowed"}`,children:(0,W.jsx)(cd,{size:14})})]})]}),l&&(0,W.jsxs)("div",{className:"border-t border-slate-700/50 px-3 py-2.5 bg-red-950/30 flex items-center gap-3",children:[(0,W.jsxs)("span",{className:"text-xs text-red-300 flex-1",children:["Remove ",(0,W.jsx)("span",{className:"font-medium",children:e.skillName||uE(e.path)}),"? This will delete the file from disk."]}),(0,W.jsx)("button",{onClick:()=>{i(e.path),c(!1)},className:"px-3 py-1 text-xs font-medium bg-red-600 hover:bg-red-500 text-white rounded transition-colors",children:"Delete"}),(0,W.jsx)("button",{onClick:()=>c(!1),className:"px-3 py-1 text-xs text-slate-400 hover:text-white transition-colors",children:"Cancel"})]}),s&&e.findings.length>0&&(0,W.jsx)("div",{className:"border-t border-slate-700/50 px-3 py-2 bg-slate-900/50",children:(0,W.jsx)(uA,{findings:e.findings})})]})}function uT({files:e,cloudConnected:t,onTrust:r,onUntrust:n,onRemove:i,onCloudUpsell:a}){return 0===e.length?null:(0,W.jsx)("div",{className:"space-y-1.5",children:e.map(e=>(0,W.jsx)(uM,{file:e,cloudConnected:t,onTrust:r,onUntrust:n,onRemove:i,onCloudUpsell:a},e.path))})}let u_=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function uD(){let[e,t]=(0,H.useState)(null),[r,n]=(0,H.useState)(!1),[i,a]=(0,H.useState)(null),[s,o]=(0,H.useState)(!1),l=async()=>{n(!0),a(null);try{let e=await (0,sa.gatedFetch)(`${u_}/api/skills/deep-scan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:[]})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Deep scan failed")}t(await e.json())}catch(e){e instanceof sa.FeatureLockedError?o(!0):a(e.message)}finally{n(!1)}};return s?(0,W.jsx)(uI,{}):(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(o3,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Deep Skill Scanner"})]}),(0,W.jsxs)("button",{onClick:l,disabled:r,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-cyan-600 text-white rounded-lg hover:bg-cyan-500 disabled:opacity-50 transition-colors",children:[(0,W.jsx)(o7.Search,{size:12}),r?"Scanning...":"Run Deep Scan"]})]}),i&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:i}),e&&(0,W.jsxs)("div",{className:"space-y-3",children:[e.degraded&&(0,W.jsx)("p",{className:"text-[10px] text-yellow-400 bg-yellow-500/10 px-2 py-1 rounded",children:e.degradedReason}),e.correlations.length>0&&(0,W.jsxs)("div",{className:"space-y-1",children:[(0,W.jsx)("h4",{className:"text-xs text-slate-400 font-medium",children:"Cross-File Correlations"}),e.correlations.map((e,t)=>(0,W.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 bg-slate-800/30 rounded text-xs",children:[(0,W.jsx)(o0,{size:12,className:"critical"===e.severity?"text-red-400 mt-0.5":"high"===e.severity?"text-orange-400 mt-0.5":"text-yellow-400 mt-0.5"}),(0,W.jsxs)("div",{children:[(0,W.jsx)("p",{className:"text-slate-200",children:e.finding}),(0,W.jsxs)("p",{className:"text-slate-500 text-[10px]",children:["Files: ",e.files.join(", ")]})]})]},t))]}),Object.keys(e.intentBreakdown).length>0&&(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs text-slate-400 font-medium mb-1",children:"Intent Breakdown"}),(0,W.jsx)("div",{className:"grid grid-cols-2 gap-1",children:Object.entries(e.intentBreakdown).map(([e,t])=>(0,W.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,W.jsx)("div",{className:"flex-1",children:(0,W.jsx)("div",{className:"h-1.5 bg-slate-800 rounded-full overflow-hidden",children:(0,W.jsx)("div",{className:"h-full bg-cyan-500/60 rounded-full",style:{width:`${Math.min(100,5*t)}%`}})})}),(0,W.jsx)("span",{className:"text-slate-500 text-[10px] w-16 truncate",children:e}),(0,W.jsx)("span",{className:"text-slate-400 text-[10px] w-4 text-right",children:t})]},e))})]}),e.recommendations.length>0&&(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs text-slate-400 font-medium mb-1",children:"Recommendations"}),(0,W.jsx)("ul",{className:"space-y-1",children:e.recommendations.map((e,t)=>(0,W.jsx)("li",{className:"text-xs text-slate-300 pl-3 relative before:absolute before:left-0 before:top-1.5 before:w-1.5 before:h-1.5 before:rounded-full before:bg-cyan-500/40",children:e},t))})]}),0===e.correlations.length&&0===Object.keys(e.intentBreakdown).length&&(0,W.jsx)("p",{className:"text-xs text-slate-500 text-center py-2",children:"No files provided for scanning. Upload skill files to analyse."})]}),!e&&!r&&(0,W.jsx)("p",{className:"text-xs text-slate-500 text-center py-2",children:"Run a deep scan to analyse skill files for cross-file threats and intent patterns."})]})}function uI(){return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(o3,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Deep Skill Scanner"})]}),(0,W.jsxs)("div",{className:"space-y-1",children:[(0,W.jsx)("h4",{className:"text-xs text-slate-400 font-medium",children:"Cross-File Correlations"}),cv.map((e,t)=>(0,W.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 bg-slate-800/30 rounded text-xs",children:[(0,W.jsx)(o0,{size:12,className:"critical"===e.severity?"text-red-400 mt-0.5":"high"===e.severity?"text-orange-400 mt-0.5":"text-yellow-400 mt-0.5"}),(0,W.jsxs)("div",{children:[(0,W.jsx)("p",{className:"text-slate-200",children:e.finding}),(0,W.jsxs)("p",{className:"text-slate-500 text-[10px]",children:["Files: ",e.files.join(", ")]})]})]},t))]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs text-slate-400 font-medium mb-1",children:"Intent Breakdown"}),(0,W.jsx)("div",{className:"grid grid-cols-2 gap-1",children:Object.entries(cb).map(([e,t])=>(0,W.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,W.jsx)("div",{className:"flex-1",children:(0,W.jsx)("div",{className:"h-1.5 bg-slate-800 rounded-full overflow-hidden",children:(0,W.jsx)("div",{className:"h-full bg-cyan-500/60 rounded-full",style:{width:`${t}%`}})})}),(0,W.jsx)("span",{className:"text-slate-500 text-[10px] w-16 truncate",children:e}),(0,W.jsx)("span",{className:"text-slate-400 text-[10px] w-4 text-right",children:t})]},e))})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h4",{className:"text-xs text-slate-400 font-medium mb-1",children:"Recommendations"}),(0,W.jsx)("ul",{className:"space-y-1",children:cj.map((e,t)=>(0,W.jsx)("li",{className:"text-xs text-slate-300 pl-3 relative before:absolute before:left-0 before:top-1.5 before:w-1.5 before:h-1.5 before:rounded-full before:bg-cyan-500/40",children:e},t))})]})]})}function uL(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(cm,{feature:"skill_scanner_deep",label:"Deep skill scanning with multi-file analysis and semantic intent detection.",children:(0,W.jsx)(uD,{})})})}let uz=[{value:"",label:"Auto-detect"},{value:"skill-md",label:"SKILL.md (Claude Code)"},{value:"hook-md",label:"HOOK.md (OpenClaw)"},{value:"hook-js",label:"handler.js (OpenClaw)"},{value:"rules",label:".cursorrules / .windsurfrules / .clinerules"},{value:"claude-md",label:"CLAUDE.md"},{value:"copilot-md",label:"copilot-instructions.md"},{value:"aider-yml",label:".aider.conf.yml"},{value:"continue-json",label:".continue/config.json"}];function uR(){let e=lz(),t=(0,sc.useMutation)({mutationFn:lL}),r=(0,sc.useMutation)({mutationFn:lR}),n=(0,sc.useMutation)({mutationFn:lF}),i=(0,sc.useMutation)({mutationFn:l$}),{data:a}=l5(),[s,o]=(0,H.useState)(null),[l,c]=(0,H.useState)(null),[u,d]=(0,H.useState)(!1),[h,p]=(0,H.useState)(""),[m,f]=(0,H.useState)(""),[x,y]=(0,H.useState)(!1),g=!!(a?.enabled&&a?.apiKeySet);return(0,W.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Skills Scanner"}),(0,W.jsx)("p",{className:"text-xs text-slate-400 mt-0.5",children:"Scan agent instruction files for hidden threats"})]}),(0,W.jsxs)("button",{onClick:()=>{e.mutate(void 0,{onSuccess:e=>o(e)})},disabled:e.isPending,className:"flex items-center gap-1.5 px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 rounded-lg text-sm font-medium text-white transition-colors",children:[e.isPending?(0,W.jsx)(lb,{size:14,className:"animate-spin"}):(0,W.jsx)(o3,{size:14}),"Scan All"]})]}),x&&(0,W.jsxs)("div",{className:"mb-4 bg-slate-900 border border-cyan-800/50 rounded-xl p-4 flex items-center gap-3",children:[(0,W.jsx)(le,{size:20,className:"text-cyan-400 shrink-0"}),(0,W.jsxs)("div",{className:"flex-1",children:[(0,W.jsx)("p",{className:"text-sm font-medium text-white",children:"Connect to ShieldCortex Cloud"}),(0,W.jsx)("p",{className:"text-xs text-slate-400 mt-0.5",children:"Enable one-click skill removal and cloud-powered threat intelligence."})]}),(0,W.jsx)("button",{onClick:()=>y(!1),className:"text-xs text-slate-500 hover:text-slate-300 transition-colors",children:"Dismiss"})]}),s?(0,W.jsxs)("div",{className:"space-y-4",children:[(0,W.jsxs)("div",{className:"flex items-center gap-3 text-xs text-slate-400",children:[(0,W.jsxs)("span",{children:[(0,W.jsx)("span",{className:"text-white font-medium",children:s.totalScanned})," files scanned"]}),(0,W.jsx)("span",{className:"text-slate-600",children:"·"}),s.threatCount>0?(0,W.jsxs)("span",{children:[(0,W.jsx)("span",{className:"text-red-400 font-medium",children:s.threatCount})," with threats"]}):(0,W.jsx)("span",{className:"text-green-400",children:"All clean"}),(0,W.jsx)("span",{className:"text-slate-600",children:"·"}),(0,W.jsx)("span",{children:new Date(s.scannedAt).toLocaleTimeString()})]}),(0,W.jsx)(uT,{files:s.files,cloudConnected:g,onTrust:e=>{r.mutate(e,{onSuccess:()=>{s&&o({...s,files:s.files.map(t=>t.path===e?{...t,trusted:!0}:t),threatCount:s.files.filter(t=>!t.safe&&!t.trusted&&t.path!==e).length})}})},onUntrust:e=>{n.mutate(e,{onSuccess:()=>{s&&o({...s,files:s.files.map(t=>t.path===e?{...t,trusted:!1}:t),threatCount:s.files.filter(t=>{let r=t.path!==e&&t.trusted;return!t.safe&&!r}).length})}})},onRemove:e=>{i.mutate(e,{onSuccess:()=>{if(s){let t=s.files.filter(t=>t.path!==e);o({...s,files:t,totalScanned:t.length,threatCount:t.filter(e=>!e.safe&&!e.trusted).length})}}})},onCloudUpsell:()=>y(!0)})]}):e.isPending?(0,W.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,W.jsx)(lb,{size:24,className:"text-cyan-400 animate-spin"})}):(0,W.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,W.jsx)(o3,{size:32,className:"text-slate-600 mb-3"}),(0,W.jsx)("p",{className:"text-sm text-slate-400",children:"No skills scanned yet"}),(0,W.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:'Click "Scan All" to discover and scan agent instruction files'})]}),(0,W.jsxs)("div",{className:"mt-6",children:[(0,W.jsxs)("button",{onClick:()=>d(!u),className:"flex items-center gap-1.5 text-xs text-slate-400 hover:text-slate-300 transition-colors",children:[u?(0,W.jsx)(lo,{size:14}):(0,W.jsx)(ui.ChevronRight,{size:14}),"Paste & Scan"]}),u&&(0,W.jsxs)("div",{className:"mt-3 bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("textarea",{value:h,onChange:e=>p(e.target.value),placeholder:"Paste skill/instruction file content here...",className:"w-full h-32 bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white placeholder:text-slate-500 focus:ring-cyan-500 focus:border-cyan-500 resize-y font-mono"}),(0,W.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,W.jsx)("select",{value:m,onChange:e=>f(e.target.value),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded-lg px-3 py-2 focus:ring-cyan-500 focus:border-cyan-500",children:uz.map(e=>(0,W.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,W.jsxs)("button",{onClick:()=>{h.trim()&&t.mutate({content:h,format:m||void 0},{onSuccess:e=>c(e)})},disabled:t.isPending||!h.trim(),className:"flex items-center gap-1.5 px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 rounded-lg text-xs font-medium text-white transition-colors",children:[t.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):(0,W.jsx)(o3,{size:12}),"Scan Content"]})]}),l&&(0,W.jsxs)("div",{className:"mt-4 bg-slate-800/50 border border-slate-700 rounded-lg p-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,W.jsx)("span",{className:"text-xs font-medium text-white",children:l.skillName}),(0,W.jsx)(uC,{level:l.riskLevel}),(0,W.jsxs)("span",{className:"text-[10px] text-slate-500",children:[l.scanDurationMs,"ms"]})]}),(0,W.jsx)("p",{className:"text-xs text-slate-400",children:l.summary}),l.findings.length>0&&(0,W.jsx)(uA,{findings:l.findings})]})]})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(uL,{})})]})}let uF=(0,oD.default)("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),u$=(0,oD.default)("shield-off",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]),uB=(0,oD.default)("scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),uU=(0,oD.default)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),uq=(0,oD.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),uV=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function uK(){let e,t,r,{data:n,isLoading:i,isLocked:a}={...e=(0,si.useQuery)({queryKey:["custom-patterns"],queryFn:()=>(0,sa.gatedFetch)(`${uV}/api/patterns`).then(e=>{if(!e.ok)throw Error("Failed to fetch custom patterns");return e.json()}),retry:(e,t)=>!(t instanceof sa.FeatureLockedError)&&e<2,refetchInterval:3e4}),isLocked:e.error instanceof sa.FeatureLockedError},s=(t=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${uV}/api/patterns`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{t.invalidateQueries({queryKey:["custom-patterns"]})}})),o=(r=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${uV}/api/patterns/${e}`,{method:"DELETE"}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{r.invalidateQueries({queryKey:["custom-patterns"]})}})),l=(0,sc.useMutation)({mutationFn:({id:e,text:t})=>(0,sa.gatedFetch)(`${uV}/api/patterns/${e}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t})}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)}))}),[c,u]=(0,H.useState)(!1),[d,h]=(0,H.useState)(null),[p,m]=(0,H.useState)({name:"",category:"custom",severity:"medium",regex:"",description:""}),f=n?.patterns??[],x=!0,y="";if(p.regex)try{new RegExp(p.regex)}catch(e){x=!1,y=e.message}return a?(0,W.jsx)(uW,{}):(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(o6,{size:16,className:"text-red-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Custom Injection Patterns"}),(0,W.jsxs)("span",{className:"text-xs text-slate-500",children:[f.length,"/50"]})]}),(0,W.jsxs)("button",{onClick:()=>u(!c),className:"flex items-center gap-1 px-2 py-1 text-xs bg-red-600/20 text-red-400 rounded hover:bg-red-600/30 transition-colors",children:[(0,W.jsx)(cu,{size:12})," Add Pattern"]})]}),c&&(0,W.jsxs)("form",{onSubmit:e=>{e.preventDefault(),s.mutate(p,{onSuccess:()=>{u(!1),m({name:"",category:"custom",severity:"medium",regex:"",description:""})}})},className:"p-3 bg-slate-800/50 rounded-lg space-y-2",children:[(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,W.jsx)("input",{value:p.name,onChange:e=>m(t=>({...t,name:e.target.value})),placeholder:"Pattern name",required:!0,className:"px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200 placeholder:text-slate-600"}),(0,W.jsxs)("select",{value:p.severity,onChange:e=>m(t=>({...t,severity:e.target.value})),className:"px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200",children:[(0,W.jsx)("option",{value:"critical",children:"Critical"}),(0,W.jsx)("option",{value:"high",children:"High"}),(0,W.jsx)("option",{value:"medium",children:"Medium"}),(0,W.jsx)("option",{value:"low",children:"Low"})]})]}),(0,W.jsxs)("div",{className:"relative",children:[(0,W.jsx)("input",{value:p.regex,onChange:e=>m(t=>({...t,regex:e.target.value})),placeholder:"Regex pattern",required:!0,className:`w-full px-2 py-1.5 text-xs bg-slate-900 border rounded text-slate-200 font-mono placeholder:text-slate-600 ${x?"border-slate-700":"border-red-500"}`}),!x&&(0,W.jsx)("p",{className:"text-[10px] text-red-400 mt-0.5",children:y})]}),(0,W.jsx)("input",{value:p.description,onChange:e=>m(t=>({...t,description:e.target.value})),placeholder:"Description (optional)",className:"w-full px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200 placeholder:text-slate-600"}),(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsx)("button",{type:"submit",disabled:s.isPending||!x,className:"px-3 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-500 disabled:opacity-50",children:s.isPending?"Creating...":"Create"}),(0,W.jsx)("button",{type:"button",onClick:()=>u(!1),className:"px-3 py-1 text-xs text-slate-400 hover:text-slate-200",children:"Cancel"})]}),s.error&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:s.error.message})]}),i?(0,W.jsx)("div",{className:"text-xs text-slate-500 py-4 text-center",children:"Loading patterns..."}):0===f.length?(0,W.jsx)("div",{className:"text-xs text-slate-500 py-4 text-center",children:'No custom patterns yet. Click "Add Pattern" to create one.'}):(0,W.jsx)("div",{className:"space-y-1",children:f.map(e=>(0,W.jsxs)("div",{className:"px-3 py-2 bg-slate-800/30 rounded text-xs space-y-1",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-slate-200 flex-1 font-medium",children:e.name}),(0,W.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${"critical"===e.severity?"bg-red-500/20 text-red-400":"high"===e.severity?"bg-orange-500/20 text-orange-400":"medium"===e.severity?"bg-yellow-500/20 text-yellow-400":"bg-slate-500/20 text-slate-400"}`,children:e.severity}),(0,W.jsx)("button",{onClick:()=>h(d?.id===e.id?null:{id:e.id,text:""}),className:"text-slate-500 hover:text-cyan-400",title:"Test pattern",children:(0,W.jsx)(uq,{size:12})}),(0,W.jsx)("button",{onClick:()=>o.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(cd,{size:12})})]}),(0,W.jsx)("code",{className:"text-slate-500 text-[10px] block truncate",children:e.regex}),d?.id===e.id&&(0,W.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,W.jsx)("input",{value:d.text,onChange:t=>h({id:e.id,text:t.target.value}),placeholder:"Test text...",className:"flex-1 px-2 py-1 text-[10px] bg-slate-900 border border-slate-700 rounded text-slate-200 placeholder:text-slate-600"}),(0,W.jsx)("button",{onClick:()=>l.mutate({id:e.id,text:d.text}),disabled:!d.text,className:"px-2 py-1 text-[10px] bg-cyan-600/20 text-cyan-400 rounded hover:bg-cyan-600/30 disabled:opacity-50",children:"Test"}),l.data&&(0,W.jsxs)("span",{className:"text-[10px] text-slate-400 self-center",children:[l.data.count," matches"]})]})]},e.id))})]})}function uW(){return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(o6,{size:16,className:"text-red-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Custom Injection Patterns"}),(0,W.jsx)("span",{className:"text-xs text-slate-500",children:"0/50"})]}),(0,W.jsx)("div",{className:"space-y-1",children:cy.map(e=>(0,W.jsxs)("div",{className:"px-3 py-2 bg-slate-800/30 rounded text-xs space-y-1",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-slate-200 flex-1 font-medium",children:e.name}),(0,W.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${"critical"===e.severity?"bg-red-500/20 text-red-400":"high"===e.severity?"bg-orange-500/20 text-orange-400":"bg-yellow-500/20 text-yellow-400"}`,children:e.severity})]}),(0,W.jsx)("code",{className:"text-slate-500 text-[10px] block truncate",children:e.regex})]},e.id))})]})}function uH(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(cm,{feature:"custom_injection_patterns",label:"Define up to 50 custom regex patterns for detecting domain-specific threats.",children:(0,W.jsx)(uK,{})})})}let uY=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function uQ(){let e,t,r,n,{data:i,isLoading:a,isLocked:s}={...e=(0,si.useQuery)({queryKey:["custom-policies"],queryFn:()=>(0,sa.gatedFetch)(`${uY}/api/iron-dome/policies`).then(e=>{if(!e.ok)throw Error("Failed to fetch custom policies");return e.json()}),retry:(e,t)=>!(t instanceof sa.FeatureLockedError)&&e<2,refetchInterval:3e4}),isLocked:e.error instanceof sa.FeatureLockedError},o=(t=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${uY}/api/iron-dome/policies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{t.invalidateQueries({queryKey:["custom-policies"]})}})),l=(r=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${uY}/api/iron-dome/policies/${e}`,{method:"DELETE"}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{r.invalidateQueries({queryKey:["custom-policies"]})}})),c=(n=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${uY}/api/iron-dome/policies/${e}/activate`,{method:"PUT"}).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})),onSuccess:()=>{n.invalidateQueries({queryKey:["custom-policies"]})}})),[u,d]=(0,H.useState)(!1),[h,p]=(0,H.useState)({name:"",description:""}),m=i?.policies??[];return s?(0,W.jsx)(uX,{}):(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oZ,{size:16,className:"text-red-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Custom Iron Dome Policies"}),(0,W.jsxs)("span",{className:"text-xs text-slate-500",children:[m.length,"/10"]})]}),(0,W.jsxs)("button",{onClick:()=>d(!u),className:"flex items-center gap-1 px-2 py-1 text-xs bg-red-600/20 text-red-400 rounded hover:bg-red-600/30 transition-colors",children:[(0,W.jsx)(cu,{size:12})," Create Policy"]})]}),u&&(0,W.jsxs)("form",{onSubmit:e=>{e.preventDefault(),o.mutate({name:h.name,description:h.description,config:{}},{onSuccess:()=>{d(!1),p({name:"",description:""})}})},className:"p-3 bg-slate-800/50 rounded-lg space-y-2",children:[(0,W.jsx)("input",{value:h.name,onChange:e=>p(t=>({...t,name:e.target.value})),placeholder:"Policy name",required:!0,className:"w-full px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200 placeholder:text-slate-600"}),(0,W.jsx)("textarea",{value:h.description,onChange:e=>p(t=>({...t,description:e.target.value})),placeholder:"Description",rows:2,className:"w-full px-2 py-1.5 text-xs bg-slate-900 border border-slate-700 rounded text-slate-200 placeholder:text-slate-600 resize-none"}),(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsx)("button",{type:"submit",disabled:o.isPending,className:"px-3 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-500 disabled:opacity-50",children:o.isPending?"Creating...":"Create"}),(0,W.jsx)("button",{type:"button",onClick:()=>d(!1),className:"px-3 py-1 text-xs text-slate-400 hover:text-slate-200",children:"Cancel"})]}),o.error&&(0,W.jsx)("p",{className:"text-xs text-red-400",children:o.error.message})]}),a?(0,W.jsx)("div",{className:"text-xs text-slate-500 py-4 text-center",children:"Loading policies..."}):0===m.length?(0,W.jsx)("div",{className:"text-xs text-slate-500 py-4 text-center",children:'No custom policies yet. Click "Create Policy" to get started.'}):(0,W.jsx)("div",{className:"space-y-1",children:m.map(e=>(0,W.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 bg-slate-800/30 rounded text-xs",children:[(0,W.jsxs)("div",{className:"flex-1",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-slate-200 font-medium",children:e.name}),1===e.is_active&&(0,W.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-green-500/20 text-green-400 text-[10px] font-medium",children:"Active"})]}),e.description&&(0,W.jsx)("p",{className:"text-slate-500 text-[10px] mt-0.5",children:e.description})]}),!e.is_active&&(0,W.jsxs)("button",{onClick:()=>c.mutate(e.id),className:"flex items-center gap-1 px-2 py-1 text-[10px] bg-green-600/20 text-green-400 rounded hover:bg-green-600/30",title:"Set active",children:[(0,W.jsx)(oL,{size:10})," Activate"]}),(0,W.jsx)("button",{onClick:()=>l.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(cd,{size:12})})]},e.id))})]})}function uX(){return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oZ,{size:16,className:"text-red-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200",children:"Custom Iron Dome Policies"}),(0,W.jsx)("span",{className:"text-xs text-slate-500",children:"0/10"})]}),(0,W.jsx)("div",{className:"space-y-1",children:cg.map(e=>(0,W.jsx)("div",{className:"flex items-center gap-3 px-3 py-2 bg-slate-800/30 rounded text-xs",children:(0,W.jsxs)("div",{className:"flex-1",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-slate-200 font-medium",children:e.name}),e.is_active&&(0,W.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-green-500/20 text-green-400 text-[10px] font-medium",children:"Active"})]}),(0,W.jsx)("p",{className:"text-slate-500 text-[10px] mt-0.5",children:e.description})]})},e.id))})]})}function uG(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(cm,{feature:"custom_iron_dome_policies",label:"Create custom Iron Dome policies with tailored action gates and trust levels.",children:(0,W.jsx)(uQ,{})})})}let uZ=[{id:"personal",label:"Personal",description:"Lighter touch for solo use",icon:oZ},{id:"enterprise",label:"Enterprise",description:"Financial & data protection",icon:ce},{id:"school",label:"School",description:"GDPR strict, pupil data guarded",icon:o4},{id:"paranoid",label:"Paranoid",description:"Everything requires approval",icon:o0}],uJ=[{name:"Injection Scanner",description:"40+ patterns across 8 categories",icon:uB},{name:"Instruction Gateway",description:"Trusted channel validation",icon:uF},{name:"Action Gate",description:"Approve / block external actions",icon:ce},{name:"PII Guard",description:"Block sensitive data output",icon:la},{name:"Kill Switch",description:"Emergency stop phrase",icon:u$},{name:"Sub-Agent Control",description:"Restrict spawned agent operations",icon:o4}],u0={critical:"bg-red-500/20 text-red-400 border-red-500/30",high:"bg-orange-500/20 text-orange-400 border-orange-500/30",medium:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",low:"bg-slate-500/20 text-slate-400 border-slate-500/30"},u1={CRITICAL:"bg-red-500/20 text-red-400",HIGH:"bg-orange-500/20 text-orange-400",MEDIUM:"bg-yellow-500/20 text-yellow-400",LOW:"bg-slate-500/20 text-slate-400",NONE:"bg-green-500/20 text-green-400"};function u2(){let e,t,r,{data:n,isLoading:i}=lG(),{data:a}=lZ(50),s=(e=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>lV(e),onSuccess:()=>{e.invalidateQueries({queryKey:["iron-dome-status"]}),e.invalidateQueries({queryKey:["iron-dome-audit"]})}})),o=(t=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:lK,onSuccess:()=>{t.invalidateQueries({queryKey:["iron-dome-status"]})}})),l=(0,sc.useMutation)({mutationFn:lW}),c=lJ(),u=(r=(0,sl.useQueryClient)(),(0,sc.useMutation)({mutationFn:e=>lY(e),onSuccess:()=>{r.invalidateQueries({queryKey:["control-status"]}),r.invalidateQueries({queryKey:["iron-dome-status"]}),r.invalidateQueries({queryKey:["iron-dome-audit"]})}})),{data:d}=(0,si.useQuery)({queryKey:["control-status"],queryFn:lQ,refetchInterval:5e3,retry:2}),[h,p]=(0,H.useState)(""),[m,f]=(0,H.useState)(null),[x,y]=(0,H.useState)(""),g=n?.enabled??!1,v=d?.killSwitchActive??!1,b=d?.killSwitchMeta??null,j=n?.profile,w=n?.config,N=a?.logs??[],k=N.filter(e=>"BLOCK"===e.firewall_result).length,S=N.filter(e=>"ALLOW"===e.firewall_result).length;return(0,W.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[(0,W.jsx)(o6,{size:20,className:"text-red-400"}),(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Iron Dome"}),i?(0,W.jsx)("span",{className:"text-[10px] text-slate-500 animate-pulse",children:"Loading..."}):(0,W.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${g?"bg-red-500/20 text-red-400 border border-red-500/30":"bg-slate-700/50 text-slate-500"}`,children:g?"ACTIVE":"INACTIVE"})]}),g&&(0,W.jsxs)("button",{onClick:()=>{o.mutate()},disabled:o.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 bg-red-500/10 border border-red-500/30 hover:bg-red-500/20 disabled:opacity-50 rounded-lg text-xs font-medium text-red-400 transition-colors",children:[o.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):(0,W.jsx)(u$,{size:12}),"Deactivate"]})]}),(0,W.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 mb-6",children:[(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-3",children:"Security Profiles"}),(0,W.jsx)("div",{className:"grid grid-cols-2 gap-2",children:uZ.map(({id:e,label:t,description:r,icon:n})=>(0,W.jsxs)("button",{onClick:()=>{s.mutate(e)},disabled:s.isPending,className:`text-left p-3 rounded-lg border transition-colors ${j===e?"border-red-500/50 bg-red-500/10 text-red-400":"border-slate-700 bg-slate-800/50 text-slate-400 hover:border-slate-600"}`,children:[(0,W.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,W.jsx)(n,{size:12}),(0,W.jsx)("span",{className:"text-xs font-medium",children:t})]}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:r})]},e))})]}),(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-3",children:"Module Status"}),(0,W.jsx)("div",{className:"space-y-2",children:uJ.map(({name:e,description:t,icon:r})=>(0,W.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg bg-slate-800/50",children:[(0,W.jsx)(r,{size:14,className:g?"text-red-400":"text-slate-600"}),(0,W.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,W.jsx)("div",{className:"text-xs font-medium text-slate-300",children:e}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 truncate",children:t})]}),(0,W.jsx)("span",{className:`w-2 h-2 rounded-full ${g?"bg-red-400":"bg-slate-600"}`})]},e))})]})]}),g&&w&&(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4 mb-6",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-3",children:"Active Configuration"}),(0,W.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-1",children:"Trusted Channels"}),(0,W.jsx)("div",{className:"flex flex-wrap gap-1",children:w.trustedChannels.map(e=>(0,W.jsx)("span",{className:"px-1.5 py-0.5 bg-slate-800 rounded text-slate-400",children:e},e))})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-1",children:"Requires Approval"}),(0,W.jsx)("div",{className:"flex flex-wrap gap-1",children:w.requireApproval.map(e=>(0,W.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500/10 border border-red-500/20 rounded text-red-400",children:e},e))})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-1",children:"Kill Phrase"}),(0,W.jsx)("span",{className:"px-1.5 py-0.5 bg-slate-800 rounded text-slate-400 font-mono",children:w.killPhrase})]})]})]}),v?(0,W.jsxs)("div",{className:"bg-red-950/50 border-2 border-red-500/50 rounded-xl p-5 mb-6 animate-pulse-slow",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,W.jsx)(uU,{size:18,className:"text-red-400"}),(0,W.jsx)("h3",{className:"text-sm font-bold text-red-400 uppercase tracking-wide",children:"Kill Switch Active"}),(0,W.jsx)("span",{className:"ml-auto text-[10px] bg-red-500/20 text-red-400 px-2 py-0.5 rounded-full border border-red-500/30",children:"LOCKDOWN"})]}),(0,W.jsx)("p",{className:"text-xs text-red-300/80 mb-2",children:"All agent operations are blocked. No memory reads, writes, graph queries, or consolidation. Iron Dome remains active and continues protecting."}),b&&(0,W.jsxs)("div",{className:"bg-red-950/30 border border-red-500/20 rounded-lg p-3 mb-4 space-y-1",children:[(0,W.jsxs)("div",{className:"text-[10px] text-slate-500",children:[(0,W.jsx)("span",{className:"text-red-400 font-medium",children:"Triggered:"})," ",new Date(b.triggeredAt).toLocaleString()]}),(0,W.jsxs)("div",{className:"text-[10px] text-slate-500",children:[(0,W.jsx)("span",{className:"text-red-400 font-medium",children:"Source:"})," ","kill_phrase"===b.source?`Kill phrase "${b.phrase}"`:"manual"===b.source?"Manual (dashboard)":"mcp_tool"===b.source?"MCP tool":b.source]}),void 0!==b.memoryCountAtTrigger&&(0,W.jsxs)("div",{className:"text-[10px] text-slate-500",children:[(0,W.jsx)("span",{className:"text-red-400 font-medium",children:"Memories at trigger:"})," ",b.memoryCountAtTrigger]})]}),(0,W.jsxs)("div",{className:"space-y-2",children:[(0,W.jsx)("input",{type:"text",value:x,onChange:e=>y(e.target.value),placeholder:"Reason for resuming (required)...",className:"w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white placeholder:text-slate-500 focus:outline-none focus:ring-1 focus:ring-green-500"}),(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[(0,W.jsxs)("button",{onClick:()=>{x.trim()&&(u.mutate(x.trim()),y(""))},disabled:u.isPending||!x.trim(),className:"flex items-center gap-1.5 px-4 py-2 bg-green-600 hover:bg-green-500 disabled:opacity-50 rounded-lg text-xs font-medium text-white transition-colors",children:[u.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):(0,W.jsx)(uq,{size:12}),"Resume Agent"]}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500",children:"Only resume after you've investigated the threat"})]})]})]}):(0,W.jsxs)("div",{className:"bg-slate-900 border border-orange-500/30 rounded-xl p-4 mb-6",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,W.jsx)(uU,{size:14,className:"text-orange-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-orange-300",children:"Emergency Stop"})]}),(0,W.jsx)("p",{className:"text-xs text-slate-400 mb-3",children:"Immediately halts your agent when you suspect it has been compromised or is acting on poisoned data. Blocks ALL operations — no reads, writes, or modifications. Iron Dome stays active."}),w?.killPhrase&&(0,W.jsxs)("p",{className:"text-[10px] text-slate-500 mb-3",children:["Kill phrase: ",(0,W.jsxs)("span",{className:"font-mono text-slate-400",children:['"',w.killPhrase,'"']})," — say this in conversation for hands-free stop"]}),(0,W.jsxs)("button",{onClick:()=>c.mutate(),disabled:c.isPending,className:"flex items-center gap-1.5 px-4 py-2 bg-red-600 hover:bg-red-500 disabled:opacity-50 rounded-lg text-xs font-bold text-white uppercase tracking-wider transition-colors",children:[c.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):(0,W.jsx)(uU,{size:14}),"Emergency Stop"]})]}),(0,W.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsxs)("h3",{className:"text-sm font-medium text-slate-300 mb-3",children:[(0,W.jsx)(uB,{size:14,className:"inline mr-1.5 text-red-400"}),"Injection Scanner"]}),(0,W.jsx)("textarea",{value:h,onChange:e=>p(e.target.value),placeholder:"Paste suspicious text to scan for injection patterns...",className:"w-full h-28 bg-slate-800 border border-slate-700 rounded-lg p-3 text-sm text-white placeholder:text-slate-500 resize-none focus:outline-none focus:ring-1 focus:ring-red-500 focus:border-red-500"}),(0,W.jsxs)("button",{onClick:()=>{h.trim()&&l.mutate(h,{onSuccess:e=>f(e)})},disabled:l.isPending||!h.trim(),className:"mt-2 flex items-center gap-1.5 px-3 py-1.5 bg-red-600 hover:bg-red-500 disabled:opacity-50 rounded-lg text-xs font-medium text-white transition-colors",children:[l.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):(0,W.jsx)(o6,{size:12}),"Scan"]}),m&&(0,W.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[m.clean?(0,W.jsx)(lj,{size:14,className:"text-green-400"}):(0,W.jsx)(l_,{size:14,className:"text-red-400"}),(0,W.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${u1[m.riskLevel]??"bg-slate-500/20 text-slate-400"}`,children:m.riskLevel}),(0,W.jsx)("span",{className:"text-xs text-slate-400",children:m.summary})]}),m.detections.map((e,t)=>(0,W.jsxs)("div",{className:`border rounded-lg p-3 ${u0[e.severity]??"border-slate-700"}`,children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,W.jsx)("span",{className:"text-[10px] font-medium uppercase",children:e.severity}),(0,W.jsx)("span",{className:"text-xs text-slate-300",children:e.category.replace(/_/g," ")})]}),(0,W.jsx)("p",{className:"text-[11px] text-slate-400 mb-1",children:e.description}),(0,W.jsx)("code",{className:"text-[10px] text-slate-500 bg-slate-800 px-1.5 py-0.5 rounded block truncate",children:e.match})]},t))]})]}),(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"Event Feed"}),(0,W.jsxs)("span",{className:"text-[10px] text-slate-500",children:["Last ",N.length," events"]})]}),(0,W.jsxs)("div",{className:"grid grid-cols-3 gap-2 mb-3",children:[(0,W.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-2 text-center",children:[(0,W.jsx)("div",{className:"text-sm font-bold text-slate-300",children:N.length}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:"Total"})]}),(0,W.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-2 text-center",children:[(0,W.jsx)("div",{className:"text-sm font-bold text-red-400",children:k}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:"Blocked"})]}),(0,W.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-2 text-center",children:[(0,W.jsx)("div",{className:"text-sm font-bold text-green-400",children:S}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:"Allowed"})]})]}),(0,W.jsx)("div",{className:"space-y-1 max-h-72 overflow-y-auto",children:0===N.length?(0,W.jsxs)("div",{className:"text-center py-6",children:[(0,W.jsx)(oZ,{size:20,className:"text-slate-600 mx-auto mb-1.5"}),(0,W.jsx)("p",{className:"text-[10px] text-slate-500",children:"No Iron Dome events yet"})]}):N.map((e,t)=>(0,W.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-slate-800/50 text-xs",children:[(0,W.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"BLOCK"===e.firewall_result?"bg-red-400":"bg-green-400"}`}),(0,W.jsx)("span",{className:"text-slate-400 truncate flex-1",children:(e.reason??"").replace(/^\[iron-dome:\w+\]\s*/,"")}),(0,W.jsx)("span",{className:"text-[10px] text-slate-600 shrink-0",children:new Date(e.timestamp).toLocaleTimeString()})]},e.id??t))})]})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(uH,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(uG,{})})]})}let u5=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",u4={architecture:"#3b82f6",error:"#ef4444",pattern:"#8b5cf6",preference:"#f59e0b",learning:"#10b981",context:"#6366f1",todo:"#f97316",note:"#94a3b8",relationship:"#ec4899",custom:"#64748b"},u3={short_term:"STM",long_term:"LTM",episodic:"Episodic"},u6={short_term:"#22d3ee",long_term:"#a78bfa",episodic:"#f472b6"},u8=["architecture","pattern","preference","error","context","learning","todo","note","relationship","custom"],u7=[{label:"All",value:"all"},{label:"STM",value:"short_term"},{label:"LTM",value:"long_term"},{label:"Episodic",value:"episodic"}];function u9(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function de({className:e}){let[t,r]=(0,H.useState)([]),[n,i]=(0,H.useState)(!0),[a,s]=(0,H.useState)(null),[o,l]=(0,H.useState)(new Set),[c,u]=(0,H.useState)("all"),[d,h]=(0,H.useState)(""),p=(0,H.useRef)(null),m=(0,H.useRef)(new Map),[f,x]=(0,H.useState)(new Set);(0,H.useEffect)(()=>{let e=!1;return async function(){i(!0),s(null);try{let t=await (0,sa.authFetch)(`${u5}/api/memories?limit=200&sort=created_at&order=desc`);if(!t.ok)throw Error(`API returned ${t.status}`);let n=await t.json();e||r(Array.isArray(n)?n:n.memories??[])}catch(t){e||s(t instanceof Error?t.message:"Failed to load memories")}finally{e||i(!1)}}(),()=>{e=!0}},[]),(0,H.useEffect)(()=>(p.current=new IntersectionObserver(e=>{x(t=>{let r=new Set(t);for(let t of e){let e=Number(t.target.getAttribute("data-memory-id"));t.isIntersecting&&r.add(e)}return r})},{threshold:.1,rootMargin:"0px 0px 50px 0px"}),()=>p.current?.disconnect()),[]);let y=(0,H.useCallback)(e=>t=>{t&&(m.current.set(e,t),p.current?.observe(t))},[]),g=(0,H.useMemo)(()=>{let e=t;if(o.size>0&&(e=e.filter(e=>o.has(e.category))),"all"!==c&&(e=e.filter(e=>e.type===c)),d.trim()){let t=d.toLowerCase();e=e.filter(e=>e.title.toLowerCase().includes(t)||e.content.toLowerCase().includes(t))}return e},[t,o,c,d]),v=(0,H.useMemo)(()=>(function(e){let t=new Map;for(let r of e){let e=u9(r.createdAt);t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.entries()).sort(([e],[t])=>t.localeCompare(e)).map(([e,t])=>({key:e,label:function(e){let t=new Date,r=u9(t.toISOString()),n=new Date(t);n.setDate(n.getDate()-1);let i=u9(n.toISOString());if(e===r)return"Today";if(e===i)return"Yesterday";let[a,s,o]=e.split("-").map(Number),l=new Date(a,s-1,o);return l.toLocaleDateString(void 0,{month:"long",day:"numeric",year:l.getFullYear()!==t.getFullYear()?"numeric":void 0})}(e),memories:t}))})(g),[g]);return n?(0,W.jsx)("div",{className:`flex items-center justify-center h-full bg-[#0a0a0f] ${e??""}`,children:(0,W.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,W.jsx)("div",{className:"w-8 h-8 border-2 border-slate-700 border-t-cyan-500 rounded-full animate-spin"}),(0,W.jsx)("span",{className:"text-sm text-slate-400",children:"Loading timeline..."})]})}):a?(0,W.jsx)("div",{className:`flex items-center justify-center h-full bg-[#0a0a0f] ${e??""}`,children:(0,W.jsxs)("div",{className:"text-center space-y-2",children:[(0,W.jsx)("p",{className:"text-red-400 text-sm",children:"Failed to load memories"}),(0,W.jsx)("p",{className:"text-slate-500 text-xs",children:a})]})}):(0,W.jsxs)("div",{className:`h-full flex flex-col bg-[#0a0a0f] text-slate-200 ${e??""}`,children:[(0,W.jsxs)("div",{className:"shrink-0 border-b border-slate-800/60 px-4 py-3 space-y-3",children:[(0,W.jsx)("input",{type:"text",placeholder:"Search memories...",value:d,onChange:e=>h(e.target.value),className:"w-full bg-slate-900/60 border border-slate-700/50 rounded-lg px-3 py-2 text-sm text-slate-200 placeholder-slate-500 focus:outline-none focus:ring-1 focus:ring-cyan-500/40 focus:border-cyan-500/40"}),(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-xs text-slate-500 uppercase tracking-wider mr-1",children:"Type"}),u7.map(e=>(0,W.jsx)("button",{onClick:()=>u(e.value),className:`px-2.5 py-1 rounded-md text-xs font-medium transition-colors ${c===e.value?"bg-cyan-500/20 text-cyan-400 border border-cyan-500/30":"bg-slate-800/40 text-slate-400 border border-slate-700/30 hover:bg-slate-800/80"}`,children:e.label},e.value))]}),(0,W.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,W.jsx)("span",{className:"text-xs text-slate-500 uppercase tracking-wider mr-1 self-center",children:"Category"}),u8.map(e=>{let t=o.has(e),r=u4[e]??"#64748b";return(0,W.jsx)("button",{onClick:()=>{l(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},className:"px-2.5 py-1 rounded-md text-xs font-medium transition-all",style:{backgroundColor:t?`${r}22`:"rgba(30, 41, 59, 0.4)",color:t?r:"#94a3b8",border:`1px solid ${t?`${r}55`:"rgba(51, 65, 85, 0.3)"}`},children:e},e)}),o.size>0&&(0,W.jsx)("button",{onClick:()=>l(new Set),className:"px-2 py-1 rounded-md text-xs text-slate-500 hover:text-slate-300 transition-colors",children:"Clear"})]})]}),(0,W.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-6",children:0===v.length?(0,W.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,W.jsxs)("div",{className:"text-center space-y-2 max-w-sm",children:[(0,W.jsx)("div",{className:"text-slate-600 text-4xl mb-3",children:"--"}),(0,W.jsx)("p",{className:"text-slate-400 text-sm",children:"No memories yet."}),(0,W.jsxs)("p",{className:"text-slate-500 text-xs",children:["Start a conversation and use ",(0,W.jsx)("code",{className:"text-cyan-500/80 bg-slate-800/60 px-1.5 py-0.5 rounded text-xs",children:"remember"})," to build your timeline."]})]})}):(0,W.jsxs)("div",{className:"relative",children:[(0,W.jsx)("div",{className:"absolute left-4 md:left-1/2 top-0 bottom-0 w-px bg-slate-800/80"}),v.map(e=>(0,W.jsxs)("div",{className:"mb-8",children:[(0,W.jsxs)("div",{className:"relative flex items-center mb-4",children:[(0,W.jsx)("div",{className:"absolute left-4 md:left-1/2 -translate-x-1/2 w-3 h-3 rounded-full bg-slate-700 border-2 border-slate-600 z-10"}),(0,W.jsx)("div",{className:"ml-10 md:ml-0 md:absolute md:left-1/2 md:translate-x-4",children:(0,W.jsx)("span",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider bg-[#0a0a0f] px-2",children:e.label})})]}),e.memories.map((e,t)=>{var r;let n=t%2==0,i=(r=e.salience)>=.8?{label:"Critical",colour:"#ef4444"}:r>=.6?{label:"High",colour:"#f59e0b"}:r>=.4?{label:"Medium",colour:"#3b82f6"}:{label:"Low",colour:"#64748b"},a=u4[e.category]??"#64748b",s=u6[e.type]??"#94a3b8",o=u3[e.type]??e.type,l=f.has(e.id);return(0,W.jsxs)("div",{ref:y(e.id),"data-memory-id":e.id,className:`relative flex mb-4 ${n?"md:justify-start justify-start":"md:justify-end justify-start"}`,style:{opacity:+!!l,transform:l?"translateY(0)":"translateY(12px)",transition:"opacity 0.4s ease-out, transform 0.4s ease-out"},children:[(0,W.jsx)("div",{className:"absolute left-4 md:left-1/2 top-4 -translate-x-1/2 w-2 h-2 rounded-full z-10",style:{backgroundColor:a}}),(0,W.jsxs)("div",{className:`ml-10 md:ml-0 w-full md:w-[calc(50%-2rem)] rounded-lg border border-slate-800/60 bg-slate-900/40 backdrop-blur-sm p-3 hover:border-slate-700/80 transition-colors ${n?"md:mr-auto md:ml-0":"md:ml-auto md:mr-0"}`,children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-1.5",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-200 leading-tight flex-1 line-clamp-1",children:e.title}),(0,W.jsx)("span",{className:"text-[10px] text-slate-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})})]}),(0,W.jsx)("p",{className:"text-xs text-slate-400 line-clamp-2 mb-2 leading-relaxed",children:e.content}),(0,W.jsxs)("div",{className:"flex items-center flex-wrap gap-1.5",children:[(0,W.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:`${a}18`,color:a,border:`1px solid ${a}33`},children:e.category}),(0,W.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:`${s}18`,color:s,border:`1px solid ${s}33`},children:o}),(0,W.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px]",style:{color:i.colour},children:[(0,W.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:i.colour}}),i.label]})]})]})]},e.id)})]},e.key))]})})]})}var dt=Symbol.for("immer-nothing"),dr=Symbol.for("immer-draftable"),dn=Symbol.for("immer-state");function di(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var da=Object,ds=da.getPrototypeOf,dl="constructor",dc="prototype",du="configurable",dd="enumerable",dh="writable",dp="value",dm=e=>!!e&&!!e[dn];function df(e){return!!e&&(dg(e)||dk(e)||!!e[dr]||!!e[dl]?.[dr]||dS(e)||dO(e))}var dx=da[dc][dl].toString(),dy=new WeakMap;function dg(e){if(!e||!dP(e))return!1;let t=ds(e);if(null===t||t===da[dc])return!0;let r=da.hasOwnProperty.call(t,dl)&&t[dl];if(r===Object)return!0;if(!dC(r))return!1;let n=dy.get(r);return void 0===n&&(n=Function.toString.call(r),dy.set(r,n)),n===dx}function dv(e,t,r=!0){0===db(e)?(r?Reflect.ownKeys(e):da.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function db(e){let t=e[dn];return t?t.type_:dk(e)?1:dS(e)?2:3*!!dO(e)}var dj=(e,t,r=db(e))=>2===r?e.has(t):da[dc].hasOwnProperty.call(e,t),dw=(e,t,r=db(e))=>2===r?e.get(t):e[t],dN=(e,t,r,n=db(e))=>{2===n?e.set(t,r):3===n?e.add(r):e[t]=r},dk=Array.isArray,dS=e=>e instanceof Map,dO=e=>e instanceof Set,dP=e=>"object"==typeof e,dC=e=>"function"==typeof e,dA=e=>e.modified_?e.copy_:e.base_;function dE(e,t){if(dS(e))return new Map(e);if(dO(e))return new Set(e);if(dk(e))return Array[dc].slice.call(e);let r=dg(e);if(!0!==t&&("class_only"!==t||r)){let t=ds(e);if(null!==t&&r)return{...e};let n=da.create(t);return da.assign(n,e)}{let t=da.getOwnPropertyDescriptors(e);delete t[dn];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){let i=r[n],a=t[i];!1===a[dh]&&(a[dh]=!0,a[du]=!0),(a.get||a.set)&&(t[i]={[du]:!0,[dh]:!0,[dd]:a[dd],[dp]:e[i]})}return da.create(ds(e),t)}}function dM(e,t=!1){return d_(e)||dm(e)||!df(e)||(db(e)>1&&da.defineProperties(e,{set:dT,add:dT,clear:dT,delete:dT}),da.freeze(e),t&&dv(e,(e,t)=>{dM(t,!0)},!1)),e}var dT={[dp]:function(){di(2)}};function d_(e){return!(null!==e&&dP(e))||da.isFrozen(e)}var dD="MapSet",dI="Patches",dL="ArrayMethods",dz={};function dR(e){let t=dz[e];return t||di(0,e),t}var dF=e=>!!dz[e];function d$(e,t){t&&(e.patchPlugin_=dR(dI),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function dB(e){dU(e),e.drafts_.forEach(dV),e.drafts_=null}function dU(e){e===m&&(m=e.parent_)}var dq=e=>m={drafts_:[],parent_:m,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:dF(dD)?dR(dD):void 0,arrayMethodsPlugin_:dF(dL)?dR(dL):void 0};function dV(e){let t=e[dn];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function dK(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(void 0!==e&&e!==r){r[dn].modified_&&(dB(t),di(4)),df(e)&&(e=dW(t,e));let{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[dn].base_,e,t)}else e=dW(t,r);return function(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dM(t,r)}(t,e,!0),dB(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==dt?e:void 0}function dW(e,t){if(d_(t))return t;let r=t[dn];if(!r)return dZ(t,e.handledSet_,e);if(!dY(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:t}=r;if(t)for(;t.length>0;)t.pop()(e);dG(r,e)}return r.copy_}function dH(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dY=(e,t)=>e.scope_===t,dQ=[];function dX(e,t,r,n){let i=e.copy_||e.base_,a=e.type_;if(void 0!==n&&dw(i,n,a)===t)return void dN(i,n,r,a);if(!e.draftLocations_){let t=e.draftLocations_=new Map;dv(i,(e,r)=>{if(dm(r)){let n=t.get(r)||[];n.push(e),t.set(r,n)}})}for(let n of e.draftLocations_.get(t)??dQ)dN(i,n,r,a)}function dG(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:r}=t;if(r){let n=r.getPath(e);n&&r.generatePatches_(e,n,t)}dH(e)}}function dZ(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||dm(e)||t.has(e)||!df(e)||d_(e)||(t.add(e),dv(e,(n,i)=>{if(dm(i)){let t=i[dn];dY(t,r)&&(dN(e,n,dA(t),e.type_),dH(t))}else df(i)&&dZ(i,t,r)})),e}var dJ={get(e,t){let r;if(t===dn)return e;let n=e.scope_.arrayMethodsPlugin_,i=1===e.type_&&"string"==typeof t;if(i&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=e.copy_||e.base_;if(!dj(a,t,e.type_)){var s;let r;return s=e,(r=d2(a,t))?dp in r?r[dp]:r.get?.call(s.draft_):void 0}let o=a[t];if(e.finalized_||!df(o)||i&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(r=+t)&&String(r)===t)return o;if(o===d1(e.base_,t)){d4(e);let r=1===e.type_?+t:t,n=d3(e.scope_,o,e,r);return e.copy_[r]=n}return o},has:(e,t)=>t in(e.copy_||e.base_),ownKeys:e=>Reflect.ownKeys(e.copy_||e.base_),set(e,t,r){let n=d2(e.copy_||e.base_,t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=d1(e.copy_||e.base_,t),i=n?.[dn];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if((r===n?0!==r||1/r==1/n:r!=r&&n!=n)&&(void 0!==r||dj(e.base_,t,e.type_)))return!0;d4(e),d5(e)}return!!(e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=r,e.assigned_.set(t,!0),!function(e,t,r){let{scope_:n}=e;if(dm(r)){let i=r[dn];dY(i,n)&&i.callbacks_.push(function(){d4(e),dX(e,r,dA(i),t)})}else df(r)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(r)&&dZ(r,n.handledSet_,n):dw(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&dZ(dw(e.copy_,t,e.type_),n.handledSet_,n)})}(e,t,r),!0)},deleteProperty:(e,t)=>(d4(e),void 0!==d1(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),d5(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=e.copy_||e.base_,n=Reflect.getOwnPropertyDescriptor(r,t);return n?{[dh]:!0,[du]:1!==e.type_||"length"!==t,[dd]:n[dd],[dp]:r[t]}:n},defineProperty(){di(11)},getPrototypeOf:e=>ds(e.base_),setPrototypeOf(){di(12)}},d0={};for(let e in dJ){let t=dJ[e];d0[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function d1(e,t){let r=e[dn];return(r?r.copy_||r.base_:e)[t]}function d2(e,t){if(!(t in e))return;let r=ds(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=ds(r)}}function d5(e){!e.modified_&&(e.modified_=!0,e.parent_&&d5(e.parent_))}function d4(e){e.copy_||(e.assigned_=new Map,e.copy_=dE(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function d3(e,t,r,n){let[i,a]=dS(t)?dR(dD).proxyMap_(t,r):dO(t)?dR(dD).proxySet_(t,r):function(e,t){let r=dk(e),n={type_:+!!r,scope_:t?t.scope_:m,modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=n,a=dJ;r&&(i=[n],a=d0);let{revoke:s,proxy:o}=Proxy.revocable(i,a);return n.draft_=o,n.revoke_=s,[o,n]}(t,r);if((r?.scope_??m).drafts_.push(i),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&void 0!==n)r.callbacks_.push(function(e){if(!a||!dY(a,e))return;e.mapSetPlugin_?.fixSetContents(a);let t=dA(a);dX(r,a.draft_??a,t,n),dG(a,e)});else a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)});return i}function d6(e){return dm(e)||di(10,e),function e(t){let r;if(!df(t)||d_(t))return t;let n=t[dn],i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=dE(t,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=dE(t,!0);return dv(r,(t,n)=>{dN(r,t,e(n))},i),n&&(n.finalized_=!1),r}(e)}d0.deleteProperty=function(e,t){return d0.set.call(this,e,t,void 0)},d0.set=function(e,t,r){return dJ.set.call(this,e[0],t,r,e[0])};var d8=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{let n;if(dC(e)&&!dC(t)){let r=t;t=e;let n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}if(dC(t)||di(6),void 0===r||dC(r)||di(7),df(e)){let i=dq(this),a=d3(i,e,void 0),s=!0;try{n=t(a),s=!1}finally{s?dB(i):dU(i)}return d$(i,r),dK(n,i)}if(e&&dP(e))di(1,e);else{if(void 0===(n=t(e))&&(n=e),n===dt&&(n=void 0),this.autoFreeze_&&dM(n,!0),r){let t=[],i=[];dR(dI).generateReplacementPatches_(e,n,{patches_:t,inversePatches_:i}),r(t,i)}return n}},this.produceWithPatches=(e,t)=>{let r,n;return dC(e)?(t,...r)=>this.produceWithPatches(t,t=>e(t,...r)):[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){df(e)||di(8),dm(e)&&(e=d6(e));let t=dq(this),r=d3(t,e,void 0);return r[dn].isManual_=!0,dU(t),r}finishDraft(e,t){let r=e&&e[dn];r&&r.isManual_||di(9);let{scope_:n}=r;return d$(n,t),dK(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=dR(dI).applyPatches_;return dm(e)?n(e,t):this.produce(e,e=>n(e,t))}}().produce,d7=e=>Array.isArray(e)?e:[e],d9=0,he=class{revision=d9;_value;_lastValue;_isEqual=ht;constructor(e,t=ht){this._value=this._lastValue=e,this._isEqual=t}get value(){return this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++d9)}};function ht(e,t){return e===t}function hr(e){return e instanceof he||console.warn("Not a valid cell! ",e),e.value}var hn=(e,t)=>!1;function hi(){return function(e,t=ht){return new he(null,t)}(0,hn)}var ha=e=>{let t=e.collectionTag;null===t&&(t=e.collectionTag=hi()),hr(t)};Symbol();var hs=0,ho=Object.getPrototypeOf({}),hl=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,hc);tag=hi();tags={};children={};collectionTag=null;id=hs++},hc={get:(e,t)=>(function(){let{value:r}=e,n=Reflect.get(r,t);if("symbol"==typeof t||t in ho)return n;if("object"==typeof n&&null!==n){var i;let r=e.children[t];return void 0===r&&(r=e.children[t]=Array.isArray(i=n)?new hu(i):new hl(i)),r.tag&&hr(r.tag),r.proxy}{let r=e.tags[t];return void 0===r&&((r=e.tags[t]=hi()).value=n),hr(r),n}})(),ownKeys:e=>(ha(e),Reflect.ownKeys(e.value)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e.value,t),has:(e,t)=>Reflect.has(e.value,t)},hu=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],hd);tag=hi();tags={};children={};collectionTag=null;id=hs++},hd={get:([e],t)=>("length"===t&&ha(e),hc.get(e,t)),ownKeys:([e])=>hc.ownKeys(e),getOwnPropertyDescriptor:([e],t)=>hc.getOwnPropertyDescriptor(e,t),has:([e],t)=>hc.has(e,t)},hh="u">typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function hp(){return{s:0,v:void 0,o:null,p:null}}function hm(e,t={}){let r,n=hp(),{resultEqualityCheck:i}=t,a=0;function s(){let t,s=n,{length:o}=arguments;for(let e=0;e<o;e++){let t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=s.o;null===e&&(s.o=e=new WeakMap);let r=e.get(t);void 0===r?(s=hp(),e.set(t,s)):s=r}else{let e=s.p;null===e&&(s.p=e=new Map);let r=e.get(t);void 0===r?(s=hp(),e.set(t,s)):s=r}}let l=s;if(1===s.s)t=s.v;else if(t=e.apply(null,arguments),a++,i){let e=r?.deref?.()??r;null!=e&&i(e,t)&&(t=e,0!==a&&a--),r="object"==typeof t&&null!==t||"function"==typeof t?new hh(t):t}return l.s=1,l.v=t,t}return s.clearCache=()=>{n=hp(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}var hf=function(e,...t){let r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,n=(...e)=>{let t,n,i=0,a=0,s={},o=e.pop();"object"==typeof o&&(s=o,o=e.pop()),function(e,t=`expected a function, instead received ${typeof e}`){if("function"!=typeof e)throw TypeError(t)}(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:l,memoizeOptions:c=[],argsMemoize:u=hm,argsMemoizeOptions:d=[],devModeChecks:h={}}={...r,...s},p=d7(c),m=d7(d),f=(!function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let r=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw TypeError(`${t}[${r}]`)}}(t=Array.isArray(e[0])?e[0]:e,"createSelector expects all input-selectors to be functions, but received the following types: "),t),x=l(function(){return i++,o.apply(null,arguments)},...p);return Object.assign(u(function(){a++;let e=function(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}(f,arguments);return n=x.apply(null,e)},...m),{resultFunc:o,memoizedResultFunc:x,dependencies:f,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>n,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:l,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}(hm),hx=Object.assign((e,t=hf)=>{!function(e,t=`expected an object, instead received ${typeof e}`){if("object"!=typeof e)throw TypeError(t)}(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e);return t(r.map(t=>e[t]),(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}))},{withTypes:()=>hx});function hy(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var hg="function"==typeof Symbol&&Symbol.observable||"@@observable",hv=()=>Math.random().toString(36).substring(7).split("").join("."),hb={INIT:`@@redux/INIT${hv()}`,REPLACE:`@@redux/REPLACE${hv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${hv()}`};function hj(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function hw(e){let t,r=Object.keys(e),n={};for(let t=0;t<r.length;t++){let i=r[t];"function"==typeof e[i]&&(n[i]=e[i])}let i=Object.keys(n);try{Object.keys(n).forEach(e=>{let t=n[e];if(void 0===t(void 0,{type:hb.INIT}))throw Error(hy(12));if(void 0===t(void 0,{type:hb.PROBE_UNKNOWN_ACTION()}))throw Error(hy(13))})}catch(e){t=e}return function(e={},r){if(t)throw t;let a=!1,s={};for(let t=0;t<i.length;t++){let o=i[t],l=n[o],c=e[o],u=l(c,r);if(void 0===u)throw r&&r.type,Error(hy(14));s[o]=u,a=a||u!==c}return(a=a||i.length!==Object.keys(e).length)?s:e}}function hN(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function hk(e){return hj(e)&&"type"in e&&"string"==typeof e.type}function hS(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var hO=hS(),hP="u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?hN:hN.apply(null,arguments)};function hC(e,t){function r(...n){if(t){let r=t(...n);if(!r)throw Error(po(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>hk(t)&&t.type===e,r}"u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var hA=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function hE(e){return df(e)?d8(e,()=>{}):e}function hM(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var hT="RTK_autoBatch",h_=()=>e=>({payload:e,meta:{[hT]:!0}}),hD=e=>t=>{setTimeout(t,e)},hI=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,a=!1,s=!1,o=new Set,l="tick"===e.type?queueMicrotask:"raf"===e.type?"u">typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:hD(10):"callback"===e.type?e.queueNotification:hD(e.timeout),c=()=>{s=!1,a&&(a=!1,o.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){let t=n.subscribe(()=>i&&e());return o.add(e),()=>{t(),o.delete(e)}},dispatch(e){try{return(a=!(i=!e?.meta?.[hT]))&&!s&&(s=!0,l(c)),n.dispatch(e)}finally{i=!0}}})};function hL(e){let t,r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw Error(po(28));if(n in r)throw Error(po(29));return r[n]=t,i},addAsyncThunk:(e,t)=>(t.pending&&(r[e.pending.type]=t.pending),t.rejected&&(r[e.rejected.type]=t.rejected),t.fulfilled&&(r[e.fulfilled.type]=t.fulfilled),t.settled&&n.push({matcher:e.settled,reducer:t.settled}),i),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(t=e,i)};return e(i),[r,n,t]}var hz=Symbol.for("rtk-slice-createasyncthunk"),hR=((d=hR||{}).reducer="reducer",d.reducerWithPrepare="reducerWithPrepare",d.asyncThunk="asyncThunk",d),hF=function({creators:e}={}){let t=e?.asyncThunk?.[hz];return function(e){let r,{name:n,reducerPath:i=n}=e;if(!n)throw Error(po(11));let a=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},s=Object.keys(a),o={},l={},c={},u=[],d={addCase(e,t){let r="string"==typeof e?e:e.type;if(!r)throw Error(po(12));if(r in l)throw Error(po(13));return l[r]=t,d},addMatcher:(e,t)=>(u.push({matcher:e,reducer:t}),d),exposeAction:(e,t)=>(c[e]=t,d),exposeCaseReducer:(e,t)=>(o[e]=t,d)};function h(){let[t={},r=[],n]="function"==typeof e.extraReducers?hL(e.extraReducers):[e.extraReducers],i={...t,...l};return function(e,t){let r,[n,i,a]=hL(t);if("function"==typeof e)r=()=>hE(e());else{let t=hE(e);r=()=>t}function s(e=r(),t){let o=[n[t.type],...i.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===o.filter(e=>!!e).length&&(o=[a]),o.reduce((e,r)=>{if(r)if(dm(e)){let n=r(e,t);return void 0===n?e:n}else{if(df(e))return d8(e,e=>r(e,t));let n=r(e,t);if(void 0===n){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return e},e)}return s.getInitialState=r,s}(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of u)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)})}s.forEach(r=>{let i=a[r],s={reducerName:r,type:`${n}/${r}`,createNotation:"function"==typeof e.reducers};"asyncThunk"===i._reducerDefinitionType?function({type:e,reducerName:t},r,n,i){if(!i)throw Error(po(18));let{payloadCreator:a,fulfilled:s,pending:o,rejected:l,settled:c,options:u}=r,d=i(e,a,u);n.exposeAction(t,d),s&&n.addCase(d.fulfilled,s),o&&n.addCase(d.pending,o),l&&n.addCase(d.rejected,l),c&&n.addMatcher(d.settled,c),n.exposeCaseReducer(t,{fulfilled:s||h$,pending:o||h$,rejected:l||h$,settled:c||h$})}(s,i,d,t):function({type:e,reducerName:t,createNotation:r},n,i){let a,s;if("reducer"in n){if(r&&"reducerWithPrepare"!==n._reducerDefinitionType)throw Error(po(17));a=n.reducer,s=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?hC(e,s):hC(e))}(s,i,d)});let p=e=>e,m=new Map,f=new WeakMap;function x(e,t){return r||(r=h()),r(e,t)}function y(){return r||(r=h()),r.getInitialState()}function g(t,r=!1){function n(e){let i=e[t];return void 0===i&&r&&(i=hM(f,n,y)),i}function i(t=p){let n=hM(m,r,()=>new WeakMap);return hM(n,t,()=>{let n={};for(let[i,a]of Object.entries(e.selectors??{}))n[i]=function(e,t,r,n){function i(a,...s){let o=t(a);return void 0===o&&n&&(o=r()),e(o,...s)}return i.unwrapped=e,i}(a,t,()=>hM(f,t,y),r);return n})}return{reducerPath:t,getSelectors:i,get selectors(){return i(n)},selectSlice:n}}let v={name:n,reducer:x,actions:c,caseReducers:o,getInitialState:y,...g(i),injectInto(e,{reducerPath:t,...r}={}){let n=t??i;return e.inject({reducerPath:n,reducer:x},r),{...v,...g(n,!0)}}};return v}}();function h$(){}var hB="listener",hU="completed",hq="cancelled",hV=`task-${hq}`,hK=`task-${hU}`,hW=`${hB}-${hq}`,hH=`${hB}-${hU}`,hY=class{constructor(e){this.code=e,this.message=`task ${hq} (reason: ${e})`}name="TaskAbortError";message},hQ=(e,t)=>{if("function"!=typeof e)throw TypeError(po(32))},hX=()=>{},hG=(e,t=hX)=>(e.catch(t),e),hZ=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),hJ=e=>{if(e.aborted)throw new hY(e.reason)};function h0(e,t){let r=hX;return new Promise((n,i)=>{let a=()=>i(new hY(e.reason));e.aborted?a():(r=hZ(e,a),t.finally(()=>r()).then(n,i))}).finally(()=>{r=hX})}var h1=async(e,t)=>{try{await Promise.resolve();let t=await e();return{status:"ok",value:t}}catch(e){return{status:e instanceof hY?"cancelled":"rejected",error:e}}finally{t?.()}},h2=e=>t=>hG(h0(e,t).then(t=>(hJ(e),t))),h5=e=>{let t=h2(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:h4}=Object,h3={},h6="listenerMiddleware",h8=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=hC(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(i);else throw Error(po(21));return hQ(a,"options.listener"),{predicate:i,type:t,effect:a}},h7=h4(e=>{let{type:t,predicate:r,effect:n}=h8(e);return{id:((e=21)=>{let t="",r=e;for(;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t})(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw Error(po(22))}}},{withTypes:()=>h7}),h9=(e,t)=>{let{type:r,effect:n,predicate:i}=h8(t);return Array.from(e.values()).find(e=>("string"==typeof r?e.type===r:e.predicate===i)&&e.effect===n)},pe=e=>{e.pending.forEach(e=>{e.abort(hW)})},pt=(e,t,r)=>{try{e(t,r)}catch(e){setTimeout(()=>{throw e},0)}},pr=h4(hC(`${h6}/add`),{withTypes:()=>pr}),pn=hC(`${h6}/removeAll`),pi=h4(hC(`${h6}/remove`),{withTypes:()=>pi}),pa=(...e)=>{console.error(`${h6}/error`,...e)},ps=(e={})=>{let t=new Map,r=new Map,{extra:n,onError:i=pa}=e;hQ(i,"onError");let a=e=>{var r;return(r=h9(t,e)??h7(e)).unsubscribe=()=>t.delete(r.id),t.set(r.id,r),e=>{r.unsubscribe(),e?.cancelActive&&pe(r)}};h4(a,{withTypes:()=>a});let s=e=>{let r=h9(t,e);return r&&(r.unsubscribe(),e.cancelActive&&pe(r)),!!r};h4(s,{withTypes:()=>s});let o=async(e,s,o,l)=>{var c,u;let d,h=new AbortController,p=(c=h.signal,d=async(e,t)=>{hJ(c);let r=()=>{},n=[new Promise((t,n)=>{let i=a({predicate:e,effect:(e,r)=>{r.unsubscribe(),t([e,r.getState(),r.getOriginalState()])}});r=()=>{i(),n()}})];null!=t&&n.push(new Promise(e=>setTimeout(e,t,null)));try{let e=await h0(c,Promise.race(n));return hJ(c),e}finally{r()}},(e,t)=>hG(d(e,t))),m=[];try{let i;e.pending.add(h),i=r.get(e)??0,r.set(e,i+1),await Promise.resolve(e.effect(s,h4({},o,{getOriginalState:l,condition:(e,t)=>p(e,t).then(Boolean),take:p,delay:h5(h.signal),pause:h2(h.signal),extra:n,signal:h.signal,fork:(u=h.signal,(e,t)=>{hQ(e,"taskExecutor");let r=new AbortController;hZ(u,()=>r.abort(u.reason));let n=h1(async()=>{hJ(u),hJ(r.signal);let t=await e({pause:h2(r.signal),delay:h5(r.signal),signal:r.signal});return hJ(r.signal),t},()=>r.abort(hK));return t?.autoJoin&&m.push(n.catch(hX)),{result:h2(u)(n),cancel(){r.abort(hV)}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,r)=>{e!==h&&(e.abort(hW),r.delete(e))})},cancel:()=>{h.abort(hW),e.pending.delete(h)},throwIfCancelled:()=>{hJ(h.signal)}})))}catch(e){e instanceof hY||pt(i,e,{raisedBy:"effect"})}finally{let t;await Promise.all(m),h.abort(hH),1===(t=r.get(e)??1)?r.delete(e):r.set(e,t-1),e.pending.delete(h)}},l=()=>{for(let e of r.keys())pe(e);t.clear()};return{middleware:e=>r=>n=>{let c;if(!hk(n))return r(n);if(pr.match(n))return a(n.payload);if(pn.match(n))return void l();if(pi.match(n))return s(n.payload);let u=e.getState(),d=()=>{if(u===h3)throw Error(po(23));return u};try{if(c=r(n),t.size>0){let r=e.getState();for(let a of Array.from(t.values())){let t=!1;try{t=a.predicate(n,r,u)}catch(e){t=!1,pt(i,e,{raisedBy:"predicate"})}t&&o(a,n,e,d)}}}finally{u=h3}return c},startListening:a,stopListening:s,clearListeners:l}};function po(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original");var pl=e.i(78712);function pc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function pu(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((e,t,n)=>{var i=r[n-1];return"string"==typeof i?e+i+t:void 0!==i?e+pc(i)+t:e+t},"")}var pd=e=>0===e?0:e>0?1:-1,ph=e=>"number"==typeof e&&e!=+e,pp=e=>"string"==typeof e&&e.indexOf("%")===e.length-1,pm=e=>("number"==typeof e||e instanceof Number)&&!ph(e),pf=e=>pm(e)||"string"==typeof e,px=0,py=e=>{var t=++px;return"".concat(e||"").concat(t)},pg=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!pm(e)&&"string"!=typeof e)return n;if(pp(e)){if(null==t)return n;var a=e.indexOf("%");r=t*parseFloat(e.slice(0,a))/100}else r=+e;return ph(r)&&(r=n),i&&null!=t&&r>t&&(r=t),r},pv=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(r[String(e[n])])return!0;else r[String(e[n])]=!0;return!1};function pb(e,t,r){return pm(e)&&pm(t)?pc(e+r*(t-e)):t}var pj=e=>null==e?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function pw(e){return null!=e}function pN(){}var pk=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!ph(r))return e[r]}},pS=hF({name:"options",initialState:{chartName:"",tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},reducers:{createEventEmitter:e=>{null==e.eventEmitter&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),pO=pS.reducer,{createEventEmitter:pP}=pS.actions,pC=(e.i(8710),{notify(){},get:()=>[]}),pA="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,pE="u">typeof navigator&&"ReactNative"===navigator.product,pM=pA||pE?H.useLayoutEffect:H.useEffect;function pT(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}var p_=Symbol.for("react-redux-context"),pD="u">typeof globalThis?globalThis:{},pI=function(){if(!H.createContext)return{};let e=pD[p_]??=new Map,t=e.get(H.createContext);return t||(t=H.createContext(null),e.set(H.createContext,t)),t}(),pL=function(e){let{children:t,context:r,serverState:n,store:i}=e,a=H.useMemo(()=>{let e=function(e,t){let r,n=pC,i=0,a=!1;function s(){c.onStateChange&&c.onStateChange()}function o(){if(i++,!r){let t,i;r=e.subscribe(s),t=null,i=null,n={clear(){t=null,i=null},notify(){let e=t;for(;e;)e.callback(),e=e.next},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let r=!0,n=i={callback:e,next:null,prev:i};return n.prev?n.prev.next=n:t=n,function(){r&&null!==t&&(r=!1,n.next?n.next.prev=n.prev:i=n.prev,n.prev?n.prev.next=n.next:t=n.next)}}}}}function l(){i--,r&&0===i&&(r(),r=void 0,n.clear(),n=pC)}let c={addNestedSub:function(e){o();let t=n.subscribe(e),r=!1;return()=>{r||(r=!0,t(),l())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:s,isSubscribed:function(){return a},trySubscribe:function(){a||(a=!0,o())},tryUnsubscribe:function(){a&&(a=!1,l())},getListeners:()=>n};return c}(i);return{store:i,subscription:e,getServerState:n?()=>n:void 0}},[i,n]),s=H.useMemo(()=>i.getState(),[i]);return pM(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),s!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,s]),H.createElement((r||pI).Provider,{value:a},t)};function pz(e=pI){return function(){return H.useContext(e)}}var pR=pz(),pF=Symbol.for("immer-nothing"),p$=Symbol.for("immer-draftable"),pB=Symbol.for("immer-state");function pU(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pq=Object.getPrototypeOf;function pV(e){return!!e&&!!e[pB]}function pK(e){return!!e&&(pY(e)||Array.isArray(e)||!!e[p$]||!!e.constructor?.[p$]||pJ(e)||p0(e))}var pW=Object.prototype.constructor.toString(),pH=new WeakMap;function pY(e){if(!e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if("function"!=typeof r)return!1;let n=pH.get(r);return void 0===n&&(n=Function.toString.call(r),pH.set(r,n)),n===pW}function pQ(e,t,r=!0){0===pX(e)?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function pX(e){let t=e[pB];return t?t.type_:Array.isArray(e)?1:pJ(e)?2:3*!!p0(e)}function pG(e,t){return 2===pX(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pZ(e,t,r){let n=pX(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function pJ(e){return e instanceof Map}function p0(e){return e instanceof Set}function p1(e){return e.copy_||e.base_}function p2(e,t){if(pJ(e))return new Map(e);if(p0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=pY(e);if(!0!==t&&("class_only"!==t||r)){let t=pq(e);return null!==t&&r?{...e}:Object.assign(Object.create(t),e)}{let t=Object.getOwnPropertyDescriptors(e);delete t[pB];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){let i=r[n],a=t[i];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(pq(e),t)}}function p5(e,t=!1){return p3(e)||pV(e)||!pK(e)||(pX(e)>1&&Object.defineProperties(e,{set:p4,add:p4,clear:p4,delete:p4}),Object.freeze(e),t&&Object.values(e).forEach(e=>p5(e,!0))),e}var p4={value:function(){pU(2)}};function p3(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var p6={};function p8(e){let t=p6[e];return t||pU(0,e),t}function p7(e,t){t&&(p8("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function p9(e){me(e),e.drafts_.forEach(mr),e.drafts_=null}function me(e){e===f&&(f=e.parent_)}function mt(e){return f={drafts_:[],parent_:f,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function mr(e){let t=e[pB];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function mn(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return void 0!==e&&e!==r?(r[pB].modified_&&(p9(t),pU(4)),pK(e)&&(e=mi(t,e),t.parent_||ms(t,e)),t.patches_&&p8("Patches").generateReplacementPatches_(r[pB].base_,e,t.patches_,t.inversePatches_)):e=mi(t,r,[]),p9(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==pF?e:void 0}function mi(e,t,r){if(p3(t))return t;let n=e.immer_.shouldUseStrictIteration(),i=t[pB];if(!i)return pQ(t,(n,a)=>ma(e,i,t,n,a,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return ms(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,s=!1;3===i.type_&&(a=new Set(t),t.clear(),s=!0),pQ(a,(n,a)=>ma(e,i,t,n,a,r,s),n),ms(e,t,!1),r&&e.patches_&&p8("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function ma(e,t,r,n,i,a,s){if(null==i||"object"!=typeof i&&!s)return;let o=p3(i);if(!o||s){if(pV(i)){let s=mi(e,i,a&&t&&3!==t.type_&&!pG(t.assigned_,n)?a.concat(n):void 0);if(pZ(r,n,s),!pV(s))return;e.canAutoFreeze_=!1}else s&&r.add(i);if(pK(i)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&o)return;mi(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&(pJ(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ms(e,i)}}}function ms(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&p5(t,r)}var mo={get(e,t){if(t===pB)return e;let r=p1(e);if(!pG(r,t)){var n;let i;return n=e,(i=mu(r,t))?"value"in i?i.value:i.get?.call(n.draft_):void 0}let i=r[t];return e.finalized_||!pK(i)?i:i===mc(e.base_,t)?(mh(e),e.copy_[t]=mm(i,e)):i},has:(e,t)=>t in p1(e),ownKeys:e=>Reflect.ownKeys(p1(e)),set(e,t,r){let n=mu(p1(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=mc(p1(e),t),i=n?.[pB];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if((r===n?0!==r||1/r==1/n:r!=r&&n!=n)&&(void 0!==r||pG(e.base_,t)))return!0;mh(e),md(e)}return!!(e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=r,e.assigned_[t]=!0,!0)},deleteProperty:(e,t)=>(void 0!==mc(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,mh(e),md(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=p1(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){pU(11)},getPrototypeOf:e=>pq(e.base_),setPrototypeOf(){pU(12)}},ml={};function mc(e,t){let r=e[pB];return(r?p1(r):e)[t]}function mu(e,t){if(!(t in e))return;let r=pq(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=pq(r)}}function md(e){!e.modified_&&(e.modified_=!0,e.parent_&&md(e.parent_))}function mh(e){e.copy_||(e.copy_=p2(e.base_,e.scope_.immer_.useStrictShallowCopy_))}pQ(mo,(e,t)=>{ml[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ml.deleteProperty=function(e,t){return ml.set.call(this,e,t,void 0)},ml.set=function(e,t,r){return mo.set.call(this,e[0],t,r,e[0])};var mp=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,r)=>{let n;if("function"==typeof e&&"function"!=typeof t){let r=t;t=e;let n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}if("function"!=typeof t&&pU(6),void 0!==r&&"function"!=typeof r&&pU(7),pK(e)){let i=mt(this),a=mm(e,void 0),s=!0;try{n=t(a),s=!1}finally{s?p9(i):me(i)}return p7(i,r),mn(n,i)}if(e&&"object"==typeof e)pU(1,e);else{if(void 0===(n=t(e))&&(n=e),n===pF&&(n=void 0),this.autoFreeze_&&p5(n,!0),r){let t=[],i=[];p8("Patches").generateReplacementPatches_(e,n,t,i),r(t,i)}return n}},this.produceWithPatches=(e,t)=>{let r,n;return"function"==typeof e?(t,...r)=>this.produceWithPatches(t,t=>e(t,...r)):[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;pK(e)||pU(8),pV(e)&&(pV(t=e)||pU(10,t),e=function e(t){let r;if(!pK(t)||p3(t))return t;let n=t[pB],i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=p2(t,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=p2(t,!0);return pQ(r,(t,n)=>{pZ(r,t,e(n))},i),n&&(n.finalized_=!1),r}(t));let r=mt(this),n=mm(e,void 0);return n[pB].isManual_=!0,me(r),n}finishDraft(e,t){let r=e&&e[pB];r&&r.isManual_||pU(9);let{scope_:n}=r;return p7(n,t),mn(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=p8("Patches").applyPatches_;return pV(e)?n(e,t):this.produce(e,e=>n(e,t))}};function mm(e,t){let r=pJ(e)?p8("MapSet").proxyMap_(e,t):p0(e)?p8("MapSet").proxySet_(e,t):function(e,t){let r=Array.isArray(e),n={type_:+!!r,scope_:t?t.scope_:f,modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,a=mo;r&&(i=[n],a=ml);let{revoke:s,proxy:o}=Proxy.revocable(i,a);return n.draft_=o,n.revoke_=s,o}(e,t);return(t?t.scope_:f).drafts_.push(r),r}new mp().produce;var mf={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},mx=hF({name:"tooltip",initialState:{itemInteraction:{click:mf,hover:mf},axisInteraction:{click:mf,hover:mf},keyboardInteraction:mf,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:h_()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,i=d6(e).tooltipItemPayloads.indexOf(r);i>-1&&(e.tooltipItemPayloads[i]=n)},prepare:h_()},removeTooltipEntrySettings:{reducer(e,t){var r=d6(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:h_()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:my,replaceTooltipEntrySettings:mg,removeTooltipEntrySettings:mv,setTooltipSettingsState:mb,setActiveMouseOverItemIndex:mj,mouseLeaveItem:mw,mouseLeaveChart:mN,setActiveClickItemIndex:mk,setMouseOverAxisIndex:mS,setMouseClickAxisIndex:mO,setSyncInteraction:mP,setKeyboardInteraction:mC}=mx.actions,mA=mx.reducer,mE=hF({name:"chartData",initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=t.payload,null==t.payload){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;null!=r&&(e.dataStartIndex=r),null!=n&&(e.dataEndIndex=n)}}}),{setChartData:mM,setDataStartEndIndexes:mT,setComputedData:m_}=mE.actions,mD=mE.reducer,mI=hF({name:"chartLayout",initialState:{layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,a;e.margin.top=null!=(r=t.payload.top)?r:0,e.margin.right=null!=(n=t.payload.right)?n:0,e.margin.bottom=null!=(i=t.payload.bottom)?i:0,e.margin.left=null!=(a=t.payload.left)?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:mL,setLayout:mz,setChartSize:mR,setScale:mF}=mI.actions,m$=mI.reducer,mB=e.i(27688),mU=(0,H.createContext)(null),mq=e=>e,mV=()=>{var e=(0,H.useContext)(mU);return e?e.store.dispatch:mq},mK=()=>{},mW=()=>mK,mH=(e,t)=>e===t;function mY(e){var t=(0,H.useContext)(mU),r=(0,H.useMemo)(()=>t?t=>{if(null!=t)return e(t)}:mK,[t,e]);return(0,mB.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:mW,t?t.store.getState:mK,t?t.store.getState:mK,r,mH)}var mQ=e.i(28914),mX=e=>e.legend.settings;function mG(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function mZ(e){return function(){return e}}function mJ(e,t){if((i=e.length)>1)for(var r,n,i,a=1,s=e[t[0]],o=s.length;a<i;++a)for(n=s,s=e[t[a]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function m0(e){for(var t=e.length,r=Array(t);--t>=0;)r[t]=t;return r}function m1(e,t){return e[t]}function m2(e){let t=[];return t.key=e,t}function m5(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function m4(e){return Number.isFinite(e)}function m3(e){return"number"==typeof e&&e>0&&Number.isFinite(e)}function m6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m8(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m6(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m6(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function m7(e,t,r){return null==e||null==t?r:pf(t)?(0,pl.default)(e,t,r):"function"==typeof t?t(e):r}hf([e=>e.legend.payload,mX],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?(0,mQ.default)(n,r):n}),Array.prototype.slice;var m9=(e,t)=>"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t,fe={sign:e=>{var t,r=e.length;if(!(r<=0)){var n=null==(t=e[0])?void 0:t.length;if(null!=n&&!(n<=0))for(var i=0;i<n;++i)for(var a=0,s=0,o=0;o<r;++o){var l=e[o],c=null==l?void 0:l[i];if(null!=c){var u=c[1],d=c[0],h=ph(u)?d:u;h>=0?(c[0]=a,a+=h,c[1]=a):(c[0]=s,s+=h,c[1]=s)}}}},expand:function(e,t){if((n=e.length)>0){for(var r,n,i,a=0,s=e[0].length;a<s;++a){for(i=r=0;r<n;++r)i+=e[r][a][1]||0;if(i)for(r=0;r<n;++r)e[r][a][1]/=i}mJ(e,t)}},none:mJ,silhouette:function(e,t){if((r=e.length)>0){for(var r,n=0,i=e[t[0]],a=i.length;n<a;++n){for(var s=0,o=0;s<r;++s)o+=e[s][n][1]||0;i[n][1]+=i[n][0]=-o/2}mJ(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(n=(r=e[t[0]]).length)>0){for(var r,n,i,a=0,s=1;s<n;++s){for(var o=0,l=0,c=0;o<i;++o){for(var u=e[t[o]],d=u[s][1]||0,h=(d-(u[s-1][1]||0))/2,p=0;p<o;++p){var m=e[t[p]];h+=(m[s][1]||0)-(m[s-1][1]||0)}l+=d,c+=h*d}r[s-1][1]+=r[s-1][0]=a,l&&(a-=c/l)}r[s-1][1]+=r[s-1][0]=a,mJ(e,t)}},positive:e=>{var t,r=e.length;if(!(r<=0)){var n=null==(t=e[0])?void 0:t.length;if(null!=n&&!(n<=0))for(var i=0;i<n;++i)for(var a=0,s=0;s<r;++s){var o=e[s],l=null==o?void 0:o[i];if(null!=l){var c=ph(l[1])?l[0]:l[1];c>=0?(l[0]=a,a+=c,l[1]=a):(l[0]=0,l[1]=0)}}}}},ft=e=>{var{axis:t,ticks:r,offset:n,bandSize:i,entry:a,index:s}=e;if("category"===t.type)return r[s]?r[s].coordinate+n:null;var o=m7(a,t.dataKey,t.scale.domain()[s]);if(null==o)return null;var l=t.scale.map(o);return pm(l)?l-i/2+n:null},fr=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fn=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fi=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=(0,mQ.default)(t,e=>e.coordinate),a=1/0,s=1,o=i.length;s<o;s++){var l=i[s],c=i[s-1];a=Math.min(((null==l?void 0:l.coordinate)||0)-((null==c?void 0:c.coordinate)||0),a)}return a===1/0?0:a}return r?void 0:0};function fa(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:i,name:a}=e;return m8(m8({},t),{},{dataKey:r,payload:n,value:i,name:a})}function fs(e,t){return e?String(e):"string"==typeof t?t:void 0}var fo=e=>e.layout.width,fl=e=>e.layout.height,fc=e=>e.layout.scale,fu=e=>e.layout.margin,fd=hf(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),fh=hf(e=>e.cartesianAxis.yAxis,e=>Object.values(e));function fp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fp(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fp(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ff=hf([fo,fl,fu,e=>e.brush.height,function(e){return fh(e).reduce((e,t)=>"left"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:60),0)},function(e){return fh(e).reduce((e,t)=>"right"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:60),0)},function(e){return fd(e).reduce((e,t)=>"top"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},function(e){return fd(e).reduce((e,t)=>"bottom"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},mX,e=>e.legend.size],(e,t,r,n,i,a,s,o,l,c)=>{var u={left:(r.left||0)+i,right:(r.right||0)+a},d=fm(fm({},{top:(r.top||0)+s,bottom:(r.bottom||0)+o}),u),h=d.bottom;d.bottom+=n;var p=e-(d=((e,t,r)=>{if(t&&r){var{width:n,height:i}=r,{align:a,verticalAlign:s,layout:o}=t;if(("vertical"===o||"horizontal"===o&&"middle"===s)&&"center"!==a&&pm(e[a]))return m8(m8({},e),{},{[a]:e[a]+(n||0)});if(("horizontal"===o||"vertical"===o&&"center"===a)&&"middle"!==s&&pm(e[s]))return m8(m8({},e),{},{[s]:e[s]+(i||0)})}return e})(d,l,c)).left-d.right,m=t-d.top-d.bottom;return fm(fm({brushBottom:h},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),fx=hf(ff,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),fy=hf(fo,fl,(e,t)=>({x:0,y:0,width:e,height:t})),fg=(0,H.createContext)(null),fv=()=>null!=(0,H.useContext)(fg),fb=e=>e.brush,fj=hf([fb,ff,fu],(e,t,r)=>({height:e.height,x:pm(e.x)?e.x:t.left,y:pm(e.y)?e.y:t.top+t.height+t.brushBottom-((null==r?void 0:r.bottom)||0),width:pm(e.width)?e.width:t.width})),fw=e.i(15325),fN=function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];if("u">typeof console&&console.warn&&(void 0===t&&console.warn("LogUtils requires an error message argument"),!e))if(void 0===t)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;console.warn(t.replace(/%s/g,()=>n[a++]))}},fk="100%",fS="100%",fO={width:-1,height:-1},fP=(e,t,r)=>{var{width:n=fk,height:i=fS,aspect:a,maxHeight:s}=r,o=pp(n)?e:Number(n),l=pp(i)?t:Number(i);return a&&a>0&&(o?l=o/a:l&&(o=l*a),s&&null!=l&&l>s&&(l=s)),{calculatedWidth:o,calculatedHeight:l}},fC={width:0,height:0,overflow:"visible"},fA={width:0,overflowX:"visible"},fE={height:0,overflowY:"visible"},fM={};function fT(){return(fT=Object.assign.bind()).apply(null,arguments)}function f_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f_(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f_(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var fI=(0,H.createContext)(fO);function fL(e){var{children:t,width:r,height:n}=e,i=(0,H.useMemo)(()=>({width:r,height:n}),[r,n]);return m3(i.width)&&m3(i.height)?H.createElement(fI.Provider,{value:i},t):null}var fz=()=>(0,H.useContext)(fI),fR=(0,H.forwardRef)((e,t)=>{var{aspect:r,initialDimension:n=fO,width:i,height:a,minWidth:s=0,minHeight:o,maxHeight:l,children:c,debounce:u=0,id:d,className:h,onResize:p,style:m={}}=e,f=(0,H.useRef)(null),x=(0,H.useRef)();x.current=p,(0,H.useImperativeHandle)(t,()=>f.current);var[y,g]=(0,H.useState)({containerWidth:n.width,containerHeight:n.height}),v=(0,H.useCallback)((e,t)=>{g(r=>{var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}})},[]);(0,H.useEffect)(()=>{if(null==f.current||"u"<typeof ResizeObserver)return pN;var e=e=>{var t,r=e[0];if(null!=r){var{width:n,height:i}=r.contentRect;v(n,i),null==(t=x.current)||t.call(x,n,i)}};u>0&&(e=(0,fw.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:r,height:n}=f.current.getBoundingClientRect();return v(r,n),t.observe(f.current),()=>{t.disconnect()}},[v,u]);var{containerWidth:b,containerHeight:j}=y;fN(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:w,calculatedHeight:N}=fP(b,j,{width:i,height:a,aspect:r,maxHeight:l});return fN(null!=w&&w>0||null!=N&&N>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",w,N,i,a,s,o,r),H.createElement("div",{id:d?"".concat(d):void 0,className:sb("recharts-responsive-container",h),style:fD(fD({},m),{},{width:i,height:a,minWidth:s,minHeight:o,maxHeight:l}),ref:f},H.createElement("div",{style:(e=>{var{width:t,height:r}=e,n=pp(t),i=pp(r);return n&&i?fC:n?fA:i?fE:fM})({width:i,height:a})},H.createElement(fL,{width:w,height:N},c)))}),fF=(0,H.forwardRef)((e,t)=>{var r=fz();if(m3(r.width)&&m3(r.height))return e.children;var{width:n,height:i}=function(e){var{width:t,height:r,aspect:n}=e,i=t,a=r;return void 0===i&&void 0===a?(i=fk,a=fS):void 0===i?i=n&&n>0?void 0:fk:void 0===a&&(a=n&&n>0?void 0:fS),{width:i,height:a}}({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=fP(void 0,void 0,{width:n,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return pm(a)&&pm(s)?H.createElement(fL,{width:a,height:s},e.children):H.createElement(fR,fT({},e,{width:n,height:i,ref:t}))});function f$(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var fB=()=>{var e,t=fv(),r=mY(fx),n=mY(fj),i=null==(e=mY(fb))?void 0:e.padding;return t&&n&&i?{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}:r},fU={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},fq=e=>e.layout.layoutType,fV=()=>{var e=mY(fq);if("horizontal"===e||"vertical"===e)return e},fK=e=>{var t=e.layout.layoutType;if("centric"===t||"radial"===t)return t},fW=e=>{var t=mV(),r=fv(),{width:n,height:i}=e,a=fz(),s=n,o=i;return a&&(s=a.width>0?a.width:n,o=a.height>0?a.height:i),(0,H.useEffect)(()=>{!r&&m3(s)&&m3(o)&&t(mR({width:s,height:o}))},[t,r,s,o]),null},fH=e.i(56558);e.s([],81206),e.i(81206),e.s([],3771),e.i(3771);var fY=e.i(17603),fQ=e.i(11276);function fX(){var e,t,r=(0,fQ.default)().unknown(void 0),n=r.domain,i=r.range,a=0,s=1,o=!1,l=0,c=0,u=.5;function d(){var r=n().length,d=s<a,h=d?s:a,p=d?a:s;e=(p-h)/Math.max(1,r-l+2*c),o&&(e=Math.floor(e)),h+=(p-h-e*(r-l))*u,t=e*(1-l),o&&(h=Math.round(h),t=Math.round(t));var m=(function(e,t,r){e*=1,t*=1,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=Array(i);++n<i;)a[n]=e+n*r;return a})(r).map(function(t){return h+e*t});return i(d?m.reverse():m)}return delete r.unknown,r.domain=function(e){return arguments.length?(n(e),d()):n()},r.range=function(e){return arguments.length?([a,s]=e,a*=1,s*=1,d()):[a,s]},r.rangeRound=function(e){return[a,s]=e,a*=1,s*=1,o=!0,d()},r.bandwidth=function(){return t},r.step=function(){return e},r.round=function(e){return arguments.length?(o=!!e,d()):o},r.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},r.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},r.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},r.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},r.copy=function(){return fX(n(),[a,s]).round(o).paddingInner(l).paddingOuter(c).align(u)},fY.initRange.apply(d(),arguments)}function fG(){return function e(t){var r=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return e(r())},t}(fX.apply(null,arguments).paddingInner(1))}let fZ=Math.sqrt(50),fJ=Math.sqrt(10),f0=Math.sqrt(2);function f1(e,t,r){let n,i,a,s=(t-e)/Math.max(0,r),o=Math.floor(Math.log10(s)),l=s/Math.pow(10,o),c=l>=fZ?10:l>=fJ?5:l>=f0?2:1;return(o<0?(n=Math.round(e*(a=Math.pow(10,-o)/c)),i=Math.round(t*a),n/a<e&&++n,i/a>t&&--i,a=-a):(n=Math.round(e/(a=Math.pow(10,o)*c)),i=Math.round(t/a),n*a<e&&++n,i*a>t&&--i),i<n&&.5<=r&&r<2)?f1(e,t,2*r):[n,i,a]}function f2(e,t,r){if(t*=1,e*=1,!((r*=1)>0))return[];if(e===t)return[e];let n=t<e,[i,a,s]=n?f1(t,e,r):f1(e,t,r);if(!(a>=i))return[];let o=a-i+1,l=Array(o);if(n)if(s<0)for(let e=0;e<o;++e)l[e]=-((a-e)/s);else for(let e=0;e<o;++e)l[e]=(a-e)*s;else if(s<0)for(let e=0;e<o;++e)l[e]=-((i+e)/s);else for(let e=0;e<o;++e)l[e]=(i+e)*s;return l}function f5(e,t,r){return f1(e*=1,t*=1,r*=1)[2]}function f4(e,t,r){t*=1,e*=1,r*=1;let n=t<e,i=n?f5(t,e,r):f5(e,t,r);return(n?-1:1)*(i<0?-(1/i):i)}function f3(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function f6(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function f8(e){let t,r,n;function i(e,n,a=0,s=e.length){if(a<s){if(0!==t(n,n))return s;do{let t=a+s>>>1;0>r(e[t],n)?a=t+1:s=t}while(a<s)}return a}return 2!==e.length?(t=f3,r=(t,r)=>f3(e(t),r),n=(t,r)=>e(t)-r):(t=e===f3||e===f6?e:f7,r=e,n=e),{left:i,center:function(e,t,r=0,a=e.length){let s=i(e,t,r,a-1);return s>r&&n(e[s-1],t)>-n(e[s],t)?s-1:s},right:function(e,n,i=0,a=e.length){if(i<a){if(0!==t(n,n))return a;do{let t=i+a>>>1;0>=r(e[t],n)?i=t+1:a=t}while(i<a)}return i}}}function f7(){return 0}function f9(e){return null===e?NaN:+e}let xe=f8(f3),xt=xe.right;xe.left,f8(f9).center;var xr=e.i(82938),xn=e.i(208),xi=e.i(6272),xa=e.i(11930),xs=e.i(44936);function xo(e,t){var r,n,i=typeof t;return null==t||"boolean"===i?(0,xs.default)(t):("number"===i?xi.default:"string"===i?(n=(0,xr.color)(t))?(t=n,xn.default):xa.default:t instanceof xr.color?xn.default:t instanceof Date?function(e,t){var r=new Date;return e*=1,t*=1,function(n){return r.setTime(e*(1-n)+t*n),r}}:!ArrayBuffer.isView(r=t)||r instanceof DataView?Array.isArray(t)?function(e,t){var r,n=t?t.length:0,i=e?Math.min(n,e.length):0,a=Array(i),s=Array(n);for(r=0;r<i;++r)a[r]=xo(e[r],t[r]);for(;r<n;++r)s[r]=t[r];return function(e){for(r=0;r<i;++r)s[r]=a[r](e);return s}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var r,n={},i={};for(r in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)r in e?n[r]=xo(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}:xi.default:function(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,i=t.slice();return function(a){for(r=0;r<n;++r)i[r]=e[r]*(1-a)+t[r]*a;return i}})(e,t)}var xl=e.i(25223);function xc(e,t){return e*=1,t*=1,function(r){return Math.round(e*(1-r)+t*r)}}function xu(e){return+e}var xd=[0,1];function xh(e){return e}function xp(e,t){var r;return(t-=e*=1)?function(r){return(r-e)/t}:(r=isNaN(t)?NaN:.5,function(){return r})}function xm(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i<n?(n=xp(i,n),a=r(s,a)):(n=xp(n,i),a=r(a,s)),function(e){return a(n(e))}}function xf(e,t,r){var n=Math.min(e.length,t.length)-1,i=Array(n),a=Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)i[s]=xp(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(t){var r=xt(e,t,1,n)-1;return a[r](i[r](t))}}function xx(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xy(){var e,t,r,n,i,a,s=xd,o=xd,l=xo,c=xh;function u(){var e,t,r,l=Math.min(s.length,o.length);return c!==xh&&(e=s[0],t=s[l-1],e>t&&(r=e,e=t,t=r),c=function(r){return Math.max(e,Math.min(t,r))}),n=l>2?xf:xm,i=a=null,d}function d(t){return null==t||isNaN(t*=1)?r:(i||(i=n(s.map(e),o,l)))(e(c(t)))}return d.invert=function(r){return c(t((a||(a=n(o,s.map(e),xl.interpolateNumber)))(r)))},d.domain=function(e){return arguments.length?(s=Array.from(e,xu),u()):s.slice()},d.range=function(e){return arguments.length?(o=Array.from(e),u()):o.slice()},d.rangeRound=function(e){return o=Array.from(e),l=xc,u()},d.clamp=function(e){return arguments.length?(c=!!e||xh,u()):c!==xh},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,u()}}function xg(){return xy()(xh,xh)}function xv(e,t){if(!isFinite(e)||0===e)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function xb(e){return(e=xv(Math.abs(e)))?e[1]:NaN}var xj=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xw(e){var t;if(!(t=xj.exec(e)))throw Error("invalid format: "+e);return new xN({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function xN(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function xk(e,t){var r=xv(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+Array(i-n.length+2).join("0")}xw.prototype=xN.prototype,xN.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let xS={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>xk(100*e,t),r:xk,s:function(e,t){var r=xv(e,t);if(!r)return x=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(x=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=n.length;return a===s?n:a>s?n+Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+Array(1-a).join("0")+xv(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function xO(e){return e}var xP=Array.prototype.map,xC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xA(e,t,r,n){var i,a,s=f4(e,t,r);switch((n=xw(null==n?",f":n)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(a=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(xb(o)/3)))-xb(Math.abs(s))))||(n.precision=a),v(n,o);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(a=Math.max(0,xb(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(i=Math.abs(i=s)))-xb(i))+1)||(n.precision=a-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(a=Math.max(0,-xb(Math.abs(s))))||(n.precision=a-("%"===n.type)*2)}return g(n)}function xE(e){var t=e.domain;return e.ticks=function(e){var r=t();return f2(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return xA(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,i,a=t(),s=0,o=a.length-1,l=a[s],c=a[o],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=o,o=i);u-- >0;){if((i=f5(l,c,r))===n)return a[s]=l,a[o]=c,t(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else if(i<0)l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i;else break;n=i}return e},e}function xM(){var e=xg();return e.copy=function(){return xx(e,xM())},fY.initRange.apply(e,arguments),xE(e)}function xT(e){var t;function r(e){return null==e||isNaN(e*=1)?t:e}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,xu),r):e.slice()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return xT(e).unknown(t)},e=arguments.length?Array.from(e,xu):[0,1],xE(r)}function x_(e,t){e=e.slice();var r,n=0,i=e.length-1,a=e[n],s=e[i];return s<a&&(r=n,n=i,i=r,r=a,a=s,s=r),e[n]=t.floor(a),e[i]=t.ceil(s),e}function xD(e){return Math.log(e)}function xI(e){return Math.exp(e)}function xL(e){return-Math.log(-e)}function xz(e){return-Math.exp(-e)}function xR(e){return isFinite(e)?+("1e"+e):e<0?0:e}function xF(e){return(t,r)=>-e(-t,r)}function x$(e){let t,r,n=e(xD,xI),i=n.domain,a=10;function s(){var s,o;return t=(s=a)===Math.E?Math.log:10===s&&Math.log10||2===s&&Math.log2||(s=Math.log(s),e=>Math.log(e)/s),r=10===(o=a)?xR:o===Math.E?Math.exp:e=>Math.pow(o,e),i()[0]<0?(t=xF(t),r=xF(r),e(xL,xz)):e(xD,xI),n}return n.base=function(e){return arguments.length?(a=+e,s()):a},n.domain=function(e){return arguments.length?(i(e),s()):i()},n.ticks=e=>{let n,s,o=i(),l=o[0],c=o[o.length-1],u=c<l;u&&([l,c]=[c,l]);let d=t(l),h=t(c),p=null==e?10:+e,m=[];if(!(a%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(n=1;n<a;++n)if(!((s=d<0?n/r(-d):n*r(d))<l)){if(s>c)break;m.push(s)}}else for(;d<=h;++d)for(n=a-1;n>=1;--n)if(!((s=d>0?n/r(-d):n*r(d))<l)){if(s>c)break;m.push(s)}2*m.length<p&&(m=f2(l,c,p))}else m=f2(d,h,Math.min(h-d,p)).map(r);return u?m.reverse():m},n.tickFormat=(e,i)=>{if(null==e&&(e=10),null==i&&(i=10===a?"s":","),"function"!=typeof i&&(a%1||null!=(i=xw(i)).precision||(i.trim=!0),i=g(i)),e===1/0)return i;let s=Math.max(1,a*e/n.ticks().length);return e=>{let n=e/r(Math.round(t(e)));return n*a<a-.5&&(n*=a),n<=s?i(e):""}},n.nice=()=>i(x_(i(),{floor:e=>r(Math.floor(t(e))),ceil:e=>r(Math.ceil(t(e)))})),n}function xB(){let e=x$(xy()).domain([1,10]);return e.copy=()=>xx(e,xB()).base(e.base()),fY.initRange.apply(e,arguments),e}function xU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function xq(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xV(e){var t=1,r=e(xU(1),xq(t));return r.constant=function(r){return arguments.length?e(xU(t=+r),xq(t)):t},xE(r)}function xK(){var e=xV(xy());return e.copy=function(){return xx(e,xK()).constant(e.constant())},fY.initRange.apply(e,arguments)}function xW(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function xH(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xY(e){return e<0?-e*e:e*e}function xQ(e){var t=e(xh,xh),r=1;return t.exponent=function(t){return arguments.length?1==(r=+t)?e(xh,xh):.5===r?e(xH,xY):e(xW(r),xW(1/r)):r},xE(t)}function xX(){var e=xQ(xy());return e.copy=function(){return xx(e,xX()).exponent(e.exponent())},fY.initRange.apply(e,arguments),e}function xG(){return xX.apply(null,arguments).exponent(.5)}function xZ(e){return Math.sign(e)*e*e}function xJ(){var e,t=xg(),r=[0,1],n=!1;function i(r){var i,a=Math.sign(i=t(r))*Math.sqrt(Math.abs(i));return isNaN(a)?e:n?Math.round(a):a}return i.invert=function(e){return t.invert(xZ(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain()},i.range=function(e){return arguments.length?(t.range((r=Array.from(e,xu)).map(xZ)),i):r.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(e){return arguments.length?(t.clamp(e),i):t.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return xJ(t.domain(),r).round(n).clamp(t.clamp()).unknown(e)},fY.initRange.apply(i,arguments),xE(i)}g=(y=function(e){var t,r,n,i=void 0===e.grouping||void 0===e.thousands?xO:(t=xP.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(e.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(r)}),a=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",l=void 0===e.numerals?xO:(n=xP.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return n[+e]})}),c=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",d=void 0===e.nan?"NaN":e.nan+"";function h(e,t){var r=(e=xw(e)).fill,n=e.align,h=e.sign,p=e.symbol,m=e.zero,f=e.width,y=e.comma,g=e.precision,v=e.trim,b=e.type;"n"===b?(y=!0,b="g"):xS[b]||(void 0===g&&(g=12),v=!0,b="g"),(m||"0"===r&&"="===n)&&(m=!0,r="0",n="=");var j=(t&&void 0!==t.prefix?t.prefix:"")+("$"===p?a:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),w=("$"===p?s:/[%p]/.test(b)?c:"")+(t&&void 0!==t.suffix?t.suffix:""),N=xS[b],k=/[defgprs%]/.test(b);function S(e){var t,a,s,c=j,p=w;if("c"===b)p=N(e)+p,e="";else{var S=(e*=1)<0||1/e<0;if(e=isNaN(e)?d:N(Math.abs(e),g),v&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(!+e[n])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==h&&(S=!1),c=(S?"("===h?h:u:"-"===h||"("===h?"":h)+c,p=("s"!==b||isNaN(e)||void 0===x?"":xC[8+x/3])+p+(S&&"("===h?")":""),k){for(t=-1,a=e.length;++t<a;)if(48>(s=e.charCodeAt(t))||s>57){p=(46===s?o+e.slice(t+1):e.slice(t))+p,e=e.slice(0,t);break}}}y&&!m&&(e=i(e,1/0));var O=c.length+e.length+p.length,P=O<f?Array(f-O+1).join(r):"";switch(y&&m&&(e=i(P+e,P.length?f-p.length:1/0),P=""),n){case"<":e=c+e+p+P;break;case"=":e=c+P+e+p;break;case"^":e=P.slice(0,O=P.length>>1)+c+e+p+P.slice(O);break;default:e=P+c+e+p}return l(e)}return g=void 0===g?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),S.toString=function(){return e+""},S}return{format:h,formatPrefix:function(e,t){var r=3*Math.max(-8,Math.min(8,Math.floor(xb(t)/3))),n=Math.pow(10,-r),i=h(((e=xw(e)).type="f",e),{suffix:xC[8+r/3]});return function(e){return i(n*e)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,v=y.formatPrefix;var x0=e.i(96509),x1=e.i(45583);function x2(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:+(e>t))}function x5(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function x4(){var e,t=[],r=[],n=[];function i(){var e=0,i=Math.max(1,r.length);for(n=Array(i-1);++e<i;)n[e-1]=function(e,t,r=f9){if(!(!(n=e.length)||isNaN(t*=1))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),s=+r(e[a],a,e);return s+(r(e[a+1],a+1,e)-s)*(i-a)}}(t,e/i);return a}function a(t){return null==t||isNaN(t*=1)?e:r[xt(n,t)]}return a.invertExtent=function(e){var i=r.indexOf(e);return i<0?[NaN,NaN]:[i>0?n[i-1]:t[0],i<n.length?n[i]:t[t.length-1]]},a.domain=function(e){if(!arguments.length)return t.slice();for(let r of(t=[],e))null==r||isNaN(r*=1)||t.push(r);return t.sort(f3),i()},a.range=function(e){return arguments.length?(r=Array.from(e),i()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return n.slice()},a.copy=function(){return x4().domain(t).range(r).unknown(e)},fY.initRange.apply(a,arguments)}function x3(){var e,t=0,r=1,n=1,i=[.5],a=[0,1];function s(t){return null!=t&&t<=t?a[xt(i,t,0,n)]:e}function o(){var e=-1;for(i=Array(n);++e<n;)i[e]=((e+1)*r-(e-n)*t)/(n+1);return s}return s.domain=function(e){return arguments.length?([t,r]=e,t*=1,r*=1,o()):[t,r]},s.range=function(e){return arguments.length?(n=(a=Array.from(e)).length-1,o()):a.slice()},s.invertExtent=function(e){var s=a.indexOf(e);return s<0?[NaN,NaN]:s<1?[t,i[0]]:s>=n?[i[n-1],r]:[i[s-1],i[s]]},s.unknown=function(t){return arguments.length&&(e=t),s},s.thresholds=function(){return i.slice()},s.copy=function(){return x3().domain([t,r]).range(a).unknown(e)},fY.initRange.apply(xE(s),arguments)}function x6(){var e,t=[.5],r=[0,1],n=1;function i(i){return null!=i&&i<=i?r[xt(t,i,0,n)]:e}return i.domain=function(e){return arguments.length?(n=Math.min((t=Array.from(e)).length,r.length-1),i):t.slice()},i.range=function(e){return arguments.length?(r=Array.from(e),n=Math.min(t.length,r.length-1),i):r.slice()},i.invertExtent=function(e){var n=r.indexOf(e);return[t[n-1],t[n]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return x6().domain(t).range(r).unknown(e)},fY.initRange.apply(i,arguments)}let x8=new Date,x7=new Date;function x9(e,t,r,n){function i(t){return e(t=0==arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=r=>(e(r=new Date(r-1)),t(r,1),e(r),r),i.round=e=>{let t=i(e),r=i.ceil(e);return e-t<r-e?t:r},i.offset=(e,r)=>(t(e=new Date(+e),null==r?1:Math.floor(r)),e),i.range=(r,n,a)=>{let s,o=[];if(r=i.ceil(r),a=null==a?1:Math.floor(a),!(r<n)||!(a>0))return o;do o.push(s=new Date(+r)),t(r,a),e(r);while(s<r&&r<n)return o},i.filter=r=>x9(t=>{if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)},(e,n)=>{if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}),r&&(i.count=(t,n)=>(x8.setTime(+t),x7.setTime(+n),e(x8),e(x7),Math.floor(r(x8,x7))),i.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?i.filter(n?t=>n(t)%e==0:t=>i.count(0,t)%e==0):i:null),i}let ye=x9(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ye.every=e=>isFinite(e=Math.floor(e))&&e>0?x9(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)}):null,ye.range;let yt=x9(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());yt.every=e=>isFinite(e=Math.floor(e))&&e>0?x9(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)}):null,yt.range;let yr=x9(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());yr.range;let yn=x9(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());yn.range;function yi(e){return x9(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}let ya=yi(0),ys=yi(1),yo=yi(2),yl=yi(3),yc=yi(4),yu=yi(5),yd=yi(6);function yh(e){return x9(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/6048e5)}ya.range,ys.range,yo.range,yl.range,yc.range,yu.range,yd.range;let yp=yh(0),ym=yh(1),yf=yh(2),yx=yh(3),yy=yh(4),yg=yh(5),yv=yh(6);yp.range,ym.range,yf.range,yx.range,yy.range,yg.range,yv.range;let yb=x9(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);yb.range;let yj=x9(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);yj.range;let yw=x9(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));yw.range;let yN=x9(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getHours());yN.range;let yk=x9(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());yk.range;let yS=x9(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());yS.range;let yO=x9(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());yO.range;let yP=x9(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());yP.range;let yC=x9(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);function yA(e,t,r,n,i,a){let s=[[yP,1,1e3],[yP,5,5e3],[yP,15,15e3],[yP,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function o(t,r,n){let i=Math.abs(r-t)/n,a=f8(([,,e])=>e).right(s,i);if(a===s.length)return e.every(f4(t/31536e6,r/31536e6,n));if(0===a)return yC.every(Math.max(f4(t,r,n),1));let[o,l]=s[i/s[a-1][2]<s[a][2]/i?a-1:a];return o.every(l)}return[function(e,t,r){let n=t<e;n&&([e,t]=[t,e]);let i=r&&"function"==typeof r.range?r:o(e,t,r),a=i?i.range(e,+t+1):[];return n?a.reverse():a},o]}yC.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?x9(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):yC:null,yC.range;let[yE,yM]=yA(yt,yn,yp,yw,yk,yO),[yT,y_]=yA(ye,yr,ya,yb,yN,yS);function yD(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function yI(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function yL(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}var yz={"-":"",_:" ",0:"0"},yR=/^\s*\d+/,yF=/^%/,y$=/[\\^$*+?|[\]().{}]/g;function yB(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?Array(r-a+1).join(t)+i:i)}function yU(e){return e.replace(y$,"\\$&")}function yq(e){return RegExp("^(?:"+e.map(yU).join("|")+")","i")}function yV(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function yK(e,t,r){var n=yR.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function yW(e,t,r){var n=yR.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function yH(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function yY(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function yQ(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yX(e,t,r){var n=yR.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function yG(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function yZ(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function yJ(e,t,r){var n=yR.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function y0(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function y1(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function y2(e,t,r){var n=yR.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function y5(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function y4(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function y3(e,t,r){var n=yR.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function y6(e,t,r){var n=yR.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function y8(e,t,r){var n=yR.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function y7(e,t,r){var n=yF.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function y9(e,t,r){var n=yR.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function ge(e,t,r){var n=yR.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function gt(e,t){return yB(e.getDate(),t,2)}function gr(e,t){return yB(e.getHours(),t,2)}function gn(e,t){return yB(e.getHours()%12||12,t,2)}function gi(e,t){return yB(1+yb.count(ye(e),e),t,3)}function ga(e,t){return yB(e.getMilliseconds(),t,3)}function gs(e,t){return ga(e,t)+"000"}function go(e,t){return yB(e.getMonth()+1,t,2)}function gl(e,t){return yB(e.getMinutes(),t,2)}function gc(e,t){return yB(e.getSeconds(),t,2)}function gu(e){var t=e.getDay();return 0===t?7:t}function gd(e,t){return yB(ya.count(ye(e)-1,e),t,2)}function gh(e){var t=e.getDay();return t>=4||0===t?yc(e):yc.ceil(e)}function gp(e,t){return e=gh(e),yB(yc.count(ye(e),e)+(4===ye(e).getDay()),t,2)}function gm(e){return e.getDay()}function gf(e,t){return yB(ys.count(ye(e)-1,e),t,2)}function gx(e,t){return yB(e.getFullYear()%100,t,2)}function gy(e,t){return yB((e=gh(e)).getFullYear()%100,t,2)}function gg(e,t){return yB(e.getFullYear()%1e4,t,4)}function gv(e,t){var r=e.getDay();return yB((e=r>=4||0===r?yc(e):yc.ceil(e)).getFullYear()%1e4,t,4)}function gb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yB(t/60|0,"0",2)+yB(t%60,"0",2)}function gj(e,t){return yB(e.getUTCDate(),t,2)}function gw(e,t){return yB(e.getUTCHours(),t,2)}function gN(e,t){return yB(e.getUTCHours()%12||12,t,2)}function gk(e,t){return yB(1+yj.count(yt(e),e),t,3)}function gS(e,t){return yB(e.getUTCMilliseconds(),t,3)}function gO(e,t){return gS(e,t)+"000"}function gP(e,t){return yB(e.getUTCMonth()+1,t,2)}function gC(e,t){return yB(e.getUTCMinutes(),t,2)}function gA(e,t){return yB(e.getUTCSeconds(),t,2)}function gE(e){var t=e.getUTCDay();return 0===t?7:t}function gM(e,t){return yB(yp.count(yt(e)-1,e),t,2)}function gT(e){var t=e.getUTCDay();return t>=4||0===t?yy(e):yy.ceil(e)}function g_(e,t){return e=gT(e),yB(yy.count(yt(e),e)+(4===yt(e).getUTCDay()),t,2)}function gD(e){return e.getUTCDay()}function gI(e,t){return yB(ym.count(yt(e)-1,e),t,2)}function gL(e,t){return yB(e.getUTCFullYear()%100,t,2)}function gz(e,t){return yB((e=gT(e)).getUTCFullYear()%100,t,2)}function gR(e,t){return yB(e.getUTCFullYear()%1e4,t,4)}function gF(e,t){var r=e.getUTCDay();return yB((e=r>=4||0===r?yy(e):yy.ceil(e)).getUTCFullYear()%1e4,t,4)}function g$(){return"+0000"}function gB(){return"%"}function gU(e){return+e}function gq(e){return Math.floor(e/1e3)}function gV(e){return new Date(e)}function gK(e){return e instanceof Date?+e:+new Date(+e)}function gW(e,t,r,n,i,a,s,o,l,c){var u=xg(),d=u.invert,h=u.domain,p=c(".%L"),m=c(":%S"),f=c("%I:%M"),x=c("%I %p"),y=c("%a %d"),g=c("%b %d"),v=c("%B"),b=c("%Y");function j(e){return(l(e)<e?p:o(e)<e?m:s(e)<e?f:a(e)<e?x:n(e)<e?i(e)<e?y:g:r(e)<e?v:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?h(Array.from(e,gK)):h().map(gV)},u.ticks=function(t){var r=h();return e(r[0],r[r.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?j:c(t)},u.nice=function(e){var r=h();return e&&"function"==typeof e.range||(e=t(r[0],r[r.length-1],null==e?10:e)),e?h(x_(r,e)):u},u.copy=function(){return xx(u,gW(e,t,r,n,i,a,s,o,l,c))},u}function gH(){return fY.initRange.apply(gW(yT,y_,ye,yr,ya,yb,yN,yS,yP,j).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gY(){return fY.initRange.apply(gW(yE,yM,yt,yn,yp,yj,yk,yO,yP,w).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function gQ(){var e,t,r,n,i,a=0,s=1,o=xh,l=!1;function c(t){return null==t||isNaN(t*=1)?i:o(0===r?.5:(t=(n(t)-e)*r,l?Math.max(0,Math.min(1,t)):t))}function u(e){return function(t){var r,n;return arguments.length?([r,n]=t,o=e(r,n),c):[o(0),o(1)]}}return c.domain=function(i){return arguments.length?([a,s]=i,e=n(a*=1),t=n(s*=1),r=e===t?0:1/(t-e),c):[a,s]},c.clamp=function(e){return arguments.length?(l=!!e,c):l},c.interpolator=function(e){return arguments.length?(o=e,c):o},c.range=u(xo),c.rangeRound=u(xc),c.unknown=function(e){return arguments.length?(i=e,c):i},function(i){return n=i,e=i(a),t=i(s),r=e===t?0:1/(t-e),c}}function gX(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function gG(){var e=xE(gQ()(xh));return e.copy=function(){return gX(e,gG())},fY.initInterpolator.apply(e,arguments)}function gZ(){var e=x$(gQ()).domain([1,10]);return e.copy=function(){return gX(e,gZ()).base(e.base())},fY.initInterpolator.apply(e,arguments)}function gJ(){var e=xV(gQ());return e.copy=function(){return gX(e,gJ()).constant(e.constant())},fY.initInterpolator.apply(e,arguments)}function g0(){var e=xQ(gQ());return e.copy=function(){return gX(e,g0()).exponent(e.exponent())},fY.initInterpolator.apply(e,arguments)}function g1(){return g0.apply(null,arguments).exponent(.5)}function g2(){var e=[],t=xh;function r(r){if(null!=r&&!isNaN(r*=1))return t((xt(e,r,1)-1)/(e.length-1))}return r.domain=function(t){if(!arguments.length)return e.slice();for(let r of(e=[],t))null==r||isNaN(r*=1)||e.push(r);return e.sort(f3),r},r.interpolator=function(e){return arguments.length?(t=e,r):t},r.range=function(){return e.map((r,n)=>t(n/(e.length-1)))},r.quantiles=function(t){return Array.from({length:t+1},(r,n)=>(function(e,t,r){if(!(!(n=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t*=1)>=t&&(yield t);else{let r=-1;for(let n of e)null!=(n=t(n,++r,e))&&(n*=1)>=n&&(yield n)}}(e,void 0))).length)||isNaN(t*=1))){if(t<=0||n<2)return(0,x1.default)(e);if(t>=1)return(0,x0.default)(e);var n,i=(n-1)*t,a=Math.floor(i),s=(0,x0.default)((function e(t,r,n=0,i=1/0,a){if(r=Math.floor(r),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(t.length-1,i)),!(n<=r&&r<=i))return t;for(a=void 0===a?x2:function(e=f3){if(e===f3)return x2;if("function"!=typeof e)throw TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||0===n?n:(0===e(r,r))-(0===e(t,t))}}(a);i>n;){if(i-n>600){let s=i-n+1,o=r-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(o-s/2<0?-1:1),d=Math.max(n,Math.floor(r-o*c/s+u)),h=Math.min(i,Math.floor(r+(s-o)*c/s+u));e(t,r,d,h,a)}let s=t[r],o=n,l=i;for(x5(t,n,r),a(t[i],s)>0&&x5(t,n,i);o<l;){for(x5(t,o,l),++o,--l;0>a(t[o],s);)++o;for(;a(t[l],s)>0;)--l}0===a(t[n],s)?x5(t,n,l):x5(t,++l,i),l<=r&&(n=l+1),r<=l&&(i=l-1)}return t})(e,a).subarray(0,a+1));return s+((0,x1.default)(e.subarray(a+1))-s)*(i-a)}})(e,n/t))},r.copy=function(){return g2(t).domain(e)},fY.initInterpolator.apply(r,arguments)}function g5(){var e,t,r,n,i,a,s,o=0,l=.5,c=1,u=1,d=xh,h=!1;function p(e){return isNaN(e*=1)?s:(e=.5+((e=+a(e))-t)*(u*e<u*t?n:i),d(h?Math.max(0,Math.min(1,e)):e))}function m(e){return function(t){var r,n,i;return arguments.length?([r,n,i]=t,d=function(e,t){void 0===t&&(t=e,e=xo);for(var r=0,n=t.length-1,i=t[0],a=Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return a[t](e-t)}}(e,[r,n,i]),p):[d(0),d(.5),d(1)]}}return p.domain=function(s){return arguments.length?([o,l,c]=s,e=a(o*=1),t=a(l*=1),r=a(c*=1),n=e===t?0:.5/(t-e),i=t===r?0:.5/(r-t),u=t<e?-1:1,p):[o,l,c]},p.clamp=function(e){return arguments.length?(h=!!e,p):h},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=m(xo),p.rangeRound=m(xc),p.unknown=function(e){return arguments.length?(s=e,p):s},function(s){return a=s,e=s(o),t=s(l),r=s(c),n=e===t?0:.5/(t-e),i=t===r?0:.5/(r-t),u=t<e?-1:1,p}}function g4(){var e=xE(g5()(xh));return e.copy=function(){return gX(e,g4())},fY.initInterpolator.apply(e,arguments)}function g3(){var e=x$(g5()).domain([.1,1,10]);return e.copy=function(){return gX(e,g3()).base(e.base())},fY.initInterpolator.apply(e,arguments)}function g6(){var e=xV(g5());return e.copy=function(){return gX(e,g6()).constant(e.constant())},fY.initInterpolator.apply(e,arguments)}function g8(){var e=xQ(g5());return e.copy=function(){return gX(e,g8()).exponent(e.exponent())},fY.initInterpolator.apply(e,arguments)}function g7(){return g8.apply(null,arguments).exponent(.5)}j=(b=function(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,c=yq(i),u=yV(i),d=yq(a),h=yV(a),p=yq(s),m=yV(s),f=yq(o),x=yV(o),y=yq(l),g=yV(l),v={a:function(e){return s[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return o[e.getMonth()]},c:null,d:gt,e:gt,f:gs,g:gy,G:gv,H:gr,I:gn,j:gi,L:ga,m:go,M:gl,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:gU,s:gq,S:gc,u:gu,U:gd,V:gp,w:gm,W:gf,x:null,X:null,y:gx,Y:gg,Z:gb,"%":gB},b={a:function(e){return s[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return o[e.getUTCMonth()]},c:null,d:gj,e:gj,f:gO,g:gz,G:gF,H:gw,I:gN,j:gk,L:gS,m:gP,M:gC,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:gU,s:gq,S:gA,u:gE,U:gM,V:g_,w:gD,W:gI,x:null,X:null,y:gL,Y:gR,Z:g$,"%":gB},j={a:function(e,t,r){var n=p.exec(t.slice(r));return n?(e.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(e,t,r){var n=d.exec(t.slice(r));return n?(e.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(e,t,r){var n=y.exec(t.slice(r));return n?(e.m=g.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(e,t,r){var n=f.exec(t.slice(r));return n?(e.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(e,r,n){return k(e,t,r,n)},d:y1,e:y1,f:y8,g:yG,G:yX,H:y5,I:y5,j:y2,L:y6,m:y0,M:y4,p:function(e,t,r){var n=c.exec(t.slice(r));return n?(e.p=u.get(n[0].toLowerCase()),r+n[0].length):-1},q:yJ,Q:y9,s:ge,S:y3,u:yW,U:yH,V:yY,w:yK,W:yQ,x:function(e,t,n){return k(e,r,t,n)},X:function(e,t,r){return k(e,n,t,r)},y:yG,Y:yX,Z:yZ,"%":y7};function w(e,t){return function(r){var n,i,a,s=[],o=-1,l=0,c=e.length;for(r instanceof Date||(r=new Date(+r));++o<c;)37===e.charCodeAt(o)&&(s.push(e.slice(l,o)),null!=(i=yz[n=e.charAt(++o)])?n=e.charAt(++o):i="e"===n?" ":"0",(a=t[n])&&(n=a(r,i)),s.push(n),l=o+1);return s.push(e.slice(l,o)),s.join("")}}function N(e,t){return function(r){var n,i,a=yL(1900,void 0,1);if(k(a,e,r+="",0)!=r.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!t||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(n=(i=(n=yI(yL(a.y,0,1))).getUTCDay())>4||0===i?ym.ceil(n):ym(n),n=yj.offset(n,(a.V-1)*7),a.y=n.getUTCFullYear(),a.m=n.getUTCMonth(),a.d=n.getUTCDate()+(a.w+6)%7):(n=(i=(n=yD(yL(a.y,0,1))).getDay())>4||0===i?ys.ceil(n):ys(n),n=yb.offset(n,(a.V-1)*7),a.y=n.getFullYear(),a.m=n.getMonth(),a.d=n.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:+("W"in a)),i="Z"in a?yI(yL(a.y,0,1)).getUTCDay():yD(yL(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,yI(a)):yD(a)}}function k(e,t,r,n){for(var i,a,s=0,o=t.length,l=r.length;s<o;){if(n>=l)return -1;if(37===(i=t.charCodeAt(s++))){if(!(a=j[(i=t.charAt(s++))in yz?t.charAt(s++):i])||(n=a(e,r,n))<0)return -1}else if(i!=r.charCodeAt(n++))return -1}return n}return v.x=w(r,v),v.X=w(n,v),v.c=w(t,v),b.x=w(r,b),b.X=w(n,b),b.c=w(t,b),{format:function(e){var t=w(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=N(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=N(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,b.parse,w=b.utcFormat,b.utcParse,e.s(["scaleBand",()=>fX,"scaleDiverging",()=>g4,"scaleDivergingLog",()=>g3,"scaleDivergingPow",()=>g8,"scaleDivergingSqrt",()=>g7,"scaleDivergingSymlog",()=>g6,"scaleIdentity",()=>xT,"scaleImplicit",()=>fQ.implicit,"scaleLinear",()=>xM,"scaleLog",()=>xB,"scaleOrdinal",()=>fQ.default,"scalePoint",()=>fG,"scalePow",()=>xX,"scaleQuantile",()=>x4,"scaleQuantize",()=>x3,"scaleRadial",()=>xJ,"scaleSequential",()=>gG,"scaleSequentialLog",()=>gZ,"scaleSequentialPow",()=>g0,"scaleSequentialQuantile",()=>g2,"scaleSequentialSqrt",()=>g1,"scaleSequentialSymlog",()=>gJ,"scaleSqrt",()=>xG,"scaleSymlog",()=>xK,"scaleThreshold",()=>x6,"scaleTime",()=>gH,"scaleUtc",()=>gY,"tickFormat",()=>xA],84649),e.i(84649),e.s(["scaleBand",()=>fX,"scaleDiverging",()=>g4,"scaleDivergingLog",()=>g3,"scaleDivergingPow",()=>g8,"scaleDivergingSqrt",()=>g7,"scaleDivergingSymlog",()=>g6,"scaleIdentity",()=>xT,"scaleImplicit",()=>fQ.implicit,"scaleLinear",()=>xM,"scaleLog",()=>xB,"scaleOrdinal",()=>fQ.default,"scalePoint",()=>fG,"scalePow",()=>xX,"scaleQuantile",()=>x4,"scaleQuantize",()=>x3,"scaleRadial",()=>xJ,"scaleSequential",()=>gG,"scaleSequentialLog",()=>gZ,"scaleSequentialPow",()=>g0,"scaleSequentialQuantile",()=>g2,"scaleSequentialSqrt",()=>g1,"scaleSequentialSymlog",()=>gJ,"scaleSqrt",()=>xG,"scaleSymlog",()=>xK,"scaleThreshold",()=>x6,"scaleTime",()=>gH,"scaleUtc",()=>gY,"tickFormat",()=>xA],93628);var g9=e.i(93628),ve=e=>e.chartData,vt=hf([ve],e=>{var t=null!=e.chartData?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),vr=(e,t,r,n)=>n?vt(e):ve(e);function vn(e){if(Array.isArray(e)&&2===e.length){var[t,r]=e;if(m4(t)&&m4(r))return!0}return!1}function vi(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function va(e,t){if(t&&"function"!=typeof e&&Array.isArray(e)&&2===e.length){var r,n,[i,a]=e;if(m4(i))r=i;else if("function"==typeof i)return;if(m4(a))n=a;else if("function"==typeof a)return;var s=[r,n];if(vn(s))return s}}var vs=e.i(73335);function vo(e){return 0===e?1:Math.floor(new vs.default(e).abs().log(10).toNumber())+1}function vl(e,t,r){for(var n=new vs.default(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var vc=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},vu=(e,t,r)=>{if(e.lte(0))return new vs.default(0);var n=vo(e.toNumber()),i=new vs.default(10).pow(n),a=e.div(i),s=1!==n?.05:.1,o=new vs.default(Math.ceil(a.div(s).toNumber())).add(r).mul(s).mul(i);return new vs.default(t?o.toNumber():Math.ceil(o.toNumber()))},vd=function(e,t,r,n){var i,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new vs.default(0),tickMin:new vs.default(0),tickMax:new vs.default(0)};var s=vu(new vs.default(t).sub(e).div(r-1),n,a),o=Math.ceil((i=e<=0&&t>=0?new vs.default(0):(i=new vs.default(e).add(t).div(2)).sub(new vs.default(i).mod(s))).sub(e).div(s).toNumber()),l=Math.ceil(new vs.default(t).sub(i).div(s).toNumber()),c=o+l+1;return c>r?vd(e,t,r,n,a+1):(c<r&&(l=t>0?l+(r-c):l,o=t>0?o:o+(r-c)),{step:s,tickMin:i.sub(new vs.default(o).mul(s)),tickMax:i.add(new vs.default(l).mul(s))})},vh=function(e){var[t,r]=e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(n,2),[s,o]=vc([t,r]);if(s===-1/0||o===1/0){var l=o===1/0?[s,...Array(n-1).fill(1/0)]:[...Array(n-1).fill(-1/0),o];return t>r?l.reverse():l}if(s===o)return((e,t,r)=>{var n=new vs.default(1),i=new vs.default(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new vs.default(10).pow(vo(e)-1),i=new vs.default(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new vs.default(Math.floor(e)))}else 0===e?i=new vs.default(Math.floor((t-1)/2)):r||(i=new vs.default(Math.floor(e)));for(var s=Math.floor((t-1)/2),o=[],l=0;l<t;l++)o.push(i.add(new vs.default(l-s).mul(n)).toNumber());return o})(s,n,i);var{step:c,tickMin:u,tickMax:d}=vd(s,o,a,i,0),h=vl(u,d.add(new vs.default(.1).mul(c)),c);return t>r?h.reverse():h},vp=function(e,t){var[r,n]=e,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],[a,s]=vc([r,n]);if(a===-1/0||s===1/0)return[r,n];if(a===s)return[a];var o=Math.max(t,2),l=vu(new vs.default(s).sub(a).div(o-1),i,0),c=[...vl(new vs.default(a),new vs.default(s),l),s];return!1===i&&(c=c.map(e=>Math.round(e))),r>n?c.reverse():c},vm=e=>e.rootProps.maxBarSize,vf=e=>e.rootProps.barCategoryGap,vx=e=>e.rootProps.stackOffset,vy=e=>e.rootProps.reverseStackOrder,vg=e=>e.options.chartName,vv=e=>e.rootProps.syncId,vb=e=>e.rootProps.syncMethod,vj=e=>e.options.eventEmitter;function vw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function vN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vw(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var vk=Math.PI/180,vS=(e,t,r,n)=>({x:e+Math.cos(-vk*n)*r,y:t+Math.sin(-vk*n)*r}),vO={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},vP={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:"polygon",cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,orientation:"outer",reversed:!1,scale:"auto",tick:!0,tickLine:!0,tickSize:8,type:"auto",zIndex:vO.axis},vC={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,label:!1,orientation:"right",radiusAxisId:0,reversed:!1,scale:"auto",stroke:"#ccc",tick:!0,tickCount:5,tickLine:!0,type:"auto",zIndex:vO.axis},vA=(e,t)=>{if(e&&t)return null!=e&&e.reversed?[t[1],t[0]]:t};function vE(e,t,r){return"auto"!==r?r:null!=e?m9(e,t)?"category":"number":void 0}function vM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function vT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vM(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vM(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var v_={allowDataOverflow:vP.allowDataOverflow,allowDecimals:vP.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:vP.angleAxisId,includeHidden:!1,name:void 0,reversed:vP.reversed,scale:vP.scale,tick:vP.tick,tickCount:void 0,ticks:void 0,type:vP.type,unit:void 0},vD={allowDataOverflow:vC.allowDataOverflow,allowDecimals:vC.allowDecimals,allowDuplicatedCategory:vC.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:vC.radiusAxisId,includeHidden:vC.includeHidden,name:void 0,reversed:vC.reversed,scale:vC.scale,tick:vC.tick,tickCount:vC.tickCount,ticks:void 0,type:vC.type,unit:void 0},vI=hf([(e,t)=>{if(null!=t)return e.polarAxis.angleAxis[t]},fK],(e,t)=>{if(null!=e)return e;var r,n=null!=(r=vE(t,"angleAxis",v_.type))?r:"category";return vT(vT({},v_),{},{type:n})}),vL=hf([(e,t)=>e.polarAxis.radiusAxis[t],fK],(e,t)=>{if(null!=e)return e;var r,n=null!=(r=vE(t,"radiusAxis",vD.type))?r:"category";return vT(vT({},vD),{},{type:n})}),vz=e=>e.polarOptions,vR=hf([fo,fl,ff],function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(t-(r.top||0)-(r.bottom||0)))/2}),vF=hf([vz,vR],(e,t)=>{if(null!=e)return pg(e.innerRadius,t,0)}),v$=hf([vz,vR],(e,t)=>{if(null!=e)return pg(e.outerRadius,t,.8*t)}),vB=hf([vz],e=>{if(null==e)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]});hf([vI,vB],vA);var vU=hf([vR,vF,v$],(e,t,r)=>{if(null!=e&&null!=t&&null!=r)return[t,r]});hf([vL,vU],vA);var vq=hf([fq,vz,vF,v$,fo,fl],(e,t,r,n,i,a)=>{if(("centric"===e||"radial"===e)&&null!=t&&null!=r&&null!=n){var{cx:s,cy:o,startAngle:l,endAngle:c}=t;return{cx:pg(s,i,i/2),cy:pg(o,a,a/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:c,clockWise:!1}}}),vV=(e,t)=>t,vK=(e,t,r)=>r;function vW(e){return null==e?void 0:e.id}function vH(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=r,s=new Map;return e.forEach(e=>{var t,r=null!=(t=e.data)?t:n;if(null!=r&&0!==r.length){var o=vW(e);r.forEach((t,r)=>{var n,l=null==a||i?r:String(m7(t,a,null)),c=m7(t,e.dataKey,0);Object.assign(n=s.has(l)?s.get(l):{},{[o]:c}),s.set(l,n)})}}),Array.from(s.values())}function vY(e){return"stackId"in e&&null!=e.stackId&&null!=e.dataKey}var vQ=(e,t)=>e===t||null!=e&&null!=t&&e[0]===t[0]&&e[1]===t[1];function vX(e,t){return!!(Array.isArray(e)&&Array.isArray(t))&&0===e.length&&0===t.length||e===t}var vG=e=>{var t=fq(e);return"horizontal"===t?"xAxis":"vertical"===t?"yAxis":"centric"===t?"angleAxis":"radiusAxis"},vZ=e=>e.tooltip.settings.axisId;function vJ(e){var t=e.ticks,r=e.bandwidth,n=e.range(),i=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],r=i[1];return t<=r?e>=t&&e<=r:e>=r&&e<=t},bandwidth:r?()=>r.call(e):void 0,ticks:t?r=>t.call(e,r):void 0,map:(t,r)=>{var n=e(t);if(null!=n){if(e.bandwidth&&null!=r&&r.position){var i=e.bandwidth();switch(r.position){case"middle":n+=i/2;break;case"end":n+=i}}return n}}}}function v0(e,t,r){if("function"==typeof e)return vJ(e.copy().domain(t).range(r));if(null!=e){var n=function(e){if(e in g9)return g9[e]();var t="scale".concat(pj(e));if(t in g9)return g9[t]()}(e);if(null!=n)return n.domain(t).range(r),vJ(n)}}function v1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v1(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v1(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var v5=[0,"auto"],v4={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},v3=(e,t)=>e.cartesianAxis.xAxis[t],v6=(e,t)=>{var r=v3(e,t);return null==r?v4:r},v8={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:v5,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:60},v7=(e,t)=>e.cartesianAxis.yAxis[t],v9=(e,t)=>{var r=v7(e,t);return null==r?v8:r},be={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},bt=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return null==r?be:r},br=(e,t,r)=>{switch(t){case"xAxis":return v6(e,r);case"yAxis":return v9(e,r);case"zAxis":return bt(e,r);case"angleAxis":return vI(e,r);case"radiusAxis":return vL(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},bn=(e,t,r)=>{switch(t){case"xAxis":return v6(e,r);case"yAxis":return v9(e,r);case"angleAxis":return vI(e,r);case"radiusAxis":return vL(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},bi=e=>e.graphicalItems.cartesianItems.some(e=>"bar"===e.type)||e.graphicalItems.polarItems.some(e=>"radialBar"===e.type);function ba(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var bs=e=>e.graphicalItems.cartesianItems,bo=hf([vV,vK],ba),bl=(e,t,r)=>e.filter(r).filter(e=>(null==t?void 0:t.includeHidden)===!0||!e.hide),bc=hf([bs,br,bo],bl,{memoizeOptions:{resultEqualityCheck:vX}}),bu=hf([bc],e=>e.filter(e=>"area"===e.type||"bar"===e.type).filter(vY)),bd=e=>e.filter(e=>!("stackId"in e)||void 0===e.stackId),bh=hf([bc],bd),bp=e=>e.map(e=>e.data).filter(Boolean).flat(1),bm=hf([bc],bp,{memoizeOptions:{resultEqualityCheck:vX}}),bf=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},bx=hf([bm,vr],bf),by=(e,t,r)=>(null==t?void 0:t.dataKey)!=null?e.map(e=>({value:m7(e,t.dataKey)})):r.length>0?r.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:m7(e,t)}))):e.map(e=>({value:e})),bg=hf([bx,br,bc],by);function bv(e,t){switch(e){case"xAxis":return"x"===t.direction;case"yAxis":return"y"===t.direction;default:return!1}}function bb(e){if(pf(e)||e instanceof Date){var t=Number(e);if(m4(t))return t}}function bj(e){if(Array.isArray(e)){var t=[bb(e[0]),bb(e[1])];return vn(t)?t:void 0}var r=bb(e);if(null!=r)return[r,r]}function bw(e){return e.map(bb).filter(pw)}var bN=e=>{var t=vG(e),r=vZ(e);return bn(e,t,r)},bk=hf([bN],e=>null==e?void 0:e.dataKey),bS=hf([bu,vr,bN],vH),bO=(e,t,r,n)=>Object.fromEntries(Object.entries(t.reduce((e,t)=>{if(null==t.stackId)return e;var r=e[t.stackId];return null==r&&(r=[]),r.push(t),e[t.stackId]=r,e},{})).map(t=>{var i,a,s,[o,l]=t,c=n?[...l].reverse():l,u=c.map(vW);return[o,{stackedData:(a=null!=(i=fe[r])?i:mJ,(s=(function(){var e=mZ([]),t=m0,r=mJ,n=m1;function i(i){var a,s,o=Array.from(e.apply(this,arguments),m2),l=o.length,c=-1;for(let e of i)for(a=0,++c;a<l;++a)(o[a][c]=[0,+n(e,o[a].key,c,i)]).data=e;for(a=0,s=mG(t(o));a<l;++a)o[s[a]].index=a;return r(o,s),o}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:mZ(Array.from(t)),i):e},i.value=function(e){return arguments.length?(n="function"==typeof e?e:mZ(+e),i):n},i.order=function(e){return arguments.length?(t=null==e?m0:"function"==typeof e?e:mZ(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(r=null==e?mJ:e,i):r},i})().keys(u).value((e,t)=>Number(m7(e,t,0))).order(m0).offset(a)(e)).forEach((t,r)=>{t.forEach((t,n)=>{var i=m7(e[n],u[r],0);Array.isArray(i)&&2===i.length&&pm(i[0])&&pm(i[1])&&(t[0]=i[0],t[1]=i[1])})}),s),graphicalItems:c}]})),bP=hf([bS,bu,vx,vy],bO),bC=(e,t,r,n)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(null==n&&"zAxis"!==r){var s=((e,t,r)=>{if(null!=e){let n;return[(n=Object.keys(e).reduce((n,i)=>{var a=e[i];if(!a)return n;var{stackedData:s}=a,o=s.reduce((e,n)=>{var i,a=[Math.min(...i=m5(n,t,r).flat(2).filter(pm)),Math.max(...i)];return m4(a[0])&&m4(a[1])?[Math.min(e[0],a[0]),Math.max(e[1],a[1])]:e},[1/0,-1/0]);return[Math.min(o[0],n[0]),Math.max(o[1],n[1])]},[1/0,-1/0]))[0]===1/0?0:n[0],n[1]===-1/0?0:n[1]]}})(e,i,a);if(null==s||0!==s[0]||0!==s[1])return s}},bA=hf([br],e=>e.allowDataOverflow),bE=e=>{var t;if(null==e||!("domain"in e))return v5;if(null!=e.domain)return e.domain;if("ticks"in e&&null!=e.ticks){if("number"===e.type){var r=bw(e.ticks);return[Math.min(...r),Math.max(...r)]}if("category"===e.type)return e.ticks.map(String)}return null!=(t=null==e?void 0:e.domain)?t:v5},bM=hf([br],bE),bT=hf([bM,bA],va),b_=hf([bP,ve,vV,bT],bC,{memoizeOptions:{resultEqualityCheck:vQ}}),bD=e=>e.errorBars,bI=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.filter(Boolean);if(0!==n.length){var i=n.flat();return[Math.min(...i),Math.max(...i)]}},bL=(e,t,r,n,i)=>{var a,s;if(r.length>0&&e.forEach(e=>{r.forEach(r=>{var o,l,c=null==(o=n[r.id])?void 0:o.filter(e=>bv(i,e)),u=m7(e,null!=(l=t.dataKey)?l:r.dataKey),d=!(!c||"number"!=typeof u||ph(u))&&c.length?bw(c.flatMap(t=>{var r,n,i=m7(e,t.dataKey);if(Array.isArray(i)?[r,n]=i:r=n=i,m4(r)&&m4(n))return[u-r,u+n]})):[];if(d.length>=2){var h=Math.min(...d),p=Math.max(...d);(null==a||h<a)&&(a=h),(null==s||p>s)&&(s=p)}var m=bj(u);null!=m&&(a=null==a?m[0]:Math.min(a,m[0]),s=null==s?m[1]:Math.max(s,m[1]))})}),(null==t?void 0:t.dataKey)!=null&&e.forEach(e=>{var r=bj(m7(e,t.dataKey));null!=r&&(a=null==a?r[0]:Math.min(a,r[0]),s=null==s?r[1]:Math.max(s,r[1]))}),m4(a)&&m4(s))return[a,s]},bz=hf([bx,br,bh,bD,vV],bL,{memoizeOptions:{resultEqualityCheck:vQ}});function bR(e){var{value:t}=e;if(pf(t)||t instanceof Date)return t}var bF=e=>e.referenceElements.dots,b$=(e,t,r)=>e.filter(e=>"extendDomain"===e.ifOverflow).filter(e=>"xAxis"===t?e.xAxisId===r:e.yAxisId===r),bB=hf([bF,vV,vK],b$),bU=e=>e.referenceElements.areas,bq=hf([bU,vV,vK],b$),bV=e=>e.referenceElements.lines,bK=hf([bV,vV,vK],b$),bW=(e,t)=>{if(null!=e){var r=bw(e.map(e=>"xAxis"===t?e.x:e.y));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},bH=hf(bB,vV,bW),bY=(e,t)=>{if(null!=e){var r=bw(e.flatMap(e=>["xAxis"===t?e.x1:e.y1,"xAxis"===t?e.x2:e.y2]));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},bQ=hf([bq,vV],bY),bX=(e,t)=>{if(null!=e){var r=e.flatMap(e=>"xAxis"===t?function(e){if(null!=e.x)return bw([e.x]);var t,r=null==(t=e.segment)?void 0:t.map(e=>e.x);return null==r||0===r.length?[]:bw(r)}(e):function(e){if(null!=e.y)return bw([e.y]);var t,r=null==(t=e.segment)?void 0:t.map(e=>e.y);return null==r||0===r.length?[]:bw(r)}(e));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},bG=hf([bK,vV],bX),bZ=hf(bH,bG,bQ,(e,t,r)=>bI(e,r,t)),bJ=(e,t,r,n,i,a,s,o)=>null!=r?r:function(e,t,r){if(r||null!=t){if("function"==typeof e&&null!=t)try{var n=e(t,r);if(vn(n))return vi(n,t,r)}catch(e){}if(Array.isArray(e)&&2===e.length){var i,a,[s,o]=e;if("auto"===s)null!=t&&(i=Math.min(...t));else if(pm(s))i=s;else if("function"==typeof s)try{null!=t&&(i=s(null==t?void 0:t[0]))}catch(e){}else if("string"==typeof s&&fr.test(s)){var l=fr.exec(s);if(null==l||null==l[1]||null==t)i=void 0;else{var c=+l[1];i=t[0]-c}}else i=null==t?void 0:t[0];if("auto"===o)null!=t&&(a=Math.max(...t));else if(pm(o))a=o;else if("function"==typeof o)try{null!=t&&(a=o(null==t?void 0:t[1]))}catch(e){}else if("string"==typeof o&&fn.test(o)){var u=fn.exec(o);if(null==u||null==u[1]||null==t)a=void 0;else{var d=+u[1];a=t[1]+d}}else a=null==t?void 0:t[1];var h=[i,a];if(vn(h))return null==t?h:vi(h,t,r)}}}(t,"vertical"===s&&"xAxis"===o||"horizontal"===s&&"yAxis"===o?bI(n,a,i):bI(a,i),e.allowDataOverflow),b0=hf([br,bM,bT,b_,bz,bZ,fq,vV],bJ,{memoizeOptions:{resultEqualityCheck:vQ}}),b1=[0,1],b2=(e,t,r,n,i,a,s)=>{if(null!=e&&null!=r&&0!==r.length||void 0!==s){var o,l,{dataKey:c,type:u}=e,d=m9(t,a);return d&&null==c?(0,fH.default)(0,null!=(l=null==r?void 0:r.length)?l:0):"category"===u?(o=n.map(bR).filter(e=>null!=e),d&&(null==e.dataKey||e.allowDuplicatedCategory&&pv(o))?(0,fH.default)(0,n.length):e.allowDuplicatedCategory?o:Array.from(new Set(o))):"expand"===i?b1:s}},b5=hf([br,fq,bx,bg,vx,vV,b0],b2),b4=(e,t,r)=>{if(null!=e){var{scale:n,type:i}=e;if("auto"===n)return"category"===i&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":"category"===i?"band":"linear";if("string"==typeof n){var a="scale".concat(pj(n));return a in g9?a:"point"}}},b3=hf([br,bi,vg],b4);function b6(e,t,r,n){if(null!=r&&null!=n)return"function"==typeof e.scale?v0(e.scale,r,n):v0(t,r,n)}var b8=(e,t,r)=>{var n=bE(t);if("auto"===r||"linear"===r){if(null!=t&&t.tickCount&&Array.isArray(n)&&("auto"===n[0]||"auto"===n[1])&&vn(e))return vh(e,t.tickCount,t.allowDecimals);if(null!=t&&t.tickCount&&"number"===t.type&&vn(e))return vp(e,t.tickCount,t.allowDecimals)}},b7=hf([b5,bn,b3],b8),b9=(e,t,r,n)=>{if("angleAxis"!==n&&(null==e?void 0:e.type)==="number"&&vn(t)&&Array.isArray(r)&&r.length>0){var i,a;return[Math.min(t[0],null!=(i=r[0])?i:0),Math.max(t[1],null!=(a=r[r.length-1])?a:0)]}return t},je=hf([br,b5,b7,vV],b9),jt=hf(bg,br,(e,t)=>{if(t&&"number"===t.type){var r=1/0,n=Array.from(bw(e.map(e=>e.value))).sort((e,t)=>e-t),i=n[0],a=n[n.length-1];if(null==i||null==a)return 1/0;var s=a-i;if(0===s)return 1/0;for(var o=0;o<n.length-1;o++){var l=n[o],c=n[o+1];null!=l&&null!=c&&(r=Math.min(r,c-l))}return r/s}}),jr=hf(jt,fq,vf,ff,(e,t,r,n,i)=>i,(e,t,r,n,i)=>{if(!m4(e))return 0;var a="vertical"===t?n.height:n.width;if("gap"===i)return e*a/2;if("no-gap"===i){var s=pg(r,e*a),o=e*a/2;return o-s-(o-s)/a*s}return 0}),jn=hf(v6,(e,t,r)=>{var n=v6(e,t);return null==n||"string"!=typeof n.padding?0:jr(e,"xAxis",t,r,n.padding)},(e,t)=>{if(null==e)return{left:0,right:0};var r,n,{padding:i}=e;return"string"==typeof i?{left:t,right:t}:{left:(null!=(r=i.left)?r:0)+t,right:(null!=(n=i.right)?n:0)+t}}),ji=hf(v9,(e,t,r)=>{var n=v9(e,t);return null==n||"string"!=typeof n.padding?0:jr(e,"yAxis",t,r,n.padding)},(e,t)=>{if(null==e)return{top:0,bottom:0};var r,n,{padding:i}=e;return"string"==typeof i?{top:t,bottom:t}:{top:(null!=(r=i.top)?r:0)+t,bottom:(null!=(n=i.bottom)?n:0)+t}}),ja=hf([ff,jn,fj,fb,(e,t,r)=>r],(e,t,r,n,i)=>{var{padding:a}=n;return i?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),js=hf([ff,fq,ji,fj,fb,(e,t,r)=>r],(e,t,r,n,i,a)=>{var{padding:s}=i;return a?[n.height-s.bottom,s.top]:"horizontal"===t?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),jo=(e,t,r,n)=>{var i;switch(t){case"xAxis":return ja(e,r,n);case"yAxis":return js(e,r,n);case"zAxis":return null==(i=bt(e,r))?void 0:i.range;case"angleAxis":return vB(e);case"radiusAxis":return vU(e,r);default:return}},jl=hf([br,jo],vA),jc=hf([b3,je],(e,t)=>{if(null!=t)if("linear"!==e)return t;else{if(!vn(t)){for(var r,n,i=0;i<t.length;i++){var a=t[i];m4(a)&&((void 0===r||a<r)&&(r=a),(void 0===n||a>n)&&(n=a))}return void 0!==r&&void 0!==n?[r,n]:void 0}return t}}),ju=hf([br,b3,jc,jl],b6);function jd(e,t){return e.id<t.id?-1:+(e.id>t.id)}hf([bc,bD,vV],(e,t,r)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>bv(r,e)));var jh=(e,t)=>t,jp=(e,t,r)=>r,jm=hf(fd,jh,jp,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(jd)),jf=hf(fh,jh,jp,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(jd)),jx=(e,t)=>({width:e.width,height:t.height}),jy=hf(ff,v6,jx),jg=hf(fl,ff,jm,jh,jp,(e,t,r,n,i)=>{var a,s={};return r.forEach(r=>{var o=jx(t,r);null==a&&(a=((e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}})(t,n,e));var l="top"===n&&!i||"bottom"===n&&i;s[r.id]=a-Number(l)*o.height,a+=(l?-1:1)*o.height}),s}),jv=hf(fo,ff,jf,jh,jp,(e,t,r,n,i)=>{var a,s={};return r.forEach(r=>{var o={width:"number"==typeof r.width?r.width:60,height:t.height};null==a&&(a=((e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}})(t,n,e));var l="left"===n&&!i||"right"===n&&i;s[r.id]=a-Number(l)*o.width,a+=(l?-1:1)*o.width}),s}),jb=hf([ff,v6,(e,t)=>{var r=v6(e,t);if(null!=r)return jg(e,r.orientation,r.mirror)},(e,t)=>t],(e,t,r,n)=>{if(null!=t){var i=null==r?void 0:r[n];return null==i?{x:e.left,y:0}:{x:e.left,y:i}}}),jj=hf([ff,v9,(e,t)=>{var r=v9(e,t);if(null!=r)return jv(e,r.orientation,r.mirror)},(e,t)=>t],(e,t,r,n)=>{if(null!=t){var i=null==r?void 0:r[n];return null==i?{x:0,y:e.top}:{x:i,y:e.top}}}),jw=hf(ff,v9,(e,t)=>({width:"number"==typeof t.width?t.width:60,height:e.height})),jN=(e,t,r)=>{switch(t){case"xAxis":return jy(e,r).width;case"yAxis":return jw(e,r).height;default:return}},jk=(e,t,r,n)=>{if(null!=r){var{allowDuplicatedCategory:i,type:a,dataKey:s}=r,o=m9(e,n),l=t.map(e=>e.value);if(s&&o&&"category"===a&&i&&pv(l))return l}},jS=hf([fq,bg,br,vV],jk),jO=(e,t,r,n)=>{if(null!=r&&null!=r.dataKey){var{type:i,scale:a}=r;if(m9(e,n)&&("number"===i||"auto"!==a))return t.map(e=>e.value)}},jP=hf([fq,bg,bn,vV],jO);hf([fq,(e,t,r)=>{switch(t){case"xAxis":return v6(e,r);case"yAxis":return v9(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},b3,ju,jS,jP,jo,b7,vV],(e,t,r,n,i,a,s,o,l)=>{if(null!=t){var c=m9(e,l);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:l,categoricalDomain:a,duplicateDomain:i,isCategorical:c,niceTicks:o,range:s,realScaleType:r,scale:n}}});var jC=hf([fq,bn,b3,ju,b7,jo,jS,jP,vV],(e,t,r,n,i,a,s,o,l)=>{if(null!=t&&null!=n){var c=m9(e,l),{type:u,ticks:d,tickCount:h}=t,p="scaleBand"===r&&"function"==typeof n.bandwidth?n.bandwidth()/2:2,m="category"===u&&n.bandwidth?n.bandwidth()/p:0;m="angleAxis"===l&&null!=a&&a.length>=2?2*pd(a[0]-a[1])*m:m;var f=d||i;return f?f.map((e,t)=>{var r=s?s.indexOf(e):e,i=n.map(r);return m4(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(pw):c&&o?o.map((e,t)=>{var r=n.map(e);return m4(r)?{coordinate:r+m,value:e,index:t,offset:m}:null}).filter(pw):n.ticks?n.ticks(h).map((e,t)=>{var r=n.map(e);return m4(r)?{coordinate:r+m,value:e,index:t,offset:m}:null}).filter(pw):n.domain().map((e,t)=>{var r=n.map(e);return m4(r)?{coordinate:r+m,value:s?s[e]:e,index:t,offset:m}:null}).filter(pw)}}),jA=hf([fq,bn,ju,jo,jS,jP,vV],(e,t,r,n,i,a,s)=>{if(null!=t&&null!=r&&null!=n&&n[0]!==n[1]){var o=m9(e,s),{tickCount:l}=t,c=0;return(c="angleAxis"===s&&(null==n?void 0:n.length)>=2?2*pd(n[0]-n[1])*c:c,o&&a)?a.map((e,t)=>{var n=r.map(e);return m4(n)?{coordinate:n+c,value:e,index:t,offset:c}:null}).filter(pw):r.ticks?r.ticks(l).map((e,t)=>{var n=r.map(e);return m4(n)?{coordinate:n+c,value:e,index:t,offset:c}:null}).filter(pw):r.domain().map((e,t)=>{var n=r.map(e);return m4(n)?{coordinate:n+c,value:i?i[e]:e,index:t,offset:c}:null}).filter(pw)}}),jE=hf(br,ju,(e,t)=>{if(null!=e&&null!=t)return v2(v2({},e),{},{scale:t})}),jM=hf([br,b3,b5,jl],b6);hf((e,t,r)=>bt(e,r),jM,(e,t)=>{if(null!=e&&null!=t)return v2(v2({},e),{},{scale:t})});var jT=hf([fq,fd,fh],(e,t,r)=>{switch(e){case"horizontal":return t.some(e=>e.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(e=>e.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),j_=e=>e.options.defaultTooltipEventType,jD=e=>e.options.validateTooltipEventTypes;function jI(e,t,r){if(null==e)return t;var n=e?"axis":"item";return null==r?t:r.includes(n)?n:t}function jL(e,t){return jI(t,j_(e),jD(e))}var jz=(e,t)=>{var r,n=Number(t);if(!ph(n)&&null!=t)return n>=0?null==e||null==(r=e[n])?void 0:r.value:void 0};function jR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function jF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jR(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jR(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var j$=(e,t,r,n)=>{if(null==t)return mf;var i,a,s,o=(i=e,a=t,s=r,"axis"===a?"click"===s?i.axisInteraction.click:i.axisInteraction.hover:"click"===s?i.itemInteraction.click:i.itemInteraction.hover);if(null==o)return mf;if(o.active)return o;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&null!=e.syncInteraction.index)return e.syncInteraction;var l=!0===e.settings.active;if(null!=o.index){if(l)return jF(jF({},o),{},{active:!0})}else if(null!=n)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return jF(jF({},mf),{},{coordinate:o.coordinate})},jB=(e,t,r,n)=>{var i=null==e?void 0:e.index;if(null==i)return null;var a=Number(i);if(!m4(a))return i;var s=Infinity;t.length>0&&(s=t.length-1);var o=Math.max(0,Math.min(a,s)),l=t[o];return null==l?String(o):!function(e,t,r){if(null==r||null==t)return!0;var n=m7(e,t);return!(null!=n&&vn(r))||function(e,t){var r=function(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}(e),n=t[0],i=t[1];if(void 0===r)return!1;var a=Math.min(n,i),s=Math.max(n,i);return r>=a&&r<=s}(n,r)}(l,r,n)?null:String(o)},jU=(e,t,r,n,i,a,s)=>{if(null!=a){var o=s[0],l=null==o?void 0:o.getPosition(a);if(null!=l)return l;var c=null==i?void 0:i[Number(a)];if(c)if("horizontal"===r)return{x:c.coordinate,y:(n.top+t)/2};else return{x:(n.left+e)/2,y:c.coordinate}}},jq=(e,t,r,n)=>{if("axis"===t)return e.tooltipItemPayloads;if(0===e.tooltipItemPayloads.length)return[];if(null==(i="hover"===r?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId)&&null!=n){var i,a=e.tooltipItemPayloads[0];return null!=a?[a]:[]}return e.tooltipItemPayloads.filter(e=>{var t;return(null==(t=e.settings)?void 0:t.graphicalItemId)===i})},jV=e=>e.options.tooltipPayloadSearcher,jK=e=>e.tooltip;function jW(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function jH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jW(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jW(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var jY=(e,t,r,n,i,a,s)=>{if(null!=t&&null!=a){var{chartData:o,computedData:l,dataStartIndex:c,dataEndIndex:u}=r;return e.reduce((e,r)=>{var d,h,p,{dataDefinedOnItem:m,settings:f}=r,x=null!=m?m:o,y=Array.isArray(x)?m5(x,c,u):x,g=null!=(d=null==f?void 0:f.dataKey)?d:n,v=null==f?void 0:f.nameKey;return Array.isArray(h=n&&Array.isArray(y)&&!Array.isArray(y[0])&&"axis"===s?function(e,t,r){if(e&&e.length)return e.find(e=>e&&("function"==typeof t?t(e):(0,pl.default)(e,t))===r)}(y,n,i):a(y,t,l,v))?h.forEach(t=>{var r=jH(jH({},f),{},{name:t.name,unit:t.unit,color:void 0,fill:void 0});e.push(fa({tooltipEntrySettings:r,dataKey:t.dataKey,payload:t.payload,value:m7(t.payload,t.dataKey),name:t.name}))}):e.push(fa({tooltipEntrySettings:f,dataKey:g,payload:h,value:m7(h,g),name:null!=(p=m7(h,v))?p:null==f?void 0:f.name})),e},[])}},jQ=hf([bN,bi,vg],b4),jX=hf([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),jG=hf([vG,vZ],ba),jZ=hf([jX,bN,jG],bl,{memoizeOptions:{resultEqualityCheck:vX}}),jJ=hf([jZ],e=>e.filter(vY)),j0=hf([jZ],bp,{memoizeOptions:{resultEqualityCheck:vX}}),j1=hf([j0,ve],bf),j2=hf([jJ,ve,bN],vH),j5=hf([j1,bN,jZ],by),j4=hf([bN],bE),j3=hf([bN],e=>e.allowDataOverflow),j6=hf([j4,j3],va),j8=hf([jZ],e=>e.filter(vY)),j7=hf([j2,j8,vx,vy],bO),j9=hf([j7,ve,vG,j6],bC),we=hf([jZ],bd),wt=hf([j1,bN,we,bD,vG],bL,{memoizeOptions:{resultEqualityCheck:vQ}}),wr=hf([bF,vG,vZ],b$),wn=hf([wr,vG],bW),wi=hf([bU,vG,vZ],b$),wa=hf([wi,vG],bY),ws=hf([bV,vG,vZ],b$),wo=hf([ws,vG],bX),wl=hf([wn,wo,wa],bI),wc=hf([bN,j4,j6,j9,wt,wl,fq,vG],bJ),wu=hf([bN,fq,j1,j5,vx,vG,wc],b2),wd=hf([wu,bN,jQ],b8),wh=hf([bN,wu,wd,vG],b9),wp=e=>{var t=vG(e),r=vZ(e);return jo(e,t,r,!1)},wm=hf([bN,wp],vA),wf=hf([bN,jQ,wh,wm],b6),wx=hf([fq,j5,bN,vG],jk),wy=hf([fq,j5,bN,vG],jO),wg=hf([fq,bN,jQ,wf,wp,wx,wy,vG],(e,t,r,n,i,a,s,o)=>{if(t){var{type:l}=t,c=m9(e,o);if(n){var u="scaleBand"===r&&n.bandwidth?n.bandwidth()/2:2,d="category"===l&&n.bandwidth?n.bandwidth()/u:0;return(d="angleAxis"===o&&null!=i&&(null==i?void 0:i.length)>=2?2*pd(i[0]-i[1])*d:d,c&&s)?s.map((e,t)=>{var r=n.map(e);return m4(r)?{coordinate:r+d,value:e,index:t,offset:d}:null}).filter(pw):n.domain().map((e,t)=>{var r=n.map(e);return m4(r)?{coordinate:r+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(pw)}}}),wv=hf([j_,jD,e=>e.tooltip.settings],(e,t,r)=>jI(r.shared,e,t)),wb=e=>e.tooltip.settings.trigger,wj=e=>e.tooltip.settings.defaultIndex,ww=hf([jK,wv,wb,wj],j$),wN=hf([ww,j1,bk,wu],jB),wk=hf([wg,wN],jz),wS=hf([ww],e=>{if(e)return e.dataKey});hf([ww],e=>{if(e)return e.graphicalItemId});var wO=hf([jK,wv,wb,wj],jq),wP=hf([fo,fl,fq,ff,wg,wj,wO],jU),wC=hf([ww,wP],(e,t)=>null!=e&&e.coordinate?e.coordinate:t),wA=hf([ww],e=>{var t;return null!=(t=null==e?void 0:e.active)&&t}),wE=hf([wO,wN,ve,bk,wk,jV,wv],jY);function wM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function wT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wM(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wM(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}hf([wE],e=>{if(null!=e)return Array.from(new Set(e.map(e=>e.payload).filter(e=>null!=e)))});var w_=(e,t,r,n,i)=>{var a=null!=(d=null==t?void 0:t.length)?d:0;if(a<=1||null==e)return 0;if("angleAxis"===n&&null!=i&&1e-6>=Math.abs(Math.abs(i[1]-i[0])-360))for(var s=0;s<a;s++){var o=s>0?null==(h=r[s-1])?void 0:h.coordinate:null==(p=r[a-1])?void 0:p.coordinate,l=null==(m=r[s])?void 0:m.coordinate,c=s>=a-1?null==(f=r[0])?void 0:f.coordinate:null==(x=r[s+1])?void 0:x.coordinate,u=void 0;if(null!=o&&null!=l&&null!=c)if(pd(l-o)!==pd(c-l)){var d,h,p,m,f,x,y,g=[];if(pd(c-l)===pd(i[1]-i[0])){u=c;var v=l+i[1]-i[0];g[0]=Math.min(v,(v+o)/2),g[1]=Math.max(v,(v+o)/2)}else{u=o;var b=c+i[1]-i[0];g[0]=Math.min(l,(b+l)/2),g[1]=Math.max(l,(b+l)/2)}var j=[Math.min(l,(u+l)/2),Math.max(l,(u+l)/2)];if(e>j[0]&&e<=j[1]||e>=g[0]&&e<=g[1])return null==(y=r[s])?void 0:y.index}else{var w,N=Math.min(o,c),k=Math.max(o,c);if(e>(N+l)/2&&e<=(k+l)/2)return null==(w=r[s])?void 0:w.index}}else if(t)for(var S=0;S<a;S++){var O=t[S];if(null!=O){var P=t[S+1],C=t[S-1];if(0===S&&null!=P&&e<=(O.coordinate+P.coordinate)/2||S===a-1&&null!=C&&e>(O.coordinate+C.coordinate)/2||S>0&&S<a-1&&null!=C&&null!=P&&e>(O.coordinate+C.coordinate)/2&&e<=(O.coordinate+P.coordinate)/2)return O.index}}return -1},wD=(e,t)=>t,wI=(e,t,r)=>r,wL=(e,t,r,n)=>n,wz=hf(wg,e=>(0,mQ.default)(e,e=>e.coordinate)),wR=hf([jK,wD,wI,wL],j$),wF=hf([wR,j1,bk,wu],jB),w$=hf([jK,wD,wI,wL],jq),wB=hf([fo,fl,fq,ff,wg,wL,w$],jU),wU=hf([wR,wB],(e,t)=>{var r;return null!=(r=e.coordinate)?r:t}),wq=hf([wg,wF],jz),wV=hf([w$,wF,ve,bk,wq,jV,wD],jY),wK=hf([wR,wF],(e,t)=>({isActive:e.active&&null!=t,activeIndex:t})),wW=hf([(e,t)=>t,fq,vq,vG,wm,wg,wz,ff],(e,t,r,n,i,a,s,o)=>{if(e&&t&&n&&i&&a){if("horizontal"===t||"vertical"===t){if(!e||!n||!i||!a)return;if(function(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}(e,o)){var l=w_("horizontal"===t?e.chartX:"vertical"===t?e.chartY:void 0,s,a,n,i),c=((e,t,r,n)=>{var i=t.find(e=>e&&e.index===r);if(i){if("horizontal"===e)return{x:i.coordinate,y:n.chartY};if("vertical"===e)return{x:n.chartX,y:i.coordinate}}return{x:0,y:0}})(t,a,l,e);return{activeIndex:String(l),activeCoordinate:c}}return}if(e&&n&&i&&a&&r){var u=((e,t)=>{var r,{chartX:n,chartY:i}=e,{radius:a,angle:s}=((e,t)=>{var{x:r,y:n}=e,{cx:i,cy:a}=t,s=((e,t)=>{var{x:r,y:n}=e,{x:i,y:a}=t;return Math.sqrt((r-i)**2+(n-a)**2)})({x:r,y:n},{x:i,y:a});if(s<=0)return{radius:s,angle:0};var o=Math.acos((r-i)/s);return n>a&&(o=2*Math.PI-o),{radius:s,angle:180*o/Math.PI,angleInRadian:o}})({x:n,y:i},t),{innerRadius:o,outerRadius:l}=t;if(a<o||a>l||0===a)return null;var{startAngle:c,endAngle:u}=(e=>{var{startAngle:t,endAngle:r}=e,n=Math.min(Math.floor(t/360),Math.floor(r/360));return{startAngle:t-360*n,endAngle:r-360*n}})(t),d=s;if(c<=u){for(;d>u;)d-=360;for(;d<c;)d+=360;r=d>=c&&d<=u}else{for(;d>c;)d-=360;for(;d<u;)d+=360;r=d>=u&&d<=c}return r?vN(vN({},t),{},{radius:a,angle:((e,t)=>{var{startAngle:r,endAngle:n}=t;return e+360*Math.min(Math.floor(r/360),Math.floor(n/360))})(d,t)}):null})(e,r);if(u){var d=w_("centric"===t?u.angle:u.radius,s,a,n,i),h=((e,t,r,n)=>{var i=t.find(e=>e&&e.index===r);if(i){if("centric"===e){var a=i.coordinate,{radius:s}=n;return wT(wT(wT({},n),vS(n.cx,n.cy,s,a)),{},{angle:a,radius:s})}var o=i.coordinate,{angle:l}=n;return wT(wT(wT({},n),vS(n.cx,n.cy,o,l)),{},{angle:l,radius:o})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}})(t,a,d,u);return{activeIndex:String(d),activeCoordinate:h}}return}}}),wH=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},wY=hC("mouseClick"),wQ=ps();wQ.startListening({actionCreator:wY,effect:(e,t)=>{var r=e.payload,n=wW(t.getState(),wH(r));(null==n?void 0:n.activeIndex)!=null&&t.dispatch(mO({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var wX=hC("mouseMove"),wG=ps(),wZ=null;function wJ(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":"children"===e&&"object"==typeof t&&null!==t?"<<CHILDREN>>":t}function w0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w1(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w0(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w0(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}wG.startListening({actionCreator:wX,effect:(e,t)=>{var r=e.payload;null!==wZ&&cancelAnimationFrame(wZ);var n=wH(r);wZ=requestAnimationFrame(()=>{var e=t.getState();if("axis"===jL(e,e.tooltip.settings.shared)){var r=wW(e,n);(null==r?void 0:r.activeIndex)!=null?t.dispatch(mS({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate})):t.dispatch(mN())}wZ=null})}});var w2=hF({name:"cartesianAxis",initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:h_()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;void 0!==e.xAxis[r.id]&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:h_()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:h_()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:h_()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;void 0!==e.yAxis[r.id]&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:h_()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:h_()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:h_()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;void 0!==e.zAxis[r.id]&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:h_()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:h_()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,i=e.yAxis[r];if(i){var a,s=i.widthHistory||[];if(3===s.length&&s[0]===s[2]&&n===s[1]&&n!==i.width&&1>=Math.abs(n-(null!=(a=s[0])?a:0)))return;var o=[...s,n].slice(-3);e.yAxis[r]=w1(w1({},i),{},{width:n,widthHistory:o})}}}}),{addXAxis:w5,replaceXAxis:w4,removeXAxis:w3,addYAxis:w6,replaceYAxis:w8,removeYAxis:w7,addZAxis:w9,replaceZAxis:Ne,removeZAxis:Nt,updateYAxisWidth:Nr}=w2.actions,Nn=w2.reducer,Ni=hF({name:"graphicalItems",initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:h_()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=d6(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:h_()},removeCartesianGraphicalItem:{reducer(e,t){var r=d6(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:h_()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:h_()},removePolarGraphicalItem:{reducer(e,t){var r=d6(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:h_()}}}),{addCartesianGraphicalItem:Na,replaceCartesianGraphicalItem:Ns,removeCartesianGraphicalItem:No,addPolarGraphicalItem:Nl,removePolarGraphicalItem:Nc}=Ni.actions,Nu=Ni.reducer,Nd=hF({name:"referenceElements",initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=d6(e).dots.findIndex(e=>e===t.payload);-1!==r&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=d6(e).areas.findIndex(e=>e===t.payload);-1!==r&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=d6(e).lines.findIndex(e=>e===t.payload);-1!==r&&e.lines.splice(r,1)}}}),{addDot:Nh,removeDot:Np,addArea:Nm,removeArea:Nf,addLine:Nx,removeLine:Ny}=Nd.actions,Ng=Nd.reducer,Nv={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Nb=hF({name:"brush",initialState:Nv,reducers:{setBrushSettings:(e,t)=>null==t.payload?Nv:t.payload}}),{setBrushSettings:Nj}=Nb.actions,Nw=Nb.reducer,NN=hF({name:"legend",initialState:{settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:h_()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,i=d6(e).payload.indexOf(r);i>-1&&(e.payload[i]=n)},prepare:h_()},removeLegendPayload:{reducer(e,t){var r=d6(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:h_()}}}),{setLegendSize:Nk,setLegendSettings:NS,addLegendPayload:NO,replaceLegendPayload:NP,removeLegendPayload:NC}=NN.actions,NA=NN.reducer,NE={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},NM=hF({name:"rootProps",initialState:NE,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=null!=(r=t.payload.barGap)?r:NE.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),NT=NM.reducer,{updateOptions:N_}=NM.actions,ND=hF({name:"polarAxis",initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:NI,removeRadiusAxis:NL,addAngleAxis:Nz,removeAngleAxis:NR}=ND.actions,NF=ND.reducer,N$=hF({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:NB}=N$.actions,NU=N$.reducer,Nq=hC("keyDown"),NV=hC("focus"),NK=ps();NK.startListening({actionCreator:Nq,effect:(e,t)=>{var r=t.getState();if(!1===r.rootProps.accessibilityLayer)return;var{keyboardInteraction:n}=r.tooltip,i=e.payload;if("ArrowRight"===i||"ArrowLeft"===i||"Enter"===i){var a=jB(n,j1(r),bk(r),wu(r)),s=null==a?-1:Number(a);if(Number.isFinite(s)&&!(s<0)){var o=wg(r);if("Enter"===i){var l=wB(r,"axis","hover",String(n.index));t.dispatch(mC({active:!n.active,activeIndex:n.index,activeCoordinate:l}));return}var c=s+("ArrowRight"===i?1:-1)*("left-to-right"===jT(r)?1:-1);if(null!=o&&!(c>=o.length)&&!(c<0)){var u=wB(r,"axis","hover",String(c));t.dispatch(mC({active:!0,activeIndex:c.toString(),activeCoordinate:u}))}}}}}),NK.startListening({actionCreator:NV,effect:(e,t)=>{var r=t.getState();if(!1!==r.rootProps.accessibilityLayer){var{keyboardInteraction:n}=r.tooltip;if(!n.active&&null==n.index){var i=wB(r,"axis","hover",String("0"));t.dispatch(mC({active:!0,activeIndex:"0",activeCoordinate:i}))}}}});var NW=hC("externalEvent"),NH=ps(),NY=new Map;NH.startListening({actionCreator:NW,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(null!=r){n.persist();var i=n.type,a=NY.get(i);void 0!==a&&cancelAnimationFrame(a);var s=requestAnimationFrame(()=>{try{var e=t.getState(),a={activeCoordinate:wC(e),activeDataKey:wS(e),activeIndex:wN(e),activeLabel:wk(e),activeTooltipIndex:wN(e),isTooltipActive:wA(e)};r(a,n)}finally{NY.delete(i)}});NY.set(i,s)}}});var NQ=hf([jK],e=>e.tooltipItemPayloads),NX=hf([NQ,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(null!=t){var n=e.find(e=>e.settings.graphicalItemId===r);if(null!=n){var{getPosition:i}=n;if(null!=i)return i(t)}}}),NG=hC("touchMove"),NZ=ps();NZ.startListening({actionCreator:NG,effect:(e,t)=>{var r=e.payload;if(null!=r.touches&&0!==r.touches.length){var n=t.getState(),i=jL(n,n.tooltip.settings.shared);if("axis"===i){var a=r.touches[0];if(null==a)return;var s=wW(n,wH({clientX:a.clientX,clientY:a.clientY,currentTarget:r.currentTarget}));(null==s?void 0:s.activeIndex)!=null&&t.dispatch(mS({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate}))}else if("item"===i){var o,l=r.touches[0];if(null==document.elementFromPoint||null==l)return;var c=document.elementFromPoint(l.clientX,l.clientY);if(!c||!c.getAttribute)return;var u=c.getAttribute("data-recharts-item-index"),d=null!=(o=c.getAttribute("data-recharts-item-id"))?o:void 0,h=jZ(n).find(e=>e.id===d);if(null==u||null==h||null==d)return;var{dataKey:p}=h,m=NX(n,u,d);t.dispatch(mj({activeDataKey:p,activeIndex:u,activeCoordinate:m,activeGraphicalItemId:d}))}}}});var NJ=hF({name:"errorBars",initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(e=>e.dataKey===n.dataKey&&e.direction===n.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(e=>e.dataKey!==n.dataKey||e.direction!==n.direction))}}}),{addErrorBar:N0,replaceErrorBar:N1,removeErrorBar:N2}=NJ.actions,N5=NJ.reducer,N4={devToolsEnabled:!0,isSsr:!("u">typeof window&&window.document&&window.document.createElement&&window.setTimeout)};function N3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function N6(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N3(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N3(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var N8={zIndexMap:Object.values(vO).reduce((e,t)=>N6(N6({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},N7=new Set(Object.values(vO)),N9=hF({name:"zIndex",initialState:N8,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:h_()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!N7.has(r)&&delete e.zIndexMap[r])},prepare:h_()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:i}=t.payload;e.zIndexMap[r]?i?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:i?void 0:n,panoramaElement:i?n:void 0}},prepare:h_()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:h_()}}}),{registerZIndexPortal:ke,unregisterZIndexPortal:kt,registerZIndexPortalElement:kr,unregisterZIndexPortalElement:kn}=N9.actions,ki=hw({brush:Nw,cartesianAxis:Nn,chartData:mD,errorBars:N5,graphicalItems:Nu,layout:m$,legend:NA,options:pO,polarAxis:NF,polarOptions:NU,referenceElements:Ng,rootProps:NT,tooltip:mA,zIndex:N9.reducer}),ka=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Chart";return function(e){let t,r,n,i=function(e){let{thunk:t=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:i=!0}=e??{},a=new hA;return t&&("boolean"==typeof t?a.push(hO):a.push(hS(t.extraArgument))),a},{reducer:a,middleware:s,devTools:o=!0,duplicateMiddlewareCheck:l=!0,preloadedState:c,enhancers:u}=e||{};if("function"==typeof a)t=a;else if(hj(a))t=hw(a);else throw Error(po(1));r="function"==typeof s?s(i):i();let d=hN;o&&(d=hP({trace:!1,..."object"==typeof o&&o}));let h=(n=function(...e){return t=>(r,n)=>{let i=t(r,n),a=()=>{throw Error(hy(15))},s={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=hN(...e.map(e=>e(s)))(i.dispatch),{...i,dispatch:a}}}(...r),function(e){let{autoBatch:t=!0}=e??{},r=new hA(n);return t&&r.push(hI("object"==typeof t?t:void 0)),r});return function e(t,r,n){if("function"!=typeof t)throw Error(hy(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(hy(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(hy(1));return n(e)(t,r)}let i=t,a=r,s=new Map,o=s,l=0,c=!1;function u(){o===s&&(o=new Map,s.forEach((e,t)=>{o.set(t,e)}))}function d(){if(c)throw Error(hy(3));return a}function h(e){if("function"!=typeof e)throw Error(hy(4));if(c)throw Error(hy(5));let t=!0;u();let r=l++;return o.set(r,e),function(){if(t){if(c)throw Error(hy(6));t=!1,u(),o.delete(r),s=null}}}function p(e){if(!hj(e))throw Error(hy(7));if(void 0===e.type)throw Error(hy(8));if("string"!=typeof e.type)throw Error(hy(17));if(c)throw Error(hy(9));try{c=!0,a=i(a,e)}finally{c=!1}return(s=o).forEach(e=>{e()}),e}return p({type:hb.INIT}),{dispatch:p,subscribe:h,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw Error(hy(10));i=e,p({type:hb.REPLACE})},[hg]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(hy(11));function t(){e.next&&e.next(d())}return t(),{unsubscribe:h(t)}},[hg](){return this}}}}}(t,c,d(..."function"==typeof u?u(h):h()))}({reducer:ki,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes("es6")}).concat([wQ.middleware,wG.middleware,NK.middleware,NH.middleware,NZ.middleware]),enhancers:e=>{var t=e;return"function"==typeof e&&(t=e()),t.concat(hI({type:"raf"}))},devTools:N4.devToolsEnabled&&{serialize:{replacer:wJ},name:"recharts-".concat(t)}})};function ks(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=fv(),a=(0,H.useRef)(null);return i?r:(null==a.current&&(a.current=ka(t,n)),H.createElement(pL,{context:mU,store:a.current},r))}var ko=e=>{var{chartData:t}=e,r=mV(),n=fv();return(0,H.useEffect)(()=>n?()=>{}:(r(mM(t)),()=>{r(mM(void 0))}),[t,r,n]),null},kl=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function kc(e,t){for(var r of new Set([...Object.keys(e),...Object.keys(t)]))if(kl.has(r)){if(null==e[r]&&null==t[r])continue;if(!function(e,t){if(pT(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!pT(e[r[n]],t[r[n]]))return!1;return!0}(e[r],t[r]))return!1}else{var n,i;if(n=e[r],i=t[r],(null!=n||null!=i)&&("number"==typeof n&&"number"==typeof i?n!==i&&(n==n||i==i):n!==i))return!1}return!0}var ku=(0,H.memo)(function(e){var{layout:t,margin:r}=e,n=mV(),i=fv();return(0,H.useEffect)(()=>{i||(n(mz(t)),n(mL(r)))},[n,i,t,r]),null},kc);function kd(e){var t=mV();return(0,H.useEffect)(()=>{t(N_(e))},[t,e]),null}var kh=()=>{var e;return null==(e=mY(e=>e.rootProps.accessibilityLayer))||e},kp=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function km(e){return"string"==typeof e&&kp.includes(e)}var kf=new Set(["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"]);function kx(e){return"string"==typeof e&&kf.has(e)}function ky(e){return"string"==typeof e&&e.startsWith("data-")}function kg(e){if("object"!=typeof e||null===e)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(kx(r)||ky(r))&&(t[r]=e[r]);return t}function kv(e){return null==e?null:(0,H.isValidElement)(e)&&"object"==typeof e.props&&null!==e.props?kg(e.props):"object"!=typeof e||Array.isArray(e)?null:kg(e)}function kb(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(kx(r)||ky(r)||km(r))&&(t[r]=e[r]);return t}var kj=["children","width","height","viewBox","className","style","title","desc"];function kw(){return(kw=Object.assign.bind()).apply(null,arguments)}var kN=(0,H.forwardRef)((e,t)=>{var{children:r,width:n,height:i,viewBox:a,className:s,style:o,title:l,desc:c}=e,u=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,kj),d=a||{width:n,height:i,x:0,y:0},h=sb("recharts-surface",s);return H.createElement("svg",kw({},kb(u),{className:h,width:n,height:i,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),H.createElement("title",null,l),H.createElement("desc",null,c),r)}),kk=hf(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(null!=t){var n=e[t];if(null!=n)return r?n.panoramaElement:n.element}}),kS=hf(e=>e.zIndex.zIndexMap,e=>Array.from(new Set(Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(vO)))).sort((e,t)=>e-t),{memoizeOptions:{resultEqualityCheck:function(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}}});function kO(e){var{zIndex:t,isPanorama:r}=e,n=(0,H.useRef)(null),i=mV();return(0,H.useLayoutEffect)(()=>(n.current&&i(kr({zIndex:t,element:n.current,isPanorama:r})),()=>{i(kn({zIndex:t,isPanorama:r}))}),[i,t,r]),H.createElement("g",{tabIndex:-1,ref:n})}function kP(e){var{children:t,isPanorama:r}=e,n=mY(kS);if(!n||0===n.length)return t;var i=n.filter(e=>e<0),a=n.filter(e=>e>0);return H.createElement(H.Fragment,null,i.map(e=>H.createElement(kO,{key:e,zIndex:e,isPanorama:r})),t,a.map(e=>H.createElement(kO,{key:e,zIndex:e,isPanorama:r})))}var kC=["children"];function kA(){return(kA=Object.assign.bind()).apply(null,arguments)}var kE={width:"100%",height:"100%",display:"block"},kM=(0,H.forwardRef)((e,t)=>{var r,n,i=mY(fo),a=mY(fl),s=kh();if(!m3(i)||!m3(a))return null;var{children:o,otherAttributes:l,title:c,desc:u}=e;return null!=l&&(r="number"==typeof l.tabIndex?l.tabIndex:s?0:void 0,n="string"==typeof l.role?l.role:s?"application":void 0),H.createElement(kN,kA({},l,{title:c,desc:u,role:n,tabIndex:r,width:i,height:a,style:kE,ref:t}),o)}),kT=e=>{var{children:t}=e,r=mY(fj);if(!r)return null;var{width:n,height:i,y:a,x:s}=r;return H.createElement(kN,{width:n,height:i,x:s,y:a},t)},k_=(0,H.forwardRef)((e,t)=>{var{children:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,kC);return fv()?H.createElement(kT,null,H.createElement(kP,{isPanorama:!0},r)):H.createElement(kM,kA({ref:t},n),H.createElement(kP,{isPanorama:!1},r))}),kD=new(e.i(236)).default,kI="recharts.syncEvent.tooltip",kL="recharts.syncEvent.brush";function kz(e){return e.tooltip.syncInteraction}var kR=["x","y"];function kF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function k$(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kF(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kF(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var kB=(0,H.createContext)(null),kU=(0,H.createContext)(null);function kq(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function kV(){return(kV=Object.assign.bind()).apply(null,arguments)}var kK=()=>{var e,t,r,n,i,a,s,o,l,c,u,d;return e=mV(),(0,H.useEffect)(()=>{e(pP())},[e]),t=mY(vv),r=mY(vj),n=mV(),i=mY(vb),a=mY(wg),s=mY(fq),o=fB(),l=mY(e=>e.rootProps.className),(0,H.useEffect)(()=>{if(null==t)return pN;var e=(e,l,c)=>{if(r!==c&&t===e){if("index"===i){if(o&&null!=l&&null!=(u=l.payload)&&u.coordinate&&l.payload.sourceViewBox){var u,d,h=l.payload.coordinate,{x:p,y:m}=h,f=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(h,kR),{x:x,y:y,width:g,height:v}=l.payload.sourceViewBox,b=k$(k$({},f),{},{x:o.x+(g?(p-x)/g:0)*o.width,y:o.y+(v?(m-y)/v:0)*o.height});n(k$(k$({},l),{},{payload:k$(k$({},l.payload),{},{coordinate:b})}))}else n(l);return}if(null!=a){if("function"==typeof i){var j=i(a,{activeTooltipIndex:null==l.payload.index?void 0:Number(l.payload.index),isTooltipActive:l.payload.active,activeIndex:null==l.payload.index?void 0:Number(l.payload.index),activeLabel:l.payload.label,activeDataKey:l.payload.dataKey,activeCoordinate:l.payload.coordinate});d=a[j]}else"value"===i&&(d=a.find(e=>String(e.value)===l.payload.label));var{coordinate:w}=l.payload;if(null==d||!1===l.payload.active||null==w||null==o)return void n(mP({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));var{x:N,y:k}=w,S=Math.min(N,o.x+o.width),O=Math.min(k,o.y+o.height),P={x:"horizontal"===s?d.coordinate:S,y:"horizontal"===s?O:d.coordinate};n(mP({active:l.payload.active,coordinate:P,dataKey:l.payload.dataKey,index:String(d.index),label:l.payload.label,sourceViewBox:l.payload.sourceViewBox,graphicalItemId:l.payload.graphicalItemId}))}}};return kD.on(kI,e),()=>{kD.off(kI,e)}},[l,n,r,t,i,a,s,o]),c=mY(vv),u=mY(vj),d=mV(),(0,H.useEffect)(()=>{if(null==c)return pN;var e=(e,t,r)=>{u!==r&&c===e&&d(mT(t))};return kD.on(kL,e),()=>{kD.off(kL,e)}},[d,u,c]),null};function kW(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var kH=(0,H.forwardRef)((e,t)=>{var r,n,i=(0,H.useRef)(null),[a,s]=(0,H.useState)({containerWidth:kW(null==(r=e.style)?void 0:r.width),containerHeight:kW(null==(n=e.style)?void 0:n.height)}),o=(0,H.useCallback)((e,t)=>{s(r=>{var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}})},[]),l=(0,H.useCallback)(e=>{if("function"==typeof t&&t(e),null!=e&&"u">typeof ResizeObserver){var{width:r,height:n}=e.getBoundingClientRect();o(r,n);var a=new ResizeObserver(e=>{var t=e[0];if(null!=t){var{width:r,height:n}=t.contentRect;o(r,n)}});a.observe(e),i.current=a}},[t,o]);return(0,H.useEffect)(()=>()=>{var e=i.current;null!=e&&e.disconnect()},[o]),H.createElement(H.Fragment,null,H.createElement(fW,{width:a.containerWidth,height:a.containerHeight}),H.createElement("div",kV({ref:l},e)))}),kY=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e,[i,a]=(0,H.useState)({containerWidth:kW(r),containerHeight:kW(n)}),s=(0,H.useCallback)((e,t)=>{a(r=>{var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}})},[]),o=(0,H.useCallback)(e=>{if("function"==typeof t&&t(e),null!=e){var{width:r,height:n}=e.getBoundingClientRect();s(r,n)}},[t,s]);return H.createElement(H.Fragment,null,H.createElement(fW,{width:i.containerWidth,height:i.containerHeight}),H.createElement("div",kV({ref:o},e)))}),kQ=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e;return H.createElement(H.Fragment,null,H.createElement(fW,{width:r,height:n}),H.createElement("div",kV({ref:t},e)))}),kX=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e;return"string"==typeof r||"string"==typeof n?H.createElement(kY,kV({},e,{ref:t})):"number"==typeof r&&"number"==typeof n?H.createElement(kQ,kV({},e,{width:r,height:n,ref:t})):H.createElement(H.Fragment,null,H.createElement(fW,{width:r,height:n}),H.createElement("div",kV({ref:t},e)))}),kG=(0,H.forwardRef)((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:s,onDoubleClick:o,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:d,onMouseUp:h,onTouchEnd:p,onTouchMove:m,onTouchStart:f,style:x,width:y,responsive:g,dispatchTouchEvents:v=!0}=e,b=(0,H.useRef)(null),j=mV(),[w,N]=(0,H.useState)(null),[k,S]=(0,H.useState)(null),O=function(){var e=mV(),[t,r]=(0,H.useState)(null),n=mY(fc);return(0,H.useEffect)(()=>{if(null!=t){var r=t.getBoundingClientRect().width/t.offsetWidth;m4(r)&&r!==n&&e(mF(r))}},[t,e,n]),r}(),P=fz(),C=(null==P?void 0:P.width)>0?P.width:y,A=(null==P?void 0:P.height)>0?P.height:i,E=(0,H.useCallback)(e=>{O(e),"function"==typeof t&&t(e),N(e),S(e),null!=e&&(b.current=e)},[O,t,N,S]),M=(0,H.useCallback)(e=>{j(wY(e)),j(NW({handler:a,reactEvent:e}))},[j,a]),T=(0,H.useCallback)(e=>{j(wX(e)),j(NW({handler:c,reactEvent:e}))},[j,c]),_=(0,H.useCallback)(e=>{j(mN()),j(NW({handler:u,reactEvent:e}))},[j,u]),D=(0,H.useCallback)(e=>{j(wX(e)),j(NW({handler:d,reactEvent:e}))},[j,d]),I=(0,H.useCallback)(()=>{j(NV())},[j]),L=(0,H.useCallback)(e=>{j(Nq(e.key))},[j]),z=(0,H.useCallback)(e=>{j(NW({handler:s,reactEvent:e}))},[j,s]),R=(0,H.useCallback)(e=>{j(NW({handler:o,reactEvent:e}))},[j,o]),F=(0,H.useCallback)(e=>{j(NW({handler:l,reactEvent:e}))},[j,l]),$=(0,H.useCallback)(e=>{j(NW({handler:h,reactEvent:e}))},[j,h]),B=(0,H.useCallback)(e=>{j(NW({handler:f,reactEvent:e}))},[j,f]),U=(0,H.useCallback)(e=>{v&&j(NG(e)),j(NW({handler:m,reactEvent:e}))},[j,v,m]),q=(0,H.useCallback)(e=>{j(NW({handler:p,reactEvent:e}))},[j,p]);return H.createElement(kB.Provider,{value:w},H.createElement(kU.Provider,{value:k},H.createElement(g?kH:kX,{width:null!=C?C:null==x?void 0:x.width,height:null!=A?A:null==x?void 0:x.height,className:sb("recharts-wrapper",n),style:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kq(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kq(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({position:"relative",cursor:"default",width:C,height:A},x),onClick:M,onContextMenu:z,onDoubleClick:R,onFocus:I,onKeyDown:L,onMouseDown:F,onMouseEnter:T,onMouseLeave:_,onMouseMove:D,onMouseUp:$,onTouchEnd:q,onTouchMove:U,onTouchStart:B,ref:E},H.createElement(kK,null),r)))}),kZ=hf([ff],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),kJ=hf([kZ,fo,fl],(e,t,r)=>{if(e&&null!=t&&null!=r)return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),k0=(0,H.createContext)(void 0),k1=e=>{var{children:t}=e,[r]=(0,H.useState)("".concat(py("recharts"),"-clip")),n=mY(kJ);if(null==n)return null;var{x:i,y:a,width:s,height:o}=n;return H.createElement(k0.Provider,{value:r},H.createElement("defs",null,H.createElement("clipPath",{id:r},H.createElement("rect",{x:i,y:a,height:o,width:s}))),t)},k2=["width","height","responsive","children","className","style","compact","title","desc"],k5=(0,H.forwardRef)((e,t)=>{var{width:r,height:n,responsive:i,children:a,className:s,style:o,compact:l,title:c,desc:u}=e,d=kg(function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,k2));return l?H.createElement(H.Fragment,null,H.createElement(fW,{width:r,height:n}),H.createElement(k_,{otherAttributes:d,title:c,desc:u},a)):H.createElement(kG,{className:s,style:o,width:r,height:n,responsive:null!=i&&i,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},H.createElement(k_,{otherAttributes:d,title:c,desc:u,ref:t},H.createElement(k1,null,a)))});function k4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function k3(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k4(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k4(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e);return Object.keys(t).reduce((e,r)=>(void 0===e[r]&&void 0!==t[r]&&(e[r]=t[r]),e),r)}function k6(){return(k6=Object.assign.bind()).apply(null,arguments)}var k8={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},k7=(0,H.forwardRef)(function(e,t){var r,n=k3(e.categoricalChartProps,k8),{chartName:i,defaultTooltipEventType:a,validateTooltipEventTypes:s,tooltipPayloadSearcher:o,categoricalChartProps:l}=e;return H.createElement(ks,{preloadedState:{options:{chartName:i,defaultTooltipEventType:a,validateTooltipEventTypes:s,tooltipPayloadSearcher:o,eventEmitter:void 0}},reduxStoreName:null!=(r=l.id)?r:i},H.createElement(ko,{chartData:l.data}),H.createElement(ku,{layout:n.layout,margin:n.margin}),H.createElement(kd,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),H.createElement(k5,k6({},n,{ref:t})))}),k9=["axis","item"],Se=(0,H.forwardRef)((e,t)=>H.createElement(k7,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:k9,tooltipPayloadSearcher:pk,categoricalChartProps:e,ref:t})),St=H,Sr=["children","className"];function Sn(){return(Sn=Object.assign.bind()).apply(null,arguments)}var Si=H.forwardRef((e,t)=>{var{children:r,className:n}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Sr),a=sb("recharts-layer",n);return H.createElement("g",Sn({className:a},kb(i),{ref:t}),r)}),Sa=e=>null;Sa.displayName="Cell";var Ss=e.i(9944);function So(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var Sl=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?So(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):So(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},{cacheSize:2e3,enableCache:!0}),Sc=new class{constructor(e){!function(e,t,r){var n;(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"cache",new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return void 0!==t&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;null!=r&&this.cache.delete(r)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}}(Sl.cacheSize),Su={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Sd="recharts_measurement_span",Sh=(e,t)=>{try{var r=document.getElementById(Sd);r||((r=document.createElement("span")).setAttribute("id",Sd),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,Su,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch(e){return{width:0,height:0}}},Sp=function(e){var t,r,n,i,a,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||N4.isSsr)return{width:0,height:0};if(!Sl.enableCache)return Sh(e,o);var l=(t=o.fontSize||"",r=o.fontFamily||"",n=o.fontWeight||"",i=o.fontStyle||"",a=o.letterSpacing||"",s=o.textTransform||"","".concat(e,"|").concat(t,"|").concat(r,"|").concat(n,"|").concat(i,"|").concat(a,"|").concat(s)),c=Sc.get(l);if(c)return c;var u=Sh(e,o);return Sc.set(l,u),u},Sm=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Sf=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Sx=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Sy=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Sg={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},Sv=["cm","mm","pt","pc","in","Q","px"];class Sb{static parse(e){var t,[,r,n]=null!=(t=Sy.exec(e))?t:[];return null==r?Sb.NaN:new Sb(parseFloat(r),null!=n?n:"")}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,ph(e)&&(this.unit=""),""===t||Sx.test(t)||(this.num=NaN,this.unit=""),Sv.includes(t)&&(this.num=e*Sg[t],this.unit="px")}add(e){return this.unit!==e.unit?new Sb(NaN,""):new Sb(this.num+e.num,this.unit)}subtract(e){return this.unit!==e.unit?new Sb(NaN,""):new Sb(this.num-e.num,this.unit)}multiply(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new Sb(NaN,""):new Sb(this.num*e.num,this.unit||e.unit)}divide(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new Sb(NaN,""):new Sb(this.num/e.num,this.unit||e.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ph(this.num)}}function Sj(e){if(null==e||e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,a]=null!=(r=Sm.exec(t))?r:[],s=Sb.parse(null!=n?n:""),o=Sb.parse(null!=a?a:""),l="*"===i?s.multiply(o):s.divide(o);if(l.isNaN())return"NaN";t=t.replace(Sm,l.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var c,[,u,d,h]=null!=(c=Sf.exec(t))?c:[],p=Sb.parse(null!=u?u:""),m=Sb.parse(null!=h?h:""),f="+"===d?p.add(m):p.subtract(m);if(f.isNaN())return"NaN";t=t.replace(Sf,f.toString())}return t}h="NaN",p=new Sb(NaN,""),(h="symbol"==typeof(c=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(h,"string"))?c:c+"")in Sb?Object.defineProperty(Sb,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):Sb[h]=p;var Sw=/\(([^()]*)\)/;function SN(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t,r=e;null!=(t=Sw.exec(r));){var[,n]=t;r=r.replace(Sw,Sj(n))}return r}(t),t=Sj(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var Sk=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],SS=["dx","dy","angle","className","breakAll"];function SO(){return(SO=Object.assign.bind()).apply(null,arguments)}function SP(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var SC=/[ \f\n\r\t\v\u2028\u2029]+/,SA=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];null!=t&&(i=r?t.toString().split(""):t.toString().split(SC));var a=i.map(e=>({word:e,width:Sp(e,n).width})),s=r?0:Sp(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch(e){return null}},SE=(e,t,r,n)=>e.reduce((e,i)=>{var{word:a,width:s}=i,o=e[e.length-1];return o&&null!=s&&(null==t||n||o.width+s+r<Number(t))?(o.words.push(a),o.width+=s+r):e.push({words:[a],width:s}),e},[]),SM=e=>e.reduce((e,t)=>e.width>t.width?e:t),ST=(e,t,r,n,i,a,s,o)=>{var l=SA({breakAll:r,style:n,children:e.slice(0,t)+"…"});if(!l)return[!1,[]];var c=SE(l.wordsWithComputedWidth,a,s,o);return[c.length>i||SM(c).width>Number(a),c]},S_=e=>[{words:null==e?[]:e.toString().split(SC),width:void 0}],SD="#808080",SI={angle:0,breakAll:!1,capHeight:"0.71em",fill:SD,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},SL=(0,H.forwardRef)((e,t)=>{var r,n=k3(e,SI),{x:i,y:a,lineHeight:s,capHeight:o,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,h=SP(n,Sk),p=(0,H.useMemo)(()=>(e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:a,maxLines:s}=e;if((t||r)&&!N4.isSsr){var o=SA({breakAll:a,children:n,style:i});if(!o)return S_(n);var{wordsWithComputedWidth:l,spaceWidth:c}=o;return((e,t,r,n,i)=>{var a,{maxLines:s,children:o,style:l,breakAll:c}=e,u=pm(s),d=String(o),h=SE(t,n,r,i);if(!u||i||!(h.length>s||SM(h).width>Number(n)))return h;for(var p=0,m=d.length-1,f=0;p<=m&&f<=d.length-1;){var x=Math.floor((p+m)/2),[y,g]=ST(d,x-1,c,l,s,n,r,i),[v]=ST(d,x,c,l,s,n,r,i);if(y||v||(p=x+1),y&&v&&(m=x-1),!y&&v){a=g;break}f++}return a||h})({breakAll:a,children:n,maxLines:s,style:i},l,c,t,!!r)}return S_(n)})({breakAll:h.breakAll,children:h.children,maxLines:h.maxLines,scaleToFit:c,style:h.style,width:h.width}),[h.breakAll,h.children,h.maxLines,c,h.style,h.width]),{dx:m,dy:f,angle:x,className:y,breakAll:g}=h,v=SP(h,SS);if(!pf(i)||!pf(a)||0===p.length)return null;var b=Number(i)+(pm(m)?m:0),j=Number(a)+(pm(f)?f:0);if(!m4(b)||!m4(j))return null;switch(d){case"start":r=SN("calc(".concat(o,")"));break;case"middle":r=SN("calc(".concat((p.length-1)/2," * -").concat(s," + (").concat(o," / 2))"));break;default:r=SN("calc(".concat(p.length-1," * -").concat(s,")"))}var w=[],N=p[0];if(c&&null!=N){var k=N.width,{width:S}=h;w.push("scale(".concat(pm(S)&&pm(k)?S/k:1,")"))}return x&&w.push("rotate(".concat(x,", ").concat(b,", ").concat(j,")")),w.length&&(v.transform=w.join(" ")),H.createElement("text",SO({},kb(v),{ref:t,x:b,y:j,className:sb("recharts-text",y),textAnchor:u,fill:l.includes("url")?SD:l}),p.map((e,t)=>{var n=e.words.join(g?"":" ");return H.createElement("tspan",{x:b,dy:0===t?r:s,key:"".concat(n,"-").concat(t)},n)}))});SL.displayName="Text";var Sz=e.i(9854);function SR(e){var{zIndex:t,children:r}=e,n=void 0!==mY(fq)&&void 0!==t&&0!==t,i=fv(),a=mV();(0,H.useLayoutEffect)(()=>n?(a(ke({zIndex:t})),()=>{a(kt({zIndex:t}))}):pN,[a,t,n]);var s=mY(e=>kk(e,t,i));return n?s?(0,Sz.createPortal)(r,s):null:r}function SF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function S$(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SF(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SF(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var SB=["labelRef"],SU=["content"];function Sq(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function SV(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function SK(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SV(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SV(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function SW(){return(SW=Object.assign.bind()).apply(null,arguments)}var SH=(0,H.createContext)(null),SY=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:i,width:a,height:s,children:o}=e,l=(0,H.useMemo)(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:a,height:s}),[t,r,n,i,a,s]);return H.createElement(SH.Provider,{value:l},o)},SQ=()=>{var e=(0,H.useContext)(SH),t=fB();return e||(t?f$(t):void 0)},SX=(0,H.createContext)(null),SG=e=>null!=e&&"function"==typeof e,SZ=e=>null!=e&&"cx"in e&&pm(e.cx),SJ={angle:0,offset:5,zIndex:vO.label,position:"middle",textBreakAll:!1};function S0(e){var t,r,n,i,a,s,o=k3(e,SJ),{viewBox:l,parentViewBox:c,position:u,value:d,children:h,content:p,className:m="",textBreakAll:f,labelRef:x}=o,y=(t=(0,H.useContext)(SX),r=mY(vq),t||r),g=SQ(),v=function(e){if(!SZ(e))return e;var{cx:t,cy:r,outerRadius:n}=e,i=2*n;return{x:t-n,y:r-n,width:i,upperWidth:i,lowerWidth:i,height:i}}(i=null==l?"center"===u?g:null!=y?y:g:SZ(l)?l:f$(l));if(!i||null==d&&null==h&&!(0,H.isValidElement)(p)&&"function"!=typeof p)return null;var b=SK(SK({},o),{},{viewBox:i});if((0,H.isValidElement)(p)){var{labelRef:j}=b,w=Sq(b,SB);return(0,H.cloneElement)(p,w)}if("function"==typeof p){var{content:N}=b,k=Sq(b,SU);if(a=(0,H.createElement)(p,k),(0,H.isValidElement)(a))return a}else a=(e=>{var{value:t,formatter:r}=e,n=null==e.children?t:e.children;return"function"==typeof r?r(n):n})(o);var S=kb(o);if(SZ(i)){if("insideStart"===u||"insideEnd"===u||"end"===u)return((e,t,r,n,i)=>{var a,s,{offset:o,className:l}=e,{cx:c,cy:u,innerRadius:d,outerRadius:h,startAngle:p,endAngle:m,clockWise:f}=i,x=(d+h)/2,y=pd(m-p)*Math.min(Math.abs(m-p),360),g=y>=0?1:-1;switch(t){case"insideStart":a=p+g*o,s=f;break;case"insideEnd":a=m-g*o,s=!f;break;case"end":a=m+g*o,s=f;break;default:throw Error("Unsupported position ".concat(t))}s=y<=0?s:!s;var v=vS(c,u,x,a),b=vS(c,u,x,a+(s?1:-1)*359),j="M".concat(v.x,",").concat(v.y,"\n A").concat(x,",").concat(x,",0,1,").concat(+!s,",\n ").concat(b.x,",").concat(b.y),w=null==e.id?py("recharts-radial-line-"):e.id;return H.createElement("text",SW({},n,{dominantBaseline:"central",className:sb("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:w,d:j})),H.createElement("textPath",{xlinkHref:"#".concat(w)},r))})(o,u,a,S,i);s=((e,t,r)=>{var{cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:o,endAngle:l}=e,c=(o+l)/2;if("outside"===r){var{x:u,y:d}=vS(n,i,s+t,c);return{x:u,y:d,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var{x:h,y:p}=vS(n,i,(a+s)/2,c);return{x:h,y:p,textAnchor:"middle",verticalAnchor:"middle"}})(i,o.offset,o.position)}else{if(!v)return null;var O=(e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:i,clamp:a}=e,{x:s,y:o,height:l,upperWidth:c,lowerWidth:u}=f$(t),d=s+(c-u)/2,h=(s+d)/2,p=(c+u)/2,m=l>=0?1:-1,f=m*n,x=m>0?"end":"start",y=m>0?"start":"end",g=c>=0?1:-1,v=g*n,b=g>0?"end":"start",j=g>0?"start":"end";if("top"===r){var w={x:s+c/2,y:o-f,horizontalAnchor:"middle",verticalAnchor:x};return a&&i&&(w.height=Math.max(o-i.y,0),w.width=c),w}if("bottom"===r){var N={x:d+u/2,y:o+l+f,horizontalAnchor:"middle",verticalAnchor:y};return a&&i&&(N.height=Math.max(i.y+i.height-(o+l),0),N.width=u),N}if("left"===r){var k={x:h-v,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"};return a&&i&&(k.width=Math.max(k.x-i.x,0),k.height=l),k}if("right"===r){var S={x:h+p+v,y:o+l/2,horizontalAnchor:j,verticalAnchor:"middle"};return a&&i&&(S.width=Math.max(i.x+i.width-S.x,0),S.height=l),S}var O=a&&i?{width:p,height:l}:{};return"insideLeft"===r?S$({x:h+v,y:o+l/2,horizontalAnchor:j,verticalAnchor:"middle"},O):"insideRight"===r?S$({x:h+p-v,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"},O):"insideTop"===r?S$({x:s+c/2,y:o+f,horizontalAnchor:"middle",verticalAnchor:y},O):"insideBottom"===r?S$({x:d+u/2,y:o+l-f,horizontalAnchor:"middle",verticalAnchor:x},O):"insideTopLeft"===r?S$({x:s+v,y:o+f,horizontalAnchor:j,verticalAnchor:y},O):"insideTopRight"===r?S$({x:s+c-v,y:o+f,horizontalAnchor:b,verticalAnchor:y},O):"insideBottomLeft"===r?S$({x:d+v,y:o+l-f,horizontalAnchor:j,verticalAnchor:x},O):"insideBottomRight"===r?S$({x:d+u-v,y:o+l-f,horizontalAnchor:b,verticalAnchor:x},O):r&&"object"==typeof r&&(pm(r.x)||pp(r.x))&&(pm(r.y)||pp(r.y))?S$({x:s+pg(r.x,p),y:o+pg(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},O):S$({x:s+c/2,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},O)})({viewBox:v,position:u,offset:o.offset,parentViewBox:SZ(c)?void 0:c,clamp:!0});s=SK(SK({x:O.x,y:O.y,textAnchor:O.horizontalAnchor,verticalAnchor:O.verticalAnchor},void 0!==O.width?{width:O.width}:{}),void 0!==O.height?{height:O.height}:{})}return H.createElement(SR,{zIndex:o.zIndex},H.createElement(SL,SW({ref:x,className:sb("recharts-label",m)},S,s,{textAnchor:"start"===(n=S.textAnchor)||"middle"===n||"end"===n||"inherit"===n?S.textAnchor:s.textAnchor,breakAll:f}),a))}function S1(e){var{label:t,labelRef:r}=e;return((e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return!0===e?H.createElement(S0,SW({key:"label-implicit"},n)):pf(e)?H.createElement(S0,SW({key:"label-implicit",value:e},n)):(0,H.isValidElement)(e)?e.type===S0?(0,H.cloneElement)(e,SK({key:"label-implicit"},n)):H.createElement(S0,SW({key:"label-implicit",content:e},n)):SG(e)?H.createElement(S0,SW({key:"label-implicit",content:e},n)):e&&"object"==typeof e?H.createElement(S0,SW({},e,{key:"label-implicit"},n)):null})(t,SQ(),r)||null}S0.displayName="Label";var S2=["valueAccessor"],S5=["dataKey","clockWise","id","textBreakAll","zIndex"];function S4(){return(S4=Object.assign.bind()).apply(null,arguments)}function S3(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var S6=e=>Array.isArray(e.value)?(0,Ss.default)(e.value):e.value,S8=(0,H.createContext)(void 0),S7=S8.Provider,S9=(0,H.createContext)(void 0);function Oe(e){var{valueAccessor:t=S6}=e,r=S3(e,S2),{dataKey:n,clockWise:i,id:a,textBreakAll:s,zIndex:o}=r,l=S3(r,S5),c=(0,H.useContext)(S8),u=(0,H.useContext)(S9),d=c||u;return d&&d.length?H.createElement(SR,{zIndex:null!=o?o:vO.label},H.createElement(Si,{className:"recharts-label-list"},d.map((e,i)=>{var o,c=null==n?t(e,i):m7(e.payload,n),u=null==a?{}:{id:"".concat(a,"-").concat(i)};return H.createElement(S0,S4({key:"label-".concat(i)},kb(e),l,u,{fill:null!=(o=r.fill)?o:e.fill,parentViewBox:e.parentViewBox,value:c,textBreakAll:s,viewBox:e.viewBox,index:i,zIndex:0}))}))):null}function Ot(e){var{label:t}=e;return t?!0===t?H.createElement(Oe,{key:"labelList-implicit"}):H.isValidElement(t)||SG(t)?H.createElement(Oe,{key:"labelList-implicit",content:t}):"object"==typeof t?H.createElement(Oe,S4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}S9.Provider,Oe.displayName="LabelList";var Or=e.i(29095),On=e=>"string"==typeof e?e:e?e.displayName||e.name||"Component":"",Oi=null,Oa=null,Os=e=>{if(e===Oi&&Array.isArray(Oa))return Oa;var t=[];return H.Children.forEach(e,e=>{null!=e&&((0,Or.isFragment)(e)?t=t.concat(Os(e.props.children)):t.push(e))}),Oa=t,Oi=e,t},Oo=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Ol=(e,t,r)=>{if(null===e||"object"!=typeof e&&"function"!=typeof e)return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];km(i)&&"function"==typeof a&&(n||(n={}),n[i]=e=>(a(t,r,e),null))}),n},Oc=e.i(91804);function Ou(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Od(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ou(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Oh=(e,t,r)=>e.map(e=>"".concat(e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))," ").concat(t,"ms ").concat(r)).join(","),Op=(e,t)=>Object.keys(t).reduce((r,n)=>Od(Od({},r),{},{[n]:e(n,t[n])}),{});function Om(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Of(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Om(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Om(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Ox=(e,t,r)=>e+(t-e)*r,Oy=e=>{var{from:t,to:r}=e;return t!==r},Og=(e,t,r)=>{var n=Op((t,r)=>{if(Oy(r)){var[n,i]=e(r.from,r.to,r.velocity);return Of(Of({},r),{},{from:n,velocity:i})}return r},t);return r<1?Op((e,t)=>Oy(t)&&null!=n[e]?Of(Of({},t),{},{velocity:Ox(t.velocity,n[e].velocity,r),from:Ox(t.from,n[e].from,r)}):t,t):Og(e,n,r-1)},Ov=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],Ob=(e,t)=>e.map((e,r)=>e*t**r).reduce((e,t)=>e+t),Oj=(e,t)=>r=>Ob(Ov(e,t),r),Ow=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(1===t.length)switch(t[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:var n=(e=>{var t,r=e.split("(");if(2!==r.length||"cubic-bezier"!==r[0])return null;var n=null==(t=r[1])||null==(t=t.split(")")[0])?void 0:t.split(",");if(null==n||4!==n.length)return null;var i=n.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]})(t[0]);if(n)return n}return 4===t.length?t:[0,0,1,1]},ON=function(){return((e,t,r,n)=>{var i=Oj(e,r),a=Oj(t,n),s=t=>Ob([...Ov(e,r).map((e,t)=>e*t).slice(1),0],t),o=e=>e>1?1:e<0?0:e,l=e=>{for(var t=e>1?1:e,r=t,n=0;n<8;++n){var l=i(r)-t,c=s(r);if(1e-4>Math.abs(l-t)||c<1e-4)break;r=o(r-l/c)}return a(r)};return l.isStepper=!1,l})(...Ow(...arguments))},Ok=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{stiff:t=100,damping:r=8,dt:n=17}=e,i=(e,i,a)=>{var s=a+(-(e-i)*t-a*r)*n/1e3,o=a*n/1e3+e;return 1e-4>Math.abs(o-i)&&1e-4>Math.abs(s)?[i,0]:[o,s]};return i.isStepper=!0,i.dt=n,i};class OS{setTimeout(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=performance.now(),n=null,i=a=>{a-r>=t?e(a):"function"==typeof requestAnimationFrame&&(n=requestAnimationFrame(i))};return n=requestAnimationFrame(i),()=>{null!=n&&cancelAnimationFrame(n)}}}var OO=(0,H.createContext)(function(){var e,t,r,n,i;return e=new OS,t=()=>null,r=!1,n=null,i=a=>{if(!r){if(Array.isArray(a)){if(!a.length)return;var[s,...o]=a;if("number"==typeof s){n=e.setTimeout(i.bind(null,o),s);return}i(s),n=e.setTimeout(i.bind(null,o));return}"string"==typeof a&&t(a),"object"==typeof a&&t(a),"function"==typeof a&&a()}},{stop:()=>{r=!0},start:e=>{r=!1,n&&(n(),n=null),i(e)},subscribe:e=>(t=e,()=>{t=()=>null}),getTimeoutController:()=>e}}),OP={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},OC={t:0},OA={t:1};function OE(e){var t,r,n,i=k3(e,OP),{isActive:a,canBegin:s,duration:o,easing:l,begin:c,onAnimationEnd:u,onAnimationStart:d,children:h}=i,p="auto"===a?!N4.isSsr:a,m=(t=i.animationId,r=i.animationManager,n=(0,H.useContext)(OO),(0,H.useMemo)(()=>null!=r?r:n(t),[t,r,n])),[f,x]=(0,H.useState)(p?OC:OA),y=(0,H.useRef)(null);return(0,H.useEffect)(()=>{p||x(OA)},[p]),(0,H.useEffect)(()=>{if(!p||!s)return pN;var e=((e,t,r,n,i,a)=>{var s,o,l,c,u,d,h,p,m=[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e)));return null==r?()=>(i(Of(Of({},e),t)),()=>{}):!0===r.isStepper?(o=m.reduce((r,n)=>Of(Of({},r),{},{[n]:{from:e[n],velocity:0,to:t[n]}}),{}),l=null,c=n=>{s||(s=n);var u=(n-s)/r.dt;o=Og(r,o,u),i(Of(Of(Of({},e),t),Op((e,t)=>t.from,o))),s=n,Object.values(o).filter(Oy).length&&(l=a.setTimeout(c))},()=>(l=a.setTimeout(c),()=>{var e;null==(e=l)||e()})):(d=null,h=m.reduce((r,n)=>{var i=e[n],a=t[n];return null==i||null==a?r:Of(Of({},r),{},{[n]:[i,a]})},{}),p=s=>{u||(u=s);var o=(s-u)/n,l=Op((e,t)=>Ox(...t,r(o)),h);if(i(Of(Of(Of({},e),t),l)),o<1)d=a.setTimeout(p);else{var c=Op((e,t)=>Ox(...t,r(1)),h);i(Of(Of(Of({},e),t),c))}},()=>(d=a.setTimeout(p),()=>{var e;null==(e=d)||e()}))})(OC,OA,(e=>{if("string"==typeof e)switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return ON(e);case"spring":return Ok();default:if("cubic-bezier"===e.split("(")[0])return ON(e)}return"function"==typeof e?e:null})(l),o,x,m.getTimeoutController());return m.start([d,c,()=>{y.current=e()},o,u]),()=>{m.stop(),y.current&&y.current(),u()}},[p,s,o,l,c,d,u,m]),h(f.t)}function OM(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"animation-",r=(0,H.useRef)(py(t)),n=(0,H.useRef)(e);return n.current!==e&&(r.current=py(t),n.current=e),r.current}var OT=["radius"],O_=["radius"];function OD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function OI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OD(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OD(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function OL(){return(OL=Object.assign.bind()).apply(null,arguments)}function Oz(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function OR(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var OF=(e,t,r,n,i)=>{var a=pc(r),s=pc(n),o=Math.min(Math.abs(a)/2,Math.abs(s)/2),l=s>=0?1:-1,c=a>=0?1:-1,u=+(s>=0&&a>=0||s<0&&a<0);if(o>0&&Array.isArray(i)){for(var d=[0,0,0,0],h=0;h<4;h++){var p,m,f=null!=(m=i[h])?m:0;d[h]=f>o?o:f}p=pu(N||(N=OR(["M",",",""])),e,t+l*d[0]),d[0]>0&&(p+=pu(k||(k=OR(["A ",",",",0,0,",",",",",""])),d[0],d[0],u,e+c*d[0],t)),p+=pu(S||(S=OR(["L ",",",""])),e+r-c*d[1],t),d[1]>0&&(p+=pu(O||(O=OR(["A ",",",",0,0,",",\n ",",",""])),d[1],d[1],u,e+r,t+l*d[1])),p+=pu(P||(P=OR(["L ",",",""])),e+r,t+n-l*d[2]),d[2]>0&&(p+=pu(C||(C=OR(["A ",",",",0,0,",",\n ",",",""])),d[2],d[2],u,e+r-c*d[2],t+n)),p+=pu(A||(A=OR(["L ",",",""])),e+c*d[3],t+n),d[3]>0&&(p+=pu(E||(E=OR(["A ",",",",0,0,",",\n ",",",""])),d[3],d[3],u,e,t+n-l*d[3])),p+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);p=pu(M||(M=OR(["M ",",","\n A ",",",",0,0,",",",",","\n L ",",","\n A ",",",",0,0,",",",",","\n L ",",","\n A ",",",",0,0,",",",",","\n L ",",","\n A ",",",",0,0,",",",","," Z"])),e,t+l*x,x,x,u,e+c*x,t,e+r-c*x,t,x,x,u,e+r,t+l*x,e+r,t+n-l*x,x,x,u,e+r-c*x,t+n,e+c*x,t+n,x,x,u,e,t+n-l*x)}else p=pu(T||(T=OR(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return p},O$={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},OB=e=>{var t=k3(e,O$),r=(0,H.useRef)(null),[n,i]=(0,H.useState)(-1);(0,H.useEffect)(()=>{if(r.current&&r.current.getTotalLength)try{var e=r.current.getTotalLength();e&&i(e)}catch(e){}},[]);var{x:a,y:s,width:o,height:l,radius:c,className:u}=t,{animationEasing:d,animationDuration:h,animationBegin:p,isAnimationActive:m,isUpdateAnimationActive:f}=t,x=(0,H.useRef)(o),y=(0,H.useRef)(l),g=(0,H.useRef)(a),v=(0,H.useRef)(s),b=OM((0,H.useMemo)(()=>({x:a,y:s,width:o,height:l,radius:c}),[a,s,o,l,c]),"rectangle-");if(a!==+a||s!==+s||o!==+o||l!==+l||0===o||0===l)return null;var j=sb("recharts-rectangle",u);if(!f){var w=kb(t),{radius:N}=w,k=Oz(w,OT);return H.createElement("path",OL({},k,{x:pc(a),y:pc(s),width:pc(o),height:pc(l),radius:"number"==typeof c?c:void 0,className:j,d:OF(a,s,o,l,c)}))}var S=x.current,O=y.current,P=g.current,C=v.current,A="0px ".concat(-1===n?1:n,"px"),E="".concat(n,"px 0px"),M=Oh(["strokeDasharray"],h,"string"==typeof d?d:O$.animationEasing);return H.createElement(OE,{animationId:b,key:b,canBegin:n>0,duration:h,easing:d,isActive:f,begin:p},e=>{var n,i=pb(S,o,e),u=pb(O,l,e),d=pb(P,a,e),h=pb(C,s,e);r.current&&(x.current=i,y.current=u,g.current=d,v.current=h),n=m?e>0?{transition:M,strokeDasharray:E}:{strokeDasharray:A}:{strokeDasharray:E};var p=kb(t),{radius:f}=p,b=Oz(p,O_);return H.createElement("path",OL({},b,{radius:"number"==typeof c?c:void 0,className:j,d:OF(d,h,i,u,c),ref:r,style:OI(OI({},n),t.style)}))})};function OU(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Oq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OU(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OU(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function OV(){return(OV=Object.assign.bind()).apply(null,arguments)}function OK(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var OW=(e,t,r,n,i)=>{var a=r-n;return pu(_||(_=OK(["M ",",",""])),e,t)+pu(D||(D=OK(["L ",",",""])),e+r,t)+pu(I||(I=OK(["L ",",",""])),e+r-a/2,t+i)+pu(L||(L=OK(["L ",",",""])),e+r-a/2-n,t+i)+pu(z||(z=OK(["L ",","," Z"])),e,t)},OH={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},OY=e=>{var t=k3(e,OH),{x:r,y:n,upperWidth:i,lowerWidth:a,height:s,className:o}=t,{animationEasing:l,animationDuration:c,animationBegin:u,isUpdateAnimationActive:d}=t,h=(0,H.useRef)(null),[p,m]=(0,H.useState)(-1),f=(0,H.useRef)(i),x=(0,H.useRef)(a),y=(0,H.useRef)(s),g=(0,H.useRef)(r),v=(0,H.useRef)(n),b=OM(e,"trapezoid-");if((0,H.useEffect)(()=>{if(h.current&&h.current.getTotalLength)try{var e=h.current.getTotalLength();e&&m(e)}catch(e){}},[]),r!==+r||n!==+n||i!==+i||a!==+a||s!==+s||0===i&&0===a||0===s)return null;var j=sb("recharts-trapezoid",o);if(!d)return H.createElement("g",null,H.createElement("path",OV({},kb(t),{className:j,d:OW(r,n,i,a,s)})));var w=f.current,N=x.current,k=y.current,S=g.current,O=v.current,P="0px ".concat(-1===p?1:p,"px"),C="".concat(p,"px 0px"),A=Oh(["strokeDasharray"],c,l);return H.createElement(OE,{animationId:b,key:b,canBegin:p>0,duration:c,easing:l,isActive:d,begin:u},e=>{var o=pb(w,i,e),l=pb(N,a,e),c=pb(k,s,e),u=pb(S,r,e),d=pb(O,n,e);h.current&&(f.current=o,x.current=l,y.current=c,g.current=u,v.current=d);var p=e>0?{transition:A,strokeDasharray:C}:{strokeDasharray:P};return H.createElement("path",OV({},kb(t),{className:j,d:OW(u,d,o,l,c),ref:h,style:Oq(Oq({},p),t.style)}))})};function OQ(){return(OQ=Object.assign.bind()).apply(null,arguments)}function OX(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var OG=e=>{var{cx:t,cy:r,radius:n,angle:i,sign:a,isExternal:s,cornerRadius:o,cornerIsExternal:l}=e,c=o*(s?1:-1)+n,u=Math.asin(o/c)/vk,d=l?i:i+a*u,h=vS(t,r,c,d);return{center:h,circleTangency:vS(t,r,n,d),lineTangency:vS(t,r,c*Math.cos(u*vk),l?i-a*u:i),theta:u}},OZ=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:a,endAngle:s}=e,o=pd(s-a)*Math.min(Math.abs(s-a),359.999),l=a+o,c=vS(t,r,i,a),u=vS(t,r,i,l),d=pu(R||(R=OX(["M ",",","\n A ",",",",0,\n ",",",",\n ",",","\n "])),c.x,c.y,i,i,+(Math.abs(o)>180),+(a>l),u.x,u.y);if(n>0){var h=vS(t,r,n,a),p=vS(t,r,n,l);d+=pu(F||(F=OX(["L ",",","\n A ",",",",0,\n ",",",",\n ",","," Z"])),p.x,p.y,n,n,+(Math.abs(o)>180),+(a<=l),h.x,h.y)}else d+=pu($||($=OX(["L ",","," Z"])),t,r);return d},OJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},O0=e=>{var t,r=k3(e,OJ),{cx:n,cy:i,innerRadius:a,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:h}=r;if(s<a||u===d)return null;var p=sb("recharts-sector",h),m=s-a,f=pg(o,m,0,!0);return t=f>0&&360>Math.abs(u-d)?(e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,cornerRadius:a,forceCornerRadius:s,cornerIsExternal:o,startAngle:l,endAngle:c}=e,u=pd(c-l),{circleTangency:d,lineTangency:h,theta:p}=OG({cx:t,cy:r,radius:i,angle:l,sign:u,cornerRadius:a,cornerIsExternal:o}),{circleTangency:m,lineTangency:f,theta:x}=OG({cx:t,cy:r,radius:i,angle:c,sign:-u,cornerRadius:a,cornerIsExternal:o}),y=o?Math.abs(l-c):Math.abs(l-c)-p-x;if(y<0)return s?pu(B||(B=OX(["M ",",","\n a",",",",0,0,1,",",0\n a",",",",0,0,1,",",0\n "])),h.x,h.y,a,a,2*a,a,a,-(2*a)):OZ({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:c});var g=pu(U||(U=OX(["M ",",","\n A",",",",0,0,",",",",","\n A",",",",0,",",",",",",","\n A",",",",0,0,",",",",","\n "])),h.x,h.y,a,a,+(u<0),d.x,d.y,i,i,+(y>180),+(u<0),m.x,m.y,a,a,+(u<0),f.x,f.y);if(n>0){var{circleTangency:v,lineTangency:b,theta:j}=OG({cx:t,cy:r,radius:n,angle:l,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),{circleTangency:w,lineTangency:N,theta:k}=OG({cx:t,cy:r,radius:n,angle:c,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),S=o?Math.abs(l-c):Math.abs(l-c)-j-k;if(S<0&&0===a)return"".concat(g,"L").concat(t,",").concat(r,"Z");g+=pu(q||(q=OX(["L",",","\n A",",",",0,0,",",",",","\n A",",",",0,",",",",",",","\n A",",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(u<0),w.x,w.y,n,n,+(S>180),+(u>0),v.x,v.y,a,a,+(u<0),b.x,b.y)}else g+=pu(V||(V=OX(["L",",","Z"])),t,r);return g})({cx:n,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(f,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):OZ({cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d}),H.createElement("path",OQ({},kb(r),{className:p,d:t}))};let O1=Math.PI,O2=2*O1,O5=O2-1e-6;function O4(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class O3{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?O4:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return O4;let r=10**t;return function(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=Math.round(arguments[t]*r)/r+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,n){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+n}`}bezierCurveTo(e,t,r,n,i,a){this._append`C${+e},${+t},${+r},${+n},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,r,n,i){if(e*=1,t*=1,r*=1,n*=1,(i*=1)<0)throw Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,o=r-e,l=n-t,c=a-e,u=s-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>1e-6)if(Math.abs(u*o-l*c)>1e-6&&i){let h=r-a,p=n-s,m=o*o+l*l,f=Math.sqrt(m),x=Math.sqrt(d),y=i*Math.tan((O1-Math.acos((m+d-(h*h+p*p))/(2*f*x)))/2),g=y/x,v=y/f;Math.abs(g-1)>1e-6&&this._append`L${e+g*c},${t+g*u}`,this._append`A${i},${i},0,0,${+(u*h>c*p)},${this._x1=e+v*o},${this._y1=t+v*l}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,r,n,i,a){if(e*=1,t*=1,r*=1,a=!!a,r<0)throw Error(`negative radius: ${r}`);let s=r*Math.cos(n),o=r*Math.sin(n),l=e+s,c=t+o,u=1^a,d=a?n-i:i-n;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-c)>1e-6)&&this._append`L${l},${c}`,r&&(d<0&&(d=d%O2+O2),d>O5?this._append`A${r},${r},0,1,${u},${e-s},${t-o}A${r},${r},0,1,${u},${this._x1=l},${this._y1=c}`:d>1e-6&&this._append`A${r},${r},0,${+(d>=O1)},${u},${this._x1=e+r*Math.cos(i)},${this._y1=t+r*Math.sin(i)}`)}rect(e,t,r,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r*=1}v${+n}h${-r}Z`}toString(){return this._}}function O6(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(null==r)t=null;else{let e=Math.floor(r);if(!(e>=0))throw RangeError(`invalid digits: ${r}`);t=e}return e},()=>new O3(t)}O3.prototype;let O8=Math.cos,O7=Math.sin,O9=Math.sqrt,Pe=Math.PI,Pt=2*Pe;O9(3);let Pr={draw(e,t){let r=O9(t/Pe);e.moveTo(r,0),e.arc(0,0,r,0,Pt)}},Pn=O9(1/3),Pi=2*Pn,Pa=O7(Pe/10)/O7(7*Pe/10),Ps=O7(Pt/10)*Pa,Po=-O8(Pt/10)*Pa,Pl=O9(3);O9(3);let Pc=O9(3)/2,Pu=1/O9(12),Pd=(Pu/2+1)*3;var Ph=["type","size","sizeType"];function Pp(){return(Pp=Object.assign.bind()).apply(null,arguments)}function Pm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Pf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pm(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pm(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Px={symbolCircle:Pr,symbolCross:{draw(e,t){let r=O9(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},symbolDiamond:{draw(e,t){let r=O9(t/Pi),n=r*Pn;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},symbolSquare:{draw(e,t){let r=O9(t),n=-r/2;e.rect(n,n,r,r)}},symbolStar:{draw(e,t){let r=O9(.8908130915292852*t),n=Ps*r,i=Po*r;e.moveTo(0,-r),e.lineTo(n,i);for(let t=1;t<5;++t){let a=Pt*t/5,s=O8(a),o=O7(a);e.lineTo(o*r,-s*r),e.lineTo(s*n-o*i,o*n+s*i)}e.closePath()}},symbolTriangle:{draw(e,t){let r=-O9(t/(3*Pl));e.moveTo(0,2*r),e.lineTo(-Pl*r,-r),e.lineTo(Pl*r,-r),e.closePath()}},symbolWye:{draw(e,t){let r=O9(t/Pd),n=r/2,i=r*Pu,a=r*Pu+r,s=-n;e.moveTo(n,i),e.lineTo(n,a),e.lineTo(s,a),e.lineTo(-.5*n-Pc*i,Pc*n+-.5*i),e.lineTo(-.5*n-Pc*a,Pc*n+-.5*a),e.lineTo(-.5*s-Pc*a,Pc*s+-.5*a),e.lineTo(-.5*n+Pc*i,-.5*i-Pc*n),e.lineTo(-.5*n+Pc*a,-.5*a-Pc*n),e.lineTo(-.5*s+Pc*a,-.5*a-Pc*s),e.closePath()}}},Py=Math.PI/180,Pg=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=Pf(Pf({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Ph)),{},{type:t,size:r,sizeType:n}),a="circle";"string"==typeof t&&(a=t);var{className:s,cx:o,cy:l}=i,c=kb(i);return pm(o)&&pm(l)&&pm(r)?H.createElement("path",Pp({},c,{className:sb("recharts-symbols",s),transform:"translate(".concat(o,", ").concat(l,")"),d:(()=>{var e,t=(e=a,Px["symbol".concat(pj(e))]||Pr),i=(function(e,t){let r=null,n=O6(i);function i(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return e="function"==typeof e?e:mZ(e||Pr),t="function"==typeof t?t:mZ(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:mZ(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:mZ(+e),i):t},i.context=function(e){return arguments.length?(r=null==e?null:e,i):r},i})().type(t).size(((e,t,r)=>{if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*Py;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.tan(n)**2);case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}})(r,n,a))();if(null!==i)return i})()})):null};function Pv(e){this._context=e}function Pb(e){return new Pv(e)}function Pj(e){return e[0]}function Pw(e){return e[1]}function PN(e,t){var r=mZ(!0),n=null,i=Pb,a=null,s=O6(o);function o(o){var l,c,u,d=(o=mG(o)).length,h=!1;for(null==n&&(a=i(u=s())),l=0;l<=d;++l)!(l<d&&r(c=o[l],l,o))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(c,l,o),+t(c,l,o));if(u)return a=null,u+""||null}return e="function"==typeof e?e:void 0===e?Pj:mZ(e),t="function"==typeof t?t:void 0===t?Pw:mZ(t),o.x=function(t){return arguments.length?(e="function"==typeof t?t:mZ(+t),o):e},o.y=function(e){return arguments.length?(t="function"==typeof e?e:mZ(+e),o):t},o.defined=function(e){return arguments.length?(r="function"==typeof e?e:mZ(!!e),o):r},o.curve=function(e){return arguments.length?(i=e,null!=n&&(a=i(n)),o):i},o.context=function(e){return arguments.length?(null==e?n=a=null:a=i(n=e),o):n},o}function Pk(e,t,r){var n=null,i=mZ(!0),a=null,s=Pb,o=null,l=O6(c);function c(c){var u,d,h,p,m,f=(c=mG(c)).length,x=!1,y=Array(f),g=Array(f);for(null==a&&(o=s(m=l())),u=0;u<=f;++u){if(!(u<f&&i(p=c[u],u,c))===x)if(x=!x)d=u,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),h=u-1;h>=d;--h)o.point(y[h],g[h]);o.lineEnd(),o.areaEnd()}x&&(y[u]=+e(p,u,c),g[u]=+t(p,u,c),o.point(n?+n(p,u,c):y[u],r?+r(p,u,c):g[u]))}if(m)return o=null,m+""||null}function u(){return PN().defined(i).curve(s).context(a)}return e="function"==typeof e?e:void 0===e?Pj:mZ(+e),t="function"==typeof t?t:void 0===t?mZ(0):mZ(+t),r="function"==typeof r?r:void 0===r?Pw:mZ(+r),c.x=function(t){return arguments.length?(e="function"==typeof t?t:mZ(+t),n=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:mZ(+t),c):e},c.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:mZ(+e),c):n},c.y=function(e){return arguments.length?(t="function"==typeof e?e:mZ(+e),r=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:mZ(+e),c):t},c.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:mZ(+e),c):r},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(r)},c.lineX1=function(){return u().x(n).y(t)},c.defined=function(e){return arguments.length?(i="function"==typeof e?e:mZ(!!e),c):i},c.curve=function(e){return arguments.length?(s=e,null!=a&&(o=s(a)),c):s},c.context=function(e){return arguments.length?(null==e?a=o=null:o=s(a=e),c):a},c}function PS(){}function PO(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function PP(e){this._context=e}function PC(e){this._context=e}function PA(e){this._context=e}Pg.registerSymbol=(e,t)=>{Px["symbol".concat(pj(e))]=t},Pv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},PP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:PO(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:PO(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},PC.prototype={areaStart:PS,areaEnd:PS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:PO(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},PA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:PO(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class PE{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function PM(e){this._context=e}PM.prototype={areaStart:PS,areaEnd:PS,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e*=1,t*=1,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function PT(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0);return((a<0?-1:1)+(s<0?-1:1))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs((a*i+s*n)/(n+i)))||0}function P_(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function PD(e,t,r){var n=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-n)/3;e._context.bezierCurveTo(n+o,i+o*t,a-o,s-o*r,a,s)}function PI(e){this._context=e}function PL(e){this._context=new Pz(e)}function Pz(e){this._context=e}function PR(e){this._context=e}function PF(e){var t,r,n=e.length-1,i=Array(n),a=Array(n),s=Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(t=0,a[n-1]=(e[n]+i[n-1])/2;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function P$(e,t){this._context=e,this._t=t}function PB(){return(PB=Object.assign.bind()).apply(null,arguments)}function PU(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Pq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?PU(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PU(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}PI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:PD(this,this._t0,P_(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(t*=1,(e*=1)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,PD(this,P_(this,r=PT(this,e,t)),r);break;default:PD(this,this._t0,r=PT(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(PL.prototype=Object.create(PI.prototype)).point=function(e,t){PI.prototype.point.call(this,t,e)},Pz.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}},PR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===r)this._context.lineTo(e[1],t[1]);else for(var n=PF(e),i=PF(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[s],t[s]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},P$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}};var PV={curveBasisClosed:function(e){return new PC(e)},curveBasisOpen:function(e){return new PA(e)},curveBasis:function(e){return new PP(e)},curveBumpX:function(e){return new PE(e,!0)},curveBumpY:function(e){return new PE(e,!1)},curveLinearClosed:function(e){return new PM(e)},curveLinear:Pb,curveMonotoneX:function(e){return new PI(e)},curveMonotoneY:function(e){return new PL(e)},curveNatural:function(e){return new PR(e)},curveStep:function(e){return new P$(e,.5)},curveStepAfter:function(e){return new P$(e,1)},curveStepBefore:function(e){return new P$(e,0)}},PK=e=>m4(e.x)&&m4(e.y),PW=e=>null!=e.base&&PK(e.base)&&PK(e),PH=e=>e.x,PY=e=>e.y,PQ=e=>{var{className:t,points:r,path:n,pathRef:i}=e,a=mY(fq);if((!r||!r.length)&&!n)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},o=r&&r.length?(e=>{var{type:t="linear",points:r=[],baseLine:n,layout:i,connectNulls:a=!1}=e,s=((e,t)=>{if("function"==typeof e)return e;var r="curve".concat(pj(e));if(("curveMonotone"===r||"curveBump"===r)&&t){var n=PV["".concat(r).concat("vertical"===t?"Y":"X")];if(n)return n}return PV[r]||Pb})(t,i),o=a?r.filter(PK):r;if(Array.isArray(n)){var l=r.map((e,t)=>Pq(Pq({},e),{},{base:n[t]}));return("vertical"===i?Pk().y(PY).x1(PH).x0(e=>e.base.x):Pk().x(PH).y1(PY).y0(e=>e.base.y)).defined(PW).curve(s)(a?l.filter(PW):l)}return("vertical"===i&&pm(n)?Pk().y(PY).x1(PH).x0(n):pm(n)?Pk().x(PH).y1(PY).y0(n):PN().x(PH).y(PY)).defined(PK).curve(s)(o)})(s):n;return H.createElement("path",PB({},kg(e),((e,t)=>{if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,H.isValidElement)(e)&&(r=e.props),"object"!=typeof r&&"function"!=typeof r)return null;var n={};return Object.keys(r).forEach(e=>{km(e)&&(n[e]=t||(t=>r[e](r,t)))}),n})(e),{className:sb("recharts-curve",t),d:null===o?void 0:o,ref:i}))},PX=["option","shapeType","activeClassName"];function PG(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function PZ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?PG(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PG(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function PJ(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return H.createElement(OB,r);case"trapezoid":return H.createElement(OY,r);case"sector":return H.createElement(O0,r);case"symbols":if("symbols"===t)return H.createElement(Pg,r);break;case"curve":return H.createElement(PQ,r);default:return null}}function P0(e){var t,{option:r,shapeType:n,activeClassName:i="recharts-active-shape"}=e,a=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,PX);if((0,H.isValidElement)(r))t=(0,H.cloneElement)(r,PZ(PZ({},a),(0,H.isValidElement)(r)?r.props:r));else if("function"==typeof r)t=r(a,a.index);else if((0,Oc.default)(r)&&"boolean"!=typeof r){var s=PZ(PZ({},a),r);t=H.createElement(PJ,{shapeType:n,elementProps:s})}else t=H.createElement(PJ,{shapeType:n,elementProps:a});return a.isActive?H.createElement(Si,{className:i},t):t}function P1(){return(P1=Object.assign.bind()).apply(null,arguments)}function P2(e){return H.createElement(P0,P1({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var P5=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(r,n)=>{if(pm(e))return e;var i=pm(r)||null==r;return i?e(r,n):(i||function(e,t){if(!e)throw Error("Invariant failed")}(!1,"minPointSize callback function received a value with type of ".concat(typeof r,". Currently only numbers or null/undefined are supported.")),t)}},P4=(e,t,r)=>{var n=mV();return(i,a)=>s=>{null==e||e(i,a,s),n(mj({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},P3=e=>{var t=mV();return(r,n)=>i=>{null==e||e(r,n,i),t(mw())}},P6=(e,t,r)=>{var n=mV();return(i,a)=>s=>{null==e||e(i,a,s),n(mk({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}};function P8(e){var{tooltipEntrySettings:t}=e,r=mV(),n=fv(),i=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{n||(null===i.current?r(my(t)):i.current!==t&&r(mg({prev:i.current,next:t})),i.current=t)},[t,r,n]),(0,H.useLayoutEffect)(()=>()=>{i.current&&(r(mv(i.current)),i.current=null)},[r]),null}var P7=["children"],P9=(0,H.createContext)({data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function Ce(e){var{children:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,P7);return H.createElement(P9.Provider,{value:r},t)}function Ct(e,t){var r,n,i=mY(t=>v6(t,e)),a=mY(e=>v9(e,t)),s=null!=(r=null==i?void 0:i.allowDataOverflow)?r:v4.allowDataOverflow,o=null!=(n=null==a?void 0:a.allowDataOverflow)?n:v8.allowDataOverflow;return{needClip:s||o,needClipX:s,needClipY:o}}function Cr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=mY(kJ),{needClipX:a,needClipY:s,needClip:o}=Ct(t,r);if(!o||!i)return null;var{x:l,y:c,width:u,height:d}=i;return H.createElement("clipPath",{id:"clipPath-".concat(n)},H.createElement("rect",{x:a?l:l-u/2,y:s?c:c-d/2,width:a?u:2*u,height:s?d:2*d}))}var Cn=(e,t,r)=>{var n=null!=r?r:e;if(null!=n)return pg(n,t,0)};function Ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ca(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ci(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Cs(e,t){var r,n;return null!=(r=null==(n=e.graphicalItems.cartesianItems.find(e=>e.id===t))?void 0:n.xAxisId)?r:0}function Co(e,t){var r,n;return null!=(r=null==(n=e.graphicalItems.cartesianItems.find(e=>e.id===t))?void 0:n.yAxisId)?r:0}var Cl=hf([bs,(e,t)=>t],(e,t)=>e.filter(e=>"bar"===e.type).find(e=>e.id===t)),Cc=hf([Cl],e=>null==e?void 0:e.maxBarSize),Cu=hf([fq,bs,Cs,Co,(e,t,r)=>r],(e,t,r,n,i)=>t.filter(t=>"horizontal"===e?t.xAxisId===r:t.yAxisId===n).filter(e=>e.isPanorama===i).filter(e=>!1===e.hide).filter(e=>"bar"===e.type)),Cd=hf([Cu,e=>e.rootProps.barSize,(e,t)=>{var r=fq(e),n=Cs(e,t),i=Co(e,t);if(null!=n&&null!=i)return"horizontal"===r?jN(e,"xAxis",n):jN(e,"yAxis",i)}],(e,t,r)=>{var n=e.filter(vY),i=e.filter(e=>null==e.stackId);return[...Object.entries(n.reduce((e,t)=>{var r=e[t.stackId];return null==r&&(r=[]),r.push(t),e[t.stackId]=r,e},{})).map(e=>{var n,[i,a]=e;return{stackId:i,dataKeys:a.map(e=>e.dataKey),barSize:Cn(t,r,null==(n=a[0])?void 0:n.barSize)}}),...i.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>null!=e),barSize:Cn(t,r,e.barSize)}))]}),Ch=(e,t,r)=>{var n,i,a=fq(e),s=Cs(e,t),o=Co(e,t);if(null!=s&&null!=o)return"horizontal"===a?(n=jE(e,"xAxis",s,r),i=jA(e,"xAxis",s,r)):(n=jE(e,"yAxis",o,r),i=jA(e,"yAxis",o,r)),fi(n,i)},Cp=hf([Cd,vm,e=>e.rootProps.barGap,vf,(e,t,r)=>{var n,i,a,s,o=Cl(e,t);if(null==o)return 0;var l=Cs(e,t),c=Co(e,t);if(null==l||null==c)return 0;var u=fq(e),d=vm(e),{maxBarSize:h}=o;return"horizontal"===u?(a=jE(e,"xAxis",l,r),s=jA(e,"xAxis",l,r)):(a=jE(e,"yAxis",c,r),s=jA(e,"yAxis",c,r)),null!=(n=null!=(i=fi(a,s,!0))?i:null==h?d:h)?n:0},Ch,Cc],(e,t,r,n,i,a,s)=>{var o=function(e,t,r,n,i){var a,s,o=n.length;if(!(o<1)){var l=pg(e,r,0,!0),c=[];if(m4(null==(a=n[0])?void 0:a.barSize)){var u=!1,d=r/o,h=n.reduce((e,t)=>e+(t.barSize||0),0);(h+=(o-1)*l)>=r&&(h-=(o-1)*l,l=0),h>=r&&d>0&&(u=!0,d*=.9,h=o*d);var p={offset:((r-h)/2|0)-l,size:0};s=n.reduce((e,t)=>{var r,n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p.offset+p.size+l,size:u?d:null!=(r=t.barSize)?r:0}},i=[...e,n];return p=n.position,i},c)}else{var m=pg(t,r,0,!0);r-2*m-(o-1)*l<=0&&(l=0);var f=(r-2*m-(o-1)*l)/o;f>1&&(f>>=0);var x=m4(i)?Math.min(f,i):f;s=n.reduce((e,t,r)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:m+(f+l)*r+(f-x)/2,size:x}}],c)}return s}}(r,n,i!==a?i:a,e,null==s?t:s);return i!==a&&null!=o&&(o=o.map(e=>Ca(Ca({},e),{},{position:Ca(Ca({},e.position),{},{offset:e.position.offset-i/2})}))),o}),Cm=hf([Cp,Cl],(e,t)=>{if(null!=e&&null!=t){var r=e.find(e=>e.stackId===t.stackId&&null!=t.dataKey&&e.dataKeys.includes(t.dataKey));if(null!=r)return r.position}}),Cf=hf([(e,t,r)=>{var n=fq(e),i=Cs(e,t),a=Co(e,t);if(null!=i&&null!=a)return"horizontal"===n?bP(e,"yAxis",a,r):bP(e,"xAxis",i,r)},Cl],(e,t)=>{var r=vW(t);if(!e||null==r||null==t)return;var{stackId:n}=t;if(null!=n){var i=e[n];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===r)}}}),Cx=hf([ff,fy,(e,t,r)=>{var n=Cs(e,t);if(null!=n)return jE(e,"xAxis",n,r)},(e,t,r)=>{var n=Co(e,t);if(null!=n)return jE(e,"yAxis",n,r)},(e,t,r)=>{var n=Cs(e,t);if(null!=n)return jA(e,"xAxis",n,r)},(e,t,r)=>{var n=Co(e,t);if(null!=n)return jA(e,"yAxis",n,r)},Cm,fq,(e,t,r)=>r?vt(e):ve(e),Ch,Cf,Cl,(e,t,r,n)=>n],(e,t,r,n,i,a,s,o,l,c,u,d,h)=>{var p,{chartData:m,dataStartIndex:f,dataEndIndex:x}=l;if(null!=d&&null!=s&&null!=t&&("horizontal"===o||"vertical"===o)&&null!=r&&null!=n&&null!=i&&null!=a&&null!=c){var{data:y}=d;if(null!=(p=null!=y&&y.length>0?y:null==m?void 0:m.slice(f,x+1)))return function(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:i,bandSize:a,xAxis:s,yAxis:o,xAxisTicks:l,yAxisTicks:c,stackedData:u,displayedData:d,offset:h,cells:p,parentViewBox:m,dataStartIndex:f}=e,x="horizontal"===t?o:s,y=u?x.scale.domain():null,g=(e=>{var{numericAxis:t}=e,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]})({numericAxis:x}),v=x.scale.map(g);return d.map((e,d)=>{if(u){var x=u[d+f];if(null==x)return null;j=((e,t)=>{if(!t||2!==t.length||!pm(t[0])||!pm(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!pm(e[0])||e[0]<r)&&(i[0]=r),(!pm(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i})(x,y)}else Array.isArray(j=m7(e,r))||(j=[g,j]);var b=P5(n,0)(j[1],d);if("horizontal"===t){var j,w,N,k,S,O,P,C=o.scale.map(j[0]),A=o.scale.map(j[1]);if(null==C||null==A)return null;w=ft({axis:s,ticks:l,bandSize:a,offset:i.offset,entry:e,index:d}),N=null!=(P=null!=A?A:C)?P:void 0,k=i.size;var E=C-A;if(S=ph(E)?0:E,O={x:w,y:h.top,width:k,height:h.height},Math.abs(b)>0&&Math.abs(S)<Math.abs(b)){var M=pd(S||b)*(Math.abs(b)-Math.abs(S));N-=M,S+=M}}else{var T=s.scale.map(j[0]),_=s.scale.map(j[1]);if(null==T||null==_)return null;if(w=T,N=ft({axis:o,ticks:c,bandSize:a,offset:i.offset,entry:e,index:d}),k=_-T,S=i.size,O={x:h.left,y:N,width:h.width,height:S},Math.abs(b)>0&&Math.abs(k)<Math.abs(b)){var D=pd(k||b)*(Math.abs(b)-Math.abs(k));k+=D}}return null==w||null==N||null==k||null==S?null:CR(CR({},e),{},{stackedBarStart:v,x:w,y:N,width:k,height:S,value:u?j:j[1],payload:e,background:O,tooltipPosition:{x:w+k/2,y:N+S/2},parentViewBox:m},p&&p[d]&&p[d].props)}).filter(Boolean)}({layout:o,barSettings:d,pos:s,parentViewBox:t,bandSize:c,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:p,offset:e,cells:h,dataStartIndex:f})}});function Cy(e){var{legendPayload:t}=e,r=mV(),n=fv(),i=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{n||(null===i.current?r(NO(t)):i.current!==t&&r(NP({prev:i.current,next:t})),i.current=t)},[r,n,t]),(0,H.useLayoutEffect)(()=>()=>{i.current&&(r(NC(i.current)),i.current=null)},[r]),null}var Cg=null!=(K=H["useId".toString()])?K:()=>{var[e]=H.useState(()=>py("uid-"));return e},Cv=(0,H.createContext)(void 0),Cb=e=>{var t,r,n,{id:i,type:a,children:s}=e,o=(t="recharts-".concat(a),r=i,n=Cg(),r||(t?"".concat(t,"-").concat(n):n));return H.createElement(Cv.Provider,{value:o},s(o))},Cj=(0,H.memo)(e=>{var t=mV(),r=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{null===r.current?t(Na(e)):r.current!==e&&t(Ns({prev:r.current,next:e})),r.current=e},[t,e]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(No(r.current)),r.current=null)},[t]),null}),Cw=(e,t)=>t,CN=(e,t,r)=>r,Ck=hf([Cw,bs,CN],(e,t,r)=>t.filter(e=>"bar"===e.type).filter(t=>t.stackId===e).filter(e=>e.isPanorama===r).filter(e=>!e.hide)),CS=hf([Ck],e=>e.map(e=>e.id)),CO=hf([e=>e,Cw,CN],(e,t,r)=>{var n=CS(e,t,r),i=[];return n.forEach(t=>{var n=Cx(e,t,r,void 0);null==n||n.forEach((e,t)=>{i[t]=((e,t)=>{if(!e)return t;if(!t)return e;var r=Math.min(e.x,e.x+e.width,t.x,t.x+t.width),n=Math.min(e.y,e.y+e.height,t.y,t.y+t.height);return{x:r,y:n,width:Math.max(e.x,e.x+e.width,t.x,t.x+t.width)-r,height:Math.max(e.y,e.y+e.height,t.y,t.y+t.height)-n}})(i[t],e)})}),i}),CP=["index"];function CC(){return(CC=Object.assign.bind()).apply(null,arguments)}var CA=(0,H.createContext)(void 0),CE=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),CM=e=>{var{index:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,CP),n=(e=>{var t=(0,H.useContext)(CA);if(null!=t){var{stackId:r}=t;return"url(#".concat(CE(r,e),")")}})(t);return H.createElement(Si,CC({className:"recharts-bar-stack-layer",clipPath:n},r))},CT=["onMouseEnter","onMouseLeave","onClick"],C_=["value","background","tooltipPosition"],CD=["id"],CI=["onMouseEnter","onClick","onMouseLeave"];function CL(){return(CL=Object.assign.bind()).apply(null,arguments)}function Cz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function CR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cz(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cz(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function CF(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var C$=St.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:n,fill:i,name:a,hide:s,unit:o,tooltipType:l,id:c}=e,u={dataDefinedOnItem:void 0,getPosition:pN,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:fs(a,t),hide:s,type:l,color:i,unit:o,graphicalItemId:c}};return St.createElement(P8,{tooltipEntrySettings:u})});function CB(e){var t,r=mY(wN),{data:n,dataKey:i,background:a,allOtherBarProps:s}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=s,u=CF(s,CT),d=P4(o,i,s.id),h=P3(l),p=P6(c,i,s.id);if(!a||null==n)return null;var m=kv(a);return St.createElement(SR,{zIndex:(t=vO.barBackground,a&&"object"==typeof a&&"zIndex"in a&&"number"==typeof a.zIndex&&m4(a.zIndex)?a.zIndex:t)},n.map((e,t)=>{var{value:n,background:s,tooltipPosition:o}=e,l=CF(e,C_);if(!s)return null;var c=d(e,t),f=h(e,t),x=p(e,t),y=CR(CR(CR(CR(CR({option:a,isActive:String(t)===r},l),{},{fill:"#eee"},s),m),Ol(u,e,t)),{},{onMouseEnter:c,onMouseLeave:f,onClick:x,dataKey:i,index:t,className:"recharts-bar-background-rectangle"});return St.createElement(P2,CL({key:"background-bar-".concat(t)},y))}))}function CU(e){var{showLabels:t,children:r,rects:n}=e,i=null==n?void 0:n.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return CR(CR({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return St.createElement(S7,{value:t?i:void 0},r)}function Cq(e){var{shape:t,activeBar:r,baseProps:n,entry:i,index:a,dataKey:s}=e,o=mY(wN),l=mY(wS),c=r&&String(a)===o&&(null==l||s===l),u=c?r:t;return c?St.createElement(SR,{zIndex:vO.activeBar},St.createElement(CM,{index:a},St.createElement(P2,CL({},n,{name:String(n.name)},i,{isActive:c,option:u,index:a,dataKey:s})))):St.createElement(P2,CL({},n,{name:String(n.name)},i,{isActive:c,option:u,index:a,dataKey:s}))}function CV(e){var{shape:t,baseProps:r,entry:n,index:i,dataKey:a}=e;return St.createElement(P2,CL({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a}))}function CK(e){var t,{data:r,props:n}=e,i=null!=(t=kg(n))?t:{},{id:a}=i,s=CF(i,CD),{shape:o,dataKey:l,activeBar:c}=n,{onMouseEnter:u,onClick:d,onMouseLeave:h}=n,p=CF(n,CI),m=P4(u,l,a),f=P3(h),x=P6(d,l,a);return r?St.createElement(St.Fragment,null,r.map((e,t)=>St.createElement(CM,CL({index:t,key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value,"-").concat(t),className:"recharts-bar-rectangle"},Ol(p,e,t),{onMouseEnter:m(e,t),onMouseLeave:f(e,t),onClick:x(e,t)}),c?St.createElement(Cq,{shape:o,activeBar:c,baseProps:s,entry:e,index:t,dataKey:l}):St.createElement(CV,{shape:o,baseProps:s,entry:e,index:t,dataKey:l})))):null}function CW(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:i,isAnimationActive:a,animationBegin:s,animationDuration:o,animationEasing:l,onAnimationEnd:c,onAnimationStart:u}=t,d=r.current,h=OM(t,"recharts-bar-"),[p,m]=(0,St.useState)(!1),f=(0,St.useCallback)(()=>{"function"==typeof c&&c(),m(!1)},[c]),x=(0,St.useCallback)(()=>{"function"==typeof u&&u(),m(!0)},[u]);return St.createElement(CU,{showLabels:!p,rects:n},St.createElement(OE,{animationId:h,begin:s,duration:o,isActive:a,easing:l,onAnimationEnd:f,onAnimationStart:x,key:h},e=>{var a=1===e?n:null==n?void 0:n.map((t,r)=>{var n=d&&d[r];if(n)return CR(CR({},t),{},{x:pb(n.x,t.x,e),y:pb(n.y,t.y,e),width:pb(n.width,t.width,e),height:pb(n.height,t.height,e)});if("horizontal"===i){var a=pb(0,t.height,e),s=pb(t.stackedBarStart,t.y,e);return CR(CR({},t),{},{y:s,height:a})}var o=pb(0,t.width,e),l=pb(t.stackedBarStart,t.x,e);return CR(CR({},t),{},{width:o,x:l})});return(e>0&&(r.current=null!=a?a:null),null==a)?null:St.createElement(Si,null,St.createElement(CK,{props:t,data:a}))}),St.createElement(Ot,{label:t.label}),t.children)}function CH(e){var t=(0,St.useRef)(null);return St.createElement(CW,{previousRectanglesRef:t,props:e})}var CY=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:m7(e,t)}};class CQ extends St.PureComponent{render(){var{hide:e,data:t,dataKey:r,className:n,xAxisId:i,yAxisId:a,needClip:s,background:o,id:l}=this.props;if(e||null==t)return null;var c=sb("recharts-bar",n);return St.createElement(Si,{className:c,id:l},s&&St.createElement("defs",null,St.createElement(Cr,{clipPathId:l,xAxisId:i,yAxisId:a})),St.createElement(Si,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(l,")"):void 0},St.createElement(CB,{data:t,dataKey:r,background:o,allOtherBarProps:this.props}),St.createElement(CH,this.props)))}}var CX={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:0,xAxisId:0,yAxisId:0,zIndex:vO.bar};function CG(e){var t,r,n,i,{xAxisId:a,yAxisId:s,hide:o,legendType:l,minPointSize:c,activeBar:u,animationBegin:d,animationDuration:h,animationEasing:p,isAnimationActive:m}=e,{needClip:f}=Ct(a,s),x=mY(fq),y=fv(),g=(t=e.children,r=[],n=[],n=Array.isArray(Sa)?Sa.map(e=>On(e)):[On(Sa)],Os(t).forEach(e=>{var t=(0,pl.default)(e,"type.displayName")||(0,pl.default)(e,"type.name");t&&-1!==n.indexOf(t)&&r.push(e)}),r),v=mY(t=>Cx(t,e.id,y,g));if("vertical"!==x&&"horizontal"!==x)return null;var b=null==v?void 0:v[0];return i=null==b||null==b.height||null==b.width?0:"vertical"===x?b.height/2:b.width/2,St.createElement(Ce,{xAxisId:a,yAxisId:s,data:v,dataPointFormatter:CY,errorBarOffset:i},St.createElement(CQ,CL({},e,{layout:x,needClip:f,data:v,xAxisId:a,yAxisId:s,hide:o,legendType:l,minPointSize:c,activeBar:u,animationBegin:d,animationDuration:h,animationEasing:p,isAnimationActive:m})))}var CZ=St.memo(function(e){var t,r,n,i=k3(e,CX),a=(r=i.stackId,null!=(n=(0,H.useContext)(CA))?n.stackId:null!=r?null==(t=r)?void 0:String(t):void 0),s=fv();return St.createElement(Cb,{id:i.id,type:"bar"},e=>St.createElement(St.Fragment,null,St.createElement(Cy,{legendPayload:(e=>{var{dataKey:t,name:r,fill:n,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:n,value:fs(r,t),payload:e}]})(i)}),St.createElement(C$,{dataKey:i.dataKey,stroke:i.stroke,strokeWidth:i.strokeWidth,fill:i.fill,name:i.name,hide:i.hide,unit:i.unit,tooltipType:i.tooltipType,id:e}),St.createElement(Cj,{type:"bar",id:e,data:void 0,xAxisId:i.xAxisId,yAxisId:i.yAxisId,zAxisId:0,dataKey:i.dataKey,stackId:a,hide:i.hide,barSize:i.barSize,minPointSize:i.minPointSize,maxBarSize:i.maxBarSize,isPanorama:s}),St.createElement(SR,{zIndex:i.zIndex},St.createElement(CG,CL({},i,{id:e})))))},kc);CZ.displayName="Bar";var CJ=function(e){var{width:t,height:r}=e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(n%180+180)%180*Math.PI/180,a=Math.atan(r/t);return Math.abs(i>a&&i<Math.PI-a?r/Math.sin(i):t/Math.cos(i))};function C0(e,t){if(t<1)return[];if(1===t)return e;for(var r=[],n=0;n<e.length;n+=t){var i=e[n];void 0!==i&&r.push(i)}return r}function C1(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function C2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function C5(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C2(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C2(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var C4=["axisLine","width","height","className","hide","ticks","axisType"];function C3(){return(C3=Object.assign.bind()).apply(null,arguments)}function C6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function C8(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C6(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C6(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var C7={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:vO.axis};function C9(e){var{x:t,y:r,width:n,height:i,orientation:a,mirror:s,axisLine:o,otherSvgProps:l}=e;if(!o)return null;var c=C8(C8(C8({},l),kg(o)),{},{fill:"none"});if("top"===a||"bottom"===a){var u=+("top"===a&&!s||"bottom"===a&&s);c=C8(C8({},c),{},{x1:t,y1:r+u*i,x2:t+n,y2:r+u*i})}else{var d=+("left"===a&&!s||"right"===a&&s);c=C8(C8({},c),{},{x1:t+d*n,y1:r,x2:t+d*n,y2:r+i})}return H.createElement("line",C3({},c,{className:sb("recharts-cartesian-axis-line",(0,pl.default)(o,"className"))}))}function Ae(e){var t,{option:r,tickProps:n,value:i}=e,a=sb(n.className,"recharts-cartesian-axis-tick-value");if(H.isValidElement(r))t=H.cloneElement(r,C8(C8({},n),{},{className:a}));else if("function"==typeof r)t=r(C8(C8({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";"boolean"!=typeof r&&(s=sb(s,r&&"object"==typeof r&&"className"in r&&"string"==typeof r.className?r.className:"")),t=H.createElement(SL,C3({},n,{className:s}),i)}return t}var At=(0,H.forwardRef)((e,t)=>{var{ticks:r=[],tick:n,tickLine:i,stroke:a,tickFormatter:s,unit:o,padding:l,tickTextProps:c,orientation:u,mirror:d,x:h,y:p,width:m,height:f,tickSize:x,tickMargin:y,fontSize:g,letterSpacing:v,getTicksConfig:b,events:j,axisType:w}=e,N=function(e,t,r){var n,{tick:i,ticks:a,viewBox:s,minTickGap:o,orientation:l,interval:c,tickFormatter:u,unit:d,angle:h}=e;if(!a||!a.length||!i)return[];if(pm(c)||N4.isSsr)return null!=(n=C0(a,(pm(c)?c:0)+1))?n:[];var p="top"===l||"bottom"===l?"width":"height",m=d&&"width"===p?Sp(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},f=(e,n)=>{var i,a="function"==typeof u?u(e.value,n):e.value;return"width"===p?(i=Sp(a,{fontSize:t,letterSpacing:r}),CJ({width:i.width+m.width,height:i.height+m.height},h)):Sp(a,{fontSize:t,letterSpacing:r})[p]},x=a[0],y=a[1],g=a.length>=2&&null!=x&&null!=y?pd(y.coordinate-x.coordinate):1,v=function(e,t,r){var n="width"===r,{x:i,y:a,width:s,height:o}=e;return 1===t?{start:n?i:a,end:n?i+s:a+o}:{start:n?i+s:a+o,end:n?i:a}}(s,g,p);return"equidistantPreserveStart"===c?function(e,t,r,n,i){for(var a,s=(n||[]).slice(),{start:o,end:l}=t,c=0,u=1,d=o;u<=s.length;)if(a=function(){var t,a=null==n?void 0:n[c];if(void 0===a)return{v:C0(n,u)};var s=c,h=()=>(void 0===t&&(t=r(a,s)),t),p=a.coordinate,m=0===c||C1(e,p,h,d,l);m||(c=0,d=o,u+=1),m&&(d=p+e*(h()/2+i),c+=u)}())return a.v;return[]}(g,v,f,a,o):"equidistantPreserveEnd"===c?function(e,t,r,n,i){var a=(n||[]).slice().length;if(0===a)return[];for(var{start:s,end:o}=t,l=1;l<=a;l++){for(var c,u=(a-1)%l,d=s,h=!0,p=u;p<a&&(0===(c=function(){var t,a=n[p];if(null==a)return 0;var s=p,l=()=>(void 0===t&&(t=r(a,s)),t),c=a.coordinate,m=p===u||C1(e,c,l,d,o);if(!m)return h=!1,1;m&&(d=c+e*(l()/2+i))}())||1!==c);p+=l);if(h){for(var m=[],f=u;f<a;f+=l){var x=n[f];null!=x&&m.push(x)}return m}}return[]}(g,v,f,a,o):("preserveStart"===c||"preserveStartEnd"===c?function(e,t,r,n,i,a){var s=(n||[]).slice(),o=s.length,{start:l,end:c}=t;if(a){var u=n[o-1];if(null!=u){var d=r(u,o-1),h=e*(u.coordinate+e*d/2-c);s[o-1]=u=C5(C5({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate}),null!=u.tickCoord&&C1(e,u.tickCoord,()=>d,l,c)&&(c=u.tickCoord-e*(d/2+i),s[o-1]=C5(C5({},u),{},{isShow:!0}))}}for(var p=a?o-1:o,m=function(t){var n,a=s[t];if(null==a)return 1;var o=a,u=()=>(void 0===n&&(n=r(a,t)),n);if(0===t){var d=e*(o.coordinate-e*u()/2-l);s[t]=o=C5(C5({},o),{},{tickCoord:d<0?o.coordinate-d*e:o.coordinate})}else s[t]=o=C5(C5({},o),{},{tickCoord:o.coordinate});null!=o.tickCoord&&C1(e,o.tickCoord,u,l,c)&&(l=o.tickCoord+e*(u()/2+i),s[t]=C5(C5({},o),{},{isShow:!0}))},f=0;f<p;f++)if(m(f))continue;return s}(g,v,f,a,o,"preserveStartEnd"===c):function(e,t,r,n,i){for(var a=(n||[]).slice(),s=a.length,{start:o}=t,{end:l}=t,c=function(t){var n,c=a[t];if(null==c)return 1;var u=c,d=()=>(void 0===n&&(n=r(c,t)),n);if(t===s-1){var h=e*(u.coordinate+e*d()/2-l);a[t]=u=C5(C5({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate})}else a[t]=u=C5(C5({},u),{},{tickCoord:u.coordinate});null!=u.tickCoord&&C1(e,u.tickCoord,d,o,l)&&(l=u.tickCoord-e*(d()/2+i),a[t]=C5(C5({},u),{},{isShow:!0}))},u=s-1;u>=0;u--)if(c(u))continue;return a}(g,v,f,a,o)).filter(e=>e.isShow)}(C8(C8({},b),{},{ticks:r}),g,v),k=function(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}(u,d),S=function(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}(u,d),O=kg(b),P=kv(n),C={};"object"==typeof i&&(C=i);var A=C8(C8({},O),{},{fill:"none"},C),E=N.map(e=>C8({entry:e},function(e,t,r,n,i,a,s,o,l){var c,u,d,h,p,m,f=o?-1:1,x=e.tickSize||s,y=pm(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":c=u=e.coordinate,m=(d=(h=r+!o*i)-f*x)-f*l,p=y;break;case"left":d=h=e.coordinate,p=(c=(u=t+!o*n)-f*x)-f*l,m=y;break;case"right":d=h=e.coordinate,p=(c=(u=t+o*n)+f*x)+f*l,m=y;break;default:c=u=e.coordinate,m=(d=(h=r+o*i)+f*x)+f*l,p=y}return{line:{x1:c,y1:d,x2:u,y2:h},tick:{x:p,y:m}}}(e,h,p,m,f,u,x,d,y))),M=E.map(e=>{var{entry:t,line:r}=e;return H.createElement(Si,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(t.value,"-").concat(t.coordinate,"-").concat(t.tickCoord)},i&&H.createElement("line",C3({},A,r,{className:sb("recharts-cartesian-axis-tick-line",(0,pl.default)(i,"className"))})))}),T=E.map((e,t)=>{var r,i,{entry:u,tick:d}=e,h=C8(C8(C8(C8({verticalAnchor:S},O),{},{textAnchor:k,stroke:"none",fill:a},d),{},{index:t,payload:u,visibleTicksCount:N.length,tickFormatter:s,padding:l},c),{},{angle:null!=(r=null!=(i=null==c?void 0:c.angle)?i:O.angle)?r:0}),p=C8(C8({},h),P);return H.createElement(Si,C3({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(u.value,"-").concat(u.coordinate,"-").concat(u.tickCoord)},Ol(j,u,t)),n&&H.createElement(Ae,{option:n,tickProps:p,value:"".concat("function"==typeof s?s(u.value,t):u.value).concat(o||"")}))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(w,"-ticks")},T.length>0&&H.createElement(SR,{zIndex:vO.label},H.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(w,"-tick-labels"),ref:t},T)),M.length>0&&H.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(w,"-tick-lines")},M))}),Ar=(0,H.forwardRef)((e,t)=>{var{axisLine:r,width:n,height:i,className:a,hide:s,ticks:o,axisType:l}=e,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,C4),[u,d]=(0,H.useState)(""),[h,p]=(0,H.useState)(""),m=(0,H.useRef)(null);(0,H.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>{var t;return(e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:i=0,tickMargin:a=0}=e,s=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>s&&(s=t.width)}});var o=r?r.getBoundingClientRect().width:0;return Math.round(s+(i+a)+o+(r?n:0))}return 0})({ticks:m.current,label:null==(t=e.labelRef)?void 0:t.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var f=(0,H.useCallback)(e=>{if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value");m.current=t;var r=t[0];if(r){var n=window.getComputedStyle(r),i=n.fontSize,a=n.letterSpacing;(i!==u||a!==h)&&(d(i),p(a))}}},[u,h]);return s||null!=n&&n<=0||null!=i&&i<=0?null:H.createElement(SR,{zIndex:e.zIndex},H.createElement(Si,{className:sb("recharts-cartesian-axis",a)},H.createElement(C9,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:kg(e)}),H.createElement(At,{ref:f,axisType:l,events:c,fontSize:u,getTicksConfig:e,height:e.height,letterSpacing:h,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:o,unit:e.unit,width:e.width,x:e.x,y:e.y}),H.createElement(SY,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},H.createElement(S1,{label:e.label,labelRef:e.labelRef}),e.children)))}),An=H.forwardRef((e,t)=>{var r=k3(e,C7);return H.createElement(Ar,C3({},r,{ref:t}))});An.displayName="CartesianAxis";var Ai=["domain","range"],Aa=["domain","range"];function As(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ao(e,t){return e===t||!!(Array.isArray(e)&&2===e.length&&Array.isArray(t))&&2===t.length&&e[0]===t[0]&&e[1]===t[1]}function Al(e,t){if(e===t)return!0;var{domain:r,range:n}=e,i=As(e,Ai),{domain:a,range:s}=t,o=As(t,Aa);return!!Ao(r,a)&&!!Ao(n,s)&&kc(i,o)}var Ac=["type"],Au=["dangerouslySetInnerHTML","ticks","scale"],Ad=["id","scale"];function Ah(){return(Ah=Object.assign.bind()).apply(null,arguments)}function Ap(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Am(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ap(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ap(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Af(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ax(e){var t=mV(),r=(0,H.useRef)(null),n=fV(),{type:i}=e,a=Af(e,Ac),s=vE(n,"xAxis",i),o=(0,H.useMemo)(()=>{if(null!=s)return Am(Am({},a),{},{type:s})},[a,s]);return(0,H.useLayoutEffect)(()=>{null!=o&&(null===r.current?t(w5(o)):r.current!==o&&t(w4({prev:r.current,next:o})),r.current=o)},[o,t]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(w3(r.current)),r.current=null)},[t]),null}var Ay=e=>{var{xAxisId:t,className:r}=e,n=mY(fy),i=fv(),a="xAxis",s=mY(e=>jC(e,a,t,i)),o=mY(e=>jy(e,t)),l=mY(e=>jb(e,t)),c=mY(e=>v3(e,t));if(null==o||null==l||null==c)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:h}=e,p=Af(e,Au),{id:m,scale:f}=c,x=Af(c,Ad);return H.createElement(An,Ah({},p,x,{x:l.x,y:l.y,width:o.width,height:o.height,className:sb("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:s,axisType:a}))},Ag={allowDataOverflow:v4.allowDataOverflow,allowDecimals:v4.allowDecimals,allowDuplicatedCategory:v4.allowDuplicatedCategory,angle:v4.angle,axisLine:C7.axisLine,height:v4.height,hide:!1,includeHidden:v4.includeHidden,interval:v4.interval,label:!1,minTickGap:v4.minTickGap,mirror:v4.mirror,orientation:v4.orientation,padding:v4.padding,reversed:v4.reversed,scale:v4.scale,tick:v4.tick,tickCount:v4.tickCount,tickLine:C7.tickLine,tickSize:C7.tickSize,type:v4.type,xAxisId:0},Av=H.memo(e=>{var t=k3(e,Ag);return H.createElement(H.Fragment,null,H.createElement(Ax,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),H.createElement(Ay,t))},Al);Av.displayName="XAxis";var Ab=["type"],Aj=["dangerouslySetInnerHTML","ticks","scale"],Aw=["id","scale"];function AN(){return(AN=Object.assign.bind()).apply(null,arguments)}function Ak(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function AS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ak(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ak(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function AO(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function AP(e){var t=mV(),r=(0,H.useRef)(null),n=fV(),{type:i}=e,a=AO(e,Ab),s=vE(n,"yAxis",i),o=(0,H.useMemo)(()=>{if(null!=s)return AS(AS({},a),{},{type:s})},[s,a]);return(0,H.useLayoutEffect)(()=>{null!=o&&(null===r.current?t(w6(o)):r.current!==o&&t(w8({prev:r.current,next:o})),r.current=o)},[o,t]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(w7(r.current)),r.current=null)},[t]),null}function AC(e){var{yAxisId:t,className:r,width:n,label:i}=e,a=(0,H.useRef)(null),s=(0,H.useRef)(null),o=mY(fy),l=fv(),c=mV(),u="yAxis",d=mY(e=>jw(e,t)),h=mY(e=>jj(e,t)),p=mY(e=>jC(e,u,t,l)),m=mY(e=>v7(e,t));if((0,H.useLayoutEffect)(()=>{if(!("auto"!==n||!d||SG(i)||(0,H.isValidElement)(i))&&null!=m){var e=a.current;if(e){var r=e.getCalculatedWidth();Math.round(d.width)!==Math.round(r)&&c(Nr({id:t,width:r}))}}},[p,d,c,i,t,n,m]),null==d||null==h||null==m)return null;var{dangerouslySetInnerHTML:f,ticks:x,scale:y}=e,g=AO(e,Aj),{id:v,scale:b}=m,j=AO(m,Aw);return H.createElement(An,AN({},g,j,{ref:a,labelRef:s,x:h.x,y:h.y,tickTextProps:"auto"===n?{width:void 0}:{width:n},width:d.width,height:d.height,className:sb("recharts-".concat(u," ").concat(u),r),viewBox:o,ticks:p,axisType:u}))}var AA={allowDataOverflow:v8.allowDataOverflow,allowDecimals:v8.allowDecimals,allowDuplicatedCategory:v8.allowDuplicatedCategory,angle:v8.angle,axisLine:C7.axisLine,hide:!1,includeHidden:v8.includeHidden,interval:v8.interval,label:!1,minTickGap:v8.minTickGap,mirror:v8.mirror,orientation:v8.orientation,padding:v8.padding,reversed:v8.reversed,scale:v8.scale,tick:v8.tick,tickCount:v8.tickCount,tickLine:C7.tickLine,tickSize:C7.tickSize,type:v8.type,width:v8.width,yAxisId:0},AE=H.memo(e=>{var t=k3(e,AA);return H.createElement(H.Fragment,null,H.createElement(AP,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),H.createElement(AC,t))},Al);function AM(){return(AM=Object.assign.bind()).apply(null,arguments)}function AT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function A_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?AT(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AT(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function AD(e){return Array.isArray(e)&&pf(e[0])&&pf(e[1])?e.join(" ~ "):e}AE.displayName="YAxis";var AI={margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},AL={display:"block",paddingTop:4,paddingBottom:4,color:"#000"},Az={},AR=e=>{var{separator:t=" : ",contentStyle:r,itemStyle:n,labelStyle:i=Az,payload:a,formatter:s,itemSorter:o,wrapperClassName:l,labelClassName:c,label:u,labelFormatter:d,accessibilityLayer:h=!1}=e,p=A_(A_({},AI),r),m=A_({margin:0},i),f=null!=u,x=f?u:"",y=sb("recharts-default-tooltip",l),g=sb("recharts-tooltip-label",c);return f&&d&&null!=a&&(x=d(u,a)),H.createElement("div",AM({className:y,style:p},h?{role:"status","aria-live":"assertive"}:{}),H.createElement("p",{className:g,style:m},H.isValidElement(x)?x:"".concat(x)),(()=>{if(a&&a.length){var e=(o?(0,mQ.default)(a,o):a).map((e,r)=>{if("none"===e.type)return null;var i=e.formatter||s||AD,{value:o,name:l}=e,c=o,u=l,d=i(o,l,e,r,a);if(Array.isArray(d))[c,u]=d;else{if(null==d)return null;c=d}var h=A_(A_({},AL),{},{color:e.color||AL.color},n);return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(r),style:h},pf(u)?H.createElement("span",{className:"recharts-tooltip-item-name"},u):null,pf(u)?H.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,H.createElement("span",{className:"recharts-tooltip-item-value"},c),H.createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return H.createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null})())},AF=H,A$="recharts-tooltip-wrapper",AB={visibility:"hidden"};function AU(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:i,position:a,reverseDirection:s,tooltipDimension:o,viewBox:l,viewBoxDimension:c}=e;if(a&&pm(a[n]))return a[n];var u=r[n]-o-(i>0?i:0),d=r[n]+i;if(t[n])return s[n]?u:d;var h=l[n];return null==h?0:s[n]?u<h?Math.max(d,h):Math.max(u,h):null==c?0:d+o>h+c?Math.max(u,h):Math.max(d,h)}function Aq(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function AV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Aq(Object(r),!0).forEach(function(t){AK(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Aq(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function AK(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class AW extends AF.PureComponent{constructor(){super(...arguments),AK(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),AK(this,"handleKeyDown",e=>{if("Escape"===e.key){var t,r,n,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:null!=(t=null==(r=this.props.coordinate)?void 0:r.x)?t:0,y:null!=(n=null==(i=this.props.coordinate)?void 0:i.y)?n:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var e,t;this.state.dismissed&&((null==(e=this.props.coordinate)?void 0:e.x)!==this.state.dismissedAtCoordinate.x||(null==(t=this.props.coordinate)?void 0:t.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:e,allowEscapeViewBox:t,animationDuration:r,animationEasing:n,children:i,coordinate:a,hasPayload:s,isAnimationActive:o,offset:l,position:c,reverseDirection:u,useTranslate3d:d,viewBox:h,wrapperStyle:p,lastBoundingBox:m,innerRef:f,hasPortalFromProps:x}=this.props,{cssClasses:y,cssProperties:g}=function(e){var t,r,n,{allowEscapeViewBox:i,coordinate:a,offsetTop:s,offsetLeft:o,position:l,reverseDirection:c,tooltipBox:u,useTranslate3d:d,viewBox:h}=e;return{cssProperties:t=u.height>0&&u.width>0&&a?function(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}({translateX:r=AU({allowEscapeViewBox:i,coordinate:a,key:"x",offset:o,position:l,reverseDirection:c,tooltipDimension:u.width,viewBox:h,viewBoxDimension:h.width}),translateY:n=AU({allowEscapeViewBox:i,coordinate:a,key:"y",offset:s,position:l,reverseDirection:c,tooltipDimension:u.height,viewBox:h,viewBoxDimension:h.height}),useTranslate3d:d}):AB,cssClasses:function(e){var{coordinate:t,translateX:r,translateY:n}=e;return sb(A$,{["".concat(A$,"-right")]:pm(r)&&t&&pm(t.x)&&r>=t.x,["".concat(A$,"-left")]:pm(r)&&t&&pm(t.x)&&r<t.x,["".concat(A$,"-bottom")]:pm(n)&&t&&pm(t.y)&&n>=t.y,["".concat(A$,"-top")]:pm(n)&&t&&pm(t.y)&&n<t.y})}({translateX:r,translateY:n,coordinate:a})}}({allowEscapeViewBox:t,coordinate:a,offsetLeft:"number"==typeof l?l:l.x,offsetTop:"number"==typeof l?l:l.y,position:c,reverseDirection:u,tooltipBox:{height:m.height,width:m.width},useTranslate3d:d,viewBox:h}),v=x?{}:AV(AV({transition:o&&e?"transform ".concat(r,"ms ").concat(n):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&e&&s?"visible":"hidden",position:"absolute",top:0,left:0}),b=AV(AV({},v),{},{visibility:!this.state.dismissed&&e&&s?"visible":"hidden"},p);return AF.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:y,style:b,ref:f},i)}}var AH=e.i(40559),AY=["x","y","top","left","width","height","className"];function AQ(){return(AQ=Object.assign.bind()).apply(null,arguments)}function AX(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var AG=e=>{var{x:t=0,y:r=0,top:n=0,left:i=0,width:a=0,height:s=0,className:o}=e,l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?AX(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AX(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({x:t,y:r,top:n,left:i,width:a,height:s},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,AY));return pm(t)&&pm(r)&&pm(a)&&pm(s)&&pm(n)&&pm(i)?H.createElement("path",AQ({},kb(l),{className:sb("recharts-cross",o),d:"M".concat(t,",").concat(n,"v").concat(s,"M").concat(i,",").concat(r,"h").concat(a)})):null};function AZ(e){var{cx:t,cy:r,radius:n,startAngle:i,endAngle:a}=e;return{points:[vS(t,r,n,i),vS(t,r,n,a)],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}function AJ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function A0(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?AJ(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AJ(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A1(){return(A1=Object.assign.bind()).apply(null,arguments)}function A2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function A5(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A2(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A2(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A4(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return(0,H.isValidElement)(t)?(0,H.cloneElement)(t,n):(0,H.createElement)(r,n)}function A3(e){var t,r,n,i,a,{coordinate:s,payload:o,index:l,offset:c,tooltipAxisBandSize:u,layout:d,cursor:h,tooltipEventType:p,chartName:m}=e;if(!h||!s||"ScatterChart"!==m&&"axis"!==p)return null;if("ScatterChart"===m)n=s,i=AG,a=vO.cursorLine;else if("BarChart"===m)t=u/2,n={stroke:"none",fill:"#ccc",x:"horizontal"===d?s.x-t:c.left+.5,y:"horizontal"===d?c.top+.5:s.y-t,width:"horizontal"===d?u:c.width-1,height:"horizontal"===d?c.height-1:u},i=OB,a=vO.cursorRectangle;else if("radial"===d&&Oo(s)){var{cx:f,cy:x,radius:y,startAngle:g,endAngle:v}=AZ(s);n={cx:f,cy:x,startAngle:g,endAngle:v,innerRadius:y,outerRadius:y},i=O0,a=vO.cursorLine}else n={points:function(e,t,r){if("horizontal"===e)return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if("vertical"===e)return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(Oo(t)){if("centric"===e){var{cx:n,cy:i,innerRadius:a,outerRadius:s,angle:o}=t,l=vS(n,i,a,o),c=vS(n,i,s,o);return[{x:l.x,y:l.y},{x:c.x,y:c.y}]}return AZ(t)}}(d,s,c)},i=PQ,a=vO.cursorLine;var b="object"==typeof h&&"className"in h?h.className:void 0,j=A5(A5(A5(A5({stroke:"#ccc",pointerEvents:"none"},c),n),kv(h)),{},{payload:o,payloadIndex:l,className:sb("recharts-tooltip-cursor",b)});return H.createElement(SR,{zIndex:null!=(r=e.zIndex)?r:a},H.createElement(A4,{cursor:h,cursorComp:i,cursorProps:j}))}function A6(e){var t,r,n,i,a=(t=mY(bN),r=mY(wg),n=mY(wf),t&&n?fi(A0(A0({},t),{},{scale:n}),r):fi(void 0,r)),s=null!=(i=mY(ff))?i:fU,o=mY(fq),l=mY(vg);return null==a||null==s||null==o||null==l?null:H.createElement(A3,A1({},e,{offset:s,layout:o,tooltipAxisBandSize:a,chartName:l}))}function A8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function A7(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A8(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A8(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A9(e){return e.dataKey}var Ee=[],Et={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Er(e){var t,r,n,i,a,s,o,l,c,u,d,h=k3(e,Et),{active:p,allowEscapeViewBox:m,animationDuration:f,animationEasing:x,content:y,filterNull:g,isAnimationActive:v,offset:b,payloadUniqBy:j,position:w,reverseDirection:N,useTranslate3d:k,wrapperStyle:S,cursor:O,shared:P,trigger:C,defaultIndex:A,portal:E,axisId:M}=h,T=mV(),_="number"==typeof A?String(A):A;(0,H.useEffect)(()=>{T(mb({shared:P,trigger:C,axisId:M,active:p,defaultIndex:_}))},[T,P,C,M,p,_]);var D=fB(),I=kh(),L=mY(e=>jL(e,P)),{activeIndex:z,isActive:R}=null!=(u=mY(e=>wK(e,L,C,_)))?u:{},F=mY(e=>wV(e,L,C,_)),$=mY(e=>wq(e,L,C,_)),B=mY(e=>wU(e,L,C,_)),U=(0,H.useContext)(kB),q=null!=(d=null!=p?p:R)&&d,[V,K]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],[t,r]=(0,H.useState)({height:0,left:0,top:0,width:0}),n=(0,H.useCallback)(e=>{if(null!=e){var n=e.getBoundingClientRect(),i={height:n.height,left:n.left,top:n.top,width:n.width};(Math.abs(i.height-t.height)>1||Math.abs(i.left-t.left)>1||Math.abs(i.top-t.top)>1||Math.abs(i.width-t.width)>1)&&r({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}([F,q]),W="axis"===L?$:void 0;t=mY(e=>((e,t,r)=>{if(null!=t){var n=jK(e);return"axis"===t?"hover"===r?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:"hover"===r?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}})(e,L,C)),r=mY(vj),n=mY(vv),i=mY(vb),s=null==(a=mY(kz))?void 0:a.active,o=fB(),(0,H.useEffect)(()=>{if(!s&&null!=n&&null!=r){var e=mP({active:q,coordinate:B,dataKey:t,index:z,label:"number"==typeof W?String(W):W,sourceViewBox:o,graphicalItemId:void 0});kD.emit(kI,n,e,r)}},[s,B,t,z,W,r,n,i,q,o]);var Y=null!=E?E:U;if(null==Y||null==D||null==L)return null;var Q=null!=F?F:Ee;q||(Q=Ee),g&&Q.length&&(l=Q.filter(e=>null!=e.value&&(!0!==e.hide||h.includeHidden)),Q=!0===j?(0,AH.default)(l,A9):"function"==typeof j?(0,AH.default)(l,j):l);var X=Q.length>0,G=H.createElement(AW,{allowEscapeViewBox:m,animationDuration:f,animationEasing:x,isAnimationActive:v,active:q,coordinate:B,hasPayload:X,offset:b,position:w,reverseDirection:N,useTranslate3d:k,viewBox:D,wrapperStyle:S,lastBoundingBox:V,innerRef:K,hasPortalFromProps:!!E},(c=A7(A7({},h),{},{payload:Q,label:W,active:q,activeIndex:z,coordinate:B,accessibilityLayer:I}),H.isValidElement(y)?H.cloneElement(y,c):"function"==typeof y?H.createElement(y,c):H.createElement(AR,c)));return H.createElement(H.Fragment,null,(0,Sz.createPortal)(G,Y),q&&H.createElement(A6,{cursor:O,tooltipEventType:L,coordinate:B,payload:Q,index:z}))}function En({stats:e,onNavigate:t}){let r=(0,H.useMemo)(()=>Object.entries(e.byCategory).map(([e,t])=>({category:e,count:t,color:(0,sy.getCategoryColor)(e),thin:t<3})).sort((e,t)=>t.count-e.count),[e.byCategory]);return 0===r.length?(0,W.jsx)("div",{className:"bg-slate-900/50 rounded-lg p-4 text-slate-400 text-sm",children:"No category data available."}):(0,W.jsxs)("div",{className:"bg-slate-900/50 rounded-lg p-4",children:[(0,W.jsx)(fF,{width:"100%",height:36*r.length+20,children:(0,W.jsxs)(Se,{data:r,layout:"vertical",margin:{left:10,right:30},children:[(0,W.jsx)(Av,{type:"number",hide:!0}),(0,W.jsx)(AE,{type:"category",dataKey:"category",width:100,tick:{fill:"#94a3b8",fontSize:12},axisLine:!1,tickLine:!1}),(0,W.jsx)(Er,{contentStyle:{background:"#1e293b",border:"1px solid #334155",borderRadius:8},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"}}),(0,W.jsx)(CZ,{dataKey:"count",radius:[0,4,4,0],cursor:"pointer",onClick:(e,n)=>{void 0!==n&&r[n]&&t({category:r[n].category})},children:r.map((e,t)=>(0,W.jsx)(Sa,{fill:e.color},t))})]})}),r.some(e=>e.thin)&&(0,W.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:r.filter(e=>e.thin).map(e=>(0,W.jsxs)("span",{className:"text-xs text-amber-400 bg-amber-400/10 px-2 py-0.5 rounded",children:["⚠ ",e.category," (",e.count,")"]},e.category))})]})}let Ei=(0,oD.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);function Ea({icon:e,title:t,count:r,children:n}){let[i,a]=(0,H.useState)(!1);return(0,W.jsxs)("div",{className:"border border-slate-800 rounded-lg overflow-hidden",children:[(0,W.jsxs)("button",{onClick:()=>a(!i),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-slate-800/50 transition-colors",children:[i?(0,W.jsx)(lo,{size:14,className:"text-slate-400"}):(0,W.jsx)(ui.ChevronRight,{size:14,className:"text-slate-400"}),(0,W.jsx)(e,{size:14,className:"text-slate-400"}),(0,W.jsx)("span",{className:"text-sm text-slate-200 flex-1 text-left",children:t}),(0,W.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-slate-700 text-slate-300",children:r})]}),i&&(0,W.jsx)("div",{className:"px-3 pb-3 space-y-1",children:n})]})}function Es({project:e}){let{data:t}=(0,st.useQuality)(e),{data:r}=(0,st.useContradictions)(e),n=t?.neverAccessed,i=t?.stale,a=t?.duplicates,s=r?.contradictions??[];return(0,W.jsxs)("div",{className:"space-y-2",children:[(0,W.jsx)(Ea,{icon:la,title:"Never Accessed",count:n?.count??0,children:n?.items?.length?n.items.map((e,t)=>(0,W.jsxs)("div",{className:"text-xs text-slate-400 py-1 border-b border-slate-800/50 last:border-0",children:[(0,W.jsx)("span",{className:"text-slate-300",children:String(e.title||"Untitled")}),e.created_at?(0,W.jsx)("span",{className:"ml-2 text-slate-500",children:String(e.created_at).slice(0,10)}):null]},t)):(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"None found"})}),(0,W.jsx)(Ea,{icon:o8,title:"Stale Memories",count:i?.count??0,children:i?.items?.length?i.items.map((e,t)=>{let r=Number(e.decayed_score??0),n=r<.3?"text-red-400":r<.5?"text-amber-400":"text-slate-400";return(0,W.jsxs)("div",{className:"text-xs text-slate-400 py-1 border-b border-slate-800/50 last:border-0 flex items-center gap-2",children:[(0,W.jsx)("span",{className:`${n} font-mono`,children:r.toFixed(2)}),(0,W.jsx)("span",{className:"text-slate-300",children:String(e.title||"Untitled")})]},t)}):(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"None found"})}),(0,W.jsx)(Ea,{icon:Ei,title:"Duplicates",count:a?.count??0,children:a?.items?.length?a.items.map((e,t)=>(0,W.jsxs)("div",{className:"text-xs text-slate-400 py-1 border-b border-slate-800/50 last:border-0",children:[(0,W.jsx)("span",{className:"text-slate-300",children:String(e.title_a||"Untitled")}),(0,W.jsx)("span",{className:"mx-1 text-slate-600",children:"↔"}),(0,W.jsx)("span",{className:"text-slate-300",children:String(e.title_b||"Untitled")})]},t)):(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"None found"})}),(0,W.jsx)(Ea,{icon:o0,title:"Contradictions",count:s.length,children:s.length?s.map((e,t)=>(0,W.jsxs)("div",{className:"text-xs py-1 border-b border-slate-800/50 last:border-0",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 text-slate-400",children:[(0,W.jsx)("span",{className:"font-mono text-amber-400",children:e.score.toFixed(2)}),(0,W.jsx)("span",{className:"text-slate-300",children:e.memoryATitle}),(0,W.jsx)("span",{className:"text-slate-600",children:"↔"}),(0,W.jsx)("span",{className:"text-slate-300",children:e.memoryBTitle})]}),e.reason&&(0,W.jsx)("div",{className:"text-slate-500 mt-0.5 ml-10",children:e.reason})]},t)):(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"None found"})})]})}function Eo({label:e,value:t,detail:r,tone:n="default"}){return(0,W.jsxs)("div",{className:`rounded-xl border p-4 ${"danger"===n?"border-red-500/30 bg-red-500/5":"warning"===n?"border-amber-500/30 bg-amber-500/5":"success"===n?"border-emerald-500/30 bg-emerald-500/5":"border-slate-800 bg-slate-900/70"}`,children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.18em] text-slate-500",children:e}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:t}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:r})]})}function El({action:e}){let t="critical"===e.tone?"border-red-500/30 bg-red-500/8":"warning"===e.tone?"border-amber-500/30 bg-amber-500/8":"border-emerald-500/30 bg-emerald-500/8",r="critical"===e.tone?(0,W.jsx)(o0,{size:16,className:"text-red-400 shrink-0"}):"warning"===e.tone?(0,W.jsx)(lS,{size:16,className:"text-amber-400 shrink-0"}):(0,W.jsx)(lj,{size:16,className:"text-emerald-400 shrink-0"});return(0,W.jsx)("button",{onClick:e.onClick,className:`w-full rounded-xl border p-4 text-left transition-colors hover:border-slate-500/60 hover:bg-slate-800/60 ${t}`,children:(0,W.jsxs)("div",{className:"flex items-start gap-3",children:[r,(0,W.jsxs)("div",{className:"flex-1",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e.title}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:e.detail}),(0,W.jsxs)("div",{className:"mt-3 inline-flex items-center gap-1 text-xs font-medium text-cyan-300",children:[e.cta,(0,W.jsx)(lv,{size:12})]})]})]})})}function Ec({card:e,license:t,onOpen:r}){let n=e.feature?t?.features.find(t=>t.feature===e.feature):null,i=!!n&&!n.enabled,a=n?.requiredTier??"pro";return(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-4",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e.title}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:e.detail})]}),i?(0,W.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-1 text-[10px] font-semibold ${cs[a]} ${ca[a]}`,children:[(0,W.jsx)(ce,{size:10}),ci[a]]}):(0,W.jsx)("span",{className:"rounded-full bg-emerald-500/10 px-2 py-1 text-[10px] font-semibold text-emerald-300",children:"Ready"})]}),(0,W.jsxs)("div",{className:"mt-4 flex items-center justify-between",children:[(0,W.jsxs)("button",{onClick:()=>r(e.target),className:"inline-flex items-center gap-1 rounded-lg border border-slate-700 px-3 py-2 text-xs font-medium text-slate-200 transition-colors hover:border-slate-500 hover:bg-slate-800",children:[i?`See ${ci[a]} workflow`:e.cta,(0,W.jsx)(lv,{size:12})]}),i&&(0,W.jsx)("a",{href:"https://shieldcortex.ai/pricing",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-cyan-300 hover:text-cyan-200",children:"Upgrade"})]})]})}function Eu({stats:e,selectedProject:t}){let{setViewMode:r,setCategoryFilter:n,setTypeFilter:i,setSelectedMemory:a,setReviewFocus:s}=(0,sr.useDashboardStore)(),{data:o}=(0,oq.useAuditStats)("24h",t||void 0),{data:l}=(0,oq.useQuarantine)("pending",10,t||void 0),{data:c}=(0,st.useQuality)(t||void 0),{data:u}=(0,st.useContradictions)(t||void 0),{data:d}=oY(),h=e?.total??0,p=e?.decayDistribution?.healthy??0,m=e?.decayDistribution?.fading??0,f=e?.decayDistribution?.critical??0,x=e?.decayDistribution?Math.round(p/Math.max(1,h)*100):null,y=u?.count??u?.contradictions.length??0,g=l?.total??0,v=o?.blockedCount??0,b=c?.duplicates.count??0,j=c?.stale.count??0,w=c?.neverAccessed.count??0,N=(0,H.useMemo)(()=>Object.entries(e?.byCategory??{}).filter(([,e])=>e<3).sort((e,t)=>e[1]-t[1]),[e?.byCategory]),k=(0,H.useCallback)(e=>{a(null),r(e)},[a,r]),S=(0,H.useCallback)(e=>{a(null),s(e),r("review")},[s,a,r]),O=(0,H.useCallback)(e=>{n(e?.category??null),i(e?.type??null),a(null),r("memories")},[n,a,i,r]),P=(0,H.useMemo)(()=>{let e=[];if(g>0&&e.push({title:`${g} item${1===g?"":"s"} waiting in quarantine`,detail:"Review blocked or quarantined writes before they pile up into silent operator debt.",tone:g>10?"critical":"warning",cta:"Open review queue",onClick:()=>{s(null),k("quarantine")}}),y>0&&e.push({title:`${y} contradiction${1===y?"":"s"} in memory`,detail:"Conflicting facts reduce recall trust and are worth resolving before they become reinforced.",tone:y>5?"critical":"warning",cta:"Resolve contradictions",onClick:()=>S("contradictions")}),(j>0||w>0||b>0)&&e.push({title:"Memory cleanup work is available",detail:`${j} stale, ${b} duplicate, ${w} never-accessed memories are reducing signal quality.`,tone:j+b>10?"warning":"healthy",cta:b>0?"Merge duplicates":j>0?"Review stale memories":"Review unused memories",onClick:()=>S(b>0?"duplicates":j>0?"stale":"neverUsed")}),N.length>0){let[t,r]=N[0];e.push({title:"Knowledge coverage is thin in at least one category",detail:`${t} only has ${r} memor${1===r?"y":"ies"} right now, which makes recall brittle in that area.`,tone:"warning",cta:"Browse category coverage",onClick:()=>O({category:t})})}return 0===e.length&&e.push({title:"No urgent trust issues right now",detail:"Memory health, quarantine, and contradiction signals all look stable. This is a good time to explore the graph or recent audit activity.",tone:"healthy",cta:"Open graph view",onClick:()=>k("graph")}),e.slice(0,4)},[g,y,j,w,b,N,O,S,k,s]);return(0,W.jsx)("div",{className:"h-full overflow-y-auto p-6",children:(0,W.jsxs)("div",{className:"mx-auto max-w-7xl space-y-6",children:[(0,W.jsx)("section",{className:"rounded-2xl border border-slate-800 bg-gradient-to-br from-slate-950 via-slate-900 to-cyan-950/20 p-6",children:(0,W.jsxs)("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[(0,W.jsxs)("div",{className:"max-w-3xl",children:[(0,W.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-cyan-500/20 bg-cyan-500/10 px-3 py-1 text-xs font-medium text-cyan-300",children:[(0,W.jsx)(oZ,{size:12}),"Trust Console"]}),(0,W.jsx)("h2",{className:"mt-4 text-3xl font-semibold text-white",children:"One place to see whether your memory system is actually healthy."}),(0,W.jsx)("p",{className:"mt-3 text-sm leading-6 text-slate-400",children:t?`Project scope: ${t}. This view pulls memory quality, threat pressure, review queue, and graph coverage into one operational surface.`:"Workspace scope: all projects. This view pulls memory quality, threat pressure, review queue, and graph coverage into one operational surface."})]}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 lg:w-[480px]",children:[(0,W.jsx)(Eo,{label:"Memory Base",value:String(h),detail:`${e?.averageSalience?`${Math.round(100*e.averageSalience)}% avg salience`:"No salience data yet"}`}),(0,W.jsx)(Eo,{label:"Healthy",value:null===x?"—":`${x}%`,detail:`${p} healthy \xb7 ${m} fading \xb7 ${f} critical`,tone:null!==x&&x<50?"warning":"success"}),(0,W.jsx)(Eo,{label:"Queue",value:String(g),detail:"Pending quarantine review",tone:g>0?"warning":"success"}),(0,W.jsx)(Eo,{label:"Blocked",value:String(v),detail:"Blocked operations in the last 24h",tone:v>0?"danger":"success"})]})]})}),(0,W.jsxs)("section",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[1.15fr_0.85fr]",children:[(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Urgent actions"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"These are the quickest wins for trust, safety, or recall quality."})]}),(0,W.jsxs)("span",{className:"rounded-full bg-slate-800 px-2.5 py-1 text-xs text-slate-400",children:[P.length," active"]})]}),(0,W.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-3",children:P.map(e=>(0,W.jsx)(El,{action:e},e.title))})]}),(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Operator snapshot"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"A compact read of the things that most often turn into recall or trust problems."}),(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:"Memory hygiene"}),(0,W.jsxs)("div",{className:"mt-2 grid grid-cols-3 gap-3 text-sm",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:b}),(0,W.jsx)("div",{className:"text-slate-500",children:"duplicates"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:j}),(0,W.jsx)("div",{className:"text-slate-500",children:"stale"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-xl font-semibold text-white",children:w}),(0,W.jsx)("div",{className:"text-slate-500",children:"never used"})]})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:"Knowledge coverage"}),(0,W.jsx)("div",{className:"mt-2 text-sm text-slate-400",children:N.length>0?(0,W.jsxs)(W.Fragment,{children:["Thin categories:"," ",N.slice(0,3).map(([e,t])=>`${e} (${t})`).join(" · ")]}):"No obviously thin categories right now."}),(0,W.jsxs)("button",{onClick:()=>k("graph"),className:"mt-3 inline-flex items-center gap-1 text-xs font-medium text-cyan-300",children:["Open graph coverage",(0,W.jsx)(lv,{size:12})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:"Free vs Pro value"}),(0,W.jsx)("div",{className:"mt-2 text-sm text-slate-400",children:"Free gives visibility and cleanup. Pro adds stronger audit workflows, custom policy controls, and deeper skill review."})]})]})]})]}),(0,W.jsxs)("section",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[1fr_1fr]",children:[(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Knowledge coverage"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Thin categories are usually where recall feels random or incomplete."})]}),(0,W.jsxs)("button",{onClick:()=>k("graph"),className:"inline-flex items-center gap-1 rounded-lg border border-slate-700 px-3 py-2 text-xs text-slate-200 hover:border-slate-500 hover:bg-slate-800",children:[(0,W.jsx)(o5,{size:12}),"Open graph"]})]}),(0,W.jsx)("div",{className:"mt-4",children:e?(0,W.jsx)(En,{stats:e,onNavigate:({category:e})=>O({category:e??null})}):(0,W.jsx)("div",{className:"rounded-lg bg-slate-950/70 p-4 text-sm text-slate-500",children:"No category data available yet."})})]}),(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Memory cleanup"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"The fastest way to improve recall is usually removing ambiguity and dead weight."})]}),(0,W.jsxs)("button",{onClick:()=>k("memories"),className:"inline-flex items-center gap-1 rounded-lg border border-slate-700 px-3 py-2 text-xs text-slate-200 hover:border-slate-500 hover:bg-slate-800",children:[(0,W.jsx)(o1,{size:12}),"Open memories"]})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(Es,{project:t||void 0})})]})]}),(0,W.jsxs)("section",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[0.9fr_1.1fr]",children:[(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(l9.Sparkles,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Free workflows"})]}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"These are the core jobs the free dashboard should do well every day."}),(0,W.jsx)("div",{className:"mt-4 space-y-3",children:[{title:"Debug recall behavior",detail:"Run a query, inspect ranking factors, and compare expected memories against the returned set.",cta:"Open Recall",target:"recall"},{title:"Clean low-signal memory",detail:"Find stale, contradictory, low-trust, and never-used memories before they degrade recall quality.",cta:"Open Review",target:"review"},{title:"Explore the knowledge map",detail:"Use the graph to understand entity coverage and jump from concepts back to source memories.",cta:"Open Graph",target:"graph"}].map(e=>(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/70 p-4",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e.title}),(0,W.jsx)("div",{className:"mt-1 text-sm text-slate-400",children:e.detail}),(0,W.jsxs)("button",{onClick:()=>k(e.target),className:"mt-3 inline-flex items-center gap-1 text-xs font-medium text-cyan-300",children:[e.cta,(0,W.jsx)(lv,{size:12})]})]},e.title))})]}),(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(o3,{size:16,className:"text-violet-400"}),(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Pro workflows"})]}),(0,W.jsx)("span",{className:`rounded-full px-2.5 py-1 text-xs font-medium ${cs[d?.tier??"free"]} ${ca[d?.tier??"free"]}`,children:ci[d?.tier??"free"]})]}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Paid value should save operator time, not just expose more settings."}),(0,W.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-3 lg:grid-cols-3",children:[{feature:"audit_export",title:"Incident export",detail:"Turn audit history into a reviewable export for incidents, customer proof, or compliance evidence.",cta:"Open Audit export",target:"audit"},{feature:"custom_firewall_rules",title:"Custom defence controls",detail:"Add project-specific allow, block, and quarantine rules instead of relying only on generic patterns.",cta:"Open Security controls",target:"shield"},{feature:"skill_scanner_deep",title:"Deep skill review",detail:"Move from file-by-file scanning to richer skill analysis when reviewing custom agent instructions.",cta:"Open Skills",target:"skills"}].map(e=>(0,W.jsx)(Ec,{card:e,license:d,onOpen:k},e.title))})]})]})]})})}let Ed=[{keys:["g","s"],description:"Go to Shield view"},{keys:["g","m"],description:"Go to Memories view"},{keys:["g","t"],description:"Go to Timeline view"},{keys:["g","g"],description:"Go to Graph view"},{keys:["g","a"],description:"Go to Audit view"},{keys:["g","b"],description:"Go to Brain view"},{keys:["g","d"],description:"Go to Dome view"}],Eh=[{keys:["/"],description:"Focus search input"},{keys:["Esc"],description:"Close panel / blur search"},{keys:["?"],description:"Toggle this help overlay"}];function Ep({children:e}){return(0,W.jsx)("kbd",{className:"inline-flex items-center justify-center min-w-[1.5rem] h-6 px-2 bg-slate-700 border border-slate-600 rounded text-xs font-mono text-slate-200 shadow-sm",children:e})}function Em({shortcut:e}){return(0,W.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,W.jsx)("span",{className:"text-sm text-slate-300",children:e.description}),(0,W.jsx)("div",{className:"flex items-center gap-1 ml-4 shrink-0",children:e.keys.map((e,t)=>(0,W.jsxs)("span",{className:"flex items-center gap-1",children:[t>0&&(0,W.jsx)("span",{className:"text-slate-500 text-xs",children:"then"}),(0,W.jsx)(Ep,{children:e})]},t))})]})}function Ef({open:e,onClose:t}){let r=(0,H.useRef)(null);return((0,H.useEffect)(()=>{if(!e)return;let n=e=>{r.current&&e.target===r.current&&t()};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[e,t]),e)?(0,W.jsx)("div",{ref:r,className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm transition-opacity duration-150",style:{opacity:+!!e},children:(0,W.jsxs)("div",{className:"bg-slate-900/95 border border-slate-700 rounded-xl shadow-2xl w-full max-w-md mx-4 p-6 backdrop-blur-md animate-in fade-in zoom-in-95 duration-150",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Keyboard Shortcuts"}),(0,W.jsx)("button",{onClick:t,className:"text-slate-400 hover:text-white transition-colors text-sm",children:(0,W.jsx)(Ep,{children:"Esc"})})]}),(0,W.jsxs)("div",{className:"mb-5",children:[(0,W.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 mb-2",children:"Navigation"}),(0,W.jsx)("div",{className:"space-y-0.5",children:Ed.map((e,t)=>(0,W.jsx)(Em,{shortcut:e},t))})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 mb-2",children:"Actions"}),(0,W.jsx)("div",{className:"space-y-0.5",children:Eh.map((e,t)=>(0,W.jsx)(Em,{shortcut:e},t))})]}),(0,W.jsxs)("div",{className:"mt-5 pt-4 border-t border-slate-800 text-xs text-slate-500 text-center",children:["Chords: press ",(0,W.jsx)(Ep,{children:"g"})," then a letter within 500ms"]})]})}):null}let Ex=(0,se.default)(()=>e.A(9070),{loadableGenerated:{modules:[13213]},ssr:!1,loading:()=>(0,W.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-950",children:(0,W.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading Graph..."})})}),Ey=(0,se.default)(()=>e.A(62838).then(e=>e.BrainControlCentre),{loadableGenerated:{modules:[41740]},ssr:!1,loading:()=>(0,W.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-950",children:(0,W.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading Brain Control Centre..."})})});function Eg(){let e,[t,r]=(0,H.useState)(""),[n,i]=(0,H.useState)(!1),[a,s]=(0,H.useState)(!1),o=(0,H.useRef)(null),l=(0,H.useRef)(null),c=sn(t,300),{viewMode:u,setViewMode:d,selectedMemory:h,setSelectedMemory:p,setSelectedAuditEntry:m,projectFilter:f,setProjectFilter:x,typeFilter:y,setTypeFilter:g,categoryFilter:v,setCategoryFilter:b,addEvent:j}=(0,sr.useDashboardStore)(),{showHelp:w,setShowHelp:N}=function(e){let{onFocusSearch:t,onClosePanel:r,onNavigate:n,onToggleHelp:i}=e,[a,s]=(0,H.useState)(!1),o=(0,H.useRef)(null),l=(0,H.useCallback)(e=>{let l=e.target,c=l.tagName.toLowerCase(),u="input"===c||"textarea"===c||"select"===c||l.isContentEditable;if("Escape"===e.key)return a?void s(!1):u?void l.blur():void r();if(u)return;if("/"===e.key){e.preventDefault(),t();return}if("?"===e.key){e.preventDefault(),s(e=>!e),i();return}let d=Date.now(),h=o.current;if("g"===e.key){if(h&&"g"===h.key&&d-h.time<500){o.current=null,n("graph");return}o.current={key:"g",time:d};return}if(h&&"g"===h.key&&d-h.time<500){o.current=null;let t={s:"shield",m:"memories",t:"timeline",a:"audit",b:"brain",d:"dome"}[e.key];if(t)return void n(t)}o.current=null},[t,r,n,i,a]);return(0,H.useEffect)(()=>(document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)),[l]),{showHelp:a,setShowHelp:s}}({onFocusSearch:(0,H.useCallback)(()=>{o.current?.focus()},[]),onClosePanel:(0,H.useCallback)(()=>{p(null),m(null)},[p,m]),onNavigate:(0,H.useCallback)(e=>{d(e)},[d]),onToggleHelp:()=>{}}),{data:k=[]}=(e=sn(t,200),(0,si.useQuery)({queryKey:["suggestions",e],queryFn:()=>so(e),enabled:e.length>=2,staleTime:3e4,refetchOnWindowFocus:!1})),{data:S}=(0,st.useProjects)();(0,H.useEffect)(()=>{let e=e=>{l.current&&!l.current.contains(e.target)&&o.current&&!o.current.contains(e.target)&&i(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let{data:O=[],isLoading:P,isConnected:C,lastEvent:A}=(0,st.useMemoriesWithRealtime)({limit:1e3,query:c||void 0,mode:c?"search":"recent",project:f||void 0,type:y||void 0,category:v||void 0}),{data:E,isLoading:M}=(0,st.useStats)(f||void 0),{data:T=[]}=(0,st.useMemoryLinks)(f||void 0),_=(0,H.useRef)(A);(0,H.useEffect)(()=>{!A||A===_.current||(_.current=A,new Set(["memory_created","memory_accessed","memory_updated","memory_deleted","consolidation_complete","decay_tick"]).has(A.type)&&j({type:A.type,timestamp:A.timestamp,data:A.data}))},[A,j]);let D=(0,st.useAccessMemory)();(0,st.useConsolidate)();let{data:I}=(0,st.useControlStatus)();(0,st.usePauseMemory)(),(0,st.useResumeMemory)();let L=I?.paused??!1,{data:z}=l5(),R=z?.enabled&&z?.apiKeySet,F=lJ(),$=I?.killSwitchActive??!1;return(0,W.jsxs)("div",{className:"h-screen w-screen bg-slate-950 text-white overflow-hidden flex flex-col",children:[(0,W.jsxs)("header",{className:"h-14 border-b border-slate-800 flex items-center justify-between px-4 bg-slate-900/50 backdrop-blur-sm shrink-0",children:[(0,W.jsxs)("div",{className:"flex items-center gap-4",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oZ,{size:20,className:"text-cyan-400"}),(0,W.jsx)("h1",{className:"text-xl font-bold bg-gradient-to-r from-cyan-400 via-blue-400 to-emerald-400 bg-clip-text text-transparent",children:"ShieldCortex"}),(0,W.jsx)("div",{title:R?"Connected to ShieldCortex Cloud":"Cloud sync not configured",children:(0,W.jsx)(le,{size:16,className:R?"text-emerald-400":"text-slate-600"})})]}),(0,W.jsx)("select",{value:f||"",onChange:e=>x(e.target.value||null),className:"bg-slate-800 border border-slate-700 text-white text-sm rounded-lg px-3 py-1.5 focus:ring-cyan-500 focus:border-cyan-500",children:S?.projects.map(e=>(0,W.jsxs)("option",{value:e.project||"",children:[e.label," (",e.memory_count,")"]},e.project||"all"))}),(0,W.jsxs)("div",{className:"relative",children:[(0,W.jsx)(oT,{ref:o,type:"text",placeholder:"Search memories...",value:t,onChange:e=>{r(e.target.value),i(!0)},onFocus:()=>i(!0),onKeyDown:e=>{"Escape"===e.key&&i(!1)},className:"w-64 bg-slate-800 border-slate-700 text-white placeholder:text-slate-400 focus:ring-cyan-500"}),n&&k.length>0&&(0,W.jsx)("div",{ref:l,className:"absolute top-full left-0 right-0 mt-1 bg-slate-800 border border-slate-700 rounded-lg shadow-xl overflow-hidden z-50",children:k.map((e,t)=>(0,W.jsxs)("button",{onClick:()=>{r(e.text),i(!1),o.current?.focus()},className:"w-full px-3 py-2 text-left hover:bg-slate-700 transition-colors flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-white text-sm truncate flex-1",children:e.text}),(0,W.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-slate-600 text-slate-300",children:e.type})]},`${e.type}-${e.text}-${t}`))})]}),(0,W.jsxs)(oM,{variant:"outline",size:"sm",onClick:()=>s(!a),className:`border-slate-600 text-slate-300 hover:text-white hover:bg-slate-700 ${a?"bg-slate-700":""}`,title:"Filter memories by type and category",children:["Filters ",(y||v)&&"•"]})]}),(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[$?(0,W.jsxs)("button",{onClick:()=>sr.useDashboardStore.getState().setViewMode("dome"),className:"flex items-center gap-1.5 px-3 py-1.5 bg-red-600/20 border border-red-500/50 rounded-lg text-xs font-bold text-red-400 uppercase tracking-wider animate-pulse cursor-pointer",title:"Kill switch is active — click to view details",children:[(0,W.jsx)(uU,{size:14}),"Kill Switch Active"]}):(0,W.jsxs)("button",{onClick:()=>F.mutate(),disabled:F.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 bg-red-600/10 border border-red-500/30 hover:bg-red-600/20 hover:border-red-500/50 disabled:opacity-50 rounded-lg text-xs font-medium text-red-400 transition-colors",title:"Emergency Stop — immediately halt all agent operations",children:[F.isPending?(0,W.jsx)(lb,{size:12,className:"animate-spin"}):(0,W.jsx)(uU,{size:14}),"Emergency Stop"]}),(0,W.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-400 px-2",children:[(0,W.jsx)("span",{className:`w-2 h-2 rounded-full ${$?"bg-red-500 animate-pulse":L?"bg-orange-500 animate-pulse":C?"bg-green-500":"bg-yellow-500"}`,title:$?"Kill switch active — all operations blocked":L?"Memory creation paused":C?"Real-time connected":"Polling mode"}),E?.total??O.length," memories"]})]})]}),a&&(0,W.jsxs)("div",{className:"h-12 border-b border-slate-800 flex items-center gap-4 px-4 bg-slate-900/30",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Type:"}),["short_term","long_term","episodic"].map(e=>(0,W.jsx)("button",{onClick:()=>g(y===e?null:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${y===e?"bg-blue-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:e.replace("_","-")},e))]}),(0,W.jsx)("div",{className:"w-px h-6 bg-slate-700"}),(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Category:"}),["architecture","pattern","error","learning","preference","context"].map(e=>(0,W.jsx)("button",{onClick:()=>b(v===e?null:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${v===e?"bg-purple-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:e},e))]}),(y||v)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{className:"w-px h-6 bg-slate-700"}),(0,W.jsx)("button",{onClick:()=>{g(null),b(null)},className:"px-2 py-1 text-xs text-red-400 hover:text-red-300",children:"Clear all"})]})]}),(0,W.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,W.jsx)(ln,{}),(0,W.jsx)(eh,{mode:"wait",children:(0,W.jsxs)(a9.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"flex-1 relative overflow-hidden",children:["overview"===u&&(0,W.jsx)(Eu,{stats:E,selectedProject:f}),"recall"===u&&(0,W.jsx)(cF,{}),"review"===u&&(0,W.jsx)(cH,{}),"shield"===u&&(0,W.jsx)(cS,{}),"cloud"===u&&(0,W.jsx)(cD,{}),"audit"===u&&(0,W.jsx)(c6,{}),"quarantine"===u&&(0,W.jsx)(ut,{}),"brain"===u&&(0,W.jsx)(Ey,{memories:O,links:T,stats:E,isLoading:P}),"graph"===u&&(0,W.jsx)(Ex,{}),"timeline"===u&&(0,W.jsx)(de,{}),"agents"===u&&(0,W.jsx)(uS,{}),"skills"===u&&(0,W.jsx)(uR,{}),"dome"===u&&(0,W.jsx)(u2,{}),"memories"===u&&(0,W.jsx)(oU,{memories:O,selectedMemory:h,onSelectMemory:e=>{p(e)},links:T,onReinforce:e=>{D.mutate(e)},onSelectMemoryById:e=>{let t=O.find(t=>t.id===e);t&&p(t)},isReinforcing:D.isPending,reinforceSuccess:D.isSuccess})]},u)})]}),(0,W.jsx)(Ef,{open:w,onClose:()=>N(!1)})]})}e.s(["default",()=>Eg],23733)}]);
|