@fleox-agent-crm/agentcrm 0.3.1 → 0.3.3

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 (38) hide show
  1. package/README.md +16 -16
  2. package/changelog.json +22 -0
  3. package/dist/admin/admin-files.json +7 -7
  4. package/dist/admin/assets/{chartsImpl-B45AAqnr.js → chartsImpl-aBuZ1X4W.js} +1 -1
  5. package/dist/admin/assets/firebase-BG1GpyBB.js +2 -0
  6. package/dist/admin/assets/{gitJson-CAUSxl8d.js → gitJson-DzX3eZ2P.js} +1 -1
  7. package/dist/admin/assets/{index-ChFauO8y.js → index-DLy5RpPl.js} +5 -5
  8. package/dist/admin/assets/{lucide-react.min--rznIkmQ.js → lucide-react.min-BgcmukkH.js} +1 -1
  9. package/dist/admin/assets/{sdk-DgzLACmL.js → sdk-DtP9zqdi.js} +1 -1
  10. package/dist/admin/index.html +1 -1
  11. package/dist/agent/agentcrm.mjs +70 -12
  12. package/dist/agent/chunks/api-Dwb4xz1k.mjs +27 -0
  13. package/dist/agent/chunks/{firebase-DxGVQV9E.mjs → firebase-DWR0K1OC.mjs} +53 -27
  14. package/dist/agent/chunks/{hosting-Bme7LxPc.mjs → hosting-Dnn1k3cV.mjs} +1 -1
  15. package/dist/agent/chunks/{index-DUSdTBkz.mjs → index-CNXq2Yk_.mjs} +1 -24
  16. package/dist/agent/chunks/index-Dio0aBWA.mjs +6920 -0
  17. package/dist/agent/chunks/{index-CRkw3_iF.mjs → index-DtCezG4R.mjs} +1 -1
  18. package/dist/agent/chunks/{install-CbpD_7gd.mjs → install-Bp-CwDVC.mjs} +13 -4
  19. package/dist/agent/chunks/{sdk-whvfg786.mjs → sdk-CYgNyuoK.mjs} +132 -7005
  20. package/dist/version.json +1 -1
  21. package/package.json +1 -1
  22. package/plugin/.claude-plugin/plugin.json +1 -1
  23. package/plugin/skills/agentcrm-admin/SKILL.md +67 -67
  24. package/plugin/skills/agentcrm-admin/references/records.md +5 -5
  25. package/plugin/skills/agentcrm-admin/references/schema.md +19 -19
  26. package/plugin/skills/agentcrm-extensions/SKILL.md +8 -8
  27. package/plugin/skills/agentcrm-extensions/references/module-recipes.md +2 -2
  28. package/plugin/skills/agentcrm-extensions/references/testing.md +14 -14
  29. package/plugin/skills/agentcrm-extensions/references/theme-recipes.md +3 -3
  30. package/plugin/skills/agentcrm-install/SKILL.md +13 -13
  31. package/plugin/skills/agentcrm-install/references/firebase.md +1 -1
  32. package/plugin/skills/agentcrm-install/references/github.md +1 -1
  33. package/plugin/skills/agentcrm-install/references/mcp.md +2 -2
  34. package/plugin/skills/agentcrm-install/references/plans.md +1 -1
  35. package/plugin/skills/agentcrm-install/references/s3.md +1 -1
  36. package/plugin/skills/agentcrm-manage/SKILL.md +15 -15
  37. package/plugin/skills/agentcrm-sales/SKILL.md +18 -18
  38. package/dist/admin/assets/firebase-C1x_l9P9.js +0 -2
package/README.md CHANGED
@@ -52,14 +52,14 @@ The `agentcrm-install` skill asks where the data lives, then where the admin is
52
52
  ### By hand
53
53
 
54
54
  ```bash
55
- npx -y @fleox-agent-crm/agentcrm@0.3.1 options # backends, locations, hostings, plan format
56
- npx -y @fleox-agent-crm/agentcrm@0.3.1 credentials set s3:main # hidden prompt
57
- npx -y @fleox-agent-crm/agentcrm@0.3.1 install --plan plan.json --dry-run
58
- npx -y @fleox-agent-crm/agentcrm@0.3.1 install --plan plan.json
59
- npx -y @fleox-agent-crm/agentcrm@0.3.1 doctor --site acme
55
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 options # backends, locations, hostings, plan format
56
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 credentials set s3:main # hidden prompt
57
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 install --plan plan.json --dry-run
58
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 install --plan plan.json
59
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 doctor --site acme
60
60
  ```
61
61
 
62
- Or try it without any account: `npx -y @fleox-agent-crm/agentcrm@0.3.1 serve` opens the setup wizard; pick **This browser** (optionally with demo data).
62
+ Or try it without any account: `npx -y @fleox-agent-crm/agentcrm@0.3.3 serve` opens the setup wizard; pick **This browser** (optionally with demo data).
63
63
 
64
64
  ## Features
65
65
 
@@ -85,8 +85,8 @@ Everything you can customise in the admin, an AI agent can do too (CLI, MCP tool
85
85
  Settings → **Modules** switches built-in features off for the whole workspace: dashboard, deals & pipelines, reports, lead forms, tasks, automations, email & calendar, AI assistant. Disabling hides pages, navigation, widgets and owned objects; it never deletes data. Dependencies are checked (cascade on request). [docs/modules.md](docs/modules.md)
86
86
 
87
87
  ```bash
88
- npx -y @fleox-agent-crm/agentcrm@0.3.1 modules list --site acme
89
- npx -y @fleox-agent-crm/agentcrm@0.3.1 modules disable forms --site acme --yes
88
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 modules list --site acme
89
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 modules disable forms --site acme --yes
90
90
  ```
91
91
 
92
92
  ### Appearance — make it yours
@@ -94,9 +94,9 @@ npx -y @fleox-agent-crm/agentcrm@0.3.1 modules disable forms --site acme --yes
94
94
  Settings → **Appearance**: one accent color generates the whole palette; neutral grays, radius, density, font (system or Google fonts), sidebar style, accent or neutral buttons, high contrast, default light / dark mode, logo, favicon, custom CSS, seven presets (default, ocean, forest, sunset, graphite, rose, high-contrast) and theme extensions. [docs/appearance.md](docs/appearance.md)
95
95
 
96
96
  ```bash
97
- npx -y @fleox-agent-crm/agentcrm@0.3.1 appearance set --accent "#0f766e" --neutral stone --buttons accent --site acme --yes
98
- npx -y @fleox-agent-crm/agentcrm@0.3.1 appearance logo ./logo.svg --site acme --yes
99
- npx -y @fleox-agent-crm/agentcrm@0.3.1 appearance preset ocean --site acme --yes
97
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 appearance set --accent "#0f766e" --neutral stone --buttons accent --site acme --yes
98
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 appearance logo ./logo.svg --site acme --yes
99
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 appearance preset ocean --site acme --yes
100
100
  ```
101
101
 
102
102
  ### Extensions — add features without rebuilding
@@ -104,10 +104,10 @@ npx -y @fleox-agent-crm/agentcrm@0.3.1 appearance preset ocean --site acme --yes
104
104
  Modules (pages, record tabs, dashboard widgets, settings pages, AI tools, automation actions, hooks) and themes are ZIPs installed from Settings → Modules → **Installed extensions** or the CLI, stored in the CRM's own data and loaded at runtime by every admin — and by the CLI / MCP server, so their AI tools and automation actions work there too. Installing runs code with admin rights: the admin and the CLI always show who made it and what it adds first; safe mode (`?safe=1`, or `--safe`) starts without extensions. [docs/extensions.md](docs/extensions.md)
105
105
 
106
106
  ```bash
107
- npx -y @fleox-agent-crm/agentcrm@0.3.1 ext new module acme-projects # scaffold (Vite + typings + en/fr)
107
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 ext new module acme-projects # scaffold (Vite + typings + en/fr)
108
108
  cd acme-projects && npm install && npm run build
109
- npx -y @fleox-agent-crm/agentcrm@0.3.1 ext check . # validate + load it like the admin
110
- npx -y @fleox-agent-crm/agentcrm@0.3.1 ext install . --site acme --yes # install (plan without --yes)
109
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 ext check . # validate + load it like the admin
110
+ npx -y @fleox-agent-crm/agentcrm@0.3.3 ext install . --site acme --yes # install (plan without --yes)
111
111
  ```
112
112
 
113
113
  Guides: [creating a module](docs/creating-a-module.md), [creating a theme](docs/creating-a-theme.md), [runtime API reference](docs/runtime-api-reference.md). Examples: [`external/`](external).
@@ -157,7 +157,7 @@ S3 / R2 / OVH / Scaleway buckets (HTTPS), GitHub Pages, GitLab Pages, Cloudflare
157
157
 
158
158
  ## CLI
159
159
 
160
- `agentcrm` runs on Node.js 20+ (`npx -y @fleox-agent-crm/agentcrm@0.3.1 <command>`). Every command accepts `--json` and prints exactly one `{ ok, data }` / `{ ok: false, error: { code, message, hint } }` object; destructive commands print a plan unless `--yes`.
160
+ `agentcrm` runs on Node.js 20+ (`npx -y @fleox-agent-crm/agentcrm@0.3.3 <command>`). Every command accepts `--json` and prints exactly one `{ ok, data }` / `{ ok: false, error: { code, message, hint } }` object; destructive commands print a plan unless `--yes`.
161
161
 
162
162
  | Area | Commands |
163
163
  |---|---|
@@ -176,7 +176,7 @@ Full reference: [docs/cli.md](docs/cli.md).
176
176
  ## MCP server
177
177
 
178
178
  ```bash
179
- claude mcp add agentcrm -- npx -y @fleox-agent-crm/agentcrm@0.3.1 mcp --site acme
179
+ claude mcp add agentcrm -- npx -y @fleox-agent-crm/agentcrm@0.3.3 mcp --site acme
180
180
  ```
181
181
 
182
182
  Tools = the shared AI catalog (search, list, get, create, update, delete, merge records, notes, activities, tasks, deal stages, reports, CSV import, automations…), resources = schema, pipelines, modules and appearance, plus the tools of the site's enabled extension modules; prompts = pipeline review, follow-up email, lead qualification. `--read-only` hides every tool that writes. Claude Desktop / Cursor config: [docs/mcp.md](docs/mcp.md).
package/changelog.json CHANGED
@@ -1,5 +1,27 @@
1
1
  {
2
2
  "versions": [
3
+ {
4
+ "version": "0.3.3",
5
+ "date": "2026-11-04",
6
+ "breaking": false,
7
+ "changes": [
8
+ "Firebase: users added from the CLI / MCP get their invitation again. The store mirrors invitations only for an admin caller and the CLI never resolved its identity when the site has a recorded --user, so `users add` created the user without `invites/{email}` and that person could not sign in."
9
+ ],
10
+ "actions": [
11
+ "Users added from the CLI on a Firebase CRM with 0.3.1 or 0.3.2: re-save them once (e.g. `agentcrm users role <email> <role>`) to write the missing invitation."
12
+ ]
13
+ },
14
+ {
15
+ "version": "0.3.2",
16
+ "date": "2026-11-04",
17
+ "breaking": false,
18
+ "changes": [
19
+ "CLI / MCP on a Firebase CRM: the stored firebase:<name> login now signs in. Up to 0.3.1 the CLI read and wrote Firestore unauthenticated, so the rules refused every write (install, doctor --repair, records…) and reads came back empty.",
20
+ "Firebase sessions are kept between CLI runs (~/.agentcrm/sessions/, mode 0600) instead of a password sign-in per command, which Firebase rate-limits; `credentials set` / `remove` forget the session of that login.",
21
+ "install --dry-run on Firebase really checks access: it signs in, refuses an unverified address and reads through the rules (it used to report ok without checking anything)."
22
+ ],
23
+ "actions": []
24
+ },
3
25
  {
4
26
  "version": "0.3.1",
5
27
  "date": "2026-11-03",
@@ -1,18 +1,18 @@
1
1
  {
2
- "version": "0.3.1",
2
+ "version": "0.3.3",
3
3
  "dataSchema": 1,
4
4
  "files": [
5
- "assets/chartsImpl-B45AAqnr.js",
6
- "assets/firebase-C1x_l9P9.js",
7
- "assets/gitJson-CAUSxl8d.js",
8
- "assets/index-ChFauO8y.js",
5
+ "assets/chartsImpl-aBuZ1X4W.js",
6
+ "assets/firebase-BG1GpyBB.js",
7
+ "assets/gitJson-DzX3eZ2P.js",
8
+ "assets/index-DLy5RpPl.js",
9
9
  "assets/index-TcjySLVg.css",
10
10
  "assets/index.esm-BFc7vwnl.js",
11
11
  "assets/index.esm-CtEQZRb1.js",
12
12
  "assets/index.esm-Dum0J07z.js",
13
13
  "assets/index.esm2017-EOzKbpUS.js",
14
- "assets/lucide-react.min--rznIkmQ.js",
15
- "assets/sdk-DgzLACmL.js",
14
+ "assets/lucide-react.min-BgcmukkH.js",
15
+ "assets/sdk-DtP9zqdi.js",
16
16
  "favicon.svg",
17
17
  "index.html",
18
18
  "runtime/agentcrm-runtime.js",
@@ -1,4 +1,4 @@
1
- var Hb=Object.defineProperty;var Vb=(e,t,r)=>t in e?Hb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Wi=(e,t,r)=>Vb(e,typeof t!="symbol"?t+"":t,r);import{E as v,H as te,b as Cu,I as Tu,g as qb,R as Yb,J as hi,K as N,L as Ic,M as Gb,N as Xb,O as Uv,P as Ft}from"./index-ChFauO8y.js";var Zb=["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 Mu(e){if(typeof e!="string")return!1;var t=Zb;return t.includes(e)}var Qb=["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"],Jb=new Set(Qb);function Hv(e){return typeof e!="string"?!1:Jb.has(e)}function Vv(e){return typeof e=="string"&&e.startsWith("data-")}function pt(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r))&&(t[r]=e[r]);return t}function vi(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return pt(t)}return typeof e=="object"&&!Array.isArray(e)?pt(e):null}function Xe(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r)||Mu(r))&&(t[r]=e[r]);return t}function ex(e){return e==null?null:v.isValidElement(e)?Xe(e.props):typeof e=="object"&&!Array.isArray(e)?Xe(e):null}var tx=["children","width","height","viewBox","className","style","title","desc"];function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ll.apply(null,arguments)}function rx(e,t){if(e==null)return{};var r,n,i=nx(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nx(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Du=v.forwardRef((e,t)=>{var r=e.children,n=e.width,i=e.height,a=e.viewBox,o=e.className,l=e.style,u=e.title,s=e.desc,c=rx(e,tx),f=a||{width:n,height:i,x:0,y:0},d=te("recharts-surface",o);return v.createElement("svg",Ll({},Xe(c),{className:d,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),v.createElement("title",null,u),v.createElement("desc",null,s),r)}),ix=["children","className"];function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rl.apply(null,arguments)}function ax(e,t){if(e==null)return{};var r,n,i=ox(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ox(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ze=v.forwardRef((e,t)=>{var r=e.children,n=e.className,i=ax(e,ix),a=te("recharts-layer",n);return v.createElement("g",Rl({className:a},Xe(i),{ref:t}),r)});function zl(e){return e==="__proto__"}const lx=Object.prototype.hasOwnProperty;function dn(e,t){return lx.call(e,t)}const ux=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function qv(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e===""||e.startsWith(".")||e.endsWith(".")?!1:ux.test(e);default:return!1}}function no(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is(e==null||(t=e.valueOf)===null||t===void 0?void 0:t.call(e),-0)?"-0":String(e)}function $u(e){return typeof e=="symbol"||e instanceof Symbol}function Yv(e){if(typeof e=="string")return e;if(Array.isArray(e)){let r="";for(let n=0;n<e.length;n++)n>0&&(r+=","),r+=Yv(e[n]);return r}if($u(e))return e.toString();const t=e+"";return t==="0"&&Object.is(Number(e),-0)?"-0":t}function sx(e){return e==null?"":Yv(e)}function Nu(e){if(Array.isArray(e))return e.map(no);if(typeof e=="symbol")return[e];e=sx(e);const t=[],r=e.length;if(r===0)return t;let n=0,i="",a="",o=!1,l=!1;const u=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push("");n<r;){const s=e[n];if(a)s==="\\"&&n+1<r?(n++,i+=e[n]):s===a?a="":i+=s;else if(o)if(s==='"'||s==="'")a=s,l=!0;else if(s==="]"){if(o=!1,!l&&i.includes(".")&&!u.test(i)){const c=i.split(".");for(let f=0;f<c.length;f++)c[f]!==""&&t.push(c[f])}else t.push(i);i=""}else i+=s;else if(s==="[")o=!0,l=!1,i&&(t.push(i),i="");else if(s==="."){i&&(t.push(i),i="");const c=e[n+1];(c===void 0||c===".")&&t.push("")}else i+=s;n++}return i&&t.push(i),t}function Ht(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(zl(t))return r;const n=e[t];return n===void 0?qv(t)&&!dn(e,t)?Ht(e,Nu(t),r):r:n}case"number":case"symbol":{typeof t=="number"&&(t=no(t));const n=e[t];return n===void 0?r:n}default:{if(Array.isArray(t))return cx(e,t,r);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),zl(t))return r;const n=e[t];return n===void 0?r:n}}}function cx(e,t,r){if(t.length===0)return r;let n=e;for(let i=0;i<t.length;i++){if(n==null||zl(t[i]))return r;n=n[t[i]]}return n===void 0?r:n}var fx=4;function Rt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fx,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function ke(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((i,a,o)=>{var l=r[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+Rt(l)+a:i+a},"")}var Ke=e=>e===0?0:e>0?1:-1,jt=e=>typeof e=="number"&&e!=+e,Tr=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,T=e=>(typeof e=="number"||e instanceof Number)&&!jt(e),Ct=e=>T(e)||typeof e=="string",dx=0,ti=e=>{var t=++dx;return"".concat(e||"").concat(t)},mt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!T(t)&&typeof t!="string")return n;var a;if(Tr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return jt(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},Gv=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function ve(e,t,r){return T(e)&&T(t)?Rt(e+r*(t-e)):t}function Xv(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Ht(n,t))===r)}var ue=e=>e===null||typeof e>"u",pi=e=>ue(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ue(e){return e!=null}function Wr(){}function Lu(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}}function kc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kc(Object(r),!0).forEach(function(n){hx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hx(e,t,r){return(t=vx(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vx(e){var t=px(e,"string");return typeof t=="symbol"?t:t+""}function px(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zv=e=>{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,a=e.parentViewBox,o=e.clamp,l=Lu(t),u=l.x,s=l.y,c=l.height,f=l.upperWidth,d=l.lowerWidth,h=u,p=u+(f-d)/2,y=(h+p)/2,m=(f+d)/2,g=h+f/2,b=c>=0?1:-1,x=b*i,A=b>0?"end":"start",P=b>0?"start":"end",w=f>=0?1:-1,_=w*i,E=w>0?"end":"start",j=w>0?"start":"end",k=a;if(r==="top"){var I={x:h+f/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:A};return o&&k&&(I.height=Math.max(s-k.y,0),I.width=f),I}if(r==="bottom"){var S={x:p+d/2,y:s+c+x,horizontalAnchor:"middle",verticalAnchor:P};return o&&k&&(S.height=Math.max(k.y+k.height-(s+c),0),S.width=d),S}if(r==="left"){var z={x:y-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"};return o&&k&&(z.width=Math.max(z.x-k.x,0),z.height=c),z}if(r==="right"){var L={x:y+m+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"};return o&&k&&(L.width=Math.max(k.x+k.width-L.x,0),L.height=c),L}var R=o&&k?{width:m,height:c}:{};return r==="insideLeft"?wt({x:y+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"},R):r==="insideRight"?wt({x:y+m-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideTop"?wt({x:h+f/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:P},R):r==="insideBottom"?wt({x:p+d/2,y:s+c-x,horizontalAnchor:"middle",verticalAnchor:A},R):r==="insideTopLeft"?wt({x:h+_,y:s+x,horizontalAnchor:j,verticalAnchor:P},R):r==="insideTopRight"?wt({x:h+f-_,y:s+x,horizontalAnchor:E,verticalAnchor:P},R):r==="insideBottomLeft"?wt({x:p+_,y:s+c-x,horizontalAnchor:j,verticalAnchor:A},R):r==="insideBottomRight"?wt({x:p+d-_,y:s+c-x,horizontalAnchor:E,verticalAnchor:A},R):r&&typeof r=="object"&&(T(r.x)||Tr(r.x))&&(T(r.y)||Tr(r.y))?wt({x:u+mt(r.x,m),y:s+mt(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},R):wt({x:g,y:s+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},mx=["top","left","right","bottom"];function Ru(e){return e==null?!1:typeof e=="object"?!0:mx.includes(e)}var Qv=v.createContext(null),yx=()=>v.useContext(Qv);const qn=Math.PI,Bl=2*qn,xr=1e-6,gx=Bl-xr;function Jv(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function bx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Jv;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}function ep(e,t,r,n){return e===r&&t===n}function xx(e){const t=Math.floor(e);if(!(t<=15))return ep;const r=10**t,n=function(i){return Math.round(i*r)};return function(i,a,o,l){return n(i)===n(o)&&n(a)===n(l)}}class wx{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Jv:bx(t),this._equal=t==null?ep:xx(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,u=n-t,s=i-r,c=o-t,f=l-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>xr)if(!(Math.abs(f*u-s*c)>xr)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,p=i-l,y=u*u+s*s,m=h*h+p*p,g=Math.sqrt(y),b=Math.sqrt(d),x=a*Math.tan((qn-Math.acos((y+d-m)/(2*g*b)))/2),A=x/b,P=x/g;Math.abs(A-1)>xr&&this._append`L${t+A*c},${r+A*f}`,this._append`A${a},${a},0,0,${+(f*h>c*p)},${this._x1=t+P*u},${this._y1=r+P*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),s=t+l,c=r+u,f=1^o,d=o?i-a:a-i;if(this._x1===null?this._append`M${s},${c}`:(Math.abs(this._x1-s)>xr||Math.abs(this._y1-c)>xr)&&this._append`L${s},${c}`,!!n){if(d<0&&(d=d%Bl+Bl),d>gx)this._append`A${n},${n},0,1,${f},${t-l},${r-u}A${n},${n},0,1,${f},${this._x1=s},${this._y1=c}`;else if(d>xr){const h=t+n*Math.cos(a),p=r+n*Math.sin(a);if(d>=qn&&this._equal(s,c,h,p)){d/=2;let y=i+d;this._append`A${n},${n},0,${+(d>=qn)},${f},${t+n*Math.cos(y)},${r+n*Math.sin(y)}`}this._append`A${n},${n},0,${+(d>=qn)},${f},${this._x1=h},${this._y1=p}`}}}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ne(e){return function(){return e}}const tp=Math.cos,ca=Math.sin,gt=Math.sqrt,jc=1e-12,fa=Math.PI,io=2*fa;function zu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new wx(t)}function Bu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rp(e){this._context=e}rp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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);break}}};function ao(e){return new rp(e)}function np(e){return e[0]}function ip(e){return e[1]}function ap(e,t){var r=ne(!0),n=null,i=ao,a=null,o=zu(l);e=typeof e=="function"?e:e===void 0?np:ne(e),t=typeof t=="function"?t:t===void 0?ip:ne(t);function l(u){var s,c=(u=Bu(u)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),s=0;s<=c;++s)!(s<c&&r(f=u[s],s,u))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(f,s,u),+t(f,s,u));if(h)return a=null,h+""||null}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:ne(+u),l):e},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:ne(+u),l):t},l.defined=function(u){return arguments.length?(r=typeof u=="function"?u:ne(!!u),l):r},l.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),l):i},l.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),l):n},l}function Fi(e,t,r){var n=null,i=ne(!0),a=null,o=ao,l=null,u=zu(s);e=typeof e=="function"?e:e===void 0?np:ne(+e),t=typeof t=="function"?t:ne(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?ip:ne(+r);function s(f){var d,h,p,y=(f=Bu(f)).length,m,g=!1,b,x=new Array(y),A=new Array(y);for(a==null&&(l=o(b=u())),d=0;d<=y;++d){if(!(d<y&&i(m=f[d],d,f))===g)if(g=!g)h=d,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),p=d-1;p>=h;--p)l.point(x[p],A[p]);l.lineEnd(),l.areaEnd()}g&&(x[d]=+e(m,d,f),A[d]=+t(m,d,f),l.point(n?+n(m,d,f):x[d],r?+r(m,d,f):A[d]))}if(b)return l=null,b+""||null}function c(){return ap().defined(i).curve(o).context(a)}return s.x=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),n=null,s):e},s.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),s):e},s.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ne(+f),s):n},s.y=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),r=null,s):t},s.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),s):t},s.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ne(+f),s):r},s.lineX0=s.lineY0=function(){return c().x(e).y(t)},s.lineY1=function(){return c().x(e).y(r)},s.lineX1=function(){return c().x(n).y(t)},s.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ne(!!f),s):i},s.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),s):o},s.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),s):a},s}class op{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Ax(e){return new op(e,!0)}function Px(e){return new op(e,!1)}var Wu={draw(e,t){const r=gt(t/fa);e.moveTo(r,0),e.arc(0,0,r,0,io)}},Ox={draw(e,t){const r=gt(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()}};const lp=gt(1/3),_x=lp*2;var Sx={draw(e,t){const r=gt(t/_x),n=r*lp;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Ex={draw(e,t){const r=gt(t),n=-r/2;e.rect(n,n,r,r)}};const Ix=.8908130915292852,up=ca(fa/10)/ca(7*fa/10),kx=ca(io/10)*up,jx=-tp(io/10)*up;var Cx={draw(e,t){const r=gt(t*Ix),n=kx*r,i=jx*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=io*a/5,l=tp(o),u=ca(o);e.lineTo(u*r,-l*r),e.lineTo(l*n-u*i,u*n+l*i)}e.closePath()}};const Zo=gt(3);var Tx={draw(e,t){const r=-gt(t/(Zo*3));e.moveTo(0,r*2),e.lineTo(-Zo*r,-r),e.lineTo(Zo*r,-r),e.closePath()}};const Je=-.5,et=gt(3)/2,Wl=1/gt(12),Mx=(Wl/2+1)*3;var Dx={draw(e,t){const r=gt(t/Mx),n=r/2,i=r*Wl,a=n,o=r*Wl+r,l=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(Je*n-et*i,et*n+Je*i),e.lineTo(Je*a-et*o,et*a+Je*o),e.lineTo(Je*l-et*u,et*l+Je*u),e.lineTo(Je*n+et*i,Je*i-et*n),e.lineTo(Je*a+et*o,Je*o-et*a),e.lineTo(Je*l+et*u,Je*u-et*l),e.closePath()}};function $x(e,t){let r=null,n=zu(i);e=typeof e=="function"?e:ne(e||Wu),t=typeof t=="function"?t:ne(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:ne(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ne(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ur(){}function da(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 oo(e){this._context=e}oo.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:da(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nx(e){return new oo(e)}function sp(e){this._context=e}sp.prototype={areaStart:ur,areaEnd:ur,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);break}}},point:function(e,t){switch(e=+e,t=+t,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:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lx(e){return new sp(e)}function cp(e){this._context=e}cp.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rx(e){return new cp(e)}function fp(e,t){this._basis=new oo(e),this._beta=t}fp.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,o=t[r]-i,l=-1,u;++l<=r;)u=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+u*a),this._beta*t[l]+(1-this._beta)*(i+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(n){return t===1?new oo(n):new fp(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function ha(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Fu(e,t){this._context=e,this._k=(1-t)/6}Fu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ha(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Fu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Ku(e,t){this._context=e,this._k=(1-t)/6}Ku.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Ku(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Uu(e,t){this._context=e,this._k=(1-t)/6}Uu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Uu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Hu(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>jc){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>jc){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*s+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*s+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function dp(e,t){this._context=e,this._alpha=t}dp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}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;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new dp(n,t):new Fu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function hp(e,t){this._context=e,this._alpha=t}hp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new hp(n,t):new Ku(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function vp(e,t){this._context=e,this._alpha=t}vp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new vp(n,t):new Uu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function pp(e){this._context=e}pp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function zx(e){return new pp(e)}function Cc(e){return e<0?-1:1}function Tc(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(Cc(a)+Cc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Mc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Qo(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,o-l*r,a,o)}function va(e){this._context=e}va.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:Qo(this,this._t0,Mc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===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,Qo(this,Mc(this,r=Tc(this,e,t)),r);break;default:Qo(this,this._t0,r=Tc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function mp(e){this._context=new yp(e)}(mp.prototype=Object.create(va.prototype)).point=function(e,t){va.prototype.point.call(this,t,e)};function yp(e){this._context=e}yp.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)}};function Bx(e){return new va(e)}function Wx(e){return new mp(e)}function gp(e){this._context=e}gp.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]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Dc(e),i=Dc(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&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)}};function Dc(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Fx(e){return new gp(e)}function lo(e,t){this._context=e,this._t=t}lo.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&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,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)}break}}this._x=e,this._y=t}};function Kx(e){return new lo(e,.5)}function Ux(e){return new lo(e,0)}function Hx(e){return new lo(e,1)}function Mr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,l=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Fl(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Vx(e,t){return e[t]}function qx(e){const t=[];return t.key=e,t}function Yx(){var e=ne([]),t=Fl,r=Mr,n=Vx;function i(a){var o=Array.from(e.apply(this,arguments),qx),l,u=o.length,s=-1,c;for(const f of a)for(l=0,++s;l<u;++l)(o[l][s]=[0,+n(f,o[l].key,s,a)]).data=f;for(l=0,c=Bu(t(o));l<u;++l)o[c[l]].index=l;return r(o,c),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ne(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:ne(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Fl:typeof a=="function"?a:ne(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??Mr,i):r},i}function Gx(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}Mr(e,t)}}function Xx(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Mr(e,t)}}function Zx(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var l=0,u=0,s=0;l<o;++l){for(var c=e[t[l]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,p=0;p<l;++p){var y=e[t[p]],m=y[n][1]||0,g=y[n-1][1]||0;h+=m-g}u+=f,s+=h*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=s/u)}i[n-1][1]+=i[n-1][0]=r,Mr(e,t)}}var Qx=["type","size","sizeType"];function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kl.apply(null,arguments)}function $c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$c(Object(r),!0).forEach(function(n){Jx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$c(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jx(e,t,r){return(t=ew(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ew(e){var t=tw(e,"string");return typeof t=="symbol"?t:t+""}function tw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rw(e,t){if(e==null)return{};var r,n,i=nw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nw(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bp={symbolCircle:Wu,symbolCross:Ox,symbolDiamond:Sx,symbolSquare:Ex,symbolStar:Cx,symbolTriangle:Tx,symbolWye:Dx},iw=Math.PI/180,aw=e=>{var t="symbol".concat(pi(e));return bp[t]||Wu},ow=(e,t,r)=>{if(t==="area")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*iw;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*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}},lw=(e,t)=>{bp["symbol".concat(pi(e))]=t},xp=e=>{var t=e.type,r=t===void 0?"circle":t,n=e.size,i=n===void 0?64:n,a=e.sizeType,o=a===void 0?"area":a,l=rw(e,Qx),u=Nc(Nc({},l),{},{type:r,size:i,sizeType:o}),s="circle";typeof r=="string"&&(s=r);var c=()=>{var y=aw(s),m=$x().type(y).size(ow(i,o,s)),g=m();if(g!==null)return g},f=u.className,d=u.cx,h=u.cy,p=Xe(u);return T(d)&&T(h)&&T(i)?v.createElement("path",Kl({},p,{className:te("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:c()})):null};xp.registerSymbol=lw;var wp=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Vu=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(v.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Mu(i)&&typeof r[i]=="function"&&(n[i]=(a=>r[i](r,a)))}),n},uw=(e,t,r)=>n=>(e(t,r,n),null),uo=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Mu(i)&&typeof a=="function"&&(n||(n={}),n[i]=uw(a,t,r))}),n};function Lc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lc(Object(r),!0).forEach(function(n){cw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cw(e,t,r){return(t=fw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fw(e){var t=dw(e,"string");return typeof t=="symbol"?t:t+""}function dw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ne(e,t){var r=sw({},e),n=t,i=Object.keys(t),a=i.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return a}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pa.apply(null,arguments)}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ap(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rc(Object(r),!0).forEach(function(n){hw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hw(e,t,r){return(t=vw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vw(e){var t=pw(e,"string");return typeof t=="symbol"?t:t+""}function pw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rt=32,mw={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function yw(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function gw(e){var t=e.data,r=e.iconType,n=e.inactiveColor,i=rt/2,a=rt/6,o=rt/3,l=t.inactive?n:t.color,u=r??t.type;if(u==="none")return null;if(u==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:yw(t.payload),x1:0,y1:i,x2:rt,y2:i,className:"recharts-legend-icon"});if(u==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
1
+ var Hb=Object.defineProperty;var Vb=(e,t,r)=>t in e?Hb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Wi=(e,t,r)=>Vb(e,typeof t!="symbol"?t+"":t,r);import{E as v,H as te,b as Cu,I as Tu,g as qb,R as Yb,J as hi,K as N,L as Ic,M as Gb,N as Xb,O as Uv,P as Ft}from"./index-DLy5RpPl.js";var Zb=["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 Mu(e){if(typeof e!="string")return!1;var t=Zb;return t.includes(e)}var Qb=["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"],Jb=new Set(Qb);function Hv(e){return typeof e!="string"?!1:Jb.has(e)}function Vv(e){return typeof e=="string"&&e.startsWith("data-")}function pt(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r))&&(t[r]=e[r]);return t}function vi(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return pt(t)}return typeof e=="object"&&!Array.isArray(e)?pt(e):null}function Xe(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r)||Mu(r))&&(t[r]=e[r]);return t}function ex(e){return e==null?null:v.isValidElement(e)?Xe(e.props):typeof e=="object"&&!Array.isArray(e)?Xe(e):null}var tx=["children","width","height","viewBox","className","style","title","desc"];function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ll.apply(null,arguments)}function rx(e,t){if(e==null)return{};var r,n,i=nx(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nx(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Du=v.forwardRef((e,t)=>{var r=e.children,n=e.width,i=e.height,a=e.viewBox,o=e.className,l=e.style,u=e.title,s=e.desc,c=rx(e,tx),f=a||{width:n,height:i,x:0,y:0},d=te("recharts-surface",o);return v.createElement("svg",Ll({},Xe(c),{className:d,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),v.createElement("title",null,u),v.createElement("desc",null,s),r)}),ix=["children","className"];function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rl.apply(null,arguments)}function ax(e,t){if(e==null)return{};var r,n,i=ox(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ox(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ze=v.forwardRef((e,t)=>{var r=e.children,n=e.className,i=ax(e,ix),a=te("recharts-layer",n);return v.createElement("g",Rl({className:a},Xe(i),{ref:t}),r)});function zl(e){return e==="__proto__"}const lx=Object.prototype.hasOwnProperty;function dn(e,t){return lx.call(e,t)}const ux=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function qv(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e===""||e.startsWith(".")||e.endsWith(".")?!1:ux.test(e);default:return!1}}function no(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is(e==null||(t=e.valueOf)===null||t===void 0?void 0:t.call(e),-0)?"-0":String(e)}function $u(e){return typeof e=="symbol"||e instanceof Symbol}function Yv(e){if(typeof e=="string")return e;if(Array.isArray(e)){let r="";for(let n=0;n<e.length;n++)n>0&&(r+=","),r+=Yv(e[n]);return r}if($u(e))return e.toString();const t=e+"";return t==="0"&&Object.is(Number(e),-0)?"-0":t}function sx(e){return e==null?"":Yv(e)}function Nu(e){if(Array.isArray(e))return e.map(no);if(typeof e=="symbol")return[e];e=sx(e);const t=[],r=e.length;if(r===0)return t;let n=0,i="",a="",o=!1,l=!1;const u=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push("");n<r;){const s=e[n];if(a)s==="\\"&&n+1<r?(n++,i+=e[n]):s===a?a="":i+=s;else if(o)if(s==='"'||s==="'")a=s,l=!0;else if(s==="]"){if(o=!1,!l&&i.includes(".")&&!u.test(i)){const c=i.split(".");for(let f=0;f<c.length;f++)c[f]!==""&&t.push(c[f])}else t.push(i);i=""}else i+=s;else if(s==="[")o=!0,l=!1,i&&(t.push(i),i="");else if(s==="."){i&&(t.push(i),i="");const c=e[n+1];(c===void 0||c===".")&&t.push("")}else i+=s;n++}return i&&t.push(i),t}function Ht(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(zl(t))return r;const n=e[t];return n===void 0?qv(t)&&!dn(e,t)?Ht(e,Nu(t),r):r:n}case"number":case"symbol":{typeof t=="number"&&(t=no(t));const n=e[t];return n===void 0?r:n}default:{if(Array.isArray(t))return cx(e,t,r);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),zl(t))return r;const n=e[t];return n===void 0?r:n}}}function cx(e,t,r){if(t.length===0)return r;let n=e;for(let i=0;i<t.length;i++){if(n==null||zl(t[i]))return r;n=n[t[i]]}return n===void 0?r:n}var fx=4;function Rt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fx,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function ke(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((i,a,o)=>{var l=r[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+Rt(l)+a:i+a},"")}var Ke=e=>e===0?0:e>0?1:-1,jt=e=>typeof e=="number"&&e!=+e,Tr=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,T=e=>(typeof e=="number"||e instanceof Number)&&!jt(e),Ct=e=>T(e)||typeof e=="string",dx=0,ti=e=>{var t=++dx;return"".concat(e||"").concat(t)},mt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!T(t)&&typeof t!="string")return n;var a;if(Tr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return jt(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},Gv=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function ve(e,t,r){return T(e)&&T(t)?Rt(e+r*(t-e)):t}function Xv(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Ht(n,t))===r)}var ue=e=>e===null||typeof e>"u",pi=e=>ue(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ue(e){return e!=null}function Wr(){}function Lu(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}}function kc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kc(Object(r),!0).forEach(function(n){hx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hx(e,t,r){return(t=vx(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vx(e){var t=px(e,"string");return typeof t=="symbol"?t:t+""}function px(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zv=e=>{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,a=e.parentViewBox,o=e.clamp,l=Lu(t),u=l.x,s=l.y,c=l.height,f=l.upperWidth,d=l.lowerWidth,h=u,p=u+(f-d)/2,y=(h+p)/2,m=(f+d)/2,g=h+f/2,b=c>=0?1:-1,x=b*i,A=b>0?"end":"start",P=b>0?"start":"end",w=f>=0?1:-1,_=w*i,E=w>0?"end":"start",j=w>0?"start":"end",k=a;if(r==="top"){var I={x:h+f/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:A};return o&&k&&(I.height=Math.max(s-k.y,0),I.width=f),I}if(r==="bottom"){var S={x:p+d/2,y:s+c+x,horizontalAnchor:"middle",verticalAnchor:P};return o&&k&&(S.height=Math.max(k.y+k.height-(s+c),0),S.width=d),S}if(r==="left"){var z={x:y-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"};return o&&k&&(z.width=Math.max(z.x-k.x,0),z.height=c),z}if(r==="right"){var L={x:y+m+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"};return o&&k&&(L.width=Math.max(k.x+k.width-L.x,0),L.height=c),L}var R=o&&k?{width:m,height:c}:{};return r==="insideLeft"?wt({x:y+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"},R):r==="insideRight"?wt({x:y+m-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideTop"?wt({x:h+f/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:P},R):r==="insideBottom"?wt({x:p+d/2,y:s+c-x,horizontalAnchor:"middle",verticalAnchor:A},R):r==="insideTopLeft"?wt({x:h+_,y:s+x,horizontalAnchor:j,verticalAnchor:P},R):r==="insideTopRight"?wt({x:h+f-_,y:s+x,horizontalAnchor:E,verticalAnchor:P},R):r==="insideBottomLeft"?wt({x:p+_,y:s+c-x,horizontalAnchor:j,verticalAnchor:A},R):r==="insideBottomRight"?wt({x:p+d-_,y:s+c-x,horizontalAnchor:E,verticalAnchor:A},R):r&&typeof r=="object"&&(T(r.x)||Tr(r.x))&&(T(r.y)||Tr(r.y))?wt({x:u+mt(r.x,m),y:s+mt(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},R):wt({x:g,y:s+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},mx=["top","left","right","bottom"];function Ru(e){return e==null?!1:typeof e=="object"?!0:mx.includes(e)}var Qv=v.createContext(null),yx=()=>v.useContext(Qv);const qn=Math.PI,Bl=2*qn,xr=1e-6,gx=Bl-xr;function Jv(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function bx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Jv;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}function ep(e,t,r,n){return e===r&&t===n}function xx(e){const t=Math.floor(e);if(!(t<=15))return ep;const r=10**t,n=function(i){return Math.round(i*r)};return function(i,a,o,l){return n(i)===n(o)&&n(a)===n(l)}}class wx{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Jv:bx(t),this._equal=t==null?ep:xx(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,u=n-t,s=i-r,c=o-t,f=l-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>xr)if(!(Math.abs(f*u-s*c)>xr)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,p=i-l,y=u*u+s*s,m=h*h+p*p,g=Math.sqrt(y),b=Math.sqrt(d),x=a*Math.tan((qn-Math.acos((y+d-m)/(2*g*b)))/2),A=x/b,P=x/g;Math.abs(A-1)>xr&&this._append`L${t+A*c},${r+A*f}`,this._append`A${a},${a},0,0,${+(f*h>c*p)},${this._x1=t+P*u},${this._y1=r+P*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),s=t+l,c=r+u,f=1^o,d=o?i-a:a-i;if(this._x1===null?this._append`M${s},${c}`:(Math.abs(this._x1-s)>xr||Math.abs(this._y1-c)>xr)&&this._append`L${s},${c}`,!!n){if(d<0&&(d=d%Bl+Bl),d>gx)this._append`A${n},${n},0,1,${f},${t-l},${r-u}A${n},${n},0,1,${f},${this._x1=s},${this._y1=c}`;else if(d>xr){const h=t+n*Math.cos(a),p=r+n*Math.sin(a);if(d>=qn&&this._equal(s,c,h,p)){d/=2;let y=i+d;this._append`A${n},${n},0,${+(d>=qn)},${f},${t+n*Math.cos(y)},${r+n*Math.sin(y)}`}this._append`A${n},${n},0,${+(d>=qn)},${f},${this._x1=h},${this._y1=p}`}}}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ne(e){return function(){return e}}const tp=Math.cos,ca=Math.sin,gt=Math.sqrt,jc=1e-12,fa=Math.PI,io=2*fa;function zu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new wx(t)}function Bu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rp(e){this._context=e}rp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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);break}}};function ao(e){return new rp(e)}function np(e){return e[0]}function ip(e){return e[1]}function ap(e,t){var r=ne(!0),n=null,i=ao,a=null,o=zu(l);e=typeof e=="function"?e:e===void 0?np:ne(e),t=typeof t=="function"?t:t===void 0?ip:ne(t);function l(u){var s,c=(u=Bu(u)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),s=0;s<=c;++s)!(s<c&&r(f=u[s],s,u))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(f,s,u),+t(f,s,u));if(h)return a=null,h+""||null}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:ne(+u),l):e},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:ne(+u),l):t},l.defined=function(u){return arguments.length?(r=typeof u=="function"?u:ne(!!u),l):r},l.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),l):i},l.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),l):n},l}function Fi(e,t,r){var n=null,i=ne(!0),a=null,o=ao,l=null,u=zu(s);e=typeof e=="function"?e:e===void 0?np:ne(+e),t=typeof t=="function"?t:ne(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?ip:ne(+r);function s(f){var d,h,p,y=(f=Bu(f)).length,m,g=!1,b,x=new Array(y),A=new Array(y);for(a==null&&(l=o(b=u())),d=0;d<=y;++d){if(!(d<y&&i(m=f[d],d,f))===g)if(g=!g)h=d,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),p=d-1;p>=h;--p)l.point(x[p],A[p]);l.lineEnd(),l.areaEnd()}g&&(x[d]=+e(m,d,f),A[d]=+t(m,d,f),l.point(n?+n(m,d,f):x[d],r?+r(m,d,f):A[d]))}if(b)return l=null,b+""||null}function c(){return ap().defined(i).curve(o).context(a)}return s.x=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),n=null,s):e},s.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),s):e},s.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ne(+f),s):n},s.y=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),r=null,s):t},s.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),s):t},s.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ne(+f),s):r},s.lineX0=s.lineY0=function(){return c().x(e).y(t)},s.lineY1=function(){return c().x(e).y(r)},s.lineX1=function(){return c().x(n).y(t)},s.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ne(!!f),s):i},s.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),s):o},s.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),s):a},s}class op{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Ax(e){return new op(e,!0)}function Px(e){return new op(e,!1)}var Wu={draw(e,t){const r=gt(t/fa);e.moveTo(r,0),e.arc(0,0,r,0,io)}},Ox={draw(e,t){const r=gt(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()}};const lp=gt(1/3),_x=lp*2;var Sx={draw(e,t){const r=gt(t/_x),n=r*lp;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Ex={draw(e,t){const r=gt(t),n=-r/2;e.rect(n,n,r,r)}};const Ix=.8908130915292852,up=ca(fa/10)/ca(7*fa/10),kx=ca(io/10)*up,jx=-tp(io/10)*up;var Cx={draw(e,t){const r=gt(t*Ix),n=kx*r,i=jx*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=io*a/5,l=tp(o),u=ca(o);e.lineTo(u*r,-l*r),e.lineTo(l*n-u*i,u*n+l*i)}e.closePath()}};const Zo=gt(3);var Tx={draw(e,t){const r=-gt(t/(Zo*3));e.moveTo(0,r*2),e.lineTo(-Zo*r,-r),e.lineTo(Zo*r,-r),e.closePath()}};const Je=-.5,et=gt(3)/2,Wl=1/gt(12),Mx=(Wl/2+1)*3;var Dx={draw(e,t){const r=gt(t/Mx),n=r/2,i=r*Wl,a=n,o=r*Wl+r,l=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(Je*n-et*i,et*n+Je*i),e.lineTo(Je*a-et*o,et*a+Je*o),e.lineTo(Je*l-et*u,et*l+Je*u),e.lineTo(Je*n+et*i,Je*i-et*n),e.lineTo(Je*a+et*o,Je*o-et*a),e.lineTo(Je*l+et*u,Je*u-et*l),e.closePath()}};function $x(e,t){let r=null,n=zu(i);e=typeof e=="function"?e:ne(e||Wu),t=typeof t=="function"?t:ne(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:ne(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ne(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ur(){}function da(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 oo(e){this._context=e}oo.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:da(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nx(e){return new oo(e)}function sp(e){this._context=e}sp.prototype={areaStart:ur,areaEnd:ur,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);break}}},point:function(e,t){switch(e=+e,t=+t,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:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lx(e){return new sp(e)}function cp(e){this._context=e}cp.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rx(e){return new cp(e)}function fp(e,t){this._basis=new oo(e),this._beta=t}fp.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,o=t[r]-i,l=-1,u;++l<=r;)u=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+u*a),this._beta*t[l]+(1-this._beta)*(i+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(n){return t===1?new oo(n):new fp(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function ha(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Fu(e,t){this._context=e,this._k=(1-t)/6}Fu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ha(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Fu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Ku(e,t){this._context=e,this._k=(1-t)/6}Ku.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Ku(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Uu(e,t){this._context=e,this._k=(1-t)/6}Uu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Uu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Hu(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>jc){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>jc){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*s+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*s+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function dp(e,t){this._context=e,this._alpha=t}dp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}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;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new dp(n,t):new Fu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function hp(e,t){this._context=e,this._alpha=t}hp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new hp(n,t):new Ku(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function vp(e,t){this._context=e,this._alpha=t}vp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new vp(n,t):new Uu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function pp(e){this._context=e}pp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function zx(e){return new pp(e)}function Cc(e){return e<0?-1:1}function Tc(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(Cc(a)+Cc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Mc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Qo(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,o-l*r,a,o)}function va(e){this._context=e}va.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:Qo(this,this._t0,Mc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===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,Qo(this,Mc(this,r=Tc(this,e,t)),r);break;default:Qo(this,this._t0,r=Tc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function mp(e){this._context=new yp(e)}(mp.prototype=Object.create(va.prototype)).point=function(e,t){va.prototype.point.call(this,t,e)};function yp(e){this._context=e}yp.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)}};function Bx(e){return new va(e)}function Wx(e){return new mp(e)}function gp(e){this._context=e}gp.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]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Dc(e),i=Dc(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&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)}};function Dc(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Fx(e){return new gp(e)}function lo(e,t){this._context=e,this._t=t}lo.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&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,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)}break}}this._x=e,this._y=t}};function Kx(e){return new lo(e,.5)}function Ux(e){return new lo(e,0)}function Hx(e){return new lo(e,1)}function Mr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,l=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Fl(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Vx(e,t){return e[t]}function qx(e){const t=[];return t.key=e,t}function Yx(){var e=ne([]),t=Fl,r=Mr,n=Vx;function i(a){var o=Array.from(e.apply(this,arguments),qx),l,u=o.length,s=-1,c;for(const f of a)for(l=0,++s;l<u;++l)(o[l][s]=[0,+n(f,o[l].key,s,a)]).data=f;for(l=0,c=Bu(t(o));l<u;++l)o[c[l]].index=l;return r(o,c),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ne(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:ne(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Fl:typeof a=="function"?a:ne(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??Mr,i):r},i}function Gx(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}Mr(e,t)}}function Xx(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Mr(e,t)}}function Zx(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var l=0,u=0,s=0;l<o;++l){for(var c=e[t[l]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,p=0;p<l;++p){var y=e[t[p]],m=y[n][1]||0,g=y[n-1][1]||0;h+=m-g}u+=f,s+=h*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=s/u)}i[n-1][1]+=i[n-1][0]=r,Mr(e,t)}}var Qx=["type","size","sizeType"];function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kl.apply(null,arguments)}function $c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$c(Object(r),!0).forEach(function(n){Jx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$c(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jx(e,t,r){return(t=ew(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ew(e){var t=tw(e,"string");return typeof t=="symbol"?t:t+""}function tw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rw(e,t){if(e==null)return{};var r,n,i=nw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nw(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bp={symbolCircle:Wu,symbolCross:Ox,symbolDiamond:Sx,symbolSquare:Ex,symbolStar:Cx,symbolTriangle:Tx,symbolWye:Dx},iw=Math.PI/180,aw=e=>{var t="symbol".concat(pi(e));return bp[t]||Wu},ow=(e,t,r)=>{if(t==="area")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*iw;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*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}},lw=(e,t)=>{bp["symbol".concat(pi(e))]=t},xp=e=>{var t=e.type,r=t===void 0?"circle":t,n=e.size,i=n===void 0?64:n,a=e.sizeType,o=a===void 0?"area":a,l=rw(e,Qx),u=Nc(Nc({},l),{},{type:r,size:i,sizeType:o}),s="circle";typeof r=="string"&&(s=r);var c=()=>{var y=aw(s),m=$x().type(y).size(ow(i,o,s)),g=m();if(g!==null)return g},f=u.className,d=u.cx,h=u.cy,p=Xe(u);return T(d)&&T(h)&&T(i)?v.createElement("path",Kl({},p,{className:te("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:c()})):null};xp.registerSymbol=lw;var wp=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Vu=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(v.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Mu(i)&&typeof r[i]=="function"&&(n[i]=(a=>r[i](r,a)))}),n},uw=(e,t,r)=>n=>(e(t,r,n),null),uo=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Mu(i)&&typeof a=="function"&&(n||(n={}),n[i]=uw(a,t,r))}),n};function Lc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lc(Object(r),!0).forEach(function(n){cw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cw(e,t,r){return(t=fw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fw(e){var t=dw(e,"string");return typeof t=="symbol"?t:t+""}function dw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ne(e,t){var r=sw({},e),n=t,i=Object.keys(t),a=i.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return a}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pa.apply(null,arguments)}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ap(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rc(Object(r),!0).forEach(function(n){hw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hw(e,t,r){return(t=vw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vw(e){var t=pw(e,"string");return typeof t=="symbol"?t:t+""}function pw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rt=32,mw={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function yw(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function gw(e){var t=e.data,r=e.iconType,n=e.inactiveColor,i=rt/2,a=rt/6,o=rt/3,l=t.inactive?n:t.color,u=r??t.type;if(u==="none")return null;if(u==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:yw(t.payload),x1:0,y1:i,x2:rt,y2:i,className:"recharts-legend-icon"});if(u==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
2
2
  A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
3
3
  H`).concat(rt,"M").concat(2*o,",").concat(i,`
4
4
  A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(u==="rect")return v.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(rt/8,"h").concat(rt,"v").concat(rt*3/4,"h").concat(-rt,"z"),className:"recharts-legend-icon"});if(v.isValidElement(t.legendIcon)){var s=Ap({},t);return delete s.legendIcon,v.cloneElement(t.legendIcon,s)}return v.createElement(xp,{fill:l,cx:i,cy:i,size:rt,sizeType:"diameter",type:u})}function bw(e){var t=e.payload,r=e.iconSize,n=e.layout,i=e.formatter,a=e.inactiveColor,o=e.iconType,l=e.labelStyle,u={x:0,y:0,width:rt,height:rt},s={display:n==="horizontal"?"inline-block":"block",marginRight:10,whiteSpace:"nowrap"},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((f,d)=>{var h,p,y=f.formatter||i,m=te({"recharts-legend-item":!0,["legend-item-".concat(d)]:!0,inactive:f.inactive});if(f.type==="none")return null;var g=typeof l=="object"?Ap({},l):{};g.color=f.inactive?a:g.color||f.color,(h=g.whiteSpace)!==null&&h!==void 0||(g.whiteSpace="normal"),(p=g.overflowWrap)!==null&&p!==void 0||(g.overflowWrap="break-word");var b=y?y(f.value,f,d):f.value;return v.createElement("li",pa({className:m,style:s,key:"legend-item-".concat(d)},uo(e,f,d)),v.createElement(Du,{width:r,height:r,viewBox:u,style:c,"aria-label":f.value==null?"legend icon":"".concat(f.value," legend icon")},v.createElement(gw,{data:f,iconType:o,inactiveColor:a})),v.createElement("span",{className:"recharts-legend-item-text",style:g},b))})}var xw=e=>{var t=Ne(e,mw),r=t.payload,n=t.layout,i=t.align;if(!r||!r.length)return null;var a={padding:0,margin:0,textAlign:n==="horizontal"?i:"left"};return v.createElement("ul",{className:"recharts-default-legend",style:a},v.createElement(bw,pa({},t,{payload:r})))};function ww(e,t){const r=new Map;for(let n=0;n<e.length;n++){const i=e[n],a=t(i,n,e);r.has(a)||r.set(a,i)}return Array.from(r.values())}function Aw(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}function Pp(e){return e}function Pw(e){return Number.isSafeInteger(e)&&e>=0}function qu(e){return e!=null&&typeof e!="function"&&Pw(e.length)}function Ow(e){return function(t){return Ht(t,e)}}function Op(e){return e==null||typeof e!="object"&&typeof e!="function"}function Er(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const _p="[object RegExp]",Yu="[object String]",Gu="[object Number]",Xu="[object Boolean]",Sp="[object Arguments]",Ep="[object Symbol]",Ip="[object Date]",kp="[object Map]",jp="[object Set]",Cp="[object Array]",_w="[object Function]",Tp="[object ArrayBuffer]",aa="[object Object]",Sw="[object Error]",Mp="[object DataView]",Dp="[object Uint8Array]",$p="[object Uint8ClampedArray]",Np="[object Uint16Array]",Lp="[object Uint32Array]",Ew="[object BigUint64Array]",Rp="[object Int8Array]",zp="[object Int16Array]",Bp="[object Int32Array]",Iw="[object BigInt64Array]",Wp="[object Float32Array]",Fp="[object Float64Array]";function Zn(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Kp(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Up(e,t,r){return typeof r!="function"?Up(e,t,()=>{}):Ul(e,t,function n(i,a,o,l,u,s){const c=r(i,a,o,l,u,s);return c!==void 0?!!c:Ul(i,a,n,s,!1)},new Map,!0)}function Ul(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return kw(e,t,r,n,i);case"function":return Object.keys(t).length>0?Ul(e,Object.assign({},t),r,n,i):Zn(e,t);default:return Kp(e)&&i?typeof t=="string"?t==="":!0:Zn(e,t)}}function kw(e,t,r,n,i=!1){if(t==null)return!0;if(Array.isArray(t))return Hp(e,t,r,n);if(t instanceof Map)return jw(e,t,r,n);if(t instanceof Set)return Cw(e,t,r,n);const a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Op(e)&&(e=Object(e));else{if(Er(t)==="[object Error]")return Er(e)==="[object Error]"&&e.name===t.name&&e.message===t.message;const o=Er(e);if(o!=="[object Object]"&&o!=="[object Arguments]")return!1}if(a.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o<a.length;o++){const l=a[o];if(!(l in e)||t[l]===void 0&&e[l]!==void 0||t[l]===null&&e[l]!==null||!r(e[l],t[l],l,e,t,n))return!1}return!0}finally{n==null||n.delete(t)}}function jw(e,t,r,n){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(const[i,a]of t.entries())if(r(e.get(i),a,i,e,t,n)===!1)return!1;return!0}function Hp(e,t,r,n){if(t.length===0)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let a=0;a<t.length;a++){const o=t[a];let l=!1;for(let u=0;u<e.length;u++){if(i.has(u))continue;const s=e[u];let c=!1;if(r(s,o,a,e,t,n)&&(c=!0),c){i.add(u),l=!0;break}}if(!l)return!1}return!0}function Cw(e,t,r,n){return t.size===0?!0:e instanceof Set?Hp([...e],[...t],r,n):!1}function Vp(e,t){return Up(e,t,()=>{})}function Hl(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}const zc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Vl(e){return typeof zc.Buffer<"u"&&zc.Buffer.isBuffer(e)}function Tw(e){return Vl(e)}function Mw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Dw(e){return Mw(e)}function $w(e,t){return an(e,void 0,e,new Map)}function an(e,t,r,n,i){if(Op(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const o=new Array(e.length);n.set(e,o);for(let l=0;l<e.length;l++)o[l]=an(e[l],l,r,n);return dn(e,"index")&&(o.index=e.index),dn(e,"input")&&(o.input=e.input),o}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const o=new RegExp(e.source,e.flags);return o.lastIndex=e.lastIndex,o}if(e instanceof Map){const o=new Map;return n.set(e,o),e.forEach((l,u)=>{o.set(u,an(l,u,r,n))}),o}if(e instanceof Set){const o=new Set;return n.set(e,o),e.forEach(l=>{o.add(an(l,void 0,r,n))}),o}if(Tw(e))return e.subarray();if(Dw(e)){const o=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,o);for(let l=0;l<e.length;l++)o[l]=an(e[l],l,r,n);return o}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const o=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,o),Yr(o,e,r,n),o}if(typeof File<"u"&&e instanceof File){const o=new File([e],e.name,{type:e.type});return n.set(e,o),Yr(o,e,r,n),o}if(typeof Blob<"u"&&e instanceof Blob){const o=new Blob([e],{type:e.type});return n.set(e,o),Yr(o,e,r,n),o}const a=Er(e);if(a==="[object Error]")return e===r?{}:e;switch(a){case Gu:case Yu:case Xu:{const o=new e.constructor(e.valueOf());return n.set(e,o),Yr(o,e,r,n),o}case Sp:{const o={};return n.set(e,o),Yr(o,e,r,n),o.length=e.length,o[Symbol.iterator]=e[Symbol.iterator],o}}if(typeof e=="object"&&Nw(a)){const o=a==="[object Object]"&&typeof e.constructor!="function"?{}:Object.create(Object.getPrototypeOf(e));return n.set(e,o),Yr(o,e,r,n),o}return e}function Yr(e,t,r,n,i){const a=[...Object.keys(t),...Hl(t)];for(let o=0;o<a.length;o++){const l=a[o],u=Object.getOwnPropertyDescriptor(e,l);(u==null||u.writable)&&(e[l]=an(t[l],l,r,n))}}function Nw(e){switch(e){case Sp:case Cp:case Tp:case Mp:case Xu:case Ip:case Wp:case Fp:case Rp:case zp:case Bp:case kp:case Gu:case aa:case _p:case jp:case Yu:case Ep:case Dp:case $p:case Np:case Lp:return!0;default:return!1}}function qp(e){return $w(e)}function Lw(e){return e=qp(e),t=>Vp(t,e)}const Rw=/^(?:0|[1-9]\d*)$/;function Yp(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 Rw.test(e)}}function zw(e){return e!==null&&typeof e=="object"&&Er(e)==="[object Arguments]"}function Bw(e,t){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&qv(t)&&!(t in Object(e))?r=Nu(t):r=[t],r.length===0)return!1;let n=e;for(let i=0;i<r.length;i++){const a=no(r[i]);if((n==null||!dn(n,a))&&!((Array.isArray(n)||zw(n))&&Yp(a)&&Number(a)<n.length))return!1;n=n[a]}return!0}function Ww(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=no(e)}return t=qp(t),function(r){const n=Ht(r,e);return n===void 0?Bw(r,e):t===void 0?n===void 0:Vp(n,t)}}function Fw(e){if(e==null)return Pp;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?Ww(e[0],e[1]):Lw(e);default:return Ow(e)}}function Kw(e){return e===0?0:e}function Bc(e,t=Pp){return qu(e)?ww(Array.from(e),Aw(Fw(t),1)).map(Kw):[]}function Gp(e,t,r){return t===!0?Bc(e,r):typeof t=="function"?Bc(e,t):e}var Jo={exports:{}},el={},tl={exports:{}},rl={};/**
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./sdk-DtP9zqdi.js","./index-DLy5RpPl.js","./index-TcjySLVg.css","./index.esm-Dum0J07z.js","./index.esm2017-EOzKbpUS.js","./index.esm-CtEQZRb1.js"])))=>i.map(i=>d[i]);
2
+ import{c as Z,w as ee,_ as te,C as A,e as ie,p as z,n as ne,r as oe,F as H,a as se}from"./index-DLy5RpPl.js";const re=Symbol("deleteField");function G(e){return(e==null?void 0:e.code)??""}function k(e){const n=G(e);return n==="permission-denied"||n==="firestore/permission-denied"}const ce=500;function ae(e,n){const i=[];for(let t=0;t<e.length;t+=n)i.push(e.slice(t,t+n));return i}const j="invites",F="extensionChunks",x=3e5,le=["admin","member","viewer"];class N extends Error{constructor(n,i,t){super(i),this.reason=n,this.email=t,this.name="FirebaseAccessError"}}function ve(e){return e.kind==="firebase"&&typeof e.accessError=="function"}function X(e){const{id:n,...i}=z(e);return i}function ue(e){return ne({...e.data,id:e.id})}function T(e){return typeof e=="string"&&le.includes(e)}function E(e){return typeof e=="string"?e.trim().toLowerCase():""}function W(e){return!!e&&!e.authUid&&!!E(e.email)}function fe(e,n,i){const t=new Map;for(const o of e){if(o.collection!=="users")continue;const r=o.op==="set"?o.doc.id:o.id,a=n(r),p=i.users.get(r),m=W(a)?E(a.email):"",w=W(p)?E(p.email):"";m&&m!==w&&t.set(m,{type:"delete",collection:j,id:m}),w&&p&&(p.disabled?t.set(w,{type:"delete",collection:j,id:w}):t.set(w,{type:"set",collection:j,id:w,data:{role:T(p.role)?p.role:"member",userId:r,email:w}}))}return[...t.values()]}const P=(e,n,i)=>`${e}__${n}__${i}`;function J(e){const n=(e==null?void 0:e.files)??{},i={};for(const[t,o]of Object.entries(n))typeof o=="string"&&(i[t]=Math.ceil(o.length/x));return i}function de(e,n){const i=e.files??{},t=Object.values(i).reduce((p,m)=>p+(typeof m=="string"?m.length:0),0),o=[],r={},a=X(e);if(t>x){for(const[p,m]of Object.entries(i)){if(typeof m!="string")continue;const w=Math.ceil(m.length/x);r[p]=w;for(let y=0;y<w;y++)o.push({type:"set",collection:F,id:P(e.id,p,y),data:{ext:e.id,file:p,index:y,data:m.slice(y*x,(y+1)*x)}})}a.files={},a.chunks=r}for(const[p,m]of Object.entries(J(n)))for(let w=r[p]??0;w<m;w++)o.push({type:"delete",collection:F,id:P(e.id,p,w)});return o.unshift({type:"set",collection:"extensions",id:e.id,data:a}),o}function pe(e,n){const i=new Map;for(const t of n){const o=String(t.data.ext??"");i.set(o,[...i.get(o)??[],t])}return e.map(t=>{const o=t.data.chunks;if(!o||typeof o!="object")return t;const r={},a=i.get(t.id)??[];for(const[w,y]of Object.entries(o)){const C=a.filter(v=>v.data.file===w).sort((v,D)=>Number(v.data.index)-Number(D.data.index));C.length===y&&(r[w]=C.map(v=>String(v.data.data??"")).join(""))}const{chunks:p,...m}=t.data;return{id:t.id,data:{...m,files:r}}})}function he(e,n){const i=[];for(const t of e)if(t.op==="set"&&t.collection==="extensions")i.push(...de(t.doc,n.extensions.get(t.doc.id)));else if(t.op==="set")i.push({type:"set",collection:t.collection,id:t.doc.id,data:X(t.doc)});else if(t.op==="delete"){if(i.push({type:"delete",collection:t.collection,id:t.id}),t.collection==="extensions")for(const[o,r]of Object.entries(J(n.extensions.get(t.id))))for(let a=0;a<r;a++)i.push({type:"delete",collection:F,id:P(t.id,o,a)})}else{if(!n[t.collection].has(t.id))continue;const o={};for(const[r,a]of Object.entries(t.fields))r==="id"||r.startsWith("id.")||(o[r]=a===void 0?re:z(a));Object.keys(o).length&&i.push({type:"update",collection:t.collection,id:t.id,data:o})}return i}const me="files",q="Firebase Storage isn't enabled for this project: enable it in the Firebase console (Build → Storage), add `storageBucket` to the web config and deploy the storage rules (docs/files.md).";function we(e){const n=()=>{if(!e.storage)throw new H(q);return e.storage},i=o=>(se(o),`${me}/${o}`),t=async o=>{try{return await o()}catch(r){const a=G(r);throw a==="storage/unknown"||a==="storage/bucket-not-found"||a==="storage/no-default-bucket"?new H(q):r}};return{kind:"firebase",put:(o,r,a)=>t(()=>n().put(i(o),r,a==null?void 0:a.mime)),async putMany(o){for(const r of o)await t(()=>{var a;return n().put(i(r.id),r.bytes,(a=r.meta)==null?void 0:a.mime)})},get:o=>t(()=>n().get(i(o))),delete:o=>t(()=>n().delete(i(o)))}}function ge(e){const n=e.api,i=e.requireVerifiedEmail!==!1,t=e.now??Date.now;let o=null,r=null,a=null,p=new Map,m=!1;const w=n.auth.onChange(s=>{(!s||s.uid!==(r==null?void 0:r.uid))&&(o=null,r=null)});function y(s,c){const f=ie();for(const d of A){const h=d==="extensions"?pe(s.get(d)??[],c):s.get(d)??[];for(const l of h)f[d].set(l.id,ue(l))}p=new Map(f.users);for(const d of[...f.users.values()])typeof d.replaces=="string"&&d.replaces!==d.id&&f.users.delete(d.replaces);return f}async function C(s){try{return await n.listCollection(s)}catch(c){if(k(c))return[];throw c}}async function v(s){const c=E(s.email);let f=null;try{f=await n.getDoc("users",s.uid)}catch(u){if(!k(u))throw u}if(f)return T(f.role)?f.role:"viewer";if(i&&!s.emailVerified)throw new N("unverified","Verify your email address to continue.",c);const d={email:c,name:s.displayName||c.split("@")[0]||"User",authUid:s.uid,createdAt:t(),updatedAt:t(),...s.photoURL?{avatarUrl:s.photoURL}:{}},h=(u,b={})=>n.commit([{type:"set",collection:"users",id:s.uid,data:{...d,...b,role:u}}]);try{return await h("admin"),"admin"}catch(u){if(!k(u))throw u}let l=null;try{l=c?await n.getDoc(j,c):null}catch(u){if(!k(u))throw u}const g=l&&T(l.role)?l.role:"member";try{return await h(g,l&&typeof l.userId=="string"?{replaces:l.userId}:{}),g}catch(u){if(!k(u))throw u}throw new N("notInvited","This account has not been invited to this CRM. Ask an admin to add your email in Settings → Users.",c)}async function D(){const s=await n.auth.currentUser();if(!s)return a=null,null;try{const c=await v(s);return a=null,{uid:s.uid,email:E(s.email),displayName:s.displayName||E(s.email),role:c}}catch(c){return a=c instanceof N?c:new N("error",c.message,E(s.email)),null}}function B(){return o||(o=D().then(s=>(r=s,s||(o=null),s))),o}async function Q(s,c,f){const d=he(s,c);!r&&s.some(h=>h.collection==="users")&&await B(),(r==null?void 0:r.role)==="admin"&&d.push(...fe(s,h=>c.users.get(h)??p.get(h),f));for(const h of ae(d,ce))await n.commit(h);for(const h of s){if(h.collection!=="users")continue;const l=h.op==="set"?h.doc.id:h.id,g=f.users.get(l);g?p.set(l,g):p.delete(l)}}const S=Z({kind:"firebase",async load(){const s=new Map;let c=[];await Promise.all([...A.map(async d=>s.set(d,await C(d))),C(F).then(d=>c=d)]);const f=y(s,c);return V(),f},persist:(s,c,f)=>Q(s,c,f),watch(s){const c=new Map;let f=null;const d=()=>{c.size<A.length||f===null||(s(y(c,f)),V())},h=A.map(l=>n.watchCollection(l,g=>{c.set(l,g),d()},g=>{k(g)?c.set(l,[]):console.warn(`[firebase] live updates of ${l} stopped:`,g)}));return h.push(n.watchCollection(F,l=>{f=l,d()},l=>{k(l)?f=[]:console.warn("[firebase] live updates of extension chunks stopped:",l)})),()=>h.forEach(l=>l())},identity:B,close(){w()}});function V(){if((r==null?void 0:r.role)!=="admin"||m)return;const s=[...p.values()].filter(c=>typeof c.replaces=="string");s.length&&(m=!0,setTimeout(()=>{Y(s).finally(()=>m=!1)},0))}async function Y(s){var l;const c=[],f=[],d=S.list("objects"),h=new Map(d.map(g=>[g.id,(g.fields??[]).filter(u=>u.type==="user").map(u=>u.id)]));for(const g of s){const u=g.replaces,b=g.id,I=p.get(u);for(const O of S.list("records")){const _={};O.ownerId===u&&(_.ownerId=b),O.createdBy===u&&(_.createdBy=b);for(const M of h.get(O.object)??[]){const L=(l=O.fields)==null?void 0:l[M];L===u?_[`fields.${M}`]=b:Array.isArray(L)&&L.includes(u)&&(_[`fields.${M}`]=L.map(K=>K===u?b:K))}Object.keys(_).length&&c.push({op:"patch",collection:"records",id:O.id,fields:_})}for(const O of S.list("activities"))O.assigneeId===u&&c.push({op:"patch",collection:"activities",id:O.id,fields:{assigneeId:b}});const R=S.get("settings","general");(R==null?void 0:R.ownerUserId)===u&&c.push({op:"patch",collection:"settings",id:"general",fields:{ownerUserId:b}}),I&&(c.push({op:"delete",collection:"users",id:u}),E(I.email)&&f.push({type:"delete",collection:j,id:E(I.email)})),c.push({op:"patch",collection:"users",id:b,fields:{replaces:void 0,...I&&I.role!==g.role&&T(I.role)?{role:I.role}:{}}})}try{await S.write(c,{message:"Link invited users"}),f.length&&await n.commit(f)}catch(g){console.warn("[firebase] could not link invited users:",g)}}return ee(S,we(n)),Object.assign(S,{api:n,accessError:()=>a,resetSession(){o=null,r=null,a=null}})}const $=new Map;function ye(e){const n=e.firebase.projectId??"default";let i=$.get(n);return i||(i=te(()=>import("./sdk-DtP9zqdi.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(t=>t.createSdkFirebaseApi(e.firebase)),$.set(n,i),i.catch(()=>$.delete(n))),i}let U=null;oe("firebase",{async signOut(){await(U==null?void 0:U.auth.signOut())}});function be(e){const n=typeof(e==null?void 0:e.email)=="string"?e.email.trim():"",i=typeof(e==null?void 0:e.password)=="string"?e.password:"";return n&&i?{email:n,password:i}:null}async function Ee(e,n){const i=be(n);if(!i)return null;const t=await e.auth.currentUser();return t!=null&&t.email&&t.email.toLowerCase()===i.email.toLowerCase()?t:(t&&await e.auth.signOut(),e.auth.signInWithPassword(i.email,i.password))}async function Se(e,n={}){var o;const i=e;if(!((o=i.firebase)!=null&&o.apiKey)||!i.firebase.projectId)throw new Error("The Firebase web config (apiKey, projectId) is missing.");const t=await ye(i);return U=t,await Ee(t,n.secrets),ge({api:t})}export{re as DELETE_FIELD,F as EXTENSION_CHUNKS_COLLECTION,x as EXTENSION_CHUNK_CHARS,ce as FIRESTORE_BATCH_LIMIT,N as FirebaseAccessError,j as INVITES_COLLECTION,me as STORAGE_FILES_DIR,q as STORAGE_NOT_ENABLED,pe as assembleExtensionDocs,ae as chunk,Se as createFirebaseStore,ge as createFirebaseStoreWith,E as emailKey,G as errorCode,ye as firebaseApiFor,we as firebaseFileStore,fe as inviteOps,ve as isFirebaseStore,k as isPermissionDenied,he as mutationOps,Ee as signInWithSecrets};
@@ -1,3 +1,3 @@
1
- import{i as V,e as X,n as Q,s as U,d as G,f as Z,S as tt,C as et,j as O,c as nt,w as st,h as ot,G as J,a as L,k as rt,D as C,l as it,m as at,o as ct,q as lt,t as ft,u as B,v as ut,x as P,y as ht,z as dt,A as pt}from"./index-ChFauO8y.js";import{B as Dt}from"./index-ChFauO8y.js";const gt="agentcrm-git-json",yt=1,v="agentcrm.json";function D(t,e){return`${t}/${e}`}function A(t){return encodeURIComponent(t).replace(/\./g,"%2E")}function mt(t){try{return decodeURIComponent(t)}catch{return t}}function wt(t,e){if(t==="records"){const s=typeof e.object=="string"&&e.object?e.object:"_";return`records/${A(s)}/${A(e.id)}.json`}return`${t}/${A(e.id)}.json`}function H(t){const e=t.split("/"),[s]=e;if(!V(s))return null;const a=e[e.length-1];if(!a.endsWith(".json")||(s==="records"?e.length!==3:e.length!==2))return null;const i=mt(a.slice(0,-5));return i?{collection:s,id:i}:null}function K(t){return t===v||H(t)!==null}function bt(t){return JSON.stringify(t,null,2)+`
1
+ import{i as V,e as X,n as Q,s as U,d as G,f as Z,S as tt,C as et,j as O,c as nt,w as st,h as ot,G as J,a as L,k as rt,D as C,l as it,m as at,o as ct,q as lt,t as ft,u as B,v as ut,x as P,y as ht,z as dt,A as pt}from"./index-DLy5RpPl.js";import{B as Dt}from"./index-DLy5RpPl.js";const gt="agentcrm-git-json",yt=1,v="agentcrm.json";function D(t,e){return`${t}/${e}`}function A(t){return encodeURIComponent(t).replace(/\./g,"%2E")}function mt(t){try{return decodeURIComponent(t)}catch{return t}}function wt(t,e){if(t==="records"){const s=typeof e.object=="string"&&e.object?e.object:"_";return`records/${A(s)}/${A(e.id)}.json`}return`${t}/${A(e.id)}.json`}function H(t){const e=t.split("/"),[s]=e;if(!V(s))return null;const a=e[e.length-1];if(!a.endsWith(".json")||(s==="records"?e.length!==3:e.length!==2))return null;const i=mt(a.slice(0,-5));return i?{collection:s,id:i}:null}function K(t){return t===v||H(t)!==null}function bt(t){return JSON.stringify(t,null,2)+`
2
2
  `}function R(t,e,s){if(Array.isArray(t))return t.map((i,o)=>R(i,[...e,String(o)],s));if(!t||typeof t!="object")return t;const a={};for(const[i,o]of Object.entries(t)){if(tt.has(i)&&typeof o=="string"){o&&(s[[...e,i].join(".")]=o);continue}a[i]=R(o,[...e,i],s)}return a}function St(t){const e={};return{doc:R(t,[],e),secrets:e}}function Tt(t,e){if(!e)return t;let s={...t};for(const[a,i]of Object.entries(e)){const o=U(a);G(s,o.slice(0,-1))===void 0&&o.length>1||(s=Z(s,o,i))}return s}function jt(t,e={}){const s=X(),a=new Map,i=[];for(const[o,f]of t){const l=H(o);if(!l)continue;let n;try{const c=JSON.parse(f);if(!c||typeof c!="object"||Array.isArray(c))throw new Error("not an object");n={...c,id:l.id}}catch(c){i.push(`${o}: ${c.message}`);continue}l.collection==="config"&&(n=Tt(n,e[l.id])),s[l.collection].set(l.id,Q(n)),a.set(D(l.collection,l.id),o)}return{snapshot:s,index:a,errors:i}}function $t(t,e,s,a,i){const o=new Map(s),f=new Map(a),l={...i},n=new Map,c=new Set;for(const[T,d]of t){const b=D(T,d);if(c.has(b))continue;c.add(b);const w=f.get(b),j=e[T].get(d);if(!j){w&&(n.set(w,{type:"delete",path:w}),o.delete(w),f.delete(b)),T==="config"&&delete l[d];continue}let M=j;if(T==="config"){const I=St(j);M=I.doc,Object.keys(I.secrets).length?l[d]=I.secrets:delete l[d]}const $=wt(T,M),_=bt(M);w&&w!==$&&(n.set(w,{type:"delete",path:w}),o.delete(w)),o.get($)!==_&&n.set($,{type:"put",path:$,content:_}),o.set($,_),f.set(b,$)}return{changes:[...n.values()],files:o,index:f,secrets:l}}function W(){return JSON.stringify({format:gt,version:yt},null,2)+`
3
3
  `}function Lt(t){return et.includes(t)}const z=3e4,xt=1e4,kt=3;function At(t){return t.kind==="git-json"&&typeof t.resetSession=="function"}function Et(t){return t.isAdmin?"admin":t.canWrite?"member":"viewer"}function Y(t,e,s){const a=e.kind==="github"?`${t.login}@users.noreply.github.com`:e.kind==="gitlab"?`${t.login}@users.noreply.gitlab.com`:"local@localhost";return{uid:e.kind==="local"?"local":`${e.kind}:${t.login}`,email:(s==null?void 0:s.trim().toLowerCase())||a,displayName:t.login,role:e.kind==="local"?"admin":Et(t)}}const F="files",Mt=5*1024*1024;function q(t){return[t.collection,t.op==="set"?t.doc.id:t.id]}const N=(t,e)=>JSON.stringify(t??null)===JSON.stringify(e??null);function Ot(t,e,s,a="Someone else changed this document — reload to see their version."){for(const i of t){const[o,f]=q(i),l=e[o].get(f),n=s[o].get(f);if(!N(l,n)){if(i.op==="patch"){if(!n)throw new C(a,o,f);for(const[c,T]of Object.entries(i.fields)){const d=U(c),b=G(l,d),w=G(n,d);if(!N(b,w)&&!N(w,T))throw new C(a,o,f);for(let j=1;j<d.length;j++){const M=G(l,d.slice(0,j)),$=G(n,d.slice(0,j));if(M===void 0!=($===void 0))throw new C(a,o,f)}}continue}if(!(i.op==="set"&&N(n,i.doc))&&!(i.op==="delete"&&!n))throw new C(a,o,f)}}}function _t(t){const e=t.dir.replace(/^\/+|\/+$/g,""),s=r=>e?r.slice(e.length+1):r,a=r=>!e||r.startsWith(e+"/"),i=t.messageSuffix??" — AgentCRM [skip ci]",o=t.secrets??{read:()=>({}),write:()=>{}};let f=null,l=null,n=null,c=!1;async function T(){return f||(f=await t.openTransport()),f}async function d(){const r=await T();if(!r)throw new Error("Not connected to the data repository on this browser (missing token or folder access).");return r}async function b(){const r=await d(),u=await r.listTree(),p=u.entries.filter(E=>a(E.path)&&K(s(E.path))),h=await r.readTexts(p),S=new Map;for(const[E,m]of h)S.set(s(E),m);const{snapshot:y,index:g,errors:x}=jt(S,o.read());x.length&&console.warn("[git-json] unreadable files:",x);const k=new Map;for(const E of u.entries){if(!a(E.path))continue;const m=s(E.path);m.startsWith(`${F}/`)&&m.endsWith(".bin")&&k.set(m,E)}return{head:u.headSha,blobs:k,files:S,index:g,snapshot:y,errors:x}}async function w(r,u,p,h){const S=await d();n||(n=await b());for(let y=0;;y++){const g=n;Ot(r,u,g.snapshot);const{next:x}=ot(g.snapshot,r),k=$t(r.map(q),x,g.files,g.index,o.read());if(g.files.has(v)||(k.changes.push({type:"put",path:v,content:W()}),k.files.set(v,W())),k.changes.length===0)return;const E=k.changes.map(m=>m.type==="put"?{type:"put",path:O(e,m.path),content:m.content??""}:{type:"delete",path:O(e,m.path)});try{const m=await S.commit(E,{message:`${h}${i}`,expectedHeadSha:g.head});o.write(k.secrets),n={head:m,blobs:g.blobs,files:k.files,index:k.index,snapshot:x,errors:g.errors},g.snapshot!==u&&y>0&&(c=!0);return}catch(m){if(!(m instanceof J)||y>=kt)throw m}n=await b(),c=!0}}const j=nt({kind:"git-json",pollIntervalMs:t.pollIntervalMs??z,async load(){return n=await b(),c=!1,n.snapshot},persist:w,async poll(){const r=await T();return!r||!n||await r.headSha()===n.head&&!c?null:(n=await b(),c=!1,n.snapshot)},identity(){return l||(l=(async()=>{const r=await T();if(!r)return null;try{const u=await r.permissions();return t.identityFor?t.identityFor(u,r):Y(u,r)}catch(u){return console.warn("[git-json] permission check failed:",u),null}})(),l.then(r=>{r||(l=null,f=null)})),l}}),M=r=>`${F}/${r}.bin`;async function $(r,u){const p=await d(),h=r.map(y=>({...y,path:O(e,y.path)})),S=`${u}${i}`;if(n)try{const y=await p.commit(h,{message:S,expectedHeadSha:n.head}),g=new Map(n.blobs);for(const x of r)x.type==="put"?g.set(x.path,{path:O(e,x.path),sha:""}):g.delete(x.path);n={...n,head:y,blobs:g};return}catch(y){if(!(y instanceof J))throw y}await p.commit(h,{message:S}),c=!0}async function _(r){const u=M(r);let p=n==null?void 0:n.blobs.get(u);if(!p||!p.sha){const S=await(await d()).listTree(),y=O(e,u);p=S.entries.find(g=>g.path===y),p&&n&&n.blobs.set(u,p)}return p??null}const I={kind:"git-json",async put(r,u){await I.putMany([{id:r,bytes:u}])},async putMany(r){var p;if(!r.length)return;for(const h of r)L(h.id);const u=r.reduce((h,S)=>h+S.bytes.length,0);u>Mt&&console.warn(`[git-json] committing ${Math.round(u/1024)} KB of files: git history keeps them forever and large repos get slow.`),await $(r.map(h=>({type:"put",path:M(h.id),content:rt(h.bytes),encoding:"base64"})),`Upload ${r.length===1?((p=r[0].meta)==null?void 0:p.name)??"a file":`${r.length} files`}`)},async get(r){L(r);const u=await _(r);return u?(await d()).readBytes(u):null},async delete(r){L(r),await _(r)&&await $([{type:"delete",path:M(r)}],"Purge a file")},async list(){const u=await(await d()).listTree(),p=O(e,`${F}/`);return u.entries.filter(h=>h.path.startsWith(p)&&h.path.endsWith(".bin")).map(h=>h.path.slice(p.length,-4)).filter(h=>!h.includes("/")).sort()}};return st(j,I),Object.assign(j,{resetSession(){f=null,l=null,n=null,c=!1},loadErrors:()=>(n==null?void 0:n.errors)??[],headSha:()=>(n==null?void 0:n.head)??null})}async function Ft(t,e){const s=e.replace(/^\/+|\/+$/g,""),a=await t.listTree(),i=a.entries.map(c=>s?c.path.startsWith(s+"/")?c.path.slice(s.length+1):null:c.path).filter(c=>c!==null),o=i.filter(c=>c!==v&&K(c)),f=i.includes(v)||o.some(c=>c.startsWith("objects/"));let l;const n=a.entries.find(c=>c.path===O(s,"settings/general.json"));if(n){const c=(await t.readTexts([n])).get(n.path);try{l=c?JSON.parse(c).name:void 0}catch{}}return{exists:f,documents:o.length,hasUsers:o.some(c=>c.startsWith("users/")),name:l}}function Jt(t={}){return{head:"c0",files:new Map(Object.entries(t)),commits:[]}}function It(t){let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return`b${(e>>>0).toString(16)}-${t.length}`}function Rt(t,e={}){const s={kind:e.kind??"github",label:"memory/repo@main",reads:0,async headSha(){return t.head},async listTree(){const a=[...t.files.entries()].map(([i,o])=>({path:i,sha:It(o),size:o.length})).sort((i,o)=>i.path.localeCompare(o.path));return{headSha:t.head,entries:a}},async readTexts(a){s.reads++;const i=new Map;for(const o of a){const f=t.files.get(o.path);f!==void 0&&i.set(o.path,f)}return i},async readBytes(a){return new TextEncoder().encode(t.files.get(a.path)??"")},async commit(a,i){var f;if((f=e.beforeCommit)==null||f.call(e,t),i.expectedHeadSha&&i.expectedHeadSha!==t.head)throw new J("Branch moved",t.head);for(const l of a)l.type==="delete"?t.files.delete(l.path):t.files.set(l.path,l.encoding==="base64"?it(l.content):l.content);const o=`c${t.commits.length+1}`;return t.commits.push({sha:o,message:i.message,changes:a}),t.head=o,o},async permissions(){return{login:"octocat",canWrite:!0,isAdmin:!0,visibility:"private",...e.permissions}}};return s}const vt="git-json-folder";async function Gt(t,e){if(t.provider==="local"){const a=await at(vt);return!a||!await ct(a,!1)?null:lt(a)}const s=e??ft(t);return s?t.provider==="github"?B({provider:"github",owner:t.owner??"",repo:t.repo??"",branch:t.branch,token:s,apiBaseUrl:t.apiBaseUrl}):B({provider:"gitlab",project:t.project??"",branch:t.branch,token:s,apiBaseUrl:t.apiBaseUrl}):null}function Ct(t){return ht(`gitEmail:${P(t)}`)}function Pt(t,e){ut(`gitEmail:${P(t)}`,(e==null?void 0:e.trim().toLowerCase())||null)}function Bt(t,e={}){var f,l;const s=t.git,a=typeof((f=e.secrets)==null?void 0:f.token)=="string"?e.secrets.token:null,i=typeof((l=e.secrets)==null?void 0:l.email)=="string"?e.secrets.email:null,o=`gitSecrets:${P(t)}`;return _t({dir:s.dir,openTransport:()=>Gt(s,a),identityFor:(n,c)=>Y(n,c,i??Ct(t)),secrets:{read:()=>pt(o)??{},write:n=>dt(o,n)},pollIntervalMs:e.pollIntervalMs??(s.provider==="local"?xt:z)})}export{gt as GIT_JSON_FORMAT,yt as GIT_JSON_VERSION,vt as LOCAL_GIT_HANDLE_KEY,v as MARKER_FILE,Ot as checkRebase,Bt as createGitJsonStore,_t as createGitJsonStoreWith,Rt as createMemoryGitTransport,Jt as createMemoryRepo,D as docKey,wt as docPath,jt as filesToSnapshot,ft as getGitToken,Ct as getGitUserEmail,Ft as inspectGitJsonFolder,Lt as isCollectionFolder,At as isGitJsonStore,K as isLayoutFile,W as markerContent,Tt as mergeDocSecrets,Gt as openGitJsonTransport,H as parseDocPath,$t as planChanges,Et as roleFromPermissions,bt as serializeDoc,Dt as setGitToken,Pt as setGitUserEmail,St as stripDocSecrets};