shieldcortex 3.0.2 → 3.0.4
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/prerender-manifest.json +3 -3
- 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 +1 -1
- 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/server/server-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/313c0d327bbf244a.js +9 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{fa5217550a8ab9a6.js → 49c1cec591af1460.js} +2 -2
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{f69fd1c5e71fbbfd.js → ca21f348cb163905.js} +1 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/f4ca424319f58dc7.css +3 -0
- package/dist/api/routes/admin.d.ts +12 -0
- package/dist/api/routes/admin.js +502 -0
- package/dist/api/routes/graph.d.ts +4 -0
- package/dist/api/routes/graph.js +333 -0
- package/dist/api/routes/incidents.d.ts +2 -0
- package/dist/api/routes/incidents.js +32 -0
- package/dist/api/routes/memories.d.ts +4 -0
- package/dist/api/routes/memories.js +659 -0
- package/dist/api/routes/recall.d.ts +4 -0
- package/dist/api/routes/recall.js +36 -0
- package/dist/api/routes/system.d.ts +9 -0
- package/dist/api/routes/system.js +201 -0
- package/dist/api/visualization-server.js +31 -1913
- package/dist/memory/search.d.ts +37 -0
- package/dist/memory/search.js +143 -0
- package/dist/memory/store.js +15 -166
- package/dist/tools/forget.d.ts +2 -2
- package/dist/tools/recall.d.ts +2 -2
- package/hooks/openclaw/cortex-memory/handler.ts +5 -141
- package/hooks/openclaw/cortex-memory/runtime.mjs +129 -0
- package/package.json +8 -4
- package/plugins/openclaw/dist/index.js +5 -39
- package/scripts/run-jest.mjs +25 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/be6970da20a17c0b.js +0 -9
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/e63d2228780629dd.css +0 -3
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/_tsc.js +0 -133818
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/_tsserver.js +0 -659
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/_typingsInstaller.js +0 -222
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/tsc.js +0 -8
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/tsserver.js +0 -8
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/tsserverlibrary.js +0 -21
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/typesMap.json +0 -497
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/typescript.js +0 -200276
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/typingsInstaller.js +0 -8
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/watchGuard.js +0 -53
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
- package/dashboard/.next/standalone/dashboard/node_modules/typescript/package.json +0 -120
- package/scripts/start-dashboard.sh +0 -41
- package/scripts/stop-dashboard.sh +0 -21
- /package/dashboard/.next/standalone/dashboard/.next/static/{wWaw0Bi8k5Hc3R8vWNUFY → BEvyMAX62LQMyt5iSb-F9}/_buildManifest.js +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{wWaw0Bi8k5Hc3R8vWNUFY → BEvyMAX62LQMyt5iSb-F9}/_clientMiddlewareManifest.json +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{wWaw0Bi8k5Hc3R8vWNUFY → BEvyMAX62LQMyt5iSb-F9}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
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 f=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=f},[f]),c(f),f}},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),f={};function p(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 m(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+=w(r)),a+=n;(r=7-(n=(s=e[t])+"").length)&&(a+=w(r))}else if(0===s)return"0";for(;s%10==0;)s/=10;return a+s}f.absoluteValue=f.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},f.comparedTo=f.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},f.decimalPlaces=f.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},f.dividedBy=f.div=function(e){return y(this,new this.constructor(e))},f.dividedToIntegerBy=f.idiv=function(e){var t=this.constructor;return k(y(this,new t(e),0,1),t.precision)},f.equals=f.eq=function(e){return!this.cmp(e)},f.exponent=function(){return v(this)},f.greaterThan=f.gt=function(e){return this.cmp(e)>0},f.greaterThanOrEqualTo=f.gte=function(e){return this.cmp(e)>=0},f.isInteger=f.isint=function(){return this.e>this.d.length-2},f.isNegative=f.isneg=function(){return this.s<0},f.isPositive=f.ispos=function(){return this.s>0},f.isZero=function(){return 0===this.s},f.lessThan=f.lt=function(e){return 0>this.cmp(e)},f.lessThanOrEqualTo=f.lte=function(e){return 1>this.cmp(e)},f.logarithm=f.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(j(this,o),j(e,o),o),a=!0,k(t,i))},f.minus=f.sub=function(e){return e=new this.constructor(e),this.s==e.s?S(this,e):p(this,(e.s=-e.s,e))},f.modulo=f.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)},f.naturalExponential=f.exp=function(){return g(this)},f.naturalLogarithm=f.ln=function(){return j(this)},f.negated=f.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},f.plus=f.add=function(e){return e=new this.constructor(e),this.s==e.s?p(this,e):S(this,(e.s=-e.s,e))},f.precision=f.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},f.squareRoot=f.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)},f.times=f.mul=function(e){var t,r,n,i,s,o,l,c,u,d=this.constructor,h=this.d,f=(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=f.length)&&(s=h,h=f,f=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]+f[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},f.toDecimalPlaces=f.todp=function(e,t){var r=this,n=r.constructor;return(r=new n(r),void 0===e)?r:(m(e,0,1e9),void 0===t?t=n.rounding:m(t,0,8),k(r,e+v(r)+1,t))},f.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=O(n,!0):(m(e,0,1e9),void 0===t?t=i.rounding:m(t,0,8),r=O(n=k(new i(n),e+1,t),!0,e+1)),r},f.toFixed=function(e,t){var r,n,i=this.constructor;return void 0===e?O(this):(m(e,0,1e9),void 0===t?t=i.rounding:m(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)},f.toInteger=f.toint=function(){var e=this.constructor;return k(new e(this),v(this)+1,e.rounding)},f.toNumber=function(){return+this},f.toPower=f.pow=function(e){var t,r,i,o,l,u,d=this,h=d.constructor,f=+(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=f<0?-f:f)<=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(j(d,i+12)),a=!0,(o=g(o)).s=l,o},f.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)):(m(e,1,1e9),void 0===t?t=a.rounding:m(t,0,8),r=v(i=k(new a(i),e,t)),n=O(i,e<=r||r<=a.toExpNeg,e)),n},f.toSignificantDigits=f.tosd=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(m(e,1,1e9),void 0===t?t=r.rounding:m(t,0,8)),k(new r(this),e,t)},f.toString=f.valueOf=f.val=f.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,f,p,m,x,y,g,b,w,j,N,S,O,P,C=n.constructor,E=n.s==i.s?1:-1,A=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=A.length,m=(p=new C(E)).d=[];M[u]==(A[u]||0);)++u;if(M[u]>(A[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++)w=1e7*d+(A[u]||0),m[u]=w/M|0,d=w%M|0;else{for((d=1e7/(M[0]+1)|0)>1&&(M=e(M,d),A=e(A,d),O=M.length,N=A.length),j=O,y=(x=A.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),f=(h=e(M,d)).length,y=x.length,1==(l=t(h,x,f,y))&&(d--,r(h,O<f?P:M,f))):(0==d&&(l=d=1),h=M.slice()),(f=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]),m[u++]=d,l&&x[0]?x[y++]=A[j]||0:(x=[A[j]],y=1);while((j++<N||void 0!==x[0])&&b--)}return m[0]||m.shift(),p.e=c,k(p,o?a+v(p)+1:a)}}();function g(e,t){var r,i,s,o,c,d=0,h=0,f=e.constructor,p=f.precision;if(v(e)>16)throw Error(l+v(e));if(!e.s)return new f(n);for(null==t?(a=!1,c=p):c=t,o=new f(.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 f(n),f.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 f.precision=p,null==t?(a=!0,k(s,p)):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 w(e){for(var t="";e--;)t+="0";return t}function j(e,t){var r,i,o,l,c,u,d,h,f,p=1,m=e,g=m.d,w=m.constructor,N=w.precision;if(m.s<1)throw Error(s+(m.s?"NaN":"-Infinity"));if(m.eq(n))return new w(0);if(null==t?(a=!1,h=N):h=t,m.eq(10))return null==t&&(a=!0),b(w,h);if(w.precision=h+=10,i=(r=x(g)).charAt(0),!(15e14>Math.abs(l=v(m))))return d=b(w,h+2,N).times(l+""),m=j(new w(i+"."+r.slice(1)),h-10).plus(d),w.precision=N,null==t?(a=!0,k(m,N)):m;for(;i<7&&1!=i||1==i&&r.charAt(1)>3;)i=(r=x((m=m.times(e)).d)).charAt(0),p++;for(l=v(m),i>1?(m=new w("0."+r),l++):m=new w(i+"."+r.slice(1)),u=c=m=y(m.minus(n),m.plus(n),h),f=k(m.times(m),h),o=3;;){if(c=k(c.times(f),h),x((d=u.plus(y(c,new w(o),h))).d).slice(0,h)===x(u.d).slice(0,h))return u=u.times(2),0!==l&&(u=u.plus(b(w,h+2,N).times(l+""))),u=y(u,new w(p),h),w.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,f,p,m,x=e.d;for(o=1,s=x[0];s>=10;s/=10)o++;if((n=t-o)<0)n+=7,i=t,p=x[m=0];else{if((m=Math.ceil((n+1)/7))>=(s=x.length))return e;for(o=1,p=s=x[m];s>=10;s/=10)o++;n%=7,i=n-7+o}if(void 0!==r&&(d=p/(s=u(10,o-i-1))%10|0,f=t<0||void 0!==x[m+1]||p%s,f=r<4?(d||f)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||f||6==r&&(n>0?i>0?p/u(10,o-i):0:x[m-1])%10&1||r==(e.s<0?8:7))),t<1||!x[0])return f?(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=m,s=1,m--):(x.length=m+1,s=u(10,7-n),x[m]=i>0?(p/u(10,o-i)%u(10,i)|0)*s:0),f)for(;;)if(0==m){1e7==(x[0]+=s)&&(x[0]=1,++e.e);break}else{if(x[m]+=s,1e7!=x[m])break;x[m--]=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,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),a?k(t,p):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(p/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,p):t):new f(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)+w(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+w(-i-1)+a,r&&(n=r-s)>0&&(a+=w(n))):i>=s?(a+=w(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+w(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=w(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=f,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,f=u.length;for(c=0;c<f;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,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=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,w=n?Symbol.for("react.scope"):60119;function j(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 p:return e;default:switch(e=e&&e.$$typeof){case u:case f:case y:case x:case c:return e;default:return t}}case a:return t}}}function N(e){return j(e)===h}r.AsyncMode=d,r.ConcurrentMode=h,r.ContextConsumer=u,r.ContextProvider=c,r.Element=i,r.ForwardRef=f,r.Fragment=s,r.Lazy=y,r.Memo=x,r.Portal=a,r.Profiler=l,r.StrictMode=o,r.Suspense=p,r.isAsyncMode=function(e){return N(e)||j(e)===d},r.isConcurrentMode=N,r.isContextConsumer=function(e){return j(e)===u},r.isContextProvider=function(e){return j(e)===c},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},r.isForwardRef=function(e){return j(e)===f},r.isFragment=function(e){return j(e)===s},r.isLazy=function(e){return j(e)===y},r.isMemo=function(e){return j(e)===x},r.isPortal=function(e){return j(e)===a},r.isProfiler=function(e){return j(e)===l},r.isStrictMode=function(e){return j(e)===o},r.isSuspense=function(e){return j(e)===p},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===h||e===l||e===o||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===x||e.$$typeof===c||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===b||e.$$typeof===w||e.$$typeof===g)},r.typeOf=j},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|f(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(E(e,ArrayBuffer)||e&&E(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(E(e,SharedArrayBuffer)||e&&E(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 p=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(p)return p;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 f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||E(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 p(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+=A[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 m(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(E(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),E(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(E(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=f,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)m(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)m(this,t,t+3),m(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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(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):p.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(E(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,f=h.length;if(f<=4096)return String.fromCharCode.apply(String,h);for(var p="",m=0;m<f;)p+=String.fromCharCode.apply(String,h.slice(m,m+=4096));return p}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 w(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function j(e,t,r,n,a){return t*=1,r>>>=0,a||w(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||w(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 f=!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(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!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 j(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return j(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 E(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var A=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,f=e[t+d];for(d+=h,a=f&(1<<-u)-1,f>>=-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*(f?-1:1);s+=Math.pow(2,n),a-=c}return(f?-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),f=n?0:a-1,p=n?1:-1,m=+(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+f]=255&o,f+=p,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*m}}},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,f,p,m,x,y,g,v,b,w,j,N,k,S,O,P,C,E,A,M,T,_,D,I,z,L,R,F,$,B,U,V,q,K,W=e.i(27493),H=e.i(4),Y=e.i(22534);let X=(0,H.createContext)({});function G(e){let t=(0,H.useRef)(null);return null===t.current&&(t.current=e()),t.current}let Q="u">typeof window,Z=Q?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:f}=o.current;if(t||!s.current||!e||!c)return;let p="left"===r?`left: ${d}`:`right: ${h}`,m="bottom"===n?`bottom: ${f}`:`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
|
+
${p}px !important;
|
|
7
|
+
${m}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=G(el),d=(0,H.useId)(),h=!0,f=(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&&(f={...f}),(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:f,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]),f=s&&!u?[]:h.map(eu),p=(0,H.useRef)(!0),m=(0,H.useRef)(h),x=G(()=>new Map),y=(0,H.useRef)(new Set),[g,v]=(0,H.useState)(h),[b,w]=(0,H.useState)(h);Z(()=>{p.current=!1,m.current=h;for(let e=0;e<b.length;e++){let t=eu(b[e]);f.includes(t)?(x.delete(t),y.current.delete(t)):!0!==x.get(t)&&x.set(t,!1)}},[b,f.length,f.join("-")]);let j=[];if(h!==g){let e=[...h];for(let t=0;t<b.length;t++){let r=b[t],n=eu(r);f.includes(n)||(e.splice(t,0,r),j.push(r))}return"wait"===a&&j.length&&(e=j),w(ed(e)),v(h),null}let{forceRender:N}=(0,H.useContext)(X);return(0,W.jsx)(W.Fragment,{children:b.map(e=>{let g=eu(e),v=(!s||!!u)&&(h===b||f.includes(g));return(0,W.jsx)(eo,{isPresent:v,initial:(!p.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?.(),w(m.current),s&&d?.(),n&&n())},anchorX:o,anchorY:l,children:e},g)})})},ef=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ep=new Set(ef),em=(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=>em(0,1,e)},eg={...ex,default:1},ev=e=>Math.round(1e5*e)/1e5,eb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,ew=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ej=(e,t)=>r=>!!("string"==typeof r&&ew.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(em(0,255,e))},eS={test:ej("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:ej("#"),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"),eE=eP("%"),eA=eP("px"),eM=eP("vh"),eT=eP("vw"),e_={...eE,parse:e=>eE.parse(e)/100,transform:e=>eE.transform(100*e)},eD={test:ej("hsl","hue"),parse:eN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+eE.transform(ev(t))+", "+eE.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)}},ez=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,eL="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(eL),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===eL?i+=ev(e[a]):t===eR?i+=eI.transform(e[a]):i+=e[a]}return i}}let eV=e=>"number"==typeof e?0:eI.test(e)?eI.getAnimatableNone(e):e,eq={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(eb)?.length||0)+(e.match(ez)?.length||0)>0},parse:eB,createTransformer:eU,getAnimatableNone:function(e){let t=eB(e);return eU(e)(t.map(eV))}},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={...eq,getAnimatableNone:e=>{let t=e.match(eH);return t?t.map(eW).join(" "):e}},eX={...ex,transform:Math.round},eG={borderWidth:eA,borderTopWidth:eA,borderRightWidth:eA,borderBottomWidth:eA,borderLeftWidth:eA,borderRadius:eA,borderTopLeftRadius:eA,borderTopRightRadius:eA,borderBottomRightRadius:eA,borderBottomLeftRadius:eA,width:eA,maxWidth:eA,height:eA,maxHeight:eA,top:eA,right:eA,bottom:eA,left:eA,inset:eA,insetBlock:eA,insetBlockStart:eA,insetBlockEnd:eA,insetInline:eA,insetInlineStart:eA,insetInlineEnd:eA,padding:eA,paddingTop:eA,paddingRight:eA,paddingBottom:eA,paddingLeft:eA,paddingBlock:eA,paddingBlockStart:eA,paddingBlockEnd:eA,paddingInline:eA,paddingInlineStart:eA,paddingInlineEnd:eA,margin:eA,marginTop:eA,marginRight:eA,marginBottom:eA,marginLeft:eA,marginBlock:eA,marginBlockStart:eA,marginBlockEnd:eA,marginInline:eA,marginInlineStart:eA,marginInlineEnd:eA,fontSize:eA,backgroundPositionX:eA,backgroundPositionY:eA,rotate:eC,rotateX:eC,rotateY:eC,rotateZ:eC,scale:eg,scaleX:eg,scaleY:eg,scaleZ:eg,skew:eC,skewX:eC,skewY:eC,distance:eA,translateX:eA,translateY:eA,translateZ:eA,x:eA,y:eA,z:eA,perspective:eA,transformPerspective:eA,opacity:ey,originX:e_,originY:e_,originZ:eA,zIndex:eX,fillOpacity:ey,strokeOpacity:ey,numOctaves:eX},eQ={...eG,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=>eQ[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",...ef]),e3=e=>t=>t.test(e),e6=[ex,eA,eE,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]),tf={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 tp(e){return+!!e.includes("scale")}function tm(e,t){let r,n;if(!e||"none"===e)return tp(t);let i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(i)r=tf,n=i;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=tc,n=t}if(!n)return tp(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===eA,tg=new Set(["x","y","z"]),tv=ef.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})=>tm(t,"x"),y:(e,{transform:t})=>tm(t,"y")};tb.translateX=tb.x,tb.translateY=tb.y;let tw=e=>e,tj={},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:f,postRender:p}=s,m=()=>{let a=tj.useManualTiming?i.timestamp:performance.now();r=!1,tj.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),f.process(i),p.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(m))};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(m)),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:tw,!0),tE=new Set,tA=!1,tM=!1,tT=!1;function t_(){if(tM){let e=Array.from(tE).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,tA=!1,tE.forEach(e=>e.complete(tT)),tE.clear()}function tD(){tE.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?(tE.add(this),tA||(tA=!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),tE.delete(this)}cancel(){"scheduled"===this.state&&(tE.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function tz(e,t){let r=eZ(e);return r!==eY&&(r=eq),r.getAnimatableNone?r.getAnimatableNone(t):void 0}let tL=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&&!tL.has(t)&&e$(t).values.length&&(n=e[i]),i++}if(n&&r)for(let i of t)e[i]=tz(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 tV(){t=void 0}let tq={now:()=>(void 0===t&&tq.set(tP.isProcessing||tj.useManualTiming?tP.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(tV)}};class tK{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=tq.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=tq.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=tq.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,eq],tY={current:null},tX={current:!1},tG="u">typeof window,tQ=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=tq.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,tQ.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:(tX.current||function(){if(tX.current=!0,tG)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=ep.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))&&eq.test(t)&&(r=tz(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=ef.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(ep.has(e)){s=!0;continue}if(tt(e)){i[e]=r;continue}{let t=rt(r,eG[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=ef[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,eG[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 rf={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!eA.test(e))return e;else e=parseFloat(e);let r=rh(e,t.target.x),n=rh(e,t.target.y);return`${r}% ${n}%`}},rp=(e,t,r)=>e+(t-e)*r,rm={borderRadius:{...rf,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rf,borderTopRightRadius:rf,borderBottomLeftRadius:rf,borderBottomRightRadius:rf,boxShadow:{correct:(e,{treeScale:t,projectionDelta:r})=>{let n=eq.parse(e);if(n.length>5)return e;let i=eq.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=rp(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 ep.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!rm[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!==ef.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(ep.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 rw(e){return void 0===e||1===e}function rj({scale:e,scaleX:t,scaleY:r}){return!rw(e)||!rw(t)||!rw(r)}function rN(e){return rj(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 rE(e,t,r,n,i=.5){let a=rp(e.min,e.max,i);rO(e,t,r,a,n)}function rA(e,t){rE(e.x,t.x,t.scaleX,t.scale,t.originX),rE(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(ep.has(t))return this.projection?.isProjecting?tp(t):((e,t)=>{let{transform:r="none"}=getComputedStyle(e);return tm(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}),rz=(0,H.createContext)({});function rL(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 rV=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&&(rV=e=>e.startsWith("on")?!rU(e):u(e))}catch{}function rq(e){return e5(e)?e.get():e}let rK=e=>(t,r)=>{let n=(0,H.useContext)(rz),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]=rq(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():G(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"]},rX=!1;function rG(){return!function(){if(rX)return;let e={};for(let t in rY)e[t]={isEnabled:e=>rY[t].some(t=>!!e[t])};t8=e,rX=!0}(),t8}let rQ=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=rG();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)(X).id;return t&&void 0!==e?t+"-"+e:e}(r)},{isStatic:h}=d,f=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)(rz));return(0,H.useMemo)(()=>({initial:t,animate:r}),[rL(t),rL(r)])}(r),p=s(r,h);if(!h&&Q){(0,H.useContext)(rI).strict;let t=function(e){let{drag:t,layout:r}=rG();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,f.visualElement=function(e,t,r,n,i,a){let{visualElement:s}=(0,H.useContext)(rz),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,f=(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,f);let p=(0,H.useRef)(!1);(0,H.useInsertionEffect)(()=>{h&&p.current&&h.update(r,l)});let m=r[rZ],x=(0,H.useRef)(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return Z(()=>{d.current=!0,h&&(p.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?.(m)}),x.current=!1),h.enteringChildren=void 0)}),h}(e,p,d,i,t.ProjectionNode,a)}return(0,W.jsxs)(rz.Provider,{value:f,children:[l&&f.visualElement?(0,W.jsx)(l,{visualElement:f.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)&&(rV(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=f.visualElement,c=(0,H.useRef)(n),(0,H.useInsertionEffect)(()=>{c.current=n}),u=(0,H.useRef)(null),(0,H.useCallback)(e=>{e&&p.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])),p,h,t,a)]})}o.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let l=(0,H.forwardRef)(o);return l[rQ]=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&&tj.WillChange){let r=new tj.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=rp(r.alpha,n.alpha,e),eS.transform(i))},no=new Set(["none","hidden"]);function nl(e,t){return r=>rp(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=eq.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 nf(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?rp(e,t,r):nc(e)(e,t)}let np=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>tS.update(t,e),stop:()=>tO(t),now:()=>tP.isProcessing?tP.timestamp:tq.now()}},nm=(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,nw=.5;function nj(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:f,isResolvedFromDuration:p}=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*em(.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=em(.05,1,s),e=em(.01,10,e/1e3),s<1?(i=t=>{let n=t*s,i=n*e;return .001-(n-r)/nj(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=nj(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)}),m=f||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:nw),x<1){let e=nj(g,x);r=t=>o-Math.exp(-x*g*t)*((m+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+(m+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*((m+x*g*y)*Math.sinh(n)+e*y*Math.cosh(n))/e}}let b={calculatedDuration:p&&h||null,next:e=>{let t=r(e);if(p)l.done=e>=h;else{let n=0===e?m:0;x<1&&(n=0===e?r8(m):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=nm(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,f=e[0],p={done:!1,value:f},m=r*t,x=f+m,y=void 0===s?x:s(x);y!==x&&(m=y-f);let g=e=>-m*Math.exp(-e/n),v=e=>y+g(e),b=e=>{let t=g(e),r=v(e);p.done=Math.abs(t)<=c,p.value=p.done?y:r},w=e=>{let t;if(t=p.value,void 0!==o&&t<o||void 0!==l&&t>l){var r;d=e,h=nO({keyframes:[p.value,(r=p.value,void 0===o?l:void 0===l||Math.abs(o-r)<Math.abs(l-r)?o:l)],velocity:ny(v,e,p.value),damping:i,stiffness:a,restDelta:c,restSpeed:u})}};return w(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==d||(t=!0,b(e),w(e)),void 0!==d&&e>=d)?h.next(e-d):(t||b(e),p)}}}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 nE(e,t,r,n){return e===t&&r===n?tw: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 nA=nE(.42,0,1,1),nM=nE(0,0,.58,1),nT=nE(.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=nE(.33,1.53,.69,.99),nz=nD(nI),nL=n_(nz),nR=e=>(e*=2)<1?.5*nz(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],nV={linear:tw,easeIn:nA,easeInOut:nT,easeOut:nM,circIn:nF,circInOut:nB,circOut:n$,backIn:nz,backInOut:nL,backOut:nI,anticipate:nR},nq=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 nE(t,r,n,i)}return"string"==typeof e?(e9(void 0!==nV[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nV[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(nq):nq(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||tj.mix||nf,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]||tw: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(em(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(rp(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 nX={decay:nP,inertia:nP,tween:nW,keyframes:nW,spring:nO};function nG(e){"string"==typeof e.type&&(e.type=nX[e.type])}class nQ{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 nQ{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!==tq.now()&&this.tick(tq.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;nG(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,nf(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:f,onUpdate:p,finalKeyframe:m}=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=em(0,1,r)*s}let b=y?{done:!1,value:c[0]}:v.next(g);i&&(b.value=i(b.value));let{done:w}=b;y||null===o||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let j=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return j&&f!==nP&&(b.value=nY(c,this.options,m,this.speed)),p&&p(b.value),j&&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(tq.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=np,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(tq.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 nQ{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()?nm(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 f=e.animate(u,h);return f}(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,tw):t(this)}}let n7={anticipate:nR,backInOut:nL,circInOut:nB};class n9 extends n8{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in n7&&(e.ease=n7[e.ease])}(e),nG(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,tq.now()-this.startTime),l=em(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&&(eq.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 nQ{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=tq.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=tq.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)&&((tj.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,f=d?new n9({...u,element:h}):new nJ(u);f.finished.then(()=>{this.notifyFinished()}).catch(tw),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}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:ep.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)),(tj.instantAnimations||tj.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 iw=0;function ij(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=rp(t.min,t.max,e.origin),e.scale=iP(r)/iP(t),e.translate=rp(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 iE(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 iA(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 iz=({current:e})=>e?e.ownerDocument.defaultView:null,iL=(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(iL(e.x,t.x)**2+iL(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,iV(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=iV(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 iV(e){return e[e.length-1]}function iq(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 iX{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),ij(e=>{let t=this.getAxisMotionValue(e).get()||0;if(eE.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=()=>ij(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:iz(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||!iG(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?rp(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?rp(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:iq(e.x,r,i),y:iq(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&&ij(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(ij(s=>{if(!iG(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(){ij(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){ij(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){ij(t=>{let{drag:r}=this.getProps();if(!iG(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]-rp(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};ij(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)),em(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(),ij(t=>{if(!iG(t,e,null))return;let r=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];r.set(rp(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&&(ij(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 iG(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}let iQ=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)(X);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(eE.test(t)&&(t=parseFloat(t),t=rp(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let o=rp(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||eA.test(e);function ah(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let af=am(0,.5,n$),ap=am(.5,.95,tw);function am(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"],aw=0;function aj(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=aw++,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=tq.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(aE);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(aA);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(aM),this.nodes.forEach(ak),this.nodes.forEach(aS)):this.nodes.forEach(aA),this.clearAllSnapshots();let e=tq.now();tP.delta=em(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(az)}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)),aV((t=n).x),aV(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&&rA(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),rN(n.latestValues)&&rA(r,n.latestValues)}return rN(this.latestValues)&&rA(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;rj(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,iA(s.x,o.x,l.x),iA(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||rj(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&&rA(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)&&rA(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(),iE(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(aL(s.x,e.x,n),aL(s.y,e.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,h,f,p,m,x;iT(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,p=this.relativeTargetOrigin,m=o,x=n,aR(f.x,p.x,m.x,x),aR(f.y,p.y,m.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=rp(0,r.opacity??1,af(n)),e.opacityExit=rp(t.opacity??1,0,ap(n))):a&&(e.opacity=rp(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(rp(au(s),au(o),n),0),(eE.test(o)||eE.test(s))&&(e[a]+="%")):e[a]=o)}(t.rotate||r.rotate)&&(e.rotate=rp(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&&aq(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),rA(t,i),iE(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&&aj("z",e,n,this.animationValues);for(let t=0;t<ab.length;t++)aj(`rotate${ab[t]}`,e,n,this.animationValues),aj(`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=rq(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=rq(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,rm){if(void 0===i[t])continue;let{correct:r,applyTo:s,isCSSVariable:o}=rm[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?rq(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(aE),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?ij(e=>{let n=a?t.measuredBox[e]:t.layoutBox[e],i=iP(n);n.min=r[e].min,n.max=n.min+i}):aq(i,t.layoutBox,r)&&ij(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();iE(s,r,t.layoutBox);let o=e0();a?iE(o,e.applyTransform(n,!0),t.measuredBox):iE(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 aE(e){e.clearMeasurements()}function aA(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 az(e){e.removeLeadSnapshot()}function aL(e,t,r){e.translate=rp(t.translate,0,r),e.scale=rp(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function aR(e,t,r,n){e.min=rp(t.min,r.min,n),e.max=rp(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:tw;function aV(e){e.min=aU(e.min),e.max=aU(e.max)}function aq(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 aX(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 aG(e){return!("touch"===e.pointerType||iO.x||iO.y)}function aQ(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,f;let p=iy[t],m=r[p],x=void 0!==s[p]?s[p]:o[p],y=tJ(x),g=p===a?m.isActive:null;!1===g&&(d=t);let v=x===o[p]&&x!==s[p]&&y;if(v&&n&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...u},!m.isActive&&null===g||!x&&!m.prevProp||tZ(x)||"boolean"==typeof x)continue;let b=(h=m.prevProp,"string"==typeof(f=x)?f!==h:!!Array.isArray(f)&&!ix(f,h)),w=b||p===a&&m.isActive&&!v&&y||t>d&&y,j=!1,N=Array.isArray(x)?x:[x],k=N.reduce(i(p),{});!1===g&&(k={});let{prevResolvedValues:S={}}=m,O={...S,...k},P=t=>{w=!0,c.has(t)&&(j=!0,c.delete(t)),m.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):m.protectedKeys[e]=!0:null!=t?P(e):c.add(e)}m.prevProp=x,m.prevResolvedValues=k,m.isActive&&(u={...u,...k}),n&&e.blockInitialAnimation&&(w=!1);let C=v&&b,E=!C||j;w&&E&&l.push(...N.map(t=>{let r={type:p};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 p=!!l.length;return n&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?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=iw++}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]=aX(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]=aX(e,r),s=e=>{if(!aG(e))return;let{target:r}=e,n=t(r,e);if("function"!=typeof n||!r)return;let a=e=>{aG(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)=>(aQ(this.node,t,"Start"),e=>aQ(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends r2{constructor(){super(...arguments),this.removePointerDownListener=tw}onPointerDown(e){this.session=new iF(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:iz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:iQ(e),onStart:iQ(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=tw,this.removeListeners=tw,this.controls=new iX(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tw}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}function sl(){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 sc=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),su=[],sd=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],i=r.nextPart.get(n);if(i){let r=sd(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}},sh=(e,t)=>{let r=sc();for(let n in e)sf(e[n],r,n,t);return r},sf=(e,t,r,n)=>{let i=e.length;for(let a=0;a<i;a++)sp(e[a],t,r,n)},sp=(e,t,r,n)=>{"string"==typeof e?sm(e,t,r):"function"==typeof e?sx(e,t,r,n):sy(e,t,r,n)},sm=(e,t,r)=>{(""===e?t:sg(t,e)).classGroupId=r},sx=(e,t,r,n)=>{sv(e)?sf(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},sy=(e,t,r,n)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,s]=i[e];sf(s,sg(t,a),r,n)}},sg=(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=sc(),r.nextPart.set(t,i)),r=i}return r},sv=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,sb=[],sw=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),sj=/\s+/,sN=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=sN(e[n]))&&(r&&(r+=" "),r+=t);return r},sk=[],sS=e=>{let t=t=>t[e]||sk;return t.isThemeGetter=!0,t},sO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sP=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sC=/^\d+\/\d+$/,sE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sA=/\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$/,sM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,s_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sD=e=>sC.test(e),sI=e=>!!e&&!Number.isNaN(Number(e)),sz=e=>!!e&&Number.isInteger(Number(e)),sL=e=>e.endsWith("%")&&sI(e.slice(0,-1)),sR=e=>sE.test(e),sF=()=>!0,s$=e=>sA.test(e)&&!sM.test(e),sB=()=>!1,sU=e=>sT.test(e),sV=e=>s_.test(e),sq=e=>!sW(e)&&!sZ(e),sK=e=>s3(e,s9,sB),sW=e=>sO.test(e),sH=e=>s3(e,oe,s$),sY=e=>s3(e,ot,sI),sX=e=>s3(e,s8,sB),sG=e=>s3(e,s7,sV),sQ=e=>s3(e,on,sU),sZ=e=>sP.test(e),sJ=e=>s6(e,oe),s0=e=>s6(e,or),s1=e=>s6(e,s8),s2=e=>s6(e,s9),s5=e=>s6(e,s7),s4=e=>s6(e,on,!0),s3=(e,t,r)=>{let n=sO.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},s6=(e,t,r=!1)=>{let n=sP.exec(e);return!!n&&(n[1]?t(n[1]):r)},s8=e=>"position"===e||"percentage"===e,s7=e=>"image"===e||"url"===e,s9=e=>"length"===e||"size"===e||"bg-size"===e,oe=e=>"length"===e,ot=e=>"number"===e,or=e=>"family-name"===e,on=e=>"shadow"===e,oi=((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(sj),l="";for(let e=o.length-1;e>=0;e-=1){let t=o[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!f,m=n(p?h.substring(0,f):h);if(!m){if(!p||!(m=n(h))){l=t+(l.length>0?" "+l:l);continue}p=!1}let x=0===u.length?"":1===u.length?u[0]:a(u).join(":"),y=d?x+"!":x,g=y+m;if(s.indexOf(g)>-1)continue;s.push(g);let v=i(m,p);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),sw(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)):sw(sb,!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 sh(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 sd(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||su}return r[e]||su}}})(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=sN(t))&&(i&&(i+=" "),i+=r);return i})(...e))})(()=>{let e=sS("color"),t=sS("font"),r=sS("text"),n=sS("font-weight"),i=sS("tracking"),a=sS("leading"),s=sS("breakpoint"),o=sS("container"),l=sS("spacing"),c=sS("radius"),u=sS("shadow"),d=sS("inset-shadow"),h=sS("text-shadow"),f=sS("drop-shadow"),p=sS("blur"),m=sS("perspective"),x=sS("aspect"),y=sS("ease"),g=sS("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"],w=()=>[...b(),sZ,sW],j=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],k=()=>[sZ,sW,l],S=()=>[sD,"full","auto",...k()],O=()=>[sz,"none","subgrid",sZ,sW],P=()=>["auto",{span:["full",sz,sZ,sW]},sz,sZ,sW],C=()=>[sz,"auto",sZ,sW],E=()=>["auto","min","max","fr",sZ,sW],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...k()],_=()=>[sD,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],D=()=>[e,sZ,sW],I=()=>[...b(),s1,sX,{position:[sZ,sW]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",s2,sK,{size:[sZ,sW]}],R=()=>[sL,sJ,sH],F=()=>["","none","full",c,sZ,sW],$=()=>["",sI,sJ,sH],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"],V=()=>[sI,sL,s1,sX],q=()=>["","none",p,sZ,sW],K=()=>["none",sI,sZ,sW],W=()=>["none",sI,sZ,sW],H=()=>[sI,sZ,sW],Y=()=>[sD,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sR],breakpoint:[sR],color:[sF],container:[sR],"drop-shadow":[sR],ease:["in","out","in-out"],font:[sq],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sR],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sR],shadow:[sR],spacing:["px",sI],text:[sR],"text-shadow":[sR],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sD,sW,sZ,x]}],container:["container"],columns:[{columns:[sI,sW,sZ,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:w()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],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:[sz,"auto",sZ,sW]}],basis:[{basis:[sD,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[sI,sD,"auto","initial","none",sW]}],grow:[{grow:["",sI,sZ,sW]}],shrink:[{shrink:["",sI,sZ,sW]}],order:[{order:[sz,"first","last","none",sZ,sW]}],"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":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"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,sJ,sH]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,sZ,sY]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sL,sW]}],"font-family":[{font:[s0,sW,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,sZ,sW]}],"line-clamp":[{"line-clamp":[sI,"none",sZ,sY]}],leading:[{leading:[a,...k()]}],"list-image":[{"list-image":["none",sZ,sW]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",sZ,sW]}],"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:[sI,"from-font","auto",sZ,sH]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[sI,"auto",sZ,sW]}],"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",sZ,sW]}],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",sZ,sW]}],"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:z()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sz,sZ,sW],radial:["",sZ,sW],conic:[sz,sZ,sW]},s5,sG]}],"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":[sI,sZ,sW]}],"outline-w":[{outline:["",sI,sJ,sH]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",u,s4,sQ]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",d,s4,sQ]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[sI,sH]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",h,s4,sQ]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[sI,sZ,sW]}],"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":[sI]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"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":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"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":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"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":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"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":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"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":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"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":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[sZ,sW]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"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":[sI]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"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:z()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",sZ,sW]}],filter:[{filter:["","none",sZ,sW]}],blur:[{blur:q()}],brightness:[{brightness:[sI,sZ,sW]}],contrast:[{contrast:[sI,sZ,sW]}],"drop-shadow":[{"drop-shadow":["","none",f,s4,sQ]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",sI,sZ,sW]}],"hue-rotate":[{"hue-rotate":[sI,sZ,sW]}],invert:[{invert:["",sI,sZ,sW]}],saturate:[{saturate:[sI,sZ,sW]}],sepia:[{sepia:["",sI,sZ,sW]}],"backdrop-filter":[{"backdrop-filter":["","none",sZ,sW]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[sI,sZ,sW]}],"backdrop-contrast":[{"backdrop-contrast":[sI,sZ,sW]}],"backdrop-grayscale":[{"backdrop-grayscale":["",sI,sZ,sW]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[sI,sZ,sW]}],"backdrop-invert":[{"backdrop-invert":["",sI,sZ,sW]}],"backdrop-opacity":[{"backdrop-opacity":[sI,sZ,sW]}],"backdrop-saturate":[{"backdrop-saturate":[sI,sZ,sW]}],"backdrop-sepia":[{"backdrop-sepia":["",sI,sZ,sW]}],"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",sZ,sW]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[sI,"initial",sZ,sW]}],ease:[{ease:["linear","initial",y,sZ,sW]}],delay:[{delay:[sI,sZ,sW]}],animate:[{animate:["none",g,sZ,sW]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,sZ,sW]}],"perspective-origin":[{"perspective-origin":w()}],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:[sZ,sW,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"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",sZ,sW]}],"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",sZ,sW]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[sI,sJ,sH,sY]}],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 oa(...e){return oi(sl(e))}function os({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card",className:oa("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function oo({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card-header",className:oa("@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 ol({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card-title",className:oa("leading-none font-semibold",e),...t})}function oc({className:e,...t}){return(0,W.jsx)("div",{"data-slot":"card-content",className:oa("px-6",e),...t})}function ou(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var od=Symbol.for("react.lazy"),oh=H[" use ".trim().toString()];function of(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===od&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var op=((l=H.forwardRef((e,t)=>{let{children:r,...n}=e;if(of(r)&&"function"==typeof oh&&(r=oh(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=ou(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():ou(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;of(r)&&"function"==typeof oh&&(r=oh(r._payload));let a=H.Children.toArray(r),s=a.find(ox);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),om=Symbol("radix.slottable");function ox(e){return H.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===om}let oy=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,og=(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 sl(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=oy(i)||oy(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 sl(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 ov({className:e,variant:t="default",size:r="default",asChild:n=!1,...i}){return(0,W.jsx)(n?op:"button",{"data-slot":"button","data-variant":t,"data-size":r,className:oa(og({variant:t,size:r,className:e})),...i})}function ob({className:e,type:t,...r}){return(0,W.jsx)("input",{type:t,"data-slot":"input",className:oa("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 ow=e.i(97358),oj=e.i(33368),oN=e.i(24929);let ok=(0,oN.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"}]]),oS=(0,oN.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),oO={references:{color:"#60a5fa",label:"References",icon:"→"},extends:{color:"#34d399",label:"Extends",icon:"⊃"},contradicts:{color:"#f87171",label:"Contradicts",icon:"⊗"},related:{color:"#a78bfa",label:"Related",icon:"~"}},oP=["architecture","pattern","preference","error","context","learning","todo","note","relationship","custom"];function oC({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,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(!1),[x,y]=(0,H.useState)(e.title),[g,v]=(0,H.useState)(e.content),[b,w]=(0,H.useState)(e.category),[j,N]=(0,H.useState)((e.tags||[]).join(", ")),[k,S]=(0,H.useState)(!1),O=(0,st.useEditMemory)(),P=(0,st.useDeleteMemory)(),[C,E]=(0,H.useState)(e.id);C!==e.id&&(E(e.id),m(!1),S(!1),y(e.title),v(e.content),w(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 A=(0,oj.calculateDecayFactor)(e),M=(0,ow.getCategoryColor)(e.category),T=(0,ow.getTypeColor)(e.type),_=A>.7?{label:"Healthy",color:"#22C55E",bgColor:"rgba(34, 197, 94, 0.15)"}:A>.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]);return(0,W.jsxs)(os,{className:`bg-slate-900 border-slate-700 h-full 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)(oo,{className:"border-b border-slate-700 pb-3",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[p?(0,W.jsx)(ob,{value:x,onChange:e=>y(e.target.value),className:"bg-slate-800 border-slate-600 text-white text-lg font-semibold"}):(0,W.jsxs)(ol,{className:"text-lg font-semibold text-white leading-tight flex items-center gap-2",children:[u&&(0,W.jsx)(oS,{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:[!p&&(0,W.jsx)(ov,{variant:"ghost",size:"sm",onClick:()=>m(!0),className:"text-slate-400 hover:text-white",title:"Edit memory",children:(0,W.jsx)(ok,{className:"w-4 h-4"})}),(0,W.jsx)(ov,{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:[p?(0,W.jsx)("select",{value:b,onChange:e=>w(e.target.value),className:"bg-slate-800 border border-slate-600 text-white text-xs rounded-lg px-2 py-1",children:oP.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)(oc,{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"}),p?(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})]}),p&&(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)(ob,{value:j,onChange:e=>N(e.target.value),placeholder:"tag1, tag2, tag3",className:"bg-slate-800 border-slate-600 text-white text-sm"})]}),p?(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsx)(ov,{variant:"default",size:"sm",onClick:()=>{let t=j.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),j!==(e.tags||[]).join(", ")&&(r.tags=t),0===Object.keys(r).length)?m(!1):O.mutate({id:e.id,updates:r},{onSuccess:()=>{m(!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)(ov,{variant:"outline",size:"sm",onClick:()=>{m(!1),y(e.title),v(e.content),w(e.category),N((e.tags||[]).join(", "))},className:"flex-1 border-slate-600 text-slate-300 hover:text-white",children:"Cancel"})]}):null,!p&&(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:A>.7?"Memory is strong and stable":A>.4?"Memory is fading - reinforce to preserve":"Memory at risk of deletion - reinforce now"})]})]}),!p&&(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*A).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*A}%`,backgroundColor:_.color}})})]})]}),!p&&(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":(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`})(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()})]})]}),!p&&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=oO[t]||oO.related,s=(0,ow.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}`)})})]}),!p&&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))})]}),!p&&(0,W.jsxs)("div",{className:"space-y-2 pt-2",children:[i&&(0,W.jsx)(ov,{variant:"default",size:"sm",onClick:()=>{f(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)(ov,{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)(ov,{variant:"outline",size:"sm",onClick:()=>S(!1),className:"flex-1 border-slate-600 text-slate-300 hover:text-white",children:"Cancel"})]})]}):(0,W.jsx)(ov,{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"})]})]})]})}var oE=e.i(1235);function oA(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 oM({memory:e,isSelected:t,onSelect:r,isChecked:n,onCheck:i}){let a=(0,ow.getCategoryColor)(e.category),s=(0,ow.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("_","-")})]}),(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 ",oA(e.createdAt)]}),(0,W.jsxs)("span",{children:["Accessed ",oA(e.lastAccessed)]})]})]})}let oT=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function o_({memories:e,selectedMemory:t,onSelectMemory:r}){let[n,i]=(0,H.useState)("salience"),[a,s]=(0,H.useState)("grid"),[o,l]=(0,H.useState)(!1),[c,u]=(0,H.useState)(new Set),[d,h]=(0,H.useState)(!1),f=(0,oE.useQueryClient)(),p=(0,H.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{switch(n){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,n]),m=(0,H.useCallback)((e,t)=>{u(r=>{let n=new Set(r);return t?n.add(e):n.delete(e),n})},[]),x=async()=>{if(0!==c.size){h(!0);try{await Promise.all(Array.from(c).map(e=>(0,sa.authFetch)(`${oT}/api/memories/${e}`,{method:"DELETE"}))),u(new Set),f.invalidateQueries({queryKey:["memories"]})}finally{h(!1)}}};return(0,W.jsxs)("div",{className:"flex flex-col h-full",children:[(0,W.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-slate-800 shrink-0",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:n,onChange:e=>i(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:()=>s("grid"),className:`px-2 py-1 text-xs ${"grid"===a?"bg-slate-700 text-white":"text-slate-400 hover:text-white"}`,children:"Grid"}),(0,W.jsx)("button",{onClick:()=>s("list"),className:`px-2 py-1 text-xs ${"list"===a?"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:()=>{l(!o),u(new Set)},className:`px-2 py-1 text-xs rounded ${o?"bg-blue-600 text-white":"bg-slate-800 text-slate-400 hover:text-white"}`,children:"Select"}),o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("button",{onClick:()=>u(new Set(p.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:x,disabled:0===c.size||d,className:"px-2 py-1 text-xs rounded bg-red-600/20 text-red-400 hover:bg-red-600/40 disabled:opacity-40",children:d?"Deleting...":`Delete (${c.size})`})]})]}),(0,W.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,W.jsx)("div",{className:"grid"===a?"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3":"flex flex-col gap-3 max-w-2xl",children:p.map(e=>(0,W.jsx)(oM,{memory:e,isSelected:t?.id===e.id,onSelect:r,isChecked:o?c.has(e.id):void 0,onCheck:o?m:void 0},e.id))})})]})}var oD=e.i(87353),oI=e.i(71921);let oz=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function oL(){let e=await (0,sa.authFetch)(`${oz}/api/license/status`);if(!e.ok)throw Error("Failed to fetch license status");return e.json()}async function oR(e){let t=await (0,sa.authFetch)(`${oz}/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 oF(){let e=await (0,sa.authFetch)(`${oz}/api/license/deactivate`,{method:"POST"});if(!e.ok)throw Error("Failed to deactivate license");return e.json()}function o$(){return(0,si.useQuery)({queryKey:["license-status"],queryFn:oL,refetchInterval:6e4,retry:2})}let oB=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function oU({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 oV=(0,oN.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"}]]),oq=(0,oN.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"}]]),oK=(0,oN.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"}]]),oW=(0,oN.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"}]]),oH=(0,oN.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"}]]),oY=(0,oN.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"}]]),oX=(0,oN.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"}]]),oG=(0,oN.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"}]]),oQ=(0,oN.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"}]]),oZ=(0,oN.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"}]]),oJ=(0,oN.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),o0=[{id:"overview",label:"Home",icon:oV},{id:"shield",label:"Shield",icon:oq},{id:"audit",label:"Audit",icon:oK},{id:"quarantine",label:"Queue",icon:oW},{id:"agents",label:"Agents",icon:oG},{id:"skills",label:"Skills",icon:oQ},{id:"dome",label:"Dome",icon:oZ},{id:"memories",label:"Memories",icon:oH},{id:"timeline",label:"Timeline",icon:oJ},{id:"brain",label:"Brain",icon:oY},{id:"graph",label:"Graph",icon:oX}],o1=new Set(["shield","audit","skills","dome"]);function o2(){let{viewMode:e,setViewMode:t}=(0,sr.useDashboardStore)(),{data:r}=(0,st.useStats)(),{data:n}=(0,oD.useAuditStats)("24h"),{data:i}=(0,st.useVersion)(),{data:a}=o$(),{memoryTrend:s,threatTrend:o}=function(){let{data:e}=(0,si.useQuery)({queryKey:["activity-trend"],queryFn:async()=>{let e=await (0,sa.authFetch)(`${oB}/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)(`${oB}/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:o0.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)(oU,{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&&o1.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 o5=(0,oN.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"}]]),o4=(0,oN.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"}]]),o3=(0,oN.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"}]]),o6=(0,oN.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),o8=[{key:"trust",label:"Trust",icon:oq,color:"text-blue-400",bg:"bg-blue-400/10"},{key:"firewall",label:"Firewall",icon:o5,color:"text-orange-400",bg:"bg-orange-400/10"},{key:"sensitivity",label:"Sensitivity",icon:o4,color:"text-purple-400",bg:"bg-purple-400/10"},{key:"fragmentation",label:"Fragment",icon:o3,color:"text-cyan-400",bg:"bg-cyan-400/10"},{key:"audit",label:"Audit",icon:oK,color:"text-green-400",bg:"bg-green-400/10"}],o7={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 o9({timeRange:e}){let{projectFilter:t}=(0,sr.useDashboardStore)(),{data:r,isLoading:n,isError:i}=(0,oD.useAuditStats)(e,t||void 0),{data:a}=(0,oD.useDefenceConfig)(),s=(0,oD.useSetDefenceMode)(),[o,l]=(0,H.useState)(!1),c=(0,H.useRef)(null),u=a?.mode??"balanced",d=o7[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)(oW,{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:o8.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<o8.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)(o6,{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=o7[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 le(){let{setViewMode:e,projectFilter:t}=(0,sr.useDashboardStore)(),{data:r,isLoading:n,isError:i}=(0,oD.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)(oW,{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 lt({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,oD.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 lr({timeRange:e}){let{projectFilter:t}=(0,sr.useDashboardStore)(),{data:r,isLoading:n,isError:i}=(0,oD.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 ln=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function li(e){return e>70?"#22c55e":e>=40?"#eab308":"#ef4444"}function la({score:e,size:t=120,strokeWidth:r=8}){let n=(t-r)/2,i=2*Math.PI*n,a=i-e/100*i,s=li(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 ls({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 lo(){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)(`${ln}/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)(la,{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:li(o)},children:o})})]})}),(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsx)(ls,{component:l.freshness}),(0,W.jsx)(ls,{component:l.coverage}),(0,W.jsx)(ls,{component:l.consistency}),(0,W.jsx)(ls,{component:l.consolidation})]})]})}let ll=(0,oN.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"}]]),lc=(0,oN.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),lu=(0,oN.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ld=(0,oN.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var lh=e.i(17278);let lf=(0,oN.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 lp(){let{projectFilter:e}=(0,sr.useDashboardStore)(),{data:t}=(0,oD.useAuditStats)("30d",e||void 0),{data:r}=o$(),[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 f=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)}}},p=()=>{localStorage.setItem("shieldcortex_cloud_dismissed",new Date().toISOString()),i("hidden")};if("hidden"===n)return null;let m=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:p,className:"absolute top-3 right-3 text-slate-500 hover:text-slate-300 transition-colors",title:"Dismiss for 30 days",children:(0,W.jsx)(lh.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)(ll,{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:m>0?`You've blocked ${m} 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)(lf,{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:p,className:"absolute top-3 right-3 text-slate-500 hover:text-slate-300 transition-colors",title:"Dismiss for 30 days",children:(0,W.jsx)(lh.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)(ll,{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:m>0?`You've blocked ${m} 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:f,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)(lu,{size:14,className:"animate-spin"}):(0,W.jsx)(lc,{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)(lu,{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)(ld,{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."})]})]})]})}function lm(){let e,t,{data:r,isLoading:n}=(0,si.useQuery)({queryKey:["cloud-sync-status"],queryFn:async()=>{let e=await (0,sa.authFetch)("http://localhost:3001/api/cloud/sync-status");if(!e.ok)throw Error("Failed to fetch sync status");return e.json()},refetchInterval:1e4});if(n||!r)return null;let{enabled:i,apiKeySet:a,lastSyncAt:s,queue:o}=r;i&&a?o.failed>0?(e="bg-red-500",t=`${o.failed} event${1===o.failed?"":"s"} failed`):o.pending>0?(e="bg-amber-500",t=`${o.pending} event${1===o.pending?"":"s"} pending`):s?(e="bg-emerald-500",t="Cloud sync: OK"):(e="bg-emerald-500",t="Cloud sync: connected"):(e="bg-slate-500",t="Cloud sync: disabled");let l=s?function(e){let t=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`}(s):null;return(0,W.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mb-4 bg-slate-800 rounded-lg text-xs w-fit",children:[(0,W.jsx)("span",{className:`inline-block w-2 h-2 rounded-full ${e}`}),(0,W.jsx)("span",{className:"text-slate-300",children:t}),l&&(0,W.jsxs)("span",{className:"text-slate-500",children:["last sync ",l]})]})}let lx=(0,oN.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"}]]),ly=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function lg(e){let t=await (0,sa.authFetch)(`${ly}/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 lv(e){let t=await (0,sa.authFetch)(`${ly}/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 lb(){return(0,oI.useMutation)({mutationFn:e=>lg(e)})}async function lw(e){let t=await (0,sa.authFetch)(`${ly}/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 lj(e){let t=await (0,sa.authFetch)(`${ly}/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 lN(e){let t=await (0,sa.authFetch)(`${ly}/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 lk(){let e=lb(),{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)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(oQ,{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)(ld,{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)(lx,{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)(lc,{size:12})]})]}):e.isPending?(0,W.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,W.jsx)(lu,{size:16,className:"text-cyan-400 animate-spin"})}):(0,W.jsxs)("div",{className:"text-center py-3",children:[(0,W.jsx)(oQ,{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 lS=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function lO(){let e=await (0,sa.authFetch)(`${lS}/api/iron-dome/status`);if(!e.ok)throw Error("Failed to fetch Iron Dome status");return e.json()}async function lP(e){let t=await (0,sa.authFetch)(`${lS}/api/iron-dome/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:e})});if(!t.ok)throw Error("Failed to activate Iron Dome");return t.json()}async function lC(){let e=await (0,sa.authFetch)(`${lS}/api/iron-dome/deactivate`,{method:"POST"});if(!e.ok)throw Error("Failed to deactivate Iron Dome");return e.json()}async function lE(e){let t=await (0,sa.authFetch)(`${lS}/api/iron-dome/scan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e})});if(!t.ok)throw Error("Failed to scan text");return t.json()}async function lA(){let e=await (0,sa.authFetch)(`${lS}/api/iron-dome/emergency-stop`,{method:"POST"});if(!e.ok)throw Error("Failed to trigger emergency stop");return e.json()}async function lM(e){let t=await (0,sa.authFetch)(`${lS}/api/iron-dome/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:e||"Resumed via dashboard"})});if(!t.ok)throw Error("Failed to resume operations");return t.json()}async function lT(){let e=await (0,sa.authFetch)(`${lS}/api/control/status`);if(!e.ok)throw Error("Failed to fetch control status");return e.json()}async function l_(e){let t=new URLSearchParams;e&&t.set("limit",e.toString());let r=await (0,sa.authFetch)(`${lS}/api/iron-dome/audit?${t}`);if(!r.ok)throw Error("Failed to fetch Iron Dome audit");return r.json()}function lD(){return(0,si.useQuery)({queryKey:["iron-dome-status"],queryFn:lO,refetchInterval:3e4,retry:2})}function lI(e){return(0,si.useQuery)({queryKey:["iron-dome-audit",e],queryFn:()=>l_(e),refetchInterval:3e4,retry:2})}function lz(){let e=(0,oE.useQueryClient)();return(0,oI.useMutation)({mutationFn:lA,onSuccess:()=>{e.invalidateQueries({queryKey:["iron-dome-status"]}),e.invalidateQueries({queryKey:["iron-dome-audit"]}),e.invalidateQueries({queryKey:["control-status"]})}})}function lL(){let{data:e,isLoading:t}=lD(),{data:r}=lI(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)(oq,{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 lR="http://localhost:3001";function lF(){return(0,si.useQuery)({queryKey:["cloud-config"],queryFn:async()=>{let e=await (0,sa.authFetch)(`${lR}/api/cloud/config`);if(!e.ok)throw Error("Failed to fetch cloud config");return e.json()},refetchInterval:3e4})}function l$(e,t,r){return Math.max(t,Math.min(r,e))}function lB({initialAutoMemory:e,initialDedupe:t,initialNoveltyThreshold:r,initialMaxRecent:n}){let i,a=(i=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:async e=>{let t=await (0,sa.authFetch)(`${lR}/api/cloud/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to update cloud config");return t.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["cloud-config"]})}})),[s,o]=(0,H.useState)(e),[l,c]=(0,H.useState)(t),[u,d]=(0,H.useState)(String(r)),[h,f]=(0,H.useState)(String(n)),p=a.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:()=>o(!s),className:`h-6 w-11 rounded-full transition-colors ${s?"bg-cyan-500":"bg-slate-700"}`,children:(0,W.jsx)("span",{className:`block h-5 w-5 rounded-full bg-white transition-transform ${s?"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:()=>c(!l),disabled:!s,className:`h-6 w-11 rounded-full transition-colors ${l&&s?"bg-emerald-500":"bg-slate-700"} ${!s?"opacity-50 cursor-not-allowed":""}`,children:(0,W.jsx)("span",{className:`block h-5 w-5 rounded-full bg-white transition-transform ${l&&s?"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)(ob,{type:"number",step:"0.01",min:.6,max:.99,value:u,disabled:!s||!l,onChange:e=>d(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)(ob,{type:"number",step:"1",min:50,max:1e3,value:h,disabled:!s||!l,onChange:e=>f(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)(ov,{size:"sm",onClick:()=>{let e=l$(Number.parseFloat(u),.6,.99),t=Math.floor(l$(Number.parseInt(h,10),50,1e3));a.mutate({openclawAutoMemory:s,openclawAutoMemoryDedupe:l,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)(lu,{size:12,className:"animate-spin"}):null,"Save"]})]})]})}function lU(){let{data:e,isLoading:t}=lF(),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)(lB,{initialAutoMemory:r?.autoMemory??!1,initialDedupe:r?.dedupe??!0,initialNoveltyThreshold:r?.noveltyThreshold??.88,initialMaxRecent:r?.maxRecent??300},n)]})}let lV=(0,oN.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"}]]),lq=(0,oN.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),lK=(0,oN.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"}]]),lW=(0,oN.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),lH="https://api.shieldcortex.ai",lY=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",lX={free:"Free",pro:"Pro",team:"Team",enterprise:"Enterprise"},lG={free:"text-slate-400",pro:"text-cyan-400",team:"text-violet-400",enterprise:"text-amber-400"},lQ={free:"bg-slate-400/10",pro:"bg-cyan-400/10",team:"bg-violet-400/10",enterprise:"bg-amber-400/10"},lZ={pro:{label:"Pro",price:"£29/mo"},team:{label:"Team",price:"£99/mo"}},lJ=["Custom injection patterns","Custom Iron Dome policies","Custom firewall rules","Audit export (JSON/CSV)","Skill scanner deep mode"];function l0(){let e,t,{data:r,isLoading:n}=o$(),i=(e=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>oR(e),onSuccess:()=>{e.invalidateQueries({queryKey:["license-status"]})}})),a=(t=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:oF,onSuccess:()=>{t.invalidateQueries({queryKey:["license-status"]})}})),s=function(){let e=(0,oE.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(`${lH}/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(`${lH}/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)(`${lY}/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)(""),[f,p]=(0,H.useState)("pro"),[m,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)(oq,{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)(lq,{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:lJ.map(e=>(0,W.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[(0,W.jsx)(lK,{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)(ld,{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)(lu,{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:()=>p(e),className:`flex-1 px-3 py-2 text-xs font-medium rounded-lg border transition-colors ${f===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:[lZ[e].label," — ",lZ[e].price]},e))}),(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)("button",{onClick:()=>s.startCheckout(d,f),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)(lu,{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)(lu,{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)(lV,{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)(oq,{size:16,className:lG[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 ${lG[y]} ${lQ[y]}`,children:lX[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(!m),className:"flex items-center gap-1 text-[10px] text-slate-500 hover:text-slate-300 transition-colors mb-2",children:[m?(0,W.jsx)(lW,{size:12}):(0,W.jsx)(o6,{size:12}),m?"Hide features":"Show features"]}),m&&(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)(ld,{size:12,className:"text-emerald-400 shrink-0"}):(0,W.jsx)(lx,{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 ${lG[e.requiredTier]} ${lQ[e.requiredTier]}`,children:lX[e.requiredTier]})]},e.feature))}),(0,W.jsx)("button",{onClick:()=>{confirm(`Remove your ${lX[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 l1=(0,oN.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),l2=(0,oN.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"}]]),l5=(0,oN.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"}]]),l4=(0,oN.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 l3({feature:e,children:t,label:r}){let{data:n}=o$();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)(lK,{size:24,className:"text-slate-500 mb-2"}),(0,W.jsxs)("p",{className:"text-sm font-medium text-slate-300 mb-1",children:[lX[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 ",lX[a],(0,W.jsx)(lf,{size:10})]})]})]})}let l6=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",l8=[{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}],l7=[{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}],l9=[{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}],ce=[{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"}],ct={"File access":45,"Network calls":30,"Process exec":15,"Memory write":10},cr=["Restrict filesystem writes to a sandboxed directory","Add explicit network permission declarations to SKILL.md"];function cn(){let e,t,r,n,{data:i,isLoading:a,isLocked:s}={...e=(0,si.useQuery)({queryKey:["firewall-rules"],queryFn:()=>(0,sa.gatedFetch)(`${l6}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${l6}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:({id:e,...t})=>(0,sa.gatedFetch)(`${l6}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${l6}/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,f]=(0,H.useState)({name:"",priority:100,condition_type:"regex",condition_value:"",action:"block"}),p=i?.rules??[];return s?(0,W.jsx)(ci,{}):(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)(oq,{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:[p.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)(l1,{size:12})," Add Rule"]})]}),u&&(0,W.jsxs)("form",{onSubmit:e=>{e.preventDefault(),o.mutate(h,{onSuccess:()=>{d(!1),f({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=>f(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=>f(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=>f(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=>f(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=>f(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===p.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:p.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)(l4,{size:14,className:"text-cyan-400"}):(0,W.jsx)(l5,{size:14})}),(0,W.jsx)("button",{onClick:()=>c.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(l2,{size:12})})]},e.id))})]})}function ci(){return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oq,{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:l8.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 ca(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(l3,{feature:"custom_firewall_rules",label:"Add custom rules to control what gets blocked, allowed, or quarantined.",children:(0,W.jsx)(cn,{})})})}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)(l0,{}),(0,W.jsx)(lm,{}),(0,W.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,W.jsx)(o9,{timeRange:e}),(0,W.jsx)(le,{}),(0,W.jsx)(lt,{timeRange:e}),(0,W.jsx)(lr,{timeRange:e})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lo,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lk,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lL,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lU,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(ca,{})}),(0,W.jsx)(lp,{})]})}let co=(0,oN.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"}]]),cl=(0,oN.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"}]]),cc=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function cu(){let e=(0,oI.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)(`${cc}/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)(co,{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)(cl,{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)(oK,{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)(co,{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 cd(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(l3,{feature:"audit_export",label:"Export your full audit trail as JSON or CSV for compliance reporting.",children:(0,W.jsx)(cu,{})})})}let ch={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 cf(){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:f,isLoading:p}=(0,oD.useAuditLogs)({startTime:h,source:a,firewallResult:o,project:e||void 0,limit:200}),m=(0,H.useMemo)(()=>f?.logs??[],[f?.logs]),x=(0,H.useCallback)(e=>{if(!t||0===m.length)return;let n=m.findIndex(e=>e.id===t.id);"Escape"===e.key?r(null):"ArrowDown"===e.key&&n<m.length-1?(e.preventDefault(),r(m[n+1])):"ArrowUp"===e.key&&n>0&&(e.preventDefault(),r(m[n-1]))},[t,m,r]);return(0,H.useEffect)(()=>(window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)),[x]),(0,W.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,W.jsxs)("div",{className:"p-4 border-b border-slate-800 shrink-0",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",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:[m.length," entries"]})]})]}),(0,W.jsx)("div",{className:"flex-1 overflow-y-auto",children:p?(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===m.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.jsxs)("table",{className:"w-full text-xs",children:[(0,W.jsx)("thead",{className:"sticky top-0 bg-slate-900",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:m.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 ${ch[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))})]})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(cd,{})})]})}let cp={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"}},cm={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)"}},cx={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 cy(e){return e>=.7?"#22C55E":e>=.4?"#EAB308":"#EF4444"}function cg(e){return e>.5?"#EF4444":e>.2?"#EAB308":"#94a3b8"}function cv({entry:e,onClose:t,onViewMemory:r}){let[n,i]=(0,H.useState)(!1),a=cp[e.firewall_result]||cp.ALLOW,s=cm[e.sensitivity_level]||cm.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)(os,{className:"bg-slate-900 border-slate-700 h-full overflow-auto",children:[(0,W.jsxs)(oo,{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)(ov,{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)(oc,{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:cy(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:cy(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:cg(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:cg(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=cx[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)(ov,{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)(ov,{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 cb=(0,oN.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"}]]),cw=(0,oN.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),cj=(0,oN.default)("square-minus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);function cN({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 store the memory in the database.":"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 ck(){let{projectFilter:e}=(0,sr.useDashboardStore)(),[t,r]=(0,H.useState)("pending"),{data:n,isLoading:i}=(0,oD.useQuarantine)(t,100,e||void 0),a=(0,oD.useApproveQuarantine)(),s=(0,oD.useRejectQuarantine)(),o=(0,oD.useBulkApproveQuarantine)(),l=(0,oD.useBulkRejectQuarantine)(),[c,u]=(0,H.useState)(null),[d,h]=(0,H.useState)(new Set),[f,p]=(0,H.useState)(null),m=n?.items??[],x=m.filter(e=>"pending"===e.status),y=x.length>0&&x.every(e=>d.has(e.id)),g=x.some(e=>d.has(e.id)),v=(0,H.useCallback)(e=>{h(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),b=(0,H.useCallback)(()=>{y?h(new Set):h(new Set(x.map(e=>e.id)))},[y,x]);return(0,W.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[c&&(0,W.jsx)(cN,{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)}),f&&(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"===f?"Approve":"Reject"," ",d.size," item",1!==d.size?"s":"","?"]}),(0,W.jsx)("p",{className:"text-xs text-slate-400 mb-4",children:"approve"===f?"This will store all selected memories in the database.":"This will permanently discard all selected memories."}),(0,W.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,W.jsx)("button",{onClick:()=>p(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(!f||0===d.size)return;let e=Array.from(d);"approve"===f?o.mutate(e):l.mutate(e),h(new Set),p(null)},className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${"approve"===f?"bg-green-600 text-white hover:bg-green-500":"bg-red-600 text-white hover:bg-red-500"}`,children:["approve"===f?"Approve":"Reject"," ",d.size," item",1!==d.size?"s":""]})]})]})}),(0,W.jsxs)("div",{className:"p-4 border-b border-slate-800 shrink-0",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&&x.length>0&&(0,W.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,W.jsxs)("button",{onClick:b,className:"flex items-center gap-1.5 text-xs text-slate-400 hover:text-white transition-colors",children:[y?(0,W.jsx)(cb,{size:14,className:"text-cyan-400"}):g?(0,W.jsx)(cj,{size:14,className:"text-cyan-400"}):(0,W.jsx)(cw,{size:14}),y?"Deselect all":"Select all"]}),g&&(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:()=>p("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)(oS,{size:12})," Approve"]}),(0,W.jsxs)("button",{onClick:()=>p("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)(lh.X,{size:12})," Reject"]})]})]})]}),(0,W.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:i?(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 quarantine items..."})}):0===m.length?(0,W.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-slate-500",children:[(0,W.jsx)(oW,{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:m.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:()=>v(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)(cb,{size:14,className:"text-cyan-400"}):(0,W.jsx)(cw,{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 max-h-24 overflow-y-auto whitespace-pre-wrap",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}),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)(oS,{size:12})," Approve"]}),(0,W.jsxs)("button",{onClick:()=>u({action:"reject",item:e}),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)(lh.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 cS=(0,oN.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"}]]),cO=(0,oN.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 cP=e.i(22934);let cC=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function cE(e,t){let r=new URLSearchParams({timeRange:e});t&&r.set("project",t);let n=await (0,sa.authFetch)(`${cC}/api/v1/agents?${r}`);if(!n.ok)throw Error("Failed to fetch agent registry");return n.json()}async function cA(e,t,r){let n=encodeURIComponent(e),i=new URLSearchParams({timeRange:t});r&&i.set("project",r);let a=await (0,sa.authFetch)(`${cC}/api/v1/agents/${n}/timeline?${i}`);if(!a.ok)throw Error("Failed to fetch agent timeline");return a.json()}async function cM(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)(`${cC}/api/v1/agents/${r}/operations?${n}`);if(!i.ok)throw Error("Failed to fetch agent operations");return i.json()}function cT(e,t){return(0,si.useQuery)({queryKey:["agent-operations",e,t],queryFn:()=>cM(e,t),enabled:!!e,refetchInterval:3e4,retry:2})}function c_(e){return e>=.7?"full":e>=.5?"limited":"restricted"}let cD={full:"text-green-400",limited:"text-yellow-400",restricted:"text-red-400"},cI={full:"bg-green-500/10",limited:"bg-yellow-500/10",restricted:"bg-red-500/10"},cz={full:"Full Access",limited:"Limited",restricted:"Restricted"},cL=460,cR=90;function cF({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:()=>cA(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*cL,s=e=>10+(1-e)*cR,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)*cR,x2:30+cL,y2:10+(1-.7)*cR,stroke:"#22c55e",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,W.jsx)("line",{x1:30,y1:10+.5*cR,x2:30+cL,y2:10+.5*cR,stroke:"#eab308",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,W.jsx)("text",{x:26,y:10+(1-.7)*cR+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.7"}),(0,W.jsx)("text",{x:26,y:10+.5*cR+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+cR+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 c$={BLOCK:"text-red-400 bg-red-500/10",QUARANTINE:"text-yellow-400 bg-yellow-500/10"};function cB({identifier:e}){let{data:t,isLoading:r}=cT(e,{firewallResult:"BLOCK",limit:20}),{data:n}=cT(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 ${c$[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 cU=(0,oN.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"}]]),cV=Y.default.env.NEXT_PUBLIC_WS_URL||"ws://localhost:3001/ws/events";function cq({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(cV);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)(cU,{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 cK({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)(cP.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 cW({score:e}){let t=c_(e);return(0,W.jsxs)("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium ${cD[t]} ${cI[t]}`,children:[e.toFixed(2)," · ",cz[t]]})}function cH({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 cY(){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),[f,p]=(0,H.useState)(!1),[m]=(0,H.useState)(()=>Date.now()),{data:x,isLoading:y}=function(e="24h",t){return(0,si.useQuery)({queryKey:["agents",e,t],queryFn:()=>cE(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=>c_(e.avg_trust_score)===d)),f&&(e=e.filter(e=>e.flagged_count>0)),e},[g,c,d,f]),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]),w=(0,H.useMemo)(()=>[...new Set(g.map(e=>e.source_type))],[g]),j=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)(oG,{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)(cS,{size:12,className:"text-slate-500"}),w.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:()=>p(!f),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors flex items-center gap-0.5 ${f?"bg-red-600/20 text-red-400":"text-slate-500 hover:text-slate-300"}`,children:[(0,W.jsx)(oW,{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:()=>j("avg_trust_score"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Trust ",(0,W.jsx)(cO,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>j("operation_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Ops ",(0,W.jsx)(cO,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>j("flagged_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Flagged ",(0,W.jsx)(cO,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>j("last_seen"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Last seen ",(0,W.jsx)(cO,{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)(cK,{identifier:e.source_identifier,compact:!0}),(0,W.jsx)("div",{className:"mt-0.5",children:(0,W.jsx)(cH,{type:e.source_type})})]}),(0,W.jsx)(cW,{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=m-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)(cK,{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)(cH,{type:n.source_type}),(0,W.jsx)(cW,{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)(cF,{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)(cB,{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)(cq,{agentFilter:n.source_identifier})]})]})})]})}let cX=(0,oN.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"}]]),cG={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 cQ({level:e}){let t=cG[e]??cG.low;return(0,W.jsx)("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${t}`,children:e.toUpperCase()})}function cZ({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)(cQ,{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 cJ(e){let t=e.split(/[/\\]/);return t[t.length-1]||e}function c0({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)(cX,{size:16,className:"text-cyan-400 shrink-0"}):e.safe?(0,W.jsx)(ld,{size:16,className:"text-green-400 shrink-0"}):(0,W.jsx)(lx,{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||cJ(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)(cQ,{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)(o6,{size:14,className:"text-slate-500 shrink-0"}):(0,W.jsx)(cP.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)(cX,{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)(oq,{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)(l2,{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||cJ(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)(cZ,{findings:e.findings})})]})}function c1({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)(c0,{file:e,cloudConnected:t,onTrust:r,onUntrust:n,onRemove:i,onCloudUpsell:a},e.path))})}var c2=e.i(6847);let c5=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function c4(){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)(`${c5}/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)(c3,{}):(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)(oQ,{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)(c2.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)(oW,{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 c3(){return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oQ,{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"}),ce.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)(oW,{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(ct).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:cr.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 c6(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(l3,{feature:"skill_scanner_deep",label:"Deep skill scanning with multi-file analysis and semantic intent detection.",children:(0,W.jsx)(c4,{})})})}let c8=[{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 c7(){let e=lb(),t=(0,oI.useMutation)({mutationFn:lv}),r=(0,oI.useMutation)({mutationFn:lw}),n=(0,oI.useMutation)({mutationFn:lj}),i=(0,oI.useMutation)({mutationFn:lN}),{data:a}=lF(),[s,o]=(0,H.useState)(null),[l,c]=(0,H.useState)(null),[u,d]=(0,H.useState)(!1),[h,f]=(0,H.useState)(""),[p,m]=(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)(lu,{size:14,className:"animate-spin"}):(0,W.jsx)(oQ,{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)(ll,{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)(c1,{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)(lu,{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)(oQ,{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)(o6,{size:14}):(0,W.jsx)(cP.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=>f(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:p,onChange:e=>m(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:c8.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:p||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)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(oQ,{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)(cQ,{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)(cZ,{findings:l.findings})]})]})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(c6,{})})]})}let c9=(0,oN.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"}]]),ue=(0,oN.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"}]]),ut=(0,oN.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"}]]),ur=(0,oN.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"}]]),un=(0,oN.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"}]]),ui=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function ua(){let e,t,r,{data:n,isLoading:i,isLocked:a}={...e=(0,si.useQuery)({queryKey:["custom-patterns"],queryFn:()=>(0,sa.gatedFetch)(`${ui}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${ui}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${ui}/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,oI.useMutation)({mutationFn:({id:e,text:t})=>(0,sa.gatedFetch)(`${ui}/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),[f,p]=(0,H.useState)({name:"",category:"custom",severity:"medium",regex:"",description:""}),m=n?.patterns??[],x=!0,y="";if(f.regex)try{new RegExp(f.regex)}catch(e){x=!1,y=e.message}return a?(0,W.jsx)(us,{}):(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 Injection Patterns"}),(0,W.jsxs)("span",{className:"text-xs text-slate-500",children:[m.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)(l1,{size:12})," Add Pattern"]})]}),c&&(0,W.jsxs)("form",{onSubmit:e=>{e.preventDefault(),s.mutate(f,{onSuccess:()=>{u(!1),p({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:f.name,onChange:e=>p(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:f.severity,onChange:e=>p(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:f.regex,onChange:e=>p(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:f.description,onChange:e=>p(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===m.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:m.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)(un,{size:12})}),(0,W.jsx)("button",{onClick:()=>o.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(l2,{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 us(){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 Injection Patterns"}),(0,W.jsx)("span",{className:"text-xs text-slate-500",children:"0/50"})]}),(0,W.jsx)("div",{className:"space-y-1",children:l7.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 uo(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(l3,{feature:"custom_injection_patterns",label:"Define up to 50 custom regex patterns for detecting domain-specific threats.",children:(0,W.jsx)(ua,{})})})}let ul=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function uc(){let e,t,r,n,{data:i,isLoading:a,isLocked:s}={...e=(0,si.useQuery)({queryKey:["custom-policies"],queryFn:()=>(0,sa.gatedFetch)(`${ul}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${ul}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${ul}/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,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>(0,sa.gatedFetch)(`${ul}/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,f]=(0,H.useState)({name:"",description:""}),p=i?.policies??[];return s?(0,W.jsx)(uu,{}):(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)(oq,{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:[p.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)(l1,{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),f({name:"",description:""})}})},className:"p-3 bg-slate-800/50 rounded-lg space-y-2",children:[(0,W.jsx)("input",{value:h.name,onChange:e=>f(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=>f(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===p.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:p.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)(oS,{size:10})," Activate"]}),(0,W.jsx)("button",{onClick:()=>l.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(l2,{size:12})})]},e.id))})]})}function uu(){return(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oq,{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:l9.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 ud(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(l3,{feature:"custom_iron_dome_policies",label:"Create custom Iron Dome policies with tailored action gates and trust levels.",children:(0,W.jsx)(uc,{})})})}let uh=[{id:"personal",label:"Personal",description:"Lighter touch for solo use",icon:oq},{id:"enterprise",label:"Enterprise",description:"Financial & data protection",icon:lK},{id:"school",label:"School",description:"GDPR strict, pupil data guarded",icon:oG},{id:"paranoid",label:"Paranoid",description:"Everything requires approval",icon:oW}],uf=[{name:"Injection Scanner",description:"40+ patterns across 8 categories",icon:ut},{name:"Instruction Gateway",description:"Trusted channel validation",icon:c9},{name:"Action Gate",description:"Approve / block external actions",icon:lK},{name:"PII Guard",description:"Block sensitive data output",icon:o4},{name:"Kill Switch",description:"Emergency stop phrase",icon:ue},{name:"Sub-Agent Control",description:"Restrict spawned agent operations",icon:oG}],up={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"},um={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 ux(){let e,t,r,{data:n,isLoading:i}=lD(),{data:a}=lI(50),s=(e=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>lP(e),onSuccess:()=>{e.invalidateQueries({queryKey:["iron-dome-status"]}),e.invalidateQueries({queryKey:["iron-dome-audit"]})}})),o=(t=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:lC,onSuccess:()=>{t.invalidateQueries({queryKey:["iron-dome-status"]})}})),l=(0,oI.useMutation)({mutationFn:lE}),c=lz(),u=(r=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>lM(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:lT,refetchInterval:5e3,retry:2}),[h,f]=(0,H.useState)(""),[p,m]=(0,H.useState)(null),[x,y]=(0,H.useState)(""),g=n?.enabled??!1,v=d?.killSwitchActive??!1,b=d?.killSwitchMeta??null,w=n?.profile,j=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)(oZ,{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)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(ue,{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:uh.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 ${w===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:uf.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&&j&&(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:j.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:j.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:j.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)(ur,{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)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(un,{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)(ur,{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."}),j?.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:['"',j.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)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(ur,{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)(ut,{size:14,className:"inline mr-1.5 text-red-400"}),"Injection Scanner"]}),(0,W.jsx)("textarea",{value:h,onChange:e=>f(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=>m(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)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(oZ,{size:12}),"Scan"]}),p&&(0,W.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[p.clean?(0,W.jsx)(ld,{size:14,className:"text-green-400"}):(0,W.jsx)(lx,{size:14,className:"text-red-400"}),(0,W.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${um[p.riskLevel]??"bg-slate-500/20 text-slate-400"}`,children:p.riskLevel}),(0,W.jsx)("span",{className:"text-xs text-slate-400",children:p.summary})]}),p.detections.map((e,t)=>(0,W.jsxs)("div",{className:`border rounded-lg p-3 ${up[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)(oq,{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)(uo,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(ud,{})})]})}let uy=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",ug={architecture:"#3b82f6",error:"#ef4444",pattern:"#8b5cf6",preference:"#f59e0b",learning:"#10b981",context:"#6366f1",todo:"#f97316",note:"#94a3b8",relationship:"#ec4899",custom:"#64748b"},uv={short_term:"STM",long_term:"LTM",episodic:"Episodic"},ub={short_term:"#22d3ee",long_term:"#a78bfa",episodic:"#f472b6"},uw=["architecture","pattern","preference","error","context","learning","todo","note","relationship","custom"],uj=[{label:"All",value:"all"},{label:"STM",value:"short_term"},{label:"LTM",value:"long_term"},{label:"Episodic",value:"episodic"}];function uN(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function uk({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)(""),f=(0,H.useRef)(null),p=(0,H.useRef)(new Map),[m,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)(`${uy}/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)(()=>(f.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"}),()=>f.current?.disconnect()),[]);let y=(0,H.useCallback)(e=>t=>{t&&(p.current.set(e,t),f.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=uN(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=uN(t.toISOString()),n=new Date(t);n.setDate(n.getDate()-1);let i=uN(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"}),uj.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"}),uw.map(e=>{let t=o.has(e),r=ug[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=ug[e.category]??"#64748b",s=ub[e.type]??"#94a3b8",o=uv[e.type]??e.type,l=m.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))]})})]})}let uS=(0,oN.default)("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var uO=Symbol.for("immer-nothing"),uP=Symbol.for("immer-draftable"),uC=Symbol.for("immer-state");function uE(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var uA=Object,uM=uA.getPrototypeOf,uT="constructor",u_="prototype",uD="configurable",uI="enumerable",uz="writable",uL="value",uR=e=>!!e&&!!e[uC];function uF(e){return!!e&&(uU(e)||uY(e)||!!e[uP]||!!e[uT]?.[uP]||uX(e)||uG(e))}var u$=uA[u_][uT].toString(),uB=new WeakMap;function uU(e){if(!e||!uQ(e))return!1;let t=uM(e);if(null===t||t===uA[u_])return!0;let r=uA.hasOwnProperty.call(t,uT)&&t[uT];if(r===Object)return!0;if(!uZ(r))return!1;let n=uB.get(r);return void 0===n&&(n=Function.toString.call(r),uB.set(r,n)),n===u$}function uV(e,t,r=!0){0===uq(e)?(r?Reflect.ownKeys(e):uA.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function uq(e){let t=e[uC];return t?t.type_:uY(e)?1:uX(e)?2:3*!!uG(e)}var uK=(e,t,r=uq(e))=>2===r?e.has(t):uA[u_].hasOwnProperty.call(e,t),uW=(e,t,r=uq(e))=>2===r?e.get(t):e[t],uH=(e,t,r,n=uq(e))=>{2===n?e.set(t,r):3===n?e.add(r):e[t]=r},uY=Array.isArray,uX=e=>e instanceof Map,uG=e=>e instanceof Set,uQ=e=>"object"==typeof e,uZ=e=>"function"==typeof e,uJ=e=>e.modified_?e.copy_:e.base_;function u0(e,t){if(uX(e))return new Map(e);if(uG(e))return new Set(e);if(uY(e))return Array[u_].slice.call(e);let r=uU(e);if(!0!==t&&("class_only"!==t||r)){let t=uM(e);if(null!==t&&r)return{...e};let n=uA.create(t);return uA.assign(n,e)}{let t=uA.getOwnPropertyDescriptors(e);delete t[uC];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){let i=r[n],a=t[i];!1===a[uz]&&(a[uz]=!0,a[uD]=!0),(a.get||a.set)&&(t[i]={[uD]:!0,[uz]:!0,[uI]:a[uI],[uL]:e[i]})}return uA.create(uM(e),t)}}function u1(e,t=!1){return u5(e)||uR(e)||!uF(e)||(uq(e)>1&&uA.defineProperties(e,{set:u2,add:u2,clear:u2,delete:u2}),uA.freeze(e),t&&uV(e,(e,t)=>{u1(t,!0)},!1)),e}var u2={[uL]:function(){uE(2)}};function u5(e){return!(null!==e&&uQ(e))||uA.isFrozen(e)}var u4="MapSet",u3="Patches",u6="ArrayMethods",u8={};function u7(e){let t=u8[e];return t||uE(0,e),t}var u9=e=>!!u8[e];function de(e,t){t&&(e.patchPlugin_=u7(u3),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function dt(e){dr(e),e.drafts_.forEach(di),e.drafts_=null}function dr(e){e===p&&(p=e.parent_)}var dn=e=>p={drafts_:[],parent_:p,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:u9(u4)?u7(u4):void 0,arrayMethodsPlugin_:u9(u6)?u7(u6):void 0};function di(e){let t=e[uC];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function da(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(void 0!==e&&e!==r){r[uC].modified_&&(dt(t),uE(4)),uF(e)&&(e=ds(t,e));let{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[uC].base_,e,t)}else e=ds(t,r);return function(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&u1(t,r)}(t,e,!0),dt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==uO?e:void 0}function ds(e,t){if(u5(t))return t;let r=t[uC];if(!r)return df(t,e.handledSet_,e);if(!dc(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);dh(r,e)}return r.copy_}function dl(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dc=(e,t)=>e.scope_===t,du=[];function dd(e,t,r,n){let i=e.copy_||e.base_,a=e.type_;if(void 0!==n&&uW(i,n,a)===t)return void uH(i,n,r,a);if(!e.draftLocations_){let t=e.draftLocations_=new Map;uV(i,(e,r)=>{if(uR(r)){let n=t.get(r)||[];n.push(e),t.set(r,n)}})}for(let n of e.draftLocations_.get(t)??du)uH(i,n,r,a)}function dh(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)}dl(e)}}function df(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||uR(e)||t.has(e)||!uF(e)||u5(e)||(t.add(e),uV(e,(n,i)=>{if(uR(i)){let t=i[uC];dc(t,r)&&(uH(e,n,uJ(t),e.type_),dl(t))}else uF(i)&&df(i,t,r)})),e}var dp={get(e,t){let r;if(t===uC)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(!uK(a,t,e.type_)){var s;let r;return s=e,(r=dy(a,t))?uL in r?r[uL]:r.get?.call(s.draft_):void 0}let o=a[t];if(e.finalized_||!uF(o)||i&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(r=+t)&&String(r)===t)return o;if(o===dx(e.base_,t)){dv(e);let r=1===e.type_?+t:t,n=db(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=dy(e.copy_||e.base_,t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=dx(e.copy_||e.base_,t),i=n?.[uC];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||uK(e.base_,t,e.type_)))return!0;dv(e),dg(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(uR(r)){let i=r[uC];dc(i,n)&&i.callbacks_.push(function(){dv(e),dd(e,r,uJ(i),t)})}else uF(r)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(r)&&df(r,n.handledSet_,n):uW(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&df(uW(e.copy_,t,e.type_),n.handledSet_,n)})}(e,t,r),!0)},deleteProperty:(e,t)=>(dv(e),void 0!==dx(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),dg(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?{[uz]:!0,[uD]:1!==e.type_||"length"!==t,[uI]:n[uI],[uL]:r[t]}:n},defineProperty(){uE(11)},getPrototypeOf:e=>uM(e.base_),setPrototypeOf(){uE(12)}},dm={};for(let e in dp){let t=dp[e];dm[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function dx(e,t){let r=e[uC];return(r?r.copy_||r.base_:e)[t]}function dy(e,t){if(!(t in e))return;let r=uM(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=uM(r)}}function dg(e){!e.modified_&&(e.modified_=!0,e.parent_&&dg(e.parent_))}function dv(e){e.copy_||(e.assigned_=new Map,e.copy_=u0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function db(e,t,r,n){let[i,a]=uX(t)?u7(u4).proxyMap_(t,r):uG(t)?u7(u4).proxySet_(t,r):function(e,t){let r=uY(e),n={type_:+!!r,scope_:t?t.scope_:p,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=dp;r&&(i=[n],a=dm);let{revoke:s,proxy:o}=Proxy.revocable(i,a);return n.draft_=o,n.revoke_=s,[o,n]}(t,r);if((r?.scope_??p).drafts_.push(i),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&void 0!==n)r.callbacks_.push(function(e){if(!a||!dc(a,e))return;e.mapSetPlugin_?.fixSetContents(a);let t=uJ(a);dd(r,a.draft_??a,t,n),dh(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 dw(e){return uR(e)||uE(10,e),function e(t){let r;if(!uF(t)||u5(t))return t;let n=t[uC],i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=u0(t,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=u0(t,!0);return uV(r,(t,n)=>{uH(r,t,e(n))},i),n&&(n.finalized_=!1),r}(e)}dm.deleteProperty=function(e,t){return dm.set.call(this,e,t,void 0)},dm.set=function(e,t,r){return dp.set.call(this,e[0],t,r,e[0])};var dj=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{let n;if(uZ(e)&&!uZ(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(uZ(t)||uE(6),void 0===r||uZ(r)||uE(7),uF(e)){let i=dn(this),a=db(i,e,void 0),s=!0;try{n=t(a),s=!1}finally{s?dt(i):dr(i)}return de(i,r),da(n,i)}if(e&&uQ(e))uE(1,e);else{if(void 0===(n=t(e))&&(n=e),n===uO&&(n=void 0),this.autoFreeze_&&u1(n,!0),r){let t=[],i=[];u7(u3).generateReplacementPatches_(e,n,{patches_:t,inversePatches_:i}),r(t,i)}return n}},this.produceWithPatches=(e,t)=>{let r,n;return uZ(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){uF(e)||uE(8),uR(e)&&(e=dw(e));let t=dn(this),r=db(t,e,void 0);return r[uC].isManual_=!0,dr(t),r}finishDraft(e,t){let r=e&&e[uC];r&&r.isManual_||uE(9);let{scope_:n}=r;return de(n,t),da(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=u7(u3).applyPatches_;return uR(e)?n(e,t):this.produce(e,e=>n(e,t))}}().produce,dN=e=>Array.isArray(e)?e:[e],dk=0,dS=class{revision=dk;_value;_lastValue;_isEqual=dO;constructor(e,t=dO){this._value=this._lastValue=e,this._isEqual=t}get value(){return this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++dk)}};function dO(e,t){return e===t}function dP(e){return e instanceof dS||console.warn("Not a valid cell! ",e),e.value}var dC=(e,t)=>!1;function dE(){return function(e,t=dO){return new dS(null,t)}(0,dC)}var dA=e=>{let t=e.collectionTag;null===t&&(t=e.collectionTag=dE()),dP(t)};Symbol();var dM=0,dT=Object.getPrototypeOf({}),d_=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,dD);tag=dE();tags={};children={};collectionTag=null;id=dM++},dD={get:(e,t)=>(function(){let{value:r}=e,n=Reflect.get(r,t);if("symbol"==typeof t||t in dT)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 dI(i):new d_(i)),r.tag&&dP(r.tag),r.proxy}{let r=e.tags[t];return void 0===r&&((r=e.tags[t]=dE()).value=n),dP(r),n}})(),ownKeys:e=>(dA(e),Reflect.ownKeys(e.value)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e.value,t),has:(e,t)=>Reflect.has(e.value,t)},dI=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],dz);tag=dE();tags={};children={};collectionTag=null;id=dM++},dz={get:([e],t)=>("length"===t&&dA(e),dD.get(e,t)),ownKeys:([e])=>dD.ownKeys(e),getOwnPropertyDescriptor:([e],t)=>dD.getOwnPropertyDescriptor(e,t),has:([e],t)=>dD.has(e,t)},dL="u">typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function dR(){return{s:0,v:void 0,o:null,p:null}}function dF(e,t={}){let r,n=dR(),{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=dR(),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=dR(),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 dL(t):t}return l.s=1,l.v=t,t}return s.clearCache=()=>{n=dR(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}var d$=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=dF,argsMemoizeOptions:d=[],devModeChecks:h={}}={...r,...s},f=dN(c),p=dN(d),m=(!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)},...f);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}(m,arguments);return n=x.apply(null,e)},...p),{resultFunc:o,memoizedResultFunc:x,dependencies:m,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>n,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:l,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}(dF),dB=Object.assign((e,t=d$)=>{!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:()=>dB});function dU(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 dV="function"==typeof Symbol&&Symbol.observable||"@@observable",dq=()=>Math.random().toString(36).substring(7).split("").join("."),dK={INIT:`@@redux/INIT${dq()}`,REPLACE:`@@redux/REPLACE${dq()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${dq()}`};function dW(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 dH(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:dK.INIT}))throw Error(dU(12));if(void 0===t(void 0,{type:dK.PROBE_UNKNOWN_ACTION()}))throw Error(dU(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(dU(14));s[o]=u,a=a||u!==c}return(a=a||i.length!==Object.keys(e).length)?s:e}}function dY(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function dX(e){return dW(e)&&"type"in e&&"string"==typeof e.type}function dG(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var dQ=dG(),dZ="u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?dY:dY.apply(null,arguments)};function dJ(e,t){function r(...n){if(t){let r=t(...n);if(!r)throw Error(hT(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=>dX(t)&&t.type===e,r}"u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var d0=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 d1(e){return uF(e)?dj(e,()=>{}):e}function d2(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var d5="RTK_autoBatch",d4=()=>e=>({payload:e,meta:{[d5]:!0}}),d3=e=>t=>{setTimeout(t,e)},d6=(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:d3(10):"callback"===e.type?e.queueNotification:d3(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?.[d5]))&&!s&&(s=!0,l(c)),n.dispatch(e)}finally{i=!0}}})};function d8(e){let t,r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw Error(hT(28));if(n in r)throw Error(hT(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 d7=Symbol.for("rtk-slice-createasyncthunk"),d9=((d=d9||{}).reducer="reducer",d.reducerWithPrepare="reducerWithPrepare",d.asyncThunk="asyncThunk",d),he=function({creators:e}={}){let t=e?.asyncThunk?.[d7];return function(e){let r,{name:n,reducerPath:i=n}=e;if(!n)throw Error(hT(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(hT(12));if(r in l)throw Error(hT(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?d8(e.extraReducers):[e.extraReducers],i={...t,...l};return function(e,t){let r,[n,i,a]=d8(t);if("function"==typeof e)r=()=>d1(e());else{let t=d1(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(uR(e)){let n=r(e,t);return void 0===n?e:n}else{if(uF(e))return dj(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(hT(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||ht,pending:o||ht,rejected:l||ht,settled:c||ht})}(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(hT(17));a=n.reducer,s=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?dJ(e,s):dJ(e))}(s,i,d)});let f=e=>e,p=new Map,m=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=d2(m,n,y)),i}function i(t=f){let n=d2(p,r,()=>new WeakMap);return d2(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,()=>d2(m,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 ht(){}var hr="listener",hn="completed",hi="cancelled",ha=`task-${hi}`,hs=`task-${hn}`,ho=`${hr}-${hi}`,hl=`${hr}-${hn}`,hc=class{constructor(e){this.code=e,this.message=`task ${hi} (reason: ${e})`}name="TaskAbortError";message},hu=(e,t)=>{if("function"!=typeof e)throw TypeError(hT(32))},hd=()=>{},hh=(e,t=hd)=>(e.catch(t),e),hf=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),hp=e=>{if(e.aborted)throw new hc(e.reason)};function hm(e,t){let r=hd;return new Promise((n,i)=>{let a=()=>i(new hc(e.reason));e.aborted?a():(r=hf(e,a),t.finally(()=>r()).then(n,i))}).finally(()=>{r=hd})}var hx=async(e,t)=>{try{await Promise.resolve();let t=await e();return{status:"ok",value:t}}catch(e){return{status:e instanceof hc?"cancelled":"rejected",error:e}}finally{t?.()}},hy=e=>t=>hh(hm(e,t).then(t=>(hp(e),t))),hg=e=>{let t=hy(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:hv}=Object,hb={},hw="listenerMiddleware",hj=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=dJ(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(i);else throw Error(hT(21));return hu(a,"options.listener"),{predicate:i,type:t,effect:a}},hN=hv(e=>{let{type:t,predicate:r,effect:n}=hj(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(hT(22))}}},{withTypes:()=>hN}),hk=(e,t)=>{let{type:r,effect:n,predicate:i}=hj(t);return Array.from(e.values()).find(e=>("string"==typeof r?e.type===r:e.predicate===i)&&e.effect===n)},hS=e=>{e.pending.forEach(e=>{e.abort(ho)})},hO=(e,t,r)=>{try{e(t,r)}catch(e){setTimeout(()=>{throw e},0)}},hP=hv(dJ(`${hw}/add`),{withTypes:()=>hP}),hC=dJ(`${hw}/removeAll`),hE=hv(dJ(`${hw}/remove`),{withTypes:()=>hE}),hA=(...e)=>{console.error(`${hw}/error`,...e)},hM=(e={})=>{let t=new Map,r=new Map,{extra:n,onError:i=hA}=e;hu(i,"onError");let a=e=>{var r;return(r=hk(t,e)??hN(e)).unsubscribe=()=>t.delete(r.id),t.set(r.id,r),e=>{r.unsubscribe(),e?.cancelActive&&hS(r)}};hv(a,{withTypes:()=>a});let s=e=>{let r=hk(t,e);return r&&(r.unsubscribe(),e.cancelActive&&hS(r)),!!r};hv(s,{withTypes:()=>s});let o=async(e,s,o,l)=>{var c,u;let d,h=new AbortController,f=(c=h.signal,d=async(e,t)=>{hp(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 hm(c,Promise.race(n));return hp(c),e}finally{r()}},(e,t)=>hh(d(e,t))),p=[];try{let i;e.pending.add(h),i=r.get(e)??0,r.set(e,i+1),await Promise.resolve(e.effect(s,hv({},o,{getOriginalState:l,condition:(e,t)=>f(e,t).then(Boolean),take:f,delay:hg(h.signal),pause:hy(h.signal),extra:n,signal:h.signal,fork:(u=h.signal,(e,t)=>{hu(e,"taskExecutor");let r=new AbortController;hf(u,()=>r.abort(u.reason));let n=hx(async()=>{hp(u),hp(r.signal);let t=await e({pause:hy(r.signal),delay:hg(r.signal),signal:r.signal});return hp(r.signal),t},()=>r.abort(hs));return t?.autoJoin&&p.push(n.catch(hd)),{result:hy(u)(n),cancel(){r.abort(ha)}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,r)=>{e!==h&&(e.abort(ho),r.delete(e))})},cancel:()=>{h.abort(ho),e.pending.delete(h)},throwIfCancelled:()=>{hp(h.signal)}})))}catch(e){e instanceof hc||hO(i,e,{raisedBy:"effect"})}finally{let t;await Promise.all(p),h.abort(hl),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())hS(e);t.clear()};return{middleware:e=>r=>n=>{let c;if(!dX(n))return r(n);if(hP.match(n))return a(n.payload);if(hC.match(n))return void l();if(hE.match(n))return s(n.payload);let u=e.getState(),d=()=>{if(u===hb)throw Error(hT(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,hO(i,e,{raisedBy:"predicate"})}t&&o(a,n,e,d)}}}finally{u=hb}return c},startListening:a,stopListening:s,clearListeners:l}};function hT(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 h_=e.i(78712);function hD(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 hI(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+hD(i)+t:e+t},"")}var hz=e=>0===e?0:e>0?1:-1,hL=e=>"number"==typeof e&&e!=+e,hR=e=>"string"==typeof e&&e.indexOf("%")===e.length-1,hF=e=>("number"==typeof e||e instanceof Number)&&!hL(e),h$=e=>hF(e)||"string"==typeof e,hB=0,hU=e=>{var t=++hB;return"".concat(e||"").concat(t)},hV=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(!hF(e)&&"string"!=typeof e)return n;if(hR(e)){if(null==t)return n;var a=e.indexOf("%");r=t*parseFloat(e.slice(0,a))/100}else r=+e;return hL(r)&&(r=n),i&&null!=t&&r>t&&(r=t),r},hq=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 hK(e,t,r){return hF(e)&&hF(t)?hD(e+r*(t-e)):t}var hW=e=>null==e?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function hH(e){return null!=e}function hY(){}var hX=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!hL(r))return e[r]}},hG=he({name:"options",initialState:{chartName:"",tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},reducers:{createEventEmitter:e=>{null==e.eventEmitter&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),hQ=hG.reducer,{createEventEmitter:hZ}=hG.actions,hJ=(e.i(8710),{notify(){},get:()=>[]}),h0="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,h1="u">typeof navigator&&"ReactNative"===navigator.product,h2=h0||h1?H.useLayoutEffect:H.useEffect;function h5(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}var h4=Symbol.for("react-redux-context"),h3="u">typeof globalThis?globalThis:{},h6=function(){if(!H.createContext)return{};let e=h3[h4]??=new Map,t=e.get(H.createContext);return t||(t=H.createContext(null),e.set(H.createContext,t)),t}(),h8=function(e){let{children:t,context:r,serverState:n,store:i}=e,a=H.useMemo(()=>{let e=function(e,t){let r,n=hJ,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=hJ)}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 h2(()=>{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||h6).Provider,{value:a},t)};function h7(e=h6){return function(){return H.useContext(e)}}var h9=h7(),fe=Symbol.for("immer-nothing"),ft=Symbol.for("immer-draftable"),fr=Symbol.for("immer-state");function fn(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fi=Object.getPrototypeOf;function fa(e){return!!e&&!!e[fr]}function fs(e){return!!e&&(fc(e)||Array.isArray(e)||!!e[ft]||!!e.constructor?.[ft]||fp(e)||fm(e))}var fo=Object.prototype.constructor.toString(),fl=new WeakMap;function fc(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=fl.get(r);return void 0===n&&(n=Function.toString.call(r),fl.set(r,n)),n===fo}function fu(e,t,r=!0){0===fd(e)?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function fd(e){let t=e[fr];return t?t.type_:Array.isArray(e)?1:fp(e)?2:3*!!fm(e)}function fh(e,t){return 2===fd(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ff(e,t,r){let n=fd(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function fp(e){return e instanceof Map}function fm(e){return e instanceof Set}function fx(e){return e.copy_||e.base_}function fy(e,t){if(fp(e))return new Map(e);if(fm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=fc(e);if(!0!==t&&("class_only"!==t||r)){let t=fi(e);return null!==t&&r?{...e}:Object.assign(Object.create(t),e)}{let t=Object.getOwnPropertyDescriptors(e);delete t[fr];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(fi(e),t)}}function fg(e,t=!1){return fb(e)||fa(e)||!fs(e)||(fd(e)>1&&Object.defineProperties(e,{set:fv,add:fv,clear:fv,delete:fv}),Object.freeze(e),t&&Object.values(e).forEach(e=>fg(e,!0))),e}var fv={value:function(){fn(2)}};function fb(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var fw={};function fj(e){let t=fw[e];return t||fn(0,e),t}function fN(e,t){t&&(fj("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fk(e){fS(e),e.drafts_.forEach(fP),e.drafts_=null}function fS(e){e===m&&(m=e.parent_)}function fO(e){return m={drafts_:[],parent_:m,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function fP(e){let t=e[fr];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function fC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return void 0!==e&&e!==r?(r[fr].modified_&&(fk(t),fn(4)),fs(e)&&(e=fE(t,e),t.parent_||fM(t,e)),t.patches_&&fj("Patches").generateReplacementPatches_(r[fr].base_,e,t.patches_,t.inversePatches_)):e=fE(t,r,[]),fk(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fe?e:void 0}function fE(e,t,r){if(fb(t))return t;let n=e.immer_.shouldUseStrictIteration(),i=t[fr];if(!i)return fu(t,(n,a)=>fA(e,i,t,n,a,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return fM(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),fu(a,(n,a)=>fA(e,i,t,n,a,r,s),n),fM(e,t,!1),r&&e.patches_&&fj("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function fA(e,t,r,n,i,a,s){if(null==i||"object"!=typeof i&&!s)return;let o=fb(i);if(!o||s){if(fa(i)){let s=fE(e,i,a&&t&&3!==t.type_&&!fh(t.assigned_,n)?a.concat(n):void 0);if(ff(r,n,s),!fa(s))return;e.canAutoFreeze_=!1}else s&&r.add(i);if(fs(i)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&o)return;fE(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&(fp(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&fM(e,i)}}}function fM(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fg(t,r)}var fT={get(e,t){if(t===fr)return e;let r=fx(e);if(!fh(r,t)){var n;let i;return n=e,(i=fI(r,t))?"value"in i?i.value:i.get?.call(n.draft_):void 0}let i=r[t];return e.finalized_||!fs(i)?i:i===fD(e.base_,t)?(fL(e),e.copy_[t]=fF(i,e)):i},has:(e,t)=>t in fx(e),ownKeys:e=>Reflect.ownKeys(fx(e)),set(e,t,r){let n=fI(fx(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=fD(fx(e),t),i=n?.[fr];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||fh(e.base_,t)))return!0;fL(e),fz(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!==fD(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,fL(e),fz(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=fx(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){fn(11)},getPrototypeOf:e=>fi(e.base_),setPrototypeOf(){fn(12)}},f_={};function fD(e,t){let r=e[fr];return(r?fx(r):e)[t]}function fI(e,t){if(!(t in e))return;let r=fi(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=fi(r)}}function fz(e){!e.modified_&&(e.modified_=!0,e.parent_&&fz(e.parent_))}function fL(e){e.copy_||(e.copy_=fy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}fu(fT,(e,t)=>{f_[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),f_.deleteProperty=function(e,t){return f_.set.call(this,e,t,void 0)},f_.set=function(e,t,r){return fT.set.call(this,e[0],t,r,e[0])};var fR=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&&fn(6),void 0!==r&&"function"!=typeof r&&fn(7),fs(e)){let i=fO(this),a=fF(e,void 0),s=!0;try{n=t(a),s=!1}finally{s?fk(i):fS(i)}return fN(i,r),fC(n,i)}if(e&&"object"==typeof e)fn(1,e);else{if(void 0===(n=t(e))&&(n=e),n===fe&&(n=void 0),this.autoFreeze_&&fg(n,!0),r){let t=[],i=[];fj("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;fs(e)||fn(8),fa(e)&&(fa(t=e)||fn(10,t),e=function e(t){let r;if(!fs(t)||fb(t))return t;let n=t[fr],i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=fy(t,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=fy(t,!0);return fu(r,(t,n)=>{ff(r,t,e(n))},i),n&&(n.finalized_=!1),r}(t));let r=fO(this),n=fF(e,void 0);return n[fr].isManual_=!0,fS(r),n}finishDraft(e,t){let r=e&&e[fr];r&&r.isManual_||fn(9);let{scope_:n}=r;return fN(n,t),fC(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=fj("Patches").applyPatches_;return fa(e)?n(e,t):this.produce(e,e=>n(e,t))}};function fF(e,t){let r=fp(e)?fj("MapSet").proxyMap_(e,t):fm(e)?fj("MapSet").proxySet_(e,t):function(e,t){let r=Array.isArray(e),n={type_:+!!r,scope_:t?t.scope_:m,modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,a=fT;r&&(i=[n],a=f_);let{revoke:s,proxy:o}=Proxy.revocable(i,a);return n.draft_=o,n.revoke_=s,o}(e,t);return(t?t.scope_:m).drafts_.push(r),r}new fR().produce;var f$={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},fB=he({name:"tooltip",initialState:{itemInteraction:{click:f$,hover:f$},axisInteraction:{click:f$,hover:f$},keyboardInteraction:f$,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:d4()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,i=dw(e).tooltipItemPayloads.indexOf(r);i>-1&&(e.tooltipItemPayloads[i]=n)},prepare:d4()},removeTooltipEntrySettings:{reducer(e,t){var r=dw(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:d4()},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:fU,replaceTooltipEntrySettings:fV,removeTooltipEntrySettings:fq,setTooltipSettingsState:fK,setActiveMouseOverItemIndex:fW,mouseLeaveItem:fH,mouseLeaveChart:fY,setActiveClickItemIndex:fX,setMouseOverAxisIndex:fG,setMouseClickAxisIndex:fQ,setSyncInteraction:fZ,setKeyboardInteraction:fJ}=fB.actions,f0=fB.reducer,f1=he({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:f2,setDataStartEndIndexes:f5,setComputedData:f4}=f1.actions,f3=f1.reducer,f6=he({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:f8,setLayout:f7,setChartSize:f9,setScale:pe}=f6.actions,pt=f6.reducer,pr=e.i(27688),pn=(0,H.createContext)(null),pi=e=>e,pa=()=>{var e=(0,H.useContext)(pn);return e?e.store.dispatch:pi},ps=()=>{},po=()=>ps,pl=(e,t)=>e===t;function pc(e){var t=(0,H.useContext)(pn),r=(0,H.useMemo)(()=>t?t=>{if(null!=t)return e(t)}:ps,[t,e]);return(0,pr.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:po,t?t.store.getState:ps,t?t.store.getState:ps,r,pl)}var pu=e.i(28914),pd=e=>e.legend.settings;function ph(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function pf(e){return function(){return e}}function pp(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 pm(e){for(var t=e.length,r=Array(t);--t>=0;)r[t]=t;return r}function px(e,t){return e[t]}function py(e){let t=[];return t.key=e,t}function pg(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function pv(e){return Number.isFinite(e)}function pb(e){return"number"==typeof e&&e>0&&Number.isFinite(e)}function pw(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 pj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pw(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)):pw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function pN(e,t,r){return null==e||null==t?r:h$(t)?(0,h_.default)(e,t,r):"function"==typeof t?t(e):r}d$([e=>e.legend.payload,pd],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?(0,pu.default)(n,r):n}),Array.prototype.slice;var pk=(e,t)=>"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t,pS={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=hL(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}pp(e,t)}},none:pp,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}pp(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,f=0;f<o;++f){var p=e[t[f]];h+=(p[s][1]||0)-(p[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,pp(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=hL(l[1])?l[0]:l[1];c>=0?(l[0]=a,a+=c,l[1]=a):(l[0]=0,l[1]=0)}}}}},pO=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=pN(a,t.dataKey,t.scale.domain()[s]);if(null==o)return null;var l=t.scale.map(o);return hF(l)?l-i/2+n:null},pP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pE=(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,pu.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 pA(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:i,name:a}=e;return pj(pj({},t),{},{dataKey:r,payload:n,value:i,name:a})}function pM(e,t){return e?String(e):"string"==typeof t?t:void 0}var pT=e=>e.layout.width,p_=e=>e.layout.height,pD=e=>e.layout.scale,pI=e=>e.layout.margin,pz=d$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),pL=d$(e=>e.cartesianAxis.yAxis,e=>Object.values(e));function pR(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?pR(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)):pR(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var p$=d$([pT,p_,pI,e=>e.brush.height,function(e){return pL(e).reduce((e,t)=>"left"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:60),0)},function(e){return pL(e).reduce((e,t)=>"right"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:60),0)},function(e){return pz(e).reduce((e,t)=>"top"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},function(e){return pz(e).reduce((e,t)=>"bottom"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},pd,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=pF(pF({},{top:(r.top||0)+s,bottom:(r.bottom||0)+o}),u),h=d.bottom;d.bottom+=n;var f=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&&hF(e[a]))return pj(pj({},e),{},{[a]:e[a]+(n||0)});if(("horizontal"===o||"vertical"===o&&"center"===a)&&"middle"!==s&&hF(e[s]))return pj(pj({},e),{},{[s]:e[s]+(i||0)})}return e})(d,l,c)).left-d.right,p=t-d.top-d.bottom;return pF(pF({brushBottom:h},d),{},{width:Math.max(f,0),height:Math.max(p,0)})}),pB=d$(p$,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),pU=d$(pT,p_,(e,t)=>({x:0,y:0,width:e,height:t})),pV=(0,H.createContext)(null),pq=()=>null!=(0,H.useContext)(pV),pK=e=>e.brush,pW=d$([pK,p$,pI],(e,t,r)=>({height:e.height,x:hF(e.x)?e.x:t.left,y:hF(e.y)?e.y:t.top+t.height+t.brushBottom-((null==r?void 0:r.bottom)||0),width:hF(e.width)?e.width:t.width})),pH=e.i(15325),pY=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++]))}},pX="100%",pG="100%",pQ={width:-1,height:-1},pZ=(e,t,r)=>{var{width:n=pX,height:i=pG,aspect:a,maxHeight:s}=r,o=hR(n)?e:Number(n),l=hR(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}},pJ={width:0,height:0,overflow:"visible"},p0={width:0,overflowX:"visible"},p1={height:0,overflowY:"visible"},p2={};function p5(){return(p5=Object.assign.bind()).apply(null,arguments)}function p4(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 p3(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p4(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)):p4(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var p6=(0,H.createContext)(pQ);function p8(e){var{children:t,width:r,height:n}=e,i=(0,H.useMemo)(()=>({width:r,height:n}),[r,n]);return pb(i.width)&&pb(i.height)?H.createElement(p6.Provider,{value:i},t):null}var p7=()=>(0,H.useContext)(p6),p9=(0,H.forwardRef)((e,t)=>{var{aspect:r,initialDimension:n=pQ,width:i,height:a,minWidth:s=0,minHeight:o,maxHeight:l,children:c,debounce:u=0,id:d,className:h,onResize:f,style:p={}}=e,m=(0,H.useRef)(null),x=(0,H.useRef)();x.current=f,(0,H.useImperativeHandle)(t,()=>m.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==m.current||"u"<typeof ResizeObserver)return hY;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,pH.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:r,height:n}=m.current.getBoundingClientRect();return v(r,n),t.observe(m.current),()=>{t.disconnect()}},[v,u]);var{containerWidth:b,containerHeight:w}=y;pY(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:j,calculatedHeight:N}=pZ(b,w,{width:i,height:a,aspect:r,maxHeight:l});return pY(null!=j&&j>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.",j,N,i,a,s,o,r),H.createElement("div",{id:d?"".concat(d):void 0,className:sl("recharts-responsive-container",h),style:p3(p3({},p),{},{width:i,height:a,minWidth:s,minHeight:o,maxHeight:l}),ref:m},H.createElement("div",{style:(e=>{var{width:t,height:r}=e,n=hR(t),i=hR(r);return n&&i?pJ:n?p0:i?p1:p2})({width:i,height:a})},H.createElement(p8,{width:j,height:N},c)))}),me=(0,H.forwardRef)((e,t)=>{var r=p7();if(pb(r.width)&&pb(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=pX,a=pG):void 0===i?i=n&&n>0?void 0:pX:void 0===a&&(a=n&&n>0?void 0:pG),{width:i,height:a}}({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=pZ(void 0,void 0,{width:n,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return hF(a)&&hF(s)?H.createElement(p8,{width:a,height:s},e.children):H.createElement(p9,p5({},e,{width:n,height:i,ref:t}))});function mt(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 mr=()=>{var e,t=pq(),r=pc(pB),n=pc(pW),i=null==(e=pc(pK))?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},mn={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},mi=e=>e.layout.layoutType,ma=()=>{var e=pc(mi);if("horizontal"===e||"vertical"===e)return e},ms=e=>{var t=e.layout.layoutType;if("centric"===t||"radial"===t)return t},mo=e=>{var t=pa(),r=pq(),{width:n,height:i}=e,a=p7(),s=n,o=i;return a&&(s=a.width>0?a.width:n,o=a.height>0?a.height:i),(0,H.useEffect)(()=>{!r&&pb(s)&&pb(o)&&t(f9({width:s,height:o}))},[t,r,s,o]),null},ml=e.i(56558);e.s([],81206),e.i(81206),e.s([],3771),e.i(3771);var mc=e.i(17603),mu=e.i(11276);function md(){var e,t,r=(0,mu.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,f=d?a:s;e=(f-h)/Math.max(1,r-l+2*c),o&&(e=Math.floor(e)),h+=(f-h-e*(r-l))*u,t=e*(1-l),o&&(h=Math.round(h),t=Math.round(t));var p=(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?p.reverse():p)}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 md(n(),[a,s]).round(o).paddingInner(l).paddingOuter(c).align(u)},mc.initRange.apply(d(),arguments)}function mh(){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}(md.apply(null,arguments).paddingInner(1))}let mf=Math.sqrt(50),mp=Math.sqrt(10),mm=Math.sqrt(2);function mx(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>=mf?10:l>=mp?5:l>=mm?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)?mx(e,t,2*r):[n,i,a]}function my(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?mx(t,e,r):mx(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 mg(e,t,r){return mx(e*=1,t*=1,r*=1)[2]}function mv(e,t,r){t*=1,e*=1,r*=1;let n=t<e,i=n?mg(t,e,r):mg(e,t,r);return(n?-1:1)*(i<0?-(1/i):i)}function mb(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mw(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mj(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=mb,r=(t,r)=>mb(e(t),r),n=(t,r)=>e(t)-r):(t=e===mb||e===mw?e:mN,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 mN(){return 0}function mk(e){return null===e?NaN:+e}let mS=mj(mb),mO=mS.right;mS.left,mj(mk).center;var mP=e.i(82938),mC=e.i(208),mE=e.i(6272),mA=e.i(11930),mM=e.i(44936);function mT(e,t){var r,n,i=typeof t;return null==t||"boolean"===i?(0,mM.default)(t):("number"===i?mE.default:"string"===i?(n=(0,mP.color)(t))?(t=n,mC.default):mA.default:t instanceof mP.color?mC.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]=mT(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]=mT(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}:mE.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 m_=e.i(25223);function mD(e,t){return e*=1,t*=1,function(r){return Math.round(e*(1-r)+t*r)}}function mI(e){return+e}var mz=[0,1];function mL(e){return e}function mR(e,t){var r;return(t-=e*=1)?function(r){return(r-e)/t}:(r=isNaN(t)?NaN:.5,function(){return r})}function mF(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i<n?(n=mR(i,n),a=r(s,a)):(n=mR(n,i),a=r(a,s)),function(e){return a(n(e))}}function m$(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]=mR(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(t){var r=mO(e,t,1,n)-1;return a[r](i[r](t))}}function mB(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mU(){var e,t,r,n,i,a,s=mz,o=mz,l=mT,c=mL;function u(){var e,t,r,l=Math.min(s.length,o.length);return c!==mL&&(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?m$:mF,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),m_.interpolateNumber)))(r)))},d.domain=function(e){return arguments.length?(s=Array.from(e,mI),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=mD,u()},d.clamp=function(e){return arguments.length?(c=!!e||mL,u()):c!==mL},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 mV(){return mU()(mL,mL)}function mq(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 mK(e){return(e=mq(Math.abs(e)))?e[1]:NaN}var mW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mH(e){var t;if(!(t=mW.exec(e)))throw Error("invalid format: "+e);return new mY({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 mY(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 mX(e,t){var r=mq(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")}mH.prototype=mY.prototype,mY.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 mG={"%":(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)=>mX(100*e,t),r:mX,s:function(e,t){var r=mq(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")+mq(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function mQ(e){return e}var mZ=Array.prototype.map,mJ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function m0(e,t,r,n){var i,a,s=mv(e,t,r);switch((n=mH(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(mK(o)/3)))-mK(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,mK(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(i=Math.abs(i=s)))-mK(i))+1)||(n.precision=a-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(a=Math.max(0,-mK(Math.abs(s))))||(n.precision=a-("%"===n.type)*2)}return g(n)}function m1(e){var t=e.domain;return e.ticks=function(e){var r=t();return my(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return m0(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=mg(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 m2(){var e=mV();return e.copy=function(){return mB(e,m2())},mc.initRange.apply(e,arguments),m1(e)}function m5(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,mI),r):e.slice()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return m5(e).unknown(t)},e=arguments.length?Array.from(e,mI):[0,1],m1(r)}function m4(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 m3(e){return Math.log(e)}function m6(e){return Math.exp(e)}function m8(e){return-Math.log(-e)}function m7(e){return-Math.exp(-e)}function m9(e){return isFinite(e)?+("1e"+e):e<0?0:e}function xe(e){return(t,r)=>-e(-t,r)}function xt(e){let t,r,n=e(m3,m6),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)?m9:o===Math.E?Math.exp:e=>Math.pow(o,e),i()[0]<0?(t=xe(t),r=xe(r),e(m8,m7)):e(m3,m6),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),f=null==e?10:+e,p=[];if(!(a%1)&&h-d<f){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;p.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;p.push(s)}2*p.length<f&&(p=my(l,c,f))}else p=my(d,h,Math.min(h-d,f)).map(r);return u?p.reverse():p},n.tickFormat=(e,i)=>{if(null==e&&(e=10),null==i&&(i=10===a?"s":","),"function"!=typeof i&&(a%1||null!=(i=mH(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(m4(i(),{floor:e=>r(Math.floor(t(e))),ceil:e=>r(Math.ceil(t(e)))})),n}function xr(){let e=xt(mU()).domain([1,10]);return e.copy=()=>mB(e,xr()).base(e.base()),mc.initRange.apply(e,arguments),e}function xn(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function xi(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xa(e){var t=1,r=e(xn(1),xi(t));return r.constant=function(r){return arguments.length?e(xn(t=+r),xi(t)):t},m1(r)}function xs(){var e=xa(mU());return e.copy=function(){return mB(e,xs()).constant(e.constant())},mc.initRange.apply(e,arguments)}function xo(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function xl(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xc(e){return e<0?-e*e:e*e}function xu(e){var t=e(mL,mL),r=1;return t.exponent=function(t){return arguments.length?1==(r=+t)?e(mL,mL):.5===r?e(xl,xc):e(xo(r),xo(1/r)):r},m1(t)}function xd(){var e=xu(mU());return e.copy=function(){return mB(e,xd()).exponent(e.exponent())},mc.initRange.apply(e,arguments),e}function xh(){return xd.apply(null,arguments).exponent(.5)}function xf(e){return Math.sign(e)*e*e}function xp(){var e,t=mV(),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(xf(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,mI)).map(xf)),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 xp(t.domain(),r).round(n).clamp(t.clamp()).unknown(e)},mc.initRange.apply(i,arguments),m1(i)}g=(y=function(e){var t,r,n,i=void 0===e.grouping||void 0===e.thousands?mQ:(t=mZ.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?mQ:(n=mZ.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=mH(e)).fill,n=e.align,h=e.sign,f=e.symbol,p=e.zero,m=e.width,y=e.comma,g=e.precision,v=e.trim,b=e.type;"n"===b?(y=!0,b="g"):mG[b]||(void 0===g&&(g=12),v=!0,b="g"),(p||"0"===r&&"="===n)&&(p=!0,r="0",n="=");var w=(t&&void 0!==t.prefix?t.prefix:"")+("$"===f?a:"#"===f&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),j=("$"===f?s:/[%p]/.test(b)?c:"")+(t&&void 0!==t.suffix?t.suffix:""),N=mG[b],k=/[defgprs%]/.test(b);function S(e){var t,a,s,c=w,f=j;if("c"===b)f=N(e)+f,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,f=("s"!==b||isNaN(e)||void 0===x?"":mJ[8+x/3])+f+(S&&"("===h?")":""),k){for(t=-1,a=e.length;++t<a;)if(48>(s=e.charCodeAt(t))||s>57){f=(46===s?o+e.slice(t+1):e.slice(t))+f,e=e.slice(0,t);break}}}y&&!p&&(e=i(e,1/0));var O=c.length+e.length+f.length,P=O<m?Array(m-O+1).join(r):"";switch(y&&p&&(e=i(P+e,P.length?m-f.length:1/0),P=""),n){case"<":e=c+e+f+P;break;case"=":e=c+P+e+f;break;case"^":e=P.slice(0,O=P.length>>1)+c+e+f+P.slice(O);break;default:e=P+c+e+f}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(mK(t)/3))),n=Math.pow(10,-r),i=h(((e=mH(e)).type="f",e),{suffix:mJ[8+r/3]});return function(e){return i(n*e)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,v=y.formatPrefix;var xm=e.i(96509),xx=e.i(45583);function xy(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:+(e>t))}function xg(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function xv(){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=mk){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[mO(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(mb),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 xv().domain(t).range(r).unknown(e)},mc.initRange.apply(a,arguments)}function xb(){var e,t=0,r=1,n=1,i=[.5],a=[0,1];function s(t){return null!=t&&t<=t?a[mO(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 xb().domain([t,r]).range(a).unknown(e)},mc.initRange.apply(m1(s),arguments)}function xw(){var e,t=[.5],r=[0,1],n=1;function i(i){return null!=i&&i<=i?r[mO(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 xw().domain(t).range(r).unknown(e)},mc.initRange.apply(i,arguments)}let xj=new Date,xN=new Date;function xk(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=>xk(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)=>(xj.setTime(+t),xN.setTime(+n),e(xj),e(xN),Math.floor(r(xj,xN))),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 xS=xk(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());xS.every=e=>isFinite(e=Math.floor(e))&&e>0?xk(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,xS.range;let xO=xk(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());xO.every=e=>isFinite(e=Math.floor(e))&&e>0?xk(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,xO.range;let xP=xk(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());xP.range;let xC=xk(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());xC.range;function xE(e){return xk(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 xA=xE(0),xM=xE(1),xT=xE(2),x_=xE(3),xD=xE(4),xI=xE(5),xz=xE(6);function xL(e){return xk(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)}xA.range,xM.range,xT.range,x_.range,xD.range,xI.range,xz.range;let xR=xL(0),xF=xL(1),x$=xL(2),xB=xL(3),xU=xL(4),xV=xL(5),xq=xL(6);xR.range,xF.range,x$.range,xB.range,xU.range,xV.range,xq.range;let xK=xk(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);xK.range;let xW=xk(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);xW.range;let xH=xk(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));xH.range;let xY=xk(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());xY.range;let xX=xk(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());xX.range;let xG=xk(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());xG.range;let xQ=xk(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());xQ.range;let xZ=xk(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());xZ.range;let xJ=xk(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);function x0(e,t,r,n,i,a){let s=[[xZ,1,1e3],[xZ,5,5e3],[xZ,15,15e3],[xZ,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=mj(([,,e])=>e).right(s,i);if(a===s.length)return e.every(mv(t/31536e6,r/31536e6,n));if(0===a)return xJ.every(Math.max(mv(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]}xJ.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?xk(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):xJ:null,xJ.range;let[x1,x2]=x0(xO,xC,xR,xH,xX,xQ),[x5,x4]=x0(xS,xP,xA,xK,xY,xG);function x3(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 x6(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 x8(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}var x7={"-":"",_:" ",0:"0"},x9=/^\s*\d+/,ye=/^%/,yt=/[\\^$*+?|[\]().{}]/g;function yr(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 yn(e){return e.replace(yt,"\\$&")}function yi(e){return RegExp("^(?:"+e.map(yn).join("|")+")","i")}function ya(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function ys(e,t,r){var n=x9.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function yo(e,t,r){var n=x9.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function yl(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function yc(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function yu(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yd(e,t,r){var n=x9.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function yh(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function yf(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 yp(e,t,r){var n=x9.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function ym(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function yx(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function yy(e,t,r){var n=x9.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function yg(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function yv(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function yb(e,t,r){var n=x9.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function yw(e,t,r){var n=x9.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function yj(e,t,r){var n=x9.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function yN(e,t,r){var n=ye.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function yk(e,t,r){var n=x9.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function yS(e,t,r){var n=x9.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function yO(e,t){return yr(e.getDate(),t,2)}function yP(e,t){return yr(e.getHours(),t,2)}function yC(e,t){return yr(e.getHours()%12||12,t,2)}function yE(e,t){return yr(1+xK.count(xS(e),e),t,3)}function yA(e,t){return yr(e.getMilliseconds(),t,3)}function yM(e,t){return yA(e,t)+"000"}function yT(e,t){return yr(e.getMonth()+1,t,2)}function y_(e,t){return yr(e.getMinutes(),t,2)}function yD(e,t){return yr(e.getSeconds(),t,2)}function yI(e){var t=e.getDay();return 0===t?7:t}function yz(e,t){return yr(xA.count(xS(e)-1,e),t,2)}function yL(e){var t=e.getDay();return t>=4||0===t?xD(e):xD.ceil(e)}function yR(e,t){return e=yL(e),yr(xD.count(xS(e),e)+(4===xS(e).getDay()),t,2)}function yF(e){return e.getDay()}function y$(e,t){return yr(xM.count(xS(e)-1,e),t,2)}function yB(e,t){return yr(e.getFullYear()%100,t,2)}function yU(e,t){return yr((e=yL(e)).getFullYear()%100,t,2)}function yV(e,t){return yr(e.getFullYear()%1e4,t,4)}function yq(e,t){var r=e.getDay();return yr((e=r>=4||0===r?xD(e):xD.ceil(e)).getFullYear()%1e4,t,4)}function yK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yr(t/60|0,"0",2)+yr(t%60,"0",2)}function yW(e,t){return yr(e.getUTCDate(),t,2)}function yH(e,t){return yr(e.getUTCHours(),t,2)}function yY(e,t){return yr(e.getUTCHours()%12||12,t,2)}function yX(e,t){return yr(1+xW.count(xO(e),e),t,3)}function yG(e,t){return yr(e.getUTCMilliseconds(),t,3)}function yQ(e,t){return yG(e,t)+"000"}function yZ(e,t){return yr(e.getUTCMonth()+1,t,2)}function yJ(e,t){return yr(e.getUTCMinutes(),t,2)}function y0(e,t){return yr(e.getUTCSeconds(),t,2)}function y1(e){var t=e.getUTCDay();return 0===t?7:t}function y2(e,t){return yr(xR.count(xO(e)-1,e),t,2)}function y5(e){var t=e.getUTCDay();return t>=4||0===t?xU(e):xU.ceil(e)}function y4(e,t){return e=y5(e),yr(xU.count(xO(e),e)+(4===xO(e).getUTCDay()),t,2)}function y3(e){return e.getUTCDay()}function y6(e,t){return yr(xF.count(xO(e)-1,e),t,2)}function y8(e,t){return yr(e.getUTCFullYear()%100,t,2)}function y7(e,t){return yr((e=y5(e)).getUTCFullYear()%100,t,2)}function y9(e,t){return yr(e.getUTCFullYear()%1e4,t,4)}function ge(e,t){var r=e.getUTCDay();return yr((e=r>=4||0===r?xU(e):xU.ceil(e)).getUTCFullYear()%1e4,t,4)}function gt(){return"+0000"}function gr(){return"%"}function gn(e){return+e}function gi(e){return Math.floor(e/1e3)}function ga(e){return new Date(e)}function gs(e){return e instanceof Date?+e:+new Date(+e)}function go(e,t,r,n,i,a,s,o,l,c){var u=mV(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),x=c("%I %p"),y=c("%a %d"),g=c("%b %d"),v=c("%B"),b=c("%Y");function w(e){return(l(e)<e?f:o(e)<e?p:s(e)<e?m: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,gs)):h().map(ga)},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?w: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(m4(r,e)):u},u.copy=function(){return mB(u,go(e,t,r,n,i,a,s,o,l,c))},u}function gl(){return mc.initRange.apply(go(x5,x4,xS,xP,xA,xK,xY,xG,xZ,w).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gc(){return mc.initRange.apply(go(x1,x2,xO,xC,xR,xW,xX,xQ,xZ,j).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function gu(){var e,t,r,n,i,a=0,s=1,o=mL,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(mT),c.rangeRound=u(mD),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 gd(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function gh(){var e=m1(gu()(mL));return e.copy=function(){return gd(e,gh())},mc.initInterpolator.apply(e,arguments)}function gf(){var e=xt(gu()).domain([1,10]);return e.copy=function(){return gd(e,gf()).base(e.base())},mc.initInterpolator.apply(e,arguments)}function gp(){var e=xa(gu());return e.copy=function(){return gd(e,gp()).constant(e.constant())},mc.initInterpolator.apply(e,arguments)}function gm(){var e=xu(gu());return e.copy=function(){return gd(e,gm()).exponent(e.exponent())},mc.initInterpolator.apply(e,arguments)}function gx(){return gm.apply(null,arguments).exponent(.5)}function gy(){var e=[],t=mL;function r(r){if(null!=r&&!isNaN(r*=1))return t((mO(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(mb),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,xx.default)(e);if(t>=1)return(0,xm.default)(e);var n,i=(n-1)*t,a=Math.floor(i),s=(0,xm.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?xy:function(e=mb){if(e===mb)return xy;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(xg(t,n,r),a(t[i],s)>0&&xg(t,n,i);o<l;){for(xg(t,o,l),++o,--l;0>a(t[o],s);)++o;for(;a(t[l],s)>0;)--l}0===a(t[n],s)?xg(t,n,l):xg(t,++l,i),l<=r&&(n=l+1),r<=l&&(i=l-1)}return t})(e,a).subarray(0,a+1));return s+((0,xx.default)(e.subarray(a+1))-s)*(i-a)}})(e,n/t))},r.copy=function(){return gy(t).domain(e)},mc.initInterpolator.apply(r,arguments)}function gg(){var e,t,r,n,i,a,s,o=0,l=.5,c=1,u=1,d=mL,h=!1;function f(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 p(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=mT);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]),f):[d(0),d(.5),d(1)]}}return f.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,f):[o,l,c]},f.clamp=function(e){return arguments.length?(h=!!e,f):h},f.interpolator=function(e){return arguments.length?(d=e,f):d},f.range=p(mT),f.rangeRound=p(mD),f.unknown=function(e){return arguments.length?(s=e,f):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,f}}function gv(){var e=m1(gg()(mL));return e.copy=function(){return gd(e,gv())},mc.initInterpolator.apply(e,arguments)}function gb(){var e=xt(gg()).domain([.1,1,10]);return e.copy=function(){return gd(e,gb()).base(e.base())},mc.initInterpolator.apply(e,arguments)}function gw(){var e=xa(gg());return e.copy=function(){return gd(e,gw()).constant(e.constant())},mc.initInterpolator.apply(e,arguments)}function gj(){var e=xu(gg());return e.copy=function(){return gd(e,gj()).exponent(e.exponent())},mc.initInterpolator.apply(e,arguments)}function gN(){return gj.apply(null,arguments).exponent(.5)}w=(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=yi(i),u=ya(i),d=yi(a),h=ya(a),f=yi(s),p=ya(s),m=yi(o),x=ya(o),y=yi(l),g=ya(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:yO,e:yO,f:yM,g:yU,G:yq,H:yP,I:yC,j:yE,L:yA,m:yT,M:y_,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:gn,s:gi,S:yD,u:yI,U:yz,V:yR,w:yF,W:y$,x:null,X:null,y:yB,Y:yV,Z:yK,"%":gr},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:yW,e:yW,f:yQ,g:y7,G:ge,H:yH,I:yY,j:yX,L:yG,m:yZ,M:yJ,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:gn,s:gi,S:y0,u:y1,U:y2,V:y4,w:y3,W:y6,x:null,X:null,y:y8,Y:y9,Z:gt,"%":gr},w={a:function(e,t,r){var n=f.exec(t.slice(r));return n?(e.w=p.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=m.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:yx,e:yx,f:yj,g:yh,G:yd,H:yg,I:yg,j:yy,L:yw,m:ym,M:yv,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:yp,Q:yk,s:yS,S:yb,u:yo,U:yl,V:yc,w:ys,W:yu,x:function(e,t,n){return k(e,r,t,n)},X:function(e,t,r){return k(e,n,t,r)},y:yh,Y:yd,Z:yf,"%":yN};function j(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=x7[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=x8(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=x6(x8(a.y,0,1))).getUTCDay())>4||0===i?xF.ceil(n):xF(n),n=xW.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=x3(x8(a.y,0,1))).getDay())>4||0===i?xM.ceil(n):xM(n),n=xK.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?x6(x8(a.y,0,1)).getUTCDay():x3(x8(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,x6(a)):x3(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=w[(i=t.charAt(s++))in x7?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=j(r,v),v.X=j(n,v),v.c=j(t,v),b.x=j(r,b),b.X=j(n,b),b.c=j(t,b),{format:function(e){var t=j(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=j(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,j=b.utcFormat,b.utcParse,e.s(["scaleBand",()=>md,"scaleDiverging",()=>gv,"scaleDivergingLog",()=>gb,"scaleDivergingPow",()=>gj,"scaleDivergingSqrt",()=>gN,"scaleDivergingSymlog",()=>gw,"scaleIdentity",()=>m5,"scaleImplicit",()=>mu.implicit,"scaleLinear",()=>m2,"scaleLog",()=>xr,"scaleOrdinal",()=>mu.default,"scalePoint",()=>mh,"scalePow",()=>xd,"scaleQuantile",()=>xv,"scaleQuantize",()=>xb,"scaleRadial",()=>xp,"scaleSequential",()=>gh,"scaleSequentialLog",()=>gf,"scaleSequentialPow",()=>gm,"scaleSequentialQuantile",()=>gy,"scaleSequentialSqrt",()=>gx,"scaleSequentialSymlog",()=>gp,"scaleSqrt",()=>xh,"scaleSymlog",()=>xs,"scaleThreshold",()=>xw,"scaleTime",()=>gl,"scaleUtc",()=>gc,"tickFormat",()=>m0],84649),e.i(84649),e.s(["scaleBand",()=>md,"scaleDiverging",()=>gv,"scaleDivergingLog",()=>gb,"scaleDivergingPow",()=>gj,"scaleDivergingSqrt",()=>gN,"scaleDivergingSymlog",()=>gw,"scaleIdentity",()=>m5,"scaleImplicit",()=>mu.implicit,"scaleLinear",()=>m2,"scaleLog",()=>xr,"scaleOrdinal",()=>mu.default,"scalePoint",()=>mh,"scalePow",()=>xd,"scaleQuantile",()=>xv,"scaleQuantize",()=>xb,"scaleRadial",()=>xp,"scaleSequential",()=>gh,"scaleSequentialLog",()=>gf,"scaleSequentialPow",()=>gm,"scaleSequentialQuantile",()=>gy,"scaleSequentialSqrt",()=>gx,"scaleSequentialSymlog",()=>gp,"scaleSqrt",()=>xh,"scaleSymlog",()=>xs,"scaleThreshold",()=>xw,"scaleTime",()=>gl,"scaleUtc",()=>gc,"tickFormat",()=>m0],93628);var gk=e.i(93628),gS=e=>e.chartData,gO=d$([gS],e=>{var t=null!=e.chartData?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),gP=(e,t,r,n)=>n?gO(e):gS(e);function gC(e){if(Array.isArray(e)&&2===e.length){var[t,r]=e;if(pv(t)&&pv(r))return!0}return!1}function gE(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function gA(e,t){if(t&&"function"!=typeof e&&Array.isArray(e)&&2===e.length){var r,n,[i,a]=e;if(pv(i))r=i;else if("function"==typeof i)return;if(pv(a))n=a;else if("function"==typeof a)return;var s=[r,n];if(gC(s))return s}}var gM=e.i(73335);function gT(e){return 0===e?1:Math.floor(new gM.default(e).abs().log(10).toNumber())+1}function g_(e,t,r){for(var n=new gM.default(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var gD=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},gI=(e,t,r)=>{if(e.lte(0))return new gM.default(0);var n=gT(e.toNumber()),i=new gM.default(10).pow(n),a=e.div(i),s=1!==n?.05:.1,o=new gM.default(Math.ceil(a.div(s).toNumber())).add(r).mul(s).mul(i);return new gM.default(t?o.toNumber():Math.ceil(o.toNumber()))},gz=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 gM.default(0),tickMin:new gM.default(0),tickMax:new gM.default(0)};var s=gI(new gM.default(t).sub(e).div(r-1),n,a),o=Math.ceil((i=e<=0&&t>=0?new gM.default(0):(i=new gM.default(e).add(t).div(2)).sub(new gM.default(i).mod(s))).sub(e).div(s).toNumber()),l=Math.ceil(new gM.default(t).sub(i).div(s).toNumber()),c=o+l+1;return c>r?gz(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 gM.default(o).mul(s)),tickMax:i.add(new gM.default(l).mul(s))})},gL=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]=gD([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 gM.default(1),i=new gM.default(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new gM.default(10).pow(gT(e)-1),i=new gM.default(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new gM.default(Math.floor(e)))}else 0===e?i=new gM.default(Math.floor((t-1)/2)):r||(i=new gM.default(Math.floor(e)));for(var s=Math.floor((t-1)/2),o=[],l=0;l<t;l++)o.push(i.add(new gM.default(l-s).mul(n)).toNumber());return o})(s,n,i);var{step:c,tickMin:u,tickMax:d}=gz(s,o,a,i,0),h=g_(u,d.add(new gM.default(.1).mul(c)),c);return t>r?h.reverse():h},gR=function(e,t){var[r,n]=e,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],[a,s]=gD([r,n]);if(a===-1/0||s===1/0)return[r,n];if(a===s)return[a];var o=Math.max(t,2),l=gI(new gM.default(s).sub(a).div(o-1),i,0),c=[...g_(new gM.default(a),new gM.default(s),l),s];return!1===i&&(c=c.map(e=>Math.round(e))),r>n?c.reverse():c},gF=e=>e.rootProps.maxBarSize,g$=e=>e.rootProps.barCategoryGap,gB=e=>e.rootProps.stackOffset,gU=e=>e.rootProps.reverseStackOrder,gV=e=>e.options.chartName,gq=e=>e.rootProps.syncId,gK=e=>e.rootProps.syncMethod,gW=e=>e.options.eventEmitter;function gH(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 gY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gH(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)):gH(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var gX=Math.PI/180,gG=(e,t,r,n)=>({x:e+Math.cos(-gX*n)*r,y:t+Math.sin(-gX*n)*r}),gQ={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},gZ={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:gQ.axis},gJ={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:gQ.axis},g0=(e,t)=>{if(e&&t)return null!=e&&e.reversed?[t[1],t[0]]:t};function g1(e,t,r){return"auto"!==r?r:null!=e?pk(e,t)?"category":"number":void 0}function g2(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 g5(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g2(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)):g2(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var g4={allowDataOverflow:gZ.allowDataOverflow,allowDecimals:gZ.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:gZ.angleAxisId,includeHidden:!1,name:void 0,reversed:gZ.reversed,scale:gZ.scale,tick:gZ.tick,tickCount:void 0,ticks:void 0,type:gZ.type,unit:void 0},g3={allowDataOverflow:gJ.allowDataOverflow,allowDecimals:gJ.allowDecimals,allowDuplicatedCategory:gJ.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:gJ.radiusAxisId,includeHidden:gJ.includeHidden,name:void 0,reversed:gJ.reversed,scale:gJ.scale,tick:gJ.tick,tickCount:gJ.tickCount,ticks:void 0,type:gJ.type,unit:void 0},g6=d$([(e,t)=>{if(null!=t)return e.polarAxis.angleAxis[t]},ms],(e,t)=>{if(null!=e)return e;var r,n=null!=(r=g1(t,"angleAxis",g4.type))?r:"category";return g5(g5({},g4),{},{type:n})}),g8=d$([(e,t)=>e.polarAxis.radiusAxis[t],ms],(e,t)=>{if(null!=e)return e;var r,n=null!=(r=g1(t,"radiusAxis",g3.type))?r:"category";return g5(g5({},g3),{},{type:n})}),g7=e=>e.polarOptions,g9=d$([pT,p_,p$],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}),ve=d$([g7,g9],(e,t)=>{if(null!=e)return hV(e.innerRadius,t,0)}),vt=d$([g7,g9],(e,t)=>{if(null!=e)return hV(e.outerRadius,t,.8*t)}),vr=d$([g7],e=>{if(null==e)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]});d$([g6,vr],g0);var vn=d$([g9,ve,vt],(e,t,r)=>{if(null!=e&&null!=t&&null!=r)return[t,r]});d$([g8,vn],g0);var vi=d$([mi,g7,ve,vt,pT,p_],(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:hV(s,i,i/2),cy:hV(o,a,a/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:c,clockWise:!1}}}),va=(e,t)=>t,vs=(e,t,r)=>r;function vo(e){return null==e?void 0:e.id}function vl(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=vo(e);r.forEach((t,r)=>{var n,l=null==a||i?r:String(pN(t,a,null)),c=pN(t,e.dataKey,0);Object.assign(n=s.has(l)?s.get(l):{},{[o]:c}),s.set(l,n)})}}),Array.from(s.values())}function vc(e){return"stackId"in e&&null!=e.stackId&&null!=e.dataKey}var vu=(e,t)=>e===t||null!=e&&null!=t&&e[0]===t[0]&&e[1]===t[1];function vd(e,t){return!!(Array.isArray(e)&&Array.isArray(t))&&0===e.length&&0===t.length||e===t}var vh=e=>{var t=mi(e);return"horizontal"===t?"xAxis":"vertical"===t?"yAxis":"centric"===t?"angleAxis":"radiusAxis"},vf=e=>e.tooltip.settings.axisId;function vp(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 vm(e,t,r){if("function"==typeof e)return vp(e.copy().domain(t).range(r));if(null!=e){var n=function(e){if(e in gk)return gk[e]();var t="scale".concat(hW(e));if(t in gk)return gk[t]()}(e);if(null!=n)return n.domain(t).range(r),vp(n)}}function vx(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 vy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vx(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)):vx(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var vg=[0,"auto"],vv={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},vb=(e,t)=>e.cartesianAxis.xAxis[t],vw=(e,t)=>{var r=vb(e,t);return null==r?vv:r},vj={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:vg,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},vN=(e,t)=>e.cartesianAxis.yAxis[t],vk=(e,t)=>{var r=vN(e,t);return null==r?vj:r},vS={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:""},vO=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return null==r?vS:r},vP=(e,t,r)=>{switch(t){case"xAxis":return vw(e,r);case"yAxis":return vk(e,r);case"zAxis":return vO(e,r);case"angleAxis":return g6(e,r);case"radiusAxis":return g8(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},vC=(e,t,r)=>{switch(t){case"xAxis":return vw(e,r);case"yAxis":return vk(e,r);case"angleAxis":return g6(e,r);case"radiusAxis":return g8(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},vE=e=>e.graphicalItems.cartesianItems.some(e=>"bar"===e.type)||e.graphicalItems.polarItems.some(e=>"radialBar"===e.type);function vA(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 vM=e=>e.graphicalItems.cartesianItems,vT=d$([va,vs],vA),v_=(e,t,r)=>e.filter(r).filter(e=>(null==t?void 0:t.includeHidden)===!0||!e.hide),vD=d$([vM,vP,vT],v_,{memoizeOptions:{resultEqualityCheck:vd}}),vI=d$([vD],e=>e.filter(e=>"area"===e.type||"bar"===e.type).filter(vc)),vz=e=>e.filter(e=>!("stackId"in e)||void 0===e.stackId),vL=d$([vD],vz),vR=e=>e.map(e=>e.data).filter(Boolean).flat(1),vF=d$([vD],vR,{memoizeOptions:{resultEqualityCheck:vd}}),v$=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},vB=d$([vF,gP],v$),vU=(e,t,r)=>(null==t?void 0:t.dataKey)!=null?e.map(e=>({value:pN(e,t.dataKey)})):r.length>0?r.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:pN(e,t)}))):e.map(e=>({value:e})),vV=d$([vB,vP,vD],vU);function vq(e,t){switch(e){case"xAxis":return"x"===t.direction;case"yAxis":return"y"===t.direction;default:return!1}}function vK(e){if(h$(e)||e instanceof Date){var t=Number(e);if(pv(t))return t}}function vW(e){if(Array.isArray(e)){var t=[vK(e[0]),vK(e[1])];return gC(t)?t:void 0}var r=vK(e);if(null!=r)return[r,r]}function vH(e){return e.map(vK).filter(hH)}var vY=e=>{var t=vh(e),r=vf(e);return vC(e,t,r)},vX=d$([vY],e=>null==e?void 0:e.dataKey),vG=d$([vI,gP,vY],vl),vQ=(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(vo);return[o,{stackedData:(a=null!=(i=pS[r])?i:pp,(s=(function(){var e=pf([]),t=pm,r=pp,n=px;function i(i){var a,s,o=Array.from(e.apply(this,arguments),py),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=ph(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:pf(Array.from(t)),i):e},i.value=function(e){return arguments.length?(n="function"==typeof e?e:pf(+e),i):n},i.order=function(e){return arguments.length?(t=null==e?pm:"function"==typeof e?e:pf(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(r=null==e?pp:e,i):r},i})().keys(u).value((e,t)=>Number(pN(e,t,0))).order(pm).offset(a)(e)).forEach((t,r)=>{t.forEach((t,n)=>{var i=pN(e[n],u[r],0);Array.isArray(i)&&2===i.length&&hF(i[0])&&hF(i[1])&&(t[0]=i[0],t[1]=i[1])})}),s),graphicalItems:c}]})),vZ=d$([vG,vI,gB,gU],vQ),vJ=(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=pg(n,t,r).flat(2).filter(hF)),Math.max(...i)];return pv(a[0])&&pv(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}},v0=d$([vP],e=>e.allowDataOverflow),v1=e=>{var t;if(null==e||!("domain"in e))return vg;if(null!=e.domain)return e.domain;if("ticks"in e&&null!=e.ticks){if("number"===e.type){var r=vH(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:vg},v2=d$([vP],v1),v5=d$([v2,v0],gA),v4=d$([vZ,gS,va,v5],vJ,{memoizeOptions:{resultEqualityCheck:vu}}),v3=e=>e.errorBars,v6=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)]}},v8=(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=>vq(i,e)),u=pN(e,null!=(l=t.dataKey)?l:r.dataKey),d=!(!c||"number"!=typeof u||hL(u))&&c.length?vH(c.flatMap(t=>{var r,n,i=pN(e,t.dataKey);if(Array.isArray(i)?[r,n]=i:r=n=i,pv(r)&&pv(n))return[u-r,u+n]})):[];if(d.length>=2){var h=Math.min(...d),f=Math.max(...d);(null==a||h<a)&&(a=h),(null==s||f>s)&&(s=f)}var p=vW(u);null!=p&&(a=null==a?p[0]:Math.min(a,p[0]),s=null==s?p[1]:Math.max(s,p[1]))})}),(null==t?void 0:t.dataKey)!=null&&e.forEach(e=>{var r=vW(pN(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]))}),pv(a)&&pv(s))return[a,s]},v7=d$([vB,vP,vL,v3,va],v8,{memoizeOptions:{resultEqualityCheck:vu}});function v9(e){var{value:t}=e;if(h$(t)||t instanceof Date)return t}var be=e=>e.referenceElements.dots,bt=(e,t,r)=>e.filter(e=>"extendDomain"===e.ifOverflow).filter(e=>"xAxis"===t?e.xAxisId===r:e.yAxisId===r),br=d$([be,va,vs],bt),bn=e=>e.referenceElements.areas,bi=d$([bn,va,vs],bt),ba=e=>e.referenceElements.lines,bs=d$([ba,va,vs],bt),bo=(e,t)=>{if(null!=e){var r=vH(e.map(e=>"xAxis"===t?e.x:e.y));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},bl=d$(br,va,bo),bc=(e,t)=>{if(null!=e){var r=vH(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)]}},bu=d$([bi,va],bc),bd=(e,t)=>{if(null!=e){var r=e.flatMap(e=>"xAxis"===t?function(e){if(null!=e.x)return vH([e.x]);var t,r=null==(t=e.segment)?void 0:t.map(e=>e.x);return null==r||0===r.length?[]:vH(r)}(e):function(e){if(null!=e.y)return vH([e.y]);var t,r=null==(t=e.segment)?void 0:t.map(e=>e.y);return null==r||0===r.length?[]:vH(r)}(e));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},bh=d$([bs,va],bd),bf=d$(bl,bh,bu,(e,t,r)=>v6(e,r,t)),bp=(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(gC(n))return gE(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(hF(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&&pP.test(s)){var l=pP.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(hF(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&&pC.test(o)){var u=pC.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(gC(h))return null==t?h:gE(h,t,r)}}}(t,"vertical"===s&&"xAxis"===o||"horizontal"===s&&"yAxis"===o?v6(n,a,i):v6(a,i),e.allowDataOverflow),bm=d$([vP,v2,v5,v4,v7,bf,mi,va],bp,{memoizeOptions:{resultEqualityCheck:vu}}),bx=[0,1],by=(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=pk(t,a);return d&&null==c?(0,ml.default)(0,null!=(l=null==r?void 0:r.length)?l:0):"category"===u?(o=n.map(v9).filter(e=>null!=e),d&&(null==e.dataKey||e.allowDuplicatedCategory&&hq(o))?(0,ml.default)(0,n.length):e.allowDuplicatedCategory?o:Array.from(new Set(o))):"expand"===i?bx:s}},bg=d$([vP,mi,vB,vV,gB,va,bm],by),bv=(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(hW(n));return a in gk?a:"point"}}},bb=d$([vP,vE,gV],bv);function bw(e,t,r,n){if(null!=r&&null!=n)return"function"==typeof e.scale?vm(e.scale,r,n):vm(t,r,n)}var bj=(e,t,r)=>{var n=v1(t);if("auto"===r||"linear"===r){if(null!=t&&t.tickCount&&Array.isArray(n)&&("auto"===n[0]||"auto"===n[1])&&gC(e))return gL(e,t.tickCount,t.allowDecimals);if(null!=t&&t.tickCount&&"number"===t.type&&gC(e))return gR(e,t.tickCount,t.allowDecimals)}},bN=d$([bg,vC,bb],bj),bk=(e,t,r,n)=>{if("angleAxis"!==n&&(null==e?void 0:e.type)==="number"&&gC(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},bS=d$([vP,bg,bN,va],bk),bO=d$(vV,vP,(e,t)=>{if(t&&"number"===t.type){var r=1/0,n=Array.from(vH(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}}),bP=d$(bO,mi,g$,p$,(e,t,r,n,i)=>i,(e,t,r,n,i)=>{if(!pv(e))return 0;var a="vertical"===t?n.height:n.width;if("gap"===i)return e*a/2;if("no-gap"===i){var s=hV(r,e*a),o=e*a/2;return o-s-(o-s)/a*s}return 0}),bC=d$(vw,(e,t,r)=>{var n=vw(e,t);return null==n||"string"!=typeof n.padding?0:bP(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}}),bE=d$(vk,(e,t,r)=>{var n=vk(e,t);return null==n||"string"!=typeof n.padding?0:bP(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}}),bA=d$([p$,bC,pW,pK,(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]}),bM=d$([p$,mi,bE,pW,pK,(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]}),bT=(e,t,r,n)=>{var i;switch(t){case"xAxis":return bA(e,r,n);case"yAxis":return bM(e,r,n);case"zAxis":return null==(i=vO(e,r))?void 0:i.range;case"angleAxis":return vr(e);case"radiusAxis":return vn(e,r);default:return}},b_=d$([vP,bT],g0),bD=d$([bb,bS],(e,t)=>{if(null!=t)if("linear"!==e)return t;else{if(!gC(t)){for(var r,n,i=0;i<t.length;i++){var a=t[i];pv(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}}),bI=d$([vP,bb,bD,b_],bw);function bz(e,t){return e.id<t.id?-1:+(e.id>t.id)}d$([vD,v3,va],(e,t,r)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>vq(r,e)));var bL=(e,t)=>t,bR=(e,t,r)=>r,bF=d$(pz,bL,bR,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(bz)),b$=d$(pL,bL,bR,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(bz)),bB=(e,t)=>({width:e.width,height:t.height}),bU=d$(p$,vw,bB),bV=d$(p_,p$,bF,bL,bR,(e,t,r,n,i)=>{var a,s={};return r.forEach(r=>{var o=bB(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}),bq=d$(pT,p$,b$,bL,bR,(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}),bK=d$([p$,vw,(e,t)=>{var r=vw(e,t);if(null!=r)return bV(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}}}),bW=d$([p$,vk,(e,t)=>{var r=vk(e,t);if(null!=r)return bq(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}}}),bH=d$(p$,vk,(e,t)=>({width:"number"==typeof t.width?t.width:60,height:e.height})),bY=(e,t,r)=>{switch(t){case"xAxis":return bU(e,r).width;case"yAxis":return bH(e,r).height;default:return}},bX=(e,t,r,n)=>{if(null!=r){var{allowDuplicatedCategory:i,type:a,dataKey:s}=r,o=pk(e,n),l=t.map(e=>e.value);if(s&&o&&"category"===a&&i&&hq(l))return l}},bG=d$([mi,vV,vP,va],bX),bQ=(e,t,r,n)=>{if(null!=r&&null!=r.dataKey){var{type:i,scale:a}=r;if(pk(e,n)&&("number"===i||"auto"!==a))return t.map(e=>e.value)}},bZ=d$([mi,vV,vC,va],bQ);d$([mi,(e,t,r)=>{switch(t){case"xAxis":return vw(e,r);case"yAxis":return vk(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},bb,bI,bG,bZ,bT,bN,va],(e,t,r,n,i,a,s,o,l)=>{if(null!=t){var c=pk(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 bJ=d$([mi,vC,bb,bI,bN,bT,bG,bZ,va],(e,t,r,n,i,a,s,o,l)=>{if(null!=t&&null!=n){var c=pk(e,l),{type:u,ticks:d,tickCount:h}=t,f="scaleBand"===r&&"function"==typeof n.bandwidth?n.bandwidth()/2:2,p="category"===u&&n.bandwidth?n.bandwidth()/f:0;p="angleAxis"===l&&null!=a&&a.length>=2?2*hz(a[0]-a[1])*p:p;var m=d||i;return m?m.map((e,t)=>{var r=s?s.indexOf(e):e,i=n.map(r);return pv(i)?{index:t,coordinate:i+p,value:e,offset:p}:null}).filter(hH):c&&o?o.map((e,t)=>{var r=n.map(e);return pv(r)?{coordinate:r+p,value:e,index:t,offset:p}:null}).filter(hH):n.ticks?n.ticks(h).map((e,t)=>{var r=n.map(e);return pv(r)?{coordinate:r+p,value:e,index:t,offset:p}:null}).filter(hH):n.domain().map((e,t)=>{var r=n.map(e);return pv(r)?{coordinate:r+p,value:s?s[e]:e,index:t,offset:p}:null}).filter(hH)}}),b0=d$([mi,vC,bI,bT,bG,bZ,va],(e,t,r,n,i,a,s)=>{if(null!=t&&null!=r&&null!=n&&n[0]!==n[1]){var o=pk(e,s),{tickCount:l}=t,c=0;return(c="angleAxis"===s&&(null==n?void 0:n.length)>=2?2*hz(n[0]-n[1])*c:c,o&&a)?a.map((e,t)=>{var n=r.map(e);return pv(n)?{coordinate:n+c,value:e,index:t,offset:c}:null}).filter(hH):r.ticks?r.ticks(l).map((e,t)=>{var n=r.map(e);return pv(n)?{coordinate:n+c,value:e,index:t,offset:c}:null}).filter(hH):r.domain().map((e,t)=>{var n=r.map(e);return pv(n)?{coordinate:n+c,value:i?i[e]:e,index:t,offset:c}:null}).filter(hH)}}),b1=d$(vP,bI,(e,t)=>{if(null!=e&&null!=t)return vy(vy({},e),{},{scale:t})}),b2=d$([vP,bb,bg,b_],bw);d$((e,t,r)=>vO(e,r),b2,(e,t)=>{if(null!=e&&null!=t)return vy(vy({},e),{},{scale:t})});var b5=d$([mi,pz,pL],(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}}),b4=e=>e.options.defaultTooltipEventType,b3=e=>e.options.validateTooltipEventTypes;function b6(e,t,r){if(null==e)return t;var n=e?"axis":"item";return null==r?t:r.includes(n)?n:t}function b8(e,t){return b6(t,b4(e),b3(e))}var b7=(e,t)=>{var r,n=Number(t);if(!hL(n)&&null!=t)return n>=0?null==e||null==(r=e[n])?void 0:r.value:void 0};function b9(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 we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b9(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)):b9(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var wt=(e,t,r,n)=>{if(null==t)return f$;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 f$;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 we(we({},o),{},{active:!0})}else if(null!=n)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return we(we({},f$),{},{coordinate:o.coordinate})},wr=(e,t,r,n)=>{var i=null==e?void 0:e.index;if(null==i)return null;var a=Number(i);if(!pv(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=pN(e,t);return!(null!=n&&gC(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)},wn=(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}}},wi=(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})},wa=e=>e.options.tooltipPayloadSearcher,ws=e=>e.tooltip;function wo(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 wl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wo(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)):wo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var wc=(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,f,{dataDefinedOnItem:p,settings:m}=r,x=null!=p?p:o,y=Array.isArray(x)?pg(x,c,u):x,g=null!=(d=null==m?void 0:m.dataKey)?d:n,v=null==m?void 0:m.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,h_.default)(e,t))===r)}(y,n,i):a(y,t,l,v))?h.forEach(t=>{var r=wl(wl({},m),{},{name:t.name,unit:t.unit,color:void 0,fill:void 0});e.push(pA({tooltipEntrySettings:r,dataKey:t.dataKey,payload:t.payload,value:pN(t.payload,t.dataKey),name:t.name}))}):e.push(pA({tooltipEntrySettings:m,dataKey:g,payload:h,value:pN(h,g),name:null!=(f=pN(h,v))?f:null==m?void 0:m.name})),e},[])}},wu=d$([vY,vE,gV],bv),wd=d$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),wh=d$([vh,vf],vA),wf=d$([wd,vY,wh],v_,{memoizeOptions:{resultEqualityCheck:vd}}),wp=d$([wf],e=>e.filter(vc)),wm=d$([wf],vR,{memoizeOptions:{resultEqualityCheck:vd}}),wx=d$([wm,gS],v$),wy=d$([wp,gS,vY],vl),wg=d$([wx,vY,wf],vU),wv=d$([vY],v1),wb=d$([vY],e=>e.allowDataOverflow),ww=d$([wv,wb],gA),wj=d$([wf],e=>e.filter(vc)),wN=d$([wy,wj,gB,gU],vQ),wk=d$([wN,gS,vh,ww],vJ),wS=d$([wf],vz),wO=d$([wx,vY,wS,v3,vh],v8,{memoizeOptions:{resultEqualityCheck:vu}}),wP=d$([be,vh,vf],bt),wC=d$([wP,vh],bo),wE=d$([bn,vh,vf],bt),wA=d$([wE,vh],bc),wM=d$([ba,vh,vf],bt),wT=d$([wM,vh],bd),w_=d$([wC,wT,wA],v6),wD=d$([vY,wv,ww,wk,wO,w_,mi,vh],bp),wI=d$([vY,mi,wx,wg,gB,vh,wD],by),wz=d$([wI,vY,wu],bj),wL=d$([vY,wI,wz,vh],bk),wR=e=>{var t=vh(e),r=vf(e);return bT(e,t,r,!1)},wF=d$([vY,wR],g0),w$=d$([vY,wu,wL,wF],bw),wB=d$([mi,wg,vY,vh],bX),wU=d$([mi,wg,vY,vh],bQ),wV=d$([mi,vY,wu,w$,wR,wB,wU,vh],(e,t,r,n,i,a,s,o)=>{if(t){var{type:l}=t,c=pk(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*hz(i[0]-i[1])*d:d,c&&s)?s.map((e,t)=>{var r=n.map(e);return pv(r)?{coordinate:r+d,value:e,index:t,offset:d}:null}).filter(hH):n.domain().map((e,t)=>{var r=n.map(e);return pv(r)?{coordinate:r+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(hH)}}}),wq=d$([b4,b3,e=>e.tooltip.settings],(e,t,r)=>b6(r.shared,e,t)),wK=e=>e.tooltip.settings.trigger,wW=e=>e.tooltip.settings.defaultIndex,wH=d$([ws,wq,wK,wW],wt),wY=d$([wH,wx,vX,wI],wr),wX=d$([wV,wY],b7),wG=d$([wH],e=>{if(e)return e.dataKey});d$([wH],e=>{if(e)return e.graphicalItemId});var wQ=d$([ws,wq,wK,wW],wi),wZ=d$([pT,p_,mi,p$,wV,wW,wQ],wn),wJ=d$([wH,wZ],(e,t)=>null!=e&&e.coordinate?e.coordinate:t),w0=d$([wH],e=>{var t;return null!=(t=null==e?void 0:e.active)&&t}),w1=d$([wQ,wY,gS,vX,wX,wa,wq],wc);function w2(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 w5(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w2(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)):w2(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}d$([w1],e=>{if(null!=e)return Array.from(new Set(e.map(e=>e.payload).filter(e=>null!=e)))});var w4=(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==(f=r[a-1])?void 0:f.coordinate,l=null==(p=r[s])?void 0:p.coordinate,c=s>=a-1?null==(m=r[0])?void 0:m.coordinate:null==(x=r[s+1])?void 0:x.coordinate,u=void 0;if(null!=o&&null!=l&&null!=c)if(hz(l-o)!==hz(c-l)){var d,h,f,p,m,x,y,g=[];if(hz(c-l)===hz(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 w=[Math.min(l,(u+l)/2),Math.max(l,(u+l)/2)];if(e>w[0]&&e<=w[1]||e>=g[0]&&e<=g[1])return null==(y=r[s])?void 0:y.index}else{var j,N=Math.min(o,c),k=Math.max(o,c);if(e>(N+l)/2&&e<=(k+l)/2)return null==(j=r[s])?void 0:j.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},w3=(e,t)=>t,w6=(e,t,r)=>r,w8=(e,t,r,n)=>n,w7=d$(wV,e=>(0,pu.default)(e,e=>e.coordinate)),w9=d$([ws,w3,w6,w8],wt),je=d$([w9,wx,vX,wI],wr),jt=d$([ws,w3,w6,w8],wi),jr=d$([pT,p_,mi,p$,wV,w8,jt],wn),jn=d$([w9,jr],(e,t)=>{var r;return null!=(r=e.coordinate)?r:t}),ji=d$([wV,je],b7),ja=d$([jt,je,gS,vX,ji,wa,w3],wc),js=d$([w9,je],(e,t)=>({isActive:e.active&&null!=t,activeIndex:t})),jo=d$([(e,t)=>t,mi,vi,vh,wF,wV,w7,p$],(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=w4("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?gY(gY({},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=w4("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 w5(w5(w5({},n),gG(n.cx,n.cy,s,a)),{},{angle:a,radius:s})}var o=i.coordinate,{angle:l}=n;return w5(w5(w5({},n),gG(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}}}),jl=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)}},jc=dJ("mouseClick"),ju=hM();ju.startListening({actionCreator:jc,effect:(e,t)=>{var r=e.payload,n=jo(t.getState(),jl(r));(null==n?void 0:n.activeIndex)!=null&&t.dispatch(fQ({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var jd=dJ("mouseMove"),jh=hM(),jf=null;function jp(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 jm(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 jx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jm(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)):jm(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}jh.startListening({actionCreator:jd,effect:(e,t)=>{var r=e.payload;null!==jf&&cancelAnimationFrame(jf);var n=jl(r);jf=requestAnimationFrame(()=>{var e=t.getState();if("axis"===b8(e,e.tooltip.settings.shared)){var r=jo(e,n);(null==r?void 0:r.activeIndex)!=null?t.dispatch(fG({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate})):t.dispatch(fY())}jf=null})}});var jy=he({name:"cartesianAxis",initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:d4()},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:d4()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:d4()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:d4()},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:d4()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:d4()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:d4()},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:d4()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:d4()},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]=jx(jx({},i),{},{width:n,widthHistory:o})}}}}),{addXAxis:jg,replaceXAxis:jv,removeXAxis:jb,addYAxis:jw,replaceYAxis:jj,removeYAxis:jN,addZAxis:jk,replaceZAxis:jS,removeZAxis:jO,updateYAxisWidth:jP}=jy.actions,jC=jy.reducer,jE=he({name:"graphicalItems",initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:d4()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=dw(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:d4()},removeCartesianGraphicalItem:{reducer(e,t){var r=dw(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:d4()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:d4()},removePolarGraphicalItem:{reducer(e,t){var r=dw(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:d4()}}}),{addCartesianGraphicalItem:jA,replaceCartesianGraphicalItem:jM,removeCartesianGraphicalItem:jT,addPolarGraphicalItem:j_,removePolarGraphicalItem:jD}=jE.actions,jI=jE.reducer,jz=he({name:"referenceElements",initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=dw(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=dw(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=dw(e).lines.findIndex(e=>e===t.payload);-1!==r&&e.lines.splice(r,1)}}}),{addDot:jL,removeDot:jR,addArea:jF,removeArea:j$,addLine:jB,removeLine:jU}=jz.actions,jV=jz.reducer,jq={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},jK=he({name:"brush",initialState:jq,reducers:{setBrushSettings:(e,t)=>null==t.payload?jq:t.payload}}),{setBrushSettings:jW}=jK.actions,jH=jK.reducer,jY=he({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:d4()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,i=dw(e).payload.indexOf(r);i>-1&&(e.payload[i]=n)},prepare:d4()},removeLegendPayload:{reducer(e,t){var r=dw(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:d4()}}}),{setLegendSize:jX,setLegendSettings:jG,addLegendPayload:jQ,replaceLegendPayload:jZ,removeLegendPayload:jJ}=jY.actions,j0=jY.reducer,j1={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},j2=he({name:"rootProps",initialState:j1,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=null!=(r=t.payload.barGap)?r:j1.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}}}),j5=j2.reducer,{updateOptions:j4}=j2.actions,j3=he({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:j6,removeRadiusAxis:j8,addAngleAxis:j7,removeAngleAxis:j9}=j3.actions,Ne=j3.reducer,Nt=he({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:Nr}=Nt.actions,Nn=Nt.reducer,Ni=dJ("keyDown"),Na=dJ("focus"),Ns=hM();Ns.startListening({actionCreator:Ni,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=wr(n,wx(r),vX(r),wI(r)),s=null==a?-1:Number(a);if(Number.isFinite(s)&&!(s<0)){var o=wV(r);if("Enter"===i){var l=jr(r,"axis","hover",String(n.index));t.dispatch(fJ({active:!n.active,activeIndex:n.index,activeCoordinate:l}));return}var c=s+("ArrowRight"===i?1:-1)*("left-to-right"===b5(r)?1:-1);if(null!=o&&!(c>=o.length)&&!(c<0)){var u=jr(r,"axis","hover",String(c));t.dispatch(fJ({active:!0,activeIndex:c.toString(),activeCoordinate:u}))}}}}}),Ns.startListening({actionCreator:Na,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=jr(r,"axis","hover",String("0"));t.dispatch(fJ({active:!0,activeIndex:"0",activeCoordinate:i}))}}}});var No=dJ("externalEvent"),Nl=hM(),Nc=new Map;Nl.startListening({actionCreator:No,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(null!=r){n.persist();var i=n.type,a=Nc.get(i);void 0!==a&&cancelAnimationFrame(a);var s=requestAnimationFrame(()=>{try{var e=t.getState(),a={activeCoordinate:wJ(e),activeDataKey:wG(e),activeIndex:wY(e),activeLabel:wX(e),activeTooltipIndex:wY(e),isTooltipActive:w0(e)};r(a,n)}finally{Nc.delete(i)}});Nc.set(i,s)}}});var Nu=d$([ws],e=>e.tooltipItemPayloads),Nd=d$([Nu,(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)}}}),Nh=dJ("touchMove"),Nf=hM();Nf.startListening({actionCreator:Nh,effect:(e,t)=>{var r=e.payload;if(null!=r.touches&&0!==r.touches.length){var n=t.getState(),i=b8(n,n.tooltip.settings.shared);if("axis"===i){var a=r.touches[0];if(null==a)return;var s=jo(n,jl({clientX:a.clientX,clientY:a.clientY,currentTarget:r.currentTarget}));(null==s?void 0:s.activeIndex)!=null&&t.dispatch(fG({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=wf(n).find(e=>e.id===d);if(null==u||null==h||null==d)return;var{dataKey:f}=h,p=Nd(n,u,d);t.dispatch(fW({activeDataKey:f,activeIndex:u,activeCoordinate:p,activeGraphicalItemId:d}))}}}});var Np=he({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:Nm,replaceErrorBar:Nx,removeErrorBar:Ny}=Np.actions,Ng=Np.reducer,Nv={devToolsEnabled:!0,isSsr:!("u">typeof window&&window.document&&window.document.createElement&&window.setTimeout)};function Nb(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 Nw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nb(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)):Nb(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Nj={zIndexMap:Object.values(gQ).reduce((e,t)=>Nw(Nw({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},NN=new Set(Object.values(gQ)),Nk=he({name:"zIndex",initialState:Nj,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:d4()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!NN.has(r)&&delete e.zIndexMap[r])},prepare:d4()},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:d4()},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:d4()}}}),{registerZIndexPortal:NS,unregisterZIndexPortal:NO,registerZIndexPortalElement:NP,unregisterZIndexPortalElement:NC}=Nk.actions,NE=dH({brush:jH,cartesianAxis:jC,chartData:f3,errorBars:Ng,graphicalItems:jI,layout:pt,legend:j0,options:hQ,polarAxis:Ne,polarOptions:Nn,referenceElements:jV,rootProps:j5,tooltip:f0,zIndex:Nk.reducer}),NA=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 d0;return t&&("boolean"==typeof t?a.push(dQ):a.push(dG(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(dW(a))t=dH(a);else throw Error(hT(1));r="function"==typeof s?s(i):i();let d=dY;o&&(d=dZ({trace:!1,..."object"==typeof o&&o}));let h=(n=function(...e){return t=>(r,n)=>{let i=t(r,n),a=()=>{throw Error(dU(15))},s={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=dY(...e.map(e=>e(s)))(i.dispatch),{...i,dispatch:a}}}(...r),function(e){let{autoBatch:t=!0}=e??{},r=new d0(n);return t&&r.push(d6("object"==typeof t?t:void 0)),r});return function e(t,r,n){if("function"!=typeof t)throw Error(dU(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(dU(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(dU(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(dU(3));return a}function h(e){if("function"!=typeof e)throw Error(dU(4));if(c)throw Error(dU(5));let t=!0;u();let r=l++;return o.set(r,e),function(){if(t){if(c)throw Error(dU(6));t=!1,u(),o.delete(r),s=null}}}function f(e){if(!dW(e))throw Error(dU(7));if(void 0===e.type)throw Error(dU(8));if("string"!=typeof e.type)throw Error(dU(17));if(c)throw Error(dU(9));try{c=!0,a=i(a,e)}finally{c=!1}return(s=o).forEach(e=>{e()}),e}return f({type:dK.INIT}),{dispatch:f,subscribe:h,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw Error(dU(10));i=e,f({type:dK.REPLACE})},[dV]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(dU(11));function t(){e.next&&e.next(d())}return t(),{unsubscribe:h(t)}},[dV](){return this}}}}}(t,c,d(..."function"==typeof u?u(h):h()))}({reducer:NE,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes("es6")}).concat([ju.middleware,jh.middleware,Ns.middleware,Nl.middleware,Nf.middleware]),enhancers:e=>{var t=e;return"function"==typeof e&&(t=e()),t.concat(d6({type:"raf"}))},devTools:Nv.devToolsEnabled&&{serialize:{replacer:jp},name:"recharts-".concat(t)}})};function NM(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=pq(),a=(0,H.useRef)(null);return i?r:(null==a.current&&(a.current=NA(t,n)),H.createElement(h8,{context:pn,store:a.current},r))}var NT=e=>{var{chartData:t}=e,r=pa(),n=pq();return(0,H.useEffect)(()=>n?()=>{}:(r(f2(t)),()=>{r(f2(void 0))}),[t,r,n]),null},N_=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function ND(e,t){for(var r of new Set([...Object.keys(e),...Object.keys(t)]))if(N_.has(r)){if(null==e[r]&&null==t[r])continue;if(!function(e,t){if(h5(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])||!h5(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 NI=(0,H.memo)(function(e){var{layout:t,margin:r}=e,n=pa(),i=pq();return(0,H.useEffect)(()=>{i||(n(f7(t)),n(f8(r)))},[n,i,t,r]),null},ND);function Nz(e){var t=pa();return(0,H.useEffect)(()=>{t(j4(e))},[t,e]),null}var NL=()=>{var e;return null==(e=pc(e=>e.rootProps.accessibilityLayer))||e},NR=["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 NF(e){return"string"==typeof e&&NR.includes(e)}var N$=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 NB(e){return"string"==typeof e&&N$.has(e)}function NU(e){return"string"==typeof e&&e.startsWith("data-")}function NV(e){if("object"!=typeof e||null===e)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(NB(r)||NU(r))&&(t[r]=e[r]);return t}function Nq(e){return null==e?null:(0,H.isValidElement)(e)&&"object"==typeof e.props&&null!==e.props?NV(e.props):"object"!=typeof e||Array.isArray(e)?null:NV(e)}function NK(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(NB(r)||NU(r)||NF(r))&&(t[r]=e[r]);return t}var NW=["children","width","height","viewBox","className","style","title","desc"];function NH(){return(NH=Object.assign.bind()).apply(null,arguments)}var NY=(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,NW),d=a||{width:n,height:i,x:0,y:0},h=sl("recharts-surface",s);return H.createElement("svg",NH({},NK(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)}),NX=d$(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}}),NG=d$(e=>e.zIndex.zIndexMap,e=>Array.from(new Set(Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(gQ)))).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 NQ(e){var{zIndex:t,isPanorama:r}=e,n=(0,H.useRef)(null),i=pa();return(0,H.useLayoutEffect)(()=>(n.current&&i(NP({zIndex:t,element:n.current,isPanorama:r})),()=>{i(NC({zIndex:t,isPanorama:r}))}),[i,t,r]),H.createElement("g",{tabIndex:-1,ref:n})}function NZ(e){var{children:t,isPanorama:r}=e,n=pc(NG);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(NQ,{key:e,zIndex:e,isPanorama:r})),t,a.map(e=>H.createElement(NQ,{key:e,zIndex:e,isPanorama:r})))}var NJ=["children"];function N0(){return(N0=Object.assign.bind()).apply(null,arguments)}var N1={width:"100%",height:"100%",display:"block"},N2=(0,H.forwardRef)((e,t)=>{var r,n,i=pc(pT),a=pc(p_),s=NL();if(!pb(i)||!pb(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(NY,N0({},l,{title:c,desc:u,role:n,tabIndex:r,width:i,height:a,style:N1,ref:t}),o)}),N5=e=>{var{children:t}=e,r=pc(pW);if(!r)return null;var{width:n,height:i,y:a,x:s}=r;return H.createElement(NY,{width:n,height:i,x:s,y:a},t)},N4=(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,NJ);return pq()?H.createElement(N5,null,H.createElement(NZ,{isPanorama:!0},r)):H.createElement(N2,N0({ref:t},n),H.createElement(NZ,{isPanorama:!1},r))}),N3=new(e.i(236)).default,N6="recharts.syncEvent.tooltip",N8="recharts.syncEvent.brush";function N7(e){return e.tooltip.syncInteraction}var N9=["x","y"];function ke(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 kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ke(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)):ke(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var kr=(0,H.createContext)(null),kn=(0,H.createContext)(null);function ki(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 ka(){return(ka=Object.assign.bind()).apply(null,arguments)}var ks=()=>{var e,t,r,n,i,a,s,o,l,c,u,d;return e=pa(),(0,H.useEffect)(()=>{e(hZ())},[e]),t=pc(gq),r=pc(gW),n=pa(),i=pc(gK),a=pc(wV),s=pc(mi),o=mr(),l=pc(e=>e.rootProps.className),(0,H.useEffect)(()=>{if(null==t)return hY;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:f,y:p}=h,m=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,N9),{x:x,y:y,width:g,height:v}=l.payload.sourceViewBox,b=kt(kt({},m),{},{x:o.x+(g?(f-x)/g:0)*o.width,y:o.y+(v?(p-y)/v:0)*o.height});n(kt(kt({},l),{},{payload:kt(kt({},l.payload),{},{coordinate:b})}))}else n(l);return}if(null!=a){if("function"==typeof i){var w=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[w]}else"value"===i&&(d=a.find(e=>String(e.value)===l.payload.label));var{coordinate:j}=l.payload;if(null==d||!1===l.payload.active||null==j||null==o)return void n(fZ({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));var{x:N,y:k}=j,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(fZ({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 N3.on(N6,e),()=>{N3.off(N6,e)}},[l,n,r,t,i,a,s,o]),c=pc(gq),u=pc(gW),d=pa(),(0,H.useEffect)(()=>{if(null==c)return hY;var e=(e,t,r)=>{u!==r&&c===e&&d(f5(t))};return N3.on(N8,e),()=>{N3.off(N8,e)}},[d,u,c]),null};function ko(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var kl=(0,H.forwardRef)((e,t)=>{var r,n,i=(0,H.useRef)(null),[a,s]=(0,H.useState)({containerWidth:ko(null==(r=e.style)?void 0:r.width),containerHeight:ko(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(mo,{width:a.containerWidth,height:a.containerHeight}),H.createElement("div",ka({ref:l},e)))}),kc=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e,[i,a]=(0,H.useState)({containerWidth:ko(r),containerHeight:ko(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(mo,{width:i.containerWidth,height:i.containerHeight}),H.createElement("div",ka({ref:o},e)))}),ku=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e;return H.createElement(H.Fragment,null,H.createElement(mo,{width:r,height:n}),H.createElement("div",ka({ref:t},e)))}),kd=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e;return"string"==typeof r||"string"==typeof n?H.createElement(kc,ka({},e,{ref:t})):"number"==typeof r&&"number"==typeof n?H.createElement(ku,ka({},e,{width:r,height:n,ref:t})):H.createElement(H.Fragment,null,H.createElement(mo,{width:r,height:n}),H.createElement("div",ka({ref:t},e)))}),kh=(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:f,onTouchMove:p,onTouchStart:m,style:x,width:y,responsive:g,dispatchTouchEvents:v=!0}=e,b=(0,H.useRef)(null),w=pa(),[j,N]=(0,H.useState)(null),[k,S]=(0,H.useState)(null),O=function(){var e=pa(),[t,r]=(0,H.useState)(null),n=pc(pD);return(0,H.useEffect)(()=>{if(null!=t){var r=t.getBoundingClientRect().width/t.offsetWidth;pv(r)&&r!==n&&e(pe(r))}},[t,e,n]),r}(),P=p7(),C=(null==P?void 0:P.width)>0?P.width:y,E=(null==P?void 0:P.height)>0?P.height:i,A=(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=>{w(jc(e)),w(No({handler:a,reactEvent:e}))},[w,a]),T=(0,H.useCallback)(e=>{w(jd(e)),w(No({handler:c,reactEvent:e}))},[w,c]),_=(0,H.useCallback)(e=>{w(fY()),w(No({handler:u,reactEvent:e}))},[w,u]),D=(0,H.useCallback)(e=>{w(jd(e)),w(No({handler:d,reactEvent:e}))},[w,d]),I=(0,H.useCallback)(()=>{w(Na())},[w]),z=(0,H.useCallback)(e=>{w(Ni(e.key))},[w]),L=(0,H.useCallback)(e=>{w(No({handler:s,reactEvent:e}))},[w,s]),R=(0,H.useCallback)(e=>{w(No({handler:o,reactEvent:e}))},[w,o]),F=(0,H.useCallback)(e=>{w(No({handler:l,reactEvent:e}))},[w,l]),$=(0,H.useCallback)(e=>{w(No({handler:h,reactEvent:e}))},[w,h]),B=(0,H.useCallback)(e=>{w(No({handler:m,reactEvent:e}))},[w,m]),U=(0,H.useCallback)(e=>{v&&w(Nh(e)),w(No({handler:p,reactEvent:e}))},[w,v,p]),V=(0,H.useCallback)(e=>{w(No({handler:f,reactEvent:e}))},[w,f]);return H.createElement(kr.Provider,{value:j},H.createElement(kn.Provider,{value:k},H.createElement(g?kl:kd,{width:null!=C?C:null==x?void 0:x.width,height:null!=E?E:null==x?void 0:x.height,className:sl("recharts-wrapper",n),style:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ki(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)):ki(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({position:"relative",cursor:"default",width:C,height:E},x),onClick:M,onContextMenu:L,onDoubleClick:R,onFocus:I,onKeyDown:z,onMouseDown:F,onMouseEnter:T,onMouseLeave:_,onMouseMove:D,onMouseUp:$,onTouchEnd:V,onTouchMove:U,onTouchStart:B,ref:A},H.createElement(ks,null),r)))}),kf=d$([p$],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),kp=d$([kf,pT,p_],(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)}}),km=(0,H.createContext)(void 0),kx=e=>{var{children:t}=e,[r]=(0,H.useState)("".concat(hU("recharts"),"-clip")),n=pc(kp);if(null==n)return null;var{x:i,y:a,width:s,height:o}=n;return H.createElement(km.Provider,{value:r},H.createElement("defs",null,H.createElement("clipPath",{id:r},H.createElement("rect",{x:i,y:a,height:o,width:s}))),t)},ky=["width","height","responsive","children","className","style","compact","title","desc"],kg=(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=NV(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,ky));return l?H.createElement(H.Fragment,null,H.createElement(mo,{width:r,height:n}),H.createElement(N4,{otherAttributes:d,title:c,desc:u},a)):H.createElement(kh,{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(N4,{otherAttributes:d,title:c,desc:u,ref:t},H.createElement(kx,null,a)))});function kv(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 kb(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kv(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)):kv(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 kw(){return(kw=Object.assign.bind()).apply(null,arguments)}var kj={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"},kN=(0,H.forwardRef)(function(e,t){var r,n=kb(e.categoricalChartProps,kj),{chartName:i,defaultTooltipEventType:a,validateTooltipEventTypes:s,tooltipPayloadSearcher:o,categoricalChartProps:l}=e;return H.createElement(NM,{preloadedState:{options:{chartName:i,defaultTooltipEventType:a,validateTooltipEventTypes:s,tooltipPayloadSearcher:o,eventEmitter:void 0}},reduxStoreName:null!=(r=l.id)?r:i},H.createElement(NT,{chartData:l.data}),H.createElement(NI,{layout:n.layout,margin:n.margin}),H.createElement(Nz,{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(kg,kw({},n,{ref:t})))}),kk=["axis","item"],kS=(0,H.forwardRef)((e,t)=>H.createElement(kN,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:kk,tooltipPayloadSearcher:hX,categoricalChartProps:e,ref:t})),kO=H,kP=["children","className"];function kC(){return(kC=Object.assign.bind()).apply(null,arguments)}var kE=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,kP),a=sl("recharts-layer",n);return H.createElement("g",kC({className:a},NK(i),{ref:t}),r)}),kA=e=>null;kA.displayName="Cell";var kM=e.i(9944);function kT(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 k_=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kT(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)):kT(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},{cacheSize:2e3,enableCache:!0}),kD=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}}(k_.cacheSize),kI={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},kz="recharts_measurement_span",kL=(e,t)=>{try{var r=document.getElementById(kz);r||((r=document.createElement("span")).setAttribute("id",kz),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,kI,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch(e){return{width:0,height:0}}},kR=function(e){var t,r,n,i,a,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||Nv.isSsr)return{width:0,height:0};if(!k_.enableCache)return kL(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=kD.get(l);if(c)return c;var u=kL(e,o);return kD.set(l,u),u},kF=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,k$=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,kB=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,kU=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,kV={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},kq=["cm","mm","pt","pc","in","Q","px"];class kK{static parse(e){var t,[,r,n]=null!=(t=kU.exec(e))?t:[];return null==r?kK.NaN:new kK(parseFloat(r),null!=n?n:"")}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,hL(e)&&(this.unit=""),""===t||kB.test(t)||(this.num=NaN,this.unit=""),kq.includes(t)&&(this.num=e*kV[t],this.unit="px")}add(e){return this.unit!==e.unit?new kK(NaN,""):new kK(this.num+e.num,this.unit)}subtract(e){return this.unit!==e.unit?new kK(NaN,""):new kK(this.num-e.num,this.unit)}multiply(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new kK(NaN,""):new kK(this.num*e.num,this.unit||e.unit)}divide(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new kK(NaN,""):new kK(this.num/e.num,this.unit||e.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return hL(this.num)}}function kW(e){if(null==e||e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,a]=null!=(r=kF.exec(t))?r:[],s=kK.parse(null!=n?n:""),o=kK.parse(null!=a?a:""),l="*"===i?s.multiply(o):s.divide(o);if(l.isNaN())return"NaN";t=t.replace(kF,l.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var c,[,u,d,h]=null!=(c=k$.exec(t))?c:[],f=kK.parse(null!=u?u:""),p=kK.parse(null!=h?h:""),m="+"===d?f.add(p):f.subtract(p);if(m.isNaN())return"NaN";t=t.replace(k$,m.toString())}return t}h="NaN",f=new kK(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 kK?Object.defineProperty(kK,h,{value:f,enumerable:!0,configurable:!0,writable:!0}):kK[h]=f;var kH=/\(([^()]*)\)/;function kY(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t,r=e;null!=(t=kH.exec(r));){var[,n]=t;r=r.replace(kH,kW(n))}return r}(t),t=kW(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var kX=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],kG=["dx","dy","angle","className","breakAll"];function kQ(){return(kQ=Object.assign.bind()).apply(null,arguments)}function kZ(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 kJ=/[ \f\n\r\t\v\u2028\u2029]+/,k0=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];null!=t&&(i=r?t.toString().split(""):t.toString().split(kJ));var a=i.map(e=>({word:e,width:kR(e,n).width})),s=r?0:kR(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch(e){return null}},k1=(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},[]),k2=e=>e.reduce((e,t)=>e.width>t.width?e:t),k5=(e,t,r,n,i,a,s,o)=>{var l=k0({breakAll:r,style:n,children:e.slice(0,t)+"…"});if(!l)return[!1,[]];var c=k1(l.wordsWithComputedWidth,a,s,o);return[c.length>i||k2(c).width>Number(a),c]},k4=e=>[{words:null==e?[]:e.toString().split(kJ),width:void 0}],k3="#808080",k6={angle:0,breakAll:!1,capHeight:"0.71em",fill:k3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},k8=(0,H.forwardRef)((e,t)=>{var r,n=kb(e,k6),{x:i,y:a,lineHeight:s,capHeight:o,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,h=kZ(n,kX),f=(0,H.useMemo)(()=>(e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:a,maxLines:s}=e;if((t||r)&&!Nv.isSsr){var o=k0({breakAll:a,children:n,style:i});if(!o)return k4(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=hF(s),d=String(o),h=k1(t,n,r,i);if(!u||i||!(h.length>s||k2(h).width>Number(n)))return h;for(var f=0,p=d.length-1,m=0;f<=p&&m<=d.length-1;){var x=Math.floor((f+p)/2),[y,g]=k5(d,x-1,c,l,s,n,r,i),[v]=k5(d,x,c,l,s,n,r,i);if(y||v||(f=x+1),y&&v&&(p=x-1),!y&&v){a=g;break}m++}return a||h})({breakAll:a,children:n,maxLines:s,style:i},l,c,t,!!r)}return k4(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:p,dy:m,angle:x,className:y,breakAll:g}=h,v=kZ(h,kG);if(!h$(i)||!h$(a)||0===f.length)return null;var b=Number(i)+(hF(p)?p:0),w=Number(a)+(hF(m)?m:0);if(!pv(b)||!pv(w))return null;switch(d){case"start":r=kY("calc(".concat(o,")"));break;case"middle":r=kY("calc(".concat((f.length-1)/2," * -").concat(s," + (").concat(o," / 2))"));break;default:r=kY("calc(".concat(f.length-1," * -").concat(s,")"))}var j=[],N=f[0];if(c&&null!=N){var k=N.width,{width:S}=h;j.push("scale(".concat(hF(S)&&hF(k)?S/k:1,")"))}return x&&j.push("rotate(".concat(x,", ").concat(b,", ").concat(w,")")),j.length&&(v.transform=j.join(" ")),H.createElement("text",kQ({},NK(v),{ref:t,x:b,y:w,className:sl("recharts-text",y),textAnchor:u,fill:l.includes("url")?k3:l}),f.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)}))});k8.displayName="Text";var k7=e.i(9854);function k9(e){var{zIndex:t,children:r}=e,n=void 0!==pc(mi)&&void 0!==t&&0!==t,i=pq(),a=pa();(0,H.useLayoutEffect)(()=>n?(a(NS({zIndex:t})),()=>{a(NO({zIndex:t}))}):hY,[a,t,n]);var s=pc(e=>NX(e,t,i));return n?s?(0,k7.createPortal)(r,s):null:r}function Se(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 St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(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)):Se(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Sr=["labelRef"],Sn=["content"];function Si(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 Sa(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 Ss(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sa(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)):Sa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function So(){return(So=Object.assign.bind()).apply(null,arguments)}var Sl=(0,H.createContext)(null),Sc=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(Sl.Provider,{value:l},o)},Su=()=>{var e=(0,H.useContext)(Sl),t=mr();return e||(t?mt(t):void 0)},Sd=(0,H.createContext)(null),Sh=e=>null!=e&&"function"==typeof e,Sf=e=>null!=e&&"cx"in e&&hF(e.cx),Sp={angle:0,offset:5,zIndex:gQ.label,position:"middle",textBreakAll:!1};function Sm(e){var t,r,n,i,a,s,o=kb(e,Sp),{viewBox:l,parentViewBox:c,position:u,value:d,children:h,content:f,className:p="",textBreakAll:m,labelRef:x}=o,y=(t=(0,H.useContext)(Sd),r=pc(vi),t||r),g=Su(),v=function(e){if(!Sf(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:Sf(l)?l:mt(l));if(!i||null==d&&null==h&&!(0,H.isValidElement)(f)&&"function"!=typeof f)return null;var b=Ss(Ss({},o),{},{viewBox:i});if((0,H.isValidElement)(f)){var{labelRef:w}=b,j=Si(b,Sr);return(0,H.cloneElement)(f,j)}if("function"==typeof f){var{content:N}=b,k=Si(b,Sn);if(a=(0,H.createElement)(f,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=NK(o);if(Sf(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:f,endAngle:p,clockWise:m}=i,x=(d+h)/2,y=hz(p-f)*Math.min(Math.abs(p-f),360),g=y>=0?1:-1;switch(t){case"insideStart":a=f+g*o,s=m;break;case"insideEnd":a=p-g*o,s=!m;break;case"end":a=p+g*o,s=m;break;default:throw Error("Unsupported position ".concat(t))}s=y<=0?s:!s;var v=gG(c,u,x,a),b=gG(c,u,x,a+(s?1:-1)*359),w="M".concat(v.x,",").concat(v.y,"\n A").concat(x,",").concat(x,",0,1,").concat(+!s,",\n ").concat(b.x,",").concat(b.y),j=null==e.id?hU("recharts-radial-line-"):e.id;return H.createElement("text",So({},n,{dominantBaseline:"central",className:sl("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:j,d:w})),H.createElement("textPath",{xlinkHref:"#".concat(j)},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}=gG(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:f}=gG(n,i,(a+s)/2,c);return{x:h,y:f,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}=mt(t),d=s+(c-u)/2,h=(s+d)/2,f=(c+u)/2,p=l>=0?1:-1,m=p*n,x=p>0?"end":"start",y=p>0?"start":"end",g=c>=0?1:-1,v=g*n,b=g>0?"end":"start",w=g>0?"start":"end";if("top"===r){var j={x:s+c/2,y:o-m,horizontalAnchor:"middle",verticalAnchor:x};return a&&i&&(j.height=Math.max(o-i.y,0),j.width=c),j}if("bottom"===r){var N={x:d+u/2,y:o+l+m,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+f+v,y:o+l/2,horizontalAnchor:w,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:f,height:l}:{};return"insideLeft"===r?St({x:h+v,y:o+l/2,horizontalAnchor:w,verticalAnchor:"middle"},O):"insideRight"===r?St({x:h+f-v,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"},O):"insideTop"===r?St({x:s+c/2,y:o+m,horizontalAnchor:"middle",verticalAnchor:y},O):"insideBottom"===r?St({x:d+u/2,y:o+l-m,horizontalAnchor:"middle",verticalAnchor:x},O):"insideTopLeft"===r?St({x:s+v,y:o+m,horizontalAnchor:w,verticalAnchor:y},O):"insideTopRight"===r?St({x:s+c-v,y:o+m,horizontalAnchor:b,verticalAnchor:y},O):"insideBottomLeft"===r?St({x:d+v,y:o+l-m,horizontalAnchor:w,verticalAnchor:x},O):"insideBottomRight"===r?St({x:d+u-v,y:o+l-m,horizontalAnchor:b,verticalAnchor:x},O):r&&"object"==typeof r&&(hF(r.x)||hR(r.x))&&(hF(r.y)||hR(r.y))?St({x:s+hV(r.x,f),y:o+hV(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},O):St({x:s+c/2,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},O)})({viewBox:v,position:u,offset:o.offset,parentViewBox:Sf(c)?void 0:c,clamp:!0});s=Ss(Ss({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(k9,{zIndex:o.zIndex},H.createElement(k8,So({ref:x,className:sl("recharts-label",p)},S,s,{textAnchor:"start"===(n=S.textAnchor)||"middle"===n||"end"===n||"inherit"===n?S.textAnchor:s.textAnchor,breakAll:m}),a))}function Sx(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(Sm,So({key:"label-implicit"},n)):h$(e)?H.createElement(Sm,So({key:"label-implicit",value:e},n)):(0,H.isValidElement)(e)?e.type===Sm?(0,H.cloneElement)(e,Ss({key:"label-implicit"},n)):H.createElement(Sm,So({key:"label-implicit",content:e},n)):Sh(e)?H.createElement(Sm,So({key:"label-implicit",content:e},n)):e&&"object"==typeof e?H.createElement(Sm,So({},e,{key:"label-implicit"},n)):null})(t,Su(),r)||null}Sm.displayName="Label";var Sy=["valueAccessor"],Sg=["dataKey","clockWise","id","textBreakAll","zIndex"];function Sv(){return(Sv=Object.assign.bind()).apply(null,arguments)}function Sb(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 Sw=e=>Array.isArray(e.value)?(0,kM.default)(e.value):e.value,Sj=(0,H.createContext)(void 0),SN=Sj.Provider,Sk=(0,H.createContext)(void 0);function SS(e){var{valueAccessor:t=Sw}=e,r=Sb(e,Sy),{dataKey:n,clockWise:i,id:a,textBreakAll:s,zIndex:o}=r,l=Sb(r,Sg),c=(0,H.useContext)(Sj),u=(0,H.useContext)(Sk),d=c||u;return d&&d.length?H.createElement(k9,{zIndex:null!=o?o:gQ.label},H.createElement(kE,{className:"recharts-label-list"},d.map((e,i)=>{var o,c=null==n?t(e,i):pN(e.payload,n),u=null==a?{}:{id:"".concat(a,"-").concat(i)};return H.createElement(Sm,Sv({key:"label-".concat(i)},NK(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 SO(e){var{label:t}=e;return t?!0===t?H.createElement(SS,{key:"labelList-implicit"}):H.isValidElement(t)||Sh(t)?H.createElement(SS,{key:"labelList-implicit",content:t}):"object"==typeof t?H.createElement(SS,Sv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}Sk.Provider,SS.displayName="LabelList";var SP=e.i(29095),SC=e=>"string"==typeof e?e:e?e.displayName||e.name||"Component":"",SE=null,SA=null,SM=e=>{if(e===SE&&Array.isArray(SA))return SA;var t=[];return H.Children.forEach(e,e=>{null!=e&&((0,SP.isFragment)(e)?t=t.concat(SM(e.props.children)):t.push(e))}),SA=t,SE=e,t},ST=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,S_=(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];NF(i)&&"function"==typeof a&&(n||(n={}),n[i]=e=>(a(t,r,e),null))}),n},SD=e.i(91804);function SI(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 Sz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SI(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)):SI(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var SL=(e,t,r)=>e.map(e=>"".concat(e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))," ").concat(t,"ms ").concat(r)).join(","),SR=(e,t)=>Object.keys(t).reduce((r,n)=>Sz(Sz({},r),{},{[n]:e(n,t[n])}),{});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=(e,t,r)=>e+(t-e)*r,SU=e=>{var{from:t,to:r}=e;return t!==r},SV=(e,t,r)=>{var n=SR((t,r)=>{if(SU(r)){var[n,i]=e(r.from,r.to,r.velocity);return S$(S$({},r),{},{from:n,velocity:i})}return r},t);return r<1?SR((e,t)=>SU(t)&&null!=n[e]?S$(S$({},t),{},{velocity:SB(t.velocity,n[e].velocity,r),from:SB(t.from,n[e].from,r)}):t,t):SV(e,n,r-1)},Sq=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],SK=(e,t)=>e.map((e,r)=>e*t**r).reduce((e,t)=>e+t),SW=(e,t)=>r=>SK(Sq(e,t),r),SH=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]},SY=function(){return((e,t,r,n)=>{var i=SW(e,r),a=SW(t,n),s=t=>SK([...Sq(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})(...SH(...arguments))},SX=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 SG{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 SQ=(0,H.createContext)(function(){var e,t,r,n,i;return e=new SG,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}}),SZ={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},SJ={t:0},S0={t:1};function S1(e){var t,r,n,i=kb(e,SZ),{isActive:a,canBegin:s,duration:o,easing:l,begin:c,onAnimationEnd:u,onAnimationStart:d,children:h}=i,f="auto"===a?!Nv.isSsr:a,p=(t=i.animationId,r=i.animationManager,n=(0,H.useContext)(SQ),(0,H.useMemo)(()=>null!=r?r:n(t),[t,r,n])),[m,x]=(0,H.useState)(f?SJ:S0),y=(0,H.useRef)(null);return(0,H.useEffect)(()=>{f||x(S0)},[f]),(0,H.useEffect)(()=>{if(!f||!s)return hY;var e=((e,t,r,n,i,a)=>{var s,o,l,c,u,d,h,f,p=[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e)));return null==r?()=>(i(S$(S$({},e),t)),()=>{}):!0===r.isStepper?(o=p.reduce((r,n)=>S$(S$({},r),{},{[n]:{from:e[n],velocity:0,to:t[n]}}),{}),l=null,c=n=>{s||(s=n);var u=(n-s)/r.dt;o=SV(r,o,u),i(S$(S$(S$({},e),t),SR((e,t)=>t.from,o))),s=n,Object.values(o).filter(SU).length&&(l=a.setTimeout(c))},()=>(l=a.setTimeout(c),()=>{var e;null==(e=l)||e()})):(d=null,h=p.reduce((r,n)=>{var i=e[n],a=t[n];return null==i||null==a?r:S$(S$({},r),{},{[n]:[i,a]})},{}),f=s=>{u||(u=s);var o=(s-u)/n,l=SR((e,t)=>SB(...t,r(o)),h);if(i(S$(S$(S$({},e),t),l)),o<1)d=a.setTimeout(f);else{var c=SR((e,t)=>SB(...t,r(1)),h);i(S$(S$(S$({},e),t),c))}},()=>(d=a.setTimeout(f),()=>{var e;null==(e=d)||e()}))})(SJ,S0,(e=>{if("string"==typeof e)switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return SY(e);case"spring":return SX();default:if("cubic-bezier"===e.split("(")[0])return SY(e)}return"function"==typeof e?e:null})(l),o,x,p.getTimeoutController());return p.start([d,c,()=>{y.current=e()},o,u]),()=>{p.stop(),y.current&&y.current(),u()}},[f,s,o,l,c,d,u,p]),h(m.t)}function S2(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"animation-",r=(0,H.useRef)(hU(t)),n=(0,H.useRef)(e);return n.current!==e&&(r.current=hU(t),n.current=e),r.current}var S5=["radius"],S4=["radius"];function S3(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 S6(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S3(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)):S3(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function S8(){return(S8=Object.assign.bind()).apply(null,arguments)}function S7(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 S9(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Oe=(e,t,r,n,i)=>{var a=hD(r),s=hD(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 f,p,m=null!=(p=i[h])?p:0;d[h]=m>o?o:m}f=hI(N||(N=S9(["M",",",""])),e,t+l*d[0]),d[0]>0&&(f+=hI(k||(k=S9(["A ",",",",0,0,",",",",",""])),d[0],d[0],u,e+c*d[0],t)),f+=hI(S||(S=S9(["L ",",",""])),e+r-c*d[1],t),d[1]>0&&(f+=hI(O||(O=S9(["A ",",",",0,0,",",\n ",",",""])),d[1],d[1],u,e+r,t+l*d[1])),f+=hI(P||(P=S9(["L ",",",""])),e+r,t+n-l*d[2]),d[2]>0&&(f+=hI(C||(C=S9(["A ",",",",0,0,",",\n ",",",""])),d[2],d[2],u,e+r-c*d[2],t+n)),f+=hI(E||(E=S9(["L ",",",""])),e+c*d[3],t+n),d[3]>0&&(f+=hI(A||(A=S9(["A ",",",",0,0,",",\n ",",",""])),d[3],d[3],u,e,t+n-l*d[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);f=hI(M||(M=S9(["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 f=hI(T||(T=S9(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},Ot={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Or=e=>{var t=kb(e,Ot),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:f,isAnimationActive:p,isUpdateAnimationActive:m}=t,x=(0,H.useRef)(o),y=(0,H.useRef)(l),g=(0,H.useRef)(a),v=(0,H.useRef)(s),b=S2((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 w=sl("recharts-rectangle",u);if(!m){var j=NK(t),{radius:N}=j,k=S7(j,S5);return H.createElement("path",S8({},k,{x:hD(a),y:hD(s),width:hD(o),height:hD(l),radius:"number"==typeof c?c:void 0,className:w,d:Oe(a,s,o,l,c)}))}var S=x.current,O=y.current,P=g.current,C=v.current,E="0px ".concat(-1===n?1:n,"px"),A="".concat(n,"px 0px"),M=SL(["strokeDasharray"],h,"string"==typeof d?d:Ot.animationEasing);return H.createElement(S1,{animationId:b,key:b,canBegin:n>0,duration:h,easing:d,isActive:m,begin:f},e=>{var n,i=hK(S,o,e),u=hK(O,l,e),d=hK(P,a,e),h=hK(C,s,e);r.current&&(x.current=i,y.current=u,g.current=d,v.current=h),n=p?e>0?{transition:M,strokeDasharray:A}:{strokeDasharray:E}:{strokeDasharray:A};var f=NK(t),{radius:m}=f,b=S7(f,S4);return H.createElement("path",S8({},b,{radius:"number"==typeof c?c:void 0,className:w,d:Oe(d,h,i,u,c),ref:r,style:S6(S6({},n),t.style)}))})};function On(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?On(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)):On(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Oa(){return(Oa=Object.assign.bind()).apply(null,arguments)}function Os(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Oo=(e,t,r,n,i)=>{var a=r-n;return hI(_||(_=Os(["M ",",",""])),e,t)+hI(D||(D=Os(["L ",",",""])),e+r,t)+hI(I||(I=Os(["L ",",",""])),e+r-a/2,t+i)+hI(z||(z=Os(["L ",",",""])),e+r-a/2-n,t+i)+hI(L||(L=Os(["L ",","," Z"])),e,t)},Ol={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Oc=e=>{var t=kb(e,Ol),{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),[f,p]=(0,H.useState)(-1),m=(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=S2(e,"trapezoid-");if((0,H.useEffect)(()=>{if(h.current&&h.current.getTotalLength)try{var e=h.current.getTotalLength();e&&p(e)}catch(e){}},[]),r!==+r||n!==+n||i!==+i||a!==+a||s!==+s||0===i&&0===a||0===s)return null;var w=sl("recharts-trapezoid",o);if(!d)return H.createElement("g",null,H.createElement("path",Oa({},NK(t),{className:w,d:Oo(r,n,i,a,s)})));var j=m.current,N=x.current,k=y.current,S=g.current,O=v.current,P="0px ".concat(-1===f?1:f,"px"),C="".concat(f,"px 0px"),E=SL(["strokeDasharray"],c,l);return H.createElement(S1,{animationId:b,key:b,canBegin:f>0,duration:c,easing:l,isActive:d,begin:u},e=>{var o=hK(j,i,e),l=hK(N,a,e),c=hK(k,s,e),u=hK(S,r,e),d=hK(O,n,e);h.current&&(m.current=o,x.current=l,y.current=c,g.current=u,v.current=d);var f=e>0?{transition:E,strokeDasharray:C}:{strokeDasharray:P};return H.createElement("path",Oa({},NK(t),{className:w,d:Oo(u,d,o,l,c),ref:h,style:Oi(Oi({},f),t.style)}))})};function Ou(){return(Ou=Object.assign.bind()).apply(null,arguments)}function Od(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Oh=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)/gX,d=l?i:i+a*u,h=gG(t,r,c,d);return{center:h,circleTangency:gG(t,r,n,d),lineTangency:gG(t,r,c*Math.cos(u*gX),l?i-a*u:i),theta:u}},Of=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:a,endAngle:s}=e,o=hz(s-a)*Math.min(Math.abs(s-a),359.999),l=a+o,c=gG(t,r,i,a),u=gG(t,r,i,l),d=hI(R||(R=Od(["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=gG(t,r,n,a),f=gG(t,r,n,l);d+=hI(F||(F=Od(["L ",",","\n A ",",",",0,\n ",",",",\n ",","," Z"])),f.x,f.y,n,n,+(Math.abs(o)>180),+(a<=l),h.x,h.y)}else d+=hI($||($=Od(["L ",","," Z"])),t,r);return d},Op={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Om=e=>{var t,r=kb(e,Op),{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 f=sl("recharts-sector",h),p=s-a,m=hV(o,p,0,!0);return t=m>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=hz(c-l),{circleTangency:d,lineTangency:h,theta:f}=Oh({cx:t,cy:r,radius:i,angle:l,sign:u,cornerRadius:a,cornerIsExternal:o}),{circleTangency:p,lineTangency:m,theta:x}=Oh({cx:t,cy:r,radius:i,angle:c,sign:-u,cornerRadius:a,cornerIsExternal:o}),y=o?Math.abs(l-c):Math.abs(l-c)-f-x;if(y<0)return s?hI(B||(B=Od(["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)):Of({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:c});var g=hI(U||(U=Od(["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),p.x,p.y,a,a,+(u<0),m.x,m.y);if(n>0){var{circleTangency:v,lineTangency:b,theta:w}=Oh({cx:t,cy:r,radius:n,angle:l,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),{circleTangency:j,lineTangency:N,theta:k}=Oh({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)-w-k;if(S<0&&0===a)return"".concat(g,"L").concat(t,",").concat(r,"Z");g+=hI(V||(V=Od(["L",",","\n A",",",",0,0,",",",",","\n A",",",",0,",",",",",",","\n A",",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(u<0),j.x,j.y,n,n,+(S>180),+(u>0),v.x,v.y,a,a,+(u<0),b.x,b.y)}else g+=hI(q||(q=Od(["L",",","Z"])),t,r);return g})({cx:n,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):Of({cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d}),H.createElement("path",Ou({},NK(r),{className:f,d:t}))};let Ox=Math.PI,Oy=2*Ox,Og=Oy-1e-6;function Ov(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class Ob{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?Ov:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ov;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,f=n-s,p=o*o+l*l,m=Math.sqrt(p),x=Math.sqrt(d),y=i*Math.tan((Ox-Math.acos((p+d-(h*h+f*f))/(2*m*x)))/2),g=y/x,v=y/m;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*f)},${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%Oy+Oy),d>Og?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>=Ox)},${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 Ow(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 Ob(t)}Ob.prototype;let Oj=Math.cos,ON=Math.sin,Ok=Math.sqrt,OS=Math.PI,OO=2*OS;Ok(3);let OP={draw(e,t){let r=Ok(t/OS);e.moveTo(r,0),e.arc(0,0,r,0,OO)}},OC=Ok(1/3),OE=2*OC,OA=ON(OS/10)/ON(7*OS/10),OM=ON(OO/10)*OA,OT=-Oj(OO/10)*OA,O_=Ok(3);Ok(3);let OD=Ok(3)/2,OI=1/Ok(12),Oz=(OI/2+1)*3;var OL=["type","size","sizeType"];function OR(){return(OR=Object.assign.bind()).apply(null,arguments)}function OF(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 O$(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OF(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)):OF(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var OB={symbolCircle:OP,symbolCross:{draw(e,t){let r=Ok(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=Ok(t/OE),n=r*OC;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},symbolSquare:{draw(e,t){let r=Ok(t),n=-r/2;e.rect(n,n,r,r)}},symbolStar:{draw(e,t){let r=Ok(.8908130915292852*t),n=OM*r,i=OT*r;e.moveTo(0,-r),e.lineTo(n,i);for(let t=1;t<5;++t){let a=OO*t/5,s=Oj(a),o=ON(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=-Ok(t/(3*O_));e.moveTo(0,2*r),e.lineTo(-O_*r,-r),e.lineTo(O_*r,-r),e.closePath()}},symbolWye:{draw(e,t){let r=Ok(t/Oz),n=r/2,i=r*OI,a=r*OI+r,s=-n;e.moveTo(n,i),e.lineTo(n,a),e.lineTo(s,a),e.lineTo(-.5*n-OD*i,OD*n+-.5*i),e.lineTo(-.5*n-OD*a,OD*n+-.5*a),e.lineTo(-.5*s-OD*a,OD*s+-.5*a),e.lineTo(-.5*n+OD*i,-.5*i-OD*n),e.lineTo(-.5*n+OD*a,-.5*a-OD*n),e.lineTo(-.5*s+OD*a,-.5*a-OD*s),e.closePath()}}},OU=Math.PI/180,OV=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=O$(O$({},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,OL)),{},{type:t,size:r,sizeType:n}),a="circle";"string"==typeof t&&(a=t);var{className:s,cx:o,cy:l}=i,c=NK(i);return hF(o)&&hF(l)&&hF(r)?H.createElement("path",OR({},c,{className:sl("recharts-symbols",s),transform:"translate(".concat(o,", ").concat(l,")"),d:(()=>{var e,t=(e=a,OB["symbol".concat(hW(e))]||OP),i=(function(e,t){let r=null,n=Ow(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:pf(e||OP),t="function"==typeof t?t:pf(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:pf(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:pf(+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*OU;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 Oq(e){this._context=e}function OK(e){return new Oq(e)}function OW(e){return e[0]}function OH(e){return e[1]}function OY(e,t){var r=pf(!0),n=null,i=OK,a=null,s=Ow(o);function o(o){var l,c,u,d=(o=ph(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?OW:pf(e),t="function"==typeof t?t:void 0===t?OH:pf(t),o.x=function(t){return arguments.length?(e="function"==typeof t?t:pf(+t),o):e},o.y=function(e){return arguments.length?(t="function"==typeof e?e:pf(+e),o):t},o.defined=function(e){return arguments.length?(r="function"==typeof e?e:pf(!!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 OX(e,t,r){var n=null,i=pf(!0),a=null,s=OK,o=null,l=Ow(c);function c(c){var u,d,h,f,p,m=(c=ph(c)).length,x=!1,y=Array(m),g=Array(m);for(null==a&&(o=s(p=l())),u=0;u<=m;++u){if(!(u<m&&i(f=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(f,u,c),g[u]=+t(f,u,c),o.point(n?+n(f,u,c):y[u],r?+r(f,u,c):g[u]))}if(p)return o=null,p+""||null}function u(){return OY().defined(i).curve(s).context(a)}return e="function"==typeof e?e:void 0===e?OW:pf(+e),t="function"==typeof t?t:void 0===t?pf(0):pf(+t),r="function"==typeof r?r:void 0===r?OH:pf(+r),c.x=function(t){return arguments.length?(e="function"==typeof t?t:pf(+t),n=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:pf(+t),c):e},c.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:pf(+e),c):n},c.y=function(e){return arguments.length?(t="function"==typeof e?e:pf(+e),r=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:pf(+e),c):t},c.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:pf(+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:pf(!!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 OG(){}function OQ(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 OZ(e){this._context=e}function OJ(e){this._context=e}function O0(e){this._context=e}OV.registerSymbol=(e,t)=>{OB["symbol".concat(hW(e))]=t},Oq.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)}}},OZ.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:OQ(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:OQ(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},OJ.prototype={areaStart:OG,areaEnd:OG,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:OQ(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},O0.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:OQ(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class O1{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 O2(e){this._context=e}O2.prototype={areaStart:OG,areaEnd:OG,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 O5(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 O4(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function O3(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 O6(e){this._context=e}function O8(e){this._context=new O7(e)}function O7(e){this._context=e}function O9(e){this._context=e}function Pe(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 Pt(e,t){this._context=e,this._t=t}function Pr(){return(Pr=Object.assign.bind()).apply(null,arguments)}function Pn(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 Pi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pn(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)):Pn(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}O6.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:O3(this,this._t0,O4(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,O3(this,O4(this,r=O5(this,e,t)),r);break;default:O3(this,this._t0,r=O5(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(O8.prototype=Object.create(O6.prototype)).point=function(e,t){O6.prototype.point.call(this,t,e)},O7.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)}},O9.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=Pe(e),i=Pe(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)}},Pt.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 Pa={curveBasisClosed:function(e){return new OJ(e)},curveBasisOpen:function(e){return new O0(e)},curveBasis:function(e){return new OZ(e)},curveBumpX:function(e){return new O1(e,!0)},curveBumpY:function(e){return new O1(e,!1)},curveLinearClosed:function(e){return new O2(e)},curveLinear:OK,curveMonotoneX:function(e){return new O6(e)},curveMonotoneY:function(e){return new O8(e)},curveNatural:function(e){return new O9(e)},curveStep:function(e){return new Pt(e,.5)},curveStepAfter:function(e){return new Pt(e,1)},curveStepBefore:function(e){return new Pt(e,0)}},Ps=e=>pv(e.x)&&pv(e.y),Po=e=>null!=e.base&&Ps(e.base)&&Ps(e),Pl=e=>e.x,Pc=e=>e.y,Pu=e=>{var{className:t,points:r,path:n,pathRef:i}=e,a=pc(mi);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(hW(e));if(("curveMonotone"===r||"curveBump"===r)&&t){var n=Pa["".concat(r).concat("vertical"===t?"Y":"X")];if(n)return n}return Pa[r]||OK})(t,i),o=a?r.filter(Ps):r;if(Array.isArray(n)){var l=r.map((e,t)=>Pi(Pi({},e),{},{base:n[t]}));return("vertical"===i?OX().y(Pc).x1(Pl).x0(e=>e.base.x):OX().x(Pl).y1(Pc).y0(e=>e.base.y)).defined(Po).curve(s)(a?l.filter(Po):l)}return("vertical"===i&&hF(n)?OX().y(Pc).x1(Pl).x0(n):hF(n)?OX().x(Pl).y1(Pc).y0(n):OY().x(Pl).y(Pc)).defined(Ps).curve(s)(o)})(s):n;return H.createElement("path",Pr({},NV(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=>{NF(e)&&(n[e]=t||(t=>r[e](r,t)))}),n})(e),{className:sl("recharts-curve",t),d:null===o?void 0:o,ref:i}))},Pd=["option","shapeType","activeClassName"];function Ph(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?Ph(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)):Ph(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Pp(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return H.createElement(Or,r);case"trapezoid":return H.createElement(Oc,r);case"sector":return H.createElement(Om,r);case"symbols":if("symbols"===t)return H.createElement(OV,r);break;case"curve":return H.createElement(Pu,r);default:return null}}function Pm(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,Pd);if((0,H.isValidElement)(r))t=(0,H.cloneElement)(r,Pf(Pf({},a),(0,H.isValidElement)(r)?r.props:r));else if("function"==typeof r)t=r(a,a.index);else if((0,SD.default)(r)&&"boolean"!=typeof r){var s=Pf(Pf({},a),r);t=H.createElement(Pp,{shapeType:n,elementProps:s})}else t=H.createElement(Pp,{shapeType:n,elementProps:a});return a.isActive?H.createElement(kE,{className:i},t):t}function Px(){return(Px=Object.assign.bind()).apply(null,arguments)}function Py(e){return H.createElement(Pm,Px({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var Pg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(r,n)=>{if(hF(e))return e;var i=hF(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)}},Pv=(e,t,r)=>{var n=pa();return(i,a)=>s=>{null==e||e(i,a,s),n(fW({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},Pb=e=>{var t=pa();return(r,n)=>i=>{null==e||e(r,n,i),t(fH())}},Pw=(e,t,r)=>{var n=pa();return(i,a)=>s=>{null==e||e(i,a,s),n(fX({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}};function Pj(e){var{tooltipEntrySettings:t}=e,r=pa(),n=pq(),i=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{n||(null===i.current?r(fU(t)):i.current!==t&&r(fV({prev:i.current,next:t})),i.current=t)},[t,r,n]),(0,H.useLayoutEffect)(()=>()=>{i.current&&(r(fq(i.current)),i.current=null)},[r]),null}var PN=["children"],Pk=(0,H.createContext)({data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function PS(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,PN);return H.createElement(Pk.Provider,{value:r},t)}function PO(e,t){var r,n,i=pc(t=>vw(t,e)),a=pc(e=>vk(e,t)),s=null!=(r=null==i?void 0:i.allowDataOverflow)?r:vv.allowDataOverflow,o=null!=(n=null==a?void 0:a.allowDataOverflow)?n:vj.allowDataOverflow;return{needClip:s||o,needClipX:s,needClipY:o}}function PP(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=pc(kp),{needClipX:a,needClipY:s,needClip:o}=PO(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 PC=(e,t,r)=>{var n=null!=r?r:e;if(null!=n)return hV(n,t,0)};function PE(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 PA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?PE(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)):PE(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function PM(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 PT(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 P_=d$([vM,(e,t)=>t],(e,t)=>e.filter(e=>"bar"===e.type).find(e=>e.id===t)),PD=d$([P_],e=>null==e?void 0:e.maxBarSize),PI=d$([mi,vM,PM,PT,(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)),Pz=d$([PI,e=>e.rootProps.barSize,(e,t)=>{var r=mi(e),n=PM(e,t),i=PT(e,t);if(null!=n&&null!=i)return"horizontal"===r?bY(e,"xAxis",n):bY(e,"yAxis",i)}],(e,t,r)=>{var n=e.filter(vc),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:PC(t,r,null==(n=a[0])?void 0:n.barSize)}}),...i.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>null!=e),barSize:PC(t,r,e.barSize)}))]}),PL=(e,t,r)=>{var n,i,a=mi(e),s=PM(e,t),o=PT(e,t);if(null!=s&&null!=o)return"horizontal"===a?(n=b1(e,"xAxis",s,r),i=b0(e,"xAxis",s,r)):(n=b1(e,"yAxis",o,r),i=b0(e,"yAxis",o,r)),pE(n,i)},PR=d$([Pz,gF,e=>e.rootProps.barGap,g$,(e,t,r)=>{var n,i,a,s,o=P_(e,t);if(null==o)return 0;var l=PM(e,t),c=PT(e,t);if(null==l||null==c)return 0;var u=mi(e),d=gF(e),{maxBarSize:h}=o;return"horizontal"===u?(a=b1(e,"xAxis",l,r),s=b0(e,"xAxis",l,r)):(a=b1(e,"yAxis",c,r),s=b0(e,"yAxis",c,r)),null!=(n=null!=(i=pE(a,s,!0))?i:null==h?d:h)?n:0},PL,PD],(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=hV(e,r,0,!0),c=[];if(pv(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 f={offset:((r-h)/2|0)-l,size:0};s=n.reduce((e,t)=>{var r,n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+l,size:u?d:null!=(r=t.barSize)?r:0}},i=[...e,n];return f=n.position,i},c)}else{var p=hV(t,r,0,!0);r-2*p-(o-1)*l<=0&&(l=0);var m=(r-2*p-(o-1)*l)/o;m>1&&(m>>=0);var x=pv(i)?Math.min(m,i):m;s=n.reduce((e,t,r)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+l)*r+(m-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=>PA(PA({},e),{},{position:PA(PA({},e.position),{},{offset:e.position.offset-i/2})}))),o}),PF=d$([PR,P_],(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}}),P$=d$([(e,t,r)=>{var n=mi(e),i=PM(e,t),a=PT(e,t);if(null!=i&&null!=a)return"horizontal"===n?vZ(e,"yAxis",a,r):vZ(e,"xAxis",i,r)},P_],(e,t)=>{var r=vo(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)}}}),PB=d$([p$,pU,(e,t,r)=>{var n=PM(e,t);if(null!=n)return b1(e,"xAxis",n,r)},(e,t,r)=>{var n=PT(e,t);if(null!=n)return b1(e,"yAxis",n,r)},(e,t,r)=>{var n=PM(e,t);if(null!=n)return b0(e,"xAxis",n,r)},(e,t,r)=>{var n=PT(e,t);if(null!=n)return b0(e,"yAxis",n,r)},PF,mi,(e,t,r)=>r?gO(e):gS(e),PL,P$,P_,(e,t,r,n)=>n],(e,t,r,n,i,a,s,o,l,c,u,d,h)=>{var f,{chartData:p,dataStartIndex:m,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!=(f=null!=y&&y.length>0?y:null==p?void 0:p.slice(m,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:f,parentViewBox:p,dataStartIndex:m}=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+m];if(null==x)return null;w=((e,t)=>{if(!t||2!==t.length||!hF(t[0])||!hF(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(!hF(e[0])||e[0]<r)&&(i[0]=r),(!hF(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(w=pN(e,r))||(w=[g,w]);var b=Pg(n,0)(w[1],d);if("horizontal"===t){var w,j,N,k,S,O,P,C=o.scale.map(w[0]),E=o.scale.map(w[1]);if(null==C||null==E)return null;j=pO({axis:s,ticks:l,bandSize:a,offset:i.offset,entry:e,index:d}),N=null!=(P=null!=E?E:C)?P:void 0,k=i.size;var A=C-E;if(S=hL(A)?0:A,O={x:j,y:h.top,width:k,height:h.height},Math.abs(b)>0&&Math.abs(S)<Math.abs(b)){var M=hz(S||b)*(Math.abs(b)-Math.abs(S));N-=M,S+=M}}else{var T=s.scale.map(w[0]),_=s.scale.map(w[1]);if(null==T||null==_)return null;if(j=T,N=pO({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=hz(k||b)*(Math.abs(b)-Math.abs(k));k+=D}}return null==j||null==N||null==k||null==S?null:P9(P9({},e),{},{stackedBarStart:v,x:j,y:N,width:k,height:S,value:u?w:w[1],payload:e,background:O,tooltipPosition:{x:j+k/2,y:N+S/2},parentViewBox:p},f&&f[d]&&f[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:f,offset:e,cells:h,dataStartIndex:m})}});function PU(e){var{legendPayload:t}=e,r=pa(),n=pq(),i=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{n||(null===i.current?r(jQ(t)):i.current!==t&&r(jZ({prev:i.current,next:t})),i.current=t)},[r,n,t]),(0,H.useLayoutEffect)(()=>()=>{i.current&&(r(jJ(i.current)),i.current=null)},[r]),null}var PV=null!=(K=H["useId".toString()])?K:()=>{var[e]=H.useState(()=>hU("uid-"));return e},Pq=(0,H.createContext)(void 0),PK=e=>{var t,r,n,{id:i,type:a,children:s}=e,o=(t="recharts-".concat(a),r=i,n=PV(),r||(t?"".concat(t,"-").concat(n):n));return H.createElement(Pq.Provider,{value:o},s(o))},PW=(0,H.memo)(e=>{var t=pa(),r=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{null===r.current?t(jA(e)):r.current!==e&&t(jM({prev:r.current,next:e})),r.current=e},[t,e]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(jT(r.current)),r.current=null)},[t]),null}),PH=(e,t)=>t,PY=(e,t,r)=>r,PX=d$([PH,vM,PY],(e,t,r)=>t.filter(e=>"bar"===e.type).filter(t=>t.stackId===e).filter(e=>e.isPanorama===r).filter(e=>!e.hide)),PG=d$([PX],e=>e.map(e=>e.id)),PQ=d$([e=>e,PH,PY],(e,t,r)=>{var n=PG(e,t,r),i=[];return n.forEach(t=>{var n=PB(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}),PZ=["index"];function PJ(){return(PJ=Object.assign.bind()).apply(null,arguments)}var P0=(0,H.createContext)(void 0),P1=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),P2=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,PZ),n=(e=>{var t=(0,H.useContext)(P0);if(null!=t){var{stackId:r}=t;return"url(#".concat(P1(r,e),")")}})(t);return H.createElement(kE,PJ({className:"recharts-bar-stack-layer",clipPath:n},r))},P5=["onMouseEnter","onMouseLeave","onClick"],P4=["value","background","tooltipPosition"],P3=["id"],P6=["onMouseEnter","onClick","onMouseLeave"];function P8(){return(P8=Object.assign.bind()).apply(null,arguments)}function P7(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 P9(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P7(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)):P7(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ce(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 Ct=kO.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:hY,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:pM(a,t),hide:s,type:l,color:i,unit:o,graphicalItemId:c}};return kO.createElement(Pj,{tooltipEntrySettings:u})});function Cr(e){var t,r=pc(wY),{data:n,dataKey:i,background:a,allOtherBarProps:s}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=s,u=Ce(s,P5),d=Pv(o,i,s.id),h=Pb(l),f=Pw(c,i,s.id);if(!a||null==n)return null;var p=Nq(a);return kO.createElement(k9,{zIndex:(t=gQ.barBackground,a&&"object"==typeof a&&"zIndex"in a&&"number"==typeof a.zIndex&&pv(a.zIndex)?a.zIndex:t)},n.map((e,t)=>{var{value:n,background:s,tooltipPosition:o}=e,l=Ce(e,P4);if(!s)return null;var c=d(e,t),m=h(e,t),x=f(e,t),y=P9(P9(P9(P9(P9({option:a,isActive:String(t)===r},l),{},{fill:"#eee"},s),p),S_(u,e,t)),{},{onMouseEnter:c,onMouseLeave:m,onClick:x,dataKey:i,index:t,className:"recharts-bar-background-rectangle"});return kO.createElement(Py,P8({key:"background-bar-".concat(t)},y))}))}function Cn(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 P9(P9({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return kO.createElement(SN,{value:t?i:void 0},r)}function Ci(e){var{shape:t,activeBar:r,baseProps:n,entry:i,index:a,dataKey:s}=e,o=pc(wY),l=pc(wG),c=r&&String(a)===o&&(null==l||s===l),u=c?r:t;return c?kO.createElement(k9,{zIndex:gQ.activeBar},kO.createElement(P2,{index:a},kO.createElement(Py,P8({},n,{name:String(n.name)},i,{isActive:c,option:u,index:a,dataKey:s})))):kO.createElement(Py,P8({},n,{name:String(n.name)},i,{isActive:c,option:u,index:a,dataKey:s}))}function Ca(e){var{shape:t,baseProps:r,entry:n,index:i,dataKey:a}=e;return kO.createElement(Py,P8({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a}))}function Cs(e){var t,{data:r,props:n}=e,i=null!=(t=NV(n))?t:{},{id:a}=i,s=Ce(i,P3),{shape:o,dataKey:l,activeBar:c}=n,{onMouseEnter:u,onClick:d,onMouseLeave:h}=n,f=Ce(n,P6),p=Pv(u,l,a),m=Pb(h),x=Pw(d,l,a);return r?kO.createElement(kO.Fragment,null,r.map((e,t)=>kO.createElement(P2,P8({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"},S_(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:x(e,t)}),c?kO.createElement(Ci,{shape:o,activeBar:c,baseProps:s,entry:e,index:t,dataKey:l}):kO.createElement(Ca,{shape:o,baseProps:s,entry:e,index:t,dataKey:l})))):null}function Co(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=S2(t,"recharts-bar-"),[f,p]=(0,kO.useState)(!1),m=(0,kO.useCallback)(()=>{"function"==typeof c&&c(),p(!1)},[c]),x=(0,kO.useCallback)(()=>{"function"==typeof u&&u(),p(!0)},[u]);return kO.createElement(Cn,{showLabels:!f,rects:n},kO.createElement(S1,{animationId:h,begin:s,duration:o,isActive:a,easing:l,onAnimationEnd:m,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 P9(P9({},t),{},{x:hK(n.x,t.x,e),y:hK(n.y,t.y,e),width:hK(n.width,t.width,e),height:hK(n.height,t.height,e)});if("horizontal"===i){var a=hK(0,t.height,e),s=hK(t.stackedBarStart,t.y,e);return P9(P9({},t),{},{y:s,height:a})}var o=hK(0,t.width,e),l=hK(t.stackedBarStart,t.x,e);return P9(P9({},t),{},{width:o,x:l})});return(e>0&&(r.current=null!=a?a:null),null==a)?null:kO.createElement(kE,null,kO.createElement(Cs,{props:t,data:a}))}),kO.createElement(SO,{label:t.label}),t.children)}function Cl(e){var t=(0,kO.useRef)(null);return kO.createElement(Co,{previousRectanglesRef:t,props:e})}var Cc=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:pN(e,t)}};class Cu extends kO.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=sl("recharts-bar",n);return kO.createElement(kE,{className:c,id:l},s&&kO.createElement("defs",null,kO.createElement(PP,{clipPathId:l,xAxisId:i,yAxisId:a})),kO.createElement(kE,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(l,")"):void 0},kO.createElement(Cr,{data:t,dataKey:r,background:o,allOtherBarProps:this.props}),kO.createElement(Cl,this.props)))}}var Cd={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:gQ.bar};function Ch(e){var t,r,n,i,{xAxisId:a,yAxisId:s,hide:o,legendType:l,minPointSize:c,activeBar:u,animationBegin:d,animationDuration:h,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=PO(a,s),x=pc(mi),y=pq(),g=(t=e.children,r=[],n=[],n=Array.isArray(kA)?kA.map(e=>SC(e)):[SC(kA)],SM(t).forEach(e=>{var t=(0,h_.default)(e,"type.displayName")||(0,h_.default)(e,"type.name");t&&-1!==n.indexOf(t)&&r.push(e)}),r),v=pc(t=>PB(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,kO.createElement(PS,{xAxisId:a,yAxisId:s,data:v,dataPointFormatter:Cc,errorBarOffset:i},kO.createElement(Cu,P8({},e,{layout:x,needClip:m,data:v,xAxisId:a,yAxisId:s,hide:o,legendType:l,minPointSize:c,activeBar:u,animationBegin:d,animationDuration:h,animationEasing:f,isAnimationActive:p})))}var Cf=kO.memo(function(e){var t,r,n,i=kb(e,Cd),a=(r=i.stackId,null!=(n=(0,H.useContext)(P0))?n.stackId:null!=r?null==(t=r)?void 0:String(t):void 0),s=pq();return kO.createElement(PK,{id:i.id,type:"bar"},e=>kO.createElement(kO.Fragment,null,kO.createElement(PU,{legendPayload:(e=>{var{dataKey:t,name:r,fill:n,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:n,value:pM(r,t),payload:e}]})(i)}),kO.createElement(Ct,{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}),kO.createElement(PW,{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}),kO.createElement(k9,{zIndex:i.zIndex},kO.createElement(Ch,P8({},i,{id:e})))))},ND);Cf.displayName="Bar";var Cp=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 Cm(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 Cx(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 Cy(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 Cg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cy(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)):Cy(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Cv=["axisLine","width","height","className","hide","ticks","axisType"];function Cb(){return(Cb=Object.assign.bind()).apply(null,arguments)}function Cw(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 Cj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cw(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)):Cw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var CN={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:gQ.axis};function Ck(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=Cj(Cj(Cj({},l),NV(o)),{},{fill:"none"});if("top"===a||"bottom"===a){var u=+("top"===a&&!s||"bottom"===a&&s);c=Cj(Cj({},c),{},{x1:t,y1:r+u*i,x2:t+n,y2:r+u*i})}else{var d=+("left"===a&&!s||"right"===a&&s);c=Cj(Cj({},c),{},{x1:t+d*n,y1:r,x2:t+d*n,y2:r+i})}return H.createElement("line",Cb({},c,{className:sl("recharts-cartesian-axis-line",(0,h_.default)(o,"className"))}))}function CS(e){var t,{option:r,tickProps:n,value:i}=e,a=sl(n.className,"recharts-cartesian-axis-tick-value");if(H.isValidElement(r))t=H.cloneElement(r,Cj(Cj({},n),{},{className:a}));else if("function"==typeof r)t=r(Cj(Cj({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";"boolean"!=typeof r&&(s=sl(s,r&&"object"==typeof r&&"className"in r&&"string"==typeof r.className?r.className:"")),t=H.createElement(k8,Cb({},n,{className:s}),i)}return t}var CO=(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:f,width:p,height:m,tickSize:x,tickMargin:y,fontSize:g,letterSpacing:v,getTicksConfig:b,events:w,axisType:j}=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(hF(c)||Nv.isSsr)return null!=(n=Cm(a,(hF(c)?c:0)+1))?n:[];var f="top"===l||"bottom"===l?"width":"height",p=d&&"width"===f?kR(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=(e,n)=>{var i,a="function"==typeof u?u(e.value,n):e.value;return"width"===f?(i=kR(a,{fontSize:t,letterSpacing:r}),Cp({width:i.width+p.width,height:i.height+p.height},h)):kR(a,{fontSize:t,letterSpacing:r})[f]},x=a[0],y=a[1],g=a.length>=2&&null!=x&&null!=y?hz(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,f);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:Cm(n,u)};var s=c,h=()=>(void 0===t&&(t=r(a,s)),t),f=a.coordinate,p=0===c||Cx(e,f,h,d,l);p||(c=0,d=o,u+=1),p&&(d=f+e*(h()/2+i),c+=u)}())return a.v;return[]}(g,v,m,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,f=u;f<a&&(0===(c=function(){var t,a=n[f];if(null==a)return 0;var s=f,l=()=>(void 0===t&&(t=r(a,s)),t),c=a.coordinate,p=f===u||Cx(e,c,l,d,o);if(!p)return h=!1,1;p&&(d=c+e*(l()/2+i))}())||1!==c);f+=l);if(h){for(var p=[],m=u;m<a;m+=l){var x=n[m];null!=x&&p.push(x)}return p}}return[]}(g,v,m,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=Cg(Cg({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate}),null!=u.tickCoord&&Cx(e,u.tickCoord,()=>d,l,c)&&(c=u.tickCoord-e*(d/2+i),s[o-1]=Cg(Cg({},u),{},{isShow:!0}))}}for(var f=a?o-1:o,p=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=Cg(Cg({},o),{},{tickCoord:d<0?o.coordinate-d*e:o.coordinate})}else s[t]=o=Cg(Cg({},o),{},{tickCoord:o.coordinate});null!=o.tickCoord&&Cx(e,o.tickCoord,u,l,c)&&(l=o.tickCoord+e*(u()/2+i),s[t]=Cg(Cg({},o),{},{isShow:!0}))},m=0;m<f;m++)if(p(m))continue;return s}(g,v,m,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=Cg(Cg({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate})}else a[t]=u=Cg(Cg({},u),{},{tickCoord:u.coordinate});null!=u.tickCoord&&Cx(e,u.tickCoord,d,o,l)&&(l=u.tickCoord-e*(d()/2+i),a[t]=Cg(Cg({},u),{},{isShow:!0}))},u=s-1;u>=0;u--)if(c(u))continue;return a}(g,v,m,a,o)).filter(e=>e.isShow)}(Cj(Cj({},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=NV(b),P=Nq(n),C={};"object"==typeof i&&(C=i);var E=Cj(Cj({},O),{},{fill:"none"},C),A=N.map(e=>Cj({entry:e},function(e,t,r,n,i,a,s,o,l){var c,u,d,h,f,p,m=o?-1:1,x=e.tickSize||s,y=hF(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":c=u=e.coordinate,p=(d=(h=r+!o*i)-m*x)-m*l,f=y;break;case"left":d=h=e.coordinate,f=(c=(u=t+!o*n)-m*x)-m*l,p=y;break;case"right":d=h=e.coordinate,f=(c=(u=t+o*n)+m*x)+m*l,p=y;break;default:c=u=e.coordinate,p=(d=(h=r+o*i)+m*x)+m*l,f=y}return{line:{x1:c,y1:d,x2:u,y2:h},tick:{x:f,y:p}}}(e,h,f,p,m,u,x,d,y))),M=A.map(e=>{var{entry:t,line:r}=e;return H.createElement(kE,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(t.value,"-").concat(t.coordinate,"-").concat(t.tickCoord)},i&&H.createElement("line",Cb({},E,r,{className:sl("recharts-cartesian-axis-tick-line",(0,h_.default)(i,"className"))})))}),T=A.map((e,t)=>{var r,i,{entry:u,tick:d}=e,h=Cj(Cj(Cj(Cj({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}),f=Cj(Cj({},h),P);return H.createElement(kE,Cb({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(u.value,"-").concat(u.coordinate,"-").concat(u.tickCoord)},S_(w,u,t)),n&&H.createElement(CS,{option:n,tickProps:f,value:"".concat("function"==typeof s?s(u.value,t):u.value).concat(o||"")}))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(j,"-ticks")},T.length>0&&H.createElement(k9,{zIndex:gQ.label},H.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(j,"-tick-labels"),ref:t},T)),M.length>0&&H.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(j,"-tick-lines")},M))}),CP=(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,Cv),[u,d]=(0,H.useState)(""),[h,f]=(0,H.useState)(""),p=(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:p.current,label:null==(t=e.labelRef)?void 0:t.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var m=(0,H.useCallback)(e=>{if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value");p.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),f(a))}}},[u,h]);return s||null!=n&&n<=0||null!=i&&i<=0?null:H.createElement(k9,{zIndex:e.zIndex},H.createElement(kE,{className:sl("recharts-cartesian-axis",a)},H.createElement(Ck,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:NV(e)}),H.createElement(CO,{ref:m,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(Sc,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},H.createElement(Sx,{label:e.label,labelRef:e.labelRef}),e.children)))}),CC=H.forwardRef((e,t)=>{var r=kb(e,CN);return H.createElement(CP,Cb({},r,{ref:t}))});CC.displayName="CartesianAxis";var CE=["domain","range"],CA=["domain","range"];function CM(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 CT(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 C_(e,t){if(e===t)return!0;var{domain:r,range:n}=e,i=CM(e,CE),{domain:a,range:s}=t,o=CM(t,CA);return!!CT(r,a)&&!!CT(n,s)&&ND(i,o)}var CD=["type"],CI=["dangerouslySetInnerHTML","ticks","scale"],Cz=["id","scale"];function CL(){return(CL=Object.assign.bind()).apply(null,arguments)}function CR(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 CF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?CR(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)):CR(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function C$(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 CB(e){var t=pa(),r=(0,H.useRef)(null),n=ma(),{type:i}=e,a=C$(e,CD),s=g1(n,"xAxis",i),o=(0,H.useMemo)(()=>{if(null!=s)return CF(CF({},a),{},{type:s})},[a,s]);return(0,H.useLayoutEffect)(()=>{null!=o&&(null===r.current?t(jg(o)):r.current!==o&&t(jv({prev:r.current,next:o})),r.current=o)},[o,t]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(jb(r.current)),r.current=null)},[t]),null}var CU=e=>{var{xAxisId:t,className:r}=e,n=pc(pU),i=pq(),a="xAxis",s=pc(e=>bJ(e,a,t,i)),o=pc(e=>bU(e,t)),l=pc(e=>bK(e,t)),c=pc(e=>vb(e,t));if(null==o||null==l||null==c)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:h}=e,f=C$(e,CI),{id:p,scale:m}=c,x=C$(c,Cz);return H.createElement(CC,CL({},f,x,{x:l.x,y:l.y,width:o.width,height:o.height,className:sl("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:s,axisType:a}))},CV={allowDataOverflow:vv.allowDataOverflow,allowDecimals:vv.allowDecimals,allowDuplicatedCategory:vv.allowDuplicatedCategory,angle:vv.angle,axisLine:CN.axisLine,height:vv.height,hide:!1,includeHidden:vv.includeHidden,interval:vv.interval,label:!1,minTickGap:vv.minTickGap,mirror:vv.mirror,orientation:vv.orientation,padding:vv.padding,reversed:vv.reversed,scale:vv.scale,tick:vv.tick,tickCount:vv.tickCount,tickLine:CN.tickLine,tickSize:CN.tickSize,type:vv.type,xAxisId:0},Cq=H.memo(e=>{var t=kb(e,CV);return H.createElement(H.Fragment,null,H.createElement(CB,{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(CU,t))},C_);Cq.displayName="XAxis";var CK=["type"],CW=["dangerouslySetInnerHTML","ticks","scale"],CH=["id","scale"];function CY(){return(CY=Object.assign.bind()).apply(null,arguments)}function CX(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 CG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?CX(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)):CX(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function CQ(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 CZ(e){var t=pa(),r=(0,H.useRef)(null),n=ma(),{type:i}=e,a=CQ(e,CK),s=g1(n,"yAxis",i),o=(0,H.useMemo)(()=>{if(null!=s)return CG(CG({},a),{},{type:s})},[s,a]);return(0,H.useLayoutEffect)(()=>{null!=o&&(null===r.current?t(jw(o)):r.current!==o&&t(jj({prev:r.current,next:o})),r.current=o)},[o,t]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(jN(r.current)),r.current=null)},[t]),null}function CJ(e){var{yAxisId:t,className:r,width:n,label:i}=e,a=(0,H.useRef)(null),s=(0,H.useRef)(null),o=pc(pU),l=pq(),c=pa(),u="yAxis",d=pc(e=>bH(e,t)),h=pc(e=>bW(e,t)),f=pc(e=>bJ(e,u,t,l)),p=pc(e=>vN(e,t));if((0,H.useLayoutEffect)(()=>{if(!("auto"!==n||!d||Sh(i)||(0,H.isValidElement)(i))&&null!=p){var e=a.current;if(e){var r=e.getCalculatedWidth();Math.round(d.width)!==Math.round(r)&&c(jP({id:t,width:r}))}}},[f,d,c,i,t,n,p]),null==d||null==h||null==p)return null;var{dangerouslySetInnerHTML:m,ticks:x,scale:y}=e,g=CQ(e,CW),{id:v,scale:b}=p,w=CQ(p,CH);return H.createElement(CC,CY({},g,w,{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:sl("recharts-".concat(u," ").concat(u),r),viewBox:o,ticks:f,axisType:u}))}var C0={allowDataOverflow:vj.allowDataOverflow,allowDecimals:vj.allowDecimals,allowDuplicatedCategory:vj.allowDuplicatedCategory,angle:vj.angle,axisLine:CN.axisLine,hide:!1,includeHidden:vj.includeHidden,interval:vj.interval,label:!1,minTickGap:vj.minTickGap,mirror:vj.mirror,orientation:vj.orientation,padding:vj.padding,reversed:vj.reversed,scale:vj.scale,tick:vj.tick,tickCount:vj.tickCount,tickLine:CN.tickLine,tickSize:CN.tickSize,type:vj.type,width:vj.width,yAxisId:0},C1=H.memo(e=>{var t=kb(e,C0);return H.createElement(H.Fragment,null,H.createElement(CZ,{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(CJ,t))},C_);function C2(){return(C2=Object.assign.bind()).apply(null,arguments)}function C5(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 C4(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C5(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)):C5(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function C3(e){return Array.isArray(e)&&h$(e[0])&&h$(e[1])?e.join(" ~ "):e}C1.displayName="YAxis";var C6={margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},C8={display:"block",paddingTop:4,paddingBottom:4,color:"#000"},C7={},C9=e=>{var{separator:t=" : ",contentStyle:r,itemStyle:n,labelStyle:i=C7,payload:a,formatter:s,itemSorter:o,wrapperClassName:l,labelClassName:c,label:u,labelFormatter:d,accessibilityLayer:h=!1}=e,f=C4(C4({},C6),r),p=C4({margin:0},i),m=null!=u,x=m?u:"",y=sl("recharts-default-tooltip",l),g=sl("recharts-tooltip-label",c);return m&&d&&null!=a&&(x=d(u,a)),H.createElement("div",C2({className:y,style:f},h?{role:"status","aria-live":"assertive"}:{}),H.createElement("p",{className:g,style:p},H.isValidElement(x)?x:"".concat(x)),(()=>{if(a&&a.length){var e=(o?(0,pu.default)(a,o):a).map((e,r)=>{if("none"===e.type)return null;var i=e.formatter||s||C3,{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=C4(C4({},C8),{},{color:e.color||C8.color},n);return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(r),style:h},h$(u)?H.createElement("span",{className:"recharts-tooltip-item-name"},u):null,h$(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})())},Ee=H,Et="recharts-tooltip-wrapper",Er={visibility:"hidden"};function En(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:i,position:a,reverseDirection:s,tooltipDimension:o,viewBox:l,viewBoxDimension:c}=e;if(a&&hF(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 Ei(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 Ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ei(Object(r),!0).forEach(function(t){Es(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ei(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Es(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 Eo extends Ee.PureComponent{constructor(){super(...arguments),Es(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Es(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:f,lastBoundingBox:p,innerRef:m,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=En({allowEscapeViewBox:i,coordinate:a,key:"x",offset:o,position:l,reverseDirection:c,tooltipDimension:u.width,viewBox:h,viewBoxDimension:h.width}),translateY:n=En({allowEscapeViewBox:i,coordinate:a,key:"y",offset:s,position:l,reverseDirection:c,tooltipDimension:u.height,viewBox:h,viewBoxDimension:h.height}),useTranslate3d:d}):Er,cssClasses:function(e){var{coordinate:t,translateX:r,translateY:n}=e;return sl(Et,{["".concat(Et,"-right")]:hF(r)&&t&&hF(t.x)&&r>=t.x,["".concat(Et,"-left")]:hF(r)&&t&&hF(t.x)&&r<t.x,["".concat(Et,"-bottom")]:hF(n)&&t&&hF(t.y)&&n>=t.y,["".concat(Et,"-top")]:hF(n)&&t&&hF(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:p.height,width:p.width},useTranslate3d:d,viewBox:h}),v=x?{}:Ea(Ea({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=Ea(Ea({},v),{},{visibility:!this.state.dismissed&&e&&s?"visible":"hidden"},f);return Ee.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:y,style:b,ref:m},i)}}var El=e.i(40559),Ec=["x","y","top","left","width","height","className"];function Eu(){return(Eu=Object.assign.bind()).apply(null,arguments)}function Ed(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 Eh=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?Ed(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)):Ed(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,Ec));return hF(t)&&hF(r)&&hF(a)&&hF(s)&&hF(n)&&hF(i)?H.createElement("path",Eu({},NK(l),{className:sl("recharts-cross",o),d:"M".concat(t,",").concat(n,"v").concat(s,"M").concat(i,",").concat(r,"h").concat(a)})):null};function Ef(e){var{cx:t,cy:r,radius:n,startAngle:i,endAngle:a}=e;return{points:[gG(t,r,n,i),gG(t,r,n,a)],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}function Ep(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 Em(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ep(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)):Ep(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ex(){return(Ex=Object.assign.bind()).apply(null,arguments)}function Ey(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 Eg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ey(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)):Ey(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ev(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 Eb(e){var t,r,n,i,a,{coordinate:s,payload:o,index:l,offset:c,tooltipAxisBandSize:u,layout:d,cursor:h,tooltipEventType:f,chartName:p}=e;if(!h||!s||"ScatterChart"!==p&&"axis"!==f)return null;if("ScatterChart"===p)n=s,i=Eh,a=gQ.cursorLine;else if("BarChart"===p)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=Or,a=gQ.cursorRectangle;else if("radial"===d&&ST(s)){var{cx:m,cy:x,radius:y,startAngle:g,endAngle:v}=Ef(s);n={cx:m,cy:x,startAngle:g,endAngle:v,innerRadius:y,outerRadius:y},i=Om,a=gQ.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(ST(t)){if("centric"===e){var{cx:n,cy:i,innerRadius:a,outerRadius:s,angle:o}=t,l=gG(n,i,a,o),c=gG(n,i,s,o);return[{x:l.x,y:l.y},{x:c.x,y:c.y}]}return Ef(t)}}(d,s,c)},i=Pu,a=gQ.cursorLine;var b="object"==typeof h&&"className"in h?h.className:void 0,w=Eg(Eg(Eg(Eg({stroke:"#ccc",pointerEvents:"none"},c),n),Nq(h)),{},{payload:o,payloadIndex:l,className:sl("recharts-tooltip-cursor",b)});return H.createElement(k9,{zIndex:null!=(r=e.zIndex)?r:a},H.createElement(Ev,{cursor:h,cursorComp:i,cursorProps:w}))}function Ew(e){var t,r,n,i,a=(t=pc(vY),r=pc(wV),n=pc(w$),t&&n?pE(Em(Em({},t),{},{scale:n}),r):pE(void 0,r)),s=null!=(i=pc(p$))?i:mn,o=pc(mi),l=pc(gV);return null==a||null==s||null==o||null==l?null:H.createElement(Eb,Ex({},e,{offset:s,layout:o,tooltipAxisBandSize:a,chartName:l}))}function Ej(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 EN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ej(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)):Ej(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ek(e){return e.dataKey}var ES=[],EO={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 EP(e){var t,r,n,i,a,s,o,l,c,u,d,h=kb(e,EO),{active:f,allowEscapeViewBox:p,animationDuration:m,animationEasing:x,content:y,filterNull:g,isAnimationActive:v,offset:b,payloadUniqBy:w,position:j,reverseDirection:N,useTranslate3d:k,wrapperStyle:S,cursor:O,shared:P,trigger:C,defaultIndex:E,portal:A,axisId:M}=h,T=pa(),_="number"==typeof E?String(E):E;(0,H.useEffect)(()=>{T(fK({shared:P,trigger:C,axisId:M,active:f,defaultIndex:_}))},[T,P,C,M,f,_]);var D=mr(),I=NL(),z=pc(e=>b8(e,P)),{activeIndex:L,isActive:R}=null!=(u=pc(e=>js(e,z,C,_)))?u:{},F=pc(e=>ja(e,z,C,_)),$=pc(e=>ji(e,z,C,_)),B=pc(e=>jn(e,z,C,_)),U=(0,H.useContext)(kr),V=null!=(d=null!=f?f:R)&&d,[q,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,V]),W="axis"===z?$:void 0;t=pc(e=>((e,t,r)=>{if(null!=t){var n=ws(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,z,C)),r=pc(gW),n=pc(gq),i=pc(gK),s=null==(a=pc(N7))?void 0:a.active,o=mr(),(0,H.useEffect)(()=>{if(!s&&null!=n&&null!=r){var e=fZ({active:V,coordinate:B,dataKey:t,index:L,label:"number"==typeof W?String(W):W,sourceViewBox:o,graphicalItemId:void 0});N3.emit(N6,n,e,r)}},[s,B,t,L,W,r,n,i,V,o]);var Y=null!=A?A:U;if(null==Y||null==D||null==z)return null;var X=null!=F?F:ES;V||(X=ES),g&&X.length&&(l=X.filter(e=>null!=e.value&&(!0!==e.hide||h.includeHidden)),X=!0===w?(0,El.default)(l,Ek):"function"==typeof w?(0,El.default)(l,w):l);var G=X.length>0,Q=H.createElement(Eo,{allowEscapeViewBox:p,animationDuration:m,animationEasing:x,isAnimationActive:v,active:V,coordinate:B,hasPayload:G,offset:b,position:j,reverseDirection:N,useTranslate3d:k,viewBox:D,wrapperStyle:S,lastBoundingBox:q,innerRef:K,hasPortalFromProps:!!A},(c=EN(EN({},h),{},{payload:X,label:W,active:V,activeIndex:L,coordinate:B,accessibilityLayer:I}),H.isValidElement(y)?H.cloneElement(y,c):"function"==typeof y?H.createElement(y,c):H.createElement(C9,c)));return H.createElement(H.Fragment,null,(0,k7.createPortal)(Q,Y),V&&H.createElement(Ew,{cursor:O,tooltipEventType:z,coordinate:B,payload:X,index:L}))}function EC({stats:e,onNavigate:t}){let r=(0,H.useMemo)(()=>Object.entries(e.byCategory).map(([e,t])=>({category:e,count:t,color:(0,ow.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)(me,{width:"100%",height:36*r.length+20,children:(0,W.jsxs)(kS,{data:r,layout:"vertical",margin:{left:10,right:30},children:[(0,W.jsx)(Cq,{type:"number",hide:!0}),(0,W.jsx)(C1,{type:"category",dataKey:"category",width:100,tick:{fill:"#94a3b8",fontSize:12},axisLine:!1,tickLine:!1}),(0,W.jsx)(EP,{contentStyle:{background:"#1e293b",border:"1px solid #334155",borderRadius:8},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"}}),(0,W.jsx)(Cf,{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)(kA,{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 EE=(0,oN.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)(o6,{size:14,className:"text-slate-400"}):(0,W.jsx)(cP.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 EM({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:o4,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:oJ,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:EE,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:oW,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 ET({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 E_({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)(oW,{size:16,className:"text-red-400 shrink-0"}):"warning"===e.tone?(0,W.jsx)(uS,{size:16,className:"text-amber-400 shrink-0"}):(0,W.jsx)(ld,{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)(lc,{size:12})]})]})]})})}function ED({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 ${lQ[a]} ${lG[a]}`,children:[(0,W.jsx)(lK,{size:10}),lX[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 ${lX[a]} workflow`:e.cta,(0,W.jsx)(lc,{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 EI({stats:e,selectedProject:t}){let{setViewMode:r,setCategoryFilter:n,setTypeFilter:i,setSelectedMemory:a}=(0,sr.useDashboardStore)(),{data:s}=(0,oD.useAuditStats)("24h",t||void 0),{data:o}=(0,oD.useQuarantine)("pending",10,t||void 0),{data:l}=(0,st.useQuality)(t||void 0),{data:c}=(0,st.useContradictions)(t||void 0),{data:u}=o$(),d=e?.total??0,h=e?.decayDistribution?.healthy??0,f=e?.decayDistribution?.fading??0,p=e?.decayDistribution?.critical??0,m=e?.decayDistribution?Math.round(h/Math.max(1,d)*100):null,x=c?.count??c?.contradictions.length??0,y=o?.total??0,g=s?.blockedCount??0,v=l?.duplicates.count??0,b=l?.stale.count??0,w=l?.neverAccessed.count??0,j=(0,H.useMemo)(()=>Object.entries(e?.byCategory??{}).filter(([,e])=>e<3).sort((e,t)=>e[1]-t[1]),[e?.byCategory]),N=(0,H.useCallback)(e=>{a(null),r(e)},[a,r]),k=(0,H.useCallback)(e=>{n(e?.category??null),i(e?.type??null),a(null),r("memories")},[n,a,i,r]),S=(0,H.useMemo)(()=>{let e=[];if(y>0&&e.push({title:`${y} item${1===y?"":"s"} waiting in quarantine`,detail:"Review blocked or quarantined writes before they pile up into silent operator debt.",tone:y>10?"critical":"warning",cta:"Open review queue",onClick:()=>N("quarantine")}),x>0&&e.push({title:`${x} contradiction${1===x?"":"s"} in memory`,detail:"Conflicting facts reduce recall trust and are worth resolving before they become reinforced.",tone:x>5?"critical":"warning",cta:"Inspect memory quality",onClick:()=>N("memories")}),(b>0||w>0||v>0)&&e.push({title:"Memory cleanup work is available",detail:`${b} stale, ${v} duplicate, ${w} never-accessed memories are reducing signal quality.`,tone:b+v>10?"warning":"healthy",cta:"Open cleanup view",onClick:()=>N("memories")}),j.length>0){let[t,r]=j[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:()=>k({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:()=>N("graph")}),e.slice(0,4)},[y,x,b,w,v,j,k,N]);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)(oq,{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)(ET,{label:"Memory Base",value:String(d),detail:`${e?.averageSalience?`${Math.round(100*e.averageSalience)}% avg salience`:"No salience data yet"}`}),(0,W.jsx)(ET,{label:"Healthy",value:null===m?"—":`${m}%`,detail:`${h} healthy \xb7 ${f} fading \xb7 ${p} critical`,tone:null!==m&&m<50?"warning":"success"}),(0,W.jsx)(ET,{label:"Queue",value:String(y),detail:"Pending quarantine review",tone:y>0?"warning":"success"}),(0,W.jsx)(ET,{label:"Blocked",value:String(g),detail:"Blocked operations in the last 24h",tone:g>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:[S.length," active"]})]}),(0,W.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-3",children:S.map(e=>(0,W.jsx)(E_,{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:v}),(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:b}),(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:j.length>0?(0,W.jsxs)(W.Fragment,{children:["Thin categories:"," ",j.slice(0,3).map(([e,t])=>`${e} (${t})`).join(" · ")]}):"No obviously thin categories right now."}),(0,W.jsxs)("button",{onClick:()=>N("graph"),className:"mt-3 inline-flex items-center gap-1 text-xs font-medium text-cyan-300",children:["Open graph coverage",(0,W.jsx)(lc,{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:()=>N("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)(oX,{size:12}),"Open graph"]})]}),(0,W.jsx)("div",{className:"mt-4",children:e?(0,W.jsx)(EC,{stats:e,onNavigate:({category:e})=>k({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:()=>N("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)(oH,{size:12}),"Open memories"]})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(EM,{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)(lq,{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:"Review incoming risk",detail:"Use quarantine and audit together to see what got blocked, what got held, and which sources are noisy.",cta:"Open Security",target:"shield"},{title:"Clean low-signal memory",detail:"Find stale, duplicate, and never-accessed memories before they degrade recall quality.",cta:"Open Memories",target:"memories"},{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:()=>N(e.target),className:"mt-3 inline-flex items-center gap-1 text-xs font-medium text-cyan-300",children:[e.cta,(0,W.jsx)(lc,{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)(oQ,{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 ${lQ[u?.tier??"free"]} ${lG[u?.tier??"free"]}`,children:lX[u?.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)(ED,{card:e,license:u,onOpen:N},e.title))})]})]})]})})}let Ez=[{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"}],EL=[{keys:["/"],description:"Focus search input"},{keys:["Esc"],description:"Close panel / blur search"},{keys:["?"],description:"Toggle this help overlay"}];function ER({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 EF({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)(ER,{children:e})]},t))})]})}function E$({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)(ER,{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:Ez.map((e,t)=>(0,W.jsx)(EF,{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:EL.map((e,t)=>(0,W.jsx)(EF,{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)(ER,{children:"g"})," then a letter within 500ms"]})]})}):null}let EB=(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..."})})}),EU=(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 EV(){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:f,selectedAuditEntry:p,setSelectedAuditEntry:m,projectFilter:x,setProjectFilter:y,typeFilter:g,setTypeFilter:v,categoryFilter:b,setCategoryFilter:w,addEvent:j}=(0,sr.useDashboardStore)(),{showHelp:N,setShowHelp:k}=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)(()=>{f(null),m(null)},[f,m]),onNavigate:(0,H.useCallback)(e=>{d(e)},[d]),onToggleHelp:()=>{}}),{data:S=[]}=(e=sn(t,200),(0,si.useQuery)({queryKey:["suggestions",e],queryFn:()=>so(e),enabled:e.length>=2,staleTime:3e4,refetchOnWindowFocus:!1})),{data:O}=(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:P=[],isLoading:C,isConnected:E,lastEvent:A}=(0,st.useMemoriesWithRealtime)({limit:1e3,query:c||void 0,mode:c?"search":"recent",project:x||void 0,type:g||void 0,category:b||void 0}),{data:M,isLoading:T}=(0,st.useStats)(x||void 0),{data:_=[]}=(0,st.useMemoryLinks)(x||void 0),D=(0,H.useRef)(A);(0,H.useEffect)(()=>{!A||A===D.current||(D.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 I=(0,st.useAccessMemory)();(0,st.useConsolidate)();let{data:z}=(0,st.useControlStatus)();(0,st.usePauseMemory)(),(0,st.useResumeMemory)();let L=z?.paused??!1,{data:R}=lF(),F=R?.enabled&&R?.apiKeySet,$=lz(),B=z?.killSwitchActive??!1,U=e=>{let t=P.find(t=>t.id===e);t&&f(t)},V="overview"===u||"shield"===u||"audit"===u||"quarantine"===u||"agents"===u||"skills"===u||"dome"===u;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)(oq,{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:F?"Connected to ShieldCortex Cloud":"Cloud sync not configured",children:(0,W.jsx)(ll,{size:16,className:F?"text-emerald-400":"text-slate-600"})})]}),(0,W.jsx)("select",{value:x||"",onChange:e=>y(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:O?.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)(ob,{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&&S.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:S.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)(ov,{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 ",(g||b)&&"•"]})]}),(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[B?(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)(ur,{size:14}),"Kill Switch Active"]}):(0,W.jsxs)("button",{onClick:()=>$.mutate(),disabled:$.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:[$.isPending?(0,W.jsx)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(ur,{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 ${B?"bg-red-500 animate-pulse":L?"bg-orange-500 animate-pulse":E?"bg-green-500":"bg-yellow-500"}`,title:B?"Kill switch active — all operations blocked":L?"Memory creation paused":E?"Real-time connected":"Polling mode"}),M?.total??P.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:()=>v(g===e?null:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${g===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:()=>w(b===e?null:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${b===e?"bg-purple-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:e},e))]}),(g||b)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{className:"w-px h-6 bg-slate-700"}),(0,W.jsx)("button",{onClick:()=>{v(null),w(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)(o2,{}),(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)(EI,{stats:M,selectedProject:x}),"shield"===u&&(0,W.jsx)(cs,{}),"audit"===u&&(0,W.jsx)(cf,{}),"quarantine"===u&&(0,W.jsx)(ck,{}),"brain"===u&&(0,W.jsx)(EU,{memories:P,links:_,stats:M,isLoading:C}),"graph"===u&&(0,W.jsx)(EB,{}),"timeline"===u&&(0,W.jsx)(uk,{}),"agents"===u&&(0,W.jsx)(cY,{}),"skills"===u&&(0,W.jsx)(c7,{}),"dome"===u&&(0,W.jsx)(ux,{}),"memories"===u&&(0,W.jsx)(o_,{memories:P,selectedMemory:h,onSelectMemory:e=>{f(e)}})]},u)}),h&&!V&&"brain"!==u&&"graph"!==u&&"timeline"!==u&&(0,W.jsx)("div",{className:"w-80 border-l border-slate-800 overflow-y-auto shrink-0",children:(0,W.jsx)(oC,{memory:h,links:_,memories:P,onClose:()=>f(null),onReinforce:e=>{I.mutate(e)},onSelectMemory:U,isReinforcing:I.isPending,reinforceSuccess:I.isSuccess})}),p&&"audit"===u&&(0,W.jsx)("div",{className:"w-80 border-l border-slate-800 overflow-y-auto shrink-0",children:(0,W.jsx)(cv,{entry:p,onClose:()=>m(null),onViewMemory:e=>{m(null),U(e),sr.useDashboardStore.getState().setViewMode("memories")}})})]}),(0,W.jsx)(E$,{open:N,onClose:()=>k(!1)})]})}e.s(["default",()=>EV],23733)}]);
|