shieldcortex 3.0.4 → 3.1.0

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.
Files changed (92) hide show
  1. package/README.md +5 -2
  2. package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -1
  3. package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +2 -2
  4. package/dashboard/.next/standalone/dashboard/.next/prerender-manifest.json +3 -3
  5. package/dashboard/.next/standalone/dashboard/.next/required-server-files.json +4 -4
  6. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
  7. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
  8. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.html +1 -1
  15. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.rsc +2 -2
  16. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/dashboard/.next/standalone/dashboard/.next/server/app/index.html +1 -1
  23. package/dashboard/.next/standalone/dashboard/.next/server/app/index.rsc +3 -3
  24. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  25. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +3 -3
  26. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
  27. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +2 -2
  28. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  29. package/dashboard/.next/standalone/dashboard/.next/server/app/page/react-loadable-manifest.json +1 -1
  30. package/dashboard/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  31. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_3051539d._.js +1 -1
  32. package/dashboard/.next/standalone/dashboard/.next/server/pages/404.html +1 -1
  33. package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
  34. package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.js +1 -1
  35. package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.json +1 -1
  36. package/dashboard/.next/standalone/dashboard/.next/static/chunks/0a69eb25d08447ee.js +1 -0
  37. package/dashboard/.next/standalone/dashboard/.next/static/chunks/9232a2d99b47b21f.js +3 -0
  38. package/dashboard/.next/standalone/dashboard/.next/static/chunks/97537d3db46c8467.css +3 -0
  39. package/dashboard/.next/standalone/dashboard/.next/static/chunks/aa6e9b8a52353969.js +9 -0
  40. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  41. package/dashboard/.next/standalone/{node_modules/@img/sharp-linux-x64 → dashboard/node_modules/@img/sharp-darwin-arm64}/package.json +7 -13
  42. package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/README.md +2 -2
  43. package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/lib/glib-2.0/include/glibconfig.h +8 -9
  44. package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 → sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib} +0 -0
  45. package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/package.json +5 -11
  46. package/dashboard/.next/standalone/dashboard/server.js +1 -1
  47. package/dashboard/.next/standalone/{dashboard/node_modules/@img/sharp-linux-x64 → node_modules/@img/sharp-darwin-arm64}/package.json +7 -13
  48. package/dashboard/.next/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/package.json +5 -11
  49. package/dist/api/routes/system.js +67 -2
  50. package/dist/cloud/cli.d.ts +1 -0
  51. package/dist/cloud/cli.js +40 -0
  52. package/dist/cloud/config.d.ts +10 -0
  53. package/dist/cloud/config.js +54 -0
  54. package/dist/cloud/graph-sync.d.ts +45 -0
  55. package/dist/cloud/graph-sync.js +257 -0
  56. package/dist/cloud/memory-sync.d.ts +36 -0
  57. package/dist/cloud/memory-sync.js +183 -0
  58. package/dist/cloud/sync-queue.d.ts +24 -0
  59. package/dist/cloud/sync-queue.js +126 -7
  60. package/dist/database/init.js +24 -0
  61. package/dist/graph/backfill.js +3 -5
  62. package/dist/graph/resolve.d.ts +10 -0
  63. package/dist/graph/resolve.js +63 -1
  64. package/dist/index.d.ts +2 -0
  65. package/dist/index.js +61 -4
  66. package/dist/memory/store.js +45 -5
  67. package/dist/memory/types.d.ts +2 -0
  68. package/dist/service/install.d.ts +1 -0
  69. package/dist/service/install.js +43 -1
  70. package/dist/tools/forget.d.ts +2 -2
  71. package/dist/tools/recall.d.ts +3 -3
  72. package/package.json +1 -1
  73. package/dashboard/.next/standalone/dashboard/.next/static/chunks/313c0d327bbf244a.js +0 -9
  74. package/dashboard/.next/standalone/dashboard/.next/static/chunks/49c1cec591af1460.js +0 -3
  75. package/dashboard/.next/standalone/dashboard/.next/static/chunks/ca21f348cb163905.js +0 -1
  76. package/dashboard/.next/standalone/dashboard/.next/static/chunks/f4ca424319f58dc7.css +0 -3
  77. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  78. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  79. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  80. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  81. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
  82. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  83. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  84. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  85. package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
  86. package/dashboard/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
  87. package/dashboard/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
  88. /package/dashboard/.next/standalone/dashboard/.next/static/{BEvyMAX62LQMyt5iSb-F9 → RnvqrTXo_jN8SuMdaNcIj}/_buildManifest.js +0 -0
  89. /package/dashboard/.next/standalone/dashboard/.next/static/{BEvyMAX62LQMyt5iSb-F9 → RnvqrTXo_jN8SuMdaNcIj}/_clientMiddlewareManifest.json +0 -0
  90. /package/dashboard/.next/standalone/dashboard/.next/static/{BEvyMAX62LQMyt5iSb-F9 → RnvqrTXo_jN8SuMdaNcIj}/_ssgManifest.js +0 -0
  91. /package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/lib/index.js +0 -0
  92. /package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/versions.json +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+=j(r)),a+=n;(r=7-(n=(s=e[t])+"").length)&&(a+=j(r))}else if(0===s)return"0";for(;s%10==0;)s/=10;return a+s}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(w(this,o),w(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 w(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(w(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,j,w,N,S,O,P,C=n.constructor,E=n.s==i.s?1:-1,M=n.d,A=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=A.length,N=M.length,m=(p=new C(E)).d=[];A[u]==(M[u]||0);)++u;if(A[u]>(M[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,A=A[0],b++;(u<N||d)&&b--;u++)j=1e7*d+(M[u]||0),m[u]=j/A|0,d=j%A|0;else{for((d=1e7/(A[0]+1)|0)>1&&(A=e(A,d),M=e(M,d),O=A.length,N=M.length),w=O,y=(x=M.slice(0,O)).length;y<O;)x[y++]=0;(P=A.slice()).unshift(0),S=A[0],A[1]>=1e7/2&&++S;do d=0,(l=t(A,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(A,d)).length,y=x.length,1==(l=t(h,x,f,y))&&(d--,r(h,O<f?P:A,f))):(0==d&&(l=d=1),h=A.slice()),(f=h.length)<y&&h.unshift(0),r(x,h,y),-1==l&&(y=x.length,(l=t(A,x,O,y))<1&&(d++,r(x,O<y?P:A,y))),y=x.length):0===l&&(d++,x=[0]),m[u++]=d,l&&x[0]?x[y++]=M[w]||0:(x=[M[w]],y=1);while((w++<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 j(e){for(var t="";e--;)t+="0";return t}function w(e,t){var r,i,o,l,c,u,d,h,f,p=1,m=e,g=m.d,j=m.constructor,N=j.precision;if(m.s<1)throw Error(s+(m.s?"NaN":"-Infinity"));if(m.eq(n))return new j(0);if(null==t?(a=!1,h=N):h=t,m.eq(10))return null==t&&(a=!0),b(j,h);if(j.precision=h+=10,i=(r=x(g)).charAt(0),!(15e14>Math.abs(l=v(m))))return d=b(j,h+2,N).times(l+""),m=w(new j(i+"."+r.slice(1)),h-10).plus(d),j.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 j("0."+r),l++):m=new j(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 j(o),h))).d).slice(0,h)===x(u.d).slice(0,h))return u=u.times(2),0!==l&&(u=u.plus(b(j,h+2,N).times(l+""))),u=y(u,new j(p),h),j.precision=N,null==t?(a=!0,k(u,N)):u;u=d,o+=2}}function N(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);)++n;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(n,i)){if(i-=n,e.e=c((r=r-n-1)/7),e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),a&&(e.e>h||e.e<-h))throw Error(l+r)}else e.s=0,e.e=0,e.d=[0];return e}function k(e,t,r){var n,i,s,o,d,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)+j(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+j(-i-1)+a,r&&(n=r-s)>0&&(a+=j(n))):i>=s?(a+=j(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+j(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=j(n))),e.s<0?"-"+a:a}function P(e,t){if(e.length>t)return e.length=t,!0}function C(e){if(!e||"object"!=typeof e)throw Error(s+"Object expected");var t,r,n,i=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if(void 0!==(n=e[r=i[t]]))if(c(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(o+r+": "+n);if(void 0!==(n=e[r="LN10"]))if(n==Math.LN10)this[r]=new this(n);else throw Error(o+r+": "+n);return this}if((i=function e(t){var r,n,i;function a(e){if(!(this instanceof a))return new a(e);if(this.constructor=a,e instanceof a){this.s=e.s,this.e=e.e,this.d=(e=e.d)?e.slice():e;return}if("number"==typeof e){if(0*e!=0)throw Error(o+e);if(e>0)this.s=1;else if(e<0)e=-e,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(e===~~e&&e<1e7){this.e=0,this.d=[e];return}return N(this,e.toString())}if("string"!=typeof e)throw Error(o+e);if(45===e.charCodeAt(0)?(e=e.slice(1),this.s=-1):this.s=1,d.test(e))N(this,e);else throw Error(o+e)}if(a.prototype=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,j=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case d:case h:case s:case l:case o:case 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 w(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)||w(e)===d},r.isConcurrentMode=N,r.isContextConsumer=function(e){return w(e)===u},r.isContextProvider=function(e){return w(e)===c},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},r.isForwardRef=function(e){return w(e)===f},r.isFragment=function(e){return w(e)===s},r.isLazy=function(e){return w(e)===y},r.isMemo=function(e){return w(e)===x},r.isPortal=function(e){return w(e)===a},r.isProfiler=function(e){return w(e)===l},r.isStrictMode=function(e){return w(e)===o},r.isSuspense=function(e){return w(e)===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===j||e.$$typeof===g)},r.typeOf=w},29095,(e,t,r)=>{"use strict";t.exports=e.r(53919)},8284,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isPlainObject=function(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){let t=e[Symbol.toStringTag];return null!=t&&!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}},91804,(e,t,r)=>{t.exports=e.r(8284).isPlainObject},96249,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.uniqBy=function(e,t){let r=new Map;for(let n=0;n<e.length;n++){let i=e[n],a=t(i,n,e);r.has(a)||r.set(a,i)}return Array.from(r.values())}},82503,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.ary=function(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}},48571,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.identity=function(e){return e}},97977,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isObjectLike=function(e){return"object"==typeof e&&null!==e}},64812,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(79087),i=e.r(97977);r.isArrayLikeObject=function(e){return i.isObjectLike(e)&&n.isArrayLike(e)}},91418,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(350);r.property=function(e){return function(t){return n.get(t,e)}}},38193,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isPrimitive=function(e){return null==e||"object"!=typeof e&&"function"!=typeof e}},27583,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(38180),i=e.r(38193),a=e.r(66480);function s(e,t,r,c){if(t===e)return!0;switch(typeof t){case"object":return function(e,t,r,n){if(null==t)return!0;if(Array.isArray(t))return o(e,t,r,n);if(t instanceof Map){var a=e,s=t,c=r,u=n;if(0===s.size)return!0;if(!(a instanceof Map))return!1;for(let[e,t]of s.entries())if(!1===c(a.get(e),t,e,a,s,u))return!1;return!0}if(t instanceof Set)return l(e,t,r,n);let d=Object.keys(t);if(null==e||i.isPrimitive(e))return 0===d.length;if(0===d.length)return!0;if(n?.has(t))return n.get(t)===e;n?.set(t,e);try{for(let a=0;a<d.length;a++){let s=d[a];if(!i.isPrimitive(e)&&!(s in e)||void 0===t[s]&&void 0!==e[s]||null===t[s]&&null!==e[s]||!r(e[s],t[s],s,e,t,n))return!1}return!0}finally{n?.delete(t)}}(e,t,r,c);case"function":if(Object.keys(t).length>0)return s(e,{...t},r,c);return a.isEqualsSameValueZero(e,t);default:if(!n.isObject(e))return a.isEqualsSameValueZero(e,t);if("string"==typeof t)return""===t;return!0}}function o(e,t,r,n){if(0===t.length)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let s=t[a],o=!1;for(let l=0;l<e.length;l++){if(i.has(l))continue;let c=e[l],u=!1;if(r(c,s,a,e,t,n)&&(u=!0),u){i.add(l),o=!0;break}}if(!o)return!1}return!0}function l(e,t,r,n){return 0===t.size||e instanceof Set&&o([...e],[...t],r,n)}r.isMatchWith=function e(t,r,n){return"function"!=typeof n?e(t,r,()=>void 0):s(t,r,function e(t,r,i,a,o,l){let c=n(t,r,i,a,o,l);return void 0!==c?!!c:s(t,r,e,l)},new Map)},r.isSetMatch=l},90943,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let n=e.r(27583);r.isMatch=function(e,t){return n.isMatchWith(e,t,()=>void 0)}},62005,(e,t,r)=>{var n={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=l(e),s=a[0],o=a[1],c=new i((s+o)*3/4-o),u=0,d=o>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=0,o=n-i;s<o;s+=16383)a.push(function(e,t,n){for(var i,a=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,s,s+16383>o?o:s+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},72:function(e,t,r){"use strict";var n=r(675),i=r(783),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);var a=0|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+=M[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 j(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function w(e,t,r,n,a){return t*=1,r>>>=0,a||j(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,a){return t*=1,r>>>=0,a||j(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,a,s,o,l,c,u,d,h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var 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 w(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var a=i-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=o.isBuffer(e)?e:o.from(e,n),l=s.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%l]}return this};var k=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function O(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function P(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function E(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var M=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,j,w,N,k,S,O,P,C,E,M,A,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 Q(e){let t=(0,H.useRef)(null);return null===t.current&&(t.current=e()),t.current}let G="u">typeof window,Z=G?H.useLayoutEffect:H.useEffect,J=(0,H.createContext)(null);function ee(e){return"object"==typeof e&&null!==e}function et(e){return ee(e)&&"offsetHeight"in e}var er=H;let en=(0,H.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ei(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class ea extends er.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,r=et(e)&&e.offsetWidth||0,n=et(e)&&e.offsetHeight||0,i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft,i.right=r-i.width-i.left,i.bottom=n-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}}function es({children:e,isPresent:t,anchorX:r,anchorY:n,root:i}){let a=(0,er.useId)(),s=(0,er.useRef)(null),o=(0,er.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,er.useContext)(en),c=function(...e){return H.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=ei(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():ei(e[t],null)}}}}(...e),e)}(s,e.props?.ref??e?.ref);return(0,er.useInsertionEffect)(()=>{let{width:e,height:c,top:u,left:d,right:h,bottom: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=Q(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=Q(()=>new Map),y=(0,H.useRef)(new Set),[g,v]=(0,H.useState)(h),[b,j]=(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 w=[];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),w.push(r))}return"wait"===a&&w.length&&(e=w),j(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?.(),j(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,ej=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ew=(e,t)=>r=>!!("string"==typeof r&&ej.test(r)&&r.startsWith(e)||t&&null!=r&&Object.prototype.hasOwnProperty.call(r,t)),eN=(e,t,r)=>n=>{if("string"!=typeof n)return n;let[i,a,s,o]=n.match(eb);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==o?parseFloat(o):1}},ek={...ex,transform:e=>Math.round(em(0,255,e))},eS={test:ew("rgb","red"),parse:eN("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ek.transform(e)+", "+ek.transform(t)+", "+ek.transform(r)+", "+ev(ey.transform(n))+")"},eO={test:ew("#"),parse:function(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:eS.transform},eP=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),eC=eP("deg"),eE=eP("%"),eM=eP("px"),eA=eP("vh"),eT=eP("vw"),e_={...eE,parse:e=>eE.parse(e)/100,transform:e=>eE.transform(100*e)},eD={test:ew("hsl","hue"),parse:eN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+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},eQ={borderWidth:eM,borderTopWidth:eM,borderRightWidth:eM,borderBottomWidth:eM,borderLeftWidth:eM,borderRadius:eM,borderTopLeftRadius:eM,borderTopRightRadius:eM,borderBottomRightRadius:eM,borderBottomLeftRadius:eM,width:eM,maxWidth:eM,height:eM,maxHeight:eM,top:eM,right:eM,bottom:eM,left:eM,inset:eM,insetBlock:eM,insetBlockStart:eM,insetBlockEnd:eM,insetInline:eM,insetInlineStart:eM,insetInlineEnd:eM,padding:eM,paddingTop:eM,paddingRight:eM,paddingBottom:eM,paddingLeft:eM,paddingBlock:eM,paddingBlockStart:eM,paddingBlockEnd:eM,paddingInline:eM,paddingInlineStart:eM,paddingInlineEnd:eM,margin:eM,marginTop:eM,marginRight:eM,marginBottom:eM,marginLeft:eM,marginBlock:eM,marginBlockStart:eM,marginBlockEnd:eM,marginInline:eM,marginInlineStart:eM,marginInlineEnd:eM,fontSize:eM,backgroundPositionX:eM,backgroundPositionY:eM,rotate:eC,rotateX:eC,rotateY:eC,rotateZ:eC,scale:eg,scaleX:eg,scaleY:eg,scaleZ:eg,skew:eC,skewX:eC,skewY:eC,distance:eM,translateX:eM,translateY:eM,translateZ:eM,x:eM,y:eM,z:eM,perspective:eM,transformPerspective:eM,opacity:ey,originX:e_,originY:e_,originZ:eM,zIndex:eX,fillOpacity:ey,strokeOpacity:ey,numOctaves:eX},eG={...eQ,color:eI,backgroundColor:eI,outlineColor:eI,fill:eI,stroke:eI,borderColor:eI,borderTopColor:eI,borderRightColor:eI,borderBottomColor:eI,borderLeftColor:eI,filter:eY,WebkitFilter:eY},eZ=e=>eG[e],eJ=()=>({translate:0,scale:1,origin:0,originPoint:0}),e0=()=>({x:eJ(),y:eJ()}),e1=()=>({min:0,max:0}),e2=()=>({x:e1(),y:e1()}),e5=e=>!!(e&&e.getVelocity),e4=new Set(["width","height","top","left","right","bottom",...ef]),e3=e=>t=>t.test(e),e6=[ex,eM,eE,eC,eT,eA,{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===eM,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 tj=e=>e,tw={},tN=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tk(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,s=tN.reduce((e,r)=>(e[r]=function(e,t){let r=new Set,n=new Set,i=!1,a=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){s.has(t)&&(u.schedule(t),e()),l++,t(o)}let u={schedule:(e,t=!1,a=!1)=>{let o=a&&i?r:n;return t&&s.add(e),o.has(e)||o.add(e),e},cancel:e=>{n.delete(e),s.delete(e)},process:e=>{if(o=e,i){a=!0;return}i=!0,[r,n]=[n,r],r.forEach(c),t,l=0,r.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}(a,t?r:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:f,postRender:p}=s,m=()=>{let a=tw.useManualTiming?i.timestamp:performance.now();r=!1,tw.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),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:tj,!0),tE=new Set,tM=!1,tA=!1,tT=!1;function t_(){if(tA){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)})}tA=!1,tM=!1,tE.forEach(e=>e.complete(tT)),tE.clear()}function tD(){tE.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(tA=!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),tM||(tM=!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||tw.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},tQ="u">typeof window,tG=new WeakMap;function tZ(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function tJ(e){return"string"==typeof e||Array.isArray(e)}let t0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],t1=["initial",...t0];function t2(e){return tZ(e.animate)||t1.some(t=>tJ(e[t]))}function t5(e){return!!(t2(e)||e.variants)}function t4(e){let t=[{},{}];return e?.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function t3(e,t,r,n){if("function"==typeof t){let[i,a]=t4(n);t=t(void 0!==r?r:e.custom,i,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[i,a]=t4(n);t=t(void 0!==r?r:e.custom,i,a)}return t}let t6=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],t8={};class t7{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:i,visualState:a},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tI,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=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,tG.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(tX.current||function(){if(tX.current=!0,tQ)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,eQ[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,eQ[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(!eM.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 rj(e){return void 0===e||1===e}function rw({scale:e,scaleX:t,scaleY:r}){return!rj(e)||!rj(t)||!rj(r)}function rN(e){return rw(e)||rk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rk(e){var t,r;return(t=e.x)&&"0%"!==t||(r=e.y)&&"0%"!==r}function rS(e,t,r,n,i){return void 0!==i&&(e=n+i*(e-n)),n+r*(e-n)+t}function rO(e,t=0,r=1,n,i){e.min=rS(e.min,t,r,n,i),e.max=rS(e.max,t,r,n,i)}function rP(e,{x:t,y:r}){rO(e.x,t.translate,t.scale,t.originPoint),rO(e.y,r.translate,r.scale,r.originPoint)}function rC(e,t){e.min=e.min+t,e.max=e.max+t}function rE(e,t,r,n,i=.5){let a=rp(e.min,e.max,i);rO(e,t,r,a,n)}function rM(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 rA(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 rA(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():Q(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 rQ(){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 rG=Symbol.for("motionComponentSymbol"),rZ="data-"+re("framerAppearId"),rJ=(0,H.createContext)({});function r0(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function r1(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&function(e){let t=rQ();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&&G){(0,H.useContext)(rI).strict;let t=function(e){let{drag:t,layout:r}=rQ();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[rG]=e,l}class r2{constructor(e){this.isMounted=!1,this.node=e}update(){}}function r5(e,t,r){let n=e.getProps();return t3(n,t,void 0!==r?r:n.custom,e)}function r4(e,t){return e?.[t]??e?.default??e}let r3=e=>Array.isArray(e);function r6(e,t){let r=e.getValue("willChange");if(e5(r)&&r.add)return r.add(t);if(!r&&tw.WillChange){let r=new tw.WillChange("auto");e.addValue("willChange",r),r.add(t)}}let r8=e=>1e3*e,r7=(e,t)=>r=>t(e(r)),r9=(...e)=>e.reduce(r7),ne={layout:0,mainThread:0,waapi:0};function nt(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function nr(e,t){return r=>r>0?t:e}let nn=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},ni=[eO,eS,eD];function na(e){let t=ni.find(t=>t.test(e));if(e7(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===eD&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let i=0,a=0,s=0;if(t/=100){let n=r<.5?r*(1+t):r+t-r*t,o=2*r-n;i=nt(o,n,e+1/3),a=nt(o,n,e),s=nt(o,n,e-1/3)}else i=a=s=r;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*s),alpha:n}}(r)),r}let ns=(e,t)=>{let r=na(e),n=na(t);if(!r||!n)return nr(e,t);let i={...r};return e=>(i.red=nn(r.red,n.red,e),i.green=nn(r.green,n.green,e),i.blue=nn(r.blue,n.blue,e),i.alpha=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,nj=.5;function nw(e,t){return e*Math.sqrt(1-t*t)}let nN=["duration","bounce"],nk=["stiffness","damping","mass"];function nS(e,t){return t.some(t=>void 0!==e[t])}function nO(e=.3,t=.3){let r,n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:i,restDelta:a}=n,s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:h,velocity: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)/nw(t,s)*Math.exp(-i)},a=t=>{let n=t*s*e,a=Math.pow(s,2)*Math.pow(t,2)*e,o=Math.exp(-n),l=nw(Math.pow(t,2),s);return(n*r+r-a)*o*(-i(t)+.001>0?-1:1)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-r)*e+1),a=t=>e*e*(r-t)*Math.exp(-t*e));let o=function(e,t,r){let n=r;for(let r=1;r<12;r++)n-=e(n)/t(n);return n}(i,a,5/e);if(e=r8(e),isNaN(o))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(o,2)*n;return{stiffness:t,damping:2*s*Math.sqrt(n*t),duration:e}}}(e);(t={...t,...r,mass:1}).isResolvedFromDuration=!0}return t}({...n,velocity:-((n.velocity||0)/1e3)}),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:nj),x<1){let e=nw(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},j=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 j(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==d||(t=!0,b(e),j(e)),void 0!==d&&e>=d)?h.next(e-d):(t||b(e),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?tj:i=>0===i||1===i?i:nC(function(e,t,r,n,i){let a,s,o=0;do(a=nC(s=t+(r-t)/2,n,i)-e)>0?r=s:t=s;while(Math.abs(a)>1e-7&&++o<12)return s}(i,0,1,e,r),t,n)}let nM=nE(.42,0,1,1),nA=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:tj,easeIn:nM,easeInOut:nT,easeOut:nA,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||tw.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]||tj:t,a)),n.push(a)}return n}(t,n,i),l=o.length,c=r=>{if(s&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);let i=nK(e[n],e[n+1],r);return o[n](i)};return r?t=>c(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 nQ(e){"string"==typeof e.type&&(e.type=nX[e.type])}class nG{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let nZ=e=>e/100;class nJ extends nG{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==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;nQ(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:j}=b;y||null===o||(j=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&j);return w&&f!==nP&&(b.value=nY(c,this.options,m,this.speed)),p&&p(b.value),w&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=r8(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(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 nG{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:r,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:s,onComplete:o}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e9("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:e,...t}){return n6(e)&&n5()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeOut",times:l}={},c){let u={[t]:r};l&&(u.offset=l);let d=function e(t,r){if(t)return"function"==typeof t?n5()?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,tj):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),nQ(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 nG{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:a="loop",keyframes:s,name:o,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=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)&&((tw.instantAnimations||!o)&&c?.(nY(e,r,t)),e[0]=e[e.length-1],it(r),r.repeat=0);let u={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...r,keyframes:e},d=!l&&function(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:a,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=t.owner.getProps();return ii()&&r&&ir.has(r)&&("transform"!==r||!l)&&!o&&!n&&"mirror"!==i&&0!==a&&"inertia"!==s}(u),h=u.motionValue?.owner?.current,f=d?new n9({...u,element:h}):new nJ(u);f.finished.then(()=>{this.notifyFinished()}).catch(tj),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)),(tw.instantAnimations||tw.skipAnimations)&&(d=!0,it(u),u.delay=0),u.allowFlatten=!o.type&&!o.ease,d&&!a&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:r="loop"},n){let i=e.filter(ic),a=t&&"loop"!==r&&t%2==1?0:i.length-1;return i[a]}(u.keyframes,o);if(void 0!==e)return void tS.update(()=>{u.onUpdate(e),u.onComplete()})}return o.isSync?new nJ(u):new ia(u)};function id(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:s,...o}=t;n&&(a=n);let l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(let t in o){let n=e.getValue(t,e.latestValues[t]??null),i=o[t];if(void 0===i||c&&function({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}(c,t))continue;let s={delay:r,...r4(a||{},t)},u=n.get();if(void 0!==u&&!n.isAnimating&&!Array.isArray(i)&&i===u&&!s.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let r=e.props[rZ];if(r){let e=window.MotionHandoffAnimation(r,t,tS);null!==e&&(s.startTime=e,d=!0)}}r6(e,t),n.start(iu(t,n,i,e.shouldReduceMotion&&e4.has(t)?{type:!1}:s,e,d));let h=n.animation;h&&l.push(h)}return s&&Promise.all(l).then(()=>{tS.update(()=>{s&&function(e,t){let{transitionEnd:r={},transition:n={},...i}=r5(e,t)||{};for(let t in i={...i,...r}){var a;let r=r3(a=i[t])?a[a.length-1]||0:a;e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,tW(r))}}(e,s)})}),l}function ih(e,t,r,n=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),s=e.size,o=(s-1)*n;return"function"==typeof r?r(a,s):1===i?a*n:o-a*n}function ip(e,t,r={}){let n=r5(e,t,"exit"===r.type?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let a=n?()=>Promise.all(id(e,n,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:a=0,staggerChildren:s,staggerDirection:o}=i;return function(e,t,r=0,n=0,i=0,a=1,s){let o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(ip(l,t,{...s,delay:r+("function"==typeof n?0:n)+ih(e.variantChildren,l,n,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,n,a,s,o,r)}:()=>Promise.resolve(),{when:o}=i;if(!o)return Promise.all([a(),s(r.delay)]);{let[e,t]="beforeChildren"===o?[a,s]:[s,a];return e().then(()=>t())}}let im=t1.length;function ix(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}let iy=[...t0].reverse(),ig=t0.length;function iv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ib(){return{animate:iv(!0),whileInView:iv(),whileHover:iv(),whileTap:iv(),whileDrag:iv(),whileFocus:iv(),exit:iv()}}let ij=0;function iw(e){return[e("x"),e("y")]}let iN=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ik(e){return iN.has(e.tagName)||!0===e.isContentEditable}function iS(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}let iO={x:!1,y:!1};function iP(e){return e.max-e.min}function iC(e,t,r,n=.5){e.origin=n,e.originPoint=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 iM(e,t,r){e.min=r.min+t.min,e.max=e.min+iP(t)}function iA(e,t,r){e.min=t.min-r.min,e.max=e.min+iP(t)}function iT(e,t,r){iA(e.x,t.x,r.x),iA(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),iw(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=()=>iw(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new iF(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow: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||!iQ(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&&iw(e=>{var t,n;let i;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=r.layoutBox[e],n=this.constraints[e],i={},void 0!==n.min&&(i.min=n.min-t.min),void 0!==n.max&&(i.max=n.max-t.min),i))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!r0(t))return!1;let n=t.current;e9(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;let a=function(e,t,r){let n=rA(e,r),{scroll:i}=t;return i&&(rC(n.x,i.offset.x),rC(n.y,i.offset.y)),n}(n,i.root,this.visualElement.getTransformPagePoint()),s=(e=i.layout.layoutBox,{x:iK(e.x,a.x),y:iK(e.y,a.y)});if(r){let e=r(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=rb(e))}return s}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:n,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),o=this.constraints||{};return Promise.all(iw(s=>{if(!iQ(s,t,this.currentDirection))return;let l=o&&o[s]||{};a&&(l={min:0,max:0});let c={type:"inertia",velocity:r?e[s]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,c)})).then(s)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return r6(this.visualElement,e),r.start(iu(e,r,0,t,this.visualElement,!1))}stopAnimation(){iw(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){iw(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){iw(t=>{let{drag:r}=this.getProps();if(!iQ(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};iw(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var r,i;let a,s,o,l=t.get();n[e]=(r={min:l,max:l},i=this.constraints[e],a=.5,s=iP(r),(o=iP(i))>s?a=nK(i.min,i.max-s,r.min):s>o&&(a=nK(r.min,r.max-o,i.min)),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(),iw(t=>{if(!iQ(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&&(iw(t=>{let r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{a(),t(),i(),s&&s()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:a=.35,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:i,dragElastic:a,dragMomentum:s}}}function iQ(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}let iG=e=>(t,r)=>{e&&tS.postRender(()=>e(t,r))},iZ={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var iJ=H;let i0=!1;class i1 extends iJ.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),r&&r.register&&n&&r.register(i),i0&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),iZ.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:n,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),i0=!0,n||e.layoutDependency!==t||void 0===t||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||tS.postRender(()=>{let e=a.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tU.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;i0=!0,n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function i2(e){let[t,r]=ec(),n=(0,iJ.useContext)(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||eM.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,tj);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"],aj=0;function aw(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function aN({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(e={},r=t?.()){this.id=aj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(aO),this.nodes.forEach(a_),this.nodes.forEach(aD),this.nodes.forEach(aP)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new ag)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new tB),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=ax(t)&&!(ax(t)&&"svg"===t.tagName),this.instance=t;let{layoutId:r,layout:n,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||r)&&(this.isLayoutDirty=!0),e){let r,n=0,i=()=>this.root.updateBlockedByResize=!1;tS.read(()=>{n=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==n){let t,a;n=e,this.root.updateBlockedByResize=!0,r&&r(),t=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(aM);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(aA),this.nodes.forEach(ak),this.nodes.forEach(aS)):this.nodes.forEach(aM),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&&rM(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),rN(n.latestValues)&&rM(r,n.latestValues)}return rN(this.latestValues)&&rM(r,this.latestValues),r}removeTransform(e){let t=e2();i9(t,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];if(!r.instance||!rN(r.latestValues))continue;rw(r.latestValues)&&r.updateSnapshot();let n=e2();i9(n,r.measurePageBox()),i8(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return rN(this.latestValues)&&i8(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==tP.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let r=!!this.resumingFrom||this!==t;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:n,layoutId:i}=this.options;if(!this.layout||!(n||i))return;this.resolvedRelativeTargetAt=tP.timestamp;let a=this.getClosestProjectingParent();if(a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=e2(),this.targetWithTransforms=e2()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var s,o,l;this.forceRelativeParentToResolveTarget(),s=this.target,o=this.relativeTarget,l=this.relativeParent.target,iM(s.x,o.x,l.x),iM(s.y,o.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):i9(this.target,this.layout.layoutBox),rP(this.target,this.targetDelta)):i9(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&1!==this.animationProgress?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||rw(this.parent.latestValues)||rk(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,r){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=e2(),this.relativeTargetOrigin=e2(),iT(this.relativeTargetOrigin,t,r),i9(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,r=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(r=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===tP.timestamp&&(r=!1),r)return;let{layout:n,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(n||i))return;i9(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,s=this.treeScale.y;!function(e,t,r,n=!1){let i,a,s=r.length;if(s){t.x=t.y=1;for(let o=0;o<s;o++){a=(i=r[o]).projectionDelta;let{visualElement:s}=i.options;(!s||!s.props.style||"contents"!==s.props.style.display)&&(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&rM(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)&&rM(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),rM(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&&aw("z",e,n,this.animationValues);for(let t=0;t<ab.length;t++)aw(`rotate${ab[t]}`,e,n,this.animationValues),aw(`skew${ab[t]}`,e,n,this.animationValues);for(let t in e.render(),n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=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?iw(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)&&iw(n=>{let i=a?t.measuredBox[n]:t.layoutBox[n],s=iP(r[n]);i.max=i.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+s)});let s=e0();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 aM(e){e.isLayoutDirty=!1}function aA(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:tj;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 aQ(e){return!("touch"===e.pointerType||iO.x||iO.y)}function aG(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);let i=n["onHover"+r];i&&tS.postRender(()=>i(t,iD(t)))}let aZ=(e,t)=>!!t&&(e===t||aZ(e,t.parentElement)),aJ=new WeakSet;function a0(e){return t=>{"Enter"===t.key&&e(t)}}function a1(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function a2(e){return i_(e)&&!(iO.x||iO.y)}function a5(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);let i=n["onTap"+("End"===r?"":r)];i&&tS.postRender(()=>i(t,iD(t)))}let a4=new WeakMap,a3=new WeakMap,a6=e=>{let t=a4.get(e.target);t&&t(e)},a8=e=>{e.forEach(a6)},a7={some:0,all:1},a9=function(e,t){if("u"<typeof Proxy)return r1;let r=new Map,n=(r,n)=>r1(r,n,e,t);return new Proxy((e,t)=>n(e,t),{get:(i,a)=>"create"===a?n:(r.has(a)||r.set(a,r1(a,void 0,e,t)),r.get(a))})}({animation:{Feature:class extends r2{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:r})=>(function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>ip(e,t,r)));else if("string"==typeof t)n=ip(e,t,r);else{let i="function"==typeof t?r5(e,t,r.custom):t;n=Promise.all(id(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})})(e,t,r))),r=ib(),n=!0,i=t=>(r,n)=>{let i=r5(e,n,"exit"===t?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...n}=i;r={...r,...n,...t}}return r};function a(a){let{props:s}=e,o=function e(t){if(!t)return;if(!t.isControllingVariants){let r=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(r.initial=t.props.initial),r}let r={};for(let e=0;e<im;e++){let n=t1[e],i=t.props[n];(tJ(i)||!1===i)&&(r[n]=i)}return r}(e.parent)||{},l=[],c=new Set,u={},d=1/0;for(let t=0;t<ig;t++){var h,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)),j=b||p===a&&m.isActive&&!v&&y||t>d&&y,w=!1,N=Array.isArray(x)?x:[x],k=N.reduce(i(p),{});!1===g&&(k={});let{prevResolvedValues:S={}}=m,O={...S,...k},P=t=>{j=!0,c.has(t)&&(w=!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&&(j=!1);let C=v&&b,E=!C||w;j&&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=ij++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends r2{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.unmount();let{viewport:r={}}=this.node.getProps(),{root:n,margin:i,amount:a="some",once:s}=r,o={root:n?n.current:void 0,rootMargin:i,threshold:"number"==typeof a?a:a7[a]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,s&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),i=t?r:n;i&&i(e)};return e=this.node.current,t=function({root:e,...t}){let r=e||document;a3.has(r)||a3.set(r,{});let n=a3.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(a8,{root:e,...t})),n[i]}(o),a4.set(e,l),t.observe(e),()=>{a4.delete(e),t.unobserve(e)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends r2{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){let[n,i,a]=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(!aQ(e))return;let{target:r}=e,n=t(r,e);if("function"!=typeof n||!r)return;let a=e=>{aQ(e)&&(n(e),r.removeEventListener("pointerleave",a))};r.addEventListener("pointerleave",a,i)};return n.forEach(e=>{e.addEventListener("pointerenter",s,i)}),a}(e,(e,t)=>(aG(this.node,t,"Start"),e=>aG(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends r2{constructor(){super(...arguments),this.removePointerDownListener=tj}onPointerDown(e){this.session=new iF(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:iz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:iG(e),onStart:iG(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&tS.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=iI(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends r2{constructor(e){super(e),this.removeGroupControls=tj,this.removeListeners=tj,this.controls=new iX(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tj}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:aY,MeasureLayout:i2},layout:{ProjectionNode:aY,MeasureLayout:i2}},(e,t)=>t.isSVG??rD(e)?new rv(t):new rT(t,{allowProjection:e!==H.Fragment}));var se=e.i(13132),st=e.i(88069),sr=e.i(42098);function sn(e,t=300){let[r,n]=(0,H.useState)(e);return(0,H.useEffect)(()=>{let r=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}var si=e.i(45688),sa=e.i(88969);let ss=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function so(e){if(!e||e.length<2)return[];let t=await (0,sa.authFetch)(`${ss}/api/suggestions?q=${encodeURIComponent(e)}&limit=8`);if(!t.ok)throw Error("Failed to fetch suggestions");return(await t.json()).suggestions}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=[],sj=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),sw=/\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)$/,sM=/\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$/,sA=/^(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=>sM.test(e)&&!sA.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),sQ=e=>s3(e,s7,sV),sG=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(sw),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),sj(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)):sj(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"],j=()=>[...b(),sZ,sW],w=()=>["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],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["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:j()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[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:[...M(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],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,sQ]}],"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,sG]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",d,s4,sG]}],"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,sG]}],"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,sG]}],"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":j()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:H()}],"skew-x":[{"skew-x":H()}],"skew-y":[{"skew-y":H()}],transform:[{transform:[sZ,sW,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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 oj=e.i(97358),ow=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,j]=(0,H.useState)(e.category),[w,N]=(0,H.useState)((e.tags||[]).join(", ")),[k,S]=(0,H.useState)(!1),O=(0,st.useEditMemory)(),P=(0,st.useDeleteMemory)(),[C,E]=(0,H.useState)(e.id);C!==e.id&&(E(e.id),m(!1),S(!1),y(e.title),v(e.content),j(e.category),N((e.tags||[]).join(", "))),(0,H.useEffect)(()=>{if(o&&h===e.id){let e=setTimeout(()=>c(!0),0),t=setTimeout(()=>c(!1),1500);return()=>{clearTimeout(e),clearTimeout(t)}}},[o,h,e.id]);let M=(0,ow.calculateDecayFactor)(e),A=(0,oj.getCategoryColor)(e.category),T=(0,oj.getTypeColor)(e.type),_=M>.7?{label:"Healthy",color:"#22C55E",bgColor:"rgba(34, 197, 94, 0.15)"}:M>.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=>j(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:A+"20",color:A},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:w,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=w.split(",").map(e=>e.trim()).filter(Boolean),r={};(x!==e.title&&(r.title=x),g!==e.content&&(r.content=g),b!==e.category&&(r.category=b),w!==(e.tags||[]).join(", ")&&(r.tags=t),0===Object.keys(r).length)?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),j(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:M>.7?"Memory is strong and stable":M>.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*M).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*M}%`,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,oj.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 oM(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 oA({memory:e,isSelected:t,onSelect:r,isChecked:n,onCheck:i}){let a=(0,oj.getCategoryColor)(e.category),s=(0,oj.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 ",oM(e.createdAt)]}),(0,W.jsxs)("span",{children:["Accessed ",oM(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)(oA,{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"}]]),oQ=(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"}]]),oG=(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=(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"}]]),o1=[{id:"overview",label:"Home",icon:oV},{id:"shield",label:"Shield",icon:oq},{id:"cloud",label:"Cloud",icon:o0},{id:"audit",label:"Audit",icon:oK},{id:"quarantine",label:"Queue",icon:oW},{id:"agents",label:"Agents",icon:oQ},{id:"skills",label:"Skills",icon:oG},{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}],o2=new Set(["shield","audit","skills","dome"]);function o5(){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:o1.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&&o2.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 o4=(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"}]]),o3=(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"}]]),o6=(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"}]]),o8=(0,oN.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),o7=[{key:"trust",label:"Trust",icon:oq,color:"text-blue-400",bg:"bg-blue-400/10"},{key:"firewall",label:"Firewall",icon:o4,color:"text-orange-400",bg:"bg-orange-400/10"},{key:"sensitivity",label:"Sensitivity",icon:o3,color:"text-purple-400",bg:"bg-purple-400/10"},{key:"fragmentation",label:"Fragment",icon:o6,color:"text-cyan-400",bg:"bg-cyan-400/10"},{key:"audit",label:"Audit",icon:oK,color:"text-green-400",bg:"bg-green-400/10"}],o9={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 le({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=o9[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:o7.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<o7.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)(o8,{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=o9[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 lt(){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 lr({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 ln({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 li=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function la(e){return e>70?"#22c55e":e>=40?"#eab308":"#ef4444"}function ls({score:e,size:t=120,strokeWidth:r=8}){let n=(t-r)/2,i=2*Math.PI*n,a=i-e/100*i,s=la(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 lo({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 ll(){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)(`${li}/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)(ls,{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:la(o)},children:o})})]})}),(0,W.jsxs)("div",{className:"space-y-3",children:[(0,W.jsx)(lo,{component:l.freshness}),(0,W.jsx)(lo,{component:l.coverage}),(0,W.jsx)(lo,{component:l.consistency}),(0,W.jsx)(lo,{component:l.consolidation})]})]})}let 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)(o0,{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)(o0,{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."})]})]})]})}let lm=(0,oN.default)("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),lx=(0,oN.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),ly=(0,oN.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),lg=[];function lv(){return(0,si.useQuery)({queryKey:["cloud-sync-status"],queryFn:async()=>{var e;let t,r,n,i,a=await (0,sa.authFetch)("http://localhost:3001/api/cloud/sync-status");if(!a.ok)throw Error("Failed to fetch sync status");return t=(e=await a.json()).controls&&"object"==typeof e.controls?e.controls:{},n="byKind"in(r=e.queue&&"object"==typeof e.queue?e.queue:{})&&r.byKind&&"object"==typeof r.byKind?r.byKind:{},i=e=>({pending:Number(n[e]?.pending??0),failed:Number(n[e]?.failed??0),synced:Number(n[e]?.synced??0)}),{enabled:!!e.enabled,apiKeySet:!!e.apiKeySet,baseUrl:"string"==typeof e.baseUrl?e.baseUrl:"https://api.shieldcortex.ai",featureEnabled:!!e.featureEnabled,requiredTier:"pro"===e.requiredTier||"team"===e.requiredTier||"enterprise"===e.requiredTier?e.requiredTier:"free",controls:{projectMode:"projectMode"in t&&("include"===t.projectMode||"exclude"===t.projectMode)?t.projectMode:"all",projects:Array.isArray(t.projects)?t.projects.filter(e=>"string"==typeof e):lg,contentMode:"contentMode"in t&&"metadata"===t.contentMode?"metadata":"full",excludeSensitive:"excludeSensitive"in t&&!!t.excludeSensitive},lastSyncAt:"string"==typeof e.lastSyncAt||null===e.lastSyncAt?e.lastSyncAt??null:null,device:{id:e.device&&"object"==typeof e.device&&"id"in e.device&&"string"==typeof e.device.id?e.device.id:"unknown",name:e.device&&"object"==typeof e.device&&"name"in e.device&&"string"==typeof e.device.name?e.device.name:"Unknown device",platform:e.device&&"object"==typeof e.device&&"platform"in e.device&&"string"==typeof e.device.platform?e.device.platform:"unknown"},queue:{pending:Number(r.pending??0),failed:Number(r.failed??0),synced:Number(r.synced??0),byKind:{audit:i("audit"),quarantine:i("quarantine"),memory:i("memory"),graph:i("graph"),unknown:i("unknown")},oldestPendingAt:"string"==typeof r.oldestPendingAt||null===r.oldestPendingAt?r.oldestPendingAt??null:null,nextRetryAt:"string"==typeof r.nextRetryAt||null===r.nextRetryAt?r.nextRetryAt??null:null,lastError:"string"==typeof r.lastError||null===r.lastError?r.lastError??null:null,lastErrorKind:"audit"===r.lastErrorKind||"quarantine"===r.lastErrorKind||"memory"===r.lastErrorKind||"graph"===r.lastErrorKind||"unknown"===r.lastErrorKind?r.lastErrorKind:null}}},refetchInterval:1e4})}function lb(e){let t=Math.max(0,Math.floor((Date.now()-new Date(e).getTime())/1e3));if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return`${i}d ago`}function lj(e){let t=Math.max(0,Math.floor((new Date(e).getTime()-Date.now())/1e3));if(t<60)return`in ${t}s`;let r=Math.floor(t/60);if(r<60)return`in ${r}m`;let n=Math.floor(r/60);if(n<24)return`in ${n}h`;let i=Math.floor(n/24);return`in ${i}d`}function lw(){let{data:e,isLoading:t}=lv(),r=(0,sr.useDashboardStore)(e=>e.setViewMode);if(t||!e)return null;let{enabled:n,apiKeySet:i,lastSyncAt:a,queue:s,device:o}=e,l=s.byKind.memory,c="disabled",u="Cloud sync disabled",d="Enable cloud sync with a Team+ key to replicate memories.";if(n&&i){let e=!!a&&Date.now()-new Date(a).getTime()>864e5;l.failed>0||s.failed>0?(c="warning",u="Cloud sync needs attention",d=s.lastError??"One or more sync jobs failed and need retry."):l.pending>0||s.pending>0?(c="queued",u=l.pending>0?"Memory sync queued":"Cloud sync queued",d=s.nextRetryAt?`Next retry ${lj(s.nextRetryAt)}`:"Waiting to flush queued sync jobs."):e?(c="warning",u="Cloud sync stale",d=a?`Last successful sync ${lb(a)}`:"No successful sync recorded yet."):(c="healthy",u="Cloud sync healthy",d=a?`Last successful sync ${lb(a)}`:"Connected and ready to sync.")}let h=function(e){switch(e){case"healthy":return{border:"border-emerald-500/20",bg:"bg-emerald-500/10",text:"text-emerald-300",icon:ld};case"queued":return{border:"border-amber-500/20",bg:"bg-amber-500/10",text:"text-amber-300",icon:lx};case"warning":return{border:"border-red-500/20",bg:"bg-red-500/10",text:"text-red-300",icon:oW};default:return{border:"border-slate-700",bg:"bg-slate-800/80",text:"text-slate-300",icon:ly}}}(c),f=h.icon;return(0,W.jsxs)("div",{className:`mb-4 rounded-xl border ${h.border} ${h.bg} p-4`,children:[(0,W.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,W.jsxs)("div",{className:"min-w-0",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(f,{size:16,className:h.text}),(0,W.jsx)("span",{className:`text-sm font-medium ${h.text}`,children:u})]}),(0,W.jsx)("p",{className:"mt-1 text-xs text-slate-400",children:d}),(0,W.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[11px] text-slate-500",children:[(0,W.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-900/70 px-2 py-1",children:[(0,W.jsx)(ly,{size:11}),o.name]}),a&&(0,W.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-900/70 px-2 py-1",children:[(0,W.jsx)(lm,{size:11}),"Synced ",lb(a)]}),s.oldestPendingAt&&(0,W.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-900/70 px-2 py-1",children:["Oldest queued ",lb(s.oldestPendingAt)]})]})]}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs sm:min-w-[260px]",children:[(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Memory queue"}),(0,W.jsx)("div",{className:"mt-1 text-lg font-semibold text-white",children:l.pending}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:"pending writes"})]}),(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Failed jobs"}),(0,W.jsx)("div",{className:`mt-1 text-lg font-semibold ${s.failed>0?"text-red-300":"text-white"}`,children:s.failed}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:"all payload kinds"})]}),(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Replicated"}),(0,W.jsx)("div",{className:"mt-1 text-lg font-semibold text-white",children:l.synced}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:"memory sync jobs"})]}),(0,W.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-950/70 p-3",children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Retrying next"}),(0,W.jsx)("div",{className:"mt-1 text-sm font-semibold text-white",children:s.nextRetryAt?lj(s.nextRetryAt):"Idle"}),(0,W.jsx)("div",{className:"text-[11px] text-slate-500",children:s.lastErrorKind?`${s.lastErrorKind} queue`:"no pending retry"})]})]})]}),(0,W.jsx)("div",{className:"mt-4 flex justify-end",children:(0,W.jsx)("button",{onClick:()=>r("cloud"),className:"rounded-lg border border-slate-700 bg-slate-950/70 px-3 py-2 text-xs font-medium text-slate-300 transition-colors hover:border-cyan-500/40 hover:text-white",children:"Open cloud diagnostics"})})]})}let lN=(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"}]]),lk=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function lS(e){let t=await (0,sa.authFetch)(`${lk}/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 lO(e){let t=await (0,sa.authFetch)(`${lk}/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 lP(){return(0,oI.useMutation)({mutationFn:e=>lS(e)})}async function lC(e){let t=await (0,sa.authFetch)(`${lk}/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 lE(e){let t=await (0,sa.authFetch)(`${lk}/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 lM(e){let t=await (0,sa.authFetch)(`${lk}/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 lA(){let e=lP(),{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)(oG,{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)(lN,{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)(oG,{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 lT=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function l_(){let e=await (0,sa.authFetch)(`${lT}/api/iron-dome/status`);if(!e.ok)throw Error("Failed to fetch Iron Dome status");return e.json()}async function lD(e){let t=await (0,sa.authFetch)(`${lT}/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 lI(){let e=await (0,sa.authFetch)(`${lT}/api/iron-dome/deactivate`,{method:"POST"});if(!e.ok)throw Error("Failed to deactivate Iron Dome");return e.json()}async function lz(e){let t=await (0,sa.authFetch)(`${lT}/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 lL(){let e=await (0,sa.authFetch)(`${lT}/api/iron-dome/emergency-stop`,{method:"POST"});if(!e.ok)throw Error("Failed to trigger emergency stop");return e.json()}async function lR(e){let t=await (0,sa.authFetch)(`${lT}/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 lF(){let e=await (0,sa.authFetch)(`${lT}/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)(`${lT}/api/iron-dome/audit?${t}`);if(!r.ok)throw Error("Failed to fetch Iron Dome audit");return r.json()}function lB(){return(0,si.useQuery)({queryKey:["iron-dome-status"],queryFn:l_,refetchInterval:3e4,retry:2})}function lU(e){return(0,si.useQuery)({queryKey:["iron-dome-audit",e],queryFn:()=>l$(e),refetchInterval:3e4,retry:2})}function lV(){let e=(0,oE.useQueryClient)();return(0,oI.useMutation)({mutationFn:lL,onSuccess:()=>{e.invalidateQueries({queryKey:["iron-dome-status"]}),e.invalidateQueries({queryKey:["iron-dome-audit"]}),e.invalidateQueries({queryKey:["control-status"]})}})}function lq(){let{data:e,isLoading:t}=lB(),{data:r}=lU(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 lK=[],lW="http://localhost:3001";function lH(){return(0,si.useQuery)({queryKey:["cloud-config"],queryFn:async()=>{var e;let t,r,n=await (0,sa.authFetch)(`${lW}/api/cloud/config`);if(!n.ok)throw Error("Failed to fetch cloud config");return t=(e=await n.json()).syncControls&&"object"==typeof e.syncControls?e.syncControls:{},r=e.openclawMemory&&"object"==typeof e.openclawMemory?e.openclawMemory:{},{enabled:!!e.enabled,apiKeySet:!!e.apiKeySet,baseUrl:"string"==typeof e.baseUrl?e.baseUrl:"https://api.shieldcortex.ai",syncControls:{projectMode:"projectMode"in t&&("include"===t.projectMode||"exclude"===t.projectMode)?t.projectMode:"all",projects:Array.isArray(t.projects)?t.projects.filter(e=>"string"==typeof e):lK,contentMode:"contentMode"in t&&"metadata"===t.contentMode?"metadata":"full",excludeSensitive:"excludeSensitive"in t&&!!t.excludeSensitive},openclawMemory:{autoMemory:"autoMemory"in r&&!!r.autoMemory,dedupe:"dedupe"in r&&!!r.dedupe,noveltyThreshold:"noveltyThreshold"in r&&"number"==typeof r.noveltyThreshold?r.noveltyThreshold:.88,maxRecent:"maxRecent"in r&&"number"==typeof r.maxRecent?r.maxRecent:300}}},refetchInterval:3e4})}function lY(){let e=(0,oE.useQueryClient)();return(0,oI.useMutation)({mutationFn:async e=>{let t=await (0,sa.authFetch)(`${lW}/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:()=>{e.invalidateQueries({queryKey:["cloud-config"]}),e.invalidateQueries({queryKey:["cloud-sync-status"]})}})}function lX(e,t,r){return Math.max(t,Math.min(r,e))}function lQ({initialAutoMemory:e,initialDedupe:t,initialNoveltyThreshold:r,initialMaxRecent:n}){let i=lY(),[a,s]=(0,H.useState)(e),[o,l]=(0,H.useState)(t),[c,u]=(0,H.useState)(String(r)),[d,h]=(0,H.useState)(String(n)),f=i.isPending;return(0,W.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Auto-memory extraction"}),(0,W.jsx)("button",{type:"button",onClick:()=>s(!a),className:`h-6 w-11 rounded-full transition-colors ${a?"bg-cyan-500":"bg-slate-700"}`,children:(0,W.jsx)("span",{className:`block h-5 w-5 rounded-full bg-white transition-transform ${a?"translate-x-5":"translate-x-0.5"}`})})]}),(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs text-slate-400",children:"Novelty dedupe"}),(0,W.jsx)("button",{type:"button",onClick:()=>l(!o),disabled:!a,className:`h-6 w-11 rounded-full transition-colors ${o&&a?"bg-emerald-500":"bg-slate-700"} ${!a?"opacity-50 cursor-not-allowed":""}`,children:(0,W.jsx)("span",{className:`block h-5 w-5 rounded-full bg-white transition-transform ${o&&a?"translate-x-5":"translate-x-0.5"}`})})]}),(0,W.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("label",{className:"block text-[11px] text-slate-500 mb-1",children:"Novelty threshold"}),(0,W.jsx)(ob,{type:"number",step:"0.01",min:.6,max:.99,value:c,disabled:!a||!o,onChange:e=>u(e.target.value),className:"h-8 text-xs bg-slate-800 border-slate-700"})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("label",{className:"block text-[11px] text-slate-500 mb-1",children:"Max recent records"}),(0,W.jsx)(ob,{type:"number",step:"1",min:50,max:1e3,value:d,disabled:!a||!o,onChange:e=>h(e.target.value),className:"h-8 text-xs bg-slate-800 border-slate-700"})]})]}),(0,W.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[(0,W.jsx)("span",{className:"text-[11px] text-slate-500",children:"Default: dedupe on, threshold 0.88, max 300"}),(0,W.jsxs)(ov,{size:"sm",onClick:()=>{let e=lX(Number.parseFloat(c),.6,.99),t=Math.floor(lX(Number.parseInt(d,10),50,1e3));i.mutate({openclawAutoMemory:a,openclawAutoMemoryDedupe:o,openclawAutoMemoryNoveltyThreshold:Number.isFinite(e)?e:.88,openclawAutoMemoryMaxRecent:Number.isFinite(t)?t:300})},disabled:f,className:"h-8 text-xs bg-cyan-600 hover:bg-cyan-500 text-white",children:[f?(0,W.jsx)(lu,{size:12,className:"animate-spin"}):null,"Save"]})]})]})}function lG(){let{data:e,isLoading:t}=lH(),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)(lQ,{initialAutoMemory:r?.autoMemory??!1,initialDedupe:r?.dedupe??!0,initialNoveltyThreshold:r?.noveltyThreshold??.88,initialMaxRecent:r?.maxRecent??300},n)]})}let lZ=(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"}]]);var lJ=e.i(13808);let l0=(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"}]]),l1=(0,oN.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),l2="https://api.shieldcortex.ai",l5=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",l4={free:"Free",pro:"Pro",team:"Team",enterprise:"Enterprise"},l3={free:"text-slate-400",pro:"text-cyan-400",team:"text-violet-400",enterprise:"text-amber-400"},l6={free:"bg-slate-400/10",pro:"bg-cyan-400/10",team:"bg-violet-400/10",enterprise:"bg-amber-400/10"},l8={pro:{label:"Pro",price:"£29/mo"},team:{label:"Team",price:"£99/mo"}},l7=["Custom injection patterns","Custom Iron Dome policies","Custom firewall rules","Audit export (JSON/CSV)","Skill scanner deep mode"];function l9(){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(`${l2}/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(`${l2}/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)(`${l5}/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)(lJ.Sparkles,{size:16,className:"text-cyan-400"})}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h3",{className:"text-sm font-semibold text-white",children:"Unlock Pro Features"}),(0,W.jsx)("p",{className:"text-[11px] text-slate-400 mt-0.5",children:"Your defence pipeline is fully active. Upgrade for advanced controls."})]})]}),(0,W.jsx)("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-slate-800 text-slate-400 border border-slate-700",children:"Free"})]}),(0,W.jsx)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5 mb-4",children:l7.map(e=>(0,W.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[(0,W.jsx)(l0,{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:[l8[e].label," — ",l8[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)(lZ,{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:l3[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 ${l3[y]} ${l6[y]}`,children:l4[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)(l1,{size:12}):(0,W.jsx)(o8,{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)(lN,{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 ${l3[e.requiredTier]} ${l6[e.requiredTier]}`,children:l4[e.requiredTier]})]},e.feature))}),(0,W.jsx)("button",{onClick:()=>{confirm(`Remove your ${l4[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 ce=(0,oN.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ct=(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"}]]),cr=(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"}]]),cn=(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 ci({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)(l0,{size:24,className:"text-slate-500 mb-2"}),(0,W.jsxs)("p",{className:"text-sm font-medium text-slate-300 mb-1",children:[l4[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 ",l4[a],(0,W.jsx)(lf,{size:10})]})]})]})}let ca=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",cs=[{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}],co=[{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}],cl=[{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}],cc=[{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"}],cu={"File access":45,"Network calls":30,"Process exec":15,"Memory write":10},cd=["Restrict filesystem writes to a sandboxed directory","Add explicit network permission declarations to SKILL.md"];function ch(){let e,t,r,n,{data:i,isLoading:a,isLocked:s}={...e=(0,si.useQuery)({queryKey:["firewall-rules"],queryFn:()=>(0,sa.gatedFetch)(`${ca}/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)(`${ca}/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)(`${ca}/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)(`${ca}/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)(cf,{}):(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)(ce,{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)(cn,{size:14,className:"text-cyan-400"}):(0,W.jsx)(cr,{size:14})}),(0,W.jsx)("button",{onClick:()=>c.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(ct,{size:12})})]},e.id))})]})}function cf(){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:cs.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 cp(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(ci,{feature:"custom_firewall_rules",label:"Add custom rules to control what gets blocked, allowed, or quarantined.",children:(0,W.jsx)(ch,{})})})}function cm(){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)(l9,{}),(0,W.jsx)(lw,{}),(0,W.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,W.jsx)(le,{timeRange:e}),(0,W.jsx)(lt,{}),(0,W.jsx)(lr,{timeRange:e}),(0,W.jsx)(ln,{timeRange:e})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(ll,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lA,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lq,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(lG,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(cp,{})}),(0,W.jsx)(lp,{})]})}let cx=(0,oN.default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),cy=(0,oN.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);function cg(e){let t=Math.max(0,Math.floor((Date.now()-new Date(e).getTime())/1e3));if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return`${i}d ago`}function cv(e){let t=Math.max(0,Math.floor((new Date(e).getTime()-Date.now())/1e3));if(t<60)return`in ${t}s`;let r=Math.floor(t/60);if(r<60)return`in ${r}m`;let n=Math.floor(r/60);if(n<24)return`in ${n}h`;let i=Math.floor(n/24);return`in ${i}d`}function cb(){let{data:e,isLoading:t}=lv(),{data:r}=o$();if(t||!e)return null;let n="border-slate-700 bg-slate-900/70 text-slate-200",i="Cloud sync disabled",a="Enable cloud sync and activate a Team licence to start replicating local data.",s=o0;return e.enabled&&e.apiKeySet&&!e.featureEnabled?(n="border-amber-500/30 bg-amber-500/10 text-amber-200",i="Cloud configured but licence locked",a=`Cloud sync requires the ${l4[e.requiredTier]} tier. Current tier: ${l4[r?.tier??"free"]}.`,s=cx):e.enabled&&e.apiKeySet&&e.queue.failed>0?(n="border-red-500/30 bg-red-500/10 text-red-200",i="Cloud sync needs attention",a=e.queue.lastError??"One or more queued sync jobs are failing.",s=cy):e.enabled&&e.apiKeySet&&e.queue.pending>0?(n="border-amber-500/30 bg-amber-500/10 text-amber-200",i="Cloud sync is catching up",a=e.queue.nextRetryAt?`Next retry ${cv(e.queue.nextRetryAt)}.`:"Queued jobs are waiting to flush.",s=lx):e.enabled&&e.apiKeySet&&(n="border-emerald-500/30 bg-emerald-500/10 text-emerald-200",i="Cloud sync healthy",a=e.lastSyncAt?`Last successful sync ${cg(e.lastSyncAt)}.`:"Connected and ready to sync.",s=ld),(0,W.jsx)("div",{className:`rounded-2xl border p-4 ${n}`,children:(0,W.jsxs)("div",{className:"flex items-start gap-3",children:[(0,W.jsx)(s,{size:18,className:"mt-0.5 shrink-0"}),(0,W.jsxs)("div",{children:[(0,W.jsx)("h2",{className:"text-sm font-semibold",children:i}),(0,W.jsx)("p",{className:"mt-1 text-sm opacity-90",children:a})]})]})})}function cj({label:e,value:t,detail:r,icon:n}){return(0,W.jsxs)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between",children:[(0,W.jsx)("span",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:e}),(0,W.jsx)(n,{size:15,className:"text-slate-500"})]}),(0,W.jsx)("div",{className:"mt-2 text-2xl font-semibold text-white",children:t}),(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:r})]})}function cw({label:e,pending:t,failed:r,synced:n}){return(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-3",children:[(0,W.jsx)("div",{className:"text-sm font-medium text-white",children:e}),(0,W.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Pending"}),(0,W.jsx)("div",{className:"mt-1 font-semibold text-amber-300",children:t})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Failed"}),(0,W.jsx)("div",{className:"mt-1 font-semibold text-red-300",children:r})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-slate-500",children:"Synced"}),(0,W.jsx)("div",{className:"mt-1 font-semibold text-emerald-300",children:n})]})]})]})}function cN(){let{data:e}=lH(),{data:t}=(0,si.useQuery)({queryKey:["cloud-projects"],queryFn:async()=>{let e=await (0,sa.authFetch)(`${lW}/api/cloud/projects`);if(!e.ok)throw Error("Failed to fetch cloud projects");return e.json()},staleTime:3e4}),r=lY(),[n,i]=(0,H.useState)(null),a=t?.projects??[],s=n??e?.syncControls??{projectMode:"all",projects:[],contentMode:"full",excludeSensitive:!1};async function o(){await r.mutateAsync({cloudSyncProjectMode:s.projectMode,cloudSyncProjects:s.projects,cloudSyncContentMode:s.contentMode,cloudSyncExcludeSensitive:s.excludeSensitive}),i(null)}return(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Sync Controls"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Decide what leaves this device before it hits the cloud replica."})]}),(0,W.jsx)("button",{type:"button",onClick:()=>void o(),disabled:r.isPending,className:"rounded-lg border border-cyan-500/30 bg-cyan-500/10 px-3 py-2 text-sm font-medium text-cyan-200 transition hover:bg-cyan-500/20 disabled:cursor-not-allowed disabled:opacity-50",children:r.isPending?"Saving...":"Save controls"})]}),(0,W.jsxs)("div",{className:"mt-5 grid gap-4",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Content mode"}),(0,W.jsxs)("div",{className:"mt-3 grid gap-2 md:grid-cols-2",children:[(0,W.jsxs)("label",{className:`rounded-lg border p-3 text-sm ${"full"===s.contentMode?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-800 text-slate-300"}`,children:[(0,W.jsx)("input",{type:"radio",className:"mr-2",checked:"full"===s.contentMode,onChange:()=>i(e=>({...e??s,contentMode:"full"}))}),"Full content",(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:"Titles and memory bodies replicate to cloud."})]}),(0,W.jsxs)("label",{className:`rounded-lg border p-3 text-sm ${"metadata"===s.contentMode?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-800 text-slate-300"}`,children:[(0,W.jsx)("input",{type:"radio",className:"mr-2",checked:"metadata"===s.contentMode,onChange:()=>i(e=>({...e??s,contentMode:"metadata"}))}),"Metadata only",(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:"Projects, tags, salience, and graph remain; body content is redacted."})]})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Project scope"}),(0,W.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:["all","include","exclude"].map(e=>(0,W.jsx)("button",{type:"button",onClick:()=>i(t=>({...t??s,projectMode:e})),className:`rounded-full border px-3 py-1.5 text-xs font-medium uppercase tracking-wide ${s.projectMode===e?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-700 bg-slate-900/60 text-slate-300"}`,children:e},e))}),(0,W.jsx)("p",{className:"mt-3 text-xs text-slate-400",children:"all"===s.projectMode?"All local projects are eligible for sync.":"include"===s.projectMode?"Only the selected projects will sync.":"Selected projects stay local-only."}),(0,W.jsx)("div",{className:"mt-3 max-h-48 overflow-y-auto rounded-lg border border-slate-800 bg-slate-900/40 p-3",children:0===a.length?(0,W.jsx)("div",{className:"text-xs text-slate-500",children:"No named projects found in local memory yet."}):(0,W.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>{let t=s.projects.includes(e.project);return(0,W.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.project,void i(e=>{let r=e??s,n=r.projects.includes(t)?r.projects.filter(e=>e!==t):[...r.projects,t].sort((e,t)=>e.localeCompare(t));return{...r,projects:n}})},className:`rounded-full border px-3 py-1.5 text-xs ${t?"border-cyan-500/40 bg-cyan-500/10 text-cyan-100":"border-slate-700 bg-slate-950/60 text-slate-300"}`,children:[e.project," ",(0,W.jsxs)("span",{className:"text-slate-500",children:["(",e.count,")"]})]},e.project)})})})]}),(0,W.jsxs)("label",{className:"flex items-start gap-3 rounded-xl border border-slate-800 bg-slate-950/60 p-4 text-sm text-slate-200",children:[(0,W.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:s.excludeSensitive,onChange:e=>i(t=>({...t??s,excludeSensitive:e.target.checked}))}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"font-medium text-white",children:"Exclude sensitive memories"}),(0,W.jsx)("div",{className:"mt-1 text-xs text-slate-400",children:"Skip memories whose sensitivity level is higher than INTERNAL when syncing to cloud."})]})]}),r.isError&&(0,W.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-200",children:r.error.message})]})]})}function ck(){let{data:e,isLoading:t}=lv(),{data:r,isLoading:n}=lH(),{data:i,isLoading:a}=o$();if(t||n||a||!e||!r||!i)return(0,W.jsx)("div",{className:"h-full overflow-y-auto p-6",children:(0,W.jsx)("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-6 text-sm text-slate-400",children:"Loading cloud diagnostics..."})});let s=i.tier,o=e.queue.byKind.memory,l=e.queue.byKind.graph,c=e.lastSyncAt?cg(e.lastSyncAt):"Never";return(0,W.jsx)("div",{className:"h-full overflow-y-auto bg-slate-950",children:(0,W.jsxs)("div",{className:"mx-auto flex max-w-7xl flex-col gap-6 p-6",children:[(0,W.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("h1",{className:"text-2xl font-semibold text-white",children:"Cloud Diagnostics"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Inspect local-to-cloud replication health, queue pressure, device identity, and Team licence gating."})]}),(0,W.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,W.jsx)("span",{className:`rounded-full px-2.5 py-1 font-medium ${l6[s]} ${l3[s]}`,children:l4[s]}),(0,W.jsxs)("span",{className:"rounded-full border border-slate-700 bg-slate-900/70 px-2.5 py-1 text-slate-300",children:["Last sync: ",c]})]})]}),(0,W.jsx)(cb,{}),(0,W.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,W.jsx)(cj,{label:"Device",value:e.device.name,detail:`${e.device.platform} \xb7 ${e.device.id.slice(0,12)}`,icon:ly}),(0,W.jsx)(cj,{label:"Cloud Target",value:new URL(e.baseUrl).host,detail:e.enabled?"Configured target":"Disabled in config",icon:o0}),(0,W.jsx)(cj,{label:"Memory Queue",value:o.pending,detail:`${o.failed} failed \xb7 ${o.synced} synced`,icon:oH}),(0,W.jsx)(cj,{label:"Graph Queue",value:l.pending,detail:`${l.failed} failed \xb7 ${l.synced} synced`,icon:oX})]}),(0,W.jsxs)("div",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[1.35fr_0.95fr]",children:[(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsx)("div",{className:"flex items-center justify-between gap-3",children:(0,W.jsxs)("div",{children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Queue Breakdown"}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Pending and failed sync jobs by payload type. This is the fastest way to spot whether memories or graph slices are backing up."})]})}),(0,W.jsxs)("div",{className:"mt-5 grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-4",children:[(0,W.jsx)(cw,{label:"Memory",...o}),(0,W.jsx)(cw,{label:"Graph",...l}),(0,W.jsx)(cw,{label:"Audit",...e.queue.byKind.audit}),(0,W.jsx)(cw,{label:"Quarantine",...e.queue.byKind.quarantine})]}),(0,W.jsx)("div",{className:"mt-5 overflow-hidden rounded-xl border border-slate-800",children:(0,W.jsxs)("table",{className:"min-w-full divide-y divide-slate-800 text-sm",children:[(0,W.jsx)("thead",{className:"bg-slate-950/70 text-slate-400",children:(0,W.jsxs)("tr",{children:[(0,W.jsx)("th",{className:"px-4 py-3 text-left font-medium",children:"Signal"}),(0,W.jsx)("th",{className:"px-4 py-3 text-left font-medium",children:"Current value"}),(0,W.jsx)("th",{className:"px-4 py-3 text-left font-medium",children:"Why it matters"})]})}),(0,W.jsxs)("tbody",{className:"divide-y divide-slate-800 bg-slate-900/40 text-slate-200",children:[(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Oldest queued job"}),(0,W.jsx)("td",{className:"px-4 py-3",children:e.queue.oldestPendingAt?cg(e.queue.oldestPendingAt):"None queued"}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"If this stays old while pending grows, the local worker is falling behind."})]}),(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Next retry"}),(0,W.jsx)("td",{className:"px-4 py-3",children:e.queue.nextRetryAt?cv(e.queue.nextRetryAt):"Idle"}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"Confirms whether failures are retrying normally or the queue is stuck."})]}),(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Failed jobs"}),(0,W.jsx)("td",{className:"px-4 py-3",children:e.queue.failed}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"A non-zero count usually means auth, network, or schema mismatch problems."})]}),(0,W.jsxs)("tr",{children:[(0,W.jsx)("td",{className:"px-4 py-3",children:"Latest memory sync"}),(0,W.jsx)("td",{className:"px-4 py-3",children:e.lastSyncAt?cg(e.lastSyncAt):"Not recorded"}),(0,W.jsx)("td",{className:"px-4 py-3 text-slate-400",children:"This is the best quick indicator for whether cloud replication is actually current."})]})]})]})})]}),(0,W.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,W.jsx)(cN,{}),(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Configuration"}),(0,W.jsxs)("div",{className:"mt-4 space-y-3 text-sm",children:[(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Cloud endpoint"}),(0,W.jsx)("div",{className:"mt-2 font-medium text-white",children:e.baseUrl})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Feature gate"}),(0,W.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[e.featureEnabled?(0,W.jsx)(ld,{size:16,className:"text-emerald-400"}):(0,W.jsx)(oW,{size:16,className:"text-amber-400"}),(0,W.jsx)("span",{className:"font-medium text-white",children:e.featureEnabled?"Team cloud sync enabled":`Requires ${l4[e.requiredTier]} tier`})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"Current sync policy"}),(0,W.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-slate-300",children:[(0,W.jsxs)("span",{children:["Projects: ",e.controls.projectMode]}),(0,W.jsxs)("span",{children:["Content: ",e.controls.contentMode]}),(0,W.jsxs)("span",{children:["Sensitive filter: ",e.controls.excludeSensitive?"Enabled":"Off"]}),(0,W.jsxs)("span",{children:["Selected projects: ",e.controls.projects.length]})]})]}),(0,W.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:[(0,W.jsx)("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:"OpenClaw complement"}),(0,W.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-slate-300",children:[(0,W.jsxs)("span",{children:["Auto-memory: ",r.openclawMemory.autoMemory?"On":"Off"]}),(0,W.jsxs)("span",{children:["Dedupe: ",r.openclawMemory.dedupe?"On":"Off"]}),(0,W.jsxs)("span",{children:["Novelty threshold: ",r.openclawMemory.noveltyThreshold]}),(0,W.jsxs)("span",{children:["Recent window: ",r.openclawMemory.maxRecent]})]})]})]})]}),(0,W.jsxs)("section",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-5",children:[(0,W.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Last actionable error"}),(0,W.jsx)("div",{className:"mt-4 rounded-xl border border-slate-800 bg-slate-950/60 p-4",children:e.queue.lastError?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-red-300",children:[(0,W.jsx)(oW,{size:16}),e.queue.lastErrorKind?`${e.queue.lastErrorKind} queue`:"Unknown queue"]}),(0,W.jsx)("p",{className:"mt-2 text-sm text-slate-300",children:e.queue.lastError}),e.queue.nextRetryAt&&(0,W.jsxs)("div",{className:"mt-3 inline-flex items-center gap-1 rounded-full bg-slate-900 px-2 py-1 text-xs text-slate-400",children:[(0,W.jsx)(lm,{size:12}),"Retry ",cv(e.queue.nextRetryAt)]})]}):(0,W.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-300",children:[(0,W.jsx)(ld,{size:16}),"No recent sync errors recorded."]})})]})]})]})]})})}let cS=(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"}]]),cO=(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"}]]),cP=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function cC(){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)(`${cP}/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)(cS,{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)(cO,{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)(cS,{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 cE(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(ci,{feature:"audit_export",label:"Export your full audit trail as JSON or CSV for compliance reporting.",children:(0,W.jsx)(cC,{})})})}let cM={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 cA(){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 ${cM[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)(cE,{})})]})}let cT={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"}},c_={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)"}},cD={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 cI(e){return e>=.7?"#22C55E":e>=.4?"#EAB308":"#EF4444"}function cz(e){return e>.5?"#EF4444":e>.2?"#EAB308":"#94a3b8"}function cL({entry:e,onClose:t,onViewMemory:r}){let[n,i]=(0,H.useState)(!1),a=cT[e.firewall_result]||cT.ALLOW,s=c_[e.sensitivity_level]||c_.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:cI(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:cI(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:cz(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:cz(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=cD[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 cR=(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"}]]),cF=(0,oN.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),c$=(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 cB({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 cU(){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)(cB,{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)(cR,{size:14,className:"text-cyan-400"}):g?(0,W.jsx)(c$,{size:14,className:"text-cyan-400"}):(0,W.jsx)(cF,{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)(cR,{size:14,className:"text-cyan-400"}):(0,W.jsx)(cF,{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 cV=(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"}]]),cq=(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 cK=e.i(22934);let cW=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function cH(e,t){let r=new URLSearchParams({timeRange:e});t&&r.set("project",t);let n=await (0,sa.authFetch)(`${cW}/api/v1/agents?${r}`);if(!n.ok)throw Error("Failed to fetch agent registry");return n.json()}async function cY(e,t,r){let n=encodeURIComponent(e),i=new URLSearchParams({timeRange:t});r&&i.set("project",r);let a=await (0,sa.authFetch)(`${cW}/api/v1/agents/${n}/timeline?${i}`);if(!a.ok)throw Error("Failed to fetch agent timeline");return a.json()}async function cX(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)(`${cW}/api/v1/agents/${r}/operations?${n}`);if(!i.ok)throw Error("Failed to fetch agent operations");return i.json()}function cQ(e,t){return(0,si.useQuery)({queryKey:["agent-operations",e,t],queryFn:()=>cX(e,t),enabled:!!e,refetchInterval:3e4,retry:2})}function cG(e){return e>=.7?"full":e>=.5?"limited":"restricted"}let cZ={full:"text-green-400",limited:"text-yellow-400",restricted:"text-red-400"},cJ={full:"bg-green-500/10",limited:"bg-yellow-500/10",restricted:"bg-red-500/10"},c0={full:"Full Access",limited:"Limited",restricted:"Restricted"},c1=460,c2=90;function c5({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:()=>cY(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*c1,s=e=>10+(1-e)*c2,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)*c2,x2:30+c1,y2:10+(1-.7)*c2,stroke:"#22c55e",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,W.jsx)("line",{x1:30,y1:10+.5*c2,x2:30+c1,y2:10+.5*c2,stroke:"#eab308",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,W.jsx)("text",{x:26,y:10+(1-.7)*c2+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.7"}),(0,W.jsx)("text",{x:26,y:10+.5*c2+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+c2+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 c4={BLOCK:"text-red-400 bg-red-500/10",QUARANTINE:"text-yellow-400 bg-yellow-500/10"};function c3({identifier:e}){let{data:t,isLoading:r}=cQ(e,{firewallResult:"BLOCK",limit:20}),{data:n}=cQ(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 ${c4[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 c6=(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"}]]),c8=Y.default.env.NEXT_PUBLIC_WS_URL||"ws://localhost:3001/ws/events";function c7({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(c8);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)(c6,{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 c9({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)(cK.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 ue({score:e}){let t=cG(e);return(0,W.jsxs)("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium ${cZ[t]} ${cJ[t]}`,children:[e.toFixed(2)," · ",c0[t]]})}function ut({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 ur(){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:()=>cH(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=>cG(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]),j=(0,H.useMemo)(()=>[...new Set(g.map(e=>e.source_type))],[g]),w=e=>{a===e?l(!o):(s(e),l(!1))};return(0,W.jsxs)("div",{className:"flex h-full",children:[(0,W.jsxs)("div",{className:`${n?"w-1/2":"w-full"} border-r border-slate-800 flex flex-col`,children:[(0,W.jsxs)("div",{className:"p-3 border-b border-slate-800 flex items-center justify-between",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2",children:[(0,W.jsx)(oQ,{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)(cV,{size:12,className:"text-slate-500"}),j.map(e=>(0,W.jsx)("button",{onClick:()=>u(c===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${c===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,W.jsx)("span",{className:"text-slate-700",children:"|"}),["full","limited","restricted"].map(e=>(0,W.jsx)("button",{onClick:()=>h(d===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${d===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,W.jsx)("span",{className:"text-slate-700",children:"|"}),(0,W.jsxs)("button",{onClick:()=>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:()=>w("avg_trust_score"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Trust ",(0,W.jsx)(cq,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>w("operation_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Ops ",(0,W.jsx)(cq,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>w("flagged_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Flagged ",(0,W.jsx)(cq,{size:8})]}),(0,W.jsxs)("button",{onClick:()=>w("last_seen"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Last seen ",(0,W.jsx)(cq,{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)(c9,{identifier:e.source_identifier,compact:!0}),(0,W.jsx)("div",{className:"mt-0.5",children:(0,W.jsx)(ut,{type:e.source_type})})]}),(0,W.jsx)(ue,{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)(c9,{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)(ut,{type:n.source_type}),(0,W.jsx)(ue,{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)(c5,{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)(c3,{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)(c7,{agentFilter:n.source_identifier})]})]})})]})}let un=(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"}]]),ui={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 ua({level:e}){let t=ui[e]??ui.low;return(0,W.jsx)("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${t}`,children:e.toUpperCase()})}function us({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)(ua,{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 uo(e){let t=e.split(/[/\\]/);return t[t.length-1]||e}function ul({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)(un,{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)(lN,{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||uo(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)(ua,{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)(o8,{size:14,className:"text-slate-500 shrink-0"}):(0,W.jsx)(cK.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)(un,{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)(ct,{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||uo(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)(us,{findings:e.findings})})]})}function uc({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)(ul,{file:e,cloudConnected:t,onTrust:r,onUntrust:n,onRemove:i,onCloudUpsell:a},e.path))})}var uu=e.i(6847);let ud=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function uh(){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)(`${ud}/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)(uf,{}):(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)(oG,{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)(uu.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 uf(){return(0,W.jsxs)("div",{className:"space-y-3",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)("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"}),cc.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(cu).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:cd.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 up(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(ci,{feature:"skill_scanner_deep",label:"Deep skill scanning with multi-file analysis and semantic intent detection.",children:(0,W.jsx)(uh,{})})})}let um=[{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 ux(){let e=lP(),t=(0,oI.useMutation)({mutationFn:lO}),r=(0,oI.useMutation)({mutationFn:lC}),n=(0,oI.useMutation)({mutationFn:lE}),i=(0,oI.useMutation)({mutationFn:lM}),{data:a}=lH(),[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)(oG,{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)(o0,{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)(uc,{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)(oG,{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)(o8,{size:14}):(0,W.jsx)(cK.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:um.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)(oG,{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)(ua,{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)(us,{findings:l.findings})]})]})]}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(up,{})})]})}let uy=(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"}]]),ug=(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"}]]),uv=(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"}]]),ub=(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"}]]),uj=(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"}]]),uw=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function uN(){let e,t,r,{data:n,isLoading:i,isLocked:a}={...e=(0,si.useQuery)({queryKey:["custom-patterns"],queryFn:()=>(0,sa.gatedFetch)(`${uw}/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)(`${uw}/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)(`${uw}/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)(`${uw}/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)(uk,{}):(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)(ce,{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)(uj,{size:12})}),(0,W.jsx)("button",{onClick:()=>o.mutate(e.id),className:"text-slate-500 hover:text-red-400",children:(0,W.jsx)(ct,{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 uk(){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:co.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 uS(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(ci,{feature:"custom_injection_patterns",label:"Define up to 50 custom regex patterns for detecting domain-specific threats.",children:(0,W.jsx)(uN,{})})})}let uO=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function uP(){let e,t,r,n,{data:i,isLoading:a,isLocked:s}={...e=(0,si.useQuery)({queryKey:["custom-policies"],queryFn:()=>(0,sa.gatedFetch)(`${uO}/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)(`${uO}/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)(`${uO}/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)(`${uO}/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)(uC,{}):(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)(ce,{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)(ct,{size:12})})]},e.id))})]})}function uC(){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:cl.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 uE(){return(0,W.jsx)("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-4",children:(0,W.jsx)(ci,{feature:"custom_iron_dome_policies",label:"Create custom Iron Dome policies with tailored action gates and trust levels.",children:(0,W.jsx)(uP,{})})})}let uM=[{id:"personal",label:"Personal",description:"Lighter touch for solo use",icon:oq},{id:"enterprise",label:"Enterprise",description:"Financial & data protection",icon:l0},{id:"school",label:"School",description:"GDPR strict, pupil data guarded",icon:oQ},{id:"paranoid",label:"Paranoid",description:"Everything requires approval",icon:oW}],uA=[{name:"Injection Scanner",description:"40+ patterns across 8 categories",icon:uv},{name:"Instruction Gateway",description:"Trusted channel validation",icon:uy},{name:"Action Gate",description:"Approve / block external actions",icon:l0},{name:"PII Guard",description:"Block sensitive data output",icon:o3},{name:"Kill Switch",description:"Emergency stop phrase",icon:ug},{name:"Sub-Agent Control",description:"Restrict spawned agent operations",icon:oQ}],uT={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"},u_={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 uD(){let e,t,r,{data:n,isLoading:i}=lB(),{data:a}=lU(50),s=(e=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>lD(e),onSuccess:()=>{e.invalidateQueries({queryKey:["iron-dome-status"]}),e.invalidateQueries({queryKey:["iron-dome-audit"]})}})),o=(t=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:lI,onSuccess:()=>{t.invalidateQueries({queryKey:["iron-dome-status"]})}})),l=(0,oI.useMutation)({mutationFn:lz}),c=lV(),u=(r=(0,oE.useQueryClient)(),(0,oI.useMutation)({mutationFn:e=>lR(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:lF,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,j=n?.profile,w=n?.config,N=a?.logs??[],k=N.filter(e=>"BLOCK"===e.firewall_result).length,S=N.filter(e=>"ALLOW"===e.firewall_result).length;return(0,W.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,W.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,W.jsxs)("div",{className:"flex items-center gap-3",children:[(0,W.jsx)(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)(ug,{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:uM.map(({id:e,label:t,description:r,icon:n})=>(0,W.jsxs)("button",{onClick:()=>{s.mutate(e)},disabled:s.isPending,className:`text-left p-3 rounded-lg border transition-colors ${j===e?"border-red-500/50 bg-red-500/10 text-red-400":"border-slate-700 bg-slate-800/50 text-slate-400 hover:border-slate-600"}`,children:[(0,W.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,W.jsx)(n,{size:12}),(0,W.jsx)("span",{className:"text-xs font-medium",children:t})]}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500",children:r})]},e))})]}),(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-3",children:"Module Status"}),(0,W.jsx)("div",{className:"space-y-2",children:uA.map(({name:e,description:t,icon:r})=>(0,W.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg bg-slate-800/50",children:[(0,W.jsx)(r,{size:14,className:g?"text-red-400":"text-slate-600"}),(0,W.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,W.jsx)("div",{className:"text-xs font-medium text-slate-300",children:e}),(0,W.jsx)("div",{className:"text-[10px] text-slate-500 truncate",children:t})]}),(0,W.jsx)("span",{className:`w-2 h-2 rounded-full ${g?"bg-red-400":"bg-slate-600"}`})]},e))})]})]}),g&&w&&(0,W.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4 mb-6",children:[(0,W.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-3",children:"Active Configuration"}),(0,W.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-1",children:"Trusted Channels"}),(0,W.jsx)("div",{className:"flex flex-wrap gap-1",children:w.trustedChannels.map(e=>(0,W.jsx)("span",{className:"px-1.5 py-0.5 bg-slate-800 rounded text-slate-400",children:e},e))})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-1",children:"Requires Approval"}),(0,W.jsx)("div",{className:"flex flex-wrap gap-1",children:w.requireApproval.map(e=>(0,W.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500/10 border border-red-500/20 rounded text-red-400",children:e},e))})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-1",children:"Kill Phrase"}),(0,W.jsx)("span",{className:"px-1.5 py-0.5 bg-slate-800 rounded text-slate-400 font-mono",children:w.killPhrase})]})]})]}),v?(0,W.jsxs)("div",{className:"bg-red-950/50 border-2 border-red-500/50 rounded-xl p-5 mb-6 animate-pulse-slow",children:[(0,W.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,W.jsx)(ub,{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)(uj,{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)(ub,{size:14,className:"text-orange-400"}),(0,W.jsx)("h3",{className:"text-sm font-medium text-orange-300",children:"Emergency Stop"})]}),(0,W.jsx)("p",{className:"text-xs text-slate-400 mb-3",children:"Immediately halts your agent when you suspect it has been compromised or is acting on poisoned data. Blocks ALL operations — no reads, writes, or modifications. Iron Dome stays active."}),w?.killPhrase&&(0,W.jsxs)("p",{className:"text-[10px] text-slate-500 mb-3",children:["Kill phrase: ",(0,W.jsxs)("span",{className:"font-mono text-slate-400",children:['"',w.killPhrase,'"']})," — say this in conversation for hands-free stop"]}),(0,W.jsxs)("button",{onClick:()=>c.mutate(),disabled:c.isPending,className:"flex items-center gap-1.5 px-4 py-2 bg-red-600 hover:bg-red-500 disabled:opacity-50 rounded-lg text-xs font-bold text-white uppercase tracking-wider transition-colors",children:[c.isPending?(0,W.jsx)(lu,{size:12,className:"animate-spin"}):(0,W.jsx)(ub,{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)(uv,{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)(lN,{size:14,className:"text-red-400"}),(0,W.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${u_[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 ${uT[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)(uS,{})}),(0,W.jsx)("div",{className:"mt-4",children:(0,W.jsx)(uE,{})})]})}let uI=Y.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",uz={architecture:"#3b82f6",error:"#ef4444",pattern:"#8b5cf6",preference:"#f59e0b",learning:"#10b981",context:"#6366f1",todo:"#f97316",note:"#94a3b8",relationship:"#ec4899",custom:"#64748b"},uL={short_term:"STM",long_term:"LTM",episodic:"Episodic"},uR={short_term:"#22d3ee",long_term:"#a78bfa",episodic:"#f472b6"},uF=["architecture","pattern","preference","error","context","learning","todo","note","relationship","custom"],u$=[{label:"All",value:"all"},{label:"STM",value:"short_term"},{label:"LTM",value:"long_term"},{label:"Episodic",value:"episodic"}];function uB(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function uU({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)(`${uI}/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=uB(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=uB(t.toISOString()),n=new Date(t);n.setDate(n.getDate()-1);let i=uB(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"}),u$.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"}),uF.map(e=>{let t=o.has(e),r=uz[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=uz[e.category]??"#64748b",s=uR[e.type]??"#94a3b8",o=uL[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))]})})]})}var uV=Symbol.for("immer-nothing"),uq=Symbol.for("immer-draftable"),uK=Symbol.for("immer-state");function uW(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var uH=Object,uY=uH.getPrototypeOf,uX="constructor",uQ="prototype",uG="configurable",uZ="enumerable",uJ="writable",u0="value",u1=e=>!!e&&!!e[uK];function u2(e){return!!e&&(u3(e)||dt(e)||!!e[uq]||!!e[uX]?.[uq]||dr(e)||dn(e))}var u5=uH[uQ][uX].toString(),u4=new WeakMap;function u3(e){if(!e||!di(e))return!1;let t=uY(e);if(null===t||t===uH[uQ])return!0;let r=uH.hasOwnProperty.call(t,uX)&&t[uX];if(r===Object)return!0;if(!da(r))return!1;let n=u4.get(r);return void 0===n&&(n=Function.toString.call(r),u4.set(r,n)),n===u5}function u6(e,t,r=!0){0===u8(e)?(r?Reflect.ownKeys(e):uH.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function u8(e){let t=e[uK];return t?t.type_:dt(e)?1:dr(e)?2:3*!!dn(e)}var u7=(e,t,r=u8(e))=>2===r?e.has(t):uH[uQ].hasOwnProperty.call(e,t),u9=(e,t,r=u8(e))=>2===r?e.get(t):e[t],de=(e,t,r,n=u8(e))=>{2===n?e.set(t,r):3===n?e.add(r):e[t]=r},dt=Array.isArray,dr=e=>e instanceof Map,dn=e=>e instanceof Set,di=e=>"object"==typeof e,da=e=>"function"==typeof e,ds=e=>e.modified_?e.copy_:e.base_;function dl(e,t){if(dr(e))return new Map(e);if(dn(e))return new Set(e);if(dt(e))return Array[uQ].slice.call(e);let r=u3(e);if(!0!==t&&("class_only"!==t||r)){let t=uY(e);if(null!==t&&r)return{...e};let n=uH.create(t);return uH.assign(n,e)}{let t=uH.getOwnPropertyDescriptors(e);delete t[uK];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){let i=r[n],a=t[i];!1===a[uJ]&&(a[uJ]=!0,a[uG]=!0),(a.get||a.set)&&(t[i]={[uG]:!0,[uJ]:!0,[uZ]:a[uZ],[u0]:e[i]})}return uH.create(uY(e),t)}}function dc(e,t=!1){return dd(e)||u1(e)||!u2(e)||(u8(e)>1&&uH.defineProperties(e,{set:du,add:du,clear:du,delete:du}),uH.freeze(e),t&&u6(e,(e,t)=>{dc(t,!0)},!1)),e}var du={[u0]:function(){uW(2)}};function dd(e){return!(null!==e&&di(e))||uH.isFrozen(e)}var dh="MapSet",df="Patches",dp="ArrayMethods",dm={};function dx(e){let t=dm[e];return t||uW(0,e),t}var dy=e=>!!dm[e];function dg(e,t){t&&(e.patchPlugin_=dx(df),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function dv(e){db(e),e.drafts_.forEach(dw),e.drafts_=null}function db(e){e===p&&(p=e.parent_)}var dj=e=>p={drafts_:[],parent_:p,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:dy(dh)?dx(dh):void 0,arrayMethodsPlugin_:dy(dp)?dx(dp):void 0};function dw(e){let t=e[uK];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function dN(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(void 0!==e&&e!==r){r[uK].modified_&&(dv(t),uW(4)),u2(e)&&(e=dk(t,e));let{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[uK].base_,e,t)}else e=dk(t,r);return function(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dc(t,r)}(t,e,!0),dv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==uV?e:void 0}function dk(e,t){if(dd(t))return t;let r=t[uK];if(!r)return dM(t,e.handledSet_,e);if(!dO(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);dE(r,e)}return r.copy_}function dS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dO=(e,t)=>e.scope_===t,dP=[];function dC(e,t,r,n){let i=e.copy_||e.base_,a=e.type_;if(void 0!==n&&u9(i,n,a)===t)return void de(i,n,r,a);if(!e.draftLocations_){let t=e.draftLocations_=new Map;u6(i,(e,r)=>{if(u1(r)){let n=t.get(r)||[];n.push(e),t.set(r,n)}})}for(let n of e.draftLocations_.get(t)??dP)de(i,n,r,a)}function dE(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)}dS(e)}}function dM(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||u1(e)||t.has(e)||!u2(e)||dd(e)||(t.add(e),u6(e,(n,i)=>{if(u1(i)){let t=i[uK];dO(t,r)&&(de(e,n,ds(t),e.type_),dS(t))}else u2(i)&&dM(i,t,r)})),e}var dA={get(e,t){let r;if(t===uK)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(!u7(a,t,e.type_)){var s;let r;return s=e,(r=dD(a,t))?u0 in r?r[u0]:r.get?.call(s.draft_):void 0}let o=a[t];if(e.finalized_||!u2(o)||i&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(r=+t)&&String(r)===t)return o;if(o===d_(e.base_,t)){dz(e);let r=1===e.type_?+t:t,n=dL(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=dD(e.copy_||e.base_,t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=d_(e.copy_||e.base_,t),i=n?.[uK];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||u7(e.base_,t,e.type_)))return!0;dz(e),dI(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(u1(r)){let i=r[uK];dO(i,n)&&i.callbacks_.push(function(){dz(e),dC(e,r,ds(i),t)})}else u2(r)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(r)&&dM(r,n.handledSet_,n):u9(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&dM(u9(e.copy_,t,e.type_),n.handledSet_,n)})}(e,t,r),!0)},deleteProperty:(e,t)=>(dz(e),void 0!==d_(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),dI(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?{[uJ]:!0,[uG]:1!==e.type_||"length"!==t,[uZ]:n[uZ],[u0]:r[t]}:n},defineProperty(){uW(11)},getPrototypeOf:e=>uY(e.base_),setPrototypeOf(){uW(12)}},dT={};for(let e in dA){let t=dA[e];dT[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function d_(e,t){let r=e[uK];return(r?r.copy_||r.base_:e)[t]}function dD(e,t){if(!(t in e))return;let r=uY(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=uY(r)}}function dI(e){!e.modified_&&(e.modified_=!0,e.parent_&&dI(e.parent_))}function dz(e){e.copy_||(e.assigned_=new Map,e.copy_=dl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function dL(e,t,r,n){let[i,a]=dr(t)?dx(dh).proxyMap_(t,r):dn(t)?dx(dh).proxySet_(t,r):function(e,t){let r=dt(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=dA;r&&(i=[n],a=dT);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||!dO(a,e))return;e.mapSetPlugin_?.fixSetContents(a);let t=ds(a);dC(r,a.draft_??a,t,n),dE(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 dR(e){return u1(e)||uW(10,e),function e(t){let r;if(!u2(t)||dd(t))return t;let n=t[uK],i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=dl(t,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=dl(t,!0);return u6(r,(t,n)=>{de(r,t,e(n))},i),n&&(n.finalized_=!1),r}(e)}dT.deleteProperty=function(e,t){return dT.set.call(this,e,t,void 0)},dT.set=function(e,t,r){return dA.set.call(this,e[0],t,r,e[0])};var dF=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{let n;if(da(e)&&!da(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(da(t)||uW(6),void 0===r||da(r)||uW(7),u2(e)){let i=dj(this),a=dL(i,e,void 0),s=!0;try{n=t(a),s=!1}finally{s?dv(i):db(i)}return dg(i,r),dN(n,i)}if(e&&di(e))uW(1,e);else{if(void 0===(n=t(e))&&(n=e),n===uV&&(n=void 0),this.autoFreeze_&&dc(n,!0),r){let t=[],i=[];dx(df).generateReplacementPatches_(e,n,{patches_:t,inversePatches_:i}),r(t,i)}return n}},this.produceWithPatches=(e,t)=>{let r,n;return da(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){u2(e)||uW(8),u1(e)&&(e=dR(e));let t=dj(this),r=dL(t,e,void 0);return r[uK].isManual_=!0,db(t),r}finishDraft(e,t){let r=e&&e[uK];r&&r.isManual_||uW(9);let{scope_:n}=r;return dg(n,t),dN(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=dx(df).applyPatches_;return u1(e)?n(e,t):this.produce(e,e=>n(e,t))}}().produce,d$=e=>Array.isArray(e)?e:[e],dB=0,dU=class{revision=dB;_value;_lastValue;_isEqual=dV;constructor(e,t=dV){this._value=this._lastValue=e,this._isEqual=t}get value(){return this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++dB)}};function dV(e,t){return e===t}function dq(e){return e instanceof dU||console.warn("Not a valid cell! ",e),e.value}var dK=(e,t)=>!1;function dW(){return function(e,t=dV){return new dU(null,t)}(0,dK)}var dH=e=>{let t=e.collectionTag;null===t&&(t=e.collectionTag=dW()),dq(t)};Symbol();var dY=0,dX=Object.getPrototypeOf({}),dQ=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,dG);tag=dW();tags={};children={};collectionTag=null;id=dY++},dG={get:(e,t)=>(function(){let{value:r}=e,n=Reflect.get(r,t);if("symbol"==typeof t||t in dX)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 dZ(i):new dQ(i)),r.tag&&dq(r.tag),r.proxy}{let r=e.tags[t];return void 0===r&&((r=e.tags[t]=dW()).value=n),dq(r),n}})(),ownKeys:e=>(dH(e),Reflect.ownKeys(e.value)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e.value,t),has:(e,t)=>Reflect.has(e.value,t)},dZ=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],dJ);tag=dW();tags={};children={};collectionTag=null;id=dY++},dJ={get:([e],t)=>("length"===t&&dH(e),dG.get(e,t)),ownKeys:([e])=>dG.ownKeys(e),getOwnPropertyDescriptor:([e],t)=>dG.getOwnPropertyDescriptor(e,t),has:([e],t)=>dG.has(e,t)},d0="u">typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function d1(){return{s:0,v:void 0,o:null,p:null}}function d2(e,t={}){let r,n=d1(),{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=d1(),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=d1(),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 d0(t):t}return l.s=1,l.v=t,t}return s.clearCache=()=>{n=d1(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}var d5=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=d2,argsMemoizeOptions:d=[],devModeChecks:h={}}={...r,...s},f=d$(c),p=d$(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}(d2),d4=Object.assign((e,t=d5)=>{!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:()=>d4});function d3(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 d6="function"==typeof Symbol&&Symbol.observable||"@@observable",d8=()=>Math.random().toString(36).substring(7).split("").join("."),d7={INIT:`@@redux/INIT${d8()}`,REPLACE:`@@redux/REPLACE${d8()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${d8()}`};function d9(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 he(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:d7.INIT}))throw Error(d3(12));if(void 0===t(void 0,{type:d7.PROBE_UNKNOWN_ACTION()}))throw Error(d3(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(d3(14));s[o]=u,a=a||u!==c}return(a=a||i.length!==Object.keys(e).length)?s:e}}function ht(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function hr(e){return d9(e)&&"type"in e&&"string"==typeof e.type}function hn(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var hi=hn(),ha="u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?ht:ht.apply(null,arguments)};function hs(e,t){function r(...n){if(t){let r=t(...n);if(!r)throw Error(hX(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=>hr(t)&&t.type===e,r}"u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var ho=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 hl(e){return u2(e)?dF(e,()=>{}):e}function hc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var hu="RTK_autoBatch",hd=()=>e=>({payload:e,meta:{[hu]:!0}}),hh=e=>t=>{setTimeout(t,e)},hf=(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:hh(10):"callback"===e.type?e.queueNotification:hh(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?.[hu]))&&!s&&(s=!0,l(c)),n.dispatch(e)}finally{i=!0}}})};function hp(e){let t,r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw Error(hX(28));if(n in r)throw Error(hX(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 hm=Symbol.for("rtk-slice-createasyncthunk"),hx=((d=hx||{}).reducer="reducer",d.reducerWithPrepare="reducerWithPrepare",d.asyncThunk="asyncThunk",d),hy=function({creators:e}={}){let t=e?.asyncThunk?.[hm];return function(e){let r,{name:n,reducerPath:i=n}=e;if(!n)throw Error(hX(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(hX(12));if(r in l)throw Error(hX(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?hp(e.extraReducers):[e.extraReducers],i={...t,...l};return function(e,t){let r,[n,i,a]=hp(t);if("function"==typeof e)r=()=>hl(e());else{let t=hl(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(u1(e)){let n=r(e,t);return void 0===n?e:n}else{if(u2(e))return dF(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(hX(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||hg,pending:o||hg,rejected:l||hg,settled:c||hg})}(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(hX(17));a=n.reducer,s=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?hs(e,s):hs(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=hc(m,n,y)),i}function i(t=f){let n=hc(p,r,()=>new WeakMap);return hc(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,()=>hc(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 hg(){}var hv="listener",hb="completed",hj="cancelled",hw=`task-${hj}`,hN=`task-${hb}`,hk=`${hv}-${hj}`,hS=`${hv}-${hb}`,hO=class{constructor(e){this.code=e,this.message=`task ${hj} (reason: ${e})`}name="TaskAbortError";message},hP=(e,t)=>{if("function"!=typeof e)throw TypeError(hX(32))},hC=()=>{},hE=(e,t=hC)=>(e.catch(t),e),hM=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),hA=e=>{if(e.aborted)throw new hO(e.reason)};function hT(e,t){let r=hC;return new Promise((n,i)=>{let a=()=>i(new hO(e.reason));e.aborted?a():(r=hM(e,a),t.finally(()=>r()).then(n,i))}).finally(()=>{r=hC})}var h_=async(e,t)=>{try{await Promise.resolve();let t=await e();return{status:"ok",value:t}}catch(e){return{status:e instanceof hO?"cancelled":"rejected",error:e}}finally{t?.()}},hD=e=>t=>hE(hT(e,t).then(t=>(hA(e),t))),hI=e=>{let t=hD(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:hz}=Object,hL={},hR="listenerMiddleware",hF=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=hs(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(i);else throw Error(hX(21));return hP(a,"options.listener"),{predicate:i,type:t,effect:a}},h$=hz(e=>{let{type:t,predicate:r,effect:n}=hF(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(hX(22))}}},{withTypes:()=>h$}),hB=(e,t)=>{let{type:r,effect:n,predicate:i}=hF(t);return Array.from(e.values()).find(e=>("string"==typeof r?e.type===r:e.predicate===i)&&e.effect===n)},hU=e=>{e.pending.forEach(e=>{e.abort(hk)})},hV=(e,t,r)=>{try{e(t,r)}catch(e){setTimeout(()=>{throw e},0)}},hq=hz(hs(`${hR}/add`),{withTypes:()=>hq}),hK=hs(`${hR}/removeAll`),hW=hz(hs(`${hR}/remove`),{withTypes:()=>hW}),hH=(...e)=>{console.error(`${hR}/error`,...e)},hY=(e={})=>{let t=new Map,r=new Map,{extra:n,onError:i=hH}=e;hP(i,"onError");let a=e=>{var r;return(r=hB(t,e)??h$(e)).unsubscribe=()=>t.delete(r.id),t.set(r.id,r),e=>{r.unsubscribe(),e?.cancelActive&&hU(r)}};hz(a,{withTypes:()=>a});let s=e=>{let r=hB(t,e);return r&&(r.unsubscribe(),e.cancelActive&&hU(r)),!!r};hz(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)=>{hA(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 hT(c,Promise.race(n));return hA(c),e}finally{r()}},(e,t)=>hE(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,hz({},o,{getOriginalState:l,condition:(e,t)=>f(e,t).then(Boolean),take:f,delay:hI(h.signal),pause:hD(h.signal),extra:n,signal:h.signal,fork:(u=h.signal,(e,t)=>{hP(e,"taskExecutor");let r=new AbortController;hM(u,()=>r.abort(u.reason));let n=h_(async()=>{hA(u),hA(r.signal);let t=await e({pause:hD(r.signal),delay:hI(r.signal),signal:r.signal});return hA(r.signal),t},()=>r.abort(hN));return t?.autoJoin&&p.push(n.catch(hC)),{result:hD(u)(n),cancel(){r.abort(hw)}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,r)=>{e!==h&&(e.abort(hk),r.delete(e))})},cancel:()=>{h.abort(hk),e.pending.delete(h)},throwIfCancelled:()=>{hA(h.signal)}})))}catch(e){e instanceof hO||hV(i,e,{raisedBy:"effect"})}finally{let t;await Promise.all(p),h.abort(hS),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())hU(e);t.clear()};return{middleware:e=>r=>n=>{let c;if(!hr(n))return r(n);if(hq.match(n))return a(n.payload);if(hK.match(n))return void l();if(hW.match(n))return s(n.payload);let u=e.getState(),d=()=>{if(u===hL)throw Error(hX(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,hV(i,e,{raisedBy:"predicate"})}t&&o(a,n,e,d)}}}finally{u=hL}return c},startListening:a,stopListening:s,clearListeners:l}};function hX(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 hQ=e.i(78712);function hG(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 hZ(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+hG(i)+t:e+t},"")}var hJ=e=>0===e?0:e>0?1:-1,h0=e=>"number"==typeof e&&e!=+e,h1=e=>"string"==typeof e&&e.indexOf("%")===e.length-1,h2=e=>("number"==typeof e||e instanceof Number)&&!h0(e),h5=e=>h2(e)||"string"==typeof e,h4=0,h3=e=>{var t=++h4;return"".concat(e||"").concat(t)},h6=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(!h2(e)&&"string"!=typeof e)return n;if(h1(e)){if(null==t)return n;var a=e.indexOf("%");r=t*parseFloat(e.slice(0,a))/100}else r=+e;return h0(r)&&(r=n),i&&null!=t&&r>t&&(r=t),r},h8=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 h7(e,t,r){return h2(e)&&h2(t)?hG(e+r*(t-e)):t}var h9=e=>null==e?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function fe(e){return null!=e}function ft(){}var fr=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!h0(r))return e[r]}},fn=hy({name:"options",initialState:{chartName:"",tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},reducers:{createEventEmitter:e=>{null==e.eventEmitter&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),fi=fn.reducer,{createEventEmitter:fa}=fn.actions,fs=(e.i(8710),{notify(){},get:()=>[]}),fo="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,fl="u">typeof navigator&&"ReactNative"===navigator.product,fc=fo||fl?H.useLayoutEffect:H.useEffect;function fu(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}var fd=Symbol.for("react-redux-context"),fh="u">typeof globalThis?globalThis:{},ff=function(){if(!H.createContext)return{};let e=fh[fd]??=new Map,t=e.get(H.createContext);return t||(t=H.createContext(null),e.set(H.createContext,t)),t}(),fp=function(e){let{children:t,context:r,serverState:n,store:i}=e,a=H.useMemo(()=>{let e=function(e,t){let r,n=fs,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=fs)}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 fc(()=>{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||ff).Provider,{value:a},t)};function fm(e=ff){return function(){return H.useContext(e)}}var fx=fm(),fy=Symbol.for("immer-nothing"),fg=Symbol.for("immer-draftable"),fv=Symbol.for("immer-state");function fb(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fj=Object.getPrototypeOf;function fw(e){return!!e&&!!e[fv]}function fN(e){return!!e&&(fO(e)||Array.isArray(e)||!!e[fg]||!!e.constructor?.[fg]||fA(e)||fT(e))}var fk=Object.prototype.constructor.toString(),fS=new WeakMap;function fO(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=fS.get(r);return void 0===n&&(n=Function.toString.call(r),fS.set(r,n)),n===fk}function fP(e,t,r=!0){0===fC(e)?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function fC(e){let t=e[fv];return t?t.type_:Array.isArray(e)?1:fA(e)?2:3*!!fT(e)}function fE(e,t){return 2===fC(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fM(e,t,r){let n=fC(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function fA(e){return e instanceof Map}function fT(e){return e instanceof Set}function f_(e){return e.copy_||e.base_}function fD(e,t){if(fA(e))return new Map(e);if(fT(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=fO(e);if(!0!==t&&("class_only"!==t||r)){let t=fj(e);return null!==t&&r?{...e}:Object.assign(Object.create(t),e)}{let t=Object.getOwnPropertyDescriptors(e);delete t[fv];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(fj(e),t)}}function fI(e,t=!1){return fL(e)||fw(e)||!fN(e)||(fC(e)>1&&Object.defineProperties(e,{set:fz,add:fz,clear:fz,delete:fz}),Object.freeze(e),t&&Object.values(e).forEach(e=>fI(e,!0))),e}var fz={value:function(){fb(2)}};function fL(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var fR={};function fF(e){let t=fR[e];return t||fb(0,e),t}function f$(e,t){t&&(fF("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fB(e){fU(e),e.drafts_.forEach(fq),e.drafts_=null}function fU(e){e===m&&(m=e.parent_)}function fV(e){return m={drafts_:[],parent_:m,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function fq(e){let t=e[fv];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function fK(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return void 0!==e&&e!==r?(r[fv].modified_&&(fB(t),fb(4)),fN(e)&&(e=fW(t,e),t.parent_||fY(t,e)),t.patches_&&fF("Patches").generateReplacementPatches_(r[fv].base_,e,t.patches_,t.inversePatches_)):e=fW(t,r,[]),fB(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fy?e:void 0}function fW(e,t,r){if(fL(t))return t;let n=e.immer_.shouldUseStrictIteration(),i=t[fv];if(!i)return fP(t,(n,a)=>fH(e,i,t,n,a,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return fY(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),fP(a,(n,a)=>fH(e,i,t,n,a,r,s),n),fY(e,t,!1),r&&e.patches_&&fF("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function fH(e,t,r,n,i,a,s){if(null==i||"object"!=typeof i&&!s)return;let o=fL(i);if(!o||s){if(fw(i)){let s=fW(e,i,a&&t&&3!==t.type_&&!fE(t.assigned_,n)?a.concat(n):void 0);if(fM(r,n,s),!fw(s))return;e.canAutoFreeze_=!1}else s&&r.add(i);if(fN(i)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&o)return;fW(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&(fA(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&fY(e,i)}}}function fY(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fI(t,r)}var fX={get(e,t){if(t===fv)return e;let r=f_(e);if(!fE(r,t)){var n;let i;return n=e,(i=fZ(r,t))?"value"in i?i.value:i.get?.call(n.draft_):void 0}let i=r[t];return e.finalized_||!fN(i)?i:i===fG(e.base_,t)?(f0(e),e.copy_[t]=f2(i,e)):i},has:(e,t)=>t in f_(e),ownKeys:e=>Reflect.ownKeys(f_(e)),set(e,t,r){let n=fZ(f_(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=fG(f_(e),t),i=n?.[fv];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||fE(e.base_,t)))return!0;f0(e),fJ(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!==fG(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,f0(e),fJ(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=f_(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){fb(11)},getPrototypeOf:e=>fj(e.base_),setPrototypeOf(){fb(12)}},fQ={};function fG(e,t){let r=e[fv];return(r?f_(r):e)[t]}function fZ(e,t){if(!(t in e))return;let r=fj(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=fj(r)}}function fJ(e){!e.modified_&&(e.modified_=!0,e.parent_&&fJ(e.parent_))}function f0(e){e.copy_||(e.copy_=fD(e.base_,e.scope_.immer_.useStrictShallowCopy_))}fP(fX,(e,t)=>{fQ[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),fQ.deleteProperty=function(e,t){return fQ.set.call(this,e,t,void 0)},fQ.set=function(e,t,r){return fX.set.call(this,e[0],t,r,e[0])};var f1=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&&fb(6),void 0!==r&&"function"!=typeof r&&fb(7),fN(e)){let i=fV(this),a=f2(e,void 0),s=!0;try{n=t(a),s=!1}finally{s?fB(i):fU(i)}return f$(i,r),fK(n,i)}if(e&&"object"==typeof e)fb(1,e);else{if(void 0===(n=t(e))&&(n=e),n===fy&&(n=void 0),this.autoFreeze_&&fI(n,!0),r){let t=[],i=[];fF("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;fN(e)||fb(8),fw(e)&&(fw(t=e)||fb(10,t),e=function e(t){let r;if(!fN(t)||fL(t))return t;let n=t[fv],i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=fD(t,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=fD(t,!0);return fP(r,(t,n)=>{fM(r,t,e(n))},i),n&&(n.finalized_=!1),r}(t));let r=fV(this),n=f2(e,void 0);return n[fv].isManual_=!0,fU(r),n}finishDraft(e,t){let r=e&&e[fv];r&&r.isManual_||fb(9);let{scope_:n}=r;return f$(n,t),fK(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=fF("Patches").applyPatches_;return fw(e)?n(e,t):this.produce(e,e=>n(e,t))}};function f2(e,t){let r=fA(e)?fF("MapSet").proxyMap_(e,t):fT(e)?fF("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=fX;r&&(i=[n],a=fQ);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 f1().produce;var f5={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},f4=hy({name:"tooltip",initialState:{itemInteraction:{click:f5,hover:f5},axisInteraction:{click:f5,hover:f5},keyboardInteraction:f5,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:hd()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,i=dR(e).tooltipItemPayloads.indexOf(r);i>-1&&(e.tooltipItemPayloads[i]=n)},prepare:hd()},removeTooltipEntrySettings:{reducer(e,t){var r=dR(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:hd()},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:f3,replaceTooltipEntrySettings:f6,removeTooltipEntrySettings:f8,setTooltipSettingsState:f7,setActiveMouseOverItemIndex:f9,mouseLeaveItem:pe,mouseLeaveChart:pt,setActiveClickItemIndex:pr,setMouseOverAxisIndex:pn,setMouseClickAxisIndex:pi,setSyncInteraction:pa,setKeyboardInteraction:ps}=f4.actions,po=f4.reducer,pl=hy({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:pc,setDataStartEndIndexes:pu,setComputedData:pd}=pl.actions,ph=pl.reducer,pf=hy({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:pp,setLayout:pm,setChartSize:px,setScale:py}=pf.actions,pg=pf.reducer,pv=e.i(27688),pb=(0,H.createContext)(null),pj=e=>e,pw=()=>{var e=(0,H.useContext)(pb);return e?e.store.dispatch:pj},pN=()=>{},pk=()=>pN,pS=(e,t)=>e===t;function pO(e){var t=(0,H.useContext)(pb),r=(0,H.useMemo)(()=>t?t=>{if(null!=t)return e(t)}:pN,[t,e]);return(0,pv.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:pk,t?t.store.getState:pN,t?t.store.getState:pN,r,pS)}var pP=e.i(28914),pC=e=>e.legend.settings;function pE(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function pM(e){return function(){return e}}function pA(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 pT(e){for(var t=e.length,r=Array(t);--t>=0;)r[t]=t;return r}function p_(e,t){return e[t]}function pD(e){let t=[];return t.key=e,t}function pI(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function pz(e){return Number.isFinite(e)}function pL(e){return"number"==typeof e&&e>0&&Number.isFinite(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}function p$(e,t,r){return null==e||null==t?r:h5(t)?(0,hQ.default)(e,t,r):"function"==typeof t?t(e):r}d5([e=>e.legend.payload,pC],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?(0,pP.default)(n,r):n}),Array.prototype.slice;var pB=(e,t)=>"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t,pU={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=h0(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}pA(e,t)}},none:pA,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}pA(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,pA(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=h0(l[1])?l[0]:l[1];c>=0?(l[0]=a,a+=c,l[1]=a):(l[0]=0,l[1]=0)}}}}},pV=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=p$(a,t.dataKey,t.scale.domain()[s]);if(null==o)return null;var l=t.scale.map(o);return h2(l)?l-i/2+n:null},pq=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pK=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pW=(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,pP.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 pH(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:i,name:a}=e;return pF(pF({},t),{},{dataKey:r,payload:n,value:i,name:a})}function pY(e,t){return e?String(e):"string"==typeof t?t:void 0}var pX=e=>e.layout.width,pQ=e=>e.layout.height,pG=e=>e.layout.scale,pZ=e=>e.layout.margin,pJ=d5(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),p0=d5(e=>e.cartesianAxis.yAxis,e=>Object.values(e));function p1(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 p2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p1(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)):p1(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var p5=d5([pX,pQ,pZ,e=>e.brush.height,function(e){return p0(e).reduce((e,t)=>"left"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:60),0)},function(e){return p0(e).reduce((e,t)=>"right"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:60),0)},function(e){return pJ(e).reduce((e,t)=>"top"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},function(e){return pJ(e).reduce((e,t)=>"bottom"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},pC,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=p2(p2({},{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&&h2(e[a]))return pF(pF({},e),{},{[a]:e[a]+(n||0)});if(("horizontal"===o||"vertical"===o&&"center"===a)&&"middle"!==s&&h2(e[s]))return pF(pF({},e),{},{[s]:e[s]+(i||0)})}return e})(d,l,c)).left-d.right,p=t-d.top-d.bottom;return p2(p2({brushBottom:h},d),{},{width:Math.max(f,0),height:Math.max(p,0)})}),p4=d5(p5,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),p3=d5(pX,pQ,(e,t)=>({x:0,y:0,width:e,height:t})),p6=(0,H.createContext)(null),p8=()=>null!=(0,H.useContext)(p6),p7=e=>e.brush,p9=d5([p7,p5,pZ],(e,t,r)=>({height:e.height,x:h2(e.x)?e.x:t.left,y:h2(e.y)?e.y:t.top+t.height+t.brushBottom-((null==r?void 0:r.bottom)||0),width:h2(e.width)?e.width:t.width})),me=e.i(15325),mt=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++]))}},mr="100%",mn="100%",mi={width:-1,height:-1},ma=(e,t,r)=>{var{width:n=mr,height:i=mn,aspect:a,maxHeight:s}=r,o=h1(n)?e:Number(n),l=h1(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}},ms={width:0,height:0,overflow:"visible"},mo={width:0,overflowX:"visible"},ml={height:0,overflowY:"visible"},mc={};function mu(){return(mu=Object.assign.bind()).apply(null,arguments)}function md(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 mh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?md(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)):md(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var mf=(0,H.createContext)(mi);function mp(e){var{children:t,width:r,height:n}=e,i=(0,H.useMemo)(()=>({width:r,height:n}),[r,n]);return pL(i.width)&&pL(i.height)?H.createElement(mf.Provider,{value:i},t):null}var mm=()=>(0,H.useContext)(mf),mx=(0,H.forwardRef)((e,t)=>{var{aspect:r,initialDimension:n=mi,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 ft;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,me.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:j}=y;mt(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:w,calculatedHeight:N}=ma(b,j,{width:i,height:a,aspect:r,maxHeight:l});return mt(null!=w&&w>0||null!=N&&N>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",w,N,i,a,s,o,r),H.createElement("div",{id:d?"".concat(d):void 0,className:sl("recharts-responsive-container",h),style:mh(mh({},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=h1(t),i=h1(r);return n&&i?ms:n?mo:i?ml:mc})({width:i,height:a})},H.createElement(mp,{width:w,height:N},c)))}),my=(0,H.forwardRef)((e,t)=>{var r=mm();if(pL(r.width)&&pL(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=mr,a=mn):void 0===i?i=n&&n>0?void 0:mr:void 0===a&&(a=n&&n>0?void 0:mn),{width:i,height:a}}({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=ma(void 0,void 0,{width:n,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return h2(a)&&h2(s)?H.createElement(mp,{width:a,height:s},e.children):H.createElement(mx,mu({},e,{width:n,height:i,ref:t}))});function mg(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 mv=()=>{var e,t=p8(),r=pO(p4),n=pO(p9),i=null==(e=pO(p7))?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},mb={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},mj=e=>e.layout.layoutType,mw=()=>{var e=pO(mj);if("horizontal"===e||"vertical"===e)return e},mN=e=>{var t=e.layout.layoutType;if("centric"===t||"radial"===t)return t},mk=e=>{var t=pw(),r=p8(),{width:n,height:i}=e,a=mm(),s=n,o=i;return a&&(s=a.width>0?a.width:n,o=a.height>0?a.height:i),(0,H.useEffect)(()=>{!r&&pL(s)&&pL(o)&&t(px({width:s,height:o}))},[t,r,s,o]),null},mS=e.i(56558);e.s([],81206),e.i(81206),e.s([],3771),e.i(3771);var mO=e.i(17603),mP=e.i(11276);function mC(){var e,t,r=(0,mP.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 mC(n(),[a,s]).round(o).paddingInner(l).paddingOuter(c).align(u)},mO.initRange.apply(d(),arguments)}function mE(){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}(mC.apply(null,arguments).paddingInner(1))}let mM=Math.sqrt(50),mA=Math.sqrt(10),mT=Math.sqrt(2);function m_(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>=mM?10:l>=mA?5:l>=mT?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)?m_(e,t,2*r):[n,i,a]}function mD(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?m_(t,e,r):m_(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 mI(e,t,r){return m_(e*=1,t*=1,r*=1)[2]}function mz(e,t,r){t*=1,e*=1,r*=1;let n=t<e,i=n?mI(t,e,r):mI(e,t,r);return(n?-1:1)*(i<0?-(1/i):i)}function mL(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mR(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mF(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=mL,r=(t,r)=>mL(e(t),r),n=(t,r)=>e(t)-r):(t=e===mL||e===mR?e:m$,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 m$(){return 0}function mB(e){return null===e?NaN:+e}let mU=mF(mL),mV=mU.right;mU.left,mF(mB).center;var mq=e.i(82938),mK=e.i(208),mW=e.i(6272),mH=e.i(11930),mY=e.i(44936);function mX(e,t){var r,n,i=typeof t;return null==t||"boolean"===i?(0,mY.default)(t):("number"===i?mW.default:"string"===i?(n=(0,mq.color)(t))?(t=n,mK.default):mH.default:t instanceof mq.color?mK.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]=mX(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]=mX(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}:mW.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 mQ=e.i(25223);function mG(e,t){return e*=1,t*=1,function(r){return Math.round(e*(1-r)+t*r)}}function mZ(e){return+e}var mJ=[0,1];function m0(e){return e}function m1(e,t){var r;return(t-=e*=1)?function(r){return(r-e)/t}:(r=isNaN(t)?NaN:.5,function(){return r})}function m2(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i<n?(n=m1(i,n),a=r(s,a)):(n=m1(n,i),a=r(a,s)),function(e){return a(n(e))}}function m5(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]=m1(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(t){var r=mV(e,t,1,n)-1;return a[r](i[r](t))}}function m4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function m3(){var e,t,r,n,i,a,s=mJ,o=mJ,l=mX,c=m0;function u(){var e,t,r,l=Math.min(s.length,o.length);return c!==m0&&(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?m5:m2,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),mQ.interpolateNumber)))(r)))},d.domain=function(e){return arguments.length?(s=Array.from(e,mZ),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=mG,u()},d.clamp=function(e){return arguments.length?(c=!!e||m0,u()):c!==m0},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 m6(){return m3()(m0,m0)}function m8(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 m7(e){return(e=m8(Math.abs(e)))?e[1]:NaN}var m9=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xe(e){var t;if(!(t=m9.exec(e)))throw Error("invalid format: "+e);return new xt({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 xt(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 xr(e,t){var r=m8(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")}xe.prototype=xt.prototype,xt.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 xn={"%":(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)=>xr(100*e,t),r:xr,s:function(e,t){var r=m8(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")+m8(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function xi(e){return e}var xa=Array.prototype.map,xs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xo(e,t,r,n){var i,a,s=mz(e,t,r);switch((n=xe(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(m7(o)/3)))-m7(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,m7(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(i=Math.abs(i=s)))-m7(i))+1)||(n.precision=a-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(a=Math.max(0,-m7(Math.abs(s))))||(n.precision=a-("%"===n.type)*2)}return g(n)}function xl(e){var t=e.domain;return e.ticks=function(e){var r=t();return mD(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return xo(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=mI(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 xc(){var e=m6();return e.copy=function(){return m4(e,xc())},mO.initRange.apply(e,arguments),xl(e)}function xu(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,mZ),r):e.slice()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return xu(e).unknown(t)},e=arguments.length?Array.from(e,mZ):[0,1],xl(r)}function xd(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 xh(e){return Math.log(e)}function xf(e){return Math.exp(e)}function xp(e){return-Math.log(-e)}function xm(e){return-Math.exp(-e)}function xx(e){return isFinite(e)?+("1e"+e):e<0?0:e}function xy(e){return(t,r)=>-e(-t,r)}function xg(e){let t,r,n=e(xh,xf),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)?xx:o===Math.E?Math.exp:e=>Math.pow(o,e),i()[0]<0?(t=xy(t),r=xy(r),e(xp,xm)):e(xh,xf),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=mD(l,c,f))}else p=mD(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=xe(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(xd(i(),{floor:e=>r(Math.floor(t(e))),ceil:e=>r(Math.ceil(t(e)))})),n}function xv(){let e=xg(m3()).domain([1,10]);return e.copy=()=>m4(e,xv()).base(e.base()),mO.initRange.apply(e,arguments),e}function xb(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function xj(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xw(e){var t=1,r=e(xb(1),xj(t));return r.constant=function(r){return arguments.length?e(xb(t=+r),xj(t)):t},xl(r)}function xN(){var e=xw(m3());return e.copy=function(){return m4(e,xN()).constant(e.constant())},mO.initRange.apply(e,arguments)}function xk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function xS(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xO(e){return e<0?-e*e:e*e}function xP(e){var t=e(m0,m0),r=1;return t.exponent=function(t){return arguments.length?1==(r=+t)?e(m0,m0):.5===r?e(xS,xO):e(xk(r),xk(1/r)):r},xl(t)}function xC(){var e=xP(m3());return e.copy=function(){return m4(e,xC()).exponent(e.exponent())},mO.initRange.apply(e,arguments),e}function xE(){return xC.apply(null,arguments).exponent(.5)}function xM(e){return Math.sign(e)*e*e}function xA(){var e,t=m6(),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(xM(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,mZ)).map(xM)),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 xA(t.domain(),r).round(n).clamp(t.clamp()).unknown(e)},mO.initRange.apply(i,arguments),xl(i)}g=(y=function(e){var t,r,n,i=void 0===e.grouping||void 0===e.thousands?xi:(t=xa.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?xi:(n=xa.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=xe(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"):xn[b]||(void 0===g&&(g=12),v=!0,b="g"),(p||"0"===r&&"="===n)&&(p=!0,r="0",n="=");var j=(t&&void 0!==t.prefix?t.prefix:"")+("$"===f?a:"#"===f&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),w=("$"===f?s:/[%p]/.test(b)?c:"")+(t&&void 0!==t.suffix?t.suffix:""),N=xn[b],k=/[defgprs%]/.test(b);function S(e){var t,a,s,c=j,f=w;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?"":xs[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(m7(t)/3))),n=Math.pow(10,-r),i=h(((e=xe(e)).type="f",e),{suffix:xs[8+r/3]});return function(e){return i(n*e)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,v=y.formatPrefix;var xT=e.i(96509),x_=e.i(45583);function xD(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:+(e>t))}function xI(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function xz(){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=mB){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[mV(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(mL),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 xz().domain(t).range(r).unknown(e)},mO.initRange.apply(a,arguments)}function xL(){var e,t=0,r=1,n=1,i=[.5],a=[0,1];function s(t){return null!=t&&t<=t?a[mV(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 xL().domain([t,r]).range(a).unknown(e)},mO.initRange.apply(xl(s),arguments)}function xR(){var e,t=[.5],r=[0,1],n=1;function i(i){return null!=i&&i<=i?r[mV(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 xR().domain(t).range(r).unknown(e)},mO.initRange.apply(i,arguments)}let xF=new Date,x$=new Date;function xB(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=>xB(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)=>(xF.setTime(+t),x$.setTime(+n),e(xF),e(x$),Math.floor(r(xF,x$))),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 xU=xB(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());xU.every=e=>isFinite(e=Math.floor(e))&&e>0?xB(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,xU.range;let xV=xB(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());xV.every=e=>isFinite(e=Math.floor(e))&&e>0?xB(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,xV.range;let xq=xB(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());xq.range;let xK=xB(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());xK.range;function xW(e){return xB(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 xH=xW(0),xY=xW(1),xX=xW(2),xQ=xW(3),xG=xW(4),xZ=xW(5),xJ=xW(6);function x0(e){return xB(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)}xH.range,xY.range,xX.range,xQ.range,xG.range,xZ.range,xJ.range;let x1=x0(0),x2=x0(1),x5=x0(2),x4=x0(3),x3=x0(4),x6=x0(5),x8=x0(6);x1.range,x2.range,x5.range,x4.range,x3.range,x6.range,x8.range;let x7=xB(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);x7.range;let x9=xB(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);x9.range;let ye=xB(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));ye.range;let yt=xB(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());yt.range;let yr=xB(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());yr.range;let yn=xB(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());yn.range;let yi=xB(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());yi.range;let ya=xB(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());ya.range;let ys=xB(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);function yo(e,t,r,n,i,a){let s=[[ya,1,1e3],[ya,5,5e3],[ya,15,15e3],[ya,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=mF(([,,e])=>e).right(s,i);if(a===s.length)return e.every(mz(t/31536e6,r/31536e6,n));if(0===a)return ys.every(Math.max(mz(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]}ys.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?xB(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ys:null,ys.range;let[yl,yc]=yo(xV,xK,x1,ye,yr,yi),[yu,yd]=yo(xU,xq,xH,x7,yt,yn);function yh(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 yf(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 yp(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}var ym={"-":"",_:" ",0:"0"},yx=/^\s*\d+/,yy=/^%/,yg=/[\\^$*+?|[\]().{}]/g;function yv(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 yb(e){return e.replace(yg,"\\$&")}function yj(e){return RegExp("^(?:"+e.map(yb).join("|")+")","i")}function yw(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function yN(e,t,r){var n=yx.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function yk(e,t,r){var n=yx.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function yS(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function yO(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function yP(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yC(e,t,r){var n=yx.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function yE(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function yM(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 yA(e,t,r){var n=yx.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function yT(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function y_(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function yD(e,t,r){var n=yx.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function yI(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function yz(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function yL(e,t,r){var n=yx.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function yR(e,t,r){var n=yx.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function yF(e,t,r){var n=yx.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function y$(e,t,r){var n=yy.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function yB(e,t,r){var n=yx.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function yU(e,t,r){var n=yx.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function yV(e,t){return yv(e.getDate(),t,2)}function yq(e,t){return yv(e.getHours(),t,2)}function yK(e,t){return yv(e.getHours()%12||12,t,2)}function yW(e,t){return yv(1+x7.count(xU(e),e),t,3)}function yH(e,t){return yv(e.getMilliseconds(),t,3)}function yY(e,t){return yH(e,t)+"000"}function yX(e,t){return yv(e.getMonth()+1,t,2)}function yQ(e,t){return yv(e.getMinutes(),t,2)}function yG(e,t){return yv(e.getSeconds(),t,2)}function yZ(e){var t=e.getDay();return 0===t?7:t}function yJ(e,t){return yv(xH.count(xU(e)-1,e),t,2)}function y0(e){var t=e.getDay();return t>=4||0===t?xG(e):xG.ceil(e)}function y1(e,t){return e=y0(e),yv(xG.count(xU(e),e)+(4===xU(e).getDay()),t,2)}function y2(e){return e.getDay()}function y5(e,t){return yv(xY.count(xU(e)-1,e),t,2)}function y4(e,t){return yv(e.getFullYear()%100,t,2)}function y3(e,t){return yv((e=y0(e)).getFullYear()%100,t,2)}function y6(e,t){return yv(e.getFullYear()%1e4,t,4)}function y8(e,t){var r=e.getDay();return yv((e=r>=4||0===r?xG(e):xG.ceil(e)).getFullYear()%1e4,t,4)}function y7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yv(t/60|0,"0",2)+yv(t%60,"0",2)}function y9(e,t){return yv(e.getUTCDate(),t,2)}function ge(e,t){return yv(e.getUTCHours(),t,2)}function gt(e,t){return yv(e.getUTCHours()%12||12,t,2)}function gr(e,t){return yv(1+x9.count(xV(e),e),t,3)}function gn(e,t){return yv(e.getUTCMilliseconds(),t,3)}function gi(e,t){return gn(e,t)+"000"}function ga(e,t){return yv(e.getUTCMonth()+1,t,2)}function gs(e,t){return yv(e.getUTCMinutes(),t,2)}function go(e,t){return yv(e.getUTCSeconds(),t,2)}function gl(e){var t=e.getUTCDay();return 0===t?7:t}function gc(e,t){return yv(x1.count(xV(e)-1,e),t,2)}function gu(e){var t=e.getUTCDay();return t>=4||0===t?x3(e):x3.ceil(e)}function gd(e,t){return e=gu(e),yv(x3.count(xV(e),e)+(4===xV(e).getUTCDay()),t,2)}function gh(e){return e.getUTCDay()}function gf(e,t){return yv(x2.count(xV(e)-1,e),t,2)}function gp(e,t){return yv(e.getUTCFullYear()%100,t,2)}function gm(e,t){return yv((e=gu(e)).getUTCFullYear()%100,t,2)}function gx(e,t){return yv(e.getUTCFullYear()%1e4,t,4)}function gy(e,t){var r=e.getUTCDay();return yv((e=r>=4||0===r?x3(e):x3.ceil(e)).getUTCFullYear()%1e4,t,4)}function gg(){return"+0000"}function gv(){return"%"}function gb(e){return+e}function gj(e){return Math.floor(e/1e3)}function gw(e){return new Date(e)}function gN(e){return e instanceof Date?+e:+new Date(+e)}function gk(e,t,r,n,i,a,s,o,l,c){var u=m6(),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 j(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,gN)):h().map(gw)},u.ticks=function(t){var r=h();return e(r[0],r[r.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?j:c(t)},u.nice=function(e){var r=h();return e&&"function"==typeof e.range||(e=t(r[0],r[r.length-1],null==e?10:e)),e?h(xd(r,e)):u},u.copy=function(){return m4(u,gk(e,t,r,n,i,a,s,o,l,c))},u}function gS(){return mO.initRange.apply(gk(yu,yd,xU,xq,xH,x7,yt,yn,ya,j).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gO(){return mO.initRange.apply(gk(yl,yc,xV,xK,x1,x9,yr,yi,ya,w).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function gP(){var e,t,r,n,i,a=0,s=1,o=m0,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(mX),c.rangeRound=u(mG),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 gC(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function gE(){var e=xl(gP()(m0));return e.copy=function(){return gC(e,gE())},mO.initInterpolator.apply(e,arguments)}function gM(){var e=xg(gP()).domain([1,10]);return e.copy=function(){return gC(e,gM()).base(e.base())},mO.initInterpolator.apply(e,arguments)}function gA(){var e=xw(gP());return e.copy=function(){return gC(e,gA()).constant(e.constant())},mO.initInterpolator.apply(e,arguments)}function gT(){var e=xP(gP());return e.copy=function(){return gC(e,gT()).exponent(e.exponent())},mO.initInterpolator.apply(e,arguments)}function g_(){return gT.apply(null,arguments).exponent(.5)}function gD(){var e=[],t=m0;function r(r){if(null!=r&&!isNaN(r*=1))return t((mV(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(mL),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,x_.default)(e);if(t>=1)return(0,xT.default)(e);var n,i=(n-1)*t,a=Math.floor(i),s=(0,xT.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?xD:function(e=mL){if(e===mL)return xD;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(xI(t,n,r),a(t[i],s)>0&&xI(t,n,i);o<l;){for(xI(t,o,l),++o,--l;0>a(t[o],s);)++o;for(;a(t[l],s)>0;)--l}0===a(t[n],s)?xI(t,n,l):xI(t,++l,i),l<=r&&(n=l+1),r<=l&&(i=l-1)}return t})(e,a).subarray(0,a+1));return s+((0,x_.default)(e.subarray(a+1))-s)*(i-a)}})(e,n/t))},r.copy=function(){return gD(t).domain(e)},mO.initInterpolator.apply(r,arguments)}function gI(){var e,t,r,n,i,a,s,o=0,l=.5,c=1,u=1,d=m0,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=mX);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(mX),f.rangeRound=p(mG),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 gz(){var e=xl(gI()(m0));return e.copy=function(){return gC(e,gz())},mO.initInterpolator.apply(e,arguments)}function gL(){var e=xg(gI()).domain([.1,1,10]);return e.copy=function(){return gC(e,gL()).base(e.base())},mO.initInterpolator.apply(e,arguments)}function gR(){var e=xw(gI());return e.copy=function(){return gC(e,gR()).constant(e.constant())},mO.initInterpolator.apply(e,arguments)}function gF(){var e=xP(gI());return e.copy=function(){return gC(e,gF()).exponent(e.exponent())},mO.initInterpolator.apply(e,arguments)}function g$(){return gF.apply(null,arguments).exponent(.5)}j=(b=function(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,c=yj(i),u=yw(i),d=yj(a),h=yw(a),f=yj(s),p=yw(s),m=yj(o),x=yw(o),y=yj(l),g=yw(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:yV,e:yV,f:yY,g:y3,G:y8,H:yq,I:yK,j:yW,L:yH,m:yX,M:yQ,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:gb,s:gj,S:yG,u:yZ,U:yJ,V:y1,w:y2,W:y5,x:null,X:null,y:y4,Y:y6,Z:y7,"%":gv},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:y9,e:y9,f:gi,g:gm,G:gy,H:ge,I:gt,j:gr,L:gn,m:ga,M:gs,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:gb,s:gj,S:go,u:gl,U:gc,V:gd,w:gh,W:gf,x:null,X:null,y:gp,Y:gx,Z:gg,"%":gv},j={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:y_,e:y_,f:yF,g:yE,G:yC,H:yI,I:yI,j:yD,L:yR,m:yT,M:yz,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:yA,Q:yB,s:yU,S:yL,u:yk,U:yS,V:yO,w:yN,W:yP,x:function(e,t,n){return k(e,r,t,n)},X:function(e,t,r){return k(e,n,t,r)},y:yE,Y:yC,Z:yM,"%":y$};function w(e,t){return function(r){var n,i,a,s=[],o=-1,l=0,c=e.length;for(r instanceof Date||(r=new Date(+r));++o<c;)37===e.charCodeAt(o)&&(s.push(e.slice(l,o)),null!=(i=ym[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=yp(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=yf(yp(a.y,0,1))).getUTCDay())>4||0===i?x2.ceil(n):x2(n),n=x9.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=yh(yp(a.y,0,1))).getDay())>4||0===i?xY.ceil(n):xY(n),n=x7.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?yf(yp(a.y,0,1)).getUTCDay():yh(yp(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,yf(a)):yh(a)}}function k(e,t,r,n){for(var i,a,s=0,o=t.length,l=r.length;s<o;){if(n>=l)return -1;if(37===(i=t.charCodeAt(s++))){if(!(a=j[(i=t.charAt(s++))in ym?t.charAt(s++):i])||(n=a(e,r,n))<0)return -1}else if(i!=r.charCodeAt(n++))return -1}return n}return v.x=w(r,v),v.X=w(n,v),v.c=w(t,v),b.x=w(r,b),b.X=w(n,b),b.c=w(t,b),{format:function(e){var t=w(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=N(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=N(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,b.parse,w=b.utcFormat,b.utcParse,e.s(["scaleBand",()=>mC,"scaleDiverging",()=>gz,"scaleDivergingLog",()=>gL,"scaleDivergingPow",()=>gF,"scaleDivergingSqrt",()=>g$,"scaleDivergingSymlog",()=>gR,"scaleIdentity",()=>xu,"scaleImplicit",()=>mP.implicit,"scaleLinear",()=>xc,"scaleLog",()=>xv,"scaleOrdinal",()=>mP.default,"scalePoint",()=>mE,"scalePow",()=>xC,"scaleQuantile",()=>xz,"scaleQuantize",()=>xL,"scaleRadial",()=>xA,"scaleSequential",()=>gE,"scaleSequentialLog",()=>gM,"scaleSequentialPow",()=>gT,"scaleSequentialQuantile",()=>gD,"scaleSequentialSqrt",()=>g_,"scaleSequentialSymlog",()=>gA,"scaleSqrt",()=>xE,"scaleSymlog",()=>xN,"scaleThreshold",()=>xR,"scaleTime",()=>gS,"scaleUtc",()=>gO,"tickFormat",()=>xo],84649),e.i(84649),e.s(["scaleBand",()=>mC,"scaleDiverging",()=>gz,"scaleDivergingLog",()=>gL,"scaleDivergingPow",()=>gF,"scaleDivergingSqrt",()=>g$,"scaleDivergingSymlog",()=>gR,"scaleIdentity",()=>xu,"scaleImplicit",()=>mP.implicit,"scaleLinear",()=>xc,"scaleLog",()=>xv,"scaleOrdinal",()=>mP.default,"scalePoint",()=>mE,"scalePow",()=>xC,"scaleQuantile",()=>xz,"scaleQuantize",()=>xL,"scaleRadial",()=>xA,"scaleSequential",()=>gE,"scaleSequentialLog",()=>gM,"scaleSequentialPow",()=>gT,"scaleSequentialQuantile",()=>gD,"scaleSequentialSqrt",()=>g_,"scaleSequentialSymlog",()=>gA,"scaleSqrt",()=>xE,"scaleSymlog",()=>xN,"scaleThreshold",()=>xR,"scaleTime",()=>gS,"scaleUtc",()=>gO,"tickFormat",()=>xo],93628);var gB=e.i(93628),gU=e=>e.chartData,gV=d5([gU],e=>{var t=null!=e.chartData?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),gq=(e,t,r,n)=>n?gV(e):gU(e);function gK(e){if(Array.isArray(e)&&2===e.length){var[t,r]=e;if(pz(t)&&pz(r))return!0}return!1}function gW(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function gH(e,t){if(t&&"function"!=typeof e&&Array.isArray(e)&&2===e.length){var r,n,[i,a]=e;if(pz(i))r=i;else if("function"==typeof i)return;if(pz(a))n=a;else if("function"==typeof a)return;var s=[r,n];if(gK(s))return s}}var gY=e.i(73335);function gX(e){return 0===e?1:Math.floor(new gY.default(e).abs().log(10).toNumber())+1}function gQ(e,t,r){for(var n=new gY.default(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var gG=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},gZ=(e,t,r)=>{if(e.lte(0))return new gY.default(0);var n=gX(e.toNumber()),i=new gY.default(10).pow(n),a=e.div(i),s=1!==n?.05:.1,o=new gY.default(Math.ceil(a.div(s).toNumber())).add(r).mul(s).mul(i);return new gY.default(t?o.toNumber():Math.ceil(o.toNumber()))},gJ=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 gY.default(0),tickMin:new gY.default(0),tickMax:new gY.default(0)};var s=gZ(new gY.default(t).sub(e).div(r-1),n,a),o=Math.ceil((i=e<=0&&t>=0?new gY.default(0):(i=new gY.default(e).add(t).div(2)).sub(new gY.default(i).mod(s))).sub(e).div(s).toNumber()),l=Math.ceil(new gY.default(t).sub(i).div(s).toNumber()),c=o+l+1;return c>r?gJ(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 gY.default(o).mul(s)),tickMax:i.add(new gY.default(l).mul(s))})},g0=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]=gG([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 gY.default(1),i=new gY.default(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new gY.default(10).pow(gX(e)-1),i=new gY.default(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new gY.default(Math.floor(e)))}else 0===e?i=new gY.default(Math.floor((t-1)/2)):r||(i=new gY.default(Math.floor(e)));for(var s=Math.floor((t-1)/2),o=[],l=0;l<t;l++)o.push(i.add(new gY.default(l-s).mul(n)).toNumber());return o})(s,n,i);var{step:c,tickMin:u,tickMax:d}=gJ(s,o,a,i,0),h=gQ(u,d.add(new gY.default(.1).mul(c)),c);return t>r?h.reverse():h},g1=function(e,t){var[r,n]=e,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],[a,s]=gG([r,n]);if(a===-1/0||s===1/0)return[r,n];if(a===s)return[a];var o=Math.max(t,2),l=gZ(new gY.default(s).sub(a).div(o-1),i,0),c=[...gQ(new gY.default(a),new gY.default(s),l),s];return!1===i&&(c=c.map(e=>Math.round(e))),r>n?c.reverse():c},g2=e=>e.rootProps.maxBarSize,g5=e=>e.rootProps.barCategoryGap,g4=e=>e.rootProps.stackOffset,g3=e=>e.rootProps.reverseStackOrder,g6=e=>e.options.chartName,g8=e=>e.rootProps.syncId,g7=e=>e.rootProps.syncMethod,g9=e=>e.options.eventEmitter;function ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ve(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)):ve(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var vr=Math.PI/180,vn=(e,t,r,n)=>({x:e+Math.cos(-vr*n)*r,y:t+Math.sin(-vr*n)*r}),vi={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},va={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:vi.axis},vs={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:vi.axis},vo=(e,t)=>{if(e&&t)return null!=e&&e.reversed?[t[1],t[0]]:t};function vl(e,t,r){return"auto"!==r?r:null!=e?pB(e,t)?"category":"number":void 0}function vc(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 vu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vc(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)):vc(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var vd={allowDataOverflow:va.allowDataOverflow,allowDecimals:va.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:va.angleAxisId,includeHidden:!1,name:void 0,reversed:va.reversed,scale:va.scale,tick:va.tick,tickCount:void 0,ticks:void 0,type:va.type,unit:void 0},vh={allowDataOverflow:vs.allowDataOverflow,allowDecimals:vs.allowDecimals,allowDuplicatedCategory:vs.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:vs.radiusAxisId,includeHidden:vs.includeHidden,name:void 0,reversed:vs.reversed,scale:vs.scale,tick:vs.tick,tickCount:vs.tickCount,ticks:void 0,type:vs.type,unit:void 0},vf=d5([(e,t)=>{if(null!=t)return e.polarAxis.angleAxis[t]},mN],(e,t)=>{if(null!=e)return e;var r,n=null!=(r=vl(t,"angleAxis",vd.type))?r:"category";return vu(vu({},vd),{},{type:n})}),vp=d5([(e,t)=>e.polarAxis.radiusAxis[t],mN],(e,t)=>{if(null!=e)return e;var r,n=null!=(r=vl(t,"radiusAxis",vh.type))?r:"category";return vu(vu({},vh),{},{type:n})}),vm=e=>e.polarOptions,vx=d5([pX,pQ,p5],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}),vy=d5([vm,vx],(e,t)=>{if(null!=e)return h6(e.innerRadius,t,0)}),vg=d5([vm,vx],(e,t)=>{if(null!=e)return h6(e.outerRadius,t,.8*t)}),vv=d5([vm],e=>{if(null==e)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]});d5([vf,vv],vo);var vb=d5([vx,vy,vg],(e,t,r)=>{if(null!=e&&null!=t&&null!=r)return[t,r]});d5([vp,vb],vo);var vj=d5([mj,vm,vy,vg,pX,pQ],(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:h6(s,i,i/2),cy:h6(o,a,a/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:c,clockWise:!1}}}),vw=(e,t)=>t,vN=(e,t,r)=>r;function vk(e){return null==e?void 0:e.id}function vS(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=vk(e);r.forEach((t,r)=>{var n,l=null==a||i?r:String(p$(t,a,null)),c=p$(t,e.dataKey,0);Object.assign(n=s.has(l)?s.get(l):{},{[o]:c}),s.set(l,n)})}}),Array.from(s.values())}function vO(e){return"stackId"in e&&null!=e.stackId&&null!=e.dataKey}var vP=(e,t)=>e===t||null!=e&&null!=t&&e[0]===t[0]&&e[1]===t[1];function vC(e,t){return!!(Array.isArray(e)&&Array.isArray(t))&&0===e.length&&0===t.length||e===t}var vE=e=>{var t=mj(e);return"horizontal"===t?"xAxis":"vertical"===t?"yAxis":"centric"===t?"angleAxis":"radiusAxis"},vM=e=>e.tooltip.settings.axisId;function vA(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 vT(e,t,r){if("function"==typeof e)return vA(e.copy().domain(t).range(r));if(null!=e){var n=function(e){if(e in gB)return gB[e]();var t="scale".concat(h9(e));if(t in gB)return gB[t]()}(e);if(null!=n)return n.domain(t).range(r),vA(n)}}function v_(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 vD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v_(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)):v_(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var vI=[0,"auto"],vz={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},vL=(e,t)=>e.cartesianAxis.xAxis[t],vR=(e,t)=>{var r=vL(e,t);return null==r?vz:r},vF={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:vI,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},v$=(e,t)=>e.cartesianAxis.yAxis[t],vB=(e,t)=>{var r=v$(e,t);return null==r?vF:r},vU={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:""},vV=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return null==r?vU:r},vq=(e,t,r)=>{switch(t){case"xAxis":return vR(e,r);case"yAxis":return vB(e,r);case"zAxis":return vV(e,r);case"angleAxis":return vf(e,r);case"radiusAxis":return vp(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},vK=(e,t,r)=>{switch(t){case"xAxis":return vR(e,r);case"yAxis":return vB(e,r);case"angleAxis":return vf(e,r);case"radiusAxis":return vp(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},vW=e=>e.graphicalItems.cartesianItems.some(e=>"bar"===e.type)||e.graphicalItems.polarItems.some(e=>"radialBar"===e.type);function vH(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 vY=e=>e.graphicalItems.cartesianItems,vX=d5([vw,vN],vH),vQ=(e,t,r)=>e.filter(r).filter(e=>(null==t?void 0:t.includeHidden)===!0||!e.hide),vG=d5([vY,vq,vX],vQ,{memoizeOptions:{resultEqualityCheck:vC}}),vZ=d5([vG],e=>e.filter(e=>"area"===e.type||"bar"===e.type).filter(vO)),vJ=e=>e.filter(e=>!("stackId"in e)||void 0===e.stackId),v0=d5([vG],vJ),v1=e=>e.map(e=>e.data).filter(Boolean).flat(1),v2=d5([vG],v1,{memoizeOptions:{resultEqualityCheck:vC}}),v5=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},v4=d5([v2,gq],v5),v3=(e,t,r)=>(null==t?void 0:t.dataKey)!=null?e.map(e=>({value:p$(e,t.dataKey)})):r.length>0?r.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:p$(e,t)}))):e.map(e=>({value:e})),v6=d5([v4,vq,vG],v3);function v8(e,t){switch(e){case"xAxis":return"x"===t.direction;case"yAxis":return"y"===t.direction;default:return!1}}function v7(e){if(h5(e)||e instanceof Date){var t=Number(e);if(pz(t))return t}}function v9(e){if(Array.isArray(e)){var t=[v7(e[0]),v7(e[1])];return gK(t)?t:void 0}var r=v7(e);if(null!=r)return[r,r]}function be(e){return e.map(v7).filter(fe)}var bt=e=>{var t=vE(e),r=vM(e);return vK(e,t,r)},br=d5([bt],e=>null==e?void 0:e.dataKey),bn=d5([vZ,gq,bt],vS),bi=(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(vk);return[o,{stackedData:(a=null!=(i=pU[r])?i:pA,(s=(function(){var e=pM([]),t=pT,r=pA,n=p_;function i(i){var a,s,o=Array.from(e.apply(this,arguments),pD),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=pE(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:pM(Array.from(t)),i):e},i.value=function(e){return arguments.length?(n="function"==typeof e?e:pM(+e),i):n},i.order=function(e){return arguments.length?(t=null==e?pT:"function"==typeof e?e:pM(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(r=null==e?pA:e,i):r},i})().keys(u).value((e,t)=>Number(p$(e,t,0))).order(pT).offset(a)(e)).forEach((t,r)=>{t.forEach((t,n)=>{var i=p$(e[n],u[r],0);Array.isArray(i)&&2===i.length&&h2(i[0])&&h2(i[1])&&(t[0]=i[0],t[1]=i[1])})}),s),graphicalItems:c}]})),ba=d5([bn,vZ,g4,g3],bi),bs=(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=pI(n,t,r).flat(2).filter(h2)),Math.max(...i)];return pz(a[0])&&pz(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}},bo=d5([vq],e=>e.allowDataOverflow),bl=e=>{var t;if(null==e||!("domain"in e))return vI;if(null!=e.domain)return e.domain;if("ticks"in e&&null!=e.ticks){if("number"===e.type){var r=be(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:vI},bc=d5([vq],bl),bu=d5([bc,bo],gH),bd=d5([ba,gU,vw,bu],bs,{memoizeOptions:{resultEqualityCheck:vP}}),bh=e=>e.errorBars,bf=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)]}},bp=(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=>v8(i,e)),u=p$(e,null!=(l=t.dataKey)?l:r.dataKey),d=!(!c||"number"!=typeof u||h0(u))&&c.length?be(c.flatMap(t=>{var r,n,i=p$(e,t.dataKey);if(Array.isArray(i)?[r,n]=i:r=n=i,pz(r)&&pz(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=v9(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=v9(p$(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]))}),pz(a)&&pz(s))return[a,s]},bm=d5([v4,vq,v0,bh,vw],bp,{memoizeOptions:{resultEqualityCheck:vP}});function bx(e){var{value:t}=e;if(h5(t)||t instanceof Date)return t}var by=e=>e.referenceElements.dots,bg=(e,t,r)=>e.filter(e=>"extendDomain"===e.ifOverflow).filter(e=>"xAxis"===t?e.xAxisId===r:e.yAxisId===r),bv=d5([by,vw,vN],bg),bb=e=>e.referenceElements.areas,bj=d5([bb,vw,vN],bg),bw=e=>e.referenceElements.lines,bN=d5([bw,vw,vN],bg),bk=(e,t)=>{if(null!=e){var r=be(e.map(e=>"xAxis"===t?e.x:e.y));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},bS=d5(bv,vw,bk),bO=(e,t)=>{if(null!=e){var r=be(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)]}},bP=d5([bj,vw],bO),bC=(e,t)=>{if(null!=e){var r=e.flatMap(e=>"xAxis"===t?function(e){if(null!=e.x)return be([e.x]);var t,r=null==(t=e.segment)?void 0:t.map(e=>e.x);return null==r||0===r.length?[]:be(r)}(e):function(e){if(null!=e.y)return be([e.y]);var t,r=null==(t=e.segment)?void 0:t.map(e=>e.y);return null==r||0===r.length?[]:be(r)}(e));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},bE=d5([bN,vw],bC),bM=d5(bS,bE,bP,(e,t,r)=>bf(e,r,t)),bA=(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(gK(n))return gW(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(h2(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&&pq.test(s)){var l=pq.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(h2(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&&pK.test(o)){var u=pK.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(gK(h))return null==t?h:gW(h,t,r)}}}(t,"vertical"===s&&"xAxis"===o||"horizontal"===s&&"yAxis"===o?bf(n,a,i):bf(a,i),e.allowDataOverflow),bT=d5([vq,bc,bu,bd,bm,bM,mj,vw],bA,{memoizeOptions:{resultEqualityCheck:vP}}),b_=[0,1],bD=(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=pB(t,a);return d&&null==c?(0,mS.default)(0,null!=(l=null==r?void 0:r.length)?l:0):"category"===u?(o=n.map(bx).filter(e=>null!=e),d&&(null==e.dataKey||e.allowDuplicatedCategory&&h8(o))?(0,mS.default)(0,n.length):e.allowDuplicatedCategory?o:Array.from(new Set(o))):"expand"===i?b_:s}},bI=d5([vq,mj,v4,v6,g4,vw,bT],bD),bz=(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(h9(n));return a in gB?a:"point"}}},bL=d5([vq,vW,g6],bz);function bR(e,t,r,n){if(null!=r&&null!=n)return"function"==typeof e.scale?vT(e.scale,r,n):vT(t,r,n)}var bF=(e,t,r)=>{var n=bl(t);if("auto"===r||"linear"===r){if(null!=t&&t.tickCount&&Array.isArray(n)&&("auto"===n[0]||"auto"===n[1])&&gK(e))return g0(e,t.tickCount,t.allowDecimals);if(null!=t&&t.tickCount&&"number"===t.type&&gK(e))return g1(e,t.tickCount,t.allowDecimals)}},b$=d5([bI,vK,bL],bF),bB=(e,t,r,n)=>{if("angleAxis"!==n&&(null==e?void 0:e.type)==="number"&&gK(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},bU=d5([vq,bI,b$,vw],bB),bV=d5(v6,vq,(e,t)=>{if(t&&"number"===t.type){var r=1/0,n=Array.from(be(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}}),bq=d5(bV,mj,g5,p5,(e,t,r,n,i)=>i,(e,t,r,n,i)=>{if(!pz(e))return 0;var a="vertical"===t?n.height:n.width;if("gap"===i)return e*a/2;if("no-gap"===i){var s=h6(r,e*a),o=e*a/2;return o-s-(o-s)/a*s}return 0}),bK=d5(vR,(e,t,r)=>{var n=vR(e,t);return null==n||"string"!=typeof n.padding?0:bq(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}}),bW=d5(vB,(e,t,r)=>{var n=vB(e,t);return null==n||"string"!=typeof n.padding?0:bq(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}}),bH=d5([p5,bK,p9,p7,(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]}),bY=d5([p5,mj,bW,p9,p7,(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]}),bX=(e,t,r,n)=>{var i;switch(t){case"xAxis":return bH(e,r,n);case"yAxis":return bY(e,r,n);case"zAxis":return null==(i=vV(e,r))?void 0:i.range;case"angleAxis":return vv(e);case"radiusAxis":return vb(e,r);default:return}},bQ=d5([vq,bX],vo),bG=d5([bL,bU],(e,t)=>{if(null!=t)if("linear"!==e)return t;else{if(!gK(t)){for(var r,n,i=0;i<t.length;i++){var a=t[i];pz(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}}),bZ=d5([vq,bL,bG,bQ],bR);function bJ(e,t){return e.id<t.id?-1:+(e.id>t.id)}d5([vG,bh,vw],(e,t,r)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>v8(r,e)));var b0=(e,t)=>t,b1=(e,t,r)=>r,b2=d5(pJ,b0,b1,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(bJ)),b5=d5(p0,b0,b1,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(bJ)),b4=(e,t)=>({width:e.width,height:t.height}),b3=d5(p5,vR,b4),b6=d5(pQ,p5,b2,b0,b1,(e,t,r,n,i)=>{var a,s={};return r.forEach(r=>{var o=b4(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}),b8=d5(pX,p5,b5,b0,b1,(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}),b7=d5([p5,vR,(e,t)=>{var r=vR(e,t);if(null!=r)return b6(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}}}),b9=d5([p5,vB,(e,t)=>{var r=vB(e,t);if(null!=r)return b8(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}}}),je=d5(p5,vB,(e,t)=>({width:"number"==typeof t.width?t.width:60,height:e.height})),jt=(e,t,r)=>{switch(t){case"xAxis":return b3(e,r).width;case"yAxis":return je(e,r).height;default:return}},jr=(e,t,r,n)=>{if(null!=r){var{allowDuplicatedCategory:i,type:a,dataKey:s}=r,o=pB(e,n),l=t.map(e=>e.value);if(s&&o&&"category"===a&&i&&h8(l))return l}},jn=d5([mj,v6,vq,vw],jr),ji=(e,t,r,n)=>{if(null!=r&&null!=r.dataKey){var{type:i,scale:a}=r;if(pB(e,n)&&("number"===i||"auto"!==a))return t.map(e=>e.value)}},ja=d5([mj,v6,vK,vw],ji);d5([mj,(e,t,r)=>{switch(t){case"xAxis":return vR(e,r);case"yAxis":return vB(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},bL,bZ,jn,ja,bX,b$,vw],(e,t,r,n,i,a,s,o,l)=>{if(null!=t){var c=pB(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 js=d5([mj,vK,bL,bZ,b$,bX,jn,ja,vw],(e,t,r,n,i,a,s,o,l)=>{if(null!=t&&null!=n){var c=pB(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*hJ(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 pz(i)?{index:t,coordinate:i+p,value:e,offset:p}:null}).filter(fe):c&&o?o.map((e,t)=>{var r=n.map(e);return pz(r)?{coordinate:r+p,value:e,index:t,offset:p}:null}).filter(fe):n.ticks?n.ticks(h).map((e,t)=>{var r=n.map(e);return pz(r)?{coordinate:r+p,value:e,index:t,offset:p}:null}).filter(fe):n.domain().map((e,t)=>{var r=n.map(e);return pz(r)?{coordinate:r+p,value:s?s[e]:e,index:t,offset:p}:null}).filter(fe)}}),jo=d5([mj,vK,bZ,bX,jn,ja,vw],(e,t,r,n,i,a,s)=>{if(null!=t&&null!=r&&null!=n&&n[0]!==n[1]){var o=pB(e,s),{tickCount:l}=t,c=0;return(c="angleAxis"===s&&(null==n?void 0:n.length)>=2?2*hJ(n[0]-n[1])*c:c,o&&a)?a.map((e,t)=>{var n=r.map(e);return pz(n)?{coordinate:n+c,value:e,index:t,offset:c}:null}).filter(fe):r.ticks?r.ticks(l).map((e,t)=>{var n=r.map(e);return pz(n)?{coordinate:n+c,value:e,index:t,offset:c}:null}).filter(fe):r.domain().map((e,t)=>{var n=r.map(e);return pz(n)?{coordinate:n+c,value:i?i[e]:e,index:t,offset:c}:null}).filter(fe)}}),jl=d5(vq,bZ,(e,t)=>{if(null!=e&&null!=t)return vD(vD({},e),{},{scale:t})}),jc=d5([vq,bL,bI,bQ],bR);d5((e,t,r)=>vV(e,r),jc,(e,t)=>{if(null!=e&&null!=t)return vD(vD({},e),{},{scale:t})});var ju=d5([mj,pJ,p0],(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}}),jd=e=>e.options.defaultTooltipEventType,jh=e=>e.options.validateTooltipEventTypes;function jf(e,t,r){if(null==e)return t;var n=e?"axis":"item";return null==r?t:r.includes(n)?n:t}function jp(e,t){return jf(t,jd(e),jh(e))}var jm=(e,t)=>{var r,n=Number(t);if(!h0(n)&&null!=t)return n>=0?null==e||null==(r=e[n])?void 0:r.value:void 0};function jx(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 jy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jx(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)):jx(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var jg=(e,t,r,n)=>{if(null==t)return f5;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 f5;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 jy(jy({},o),{},{active:!0})}else if(null!=n)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return jy(jy({},f5),{},{coordinate:o.coordinate})},jv=(e,t,r,n)=>{var i=null==e?void 0:e.index;if(null==i)return null;var a=Number(i);if(!pz(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=p$(e,t);return!(null!=n&&gK(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)},jb=(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}}},jj=(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})},jw=e=>e.options.tooltipPayloadSearcher,jN=e=>e.tooltip;function jk(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 jS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jk(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)):jk(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var jO=(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)?pI(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,hQ.default)(e,t))===r)}(y,n,i):a(y,t,l,v))?h.forEach(t=>{var r=jS(jS({},m),{},{name:t.name,unit:t.unit,color:void 0,fill:void 0});e.push(pH({tooltipEntrySettings:r,dataKey:t.dataKey,payload:t.payload,value:p$(t.payload,t.dataKey),name:t.name}))}):e.push(pH({tooltipEntrySettings:m,dataKey:g,payload:h,value:p$(h,g),name:null!=(f=p$(h,v))?f:null==m?void 0:m.name})),e},[])}},jP=d5([bt,vW,g6],bz),jC=d5([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),jE=d5([vE,vM],vH),jM=d5([jC,bt,jE],vQ,{memoizeOptions:{resultEqualityCheck:vC}}),jA=d5([jM],e=>e.filter(vO)),jT=d5([jM],v1,{memoizeOptions:{resultEqualityCheck:vC}}),j_=d5([jT,gU],v5),jD=d5([jA,gU,bt],vS),jI=d5([j_,bt,jM],v3),jz=d5([bt],bl),jL=d5([bt],e=>e.allowDataOverflow),jR=d5([jz,jL],gH),jF=d5([jM],e=>e.filter(vO)),j$=d5([jD,jF,g4,g3],bi),jB=d5([j$,gU,vE,jR],bs),jU=d5([jM],vJ),jV=d5([j_,bt,jU,bh,vE],bp,{memoizeOptions:{resultEqualityCheck:vP}}),jq=d5([by,vE,vM],bg),jK=d5([jq,vE],bk),jW=d5([bb,vE,vM],bg),jH=d5([jW,vE],bO),jY=d5([bw,vE,vM],bg),jX=d5([jY,vE],bC),jQ=d5([jK,jX,jH],bf),jG=d5([bt,jz,jR,jB,jV,jQ,mj,vE],bA),jZ=d5([bt,mj,j_,jI,g4,vE,jG],bD),jJ=d5([jZ,bt,jP],bF),j0=d5([bt,jZ,jJ,vE],bB),j1=e=>{var t=vE(e),r=vM(e);return bX(e,t,r,!1)},j2=d5([bt,j1],vo),j5=d5([bt,jP,j0,j2],bR),j4=d5([mj,jI,bt,vE],jr),j3=d5([mj,jI,bt,vE],ji),j6=d5([mj,bt,jP,j5,j1,j4,j3,vE],(e,t,r,n,i,a,s,o)=>{if(t){var{type:l}=t,c=pB(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*hJ(i[0]-i[1])*d:d,c&&s)?s.map((e,t)=>{var r=n.map(e);return pz(r)?{coordinate:r+d,value:e,index:t,offset:d}:null}).filter(fe):n.domain().map((e,t)=>{var r=n.map(e);return pz(r)?{coordinate:r+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(fe)}}}),j8=d5([jd,jh,e=>e.tooltip.settings],(e,t,r)=>jf(r.shared,e,t)),j7=e=>e.tooltip.settings.trigger,j9=e=>e.tooltip.settings.defaultIndex,we=d5([jN,j8,j7,j9],jg),wt=d5([we,j_,br,jZ],jv),wr=d5([j6,wt],jm),wn=d5([we],e=>{if(e)return e.dataKey});d5([we],e=>{if(e)return e.graphicalItemId});var wi=d5([jN,j8,j7,j9],jj),wa=d5([pX,pQ,mj,p5,j6,j9,wi],jb),ws=d5([we,wa],(e,t)=>null!=e&&e.coordinate?e.coordinate:t),wo=d5([we],e=>{var t;return null!=(t=null==e?void 0:e.active)&&t}),wl=d5([wi,wt,gU,br,wr,jw,j8],jO);function wc(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 wu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wc(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)):wc(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}d5([wl],e=>{if(null!=e)return Array.from(new Set(e.map(e=>e.payload).filter(e=>null!=e)))});var wd=(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(hJ(l-o)!==hJ(c-l)){var d,h,f,p,m,x,y,g=[];if(hJ(c-l)===hJ(i[1]-i[0])){u=c;var v=l+i[1]-i[0];g[0]=Math.min(v,(v+o)/2),g[1]=Math.max(v,(v+o)/2)}else{u=o;var b=c+i[1]-i[0];g[0]=Math.min(l,(b+l)/2),g[1]=Math.max(l,(b+l)/2)}var j=[Math.min(l,(u+l)/2),Math.max(l,(u+l)/2)];if(e>j[0]&&e<=j[1]||e>=g[0]&&e<=g[1])return null==(y=r[s])?void 0:y.index}else{var w,N=Math.min(o,c),k=Math.max(o,c);if(e>(N+l)/2&&e<=(k+l)/2)return null==(w=r[s])?void 0:w.index}}else if(t)for(var S=0;S<a;S++){var O=t[S];if(null!=O){var P=t[S+1],C=t[S-1];if(0===S&&null!=P&&e<=(O.coordinate+P.coordinate)/2||S===a-1&&null!=C&&e>(O.coordinate+C.coordinate)/2||S>0&&S<a-1&&null!=C&&null!=P&&e>(O.coordinate+C.coordinate)/2&&e<=(O.coordinate+P.coordinate)/2)return O.index}}return -1},wh=(e,t)=>t,wf=(e,t,r)=>r,wp=(e,t,r,n)=>n,wm=d5(j6,e=>(0,pP.default)(e,e=>e.coordinate)),wx=d5([jN,wh,wf,wp],jg),wy=d5([wx,j_,br,jZ],jv),wg=d5([jN,wh,wf,wp],jj),wv=d5([pX,pQ,mj,p5,j6,wp,wg],jb),wb=d5([wx,wv],(e,t)=>{var r;return null!=(r=e.coordinate)?r:t}),wj=d5([j6,wy],jm),ww=d5([wg,wy,gU,br,wj,jw,wh],jO),wN=d5([wx,wy],(e,t)=>({isActive:e.active&&null!=t,activeIndex:t})),wk=d5([(e,t)=>t,mj,vj,vE,j2,j6,wm,p5],(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=wd("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?vt(vt({},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=wd("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 wu(wu(wu({},n),vn(n.cx,n.cy,s,a)),{},{angle:a,radius:s})}var o=i.coordinate,{angle:l}=n;return wu(wu(wu({},n),vn(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}}}),wS=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)}},wO=hs("mouseClick"),wP=hY();wP.startListening({actionCreator:wO,effect:(e,t)=>{var r=e.payload,n=wk(t.getState(),wS(r));(null==n?void 0:n.activeIndex)!=null&&t.dispatch(pi({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var wC=hs("mouseMove"),wE=hY(),wM=null;function wA(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 wT(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 w_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wT(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)):wT(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}wE.startListening({actionCreator:wC,effect:(e,t)=>{var r=e.payload;null!==wM&&cancelAnimationFrame(wM);var n=wS(r);wM=requestAnimationFrame(()=>{var e=t.getState();if("axis"===jp(e,e.tooltip.settings.shared)){var r=wk(e,n);(null==r?void 0:r.activeIndex)!=null?t.dispatch(pn({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate})):t.dispatch(pt())}wM=null})}});var wD=hy({name:"cartesianAxis",initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:hd()},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:hd()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:hd()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:hd()},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:hd()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:hd()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:hd()},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:hd()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:hd()},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]=w_(w_({},i),{},{width:n,widthHistory:o})}}}}),{addXAxis:wI,replaceXAxis:wz,removeXAxis:wL,addYAxis:wR,replaceYAxis:wF,removeYAxis:w$,addZAxis:wB,replaceZAxis:wU,removeZAxis:wV,updateYAxisWidth:wq}=wD.actions,wK=wD.reducer,wW=hy({name:"graphicalItems",initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:hd()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=dR(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:hd()},removeCartesianGraphicalItem:{reducer(e,t){var r=dR(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:hd()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:hd()},removePolarGraphicalItem:{reducer(e,t){var r=dR(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:hd()}}}),{addCartesianGraphicalItem:wH,replaceCartesianGraphicalItem:wY,removeCartesianGraphicalItem:wX,addPolarGraphicalItem:wQ,removePolarGraphicalItem:wG}=wW.actions,wZ=wW.reducer,wJ=hy({name:"referenceElements",initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=dR(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=dR(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=dR(e).lines.findIndex(e=>e===t.payload);-1!==r&&e.lines.splice(r,1)}}}),{addDot:w0,removeDot:w1,addArea:w2,removeArea:w5,addLine:w4,removeLine:w3}=wJ.actions,w6=wJ.reducer,w8={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},w7=hy({name:"brush",initialState:w8,reducers:{setBrushSettings:(e,t)=>null==t.payload?w8:t.payload}}),{setBrushSettings:w9}=w7.actions,Ne=w7.reducer,Nt=hy({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:hd()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,i=dR(e).payload.indexOf(r);i>-1&&(e.payload[i]=n)},prepare:hd()},removeLegendPayload:{reducer(e,t){var r=dR(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:hd()}}}),{setLegendSize:Nr,setLegendSettings:Nn,addLegendPayload:Ni,replaceLegendPayload:Na,removeLegendPayload:Ns}=Nt.actions,No=Nt.reducer,Nl={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},Nc=hy({name:"rootProps",initialState:Nl,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=null!=(r=t.payload.barGap)?r:Nl.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}}}),Nu=Nc.reducer,{updateOptions:Nd}=Nc.actions,Nh=hy({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:Nf,removeRadiusAxis:Np,addAngleAxis:Nm,removeAngleAxis:Nx}=Nh.actions,Ny=Nh.reducer,Ng=hy({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:Nv}=Ng.actions,Nb=Ng.reducer,Nj=hs("keyDown"),Nw=hs("focus"),NN=hY();NN.startListening({actionCreator:Nj,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=jv(n,j_(r),br(r),jZ(r)),s=null==a?-1:Number(a);if(Number.isFinite(s)&&!(s<0)){var o=j6(r);if("Enter"===i){var l=wv(r,"axis","hover",String(n.index));t.dispatch(ps({active:!n.active,activeIndex:n.index,activeCoordinate:l}));return}var c=s+("ArrowRight"===i?1:-1)*("left-to-right"===ju(r)?1:-1);if(null!=o&&!(c>=o.length)&&!(c<0)){var u=wv(r,"axis","hover",String(c));t.dispatch(ps({active:!0,activeIndex:c.toString(),activeCoordinate:u}))}}}}}),NN.startListening({actionCreator:Nw,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=wv(r,"axis","hover",String("0"));t.dispatch(ps({active:!0,activeIndex:"0",activeCoordinate:i}))}}}});var Nk=hs("externalEvent"),NS=hY(),NO=new Map;NS.startListening({actionCreator:Nk,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(null!=r){n.persist();var i=n.type,a=NO.get(i);void 0!==a&&cancelAnimationFrame(a);var s=requestAnimationFrame(()=>{try{var e=t.getState(),a={activeCoordinate:ws(e),activeDataKey:wn(e),activeIndex:wt(e),activeLabel:wr(e),activeTooltipIndex:wt(e),isTooltipActive:wo(e)};r(a,n)}finally{NO.delete(i)}});NO.set(i,s)}}});var NP=d5([jN],e=>e.tooltipItemPayloads),NC=d5([NP,(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)}}}),NE=hs("touchMove"),NM=hY();NM.startListening({actionCreator:NE,effect:(e,t)=>{var r=e.payload;if(null!=r.touches&&0!==r.touches.length){var n=t.getState(),i=jp(n,n.tooltip.settings.shared);if("axis"===i){var a=r.touches[0];if(null==a)return;var s=wk(n,wS({clientX:a.clientX,clientY:a.clientY,currentTarget:r.currentTarget}));(null==s?void 0:s.activeIndex)!=null&&t.dispatch(pn({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=jM(n).find(e=>e.id===d);if(null==u||null==h||null==d)return;var{dataKey:f}=h,p=NC(n,u,d);t.dispatch(f9({activeDataKey:f,activeIndex:u,activeCoordinate:p,activeGraphicalItemId:d}))}}}});var NA=hy({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:NT,replaceErrorBar:N_,removeErrorBar:ND}=NA.actions,NI=NA.reducer,Nz={devToolsEnabled:!0,isSsr:!("u">typeof window&&window.document&&window.document.createElement&&window.setTimeout)};function NL(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 NR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?NL(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)):NL(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var NF={zIndexMap:Object.values(vi).reduce((e,t)=>NR(NR({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},N$=new Set(Object.values(vi)),NB=hy({name:"zIndex",initialState:NF,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:hd()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!N$.has(r)&&delete e.zIndexMap[r])},prepare:hd()},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:hd()},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:hd()}}}),{registerZIndexPortal:NU,unregisterZIndexPortal:NV,registerZIndexPortalElement:Nq,unregisterZIndexPortalElement:NK}=NB.actions,NW=he({brush:Ne,cartesianAxis:wK,chartData:ph,errorBars:NI,graphicalItems:wZ,layout:pg,legend:No,options:fi,polarAxis:Ny,polarOptions:Nb,referenceElements:w6,rootProps:Nu,tooltip:po,zIndex:NB.reducer}),NH=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 ho;return t&&("boolean"==typeof t?a.push(hi):a.push(hn(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(d9(a))t=he(a);else throw Error(hX(1));r="function"==typeof s?s(i):i();let d=ht;o&&(d=ha({trace:!1,..."object"==typeof o&&o}));let h=(n=function(...e){return t=>(r,n)=>{let i=t(r,n),a=()=>{throw Error(d3(15))},s={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=ht(...e.map(e=>e(s)))(i.dispatch),{...i,dispatch:a}}}(...r),function(e){let{autoBatch:t=!0}=e??{},r=new ho(n);return t&&r.push(hf("object"==typeof t?t:void 0)),r});return function e(t,r,n){if("function"!=typeof t)throw Error(d3(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(d3(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(d3(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(d3(3));return a}function h(e){if("function"!=typeof e)throw Error(d3(4));if(c)throw Error(d3(5));let t=!0;u();let r=l++;return o.set(r,e),function(){if(t){if(c)throw Error(d3(6));t=!1,u(),o.delete(r),s=null}}}function f(e){if(!d9(e))throw Error(d3(7));if(void 0===e.type)throw Error(d3(8));if("string"!=typeof e.type)throw Error(d3(17));if(c)throw Error(d3(9));try{c=!0,a=i(a,e)}finally{c=!1}return(s=o).forEach(e=>{e()}),e}return f({type:d7.INIT}),{dispatch:f,subscribe:h,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw Error(d3(10));i=e,f({type:d7.REPLACE})},[d6]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(d3(11));function t(){e.next&&e.next(d())}return t(),{unsubscribe:h(t)}},[d6](){return this}}}}}(t,c,d(..."function"==typeof u?u(h):h()))}({reducer:NW,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes("es6")}).concat([wP.middleware,wE.middleware,NN.middleware,NS.middleware,NM.middleware]),enhancers:e=>{var t=e;return"function"==typeof e&&(t=e()),t.concat(hf({type:"raf"}))},devTools:Nz.devToolsEnabled&&{serialize:{replacer:wA},name:"recharts-".concat(t)}})};function NY(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=p8(),a=(0,H.useRef)(null);return i?r:(null==a.current&&(a.current=NH(t,n)),H.createElement(fp,{context:pb,store:a.current},r))}var NX=e=>{var{chartData:t}=e,r=pw(),n=p8();return(0,H.useEffect)(()=>n?()=>{}:(r(pc(t)),()=>{r(pc(void 0))}),[t,r,n]),null},NQ=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function NG(e,t){for(var r of new Set([...Object.keys(e),...Object.keys(t)]))if(NQ.has(r)){if(null==e[r]&&null==t[r])continue;if(!function(e,t){if(fu(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])||!fu(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 NZ=(0,H.memo)(function(e){var{layout:t,margin:r}=e,n=pw(),i=p8();return(0,H.useEffect)(()=>{i||(n(pm(t)),n(pp(r)))},[n,i,t,r]),null},NG);function NJ(e){var t=pw();return(0,H.useEffect)(()=>{t(Nd(e))},[t,e]),null}var N0=()=>{var e;return null==(e=pO(e=>e.rootProps.accessibilityLayer))||e},N1=["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 N2(e){return"string"==typeof e&&N1.includes(e)}var N5=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 N4(e){return"string"==typeof e&&N5.has(e)}function N3(e){return"string"==typeof e&&e.startsWith("data-")}function N6(e){if("object"!=typeof e||null===e)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(N4(r)||N3(r))&&(t[r]=e[r]);return t}function N8(e){return null==e?null:(0,H.isValidElement)(e)&&"object"==typeof e.props&&null!==e.props?N6(e.props):"object"!=typeof e||Array.isArray(e)?null:N6(e)}function N7(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(N4(r)||N3(r)||N2(r))&&(t[r]=e[r]);return t}var N9=["children","width","height","viewBox","className","style","title","desc"];function ke(){return(ke=Object.assign.bind()).apply(null,arguments)}var kt=(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,N9),d=a||{width:n,height:i,x:0,y:0},h=sl("recharts-surface",s);return H.createElement("svg",ke({},N7(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)}),kr=d5(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}}),kn=d5(e=>e.zIndex.zIndexMap,e=>Array.from(new Set(Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(vi)))).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 ki(e){var{zIndex:t,isPanorama:r}=e,n=(0,H.useRef)(null),i=pw();return(0,H.useLayoutEffect)(()=>(n.current&&i(Nq({zIndex:t,element:n.current,isPanorama:r})),()=>{i(NK({zIndex:t,isPanorama:r}))}),[i,t,r]),H.createElement("g",{tabIndex:-1,ref:n})}function ka(e){var{children:t,isPanorama:r}=e,n=pO(kn);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(ki,{key:e,zIndex:e,isPanorama:r})),t,a.map(e=>H.createElement(ki,{key:e,zIndex:e,isPanorama:r})))}var ks=["children"];function ko(){return(ko=Object.assign.bind()).apply(null,arguments)}var kl={width:"100%",height:"100%",display:"block"},kc=(0,H.forwardRef)((e,t)=>{var r,n,i=pO(pX),a=pO(pQ),s=N0();if(!pL(i)||!pL(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(kt,ko({},l,{title:c,desc:u,role:n,tabIndex:r,width:i,height:a,style:kl,ref:t}),o)}),ku=e=>{var{children:t}=e,r=pO(p9);if(!r)return null;var{width:n,height:i,y:a,x:s}=r;return H.createElement(kt,{width:n,height:i,x:s,y:a},t)},kd=(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,ks);return p8()?H.createElement(ku,null,H.createElement(ka,{isPanorama:!0},r)):H.createElement(kc,ko({ref:t},n),H.createElement(ka,{isPanorama:!1},r))}),kh=new(e.i(236)).default,kf="recharts.syncEvent.tooltip",kp="recharts.syncEvent.brush";function km(e){return e.tooltip.syncInteraction}var kx=["x","y"];function ky(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 kg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ky(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)):ky(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var kv=(0,H.createContext)(null),kb=(0,H.createContext)(null);function kj(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 kw(){return(kw=Object.assign.bind()).apply(null,arguments)}var kN=()=>{var e,t,r,n,i,a,s,o,l,c,u,d;return e=pw(),(0,H.useEffect)(()=>{e(fa())},[e]),t=pO(g8),r=pO(g9),n=pw(),i=pO(g7),a=pO(j6),s=pO(mj),o=mv(),l=pO(e=>e.rootProps.className),(0,H.useEffect)(()=>{if(null==t)return ft;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,kx),{x:x,y:y,width:g,height:v}=l.payload.sourceViewBox,b=kg(kg({},m),{},{x:o.x+(g?(f-x)/g:0)*o.width,y:o.y+(v?(p-y)/v:0)*o.height});n(kg(kg({},l),{},{payload:kg(kg({},l.payload),{},{coordinate:b})}))}else n(l);return}if(null!=a){if("function"==typeof i){var j=i(a,{activeTooltipIndex:null==l.payload.index?void 0:Number(l.payload.index),isTooltipActive:l.payload.active,activeIndex:null==l.payload.index?void 0:Number(l.payload.index),activeLabel:l.payload.label,activeDataKey:l.payload.dataKey,activeCoordinate:l.payload.coordinate});d=a[j]}else"value"===i&&(d=a.find(e=>String(e.value)===l.payload.label));var{coordinate:w}=l.payload;if(null==d||!1===l.payload.active||null==w||null==o)return void n(pa({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));var{x:N,y:k}=w,S=Math.min(N,o.x+o.width),O=Math.min(k,o.y+o.height),P={x:"horizontal"===s?d.coordinate:S,y:"horizontal"===s?O:d.coordinate};n(pa({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 kh.on(kf,e),()=>{kh.off(kf,e)}},[l,n,r,t,i,a,s,o]),c=pO(g8),u=pO(g9),d=pw(),(0,H.useEffect)(()=>{if(null==c)return ft;var e=(e,t,r)=>{u!==r&&c===e&&d(pu(t))};return kh.on(kp,e),()=>{kh.off(kp,e)}},[d,u,c]),null};function kk(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var kS=(0,H.forwardRef)((e,t)=>{var r,n,i=(0,H.useRef)(null),[a,s]=(0,H.useState)({containerWidth:kk(null==(r=e.style)?void 0:r.width),containerHeight:kk(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(mk,{width:a.containerWidth,height:a.containerHeight}),H.createElement("div",kw({ref:l},e)))}),kO=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e,[i,a]=(0,H.useState)({containerWidth:kk(r),containerHeight:kk(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(mk,{width:i.containerWidth,height:i.containerHeight}),H.createElement("div",kw({ref:o},e)))}),kP=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e;return H.createElement(H.Fragment,null,H.createElement(mk,{width:r,height:n}),H.createElement("div",kw({ref:t},e)))}),kC=(0,H.forwardRef)((e,t)=>{var{width:r,height:n}=e;return"string"==typeof r||"string"==typeof n?H.createElement(kO,kw({},e,{ref:t})):"number"==typeof r&&"number"==typeof n?H.createElement(kP,kw({},e,{width:r,height:n,ref:t})):H.createElement(H.Fragment,null,H.createElement(mk,{width:r,height:n}),H.createElement("div",kw({ref:t},e)))}),kE=(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),j=pw(),[w,N]=(0,H.useState)(null),[k,S]=(0,H.useState)(null),O=function(){var e=pw(),[t,r]=(0,H.useState)(null),n=pO(pG);return(0,H.useEffect)(()=>{if(null!=t){var r=t.getBoundingClientRect().width/t.offsetWidth;pz(r)&&r!==n&&e(py(r))}},[t,e,n]),r}(),P=mm(),C=(null==P?void 0:P.width)>0?P.width:y,E=(null==P?void 0:P.height)>0?P.height:i,M=(0,H.useCallback)(e=>{O(e),"function"==typeof t&&t(e),N(e),S(e),null!=e&&(b.current=e)},[O,t,N,S]),A=(0,H.useCallback)(e=>{j(wO(e)),j(Nk({handler:a,reactEvent:e}))},[j,a]),T=(0,H.useCallback)(e=>{j(wC(e)),j(Nk({handler:c,reactEvent:e}))},[j,c]),_=(0,H.useCallback)(e=>{j(pt()),j(Nk({handler:u,reactEvent:e}))},[j,u]),D=(0,H.useCallback)(e=>{j(wC(e)),j(Nk({handler:d,reactEvent:e}))},[j,d]),I=(0,H.useCallback)(()=>{j(Nw())},[j]),z=(0,H.useCallback)(e=>{j(Nj(e.key))},[j]),L=(0,H.useCallback)(e=>{j(Nk({handler:s,reactEvent:e}))},[j,s]),R=(0,H.useCallback)(e=>{j(Nk({handler:o,reactEvent:e}))},[j,o]),F=(0,H.useCallback)(e=>{j(Nk({handler:l,reactEvent:e}))},[j,l]),$=(0,H.useCallback)(e=>{j(Nk({handler:h,reactEvent:e}))},[j,h]),B=(0,H.useCallback)(e=>{j(Nk({handler:m,reactEvent:e}))},[j,m]),U=(0,H.useCallback)(e=>{v&&j(NE(e)),j(Nk({handler:p,reactEvent:e}))},[j,v,p]),V=(0,H.useCallback)(e=>{j(Nk({handler:f,reactEvent:e}))},[j,f]);return H.createElement(kv.Provider,{value:w},H.createElement(kb.Provider,{value:k},H.createElement(g?kS:kC,{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?kj(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)):kj(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:A,onContextMenu:L,onDoubleClick:R,onFocus:I,onKeyDown:z,onMouseDown:F,onMouseEnter:T,onMouseLeave:_,onMouseMove:D,onMouseUp:$,onTouchEnd:V,onTouchMove:U,onTouchStart:B,ref:M},H.createElement(kN,null),r)))}),kM=d5([p5],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),kA=d5([kM,pX,pQ],(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)}}),kT=(0,H.createContext)(void 0),k_=e=>{var{children:t}=e,[r]=(0,H.useState)("".concat(h3("recharts"),"-clip")),n=pO(kA);if(null==n)return null;var{x:i,y:a,width:s,height:o}=n;return H.createElement(kT.Provider,{value:r},H.createElement("defs",null,H.createElement("clipPath",{id:r},H.createElement("rect",{x:i,y:a,height:o,width:s}))),t)},kD=["width","height","responsive","children","className","style","compact","title","desc"],kI=(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=N6(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,kD));return l?H.createElement(H.Fragment,null,H.createElement(mk,{width:r,height:n}),H.createElement(kd,{otherAttributes:d,title:c,desc:u},a)):H.createElement(kE,{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(kd,{otherAttributes:d,title:c,desc:u,ref:t},H.createElement(k_,null,a)))});function kz(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 kL(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kz(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)):kz(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 kR(){return(kR=Object.assign.bind()).apply(null,arguments)}var kF={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"},k$=(0,H.forwardRef)(function(e,t){var r,n=kL(e.categoricalChartProps,kF),{chartName:i,defaultTooltipEventType:a,validateTooltipEventTypes:s,tooltipPayloadSearcher:o,categoricalChartProps:l}=e;return H.createElement(NY,{preloadedState:{options:{chartName:i,defaultTooltipEventType:a,validateTooltipEventTypes:s,tooltipPayloadSearcher:o,eventEmitter:void 0}},reduxStoreName:null!=(r=l.id)?r:i},H.createElement(NX,{chartData:l.data}),H.createElement(NZ,{layout:n.layout,margin:n.margin}),H.createElement(NJ,{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(kI,kR({},n,{ref:t})))}),kB=["axis","item"],kU=(0,H.forwardRef)((e,t)=>H.createElement(k$,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:kB,tooltipPayloadSearcher:fr,categoricalChartProps:e,ref:t})),kV=H,kq=["children","className"];function kK(){return(kK=Object.assign.bind()).apply(null,arguments)}var kW=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,kq),a=sl("recharts-layer",n);return H.createElement("g",kK({className:a},N7(i),{ref:t}),r)}),kH=e=>null;kH.displayName="Cell";var kY=e.i(9944);function kX(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 kQ=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kX(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)):kX(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},{cacheSize:2e3,enableCache:!0}),kG=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}}(kQ.cacheSize),kZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},kJ="recharts_measurement_span",k0=(e,t)=>{try{var r=document.getElementById(kJ);r||((r=document.createElement("span")).setAttribute("id",kJ),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,kZ,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch(e){return{width:0,height:0}}},k1=function(e){var t,r,n,i,a,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||Nz.isSsr)return{width:0,height:0};if(!kQ.enableCache)return k0(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=kG.get(l);if(c)return c;var u=k0(e,o);return kG.set(l,u),u},k2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,k5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,k4=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,k3=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,k6={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},k8=["cm","mm","pt","pc","in","Q","px"];class k7{static parse(e){var t,[,r,n]=null!=(t=k3.exec(e))?t:[];return null==r?k7.NaN:new k7(parseFloat(r),null!=n?n:"")}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,h0(e)&&(this.unit=""),""===t||k4.test(t)||(this.num=NaN,this.unit=""),k8.includes(t)&&(this.num=e*k6[t],this.unit="px")}add(e){return this.unit!==e.unit?new k7(NaN,""):new k7(this.num+e.num,this.unit)}subtract(e){return this.unit!==e.unit?new k7(NaN,""):new k7(this.num-e.num,this.unit)}multiply(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new k7(NaN,""):new k7(this.num*e.num,this.unit||e.unit)}divide(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new k7(NaN,""):new k7(this.num/e.num,this.unit||e.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return h0(this.num)}}function k9(e){if(null==e||e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,a]=null!=(r=k2.exec(t))?r:[],s=k7.parse(null!=n?n:""),o=k7.parse(null!=a?a:""),l="*"===i?s.multiply(o):s.divide(o);if(l.isNaN())return"NaN";t=t.replace(k2,l.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var c,[,u,d,h]=null!=(c=k5.exec(t))?c:[],f=k7.parse(null!=u?u:""),p=k7.parse(null!=h?h:""),m="+"===d?f.add(p):f.subtract(p);if(m.isNaN())return"NaN";t=t.replace(k5,m.toString())}return t}h="NaN",f=new k7(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 k7?Object.defineProperty(k7,h,{value:f,enumerable:!0,configurable:!0,writable:!0}):k7[h]=f;var Se=/\(([^()]*)\)/;function St(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t,r=e;null!=(t=Se.exec(r));){var[,n]=t;r=r.replace(Se,k9(n))}return r}(t),t=k9(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var Sr=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Sn=["dx","dy","angle","className","breakAll"];function Si(){return(Si=Object.assign.bind()).apply(null,arguments)}function Sa(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 Ss=/[ \f\n\r\t\v\u2028\u2029]+/,So=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];null!=t&&(i=r?t.toString().split(""):t.toString().split(Ss));var a=i.map(e=>({word:e,width:k1(e,n).width})),s=r?0:k1(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch(e){return null}},Sl=(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},[]),Sc=e=>e.reduce((e,t)=>e.width>t.width?e:t),Su=(e,t,r,n,i,a,s,o)=>{var l=So({breakAll:r,style:n,children:e.slice(0,t)+"…"});if(!l)return[!1,[]];var c=Sl(l.wordsWithComputedWidth,a,s,o);return[c.length>i||Sc(c).width>Number(a),c]},Sd=e=>[{words:null==e?[]:e.toString().split(Ss),width:void 0}],Sh="#808080",Sf={angle:0,breakAll:!1,capHeight:"0.71em",fill:Sh,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Sp=(0,H.forwardRef)((e,t)=>{var r,n=kL(e,Sf),{x:i,y:a,lineHeight:s,capHeight:o,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,h=Sa(n,Sr),f=(0,H.useMemo)(()=>(e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:a,maxLines:s}=e;if((t||r)&&!Nz.isSsr){var o=So({breakAll:a,children:n,style:i});if(!o)return Sd(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=h2(s),d=String(o),h=Sl(t,n,r,i);if(!u||i||!(h.length>s||Sc(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]=Su(d,x-1,c,l,s,n,r,i),[v]=Su(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 Sd(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=Sa(h,Sn);if(!h5(i)||!h5(a)||0===f.length)return null;var b=Number(i)+(h2(p)?p:0),j=Number(a)+(h2(m)?m:0);if(!pz(b)||!pz(j))return null;switch(d){case"start":r=St("calc(".concat(o,")"));break;case"middle":r=St("calc(".concat((f.length-1)/2," * -").concat(s," + (").concat(o," / 2))"));break;default:r=St("calc(".concat(f.length-1," * -").concat(s,")"))}var w=[],N=f[0];if(c&&null!=N){var k=N.width,{width:S}=h;w.push("scale(".concat(h2(S)&&h2(k)?S/k:1,")"))}return x&&w.push("rotate(".concat(x,", ").concat(b,", ").concat(j,")")),w.length&&(v.transform=w.join(" ")),H.createElement("text",Si({},N7(v),{ref:t,x:b,y:j,className:sl("recharts-text",y),textAnchor:u,fill:l.includes("url")?Sh: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)}))});Sp.displayName="Text";var Sm=e.i(9854);function Sx(e){var{zIndex:t,children:r}=e,n=void 0!==pO(mj)&&void 0!==t&&0!==t,i=p8(),a=pw();(0,H.useLayoutEffect)(()=>n?(a(NU({zIndex:t})),()=>{a(NV({zIndex:t}))}):ft,[a,t,n]);var s=pO(e=>kr(e,t,i));return n?s?(0,Sm.createPortal)(r,s):null:r}function Sy(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 Sg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sy(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)):Sy(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Sv=["labelRef"],Sb=["content"];function Sj(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 Sw(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 SN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sw(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)):Sw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Sk(){return(Sk=Object.assign.bind()).apply(null,arguments)}var SS=(0,H.createContext)(null),SO=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(SS.Provider,{value:l},o)},SP=()=>{var e=(0,H.useContext)(SS),t=mv();return e||(t?mg(t):void 0)},SC=(0,H.createContext)(null),SE=e=>null!=e&&"function"==typeof e,SM=e=>null!=e&&"cx"in e&&h2(e.cx),SA={angle:0,offset:5,zIndex:vi.label,position:"middle",textBreakAll:!1};function ST(e){var t,r,n,i,a,s,o=kL(e,SA),{viewBox:l,parentViewBox:c,position:u,value:d,children:h,content:f,className:p="",textBreakAll:m,labelRef:x}=o,y=(t=(0,H.useContext)(SC),r=pO(vj),t||r),g=SP(),v=function(e){if(!SM(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:SM(l)?l:mg(l));if(!i||null==d&&null==h&&!(0,H.isValidElement)(f)&&"function"!=typeof f)return null;var b=SN(SN({},o),{},{viewBox:i});if((0,H.isValidElement)(f)){var{labelRef:j}=b,w=Sj(b,Sv);return(0,H.cloneElement)(f,w)}if("function"==typeof f){var{content:N}=b,k=Sj(b,Sb);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=N7(o);if(SM(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=hJ(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=vn(c,u,x,a),b=vn(c,u,x,a+(s?1:-1)*359),j="M".concat(v.x,",").concat(v.y,"\n A").concat(x,",").concat(x,",0,1,").concat(+!s,",\n ").concat(b.x,",").concat(b.y),w=null==e.id?h3("recharts-radial-line-"):e.id;return H.createElement("text",Sk({},n,{dominantBaseline:"central",className:sl("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:w,d:j})),H.createElement("textPath",{xlinkHref:"#".concat(w)},r))})(o,u,a,S,i);s=((e,t,r)=>{var{cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:o,endAngle:l}=e,c=(o+l)/2;if("outside"===r){var{x:u,y:d}=vn(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}=vn(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}=mg(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",j=g>0?"start":"end";if("top"===r){var w={x:s+c/2,y:o-m,horizontalAnchor:"middle",verticalAnchor:x};return a&&i&&(w.height=Math.max(o-i.y,0),w.width=c),w}if("bottom"===r){var N={x:d+u/2,y:o+l+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:j,verticalAnchor:"middle"};return a&&i&&(S.width=Math.max(i.x+i.width-S.x,0),S.height=l),S}var O=a&&i?{width:f,height:l}:{};return"insideLeft"===r?Sg({x:h+v,y:o+l/2,horizontalAnchor:j,verticalAnchor:"middle"},O):"insideRight"===r?Sg({x:h+f-v,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"},O):"insideTop"===r?Sg({x:s+c/2,y:o+m,horizontalAnchor:"middle",verticalAnchor:y},O):"insideBottom"===r?Sg({x:d+u/2,y:o+l-m,horizontalAnchor:"middle",verticalAnchor:x},O):"insideTopLeft"===r?Sg({x:s+v,y:o+m,horizontalAnchor:j,verticalAnchor:y},O):"insideTopRight"===r?Sg({x:s+c-v,y:o+m,horizontalAnchor:b,verticalAnchor:y},O):"insideBottomLeft"===r?Sg({x:d+v,y:o+l-m,horizontalAnchor:j,verticalAnchor:x},O):"insideBottomRight"===r?Sg({x:d+u-v,y:o+l-m,horizontalAnchor:b,verticalAnchor:x},O):r&&"object"==typeof r&&(h2(r.x)||h1(r.x))&&(h2(r.y)||h1(r.y))?Sg({x:s+h6(r.x,f),y:o+h6(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},O):Sg({x:s+c/2,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},O)})({viewBox:v,position:u,offset:o.offset,parentViewBox:SM(c)?void 0:c,clamp:!0});s=SN(SN({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(Sx,{zIndex:o.zIndex},H.createElement(Sp,Sk({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 S_(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(ST,Sk({key:"label-implicit"},n)):h5(e)?H.createElement(ST,Sk({key:"label-implicit",value:e},n)):(0,H.isValidElement)(e)?e.type===ST?(0,H.cloneElement)(e,SN({key:"label-implicit"},n)):H.createElement(ST,Sk({key:"label-implicit",content:e},n)):SE(e)?H.createElement(ST,Sk({key:"label-implicit",content:e},n)):e&&"object"==typeof e?H.createElement(ST,Sk({},e,{key:"label-implicit"},n)):null})(t,SP(),r)||null}ST.displayName="Label";var SD=["valueAccessor"],SI=["dataKey","clockWise","id","textBreakAll","zIndex"];function Sz(){return(Sz=Object.assign.bind()).apply(null,arguments)}function SL(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 SR=e=>Array.isArray(e.value)?(0,kY.default)(e.value):e.value,SF=(0,H.createContext)(void 0),S$=SF.Provider,SB=(0,H.createContext)(void 0);function SU(e){var{valueAccessor:t=SR}=e,r=SL(e,SD),{dataKey:n,clockWise:i,id:a,textBreakAll:s,zIndex:o}=r,l=SL(r,SI),c=(0,H.useContext)(SF),u=(0,H.useContext)(SB),d=c||u;return d&&d.length?H.createElement(Sx,{zIndex:null!=o?o:vi.label},H.createElement(kW,{className:"recharts-label-list"},d.map((e,i)=>{var o,c=null==n?t(e,i):p$(e.payload,n),u=null==a?{}:{id:"".concat(a,"-").concat(i)};return H.createElement(ST,Sz({key:"label-".concat(i)},N7(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 SV(e){var{label:t}=e;return t?!0===t?H.createElement(SU,{key:"labelList-implicit"}):H.isValidElement(t)||SE(t)?H.createElement(SU,{key:"labelList-implicit",content:t}):"object"==typeof t?H.createElement(SU,Sz({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}SB.Provider,SU.displayName="LabelList";var Sq=e.i(29095),SK=e=>"string"==typeof e?e:e?e.displayName||e.name||"Component":"",SW=null,SH=null,SY=e=>{if(e===SW&&Array.isArray(SH))return SH;var t=[];return H.Children.forEach(e,e=>{null!=e&&((0,Sq.isFragment)(e)?t=t.concat(SY(e.props.children)):t.push(e))}),SH=t,SW=e,t},SX=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,SQ=(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];N2(i)&&"function"==typeof a&&(n||(n={}),n[i]=e=>(a(t,r,e),null))}),n},SG=e.i(91804);function SZ(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 SJ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SZ(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)):SZ(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var S0=(e,t,r)=>e.map(e=>"".concat(e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))," ").concat(t,"ms ").concat(r)).join(","),S1=(e,t)=>Object.keys(t).reduce((r,n)=>SJ(SJ({},r),{},{[n]:e(n,t[n])}),{});function S2(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 S5(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S2(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)):S2(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var S4=(e,t,r)=>e+(t-e)*r,S3=e=>{var{from:t,to:r}=e;return t!==r},S6=(e,t,r)=>{var n=S1((t,r)=>{if(S3(r)){var[n,i]=e(r.from,r.to,r.velocity);return S5(S5({},r),{},{from:n,velocity:i})}return r},t);return r<1?S1((e,t)=>S3(t)&&null!=n[e]?S5(S5({},t),{},{velocity:S4(t.velocity,n[e].velocity,r),from:S4(t.from,n[e].from,r)}):t,t):S6(e,n,r-1)},S8=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],S7=(e,t)=>e.map((e,r)=>e*t**r).reduce((e,t)=>e+t),S9=(e,t)=>r=>S7(S8(e,t),r),Oe=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]},Ot=function(){return((e,t,r,n)=>{var i=S9(e,r),a=S9(t,n),s=t=>S7([...S8(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})(...Oe(...arguments))},Or=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 On{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 Oi=(0,H.createContext)(function(){var e,t,r,n,i;return e=new On,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}}),Oa={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Os={t:0},Oo={t:1};function Ol(e){var t,r,n,i=kL(e,Oa),{isActive:a,canBegin:s,duration:o,easing:l,begin:c,onAnimationEnd:u,onAnimationStart:d,children:h}=i,f="auto"===a?!Nz.isSsr:a,p=(t=i.animationId,r=i.animationManager,n=(0,H.useContext)(Oi),(0,H.useMemo)(()=>null!=r?r:n(t),[t,r,n])),[m,x]=(0,H.useState)(f?Os:Oo),y=(0,H.useRef)(null);return(0,H.useEffect)(()=>{f||x(Oo)},[f]),(0,H.useEffect)(()=>{if(!f||!s)return ft;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(S5(S5({},e),t)),()=>{}):!0===r.isStepper?(o=p.reduce((r,n)=>S5(S5({},r),{},{[n]:{from:e[n],velocity:0,to:t[n]}}),{}),l=null,c=n=>{s||(s=n);var u=(n-s)/r.dt;o=S6(r,o,u),i(S5(S5(S5({},e),t),S1((e,t)=>t.from,o))),s=n,Object.values(o).filter(S3).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:S5(S5({},r),{},{[n]:[i,a]})},{}),f=s=>{u||(u=s);var o=(s-u)/n,l=S1((e,t)=>S4(...t,r(o)),h);if(i(S5(S5(S5({},e),t),l)),o<1)d=a.setTimeout(f);else{var c=S1((e,t)=>S4(...t,r(1)),h);i(S5(S5(S5({},e),t),c))}},()=>(d=a.setTimeout(f),()=>{var e;null==(e=d)||e()}))})(Os,Oo,(e=>{if("string"==typeof e)switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Ot(e);case"spring":return Or();default:if("cubic-bezier"===e.split("(")[0])return Ot(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 Oc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"animation-",r=(0,H.useRef)(h3(t)),n=(0,H.useRef)(e);return n.current!==e&&(r.current=h3(t),n.current=e),r.current}var Ou=["radius"],Od=["radius"];function Oh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Of(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oh(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)):Oh(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Op(){return(Op=Object.assign.bind()).apply(null,arguments)}function Om(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 Ox(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Oy=(e,t,r,n,i)=>{var a=hG(r),s=hG(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=hZ(N||(N=Ox(["M",",",""])),e,t+l*d[0]),d[0]>0&&(f+=hZ(k||(k=Ox(["A ",",",",0,0,",",",",",""])),d[0],d[0],u,e+c*d[0],t)),f+=hZ(S||(S=Ox(["L ",",",""])),e+r-c*d[1],t),d[1]>0&&(f+=hZ(O||(O=Ox(["A ",",",",0,0,",",\n ",",",""])),d[1],d[1],u,e+r,t+l*d[1])),f+=hZ(P||(P=Ox(["L ",",",""])),e+r,t+n-l*d[2]),d[2]>0&&(f+=hZ(C||(C=Ox(["A ",",",",0,0,",",\n ",",",""])),d[2],d[2],u,e+r-c*d[2],t+n)),f+=hZ(E||(E=Ox(["L ",",",""])),e+c*d[3],t+n),d[3]>0&&(f+=hZ(M||(M=Ox(["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=hZ(A||(A=Ox(["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=hZ(T||(T=Ox(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},Og={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ov=e=>{var t=kL(e,Og),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=Oc((0,H.useMemo)(()=>({x:a,y:s,width:o,height:l,radius:c}),[a,s,o,l,c]),"rectangle-");if(a!==+a||s!==+s||o!==+o||l!==+l||0===o||0===l)return null;var j=sl("recharts-rectangle",u);if(!m){var w=N7(t),{radius:N}=w,k=Om(w,Ou);return H.createElement("path",Op({},k,{x:hG(a),y:hG(s),width:hG(o),height:hG(l),radius:"number"==typeof c?c:void 0,className:j,d:Oy(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"),M="".concat(n,"px 0px"),A=S0(["strokeDasharray"],h,"string"==typeof d?d:Og.animationEasing);return H.createElement(Ol,{animationId:b,key:b,canBegin:n>0,duration:h,easing:d,isActive:m,begin:f},e=>{var n,i=h7(S,o,e),u=h7(O,l,e),d=h7(P,a,e),h=h7(C,s,e);r.current&&(x.current=i,y.current=u,g.current=d,v.current=h),n=p?e>0?{transition:A,strokeDasharray:M}:{strokeDasharray:E}:{strokeDasharray:M};var f=N7(t),{radius:m}=f,b=Om(f,Od);return H.createElement("path",Op({},b,{radius:"number"==typeof c?c:void 0,className:j,d:Oy(d,h,i,u,c),ref:r,style:Of(Of({},n),t.style)}))})};function Ob(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 Oj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ob(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)):Ob(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ow(){return(Ow=Object.assign.bind()).apply(null,arguments)}function ON(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ok=(e,t,r,n,i)=>{var a=r-n;return hZ(_||(_=ON(["M ",",",""])),e,t)+hZ(D||(D=ON(["L ",",",""])),e+r,t)+hZ(I||(I=ON(["L ",",",""])),e+r-a/2,t+i)+hZ(z||(z=ON(["L ",",",""])),e+r-a/2-n,t+i)+hZ(L||(L=ON(["L ",","," Z"])),e,t)},OS={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},OO=e=>{var t=kL(e,OS),{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=Oc(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 j=sl("recharts-trapezoid",o);if(!d)return H.createElement("g",null,H.createElement("path",Ow({},N7(t),{className:j,d:Ok(r,n,i,a,s)})));var w=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=S0(["strokeDasharray"],c,l);return H.createElement(Ol,{animationId:b,key:b,canBegin:f>0,duration:c,easing:l,isActive:d,begin:u},e=>{var o=h7(w,i,e),l=h7(N,a,e),c=h7(k,s,e),u=h7(S,r,e),d=h7(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",Ow({},N7(t),{className:j,d:Ok(u,d,o,l,c),ref:h,style:Oj(Oj({},f),t.style)}))})};function OP(){return(OP=Object.assign.bind()).apply(null,arguments)}function OC(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var OE=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)/vr,d=l?i:i+a*u,h=vn(t,r,c,d);return{center:h,circleTangency:vn(t,r,n,d),lineTangency:vn(t,r,c*Math.cos(u*vr),l?i-a*u:i),theta:u}},OM=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:a,endAngle:s}=e,o=hJ(s-a)*Math.min(Math.abs(s-a),359.999),l=a+o,c=vn(t,r,i,a),u=vn(t,r,i,l),d=hZ(R||(R=OC(["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=vn(t,r,n,a),f=vn(t,r,n,l);d+=hZ(F||(F=OC(["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+=hZ($||($=OC(["L ",","," Z"])),t,r);return d},OA={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},OT=e=>{var t,r=kL(e,OA),{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=h6(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=hJ(c-l),{circleTangency:d,lineTangency:h,theta:f}=OE({cx:t,cy:r,radius:i,angle:l,sign:u,cornerRadius:a,cornerIsExternal:o}),{circleTangency:p,lineTangency:m,theta:x}=OE({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?hZ(B||(B=OC(["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)):OM({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:c});var g=hZ(U||(U=OC(["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:j}=OE({cx:t,cy:r,radius:n,angle:l,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),{circleTangency:w,lineTangency:N,theta:k}=OE({cx:t,cy:r,radius:n,angle:c,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),S=o?Math.abs(l-c):Math.abs(l-c)-j-k;if(S<0&&0===a)return"".concat(g,"L").concat(t,",").concat(r,"Z");g+=hZ(V||(V=OC(["L",",","\n A",",",",0,0,",",",",","\n A",",",",0,",",",",",",","\n A",",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(u<0),w.x,w.y,n,n,+(S>180),+(u>0),v.x,v.y,a,a,+(u<0),b.x,b.y)}else g+=hZ(q||(q=OC(["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}):OM({cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d}),H.createElement("path",OP({},N7(r),{className:f,d:t}))};let O_=Math.PI,OD=2*O_,OI=OD-1e-6;function Oz(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class OL{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?Oz:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Oz;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((O_-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%OD+OD),d>OI?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>=O_)},${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 OR(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 OL(t)}OL.prototype;let OF=Math.cos,O$=Math.sin,OB=Math.sqrt,OU=Math.PI,OV=2*OU;OB(3);let Oq={draw(e,t){let r=OB(t/OU);e.moveTo(r,0),e.arc(0,0,r,0,OV)}},OK=OB(1/3),OW=2*OK,OH=O$(OU/10)/O$(7*OU/10),OY=O$(OV/10)*OH,OX=-OF(OV/10)*OH,OQ=OB(3);OB(3);let OG=OB(3)/2,OZ=1/OB(12),OJ=(OZ/2+1)*3;var O0=["type","size","sizeType"];function O1(){return(O1=Object.assign.bind()).apply(null,arguments)}function O2(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 O5(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O2(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)):O2(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var O4={symbolCircle:Oq,symbolCross:{draw(e,t){let r=OB(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=OB(t/OW),n=r*OK;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},symbolSquare:{draw(e,t){let r=OB(t),n=-r/2;e.rect(n,n,r,r)}},symbolStar:{draw(e,t){let r=OB(.8908130915292852*t),n=OY*r,i=OX*r;e.moveTo(0,-r),e.lineTo(n,i);for(let t=1;t<5;++t){let a=OV*t/5,s=OF(a),o=O$(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=-OB(t/(3*OQ));e.moveTo(0,2*r),e.lineTo(-OQ*r,-r),e.lineTo(OQ*r,-r),e.closePath()}},symbolWye:{draw(e,t){let r=OB(t/OJ),n=r/2,i=r*OZ,a=r*OZ+r,s=-n;e.moveTo(n,i),e.lineTo(n,a),e.lineTo(s,a),e.lineTo(-.5*n-OG*i,OG*n+-.5*i),e.lineTo(-.5*n-OG*a,OG*n+-.5*a),e.lineTo(-.5*s-OG*a,OG*s+-.5*a),e.lineTo(-.5*n+OG*i,-.5*i-OG*n),e.lineTo(-.5*n+OG*a,-.5*a-OG*n),e.lineTo(-.5*s+OG*a,-.5*a-OG*s),e.closePath()}}},O3=Math.PI/180,O6=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=O5(O5({},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,O0)),{},{type:t,size:r,sizeType:n}),a="circle";"string"==typeof t&&(a=t);var{className:s,cx:o,cy:l}=i,c=N7(i);return h2(o)&&h2(l)&&h2(r)?H.createElement("path",O1({},c,{className:sl("recharts-symbols",s),transform:"translate(".concat(o,", ").concat(l,")"),d:(()=>{var e,t=(e=a,O4["symbol".concat(h9(e))]||Oq),i=(function(e,t){let r=null,n=OR(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:pM(e||Oq),t="function"==typeof t?t:pM(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:pM(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:pM(+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*O3;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 O8(e){this._context=e}function O7(e){return new O8(e)}function O9(e){return e[0]}function Pe(e){return e[1]}function Pt(e,t){var r=pM(!0),n=null,i=O7,a=null,s=OR(o);function o(o){var l,c,u,d=(o=pE(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?O9:pM(e),t="function"==typeof t?t:void 0===t?Pe:pM(t),o.x=function(t){return arguments.length?(e="function"==typeof t?t:pM(+t),o):e},o.y=function(e){return arguments.length?(t="function"==typeof e?e:pM(+e),o):t},o.defined=function(e){return arguments.length?(r="function"==typeof e?e:pM(!!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 Pr(e,t,r){var n=null,i=pM(!0),a=null,s=O7,o=null,l=OR(c);function c(c){var u,d,h,f,p,m=(c=pE(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 Pt().defined(i).curve(s).context(a)}return e="function"==typeof e?e:void 0===e?O9:pM(+e),t="function"==typeof t?t:void 0===t?pM(0):pM(+t),r="function"==typeof r?r:void 0===r?Pe:pM(+r),c.x=function(t){return arguments.length?(e="function"==typeof t?t:pM(+t),n=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:pM(+t),c):e},c.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:pM(+e),c):n},c.y=function(e){return arguments.length?(t="function"==typeof e?e:pM(+e),r=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:pM(+e),c):t},c.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:pM(+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:pM(!!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 Pn(){}function Pi(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 Pa(e){this._context=e}function Ps(e){this._context=e}function Po(e){this._context=e}O6.registerSymbol=(e,t)=>{O4["symbol".concat(h9(e))]=t},O8.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)}}},Pa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pi(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:Pi(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Ps.prototype={areaStart:Pn,areaEnd:Pn,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:Pi(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Po.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:Pi(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class Pl{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 Pc(e){this._context=e}Pc.prototype={areaStart:Pn,areaEnd:Pn,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 Pu(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 Pd(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ph(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 Pf(e){this._context=e}function Pp(e){this._context=new Pm(e)}function Pm(e){this._context=e}function Px(e){this._context=e}function Py(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 Pg(e,t){this._context=e,this._t=t}function Pv(){return(Pv=Object.assign.bind()).apply(null,arguments)}function Pb(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?Pb(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)):Pb(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}Pf.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:Ph(this,this._t0,Pd(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,Ph(this,Pd(this,r=Pu(this,e,t)),r);break;default:Ph(this,this._t0,r=Pu(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(Pp.prototype=Object.create(Pf.prototype)).point=function(e,t){Pf.prototype.point.call(this,t,e)},Pm.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)}},Px.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=Py(e),i=Py(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)}},Pg.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 Pw={curveBasisClosed:function(e){return new Ps(e)},curveBasisOpen:function(e){return new Po(e)},curveBasis:function(e){return new Pa(e)},curveBumpX:function(e){return new Pl(e,!0)},curveBumpY:function(e){return new Pl(e,!1)},curveLinearClosed:function(e){return new Pc(e)},curveLinear:O7,curveMonotoneX:function(e){return new Pf(e)},curveMonotoneY:function(e){return new Pp(e)},curveNatural:function(e){return new Px(e)},curveStep:function(e){return new Pg(e,.5)},curveStepAfter:function(e){return new Pg(e,1)},curveStepBefore:function(e){return new Pg(e,0)}},PN=e=>pz(e.x)&&pz(e.y),Pk=e=>null!=e.base&&PN(e.base)&&PN(e),PS=e=>e.x,PO=e=>e.y,PP=e=>{var{className:t,points:r,path:n,pathRef:i}=e,a=pO(mj);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(h9(e));if(("curveMonotone"===r||"curveBump"===r)&&t){var n=Pw["".concat(r).concat("vertical"===t?"Y":"X")];if(n)return n}return Pw[r]||O7})(t,i),o=a?r.filter(PN):r;if(Array.isArray(n)){var l=r.map((e,t)=>Pj(Pj({},e),{},{base:n[t]}));return("vertical"===i?Pr().y(PO).x1(PS).x0(e=>e.base.x):Pr().x(PS).y1(PO).y0(e=>e.base.y)).defined(Pk).curve(s)(a?l.filter(Pk):l)}return("vertical"===i&&h2(n)?Pr().y(PO).x1(PS).x0(n):h2(n)?Pr().x(PS).y1(PO).y0(n):Pt().x(PS).y(PO)).defined(PN).curve(s)(o)})(s):n;return H.createElement("path",Pv({},N6(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=>{N2(e)&&(n[e]=t||(t=>r[e](r,t)))}),n})(e),{className:sl("recharts-curve",t),d:null===o?void 0:o,ref:i}))},PC=["option","shapeType","activeClassName"];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 PM(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 PA(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return H.createElement(Ov,r);case"trapezoid":return H.createElement(OO,r);case"sector":return H.createElement(OT,r);case"symbols":if("symbols"===t)return H.createElement(O6,r);break;case"curve":return H.createElement(PP,r);default:return null}}function PT(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,PC);if((0,H.isValidElement)(r))t=(0,H.cloneElement)(r,PM(PM({},a),(0,H.isValidElement)(r)?r.props:r));else if("function"==typeof r)t=r(a,a.index);else if((0,SG.default)(r)&&"boolean"!=typeof r){var s=PM(PM({},a),r);t=H.createElement(PA,{shapeType:n,elementProps:s})}else t=H.createElement(PA,{shapeType:n,elementProps:a});return a.isActive?H.createElement(kW,{className:i},t):t}function P_(){return(P_=Object.assign.bind()).apply(null,arguments)}function PD(e){return H.createElement(PT,P_({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var PI=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(r,n)=>{if(h2(e))return e;var i=h2(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)}},Pz=(e,t,r)=>{var n=pw();return(i,a)=>s=>{null==e||e(i,a,s),n(f9({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},PL=e=>{var t=pw();return(r,n)=>i=>{null==e||e(r,n,i),t(pe())}},PR=(e,t,r)=>{var n=pw();return(i,a)=>s=>{null==e||e(i,a,s),n(pr({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}};function PF(e){var{tooltipEntrySettings:t}=e,r=pw(),n=p8(),i=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{n||(null===i.current?r(f3(t)):i.current!==t&&r(f6({prev:i.current,next:t})),i.current=t)},[t,r,n]),(0,H.useLayoutEffect)(()=>()=>{i.current&&(r(f8(i.current)),i.current=null)},[r]),null}var P$=["children"],PB=(0,H.createContext)({data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function PU(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,P$);return H.createElement(PB.Provider,{value:r},t)}function PV(e,t){var r,n,i=pO(t=>vR(t,e)),a=pO(e=>vB(e,t)),s=null!=(r=null==i?void 0:i.allowDataOverflow)?r:vz.allowDataOverflow,o=null!=(n=null==a?void 0:a.allowDataOverflow)?n:vF.allowDataOverflow;return{needClip:s||o,needClipX:s,needClipY:o}}function Pq(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=pO(kA),{needClipX:a,needClipY:s,needClip:o}=PV(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 PK=(e,t,r)=>{var n=null!=r?r:e;if(null!=n)return h6(n,t,0)};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 PH(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 PY(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 PX(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 PQ=d5([vY,(e,t)=>t],(e,t)=>e.filter(e=>"bar"===e.type).find(e=>e.id===t)),PG=d5([PQ],e=>null==e?void 0:e.maxBarSize),PZ=d5([mj,vY,PY,PX,(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)),PJ=d5([PZ,e=>e.rootProps.barSize,(e,t)=>{var r=mj(e),n=PY(e,t),i=PX(e,t);if(null!=n&&null!=i)return"horizontal"===r?jt(e,"xAxis",n):jt(e,"yAxis",i)}],(e,t,r)=>{var n=e.filter(vO),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:PK(t,r,null==(n=a[0])?void 0:n.barSize)}}),...i.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>null!=e),barSize:PK(t,r,e.barSize)}))]}),P0=(e,t,r)=>{var n,i,a=mj(e),s=PY(e,t),o=PX(e,t);if(null!=s&&null!=o)return"horizontal"===a?(n=jl(e,"xAxis",s,r),i=jo(e,"xAxis",s,r)):(n=jl(e,"yAxis",o,r),i=jo(e,"yAxis",o,r)),pW(n,i)},P1=d5([PJ,g2,e=>e.rootProps.barGap,g5,(e,t,r)=>{var n,i,a,s,o=PQ(e,t);if(null==o)return 0;var l=PY(e,t),c=PX(e,t);if(null==l||null==c)return 0;var u=mj(e),d=g2(e),{maxBarSize:h}=o;return"horizontal"===u?(a=jl(e,"xAxis",l,r),s=jo(e,"xAxis",l,r)):(a=jl(e,"yAxis",c,r),s=jo(e,"yAxis",c,r)),null!=(n=null!=(i=pW(a,s,!0))?i:null==h?d:h)?n:0},P0,PG],(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=h6(e,r,0,!0),c=[];if(pz(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=h6(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=pz(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=>PH(PH({},e),{},{position:PH(PH({},e.position),{},{offset:e.position.offset-i/2})}))),o}),P2=d5([P1,PQ],(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}}),P5=d5([(e,t,r)=>{var n=mj(e),i=PY(e,t),a=PX(e,t);if(null!=i&&null!=a)return"horizontal"===n?ba(e,"yAxis",a,r):ba(e,"xAxis",i,r)},PQ],(e,t)=>{var r=vk(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)}}}),P4=d5([p5,p3,(e,t,r)=>{var n=PY(e,t);if(null!=n)return jl(e,"xAxis",n,r)},(e,t,r)=>{var n=PX(e,t);if(null!=n)return jl(e,"yAxis",n,r)},(e,t,r)=>{var n=PY(e,t);if(null!=n)return jo(e,"xAxis",n,r)},(e,t,r)=>{var n=PX(e,t);if(null!=n)return jo(e,"yAxis",n,r)},P2,mj,(e,t,r)=>r?gV(e):gU(e),P0,P5,PQ,(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;j=((e,t)=>{if(!t||2!==t.length||!h2(t[0])||!h2(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(!h2(e[0])||e[0]<r)&&(i[0]=r),(!h2(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i})(x,y)}else Array.isArray(j=p$(e,r))||(j=[g,j]);var b=PI(n,0)(j[1],d);if("horizontal"===t){var j,w,N,k,S,O,P,C=o.scale.map(j[0]),E=o.scale.map(j[1]);if(null==C||null==E)return null;w=pV({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 M=C-E;if(S=h0(M)?0:M,O={x:w,y:h.top,width:k,height:h.height},Math.abs(b)>0&&Math.abs(S)<Math.abs(b)){var A=hJ(S||b)*(Math.abs(b)-Math.abs(S));N-=A,S+=A}}else{var T=s.scale.map(j[0]),_=s.scale.map(j[1]);if(null==T||null==_)return null;if(w=T,N=pV({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=hJ(k||b)*(Math.abs(b)-Math.abs(k));k+=D}}return null==w||null==N||null==k||null==S?null:Cx(Cx({},e),{},{stackedBarStart:v,x:w,y:N,width:k,height:S,value:u?j:j[1],payload:e,background:O,tooltipPosition:{x:w+k/2,y:N+S/2},parentViewBox: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 P3(e){var{legendPayload:t}=e,r=pw(),n=p8(),i=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{n||(null===i.current?r(Ni(t)):i.current!==t&&r(Na({prev:i.current,next:t})),i.current=t)},[r,n,t]),(0,H.useLayoutEffect)(()=>()=>{i.current&&(r(Ns(i.current)),i.current=null)},[r]),null}var P6=null!=(K=H["useId".toString()])?K:()=>{var[e]=H.useState(()=>h3("uid-"));return e},P8=(0,H.createContext)(void 0),P7=e=>{var t,r,n,{id:i,type:a,children:s}=e,o=(t="recharts-".concat(a),r=i,n=P6(),r||(t?"".concat(t,"-").concat(n):n));return H.createElement(P8.Provider,{value:o},s(o))},P9=(0,H.memo)(e=>{var t=pw(),r=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{null===r.current?t(wH(e)):r.current!==e&&t(wY({prev:r.current,next:e})),r.current=e},[t,e]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(wX(r.current)),r.current=null)},[t]),null}),Ce=(e,t)=>t,Ct=(e,t,r)=>r,Cr=d5([Ce,vY,Ct],(e,t,r)=>t.filter(e=>"bar"===e.type).filter(t=>t.stackId===e).filter(e=>e.isPanorama===r).filter(e=>!e.hide)),Cn=d5([Cr],e=>e.map(e=>e.id)),Ci=d5([e=>e,Ce,Ct],(e,t,r)=>{var n=Cn(e,t,r),i=[];return n.forEach(t=>{var n=P4(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}),Ca=["index"];function Cs(){return(Cs=Object.assign.bind()).apply(null,arguments)}var Co=(0,H.createContext)(void 0),Cl=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Cc=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,Ca),n=(e=>{var t=(0,H.useContext)(Co);if(null!=t){var{stackId:r}=t;return"url(#".concat(Cl(r,e),")")}})(t);return H.createElement(kW,Cs({className:"recharts-bar-stack-layer",clipPath:n},r))},Cu=["onMouseEnter","onMouseLeave","onClick"],Cd=["value","background","tooltipPosition"],Ch=["id"],Cf=["onMouseEnter","onClick","onMouseLeave"];function Cp(){return(Cp=Object.assign.bind()).apply(null,arguments)}function Cm(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 Cx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cm(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)):Cm(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Cy(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 Cg=kV.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:ft,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:pY(a,t),hide:s,type:l,color:i,unit:o,graphicalItemId:c}};return kV.createElement(PF,{tooltipEntrySettings:u})});function Cv(e){var t,r=pO(wt),{data:n,dataKey:i,background:a,allOtherBarProps:s}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=s,u=Cy(s,Cu),d=Pz(o,i,s.id),h=PL(l),f=PR(c,i,s.id);if(!a||null==n)return null;var p=N8(a);return kV.createElement(Sx,{zIndex:(t=vi.barBackground,a&&"object"==typeof a&&"zIndex"in a&&"number"==typeof a.zIndex&&pz(a.zIndex)?a.zIndex:t)},n.map((e,t)=>{var{value:n,background:s,tooltipPosition:o}=e,l=Cy(e,Cd);if(!s)return null;var c=d(e,t),m=h(e,t),x=f(e,t),y=Cx(Cx(Cx(Cx(Cx({option:a,isActive:String(t)===r},l),{},{fill:"#eee"},s),p),SQ(u,e,t)),{},{onMouseEnter:c,onMouseLeave:m,onClick:x,dataKey:i,index:t,className:"recharts-bar-background-rectangle"});return kV.createElement(PD,Cp({key:"background-bar-".concat(t)},y))}))}function Cb(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 Cx(Cx({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return kV.createElement(S$,{value:t?i:void 0},r)}function Cj(e){var{shape:t,activeBar:r,baseProps:n,entry:i,index:a,dataKey:s}=e,o=pO(wt),l=pO(wn),c=r&&String(a)===o&&(null==l||s===l),u=c?r:t;return c?kV.createElement(Sx,{zIndex:vi.activeBar},kV.createElement(Cc,{index:a},kV.createElement(PD,Cp({},n,{name:String(n.name)},i,{isActive:c,option:u,index:a,dataKey:s})))):kV.createElement(PD,Cp({},n,{name:String(n.name)},i,{isActive:c,option:u,index:a,dataKey:s}))}function Cw(e){var{shape:t,baseProps:r,entry:n,index:i,dataKey:a}=e;return kV.createElement(PD,Cp({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a}))}function CN(e){var t,{data:r,props:n}=e,i=null!=(t=N6(n))?t:{},{id:a}=i,s=Cy(i,Ch),{shape:o,dataKey:l,activeBar:c}=n,{onMouseEnter:u,onClick:d,onMouseLeave:h}=n,f=Cy(n,Cf),p=Pz(u,l,a),m=PL(h),x=PR(d,l,a);return r?kV.createElement(kV.Fragment,null,r.map((e,t)=>kV.createElement(Cc,Cp({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"},SQ(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:x(e,t)}),c?kV.createElement(Cj,{shape:o,activeBar:c,baseProps:s,entry:e,index:t,dataKey:l}):kV.createElement(Cw,{shape:o,baseProps:s,entry:e,index:t,dataKey:l})))):null}function Ck(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=Oc(t,"recharts-bar-"),[f,p]=(0,kV.useState)(!1),m=(0,kV.useCallback)(()=>{"function"==typeof c&&c(),p(!1)},[c]),x=(0,kV.useCallback)(()=>{"function"==typeof u&&u(),p(!0)},[u]);return kV.createElement(Cb,{showLabels:!f,rects:n},kV.createElement(Ol,{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 Cx(Cx({},t),{},{x:h7(n.x,t.x,e),y:h7(n.y,t.y,e),width:h7(n.width,t.width,e),height:h7(n.height,t.height,e)});if("horizontal"===i){var a=h7(0,t.height,e),s=h7(t.stackedBarStart,t.y,e);return Cx(Cx({},t),{},{y:s,height:a})}var o=h7(0,t.width,e),l=h7(t.stackedBarStart,t.x,e);return Cx(Cx({},t),{},{width:o,x:l})});return(e>0&&(r.current=null!=a?a:null),null==a)?null:kV.createElement(kW,null,kV.createElement(CN,{props:t,data:a}))}),kV.createElement(SV,{label:t.label}),t.children)}function CS(e){var t=(0,kV.useRef)(null);return kV.createElement(Ck,{previousRectanglesRef:t,props:e})}var CO=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:p$(e,t)}};class CP extends kV.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 kV.createElement(kW,{className:c,id:l},s&&kV.createElement("defs",null,kV.createElement(Pq,{clipPathId:l,xAxisId:i,yAxisId:a})),kV.createElement(kW,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(l,")"):void 0},kV.createElement(Cv,{data:t,dataKey:r,background:o,allOtherBarProps:this.props}),kV.createElement(CS,this.props)))}}var CC={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:vi.bar};function CE(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}=PV(a,s),x=pO(mj),y=p8(),g=(t=e.children,r=[],n=[],n=Array.isArray(kH)?kH.map(e=>SK(e)):[SK(kH)],SY(t).forEach(e=>{var t=(0,hQ.default)(e,"type.displayName")||(0,hQ.default)(e,"type.name");t&&-1!==n.indexOf(t)&&r.push(e)}),r),v=pO(t=>P4(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,kV.createElement(PU,{xAxisId:a,yAxisId:s,data:v,dataPointFormatter:CO,errorBarOffset:i},kV.createElement(CP,Cp({},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 CM=kV.memo(function(e){var t,r,n,i=kL(e,CC),a=(r=i.stackId,null!=(n=(0,H.useContext)(Co))?n.stackId:null!=r?null==(t=r)?void 0:String(t):void 0),s=p8();return kV.createElement(P7,{id:i.id,type:"bar"},e=>kV.createElement(kV.Fragment,null,kV.createElement(P3,{legendPayload:(e=>{var{dataKey:t,name:r,fill:n,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:n,value:pY(r,t),payload:e}]})(i)}),kV.createElement(Cg,{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}),kV.createElement(P9,{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}),kV.createElement(Sx,{zIndex:i.zIndex},kV.createElement(CE,Cp({},i,{id:e})))))},NG);CM.displayName="Bar";var CA=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 CT(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 C_(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 CD(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 CI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?CD(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)):CD(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Cz=["axisLine","width","height","className","hide","ticks","axisType"];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}var C$={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:vi.axis};function CB(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=CF(CF(CF({},l),N6(o)),{},{fill:"none"});if("top"===a||"bottom"===a){var u=+("top"===a&&!s||"bottom"===a&&s);c=CF(CF({},c),{},{x1:t,y1:r+u*i,x2:t+n,y2:r+u*i})}else{var d=+("left"===a&&!s||"right"===a&&s);c=CF(CF({},c),{},{x1:t+d*n,y1:r,x2:t+d*n,y2:r+i})}return H.createElement("line",CL({},c,{className:sl("recharts-cartesian-axis-line",(0,hQ.default)(o,"className"))}))}function CU(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,CF(CF({},n),{},{className:a}));else if("function"==typeof r)t=r(CF(CF({},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(Sp,CL({},n,{className:s}),i)}return t}var CV=(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:j,axisType:w}=e,N=function(e,t,r){var n,{tick:i,ticks:a,viewBox:s,minTickGap:o,orientation:l,interval:c,tickFormatter:u,unit:d,angle:h}=e;if(!a||!a.length||!i)return[];if(h2(c)||Nz.isSsr)return null!=(n=CT(a,(h2(c)?c:0)+1))?n:[];var f="top"===l||"bottom"===l?"width":"height",p=d&&"width"===f?k1(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=k1(a,{fontSize:t,letterSpacing:r}),CA({width:i.width+p.width,height:i.height+p.height},h)):k1(a,{fontSize:t,letterSpacing:r})[f]},x=a[0],y=a[1],g=a.length>=2&&null!=x&&null!=y?hJ(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:CT(n,u)};var s=c,h=()=>(void 0===t&&(t=r(a,s)),t),f=a.coordinate,p=0===c||C_(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||C_(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=CI(CI({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate}),null!=u.tickCoord&&C_(e,u.tickCoord,()=>d,l,c)&&(c=u.tickCoord-e*(d/2+i),s[o-1]=CI(CI({},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=CI(CI({},o),{},{tickCoord:d<0?o.coordinate-d*e:o.coordinate})}else s[t]=o=CI(CI({},o),{},{tickCoord:o.coordinate});null!=o.tickCoord&&C_(e,o.tickCoord,u,l,c)&&(l=o.tickCoord+e*(u()/2+i),s[t]=CI(CI({},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=CI(CI({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate})}else a[t]=u=CI(CI({},u),{},{tickCoord:u.coordinate});null!=u.tickCoord&&C_(e,u.tickCoord,d,o,l)&&(l=u.tickCoord-e*(d()/2+i),a[t]=CI(CI({},u),{},{isShow:!0}))},u=s-1;u>=0;u--)if(c(u))continue;return a}(g,v,m,a,o)).filter(e=>e.isShow)}(CF(CF({},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=N6(b),P=N8(n),C={};"object"==typeof i&&(C=i);var E=CF(CF({},O),{},{fill:"none"},C),M=N.map(e=>CF({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=h2(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))),A=M.map(e=>{var{entry:t,line:r}=e;return H.createElement(kW,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(t.value,"-").concat(t.coordinate,"-").concat(t.tickCoord)},i&&H.createElement("line",CL({},E,r,{className:sl("recharts-cartesian-axis-tick-line",(0,hQ.default)(i,"className"))})))}),T=M.map((e,t)=>{var r,i,{entry:u,tick:d}=e,h=CF(CF(CF(CF({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=CF(CF({},h),P);return H.createElement(kW,CL({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(u.value,"-").concat(u.coordinate,"-").concat(u.tickCoord)},SQ(j,u,t)),n&&H.createElement(CU,{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(w,"-ticks")},T.length>0&&H.createElement(Sx,{zIndex:vi.label},H.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(w,"-tick-labels"),ref:t},T)),A.length>0&&H.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(w,"-tick-lines")},A))}),Cq=(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,Cz),[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(Sx,{zIndex:e.zIndex},H.createElement(kW,{className:sl("recharts-cartesian-axis",a)},H.createElement(CB,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:N6(e)}),H.createElement(CV,{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(SO,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},H.createElement(S_,{label:e.label,labelRef:e.labelRef}),e.children)))}),CK=H.forwardRef((e,t)=>{var r=kL(e,C$);return H.createElement(Cq,CL({},r,{ref:t}))});CK.displayName="CartesianAxis";var CW=["domain","range"],CH=["domain","range"];function CY(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 CX(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 CQ(e,t){if(e===t)return!0;var{domain:r,range:n}=e,i=CY(e,CW),{domain:a,range:s}=t,o=CY(t,CH);return!!CX(r,a)&&!!CX(n,s)&&NG(i,o)}var CG=["type"],CZ=["dangerouslySetInnerHTML","ticks","scale"],CJ=["id","scale"];function C0(){return(C0=Object.assign.bind()).apply(null,arguments)}function C1(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 C2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C1(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)):C1(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function C5(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 C4(e){var t=pw(),r=(0,H.useRef)(null),n=mw(),{type:i}=e,a=C5(e,CG),s=vl(n,"xAxis",i),o=(0,H.useMemo)(()=>{if(null!=s)return C2(C2({},a),{},{type:s})},[a,s]);return(0,H.useLayoutEffect)(()=>{null!=o&&(null===r.current?t(wI(o)):r.current!==o&&t(wz({prev:r.current,next:o})),r.current=o)},[o,t]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(wL(r.current)),r.current=null)},[t]),null}var C3=e=>{var{xAxisId:t,className:r}=e,n=pO(p3),i=p8(),a="xAxis",s=pO(e=>js(e,a,t,i)),o=pO(e=>b3(e,t)),l=pO(e=>b7(e,t)),c=pO(e=>vL(e,t));if(null==o||null==l||null==c)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:h}=e,f=C5(e,CZ),{id:p,scale:m}=c,x=C5(c,CJ);return H.createElement(CK,C0({},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}))},C6={allowDataOverflow:vz.allowDataOverflow,allowDecimals:vz.allowDecimals,allowDuplicatedCategory:vz.allowDuplicatedCategory,angle:vz.angle,axisLine:C$.axisLine,height:vz.height,hide:!1,includeHidden:vz.includeHidden,interval:vz.interval,label:!1,minTickGap:vz.minTickGap,mirror:vz.mirror,orientation:vz.orientation,padding:vz.padding,reversed:vz.reversed,scale:vz.scale,tick:vz.tick,tickCount:vz.tickCount,tickLine:C$.tickLine,tickSize:C$.tickSize,type:vz.type,xAxisId:0},C8=H.memo(e=>{var t=kL(e,C6);return H.createElement(H.Fragment,null,H.createElement(C4,{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(C3,t))},CQ);C8.displayName="XAxis";var C7=["type"],C9=["dangerouslySetInnerHTML","ticks","scale"],Ee=["id","scale"];function Et(){return(Et=Object.assign.bind()).apply(null,arguments)}function Er(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?Er(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)):Er(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ei(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 Ea(e){var t=pw(),r=(0,H.useRef)(null),n=mw(),{type:i}=e,a=Ei(e,C7),s=vl(n,"yAxis",i),o=(0,H.useMemo)(()=>{if(null!=s)return En(En({},a),{},{type:s})},[s,a]);return(0,H.useLayoutEffect)(()=>{null!=o&&(null===r.current?t(wR(o)):r.current!==o&&t(wF({prev:r.current,next:o})),r.current=o)},[o,t]),(0,H.useLayoutEffect)(()=>()=>{r.current&&(t(w$(r.current)),r.current=null)},[t]),null}function Es(e){var{yAxisId:t,className:r,width:n,label:i}=e,a=(0,H.useRef)(null),s=(0,H.useRef)(null),o=pO(p3),l=p8(),c=pw(),u="yAxis",d=pO(e=>je(e,t)),h=pO(e=>b9(e,t)),f=pO(e=>js(e,u,t,l)),p=pO(e=>v$(e,t));if((0,H.useLayoutEffect)(()=>{if(!("auto"!==n||!d||SE(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(wq({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=Ei(e,C9),{id:v,scale:b}=p,j=Ei(p,Ee);return H.createElement(CK,Et({},g,j,{ref:a,labelRef:s,x:h.x,y:h.y,tickTextProps:"auto"===n?{width:void 0}:{width:n},width:d.width,height:d.height,className:sl("recharts-".concat(u," ").concat(u),r),viewBox:o,ticks:f,axisType:u}))}var Eo={allowDataOverflow:vF.allowDataOverflow,allowDecimals:vF.allowDecimals,allowDuplicatedCategory:vF.allowDuplicatedCategory,angle:vF.angle,axisLine:C$.axisLine,hide:!1,includeHidden:vF.includeHidden,interval:vF.interval,label:!1,minTickGap:vF.minTickGap,mirror:vF.mirror,orientation:vF.orientation,padding:vF.padding,reversed:vF.reversed,scale:vF.scale,tick:vF.tick,tickCount:vF.tickCount,tickLine:C$.tickLine,tickSize:C$.tickSize,type:vF.type,width:vF.width,yAxisId:0},El=H.memo(e=>{var t=kL(e,Eo);return H.createElement(H.Fragment,null,H.createElement(Ea,{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(Es,t))},CQ);function Ec(){return(Ec=Object.assign.bind()).apply(null,arguments)}function Eu(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 Ed(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Eu(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)):Eu(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Eh(e){return Array.isArray(e)&&h5(e[0])&&h5(e[1])?e.join(" ~ "):e}El.displayName="YAxis";var Ef={margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},Ep={display:"block",paddingTop:4,paddingBottom:4,color:"#000"},Em={},Ex=e=>{var{separator:t=" : ",contentStyle:r,itemStyle:n,labelStyle:i=Em,payload:a,formatter:s,itemSorter:o,wrapperClassName:l,labelClassName:c,label:u,labelFormatter:d,accessibilityLayer:h=!1}=e,f=Ed(Ed({},Ef),r),p=Ed({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",Ec({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,pP.default)(a,o):a).map((e,r)=>{if("none"===e.type)return null;var i=e.formatter||s||Eh,{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=Ed(Ed({},Ep),{},{color:e.color||Ep.color},n);return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(r),style:h},h5(u)?H.createElement("span",{className:"recharts-tooltip-item-name"},u):null,h5(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})())},Ey=H,Eg="recharts-tooltip-wrapper",Ev={visibility:"hidden"};function Eb(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:i,position:a,reverseDirection:s,tooltipDimension:o,viewBox:l,viewBoxDimension:c}=e;if(a&&h2(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 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 Ew(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){EN(e,t,r[t])}):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 EN(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 Ek extends Ey.PureComponent{constructor(){super(...arguments),EN(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),EN(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=Eb({allowEscapeViewBox:i,coordinate:a,key:"x",offset:o,position:l,reverseDirection:c,tooltipDimension:u.width,viewBox:h,viewBoxDimension:h.width}),translateY:n=Eb({allowEscapeViewBox:i,coordinate:a,key:"y",offset:s,position:l,reverseDirection:c,tooltipDimension:u.height,viewBox:h,viewBoxDimension:h.height}),useTranslate3d:d}):Ev,cssClasses:function(e){var{coordinate:t,translateX:r,translateY:n}=e;return sl(Eg,{["".concat(Eg,"-right")]:h2(r)&&t&&h2(t.x)&&r>=t.x,["".concat(Eg,"-left")]:h2(r)&&t&&h2(t.x)&&r<t.x,["".concat(Eg,"-bottom")]:h2(n)&&t&&h2(t.y)&&n>=t.y,["".concat(Eg,"-top")]:h2(n)&&t&&h2(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?{}:Ew(Ew({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=Ew(Ew({},v),{},{visibility:!this.state.dismissed&&e&&s?"visible":"hidden"},f);return Ey.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:y,style:b,ref:m},i)}}var ES=e.i(40559),EO=["x","y","top","left","width","height","className"];function EP(){return(EP=Object.assign.bind()).apply(null,arguments)}function EC(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 EE=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?EC(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)):EC(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,EO));return h2(t)&&h2(r)&&h2(a)&&h2(s)&&h2(n)&&h2(i)?H.createElement("path",EP({},N7(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 EM(e){var{cx:t,cy:r,radius:n,startAngle:i,endAngle:a}=e;return{points:[vn(t,r,n,i),vn(t,r,n,a)],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}function EA(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 ET(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EA(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)):EA(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function E_(){return(E_=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}function EI(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}function Ez(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 EL(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=EE,a=vi.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=Ov,a=vi.cursorRectangle;else if("radial"===d&&SX(s)){var{cx:m,cy:x,radius:y,startAngle:g,endAngle:v}=EM(s);n={cx:m,cy:x,startAngle:g,endAngle:v,innerRadius:y,outerRadius:y},i=OT,a=vi.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(SX(t)){if("centric"===e){var{cx:n,cy:i,innerRadius:a,outerRadius:s,angle:o}=t,l=vn(n,i,a,o),c=vn(n,i,s,o);return[{x:l.x,y:l.y},{x:c.x,y:c.y}]}return EM(t)}}(d,s,c)},i=PP,a=vi.cursorLine;var b="object"==typeof h&&"className"in h?h.className:void 0,j=EI(EI(EI(EI({stroke:"#ccc",pointerEvents:"none"},c),n),N8(h)),{},{payload:o,payloadIndex:l,className:sl("recharts-tooltip-cursor",b)});return H.createElement(Sx,{zIndex:null!=(r=e.zIndex)?r:a},H.createElement(Ez,{cursor:h,cursorComp:i,cursorProps:j}))}function ER(e){var t,r,n,i,a=(t=pO(bt),r=pO(j6),n=pO(j5),t&&n?pW(ET(ET({},t),{},{scale:n}),r):pW(void 0,r)),s=null!=(i=pO(p5))?i:mb,o=pO(mj),l=pO(g6);return null==a||null==s||null==o||null==l?null:H.createElement(EL,E_({},e,{offset:s,layout:o,tooltipAxisBandSize:a,chartName:l}))}function EF(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 E$(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EF(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)):EF(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function EB(e){return e.dataKey}var EU=[],EV={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 Eq(e){var t,r,n,i,a,s,o,l,c,u,d,h=kL(e,EV),{active:f,allowEscapeViewBox:p,animationDuration:m,animationEasing:x,content:y,filterNull:g,isAnimationActive:v,offset:b,payloadUniqBy:j,position:w,reverseDirection:N,useTranslate3d:k,wrapperStyle:S,cursor:O,shared:P,trigger:C,defaultIndex:E,portal:M,axisId:A}=h,T=pw(),_="number"==typeof E?String(E):E;(0,H.useEffect)(()=>{T(f7({shared:P,trigger:C,axisId:A,active:f,defaultIndex:_}))},[T,P,C,A,f,_]);var D=mv(),I=N0(),z=pO(e=>jp(e,P)),{activeIndex:L,isActive:R}=null!=(u=pO(e=>wN(e,z,C,_)))?u:{},F=pO(e=>ww(e,z,C,_)),$=pO(e=>wj(e,z,C,_)),B=pO(e=>wb(e,z,C,_)),U=(0,H.useContext)(kv),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=pO(e=>((e,t,r)=>{if(null!=t){var n=jN(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=pO(g9),n=pO(g8),i=pO(g7),s=null==(a=pO(km))?void 0:a.active,o=mv(),(0,H.useEffect)(()=>{if(!s&&null!=n&&null!=r){var e=pa({active:V,coordinate:B,dataKey:t,index:L,label:"number"==typeof W?String(W):W,sourceViewBox:o,graphicalItemId:void 0});kh.emit(kf,n,e,r)}},[s,B,t,L,W,r,n,i,V,o]);var Y=null!=M?M:U;if(null==Y||null==D||null==z)return null;var X=null!=F?F:EU;V||(X=EU),g&&X.length&&(l=X.filter(e=>null!=e.value&&(!0!==e.hide||h.includeHidden)),X=!0===j?(0,ES.default)(l,EB):"function"==typeof j?(0,ES.default)(l,j):l);var Q=X.length>0,G=H.createElement(Ek,{allowEscapeViewBox:p,animationDuration:m,animationEasing:x,isAnimationActive:v,active:V,coordinate:B,hasPayload:Q,offset:b,position:w,reverseDirection:N,useTranslate3d:k,viewBox:D,wrapperStyle:S,lastBoundingBox:q,innerRef:K,hasPortalFromProps:!!M},(c=E$(E$({},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(Ex,c)));return H.createElement(H.Fragment,null,(0,Sm.createPortal)(G,Y),V&&H.createElement(ER,{cursor:O,tooltipEventType:z,coordinate:B,payload:X,index:L}))}function EK({stats:e,onNavigate:t}){let r=(0,H.useMemo)(()=>Object.entries(e.byCategory).map(([e,t])=>({category:e,count:t,color:(0,oj.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)(my,{width:"100%",height:36*r.length+20,children:(0,W.jsxs)(kU,{data:r,layout:"vertical",margin:{left:10,right:30},children:[(0,W.jsx)(C8,{type:"number",hide:!0}),(0,W.jsx)(El,{type:"category",dataKey:"category",width:100,tick:{fill:"#94a3b8",fontSize:12},axisLine:!1,tickLine:!1}),(0,W.jsx)(Eq,{contentStyle:{background:"#1e293b",border:"1px solid #334155",borderRadius:8},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"}}),(0,W.jsx)(CM,{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)(kH,{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 EW=(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 EH({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)(o8,{size:14,className:"text-slate-400"}):(0,W.jsx)(cK.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 EY({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)(EH,{icon:o3,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)(EH,{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)(EH,{icon:EW,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)(EH,{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 EX({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 EQ({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)(lm,{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 EG({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 ${l6[a]} ${l3[a]}`,children:[(0,W.jsx)(l0,{size:10}),l4[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 ${l4[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 EZ({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,j=l?.neverAccessed.count??0,w=(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||j>0||v>0)&&e.push({title:"Memory cleanup work is available",detail:`${b} stale, ${v} duplicate, ${j} never-accessed memories are reducing signal quality.`,tone:b+v>10?"warning":"healthy",cta:"Open cleanup view",onClick:()=>N("memories")}),w.length>0){let[t,r]=w[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,j,v,w,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)(EX,{label:"Memory Base",value:String(d),detail:`${e?.averageSalience?`${Math.round(100*e.averageSalience)}% avg salience`:"No salience data yet"}`}),(0,W.jsx)(EX,{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)(EX,{label:"Queue",value:String(y),detail:"Pending quarantine review",tone:y>0?"warning":"success"}),(0,W.jsx)(EX,{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)(EQ,{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:j}),(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:w.length>0?(0,W.jsxs)(W.Fragment,{children:["Thin categories:"," ",w.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)(EK,{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)(EY,{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)(lJ.Sparkles,{size:16,className:"text-cyan-400"}),(0,W.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Free workflows"})]}),(0,W.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"These are the core jobs the free dashboard should do well every day."}),(0,W.jsx)("div",{className:"mt-4 space-y-3",children:[{title:"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)(oG,{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 ${l6[u?.tier??"free"]} ${l3[u?.tier??"free"]}`,children:l4[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)(EG,{card:e,license:u,onOpen:N},e.title))})]})]})]})})}let EJ=[{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"}],E0=[{keys:["/"],description:"Focus search input"},{keys:["Esc"],description:"Close panel / blur search"},{keys:["?"],description:"Toggle this help overlay"}];function E1({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 E2({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)(E1,{children:e})]},t))})]})}function E5({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)(E1,{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:EJ.map((e,t)=>(0,W.jsx)(E2,{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:E0.map((e,t)=>(0,W.jsx)(E2,{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)(E1,{children:"g"})," then a letter within 500ms"]})]})}):null}let E4=(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..."})})}),E3=(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 E6(){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:j,addEvent:w}=(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:M}=(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:A,isLoading:T}=(0,st.useStats)(x||void 0),{data:_=[]}=(0,st.useMemoryLinks)(x||void 0),D=(0,H.useRef)(M);(0,H.useEffect)(()=>{!M||M===D.current||(D.current=M,new Set(["memory_created","memory_accessed","memory_updated","memory_deleted","consolidation_complete","decay_tick"]).has(M.type)&&w({type:M.type,timestamp:M.timestamp,data:M.data}))},[M,w]);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}=lH(),F=R?.enabled&&R?.apiKeySet,$=lV(),B=z?.killSwitchActive??!1,U=e=>{let t=P.find(t=>t.id===e);t&&f(t)},V="overview"===u||"shield"===u||"cloud"===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)(o0,{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)(ub,{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)(ub,{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"}),A?.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:()=>j(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),j(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)(o5,{}),(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)(EZ,{stats:A,selectedProject:x}),"shield"===u&&(0,W.jsx)(cm,{}),"cloud"===u&&(0,W.jsx)(ck,{}),"audit"===u&&(0,W.jsx)(cA,{}),"quarantine"===u&&(0,W.jsx)(cU,{}),"brain"===u&&(0,W.jsx)(E3,{memories:P,links:_,stats:A,isLoading:C}),"graph"===u&&(0,W.jsx)(E4,{}),"timeline"===u&&(0,W.jsx)(uU,{}),"agents"===u&&(0,W.jsx)(ur,{}),"skills"===u&&(0,W.jsx)(ux,{}),"dome"===u&&(0,W.jsx)(uD,{}),"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)(cL,{entry:p,onClose:()=>m(null),onViewMemory:e=>{m(null),U(e),sr.useDashboardStore.getState().setViewMode("memories")}})})]}),(0,W.jsx)(E5,{open:N,onClose:()=>k(!1)})]})}e.s(["default",()=>E6],23733)}]);