@rustic-ai/ui-components 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{var e={450:function(e){e.exports=function(){var e=[],t=[],r={},n={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function c(e,t){return e.replace(t[0],(function(r,n){var i,o,c=(i=t[1],o=arguments,i.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return a(""===r?e[n-1]:r,c)}))}function l(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var i=n.length;i--;){var o=n[i];if(o[0].test(t))return c(t,o)}return t}function s(e,t,r){return function(n){var i=n.toLowerCase();return t.hasOwnProperty(i)?a(n,i):e.hasOwnProperty(i)?a(n,e[i]):l(i,n,r)}}function u(e,t,r,n){return function(n){var i=n.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&l(i,i,r)===i}}function p(e,t,r){return(r?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=s(i,n,e),p.isPlural=u(i,n,e),p.singular=s(n,i,t),p.isSingular=u(n,i,t),p.addPluralRule=function(t,r){e.push([o(t),r])},p.addSingularRule=function(e,r){t.push([o(e),r])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):r[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Action:()=>Fr,CodeSnippet:()=>k,CopyText:()=>$r,ElementRenderer:()=>j,FCCalendar:()=>m,Image:()=>z,MarkedMarkdown:()=>cr,MarkedStreamingMarkdown:()=>lr,MermaidViz:()=>Qd,MessageCanvas:()=>Hr,MessageSpace:()=>Vr,MultimodalInput:()=>be,Multipart:()=>Yr,OpenLayersMap:()=>_e,PDFViewer:()=>gn,ParticipantRole:()=>cn,ParticipantType:()=>ln,ParticipantsContainer:()=>pn,PerspectiveViz:()=>nf,PopoverMenu:()=>zr,Question:()=>bn,RechartsTimeSeries:()=>Vd,Sound:()=>Er,StreamingText:()=>Fn,Table:()=>zn,Text:()=>Kr,TextInput:()=>Oe,Timestamp:()=>Ur,Uploader:()=>ye,VegaLiteViz:()=>uf,Video:()=>Tr,Weather:()=>pf,YoutubeVideo:()=>qn,rusticDarkTheme:()=>Pf,rusticLightTheme:()=>jf});const e=require("react/jsx-runtime"),t=require("@fullcalendar/daygrid");var i=r.n(t);const o=require("@fullcalendar/react");var a=r.n(o);const c=require("@mui/material/Box");var l=r.n(c);const s=require("@mui/material/styles"),u=require("@mui/material/useMediaQuery");var p=r.n(u);const d=require("react");var f=r.n(d);function h(e){return{title:e.title?e.title:"",start:e.start,end:e.end,allDay:e.isAllDay}}function m(t){var r=(0,s.useTheme)(),n=p()(r.breakpoints.up("md"));return(0,e.jsx)(l(),{className:"rustic-fc-calendar",children:(0,e.jsx)(a(),{plugins:[i()],initialView:n?"dayGridMonth":"dayGridDay",headerToolbar:{left:"prev,next",center:"title",right:"dayGridMonth,dayGridWeek,dayGridDay"},eventTimeFormat:{hour:"2-digit",minute:"2-digit"},initialDate:t.events[0].start,events:t.events.map(h),views:{dayGridMonth:{titleFormat:{year:"numeric",month:"short"}},dayGridWeek:{},dayGridDay:{titleFormat:{year:"numeric",month:"short",day:"numeric"}}}})})}const y=require("@codemirror/language"),v=require("@codemirror/language-data"),g=require("@codemirror/state"),b=require("@codemirror/view"),x=require("@mui/material/Typography");var w=r.n(x);const O=require("@mui/system");function k(t){var r=(0,d.useRef)(null),n=(0,d.useRef)(),i=new g.Compartment,o=[g.EditorState.readOnly.of(!0),(0,b.highlightSpecialChars)(),(0,y.syntaxHighlighting)(y.defaultHighlightStyle,{fallback:!0}),i.of([])],a=v.languages.find((function(e){return e.name.toLowerCase()===t.language.toLowerCase()}));return(0,d.useEffect)((function(){if(r.current&&!n.current){var e=r.current,c=g.EditorState.create({doc:t.code,extensions:o});n.current=new b.EditorView({state:c,parent:e}),a&&n.current&&a.load().then((function(e){var t;null===(t=n.current)||void 0===t||t.dispatch({effects:i.reconfigure(e.extension)})}))}}),[]),(0,e.jsx)(O.Box,{sx:{backgroundColor:"background.default"},className:"rustic-code-snippet",children:(0,e.jsx)("div",{"aria-label":"code snippet",ref:r,children:(0,e.jsx)(w(),{variant:"body2","aria-label":"language type",children:t.language})})})}var S=function(){return S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},S.apply(this,arguments)};const j=function(t){var r=t.supportedElements[t.message.format];return(0,e.jsx)(e.Fragment,{children:r?f().createElement(r,S(S({sender:t.sender,ws:t.ws,messageId:t.message.id,conversationId:t.message.conversationId},t.message.data),t.message.threadMessagesData&&{updatedData:t.message.threadMessagesData})):(0,e.jsxs)(w(),{variant:"body2",children:["Unsupported element format: ",t.message.format]})})},E=require("@mui/material/CircularProgress");var A=r.n(E),P=r(450),T=r.n(P),C=function(){return C=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},C.apply(this,arguments)};function I(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}var D,M=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};function N(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===D.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?D.HOUR:D.MONTH_DATE)}function R(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),i=t>0?"".concat(t,":"):"",o="".concat(t>0?r.toString().padStart(2,"0"):r),a=n.toString().padStart(2,"0");return"".concat(i).concat(o,":").concat(a)}function _(e,t){var r={};return e&&(r={width:e}),t&&(r=C(C({},r),{height:t})),e||t||(r={className:"rustic-fit-container"}),r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(D||(D={}));var B=function(e){var t=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:t,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[t]}},L=function(){return L=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function z(t){var r=(0,d.useState)(!0),n=r[0],i=r[1],o=(0,d.useState)(""),a=o[0],c=o[1];return a.length>0?(0,e.jsx)(w(),{variant:"body2",children:a}):(0,e.jsxs)("figure",{children:[n&&(0,e.jsx)(A(),{}),(0,e.jsx)("img",L({},_(t.width,t.height),{src:t.src,alt:t.alt,onError:function(){c("Image failed to load"),i(!1)},onLoad:function(){i(!1)}})),t.description&&(0,e.jsx)("figcaption",{children:(0,e.jsx)(w(),{variant:"body2",children:t.description})})]})}z.defaultProps={alt:"An image is displayed"};const F=require("crypto");var $=r.n(F);const q={randomUUID:$().randomUUID},W=new Uint8Array(256);let U=W.length;function H(){return U>W.length-16&&($().randomFillSync(W),U=0),W.slice(U,U+=16)}const G=[];for(let e=0;e<256;++e)G.push((e+256).toString(16).slice(1));const X=function(e,t,r){if(q.randomUUID&&!t&&!e)return q.randomUUID();const n=(e=e||{}).random||(e.rng||H)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return G[e[t+0]]+G[e[t+1]]+G[e[t+2]]+G[e[t+3]]+"-"+G[e[t+4]]+G[e[t+5]]+"-"+G[e[t+6]]+G[e[t+7]]+"-"+G[e[t+8]]+G[e[t+9]]+"-"+G[e[t+10]]+G[e[t+11]]+G[e[t+12]]+G[e[t+13]]+G[e[t+14]]+G[e[t+15]]}(n)},V=require("@mui/material/IconButton");var K=r.n(V);const Y=require("@mui/material/InputAdornment");var Z=r.n(Y);const Q=require("@mui/material/TextField");var J=r.n(Q);const ee=require("@mui/material/Tooltip");var te=r.n(ee);function re(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}var ne=(0,d.forwardRef)((function(t,r){var n=(0,d.useState)(""),i=n[0],o=n[1],a=(0,d.useState)(!1),c=a[0],s=a[1],u=(0,d.useState)(!1),p=u[0],f=u[1],h=(0,d.useState)(!1),m=h[0],y=h[1],v=(0,d.useState)(""),g=v[0],b=v[1],x=(0,d.useRef)(null),O=!i.trim().length&&!t.isSendEnabled,k="".concat(c?"Stop":"Start"," speech to text"),S=c?"error.main":p?"primary.main":"primary.light",j=c?"stop_circle":"speech_to_text",E={"no-speech":"No speech detected. Check your microphone volume and try again.",aborted:"Speech input was aborted. Ensure no other windows are accessing your microphone and try again.","audio-capture":"Could not capture any audio. Check that your microphone is connected and try again.",network:"Failed to connect to the internet for recognition. Check your internet connection and try again.","not-allowed":"This functionality requires microphone access. Please allow microphone access and try again.","service-not-allowed":"Speech recognition service is not allowed, either because the browser doesn't support it or because of reasons of security, privacy or user preference.","bad-grammar":"There was an error in the speech recognition grammar or format. Check your speech input or grammar rules.","language-not-supported":"The language you're speaking isn't supported. Try speaking in a different language or check your device settings."},P={endAdornment:(0,e.jsx)(Z(),{position:"end",children:m?(0,e.jsx)(A(),{size:24}):(0,e.jsx)(te(),{title:k,children:(0,e.jsx)(K(),{onClick:function(){var e=new window.webkitSpeechRecognition,t=navigator.language;e.lang=t,c?(e.stop(),y(!0),s(!1)):(e.start(),b(""),s(!0)),e.onstart=function(){s(!0)},e.onresult=function(e){var t,r=e.results[0][0].transcript;i.length>0?o(i+" "+r):o(r),null===(t=x.current)||void 0===t||t.focus(),s(!1)},e.onerror=function(e){var t=E[e.error];b(t),s(!1)},e.onend=function(){y(!1),s(!1)}},size:"small",sx:{color:S},children:(0,e.jsx)(re,{name:j})})})})};function T(){var e=(new Date).toISOString(),r={id:X(),timestamp:e,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:i}};t.send(r),o(""),b("")}return(0,e.jsxs)(l(),{className:"rustic-base-input",ref:r,children:[(0,e.jsxs)(l(),{className:"rustic-error-and-input-container",children:[(0,e.jsx)(l(),{className:"rustic-error-container",children:(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:g})}),(0,e.jsxs)(l(),{className:"rustic-input-field",sx:{border:"1px solid",borderColor:p?"secondary.main":"action.disabled"},children:[(0,e.jsx)(J(),{className:"rustic-text-field",variant:"outlined",value:i,label:t.label,placeholder:t.placeholder,maxRows:t.maxRows,multiline:t.multiline,fullWidth:t.fullWidth,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!O&&T())},onChange:function(e){b(""),o(e.target.value)},onFocus:function(){return f(!0)},onBlur:function(){return f(!1)},inputRef:x,color:"secondary",size:"small",InputProps:t.enableSpeechToText?P:{},InputLabelProps:{className:p?"":"rustic-input-label",sx:{backgroundColor:"background.paper"}}}),(0,e.jsx)("div",{className:"rustic-input-extras"})]})]}),(0,e.jsxs)(l(),{className:"rustic-input-actions",children:[t.children,(0,e.jsx)(te(),{title:"Send",children:(0,e.jsx)("span",{children:(0,e.jsx)(K(),{"aria-label":"send message",onClick:T,disabled:O,color:"primary",className:"rustic-send-button",children:(0,e.jsx)(re,{name:"send"})})})})]})]})}));ne.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,enableSpeechToText:!1};const ie=ne,oe=require("@mui/material/LinearProgress");var ae=r.n(oe);const ce=require("axios");var le=r.n(ce);const se=require("react-dom"),ue=require("@mui/material/Card");var pe=r.n(ue);function de(t){var r,n=(0,s.useTheme)();return(0,e.jsxs)(pe(),{className:"rustic-file-preview",variant:"outlined",sx:{boxShadow:n.shadows[1]},children:[(0,e.jsx)(w(),{variant:"subtitle2",children:(r=t.file.name,15,r.length<=15?r:r.substring(0,12)+"...")}),t.children]})}var fe=function(){return fe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fe.apply(this,arguments)},he=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function me(e){for(var t=["Bytes","KB","MB","GB"],r=0;e>=1024&&r<t.length-1;)e/=1024,r++;var n=e.toFixed(1).toString().replace(/\.0$/,"");return"".concat(n," ").concat(t[r])}const ye=function(t){var r=(0,d.useState)([]),n=r[0],i=r[1],o=(0,d.useState)([]),a=o[0],c=o[1],s=(0,d.useRef)({}),u=X();(0,d.useEffect)((function(){i([]),c([]),s.current={}}),[t.messageId]);var p=(0,e.jsx)(l(),{className:"rustic-files rustic-padding-16",children:n.map((function(r,n){return(0,e.jsx)(de,{file:{name:r.name},children:(0,e.jsxs)(l(),{className:"rustic-flex-center",children:[r.loadingProgress<100&&(0,e.jsx)(ae(),{variant:"determinate",color:"secondary",value:r.loadingProgress,className:"rustic-upload-progress"}),(0,e.jsx)(te(),{title:"Delete",children:(0,e.jsx)(K(),{color:"primary",onClick:function(){return function(e,r){var n,o;c([]);var a=e.name;if(s.current=fe(fe({},s.current),((n={})[a]=s.current[a]--,n)),t.onFileUpdate("remove",a),100===e.loadingProgress){var l="".concat(t.deleteFileEndpoint,"?message-id=").concat(t.messageId,"&file-id=").concat(e.id);le().delete(l).then((function(){return i((function(e){return e.filter((function(e,t){return t!==r}))}))})).catch((function(){return t.onFileUpdate("add",a),c((function(e){return he(he([],e,!0),["Failed to delete ".concat(a,". Please try again.")],!1)}))}))}else e.abortController.abort(),i((function(e){return e.filter((function(e,t){return t!==r}))})),s.current=fe(fe({},s.current),((o={})[a]=s.current[a]++,o))}(r,n)},className:"rustic-delete-button","aria-label":"cancel file upload",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"cancel"})})})]})},n)}))}),f=(0,e.jsx)(l(),{children:a.map((function(t,r){return(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:t},r)}))});function h(e,t){return t?(0,se.createPortal)(e,t):e}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l(),{className:"rustic-uploader",children:[(0,e.jsx)("label",{htmlFor:u,children:(0,e.jsx)(te(),{title:"Upload",children:(0,e.jsx)(K(),{component:"span","aria-label":"Upload file",color:"primary",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"upload_2"})})})}),(0,e.jsx)("input",{type:"file",id:u,onChange:function(e){c([]);var r=e.target.files&&Array.from(e.target.files),o=n.length+(r?r.length:0);t.maxFileCount&&o>t.maxFileCount&&c((function(e){return he(he([],e,!0),["You can only upload ".concat(t.maxFileCount," files.")],!1)}));var a=r&&function(e,t,r){return r?t<=r?e:e.slice(0,r-t):e}(r,o,t.maxFileCount);a&&a.forEach((function(e){!function(e){var r;t.maxFileSize&&e.size>t.maxFileSize?(r=e.name,c((function(e){return he(he([],e,!0),["Failed to upload ".concat(r,". You cannot upload files larger than ").concat(t.maxFileSize&&me(t.maxFileSize),".")],!1)}))):function(e){var r=new FormData,n=new AbortController,o=function(e){var t,r,n=e.name,i=s.current[n];if(i){var o=i+1,a=n.lastIndexOf("."),c=n.substring(0,a),l=n.substring(a);n="".concat(c,"(").concat(i,")").concat(l),s.current=fe(fe({},s.current),((t={})[e.name]=o,t))}else s.current=fe(fe({},s.current),((r={})[e.name]=1,r));return n}(e),a=new File([e],o,{type:e.type});r.append("file",a);var l=X(),u={name:o,loadingProgress:0,abortController:n,id:l};i((function(e){return he(he([],e,!0),[u],!1)})),t.onFileUpdate("add",o);var p="".concat(t.uploadFileEndpoint,"?message-id=").concat(t.messageId);le().post(p,r,{onUploadProgress:function(e){var t,r;e.total&&(t=e.loaded/e.total*100,r=u.id,i((function(e){var n=e.map((function(e){return e.id===r?fe(fe({},e),{loadingProgress:t}):e}));return n})))},signal:n.signal}).then((function(e){var t,r;t=e.data,r=u.id,i((function(e){var n=e.findIndex((function(e){return e.id===r}));if(-1!==n){var i=he([],e,!0);return i[n]=fe(fe({},i[n]),{id:t.fileId}),i}return e}))})).catch((function(r){var n,a;t.onFileUpdate("remove",o),s.current=fe(fe({},s.current),((n={})[o]=s.current[e.name]--,n)),function(e,t,r){c((function(t){return he(he([],t,!0),["Failed to upload ".concat(e,". ").concat((null==r?void 0:r.message)||"")],!1)})),i((function(e){return e.filter((function(e){return e.id!==t}))}))}(e.name,u.id,null===(a=r.response)||void 0===a?void 0:a.data)}))}(e)}(e)})),e.target.value=""},multiple:!0,accept:t.acceptedFileTypes})]}),a.length>0&&h(f,t.errorMessagesContainer),n.length>0&&h(p,t.filePreviewsContainer)]})};var ve=function(){return ve=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ve.apply(this,arguments)},ge=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function be(t){var r=(0,d.useState)([]),n=r[0],i=r[1],o=(0,d.useState)(X()),a=o[0],c=o[1],s=(0,d.useState)(),u=s[0],p=s[1],f=(0,d.useState)(),h=f[0],m=f[1],y=(0,d.useRef)(null),v=n.length>0;return(0,d.useEffect)((function(){y.current&&(m(y.current.querySelector(".rustic-error-container")),p(y.current.querySelector(".rustic-input-extras")))})),(0,e.jsx)(l(),{className:"rustic-multimodal-input",children:(0,e.jsx)(ie,ve({},t,{send:function(e){v&&(e.id=a,e.format="multipart",e.data.files=n),t.ws.send(e),c(X()),i([])},isSendEnabled:v,ref:y,children:(0,e.jsx)(l(),{className:"rustic-bottom-buttons",children:(0,e.jsx)(ye,{acceptedFileTypes:t.acceptedFileTypes,maxFileCount:t.maxFileCount,maxFileSize:t.maxFileSize,uploadFileEndpoint:t.uploadFileEndpoint,deleteFileEndpoint:t.deleteFileEndpoint,onFileUpdate:function(e,t){i("add"===e?function(e){return ge(ge([],e,!0),[{name:t}],!1)}:function(e){return e.filter((function(e){return e.name!==t}))})},messageId:a,filePreviewsContainer:u,errorMessagesContainer:h})})}))})}be.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,maxFileSize:2097152,maxFileCount:1};var xe=function(){return xe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xe.apply(this,arguments)},we=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};function Oe(t){var r=t.ws,n=we(t,["ws"]);return(0,e.jsx)(ie,xe({},n,{send:function(e){r.send(e)}}))}require("ol/ol.css");const ke=require("@mui/material/Alert");var Se=r.n(ke);const je=require("ol/layer/Tile.js");var Ee=r.n(je);const Ae=require("ol/Map.js");var Pe=r.n(Ae);const Te=require("ol/Overlay.js");var Ce=r.n(Te);const Ie=require("ol/proj.js"),De=require("ol/source/OSM.js");var Me=r.n(De);const Ne=require("ol/View.js");var Re=r.n(Ne);function _e(t){var r=(0,d.useState)(""),n=r[0],i=r[1],o=(0,d.useRef)(null),a=(0,d.useRef)(null);return(0,d.useEffect)((function(){if(i(""),t.latitude<-90||t.latitude>90||t.longitude<-180||t.longitude>180)return i("Invalid coordinates");if(o.current&&a.current){var e=new(Pe())({layers:[new(Ee())({source:new(Me())})],view:new(Re())({center:(0,Ie.fromLonLat)([t.longitude,t.latitude]),zoom:12}),target:o.current}),r=new(Ce())({element:a.current,position:(0,Ie.fromLonLat)([t.longitude,t.latitude]),positioning:"bottom-center",stopEvent:!1});return e.addOverlay(r),e.once("postrender",(function(){var e;if(!(null===(e=o.current)||void 0===e?void 0:e.querySelector("canvas")))return i("An error occurred while loading the map")})),function(){e.setTarget(""),e.removeOverlay(r)}}}),[]),(0,e.jsx)(e.Fragment,{children:n.length>0?(0,e.jsx)(Se(),{severity:"error",children:n}):(0,e.jsxs)(l(),{children:[(0,e.jsx)(l(),{ref:a,children:(0,e.jsx)(re,{className:"rustic-open-layers-map-marker",name:"location_on"})}),(0,e.jsx)("div",{ref:o,className:"rustic-open-layers-map-canvas"})]})})}const{entries:Be,setPrototypeOf:Le,isFrozen:ze,getPrototypeOf:Fe,getOwnPropertyDescriptor:$e}=Object;let{freeze:qe,seal:We,create:Ue}=Object,{apply:He,construct:Ge}="undefined"!=typeof Reflect&&Reflect;qe||(qe=function(e){return e}),We||(We=function(e){return e}),He||(He=function(e,t,r){return e.apply(t,r)}),Ge||(Ge=function(e,t){return new e(...t)});const Xe=ot(Array.prototype.forEach),Ve=ot(Array.prototype.pop),Ke=ot(Array.prototype.push),Ye=ot(String.prototype.toLowerCase),Ze=ot(String.prototype.toString),Qe=ot(String.prototype.match),Je=ot(String.prototype.replace),et=ot(String.prototype.indexOf),tt=ot(String.prototype.trim),rt=ot(RegExp.prototype.test),nt=(it=TypeError,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ge(it,t)});var it;function ot(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return He(e,t,n)}}function at(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ye;Le&&Le(e,null);let n=t.length;for(;n--;){let i=t[n];if("string"==typeof i){const e=r(i);e!==i&&(ze(t)||(t[n]=e),i=e)}e[i]=!0}return e}function ct(e){const t=Ue(null);for(const[r,n]of Be(e))void 0!==$e(e,r)&&(t[r]=n);return t}function lt(e,t){for(;null!==e;){const r=$e(e,t);if(r){if(r.get)return ot(r.get);if("function"==typeof r.value)return ot(r.value)}e=Fe(e)}return function(e){return console.warn("fallback value for",e),null}}const st=qe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ut=qe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),pt=qe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),dt=qe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ft=qe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ht=qe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mt=qe(["#text"]),yt=qe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),vt=qe(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gt=qe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),bt=qe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xt=We(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wt=We(/<%[\w\W]*|[\w\W]*%>/gm),Ot=We(/\${[\w\W]*}/gm),kt=We(/^data-[\-\w.\u00B7-\uFFFF]/),St=We(/^aria-[\-\w]+$/),jt=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Et=We(/^(?:\w+script|data):/i),At=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pt=We(/^html$/i);var Tt=Object.freeze({__proto__:null,MUSTACHE_EXPR:xt,ERB_EXPR:wt,TMPLIT_EXPR:Ot,DATA_ATTR:kt,ARIA_ATTR:St,IS_ALLOWED_URI:jt,IS_SCRIPT_OR_DATA:Et,ATTR_WHITESPACE:At,DOCTYPE_NAME:Pt});const Ct=function(){return"undefined"==typeof window?null:window};var It=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ct();const r=t=>e(t);if(r.version="3.0.6",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;let{document:n}=t;const i=n,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:c,Node:l,Element:s,NodeFilter:u,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:h}=t,m=s.prototype,y=lt(m,"cloneNode"),v=lt(m,"nextSibling"),g=lt(m,"childNodes"),b=lt(m,"parentNode");if("function"==typeof c){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,w="";const{implementation:O,createNodeIterator:k,createDocumentFragment:S,getElementsByTagName:j}=n,{importNode:E}=i;let A={};r.isSupported="function"==typeof Be&&"function"==typeof b&&O&&void 0!==O.createHTMLDocument;const{MUSTACHE_EXPR:P,ERB_EXPR:T,TMPLIT_EXPR:C,DATA_ATTR:I,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:N}=Tt;let{IS_ALLOWED_URI:R}=Tt,_=null;const B=at({},[...st,...ut,...pt,...ft,...mt]);let L=null;const z=at({},[...yt,...vt,...gt,...bt]);let F=Object.seal(Ue(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,q=null,W=!0,U=!0,H=!1,G=!0,X=!1,V=!1,K=!1,Y=!1,Z=!1,Q=!1,J=!1,ee=!0,te=!1,re=!0,ne=!1,ie={},oe=null;const ae=at({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const le=at({},["audio","video","img","source","image","track"]);let se=null;const ue=at({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",de="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let he=fe,me=!1,ye=null;const ve=at({},[pe,de,fe],Ze);let ge=null;const be=["application/xhtml+xml","text/html"];let xe=null,we=null;const Oe=n.createElement("form"),ke=function(e){return e instanceof RegExp||e instanceof Function},Se=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!we||we!==e){if(e&&"object"==typeof e||(e={}),e=ct(e),ge=ge=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,xe="application/xhtml+xml"===ge?Ze:Ye,_="ALLOWED_TAGS"in e?at({},e.ALLOWED_TAGS,xe):B,L="ALLOWED_ATTR"in e?at({},e.ALLOWED_ATTR,xe):z,ye="ALLOWED_NAMESPACES"in e?at({},e.ALLOWED_NAMESPACES,Ze):ve,se="ADD_URI_SAFE_ATTR"in e?at(ct(ue),e.ADD_URI_SAFE_ATTR,xe):ue,ce="ADD_DATA_URI_TAGS"in e?at(ct(le),e.ADD_DATA_URI_TAGS,xe):le,oe="FORBID_CONTENTS"in e?at({},e.FORBID_CONTENTS,xe):ae,$="FORBID_TAGS"in e?at({},e.FORBID_TAGS,xe):{},q="FORBID_ATTR"in e?at({},e.FORBID_ATTR,xe):{},ie="USE_PROFILES"in e&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,U=!1!==e.ALLOW_DATA_ATTR,H=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,V=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,re=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||jt,he=e.NAMESPACE||fe,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(U=!1),Q&&(Z=!0),ie&&(_=at({},[...mt]),L=[],!0===ie.html&&(at(_,st),at(L,yt)),!0===ie.svg&&(at(_,ut),at(L,vt),at(L,bt)),!0===ie.svgFilters&&(at(_,pt),at(L,vt),at(L,bt)),!0===ie.mathMl&&(at(_,ft),at(L,gt),at(L,bt))),e.ADD_TAGS&&(_===B&&(_=ct(_)),at(_,e.ADD_TAGS,xe)),e.ADD_ATTR&&(L===z&&(L=ct(L)),at(L,e.ADD_ATTR,xe)),e.ADD_URI_SAFE_ATTR&&at(se,e.ADD_URI_SAFE_ATTR,xe),e.FORBID_CONTENTS&&(oe===ae&&(oe=ct(oe)),at(oe,e.FORBID_CONTENTS,xe)),re&&(_["#text"]=!0),V&&at(_,["html","head","body"]),_.table&&(at(_,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw nt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw nt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=e.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else void 0===x&&(x=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));const i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(h,o)),null!==x&&"string"==typeof w&&(w=x.createHTML(""));qe&&qe(e),we=e}},je=at({},["mi","mo","mn","ms","mtext"]),Ee=at({},["foreignobject","desc","title","annotation-xml"]),Ae=at({},["title","style","font","a","script"]),Pe=at({},ut);at(Pe,pt),at(Pe,dt);const Te=at({},ft);at(Te,ht);const Ce=function(e){Ke(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Ie=function(e,t){try{Ke(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ke(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!L[e])if(Z||Q)try{Ce(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,r=null;if(Y)e="<remove></remove>"+e;else{const t=Qe(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===ge&&he===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=x?x.createHTML(e):e;if(he===fe)try{t=(new f).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=O.createDocument(he,"template",null);try{t.documentElement.innerHTML=me?w:i}catch(e){}}const o=t.body||t.documentElement;return e&&r&&o.insertBefore(n.createTextNode(r),o.childNodes[0]||null),he===fe?j.call(t,V?"html":"body")[0]:V?t.documentElement:o},Me=function(e){return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},Ne=function(e){return"function"==typeof l&&e instanceof l},Re=function(e,t,n){A[e]&&Xe(A[e],(e=>{e.call(r,t,n,we)}))},_e=function(e){let t=null;if(Re("beforeSanitizeElements",e,null),(n=e)instanceof d&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof p)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return Ce(e),!0;var n;const i=xe(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:i,allowedTags:_}),e.hasChildNodes()&&!Ne(e.firstElementChild)&&rt(/<[/\w]/g,e.innerHTML)&&rt(/<[/\w]/g,e.textContent))return Ce(e),!0;if(!_[i]||$[i]){if(!$[i]&&ze(i)){if(F.tagNameCheck instanceof RegExp&&rt(F.tagNameCheck,i))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(i))return!1}if(re&&!oe[i]){const t=b(e)||e.parentNode,r=g(e)||e.childNodes;if(r&&t)for(let n=r.length-1;n>=0;--n)t.insertBefore(y(r[n],!0),v(e))}return Ce(e),!0}return e instanceof s&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const r=Ye(e.tagName),n=Ye(t.tagName);return!!ye[e.namespaceURI]&&(e.namespaceURI===de?t.namespaceURI===fe?"svg"===r:t.namespaceURI===pe?"svg"===r&&("annotation-xml"===n||je[n]):Boolean(Pe[r]):e.namespaceURI===pe?t.namespaceURI===fe?"math"===r:t.namespaceURI===de?"math"===r&&Ee[n]:Boolean(Te[r]):e.namespaceURI===fe?!(t.namespaceURI===de&&!Ee[n])&&!(t.namespaceURI===pe&&!je[n])&&!Te[r]&&(Ae[r]||!Pe[r]):!("application/xhtml+xml"!==ge||!ye[e.namespaceURI]))}(e)?(Ce(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!rt(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,Xe([P,T,C],(e=>{t=Je(t,e," ")})),e.textContent!==t&&(Ke(r.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Ce(e),!0)},Le=function(e,t,r){if(ee&&("id"===t||"name"===t)&&(r in n||r in Oe))return!1;if(U&&!q[t]&&rt(I,t));else if(W&&rt(D,t));else if(!L[t]||q[t]){if(!(ze(e)&&(F.tagNameCheck instanceof RegExp&&rt(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&rt(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&rt(F.tagNameCheck,r)||F.tagNameCheck instanceof Function&&F.tagNameCheck(r))))return!1}else if(se[t]);else if(rt(R,Je(r,N,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==et(r,"data:")||!ce[e])if(H&&!rt(M,Je(r,N,"")));else if(r)return!1;return!0},ze=function(e){return e.indexOf("-")>0},Fe=function(e){Re("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:c,value:l}=o,s=xe(a);let u="value"===a?l:tt(l);if(n.attrName=s,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,n),u=n.attrValue,n.forceKeepAttr)continue;if(Ie(a,e),!n.keepAttr)continue;if(!G&&rt(/\/>/i,u)){Ie(a,e);continue}X&&Xe([P,T,C],(e=>{u=Je(u,e," ")}));const p=xe(e.nodeName);if(Le(p,s,u)){if(!te||"id"!==s&&"name"!==s||(Ie(a,e),u="user-content-"+u),x&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(c);else switch(h.getAttributeType(p,s)){case"TrustedHTML":u=x.createHTML(u);break;case"TrustedScriptURL":u=x.createScriptURL(u)}try{c?e.setAttributeNS(c,a,u):e.setAttribute(a,u),Ve(r.removed)}catch(e){}}}Re("afterSanitizeAttributes",e,null)},$e=function e(t){let r=null;const n=Me(t);for(Re("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Re("uponSanitizeShadowNode",r,null),_e(r)||(r.content instanceof a&&e(r.content),Fe(r));Re("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,c=null,s=null;if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw nt("toString is not a function");if("string"!=typeof(e=e.toString()))throw nt("dirty is not a string, aborting")}if(!r.isSupported)return e;if(K||Se(t),r.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=xe(e.nodeName);if(!_[t]||$[t])throw nt("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)n=De("\x3c!----\x3e"),o=n.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!Z&&!X&&!V&&-1===e.indexOf("<"))return x&&J?x.createHTML(e):e;if(n=De(e),!n)return Z?null:J?w:""}n&&Y&&Ce(n.firstChild);const u=Me(ne?e:n);for(;c=u.nextNode();)_e(c)||(c.content instanceof a&&$e(c.content),Fe(c));if(ne)return e;if(Z){if(Q)for(s=S.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(L.shadowroot||L.shadowrootmode)&&(s=E.call(i,s,!0)),s}let p=V?n.outerHTML:n.innerHTML;return V&&_["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&rt(Pt,n.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+p),X&&Xe([P,T,C],(e=>{p=Je(p,e," ")})),x&&J?x.createHTML(p):p},r.setConfig=function(){Se(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),K=!0},r.clearConfig=function(){we=null,K=!1},r.isValidAttribute=function(e,t,r){we||Se({});const n=xe(e),i=xe(t);return Le(n,i,r)},r.addHook=function(e,t){"function"==typeof t&&(A[e]=A[e]||[],Ke(A[e],t))},r.removeHook=function(e){if(A[e])return Ve(A[e])},r.removeHooks=function(e){A[e]&&(A[e]=[])},r.removeAllHooks=function(){A={}},r}();let Dt={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Mt(e){Dt=e}const Nt=/[&<>"']/,Rt=new RegExp(Nt.source,"g"),_t=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Bt=new RegExp(_t.source,"g"),Lt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},zt=e=>Lt[e];function Ft(e,t){if(t){if(Nt.test(e))return e.replace(Rt,zt)}else if(_t.test(e))return e.replace(Bt,zt);return e}const $t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function qt(e){return e.replace($t,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Wt=/(^|[^\[])\^/g;function Ut(e,t){e="string"==typeof e?e:e.source,t=t||"";const r={replace:(t,n)=>(n=(n="object"==typeof n&&"source"in n?n.source:n).replace(Wt,"$1"),e=e.replace(t,n),r),getRegex:()=>new RegExp(e,t)};return r}function Ht(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const Gt={exec:()=>null};function Xt(e,t){const r=e.replace(/\|/g,((e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function Vt(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){const o=e.charAt(n-i-1);if(o!==t||r){if(o===t||!r)break;i++}else i++}return e.slice(0,n-i)}function Kt(e,t,r,n){const i=t.href,o=t.title?Ft(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:i,title:o,text:Ft(a)}}class Yt{options;rules;lexer;constructor(e){this.options=e||Dt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Vt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=function(e,t){const r=e.match(/^(\s+)(?:```)/);if(null===r)return t;const n=r[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Vt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=Vt(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),r=this.lexer.state.top;this.lexer.state.top=!0;const n=this.lexer.blockTokens(e);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:n,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",c="",l=!1;for(;e;){let r=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let n=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),s=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,c=n.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,c=n.slice(u),u+=t[1].length);let p=!1;if(!n&&/^ *$/.test(s)&&(a+=s+"\n",e=e.substring(s.length+1),r=!0),!r){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(s=l,this.options.pedantic&&(s=s.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(s))break;if(o.test(s))break;if(t.test(s))break;if(r.test(e))break;if(s.search(/[^ ]/)>=u||!s.trim())c+="\n"+s.slice(u);else{if(p)break;if(n.search(/[^ ]/)>=4)break;if(i.test(n))break;if(o.test(n))break;if(r.test(n))break;c+="\n"+s}p||s.trim()||(p=!0),a+=l+"\n",e=e.substring(l.length+1),n=s.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(a)&&(l=!0));let d,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(c),f&&(d="[ ] "!==f[0],c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!f,checked:d,loose:!1,text:c,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=c.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),r=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:Xt(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,r,n,i,o=e.align.length;for(t=0;t<o;t++){const r=e.align[t];r&&(/^ *-+: *$/.test(r)?e.align[t]="right":/^ *:-+: *$/.test(r)?e.align[t]="center":/^ *:-+ *$/.test(r)?e.align[t]="left":e.align[t]=null)}for(o=e.rows.length,t=0;t<o;t++)e.rows[t]=Xt(e.rows[t],e.header.length).map((e=>({text:e,tokens:[]})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],n=0;n<i.length;n++)i[n].tokens=this.lexer.inline(i[n].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ft(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Vt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(e)?r.slice(1):r.slice(1,-1)),Kt(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=(r[2]||r[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return Kt(r,e,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!r.match(/[\p{L}\p{N}]/u))&&(!n[1]&&!n[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...n[0]].length-1;let i,o,a=r,c=0;const l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){c+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);const t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const s=l.slice(2,-2);return{type:"strong",raw:l,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const r=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return r&&n&&(e=e.substring(1,e.length-1)),e=Ft(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=Ft(t[1]),r="mailto:"+e):(e=Ft(t[1]),r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])e=Ft(t[0]),r="mailto:"+e;else{let n;do{n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(n!==t[0]);e=Ft(t[0]),r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Ft(t[0]),{type:"text",raw:t[0],text:e}}}}const Zt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Gt,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Zt.def=Ut(Zt.def).replace("label",Zt._label).replace("title",Zt._title).getRegex(),Zt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Zt.listItemStart=Ut(/^( *)(bull) */).replace("bull",Zt.bullet).getRegex(),Zt.list=Ut(Zt.list).replace(/bull/g,Zt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Zt.def.source+")").getRegex(),Zt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Zt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Zt.html=Ut(Zt.html,"i").replace("comment",Zt._comment).replace("tag",Zt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Zt.lheading=Ut(Zt.lheading).replace(/bull/g,Zt.bullet).getRegex(),Zt.paragraph=Ut(Zt._paragraph).replace("hr",Zt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zt._tag).getRegex(),Zt.blockquote=Ut(Zt.blockquote).replace("paragraph",Zt.paragraph).getRegex(),Zt.normal={...Zt},Zt.gfm={...Zt.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Zt.gfm.table=Ut(Zt.gfm.table).replace("hr",Zt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zt._tag).getRegex(),Zt.gfm.paragraph=Ut(Zt._paragraph).replace("hr",Zt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Zt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zt._tag).getRegex(),Zt.pedantic={...Zt.normal,html:Ut("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Zt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Gt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ut(Zt.normal._paragraph).replace("hr",Zt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Zt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Qt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Gt,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Gt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/,_punctuation:"\\p{P}$+<=>`^|~"};Qt.punctuation=Ut(Qt.punctuation,"u").replace(/punctuation/g,Qt._punctuation).getRegex(),Qt.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Qt.anyPunctuation=/\\[punct]/g,Qt._escapes=/\\([punct])/g,Qt._comment=Ut(Zt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Qt.emStrong.lDelim=Ut(Qt.emStrong.lDelim,"u").replace(/punct/g,Qt._punctuation).getRegex(),Qt.emStrong.rDelimAst=Ut(Qt.emStrong.rDelimAst,"gu").replace(/punct/g,Qt._punctuation).getRegex(),Qt.emStrong.rDelimUnd=Ut(Qt.emStrong.rDelimUnd,"gu").replace(/punct/g,Qt._punctuation).getRegex(),Qt.anyPunctuation=Ut(Qt.anyPunctuation,"gu").replace(/punct/g,Qt._punctuation).getRegex(),Qt._escapes=Ut(Qt._escapes,"gu").replace(/punct/g,Qt._punctuation).getRegex(),Qt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Qt._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Qt.autolink=Ut(Qt.autolink).replace("scheme",Qt._scheme).replace("email",Qt._email).getRegex(),Qt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Qt.tag=Ut(Qt.tag).replace("comment",Qt._comment).replace("attribute",Qt._attribute).getRegex(),Qt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Qt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Qt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Qt.link=Ut(Qt.link).replace("label",Qt._label).replace("href",Qt._href).replace("title",Qt._title).getRegex(),Qt.reflink=Ut(Qt.reflink).replace("label",Qt._label).replace("ref",Zt._label).getRegex(),Qt.nolink=Ut(Qt.nolink).replace("ref",Zt._label).getRegex(),Qt.reflinkSearch=Ut(Qt.reflinkSearch,"g").replace("reflink",Qt.reflink).replace("nolink",Qt.nolink).getRegex(),Qt.normal={...Qt},Qt.pedantic={...Qt.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ut(/^!?\[(label)\]\((.*?)\)/).replace("label",Qt._label).getRegex(),reflink:Ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qt._label).getRegex()},Qt.gfm={...Qt.normal,escape:Ut(Qt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Qt.gfm.url=Ut(Qt.gfm.url,"i").replace("email",Qt.gfm._extended_email).getRegex(),Qt.breaks={...Qt.gfm,br:Ut(Qt.br).replace("{2,}","*").getRegex(),text:Ut(Qt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class Jt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Dt,this.options.tokenizer=this.options.tokenizer||new Yt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Zt.normal,inline:Qt.normal};this.options.pedantic?(t.block=Zt.pedantic,t.inline=Qt.pedantic):this.options.gfm&&(t.block=Zt.gfm,this.options.breaks?t.inline=Qt.breaks:t.inline=Qt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Zt,inline:Qt}}static lex(e,t){return new Jt(t).lex(e)}static lexInline(e,t){return new Jt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let r,n,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,r)=>t+" ".repeat(r.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(r):(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i)))n=t[t.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r),o=i.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,i,o,a,c,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(c=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,l,c))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.autolink(e))e=e.substring(r.raw.length),t.push(r);else if(this.state.inLink||!(r=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),a=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(r.raw.length),t.push(r);return t}}class er{options;constructor(e){this.options=e||Dt}code(e,t,r){const n=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="language-'+Ft(n)+'">'+(r?e:Ft(e,!0))+"</code></pre>\n":"<pre><code>"+(r?e:Ft(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,r){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,r){const n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+">\n"+e+"</"+n+">\n"}listitem(e,t,r){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,r){const n=Ht(e);if(null===n)return r;let i='<a href="'+(e=n)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+r+"</a>",i}image(e,t,r){const n=Ht(e);if(null===n)return r;let i=`<img src="${e=n}" alt="${r}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class tr{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class rr{options;renderer;textRenderer;constructor(e){this.options=e||Dt,this.options.renderer=this.options.renderer||new er,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tr}static parse(e,t){return new rr(t).parse(e)}static parseInline(e,t){return new rr(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}switch(i.type){case"space":continue;case"hr":r+=this.renderer.hr();continue;case"heading":{const e=i;r+=this.renderer.heading(this.parseInline(e.tokens),e.depth,qt(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;r+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(n);let o="";for(let t=0;t<e.rows.length;t++){const r=e.rows[t];n="";for(let t=0;t<r.length;t++)n+=this.renderer.tablecell(this.parseInline(r[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(n)}r+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);r+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,n=e.start,o=e.loose;let a="";for(let t=0;t<e.items.length;t++){const r=e.items[t],n=r.checked,i=r.task;let c="";if(r.task){const e=this.renderer.checkbox(!!n);o?r.tokens.length>0&&"paragraph"===r.tokens[0].type?(r.tokens[0].text=e+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&"text"===r.tokens[0].tokens[0].type&&(r.tokens[0].tokens[0].text=e+" "+r.tokens[0].tokens[0].text)):r.tokens.unshift({type:"text",text:e+" "}):c+=e+" "}c+=this.parse(r.tokens,o),a+=this.renderer.listitem(c,i,!!n)}r+=this.renderer.list(a,t,n);continue}case"html":{const e=i;r+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;r+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,a=o.tokens?this.parseInline(o.tokens):o.text;for(;n+1<e.length&&"text"===e[n+1].type;)o=e[++n],a+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);r+=t?this.renderer.paragraph(a):a;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}switch(i.type){case"escape":{const e=i;r+=t.text(e.text);break}case"html":{const e=i;r+=t.html(e.text);break}case"link":{const e=i;r+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;r+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;r+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;r+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;r+=t.codespan(e.text);break}case"br":r+=t.br();break;case"del":{const e=i;r+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;r+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}}class nr{options;constructor(e){this.options=e||Dt}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}const ir=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(Jt.lex,rr.parse);parseInline=this.#e(Jt.lexInline,rr.parseInline);Parser=rr;Renderer=er;TextRenderer=tr;Lexer=Jt;Tokenizer=Yt;Hooks=nr;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;r=r.concat(this.walkTokens(e.items,t));break}default:{const e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((n=>{r=r.concat(this.walkTokens(e[n],t))})):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),r.extensions=t),e.renderer){const t=this.defaults.renderer||new er(this.defaults);for(const r in e.renderer){const n=e.renderer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new Yt(this.defaults);for(const r in e.tokenizer){const n=e.tokenizer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new nr;for(const r in e.hooks){const n=e.hooks[r],i=r,o=t[i];nr.passThroughHooks.has(r)?t[i]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then((e=>o.call(t,e)));const r=n.call(t,e);return o.call(t,r)}:t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Jt.lex(e,t??this.defaults)}parser(e,t){return rr.parse(e,t??this.defaults)}#e(e,t){return(r,n)=>{const i={...n},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const a=this.#t(!!o.silent,!!o.async);if(null==r)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then((t=>e(t,o))).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));const n=e(r,o);o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return a(e)}}}#t(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+Ft(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function or(e,t){return ir.parse(e,t)}function ar(e){var t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=or.parse(t);return It.sanitize(r)}or.options=or.setOptions=function(e){return ir.setOptions(e),or.defaults=ir.defaults,Mt(or.defaults),or},or.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},or.defaults=Dt,or.use=function(...e){return ir.use(...e),or.defaults=ir.defaults,Mt(or.defaults),or},or.walkTokens=function(e,t){return ir.walkTokens(e,t)},or.parseInline=ir.parseInline,or.Parser=rr,or.parser=rr.parse,or.Renderer=er,or.TextRenderer=tr,or.Lexer=Jt,or.lexer=Jt.lex,or.Tokenizer=Yt,or.Hooks=nr,or.parse=or,or.options,or.setOptions,or.use,or.walkTokens,or.parseInline,rr.parse,Jt.lex;const cr=function(t){var r=(0,d.useState)(ar(t.text)),n=r[0],i=r[1];return(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=t.updatedData[t.updatedData.length-1].text;i(ar(e))}}),[t.text,t.updatedData]),(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}})},lr=function(t){var r=(0,d.useState)(ar(t.text)),n=r[0],i=r[1],o=(0,d.useState)(""),a=o[0],c=o[1];return(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text?(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")):e+=o.text}i(ar(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}}),a&&(0,e.jsx)(Se(),{severity:"error",children:a})]})},sr=require("@mui/material"),ur=require("@mui/material/Button");var pr=r.n(ur);const dr=require("@mui/material/Slider");var fr=r.n(dr);function hr(t){var r,n={play:{symbol:"play_circle",label:"Play"},pause:{symbol:"pause_circle",label:"Pause"},forward:{symbol:"forward_10",label:"Forward ten seconds"},replay:{symbol:"replay_10",label:"Replay ten seconds"},volumeUp:{symbol:"volume_up",label:"Mute"},volumeOff:{symbol:"volume_off",label:"Unmute"},miniPlayer:{symbol:"picture_in_picture",label:"Mini player"},miniPlayerExit:{symbol:"picture_in_picture_off",label:"Exit mini player"},fullscreen:{symbol:"fullscreen",label:"Fullscreen"},fullscreenExit:{symbol:"fullscreen_exit",label:"Exit fullscreen"},captionsOn:{symbol:"closed_caption",label:"Show captions"},captionsOff:{symbol:"closed_caption_disabled",label:"Hide captions"}};return n[t.action].label.replaceAll(" ","-").toLowerCase(),(0,e.jsx)(te(),{title:n[t.action].label,PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(K(),{onClick:t.onClick,className:t.className,color:"primary",children:(0,e.jsx)(re,{name:n[t.action].symbol,className:"rustic-icon-large"})})})}var mr=100;function yr(t){var r="dark"===(0,sr.useTheme)().palette.mode,n=R(t.mediaElement.currentTime);return(0,e.jsxs)(l(),{className:"rustic-progress",children:[function(){for(var n=t.mediaElement.buffered,i=0,o=n.length-1;o>=0;--o){var a=n.start(o),c=n.end(o);if(a<t.mediaElement.currentTime){i=c;break}}var l=i/t.mediaElement.duration*mr;return(0,e.jsx)(ae(),{className:"rustic-progress-buffered",variant:"determinate",value:l,sx:{backgroundColor:"action.focus","& .MuiLinearProgress-bar":{backgroundColor:r?"secondary.light":"action.selected"}}})}(),(0,e.jsx)(fr(),{className:"rustic-progress-slider",size:"small","aria-label":"Time","aria-valuetext":"Current time: ".concat(n),max:t.mediaElement.duration,value:t.mediaElement.currentTime,onChange:function(e,r){t.mediaElement.currentTime=r},valueLabelDisplay:"auto",valueLabelFormat:function(e){return R(e)},color:"secondary",sx:{"& .MuiSlider-rail":{color:"action.focus"}}})]})}function vr(t){var r=(0,d.useState)(t.mediaElement.volume),n=r[0],i=r[1],o=(0,d.useState)(t.mediaElement.volume),a=o[0],c=o[1],s=t.mediaElement.muted?"volumeOff":"volumeUp";return(0,e.jsxs)(l(),{className:"rustic-volume-settings",children:[(0,e.jsx)(hr,{onClick:function(){t.mediaElement.muted=!t.mediaElement.muted,t.mediaElement.muted?(c(t.mediaElement.volume),i(0)):i(a)},className:"rustic-mute-button",action:s}),(0,e.jsx)(fr(),{className:"rustic-volume-slider",size:"small",max:1,step:.1,"aria-label":"Volume","aria-valuetext":"Volume: ".concat(n*mr,"%"),value:n,onChange:function(e,r){var n=r;t.mediaElement.muted=0===n,t.mediaElement.volume=n,i(t.mediaElement.volume)}})]})}function gr(t){var r=t.isTranscriptVisible?"keyboard_arrow_up":"keyboard_arrow_down",n="".concat(t.isTranscriptVisible?"Hide":"Show"," Transcript");return(0,e.jsx)(pr(),{className:"rustic-transcript-toggle",onClick:t.setIsTranscriptVisible,endIcon:(0,e.jsx)(re,{name:r}),children:(0,e.jsx)(w(),{variant:"overline",children:n})})}function br(t){var r=(0,d.useState)(!t.mediaElement.paused),n=r[0],i=r[1],o=n?"pause":"play";return t.mediaElement.onended=function(){i(!1)},t.mediaElement.onpause=function(){i(!1)},t.mediaElement.onplay=function(){i(!0)},(0,e.jsx)(hr,{onClick:function(){n?t.mediaElement.pause():t.mediaElement.play().catch((function(e){t.onError("Failed to play the media. Error: ".concat(e.message))}))},action:o,className:"rustic-pause-play-icon"})}function xr(t){var r,n=(0,d.useState)(t.mediaElement.playbackRate),i=n[0],o=n[1];return(0,e.jsx)(te(),{title:"Playback rate",PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(pr(),{onClick:function(){var e=1;t.mediaElement.playbackRate<2&&(e=t.mediaElement.playbackRate+.5),t.mediaElement.playbackRate=e,o(e)},className:"rustic-playback-rate-button",children:(0,e.jsxs)(w(),{variant:"body1",children:[i,"X"]})})})}function wr(t){var r="replay"===t.movement,n=r?function(){t.mediaElement.currentTime-=10}:function(){t.mediaElement.currentTime+=10},i=r?"replay":"forward";return(0,e.jsx)(hr,{onClick:n,action:i})}function Or(t){var r=R(t.elapsedTimeInSeconds),n=R(t.durationTimeInSeconds),i="".concat(r," / ").concat(n);return"wide"===t.style?(0,e.jsxs)(l(),{className:"rustic-time-container",children:[(0,e.jsx)(w(),{variant:"overline",children:r}),(0,e.jsx)(w(),{variant:"overline",children:n})]}):(0,e.jsx)(w(),{variant:"overline",className:"rustic-time-display",children:i})}Or.defaultProps={style:"condensed"};const kr=require("@mui/material/Divider");var Sr=r.n(kr);function jr(t){var r=!!document.fullscreenElement;return(0,e.jsxs)(O.Box,{className:"rustic-transcript-container",children:[!r&&(0,e.jsx)(Sr(),{orientation:"vertical",flexItem:!0}),(0,e.jsx)(w(),{className:"rustic-transcript-content",variant:"body2",children:t.transcript})]})}function Er(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=(0,d.useState)(!1),a=o[0],c=o[1],l=(0,d.useState)(!0),s=l[0],u=l[1],p=(0,d.useState)(0),f=p[0],h=p[1],m=(0,d.useState)(""),y=m[0],v=m[1],g=(0,d.useState)(""),b=g[0],x=g[1],k=(0,sr.useTheme)(),S=(0,d.useRef)(null),j=(0,sr.useMediaQuery)(k.breakpoints.down("md"));function E(){return(0,e.jsx)(w(),{variant:"h6",className:"rustic-sound-title",children:t.title})}function P(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(hr,{action:r,onClick:function(){return c(!a)}})}}function T(){if(S.current)return(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(wr,{mediaElement:S.current,movement:"replay"}),(0,e.jsx)(br,{mediaElement:S.current,onError:x}),(0,e.jsx)(wr,{mediaElement:S.current,movement:"forward"})]})}function C(){if(t.transcript&&n)return(0,e.jsx)(jr,{transcript:t.transcript})}function I(){if(t.transcript)return(0,e.jsx)(gr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}function D(){return(0,e.jsx)("video",{src:t.src,ref:S,className:a?"rustic-has-captions":"",children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})})}(0,d.useEffect)((function(){var e,t,r,n;function i(e){v(e)}null===(e=S.current)||void 0===e||e.addEventListener("timeupdate",(function(){S.current&&h(S.current.currentTime)})),null===(t=S.current)||void 0===t||t.addEventListener("canplay",(function(){v(""),u(!1)})),null===(r=S.current)||void 0===r||r.addEventListener("error",(function(){return i("Failed to load the audio.")})),null===(n=S.current)||void 0===n||n.addEventListener("stalled",(function(){return i("Failed to fetch audio data, but trying.")}))}),[]);var M=j?function(){if(S.current)return(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(Or,{elapsedTimeInSeconds:f,durationTimeInSeconds:S.current.duration,style:"wide"}),(0,e.jsx)(yr,{mediaElement:S.current}),E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-left",children:T()}),(0,e.jsx)(vr,{mediaElement:S.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-right",children:[I(),(0,e.jsxs)(O.Box,{children:[P(),(0,e.jsx)(xr,{mediaElement:S.current})]})]})]}),C()]})}:function(){if(S.current)return(0,e.jsxs)(e.Fragment,{children:[E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(yr,{mediaElement:S.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-left",children:[T(),P(),(0,e.jsx)(xr,{mediaElement:S.current}),(0,e.jsx)(vr,{mediaElement:S.current}),(0,e.jsx)(Or,{elapsedTimeInSeconds:f,durationTimeInSeconds:S.current.duration,style:"condensed"})]}),(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-right",children:I()})]}),C()]})]})};return y.length>0?(0,e.jsx)(Se(),{severity:"error",children:y}):s?(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),(0,e.jsx)(A(),{})]}):(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),M(),b.length>0&&(0,e.jsx)(Se(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b})]})}function Ar(t){var r=(0,d.useState)(!!document.pictureInPictureElement),n=r[0],i=r[1],o=t.mediaElement,a=n?"miniPlayerExit":"miniPlayer";return o.onleavepictureinpicture=function(){i(!1)},(0,e.jsx)(hr,{onClick:function(){n?document.exitPictureInPicture().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit mini player. Error: ".concat(e.message))})):o.requestPictureInPicture().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter mini player. Error: ".concat(e.message))}))},action:a})}function Pr(t){var r=(0,d.useState)(!!document.fullscreenElement),n=r[0],i=r[1],o=t.element,a=n?"fullscreenExit":"fullscreen";return o.onfullscreenchange=function(){i(!!document.fullscreenElement)},(0,e.jsx)(hr,{onClick:function(){n?document.exitFullscreen().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit fullscreen mode. Error: ".concat(e.message))})):o.requestFullscreen().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter fullscreen mode. Error: ".concat(e.message))}))},action:a})}function Tr(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=(0,d.useState)(!1),a=o[0],c=o[1],l=(0,d.useState)(!0),s=l[0],u=l[1],p=(0,d.useState)(!!document.fullscreenElement),f=p[0],h=p[1],m=(0,d.useState)(!1),y=m[0],v=m[1],g=(0,d.useState)(""),b=g[0],x=g[1],k=(0,d.useState)(""),S=k[0],j=k[1],E=(0,d.useState)(0),P=E[0],T=E[1],C=(0,d.useRef)(null),I=(0,d.useRef)(null),D=(0,sr.useTheme)(),M=(0,sr.useMediaQuery)(D.breakpoints.down("md"));(0,d.useEffect)((function(){var e,t,r,n,i,o,a,c;function l(e){j(e),u(!1)}function s(){clearTimeout(c),c=setTimeout((function(){return v(!1)}),3e3)}null===(e=I.current)||void 0===e||e.addEventListener("timeupdate",(function(){I.current&&T(I.current.currentTime)})),null===(t=I.current)||void 0===t||t.addEventListener("canplay",(function(){j(""),u(!1)})),null===(r=I.current)||void 0===r||r.addEventListener("error",(function(){return l("Failed to load the video.")})),null===(n=I.current)||void 0===n||n.addEventListener("stalled",(function(){return l("Failed to fetch video data, but trying.")})),document.addEventListener("fullscreenchange",(function(){h(!!document.fullscreenElement)})),null===(i=C.current)||void 0===i||i.addEventListener("mousemove",(function(){v(!0),s()})),null===(o=C.current)||void 0===o||o.addEventListener("mouseleave",(function(){v(!1)})),null===(a=C.current)||void 0===a||a.addEventListener("keydown",(function(){v(!0),s()}))}),[]);var N={backgroundColor:D.palette.background.paper,opacity:y?1:0};function R(){if(t.transcript&&n)return(0,e.jsx)(jr,{transcript:t.transcript})}function _(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(hr,{action:r,onClick:function(){return c(!a)}})}}function B(){if(t.transcript)return(0,e.jsx)(gr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}var L=M?function(){return f?(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsxs)(O.Box,{className:"rustic-video-top-controls",children:[(0,e.jsx)(br,{mediaElement:I.current,onError:x}),(0,e.jsx)(yr,{mediaElement:I.current}),(0,e.jsx)(Or,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(wr,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(wr,{mediaElement:I.current,movement:"forward"}),_(),(0,e.jsx)(xr,{mediaElement:I.current})]}),B()]}),R()]})}):(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls-mobile-preview",children:[(0,e.jsx)(br,{mediaElement:I.current,onError:x}),(0,e.jsxs)(O.Box,{className:"rustic-video-controls-right",children:[B(),(0,e.jsx)(Pr,{element:C.current,onError:x})]})]})})}:function(){return(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsx)(yr,{mediaElement:I.current}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-left",children:[(0,e.jsx)(br,{mediaElement:I.current,onError:x}),(0,e.jsx)(wr,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(wr,{mediaElement:I.current,movement:"forward"}),_(),(0,e.jsx)(xr,{mediaElement:I.current}),(0,e.jsx)(vr,{mediaElement:I.current}),(0,e.jsx)(Or,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration,style:"condensed"})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-right",children:[B(),(0,e.jsx)(Ar,{mediaElement:I.current,onError:x}),(0,e.jsx)(Pr,{element:C.current,onError:x})]})]}),f&&R()]})})};return S.length>0?(0,e.jsx)(Se(),{severity:"error",children:S}):(0,e.jsxs)(O.Box,{className:"rustic-video",children:[s&&(0,e.jsx)(A(),{className:"rustic-video-loading-spinner"}),(0,e.jsxs)(O.Box,{ref:C,className:"rustic-video-screen",sx:{visibility:s?"hidden":"visible"},children:[b.length>0&&(0,e.jsx)(Se(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b}),(!M||f)&&function(){if(I.current&&C.current)return(0,e.jsxs)(O.Box,{className:"rustic-video-title",sx:N,children:[(0,e.jsx)(w(),{variant:"body2",children:t.title}),f&&M&&(0,e.jsxs)(O.Box,{children:[(0,e.jsx)(Ar,{mediaElement:I.current,onError:x}),(0,e.jsx)(Pr,{element:C.current,onError:x})]})]})}(),(0,e.jsx)("video",{className:"rustic-video-element",ref:I,src:t.src,poster:t.poster,children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})}),L()]}),!f&&R()]})}const Cr=require("@mui/material/Drawer");var Ir=r.n(Cr);const Dr=require("@mui/material/ListItemText");var Mr=r.n(Dr);const Nr=require("@mui/material/Menu");var Rr=r.n(Nr);const _r=require("@mui/material/MenuItem");var Br=r.n(_r),Lr=function(){return Lr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lr.apply(this,arguments)};function zr(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=(0,d.useRef)(null),a=(0,s.useTheme)(),c=(0,sr.useMediaQuery)(a.breakpoints.down("md")),l=c?Ir():Rr(),u={borderRadius:"".concat(a.shape.borderRadius,"px"),border:"1px solid ".concat(a.palette.divider)};function p(t){return(0,e.jsxs)(e.Fragment,{children:[t.startDecorator&&(0,e.jsx)(O.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:t.startDecorator}),(0,e.jsx)(Mr(),{children:(0,e.jsx)(w(),{variant:"body2",children:t.label})}),t.endDecorator&&(0,e.jsx)(O.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:t.endDecorator})]})}c&&(u=Lr(Lr({},u),{borderRadius:"".concat(a.shape.borderRadius,"px ").concat(a.shape.borderRadius,"px 0 0"),borderBottom:0}));var f=t.menuItems.map((function(t){return t.href?(0,e.jsx)(Br(),{component:"a",onClick:function(){return i(!1)},href:t.href,download:t.downloadFileName||t.isFiledownload,children:p(t)},t.label):(0,e.jsx)(Br(),{onClick:function(e){t.onClick&&t.onClick(e),i(!1)},disabled:!t.onClick,children:p(t)},t.label)}));var h,m,y=c?{}:{anchorEl:o.current};return(0,e.jsxs)(e.Fragment,{children:[(h={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":t.ariaLabel,ref:o,className:"rustic-popover-menu-button"},m=(0,e.jsx)(re,{name:"more_vert"}),t.buttonText?(0,e.jsx)(pr(),Lr({},h,{startIcon:t.icon?t.icon:null,children:t.buttonText})):(0,e.jsx)(te(),{title:t.ariaLabel,children:(0,e.jsx)(K(),Lr({},h,{children:t.icon?t.icon:m}))})),(0,e.jsx)(l,Lr({open:n,onClose:function(){return i(!1)}},y,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":Lr(Lr({},u),{backgroundImage:"none",boxShadow:a.shadows[2]})},children:f}))]})}function Fr(t){return(0,e.jsx)(te(),{title:t.label,children:(0,e.jsx)(K(),{color:"inherit","aria-label":t.label,onClick:function(e){e.stopPropagation(),e.preventDefault(),t.onClick(t.message)},className:"rustic-message-actions",children:t.icon})})}function $r(t){var r=(0,d.useState)("Copy text"),n=r[0],i=r[1];return(0,e.jsx)(Fr,{message:t.message,icon:(0,e.jsx)(re,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){i("Copied"),setTimeout((function(){i("Copy text")}),2e3)})).catch((function(){i("Failed to copy")}))},label:n})}const qr=require("@mui/material/Stack");var Wr=r.n(qr);const Ur=function(t){return(0,e.jsx)(w(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(r=t.timestamp,I(r)<86400?function(e){var t=I(e);if(t<60)return"".concat(T()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(T()("minute",r,!0)," ago")}var n=Math.floor(t/3600);return"".concat(T()("hour",n,!0)," ago")}(r):(n=new Date(r),i=navigator.language,o={month:"short",day:"numeric"},a=new Date,l=(c=n.getFullYear()!==a.getFullYear())?" at ":", ",c&&(o.year="numeric"),n.toLocaleDateString(i,o)+l+n.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})))});var r,n,i,o,a,c,l},Hr=(0,d.forwardRef)((function(t,r){var n=(0,sr.useTheme)();return(0,e.jsxs)(Wr(),{id:t.message.id,className:"rustic-message-canvas",ref:r,children:[(0,e.jsxs)(Wr(),{direction:"row",alignItems:"center",spacing:1,children:[t.getProfileComponent&&t.getProfileComponent(t.message),(0,e.jsx)(Ur,{timestamp:t.message.timestamp})]}),t.getActionsComponent&&t.getActionsComponent(t.message)&&(0,e.jsx)(pe(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:t.getActionsComponent(t.message)}),(0,e.jsx)(pe(),{variant:"outlined",className:"rustic-message-container",children:t.children})]})})),Gr=require("@mui/system/Box");var Xr=r.n(Gr);function Vr(t){var r,n,i,o,a=(0,d.useRef)(null),c=(0,d.useRef)(null),l=(0,d.useRef)(),s=(0,d.useState)(!0),u=s[0],p=s[1],f=(0,d.useState)(!0),h=f[0],m=f[1],y=(0,d.useState)(!1),v=y[0],g=y[1],b=(null===(r=t.messages)||void 0===r?void 0:r.length)||0,x=(i=b,o=(0,d.useRef)(0),(0,d.useEffect)((function(){o.current=i})),o.current),w=2e3;function O(){m(!0),l.current&&clearTimeout(l.current),l.current=setTimeout((function(){m(!1)}),w)}function k(){var e,t=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}function S(){var e=c.current,t=a.current;if(e&&t){var r=e.getBoundingClientRect().bottom,n=t.getBoundingClientRect().bottom;p(n-1<=r)}}function E(){if(k()){var e=c.current;g(!0),e&&setTimeout((function(){O(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(E,1)}function A(){if(k()){var e=a.current;e&&setTimeout((function(){e.scrollIntoView({block:"start",inline:"nearest"})}),0)}else setTimeout(A,1)}return(0,d.useEffect)((function(){var e=c.current;if(S(),e)return e.addEventListener("scroll",S),window.addEventListener("resize",S),function(){e.removeEventListener("scroll",S),window.removeEventListener("resize",S)}}),[u]),(0,d.useEffect)((function(){E()}),[v]),(0,d.useEffect)((function(){u&&0!==x&&b>x&&(O(),A())}),[u,null===(n=t.messages)||void 0===n?void 0:n.length]),(0,e.jsxs)(Xr(),{ref:c,className:"rustic-message-space",children:[t.messages&&t.messages.length>0&&t.messages.map((function(r,n){return(0,e.jsx)(Hr,{message:r,getActionsComponent:t.getActionsComponent,getProfileComponent:t.getProfileComponent,ref:n===b-1?a:null,children:(0,e.jsx)(j,{ws:t.ws,sender:t.sender,message:r,supportedElements:t.supportedElements})},r.id)})),!u&&!h&&(0,e.jsx)(pr(),{variant:"contained",color:"secondary",className:"rustic-scroll-down-button",onClick:function(){var e;null===(e=a.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"}),O()},endIcon:(0,e.jsx)(re,{name:"arrow_downward",className:"rustic-end-icon"}),children:t.scrollDownLabel})]})}Vr.defaultProps={scrollDownLabel:"scroll down"};const Kr=function(t){return(0,e.jsx)(w(),{variant:"body2",className:"rustic-text",children:It.sanitize(t.text)})};function Yr(t){return(0,e.jsxs)(Xr(),{className:"rustic-multipart",children:[t.text&&(0,e.jsx)(Kr,{text:t.text}),(r=t.files.map((function(t,r){return(0,e.jsx)(de,{file:t,children:t.url&&(0,e.jsx)(te(),{title:"Download",children:(0,e.jsx)(K(),{component:"a",href:t.url,download:t.name,children:(0,e.jsx)(re,{name:"download"})})})},r)})),(0,e.jsx)(Xr(),{className:"rustic-files",children:r}))]});var r}const Zr=require("@mui/material/Dialog");var Qr=r.n(Zr);const Jr=require("@mui/material/DialogTitle");var en=r.n(Jr);const tn=require("@mui/material/List");var rn=r.n(tn);const nn=require("@mui/material/ListItem");var on=r.n(nn);const an=require("@mui/material/ListSubheader");var cn,ln,sn=r.n(an);!function(e){e.Owner="owner",e.Member="member"}(cn||(cn={})),function(e){e.Human="human",e.Agent="agent"}(ln||(ln={}));function un(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=t.participants.length,a=n?t.participants:t.participants.slice(0,3),c="".concat(T()(t.participantType,o)," (").concat(o,")"),l=n?"Show Less":"Show All ".concat(o);return 0===o?(0,e.jsx)(w(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,e.jsx)(rn(),{className:"rustic-participant-list",subheader:(0,e.jsxs)(sn(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,e.jsxs)(O.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,e.jsx)(w(),{variant:"subtitle2",color:"text.secondary",children:c})]}),o>3&&(0,e.jsx)(pr(),{onClick:function(){return i(!n)},color:"primary",size:"small",startIcon:(0,e.jsx)(re,{name:"keyboard_arrow_down"}),children:l})]}),children:a.map((function(t){return(0,e.jsxs)(on(),{className:"rustic-participant-list-item",children:[(0,e.jsx)(w(),{variant:"subtitle2",children:t.displayName}),(0,e.jsx)(w(),{variant:t.participantRole===cn.Owner?"subtitle2":"caption",children:M(t.participantRole)})]},t.id)}))})}const pn=function(t){function r(e,t){return function(e){return function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e,!0).sort((function(e,t){return t.participantRole===cn.Owner?1:-1}))}(e.filter((function(e){return e.participantType===t})))}var n=r(t.participants,ln.Human),i=r(t.participants,ln.Agent),o="".concat(T()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,e.jsxs)(Qr(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,e.jsx)(en(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:o}),(0,e.jsx)(un,{participantType:"Human",participantTypeIcon:(0,e.jsx)(re,{name:"account_circle"}),participants:n}),i.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Sr(),{className:"rustic-participants-container-divider"}),(0,e.jsx)(un,{participantType:"Agent",participantTypeIcon:(0,e.jsx)(re,{name:"smart_toy"}),participants:i})]})]})},dn=require("@mui/system/Stack");var fn=r.n(dn);const hn=require("@mui/system/useTheme");var mn=r.n(hn);const yn=require("pdfjs-dist"),vn=function(t){var r={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(r[t.action].label.replaceAll(" ","-").toLowerCase(),r[t.action]);return(0,e.jsx)(te(),{title:n.label,children:(0,e.jsx)(K(),{onClick:t.onClick,className:t.className,disabled:t.isDisabled,children:(0,e.jsx)(re,{name:n.symbol})})})},gn=function(t){var r,n=(0,d.useRef)(null),i=(0,d.useState)(1),o=i[0],a=i[1],c=(0,d.useState)(1),s=c[0],u=c[1],f=(0,d.useState)(1),h=f[0],m=f[1],y=(0,d.useState)(!1),v=y[0],g=y[1],b=mn()(),x=p()(b.breakpoints.down("sm")),O=p()(b.breakpoints.between("sm","md"));if(r=t.url,!/\/[^/]+\.pdf$/.test(r))return(0,e.jsx)(pe(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(w(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var k=(0,d.useState)((function(){return x?.5:O?1:1.5})),S=k[0],j=k[1];return(0,d.useEffect)((function(){yn.GlobalWorkerOptions.workerSrc||(yn.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(yn.version,"/pdf.worker.mjs")),yn.getDocument({url:"".concat(t.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(o).then((function(e){var t=e.getViewport({scale:S}),r=n.current;if(r){var i=r.getContext("2d");if(i){var o=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*o,r.height=t.height*o;var a={canvasContext:i,viewport:t,transform:[o,0,0,o,0,0]};e.render(a)}}}))}(e)})).catch((function(){g(!0)}))}),[t.url,o,S]),v?(0,e.jsx)(pe(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(w(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,e.jsxs)(pe(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,e.jsxs)(l(),{className:"rustic-pdf-viewer-header",children:[(0,e.jsx)(vn,{action:"zoomOut",onClick:function(){j((function(e){return Math.max(e-.2,.2)}))}}),(0,e.jsx)(vn,{action:"zoomIn",onClick:function(){j((function(e){return e+.2}))}})]}),(0,e.jsx)(l(),{className:"rustic-pdf-viewer-body",children:(0,e.jsx)(l(),{className:"rustic-pdf-viewer-body-inner",children:(0,e.jsx)("canvas",{ref:n})})}),(0,e.jsxs)(fn(),{direction:"row",justifyContent:"center",alignItems:"center",children:[(0,e.jsx)(vn,{action:"previousPage",onClick:function(){o>1&&(a(o-1),m(o-1))},isDisabled:1===o}),(0,e.jsxs)(w(),{variant:"body1",className:"rustic-page-indicator",children:["Page",(0,e.jsx)(J(),{type:"number",value:h,onChange:function(e){var t=parseInt(e.target.value);m(t),!isNaN(t)&&t>=1&&t<=s&&a(t)},size:"small",className:"rustic-pdf-page-input"}),"of ",s]}),(0,e.jsx)(vn,{action:"nextPage",onClick:function(){o<s&&(a(o+1),m(o+1))},isDisabled:o===s})]})]})};function bn(t){var r=(0,d.useState)(""),n=r[0],i=r[1],o=(0,sr.useTheme)(),a=(0,sr.useMediaQuery)(o.breakpoints.down("md"))?"column":"row",c=t.options.map((function(r,o){return(0,e.jsx)(pr(),{onClick:function(){return function(e){i(e);var r=(new Date).toISOString(),n={id:X(),timestamp:r,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:e},inReplyTo:t.messageId};t.ws.send(n)}(r)},variant:"outlined",sx:n===r?{"&.Mui-disabled":{color:"common.white",backgroundColor:"secondary.main"}}:{},color:"secondary",className:"rustic-option",disabled:!!n,children:r},o)}));return(0,e.jsxs)(l(),{className:"rustic-question",children:[(t.title||t.description)&&(0,e.jsxs)(l(),{className:"rustic-question-text",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description})]}),(0,e.jsx)(Wr(),{direction:a,className:"rustic-options-container",children:c})]})}const xn=require("@mui/material/Table");var wn=r.n(xn);const On=require("@mui/material/TableBody");var kn=r.n(On);const Sn=require("@mui/material/TableCell");var jn=r.n(Sn);const En=require("@mui/material/TableContainer");var An=r.n(En);const Pn=require("@mui/material/TableHead");var Tn=r.n(Pn);const Cn=require("@mui/material/TablePagination");var In=r.n(Cn);const Dn=require("@mui/material/TableRow");var Mn=r.n(Dn);const Nn=require("@mui/material/TableSortLabel");var Rn,_n=r.n(Nn),Bn=10;function Ln(){return(0,e.jsx)(re,{name:"expand_all"})}function zn(t){if(0===t.data.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var r,n,i,o=t.data.length>Bn,a=(0,d.useState)({}),c=a[0],l=a[1],s=(0,d.useState)(o?Bn:-1),u=s[0],p=s[1],f=(0,d.useState)(0),h=f[0],m=f[1],y=(0,sr.useTheme)(),v=Array.from(new Set(t.data.flatMap((function(e){return Object.keys(e)})))),g=t.headers||v.map((function(e){return{dataKey:e}})),b=(r=t.data,n=Object.keys(c)[0],i=c[n],n&&i?r.slice().sort((function(e,t){var r=Object.keys(c)[0],n=c[r];return e[r]<t[r]?n===Rn.Descending?1:-1:e[r]>t[r]?n===Rn.Descending?-1:1:0})):r),x=b.slice(h*u,h*u+u),O=u>0?x:b;function k(e){if(!c[e])return Ln}return(0,e.jsxs)(Wr(),{className:"rustic-table",spacing:1,children:[t.title&&(0,e.jsx)(w(),{variant:"h6",className:"rustic-table-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"body1",children:t.description}),(0,e.jsx)(An(),{className:"rustic-table-container",children:(0,e.jsxs)(wn(),{"aria-label":t.title||"a table of data",size:"small",stickyHeader:!0,children:[g.length>0&&(0,e.jsx)(Tn(),{children:(0,e.jsx)(Mn(),{children:g.map((function(t,r){return(0,e.jsx)(jn(),{sortDirection:c[t.dataKey]||!1,children:(0,e.jsx)(te(),{title:(n=t.dataKey,i=c[n],i?Object.keys(Rn)[Object.values(Rn).indexOf(i)]:"Sort"),children:(0,e.jsx)(_n(),{active:!0,direction:c[t.dataKey],onClick:function(){return function(e){l((function(t){var r,n,i={};switch(t[e]){case Rn.Ascending:(r={})[e]=Rn.Descending,i=r;break;case Rn.Descending:i={};break;default:(n={})[e]=Rn.Ascending,i=n}return i}))}(t.dataKey)},className:"rustic-table-header",IconComponent:k(t.dataKey),children:t.label||M(t.dataKey)})})},"header-".concat(r));var n,i}))})}),(0,e.jsx)(kn(),{children:O.map((function(t,r){return(0,e.jsx)(Mn(),{children:g.map((function(n,i){return(0,e.jsx)(jn(),{children:t[n.dataKey]},"cell-".concat(r,"-").concat(i))}))},"row-".concat(r))}))})]})}),o&&(0,e.jsx)(In(),{className:"rustic-table-pagination",component:"div",count:t.data.length,rowsPerPage:u,labelRowsPerPage:"Rows:",page:h,onPageChange:function(e,t){return m(t)},onRowsPerPageChange:function(e){p(+e.target.value),m(0)},sx:{"& .MuiTablePagination-selectLabel":{color:y.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})}!function(e){e.Ascending="asc",e.Descending="desc"}(Rn||(Rn={}));const Fn=function(t){var r=(0,d.useState)(It.sanitize(t.text)),n=r[0],i=r[1],o=(0,d.useState)(""),a=o[0],c=o[1];return(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text&&(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")),e+=o.text}i(It.sanitize(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",children:n}),a&&(0,e.jsx)(Se(),{severity:"error",children:a})]})};var $n=function(){return $n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$n.apply(this,arguments)};function qn(t){var r=It.sanitize(t.youtubeVideoId);return(0,e.jsx)("iframe",$n({},_(t.width,t.height),{src:"https://www.youtube.com/embed/".concat(r),title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",loading:"lazy"}))}qn.defaultProps={title:"Embedded video"};const Wn=require("@mui/material/FormControl");var Un=r.n(Wn);const Hn=require("lodash/isNil");var Gn=r.n(Hn);const Xn=require("lodash/isFunction");var Vn=r.n(Xn);const Kn=require("lodash/range");var Yn=r.n(Kn);const Zn=require("lodash/get");var Qn=r.n(Zn);const Jn=require("lodash/sortBy");var ei=r.n(Jn);const ti=require("lodash/throttle");var ri=r.n(ti);const ni=require("lodash/find");var ii=r.n(ni);const oi=require("lodash/every");var ai=r.n(oi);const ci=require("clsx");var li=r.n(ci);const si=require("tiny-invariant");var ui=r.n(si);function pi(e){return pi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pi(e)}function di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?di(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==pi(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==pi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===pi(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):di(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var hi=Math.PI/180,mi=function(e){return 180*e/Math.PI},yi=function(e,t,r,n){return{x:e+Math.cos(-hi*n)*r,y:t+Math.sin(-hi*n)*r}},vi=function(e,t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360);return e+360*Math.min(i,o)},gi=function(e,t){var r=function(e,t){var r,n,i,o,a,c,l=e.x,s=e.y,u=t.cx,p=t.cy,d=(i=(r={x:l,y:s}).x,o=r.y,a=(n={x:u,y:p}).x,c=n.y,Math.sqrt(Math.pow(i-a,2)+Math.pow(o-c,2)));if(d<=0)return{radius:d};var f=(l-u)/d,h=Math.acos(f);return s>p&&(h=2*Math.PI-h),{radius:d,angle:mi(h),angleInRadian:h}}({x:e.x,y:e.y},t),n=r.radius,i=r.angle,o=t.innerRadius,a=t.outerRadius;if(n<o||n>a)return!1;if(0===n)return!0;var c,l=function(e){var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-360*o,endAngle:r-360*o}}(t),s=l.startAngle,u=l.endAngle,p=i;if(s<=u){for(;p>u;)p-=360;for(;p<s;)p+=360;c=p>=s&&p<=u}else{for(;p>s;)p-=360;for(;p<u;)p+=360;c=p>=u&&p<=s}return c?fi(fi({},t),{},{radius:n,angle:vi(p,t)}):null};function bi(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle;return{points:[yi(t,r,n,i),yi(t,r,n,o)],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}const xi=require("lodash/isString");var wi=r.n(xi);const Oi=require("lodash/isNaN");var ki=r.n(Oi);const Si=require("lodash/isNumber");var ji=r.n(Si),Ei=function(e){return 0===e?0:e>0?1:-1},Ai=function(e){return wi()(e)&&e.indexOf("%")===e.length-1},Pi=function(e){return ji()(e)&&!ki()(e)},Ti=function(e){return Pi(e)||wi()(e)},Ci=0,Ii=function(e){var t=++Ci;return"".concat(e||"").concat(t)},Di=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!Pi(e)&&!wi()(e))return n;if(Ai(e)){var o=e.indexOf("%");r=t*parseFloat(e.slice(0,o))/100}else r=+e;return ki()(r)&&(r=n),i&&r>t&&(r=t),r},Mi=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},Ni=function(e,t){return Pi(e)&&Pi(t)?function(r){return e+r*(t-e)}:function(){return t}};function Ri(e,t,r){return e&&e.length?e.find((function(e){return e&&("function"==typeof t?t(e):Qn()(e,t))===r})):null}var _i={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return _i[e]},set:function(e,t){if("string"==typeof e)_i[e]=t;else{var r=Object.keys(e);r&&r.length&&r.forEach((function(t){_i[t]=e[t]}))}}};function Bi(e){return Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(e)}function Li(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Li(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Bi(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Bi(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Li(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fi={widthCache:{},cacheCount:0},$i={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},qi="recharts_measurement_span",Wi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||_i.isSsr)return{width:0,height:0};var r,n=(r=zi({},t),Object.keys(r).forEach((function(e){r[e]||delete r[e]})),r),i=JSON.stringify({text:e,copyStyle:n});if(Fi.widthCache[i])return Fi.widthCache[i];try{var o=document.getElementById(qi);o||((o=document.createElement("span")).setAttribute("id",qi),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=zi(zi({},$i),n);Object.assign(o.style,a),o.textContent="".concat(e);var c=o.getBoundingClientRect(),l={width:c.width,height:c.height};return Fi.widthCache[i]=l,++Fi.cacheCount>2e3&&(Fi.cacheCount=0,Fi.widthCache={}),l}catch(e){return{width:0,height:0}}};const Ui=require("lodash/mapValues");var Hi=r.n(Ui);const Gi=require("victory-vendor/d3-scale"),Xi=require("victory-vendor/d3-shape"),Vi=require("lodash/max");var Ki=r.n(Vi);const Yi=require("lodash/min");var Zi=r.n(Yi);const Qi=require("lodash/flatMap");var Ji=r.n(Qi);const eo=require("lodash/upperFirst");var to=r.n(eo);const ro=require("lodash/isEqual");var no=r.n(ro);const io=require("recharts-scale"),oo=require("lodash/isObject");var ao=r.n(oo);const co=require("react-is");function lo(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function so(e){return so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},so(e)}var uo=["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"],po=["points","pathLength"],fo={svg:["viewBox","children"],polygon:po,polyline:po},ho=["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"],mo=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,d.isValidElement)(e)&&(r=e.props),!ao()(r))return null;var n={};return Object.keys(r).forEach((function(e){ho.includes(e)&&(n[e]=t||function(t){return r[e](r,t)})})),n},yo=function(e,t,r){if(!ao()(e)||"object"!==so(e))return null;var n=null;return Object.keys(e).forEach((function(i){var o=e[i];ho.includes(i)&&"function"==typeof o&&(n||(n={}),n[i]=function(e,t,r){return function(n){return e(t,r,n),null}}(o,t,r))})),n},vo=["children"],go=["children"];function bo(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function xo(e){return xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xo(e)}var wo={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Oo=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},ko=null,So=null,jo=function e(t){if(t===ko&&Array.isArray(So))return So;var r=[];return d.Children.forEach(t,(function(t){Gn()(t)||((0,co.isFragment)(t)?r=r.concat(e(t.props.children)):r.push(t))})),So=r,ko=t,r};function Eo(e,t){var r=[],n=[];return n=Array.isArray(t)?t.map((function(e){return Oo(e)})):[Oo(t)],jo(e).forEach((function(e){var t=Qn()(e,"type.displayName")||Qn()(e,"type.name");-1!==n.indexOf(t)&&r.push(e)})),r}function Ao(e,t){var r=Eo(e,t);return r&&r[0]}var Po=function(e){if(!e||!e.props)return!1;var t=e.props,r=t.width,n=t.height;return!(!Pi(r)||r<=0||!Pi(n)||n<=0)},To=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Co=function(e){return e&&"object"===xo(e)&&"cx"in e&&"cy"in e&&"r"in e},Io=function(e,t,r){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,d.isValidElement)(e)&&(n=e.props),!ao()(n))return null;var i={};return Object.keys(n).forEach((function(e){var o;(function(e,t,r,n){var i,o=null!==(i=null==fo?void 0:fo[n])&&void 0!==i?i:[];return!Vn()(e)&&(n&&o.includes(t)||uo.includes(t))||r&&ho.includes(t)})(null===(o=n)||void 0===o?void 0:o[e],e,t,r)&&(i[e]=n[e])})),i},Do=function e(t,r){if(t===r)return!0;var n=d.Children.count(t);if(n!==d.Children.count(r))return!1;if(0===n)return!0;if(1===n)return Mo(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var o=t[i],a=r[i];if(Array.isArray(o)||Array.isArray(a)){if(!e(o,a))return!1}else if(!Mo(o,a))return!1}return!0},Mo=function(e,t){if(Gn()(e)&&Gn()(t))return!0;if(!Gn()(e)&&!Gn()(t)){var r=e.props||{},n=r.children,i=bo(r,vo),o=t.props||{},a=o.children,c=bo(o,go);return n&&a?lo(i,c)&&Do(n,a):!n&&!a&&lo(i,c)}return!1},No=function(e,t){var r=[],n={};return jo(e).forEach((function(e,i){if(function(e){return e&&e.type&&wi()(e.type)&&To.indexOf(e.type)>=0}(e))r.push(e);else if(e){var o=Oo(e.type),a=t[o]||{},c=a.handler,l=a.once;if(c&&(!l||!n[o])){var s=c(e,o,i);r.push(s),n[o]=!0}}})),r},Ro=["children","className"];function _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_o.apply(this,arguments)}var Bo=f().forwardRef((function(e,t){var r=e.children,n=e.className,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Ro),o=li()("recharts-layer",n);return f().createElement("g",_o({className:o},Io(i,!0),{ref:t}),r)})),Lo=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function zo(){return zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zo.apply(this,arguments)}function Fo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $o(e){var t=e.offset,r=e.layout,n=e.width,i=e.dataKey,o=e.data,a=e.dataPointFormatter,c=e.xAxis,l=e.yAxis,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Lo),u=Io(s),p=o.map((function(e){var o=a(e,i),s=o.x,p=o.y,d=o.value,h=o.errorVal;if(!h)return null;var m,y,v,g,b=[];if(Array.isArray(h)){var x=(g=2,function(e){if(Array.isArray(e))return e}(v=h)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(v,g)||function(e,t){if(e){if("string"==typeof e)return Fo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fo(e,t):void 0}}(v,g)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());m=x[0],y=x[1]}else m=y=h;if("vertical"===r){var w=c.scale,O=p+t,k=O+n,S=O-n,j=w(d-m),E=w(d+y);b.push({x1:E,y1:k,x2:E,y2:S}),b.push({x1:j,y1:O,x2:E,y2:O}),b.push({x1:j,y1:k,x2:j,y2:S})}else if("horizontal"===r){var A=l.scale,P=s+t,T=P-n,C=P+n,I=A(d-m),D=A(d+y);b.push({x1:T,y1:D,x2:C,y2:D}),b.push({x1:P,y1:I,x2:P,y2:D}),b.push({x1:T,y1:I,x2:C,y2:I})}return f().createElement(Bo,zo({className:"recharts-errorBar",key:"bar-".concat(b.map((function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)})))},u),b.map((function(e){return f().createElement("line",zo({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))})))}));return f().createElement(Bo,{className:"recharts-errorBars"},p)}$o.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},$o.displayName="ErrorBar";var qo=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i]},Wo=["children","width","height","viewBox","className","style","title","desc"];function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uo.apply(this,arguments)}function Ho(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,a=e.style,c=e.title,l=e.desc,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Wo),u=i||{width:r,height:n,x:0,y:0},p=li()("recharts-surface",o);return f().createElement("svg",Uo({},Io(s,!0,"svg"),{className:p,width:r,height:n,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),f().createElement("title",null,c),f().createElement("desc",null,l),t)}function Go(e){return Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Go(e)}var Xo=["type","size","sizeType"];function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vo.apply(this,arguments)}function Ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ko(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Go(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Go(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Zo={symbolCircle:Xi.symbolCircle,symbolCross:Xi.symbolCross,symbolDiamond:Xi.symbolDiamond,symbolSquare:Xi.symbolSquare,symbolStar:Xi.symbolStar,symbolTriangle:Xi.symbolTriangle,symbolWye:Xi.symbolWye},Qo=Math.PI/180,Jo=function(e){var t,r,n=e.type,i=void 0===n?"circle":n,o=e.size,a=void 0===o?64:o,c=e.sizeType,l=void 0===c?"area":c,s=Yo(Yo({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Xo)),{},{type:i,size:a,sizeType:l}),u=s.className,p=s.cx,d=s.cy,h=Io(s,!0);return p===+p&&d===+d&&a===+a?f().createElement("path",Vo({},h,{className:li()("recharts-symbols",u),transform:"translate(".concat(p,", ").concat(d,")"),d:(t=function(e){var t="symbol".concat(to()(e));return Zo[t]||Xi.symbolCircle}(i),r=(0,Xi.symbol)().type(t).size(function(e,t,r){if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*Qo;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.pow(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}}(a,l,i)),r())})):null};function ea(e){return ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ea(e)}function ta(){return ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ta.apply(this,arguments)}function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ca(n.key),n)}}function ia(e,t){return ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ia(e,t)}function oa(e){return oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oa(e)}function aa(e,t,r){return(t=ca(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ca(e){var t=function(e,t){if("object"!==ea(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ea(t)?t:String(t)}Jo.registerSymbol=function(e,t){Zo["symbol".concat(to()(e))]=t};var la=32,sa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ia(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=oa(n);if(i){var r=oa(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ea(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,r=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,r=16,n=la/6,i=la/3,o=e.inactive?t:e.color;if("plainline"===e.type)return f().createElement("line",{strokeWidth:4,fill:"none",stroke:o,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:r,x2:la,y2:r,className:"recharts-legend-icon"});if("line"===e.type)return f().createElement("path",{strokeWidth:4,fill:"none",stroke:o,d:"M0,".concat(r,"h").concat(i,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*i,",").concat(r,"\n H").concat(la,"M").concat(2*i,",").concat(r,"\n A").concat(n,",").concat(n,",0,1,1,").concat(i,",").concat(r),className:"recharts-legend-icon"});if("rect"===e.type)return f().createElement("path",{stroke:"none",fill:o,d:"M0,".concat(4,"h").concat(la,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(f().isValidElement(e.legendIcon)){var a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){aa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);return delete a.legendIcon,f().cloneElement(e.legendIcon,a)}return f().createElement(Jo,{fill:o,cx:r,cy:r,size:la,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,r=t.payload,n=t.iconSize,i=t.layout,o=t.formatter,a=t.inactiveColor,c={x:0,y:0,width:la,height:la},l={display:"horizontal"===i?"inline-block":"block",marginRight:10},s={display:"inline-block",verticalAlign:"middle",marginRight:4};return r.map((function(t,r){var i,u=t.formatter||o,p=li()((aa(i={"recharts-legend-item":!0},"legend-item-".concat(r),!0),aa(i,"inactive",t.inactive),i));if("none"===t.type)return null;var d=Vn()(t.value)?null:t.value;qo(!Vn()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var h=t.inactive?a:t.color;return f().createElement("li",ta({className:p,style:l,key:"legend-item-".concat(r)},yo(e.props,t,r)),f().createElement(Ho,{width:n,height:n,viewBox:c,style:s},e.renderIcon(t)),f().createElement("span",{className:"recharts-legend-item-text",style:{color:h}},u?u(d,t,r):d))}))}},{key:"render",value:function(){var e=this.props,t=e.payload,r=e.layout,n=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:"horizontal"===r?n:"left"};return f().createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}],r&&na(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(d.PureComponent);aa(sa,"displayName","Legend"),aa(sa,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});const ua=require("lodash/uniqBy");var pa=r.n(ua);function da(e,t,r){return!0===t?pa()(e,r):Vn()(t)?pa()(e,t):e}function fa(e){return fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fa(e)}var ha=["ref"];function ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ma(Object(r),!0).forEach((function(t){wa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ma(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function va(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Oa(n.key),n)}}function ga(e,t){return ga=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ga(e,t)}function ba(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xa(e){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xa(e)}function wa(e,t,r){return(t=Oa(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oa(e){var t=function(e,t){if("object"!==fa(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==fa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===fa(t)?t:String(t)}function ka(e){return e.value}var Sa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ga(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xa(i);if(o){var r=xa(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===fa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ba(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return wa(ba(e=a.call.apply(a,[this].concat(r))),"lastBoundingBox",{width:-1,height:-1}),e}return t=c,n=[{key:"getWithHeight",value:function(e,t){var r=e.props.layout;return"vertical"===r&&Pi(e.props.height)?{height:e.props.height}:"horizontal"===r?{width:e.props.width||t}:null}}],(r=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ya({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,r,n=this.props,i=n.layout,o=n.align,a=n.verticalAlign,c=n.margin,l=n.chartWidth,s=n.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===o&&"vertical"===i?{left:((l||0)-this.getBBoxSnapshot().width)/2}:"right"===o?{right:c&&c.right||0}:{left:c&&c.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(r="middle"===a?{top:((s||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:c&&c.bottom||0}:{top:c&&c.top||0}),ya(ya({},t),r)}},{key:"render",value:function(){var e=this,t=this.props,r=t.content,n=t.width,i=t.height,o=t.wrapperStyle,a=t.payloadUniqBy,c=t.payload,l=ya(ya({position:"absolute",width:n||"auto",height:i||"auto"},this.getDefaultPosition(o)),o);return f().createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(t){e.wrapperNode=t}},function(e,t){if(f().isValidElement(e))return f().cloneElement(e,t);if("function"==typeof e)return f().createElement(e,t);t.ref;var r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,ha);return f().createElement(sa,r)}(r,ya(ya({},this.props),{},{payload:da(c,a,ka)})))}}])&&va(t.prototype,r),n&&va(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);function ja(e){return ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ja(e)}function Ea(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Aa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ea(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ja(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ja(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ja(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ea(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}wa(Sa,"displayName","Legend"),wa(Sa,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Pa=function(e){var t,r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,o=e.legendContent,a=Ao(r,Sa);return a?(t=a.props&&a.props.payload?a.props&&a.props.payload:"children"===o?(n||[]).reduce((function(e,t){var r=t.item,n=t.props,i=n.sectors||n.data||[];return e.concat(i.map((function(e){return{type:a.props.iconType||r.props.legendType,value:e.name,color:e.fill,payload:e}})))}),[]):(n||[]).map((function(e){var t=e.item,r=t.props,n=r.dataKey,i=r.name,o=r.legendType;return{inactive:r.hide,dataKey:n,type:a.props.iconType||o||"square",color:Ba(t),value:i||n,payload:t.props}})),Aa(Aa(Aa({},a.props),Sa.getWithHeight(a,i)),{},{payload:t,item:a})):null};function Ta(e){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(e)}function Ca(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(r),!0).forEach((function(t){Da(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ca(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Da(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Ta(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ta(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ta(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ma(e){return function(e){if(Array.isArray(e))return Na(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Na(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Na(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Na(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ra(e,t,r){return Gn()(e)||Gn()(t)?r:Ti(t)?Qn()(e,t,r):Vn()(t)?t(e):r}function _a(e,t,r,n){var i=Ji()(e,(function(e){return Ra(e,t)}));if("number"===r){var o=i.filter((function(e){return Pi(e)||parseFloat(e)}));return o.length?[Zi()(o),Ki()(o)]:[1/0,-1/0]}return(n?i.filter((function(e){return!Gn()(e)})):i).map((function(e){return Ti(e)||e instanceof Date?e:""}))}var Ba=function(e){var t,r=e.type.displayName,n=e.props,i=n.stroke,o=n.fill;switch(r){case"Line":t=i;break;case"Area":case"Radar":t=i&&"none"!==i?i:o;break;default:t=o}return t},La=function(e,t,r,n,i){var o=Eo(t.props.children,$o).filter((function(e){return function(e,t,r){return!!Gn()(t)||("horizontal"===e?"yAxis"===t:"vertical"===e||"x"===r?"xAxis"===t:"y"!==r||"yAxis"===t)}(n,i,e.props.direction)}));if(o&&o.length){var a=o.map((function(e){return e.props.dataKey}));return e.reduce((function(e,t){var n=Ra(t,r,0),i=Array.isArray(n)?[Zi()(n),Ki()(n)]:[n,n],o=a.reduce((function(e,r){var n=Ra(t,r,0),o=i[0]-Math.abs(Array.isArray(n)?n[0]:n),a=i[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(o,e[0]),Math.max(a,e[1])]}),[1/0,-1/0]);return[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}),[1/0,-1/0])}return null},za=function(e,t,r,n,i){var o=t.map((function(t){var o=t.props.dataKey;return"number"===r&&o&&La(e,t,o,n)||_a(e,o,r,i)}));if("number"===r)return o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]);var a={};return o.reduce((function(e,t){for(var r=0,n=t.length;r<n;r++)a[t[r]]||(a[t[r]]=!0,e.push(t[r]));return e}),[])},Fa=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},$a=function(e,t,r,n){if(n)return e.map((function(e){return e.coordinate}));var i,o,a=e.map((function(e){return e.coordinate===t&&(i=!0),e.coordinate===r&&(o=!0),e.coordinate}));return i||a.push(t),o||a.push(r),a},qa=function(e,t,r){if(!e)return null;var n=e.scale,i=e.duplicateDomain,o=e.type,a=e.range,c="scaleBand"===e.realScaleType?n.bandwidth()/2:2,l=(t||r)&&"category"===o&&n.bandwidth?n.bandwidth()/c:0;return l="angleAxis"===e.axisType&&(null==a?void 0:a.length)>=2?2*Ei(a[0]-a[1])*l:l,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map((function(e){var t=i?i.indexOf(e):e;return{coordinate:n(t)+l,value:e,offset:l}})).filter((function(e){return!ki()(e.coordinate)})):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map((function(e,t){return{coordinate:n(e)+l,value:e,index:t,offset:l}})):n.ticks&&!r?n.ticks(e.tickCount).map((function(e){return{coordinate:n(e)+l,value:e,offset:l}})):n.domain().map((function(e,t){return{coordinate:n(e)+l,value:i?i[e]:e,index:t,offset:l}}))},Wa=new WeakMap,Ua=function(e,t){if("function"!=typeof t)return e;Wa.has(e)||Wa.set(e,new WeakMap);var r=Wa.get(e);if(r.has(t))return r.get(t);var n=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return r.set(t,n),n},Ha=1e-4,Ga={sign:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0,a=0;a<t;++a){var c=ki()(e[a][r][1])?e[a][r][0]:e[a][r][1];c>=0?(e[a][r][0]=i,e[a][r][1]=i+c,i=e[a][r][1]):(e[a][r][0]=o,e[a][r][1]=o+c,o=e[a][r][1])}},expand:Xi.stackOffsetExpand,none:Xi.stackOffsetNone,silhouette:Xi.stackOffsetSilhouette,wiggle:Xi.stackOffsetWiggle,positive:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0;o<t;++o){var a=ki()(e[o][r][1])?e[o][r][0]:e[o][r][1];a>=0?(e[o][r][0]=i,e[o][r][1]=i+a,i=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}}},Xa=function(e,t,r){var n=t.map((function(e){return e.props.dataKey})),i=Ga[r];return(0,Xi.stack)().keys(n).value((function(e,t){return+Ra(e,t,0)})).order(Xi.stackOrderNone).offset(i)(e)},Va=function(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!Gn()(i[t.dataKey])){var c=Ri(r,"value",i[t.dataKey]);if(c)return c.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var l=Ra(i,Gn()(a)?t.dataKey:a);return Gn()(l)?null:t.scale(l)},Ka=function(e){var t=e.axis,r=e.ticks,n=e.offset,i=e.bandSize,o=e.entry,a=e.index;if("category"===t.type)return r[a]?r[a].coordinate+n:null;var c=Ra(o,t.dataKey,t.domain[a]);return Gn()(c)?null:t.scale(c)-i/2+n},Ya=function(e,t,r){return Object.keys(e).reduce((function(n,i){var o=e[i].stackedData.reduce((function(e,n){var i=n.slice(t,r+1).reduce((function(e,t){return[Zi()(t.concat([e[0]]).filter(Pi)),Ki()(t.concat([e[1]]).filter(Pi))]}),[1/0,-1/0]);return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]}),[1/0,-1/0]);return[Math.min(o[0],n[0]),Math.max(o[1],n[1])]}),[1/0,-1/0]).map((function(e){return e===1/0||e===-1/0?0:e}))},Za=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Qa=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ja=function(e,t,r){if(Vn()(e))return e(t,r);if(!Array.isArray(e))return t;var n=[];if(Pi(e[0]))n[0]=r?e[0]:Math.min(e[0],t[0]);else if(Za.test(e[0])){var i=+Za.exec(e[0])[1];n[0]=t[0]-i}else Vn()(e[0])?n[0]=e[0](t[0]):n[0]=t[0];if(Pi(e[1]))n[1]=r?e[1]:Math.max(e[1],t[1]);else if(Qa.test(e[1])){var o=+Qa.exec(e[1])[1];n[1]=t[1]+o}else Vn()(e[1])?n[1]=e[1](t[1]):n[1]=t[1];return n},ec=function(e,t,r){if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=ei()(t,(function(e){return e.coordinate})),o=1/0,a=1,c=i.length;a<c;a++){var l=i[a],s=i[a-1];o=Math.min((l.coordinate||0)-(s.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},tc=function(e,t,r){return e&&e.length?no()(e,Qn()(r,"type.defaultProps.domain"))?t:e:t},rc=function(e,t){var r=e.props,n=r.dataKey,i=r.name,o=r.unit,a=r.formatter,c=r.tooltipType,l=r.chartType;return Ia(Ia({},Io(e)),{},{dataKey:n,unit:o,formatter:a,name:i||n,color:Ba(e),value:Ra(t,n),type:c,payload:t,chartType:l})};const nc=require("react-smooth");var ic=r.n(nc),oc=function(e){return null};oc.displayName="Cell";const ac=require("lodash/last");var cc=r.n(ac);function lc(e){return lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lc(e)}function sc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==lc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==lc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===lc(i)?i:String(i)),n)}var i}var dc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,hc=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,mc=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,yc={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},vc=Object.keys(yc),gc="NaN",bc=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),""===r||hc.test(r)||(this.num=NaN,this.unit=""),vc.includes(r)&&(this.num=function(e,t){return e*yc[t]}(t,r),this.unit="px")}var t,r,n;return t=e,n=[{key:"parse",value:function(t){var r,n=sc(null!==(r=mc.exec(t))&&void 0!==r?r:[],3),i=n[1],o=n[2];return new e(parseFloat(i),null!=o?o:"")}}],(r=[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}])&&pc(t.prototype,r),n&&pc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function xc(e){if(e.includes(gc))return gc;for(var t=e;t.includes("*")||t.includes("/");){var r,n=sc(null!==(r=dc.exec(t))&&void 0!==r?r:[],4),i=n[1],o=n[2],a=n[3],c=bc.parse(null!=i?i:""),l=bc.parse(null!=a?a:""),s="*"===o?c.multiply(l):c.divide(l);if(s.isNaN())return gc;t=t.replace(dc,s.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,p=sc(null!==(u=fc.exec(t))&&void 0!==u?u:[],4),d=p[1],f=p[2],h=p[3],m=bc.parse(null!=d?d:""),y=bc.parse(null!=h?h:""),v="+"===f?m.add(y):m.subtract(y);if(v.isNaN())return gc;t=t.replace(fc,v.toString())}return t}var wc=/\(([^()]*)\)/;function Oc(e){var t=function(e){try{return function(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t=e;t.includes("(");){var r=sc(wc.exec(t),2)[1];t=t.replace(wc,xc(r))}return t}(t),xc(t)}(e)}catch(e){return gc}}(e.slice(5,-1));return t===gc?"":t}var kc=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Sc=["dx","dy","angle","className","breakAll"];function jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jc.apply(this,arguments)}function Ec(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ac(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Tc=/[ \f\n\r\t\v\u2028\u2029]+/,Cc=function(e){var t=e.children,r=e.breakAll,n=e.style;try{var i=[];return Gn()(t)||(i=r?t.toString().split(""):t.toString().split(Tc)),{wordsWithComputedWidth:i.map((function(e){return{word:e,width:Wi(e,n).width}})),spaceWidth:r?0:Wi(" ",n).width}}catch(e){return null}},Ic=function(e){return[{words:Gn()(e)?[]:e.toString().split(Tc)}]},Dc="#808080",Mc=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.lineHeight,a=void 0===o?"1em":o,c=e.capHeight,l=void 0===c?"0.71em":c,s=e.scaleToFit,u=void 0!==s&&s,p=e.textAnchor,h=void 0===p?"start":p,m=e.verticalAnchor,y=void 0===m?"end":m,v=e.fill,g=void 0===v?Dc:v,b=Ec(e,kc),x=(0,d.useMemo)((function(){return function(e){var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,a=e.maxLines;if((t||r)&&!_i.isSsr){var c=Cc({breakAll:o,children:n,style:i});return c?function(e,t,r,n,i){var o=e.maxLines,a=e.children,c=e.style,l=e.breakAll,s=Pi(o),u=a,p=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var o=t.word,a=t.width,c=e[e.length-1];if(c&&(null==n||i||c.width+a+r<Number(n)))c.words.push(o),c.width+=a+r;else{var l={words:[o],width:a};e.push(l)}return e}),[])},d=p(t);if(!s)return d;for(var f,h=function(e){var t=u.slice(0,e),r=Cc({breakAll:l,style:c,children:t+"…"}).wordsWithComputedWidth,i=p(r),a=i.length>o||function(e){return e.reduce((function(e,t){return e.width>t.width?e:t}))}(i).width>Number(n);return[a,i]},m=0,y=u.length-1,v=0;m<=y&&v<=u.length-1;){var g=Math.floor((m+y)/2),b=Ac(h(g-1),2),x=b[0],w=b[1],O=Ac(h(g),1)[0];if(x||O||(m=g+1),x&&O&&(y=g-1),!x&&O){f=w;break}v++}return f||d}({breakAll:o,children:n,maxLines:a,style:i},c.wordsWithComputedWidth,c.spaceWidth,t,r):Ic(n)}return Ic(n)}({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:u,style:b.style,width:b.width})}),[b.breakAll,b.children,b.maxLines,u,b.style,b.width]),w=b.dx,O=b.dy,k=b.angle,S=b.className,j=b.breakAll,E=Ec(b,Sc);if(!Ti(r)||!Ti(i))return null;var A,P=r+(Pi(w)?w:0),T=i+(Pi(O)?O:0);switch(y){case"start":A=Oc("calc(".concat(l,")"));break;case"middle":A=Oc("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:A=Oc("calc(".concat(x.length-1," * -").concat(a,")"))}var C=[];if(u){var I=x[0].width,D=b.width;C.push("scale(".concat((Pi(D)?D/I:1)/I,")"))}return k&&C.push("rotate(".concat(k,", ").concat(P,", ").concat(T,")")),C.length&&(E.transform=C.join(" ")),f().createElement("text",jc({},Io(E,!0),{x:P,y:T,className:li()("recharts-text",S),textAnchor:h,fill:g.includes("url")?Dc:g}),x.map((function(e,t){var r=e.words.join(j?"":" ");return f().createElement("tspan",{x:P,dy:0===t?A:a,key:r},r)})))};function Nc(e){return Nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nc(e)}var Rc=["offset"];function _c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Nc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Nc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Nc(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zc(){return zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zc.apply(this,arguments)}var Fc=function(e){var t=e.value,r=e.formatter,n=Gn()(e.children)?t:e.children;return Vn()(r)?r(n):n},$c=function(e,t,r){var n,i,o=e.position,a=e.viewBox,c=e.offset,l=e.className,s=a,u=s.cx,p=s.cy,d=s.innerRadius,h=s.outerRadius,m=s.startAngle,y=s.endAngle,v=s.clockWise,g=(d+h)/2,b=function(e,t){return Ei(t-e)*Math.min(Math.abs(t-e),360)}(m,y),x=b>=0?1:-1;"insideStart"===o?(n=m+x*c,i=v):"insideEnd"===o?(n=y-x*c,i=!v):"end"===o&&(n=y+x*c,i=v),i=b<=0?i:!i;var w=yi(u,p,g,n),O=yi(u,p,g,n+359*(i?1:-1)),k="M".concat(w.x,",").concat(w.y,"\n A").concat(g,",").concat(g,",0,1,").concat(i?0:1,",\n ").concat(O.x,",").concat(O.y),S=Gn()(e.id)?Ii("recharts-radial-line-"):e.id;return f().createElement("text",zc({},r,{dominantBaseline:"central",className:li()("recharts-radial-bar-label",l)}),f().createElement("defs",null,f().createElement("path",{id:S,d:k})),f().createElement("textPath",{xlinkHref:"#".concat(S)},t))},qc=function(e){var t=e.viewBox,r=e.offset,n=e.position,i=t,o=i.cx,a=i.cy,c=i.innerRadius,l=i.outerRadius,s=(i.startAngle+i.endAngle)/2;if("outside"===n){var u=yi(o,a,l+r,s),p=u.x;return{x:p,y:u.y,textAnchor:p>=o?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=yi(o,a,(c+l)/2,s);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}},Wc=function(e){var t=e.viewBox,r=e.parentViewBox,n=e.offset,i=e.position,o=t,a=o.x,c=o.y,l=o.width,s=o.height,u=s>=0?1:-1,p=u*n,d=u>0?"end":"start",f=u>0?"start":"end",h=l>=0?1:-1,m=h*n,y=h>0?"end":"start",v=h>0?"start":"end";if("top"===i)return Lc(Lc({},{x:a+l/2,y:c-u*n,textAnchor:"middle",verticalAnchor:d}),r?{height:Math.max(c-r.y,0),width:l}:{});if("bottom"===i)return Lc(Lc({},{x:a+l/2,y:c+s+p,textAnchor:"middle",verticalAnchor:f}),r?{height:Math.max(r.y+r.height-(c+s),0),width:l}:{});if("left"===i){var g={x:a-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"};return Lc(Lc({},g),r?{width:Math.max(g.x-r.x,0),height:s}:{})}if("right"===i){var b={x:a+l+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"};return Lc(Lc({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:s}:{})}var x=r?{width:l,height:s}:{};return"insideLeft"===i?Lc({x:a+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"},x):"insideRight"===i?Lc({x:a+l-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"},x):"insideTop"===i?Lc({x:a+l/2,y:c+p,textAnchor:"middle",verticalAnchor:f},x):"insideBottom"===i?Lc({x:a+l/2,y:c+s-p,textAnchor:"middle",verticalAnchor:d},x):"insideTopLeft"===i?Lc({x:a+m,y:c+p,textAnchor:v,verticalAnchor:f},x):"insideTopRight"===i?Lc({x:a+l-m,y:c+p,textAnchor:y,verticalAnchor:f},x):"insideBottomLeft"===i?Lc({x:a+m,y:c+s-p,textAnchor:v,verticalAnchor:d},x):"insideBottomRight"===i?Lc({x:a+l-m,y:c+s-p,textAnchor:y,verticalAnchor:d},x):ao()(i)&&(Pi(i.x)||Ai(i.x))&&(Pi(i.y)||Ai(i.y))?Lc({x:a+Di(i.x,l),y:c+Di(i.y,s),textAnchor:"end",verticalAnchor:"end"},x):Lc({x:a+l/2,y:c+s/2,textAnchor:"middle",verticalAnchor:"middle"},x)},Uc=function(e){return"cx"in e&&Pi(e.cx)};function Hc(e){var t,r=e.offset,n=Lc({offset:void 0===r?5:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Rc)),i=n.viewBox,o=n.position,a=n.value,c=n.children,l=n.content,s=n.className,u=void 0===s?"":s,p=n.textBreakAll;if(!i||Gn()(a)&&Gn()(c)&&!(0,d.isValidElement)(l)&&!Vn()(l))return null;if((0,d.isValidElement)(l))return(0,d.cloneElement)(l,n);if(Vn()(l)){if(t=(0,d.createElement)(l,n),(0,d.isValidElement)(t))return t}else t=Fc(n);var h=Uc(i),m=Io(n,!0);if(h&&("insideStart"===o||"insideEnd"===o||"end"===o))return $c(n,t,m);var y=h?qc(n):Wc(n);return f().createElement(Mc,zc({className:li()("recharts-label",u)},m,y,{breakAll:p}),t)}Hc.displayName="Label";var Gc=function(e){var t=e.cx,r=e.cy,n=e.angle,i=e.startAngle,o=e.endAngle,a=e.r,c=e.radius,l=e.innerRadius,s=e.outerRadius,u=e.x,p=e.y,d=e.top,f=e.left,h=e.width,m=e.height,y=e.clockWise,v=e.labelViewBox;if(v)return v;if(Pi(h)&&Pi(m)){if(Pi(u)&&Pi(p))return{x:u,y:p,width:h,height:m};if(Pi(d)&&Pi(f))return{x:d,y:f,width:h,height:m}}return Pi(u)&&Pi(p)?{x:u,y:p,width:0,height:0}:Pi(t)&&Pi(r)?{cx:t,cy:r,startAngle:i||n||0,endAngle:o||n||0,innerRadius:l||0,outerRadius:s||c||a||0,clockWise:y}:e.viewBox?e.viewBox:{}};function Xc(e){return Xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xc(e)}Hc.parseViewBox=Gc,Hc.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Gc(e),o=Eo(n,Hc).map((function(e,r){return(0,d.cloneElement)(e,{viewBox:t||i,key:"label-".concat(r)})}));if(!r)return o;var a,c=function(e,t){return e?!0===e?f().createElement(Hc,{key:"label-implicit",viewBox:t}):Ti(e)?f().createElement(Hc,{key:"label-implicit",viewBox:t,value:e}):(0,d.isValidElement)(e)?e.type===Hc?(0,d.cloneElement)(e,{key:"label-implicit",viewBox:t}):f().createElement(Hc,{key:"label-implicit",content:e,viewBox:t}):Vn()(e)?f().createElement(Hc,{key:"label-implicit",content:e,viewBox:t}):ao()(e)?f().createElement(Hc,zc({viewBox:t},e,{key:"label-implicit"})):null:null}(e.label,t||i);return[c].concat(function(e){if(Array.isArray(e))return _c(e)}(a=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return _c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_c(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())};var Vc=["valueAccessor"],Kc=["data","dataKey","clockWise","id","textBreakAll"];function Yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zc(){return Zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zc.apply(this,arguments)}function Qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Xc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Xc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Xc(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function el(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var tl=function(e){return Array.isArray(e.value)?cc()(e.value):e.value};function rl(e){var t=e.valueAccessor,r=void 0===t?tl:t,n=el(e,Vc),i=n.data,o=n.dataKey,a=n.clockWise,c=n.id,l=n.textBreakAll,s=el(n,Kc);return i&&i.length?f().createElement(Bo,{className:"recharts-label-list"},i.map((function(e,t){var n=Gn()(o)?r(e,t):Ra(e&&e.payload,o),i=Gn()(c)?{}:{id:"".concat(c,"-").concat(t)};return f().createElement(Hc,Zc({},Io(e,!0),s,i,{parentViewBox:e.parentViewBox,value:n,textBreakAll:l,viewBox:Hc.parseViewBox(Gn()(a)?e:Jc(Jc({},e),{},{clockWise:a})),key:"label-".concat(t),index:t}))}))):null}rl.displayName="LabelList",rl.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n,i=Eo(e.children,rl).map((function(e,r){return(0,d.cloneElement)(e,{data:t,key:"labelList-".concat(r)})}));return r?[function(e,t){return e?!0===e?f().createElement(rl,{key:"labelList-implicit",data:t}):f().isValidElement(e)||Vn()(e)?f().createElement(rl,{key:"labelList-implicit",data:t,content:e}):ao()(e)?f().createElement(rl,Zc({data:t},e,{key:"labelList-implicit"})):null:null}(e.label,t)].concat(function(e){if(Array.isArray(e))return Yc(e)}(n=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return Yc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yc(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i};const nl=require("lodash/isPlainObject");var il=r.n(nl);const ol=require("lodash/isBoolean");var al=r.n(ol);function cl(e){return cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cl(e)}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)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ll.apply(this,arguments)}function sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ul(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ul(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==cl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===cl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ul(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dl=function(e,t,r,n,i){var o,a=Math.min(Math.abs(r)/2,Math.abs(n)/2),c=n>=0?1:-1,l=r>=0?1:-1,s=n>=0&&r>=0||n<0&&r<0?1:0;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],p=0;p<4;p++)u[p]=i[p]>a?a:i[p];o="M".concat(e,",").concat(t+c*u[0]),u[0]>0&&(o+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(s,",").concat(e+l*u[0],",").concat(t)),o+="L ".concat(e+r-l*u[1],",").concat(t),u[1]>0&&(o+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(s,",\n ").concat(e+r,",").concat(t+c*u[1])),o+="L ".concat(e+r,",").concat(t+n-c*u[2]),u[2]>0&&(o+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(s,",\n ").concat(e+r-l*u[2],",").concat(t+n)),o+="L ".concat(e+l*u[3],",").concat(t+n),u[3]>0&&(o+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(s,",\n ").concat(e,",").concat(t+n-c*u[3])),o+="Z"}else if(a>0&&i===+i&&i>0){var d=Math.min(a,i);o="M ".concat(e,",").concat(t+c*d,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e+l*d,",").concat(t,"\n L ").concat(e+r-l*d,",").concat(t,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e+r,",").concat(t+c*d,"\n L ").concat(e+r,",").concat(t+n-c*d,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e+r-l*d,",").concat(t+n,"\n L ").concat(e+l*d,",").concat(t+n,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e,",").concat(t+n-c*d," Z")}else o="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return o},fl=function(e,t){if(!e||!t)return!1;var r=e.x,n=e.y,i=t.x,o=t.y,a=t.width,c=t.height;if(Math.abs(a)>0&&Math.abs(c)>0){var l=Math.min(i,i+a),s=Math.max(i,i+a),u=Math.min(o,o+c),p=Math.max(o,o+c);return r>=l&&r<=s&&n>=u&&n<=p}return!1},hl={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ml=function(e){var t,r,n=pl(pl({},hl),e),i=(0,d.useRef)(),o=(t=(0,d.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return sl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sl(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,d.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.width,p=n.height,h=n.radius,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||0===u||0===p)return null;var w=li()("recharts-rectangle",m);return x?f().createElement(ic(),{canBegin:a>0,from:{width:u,height:p,x:l,y:s},to:{width:u,height:p,x:l,y:s},duration:v,animationEasing:y,isActive:x},(function(e){var t=e.width,r=e.height,o=e.x,c=e.y;return f().createElement(ic(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:b,easing:y},f().createElement("path",ll({},Io(n,!0),{className:w,d:dl(o,c,t,r,h),ref:i})))})):f().createElement("path",ll({},Io(n,!0),{className:w,d:dl(l,s,u,p,h)}))};function yl(e){return yl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yl(e)}function vl(){return vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vl.apply(this,arguments)}function gl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==yl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==yl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wl=function(e,t,r,n,i){var o,a=r-n;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+r,",").concat(t),o+="L ".concat(e+r-a/2,",").concat(t+i),(o+="L ".concat(e+r-a/2-n,",").concat(t+i))+"L ".concat(e,",").concat(t," Z")},Ol={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},kl=function(e){var t,r,n=xl(xl({},Ol),e),i=(0,d.useRef)(),o=(t=(0,d.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return gl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gl(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,d.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.upperWidth,p=n.lowerWidth,h=n.height,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||h!==+h||0===u&&0===p||0===h)return null;var x=li()("recharts-trapezoid",m);return b?f().createElement(ic(),{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:s},to:{upperWidth:u,lowerWidth:p,height:h,x:l,y:s},duration:v,animationEasing:y,isActive:b},(function(e){var t=e.upperWidth,r=e.lowerWidth,o=e.height,c=e.x,l=e.y;return f().createElement(ic(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},f().createElement("path",vl({},Io(n,!0),{className:x,d:wl(c,l,t,r,o),ref:i})))})):f().createElement("g",null,f().createElement("path",vl({},Io(n,!0),{className:x,d:wl(l,s,u,p,h)})))};function Sl(e){return Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sl(e)}function jl(){return jl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jl.apply(this,arguments)}function El(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Al(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?El(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Sl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Sl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Sl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):El(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pl=function(e){var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,a=e.isExternal,c=e.cornerRadius,l=e.cornerIsExternal,s=c*(a?1:-1)+n,u=Math.asin(c/s)/hi,p=l?i:i+o*u,d=l?i-o*u:i;return{center:yi(t,r,s,p),circleTangency:yi(t,r,n,p),lineTangency:yi(t,r,s*Math.cos(u*hi),d),theta:u}},Tl=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,a=function(e,t){return Ei(t-e)*Math.min(Math.abs(t-e),359.999)}(o,e.endAngle),c=o+a,l=yi(t,r,i,o),s=yi(t,r,i,c),u="M ".concat(l.x,",").concat(l.y,"\n A ").concat(i,",").concat(i,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o>c),",\n ").concat(s.x,",").concat(s.y,"\n ");if(n>0){var p=yi(t,r,n,o),d=yi(t,r,n,c);u+="L ".concat(d.x,",").concat(d.y,"\n A ").concat(n,",").concat(n,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o<=c),",\n ").concat(p.x,",").concat(p.y," Z")}else u+="L ".concat(t,",").concat(r," Z");return u},Cl={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Il=function(e){var t=Al(Al({},Cl),e),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,a=t.cornerRadius,c=t.forceCornerRadius,l=t.cornerIsExternal,s=t.startAngle,u=t.endAngle,p=t.className;if(o<i||s===u)return null;var d,h=li()("recharts-sector",p),m=o-i,y=Di(a,m,0,!0);return d=y>0&&Math.abs(s-u)<360?function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,a=e.forceCornerRadius,c=e.cornerIsExternal,l=e.startAngle,s=e.endAngle,u=Ei(s-l),p=Pl({cx:t,cy:r,radius:i,angle:l,sign:u,cornerRadius:o,cornerIsExternal:c}),d=p.circleTangency,f=p.lineTangency,h=p.theta,m=Pl({cx:t,cy:r,radius:i,angle:s,sign:-u,cornerRadius:o,cornerIsExternal:c}),y=m.circleTangency,v=m.lineTangency,g=m.theta,b=c?Math.abs(l-s):Math.abs(l-s)-h-g;if(b<0)return a?"M ".concat(f.x,",").concat(f.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(2*-o,",0\n "):Tl({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:s});var x="M ".concat(f.x,",").concat(f.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(d.x,",").concat(d.y,"\n A").concat(i,",").concat(i,",0,").concat(+(b>180),",").concat(+(u<0),",").concat(y.x,",").concat(y.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(v.x,",").concat(v.y,"\n ");if(n>0){var w=Pl({cx:t,cy:r,radius:n,angle:l,sign:u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),O=w.circleTangency,k=w.lineTangency,S=w.theta,j=Pl({cx:t,cy:r,radius:n,angle:s,sign:-u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=j.circleTangency,A=j.lineTangency,P=j.theta,T=c?Math.abs(l-s):Math.abs(l-s)-S-P;if(T<0&&0===o)return"".concat(x,"L").concat(t,",").concat(r,"Z");x+="L".concat(A.x,",").concat(A.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(E.x,",").concat(E.y,"\n A").concat(n,",").concat(n,",0,").concat(+(T>180),",").concat(+(u>0),",").concat(O.x,",").concat(O.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(k.x,",").concat(k.y,"Z")}else x+="L".concat(t,",").concat(r,"Z");return x}({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,m/2),forceCornerRadius:c,cornerIsExternal:l,startAngle:s,endAngle:u}):Tl({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:s,endAngle:u}),f().createElement("path",jl({},Io(t,!0),{className:h,d,role:"img"}))},Dl=["option","shapeType","propTransformer","activeClassName","isActive"];function Ml(e){return Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ml(e)}function Nl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ml(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ml(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ml(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _l(e,t){return Rl(Rl({},t),e)}function Bl(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return f().createElement(ml,r);case"trapezoid":return f().createElement(kl,r);case"sector":return f().createElement(Il,r);case"symbols":if(function(e,t){return"symbols"===e}(t))return f().createElement(Jo,r);break;default:return null}}function Ll(e){var t,r=e.option,n=e.shapeType,i=e.propTransformer,o=void 0===i?_l:i,a=e.activeClassName,c=void 0===a?"recharts-active-shape":a,l=e.isActive,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Dl);if((0,d.isValidElement)(r))t=(0,d.cloneElement)(r,Rl(Rl({},s),function(e){return(0,d.isValidElement)(e)?e.props:e}(r)));else if(Vn()(r))t=r(s);else if(il()(r)&&!al()(r)){var u=o(r,s);t=f().createElement(Bl,{shapeType:n,elementProps:u})}else{var p=s;t=f().createElement(Bl,{shapeType:n,elementProps:p})}return l?f().createElement(Bo,{className:c},t):t}function zl(e,t){return null!=t&&"trapezoids"in e.props}function Fl(e,t){return null!=t&&"sectors"in e.props}function $l(e,t){return null!=t&&"points"in e.props}function ql(e,t){var r,n,i=e.x===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.x)||e.x===t.x,o=e.y===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.y)||e.y===t.y;return i&&o}function Wl(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Ul(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function Hl(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=function(e,t){var r;return zl(e,t)?r="trapezoids":Fl(e,t)?r="sectors":$l(e,t)&&(r="points"),r}(r,t),o=function(e,t){var r,n;return zl(e,t)?null===(r=t.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:Fl(e,t)?null===(n=t.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:$l(e,t)?t.payload:{}}(r,t),a=n.filter((function(e,n){var a=no()(o,e),c=r.props[i].filter((function(e){var n=function(e,t){var r;return zl(e,t)?r=ql:Fl(e,t)?r=Wl:$l(e,t)&&(r=Ul),r}(r,t);return n(e,t)})),l=r.props[i].indexOf(c[c.length-1]);return a&&n===l}));return n.indexOf(a[a.length-1])}function Gl(e){return Gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gl(e)}var Xl=["x","y"];function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vl.apply(this,arguments)}function Kl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Gl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Gl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Gl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zl(e,t){var r=e.x,n=e.y,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Xl),o="".concat(r),a=parseInt(o,10),c="".concat(n),l=parseInt(c,10),s="".concat(t.height||i.height),u=parseInt(s,10),p="".concat(t.width||i.width),d=parseInt(p,10);return Yl(Yl(Yl(Yl(Yl({},t),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:t.name,radius:t.radius})}function Ql(e){return f().createElement(Ll,Vl({shapeType:"rectangle",propTransformer:Zl,activeClassName:"recharts-active-bar"},e))}var Jl=["value","background"];function es(e){return es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},es(e)}function ts(){return ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ts.apply(this,arguments)}function rs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ns(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rs(Object(r),!0).forEach((function(t){ls(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function is(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ss(n.key),n)}}function os(e,t){return os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},os(e,t)}function as(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cs(e){return cs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cs(e)}function ls(e,t,r){return(t=ss(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ss(e){var t=function(e,t){if("object"!==es(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==es(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===es(t)?t:String(t)}var us=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&os(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cs(i);if(o){var r=cs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===es(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return as(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ls(as(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!1}),ls(as(e),"id",Ii("recharts-bar-")),ls(as(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()})),ls(as(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],(r=[{key:"renderRectanglesStatically",value:function(e){var t=this,r=this.props,n=r.shape,i=r.dataKey,o=r.activeIndex,a=r.activeBar,c=Io(this.props);return e&&e.map((function(e,r){var l=r===o,s=l?a:n,u=ns(ns(ns({},c),e),{},{isActive:l,option:s,index:r,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return f().createElement(Bo,ts({className:"recharts-bar-rectangle"},yo(t.props,e,r),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),f().createElement(Ql,u))}))}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,r=t.data,n=t.layout,i=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,c=t.animationEasing,l=t.animationId,s=this.state.prevData;return f().createElement(ic(),{begin:o,duration:a,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(l),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(t){var i=t.t,o=r.map((function(e,t){var r=s&&s[t];if(r){var o=Ni(r.x,e.x),a=Ni(r.y,e.y),c=Ni(r.width,e.width),l=Ni(r.height,e.height);return ns(ns({},e),{},{x:o(i),y:a(i),width:c(i),height:l(i)})}if("horizontal"===n){var u=Ni(0,e.height)(i);return ns(ns({},e),{},{y:e.y+e.height-u,height:u})}var p=Ni(0,e.width)(i);return ns(ns({},e),{},{width:p})}));return f().createElement(Bo,null,e.renderRectanglesStatically(o))}))}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,r=e.isAnimationActive,n=this.state.prevData;return!(r&&t&&t.length)||n&&no()(n,t)?this.renderRectanglesStatically(t):this.renderRectanglesWithAnimation()}},{key:"renderBackground",value:function(){var e=this,t=this.props,r=t.data,n=t.dataKey,i=t.activeIndex,o=Io(this.props.background);return r.map((function(t,r){t.value;var a=t.background,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,Jl);if(!a)return null;var l=ns(ns(ns(ns(ns({},c),{},{fill:"#eee"},a),o),yo(e.props,t,r)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:n,index:r,key:"background-bar-".concat(r),className:"recharts-bar-background-rectangle"});return f().createElement(Ql,ts({option:e.props.background,isActive:r===i},l))}))}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.data,i=r.xAxis,o=r.yAxis,a=r.layout,c=Eo(r.children,$o);if(!c)return null;var l="vertical"===a?n[0].height/2:n[0].width/2,s=function(e,t){var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:Ra(e,t)}},u={clipPath:e?"url(#clipPath-".concat(t,")"):null};return f().createElement(Bo,u,c.map((function(e){return f().cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,offset:l,dataPointFormatter:s})})))}},{key:"render",value:function(){var e=this.props,t=e.hide,r=e.data,n=e.className,i=e.xAxis,o=e.yAxis,a=e.left,c=e.top,l=e.width,s=e.height,u=e.isAnimationActive,p=e.background,d=e.id;if(t||!r||!r.length)return null;var h=this.state.isAnimationFinished,m=li()("recharts-bar",n),y=i&&i.allowDataOverflow,v=o&&o.allowDataOverflow,g=y||v,b=Gn()(d)?this.id:d;return f().createElement(Bo,{className:m},y||v?f().createElement("defs",null,f().createElement("clipPath",{id:"clipPath-".concat(b)},f().createElement("rect",{x:y?a:a-l/2,y:v?c:c-s/2,width:y?l:2*l,height:v?s:2*s}))):null,f().createElement(Bo,{className:"recharts-bar-rectangles",clipPath:g?"url(#clipPath-".concat(b,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(g,b),(!u||h)&&rl.renderCallByParent(this.props,r))}}])&&is(t.prototype,r),n&&is(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);function ps(e){return ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ps(e)}function ds(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ys(n.key),n)}}function fs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fs(Object(r),!0).forEach((function(t){ms(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ms(e,t,r){return(t=ys(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ys(e){var t=function(e,t){if("object"!==ps(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ps(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ps(t)?t:String(t)}ls(us,"displayName","Bar"),ls(us,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!_i.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),ls(us,"getComposedData",(function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,o=e.xAxis,a=e.yAxis,c=e.xAxisTicks,l=e.yAxisTicks,s=e.stackedData,u=e.dataStartIndex,p=e.displayedData,d=e.offset,f=function(e,t){if(!e)return null;for(var r=0,n=e.length;r<n;r++)if(e[r].item===t)return e[r].position;return null}(n,r);if(!f)return null;var h=t.layout,m=r.props,y=m.dataKey,v=m.children,g=m.minPointSize,b="horizontal"===h?a:o,x=s?b.scale.domain():null,w=function(e){var t=e.numericAxis,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]}({numericAxis:b}),O=Eo(v,oc),k=p.map((function(e,t){var n,p,d,m,v,b;if(s?n=function(e,t){if(!t||2!==t.length||!Pi(t[0])||!Pi(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Pi(e[0])||e[0]<r)&&(i[0]=r),(!Pi(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i}(s[u+t],x):(n=Ra(e,y),Array.isArray(n)||(n=[w,n])),"horizontal"===h){var k,S=[a.scale(n[0]),a.scale(n[1])],j=S[0],E=S[1];p=Ka({axis:o,ticks:c,bandSize:i,offset:f.offset,entry:e,index:t}),d=null!==(k=null!=E?E:j)&&void 0!==k?k:void 0,m=f.size;var A=j-E;if(v=Number.isNaN(A)?0:A,b={x:p,y:a.y,width:m,height:a.height},Math.abs(g)>0&&Math.abs(v)<Math.abs(g)){var P=Ei(v||g)*(Math.abs(g)-Math.abs(v));d-=P,v+=P}}else{var T=[o.scale(n[0]),o.scale(n[1])],C=T[0],I=T[1];p=C,d=Ka({axis:a,ticks:l,bandSize:i,offset:f.offset,entry:e,index:t}),m=I-C,v=f.size,b={x:o.x,y:d,width:o.width,height:v},Math.abs(g)>0&&Math.abs(m)<Math.abs(g)&&(m+=Ei(m||g)*(Math.abs(g)-Math.abs(m)))}return ns(ns(ns({},e),{},{x:p,y:d,width:m,height:v,value:s?n:n[1],payload:e,background:b},O&&O[t]&&O[t].props),{},{tooltipPayload:[rc(r,e)],tooltipPosition:{x:p+m/2,y:d+v/2}})}));return ns({data:k,layout:h},d)}));var vs=function(e,t,r,n,i){var o=e.width,a=e.height,c=e.layout,l=e.children,s=Object.keys(t),u={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:a-r.bottom,bottomMirror:a-r.bottom},p=!!Ao(l,us);return s.reduce((function(o,a){var l,s,d,f,h,m=t[a],y=m.orientation,v=m.domain,g=m.padding,b=void 0===g?{}:g,x=m.mirror,w=m.reversed,O="".concat(y).concat(x?"Mirror":"");if("number"===m.type&&("gap"===m.padding||"no-gap"===m.padding)){var k=v[1]-v[0],S=1/0,j=m.categoricalDomain.sort();j.forEach((function(e,t){t>0&&(S=Math.min((e||0)-(j[t-1]||0),S))}));var E=S/k,A="vertical"===m.layout?r.height:r.width;if("gap"===m.padding&&(l=E*A/2),"no-gap"===m.padding){var P=Di(e.barCategoryGap,E*A),T=E*A/2;l=T-P-(T-P)/A*P}}s="xAxis"===n?[r.left+(b.left||0)+(l||0),r.left+r.width-(b.right||0)-(l||0)]:"yAxis"===n?"horizontal"===c?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(l||0),r.top+r.height-(b.bottom||0)-(l||0)]:m.range,w&&(s=[s[1],s[0]]);var C=function(e,t,r){var n=e.scale,i=e.type,o=e.layout,a=e.axisType;if("auto"===n)return"radial"===o&&"radiusAxis"===a?{scale:Gi.scaleBand(),realScaleType:"band"}:"radial"===o&&"angleAxis"===a?{scale:Gi.scaleLinear(),realScaleType:"linear"}:"category"===i&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!r)?{scale:Gi.scalePoint(),realScaleType:"point"}:"category"===i?{scale:Gi.scaleBand(),realScaleType:"band"}:{scale:Gi.scaleLinear(),realScaleType:"linear"};if(wi()(n)){var c="scale".concat(to()(n));return{scale:(Gi[c]||Gi.scalePoint)(),realScaleType:Gi[c]?c:"point"}}return Vn()(n)?{scale:n}:{scale:Gi.scalePoint(),realScaleType:"point"}}(m,i,p),I=C.scale,D=C.realScaleType;I.domain(v).range(s),function(e){var t=e.domain();if(t&&!(t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-Ha,o=Math.max(n[0],n[1])+Ha,a=e(t[0]),c=e(t[r-1]);(a<i||a>o||c<i||c>o)&&e.domain([t[0],t[r-1]])}}(I);var M=function(e,t){var r=t.realScaleType,n=t.type,i=t.tickCount,o=t.originalDomain,a=t.allowDecimals,c=r||t.scale;if("auto"!==c&&"linear"!==c)return null;if(i&&"number"===n&&o&&("auto"===o[0]||"auto"===o[1])){var l=e.domain();if(!l.length)return null;var s=(0,io.getNiceTickValues)(l,i,a);return e.domain([Zi()(s),Ki()(s)]),{niceTicks:s}}if(i&&"number"===n){var u=e.domain();return{niceTicks:(0,io.getTickValuesFixedDomain)(u,i,a)}}return null}(I,hs(hs({},m),{},{realScaleType:D}));"xAxis"===n?(h="top"===y&&!x||"bottom"===y&&x,d=r.left,f=u[O]-h*m.height):"yAxis"===n&&(h="left"===y&&!x||"right"===y&&x,d=u[O]-h*m.width,f=r.top);var N=hs(hs(hs({},m),M),{},{realScaleType:D,x:d,y:f,scale:I,width:"xAxis"===n?r.width:m.width,height:"yAxis"===n?r.height:m.height});return N.bandSize=ec(N,M),m.hide||"xAxis"!==n?m.hide||(u[O]+=(h?-1:1)*N.width):u[O]+=(h?-1:1)*N.height,hs(hs({},o),{},ms({},a,N))}),{})},gs=function(e,t){var r=e.x,n=e.y,i=t.x,o=t.y;return{x:Math.min(r,i),y:Math.min(n,o),width:Math.abs(i-r),height:Math.abs(o-n)}},bs=function(e){var t=e.x1,r=e.y1,n=e.x2,i=e.y2;return gs({x:t,y:r},{x:n,y:i})},xs=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scale=t}var t,r,n;return t=e,r=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.bandAware,n=t.position;if(void 0!==e){if(n)switch(n){case"start":default:return this.scale(e);case"middle":var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(e)+o}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),r=t[0],n=t[t.length-1];return r<=n?e>=r&&e<=n:e>=n&&e<=r}}],n=[{key:"create",value:function(t){return new e(t)}}],r&&ds(t.prototype,r),n&&ds(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();ms(xs,"EPS",1e-4);var ws=function(e){var t=Object.keys(e).reduce((function(t,r){return hs(hs({},t),{},ms({},r,xs.create(e[r])))}),{});return hs(hs({},t),{},{apply:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,i=r.position;return Hi()(e,(function(e,r){return t[r].apply(e,{bandAware:n,position:i})}))},isInRange:function(e){return ai()(e,(function(e,r){return t[r].isInRange(e)}))}})};function Os(e,t,r){if(t<1)return[];if(1===t&&void 0===r)return e;for(var n=[],i=0;i<e.length;i+=t){if(void 0!==r&&!0!==r(e[i]))return;n.push(e[i])}return n}function ks(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function Ss(e){return Ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ss(e)}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Es(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?js(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ss(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ss(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ss(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):js(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function As(e,t,r){var n=e.tick,i=e.ticks,o=e.viewBox,a=e.minTickGap,c=e.orientation,l=e.interval,s=e.tickFormatter,u=e.unit,p=e.angle;if(!i||!i.length||!n)return[];if(Pi(l)||_i.isSsr)return function(e,t){return Os(e,t+1)}(i,"number"==typeof l&&Pi(l)?l:0);var d=[],f="top"===c||"bottom"===c?"width":"height",h=u&&"width"===f?Wi(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(e,n){var i=Vn()(s)?s(e.value,n):e.value;return"width"===f?function(e,t,r){return function(e){var t=e.width,r=e.height,n=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)%180+180)%180*Math.PI/180,i=Math.atan(r/t),o=n>i&&n<Math.PI-i?r/Math.sin(n):t/Math.cos(n);return Math.abs(o)}({width:e.width+t.width,height:e.height+t.height},r)}(Wi(i,{fontSize:t,letterSpacing:r}),h,p):Wi(i,{fontSize:t,letterSpacing:r})[f]},y=i.length>=2?Ei(i[1].coordinate-i[0].coordinate):1,v=function(e,t,r){var n="width"===r,i=e.x,o=e.y,a=e.width,c=e.height;return 1===t?{start:n?i:o,end:n?i+a:o+c}:{start:n?i+a:o+c,end:n?i:o}}(o,y,f);return"equidistantPreserveStart"===l?function(e,t,r,n,i){for(var o,a=(n||[]).slice(),c=t.start,l=t.end,s=0,u=1,p=c,d=function(){var t=null==n?void 0:n[s];if(void 0===t)return{v:Os(n,u)};var o,a=s,d=function(){return void 0===o&&(o=r(t,a)),o},f=t.coordinate,h=0===s||ks(e,f,d,p,l);h||(s=0,p=c,u+=1),h&&(p=f+e*(d()/2+i),s+=u)};u<=a.length;)if(o=d())return o.v;return[]}(y,v,m,i,a):(d="preserveStart"===l||"preserveStartEnd"===l?function(e,t,r,n,i,o){var a=(n||[]).slice(),c=a.length,l=t.start,s=t.end;if(o){var u=n[c-1],p=r(u,c-1),d=e*(u.coordinate+e*p/2-s);a[c-1]=u=Es(Es({},u),{},{tickCoord:d>0?u.coordinate-d*e:u.coordinate}),ks(e,u.tickCoord,(function(){return p}),l,s)&&(s=u.tickCoord-e*(p/2+i),a[c-1]=Es(Es({},u),{},{isShow:!0}))}for(var f=o?c-1:c,h=function(t){var n,o=a[t],c=function(){return void 0===n&&(n=r(o,t)),n};if(0===t){var u=e*(o.coordinate-e*c()/2-l);a[t]=o=Es(Es({},o),{},{tickCoord:u<0?o.coordinate-u*e:o.coordinate})}else a[t]=o=Es(Es({},o),{},{tickCoord:o.coordinate});ks(e,o.tickCoord,c,l,s)&&(l=o.tickCoord+e*(c()/2+i),a[t]=Es(Es({},o),{},{isShow:!0}))},m=0;m<f;m++)h(m);return a}(y,v,m,i,a,"preserveStartEnd"===l):function(e,t,r,n,i){for(var o=(n||[]).slice(),a=o.length,c=t.start,l=t.end,s=function(t){var n,s=o[t],u=function(){return void 0===n&&(n=r(s,t)),n};if(t===a-1){var p=e*(s.coordinate+e*u()/2-l);o[t]=s=Es(Es({},s),{},{tickCoord:p>0?s.coordinate-p*e:s.coordinate})}else o[t]=s=Es(Es({},s),{},{tickCoord:s.coordinate});ks(e,s.tickCoord,u,c,l)&&(l=s.tickCoord-e*(u()/2+i),o[t]=Es(Es({},s),{},{isShow:!0}))},u=a-1;u>=0;u--)s(u);return o}(y,v,m,i,a),d.filter((function(e){return e.isShow})))}function Ps(e){return Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ps(e)}function Ts(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Cs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Is(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cs(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ps(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ps(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ps(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ds(e){return Array.isArray(e)&&Ti(e[0])&&Ti(e[1])?e.join(" ~ "):e}var Ms=function(e){var t=e.separator,r=void 0===t?" : ":t,n=e.contentStyle,i=void 0===n?{}:n,o=e.itemStyle,a=void 0===o?{}:o,c=e.labelStyle,l=void 0===c?{}:c,s=e.payload,u=e.formatter,p=e.itemSorter,d=e.wrapperClassName,h=e.labelClassName,m=e.label,y=e.labelFormatter,v=Is({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),g=Is({margin:0},l),b=!Gn()(m),x=b?m:"",w=li()("recharts-default-tooltip",d),O=li()("recharts-tooltip-label",h);return b&&y&&null!=s&&(x=y(m,s)),f().createElement("div",{className:w,style:v},f().createElement("p",{className:O,style:g},f().isValidElement(x)?x:"".concat(x)),function(){if(s&&s.length){var e=(p?ei()(s,p):s).map((function(e,t){if("none"===e.type)return null;var n=Is({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},a),i=e.formatter||u||Ds,o=e.value,c=e.name,l=o,p=c;if(i&&null!=l&&null!=p){var d=i(o,c,e,t,s);if(Array.isArray(d)){var h=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ts(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ts(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(d,2);l=h[0],p=h[1]}else l=d}return f().createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:n},Ti(p)?f().createElement("span",{className:"recharts-tooltip-item-name"},p):null,Ti(p)?f().createElement("span",{className:"recharts-tooltip-item-separator"},r):null,f().createElement("span",{className:"recharts-tooltip-item-value"},l),f().createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))}));return f().createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function Ns(e){return Ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ns(e)}function Rs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Ns(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ns(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ns(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _s="recharts-tooltip-wrapper",Bs={visibility:"hidden"};function Ls(e){var t,r=e.coordinate,n=e.translateX,i=e.translateY;return li()(_s,(Rs(t={},"".concat(_s,"-right"),Pi(n)&&r&&Pi(r.x)&&n>=r.x),Rs(t,"".concat(_s,"-left"),Pi(n)&&r&&Pi(r.x)&&n<r.x),Rs(t,"".concat(_s,"-bottom"),Pi(i)&&r&&Pi(r.y)&&i>=r.y),Rs(t,"".concat(_s,"-top"),Pi(i)&&r&&Pi(r.y)&&i<r.y),t))}function zs(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,o=e.position,a=e.reverseDirection,c=e.tooltipDimension,l=e.viewBox,s=e.viewBoxDimension;if(o&&Pi(o[n]))return o[n];var u=r[n]-c-i,p=r[n]+i;return t[n]?a[n]?u:p:a[n]?u<l[n]?Math.max(p,l[n]):Math.max(u,l[n]):p+c>l[n]+s?Math.max(u,l[n]):Math.max(p,l[n])}function Fs(e){return Fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fs(e)}function $s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$s(Object(r),!0).forEach((function(t){Xs(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ws(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vs(n.key),n)}}function Us(e,t){return Us=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Us(e,t)}function Hs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gs(e){return Gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gs(e)}function Xs(e,t,r){return(t=Vs(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vs(e){var t=function(e,t){if("object"!==Fs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Fs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Fs(t)?t:String(t)}var Ks=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Us(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gs(n);if(i){var r=Gs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Fs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hs(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Xs(Hs(e=o.call.apply(o,[this].concat(r))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Xs(Hs(e),"lastBoundingBox",{width:-1,height:-1}),Xs(Hs(e),"handleKeyDown",(function(t){var r,n,i,o;"Escape"===t.key&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(r=null===(n=e.props.coordinate)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(i=null===(o=e.props.coordinate)||void 0===o?void 0:o.y)&&void 0!==i?i:0}})})),e}return t=a,(r=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}},{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,i=t.animationDuration,o=t.animationEasing,a=t.children,c=t.coordinate,l=t.hasPayload,s=t.isAnimationActive,u=t.offset,p=t.position,d=t.reverseDirection,h=t.useTranslate3d,m=t.viewBox,y=t.wrapperStyle,v=function(e){var t,r,n,i=e.allowEscapeViewBox,o=e.coordinate,a=e.offsetTopLeft,c=e.position,l=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,p=e.viewBox;return t=s.height>0&&s.width>0&&o?function(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return(0,nc.translateStyle)({transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")})}({translateX:r=zs({allowEscapeViewBox:i,coordinate:o,key:"x",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.width,viewBox:p,viewBoxDimension:p.width}),translateY:n=zs({allowEscapeViewBox:i,coordinate:o,key:"y",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.height,viewBox:p,viewBoxDimension:p.height}),useTranslate3d:u}):Bs,{cssProperties:t,cssClasses:Ls({translateX:r,translateY:n,coordinate:o})}}({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:u,position:p,reverseDirection:d,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:h,viewBox:m}),g=v.cssClasses,b=v.cssProperties,x=qs(qs(qs({},s&&r&&(0,nc.translateStyle)({transition:"transform ".concat(i,"ms ").concat(o)})),b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&r&&l?"visible":"hidden",position:"absolute",top:0,left:0},y);return f().createElement("div",{tabIndex:-1,role:"dialog",className:g,style:x,ref:function(t){e.wrapperNode=t}},a)}}])&&Ws(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(d.PureComponent);function Ys(e){return Ys="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ys(e)}function Zs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zs(Object(r),!0).forEach((function(t){ru(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Js(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nu(n.key),n)}}function eu(e,t){return eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eu(e,t)}function tu(e){return tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tu(e)}function ru(e,t,r){return(t=nu(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nu(e){var t=function(e,t){if("object"!==Ys(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ys(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ys(t)?t:String(t)}function iu(e){return e.dataKey}var ou=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eu(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=tu(n);if(i){var r=tu(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ys(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,(r=[{key:"render",value:function(){var e=this.props,t=e.active,r=e.allowEscapeViewBox,n=e.animationDuration,i=e.animationEasing,o=e.content,a=e.coordinate,c=e.filterNull,l=e.isAnimationActive,s=e.offset,u=e.payload,p=e.payloadUniqBy,d=e.position,h=e.reverseDirection,m=e.useTranslate3d,y=e.viewBox,v=e.wrapperStyle,g=null!=u?u:[];c&&g.length&&(g=da(u.filter((function(e){return null!=e.value})),p,iu));var b=g.length>0;return f().createElement(Ks,{allowEscapeViewBox:r,animationDuration:n,animationEasing:i,isAnimationActive:l,active:t,coordinate:a,hasPayload:b,offset:s,position:d,reverseDirection:h,useTranslate3d:m,viewBox:y,wrapperStyle:v},function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):"function"==typeof e?f().createElement(e,t):f().createElement(Ms,t)}(o,Qs(Qs({},this.props),{},{payload:g})))}}])&&Js(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(d.PureComponent);function au(e){return au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},au(e)}function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cu.apply(this,arguments)}function lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function su(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==au(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==au(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===au(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ru(ou,"displayName","Tooltip"),ru(ou,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!_i.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var uu={curveBasisClosed:Xi.curveBasisClosed,curveBasisOpen:Xi.curveBasisOpen,curveBasis:Xi.curveBasis,curveBumpX:Xi.curveBumpX,curveBumpY:Xi.curveBumpY,curveLinearClosed:Xi.curveLinearClosed,curveLinear:Xi.curveLinear,curveMonotoneX:Xi.curveMonotoneX,curveMonotoneY:Xi.curveMonotoneY,curveNatural:Xi.curveNatural,curveStep:Xi.curveStep,curveStepAfter:Xi.curveStepAfter,curveStepBefore:Xi.curveStepBefore},pu=function(e){return e.x===+e.x&&e.y===+e.y},du=function(e){return e.x},fu=function(e){return e.y},hu=function(e){var t=e.className,r=e.points,n=e.path,i=e.pathRef;if(!(r&&r.length||n))return null;var o=r&&r.length?function(e){var t,r=e.type,n=void 0===r?"linear":r,i=e.points,o=void 0===i?[]:i,a=e.baseLine,c=e.layout,l=e.connectNulls,s=void 0!==l&&l,u=function(e,t){if(Vn()(e))return e;var r="curve".concat(to()(e));return"curveMonotone"!==r&&"curveBump"!==r||!t?uu[r]||Xi.curveLinear:uu["".concat(r).concat("vertical"===t?"Y":"X")]}(n,c),p=s?o.filter((function(e){return pu(e)})):o;if(Array.isArray(a)){var d=s?a.filter((function(e){return pu(e)})):a,f=p.map((function(e,t){return su(su({},e),{},{base:d[t]})}));return(t="vertical"===c?(0,Xi.area)().y(fu).x1(du).x0((function(e){return e.base.x})):(0,Xi.area)().x(du).y1(fu).y0((function(e){return e.base.y}))).defined(pu).curve(u),t(f)}return(t="vertical"===c&&Pi(a)?(0,Xi.area)().y(fu).x1(du).x0(a):Pi(a)?(0,Xi.area)().x(du).y1(fu).y0(a):(0,Xi.line)().x(du).y(fu)).defined(pu).curve(u),t(p)}(e):n;return f().createElement("path",cu({},Io(e),mo(e),{className:li()("recharts-curve",t),d:o,ref:i}))};function mu(e){return mu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mu(e)}var yu=["x","y","top","left","width","height","className"];function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vu.apply(this,arguments)}function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var bu=function(e,t,r,n,i,o){return"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r)},xu=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.top,a=void 0===o?0:o,c=e.left,l=void 0===c?0:c,s=e.width,u=void 0===s?0:s,p=e.height,d=void 0===p?0:p,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==mu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==mu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===mu(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({x:r,y:i,top:a,left:l,width:u,height:d},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,yu));return Pi(r)&&Pi(i)&&Pi(u)&&Pi(d)&&Pi(a)&&Pi(l)?f().createElement("path",vu({},Io(m,!0),{className:li()("recharts-cross",h),d:bu(r,i,u,d,a,l)})):null};function wu(){return wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wu.apply(this,arguments)}var Ou=function(e){var t=e.cx,r=e.cy,n=e.r,i=e.className,o=li()("recharts-dot",i);return t===+t&&r===+r&&n===+n?f().createElement("circle",wu({},Io(e),mo(e),{className:o,cx:t,cy:r,r:n})):null},ku=["viewBox"],Su=["viewBox"],ju=["ticks"];function Eu(e){return Eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu(e)}function Au(){return Au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Au.apply(this,arguments)}function Pu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pu(Object(r),!0).forEach((function(t){Nu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Cu(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Iu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ru(n.key),n)}}function Du(e,t){return Du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Du(e,t)}function Mu(e){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mu(e)}function Nu(e,t,r){return(t=Ru(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ru(e){var t=function(e,t){if("object"!==Eu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Eu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Eu(t)?t:String(t)}var _u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Du(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mu(i);if(o){var r=Mu(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Eu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=a.call(this,e)).state={fontSize:"",letterSpacing:""},t}return t=c,n=[{key:"renderTickItem",value:function(e,t,r){return f().isValidElement(e)?f().cloneElement(e,t):Vn()(e)?e(t):f().createElement(Mc,Au({},t,{className:"recharts-cartesian-axis-tick-value"}),r)}}],(r=[{key:"shouldComponentUpdate",value:function(e,t){var r=e.viewBox,n=Cu(e,ku),i=this.props,o=i.viewBox,a=Cu(i,Su);return!lo(r,o)||!lo(n,a)||!lo(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,r,n,i,o,a,c=this.props,l=c.x,s=c.y,u=c.width,p=c.height,d=c.orientation,f=c.tickSize,h=c.mirror,m=c.tickMargin,y=h?-1:1,v=e.tickSize||f,g=Pi(e.tickCoord)?e.tickCoord:e.coordinate;switch(d){case"top":t=r=e.coordinate,a=(n=(i=s+ +!h*p)-y*v)-y*m,o=g;break;case"left":n=i=e.coordinate,o=(t=(r=l+ +!h*u)-y*v)-y*m,a=g;break;case"right":n=i=e.coordinate,o=(t=(r=l+ +h*u)+y*v)+y*m,a=g;break;default:t=r=e.coordinate,a=(n=(i=s+ +h*p)+y*v)+y*m,o=g}return{line:{x1:t,y1:n,x2:r,y2:i},tick:{x:o,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,r=t.orientation,n=t.mirror;switch(r){case"left":e=n?"start":"end";break;case"right":e=n?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,r=e.mirror,n="end";switch(t){case"left":case"right":n="middle";break;case"top":n=r?"start":"end";break;default:n=r?"end":"start"}return n}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.orientation,a=e.mirror,c=e.axisLine,l=Tu(Tu(Tu({},Io(this.props)),Io(c)),{},{fill:"none"});if("top"===o||"bottom"===o){var s=+("top"===o&&!a||"bottom"===o&&a);l=Tu(Tu({},l),{},{x1:t,y1:r+s*i,x2:t+n,y2:r+s*i})}else{var u=+("left"===o&&!a||"right"===o&&a);l=Tu(Tu({},l),{},{x1:t+u*n,y1:r,x2:t+u*n,y2:r+i})}return f().createElement("line",Au({},l,{className:li()("recharts-cartesian-axis-line",Qn()(c,"className"))}))}},{key:"renderTicks",value:function(e,t,r){var n=this,i=this.props,o=i.tickLine,a=i.stroke,l=i.tick,s=i.tickFormatter,u=i.unit,p=As(Tu(Tu({},this.props),{},{ticks:e}),t,r),d=this.getTickTextAnchor(),h=this.getTickVerticalAnchor(),m=Io(this.props),y=Io(l),v=Tu(Tu({},m),{},{fill:"none"},Io(o)),g=p.map((function(e,t){var r=n.getTickLineCoord(e),i=r.line,g=r.tick,b=Tu(Tu(Tu(Tu({textAnchor:d,verticalAnchor:h},m),{},{stroke:"none",fill:a},y),g),{},{index:t,payload:e,visibleTicksCount:p.length,tickFormatter:s});return f().createElement(Bo,Au({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},yo(n.props,e,t)),o&&f().createElement("line",Au({},v,i,{className:li()("recharts-cartesian-axis-tick-line",Qn()(o,"className"))})),l&&c.renderTickItem(l,b,"".concat(Vn()(s)?s(e.value,t):e.value).concat(u||"")))}));return f().createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var e=this,t=this.props,r=t.axisLine,n=t.width,i=t.height,o=t.ticksGenerator,a=t.className;if(t.hide)return null;var c=this.props,l=c.ticks,s=Cu(c,ju),u=l;return Vn()(o)&&(u=l&&l.length>0?o(this.props):o(s)),n<=0||i<=0||!u||!u.length?null:f().createElement(Bo,{className:li()("recharts-cartesian-axis",a),ref:function(t){e.layerReference=t}},r&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),Hc.renderCallByParent(this.props))}}])&&Iu(t.prototype,r),n&&Iu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.Component);function Bu(e){return Bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bu(e)}function Lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lu(Object(r),!0).forEach((function(t){Fu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Bu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Bu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Nu(_u,"displayName","CartesianAxis"),Nu(_u,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var $u=["Webkit","Moz","O","ms"];function qu(e){return qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qu(e)}function Wu(){return Wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wu.apply(this,arguments)}function Uu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Uu(Object(r),!0).forEach((function(t){Yu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zu(n.key),n)}}function Xu(e,t){return Xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xu(e,t)}function Vu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ku(e){return Ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ku(e)}function Yu(e,t,r){return(t=Zu(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zu(e){var t=function(e,t){if("object"!==qu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==qu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===qu(t)?t:String(t)}var Qu=function(e){return e.changedTouches&&!!e.changedTouches.length},Ju=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xu(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ku(i);if(o){var r=Ku(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===qu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vu(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),Yu(Vu(t=a.call(this,e)),"handleDrag",(function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)})),Yu(Vu(t),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])})),Yu(Vu(t),"handleDragEnd",(function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},(function(){var e=t.props,r=e.endIndex,n=e.onDragEnd,i=e.startIndex;null==n||n({endIndex:r,startIndex:i})})),t.detachDragEndListener()})),Yu(Vu(t),"handleLeaveWrapper",(function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))})),Yu(Vu(t),"handleEnterSlideOrTraveller",(function(){t.setState({isTextActive:!0})})),Yu(Vu(t),"handleLeaveSlideOrTraveller",(function(){t.setState({isTextActive:!1})})),Yu(Vu(t),"handleSlideDragStart",(function(e){var r=Qu(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:r.pageX}),t.attachDragEndListener()})),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(Vu(t),"startX"),endX:t.handleTravellerDragStart.bind(Vu(t),"endX")},t.state={},t}return t=c,n=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,r=e.y,n=e.width,i=e.height,o=e.stroke,a=Math.floor(r+i/2)-1;return f().createElement(f().Fragment,null,f().createElement("rect",{x:t,y:r,width:n,height:i,fill:o,stroke:"none"}),f().createElement("line",{x1:t+1,y1:a,x2:t+n-1,y2:a,fill:"none",stroke:"#fff"}),f().createElement("line",{x1:t+1,y1:a+2,x2:t+n-1,y2:a+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):Vn()(e)?e(t):c.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var r=e.data,n=e.width,i=e.x,o=e.travellerWidth,a=e.updateId,c=e.startIndex,l=e.endIndex;if(r!==t.prevData||a!==t.prevUpdateId)return Hu({prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n},r&&r.length?function(e){var t=e.data,r=e.startIndex,n=e.endIndex,i=e.x,o=e.width,a=e.travellerWidth;if(!t||!t.length)return{};var c=t.length,l=(0,Gi.scalePoint)().domain(Yn()(0,c)).range([i,i+o-a]),s=l.domain().map((function(e){return l(e)}));return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:l(r),endX:l(n),scale:l,scaleValues:s}}({data:r,width:n,x:i,travellerWidth:o,startIndex:c,endIndex:l}):{scale:null,scaleValues:null});if(t.scale&&(n!==t.prevWidth||i!==t.prevX||o!==t.prevTravellerWidth)){t.scale.range([i,i+n-o]);var s=t.scale.domain().map((function(e){return t.scale(e)}));return{prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:s}}return null}},{key:"getIndexInRange",value:function(e,t){for(var r=0,n=e.length-1;n-r>1;){var i=Math.floor((r+n)/2);e[i]>t?n=i:r=i}return t>=e[n]?n:r}}],(r=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,r=e.endX,n=this.state.scaleValues,i=this.props,o=i.gap,a=i.data.length-1,l=Math.min(t,r),s=Math.max(t,r),u=c.getIndexInRange(n,l),p=c.getIndexInRange(n,s);return{startIndex:u-u%o,endIndex:p===a?a:p-p%o}}},{key:"getTextOfTick",value:function(e){var t=this.props,r=t.data,n=t.tickFormatter,i=t.dataKey,o=Ra(r[e],i,e);return Vn()(n)?n(o,e):o}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,r=t.slideMoveStartX,n=t.startX,i=t.endX,o=this.props,a=o.x,c=o.width,l=o.travellerWidth,s=o.startIndex,u=o.endIndex,p=o.onChange,d=e.pageX-r;d>0?d=Math.min(d,a+c-l-i,a+c-l-n):d<0&&(d=Math.max(d,a-n,a-i));var f=this.getIndex({startX:n+d,endX:i+d});f.startIndex===s&&f.endIndex===u||!p||p(f),this.setState({startX:n+d,endX:i+d,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var r=Qu(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,r=this.state,n=r.brushMoveStartX,i=r.movingTravellerId,o=r.endX,a=r.startX,c=this.state[i],l=this.props,s=l.x,u=l.width,p=l.travellerWidth,d=l.onChange,f=l.gap,h=l.data,m={startX:this.state.startX,endX:this.state.endX},y=e.pageX-n;y>0?y=Math.min(y,s+u-p-c):y<0&&(y=Math.max(y,s-c)),m[i]=c+y;var v=this.getIndex(m),g=v.startIndex,b=v.endIndex;this.setState((Yu(t={},i,c+y),Yu(t,"brushMoveStartX",e.pageX),t),(function(){var e;d&&(e=h.length-1,("startX"===i&&(o>a?g%f==0:b%f==0)||o<a&&b===e||"endX"===i&&(o>a?b%f==0:g%f==0)||o>a&&b===e)&&d(v))}))}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var r=this,n=this.state,i=n.scaleValues,o=n.startX,a=n.endX,c=this.state[t],l=i.indexOf(c);if(-1!==l){var s=l+e;if(!(-1===s||s>=i.length)){var u=i[s];"startX"===t&&u>=a||"endX"===t&&u<=o||this.setState(Yu({},t,u),(function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))}))}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.fill,a=e.stroke;return f().createElement("rect",{stroke:a,fill:o,x:t,y:r,width:n,height:i})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.data,a=e.children,c=e.padding,l=d.Children.only(a);return l?f().cloneElement(l,{x:t,y:r,width:n,height:i,margin:c,compact:!0,data:o}):null}},{key:"renderTravellerLayer",value:function(e,t){var r=this,n=this.props,i=n.y,o=n.travellerWidth,a=n.height,l=n.traveller,s=n.ariaLabel,u=n.data,p=n.startIndex,d=n.endIndex,h=Math.max(e,this.props.x),m=Hu(Hu({},Io(this.props)),{},{x:h,y:i,width:o,height:a}),y=s||"Min value: ".concat(u[p].name,", Max value: ").concat(u[d].name);return f().createElement(Bo,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},c.renderTraveller(l,m))}},{key:"renderSlide",value:function(e,t){var r=this.props,n=r.y,i=r.height,o=r.stroke,a=r.travellerWidth,c=Math.min(e,t)+a,l=Math.max(Math.abs(t-e)-a,0);return f().createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:c,y:n,width:l,height:i})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,r=e.endIndex,n=e.y,i=e.height,o=e.travellerWidth,a=e.stroke,c=this.state,l=c.startX,s=c.endX,u={pointerEvents:"none",fill:a};return f().createElement(Bo,{className:"recharts-brush-texts"},f().createElement(Mc,Wu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:n+i/2},u),this.getTextOfTick(t)),f().createElement(Mc,Wu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+o+5,y:n+i/2},u),this.getTextOfTick(r)))}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.className,n=e.children,i=e.x,o=e.y,a=e.width,c=e.height,l=e.alwaysShowText,s=this.state,u=s.startX,p=s.endX,d=s.isTextActive,h=s.isSlideMoving,m=s.isTravellerMoving,y=s.isTravellerFocused;if(!t||!t.length||!Pi(i)||!Pi(o)||!Pi(a)||!Pi(c)||a<=0||c<=0)return null;var v,g,b,x,w=li()("recharts-brush",r),O=1===f().Children.count(n),k=(g="none",b=(v="userSelect").replace(/(\w)/,(function(e){return e.toUpperCase()})),(x=$u.reduce((function(e,t){return zu(zu({},e),{},Fu({},t+b,g))}),{}))[v]=g,x);return f().createElement(Bo,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:k},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(u,p),this.renderTravellerLayer(u,"startX"),this.renderTravellerLayer(p,"endX"),(d||h||m||y||l)&&this.renderText())}}])&&Gu(t.prototype,r),n&&Gu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);Yu(Ju,"displayName","Brush"),Yu(Ju,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var ep=function(e,t){var r=e.alwaysShow,n=e.ifOverflow;return r&&(n="extendDomain"),n===t};function tp(e){return tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tp(e)}function rp(){return rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rp.apply(this,arguments)}function np(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ip(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?np(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==tp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==tp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===tp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):np(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function op(e){var t=e.x,r=e.y,n=e.r,i=e.alwaysShow,o=e.clipPathId,a=Ti(t),c=Ti(r);if(qo(void 0===i,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!a||!c)return null;var l=function(e){var t=e.x,r=e.y,n=e.xAxis,i=e.yAxis,o=ws({x:n.scale,y:i.scale}),a=o.apply({x:t,y:r},{bandAware:!0});return ep(e,"discard")&&!o.isInRange(a)?null:a}(e);if(!l)return null;var s=l.x,u=l.y,p=e.shape,d=e.className,h=ip(ip({clipPath:ep(e,"hidden")?"url(#".concat(o,")"):void 0},Io(e,!0)),{},{cx:s,cy:u});return f().createElement(Bo,{className:li()("recharts-reference-dot",d)},op.renderDot(p,h),Hc.renderCallByParent(e,{x:s-n,y:u-n,width:2*n,height:2*n}))}op.displayName="ReferenceDot",op.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},op.renderDot=function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):Vn()(e)?e(t):f().createElement(Ou,rp({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};const ap=require("lodash/some");var cp=r.n(ap);function lp(e){return lp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lp(e)}function sp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function up(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==lp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==lp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===lp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dp(){return dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dp.apply(this,arguments)}var fp=function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):Vn()(e)?e(t):f().createElement("line",dp({},t,{className:"recharts-reference-line-line"}))},hp=function(e,t,r,n,i){var o=i.viewBox,a=o.x,c=o.y,l=o.width,s=o.height,u=i.position;if(r){var p=i.y,d=i.yAxis.orientation,f=e.y.apply(p,{position:u});if(ep(i,"discard")&&!e.y.isInRange(f))return null;var h=[{x:a+l,y:f},{x:a,y:f}];return"left"===d?h.reverse():h}if(t){var m=i.x,y=i.xAxis.orientation,v=e.x.apply(m,{position:u});if(ep(i,"discard")&&!e.x.isInRange(v))return null;var g=[{x:v,y:c+s},{x:v,y:c}];return"top"===y?g.reverse():g}if(n){var b=i.segment.map((function(t){return e.apply(t,{position:u})}));return ep(i,"discard")&&cp()(b,(function(t){return!e.isInRange(t)}))?null:b}return null};function mp(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxis,o=e.yAxis,a=e.shape,c=e.className,l=e.alwaysShow,s=e.clipPathId;qo(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var u=ws({x:i.scale,y:o.scale}),p=Ti(t),d=Ti(r),h=n&&2===n.length,m=hp(u,p,d,h,e);if(!m)return null;var y,v,g=(v=2,function(e){if(Array.isArray(e))return e}(y=m)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(y,v)||function(e,t){if(e){if("string"==typeof e)return pp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pp(e,t):void 0}}(y,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=g[0],x=b.x,w=b.y,O=g[1],k=O.x,S=O.y,j=up(up({clipPath:ep(e,"hidden")?"url(#".concat(s,")"):void 0},Io(e,!0)),{},{x1:x,y1:w,x2:k,y2:S});return f().createElement(Bo,{className:li()("recharts-reference-line",c)},fp(a,j),Hc.renderCallByParent(e,bs({x1:x,y1:w,x2:k,y2:S})))}function yp(e){return yp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yp(e)}function vp(){return vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vp.apply(this,arguments)}function gp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==yp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==yp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xp(e){var t=e.x1,r=e.x2,n=e.y1,i=e.y2,o=e.className,a=e.alwaysShow,c=e.clipPathId;qo(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var l=Ti(t),s=Ti(r),u=Ti(n),p=Ti(i),d=e.shape;if(!(l||s||u||p||d))return null;var h=function(e,t,r,n,i){var o=i.x1,a=i.x2,c=i.y1,l=i.y2,s=i.xAxis,u=i.yAxis;if(!s||!u)return null;var p=ws({x:s.scale,y:u.scale}),d={x:e?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:r?p.y.apply(c,{position:"start"}):p.y.rangeMin},f={x:t?p.x.apply(a,{position:"end"}):p.x.rangeMax,y:n?p.y.apply(l,{position:"end"}):p.y.rangeMax};return!ep(i,"discard")||p.isInRange(d)&&p.isInRange(f)?gs(d,f):null}(l,s,u,p,e);if(!h&&!d)return null;var m=ep(e,"hidden")?"url(#".concat(c,")"):void 0;return f().createElement(Bo,{className:li()("recharts-reference-area",o)},xp.renderRect(d,bp(bp({clipPath:m},Io(e,!0)),h)),Hc.renderCallByParent(e,h))}function wp(e){return function(e){if(Array.isArray(e))return Op(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Op(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Op(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Op(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}mp.displayName="ReferenceLine",mp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"},xp.displayName="ReferenceArea",xp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},xp.renderRect=function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):Vn()(e)?e(t):f().createElement(ml,vp({},t,{className:"recharts-reference-area-rect"}))};var kp=function(e,t,r,n,i){var o=Eo(e,mp),a=Eo(e,op),c=[].concat(wp(o),wp(a)),l=Eo(e,xp),s="".concat(n,"Id"),u=n[0],p=t;if(c.length&&(p=c.reduce((function(e,t){if(t.props[s]===r&&ep(t.props,"extendDomain")&&Pi(t.props[u])){var n=t.props[u];return[Math.min(e[0],n),Math.max(e[1],n)]}return e}),p)),l.length){var d="".concat(u,"1"),f="".concat(u,"2");p=l.reduce((function(e,t){if(t.props[s]===r&&ep(t.props,"extendDomain")&&Pi(t.props[d])&&Pi(t.props[f])){var n=t.props[d],i=t.props[f];return[Math.min(e[0],n,i),Math.max(e[1],n,i)]}return e}),p)}return i&&i.length&&(p=i.reduce((function(e,t){return Pi(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e}),p)),p};const Sp=require("eventemitter3");var jp=new(r.n(Sp)()),Ep="recharts.syncMouseEvents";function Ap(e){return Ap="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ap(e)}function Pp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cp(n.key),n)}}function Tp(e,t,r){return(t=Cp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cp(e){var t=function(e,t){if("object"!==Ap(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ap(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ap(t)?t:String(t)}var Ip=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Tp(this,"activeIndex",0),Tp(this,"coordinateList",[]),Tp(this,"layout","horizontal")}var t,r;return t=e,(r=[{key:"setDetails",value:function(e){var t=e.coordinateList,r=void 0===t?[]:t,n=e.container,i=void 0===n?null:n,o=e.layout,a=void 0===o?null:o,c=e.offset,l=void 0===c?null:c,s=e.mouseHandlerCallback,u=void 0===s?null:s;this.coordinateList=null!=r?r:this.coordinateList,this.container=null!=i?i:this.container,this.layout=null!=a?a:this.layout,this.offset=null!=l?l:this.offset,this.mouseHandlerCallback=null!=u?u:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"spoofMouse",value:function(){var e,t;if("horizontal"===this.layout&&0!==this.coordinateList.length){var r=this.container.getBoundingClientRect(),n=r.x,i=r.y,o=r.height,a=this.coordinateList[this.activeIndex].coordinate,c=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,l=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,s=n+a+c,u=i+this.offset.top+o/2+l;this.mouseHandlerCallback({pageX:s,pageY:u})}}}])&&Pp(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Dp(e,t,r){var n,i,o,a;if("horizontal"===e)o=n=t.x,i=r.top,a=r.top+r.height;else if("vertical"===e)a=i=t.y,n=r.left,o=r.left+r.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return bi(t);var c=t.cx,l=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.angle,d=yi(c,l,s,p),f=yi(c,l,u,p);n=d.x,i=d.y,o=f.x,a=f.y}return[{x:n,y:i},{x:o,y:a}]}var Mp=["item"],Np=["children","className","width","height","style","compact","title","desc"];function Rp(e){return Rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rp(e)}function _p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||Up(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bp(){return Bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bp.apply(this,arguments)}function Lp(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function zp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Kp(n.key),n)}}function Fp(e,t){return Fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fp(e,t)}function $p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qp(e){return qp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qp(e)}function Wp(e){return function(e){if(Array.isArray(e))return Hp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Up(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Up(e,t){if(e){if("string"==typeof e)return Hp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Hp(e,t):void 0}}function Hp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Gp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gp(Object(r),!0).forEach((function(t){Vp(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vp(e,t,r){return(t=Kp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kp(e){var t=function(e,t){if("object"!==Rp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Rp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Rp(t)?t:String(t)}var Yp={xAxis:["bottom","top"],yAxis:["left","right"]},Zp={width:"100%",height:"100%"},Qp={x:0,y:0},Jp=function(e,t){var r=t.graphicalItems,n=t.dataStartIndex,i=t.dataEndIndex,o=(null!=r?r:[]).reduce((function(e,t){var r=t.props.data;return r&&r.length?[].concat(Wp(e),Wp(r)):e}),[]);return o.length>0?o:e&&e.length&&Pi(n)&&Pi(i)?e.slice(n,i+1):[]};function ed(e){return"number"===e?[0,"auto"]:void 0}var td=function(e,t,r,n){var i=e.graphicalItems,o=e.tooltipAxis,a=Jp(t,e);return r<0||!i||!i.length||r>=a.length?null:i.reduce((function(i,c){var l;if(c.props.hide)return i;var s,u=null!==(l=c.props.data)&&void 0!==l?l:t;return u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),(s=o.dataKey&&!o.allowDuplicatedCategory?Ri(void 0===u?a:u,o.dataKey,n):u&&u[r]||a[r])?[].concat(Wp(i),[rc(c,s)]):i}),[])},rd=function(e,t,r,n){var i=n||{x:e.chartX,y:e.chartY},o=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(i,r),a=e.orderedTooltipTicks,c=e.tooltipAxis,l=e.tooltipTicks,s=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,a=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(a<=1)return 0;if(i&&"angleAxis"===i.axisType&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,l=0;l<a;l++){var s=l>0?n[l-1].coordinate:n[a-1].coordinate,u=n[l].coordinate,p=l>=a-1?n[0].coordinate:n[l+1].coordinate,d=void 0;if(Ei(u-s)!==Ei(p-u)){var f=[];if(Ei(p-u)===Ei(c[1]-c[0])){d=p;var h=u+c[1]-c[0];f[0]=Math.min(h,(h+s)/2),f[1]=Math.max(h,(h+s)/2)}else{d=s;var m=p+c[1]-c[0];f[0]=Math.min(u,(m+u)/2),f[1]=Math.max(u,(m+u)/2)}var y=[Math.min(u,(d+u)/2),Math.max(u,(d+u)/2)];if(e>y[0]&&e<=y[1]||e>=f[0]&&e<=f[1]){o=n[l].index;break}}else{var v=Math.min(s,p),g=Math.max(s,p);if(e>(v+u)/2&&e<=(g+u)/2){o=n[l].index;break}}}else for(var b=0;b<a;b++)if(0===b&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){o=r[b].index;break}return o}(o,a,l,c);if(s>=0&&l){var u=l[s]&&l[s].value,p=td(e,t,s,u),d=function(e,t,r,n){var i=t.find((function(e){return e&&e.index===r}));if(i){if("horizontal"===e)return{x:i.coordinate,y:n.y};if("vertical"===e)return{x:n.x,y:i.coordinate};if("centric"===e){var o=i.coordinate,a=n.radius;return Xp(Xp(Xp({},n),yi(n.cx,n.cy,a,o)),{},{angle:o,radius:a})}var c=i.coordinate,l=n.angle;return Xp(Xp(Xp({},n),yi(n.cx,n.cy,c,l)),{},{angle:l,radius:c})}return Qp}(r,a,s,i);return{activeTooltipIndex:s,activeLabel:u,activePayload:p,activeCoordinate:d}}return null},nd=function(e,t){var r=t.axisType,n=void 0===r?"xAxis":r,i=t.AxisComp,o=t.graphicalItems,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.children,u="".concat(n,"Id"),p=Eo(s,i),d={};return p&&p.length?d=function(e,t){var r=t.axes,n=t.graphicalItems,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=e.stackOffset,d=Fa(s,i);return r.reduce((function(t,r){var f,h=r.props,m=h.type,y=h.dataKey,v=h.allowDataOverflow,g=h.allowDuplicatedCategory,b=h.scale,x=h.ticks,w=h.includeHidden,O=r.props[o];if(t[O])return t;var k,S,j,E=Jp(e.data,{graphicalItems:n.filter((function(e){return e.props[o]===O})),dataStartIndex:c,dataEndIndex:l}),A=E.length;(function(e,t,r){if("number"===r&&!0===t&&Array.isArray(e)){var n=null==e?void 0:e[0],i=null==e?void 0:e[1];if(n&&i&&Pi(n)&&Pi(i))return!0}return!1})(r.props.domain,v,m)&&(k=Ja(r.props.domain,null,v),!d||"number"!==m&&"auto"===b||(j=_a(E,y,"category")));var P=ed(m);if(!k||0===k.length){var T,C=null!==(T=r.props.domain)&&void 0!==T?T:P;if(y){if(k=_a(E,y,m),"category"===m&&d){var I=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++){if(r[e[n]])return!0;r[e[n]]=!0}return!1}(k);g&&I?(S=k,k=Yn()(0,A)):g||(k=tc(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0?e:[].concat(Wp(e),[t])}),[]))}else if("category"===m)k=g?k.filter((function(e){return""!==e&&!Gn()(e)})):tc(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0||""===t||Gn()(t)?e:[].concat(Wp(e),[t])}),[]);else if("number"===m){var D=function(e,t,r,n,i){var o=t.map((function(t){return La(e,t,r,i,n)})).filter((function(e){return!Gn()(e)}));return o&&o.length?o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null}(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),y,i,s);D&&(k=D)}!d||"number"!==m&&"auto"===b||(j=_a(E,y,"category"))}else k=d?Yn()(0,A):a&&a[O]&&a[O].hasStack&&"number"===m?"expand"===p?[0,1]:Ya(a[O].stackGroups,c,l):za(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),m,s,!0);if("number"===m)k=kp(u,k,O,i,x),C&&(k=Ja(C,k,v));else if("category"===m&&C){var M=C;k.every((function(e){return M.indexOf(e)>=0}))&&(k=M)}}return Xp(Xp({},t),{},Vp({},O,Xp(Xp({},r.props),{},{axisType:i,domain:k,categoricalDomain:j,duplicateDomain:S,originalDomain:null!==(f=r.props.domain)&&void 0!==f?f:P,isCategorical:d,layout:s})))}),{})}(e,{axes:p,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l}):o&&o.length&&(d=function(e,t){var r=t.graphicalItems,n=t.Axis,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=Jp(e.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:l}),d=p.length,f=Fa(s,i),h=-1;return r.reduce((function(e,t){var m,y=t.props[o],v=ed("number");return e[y]?e:(h++,f?m=Yn()(0,d):a&&a[y]&&a[y].hasStack?(m=Ya(a[y].stackGroups,c,l),m=kp(u,m,y,i)):(m=Ja(v,za(p,r.filter((function(e){return e.props[o]===y&&!e.props.hide})),"number",s),n.defaultProps.allowDataOverflow),m=kp(u,m,y,i)),Xp(Xp({},e),{},Vp({},y,Xp(Xp({axisType:i},n.defaultProps),{},{hide:!0,orientation:Qn()(Yp,"".concat(i,".").concat(h%2),null),domain:m,originalDomain:v,isCategorical:f,layout:s}))))}),{})}(e,{Axis:i,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l})),d},id=function(e){var t=e.children,r=e.defaultShowTooltip,n=Ao(t,Ju),i=0,o=0;return e.data&&0!==e.data.length&&(o=e.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(i=n.props.startIndex),n.props.endIndex>=0&&(o=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:Boolean(r)}},od=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ad=function(e){var t,r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,o=void 0===i?"axis":i,a=e.validateTooltipEventTypes,c=void 0===a?["axis"]:a,l=e.axisComponents,s=e.legendContent,u=e.formatAxisMap,p=e.defaultProps,h=function(e,t){var i=e.props,o=e.dataStartIndex,a=e.dataEndIndex,c=e.updateId;if(!Po({props:i}))return null;var s=i.children,p=i.layout,d=i.stackOffset,f=i.data,h=i.reverseStackOrder,m=od(p),y=m.numericAxisName,v=m.cateAxisName,g=Eo(s,n),b=function(e,t,r,n,i,o){if(!e)return null;var a=(o?t.reverse():t).reduce((function(e,t){var i=t.props,o=i.stackId;if(i.hide)return e;var a=t.props[r],c=e[a]||{hasStack:!1,stackGroups:{}};if(Ti(o)){var l=c.stackGroups[o]||{numericAxisId:r,cateAxisId:n,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[Ii("_stackId_")]={numericAxisId:r,cateAxisId:n,items:[t]};return Ia(Ia({},e),{},Da({},a,c))}),{});return Object.keys(a).reduce((function(t,o){var c=a[o];return c.hasStack&&(c.stackGroups=Object.keys(c.stackGroups).reduce((function(t,o){var a=c.stackGroups[o];return Ia(Ia({},t),{},Da({},o,{numericAxisId:r,cateAxisId:n,items:a.items,stackedData:Xa(e,a.items,i)}))}),{})),Ia(Ia({},t),{},Da({},o,c))}),{})}(f,g,"".concat(y,"Id"),"".concat(v,"Id"),d,h),x=l.reduce((function(e,t){var r="".concat(t.axisType,"Map");return Xp(Xp({},e),{},Vp({},r,nd(i,Xp(Xp({},t),{},{graphicalItems:g,stackGroups:t.axisType===y&&b,dataStartIndex:o,dataEndIndex:a}))))}),{}),w=function(e,t){var r=e.props,n=(e.graphicalItems,e.xAxisMap),i=void 0===n?{}:n,o=e.yAxisMap,a=void 0===o?{}:o,c=r.width,l=r.height,s=r.children,u=r.margin||{},p=Ao(s,Ju),d=Ao(s,Sa),f=Object.keys(a).reduce((function(e,t){var r=a[t],n=r.orientation;return r.mirror||r.hide?e:Xp(Xp({},e),{},Vp({},n,e[n]+r.width))}),{left:u.left||0,right:u.right||0}),h=Object.keys(i).reduce((function(e,t){var r=i[t],n=r.orientation;return r.mirror||r.hide?e:Xp(Xp({},e),{},Vp({},n,Qn()(e,"".concat(n))+r.height))}),{top:u.top||0,bottom:u.bottom||0}),m=Xp(Xp({},h),f),y=m.bottom;p&&(m.bottom+=p.props.height||Ju.defaultProps.height),d&&t&&(m=function(e,t,r,n){var i=r.children,o=r.width,a=r.margin,c=o-(a.left||0)-(a.right||0),l=Pa({children:i,legendWidth:c});if(l){var s=n||{},u=s.width,p=s.height,d=l.align,f=l.verticalAlign,h=l.layout;if(("vertical"===h||"horizontal"===h&&"middle"===f)&&"center"!==d&&Pi(e[d]))return Ia(Ia({},e),{},Da({},d,e[d]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===d)&&"middle"!==f&&Pi(e[f]))return Ia(Ia({},e),{},Da({},f,e[f]+(p||0)))}return e}(m,0,r,t));var v=c-m.left-m.right,g=l-m.top-m.bottom;return Xp(Xp({brushBottom:y},m),{},{width:Math.max(v,0),height:Math.max(g,0)})}(Xp(Xp({},x),{},{props:i,graphicalItems:g}),null==t?void 0:t.legendBBox);Object.keys(x).forEach((function(e){x[e]=u(i,x[e],w,e.replace("Map",""),r)}));var O,k,S=x["".concat(v,"Map")],j=(O=Mi(S),{tooltipTicks:k=qa(O,!1,!0),orderedTooltipTicks:ei()(k,(function(e){return e.coordinate})),tooltipAxis:O,tooltipAxisBandSize:ec(O,k)}),E=function(e,t){var r=t.graphicalItems,n=t.stackGroups,i=t.offset,o=t.updateId,a=t.dataStartIndex,c=t.dataEndIndex,s=e.barSize,u=e.layout,p=e.barGap,d=e.barCategoryGap,f=e.maxBarSize,h=od(u),m=h.numericAxisName,y=h.cateAxisName,v=function(e){return!(!e||!e.length)&&e.some((function(e){var t=Oo(e&&e.type);return t&&t.indexOf("Bar")>=0}))}(r),g=v&&function(e){var t=e.barSize,r=e.stackGroups,n=void 0===r?{}:r;if(!n)return{};for(var i={},o=Object.keys(n),a=0,c=o.length;a<c;a++)for(var l=n[o[a]].stackGroups,s=Object.keys(l),u=0,p=s.length;u<p;u++){var d=l[s[u]],f=d.items,h=d.cateAxisId,m=f.filter((function(e){return Oo(e.type).indexOf("Bar")>=0}));if(m&&m.length){var y=m[0].props.barSize,v=m[0].props[h];i[v]||(i[v]=[]),i[v].push({item:m[0],stackList:m.slice(1),barSize:Gn()(y)?t:y})}}return i}({barSize:s,stackGroups:n}),b=[];return r.forEach((function(r,s){var h=Jp(e.data,{graphicalItems:[r],dataStartIndex:a,dataEndIndex:c}),v=r.props,x=v.dataKey,w=v.maxBarSize,O=r.props["".concat(m,"Id")],k=r.props["".concat(y,"Id")],S=l.reduce((function(e,n){var i,o=t["".concat(n.axisType,"Map")],a=r.props["".concat(n.axisType,"Id")];o&&o[a]||"zAxis"===n.axisType||ui()(!1);var c=o[a];return Xp(Xp({},e),{},(Vp(i={},n.axisType,c),Vp(i,"".concat(n.axisType,"Ticks"),qa(c)),i))}),{}),j=S[y],E=S["".concat(y,"Ticks")],A=n&&n[O]&&n[O].hasStack&&function(e,t){var r=e.props.stackId;if(Ti(r)){var n=t[r];if(n){var i=n.items.indexOf(e);return i>=0?n.stackedData[i]:null}}return null}(r,n[O].stackGroups),P=Oo(r.type).indexOf("Bar")>=0,T=ec(j,E),C=[];if(P){var I,D,M=Gn()(w)?f:w,N=null!==(I=null!==(D=ec(j,E,!0))&&void 0!==D?D:M)&&void 0!==I?I:0;C=function(e){var t=e.barGap,r=e.barCategoryGap,n=e.bandSize,i=e.sizeList,o=void 0===i?[]:i,a=e.maxBarSize,c=o.length;if(c<1)return null;var l,s=Di(t,n,0,!0),u=[];if(o[0].barSize===+o[0].barSize){var p=!1,d=n/c,f=o.reduce((function(e,t){return e+t.barSize||0}),0);(f+=(c-1)*s)>=n&&(f-=(c-1)*s,s=0),f>=n&&d>0&&(p=!0,f=c*(d*=.9));var h={offset:((n-f)/2|0)-s,size:0};l=o.reduce((function(e,t){var r={item:t.item,position:{offset:h.offset+h.size+s,size:p?d:t.barSize}},n=[].concat(Ma(e),[r]);return h=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:h})})),n}),u)}else{var m=Di(r,n,0,!0);n-2*m-(c-1)*s<=0&&(s=0);var y=(n-2*m-(c-1)*s)/c;y>1&&(y>>=0);var v=a===+a?Math.min(y,a):y;l=o.reduce((function(e,t,r){var n=[].concat(Ma(e),[{item:t.item,position:{offset:m+(y+s)*r+(y-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:n[n.length-1].position})})),n}),u)}return l}({barGap:p,barCategoryGap:d,bandSize:N!==T?N:T,sizeList:g[k],maxBarSize:M}),N!==T&&(C=C.map((function(e){return Xp(Xp({},e),{},{position:Xp(Xp({},e.position),{},{offset:e.position.offset-N/2})})})))}var R,_,B,L=r&&r.type&&r.type.getComposedData;L&&b.push({props:Xp(Xp({},L(Xp(Xp({},S),{},{displayedData:h,props:e,dataKey:x,item:r,bandSize:T,barPosition:C,offset:i,stackedData:A,layout:u,dataStartIndex:a,dataEndIndex:c}))),{},(R={key:r.key||"item-".concat(s)},Vp(R,m,S[m]),Vp(R,y,S[y]),Vp(R,"animationId",o),R)),childIndex:(_=r,B=e.children,jo(B).indexOf(_)),item:r})})),b}(i,Xp(Xp({},x),{},{dataStartIndex:o,dataEndIndex:a,updateId:c,graphicalItems:g,stackGroups:b,offset:w}));return Xp(Xp({formattedGraphicalItems:E,graphicalItems:g,offset:w,stackGroups:b},j),x)};return t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fp(e,t)}(u,e);var t,n,i,a,l=(i=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=qp(i);if(a){var r=qp(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Rp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $p(e)}(this,e)});function u(e){var t,n,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),Vp($p(i=l.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Vp($p(i),"accessibilityManager",new Ip),Vp($p(i),"handleLegendBBoxUpdate",(function(e){if(e){var t=i.state,r=t.dataStartIndex,n=t.dataEndIndex,o=t.updateId;i.setState(Xp({legendBBox:e},h({props:i.props,dataStartIndex:r,dataEndIndex:n,updateId:o},Xp(Xp({},i.state),{},{legendBBox:e}))))}})),Vp($p(i),"handleReceiveSyncEvent",(function(e,t,r){if(i.props.syncId===e){if(r===i.eventEmitterSymbol&&"function"!=typeof i.props.syncMethod)return;i.applySyncEvent(t)}})),Vp($p(i),"handleBrushChange",(function(e){var t=e.startIndex,r=e.endIndex;if(t!==i.state.dataStartIndex||r!==i.state.dataEndIndex){var n=i.state.updateId;i.setState((function(){return Xp({dataStartIndex:t,dataEndIndex:r},h({props:i.props,dataStartIndex:t,dataEndIndex:r,updateId:n},i.state))})),i.triggerSyncEvent({dataStartIndex:t,dataEndIndex:r})}})),Vp($p(i),"handleMouseEnter",(function(e){var t=i.getMouseInfo(e);if(t){var r=Xp(Xp({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseEnter;Vn()(n)&&n(r,e)}})),Vp($p(i),"triggeredAfterMouseMove",(function(e){var t=i.getMouseInfo(e),r=t?Xp(Xp({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseMove;Vn()(n)&&n(r,e)})),Vp($p(i),"handleItemMouseEnter",(function(e){i.setState((function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}}))})),Vp($p(i),"handleItemMouseLeave",(function(){i.setState((function(){return{isTooltipActive:!1}}))})),Vp($p(i),"handleMouseMove",(function(e){e.persist(),i.throttleTriggeredAfterMouseMove(e)})),Vp($p(i),"handleMouseLeave",(function(e){var t={isTooltipActive:!1};i.setState(t),i.triggerSyncEvent(t);var r=i.props.onMouseLeave;Vn()(r)&&r(t,e)})),Vp($p(i),"handleOuterEvent",(function(e){var t,r=function(e){var t=e&&e.type;return t&&wo[t]?wo[t]:null}(e),n=Qn()(i.props,"".concat(r));r&&Vn()(n)&&n(null!==(t=/.*touch.*/i.test(r)?i.getMouseInfo(e.changedTouches[0]):i.getMouseInfo(e))&&void 0!==t?t:{},e)})),Vp($p(i),"handleClick",(function(e){var t=i.getMouseInfo(e);if(t){var r=Xp(Xp({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onClick;Vn()(n)&&n(r,e)}})),Vp($p(i),"handleMouseDown",(function(e){var t=i.props.onMouseDown;Vn()(t)&&t(i.getMouseInfo(e),e)})),Vp($p(i),"handleMouseUp",(function(e){var t=i.props.onMouseUp;Vn()(t)&&t(i.getMouseInfo(e),e)})),Vp($p(i),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.throttleTriggeredAfterMouseMove(e.changedTouches[0])})),Vp($p(i),"handleTouchStart",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseDown(e.changedTouches[0])})),Vp($p(i),"handleTouchEnd",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseUp(e.changedTouches[0])})),Vp($p(i),"triggerSyncEvent",(function(e){void 0!==i.props.syncId&&jp.emit(Ep,i.props.syncId,e,i.eventEmitterSymbol)})),Vp($p(i),"applySyncEvent",(function(e){var t=i.props,r=t.layout,n=t.syncMethod,o=i.state.updateId,a=e.dataStartIndex,c=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)i.setState(Xp({dataStartIndex:a,dataEndIndex:c},h({props:i.props,dataStartIndex:a,dataEndIndex:c,updateId:o},i.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,s=e.chartY,u=e.activeTooltipIndex,p=i.state,d=p.offset,f=p.tooltipTicks;if(!d)return;if("function"==typeof n)u=n(f,e);else if("value"===n){u=-1;for(var m=0;m<f.length;m++)if(f[m].value===e.activeLabel){u=m;break}}var y=Xp(Xp({},d),{},{x:d.left,y:d.top}),v=Math.min(l,y.x+y.width),g=Math.min(s,y.y+y.height),b=f[u]&&f[u].value,x=td(i.state,i.props.data,u),w=f[u]?{x:"horizontal"===r?f[u].coordinate:v,y:"horizontal"===r?g:f[u].coordinate}:Qp;i.setState(Xp(Xp({},e),{},{activeLabel:b,activeCoordinate:w,activePayload:x,activeTooltipIndex:u}))}else i.setState(e)})),Vp($p(i),"verticalCoordinatesGenerator",(function(e,t){var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return $a(As(Xp(Xp(Xp({},_u.defaultProps),r),{},{ticks:qa(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)})),Vp($p(i),"horizontalCoordinatesGenerator",(function(e,t){var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return $a(As(Xp(Xp(Xp({},_u.defaultProps),r),{},{ticks:qa(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)})),Vp($p(i),"axesTicksGenerator",(function(e){return qa(e,!0)})),Vp($p(i),"renderCursor",(function(e){var t,n=i.state,o=n.isTooltipActive,a=n.activeCoordinate,c=n.activePayload,l=n.offset,s=n.activeTooltipIndex,u=n.tooltipAxisBandSize,p=i.getTooltipEventType(),f=null!==(t=e.props.active)&&void 0!==t?t:o;if(!e||!e.props.cursor||!f||!a||"ScatterChart"!==r&&"axis"!==p)return null;var h,m=i.props.layout,y=hu;if("ScatterChart"===r)h=a,y=xu;else if("BarChart"===r)h=function(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-i:r.left+.5,y:"horizontal"===e?r.top+.5:t.y-i,width:"horizontal"===e?n:r.width-1,height:"horizontal"===e?r.height-1:n}}(m,a,l,u),y=ml;else if("radial"===m){var v=bi(a),g=v.cx,b=v.cy,x=v.radius;h={cx:g,cy:b,startAngle:v.startAngle,endAngle:v.endAngle,innerRadius:x,outerRadius:x},y=Il}else h={points:Dp(m,a,l)},y=hu;var w=e.key||"_recharts-cursor",O=Xp(Xp(Xp(Xp({stroke:"#ccc",pointerEvents:"none"},l),h),Io(e.props.cursor)),{},{payload:c,payloadIndex:s,key:w,className:"recharts-tooltip-cursor"});return(0,d.isValidElement)(e.props.cursor)?(0,d.cloneElement)(e.props.cursor,O):(0,d.createElement)(y,O)})),Vp($p(i),"renderPolarAxis",(function(e,t,r){var n=Qn()(e,"type.axisType"),o=Qn()(i.state,"".concat(n,"Map")),a=o&&o[e.props["".concat(n,"Id")]];return(0,d.cloneElement)(e,Xp(Xp({},a),{},{className:n,key:e.key||"".concat(t,"-").concat(r),ticks:qa(a,!0)}))})),Vp($p(i),"renderXAxis",(function(e,t,r){var n=i.state.xAxisMap[e.props.xAxisId];return i.renderAxis(n,e,t,r)})),Vp($p(i),"renderYAxis",(function(e,t,r){var n=i.state.yAxisMap[e.props.yAxisId];return i.renderAxis(n,e,t,r)})),Vp($p(i),"renderGrid",(function(e){var t=i.state,r=t.xAxisMap,n=t.yAxisMap,o=t.offset,a=i.props,c=a.width,l=a.height,s=Mi(r),u=ii()(n,(function(e){return ai()(e.domain,Number.isFinite)}))||Mi(n),p=e.props||{};return(0,d.cloneElement)(e,{key:e.key||"grid",x:Pi(p.x)?p.x:o.left,y:Pi(p.y)?p.y:o.top,width:Pi(p.width)?p.width:o.width,height:Pi(p.height)?p.height:o.height,xAxis:s,yAxis:u,offset:o,chartWidth:c,chartHeight:l,verticalCoordinatesGenerator:p.verticalCoordinatesGenerator||i.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:p.horizontalCoordinatesGenerator||i.horizontalCoordinatesGenerator})})),Vp($p(i),"renderPolarGrid",(function(e){var t=e.props,r=t.radialLines,n=t.polarAngles,o=t.polarRadius,a=i.state,c=a.radiusAxisMap,l=a.angleAxisMap,s=Mi(c),u=Mi(l),p=u.cx,f=u.cy,h=u.innerRadius,m=u.outerRadius;return(0,d.cloneElement)(e,{polarAngles:Array.isArray(n)?n:qa(u,!0).map((function(e){return e.coordinate})),polarRadius:Array.isArray(o)?o:qa(s,!0).map((function(e){return e.coordinate})),cx:p,cy:f,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:r})})),Vp($p(i),"renderLegend",(function(){var e=i.state.formattedGraphicalItems,t=i.props,r=t.children,n=t.width,o=t.height,a=i.props.margin||{},c=n-(a.left||0)-(a.right||0),l=Pa({children:r,formattedGraphicalItems:e,legendWidth:c,legendContent:s});if(!l)return null;var u=l.item,p=Lp(l,Mp);return(0,d.cloneElement)(u,Xp(Xp({},p),{},{chartWidth:n,chartHeight:o,margin:a,onBBoxUpdate:i.handleLegendBBoxUpdate}))})),Vp($p(i),"renderTooltip",(function(){var e,t=Ao(i.props.children,ou);if(!t)return null;var r=i.state,n=r.isTooltipActive,o=r.activeCoordinate,a=r.activePayload,c=r.activeLabel,l=r.offset,s=null!==(e=t.props.active)&&void 0!==e?e:n;return(0,d.cloneElement)(t,{viewBox:Xp(Xp({},l),{},{x:l.left,y:l.top}),active:s,label:c,payload:s?a:[],coordinate:o})})),Vp($p(i),"renderBrush",(function(e){var t=i.props,r=t.margin,n=t.data,o=i.state,a=o.offset,c=o.dataStartIndex,l=o.dataEndIndex,s=o.updateId;return(0,d.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:Ua(i.handleBrushChange,e.props.onChange),data:n,x:Pi(e.props.x)?e.props.x:a.left,y:Pi(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(r.bottom||0),width:Pi(e.props.width)?e.props.width:a.width,startIndex:c,endIndex:l,updateId:"brush-".concat(s)})})),Vp($p(i),"renderReferenceElement",(function(e,t,r){if(!e)return null;var n=$p(i).clipPathId,o=i.state,a=o.xAxisMap,c=o.yAxisMap,l=o.offset,s=e.props,u=s.xAxisId,p=s.yAxisId;return(0,d.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(r),xAxis:a[u],yAxis:c[p],viewBox:{x:l.left,y:l.top,width:l.width,height:l.height},clipPathId:n})})),Vp($p(i),"renderActivePoints",(function(e){var t=e.item,r=e.activePoint,n=e.basePoint,i=e.childIndex,o=e.isRange,a=[],c=t.props.key,l=t.item.props,s=l.activeDot,p=Xp(Xp({index:i,dataKey:l.dataKey,cx:r.x,cy:r.y,r:4,fill:Ba(t.item),strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value,key:"".concat(c,"-activePoint-").concat(i)},Io(s)),mo(s));return a.push(u.renderActiveDot(s,p)),n?a.push(u.renderActiveDot(s,Xp(Xp({},p),{},{cx:n.x,cy:n.y,key:"".concat(c,"-basePoint-").concat(i)}))):o&&a.push(null),a})),Vp($p(i),"renderGraphicChild",(function(e,t,r){var n=i.filterFormatItem(e,t,r);if(!n)return null;var o=i.getTooltipEventType(),a=i.state,c=a.isTooltipActive,l=a.tooltipAxis,s=a.activeTooltipIndex,u=a.activeLabel,p=Ao(i.props.children,ou),f=n.props,h=f.points,m=f.isRange,y=f.baseLine,v=n.item.props,g=v.activeDot,b=v.hide,x=v.activeBar,w=v.activeShape,O=Boolean(!b&&c&&p&&(g||x||w)),k={};"axis"!==o&&p&&"click"===p.props.trigger?k={onClick:Ua(i.handleItemMouseEnter,e.props.onClick)}:"axis"!==o&&(k={onMouseLeave:Ua(i.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:Ua(i.handleItemMouseEnter,e.props.onMouseEnter)});var S=(0,d.cloneElement)(e,Xp(Xp({},n.props),k));if(O){if(!(s>=0)){var j,E=(null!==(j=i.getItemByXY(i.state.activeCoordinate))&&void 0!==j?j:{graphicalItem:S}).graphicalItem,A=E.item,P=void 0===A?e:A,T=E.childIndex,C=Xp(Xp(Xp({},n.props),k),{},{activeIndex:T});return[(0,d.cloneElement)(P,C),null,null]}var I,D;if(l.dataKey&&!l.allowDuplicatedCategory){var M="function"==typeof l.dataKey?function(e){return"function"==typeof l.dataKey?l.dataKey(e.payload):null}:"payload.".concat(l.dataKey.toString());I=Ri(h,M,u),D=m&&y&&Ri(y,M,u)}else I=null==h?void 0:h[s],D=m&&y&&y[s];if(w||x){var N=void 0!==e.props.activeIndex?e.props.activeIndex:s;return[(0,d.cloneElement)(e,Xp(Xp(Xp({},n.props),k),{},{activeIndex:N})),null,null]}if(!Gn()(I))return[S].concat(Wp(i.renderActivePoints({item:n,activePoint:I,basePoint:D,childIndex:s,isRange:m})))}return m?[S,null,null]:[S,null]})),Vp($p(i),"renderCustomized",(function(e,t,r){return(0,d.cloneElement)(e,Xp(Xp({key:"recharts-customized-".concat(r)},i.props),i.state))})),Vp($p(i),"renderMap",{CartesianGrid:{handler:i.renderGrid,once:!0},ReferenceArea:{handler:i.renderReferenceElement},ReferenceLine:{handler:i.renderReferenceElement},ReferenceDot:{handler:i.renderReferenceElement},XAxis:{handler:i.renderXAxis},YAxis:{handler:i.renderYAxis},Brush:{handler:i.renderBrush,once:!0},Bar:{handler:i.renderGraphicChild},Line:{handler:i.renderGraphicChild},Area:{handler:i.renderGraphicChild},Radar:{handler:i.renderGraphicChild},RadialBar:{handler:i.renderGraphicChild},Scatter:{handler:i.renderGraphicChild},Pie:{handler:i.renderGraphicChild},Funnel:{handler:i.renderGraphicChild},Tooltip:{handler:i.renderCursor,once:!0},PolarGrid:{handler:i.renderPolarGrid,once:!0},PolarAngleAxis:{handler:i.renderPolarAxis},PolarRadiusAxis:{handler:i.renderPolarAxis},Customized:{handler:i.renderCustomized}}),i.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:Ii("recharts"),"-clip"),i.throttleTriggeredAfterMouseMove=ri()(i.triggeredAfterMouseMove,null!==(n=e.throttleDelay)&&void 0!==n?n:1e3/60),i.state={},i}return t=u,n=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:null!==(r=this.props.margin.left)&&void 0!==r?r:0,top:null!==(n=this.props.margin.top)&&void 0!==n?n:0}}),null):null;var r,n}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=Ao(this.props.children,ou);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return c.indexOf(t)>=0?t:o}return o}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t,r=this.container,n=r.getBoundingClientRect(),i=(t=n).top+window.scrollY-document.documentElement.clientTop,o=t.left+window.scrollX-document.documentElement.clientLeft,a={chartX:Math.round(e.pageX-o),chartY:Math.round(e.pageY-i)},c=n.width/r.offsetWidth||1,l=this.inRange(a.chartX,a.chartY,c);if(!l)return null;var s=this.state,u=s.xAxisMap,p=s.yAxisMap;if("axis"!==this.getTooltipEventType()&&u&&p){var d=Mi(u).scale,f=Mi(p).scale,h=d&&d.invert?d.invert(a.chartX):null,m=f&&f.invert?f.invert(a.chartY):null;return Xp(Xp({},a),{},{xValue:h,yValue:m})}var y=rd(this.state,this.props.data,this.props.layout,l);return y?Xp(Xp({},a),y):null}},{key:"inRange",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,i=e/r,o=t/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return i>=a.left&&i<=a.left+a.width&&o>=a.top&&o<=a.top+a.height?{x:i,y:o}:null}var c=this.state,l=c.angleAxisMap,s=c.radiusAxisMap;if(l&&s){var u=Mi(l);return gi({x:i,y:o},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),r=Ao(e,ou),n={};return r&&"axis"===t&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),Xp(Xp({},mo(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){jp.on(Ep,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){jp.removeListener(Ep,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,r){for(var n=this.state.formattedGraphicalItems,i=0,o=n.length;i<o;i++){var a=n[i];if(a.item===e||a.props.key===e.key||t===Oo(a.item.type)&&r===a.childIndex)return a}return null}},{key:"renderAxis",value:function(e,t,r,n){var i=this.props,o=i.width,a=i.height;return f().createElement(_u,Bp({},e,{className:li()("recharts-".concat(e.axisType," ").concat(e.axisType),e.className),key:t.key||"".concat(r,"-").concat(n),viewBox:{x:0,y:0,width:o,height:a},ticksGenerator:this.axesTicksGenerator}))}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,r=t.left,n=t.top,i=t.height,o=t.width;return f().createElement("defs",null,f().createElement("clipPath",{id:e},f().createElement("rect",{x:r,y:n,height:i,width:o})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=_p(t,2),n=r[0],i=r[1];return Xp(Xp({},e),{},Vp({},n,i.scale))}),{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=_p(t,2),n=r[0],i=r[1];return Xp(Xp({},e),{},Vp({},n,i.scale))}),{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,r=t.formattedGraphicalItems,n=t.activeItem;if(r&&r.length)for(var i=0,o=r.length;i<o;i++){var a=r[i],c=a.props,l=a.item,s=Oo(l.type);if("Bar"===s){var u=(c.data||[]).find((function(t){return fl(e,t)}));if(u)return{graphicalItem:a,payload:u}}else if("RadialBar"===s){var p=(c.data||[]).find((function(t){return gi(e,t)}));if(p)return{graphicalItem:a,payload:p}}else if(zl(a,n)||Fl(a,n)||$l(a,n)){var d=Hl({graphicalItem:a,activeTooltipItem:n,itemData:l.props.data}),f=void 0===l.props.activeIndex?d:l.props.activeIndex;return{graphicalItem:Xp(Xp({},a),{},{childIndex:f}),payload:$l(a,n)?l.props.data[d]:a.props.data[d]}}}return null}},{key:"render",value:function(){var e=this;if(!Po(this))return null;var t,r,n=this.props,i=n.children,o=n.className,a=n.width,c=n.height,l=n.style,s=n.compact,u=n.title,p=n.desc,d=Lp(n,Np),h=Io(d);if(s)return f().createElement(Ho,Bp({},h,{width:a,height:c,title:u,desc:p}),this.renderClipPath(),No(i,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(t=this.props.tabIndex)&&void 0!==t?t:0,h.role=null!==(r=this.props.role)&&void 0!==r?r:"img",h.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},h.onFocus=function(){e.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return f().createElement("div",Bp({className:li()("recharts-wrapper",o),style:Xp({position:"relative",cursor:"default",width:a,height:c},l)},m,{ref:function(t){e.container=t},role:"region"}),f().createElement(Ho,Bp({},h,{width:a,height:c,title:u,desc:p,style:Zp}),this.renderClipPath(),No(i,this.renderMap)),this.renderLegend(),this.renderTooltip())}}],n&&zp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),u}(d.Component),Vp(t,"displayName",r),Vp(t,"defaultProps",Xp({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),Vp(t,"getDerivedStateFromProps",(function(e,t){var r=e.dataKey,n=e.data,i=e.children,o=e.width,a=e.height,c=e.layout,l=e.stackOffset,s=e.margin;if(void 0===t.updateId){var u=id(e);return Xp(Xp(Xp({},u),{},{updateId:0},h(Xp(Xp({props:e},u),{},{updateId:0}),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(r!==t.prevDataKey||n!==t.prevData||o!==t.prevWidth||a!==t.prevHeight||c!==t.prevLayout||l!==t.prevStackOffset||!lo(s,t.prevMargin)){var p=id(e),d={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},f=Xp(Xp({},rd(t,n,c)),{},{updateId:t.updateId+1}),m=Xp(Xp(Xp({},p),d),f);return Xp(Xp(Xp({},m),h(Xp({props:e},m),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(!Do(i,t.prevChildren)){var y=Gn()(n)?t.updateId+1:t.updateId;return Xp(Xp({updateId:y},h(Xp(Xp({props:e},t),{},{updateId:y}),t)),{},{prevChildren:i})}return null})),Vp(t,"renderActiveDot",(function(e,t){var r;return r=(0,d.isValidElement)(e)?(0,d.cloneElement)(e,t):Vn()(e)?e(t):f().createElement(Ou,t),f().createElement(Bo,{className:"recharts-active-dot",key:t.key},r)})),t},cd=["type","layout","connectNulls","ref"];function ld(e){return ld="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ld(e)}function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sd.apply(this,arguments)}function ud(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ud(Object(r),!0).forEach((function(t){gd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ud(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function dd(e){return function(e){if(Array.isArray(e))return fd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return fd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fd(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bd(n.key),n)}}function md(e,t){return md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},md(e,t)}function yd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vd(e){return vd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vd(e)}function gd(e,t,r){return(t=bd(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bd(e){var t=function(e,t){if("object"!==ld(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ld(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ld(t)?t:String(t)}var xd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&md(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vd(i);if(o){var r=vd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ld(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return yd(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return gd(yd(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0,totalLength:0}),gd(yd(e),"generateSimpleStrokeDasharray",(function(e,t){return"".concat(t,"px ").concat(e-t,"px")})),gd(yd(e),"getStrokeDasharray",(function(t,r,n){var i=n.reduce((function(e,t){return e+t}));if(!i)return e.generateSimpleStrokeDasharray(r,t);for(var o=Math.floor(t/i),a=t%i,l=r-t,s=[],u=0,p=0;u<n.length;p+=n[u],++u)if(p+n[u]>a){s=[].concat(dd(n.slice(0,u)),[a-p]);break}var d=s.length%2==0?[0,l]:[l];return[].concat(dd(c.repeat(n,o)),dd(s),d).map((function(e){return"".concat(e,"px")})).join(", ")})),gd(yd(e),"id",Ii("recharts-line-")),gd(yd(e),"pathRef",(function(t){e.mainCurve=t})),gd(yd(e),"handleAnimationEnd",(function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()})),gd(yd(e),"handleAnimationStart",(function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(dd(e),[0]):e,n=[],i=0;i<t;++i)n=[].concat(dd(n),dd(r));return n}},{key:"renderDotItem",value:function(e,t){var r;if(f().isValidElement(e))r=f().cloneElement(e,t);else if(Vn()(e))r=e(t);else{var n=li()("recharts-line-dot",e?e.className:"");r=f().createElement(Ou,sd({},t,{className:n}))}return r}}],(r=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.points,i=r.xAxis,o=r.yAxis,a=r.layout,c=Eo(r.children,$o);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:Ra(e.payload,t)}},s={clipPath:e?"url(#clipPath-".concat(t,")"):null};return f().createElement(Bo,s,c.map((function(e){return f().cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,dataPointFormatter:l})})))}},{key:"renderDots",value:function(e,t,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,i=n.dot,o=n.points,a=n.dataKey,l=Io(this.props),s=Io(i,!0),u=o.map((function(e,t){var r=pd(pd(pd({key:"dot-".concat(t),r:3},l),s),{},{value:e.value,dataKey:a,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(i,r)})),p={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return f().createElement(Bo,sd({className:"recharts-line-dots",key:"dots"},p),u)}},{key:"renderCurveStatically",value:function(e,t,r,n){var i=this.props,o=i.type,a=i.layout,c=i.connectNulls,l=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,cd)),s=pd(pd(pd({},Io(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},n),{},{type:o,layout:a,connectNulls:c});return f().createElement(hu,sd({},s,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.strokeDasharray,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=n.animateNewValues,d=n.width,h=n.height,m=this.state,y=m.prevPoints,v=m.totalLength;return f().createElement(ic(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"line-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(y){var c=y.length/i.length,l=i.map((function(e,t){var r=Math.floor(t*c);if(y[r]){var n=y[r],i=Ni(n.x,e.x),o=Ni(n.y,e.y);return pd(pd({},e),{},{x:i(a),y:o(a)})}if(p){var l=Ni(2*d,e.x),s=Ni(h/2,e.y);return pd(pd({},e),{},{x:l(a),y:s(a)})}return pd(pd({},e),{},{x:e.x,y:e.y})}));return r.renderCurveStatically(l,e,t)}var s,u=Ni(0,v)(a);if(o){var f="".concat(o).split(/[,\s]+/gim).map((function(e){return parseFloat(e)}));s=r.getStrokeDasharray(u,v,f)}else s=r.generateSimpleStrokeDasharray(v,u);return r.renderCurveStatically(i,e,t,{strokeDasharray:s})}))}},{key:"renderCurve",value:function(e,t){var r=this.props,n=r.points,i=r.isAnimationActive,o=this.state,a=o.prevPoints,c=o.totalLength;return i&&n&&n.length&&(!a&&c>0||!no()(a,n))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(n,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.xAxis,c=t.yAxis,l=t.top,s=t.left,u=t.width,p=t.height,d=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=li()("recharts-line",o),g=a&&a.allowDataOverflow,b=c&&c.allowDataOverflow,x=g||b,w=Gn()(h)?this.id:h,O=null!==(e=Io(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,S=void 0===k?3:k,j=O.strokeWidth,E=void 0===j?2:j,A=(Co(n)?n:{}).clipDot,P=void 0===A||A,T=2*S+E;return f().createElement(Bo,{className:v},g||b?f().createElement("defs",null,f().createElement("clipPath",{id:"clipPath-".concat(w)},f().createElement("rect",{x:g?s:s-u/2,y:b?l:l-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&f().createElement("clipPath",{id:"clipPath-dots-".concat(w)},f().createElement("rect",{x:s-T/2,y:l-T/2,width:u+T,height:p+T}))):null,!y&&this.renderCurve(x,w),this.renderErrorBar(x,w),(y||n)&&this.renderDots(x,P,w),(!d||m)&&rl.renderCallByParent(this.props,i))}}])&&hd(t.prototype,r),n&&hd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);gd(xd,"displayName","Line"),gd(xd,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!_i.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),gd(xd,"getComposedData",(function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,a=e.dataKey,c=e.bandSize,l=e.displayedData,s=e.offset,u=t.layout;return pd({points:l.map((function(e,t){var l=Ra(e,a);return"horizontal"===u?{x:Va({axis:r,ticks:i,bandSize:c,entry:e,index:t}),y:Gn()(l)?null:n.scale(l),value:l,payload:e}:{x:Gn()(l)?null:r.scale(l),y:Va({axis:n,ticks:o,bandSize:c,entry:e,index:t}),value:l,payload:e}})),layout:u},s)}));var wd=function(){return null};wd.displayName="XAxis",wd.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0};var Od=function(){return null};Od.displayName="YAxis",Od.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1};var kd,Sd=ad({chartName:"LineChart",GraphicalChild:xd,axisComponents:[{axisType:"xAxis",AxisComp:wd},{axisType:"yAxis",AxisComp:Od}],formatAxisMap:vs}),jd=ad({chartName:"BarChart",GraphicalChild:us,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:wd},{axisType:"yAxis",AxisComp:Od}],formatAxisMap:vs}),Ed=["layout","type","stroke","connectNulls","isRange","ref"];function Ad(e){return Ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ad(e)}function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pd.apply(this,arguments)}function Td(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Td(Object(r),!0).forEach((function(t){Rd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Td(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Id(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_d(n.key),n)}}function Dd(e,t){return Dd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dd(e,t)}function Md(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nd(e){return Nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nd(e)}function Rd(e,t,r){return(t=_d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _d(e){var t=function(e,t){if("object"!==Ad(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ad(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ad(t)?t:String(t)}var Bd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dd(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Nd(i);if(o){var r=Nd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ad(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Md(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Rd(Md(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0}),Rd(Md(e),"id",Ii("recharts-area-")),Rd(Md(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),Vn()(t)&&t()})),Rd(Md(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),Vn()(t)&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],(r=[{key:"renderDots",value:function(e,t,r){var n=this.props.isAnimationActive,i=this.state.isAnimationFinished;if(n&&!i)return null;var o=this.props,a=o.dot,l=o.points,s=o.dataKey,u=Io(this.props),p=Io(a,!0),d=l.map((function(e,t){var r=Cd(Cd(Cd({key:"dot-".concat(t),r:3},u),p),{},{dataKey:s,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return c.renderDotItem(a,r)})),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return f().createElement(Bo,Pd({className:"recharts-area-dots"},h),d)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].x,a=n[n.length-1].x,c=e*Math.abs(o-a),l=Ki()(n.map((function(e){return e.y||0})));return Pi(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(Ki()(r.map((function(e){return e.y||0}))),l)),Pi(l)?f().createElement("rect",{x:o<a?o:o-c,y:0,width:c,height:Math.floor(l+(i?parseInt("".concat(i),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].y,a=n[n.length-1].y,c=e*Math.abs(o-a),l=Ki()(n.map((function(e){return e.x||0})));return Pi(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(Ki()(r.map((function(e){return e.x||0}))),l)),Pi(l)?f().createElement("rect",{x:0,y:o<a?o:o-c,width:l+(i?parseInt("".concat(i),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,r,n){var i=this.props,o=i.layout,a=i.type,c=i.stroke,l=i.connectNulls,s=i.isRange,u=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,Ed));return f().createElement(Bo,{clipPath:r?"url(#clipPath-".concat(n,")"):null},f().createElement(hu,Pd({},Io(u,!0),{points:e,connectNulls:l,type:a,baseLine:t,layout:o,stroke:"none",className:"recharts-area-area"})),"none"!==c&&f().createElement(hu,Pd({},Io(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:e})),"none"!==c&&s&&f().createElement(hu,Pd({},Io(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.baseLine,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=this.state,d=p.prevPoints,h=p.prevBaseLine;return f().createElement(ic(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"area-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(d){var c,l=d.length/i.length,s=i.map((function(e,t){var r=Math.floor(t*l);if(d[r]){var n=d[r],i=Ni(n.x,e.x),o=Ni(n.y,e.y);return Cd(Cd({},e),{},{x:i(a),y:o(a)})}return e}));return c=Pi(o)&&"number"==typeof o?Ni(h,o)(a):Gn()(o)||ki()(o)?Ni(h,0)(a):o.map((function(e,t){var r=Math.floor(t*l);if(h[r]){var n=h[r],i=Ni(n.x,e.x),o=Ni(n.y,e.y);return Cd(Cd({},e),{},{x:i(a),y:o(a)})}return e})),r.renderAreaStatically(s,c,e,t)}return f().createElement(Bo,null,f().createElement("defs",null,f().createElement("clipPath",{id:"animationClipPath-".concat(t)},r.renderClipRect(a))),f().createElement(Bo,{clipPath:"url(#animationClipPath-".concat(t,")")},r.renderAreaStatically(i,o,e,t)))}))}},{key:"renderArea",value:function(e,t){var r=this.props,n=r.points,i=r.baseLine,o=r.isAnimationActive,a=this.state,c=a.prevPoints,l=a.prevBaseLine,s=a.totalLength;return o&&n&&n.length&&(!c&&s>0||!no()(c,n)||!no()(l,i))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(n,i,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.top,c=t.left,l=t.xAxis,s=t.yAxis,u=t.width,p=t.height,d=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=li()("recharts-area",o),g=l&&l.allowDataOverflow,b=s&&s.allowDataOverflow,x=g||b,w=Gn()(h)?this.id:h,O=null!==(e=Io(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,S=void 0===k?3:k,j=O.strokeWidth,E=void 0===j?2:j,A=(Co(n)?n:{}).clipDot,P=void 0===A||A,T=2*S+E;return f().createElement(Bo,{className:v},g||b?f().createElement("defs",null,f().createElement("clipPath",{id:"clipPath-".concat(w)},f().createElement("rect",{x:g?c:c-u/2,y:b?a:a-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&f().createElement("clipPath",{id:"clipPath-dots-".concat(w)},f().createElement("rect",{x:c-T/2,y:a-T/2,width:u+T,height:p+T}))):null,y?null:this.renderArea(x,w),(n||y)&&this.renderDots(x,P,w),(!d||m)&&rl.renderCallByParent(this.props,i))}}])&&Id(t.prototype,r),n&&Id(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);kd=Bd,Rd(Bd,"displayName","Area"),Rd(Bd,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!_i.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),Rd(Bd,"getBaseValue",(function(e,t,r,n){var i=e.layout,o=e.baseValue,a=t.props.baseValue,c=null!=a?a:o;if(Pi(c)&&"number"==typeof c)return c;var l="horizontal"===i?n:r,s=l.scale.domain();if("number"===l.type){var u=Math.max(s[0],s[1]),p=Math.min(s[0],s[1]);return"dataMin"===c?p:"dataMax"===c||u<0?u:Math.max(Math.min(s[0],s[1]),0)}return"dataMin"===c?s[0]:"dataMax"===c?s[1]:s[0]})),Rd(Bd,"getComposedData",(function(e){var t,r=e.props,n=e.item,i=e.xAxis,o=e.yAxis,a=e.xAxisTicks,c=e.yAxisTicks,l=e.bandSize,s=e.dataKey,u=e.stackedData,p=e.dataStartIndex,d=e.displayedData,f=e.offset,h=r.layout,m=u&&u.length,y=kd.getBaseValue(r,n,i,o),v="horizontal"===h,g=!1,b=d.map((function(e,t){var r;m?r=u[p+t]:(r=Ra(e,s),Array.isArray(r)?g=!0:r=[y,r]);var n=null==r[1]||m&&null==Ra(e,s);return v?{x:Va({axis:i,ticks:a,bandSize:l,entry:e,index:t}),y:n?null:o.scale(r[1]),value:r,payload:e}:{x:n?null:i.scale(r[1]),y:Va({axis:o,ticks:c,bandSize:l,entry:e,index:t}),value:r,payload:e}}));return t=m||g?b.map((function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?o.scale(t):null}:{x:null!=t?i.scale(t):null,y:e.y}})):v?o.scale(y):i.scale(y),Cd({points:b,baseLine:t,layout:h,isRange:g},f)})),Rd(Bd,"renderDotItem",(function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):Vn()(e)?e(t):f().createElement(Ou,Pd({},t,{className:"recharts-area-dot"}))}));var Ld=ad({chartName:"AreaChart",GraphicalChild:Bd,axisComponents:[{axisType:"xAxis",AxisComp:wd},{axisType:"yAxis",AxisComp:Od}],formatAxisMap:vs});function zd(e){return zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zd(e)}function Fd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fd(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==zd(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==zd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===zd(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wd=(0,d.forwardRef)((function(e,t){var r=e.aspect,n=e.initialDimension,i=void 0===n?{width:-1,height:-1}:n,o=e.width,a=void 0===o?"100%":o,c=e.height,l=void 0===c?"100%":c,s=e.minWidth,u=void 0===s?0:s,p=e.minHeight,h=e.maxHeight,m=e.children,y=e.debounce,v=void 0===y?0:y,g=e.id,b=e.className,x=e.onResize,w=e.style,O=void 0===w?{}:w,k=(0,d.useRef)(null),S=(0,d.useRef)();S.current=x,(0,d.useImperativeHandle)(t,(function(){return k}));var j,E,A=(j=(0,d.useState)({containerWidth:i.width,containerHeight:i.height}),E=2,function(e){if(Array.isArray(e))return e}(j)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(j,E)||function(e,t){if(e){if("string"==typeof e)return qd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qd(e,t):void 0}}(j,E)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),P=A[0],T=A[1],C=(0,d.useCallback)((function(e,t){T((function(r){var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}}))}),[]);(0,d.useEffect)((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,i=r.height;C(n,i),null===(t=S.current)||void 0===t||t.call(S,n,i)};v>0&&(e=ri()(e,v,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=k.current.getBoundingClientRect(),n=r.width,i=r.height;return C(n,i),t.observe(k.current),function(){t.disconnect()}}),[C,v]);var I=(0,d.useMemo)((function(){var e=P.containerWidth,t=P.containerHeight;if(e<0||t<0)return null;qo(Ai(a)||Ai(l),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",a,l),qo(!r||r>0,"The aspect(%s) must be greater than zero.",r);var n=Ai(a)?e:a,i=Ai(l)?t:l;r&&r>0&&(n?i=n/r:i&&(n=i*r),h&&i>h&&(i=h)),qo(n>0||i>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,i,a,l,u,p,r);var o=!Array.isArray(m)&&(0,co.isElement)(m)&&Oo(m.type).endsWith("Chart");return f().Children.map(m,(function(e){return(0,co.isElement)(e)?(0,d.cloneElement)(e,$d({width:n,height:i},o?{style:$d({height:"100%",width:"100%",maxHeight:i,maxWidth:n},e.props.style)}:{})):e}))}),[r,m,l,h,p,u,P,a]);return f().createElement("div",{id:g?"".concat(g):void 0,className:li()("recharts-responsive-container",b),style:$d($d({},O),{},{width:a,height:l,minWidth:u,minHeight:p,maxHeight:h}),ref:k},I)})),Ud=function(){return Ud=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ud.apply(this,arguments)},Hd={line:Sd,bar:jd,area:Ld};function Gd(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function Xd(t){var r=(0,d.useState)(t.defaultChartType||"line"),n=r[0],i=r[1],o=(0,d.useState)(null),a=o[0],c=o[1],l=(0,d.useState)(t.timeSeries),s=l[0],u=l[1],p=mn()(),f=s.length>0?Object.keys(s[0]):[],h=f[0],m=f.slice(1),y=(0,d.useState)(Gd(m)),v=y[0],g=y[1];(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],t.timeSeries,!0);t.updatedData.forEach((function(t){e=e.concat(t.timeSeries),u(e)}))}}),[t.timeSeries,t.updatedData]);var b=Hd[n];function x(e){a?c(null):e&&c(e.currentTarget)}function O(e,r){return v[e]?t.chartColors[r%t.chartColors.length]:"grey"}function k(e){return v[e]?"none":"line-through"}if(0===s.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var S,j,E,A,P=t.timeSeries[t.timeSeries.length-1],T=(S=t.timeSeries[0][h],j=P[h],E=new Date(S),A=new Date(j),Math.round(Math.abs((A.getTime()-E.getTime())/864e5)));return(0,e.jsxs)(Xr(),{className:"rustic-recharts-time-series",children:[!t.disableChartTypeToggle&&(0,e.jsxs)(Un(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,e.jsx)(K(),{"aria-label":"chart options","aria-expanded":Boolean(a),"aria-haspopup":"true",onClick:x,color:"primary",children:(0,e.jsx)(re,{name:"more_vert"})}),(0,e.jsxs)(Rr(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,open:Boolean(a),onClose:function(e){return x(e)},children:[(0,e.jsx)(w(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(Hd).map((function(t){return(0,e.jsxs)(Br(),{value:t,selected:t===n,onClick:function(){return function(e){i(e),x()}(t)},children:[t.charAt(0).toUpperCase()+t.slice(1)," ","Chart"]},t)}))]})]}),(0,e.jsxs)(Xr(),{children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",className:"rustic-recharts-time-series-description",children:t.description}),(0,e.jsx)(Wd,{aspect:t.aspectRatio,width:t.width,maxHeight:t.maxHeight,minWidth:t.minChartWidth,children:(0,e.jsxs)(b,{data:s,margin:t.chartContainerMargin,children:[(0,e.jsx)(wd,{dataKey:h,tickFormatter:function(e){return N(e,T)},stroke:p.palette.text.primary}),(0,e.jsx)(Od,{domain:["auto","auto"],width:t.yAxisLabelWidth,tickFormatter:t.yAxisTickFormatter,stroke:p.palette.text.primary}),(0,e.jsx)(ou,{labelFormatter:function(e){return[N(e,T)]},formatter:t.tooltipFormatter,contentStyle:{color:p.palette.common.black}}),(0,e.jsx)(Sa,{content:function(){return(0,e.jsx)(Xr(),{className:"rustic-recharts-time-series-legend",children:m.map((function(t,r){return(0,e.jsxs)(Xr(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=v[e]&&!m.find((function(t){return t!==e&&v[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(v)){for(var n={},i=0,o=m;i<o.length;i++){var a=o[i],c=a===e;n[a]=c}g(n)}else g(r?Gd(m):Ud(Ud({},v),((t={})[e]=!v[e],t)))}(t)},sx:{color:O(t,r)},children:[(0,e.jsx)(re,{name:"crop_16_9"}),(0,e.jsx)(w(),{variant:"body2",display:"inline",sx:{textDecorationLine:k(t)},children:t})]},r)}))})}}),m.map((function(r,i){return v[r]?function(r,i){var o=i%t.chartColors.length,a=v[r]?t.chartColors[o]:"transparent",c={onClick:t.onClick,cursor:"pointer"};switch(n){case"line":return(0,e.jsx)(xd,{type:"monotone",isAnimationActive:!1,dataKey:r,name:r,dot:!1,stroke:a,activeDot:t.onClick&&c},r);case"bar":return(0,e.jsx)(us,{dataKey:r,fill:a,onClick:t.onClick&&c.onClick,cursor:t.onClick&&c.cursor},r);case"area":return(0,e.jsxs)(d.Fragment,{children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"color".concat(r),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"5%",stopColor:a,stopOpacity:.8}),(0,e.jsx)("stop",{offset:"95%",stopColor:a,stopOpacity:0})]})}),(0,e.jsx)(Bd,{isAnimationActive:!1,dataKey:r,type:"monotone",stroke:a,fillOpacity:1,fill:"url(#color".concat(r,")"),activeDot:t.onClick&&c},r)]},r)}}(r,i):null})),t.referenceLineYAxis&&t.referenceLineYAxis.map((function(r,n){return(0,e.jsx)(mp,{y:r,label:t.referenceLineLabel&&t.referenceLineLabel[n],stroke:t.referenceLineColor&&t.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:t.referenceLineStrokeWidth&&t.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}Xd.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const Vd=Xd,Kd=require("mermaid");var Yd=r.n(Kd),Zd=function(){return Zd=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Zd.apply(this,arguments)};const Qd=function(t){var r=(0,d.useRef)(null),n=(0,d.useState)(),i=n[0],o=n[1],a=mn()(),c=X();return(0,d.useEffect)((function(){var e="dark"===a.palette.mode?"dark":"neutral",n=a.typography.fontFamily;r.current&&(Yd().initialize(Zd({theme:e,themeVariables:{fontFamily:n}},t.config)),Yd().render("mermaid-svg-".concat(c),t.diagram,r.current).then((function(e){r.current&&(r.current.innerHTML=e.svg),o("")})).catch((function(){var e;null===(e=r.current)||void 0===e||e.replaceChildren(),o("Failed to render the diagram.")})))})),(0,e.jsxs)(Wr(),{className:"rustic-mermaid-container",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{className:"rustic-mermaid",ref:r}),i&&(0,e.jsx)(w(),{variant:"body2",children:i})]})},Jd=(require("@finos/perspective-viewer"),require("@finos/perspective-viewer-datagrid"),require("@finos/perspective-viewer-d3fc"),require("@finos/perspective-viewer/dist/css/pro.css"),require("@finos/perspective-viewer/dist/css/pro-dark.css"),require("@finos/perspective"));var ef=r.n(Jd),tf=function(){return tf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},tf.apply(this,arguments)};function rf(e){return e?e.reduce((function(e,t){var r=t.dataKey,n=t.label;return e[r]=n||r,e}),{}):{}}const nf=function(t){if(0===t.data.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available."});var r=(0,d.useRef)(null),n=mn()(),i=(0,d.useState)(!1),o=i[0],a=i[1],c=n.palette.mode,l="dark"===c?"Pro Dark":"Pro Light",s=rf(t.headers),u="\n /* General Button Styles */\n button, .button:hover, #editor-container, .editable, #settings_button {\n border-radius: 16px !important;\n color: ".concat(n.palette.text.primary," !important;\n /* TODO: add background color after updating the theme */\n }\n \n #settings_button {\n border: 1px solid ").concat(n.palette.primary.light," !important;\n }\n \n /* Hide border for aggregate Selector */\n .aggregate-selector:hover {\n border: none !important;\n }\n \n /* Input and Select Elements */\n input, select, .noselect, #add-expression, .dropdown-width-container, \n .pivot-column-border, .pivot-column, .column-selector-column-border {\n border-radius: 8px !important;\n }\n \n /* Change background color */\n #settings_panel, #column_settings_sidebar {\n background: ").concat("dark"===c?"dark":"white"," !important;\n background-image: none !important;\n }\n \n /* Expression Edit Button */\n .expression-edit-button {\n display: none;\n }\n \n /* Add padding to expression input */\n #editor-container, .editable {\n padding: 8px !important;\n }\n \n /* Change Button Font Size */\n .button select, .button {\n font-size: 12px !important;\n }\n \n /* Button and Icon Colors */\n span.button {\n color: ").concat(n.palette.primary.main," !important;\n }\n \n span.button:hover:before {\n background-color: ").concat(n.palette.primary.main," !important;\n }\n \n .button select:hover, .button:hover, .psp-expression-editor__button:hover, \n .sidebar_close_button_inner:hover {\n background-color: ").concat(n.palette.primary.light," !important;\n }\n \n /* Enable Scrolling */\n #plugin_selector_container.open, #status_bar, #menu-bar, #app_panel {\n overflow: scroll !important;\n }\n \n /* Hide unused buttons */\n #debug_open_button.sidebar_close_button, .reset-default-style-disabled, \n .expression-edit-button, #theme, #status, #status_bar .input-sizer {\n display: none !important;\n }\n ");var p,f,h,m,y,v,g,b,x,O=t.config&&(f=(p=t.config).groupBy,h=p.splitBy,m=p.aggregates,y=p.sort,v=p.filter,g=p.columns,b=null==y?void 0:y.map((function(e){return[s[e[0]]||e[0],e[1]]})),x=m&&Object.fromEntries(Object.entries(m).map((function(e){var t=e[0],r=e[1];return[s[t]||t,r]}))),{group_by:null==f?void 0:f.map((function(e){return s[e]||e})),split_by:null==h?void 0:h.map((function(e){return s[e]||e})),aggregates:x,sort:b,filter:v&&function(e){return e.map((function(e){return[s[e[0]]||e[0],e[1],e[e.length-1]]}))}(v),columns:null==g?void 0:g.map((function(e){return s[e]||e}))});return(0,d.useEffect)((function(){ef().worker().table(function(e,t){var r=rf(t);return e.map((function(e){for(var t={},n=0,i=Object.entries(e);n<i.length;n++){var o=i[n],a=o[0],c=o[1];t[r[a]||a]=[c]}return t}))}(t.data,t.headers)).then((function(e){var n=r.current;n&&n.load(e).then((function(){if(n.restore(tf(tf({},O),{theme:l,title:t.title,settings:!1})),n.shadowRoot){var e=new CSSStyleSheet;e.replaceSync(u),n.shadowRoot.adoptedStyleSheets.push(e)}})).catch((function(){a(!0)}))})).catch((function(){a(!0)}))}),[t.data,l]),o?(0,e.jsx)(w(),{variant:"body2",children:"Failed to create table from data."}):(0,e.jsxs)(fn(),{direction:"column",className:"rustic-perspective-viz",children:[t.title&&(0,e.jsx)(w(),{variant:"h6",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"body1",children:t.description}),(0,e.jsx)("perspective-viewer",{ref:r,style:{fontFamily:n.typography.fontFamily}})]})},of=require("react-dom/server"),af=require("vega-embed");var cf=r.n(af),lf=function(){return lf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},lf.apply(this,arguments)};function sf(t){var r=(0,d.useRef)(null),n=(0,d.useState)(!1),i=n[0],o=n[1],a=mn()(),c="dark"===a.palette.mode,l=a.typography.fontFamily,s={backgroundColor:a.palette.primary.main,color:a.palette.background.paper,borderRadius:a.shape.borderRadius+"px",padding:"4px 8px",fontSize:a.typography.caption.fontSize,fontFamily:l,fontWeight:a.typography.caption.fontWeight},u={formatTooltip:function(t,r){return(0,of.renderToStaticMarkup)((0,e.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:s,children:Object.entries(t).map((function(t){var n=t[0],i=t[1];return(0,e.jsxs)("div",{children:[(0,e.jsxs)("strong",{children:[r(n),":"]})," ",r(i)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},p=[{label:"Save as SVG"},{label:"Save as PNG"}];function f(){var e,n,i,a;if(r.current&&t.spec){var s=lf(lf({config:{font:l}},t.options),{theme:c?null===(e=t.theme)||void 0===e?void 0:e.dark:null===(n=t.theme)||void 0===n?void 0:n.light,tooltip:u,actions:!1});(null===(a=null===(i=t.options)||void 0===i?void 0:i.config)||void 0===a?void 0:a.font)||(s.config.font=l),cf()(r.current,t.spec,s).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,i){var o="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,o).then((function(e){p[i].href=e,p[i].downloadFileName="".concat(r,".").concat(n)}))})),o(!1)})).catch((function(){o(!0)}))}}return(0,d.useEffect)((function(){function e(){f()}return f(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[t.spec,c]),i?(0,e.jsx)(w(),{variant:"body2",children:"Failed to load the chart."}):(0,e.jsxs)(fn(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,e.jsx)(Xr(),{justifyContent:"end",display:"flex",children:(0,e.jsx)(zr,{menuItems:p,ariaLabel:"Download options"})}),t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{ref:r,className:"rustic-vega-lite"})]})}const uf=sf;function pf(t){var r=(0,d.useState)(t.units),n=r[0],i=r[1];function o(e){return"metric"===t.units&&"imperial"===n?Math.round(1.8*e+32):"imperial"===t.units&&"metric"===n?Math.round(e*(5/9)-32):Math.round(e)}var a=new Date(1e3*t.weather[0].timestamp),c=B(t.weather[0].timestamp).shortName,s=a.getDate(),u=a.getFullYear().toString().slice(2),p="".concat(c," ").concat(s,"/").concat(u," TODAY"),f="HIGH: ".concat(o(t.weather[0].temp.high)," / LOW: ").concat(o(t.weather[0].temp.high)),h=t.weather.map((function(t,r){if(0!==r)return(0,e.jsxs)(pe(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,e.jsx)(w(),{variant:"h5",component:"span",color:"text.secondary","aria-label":B(t.timestamp).fullName,children:B(t.timestamp).shortName}),(0,e.jsx)("img",{src:t.weatherIcon.icon,alt:t.weatherIcon.description}),(0,e.jsxs)(w(),{variant:"body2",color:"text.secondary",children:["High: ",o(t.temp.high),"°"]}),(0,e.jsxs)(w(),{variant:"body2",color:"text.secondary",children:["Low: ",o(t.temp.low),"°"]})]},r)}));return(0,e.jsxs)(pe(),{variant:"outlined",className:"rustic-weather",children:[(0,e.jsx)(zr,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:function(){return i("metric")}},{label:"Fahrenheit",endDecorator:"°F",onClick:function(){return i("imperial")}}]}),(0,e.jsxs)(Wr(),{alignItems:"center",children:[(0,e.jsx)(w(),{variant:"h4",component:"span",children:t.location}),(0,e.jsxs)(Wr(),{direction:"row",alignItems:"center",spacing:1,className:"rustic-current-weather-description",children:[(0,e.jsx)("img",{src:t.weather[0].weatherIcon.icon,alt:""}),(0,e.jsx)(w(),{variant:"body2",children:t.weather[0].weatherIcon.description})]}),t.weather[0].temp.current&&(0,e.jsxs)(w(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[o(t.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(n)]}),(0,e.jsxs)(Wr(),{direction:"row",spacing:2,children:[(0,e.jsx)(w(),{variant:"overline",children:p}),(0,e.jsx)(w(),{variant:"overline",children:f})]})]}),(0,e.jsx)(l(),{className:"rustic-daily-weather-container",children:h}),t.weatherProvider&&(0,e.jsxs)(Wr(),{alignItems:"center",direction:"row",spacing:1,alignSelf:"center",className:"rustic-weather-attribution",children:[(0,e.jsx)(re,{name:"cloud"}),(0,e.jsx)(w(),{variant:"body2",children:"Weather data provided by ".concat(t.weatherProvider)})]})]})}sf.defaultProps={theme:{dark:"dark"}};const df=require("@mui/utils");var ff="#000000",hf="#FFFFFF",mf="#FF6928",yf="#E54500",vf="#5F5C5A",gf="#E7E7E7",bf="#CFCFCF",xf="#A7A19E",wf="#D6D0D0",Of="#D0C4BE",kf=(0,s.createTheme)({shape:{borderRadius:16},typography:{fontFamily:"Inter",h1:{fontStyle:"normal",fontWeight:300,fontSize:"94px",lineHeight:1.167,letterSpacing:"-1.5px"},h2:{fontStyle:"normal",fontWeight:300,fontSize:"59px",letterSpacing:"-0.5px",lineHeight:1.2},h3:{fontStyle:"normal",fontWeight:400,fontSize:"47px",letterSpacing:"0px",lineHeight:1.167},h4:{fontStyle:"normal",fontWeight:400,fontSize:"33px",letterSpacing:"0.25px",lineHeight:1.235},h5:{fontStyle:"normal",fontWeight:400,fontSize:"24px",letterSpacing:"0px",lineHeight:1.334},h6:{fontStyle:"normal",fontWeight:500,fontSize:"20px",letterSpacing:"0.15px",lineHeight:1.6},body1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.5px",lineHeight:1.5},body2:{fontStyle:"normal",fontWeight:400,fontSize:"14px",letterSpacing:"0.25px",lineHeight:1.43},subtitle1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.15px",lineHeight:1.75},subtitle2:{fontStyle:"normal",fontWeight:500,fontSize:"14px",letterSpacing:"0.1px",lineHeight:1.57},overline:{fontStyle:"normal",fontWeight:400,fontSize:"10px",letterSpacing:"1.5px",lineHeight:1.5,textTransform:"uppercase"},caption:{fontStyle:"normal",fontWeight:400,fontSize:"12px",letterSpacing:"0.4px",lineHeight:1.66},button:{textTransform:"capitalize"}},palette:{common:{black:ff,white:hf},error:{main:"#F82A43"},warning:{main:"#FFB800"},info:{main:"#0094FF"},success:{main:"#35A700"}},shadows:function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],(0,s.createTheme)({}).shadows.map((function(e,t){return 1===t?"0 4px 5px rgba(0, 0, 0, 0.05)":2===t?"0 4px 10px rgba(0, 0, 0, 0.1)":3===t?"0 4px 15px rgba(0, 0, 0, 0.15)":"none"})),!0),components:{MuiTableCell:{styleOverrides:{head:{backgroundColor:gf},root:{borderBottom:"1px solid ".concat(Of),padding:"8px 16px"}}},MuiTableSortLabel:{styleOverrides:{root:{"&.Mui-active":{color:ff,"& .MuiTableSortLabel-icon":{color:ff}}}}}}}),Sf="#3D3834",jf=(0,s.createTheme)((0,df.deepmerge)(kf,{palette:{mode:"light",divider:Of,text:{primary:"#1E0C04",secondary:"#4E443F",disabled:"#9C9795"},primary:{main:Sf,dark:"#2D2825",light:"#716865"},secondary:{main:mf,light:"#FFDBCC",dark:yf},background:{default:"#F7F6F5",paper:hf},action:{active:vf,hover:"#EFEAEA",selected:wf,disabledBackground:bf,focus:gf,disabled:xf}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:Sf,color:hf}}}}})),Ef="#2F2F2F",Af="#FFFCFB",Pf=(0,s.createTheme)((0,df.deepmerge)(kf,{palette:{mode:"dark",divider:Of,primary:{main:Af,dark:yf,light:"#FFDBCC"},secondary:{main:mf,light:"#FFA983",dark:yf},background:{default:"#040404",paper:Ef},text:{primary:hf,secondary:"#EBEBEB",disabled:"#C1C1C1"},action:{active:vf,hover:"#9A9A9A",selected:wf,focus:gf,disabledBackground:bf,disabled:xf}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:Af,color:Ef}}}}}));jf=(0,s.responsiveFontSizes)(jf),Pf=(0,s.responsiveFontSizes)(Pf)})(),n})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{var e,t,r={450:function(e){e.exports=function(){var e=[],t=[],r={},n={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function c(e,t){return e.replace(t[0],(function(r,n){var i,o,c=(i=t[1],o=arguments,i.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return a(""===r?e[n-1]:r,c)}))}function l(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var i=n.length;i--;){var o=n[i];if(o[0].test(t))return c(t,o)}return t}function s(e,t,r){return function(n){var i=n.toLowerCase();return t.hasOwnProperty(i)?a(n,i):e.hasOwnProperty(i)?a(n,e[i]):l(i,n,r)}}function u(e,t,r,n){return function(n){var i=n.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&l(i,i,r)===i}}function p(e,t,r){return(r?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=s(i,n,e),p.isPlural=u(i,n,e),p.singular=s(n,i,t),p.isSingular=u(n,i,t),p.addPluralRule=function(t,r){e.push([o(t),r])},p.addSingularRule=function(e,r){t.push([o(e),r])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):r[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}()},13:e=>{"use strict";e.exports=require("emoji-picker-element")}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e].call(o.exports,o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var c=2&n&&r;"object"==typeof c&&!~e.indexOf(c);c=t(c))Object.getOwnPropertyNames(c).forEach((e=>a[e]=()=>r[e]));return a.default=()=>r,i.d(o,a),o},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";i.r(o),i.d(o,{Action:()=>Vr,CodeSnippet:()=>k,CopyText:()=>Kr,ElementRenderer:()=>S,FCCalendar:()=>m,Image:()=>z,MarkedMarkdown:()=>vr,MarkedStreamingMarkdown:()=>gr,MermaidViz:()=>cf,MessageCanvas:()=>Jr,MessageSpace:()=>rn,MultimodalInput:()=>Te,Multipart:()=>on,OpenLayersMap:()=>Ge,PDFViewer:()=>En,ParticipantRole:()=>mn,ParticipantType:()=>yn,ParticipantsContainer:()=>bn,PerspectiveViz:()=>df,PopoverMenu:()=>Xr,Question:()=>An,RechartsTimeSeries:()=>rf,Sound:()=>_r,StreamingText:()=>Vn,Table:()=>Xn,Text:()=>nn,TextInput:()=>De,Timestamp:()=>Qr,Uploader:()=>Ee,VegaLiteViz:()=>gf,Video:()=>zr,Weather:()=>bf,YoutubeVideo:()=>Yn,rusticDarkTheme:()=>_f,rusticLightTheme:()=>Mf});const e=require("react/jsx-runtime"),t=require("@fullcalendar/daygrid");var r=i.n(t);const n=require("@fullcalendar/react");var a=i.n(n);const c=require("@mui/material/Box");var l=i.n(c);const s=require("@mui/material/styles"),u=require("@mui/material/useMediaQuery");var p=i.n(u);const d=require("react");var f=i.n(d);function h(e){return{title:e.title?e.title:"",start:e.start,end:e.end,allDay:e.isAllDay}}function m(t){var n=(0,s.useTheme)(),i=p()(n.breakpoints.up("md"));return(0,e.jsx)(l(),{className:"rustic-fc-calendar",children:(0,e.jsx)(a(),{plugins:[r()],initialView:i?"dayGridMonth":"dayGridDay",headerToolbar:{left:"prev,next",center:"title",right:"dayGridMonth,dayGridWeek,dayGridDay"},eventTimeFormat:{hour:"2-digit",minute:"2-digit"},initialDate:t.events[0].start,events:t.events.map(h),views:{dayGridMonth:{titleFormat:{year:"numeric",month:"short"}},dayGridWeek:{},dayGridDay:{titleFormat:{year:"numeric",month:"short",day:"numeric"}}}})})}const y=require("@codemirror/language"),v=require("@codemirror/language-data"),g=require("@codemirror/state"),b=require("@codemirror/view"),x=require("@mui/material/Typography");var w=i.n(x);const O=require("@mui/system");function k(t){var r=(0,d.useRef)(null),n=(0,d.useRef)(),i=new g.Compartment,o=[g.EditorState.readOnly.of(!0),(0,b.highlightSpecialChars)(),(0,y.syntaxHighlighting)(y.defaultHighlightStyle,{fallback:!0}),i.of([])],a=v.languages.find((function(e){return e.name.toLowerCase()===t.language.toLowerCase()}));return(0,d.useEffect)((function(){if(r.current&&!n.current){var e=r.current,c=g.EditorState.create({doc:t.code,extensions:o});n.current=new b.EditorView({state:c,parent:e}),a&&n.current&&a.load().then((function(e){var t;null===(t=n.current)||void 0===t||t.dispatch({effects:i.reconfigure(e.extension)})}))}}),[]),(0,e.jsx)(O.Box,{sx:{backgroundColor:"background.default"},className:"rustic-code-snippet",children:(0,e.jsx)("div",{"aria-label":"code snippet",ref:r,children:(0,e.jsx)(w(),{variant:"body2","aria-label":"language type",children:t.language})})})}var j=function(){return j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j.apply(this,arguments)};const S=function(t){var r=t.supportedElements[t.message.format];return(0,e.jsx)(e.Fragment,{children:r?f().createElement(r,j(j({sender:t.sender,ws:t.ws,messageId:t.message.id,conversationId:t.message.conversationId},t.message.data),t.message.threadMessagesData&&{updatedData:t.message.threadMessagesData})):(0,e.jsxs)(w(),{variant:"body2",children:["Unsupported element format: ",t.message.format]})})},E=require("@mui/material/CircularProgress");var A=i.n(E),P=i(450),T=i.n(P),C=function(){return C=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},C.apply(this,arguments)};function I(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}var D,M=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};function N(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===D.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?D.HOUR:D.MONTH_DATE)}function R(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),i=t>0?"".concat(t,":"):"",o="".concat(t>0?r.toString().padStart(2,"0"):r),a=n.toString().padStart(2,"0");return"".concat(i).concat(o,":").concat(a)}function _(e,t){var r={};return e&&(r={width:e}),t&&(r=C(C({},r),{height:t})),e||t||(r={className:"rustic-fit-container"}),r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(D||(D={}));var B=function(e){var t=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:t,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[t]}},L=function(){return L=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function z(t){var r=(0,d.useState)(!0),n=r[0],i=r[1],o=(0,d.useState)(""),a=o[0],c=o[1];return a.length>0?(0,e.jsx)(w(),{variant:"body2",children:a}):(0,e.jsxs)("figure",{children:[n&&(0,e.jsx)(A(),{}),(0,e.jsx)("img",L({},_(t.width,t.height),{src:t.src,alt:t.alt,onError:function(){c("Image failed to load"),i(!1)},onLoad:function(){i(!1)}})),t.description&&(0,e.jsx)("figcaption",{children:(0,e.jsx)(w(),{variant:"body2",children:t.description})})]})}z.defaultProps={alt:"An image is displayed"};const F=require("crypto");var $=i.n(F);const q={randomUUID:$().randomUUID},W=new Uint8Array(256);let U=W.length;function H(){return U>W.length-16&&($().randomFillSync(W),U=0),W.slice(U,U+=16)}const G=[];for(let e=0;e<256;++e)G.push((e+256).toString(16).slice(1));const X=function(e,t,r){if(q.randomUUID&&!t&&!e)return q.randomUUID();const n=(e=e||{}).random||(e.rng||H)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return G[e[t+0]]+G[e[t+1]]+G[e[t+2]]+G[e[t+3]]+"-"+G[e[t+4]]+G[e[t+5]]+"-"+G[e[t+6]]+G[e[t+7]]+"-"+G[e[t+8]]+G[e[t+9]]+"-"+G[e[t+10]]+G[e[t+11]]+G[e[t+12]]+G[e[t+13]]+G[e[t+14]]+G[e[t+15]]}(n)},V=require("@mui/material/IconButton");var K=i.n(V);const Y=require("@mui/material/InputAdornment");var Z=i.n(Y);const Q=require("@mui/material/MenuItem");var J=i.n(Q);const ee=require("@mui/material/MenuList");var te=i.n(ee);const re=require("@mui/material/Popover");var ne=i.n(re);const ie=require("@mui/material/TextField");var oe=i.n(ie);const ae=require("@mui/material/Tooltip");var ce=i.n(ae),le=i(13);function se(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}const ue=function(t){var r=(0,s.useTheme)(),n=(0,d.useRef)(null),o=(0,d.useState)(!1),a=o[0],c=o[1],l=(0,d.useState)(null),u=l[0],p=l[1],f={"--indicator-color":r.palette.divider,"--background":r.palette.background.paper,"--input-border-color":r.palette.divider,"--outline-color":r.palette.secondary.main};function h(){c(!1),u&&p(null)}function m(e){e.detail.unicode&&t.onEmojiClick(e.detail.unicode);var r=document.querySelector("emoji-picker");null==r||r.database.close().catch((function(e){console.error("Failed to close database:",e)})),h()}return(0,d.useEffect)((function(){if(a&&"undefined"!=typeof window)return Promise.resolve().then(i.t.bind(i,13,23)).then((function(e){var t=new(0,e.Picker),n="dark"===r.palette.mode?"dark":"light";t.classList.add(n),t.addEventListener("emoji-click",m),Object.keys(f).forEach((function(e){t.style.setProperty(e,f[e])})),p(t)})).catch((function(e){console.error("Failed to load emoji picker",e)})),function(){p(null)}}),[a]),(0,e.jsxs)("div",{children:[(0,e.jsx)(ce(),{title:"Emoji",children:(0,e.jsx)(K(),{size:"small",ref:n,onClick:function(){c((function(e){return!e}))},sx:{color:t.buttonColor},children:(0,e.jsx)(se,{name:"Mood"})})}),u&&(0,e.jsx)(ne(),{open:a,anchorEl:n.current,onClose:h,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,e.jsx)("div",{className:"rustic-emoji-picker",ref:function(e){return e&&e.appendChild(u)}})})]})};var pe={"no-speech":"No speech detected. Check your microphone volume and try again.",aborted:"Speech input was aborted. Ensure no other windows are accessing your microphone and try again.","audio-capture":"Could not capture any audio. Check that your microphone is connected and try again.",network:"Failed to connect to the internet for recognition. Check your internet connection and try again.","not-allowed":"This functionality requires microphone access. Please allow microphone access and try again.","service-not-allowed":"Speech recognition service is not allowed, either because the browser doesn't support it or because of reasons of security, privacy or user preference.","bad-grammar":"There was an error in the speech recognition grammar or format. Check your speech input or grammar rules.","language-not-supported":"The language you're speaking isn't supported. Try speaking in a different language or check your device settings."};function de(e){if("unicode"in e&&"annotation"in e)return"".concat(e.unicode," ").concat(e.annotation)}var fe=(0,d.forwardRef)((function(t,r){var n=(0,d.useState)(""),i=n[0],o=n[1],a=(0,d.useState)(!1),c=a[0],s=a[1],u=(0,d.useState)(!1),p=u[0],f=u[1],h=(0,d.useState)(!1),m=h[0],y=h[1],v=(0,d.useState)(""),g=v[0],b=v[1],x=(0,d.useState)([]),O=x[0],k=x[1],j=(0,d.useState)(!1),S=j[0],E=j[1],P=(0,d.useRef)(null),T=!i.trim().length&&!t.isSendEnabled,C="".concat(c?"Stop":"Start"," speech to text"),I=p?"primary.main":"primary.light",D=c?"error.main":I,M=c?"stop_circle":"speech_to_text";function N(e,t){if(void 0===t&&(t=!1),P.current){var r=P.current,n=r.selectionStart,a=r.selectionEnd;if("number"==typeof n&&"number"==typeof a){var c,l=i||"",s=l.substring(0,n),u=l.substring(a);c=t?s.replace(/:(\w+)$/,e)+u:s+e+u,o(c);var p=t?s.replace(/:(\w+)$/,e).length:n+e.length;setTimeout((function(){var e,t;null===(e=P.current)||void 0===e||e.focus(),null===(t=P.current)||void 0===t||t.setSelectionRange(p,p)}),0)}}E(!1)}var R=new le.Database,_=m?(0,e.jsx)(A(),{size:24}):(0,e.jsx)(ce(),{title:C,children:(0,e.jsx)(K(),{onClick:function(){var e=new window.webkitSpeechRecognition,t=navigator.language;e.lang=t,c?(e.stop(),y(!0),s(!1)):(e.start(),b(""),s(!0)),e.onstart=function(){s(!0)},e.onresult=function(e){var t,r=e.results[0][0].transcript;i.length>0?o(i+" "+r):o(r),null===(t=P.current)||void 0===t||t.focus(),s(!1)},e.onerror=function(e){var t=pe[e.error];b(t),s(!1)},e.onend=function(){y(!1),s(!1)}},size:"small",sx:{color:D},children:(0,e.jsx)(se,{name:M})})});function B(){var e=(new Date).toISOString(),r={id:X(),timestamp:e,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:i}};t.send(r),o(""),b("")}return(0,e.jsxs)(l(),{className:"rustic-base-input",ref:r,children:[(0,e.jsxs)(l(),{className:"rustic-error-and-input-container",children:[(0,e.jsx)(l(),{className:"rustic-error-container",children:(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:g})}),(0,e.jsxs)(l(),{className:"rustic-input-field",sx:{border:"1px solid",borderColor:p?"secondary.main":"action.disabled"},children:[O.length>0&&(0,e.jsx)(ne(),{open:S,anchorEl:P.current,onClose:function(){return E(!1)},disableAutoFocus:!0,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:(0,e.jsx)(te(),{children:O.map((function(t,r){return"unicode"in t&&(0,e.jsx)(J(),{onClick:function(){return N(t.unicode,!0)},children:de(t)},r)}))})}),(0,e.jsx)(oe(),{className:"rustic-text-field",variant:"outlined",value:i,label:t.label,placeholder:t.placeholder,maxRows:t.maxRows,multiline:t.multiline,fullWidth:t.fullWidth,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!T&&B())},onChange:function(e){b("");var r=e.target.value;o(r);var n,i=r.match(/:(\w{2,}):/g),a=r.match(/:(\w{2,})/g);if(i){var c=i[0].replace(/:/g,"");R.getEmojiByShortcode(c).then((function(e){if(e&&"unicode"in e){var t=r.replace(i[0],e.unicode);o(t)}else o(r)})).catch((function(){o(r)})),E(!1)}else a?(n=a[0].replace(":",""),R.getEmojiBySearchQuery(n).then((function(e){e.length?(k(e.slice(0,t.maximumEmojiSearchResults)),E(!0)):(k([]),E(!1))})).catch((function(){k([]),E(!1)}))):E(!1)},onFocus:function(){return f(!0)},onBlur:function(){return f(!1)},inputRef:P,color:"secondary",size:"small",InputProps:{endAdornment:(0,e.jsxs)(Z(),{position:"end",children:[(0,e.jsx)(ue,{onEmojiClick:N,buttonColor:I}),t.enableSpeechToText&&_]})},InputLabelProps:{className:p?"":"rustic-input-label",sx:{backgroundColor:"background.paper"}}}),(0,e.jsx)("div",{className:"rustic-input-extras"})]})]}),(0,e.jsxs)(l(),{className:"rustic-input-actions",children:[t.children,(0,e.jsx)(ce(),{title:"Send",children:(0,e.jsx)("span",{children:(0,e.jsx)(K(),{"aria-label":"send message",onClick:B,disabled:T,color:"primary",className:"rustic-send-button",children:(0,e.jsx)(se,{name:"send"})})})})]})]})}));fe.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,enableSpeechToText:!1,maximumEmojiSearchResults:5};const he=fe,me=require("@mui/material/LinearProgress");var ye=i.n(me);const ve=require("axios");var ge=i.n(ve);const be=require("react-dom"),xe=require("@mui/material/Card");var we=i.n(xe);function Oe(t){var r,n=(0,s.useTheme)();return(0,e.jsxs)(we(),{className:"rustic-file-preview",variant:"outlined",sx:{boxShadow:n.shadows[1]},children:[(0,e.jsx)(w(),{variant:"subtitle2",children:(r=t.file.name,15,r.length<=15?r:r.substring(0,12)+"...")}),t.children]})}var ke=function(){return ke=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ke.apply(this,arguments)},je=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function Se(e){for(var t=["Bytes","KB","MB","GB"],r=0;e>=1024&&r<t.length-1;)e/=1024,r++;var n=e.toFixed(1).toString().replace(/\.0$/,"");return"".concat(n," ").concat(t[r])}const Ee=function(t){var r=(0,d.useState)([]),n=r[0],i=r[1],o=(0,d.useState)([]),a=o[0],c=o[1],s=(0,d.useRef)({}),u=X();(0,d.useEffect)((function(){i([]),c([]),s.current={}}),[t.messageId]);var p=(0,e.jsx)(l(),{className:"rustic-files rustic-padding-16",children:n.map((function(r,n){return(0,e.jsx)(Oe,{file:{name:r.name},children:(0,e.jsxs)(l(),{className:"rustic-flex-center",children:[r.loadingProgress<100&&(0,e.jsx)(ye(),{variant:"determinate",color:"secondary",value:r.loadingProgress,className:"rustic-upload-progress"}),(0,e.jsx)(ce(),{title:"Delete",children:(0,e.jsx)(K(),{color:"primary",onClick:function(){return function(e,r){var n,o;c([]);var a=e.name;if(s.current=ke(ke({},s.current),((n={})[a]=s.current[a]--,n)),t.onFileUpdate("remove",a),100===e.loadingProgress){var l="".concat(t.deleteFileEndpoint,"?message-id=").concat(t.messageId,"&file-id=").concat(e.id);ge().delete(l).then((function(){return i((function(e){return e.filter((function(e,t){return t!==r}))}))})).catch((function(){return t.onFileUpdate("add",a),c((function(e){return je(je([],e,!0),["Failed to delete ".concat(a,". Please try again.")],!1)}))}))}else e.abortController.abort(),i((function(e){return e.filter((function(e,t){return t!==r}))})),s.current=ke(ke({},s.current),((o={})[a]=s.current[a]++,o))}(r,n)},className:"rustic-delete-button","aria-label":"cancel file upload",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"cancel"})})})]})},n)}))}),f=(0,e.jsx)(l(),{children:a.map((function(t,r){return(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:t},r)}))});function h(e,t){return t?(0,be.createPortal)(e,t):e}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l(),{className:"rustic-uploader",children:[(0,e.jsx)("label",{htmlFor:u,children:(0,e.jsx)(ce(),{title:"Upload",children:(0,e.jsx)(K(),{component:"span","aria-label":"Upload file",color:"primary",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"upload_2"})})})}),(0,e.jsx)("input",{type:"file",id:u,onChange:function(e){c([]);var r=e.target.files&&Array.from(e.target.files),o=n.length+(r?r.length:0);t.maxFileCount&&o>t.maxFileCount&&c((function(e){return je(je([],e,!0),["You can only upload ".concat(t.maxFileCount," files.")],!1)}));var a=r&&function(e,t,r){return r?t<=r?e:e.slice(0,r-t):e}(r,o,t.maxFileCount);a&&a.forEach((function(e){!function(e){var r;t.maxFileSize&&e.size>t.maxFileSize?(r=e.name,c((function(e){return je(je([],e,!0),["Failed to upload ".concat(r,". You cannot upload files larger than ").concat(t.maxFileSize&&Se(t.maxFileSize),".")],!1)}))):function(e){var r=new FormData,n=new AbortController,o=function(e){var t,r,n=e.name,i=s.current[n];if(i){var o=i+1,a=n.lastIndexOf("."),c=n.substring(0,a),l=n.substring(a);n="".concat(c,"(").concat(i,")").concat(l),s.current=ke(ke({},s.current),((t={})[e.name]=o,t))}else s.current=ke(ke({},s.current),((r={})[e.name]=1,r));return n}(e),a=new File([e],o,{type:e.type});r.append("file",a);var l=X(),u={name:o,loadingProgress:0,abortController:n,id:l};i((function(e){return je(je([],e,!0),[u],!1)})),t.onFileUpdate("add",o);var p="".concat(t.uploadFileEndpoint,"?message-id=").concat(t.messageId);ge().post(p,r,{onUploadProgress:function(e){var t,r;e.total&&(t=e.loaded/e.total*100,r=u.id,i((function(e){var n=e.map((function(e){return e.id===r?ke(ke({},e),{loadingProgress:t}):e}));return n})))},signal:n.signal}).then((function(e){var t,r;t=e.data,r=u.id,i((function(e){var n=e.findIndex((function(e){return e.id===r}));if(-1!==n){var i=je([],e,!0);return i[n]=ke(ke({},i[n]),{id:t.fileId}),i}return e}))})).catch((function(r){var n,a;t.onFileUpdate("remove",o),s.current=ke(ke({},s.current),((n={})[o]=s.current[e.name]--,n)),function(e,t,r){c((function(t){return je(je([],t,!0),["Failed to upload ".concat(e,". ").concat((null==r?void 0:r.message)||"")],!1)})),i((function(e){return e.filter((function(e){return e.id!==t}))}))}(e.name,u.id,null===(a=r.response)||void 0===a?void 0:a.data)}))}(e)}(e)})),e.target.value=""},multiple:!0,accept:t.acceptedFileTypes})]}),a.length>0&&h(f,t.errorMessagesContainer),n.length>0&&h(p,t.filePreviewsContainer)]})};var Ae=function(){return Ae=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ae.apply(this,arguments)},Pe=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function Te(t){var r=(0,d.useState)([]),n=r[0],i=r[1],o=(0,d.useState)(X()),a=o[0],c=o[1],s=(0,d.useState)(),u=s[0],p=s[1],f=(0,d.useState)(),h=f[0],m=f[1],y=(0,d.useRef)(null),v=n.length>0;return(0,d.useEffect)((function(){y.current&&(m(y.current.querySelector(".rustic-error-container")),p(y.current.querySelector(".rustic-input-extras")))})),(0,e.jsx)(l(),{className:"rustic-multimodal-input",children:(0,e.jsx)(he,Ae({},t,{send:function(e){v&&(e.id=a,e.format="multipart",e.data.files=n),t.ws.send(e),c(X()),i([])},isSendEnabled:v,ref:y,children:(0,e.jsx)(l(),{className:"rustic-bottom-buttons",children:(0,e.jsx)(Ee,{acceptedFileTypes:t.acceptedFileTypes,maxFileCount:t.maxFileCount,maxFileSize:t.maxFileSize,uploadFileEndpoint:t.uploadFileEndpoint,deleteFileEndpoint:t.deleteFileEndpoint,onFileUpdate:function(e,t){i("add"===e?function(e){return Pe(Pe([],e,!0),[{name:t}],!1)}:function(e){return e.filter((function(e){return e.name!==t}))})},messageId:a,filePreviewsContainer:u,errorMessagesContainer:h})})}))})}Te.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,maxFileSize:2097152,maxFileCount:1};var Ce=function(){return Ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ce.apply(this,arguments)},Ie=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};function De(t){var r=t.ws,n=Ie(t,["ws"]);return(0,e.jsx)(he,Ce({},n,{send:function(e){r.send(e)}}))}require("ol/ol.css");const Me=require("@mui/material/Alert");var Ne=i.n(Me);const Re=require("ol/layer/Tile.js");var _e=i.n(Re);const Be=require("ol/Map.js");var Le=i.n(Be);const ze=require("ol/Overlay.js");var Fe=i.n(ze);const $e=require("ol/proj.js"),qe=require("ol/source/OSM.js");var We=i.n(qe);const Ue=require("ol/View.js");var He=i.n(Ue);function Ge(t){var r=(0,d.useState)(""),n=r[0],i=r[1],o=(0,d.useRef)(null),a=(0,d.useRef)(null);return(0,d.useEffect)((function(){if(i(""),t.latitude<-90||t.latitude>90||t.longitude<-180||t.longitude>180)return i("Invalid coordinates");if(o.current&&a.current){var e=new(Le())({layers:[new(_e())({source:new(We())})],view:new(He())({center:(0,$e.fromLonLat)([t.longitude,t.latitude]),zoom:12}),target:o.current}),r=new(Fe())({element:a.current,position:(0,$e.fromLonLat)([t.longitude,t.latitude]),positioning:"bottom-center",stopEvent:!1});return e.addOverlay(r),e.once("postrender",(function(){var e;if(!(null===(e=o.current)||void 0===e?void 0:e.querySelector("canvas")))return i("An error occurred while loading the map")})),function(){e.setTarget(""),e.removeOverlay(r)}}}),[]),(0,e.jsx)(e.Fragment,{children:n.length>0?(0,e.jsx)(Ne(),{severity:"error",children:n}):(0,e.jsxs)(l(),{children:[(0,e.jsx)(l(),{ref:a,children:(0,e.jsx)(se,{className:"rustic-open-layers-map-marker",name:"location_on"})}),(0,e.jsx)("div",{ref:o,className:"rustic-open-layers-map-canvas"})]})})}const{entries:Xe,setPrototypeOf:Ve,isFrozen:Ke,getPrototypeOf:Ye,getOwnPropertyDescriptor:Ze}=Object;let{freeze:Qe,seal:Je,create:et}=Object,{apply:tt,construct:rt}="undefined"!=typeof Reflect&&Reflect;Qe||(Qe=function(e){return e}),Je||(Je=function(e){return e}),tt||(tt=function(e,t,r){return e.apply(t,r)}),rt||(rt=function(e,t){return new e(...t)});const nt=mt(Array.prototype.forEach),it=mt(Array.prototype.pop),ot=mt(Array.prototype.push),at=mt(String.prototype.toLowerCase),ct=mt(String.prototype.toString),lt=mt(String.prototype.match),st=mt(String.prototype.replace),ut=mt(String.prototype.indexOf),pt=mt(String.prototype.trim),dt=mt(RegExp.prototype.test),ft=(ht=TypeError,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return rt(ht,t)});var ht;function mt(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return tt(e,t,n)}}function yt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at;Ve&&Ve(e,null);let n=t.length;for(;n--;){let i=t[n];if("string"==typeof i){const e=r(i);e!==i&&(Ke(t)||(t[n]=e),i=e)}e[i]=!0}return e}function vt(e){const t=et(null);for(const[r,n]of Xe(e))void 0!==Ze(e,r)&&(t[r]=n);return t}function gt(e,t){for(;null!==e;){const r=Ze(e,t);if(r){if(r.get)return mt(r.get);if("function"==typeof r.value)return mt(r.value)}e=Ye(e)}return function(e){return console.warn("fallback value for",e),null}}const bt=Qe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),xt=Qe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),wt=Qe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ot=Qe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),kt=Qe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),jt=Qe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),St=Qe(["#text"]),Et=Qe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),At=Qe(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pt=Qe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Tt=Qe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ct=Je(/\{\{[\w\W]*|[\w\W]*\}\}/gm),It=Je(/<%[\w\W]*|[\w\W]*%>/gm),Dt=Je(/\${[\w\W]*}/gm),Mt=Je(/^data-[\-\w.\u00B7-\uFFFF]/),Nt=Je(/^aria-[\-\w]+$/),Rt=Je(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_t=Je(/^(?:\w+script|data):/i),Bt=Je(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lt=Je(/^html$/i);var zt=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ct,ERB_EXPR:It,TMPLIT_EXPR:Dt,DATA_ATTR:Mt,ARIA_ATTR:Nt,IS_ALLOWED_URI:Rt,IS_SCRIPT_OR_DATA:_t,ATTR_WHITESPACE:Bt,DOCTYPE_NAME:Lt});const Ft=function(){return"undefined"==typeof window?null:window};var $t=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ft();const r=t=>e(t);if(r.version="3.0.6",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;let{document:n}=t;const i=n,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:c,Node:l,Element:s,NodeFilter:u,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:h}=t,m=s.prototype,y=gt(m,"cloneNode"),v=gt(m,"nextSibling"),g=gt(m,"childNodes"),b=gt(m,"parentNode");if("function"==typeof c){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,w="";const{implementation:O,createNodeIterator:k,createDocumentFragment:j,getElementsByTagName:S}=n,{importNode:E}=i;let A={};r.isSupported="function"==typeof Xe&&"function"==typeof b&&O&&void 0!==O.createHTMLDocument;const{MUSTACHE_EXPR:P,ERB_EXPR:T,TMPLIT_EXPR:C,DATA_ATTR:I,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:N}=zt;let{IS_ALLOWED_URI:R}=zt,_=null;const B=yt({},[...bt,...xt,...wt,...kt,...St]);let L=null;const z=yt({},[...Et,...At,...Pt,...Tt]);let F=Object.seal(et(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,q=null,W=!0,U=!0,H=!1,G=!0,X=!1,V=!1,K=!1,Y=!1,Z=!1,Q=!1,J=!1,ee=!0,te=!1,re=!0,ne=!1,ie={},oe=null;const ae=yt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const le=yt({},["audio","video","img","source","image","track"]);let se=null;const ue=yt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",de="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let he=fe,me=!1,ye=null;const ve=yt({},[pe,de,fe],ct);let ge=null;const be=["application/xhtml+xml","text/html"];let xe=null,we=null;const Oe=n.createElement("form"),ke=function(e){return e instanceof RegExp||e instanceof Function},je=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!we||we!==e){if(e&&"object"==typeof e||(e={}),e=vt(e),ge=ge=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,xe="application/xhtml+xml"===ge?ct:at,_="ALLOWED_TAGS"in e?yt({},e.ALLOWED_TAGS,xe):B,L="ALLOWED_ATTR"in e?yt({},e.ALLOWED_ATTR,xe):z,ye="ALLOWED_NAMESPACES"in e?yt({},e.ALLOWED_NAMESPACES,ct):ve,se="ADD_URI_SAFE_ATTR"in e?yt(vt(ue),e.ADD_URI_SAFE_ATTR,xe):ue,ce="ADD_DATA_URI_TAGS"in e?yt(vt(le),e.ADD_DATA_URI_TAGS,xe):le,oe="FORBID_CONTENTS"in e?yt({},e.FORBID_CONTENTS,xe):ae,$="FORBID_TAGS"in e?yt({},e.FORBID_TAGS,xe):{},q="FORBID_ATTR"in e?yt({},e.FORBID_ATTR,xe):{},ie="USE_PROFILES"in e&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,U=!1!==e.ALLOW_DATA_ATTR,H=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,V=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,re=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||Rt,he=e.NAMESPACE||fe,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(U=!1),Q&&(Z=!0),ie&&(_=yt({},[...St]),L=[],!0===ie.html&&(yt(_,bt),yt(L,Et)),!0===ie.svg&&(yt(_,xt),yt(L,At),yt(L,Tt)),!0===ie.svgFilters&&(yt(_,wt),yt(L,At),yt(L,Tt)),!0===ie.mathMl&&(yt(_,kt),yt(L,Pt),yt(L,Tt))),e.ADD_TAGS&&(_===B&&(_=vt(_)),yt(_,e.ADD_TAGS,xe)),e.ADD_ATTR&&(L===z&&(L=vt(L)),yt(L,e.ADD_ATTR,xe)),e.ADD_URI_SAFE_ATTR&&yt(se,e.ADD_URI_SAFE_ATTR,xe),e.FORBID_CONTENTS&&(oe===ae&&(oe=vt(oe)),yt(oe,e.FORBID_CONTENTS,xe)),re&&(_["#text"]=!0),V&&yt(_,["html","head","body"]),_.table&&(yt(_,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw ft('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw ft('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=e.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else void 0===x&&(x=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));const i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(h,o)),null!==x&&"string"==typeof w&&(w=x.createHTML(""));Qe&&Qe(e),we=e}},Se=yt({},["mi","mo","mn","ms","mtext"]),Ee=yt({},["foreignobject","desc","title","annotation-xml"]),Ae=yt({},["title","style","font","a","script"]),Pe=yt({},xt);yt(Pe,wt),yt(Pe,Ot);const Te=yt({},kt);yt(Te,jt);const Ce=function(e){ot(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Ie=function(e,t){try{ot(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){ot(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!L[e])if(Z||Q)try{Ce(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,r=null;if(Y)e="<remove></remove>"+e;else{const t=lt(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===ge&&he===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=x?x.createHTML(e):e;if(he===fe)try{t=(new f).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=O.createDocument(he,"template",null);try{t.documentElement.innerHTML=me?w:i}catch(e){}}const o=t.body||t.documentElement;return e&&r&&o.insertBefore(n.createTextNode(r),o.childNodes[0]||null),he===fe?S.call(t,V?"html":"body")[0]:V?t.documentElement:o},Me=function(e){return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},Ne=function(e){return"function"==typeof l&&e instanceof l},Re=function(e,t,n){A[e]&&nt(A[e],(e=>{e.call(r,t,n,we)}))},_e=function(e){let t=null;if(Re("beforeSanitizeElements",e,null),(n=e)instanceof d&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof p)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return Ce(e),!0;var n;const i=xe(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:i,allowedTags:_}),e.hasChildNodes()&&!Ne(e.firstElementChild)&&dt(/<[/\w]/g,e.innerHTML)&&dt(/<[/\w]/g,e.textContent))return Ce(e),!0;if(!_[i]||$[i]){if(!$[i]&&Le(i)){if(F.tagNameCheck instanceof RegExp&&dt(F.tagNameCheck,i))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(i))return!1}if(re&&!oe[i]){const t=b(e)||e.parentNode,r=g(e)||e.childNodes;if(r&&t)for(let n=r.length-1;n>=0;--n)t.insertBefore(y(r[n],!0),v(e))}return Ce(e),!0}return e instanceof s&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const r=at(e.tagName),n=at(t.tagName);return!!ye[e.namespaceURI]&&(e.namespaceURI===de?t.namespaceURI===fe?"svg"===r:t.namespaceURI===pe?"svg"===r&&("annotation-xml"===n||Se[n]):Boolean(Pe[r]):e.namespaceURI===pe?t.namespaceURI===fe?"math"===r:t.namespaceURI===de?"math"===r&&Ee[n]:Boolean(Te[r]):e.namespaceURI===fe?!(t.namespaceURI===de&&!Ee[n])&&!(t.namespaceURI===pe&&!Se[n])&&!Te[r]&&(Ae[r]||!Pe[r]):!("application/xhtml+xml"!==ge||!ye[e.namespaceURI]))}(e)?(Ce(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!dt(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,nt([P,T,C],(e=>{t=st(t,e," ")})),e.textContent!==t&&(ot(r.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Ce(e),!0)},Be=function(e,t,r){if(ee&&("id"===t||"name"===t)&&(r in n||r in Oe))return!1;if(U&&!q[t]&&dt(I,t));else if(W&&dt(D,t));else if(!L[t]||q[t]){if(!(Le(e)&&(F.tagNameCheck instanceof RegExp&&dt(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&dt(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&dt(F.tagNameCheck,r)||F.tagNameCheck instanceof Function&&F.tagNameCheck(r))))return!1}else if(se[t]);else if(dt(R,st(r,N,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==ut(r,"data:")||!ce[e])if(H&&!dt(M,st(r,N,"")));else if(r)return!1;return!0},Le=function(e){return e.indexOf("-")>0},ze=function(e){Re("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:c,value:l}=o,s=xe(a);let u="value"===a?l:pt(l);if(n.attrName=s,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,n),u=n.attrValue,n.forceKeepAttr)continue;if(Ie(a,e),!n.keepAttr)continue;if(!G&&dt(/\/>/i,u)){Ie(a,e);continue}X&&nt([P,T,C],(e=>{u=st(u,e," ")}));const p=xe(e.nodeName);if(Be(p,s,u)){if(!te||"id"!==s&&"name"!==s||(Ie(a,e),u="user-content-"+u),x&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(c);else switch(h.getAttributeType(p,s)){case"TrustedHTML":u=x.createHTML(u);break;case"TrustedScriptURL":u=x.createScriptURL(u)}try{c?e.setAttributeNS(c,a,u):e.setAttribute(a,u),it(r.removed)}catch(e){}}}Re("afterSanitizeAttributes",e,null)},Fe=function e(t){let r=null;const n=Me(t);for(Re("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Re("uponSanitizeShadowNode",r,null),_e(r)||(r.content instanceof a&&e(r.content),ze(r));Re("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,c=null,s=null;if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw ft("toString is not a function");if("string"!=typeof(e=e.toString()))throw ft("dirty is not a string, aborting")}if(!r.isSupported)return e;if(K||je(t),r.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=xe(e.nodeName);if(!_[t]||$[t])throw ft("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)n=De("\x3c!----\x3e"),o=n.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!Z&&!X&&!V&&-1===e.indexOf("<"))return x&&J?x.createHTML(e):e;if(n=De(e),!n)return Z?null:J?w:""}n&&Y&&Ce(n.firstChild);const u=Me(ne?e:n);for(;c=u.nextNode();)_e(c)||(c.content instanceof a&&Fe(c.content),ze(c));if(ne)return e;if(Z){if(Q)for(s=j.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(L.shadowroot||L.shadowrootmode)&&(s=E.call(i,s,!0)),s}let p=V?n.outerHTML:n.innerHTML;return V&&_["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&dt(Lt,n.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+p),X&&nt([P,T,C],(e=>{p=st(p,e," ")})),x&&J?x.createHTML(p):p},r.setConfig=function(){je(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),K=!0},r.clearConfig=function(){we=null,K=!1},r.isValidAttribute=function(e,t,r){we||je({});const n=xe(e),i=xe(t);return Be(n,i,r)},r.addHook=function(e,t){"function"==typeof t&&(A[e]=A[e]||[],ot(A[e],t))},r.removeHook=function(e){if(A[e])return it(A[e])},r.removeHooks=function(e){A[e]&&(A[e]=[])},r.removeAllHooks=function(){A={}},r}();let qt={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Wt(e){qt=e}const Ut=/[&<>"']/,Ht=new RegExp(Ut.source,"g"),Gt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Xt=new RegExp(Gt.source,"g"),Vt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Kt=e=>Vt[e];function Yt(e,t){if(t){if(Ut.test(e))return e.replace(Ht,Kt)}else if(Gt.test(e))return e.replace(Xt,Kt);return e}const Zt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Qt(e){return e.replace(Zt,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Jt=/(^|[^\[])\^/g;function er(e,t){e="string"==typeof e?e:e.source,t=t||"";const r={replace:(t,n)=>(n=(n="object"==typeof n&&"source"in n?n.source:n).replace(Jt,"$1"),e=e.replace(t,n),r),getRegex:()=>new RegExp(e,t)};return r}function tr(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const rr={exec:()=>null};function nr(e,t){const r=e.replace(/\|/g,((e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function ir(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){const o=e.charAt(n-i-1);if(o!==t||r){if(o===t||!r)break;i++}else i++}return e.slice(0,n-i)}function or(e,t,r,n){const i=t.href,o=t.title?Yt(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:i,title:o,text:Yt(a)}}class ar{options;rules;lexer;constructor(e){this.options=e||qt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ir(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=function(e,t){const r=e.match(/^(\s+)(?:```)/);if(null===r)return t;const n=r[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ir(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=ir(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),r=this.lexer.state.top;this.lexer.state.top=!0;const n=this.lexer.blockTokens(e);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:n,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",c="",l=!1;for(;e;){let r=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let n=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),s=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,c=n.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,c=n.slice(u),u+=t[1].length);let p=!1;if(!n&&/^ *$/.test(s)&&(a+=s+"\n",e=e.substring(s.length+1),r=!0),!r){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(s=l,this.options.pedantic&&(s=s.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(s))break;if(o.test(s))break;if(t.test(s))break;if(r.test(e))break;if(s.search(/[^ ]/)>=u||!s.trim())c+="\n"+s.slice(u);else{if(p)break;if(n.search(/[^ ]/)>=4)break;if(i.test(n))break;if(o.test(n))break;if(r.test(n))break;c+="\n"+s}p||s.trim()||(p=!0),a+=l+"\n",e=e.substring(l.length+1),n=s.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(a)&&(l=!0));let d,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(c),f&&(d="[ ] "!==f[0],c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!f,checked:d,loose:!1,text:c,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=c.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),r=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:nr(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,r,n,i,o=e.align.length;for(t=0;t<o;t++){const r=e.align[t];r&&(/^ *-+: *$/.test(r)?e.align[t]="right":/^ *:-+: *$/.test(r)?e.align[t]="center":/^ *:-+ *$/.test(r)?e.align[t]="left":e.align[t]=null)}for(o=e.rows.length,t=0;t<o;t++)e.rows[t]=nr(e.rows[t],e.header.length).map((e=>({text:e,tokens:[]})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],n=0;n<i.length;n++)i[n].tokens=this.lexer.inline(i[n].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Yt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ir(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(e)?r.slice(1):r.slice(1,-1)),or(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=(r[2]||r[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return or(r,e,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!r.match(/[\p{L}\p{N}]/u))&&(!n[1]&&!n[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...n[0]].length-1;let i,o,a=r,c=0;const l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){c+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);const t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const s=l.slice(2,-2);return{type:"strong",raw:l,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const r=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return r&&n&&(e=e.substring(1,e.length-1)),e=Yt(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=Yt(t[1]),r="mailto:"+e):(e=Yt(t[1]),r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])e=Yt(t[0]),r="mailto:"+e;else{let n;do{n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(n!==t[0]);e=Yt(t[0]),r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Yt(t[0]),{type:"text",raw:t[0],text:e}}}}const cr={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:rr,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};cr.def=er(cr.def).replace("label",cr._label).replace("title",cr._title).getRegex(),cr.bullet=/(?:[*+-]|\d{1,9}[.)])/,cr.listItemStart=er(/^( *)(bull) */).replace("bull",cr.bullet).getRegex(),cr.list=er(cr.list).replace(/bull/g,cr.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+cr.def.source+")").getRegex(),cr._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",cr._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,cr.html=er(cr.html,"i").replace("comment",cr._comment).replace("tag",cr._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cr.lheading=er(cr.lheading).replace(/bull/g,cr.bullet).getRegex(),cr.paragraph=er(cr._paragraph).replace("hr",cr.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cr._tag).getRegex(),cr.blockquote=er(cr.blockquote).replace("paragraph",cr.paragraph).getRegex(),cr.normal={...cr},cr.gfm={...cr.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},cr.gfm.table=er(cr.gfm.table).replace("hr",cr.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cr._tag).getRegex(),cr.gfm.paragraph=er(cr._paragraph).replace("hr",cr.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cr.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cr._tag).getRegex(),cr.pedantic={...cr.normal,html:er("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",cr._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:rr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:er(cr.normal._paragraph).replace("hr",cr.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",cr.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const lr={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:rr,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:rr,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/,_punctuation:"\\p{P}$+<=>`^|~"};lr.punctuation=er(lr.punctuation,"u").replace(/punctuation/g,lr._punctuation).getRegex(),lr.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,lr.anyPunctuation=/\\[punct]/g,lr._escapes=/\\([punct])/g,lr._comment=er(cr._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),lr.emStrong.lDelim=er(lr.emStrong.lDelim,"u").replace(/punct/g,lr._punctuation).getRegex(),lr.emStrong.rDelimAst=er(lr.emStrong.rDelimAst,"gu").replace(/punct/g,lr._punctuation).getRegex(),lr.emStrong.rDelimUnd=er(lr.emStrong.rDelimUnd,"gu").replace(/punct/g,lr._punctuation).getRegex(),lr.anyPunctuation=er(lr.anyPunctuation,"gu").replace(/punct/g,lr._punctuation).getRegex(),lr._escapes=er(lr._escapes,"gu").replace(/punct/g,lr._punctuation).getRegex(),lr._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,lr._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,lr.autolink=er(lr.autolink).replace("scheme",lr._scheme).replace("email",lr._email).getRegex(),lr._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,lr.tag=er(lr.tag).replace("comment",lr._comment).replace("attribute",lr._attribute).getRegex(),lr._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,lr._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,lr._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,lr.link=er(lr.link).replace("label",lr._label).replace("href",lr._href).replace("title",lr._title).getRegex(),lr.reflink=er(lr.reflink).replace("label",lr._label).replace("ref",cr._label).getRegex(),lr.nolink=er(lr.nolink).replace("ref",cr._label).getRegex(),lr.reflinkSearch=er(lr.reflinkSearch,"g").replace("reflink",lr.reflink).replace("nolink",lr.nolink).getRegex(),lr.normal={...lr},lr.pedantic={...lr.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:er(/^!?\[(label)\]\((.*?)\)/).replace("label",lr._label).getRegex(),reflink:er(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lr._label).getRegex()},lr.gfm={...lr.normal,escape:er(lr.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},lr.gfm.url=er(lr.gfm.url,"i").replace("email",lr.gfm._extended_email).getRegex(),lr.breaks={...lr.gfm,br:er(lr.br).replace("{2,}","*").getRegex(),text:er(lr.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class sr{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||qt,this.options.tokenizer=this.options.tokenizer||new ar,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:cr.normal,inline:lr.normal};this.options.pedantic?(t.block=cr.pedantic,t.inline=lr.pedantic):this.options.gfm&&(t.block=cr.gfm,this.options.breaks?t.inline=lr.breaks:t.inline=lr.gfm),this.tokenizer.rules=t}static get rules(){return{block:cr,inline:lr}}static lex(e,t){return new sr(t).lex(e)}static lexInline(e,t){return new sr(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let r,n,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,r)=>t+" ".repeat(r.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(r):(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i)))n=t[t.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r),o=i.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,i,o,a,c,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(c=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,l,c))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.autolink(e))e=e.substring(r.raw.length),t.push(r);else if(this.state.inLink||!(r=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),a=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(r.raw.length),t.push(r);return t}}class ur{options;constructor(e){this.options=e||qt}code(e,t,r){const n=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="language-'+Yt(n)+'">'+(r?e:Yt(e,!0))+"</code></pre>\n":"<pre><code>"+(r?e:Yt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,r){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,r){const n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+">\n"+e+"</"+n+">\n"}listitem(e,t,r){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,r){const n=tr(e);if(null===n)return r;let i='<a href="'+(e=n)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+r+"</a>",i}image(e,t,r){const n=tr(e);if(null===n)return r;let i=`<img src="${e=n}" alt="${r}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class pr{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class dr{options;renderer;textRenderer;constructor(e){this.options=e||qt,this.options.renderer=this.options.renderer||new ur,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new pr}static parse(e,t){return new dr(t).parse(e)}static parseInline(e,t){return new dr(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}switch(i.type){case"space":continue;case"hr":r+=this.renderer.hr();continue;case"heading":{const e=i;r+=this.renderer.heading(this.parseInline(e.tokens),e.depth,Qt(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;r+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(n);let o="";for(let t=0;t<e.rows.length;t++){const r=e.rows[t];n="";for(let t=0;t<r.length;t++)n+=this.renderer.tablecell(this.parseInline(r[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(n)}r+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);r+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,n=e.start,o=e.loose;let a="";for(let t=0;t<e.items.length;t++){const r=e.items[t],n=r.checked,i=r.task;let c="";if(r.task){const e=this.renderer.checkbox(!!n);o?r.tokens.length>0&&"paragraph"===r.tokens[0].type?(r.tokens[0].text=e+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&"text"===r.tokens[0].tokens[0].type&&(r.tokens[0].tokens[0].text=e+" "+r.tokens[0].tokens[0].text)):r.tokens.unshift({type:"text",text:e+" "}):c+=e+" "}c+=this.parse(r.tokens,o),a+=this.renderer.listitem(c,i,!!n)}r+=this.renderer.list(a,t,n);continue}case"html":{const e=i;r+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;r+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,a=o.tokens?this.parseInline(o.tokens):o.text;for(;n+1<e.length&&"text"===e[n+1].type;)o=e[++n],a+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);r+=t?this.renderer.paragraph(a):a;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}switch(i.type){case"escape":{const e=i;r+=t.text(e.text);break}case"html":{const e=i;r+=t.html(e.text);break}case"link":{const e=i;r+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;r+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;r+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;r+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;r+=t.codespan(e.text);break}case"br":r+=t.br();break;case"del":{const e=i;r+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;r+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}}class fr{options;constructor(e){this.options=e||qt}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}const hr=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(sr.lex,dr.parse);parseInline=this.#e(sr.lexInline,dr.parseInline);Parser=dr;Renderer=ur;TextRenderer=pr;Lexer=sr;Tokenizer=ar;Hooks=fr;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;r=r.concat(this.walkTokens(e.items,t));break}default:{const e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((n=>{r=r.concat(this.walkTokens(e[n],t))})):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),r.extensions=t),e.renderer){const t=this.defaults.renderer||new ur(this.defaults);for(const r in e.renderer){const n=e.renderer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ar(this.defaults);for(const r in e.tokenizer){const n=e.tokenizer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new fr;for(const r in e.hooks){const n=e.hooks[r],i=r,o=t[i];fr.passThroughHooks.has(r)?t[i]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then((e=>o.call(t,e)));const r=n.call(t,e);return o.call(t,r)}:t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return sr.lex(e,t??this.defaults)}parser(e,t){return dr.parse(e,t??this.defaults)}#e(e,t){return(r,n)=>{const i={...n},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const a=this.#t(!!o.silent,!!o.async);if(null==r)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then((t=>e(t,o))).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));const n=e(r,o);o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return a(e)}}}#t(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+Yt(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function mr(e,t){return hr.parse(e,t)}function yr(e){var t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=mr.parse(t);return $t.sanitize(r)}mr.options=mr.setOptions=function(e){return hr.setOptions(e),mr.defaults=hr.defaults,Wt(mr.defaults),mr},mr.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},mr.defaults=qt,mr.use=function(...e){return hr.use(...e),mr.defaults=hr.defaults,Wt(mr.defaults),mr},mr.walkTokens=function(e,t){return hr.walkTokens(e,t)},mr.parseInline=hr.parseInline,mr.Parser=dr,mr.parser=dr.parse,mr.Renderer=ur,mr.TextRenderer=pr,mr.Lexer=sr,mr.lexer=sr.lex,mr.Tokenizer=ar,mr.Hooks=fr,mr.parse=mr,mr.options,mr.setOptions,mr.use,mr.walkTokens,mr.parseInline,dr.parse,sr.lex;const vr=function(t){var r=(0,d.useState)(yr(t.text)),n=r[0],i=r[1];return(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=t.updatedData[t.updatedData.length-1].text;i(yr(e))}}),[t.text,t.updatedData]),(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}})},gr=function(t){var r=(0,d.useState)(yr(t.text)),n=r[0],i=r[1],o=(0,d.useState)(""),a=o[0],c=o[1];return(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text?(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")):e+=o.text}i(yr(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}}),a&&(0,e.jsx)(Ne(),{severity:"error",children:a})]})},br=require("@mui/material"),xr=require("@mui/material/Button");var wr=i.n(xr);const Or=require("@mui/material/Slider");var kr=i.n(Or);function jr(t){var r,n={play:{symbol:"play_circle",label:"Play"},pause:{symbol:"pause_circle",label:"Pause"},forward:{symbol:"forward_10",label:"Forward ten seconds"},replay:{symbol:"replay_10",label:"Replay ten seconds"},volumeUp:{symbol:"volume_up",label:"Mute"},volumeOff:{symbol:"volume_off",label:"Unmute"},miniPlayer:{symbol:"picture_in_picture",label:"Mini player"},miniPlayerExit:{symbol:"picture_in_picture_off",label:"Exit mini player"},fullscreen:{symbol:"fullscreen",label:"Fullscreen"},fullscreenExit:{symbol:"fullscreen_exit",label:"Exit fullscreen"},captionsOn:{symbol:"closed_caption",label:"Show captions"},captionsOff:{symbol:"closed_caption_disabled",label:"Hide captions"}};return n[t.action].label.replaceAll(" ","-").toLowerCase(),(0,e.jsx)(ce(),{title:n[t.action].label,PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(K(),{onClick:t.onClick,className:t.className,color:"primary",children:(0,e.jsx)(se,{name:n[t.action].symbol,className:"rustic-icon-large"})})})}var Sr=100;function Er(t){var r="dark"===(0,br.useTheme)().palette.mode,n=R(t.mediaElement.currentTime);return(0,e.jsxs)(l(),{className:"rustic-progress",children:[function(){for(var n=t.mediaElement.buffered,i=0,o=n.length-1;o>=0;--o){var a=n.start(o),c=n.end(o);if(a<t.mediaElement.currentTime){i=c;break}}var l=i/t.mediaElement.duration*Sr;return(0,e.jsx)(ye(),{className:"rustic-progress-buffered",variant:"determinate",value:l,sx:{backgroundColor:"action.focus","& .MuiLinearProgress-bar":{backgroundColor:r?"secondary.light":"action.selected"}}})}(),(0,e.jsx)(kr(),{className:"rustic-progress-slider",size:"small","aria-label":"Time","aria-valuetext":"Current time: ".concat(n),max:t.mediaElement.duration,value:t.mediaElement.currentTime,onChange:function(e,r){t.mediaElement.currentTime=r},valueLabelDisplay:"auto",valueLabelFormat:function(e){return R(e)},color:"secondary",sx:{"& .MuiSlider-rail":{color:"action.focus"}}})]})}function Ar(t){var r=(0,d.useState)(t.mediaElement.volume),n=r[0],i=r[1],o=(0,d.useState)(t.mediaElement.volume),a=o[0],c=o[1],s=t.mediaElement.muted?"volumeOff":"volumeUp";return(0,e.jsxs)(l(),{className:"rustic-volume-settings",children:[(0,e.jsx)(jr,{onClick:function(){t.mediaElement.muted=!t.mediaElement.muted,t.mediaElement.muted?(c(t.mediaElement.volume),i(0)):i(a)},className:"rustic-mute-button",action:s}),(0,e.jsx)(kr(),{className:"rustic-volume-slider",size:"small",max:1,step:.1,"aria-label":"Volume","aria-valuetext":"Volume: ".concat(n*Sr,"%"),value:n,onChange:function(e,r){var n=r;t.mediaElement.muted=0===n,t.mediaElement.volume=n,i(t.mediaElement.volume)}})]})}function Pr(t){var r=t.isTranscriptVisible?"keyboard_arrow_up":"keyboard_arrow_down",n="".concat(t.isTranscriptVisible?"Hide":"Show"," Transcript");return(0,e.jsx)(wr(),{className:"rustic-transcript-toggle",onClick:t.setIsTranscriptVisible,endIcon:(0,e.jsx)(se,{name:r}),children:(0,e.jsx)(w(),{variant:"overline",children:n})})}function Tr(t){var r=(0,d.useState)(!t.mediaElement.paused),n=r[0],i=r[1],o=n?"pause":"play";return t.mediaElement.onended=function(){i(!1)},t.mediaElement.onpause=function(){i(!1)},t.mediaElement.onplay=function(){i(!0)},(0,e.jsx)(jr,{onClick:function(){n?t.mediaElement.pause():t.mediaElement.play().catch((function(e){t.onError("Failed to play the media. Error: ".concat(e.message))}))},action:o,className:"rustic-pause-play-icon"})}function Cr(t){var r,n=(0,d.useState)(t.mediaElement.playbackRate),i=n[0],o=n[1];return(0,e.jsx)(ce(),{title:"Playback rate",PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(wr(),{onClick:function(){var e=1;t.mediaElement.playbackRate<2&&(e=t.mediaElement.playbackRate+.5),t.mediaElement.playbackRate=e,o(e)},className:"rustic-playback-rate-button",children:(0,e.jsxs)(w(),{variant:"body1",children:[i,"X"]})})})}function Ir(t){var r="replay"===t.movement,n=r?function(){t.mediaElement.currentTime-=10}:function(){t.mediaElement.currentTime+=10},i=r?"replay":"forward";return(0,e.jsx)(jr,{onClick:n,action:i})}function Dr(t){var r=R(t.elapsedTimeInSeconds),n=R(t.durationTimeInSeconds),i="".concat(r," / ").concat(n);return"wide"===t.style?(0,e.jsxs)(l(),{className:"rustic-time-container",children:[(0,e.jsx)(w(),{variant:"overline",children:r}),(0,e.jsx)(w(),{variant:"overline",children:n})]}):(0,e.jsx)(w(),{variant:"overline",className:"rustic-time-display",children:i})}Dr.defaultProps={style:"condensed"};const Mr=require("@mui/material/Divider");var Nr=i.n(Mr);function Rr(t){var r=!!document.fullscreenElement;return(0,e.jsxs)(O.Box,{className:"rustic-transcript-container",children:[!r&&(0,e.jsx)(Nr(),{orientation:"vertical",flexItem:!0}),(0,e.jsx)(w(),{className:"rustic-transcript-content",variant:"body2",children:t.transcript})]})}function _r(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=(0,d.useState)(!1),a=o[0],c=o[1],l=(0,d.useState)(!0),s=l[0],u=l[1],p=(0,d.useState)(0),f=p[0],h=p[1],m=(0,d.useState)(""),y=m[0],v=m[1],g=(0,d.useState)(""),b=g[0],x=g[1],k=(0,br.useTheme)(),j=(0,d.useRef)(null),S=(0,br.useMediaQuery)(k.breakpoints.down("md"));function E(){return(0,e.jsx)(w(),{variant:"h6",className:"rustic-sound-title",children:t.title})}function P(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(jr,{action:r,onClick:function(){return c(!a)}})}}function T(){if(j.current)return(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(Ir,{mediaElement:j.current,movement:"replay"}),(0,e.jsx)(Tr,{mediaElement:j.current,onError:x}),(0,e.jsx)(Ir,{mediaElement:j.current,movement:"forward"})]})}function C(){if(t.transcript&&n)return(0,e.jsx)(Rr,{transcript:t.transcript})}function I(){if(t.transcript)return(0,e.jsx)(Pr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}function D(){return(0,e.jsx)("video",{src:t.src,ref:j,className:a?"rustic-has-captions":"",children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})})}(0,d.useEffect)((function(){var e,t,r,n;function i(e){v(e)}null===(e=j.current)||void 0===e||e.addEventListener("timeupdate",(function(){j.current&&h(j.current.currentTime)})),null===(t=j.current)||void 0===t||t.addEventListener("canplay",(function(){v(""),u(!1)})),null===(r=j.current)||void 0===r||r.addEventListener("error",(function(){return i("Failed to load the audio.")})),null===(n=j.current)||void 0===n||n.addEventListener("stalled",(function(){return i("Failed to fetch audio data, but trying.")}))}),[]);var M=S?function(){if(j.current)return(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(Dr,{elapsedTimeInSeconds:f,durationTimeInSeconds:j.current.duration,style:"wide"}),(0,e.jsx)(Er,{mediaElement:j.current}),E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-left",children:T()}),(0,e.jsx)(Ar,{mediaElement:j.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-right",children:[I(),(0,e.jsxs)(O.Box,{children:[P(),(0,e.jsx)(Cr,{mediaElement:j.current})]})]})]}),C()]})}:function(){if(j.current)return(0,e.jsxs)(e.Fragment,{children:[E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(Er,{mediaElement:j.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-left",children:[T(),P(),(0,e.jsx)(Cr,{mediaElement:j.current}),(0,e.jsx)(Ar,{mediaElement:j.current}),(0,e.jsx)(Dr,{elapsedTimeInSeconds:f,durationTimeInSeconds:j.current.duration,style:"condensed"})]}),(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-right",children:I()})]}),C()]})]})};return y.length>0?(0,e.jsx)(Ne(),{severity:"error",children:y}):s?(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),(0,e.jsx)(A(),{})]}):(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),M(),b.length>0&&(0,e.jsx)(Ne(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b})]})}function Br(t){var r=(0,d.useState)(!!document.pictureInPictureElement),n=r[0],i=r[1],o=t.mediaElement,a=n?"miniPlayerExit":"miniPlayer";return o.onleavepictureinpicture=function(){i(!1)},(0,e.jsx)(jr,{onClick:function(){n?document.exitPictureInPicture().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit mini player. Error: ".concat(e.message))})):o.requestPictureInPicture().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter mini player. Error: ".concat(e.message))}))},action:a})}function Lr(t){var r=(0,d.useState)(!!document.fullscreenElement),n=r[0],i=r[1],o=t.element,a=n?"fullscreenExit":"fullscreen";return o.onfullscreenchange=function(){i(!!document.fullscreenElement)},(0,e.jsx)(jr,{onClick:function(){n?document.exitFullscreen().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit fullscreen mode. Error: ".concat(e.message))})):o.requestFullscreen().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter fullscreen mode. Error: ".concat(e.message))}))},action:a})}function zr(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=(0,d.useState)(!1),a=o[0],c=o[1],l=(0,d.useState)(!0),s=l[0],u=l[1],p=(0,d.useState)(!!document.fullscreenElement),f=p[0],h=p[1],m=(0,d.useState)(!1),y=m[0],v=m[1],g=(0,d.useState)(""),b=g[0],x=g[1],k=(0,d.useState)(""),j=k[0],S=k[1],E=(0,d.useState)(0),P=E[0],T=E[1],C=(0,d.useRef)(null),I=(0,d.useRef)(null),D=(0,br.useTheme)(),M=(0,br.useMediaQuery)(D.breakpoints.down("md"));(0,d.useEffect)((function(){var e,t,r,n,i,o,a,c;function l(e){S(e),u(!1)}function s(){clearTimeout(c),c=setTimeout((function(){return v(!1)}),3e3)}null===(e=I.current)||void 0===e||e.addEventListener("timeupdate",(function(){I.current&&T(I.current.currentTime)})),null===(t=I.current)||void 0===t||t.addEventListener("canplay",(function(){S(""),u(!1)})),null===(r=I.current)||void 0===r||r.addEventListener("error",(function(){return l("Failed to load the video.")})),null===(n=I.current)||void 0===n||n.addEventListener("stalled",(function(){return l("Failed to fetch video data, but trying.")})),document.addEventListener("fullscreenchange",(function(){h(!!document.fullscreenElement)})),null===(i=C.current)||void 0===i||i.addEventListener("mousemove",(function(){v(!0),s()})),null===(o=C.current)||void 0===o||o.addEventListener("mouseleave",(function(){v(!1)})),null===(a=C.current)||void 0===a||a.addEventListener("keydown",(function(){v(!0),s()}))}),[]);var N={backgroundColor:D.palette.background.paper,opacity:y?1:0};function R(){if(t.transcript&&n)return(0,e.jsx)(Rr,{transcript:t.transcript})}function _(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(jr,{action:r,onClick:function(){return c(!a)}})}}function B(){if(t.transcript)return(0,e.jsx)(Pr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}var L=M?function(){return f?(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsxs)(O.Box,{className:"rustic-video-top-controls",children:[(0,e.jsx)(Tr,{mediaElement:I.current,onError:x}),(0,e.jsx)(Er,{mediaElement:I.current}),(0,e.jsx)(Dr,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(Ir,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(Ir,{mediaElement:I.current,movement:"forward"}),_(),(0,e.jsx)(Cr,{mediaElement:I.current})]}),B()]}),R()]})}):(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls-mobile-preview",children:[(0,e.jsx)(Tr,{mediaElement:I.current,onError:x}),(0,e.jsxs)(O.Box,{className:"rustic-video-controls-right",children:[B(),(0,e.jsx)(Lr,{element:C.current,onError:x})]})]})})}:function(){return(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsx)(Er,{mediaElement:I.current}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-left",children:[(0,e.jsx)(Tr,{mediaElement:I.current,onError:x}),(0,e.jsx)(Ir,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(Ir,{mediaElement:I.current,movement:"forward"}),_(),(0,e.jsx)(Cr,{mediaElement:I.current}),(0,e.jsx)(Ar,{mediaElement:I.current}),(0,e.jsx)(Dr,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration,style:"condensed"})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-right",children:[B(),(0,e.jsx)(Br,{mediaElement:I.current,onError:x}),(0,e.jsx)(Lr,{element:C.current,onError:x})]})]}),f&&R()]})})};return j.length>0?(0,e.jsx)(Ne(),{severity:"error",children:j}):(0,e.jsxs)(O.Box,{className:"rustic-video",children:[s&&(0,e.jsx)(A(),{className:"rustic-video-loading-spinner"}),(0,e.jsxs)(O.Box,{ref:C,className:"rustic-video-screen",sx:{visibility:s?"hidden":"visible"},children:[b.length>0&&(0,e.jsx)(Ne(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b}),(!M||f)&&function(){if(I.current&&C.current)return(0,e.jsxs)(O.Box,{className:"rustic-video-title",sx:N,children:[(0,e.jsx)(w(),{variant:"body2",children:t.title}),f&&M&&(0,e.jsxs)(O.Box,{children:[(0,e.jsx)(Br,{mediaElement:I.current,onError:x}),(0,e.jsx)(Lr,{element:C.current,onError:x})]})]})}(),(0,e.jsx)("video",{className:"rustic-video-element",ref:I,src:t.src,poster:t.poster,children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})}),L()]}),!f&&R()]})}const Fr=require("@mui/material/Drawer");var $r=i.n(Fr);const qr=require("@mui/material/ListItemText");var Wr=i.n(qr);const Ur=require("@mui/material/Menu");var Hr=i.n(Ur),Gr=function(){return Gr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Gr.apply(this,arguments)};function Xr(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=(0,d.useRef)(null),a=(0,s.useTheme)(),c=(0,br.useMediaQuery)(a.breakpoints.down("md")),l=c?$r():Hr(),u={borderRadius:"".concat(a.shape.borderRadius,"px"),border:"1px solid ".concat(a.palette.divider)};function p(t){return(0,e.jsxs)(e.Fragment,{children:[t.startDecorator&&(0,e.jsx)(O.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:t.startDecorator}),(0,e.jsx)(Wr(),{children:(0,e.jsx)(w(),{variant:"body2",children:t.label})}),t.endDecorator&&(0,e.jsx)(O.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:t.endDecorator})]})}c&&(u=Gr(Gr({},u),{borderRadius:"".concat(a.shape.borderRadius,"px ").concat(a.shape.borderRadius,"px 0 0"),borderBottom:0}));var f=t.menuItems.map((function(t){return t.href?(0,e.jsx)(J(),{component:"a",onClick:function(){return i(!1)},href:t.href,download:t.downloadFileName||t.isFiledownload,children:p(t)},t.label):(0,e.jsx)(J(),{onClick:function(e){t.onClick&&t.onClick(e),i(!1)},disabled:!t.onClick,children:p(t)},t.label)}));var h,m,y=c?{}:{anchorEl:o.current};return(0,e.jsxs)(e.Fragment,{children:[(h={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":t.ariaLabel,ref:o,className:"rustic-popover-menu-button"},m=(0,e.jsx)(se,{name:"more_vert"}),t.buttonText?(0,e.jsx)(wr(),Gr({},h,{startIcon:t.icon?t.icon:null,children:t.buttonText})):(0,e.jsx)(ce(),{title:t.ariaLabel,children:(0,e.jsx)(K(),Gr({},h,{children:t.icon?t.icon:m}))})),(0,e.jsx)(l,Gr({open:n,onClose:function(){return i(!1)}},y,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":Gr(Gr({},u),{backgroundImage:"none",boxShadow:a.shadows[2]})},children:f}))]})}function Vr(t){return(0,e.jsx)(ce(),{title:t.label,children:(0,e.jsx)(K(),{color:"inherit","aria-label":t.label,onClick:function(e){e.stopPropagation(),e.preventDefault(),t.onClick(t.message)},className:"rustic-message-actions",children:t.icon})})}function Kr(t){var r=(0,d.useState)("Copy text"),n=r[0],i=r[1];return(0,e.jsx)(Vr,{message:t.message,icon:(0,e.jsx)(se,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){i("Copied"),setTimeout((function(){i("Copy text")}),2e3)})).catch((function(){i("Failed to copy")}))},label:n})}const Yr=require("@mui/material/Stack");var Zr=i.n(Yr);const Qr=function(t){return(0,e.jsx)(w(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(r=t.timestamp,I(r)<86400?function(e){var t=I(e);if(t<60)return"".concat(T()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(T()("minute",r,!0)," ago")}var n=Math.floor(t/3600);return"".concat(T()("hour",n,!0)," ago")}(r):(n=new Date(r),i=navigator.language,o={month:"short",day:"numeric"},a=new Date,l=(c=n.getFullYear()!==a.getFullYear())?" at ":", ",c&&(o.year="numeric"),n.toLocaleDateString(i,o)+l+n.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})))});var r,n,i,o,a,c,l},Jr=(0,d.forwardRef)((function(t,r){var n=(0,br.useTheme)();return(0,e.jsxs)(Zr(),{id:t.message.id,className:"rustic-message-canvas",ref:r,children:[(0,e.jsxs)(Zr(),{direction:"row",alignItems:"center",spacing:1,children:[t.getProfileComponent&&t.getProfileComponent(t.message),(0,e.jsx)(Qr,{timestamp:t.message.timestamp})]}),t.getActionsComponent&&t.getActionsComponent(t.message)&&(0,e.jsx)(we(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:t.getActionsComponent(t.message)}),(0,e.jsx)(we(),{variant:"outlined",className:"rustic-message-container",children:t.children})]})})),en=require("@mui/system/Box");var tn=i.n(en);function rn(t){var r,n,i,o,a=(0,d.useRef)(null),c=(0,d.useRef)(null),l=(0,d.useRef)(),s=(0,d.useState)(!0),u=s[0],p=s[1],f=(0,d.useState)(!0),h=f[0],m=f[1],y=(0,d.useState)(!1),v=y[0],g=y[1],b=(null===(r=t.messages)||void 0===r?void 0:r.length)||0,x=(i=b,o=(0,d.useRef)(0),(0,d.useEffect)((function(){o.current=i})),o.current),w=2e3;function O(){m(!0),l.current&&clearTimeout(l.current),l.current=setTimeout((function(){m(!1)}),w)}function k(){var e,t=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}function j(){var e=c.current,t=a.current;if(e&&t){var r=e.getBoundingClientRect().bottom,n=t.getBoundingClientRect().bottom;p(n-1<=r)}}function E(){if(k()){var e=c.current;g(!0),e&&setTimeout((function(){O(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(E,1)}function A(){if(k()){var e=a.current;e&&setTimeout((function(){e.scrollIntoView({block:"start",inline:"nearest"})}),0)}else setTimeout(A,1)}return(0,d.useEffect)((function(){var e=c.current;if(j(),e)return e.addEventListener("scroll",j),window.addEventListener("resize",j),function(){e.removeEventListener("scroll",j),window.removeEventListener("resize",j)}}),[u]),(0,d.useEffect)((function(){E()}),[v]),(0,d.useEffect)((function(){u&&0!==x&&b>x&&(O(),A())}),[u,null===(n=t.messages)||void 0===n?void 0:n.length]),(0,e.jsxs)(tn(),{ref:c,className:"rustic-message-space",children:[t.messages&&t.messages.length>0&&t.messages.map((function(r,n){return(0,e.jsx)(Jr,{message:r,getActionsComponent:t.getActionsComponent,getProfileComponent:t.getProfileComponent,ref:n===b-1?a:null,children:(0,e.jsx)(S,{ws:t.ws,sender:t.sender,message:r,supportedElements:t.supportedElements})},r.id)})),!u&&!h&&(0,e.jsx)(wr(),{variant:"contained",color:"secondary",className:"rustic-scroll-down-button",onClick:function(){var e;null===(e=a.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"}),O()},endIcon:(0,e.jsx)(se,{name:"arrow_downward",className:"rustic-end-icon"}),children:t.scrollDownLabel})]})}rn.defaultProps={scrollDownLabel:"scroll down"};const nn=function(t){return(0,e.jsx)(w(),{variant:"body2",className:"rustic-text",children:$t.sanitize(t.text)})};function on(t){return(0,e.jsxs)(tn(),{className:"rustic-multipart",children:[t.text&&(0,e.jsx)(nn,{text:t.text}),(r=t.files.map((function(t,r){return(0,e.jsx)(Oe,{file:t,children:t.url&&(0,e.jsx)(ce(),{title:"Download",children:(0,e.jsx)(K(),{component:"a",href:t.url,download:t.name,children:(0,e.jsx)(se,{name:"download"})})})},r)})),(0,e.jsx)(tn(),{className:"rustic-files",children:r}))]});var r}const an=require("@mui/material/Dialog");var cn=i.n(an);const ln=require("@mui/material/DialogTitle");var sn=i.n(ln);const un=require("@mui/material/List");var pn=i.n(un);const dn=require("@mui/material/ListItem");var fn=i.n(dn);const hn=require("@mui/material/ListSubheader");var mn,yn,vn=i.n(hn);!function(e){e.Owner="owner",e.Member="member"}(mn||(mn={})),function(e){e.Human="human",e.Agent="agent"}(yn||(yn={}));function gn(t){var r=(0,d.useState)(!1),n=r[0],i=r[1],o=t.participants.length,a=n?t.participants:t.participants.slice(0,3),c="".concat(T()(t.participantType,o)," (").concat(o,")"),l=n?"Show Less":"Show All ".concat(o);return 0===o?(0,e.jsx)(w(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,e.jsx)(pn(),{className:"rustic-participant-list",subheader:(0,e.jsxs)(vn(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,e.jsxs)(O.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,e.jsx)(w(),{variant:"subtitle2",color:"text.secondary",children:c})]}),o>3&&(0,e.jsx)(wr(),{onClick:function(){return i(!n)},color:"primary",size:"small",startIcon:(0,e.jsx)(se,{name:"keyboard_arrow_down"}),children:l})]}),children:a.map((function(t){return(0,e.jsxs)(fn(),{className:"rustic-participant-list-item",children:[(0,e.jsx)(w(),{variant:"subtitle2",children:t.displayName}),(0,e.jsx)(w(),{variant:t.participantRole===mn.Owner?"subtitle2":"caption",children:M(t.participantRole)})]},t.id)}))})}const bn=function(t){function r(e,t){return function(e){return function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e,!0).sort((function(e,t){return t.participantRole===mn.Owner?1:-1}))}(e.filter((function(e){return e.participantType===t})))}var n=r(t.participants,yn.Human),i=r(t.participants,yn.Agent),o="".concat(T()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,e.jsxs)(cn(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,e.jsx)(sn(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:o}),(0,e.jsx)(gn,{participantType:"Human",participantTypeIcon:(0,e.jsx)(se,{name:"account_circle"}),participants:n}),i.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Nr(),{className:"rustic-participants-container-divider"}),(0,e.jsx)(gn,{participantType:"Agent",participantTypeIcon:(0,e.jsx)(se,{name:"smart_toy"}),participants:i})]})]})},xn=require("@mui/system/Stack");var wn=i.n(xn);const On=require("@mui/system/useTheme");var kn=i.n(On);const jn=require("pdfjs-dist"),Sn=function(t){var r={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(r[t.action].label.replaceAll(" ","-").toLowerCase(),r[t.action]);return(0,e.jsx)(ce(),{title:n.label,children:(0,e.jsx)("span",{children:(0,e.jsx)(K(),{onClick:t.onClick,className:t.className,disabled:t.isDisabled,children:(0,e.jsx)(se,{name:n.symbol})})})})},En=function(t){var r,n=(0,d.useRef)(null),i=(0,d.useState)(1),o=i[0],a=i[1],c=(0,d.useState)(1),s=c[0],u=c[1],f=(0,d.useState)(1),h=f[0],m=f[1],y=(0,d.useState)(!1),v=y[0],g=y[1],b=(0,d.useState)(),x=b[0],O=b[1],k=kn()(),j=p()(k.breakpoints.down("sm")),S=p()(k.breakpoints.between("sm","md"));if(r=t.url,!/\/[^/]+\.pdf$/.test(r))return(0,e.jsx)(we(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(w(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var E=(0,d.useState)((function(){return j?.5:S?1:1.5})),A=E[0],P=E[1];return(0,d.useEffect)((function(){jn.GlobalWorkerOptions.workerSrc||(jn.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(jn.version,"/pdf.worker.mjs")),jn.getDocument({url:"".concat(t.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(o).then((function(e){var t=e.getViewport({scale:A}),r=n.current;if(r){var i=r.getContext("2d");if(i){var o=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*o,r.height=t.height*o;var a={canvasContext:i,viewport:t,transform:[o,0,0,o,0,0]};x&&x.cancel();var c=e.render(a);O(c),c.promise.then((function(){O(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){g(!0)}))}),[t.url,o,A]),v?(0,e.jsx)(we(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(w(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,e.jsxs)(we(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,e.jsxs)(l(),{className:"rustic-pdf-viewer-header",children:[(0,e.jsx)(Sn,{action:"zoomOut",onClick:function(){P((function(e){return Math.max(e-.2,.2)}))}}),(0,e.jsx)(Sn,{action:"zoomIn",onClick:function(){P((function(e){return e+.2}))}})]}),(0,e.jsx)(l(),{className:"rustic-pdf-viewer-body",children:(0,e.jsx)(l(),{className:"rustic-pdf-viewer-body-inner",children:(0,e.jsx)("canvas",{ref:n})})}),(0,e.jsxs)(wn(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,e.jsx)(Sn,{action:"previousPage",onClick:function(){o>1&&(a(o-1),m(o-1))},isDisabled:1===o}),(0,e.jsx)(w(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,e.jsx)(oe(),{type:"number",value:h,onChange:function(e){var t=parseInt(e.target.value);m(t),!isNaN(t)&&t>=1&&t<=s&&a(t)},size:"small",className:"rustic-pdf-page-input"}),(0,e.jsxs)(w(),{variant:"body1",className:"rustic-page-indicator",children:["of ",s]}),(0,e.jsx)(Sn,{action:"nextPage",onClick:function(){o<s&&(a(o+1),m(o+1))},isDisabled:o===s})]})]})};function An(t){var r=(0,d.useState)(""),n=r[0],i=r[1],o=(0,br.useTheme)(),a=(0,br.useMediaQuery)(o.breakpoints.down("md"))?"column":"row",c=t.options.map((function(r,o){return(0,e.jsx)(wr(),{onClick:function(){return function(e){i(e);var r=(new Date).toISOString(),n={id:X(),timestamp:r,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:e},inReplyTo:t.messageId};t.ws.send(n)}(r)},variant:"outlined",sx:n===r?{"&.Mui-disabled":{color:"common.white",backgroundColor:"secondary.main"}}:{},color:"secondary",className:"rustic-option",disabled:!!n,children:r},o)}));return(0,e.jsxs)(l(),{className:"rustic-question",children:[(t.title||t.description)&&(0,e.jsxs)(l(),{className:"rustic-question-text",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description})]}),(0,e.jsx)(Zr(),{direction:a,className:"rustic-options-container",children:c})]})}const Pn=require("@mui/material/Table");var Tn=i.n(Pn);const Cn=require("@mui/material/TableBody");var In=i.n(Cn);const Dn=require("@mui/material/TableCell");var Mn=i.n(Dn);const Nn=require("@mui/material/TableContainer");var Rn=i.n(Nn);const _n=require("@mui/material/TableHead");var Bn=i.n(_n);const Ln=require("@mui/material/TablePagination");var zn=i.n(Ln);const Fn=require("@mui/material/TableRow");var $n=i.n(Fn);const qn=require("@mui/material/TableSortLabel");var Wn,Un=i.n(qn),Hn=10;function Gn(){return(0,e.jsx)(se,{name:"expand_all"})}function Xn(t){if(0===t.data.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var r,n,i,o=t.data.length>Hn,a=(0,d.useState)({}),c=a[0],l=a[1],s=(0,d.useState)(o?Hn:-1),u=s[0],p=s[1],f=(0,d.useState)(0),h=f[0],m=f[1],y=(0,br.useTheme)(),v=Array.from(new Set(t.data.flatMap((function(e){return Object.keys(e)})))),g=t.headers||v.map((function(e){return{dataKey:e}})),b=(r=t.data,n=Object.keys(c)[0],i=c[n],n&&i?r.slice().sort((function(e,t){var r=Object.keys(c)[0],n=c[r];return e[r]<t[r]?n===Wn.Descending?1:-1:e[r]>t[r]?n===Wn.Descending?-1:1:0})):r),x=b.slice(h*u,h*u+u),O=u>0?x:b;function k(e){if(!c[e])return Gn}return(0,e.jsxs)(Zr(),{className:"rustic-table",spacing:1,children:[t.title&&(0,e.jsx)(w(),{variant:"h6",className:"rustic-table-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"body1",children:t.description}),(0,e.jsx)(Rn(),{className:"rustic-table-container",children:(0,e.jsxs)(Tn(),{"aria-label":t.title||"a table of data",size:"small",stickyHeader:!0,children:[g.length>0&&(0,e.jsx)(Bn(),{children:(0,e.jsx)($n(),{children:g.map((function(t,r){return(0,e.jsx)(Mn(),{sortDirection:c[t.dataKey]||!1,children:(0,e.jsx)(ce(),{title:(n=t.dataKey,i=c[n],i?Object.keys(Wn)[Object.values(Wn).indexOf(i)]:"Sort"),children:(0,e.jsx)(Un(),{active:!0,direction:c[t.dataKey],onClick:function(){return function(e){l((function(t){var r,n,i={};switch(t[e]){case Wn.Ascending:(r={})[e]=Wn.Descending,i=r;break;case Wn.Descending:i={};break;default:(n={})[e]=Wn.Ascending,i=n}return i}))}(t.dataKey)},className:"rustic-table-header",IconComponent:k(t.dataKey),children:t.label||M(t.dataKey)})})},"header-".concat(r));var n,i}))})}),(0,e.jsx)(In(),{children:O.map((function(t,r){return(0,e.jsx)($n(),{children:g.map((function(n,i){return(0,e.jsx)(Mn(),{children:t[n.dataKey]},"cell-".concat(r,"-").concat(i))}))},"row-".concat(r))}))})]})}),o&&(0,e.jsx)(zn(),{className:"rustic-table-pagination",component:"div",count:t.data.length,rowsPerPage:u,labelRowsPerPage:"Rows:",page:h,onPageChange:function(e,t){return m(t)},onRowsPerPageChange:function(e){p(+e.target.value),m(0)},sx:{"& .MuiTablePagination-selectLabel":{color:y.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})}!function(e){e.Ascending="asc",e.Descending="desc"}(Wn||(Wn={}));const Vn=function(t){var r=(0,d.useState)($t.sanitize(t.text)),n=r[0],i=r[1],o=(0,d.useState)(""),a=o[0],c=o[1];return(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text&&(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")),e+=o.text}i($t.sanitize(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",children:n}),a&&(0,e.jsx)(Ne(),{severity:"error",children:a})]})};var Kn=function(){return Kn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Kn.apply(this,arguments)};function Yn(t){var r=$t.sanitize(t.youtubeVideoId);return(0,e.jsx)("iframe",Kn({},_(t.width,t.height),{src:"https://www.youtube.com/embed/".concat(r),title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",loading:"lazy"}))}Yn.defaultProps={title:"Embedded video"};const Zn=require("@mui/material/FormControl");var Qn=i.n(Zn);const Jn=require("lodash/isNil");var ei=i.n(Jn);const ti=require("lodash/isFunction");var ri=i.n(ti);const ni=require("lodash/range");var ii=i.n(ni);const oi=require("lodash/get");var ai=i.n(oi);const ci=require("lodash/sortBy");var li=i.n(ci);const si=require("lodash/throttle");var ui=i.n(si);const pi=require("lodash/find");var di=i.n(pi);const fi=require("lodash/every");var hi=i.n(fi);const mi=require("clsx");var yi=i.n(mi);const vi=require("tiny-invariant");var gi=i.n(vi);function bi(e){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bi(e)}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xi(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==bi(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===bi(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Oi=Math.PI/180,ki=function(e){return 180*e/Math.PI},ji=function(e,t,r,n){return{x:e+Math.cos(-Oi*n)*r,y:t+Math.sin(-Oi*n)*r}},Si=function(e,t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360);return e+360*Math.min(i,o)},Ei=function(e,t){var r=function(e,t){var r,n,i,o,a,c,l=e.x,s=e.y,u=t.cx,p=t.cy,d=(i=(r={x:l,y:s}).x,o=r.y,a=(n={x:u,y:p}).x,c=n.y,Math.sqrt(Math.pow(i-a,2)+Math.pow(o-c,2)));if(d<=0)return{radius:d};var f=(l-u)/d,h=Math.acos(f);return s>p&&(h=2*Math.PI-h),{radius:d,angle:ki(h),angleInRadian:h}}({x:e.x,y:e.y},t),n=r.radius,i=r.angle,o=t.innerRadius,a=t.outerRadius;if(n<o||n>a)return!1;if(0===n)return!0;var c,l=function(e){var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-360*o,endAngle:r-360*o}}(t),s=l.startAngle,u=l.endAngle,p=i;if(s<=u){for(;p>u;)p-=360;for(;p<s;)p+=360;c=p>=s&&p<=u}else{for(;p>s;)p-=360;for(;p<u;)p+=360;c=p>=u&&p<=s}return c?wi(wi({},t),{},{radius:n,angle:Si(p,t)}):null};function Ai(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle;return{points:[ji(t,r,n,i),ji(t,r,n,o)],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}const Pi=require("lodash/isString");var Ti=i.n(Pi);const Ci=require("lodash/isNaN");var Ii=i.n(Ci);const Di=require("lodash/isNumber");var Mi=i.n(Di),Ni=function(e){return 0===e?0:e>0?1:-1},Ri=function(e){return Ti()(e)&&e.indexOf("%")===e.length-1},_i=function(e){return Mi()(e)&&!Ii()(e)},Bi=function(e){return _i(e)||Ti()(e)},Li=0,zi=function(e){var t=++Li;return"".concat(e||"").concat(t)},Fi=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!_i(e)&&!Ti()(e))return n;if(Ri(e)){var o=e.indexOf("%");r=t*parseFloat(e.slice(0,o))/100}else r=+e;return Ii()(r)&&(r=n),i&&r>t&&(r=t),r},$i=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},qi=function(e,t){return _i(e)&&_i(t)?function(r){return e+r*(t-e)}:function(){return t}};function Wi(e,t,r){return e&&e.length?e.find((function(e){return e&&("function"==typeof t?t(e):ai()(e,t))===r})):null}var Ui={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return Ui[e]},set:function(e,t){if("string"==typeof e)Ui[e]=t;else{var r=Object.keys(e);r&&r.length&&r.forEach((function(t){Ui[t]=e[t]}))}}};function Hi(e){return Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hi(e)}function Gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Hi(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Hi(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vi={widthCache:{},cacheCount:0},Ki={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Yi="recharts_measurement_span",Zi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||Ui.isSsr)return{width:0,height:0};var r,n=(r=Xi({},t),Object.keys(r).forEach((function(e){r[e]||delete r[e]})),r),i=JSON.stringify({text:e,copyStyle:n});if(Vi.widthCache[i])return Vi.widthCache[i];try{var o=document.getElementById(Yi);o||((o=document.createElement("span")).setAttribute("id",Yi),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=Xi(Xi({},Ki),n);Object.assign(o.style,a),o.textContent="".concat(e);var c=o.getBoundingClientRect(),l={width:c.width,height:c.height};return Vi.widthCache[i]=l,++Vi.cacheCount>2e3&&(Vi.cacheCount=0,Vi.widthCache={}),l}catch(e){return{width:0,height:0}}};const Qi=require("lodash/mapValues");var Ji=i.n(Qi);const eo=require("victory-vendor/d3-scale"),to=require("victory-vendor/d3-shape"),ro=require("lodash/max");var no=i.n(ro);const io=require("lodash/min");var oo=i.n(io);const ao=require("lodash/flatMap");var co=i.n(ao);const lo=require("lodash/upperFirst");var so=i.n(lo);const uo=require("lodash/isEqual");var po=i.n(uo);const fo=require("recharts-scale"),ho=require("lodash/isObject");var mo=i.n(ho);const yo=require("react-is");function vo(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function go(e){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},go(e)}var bo=["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"],xo=["points","pathLength"],wo={svg:["viewBox","children"],polygon:xo,polyline:xo},Oo=["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"],ko=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,d.isValidElement)(e)&&(r=e.props),!mo()(r))return null;var n={};return Object.keys(r).forEach((function(e){Oo.includes(e)&&(n[e]=t||function(t){return r[e](r,t)})})),n},jo=function(e,t,r){if(!mo()(e)||"object"!==go(e))return null;var n=null;return Object.keys(e).forEach((function(i){var o=e[i];Oo.includes(i)&&"function"==typeof o&&(n||(n={}),n[i]=function(e,t,r){return function(n){return e(t,r,n),null}}(o,t,r))})),n},So=["children"],Eo=["children"];function Ao(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Po(e){return Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Po(e)}var To={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Co=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},Io=null,Do=null,Mo=function e(t){if(t===Io&&Array.isArray(Do))return Do;var r=[];return d.Children.forEach(t,(function(t){ei()(t)||((0,yo.isFragment)(t)?r=r.concat(e(t.props.children)):r.push(t))})),Do=r,Io=t,r};function No(e,t){var r=[],n=[];return n=Array.isArray(t)?t.map((function(e){return Co(e)})):[Co(t)],Mo(e).forEach((function(e){var t=ai()(e,"type.displayName")||ai()(e,"type.name");-1!==n.indexOf(t)&&r.push(e)})),r}function Ro(e,t){var r=No(e,t);return r&&r[0]}var _o=function(e){if(!e||!e.props)return!1;var t=e.props,r=t.width,n=t.height;return!(!_i(r)||r<=0||!_i(n)||n<=0)},Bo=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Lo=function(e){return e&&"object"===Po(e)&&"cx"in e&&"cy"in e&&"r"in e},zo=function(e,t,r){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,d.isValidElement)(e)&&(n=e.props),!mo()(n))return null;var i={};return Object.keys(n).forEach((function(e){var o;(function(e,t,r,n){var i,o=null!==(i=null==wo?void 0:wo[n])&&void 0!==i?i:[];return!ri()(e)&&(n&&o.includes(t)||bo.includes(t))||r&&Oo.includes(t)})(null===(o=n)||void 0===o?void 0:o[e],e,t,r)&&(i[e]=n[e])})),i},Fo=function e(t,r){if(t===r)return!0;var n=d.Children.count(t);if(n!==d.Children.count(r))return!1;if(0===n)return!0;if(1===n)return $o(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var o=t[i],a=r[i];if(Array.isArray(o)||Array.isArray(a)){if(!e(o,a))return!1}else if(!$o(o,a))return!1}return!0},$o=function(e,t){if(ei()(e)&&ei()(t))return!0;if(!ei()(e)&&!ei()(t)){var r=e.props||{},n=r.children,i=Ao(r,So),o=t.props||{},a=o.children,c=Ao(o,Eo);return n&&a?vo(i,c)&&Fo(n,a):!n&&!a&&vo(i,c)}return!1},qo=function(e,t){var r=[],n={};return Mo(e).forEach((function(e,i){if(function(e){return e&&e.type&&Ti()(e.type)&&Bo.indexOf(e.type)>=0}(e))r.push(e);else if(e){var o=Co(e.type),a=t[o]||{},c=a.handler,l=a.once;if(c&&(!l||!n[o])){var s=c(e,o,i);r.push(s),n[o]=!0}}})),r},Wo=["children","className"];function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uo.apply(this,arguments)}var Ho=f().forwardRef((function(e,t){var r=e.children,n=e.className,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Wo),o=yi()("recharts-layer",n);return f().createElement("g",Uo({className:o},zo(i,!0),{ref:t}),r)})),Go=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xo.apply(this,arguments)}function Vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ko(e){var t=e.offset,r=e.layout,n=e.width,i=e.dataKey,o=e.data,a=e.dataPointFormatter,c=e.xAxis,l=e.yAxis,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Go),u=zo(s),p=o.map((function(e){var o=a(e,i),s=o.x,p=o.y,d=o.value,h=o.errorVal;if(!h)return null;var m,y,v,g,b=[];if(Array.isArray(h)){var x=(g=2,function(e){if(Array.isArray(e))return e}(v=h)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(v,g)||function(e,t){if(e){if("string"==typeof e)return Vo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vo(e,t):void 0}}(v,g)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());m=x[0],y=x[1]}else m=y=h;if("vertical"===r){var w=c.scale,O=p+t,k=O+n,j=O-n,S=w(d-m),E=w(d+y);b.push({x1:E,y1:k,x2:E,y2:j}),b.push({x1:S,y1:O,x2:E,y2:O}),b.push({x1:S,y1:k,x2:S,y2:j})}else if("horizontal"===r){var A=l.scale,P=s+t,T=P-n,C=P+n,I=A(d-m),D=A(d+y);b.push({x1:T,y1:D,x2:C,y2:D}),b.push({x1:P,y1:I,x2:P,y2:D}),b.push({x1:T,y1:I,x2:C,y2:I})}return f().createElement(Ho,Xo({className:"recharts-errorBar",key:"bar-".concat(b.map((function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)})))},u),b.map((function(e){return f().createElement("line",Xo({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))})))}));return f().createElement(Ho,{className:"recharts-errorBars"},p)}Ko.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},Ko.displayName="ErrorBar";var Yo=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i]},Zo=["children","width","height","viewBox","className","style","title","desc"];function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qo.apply(this,arguments)}function Jo(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,a=e.style,c=e.title,l=e.desc,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Zo),u=i||{width:r,height:n,x:0,y:0},p=yi()("recharts-surface",o);return f().createElement("svg",Qo({},zo(s,!0,"svg"),{className:p,width:r,height:n,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),f().createElement("title",null,c),f().createElement("desc",null,l),t)}function ea(e){return ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ea(e)}var ta=["type","size","sizeType"];function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ra.apply(this,arguments)}function na(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?na(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ea(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ea(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):na(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var oa={symbolCircle:to.symbolCircle,symbolCross:to.symbolCross,symbolDiamond:to.symbolDiamond,symbolSquare:to.symbolSquare,symbolStar:to.symbolStar,symbolTriangle:to.symbolTriangle,symbolWye:to.symbolWye},aa=Math.PI/180,ca=function(e){var t,r,n=e.type,i=void 0===n?"circle":n,o=e.size,a=void 0===o?64:o,c=e.sizeType,l=void 0===c?"area":c,s=ia(ia({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,ta)),{},{type:i,size:a,sizeType:l}),u=s.className,p=s.cx,d=s.cy,h=zo(s,!0);return p===+p&&d===+d&&a===+a?f().createElement("path",ra({},h,{className:yi()("recharts-symbols",u),transform:"translate(".concat(p,", ").concat(d,")"),d:(t=function(e){var t="symbol".concat(so()(e));return oa[t]||to.symbolCircle}(i),r=(0,to.symbol)().type(t).size(function(e,t,r){if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*aa;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.pow(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}}(a,l,i)),r())})):null};function la(e){return la="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},la(e)}function sa(){return sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sa.apply(this,arguments)}function ua(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ma(n.key),n)}}function da(e,t){return da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},da(e,t)}function fa(e){return fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fa(e)}function ha(e,t,r){return(t=ma(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ma(e){var t=function(e,t){if("object"!==la(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==la(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===la(t)?t:String(t)}ca.registerSymbol=function(e,t){oa["symbol".concat(so()(e))]=t};var ya=32,va=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&da(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fa(n);if(i){var r=fa(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===la(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,r=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,r=16,n=ya/6,i=ya/3,o=e.inactive?t:e.color;if("plainline"===e.type)return f().createElement("line",{strokeWidth:4,fill:"none",stroke:o,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:r,x2:ya,y2:r,className:"recharts-legend-icon"});if("line"===e.type)return f().createElement("path",{strokeWidth:4,fill:"none",stroke:o,d:"M0,".concat(r,"h").concat(i,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*i,",").concat(r,"\n H").concat(ya,"M").concat(2*i,",").concat(r,"\n A").concat(n,",").concat(n,",0,1,1,").concat(i,",").concat(r),className:"recharts-legend-icon"});if("rect"===e.type)return f().createElement("path",{stroke:"none",fill:o,d:"M0,".concat(4,"h").concat(ya,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(f().isValidElement(e.legendIcon)){var a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ua(Object(r),!0).forEach((function(t){ha(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ua(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);return delete a.legendIcon,f().cloneElement(e.legendIcon,a)}return f().createElement(ca,{fill:o,cx:r,cy:r,size:ya,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,r=t.payload,n=t.iconSize,i=t.layout,o=t.formatter,a=t.inactiveColor,c={x:0,y:0,width:ya,height:ya},l={display:"horizontal"===i?"inline-block":"block",marginRight:10},s={display:"inline-block",verticalAlign:"middle",marginRight:4};return r.map((function(t,r){var i,u=t.formatter||o,p=yi()((ha(i={"recharts-legend-item":!0},"legend-item-".concat(r),!0),ha(i,"inactive",t.inactive),i));if("none"===t.type)return null;var d=ri()(t.value)?null:t.value;Yo(!ri()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var h=t.inactive?a:t.color;return f().createElement("li",sa({className:p,style:l,key:"legend-item-".concat(r)},jo(e.props,t,r)),f().createElement(Jo,{width:n,height:n,viewBox:c,style:s},e.renderIcon(t)),f().createElement("span",{className:"recharts-legend-item-text",style:{color:h}},u?u(d,t,r):d))}))}},{key:"render",value:function(){var e=this.props,t=e.payload,r=e.layout,n=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:"horizontal"===r?n:"left"};return f().createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}],r&&pa(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(d.PureComponent);ha(va,"displayName","Legend"),ha(va,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});const ga=require("lodash/uniqBy");var ba=i.n(ga);function xa(e,t,r){return!0===t?ba()(e,r):ri()(t)?ba()(e,t):e}function wa(e){return wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wa(e)}var Oa=["ref"];function ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ja(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(r),!0).forEach((function(t){Ta(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Sa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ca(n.key),n)}}function Ea(e,t){return Ea=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ea(e,t)}function Aa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pa(e){return Pa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pa(e)}function Ta(e,t,r){return(t=Ca(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ca(e){var t=function(e,t){if("object"!==wa(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==wa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===wa(t)?t:String(t)}function Ia(e){return e.value}var Da=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ea(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Pa(i);if(o){var r=Pa(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===wa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Aa(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ta(Aa(e=a.call.apply(a,[this].concat(r))),"lastBoundingBox",{width:-1,height:-1}),e}return t=c,n=[{key:"getWithHeight",value:function(e,t){var r=e.props.layout;return"vertical"===r&&_i(e.props.height)?{height:e.props.height}:"horizontal"===r?{width:e.props.width||t}:null}}],(r=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ja({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,r,n=this.props,i=n.layout,o=n.align,a=n.verticalAlign,c=n.margin,l=n.chartWidth,s=n.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===o&&"vertical"===i?{left:((l||0)-this.getBBoxSnapshot().width)/2}:"right"===o?{right:c&&c.right||0}:{left:c&&c.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(r="middle"===a?{top:((s||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:c&&c.bottom||0}:{top:c&&c.top||0}),ja(ja({},t),r)}},{key:"render",value:function(){var e=this,t=this.props,r=t.content,n=t.width,i=t.height,o=t.wrapperStyle,a=t.payloadUniqBy,c=t.payload,l=ja(ja({position:"absolute",width:n||"auto",height:i||"auto"},this.getDefaultPosition(o)),o);return f().createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(t){e.wrapperNode=t}},function(e,t){if(f().isValidElement(e))return f().cloneElement(e,t);if("function"==typeof e)return f().createElement(e,t);t.ref;var r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,Oa);return f().createElement(va,r)}(r,ja(ja({},this.props),{},{payload:xa(c,a,Ia)})))}}])&&Sa(t.prototype,r),n&&Sa(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);function Ma(e){return Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ma(e)}function Na(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ra(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Na(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ma(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ma(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ma(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Na(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Ta(Da,"displayName","Legend"),Ta(Da,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var _a=function(e){var t,r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,o=e.legendContent,a=Ro(r,Da);return a?(t=a.props&&a.props.payload?a.props&&a.props.payload:"children"===o?(n||[]).reduce((function(e,t){var r=t.item,n=t.props,i=n.sectors||n.data||[];return e.concat(i.map((function(e){return{type:a.props.iconType||r.props.legendType,value:e.name,color:e.fill,payload:e}})))}),[]):(n||[]).map((function(e){var t=e.item,r=t.props,n=r.dataKey,i=r.name,o=r.legendType;return{inactive:r.hide,dataKey:n,type:a.props.iconType||o||"square",color:Ha(t),value:i||n,payload:t.props}})),Ra(Ra(Ra({},a.props),Da.getWithHeight(a,i)),{},{payload:t,item:a})):null};function Ba(e){return Ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ba(e)}function La(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function za(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?La(Object(r),!0).forEach((function(t){Fa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):La(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Ba(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ba(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ba(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $a(e){return function(e){if(Array.isArray(e))return qa(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return qa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qa(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wa(e,t,r){return ei()(e)||ei()(t)?r:Bi(t)?ai()(e,t,r):ri()(t)?t(e):r}function Ua(e,t,r,n){var i=co()(e,(function(e){return Wa(e,t)}));if("number"===r){var o=i.filter((function(e){return _i(e)||parseFloat(e)}));return o.length?[oo()(o),no()(o)]:[1/0,-1/0]}return(n?i.filter((function(e){return!ei()(e)})):i).map((function(e){return Bi(e)||e instanceof Date?e:""}))}var Ha=function(e){var t,r=e.type.displayName,n=e.props,i=n.stroke,o=n.fill;switch(r){case"Line":t=i;break;case"Area":case"Radar":t=i&&"none"!==i?i:o;break;default:t=o}return t},Ga=function(e,t,r,n,i){var o=No(t.props.children,Ko).filter((function(e){return function(e,t,r){return!!ei()(t)||("horizontal"===e?"yAxis"===t:"vertical"===e||"x"===r?"xAxis"===t:"y"!==r||"yAxis"===t)}(n,i,e.props.direction)}));if(o&&o.length){var a=o.map((function(e){return e.props.dataKey}));return e.reduce((function(e,t){var n=Wa(t,r,0),i=Array.isArray(n)?[oo()(n),no()(n)]:[n,n],o=a.reduce((function(e,r){var n=Wa(t,r,0),o=i[0]-Math.abs(Array.isArray(n)?n[0]:n),a=i[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(o,e[0]),Math.max(a,e[1])]}),[1/0,-1/0]);return[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}),[1/0,-1/0])}return null},Xa=function(e,t,r,n,i){var o=t.map((function(t){var o=t.props.dataKey;return"number"===r&&o&&Ga(e,t,o,n)||Ua(e,o,r,i)}));if("number"===r)return o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]);var a={};return o.reduce((function(e,t){for(var r=0,n=t.length;r<n;r++)a[t[r]]||(a[t[r]]=!0,e.push(t[r]));return e}),[])},Va=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},Ka=function(e,t,r,n){if(n)return e.map((function(e){return e.coordinate}));var i,o,a=e.map((function(e){return e.coordinate===t&&(i=!0),e.coordinate===r&&(o=!0),e.coordinate}));return i||a.push(t),o||a.push(r),a},Ya=function(e,t,r){if(!e)return null;var n=e.scale,i=e.duplicateDomain,o=e.type,a=e.range,c="scaleBand"===e.realScaleType?n.bandwidth()/2:2,l=(t||r)&&"category"===o&&n.bandwidth?n.bandwidth()/c:0;return l="angleAxis"===e.axisType&&(null==a?void 0:a.length)>=2?2*Ni(a[0]-a[1])*l:l,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map((function(e){var t=i?i.indexOf(e):e;return{coordinate:n(t)+l,value:e,offset:l}})).filter((function(e){return!Ii()(e.coordinate)})):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map((function(e,t){return{coordinate:n(e)+l,value:e,index:t,offset:l}})):n.ticks&&!r?n.ticks(e.tickCount).map((function(e){return{coordinate:n(e)+l,value:e,offset:l}})):n.domain().map((function(e,t){return{coordinate:n(e)+l,value:i?i[e]:e,index:t,offset:l}}))},Za=new WeakMap,Qa=function(e,t){if("function"!=typeof t)return e;Za.has(e)||Za.set(e,new WeakMap);var r=Za.get(e);if(r.has(t))return r.get(t);var n=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return r.set(t,n),n},Ja=1e-4,ec={sign:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0,a=0;a<t;++a){var c=Ii()(e[a][r][1])?e[a][r][0]:e[a][r][1];c>=0?(e[a][r][0]=i,e[a][r][1]=i+c,i=e[a][r][1]):(e[a][r][0]=o,e[a][r][1]=o+c,o=e[a][r][1])}},expand:to.stackOffsetExpand,none:to.stackOffsetNone,silhouette:to.stackOffsetSilhouette,wiggle:to.stackOffsetWiggle,positive:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0;o<t;++o){var a=Ii()(e[o][r][1])?e[o][r][0]:e[o][r][1];a>=0?(e[o][r][0]=i,e[o][r][1]=i+a,i=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}}},tc=function(e,t,r){var n=t.map((function(e){return e.props.dataKey})),i=ec[r];return(0,to.stack)().keys(n).value((function(e,t){return+Wa(e,t,0)})).order(to.stackOrderNone).offset(i)(e)},rc=function(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!ei()(i[t.dataKey])){var c=Wi(r,"value",i[t.dataKey]);if(c)return c.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var l=Wa(i,ei()(a)?t.dataKey:a);return ei()(l)?null:t.scale(l)},nc=function(e){var t=e.axis,r=e.ticks,n=e.offset,i=e.bandSize,o=e.entry,a=e.index;if("category"===t.type)return r[a]?r[a].coordinate+n:null;var c=Wa(o,t.dataKey,t.domain[a]);return ei()(c)?null:t.scale(c)-i/2+n},ic=function(e,t,r){return Object.keys(e).reduce((function(n,i){var o=e[i].stackedData.reduce((function(e,n){var i=n.slice(t,r+1).reduce((function(e,t){return[oo()(t.concat([e[0]]).filter(_i)),no()(t.concat([e[1]]).filter(_i))]}),[1/0,-1/0]);return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]}),[1/0,-1/0]);return[Math.min(o[0],n[0]),Math.max(o[1],n[1])]}),[1/0,-1/0]).map((function(e){return e===1/0||e===-1/0?0:e}))},oc=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ac=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cc=function(e,t,r){if(ri()(e))return e(t,r);if(!Array.isArray(e))return t;var n=[];if(_i(e[0]))n[0]=r?e[0]:Math.min(e[0],t[0]);else if(oc.test(e[0])){var i=+oc.exec(e[0])[1];n[0]=t[0]-i}else ri()(e[0])?n[0]=e[0](t[0]):n[0]=t[0];if(_i(e[1]))n[1]=r?e[1]:Math.max(e[1],t[1]);else if(ac.test(e[1])){var o=+ac.exec(e[1])[1];n[1]=t[1]+o}else ri()(e[1])?n[1]=e[1](t[1]):n[1]=t[1];return n},lc=function(e,t,r){if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=li()(t,(function(e){return e.coordinate})),o=1/0,a=1,c=i.length;a<c;a++){var l=i[a],s=i[a-1];o=Math.min((l.coordinate||0)-(s.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},sc=function(e,t,r){return e&&e.length?po()(e,ai()(r,"type.defaultProps.domain"))?t:e:t},uc=function(e,t){var r=e.props,n=r.dataKey,i=r.name,o=r.unit,a=r.formatter,c=r.tooltipType,l=r.chartType;return za(za({},zo(e)),{},{dataKey:n,unit:o,formatter:a,name:i||n,color:Ha(e),value:Wa(t,n),type:c,payload:t,chartType:l})};const pc=require("react-smooth");var dc=i.n(pc),fc=function(e){return null};fc.displayName="Cell";const hc=require("lodash/last");var mc=i.n(hc);function yc(e){return yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yc(e)}function vc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==yc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===yc(i)?i:String(i)),n)}var i}var xc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,wc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Oc=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,kc=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,jc={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},Sc=Object.keys(jc),Ec="NaN",Ac=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),""===r||Oc.test(r)||(this.num=NaN,this.unit=""),Sc.includes(r)&&(this.num=function(e,t){return e*jc[t]}(t,r),this.unit="px")}var t,r,n;return t=e,n=[{key:"parse",value:function(t){var r,n=vc(null!==(r=kc.exec(t))&&void 0!==r?r:[],3),i=n[1],o=n[2];return new e(parseFloat(i),null!=o?o:"")}}],(r=[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}])&&bc(t.prototype,r),n&&bc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Pc(e){if(e.includes(Ec))return Ec;for(var t=e;t.includes("*")||t.includes("/");){var r,n=vc(null!==(r=xc.exec(t))&&void 0!==r?r:[],4),i=n[1],o=n[2],a=n[3],c=Ac.parse(null!=i?i:""),l=Ac.parse(null!=a?a:""),s="*"===o?c.multiply(l):c.divide(l);if(s.isNaN())return Ec;t=t.replace(xc,s.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,p=vc(null!==(u=wc.exec(t))&&void 0!==u?u:[],4),d=p[1],f=p[2],h=p[3],m=Ac.parse(null!=d?d:""),y=Ac.parse(null!=h?h:""),v="+"===f?m.add(y):m.subtract(y);if(v.isNaN())return Ec;t=t.replace(wc,v.toString())}return t}var Tc=/\(([^()]*)\)/;function Cc(e){var t=function(e){try{return function(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t=e;t.includes("(");){var r=vc(Tc.exec(t),2)[1];t=t.replace(Tc,Pc(r))}return t}(t),Pc(t)}(e)}catch(e){return Ec}}(e.slice(5,-1));return t===Ec?"":t}var Ic=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Dc=["dx","dy","angle","className","breakAll"];function Mc(){return Mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mc.apply(this,arguments)}function Nc(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Rc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Bc=/[ \f\n\r\t\v\u2028\u2029]+/,Lc=function(e){var t=e.children,r=e.breakAll,n=e.style;try{var i=[];return ei()(t)||(i=r?t.toString().split(""):t.toString().split(Bc)),{wordsWithComputedWidth:i.map((function(e){return{word:e,width:Zi(e,n).width}})),spaceWidth:r?0:Zi(" ",n).width}}catch(e){return null}},zc=function(e){return[{words:ei()(e)?[]:e.toString().split(Bc)}]},Fc="#808080",$c=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.lineHeight,a=void 0===o?"1em":o,c=e.capHeight,l=void 0===c?"0.71em":c,s=e.scaleToFit,u=void 0!==s&&s,p=e.textAnchor,h=void 0===p?"start":p,m=e.verticalAnchor,y=void 0===m?"end":m,v=e.fill,g=void 0===v?Fc:v,b=Nc(e,Ic),x=(0,d.useMemo)((function(){return function(e){var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,a=e.maxLines;if((t||r)&&!Ui.isSsr){var c=Lc({breakAll:o,children:n,style:i});return c?function(e,t,r,n,i){var o=e.maxLines,a=e.children,c=e.style,l=e.breakAll,s=_i(o),u=a,p=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var o=t.word,a=t.width,c=e[e.length-1];if(c&&(null==n||i||c.width+a+r<Number(n)))c.words.push(o),c.width+=a+r;else{var l={words:[o],width:a};e.push(l)}return e}),[])},d=p(t);if(!s)return d;for(var f,h=function(e){var t=u.slice(0,e),r=Lc({breakAll:l,style:c,children:t+"…"}).wordsWithComputedWidth,i=p(r),a=i.length>o||function(e){return e.reduce((function(e,t){return e.width>t.width?e:t}))}(i).width>Number(n);return[a,i]},m=0,y=u.length-1,v=0;m<=y&&v<=u.length-1;){var g=Math.floor((m+y)/2),b=Rc(h(g-1),2),x=b[0],w=b[1],O=Rc(h(g),1)[0];if(x||O||(m=g+1),x&&O&&(y=g-1),!x&&O){f=w;break}v++}return f||d}({breakAll:o,children:n,maxLines:a,style:i},c.wordsWithComputedWidth,c.spaceWidth,t,r):zc(n)}return zc(n)}({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:u,style:b.style,width:b.width})}),[b.breakAll,b.children,b.maxLines,u,b.style,b.width]),w=b.dx,O=b.dy,k=b.angle,j=b.className,S=b.breakAll,E=Nc(b,Dc);if(!Bi(r)||!Bi(i))return null;var A,P=r+(_i(w)?w:0),T=i+(_i(O)?O:0);switch(y){case"start":A=Cc("calc(".concat(l,")"));break;case"middle":A=Cc("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:A=Cc("calc(".concat(x.length-1," * -").concat(a,")"))}var C=[];if(u){var I=x[0].width,D=b.width;C.push("scale(".concat((_i(D)?D/I:1)/I,")"))}return k&&C.push("rotate(".concat(k,", ").concat(P,", ").concat(T,")")),C.length&&(E.transform=C.join(" ")),f().createElement("text",Mc({},zo(E,!0),{x:P,y:T,className:yi()("recharts-text",j),textAnchor:h,fill:g.includes("url")?Fc:g}),x.map((function(e,t){var r=e.words.join(S?"":" ");return f().createElement("tspan",{x:P,dy:0===t?A:a,key:r},r)})))};function qc(e){return qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qc(e)}var Wc=["offset"];function Uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Hc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hc(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==qc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==qc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===qc(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xc(){return Xc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xc.apply(this,arguments)}var Vc=function(e){var t=e.value,r=e.formatter,n=ei()(e.children)?t:e.children;return ri()(r)?r(n):n},Kc=function(e,t,r){var n,i,o=e.position,a=e.viewBox,c=e.offset,l=e.className,s=a,u=s.cx,p=s.cy,d=s.innerRadius,h=s.outerRadius,m=s.startAngle,y=s.endAngle,v=s.clockWise,g=(d+h)/2,b=function(e,t){return Ni(t-e)*Math.min(Math.abs(t-e),360)}(m,y),x=b>=0?1:-1;"insideStart"===o?(n=m+x*c,i=v):"insideEnd"===o?(n=y-x*c,i=!v):"end"===o&&(n=y+x*c,i=v),i=b<=0?i:!i;var w=ji(u,p,g,n),O=ji(u,p,g,n+359*(i?1:-1)),k="M".concat(w.x,",").concat(w.y,"\n A").concat(g,",").concat(g,",0,1,").concat(i?0:1,",\n ").concat(O.x,",").concat(O.y),j=ei()(e.id)?zi("recharts-radial-line-"):e.id;return f().createElement("text",Xc({},r,{dominantBaseline:"central",className:yi()("recharts-radial-bar-label",l)}),f().createElement("defs",null,f().createElement("path",{id:j,d:k})),f().createElement("textPath",{xlinkHref:"#".concat(j)},t))},Yc=function(e){var t=e.viewBox,r=e.offset,n=e.position,i=t,o=i.cx,a=i.cy,c=i.innerRadius,l=i.outerRadius,s=(i.startAngle+i.endAngle)/2;if("outside"===n){var u=ji(o,a,l+r,s),p=u.x;return{x:p,y:u.y,textAnchor:p>=o?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=ji(o,a,(c+l)/2,s);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}},Zc=function(e){var t=e.viewBox,r=e.parentViewBox,n=e.offset,i=e.position,o=t,a=o.x,c=o.y,l=o.width,s=o.height,u=s>=0?1:-1,p=u*n,d=u>0?"end":"start",f=u>0?"start":"end",h=l>=0?1:-1,m=h*n,y=h>0?"end":"start",v=h>0?"start":"end";if("top"===i)return Gc(Gc({},{x:a+l/2,y:c-u*n,textAnchor:"middle",verticalAnchor:d}),r?{height:Math.max(c-r.y,0),width:l}:{});if("bottom"===i)return Gc(Gc({},{x:a+l/2,y:c+s+p,textAnchor:"middle",verticalAnchor:f}),r?{height:Math.max(r.y+r.height-(c+s),0),width:l}:{});if("left"===i){var g={x:a-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"};return Gc(Gc({},g),r?{width:Math.max(g.x-r.x,0),height:s}:{})}if("right"===i){var b={x:a+l+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"};return Gc(Gc({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:s}:{})}var x=r?{width:l,height:s}:{};return"insideLeft"===i?Gc({x:a+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"},x):"insideRight"===i?Gc({x:a+l-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"},x):"insideTop"===i?Gc({x:a+l/2,y:c+p,textAnchor:"middle",verticalAnchor:f},x):"insideBottom"===i?Gc({x:a+l/2,y:c+s-p,textAnchor:"middle",verticalAnchor:d},x):"insideTopLeft"===i?Gc({x:a+m,y:c+p,textAnchor:v,verticalAnchor:f},x):"insideTopRight"===i?Gc({x:a+l-m,y:c+p,textAnchor:y,verticalAnchor:f},x):"insideBottomLeft"===i?Gc({x:a+m,y:c+s-p,textAnchor:v,verticalAnchor:d},x):"insideBottomRight"===i?Gc({x:a+l-m,y:c+s-p,textAnchor:y,verticalAnchor:d},x):mo()(i)&&(_i(i.x)||Ri(i.x))&&(_i(i.y)||Ri(i.y))?Gc({x:a+Fi(i.x,l),y:c+Fi(i.y,s),textAnchor:"end",verticalAnchor:"end"},x):Gc({x:a+l/2,y:c+s/2,textAnchor:"middle",verticalAnchor:"middle"},x)},Qc=function(e){return"cx"in e&&_i(e.cx)};function Jc(e){var t,r=e.offset,n=Gc({offset:void 0===r?5:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Wc)),i=n.viewBox,o=n.position,a=n.value,c=n.children,l=n.content,s=n.className,u=void 0===s?"":s,p=n.textBreakAll;if(!i||ei()(a)&&ei()(c)&&!(0,d.isValidElement)(l)&&!ri()(l))return null;if((0,d.isValidElement)(l))return(0,d.cloneElement)(l,n);if(ri()(l)){if(t=(0,d.createElement)(l,n),(0,d.isValidElement)(t))return t}else t=Vc(n);var h=Qc(i),m=zo(n,!0);if(h&&("insideStart"===o||"insideEnd"===o||"end"===o))return Kc(n,t,m);var y=h?Yc(n):Zc(n);return f().createElement($c,Xc({className:yi()("recharts-label",u)},m,y,{breakAll:p}),t)}Jc.displayName="Label";var el=function(e){var t=e.cx,r=e.cy,n=e.angle,i=e.startAngle,o=e.endAngle,a=e.r,c=e.radius,l=e.innerRadius,s=e.outerRadius,u=e.x,p=e.y,d=e.top,f=e.left,h=e.width,m=e.height,y=e.clockWise,v=e.labelViewBox;if(v)return v;if(_i(h)&&_i(m)){if(_i(u)&&_i(p))return{x:u,y:p,width:h,height:m};if(_i(d)&&_i(f))return{x:d,y:f,width:h,height:m}}return _i(u)&&_i(p)?{x:u,y:p,width:0,height:0}:_i(t)&&_i(r)?{cx:t,cy:r,startAngle:i||n||0,endAngle:o||n||0,innerRadius:l||0,outerRadius:s||c||a||0,clockWise:y}:e.viewBox?e.viewBox:{}};function tl(e){return tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tl(e)}Jc.parseViewBox=el,Jc.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=el(e),o=No(n,Jc).map((function(e,r){return(0,d.cloneElement)(e,{viewBox:t||i,key:"label-".concat(r)})}));if(!r)return o;var a,c=function(e,t){return e?!0===e?f().createElement(Jc,{key:"label-implicit",viewBox:t}):Bi(e)?f().createElement(Jc,{key:"label-implicit",viewBox:t,value:e}):(0,d.isValidElement)(e)?e.type===Jc?(0,d.cloneElement)(e,{key:"label-implicit",viewBox:t}):f().createElement(Jc,{key:"label-implicit",content:e,viewBox:t}):ri()(e)?f().createElement(Jc,{key:"label-implicit",content:e,viewBox:t}):mo()(e)?f().createElement(Jc,Xc({viewBox:t},e,{key:"label-implicit"})):null:null}(e.label,t||i);return[c].concat(function(e){if(Array.isArray(e))return Uc(e)}(a=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return Uc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Uc(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())};var rl=["valueAccessor"],nl=["data","dataKey","clockWise","id","textBreakAll"];function il(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ol.apply(this,arguments)}function al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function cl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?al(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==tl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===tl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):al(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ll(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var sl=function(e){return Array.isArray(e.value)?mc()(e.value):e.value};function ul(e){var t=e.valueAccessor,r=void 0===t?sl:t,n=ll(e,rl),i=n.data,o=n.dataKey,a=n.clockWise,c=n.id,l=n.textBreakAll,s=ll(n,nl);return i&&i.length?f().createElement(Ho,{className:"recharts-label-list"},i.map((function(e,t){var n=ei()(o)?r(e,t):Wa(e&&e.payload,o),i=ei()(c)?{}:{id:"".concat(c,"-").concat(t)};return f().createElement(Jc,ol({},zo(e,!0),s,i,{parentViewBox:e.parentViewBox,value:n,textBreakAll:l,viewBox:Jc.parseViewBox(ei()(a)?e:cl(cl({},e),{},{clockWise:a})),key:"label-".concat(t),index:t}))}))):null}ul.displayName="LabelList",ul.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n,i=No(e.children,ul).map((function(e,r){return(0,d.cloneElement)(e,{data:t,key:"labelList-".concat(r)})}));return r?[function(e,t){return e?!0===e?f().createElement(ul,{key:"labelList-implicit",data:t}):f().isValidElement(e)||ri()(e)?f().createElement(ul,{key:"labelList-implicit",data:t,content:e}):mo()(e)?f().createElement(ul,ol({data:t},e,{key:"labelList-implicit"})):null:null}(e.label,t)].concat(function(e){if(Array.isArray(e))return il(e)}(n=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return il(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?il(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i};const pl=require("lodash/isPlainObject");var dl=i.n(pl);const fl=require("lodash/isBoolean");var hl=i.n(fl);function ml(e){return ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ml(e)}function yl(){return yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yl.apply(this,arguments)}function vl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ml(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ml(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ml(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xl=function(e,t,r,n,i){var o,a=Math.min(Math.abs(r)/2,Math.abs(n)/2),c=n>=0?1:-1,l=r>=0?1:-1,s=n>=0&&r>=0||n<0&&r<0?1:0;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],p=0;p<4;p++)u[p]=i[p]>a?a:i[p];o="M".concat(e,",").concat(t+c*u[0]),u[0]>0&&(o+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(s,",").concat(e+l*u[0],",").concat(t)),o+="L ".concat(e+r-l*u[1],",").concat(t),u[1]>0&&(o+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(s,",\n ").concat(e+r,",").concat(t+c*u[1])),o+="L ".concat(e+r,",").concat(t+n-c*u[2]),u[2]>0&&(o+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(s,",\n ").concat(e+r-l*u[2],",").concat(t+n)),o+="L ".concat(e+l*u[3],",").concat(t+n),u[3]>0&&(o+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(s,",\n ").concat(e,",").concat(t+n-c*u[3])),o+="Z"}else if(a>0&&i===+i&&i>0){var d=Math.min(a,i);o="M ".concat(e,",").concat(t+c*d,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e+l*d,",").concat(t,"\n L ").concat(e+r-l*d,",").concat(t,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e+r,",").concat(t+c*d,"\n L ").concat(e+r,",").concat(t+n-c*d,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e+r-l*d,",").concat(t+n,"\n L ").concat(e+l*d,",").concat(t+n,"\n A ").concat(d,",").concat(d,",0,0,").concat(s,",").concat(e,",").concat(t+n-c*d," Z")}else o="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return o},wl=function(e,t){if(!e||!t)return!1;var r=e.x,n=e.y,i=t.x,o=t.y,a=t.width,c=t.height;if(Math.abs(a)>0&&Math.abs(c)>0){var l=Math.min(i,i+a),s=Math.max(i,i+a),u=Math.min(o,o+c),p=Math.max(o,o+c);return r>=l&&r<=s&&n>=u&&n<=p}return!1},Ol={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},kl=function(e){var t,r,n=bl(bl({},Ol),e),i=(0,d.useRef)(),o=(t=(0,d.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return vl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vl(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,d.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.width,p=n.height,h=n.radius,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||0===u||0===p)return null;var w=yi()("recharts-rectangle",m);return x?f().createElement(dc(),{canBegin:a>0,from:{width:u,height:p,x:l,y:s},to:{width:u,height:p,x:l,y:s},duration:v,animationEasing:y,isActive:x},(function(e){var t=e.width,r=e.height,o=e.x,c=e.y;return f().createElement(dc(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:b,easing:y},f().createElement("path",yl({},zo(n,!0),{className:w,d:xl(o,c,t,r,h),ref:i})))})):f().createElement("path",yl({},zo(n,!0),{className:w,d:xl(l,s,u,p,h)}))};function jl(e){return jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jl(e)}function Sl(){return Sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sl.apply(this,arguments)}function El(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==jl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==jl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===jl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Al(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Tl=function(e,t,r,n,i){var o,a=r-n;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+r,",").concat(t),o+="L ".concat(e+r-a/2,",").concat(t+i),(o+="L ".concat(e+r-a/2-n,",").concat(t+i))+"L ".concat(e,",").concat(t," Z")},Cl={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Il=function(e){var t,r,n=Pl(Pl({},Cl),e),i=(0,d.useRef)(),o=(t=(0,d.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return El(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?El(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,d.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.upperWidth,p=n.lowerWidth,h=n.height,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||h!==+h||0===u&&0===p||0===h)return null;var x=yi()("recharts-trapezoid",m);return b?f().createElement(dc(),{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:s},to:{upperWidth:u,lowerWidth:p,height:h,x:l,y:s},duration:v,animationEasing:y,isActive:b},(function(e){var t=e.upperWidth,r=e.lowerWidth,o=e.height,c=e.x,l=e.y;return f().createElement(dc(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},f().createElement("path",Sl({},zo(n,!0),{className:x,d:Tl(c,l,t,r,o),ref:i})))})):f().createElement("g",null,f().createElement("path",Sl({},zo(n,!0),{className:x,d:Tl(l,s,u,p,h)})))};function Dl(e){return Dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dl(e)}function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ml.apply(this,arguments)}function Nl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Dl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Dl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Dl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _l=function(e){var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,a=e.isExternal,c=e.cornerRadius,l=e.cornerIsExternal,s=c*(a?1:-1)+n,u=Math.asin(c/s)/Oi,p=l?i:i+o*u,d=l?i-o*u:i;return{center:ji(t,r,s,p),circleTangency:ji(t,r,n,p),lineTangency:ji(t,r,s*Math.cos(u*Oi),d),theta:u}},Bl=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,a=function(e,t){return Ni(t-e)*Math.min(Math.abs(t-e),359.999)}(o,e.endAngle),c=o+a,l=ji(t,r,i,o),s=ji(t,r,i,c),u="M ".concat(l.x,",").concat(l.y,"\n A ").concat(i,",").concat(i,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o>c),",\n ").concat(s.x,",").concat(s.y,"\n ");if(n>0){var p=ji(t,r,n,o),d=ji(t,r,n,c);u+="L ".concat(d.x,",").concat(d.y,"\n A ").concat(n,",").concat(n,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o<=c),",\n ").concat(p.x,",").concat(p.y," Z")}else u+="L ".concat(t,",").concat(r," Z");return u},Ll={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},zl=function(e){var t=Rl(Rl({},Ll),e),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,a=t.cornerRadius,c=t.forceCornerRadius,l=t.cornerIsExternal,s=t.startAngle,u=t.endAngle,p=t.className;if(o<i||s===u)return null;var d,h=yi()("recharts-sector",p),m=o-i,y=Fi(a,m,0,!0);return d=y>0&&Math.abs(s-u)<360?function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,a=e.forceCornerRadius,c=e.cornerIsExternal,l=e.startAngle,s=e.endAngle,u=Ni(s-l),p=_l({cx:t,cy:r,radius:i,angle:l,sign:u,cornerRadius:o,cornerIsExternal:c}),d=p.circleTangency,f=p.lineTangency,h=p.theta,m=_l({cx:t,cy:r,radius:i,angle:s,sign:-u,cornerRadius:o,cornerIsExternal:c}),y=m.circleTangency,v=m.lineTangency,g=m.theta,b=c?Math.abs(l-s):Math.abs(l-s)-h-g;if(b<0)return a?"M ".concat(f.x,",").concat(f.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(2*-o,",0\n "):Bl({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:s});var x="M ".concat(f.x,",").concat(f.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(d.x,",").concat(d.y,"\n A").concat(i,",").concat(i,",0,").concat(+(b>180),",").concat(+(u<0),",").concat(y.x,",").concat(y.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(v.x,",").concat(v.y,"\n ");if(n>0){var w=_l({cx:t,cy:r,radius:n,angle:l,sign:u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),O=w.circleTangency,k=w.lineTangency,j=w.theta,S=_l({cx:t,cy:r,radius:n,angle:s,sign:-u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=S.circleTangency,A=S.lineTangency,P=S.theta,T=c?Math.abs(l-s):Math.abs(l-s)-j-P;if(T<0&&0===o)return"".concat(x,"L").concat(t,",").concat(r,"Z");x+="L".concat(A.x,",").concat(A.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(E.x,",").concat(E.y,"\n A").concat(n,",").concat(n,",0,").concat(+(T>180),",").concat(+(u>0),",").concat(O.x,",").concat(O.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(k.x,",").concat(k.y,"Z")}else x+="L".concat(t,",").concat(r,"Z");return x}({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,m/2),forceCornerRadius:c,cornerIsExternal:l,startAngle:s,endAngle:u}):Bl({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:s,endAngle:u}),f().createElement("path",Ml({},zo(t,!0),{className:h,d,role:"img"}))},Fl=["option","shapeType","propTransformer","activeClassName","isActive"];function $l(e){return $l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$l(e)}function ql(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ql(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==$l(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==$l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===$l(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ql(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ul(e,t){return Wl(Wl({},t),e)}function Hl(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return f().createElement(kl,r);case"trapezoid":return f().createElement(Il,r);case"sector":return f().createElement(zl,r);case"symbols":if(function(e,t){return"symbols"===e}(t))return f().createElement(ca,r);break;default:return null}}function Gl(e){var t,r=e.option,n=e.shapeType,i=e.propTransformer,o=void 0===i?Ul:i,a=e.activeClassName,c=void 0===a?"recharts-active-shape":a,l=e.isActive,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Fl);if((0,d.isValidElement)(r))t=(0,d.cloneElement)(r,Wl(Wl({},s),function(e){return(0,d.isValidElement)(e)?e.props:e}(r)));else if(ri()(r))t=r(s);else if(dl()(r)&&!hl()(r)){var u=o(r,s);t=f().createElement(Hl,{shapeType:n,elementProps:u})}else{var p=s;t=f().createElement(Hl,{shapeType:n,elementProps:p})}return l?f().createElement(Ho,{className:c},t):t}function Xl(e,t){return null!=t&&"trapezoids"in e.props}function Vl(e,t){return null!=t&&"sectors"in e.props}function Kl(e,t){return null!=t&&"points"in e.props}function Yl(e,t){var r,n,i=e.x===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.x)||e.x===t.x,o=e.y===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.y)||e.y===t.y;return i&&o}function Zl(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Ql(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function Jl(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=function(e,t){var r;return Xl(e,t)?r="trapezoids":Vl(e,t)?r="sectors":Kl(e,t)&&(r="points"),r}(r,t),o=function(e,t){var r,n;return Xl(e,t)?null===(r=t.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:Vl(e,t)?null===(n=t.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:Kl(e,t)?t.payload:{}}(r,t),a=n.filter((function(e,n){var a=po()(o,e),c=r.props[i].filter((function(e){var n=function(e,t){var r;return Xl(e,t)?r=Yl:Vl(e,t)?r=Zl:Kl(e,t)&&(r=Ql),r}(r,t);return n(e,t)})),l=r.props[i].indexOf(c[c.length-1]);return a&&n===l}));return n.indexOf(a[a.length-1])}function es(e){return es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},es(e)}var ts=["x","y"];function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rs.apply(this,arguments)}function ns(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function is(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ns(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==es(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==es(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===es(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ns(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function os(e,t){var r=e.x,n=e.y,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,ts),o="".concat(r),a=parseInt(o,10),c="".concat(n),l=parseInt(c,10),s="".concat(t.height||i.height),u=parseInt(s,10),p="".concat(t.width||i.width),d=parseInt(p,10);return is(is(is(is(is({},t),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:t.name,radius:t.radius})}function as(e){return f().createElement(Gl,rs({shapeType:"rectangle",propTransformer:os,activeClassName:"recharts-active-bar"},e))}var cs=["value","background"];function ls(e){return ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ls(e)}function ss(){return ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ss.apply(this,arguments)}function us(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ps(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?us(Object(r),!0).forEach((function(t){ys(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):us(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ds(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vs(n.key),n)}}function fs(e,t){return fs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fs(e,t)}function hs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ms(e){return ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ms(e)}function ys(e,t,r){return(t=vs(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vs(e){var t=function(e,t){if("object"!==ls(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ls(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ls(t)?t:String(t)}var gs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fs(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ms(i);if(o){var r=ms(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ls(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hs(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ys(hs(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!1}),ys(hs(e),"id",zi("recharts-bar-")),ys(hs(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()})),ys(hs(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],(r=[{key:"renderRectanglesStatically",value:function(e){var t=this,r=this.props,n=r.shape,i=r.dataKey,o=r.activeIndex,a=r.activeBar,c=zo(this.props);return e&&e.map((function(e,r){var l=r===o,s=l?a:n,u=ps(ps(ps({},c),e),{},{isActive:l,option:s,index:r,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return f().createElement(Ho,ss({className:"recharts-bar-rectangle"},jo(t.props,e,r),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),f().createElement(as,u))}))}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,r=t.data,n=t.layout,i=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,c=t.animationEasing,l=t.animationId,s=this.state.prevData;return f().createElement(dc(),{begin:o,duration:a,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(l),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(t){var i=t.t,o=r.map((function(e,t){var r=s&&s[t];if(r){var o=qi(r.x,e.x),a=qi(r.y,e.y),c=qi(r.width,e.width),l=qi(r.height,e.height);return ps(ps({},e),{},{x:o(i),y:a(i),width:c(i),height:l(i)})}if("horizontal"===n){var u=qi(0,e.height)(i);return ps(ps({},e),{},{y:e.y+e.height-u,height:u})}var p=qi(0,e.width)(i);return ps(ps({},e),{},{width:p})}));return f().createElement(Ho,null,e.renderRectanglesStatically(o))}))}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,r=e.isAnimationActive,n=this.state.prevData;return!(r&&t&&t.length)||n&&po()(n,t)?this.renderRectanglesStatically(t):this.renderRectanglesWithAnimation()}},{key:"renderBackground",value:function(){var e=this,t=this.props,r=t.data,n=t.dataKey,i=t.activeIndex,o=zo(this.props.background);return r.map((function(t,r){t.value;var a=t.background,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,cs);if(!a)return null;var l=ps(ps(ps(ps(ps({},c),{},{fill:"#eee"},a),o),jo(e.props,t,r)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:n,index:r,key:"background-bar-".concat(r),className:"recharts-bar-background-rectangle"});return f().createElement(as,ss({option:e.props.background,isActive:r===i},l))}))}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.data,i=r.xAxis,o=r.yAxis,a=r.layout,c=No(r.children,Ko);if(!c)return null;var l="vertical"===a?n[0].height/2:n[0].width/2,s=function(e,t){var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:Wa(e,t)}},u={clipPath:e?"url(#clipPath-".concat(t,")"):null};return f().createElement(Ho,u,c.map((function(e){return f().cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,offset:l,dataPointFormatter:s})})))}},{key:"render",value:function(){var e=this.props,t=e.hide,r=e.data,n=e.className,i=e.xAxis,o=e.yAxis,a=e.left,c=e.top,l=e.width,s=e.height,u=e.isAnimationActive,p=e.background,d=e.id;if(t||!r||!r.length)return null;var h=this.state.isAnimationFinished,m=yi()("recharts-bar",n),y=i&&i.allowDataOverflow,v=o&&o.allowDataOverflow,g=y||v,b=ei()(d)?this.id:d;return f().createElement(Ho,{className:m},y||v?f().createElement("defs",null,f().createElement("clipPath",{id:"clipPath-".concat(b)},f().createElement("rect",{x:y?a:a-l/2,y:v?c:c-s/2,width:y?l:2*l,height:v?s:2*s}))):null,f().createElement(Ho,{className:"recharts-bar-rectangles",clipPath:g?"url(#clipPath-".concat(b,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(g,b),(!u||h)&&ul.renderCallByParent(this.props,r))}}])&&ds(t.prototype,r),n&&ds(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);function bs(e){return bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bs(e)}function xs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,js(n.key),n)}}function ws(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Os(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(r),!0).forEach((function(t){ks(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ws(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ks(e,t,r){return(t=js(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function js(e){var t=function(e,t){if("object"!==bs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==bs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===bs(t)?t:String(t)}ys(gs,"displayName","Bar"),ys(gs,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!Ui.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),ys(gs,"getComposedData",(function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,o=e.xAxis,a=e.yAxis,c=e.xAxisTicks,l=e.yAxisTicks,s=e.stackedData,u=e.dataStartIndex,p=e.displayedData,d=e.offset,f=function(e,t){if(!e)return null;for(var r=0,n=e.length;r<n;r++)if(e[r].item===t)return e[r].position;return null}(n,r);if(!f)return null;var h=t.layout,m=r.props,y=m.dataKey,v=m.children,g=m.minPointSize,b="horizontal"===h?a:o,x=s?b.scale.domain():null,w=function(e){var t=e.numericAxis,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]}({numericAxis:b}),O=No(v,fc),k=p.map((function(e,t){var n,p,d,m,v,b;if(s?n=function(e,t){if(!t||2!==t.length||!_i(t[0])||!_i(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!_i(e[0])||e[0]<r)&&(i[0]=r),(!_i(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i}(s[u+t],x):(n=Wa(e,y),Array.isArray(n)||(n=[w,n])),"horizontal"===h){var k,j=[a.scale(n[0]),a.scale(n[1])],S=j[0],E=j[1];p=nc({axis:o,ticks:c,bandSize:i,offset:f.offset,entry:e,index:t}),d=null!==(k=null!=E?E:S)&&void 0!==k?k:void 0,m=f.size;var A=S-E;if(v=Number.isNaN(A)?0:A,b={x:p,y:a.y,width:m,height:a.height},Math.abs(g)>0&&Math.abs(v)<Math.abs(g)){var P=Ni(v||g)*(Math.abs(g)-Math.abs(v));d-=P,v+=P}}else{var T=[o.scale(n[0]),o.scale(n[1])],C=T[0],I=T[1];p=C,d=nc({axis:a,ticks:l,bandSize:i,offset:f.offset,entry:e,index:t}),m=I-C,v=f.size,b={x:o.x,y:d,width:o.width,height:v},Math.abs(g)>0&&Math.abs(m)<Math.abs(g)&&(m+=Ni(m||g)*(Math.abs(g)-Math.abs(m)))}return ps(ps(ps({},e),{},{x:p,y:d,width:m,height:v,value:s?n:n[1],payload:e,background:b},O&&O[t]&&O[t].props),{},{tooltipPayload:[uc(r,e)],tooltipPosition:{x:p+m/2,y:d+v/2}})}));return ps({data:k,layout:h},d)}));var Ss=function(e,t,r,n,i){var o=e.width,a=e.height,c=e.layout,l=e.children,s=Object.keys(t),u={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:a-r.bottom,bottomMirror:a-r.bottom},p=!!Ro(l,gs);return s.reduce((function(o,a){var l,s,d,f,h,m=t[a],y=m.orientation,v=m.domain,g=m.padding,b=void 0===g?{}:g,x=m.mirror,w=m.reversed,O="".concat(y).concat(x?"Mirror":"");if("number"===m.type&&("gap"===m.padding||"no-gap"===m.padding)){var k=v[1]-v[0],j=1/0,S=m.categoricalDomain.sort();S.forEach((function(e,t){t>0&&(j=Math.min((e||0)-(S[t-1]||0),j))}));var E=j/k,A="vertical"===m.layout?r.height:r.width;if("gap"===m.padding&&(l=E*A/2),"no-gap"===m.padding){var P=Fi(e.barCategoryGap,E*A),T=E*A/2;l=T-P-(T-P)/A*P}}s="xAxis"===n?[r.left+(b.left||0)+(l||0),r.left+r.width-(b.right||0)-(l||0)]:"yAxis"===n?"horizontal"===c?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(l||0),r.top+r.height-(b.bottom||0)-(l||0)]:m.range,w&&(s=[s[1],s[0]]);var C=function(e,t,r){var n=e.scale,i=e.type,o=e.layout,a=e.axisType;if("auto"===n)return"radial"===o&&"radiusAxis"===a?{scale:eo.scaleBand(),realScaleType:"band"}:"radial"===o&&"angleAxis"===a?{scale:eo.scaleLinear(),realScaleType:"linear"}:"category"===i&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!r)?{scale:eo.scalePoint(),realScaleType:"point"}:"category"===i?{scale:eo.scaleBand(),realScaleType:"band"}:{scale:eo.scaleLinear(),realScaleType:"linear"};if(Ti()(n)){var c="scale".concat(so()(n));return{scale:(eo[c]||eo.scalePoint)(),realScaleType:eo[c]?c:"point"}}return ri()(n)?{scale:n}:{scale:eo.scalePoint(),realScaleType:"point"}}(m,i,p),I=C.scale,D=C.realScaleType;I.domain(v).range(s),function(e){var t=e.domain();if(t&&!(t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-Ja,o=Math.max(n[0],n[1])+Ja,a=e(t[0]),c=e(t[r-1]);(a<i||a>o||c<i||c>o)&&e.domain([t[0],t[r-1]])}}(I);var M=function(e,t){var r=t.realScaleType,n=t.type,i=t.tickCount,o=t.originalDomain,a=t.allowDecimals,c=r||t.scale;if("auto"!==c&&"linear"!==c)return null;if(i&&"number"===n&&o&&("auto"===o[0]||"auto"===o[1])){var l=e.domain();if(!l.length)return null;var s=(0,fo.getNiceTickValues)(l,i,a);return e.domain([oo()(s),no()(s)]),{niceTicks:s}}if(i&&"number"===n){var u=e.domain();return{niceTicks:(0,fo.getTickValuesFixedDomain)(u,i,a)}}return null}(I,Os(Os({},m),{},{realScaleType:D}));"xAxis"===n?(h="top"===y&&!x||"bottom"===y&&x,d=r.left,f=u[O]-h*m.height):"yAxis"===n&&(h="left"===y&&!x||"right"===y&&x,d=u[O]-h*m.width,f=r.top);var N=Os(Os(Os({},m),M),{},{realScaleType:D,x:d,y:f,scale:I,width:"xAxis"===n?r.width:m.width,height:"yAxis"===n?r.height:m.height});return N.bandSize=lc(N,M),m.hide||"xAxis"!==n?m.hide||(u[O]+=(h?-1:1)*N.width):u[O]+=(h?-1:1)*N.height,Os(Os({},o),{},ks({},a,N))}),{})},Es=function(e,t){var r=e.x,n=e.y,i=t.x,o=t.y;return{x:Math.min(r,i),y:Math.min(n,o),width:Math.abs(i-r),height:Math.abs(o-n)}},As=function(e){var t=e.x1,r=e.y1,n=e.x2,i=e.y2;return Es({x:t,y:r},{x:n,y:i})},Ps=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scale=t}var t,r,n;return t=e,r=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.bandAware,n=t.position;if(void 0!==e){if(n)switch(n){case"start":default:return this.scale(e);case"middle":var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(e)+o}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),r=t[0],n=t[t.length-1];return r<=n?e>=r&&e<=n:e>=n&&e<=r}}],n=[{key:"create",value:function(t){return new e(t)}}],r&&xs(t.prototype,r),n&&xs(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();ks(Ps,"EPS",1e-4);var Ts=function(e){var t=Object.keys(e).reduce((function(t,r){return Os(Os({},t),{},ks({},r,Ps.create(e[r])))}),{});return Os(Os({},t),{},{apply:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,i=r.position;return Ji()(e,(function(e,r){return t[r].apply(e,{bandAware:n,position:i})}))},isInRange:function(e){return hi()(e,(function(e,r){return t[r].isInRange(e)}))}})};function Cs(e,t,r){if(t<1)return[];if(1===t&&void 0===r)return e;for(var n=[],i=0;i<e.length;i+=t){if(void 0!==r&&!0!==r(e[i]))return;n.push(e[i])}return n}function Is(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function Ds(e){return Ds="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ds(e)}function Ms(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ns(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ms(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ds(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ds(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ds(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ms(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rs(e,t,r){var n=e.tick,i=e.ticks,o=e.viewBox,a=e.minTickGap,c=e.orientation,l=e.interval,s=e.tickFormatter,u=e.unit,p=e.angle;if(!i||!i.length||!n)return[];if(_i(l)||Ui.isSsr)return function(e,t){return Cs(e,t+1)}(i,"number"==typeof l&&_i(l)?l:0);var d=[],f="top"===c||"bottom"===c?"width":"height",h=u&&"width"===f?Zi(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(e,n){var i=ri()(s)?s(e.value,n):e.value;return"width"===f?function(e,t,r){return function(e){var t=e.width,r=e.height,n=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)%180+180)%180*Math.PI/180,i=Math.atan(r/t),o=n>i&&n<Math.PI-i?r/Math.sin(n):t/Math.cos(n);return Math.abs(o)}({width:e.width+t.width,height:e.height+t.height},r)}(Zi(i,{fontSize:t,letterSpacing:r}),h,p):Zi(i,{fontSize:t,letterSpacing:r})[f]},y=i.length>=2?Ni(i[1].coordinate-i[0].coordinate):1,v=function(e,t,r){var n="width"===r,i=e.x,o=e.y,a=e.width,c=e.height;return 1===t?{start:n?i:o,end:n?i+a:o+c}:{start:n?i+a:o+c,end:n?i:o}}(o,y,f);return"equidistantPreserveStart"===l?function(e,t,r,n,i){for(var o,a=(n||[]).slice(),c=t.start,l=t.end,s=0,u=1,p=c,d=function(){var t=null==n?void 0:n[s];if(void 0===t)return{v:Cs(n,u)};var o,a=s,d=function(){return void 0===o&&(o=r(t,a)),o},f=t.coordinate,h=0===s||Is(e,f,d,p,l);h||(s=0,p=c,u+=1),h&&(p=f+e*(d()/2+i),s+=u)};u<=a.length;)if(o=d())return o.v;return[]}(y,v,m,i,a):(d="preserveStart"===l||"preserveStartEnd"===l?function(e,t,r,n,i,o){var a=(n||[]).slice(),c=a.length,l=t.start,s=t.end;if(o){var u=n[c-1],p=r(u,c-1),d=e*(u.coordinate+e*p/2-s);a[c-1]=u=Ns(Ns({},u),{},{tickCoord:d>0?u.coordinate-d*e:u.coordinate}),Is(e,u.tickCoord,(function(){return p}),l,s)&&(s=u.tickCoord-e*(p/2+i),a[c-1]=Ns(Ns({},u),{},{isShow:!0}))}for(var f=o?c-1:c,h=function(t){var n,o=a[t],c=function(){return void 0===n&&(n=r(o,t)),n};if(0===t){var u=e*(o.coordinate-e*c()/2-l);a[t]=o=Ns(Ns({},o),{},{tickCoord:u<0?o.coordinate-u*e:o.coordinate})}else a[t]=o=Ns(Ns({},o),{},{tickCoord:o.coordinate});Is(e,o.tickCoord,c,l,s)&&(l=o.tickCoord+e*(c()/2+i),a[t]=Ns(Ns({},o),{},{isShow:!0}))},m=0;m<f;m++)h(m);return a}(y,v,m,i,a,"preserveStartEnd"===l):function(e,t,r,n,i){for(var o=(n||[]).slice(),a=o.length,c=t.start,l=t.end,s=function(t){var n,s=o[t],u=function(){return void 0===n&&(n=r(s,t)),n};if(t===a-1){var p=e*(s.coordinate+e*u()/2-l);o[t]=s=Ns(Ns({},s),{},{tickCoord:p>0?s.coordinate-p*e:s.coordinate})}else o[t]=s=Ns(Ns({},s),{},{tickCoord:s.coordinate});Is(e,s.tickCoord,u,c,l)&&(l=s.tickCoord-e*(u()/2+i),o[t]=Ns(Ns({},s),{},{isShow:!0}))},u=a-1;u>=0;u--)s(u);return o}(y,v,m,i,a),d.filter((function(e){return e.isShow})))}function _s(e){return _s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_s(e)}function Bs(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ls(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ls(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==_s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==_s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===_s(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ls(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fs(e){return Array.isArray(e)&&Bi(e[0])&&Bi(e[1])?e.join(" ~ "):e}var $s=function(e){var t=e.separator,r=void 0===t?" : ":t,n=e.contentStyle,i=void 0===n?{}:n,o=e.itemStyle,a=void 0===o?{}:o,c=e.labelStyle,l=void 0===c?{}:c,s=e.payload,u=e.formatter,p=e.itemSorter,d=e.wrapperClassName,h=e.labelClassName,m=e.label,y=e.labelFormatter,v=zs({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),g=zs({margin:0},l),b=!ei()(m),x=b?m:"",w=yi()("recharts-default-tooltip",d),O=yi()("recharts-tooltip-label",h);return b&&y&&null!=s&&(x=y(m,s)),f().createElement("div",{className:w,style:v},f().createElement("p",{className:O,style:g},f().isValidElement(x)?x:"".concat(x)),function(){if(s&&s.length){var e=(p?li()(s,p):s).map((function(e,t){if("none"===e.type)return null;var n=zs({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},a),i=e.formatter||u||Fs,o=e.value,c=e.name,l=o,p=c;if(i&&null!=l&&null!=p){var d=i(o,c,e,t,s);if(Array.isArray(d)){var h=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Bs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bs(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(d,2);l=h[0],p=h[1]}else l=d}return f().createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:n},Bi(p)?f().createElement("span",{className:"recharts-tooltip-item-name"},p):null,Bi(p)?f().createElement("span",{className:"recharts-tooltip-item-separator"},r):null,f().createElement("span",{className:"recharts-tooltip-item-value"},l),f().createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))}));return f().createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function qs(e){return qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qs(e)}function Ws(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==qs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==qs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===qs(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Us="recharts-tooltip-wrapper",Hs={visibility:"hidden"};function Gs(e){var t,r=e.coordinate,n=e.translateX,i=e.translateY;return yi()(Us,(Ws(t={},"".concat(Us,"-right"),_i(n)&&r&&_i(r.x)&&n>=r.x),Ws(t,"".concat(Us,"-left"),_i(n)&&r&&_i(r.x)&&n<r.x),Ws(t,"".concat(Us,"-bottom"),_i(i)&&r&&_i(r.y)&&i>=r.y),Ws(t,"".concat(Us,"-top"),_i(i)&&r&&_i(r.y)&&i<r.y),t))}function Xs(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,o=e.position,a=e.reverseDirection,c=e.tooltipDimension,l=e.viewBox,s=e.viewBoxDimension;if(o&&_i(o[n]))return o[n];var u=r[n]-c-i,p=r[n]+i;return t[n]?a[n]?u:p:a[n]?u<l[n]?Math.max(p,l[n]):Math.max(u,l[n]):p+c>l[n]+s?Math.max(u,l[n]):Math.max(p,l[n])}function Vs(e){return Vs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vs(e)}function Ks(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ys(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(r),!0).forEach((function(t){tu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ks(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ru(n.key),n)}}function Qs(e,t){return Qs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qs(e,t)}function Js(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eu(e){return eu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eu(e)}function tu(e,t,r){return(t=ru(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ru(e){var t=function(e,t){if("object"!==Vs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Vs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Vs(t)?t:String(t)}var nu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qs(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eu(n);if(i){var r=eu(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Vs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Js(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return tu(Js(e=o.call.apply(o,[this].concat(r))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),tu(Js(e),"lastBoundingBox",{width:-1,height:-1}),tu(Js(e),"handleKeyDown",(function(t){var r,n,i,o;"Escape"===t.key&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(r=null===(n=e.props.coordinate)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(i=null===(o=e.props.coordinate)||void 0===o?void 0:o.y)&&void 0!==i?i:0}})})),e}return t=a,(r=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}},{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,i=t.animationDuration,o=t.animationEasing,a=t.children,c=t.coordinate,l=t.hasPayload,s=t.isAnimationActive,u=t.offset,p=t.position,d=t.reverseDirection,h=t.useTranslate3d,m=t.viewBox,y=t.wrapperStyle,v=function(e){var t,r,n,i=e.allowEscapeViewBox,o=e.coordinate,a=e.offsetTopLeft,c=e.position,l=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,p=e.viewBox;return t=s.height>0&&s.width>0&&o?function(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return(0,pc.translateStyle)({transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")})}({translateX:r=Xs({allowEscapeViewBox:i,coordinate:o,key:"x",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.width,viewBox:p,viewBoxDimension:p.width}),translateY:n=Xs({allowEscapeViewBox:i,coordinate:o,key:"y",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.height,viewBox:p,viewBoxDimension:p.height}),useTranslate3d:u}):Hs,{cssProperties:t,cssClasses:Gs({translateX:r,translateY:n,coordinate:o})}}({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:u,position:p,reverseDirection:d,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:h,viewBox:m}),g=v.cssClasses,b=v.cssProperties,x=Ys(Ys(Ys({},s&&r&&(0,pc.translateStyle)({transition:"transform ".concat(i,"ms ").concat(o)})),b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&r&&l?"visible":"hidden",position:"absolute",top:0,left:0},y);return f().createElement("div",{tabIndex:-1,role:"dialog",className:g,style:x,ref:function(t){e.wrapperNode=t}},a)}}])&&Zs(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(d.PureComponent);function iu(e){return iu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iu(e)}function ou(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function au(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(r),!0).forEach((function(t){uu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ou(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pu(n.key),n)}}function lu(e,t){return lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lu(e,t)}function su(e){return su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},su(e)}function uu(e,t,r){return(t=pu(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pu(e){var t=function(e,t){if("object"!==iu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==iu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===iu(t)?t:String(t)}function du(e){return e.dataKey}var fu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lu(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=su(n);if(i){var r=su(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===iu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,(r=[{key:"render",value:function(){var e=this.props,t=e.active,r=e.allowEscapeViewBox,n=e.animationDuration,i=e.animationEasing,o=e.content,a=e.coordinate,c=e.filterNull,l=e.isAnimationActive,s=e.offset,u=e.payload,p=e.payloadUniqBy,d=e.position,h=e.reverseDirection,m=e.useTranslate3d,y=e.viewBox,v=e.wrapperStyle,g=null!=u?u:[];c&&g.length&&(g=xa(u.filter((function(e){return null!=e.value})),p,du));var b=g.length>0;return f().createElement(nu,{allowEscapeViewBox:r,animationDuration:n,animationEasing:i,isAnimationActive:l,active:t,coordinate:a,hasPayload:b,offset:s,position:d,reverseDirection:h,useTranslate3d:m,viewBox:y,wrapperStyle:v},function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):"function"==typeof e?f().createElement(e,t):f().createElement($s,t)}(o,au(au({},this.props),{},{payload:g})))}}])&&cu(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(d.PureComponent);function hu(e){return hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hu(e)}function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mu.apply(this,arguments)}function yu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==hu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==hu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===hu(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}uu(fu,"displayName","Tooltip"),uu(fu,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ui.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var gu={curveBasisClosed:to.curveBasisClosed,curveBasisOpen:to.curveBasisOpen,curveBasis:to.curveBasis,curveBumpX:to.curveBumpX,curveBumpY:to.curveBumpY,curveLinearClosed:to.curveLinearClosed,curveLinear:to.curveLinear,curveMonotoneX:to.curveMonotoneX,curveMonotoneY:to.curveMonotoneY,curveNatural:to.curveNatural,curveStep:to.curveStep,curveStepAfter:to.curveStepAfter,curveStepBefore:to.curveStepBefore},bu=function(e){return e.x===+e.x&&e.y===+e.y},xu=function(e){return e.x},wu=function(e){return e.y},Ou=function(e){var t=e.className,r=e.points,n=e.path,i=e.pathRef;if(!(r&&r.length||n))return null;var o=r&&r.length?function(e){var t,r=e.type,n=void 0===r?"linear":r,i=e.points,o=void 0===i?[]:i,a=e.baseLine,c=e.layout,l=e.connectNulls,s=void 0!==l&&l,u=function(e,t){if(ri()(e))return e;var r="curve".concat(so()(e));return"curveMonotone"!==r&&"curveBump"!==r||!t?gu[r]||to.curveLinear:gu["".concat(r).concat("vertical"===t?"Y":"X")]}(n,c),p=s?o.filter((function(e){return bu(e)})):o;if(Array.isArray(a)){var d=s?a.filter((function(e){return bu(e)})):a,f=p.map((function(e,t){return vu(vu({},e),{},{base:d[t]})}));return(t="vertical"===c?(0,to.area)().y(wu).x1(xu).x0((function(e){return e.base.x})):(0,to.area)().x(xu).y1(wu).y0((function(e){return e.base.y}))).defined(bu).curve(u),t(f)}return(t="vertical"===c&&_i(a)?(0,to.area)().y(wu).x1(xu).x0(a):_i(a)?(0,to.area)().x(xu).y1(wu).y0(a):(0,to.line)().x(xu).y(wu)).defined(bu).curve(u),t(p)}(e):n;return f().createElement("path",mu({},zo(e),ko(e),{className:yi()("recharts-curve",t),d:o,ref:i}))};function ku(e){return ku="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ku(e)}var ju=["x","y","top","left","width","height","className"];function Su(){return Su=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Su.apply(this,arguments)}function Eu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Au=function(e,t,r,n,i,o){return"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r)},Pu=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.top,a=void 0===o?0:o,c=e.left,l=void 0===c?0:c,s=e.width,u=void 0===s?0:s,p=e.height,d=void 0===p?0:p,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Eu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ku(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ku(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ku(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({x:r,y:i,top:a,left:l,width:u,height:d},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,ju));return _i(r)&&_i(i)&&_i(u)&&_i(d)&&_i(a)&&_i(l)?f().createElement("path",Su({},zo(m,!0),{className:yi()("recharts-cross",h),d:Au(r,i,u,d,a,l)})):null};function Tu(){return Tu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tu.apply(this,arguments)}var Cu=function(e){var t=e.cx,r=e.cy,n=e.r,i=e.className,o=yi()("recharts-dot",i);return t===+t&&r===+r&&n===+n?f().createElement("circle",Tu({},zo(e),ko(e),{className:o,cx:t,cy:r,r:n})):null},Iu=["viewBox"],Du=["viewBox"],Mu=["ticks"];function Nu(e){return Nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nu(e)}function Ru(){return Ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ru.apply(this,arguments)}function _u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_u(Object(r),!0).forEach((function(t){qu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lu(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function zu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wu(n.key),n)}}function Fu(e,t){return Fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fu(e,t)}function $u(e){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$u(e)}function qu(e,t,r){return(t=Wu(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wu(e){var t=function(e,t){if("object"!==Nu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Nu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Nu(t)?t:String(t)}var Uu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fu(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$u(i);if(o){var r=$u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Nu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=a.call(this,e)).state={fontSize:"",letterSpacing:""},t}return t=c,n=[{key:"renderTickItem",value:function(e,t,r){return f().isValidElement(e)?f().cloneElement(e,t):ri()(e)?e(t):f().createElement($c,Ru({},t,{className:"recharts-cartesian-axis-tick-value"}),r)}}],(r=[{key:"shouldComponentUpdate",value:function(e,t){var r=e.viewBox,n=Lu(e,Iu),i=this.props,o=i.viewBox,a=Lu(i,Du);return!vo(r,o)||!vo(n,a)||!vo(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,r,n,i,o,a,c=this.props,l=c.x,s=c.y,u=c.width,p=c.height,d=c.orientation,f=c.tickSize,h=c.mirror,m=c.tickMargin,y=h?-1:1,v=e.tickSize||f,g=_i(e.tickCoord)?e.tickCoord:e.coordinate;switch(d){case"top":t=r=e.coordinate,a=(n=(i=s+ +!h*p)-y*v)-y*m,o=g;break;case"left":n=i=e.coordinate,o=(t=(r=l+ +!h*u)-y*v)-y*m,a=g;break;case"right":n=i=e.coordinate,o=(t=(r=l+ +h*u)+y*v)+y*m,a=g;break;default:t=r=e.coordinate,a=(n=(i=s+ +h*p)+y*v)+y*m,o=g}return{line:{x1:t,y1:n,x2:r,y2:i},tick:{x:o,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,r=t.orientation,n=t.mirror;switch(r){case"left":e=n?"start":"end";break;case"right":e=n?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,r=e.mirror,n="end";switch(t){case"left":case"right":n="middle";break;case"top":n=r?"start":"end";break;default:n=r?"end":"start"}return n}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.orientation,a=e.mirror,c=e.axisLine,l=Bu(Bu(Bu({},zo(this.props)),zo(c)),{},{fill:"none"});if("top"===o||"bottom"===o){var s=+("top"===o&&!a||"bottom"===o&&a);l=Bu(Bu({},l),{},{x1:t,y1:r+s*i,x2:t+n,y2:r+s*i})}else{var u=+("left"===o&&!a||"right"===o&&a);l=Bu(Bu({},l),{},{x1:t+u*n,y1:r,x2:t+u*n,y2:r+i})}return f().createElement("line",Ru({},l,{className:yi()("recharts-cartesian-axis-line",ai()(c,"className"))}))}},{key:"renderTicks",value:function(e,t,r){var n=this,i=this.props,o=i.tickLine,a=i.stroke,l=i.tick,s=i.tickFormatter,u=i.unit,p=Rs(Bu(Bu({},this.props),{},{ticks:e}),t,r),d=this.getTickTextAnchor(),h=this.getTickVerticalAnchor(),m=zo(this.props),y=zo(l),v=Bu(Bu({},m),{},{fill:"none"},zo(o)),g=p.map((function(e,t){var r=n.getTickLineCoord(e),i=r.line,g=r.tick,b=Bu(Bu(Bu(Bu({textAnchor:d,verticalAnchor:h},m),{},{stroke:"none",fill:a},y),g),{},{index:t,payload:e,visibleTicksCount:p.length,tickFormatter:s});return f().createElement(Ho,Ru({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},jo(n.props,e,t)),o&&f().createElement("line",Ru({},v,i,{className:yi()("recharts-cartesian-axis-tick-line",ai()(o,"className"))})),l&&c.renderTickItem(l,b,"".concat(ri()(s)?s(e.value,t):e.value).concat(u||"")))}));return f().createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var e=this,t=this.props,r=t.axisLine,n=t.width,i=t.height,o=t.ticksGenerator,a=t.className;if(t.hide)return null;var c=this.props,l=c.ticks,s=Lu(c,Mu),u=l;return ri()(o)&&(u=l&&l.length>0?o(this.props):o(s)),n<=0||i<=0||!u||!u.length?null:f().createElement(Ho,{className:yi()("recharts-cartesian-axis",a),ref:function(t){e.layerReference=t}},r&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),Jc.renderCallByParent(this.props))}}])&&zu(t.prototype,r),n&&zu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.Component);function Hu(e){return Hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hu(e)}function Gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gu(Object(r),!0).forEach((function(t){Vu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Hu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Hu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Hu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}qu(Uu,"displayName","CartesianAxis"),qu(Uu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Ku=["Webkit","Moz","O","ms"];function Yu(e){return Yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yu(e)}function Zu(){return Zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zu.apply(this,arguments)}function Qu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ju(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qu(Object(r),!0).forEach((function(t){ip(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ep(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,op(n.key),n)}}function tp(e,t){return tp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tp(e,t)}function rp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function np(e){return np=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},np(e)}function ip(e,t,r){return(t=op(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function op(e){var t=function(e,t){if("object"!==Yu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Yu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Yu(t)?t:String(t)}var ap=function(e){return e.changedTouches&&!!e.changedTouches.length},cp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tp(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=np(i);if(o){var r=np(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Yu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return rp(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),ip(rp(t=a.call(this,e)),"handleDrag",(function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)})),ip(rp(t),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])})),ip(rp(t),"handleDragEnd",(function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},(function(){var e=t.props,r=e.endIndex,n=e.onDragEnd,i=e.startIndex;null==n||n({endIndex:r,startIndex:i})})),t.detachDragEndListener()})),ip(rp(t),"handleLeaveWrapper",(function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))})),ip(rp(t),"handleEnterSlideOrTraveller",(function(){t.setState({isTextActive:!0})})),ip(rp(t),"handleLeaveSlideOrTraveller",(function(){t.setState({isTextActive:!1})})),ip(rp(t),"handleSlideDragStart",(function(e){var r=ap(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:r.pageX}),t.attachDragEndListener()})),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(rp(t),"startX"),endX:t.handleTravellerDragStart.bind(rp(t),"endX")},t.state={},t}return t=c,n=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,r=e.y,n=e.width,i=e.height,o=e.stroke,a=Math.floor(r+i/2)-1;return f().createElement(f().Fragment,null,f().createElement("rect",{x:t,y:r,width:n,height:i,fill:o,stroke:"none"}),f().createElement("line",{x1:t+1,y1:a,x2:t+n-1,y2:a,fill:"none",stroke:"#fff"}),f().createElement("line",{x1:t+1,y1:a+2,x2:t+n-1,y2:a+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):ri()(e)?e(t):c.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var r=e.data,n=e.width,i=e.x,o=e.travellerWidth,a=e.updateId,c=e.startIndex,l=e.endIndex;if(r!==t.prevData||a!==t.prevUpdateId)return Ju({prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n},r&&r.length?function(e){var t=e.data,r=e.startIndex,n=e.endIndex,i=e.x,o=e.width,a=e.travellerWidth;if(!t||!t.length)return{};var c=t.length,l=(0,eo.scalePoint)().domain(ii()(0,c)).range([i,i+o-a]),s=l.domain().map((function(e){return l(e)}));return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:l(r),endX:l(n),scale:l,scaleValues:s}}({data:r,width:n,x:i,travellerWidth:o,startIndex:c,endIndex:l}):{scale:null,scaleValues:null});if(t.scale&&(n!==t.prevWidth||i!==t.prevX||o!==t.prevTravellerWidth)){t.scale.range([i,i+n-o]);var s=t.scale.domain().map((function(e){return t.scale(e)}));return{prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:s}}return null}},{key:"getIndexInRange",value:function(e,t){for(var r=0,n=e.length-1;n-r>1;){var i=Math.floor((r+n)/2);e[i]>t?n=i:r=i}return t>=e[n]?n:r}}],(r=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,r=e.endX,n=this.state.scaleValues,i=this.props,o=i.gap,a=i.data.length-1,l=Math.min(t,r),s=Math.max(t,r),u=c.getIndexInRange(n,l),p=c.getIndexInRange(n,s);return{startIndex:u-u%o,endIndex:p===a?a:p-p%o}}},{key:"getTextOfTick",value:function(e){var t=this.props,r=t.data,n=t.tickFormatter,i=t.dataKey,o=Wa(r[e],i,e);return ri()(n)?n(o,e):o}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,r=t.slideMoveStartX,n=t.startX,i=t.endX,o=this.props,a=o.x,c=o.width,l=o.travellerWidth,s=o.startIndex,u=o.endIndex,p=o.onChange,d=e.pageX-r;d>0?d=Math.min(d,a+c-l-i,a+c-l-n):d<0&&(d=Math.max(d,a-n,a-i));var f=this.getIndex({startX:n+d,endX:i+d});f.startIndex===s&&f.endIndex===u||!p||p(f),this.setState({startX:n+d,endX:i+d,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var r=ap(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,r=this.state,n=r.brushMoveStartX,i=r.movingTravellerId,o=r.endX,a=r.startX,c=this.state[i],l=this.props,s=l.x,u=l.width,p=l.travellerWidth,d=l.onChange,f=l.gap,h=l.data,m={startX:this.state.startX,endX:this.state.endX},y=e.pageX-n;y>0?y=Math.min(y,s+u-p-c):y<0&&(y=Math.max(y,s-c)),m[i]=c+y;var v=this.getIndex(m),g=v.startIndex,b=v.endIndex;this.setState((ip(t={},i,c+y),ip(t,"brushMoveStartX",e.pageX),t),(function(){var e;d&&(e=h.length-1,("startX"===i&&(o>a?g%f==0:b%f==0)||o<a&&b===e||"endX"===i&&(o>a?b%f==0:g%f==0)||o>a&&b===e)&&d(v))}))}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var r=this,n=this.state,i=n.scaleValues,o=n.startX,a=n.endX,c=this.state[t],l=i.indexOf(c);if(-1!==l){var s=l+e;if(!(-1===s||s>=i.length)){var u=i[s];"startX"===t&&u>=a||"endX"===t&&u<=o||this.setState(ip({},t,u),(function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))}))}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.fill,a=e.stroke;return f().createElement("rect",{stroke:a,fill:o,x:t,y:r,width:n,height:i})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.data,a=e.children,c=e.padding,l=d.Children.only(a);return l?f().cloneElement(l,{x:t,y:r,width:n,height:i,margin:c,compact:!0,data:o}):null}},{key:"renderTravellerLayer",value:function(e,t){var r=this,n=this.props,i=n.y,o=n.travellerWidth,a=n.height,l=n.traveller,s=n.ariaLabel,u=n.data,p=n.startIndex,d=n.endIndex,h=Math.max(e,this.props.x),m=Ju(Ju({},zo(this.props)),{},{x:h,y:i,width:o,height:a}),y=s||"Min value: ".concat(u[p].name,", Max value: ").concat(u[d].name);return f().createElement(Ho,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},c.renderTraveller(l,m))}},{key:"renderSlide",value:function(e,t){var r=this.props,n=r.y,i=r.height,o=r.stroke,a=r.travellerWidth,c=Math.min(e,t)+a,l=Math.max(Math.abs(t-e)-a,0);return f().createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:c,y:n,width:l,height:i})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,r=e.endIndex,n=e.y,i=e.height,o=e.travellerWidth,a=e.stroke,c=this.state,l=c.startX,s=c.endX,u={pointerEvents:"none",fill:a};return f().createElement(Ho,{className:"recharts-brush-texts"},f().createElement($c,Zu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:n+i/2},u),this.getTextOfTick(t)),f().createElement($c,Zu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+o+5,y:n+i/2},u),this.getTextOfTick(r)))}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.className,n=e.children,i=e.x,o=e.y,a=e.width,c=e.height,l=e.alwaysShowText,s=this.state,u=s.startX,p=s.endX,d=s.isTextActive,h=s.isSlideMoving,m=s.isTravellerMoving,y=s.isTravellerFocused;if(!t||!t.length||!_i(i)||!_i(o)||!_i(a)||!_i(c)||a<=0||c<=0)return null;var v,g,b,x,w=yi()("recharts-brush",r),O=1===f().Children.count(n),k=(g="none",b=(v="userSelect").replace(/(\w)/,(function(e){return e.toUpperCase()})),(x=Ku.reduce((function(e,t){return Xu(Xu({},e),{},Vu({},t+b,g))}),{}))[v]=g,x);return f().createElement(Ho,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:k},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(u,p),this.renderTravellerLayer(u,"startX"),this.renderTravellerLayer(p,"endX"),(d||h||m||y||l)&&this.renderText())}}])&&ep(t.prototype,r),n&&ep(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);ip(cp,"displayName","Brush"),ip(cp,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var lp=function(e,t){var r=e.alwaysShow,n=e.ifOverflow;return r&&(n="extendDomain"),n===t};function sp(e){return sp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sp(e)}function up(){return up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},up.apply(this,arguments)}function pp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==sp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==sp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===sp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fp(e){var t=e.x,r=e.y,n=e.r,i=e.alwaysShow,o=e.clipPathId,a=Bi(t),c=Bi(r);if(Yo(void 0===i,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!a||!c)return null;var l=function(e){var t=e.x,r=e.y,n=e.xAxis,i=e.yAxis,o=Ts({x:n.scale,y:i.scale}),a=o.apply({x:t,y:r},{bandAware:!0});return lp(e,"discard")&&!o.isInRange(a)?null:a}(e);if(!l)return null;var s=l.x,u=l.y,p=e.shape,d=e.className,h=dp(dp({clipPath:lp(e,"hidden")?"url(#".concat(o,")"):void 0},zo(e,!0)),{},{cx:s,cy:u});return f().createElement(Ho,{className:yi()("recharts-reference-dot",d)},fp.renderDot(p,h),Jc.renderCallByParent(e,{x:s-n,y:u-n,width:2*n,height:2*n}))}fp.displayName="ReferenceDot",fp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},fp.renderDot=function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):ri()(e)?e(t):f().createElement(Cu,up({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};const hp=require("lodash/some");var mp=i.n(hp);function yp(e){return yp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yp(e)}function vp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==yp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==yp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xp(){return xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xp.apply(this,arguments)}var wp=function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):ri()(e)?e(t):f().createElement("line",xp({},t,{className:"recharts-reference-line-line"}))},Op=function(e,t,r,n,i){var o=i.viewBox,a=o.x,c=o.y,l=o.width,s=o.height,u=i.position;if(r){var p=i.y,d=i.yAxis.orientation,f=e.y.apply(p,{position:u});if(lp(i,"discard")&&!e.y.isInRange(f))return null;var h=[{x:a+l,y:f},{x:a,y:f}];return"left"===d?h.reverse():h}if(t){var m=i.x,y=i.xAxis.orientation,v=e.x.apply(m,{position:u});if(lp(i,"discard")&&!e.x.isInRange(v))return null;var g=[{x:v,y:c+s},{x:v,y:c}];return"top"===y?g.reverse():g}if(n){var b=i.segment.map((function(t){return e.apply(t,{position:u})}));return lp(i,"discard")&&mp()(b,(function(t){return!e.isInRange(t)}))?null:b}return null};function kp(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxis,o=e.yAxis,a=e.shape,c=e.className,l=e.alwaysShow,s=e.clipPathId;Yo(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var u=Ts({x:i.scale,y:o.scale}),p=Bi(t),d=Bi(r),h=n&&2===n.length,m=Op(u,p,d,h,e);if(!m)return null;var y,v,g=(v=2,function(e){if(Array.isArray(e))return e}(y=m)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(y,v)||function(e,t){if(e){if("string"==typeof e)return bp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bp(e,t):void 0}}(y,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=g[0],x=b.x,w=b.y,O=g[1],k=O.x,j=O.y,S=gp(gp({clipPath:lp(e,"hidden")?"url(#".concat(s,")"):void 0},zo(e,!0)),{},{x1:x,y1:w,x2:k,y2:j});return f().createElement(Ho,{className:yi()("recharts-reference-line",c)},wp(a,S),Jc.renderCallByParent(e,As({x1:x,y1:w,x2:k,y2:j})))}function jp(e){return jp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(e)}function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sp.apply(this,arguments)}function Ep(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ap(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ep(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==jp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==jp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===jp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ep(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pp(e){var t=e.x1,r=e.x2,n=e.y1,i=e.y2,o=e.className,a=e.alwaysShow,c=e.clipPathId;Yo(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var l=Bi(t),s=Bi(r),u=Bi(n),p=Bi(i),d=e.shape;if(!(l||s||u||p||d))return null;var h=function(e,t,r,n,i){var o=i.x1,a=i.x2,c=i.y1,l=i.y2,s=i.xAxis,u=i.yAxis;if(!s||!u)return null;var p=Ts({x:s.scale,y:u.scale}),d={x:e?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:r?p.y.apply(c,{position:"start"}):p.y.rangeMin},f={x:t?p.x.apply(a,{position:"end"}):p.x.rangeMax,y:n?p.y.apply(l,{position:"end"}):p.y.rangeMax};return!lp(i,"discard")||p.isInRange(d)&&p.isInRange(f)?Es(d,f):null}(l,s,u,p,e);if(!h&&!d)return null;var m=lp(e,"hidden")?"url(#".concat(c,")"):void 0;return f().createElement(Ho,{className:yi()("recharts-reference-area",o)},Pp.renderRect(d,Ap(Ap({clipPath:m},zo(e,!0)),h)),Jc.renderCallByParent(e,h))}function Tp(e){return function(e){if(Array.isArray(e))return Cp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Cp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Cp(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}kp.displayName="ReferenceLine",kp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"},Pp.displayName="ReferenceArea",Pp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},Pp.renderRect=function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):ri()(e)?e(t):f().createElement(kl,Sp({},t,{className:"recharts-reference-area-rect"}))};var Ip=function(e,t,r,n,i){var o=No(e,kp),a=No(e,fp),c=[].concat(Tp(o),Tp(a)),l=No(e,Pp),s="".concat(n,"Id"),u=n[0],p=t;if(c.length&&(p=c.reduce((function(e,t){if(t.props[s]===r&&lp(t.props,"extendDomain")&&_i(t.props[u])){var n=t.props[u];return[Math.min(e[0],n),Math.max(e[1],n)]}return e}),p)),l.length){var d="".concat(u,"1"),f="".concat(u,"2");p=l.reduce((function(e,t){if(t.props[s]===r&&lp(t.props,"extendDomain")&&_i(t.props[d])&&_i(t.props[f])){var n=t.props[d],i=t.props[f];return[Math.min(e[0],n,i),Math.max(e[1],n,i)]}return e}),p)}return i&&i.length&&(p=i.reduce((function(e,t){return _i(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e}),p)),p};const Dp=require("eventemitter3");var Mp=new(i.n(Dp)()),Np="recharts.syncMouseEvents";function Rp(e){return Rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rp(e)}function _p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Lp(n.key),n)}}function Bp(e,t,r){return(t=Lp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lp(e){var t=function(e,t){if("object"!==Rp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Rp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Rp(t)?t:String(t)}var zp=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Bp(this,"activeIndex",0),Bp(this,"coordinateList",[]),Bp(this,"layout","horizontal")}var t,r;return t=e,(r=[{key:"setDetails",value:function(e){var t=e.coordinateList,r=void 0===t?[]:t,n=e.container,i=void 0===n?null:n,o=e.layout,a=void 0===o?null:o,c=e.offset,l=void 0===c?null:c,s=e.mouseHandlerCallback,u=void 0===s?null:s;this.coordinateList=null!=r?r:this.coordinateList,this.container=null!=i?i:this.container,this.layout=null!=a?a:this.layout,this.offset=null!=l?l:this.offset,this.mouseHandlerCallback=null!=u?u:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"spoofMouse",value:function(){var e,t;if("horizontal"===this.layout&&0!==this.coordinateList.length){var r=this.container.getBoundingClientRect(),n=r.x,i=r.y,o=r.height,a=this.coordinateList[this.activeIndex].coordinate,c=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,l=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,s=n+a+c,u=i+this.offset.top+o/2+l;this.mouseHandlerCallback({pageX:s,pageY:u})}}}])&&_p(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fp(e,t,r){var n,i,o,a;if("horizontal"===e)o=n=t.x,i=r.top,a=r.top+r.height;else if("vertical"===e)a=i=t.y,n=r.left,o=r.left+r.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return Ai(t);var c=t.cx,l=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.angle,d=ji(c,l,s,p),f=ji(c,l,u,p);n=d.x,i=d.y,o=f.x,a=f.y}return[{x:n,y:i},{x:o,y:a}]}var $p=["item"],qp=["children","className","width","height","style","compact","title","desc"];function Wp(e){return Wp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wp(e)}function Up(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||Qp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hp.apply(this,arguments)}function Gp(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Xp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nd(n.key),n)}}function Vp(e,t){return Vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vp(e,t)}function Kp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yp(e){return Yp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yp(e)}function Zp(e){return function(e){if(Array.isArray(e))return Jp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Qp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qp(e,t){if(e){if("string"==typeof e)return Jp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Jp(e,t):void 0}}function Jp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ed(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function td(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ed(Object(r),!0).forEach((function(t){rd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ed(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rd(e,t,r){return(t=nd(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nd(e){var t=function(e,t){if("object"!==Wp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Wp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Wp(t)?t:String(t)}var id={xAxis:["bottom","top"],yAxis:["left","right"]},od={width:"100%",height:"100%"},ad={x:0,y:0},cd=function(e,t){var r=t.graphicalItems,n=t.dataStartIndex,i=t.dataEndIndex,o=(null!=r?r:[]).reduce((function(e,t){var r=t.props.data;return r&&r.length?[].concat(Zp(e),Zp(r)):e}),[]);return o.length>0?o:e&&e.length&&_i(n)&&_i(i)?e.slice(n,i+1):[]};function ld(e){return"number"===e?[0,"auto"]:void 0}var sd=function(e,t,r,n){var i=e.graphicalItems,o=e.tooltipAxis,a=cd(t,e);return r<0||!i||!i.length||r>=a.length?null:i.reduce((function(i,c){var l;if(c.props.hide)return i;var s,u=null!==(l=c.props.data)&&void 0!==l?l:t;return u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),(s=o.dataKey&&!o.allowDuplicatedCategory?Wi(void 0===u?a:u,o.dataKey,n):u&&u[r]||a[r])?[].concat(Zp(i),[uc(c,s)]):i}),[])},ud=function(e,t,r,n){var i=n||{x:e.chartX,y:e.chartY},o=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(i,r),a=e.orderedTooltipTicks,c=e.tooltipAxis,l=e.tooltipTicks,s=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,a=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(a<=1)return 0;if(i&&"angleAxis"===i.axisType&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,l=0;l<a;l++){var s=l>0?n[l-1].coordinate:n[a-1].coordinate,u=n[l].coordinate,p=l>=a-1?n[0].coordinate:n[l+1].coordinate,d=void 0;if(Ni(u-s)!==Ni(p-u)){var f=[];if(Ni(p-u)===Ni(c[1]-c[0])){d=p;var h=u+c[1]-c[0];f[0]=Math.min(h,(h+s)/2),f[1]=Math.max(h,(h+s)/2)}else{d=s;var m=p+c[1]-c[0];f[0]=Math.min(u,(m+u)/2),f[1]=Math.max(u,(m+u)/2)}var y=[Math.min(u,(d+u)/2),Math.max(u,(d+u)/2)];if(e>y[0]&&e<=y[1]||e>=f[0]&&e<=f[1]){o=n[l].index;break}}else{var v=Math.min(s,p),g=Math.max(s,p);if(e>(v+u)/2&&e<=(g+u)/2){o=n[l].index;break}}}else for(var b=0;b<a;b++)if(0===b&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){o=r[b].index;break}return o}(o,a,l,c);if(s>=0&&l){var u=l[s]&&l[s].value,p=sd(e,t,s,u),d=function(e,t,r,n){var i=t.find((function(e){return e&&e.index===r}));if(i){if("horizontal"===e)return{x:i.coordinate,y:n.y};if("vertical"===e)return{x:n.x,y:i.coordinate};if("centric"===e){var o=i.coordinate,a=n.radius;return td(td(td({},n),ji(n.cx,n.cy,a,o)),{},{angle:o,radius:a})}var c=i.coordinate,l=n.angle;return td(td(td({},n),ji(n.cx,n.cy,c,l)),{},{angle:l,radius:c})}return ad}(r,a,s,i);return{activeTooltipIndex:s,activeLabel:u,activePayload:p,activeCoordinate:d}}return null},pd=function(e,t){var r=t.axisType,n=void 0===r?"xAxis":r,i=t.AxisComp,o=t.graphicalItems,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.children,u="".concat(n,"Id"),p=No(s,i),d={};return p&&p.length?d=function(e,t){var r=t.axes,n=t.graphicalItems,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=e.stackOffset,d=Va(s,i);return r.reduce((function(t,r){var f,h=r.props,m=h.type,y=h.dataKey,v=h.allowDataOverflow,g=h.allowDuplicatedCategory,b=h.scale,x=h.ticks,w=h.includeHidden,O=r.props[o];if(t[O])return t;var k,j,S,E=cd(e.data,{graphicalItems:n.filter((function(e){return e.props[o]===O})),dataStartIndex:c,dataEndIndex:l}),A=E.length;(function(e,t,r){if("number"===r&&!0===t&&Array.isArray(e)){var n=null==e?void 0:e[0],i=null==e?void 0:e[1];if(n&&i&&_i(n)&&_i(i))return!0}return!1})(r.props.domain,v,m)&&(k=cc(r.props.domain,null,v),!d||"number"!==m&&"auto"===b||(S=Ua(E,y,"category")));var P=ld(m);if(!k||0===k.length){var T,C=null!==(T=r.props.domain)&&void 0!==T?T:P;if(y){if(k=Ua(E,y,m),"category"===m&&d){var I=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++){if(r[e[n]])return!0;r[e[n]]=!0}return!1}(k);g&&I?(j=k,k=ii()(0,A)):g||(k=sc(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0?e:[].concat(Zp(e),[t])}),[]))}else if("category"===m)k=g?k.filter((function(e){return""!==e&&!ei()(e)})):sc(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0||""===t||ei()(t)?e:[].concat(Zp(e),[t])}),[]);else if("number"===m){var D=function(e,t,r,n,i){var o=t.map((function(t){return Ga(e,t,r,i,n)})).filter((function(e){return!ei()(e)}));return o&&o.length?o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null}(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),y,i,s);D&&(k=D)}!d||"number"!==m&&"auto"===b||(S=Ua(E,y,"category"))}else k=d?ii()(0,A):a&&a[O]&&a[O].hasStack&&"number"===m?"expand"===p?[0,1]:ic(a[O].stackGroups,c,l):Xa(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),m,s,!0);if("number"===m)k=Ip(u,k,O,i,x),C&&(k=cc(C,k,v));else if("category"===m&&C){var M=C;k.every((function(e){return M.indexOf(e)>=0}))&&(k=M)}}return td(td({},t),{},rd({},O,td(td({},r.props),{},{axisType:i,domain:k,categoricalDomain:S,duplicateDomain:j,originalDomain:null!==(f=r.props.domain)&&void 0!==f?f:P,isCategorical:d,layout:s})))}),{})}(e,{axes:p,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l}):o&&o.length&&(d=function(e,t){var r=t.graphicalItems,n=t.Axis,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=cd(e.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:l}),d=p.length,f=Va(s,i),h=-1;return r.reduce((function(e,t){var m,y=t.props[o],v=ld("number");return e[y]?e:(h++,f?m=ii()(0,d):a&&a[y]&&a[y].hasStack?(m=ic(a[y].stackGroups,c,l),m=Ip(u,m,y,i)):(m=cc(v,Xa(p,r.filter((function(e){return e.props[o]===y&&!e.props.hide})),"number",s),n.defaultProps.allowDataOverflow),m=Ip(u,m,y,i)),td(td({},e),{},rd({},y,td(td({axisType:i},n.defaultProps),{},{hide:!0,orientation:ai()(id,"".concat(i,".").concat(h%2),null),domain:m,originalDomain:v,isCategorical:f,layout:s}))))}),{})}(e,{Axis:i,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l})),d},dd=function(e){var t=e.children,r=e.defaultShowTooltip,n=Ro(t,cp),i=0,o=0;return e.data&&0!==e.data.length&&(o=e.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(i=n.props.startIndex),n.props.endIndex>=0&&(o=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:Boolean(r)}},fd=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},hd=function(e){var t,r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,o=void 0===i?"axis":i,a=e.validateTooltipEventTypes,c=void 0===a?["axis"]:a,l=e.axisComponents,s=e.legendContent,u=e.formatAxisMap,p=e.defaultProps,h=function(e,t){var i=e.props,o=e.dataStartIndex,a=e.dataEndIndex,c=e.updateId;if(!_o({props:i}))return null;var s=i.children,p=i.layout,d=i.stackOffset,f=i.data,h=i.reverseStackOrder,m=fd(p),y=m.numericAxisName,v=m.cateAxisName,g=No(s,n),b=function(e,t,r,n,i,o){if(!e)return null;var a=(o?t.reverse():t).reduce((function(e,t){var i=t.props,o=i.stackId;if(i.hide)return e;var a=t.props[r],c=e[a]||{hasStack:!1,stackGroups:{}};if(Bi(o)){var l=c.stackGroups[o]||{numericAxisId:r,cateAxisId:n,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[zi("_stackId_")]={numericAxisId:r,cateAxisId:n,items:[t]};return za(za({},e),{},Fa({},a,c))}),{});return Object.keys(a).reduce((function(t,o){var c=a[o];return c.hasStack&&(c.stackGroups=Object.keys(c.stackGroups).reduce((function(t,o){var a=c.stackGroups[o];return za(za({},t),{},Fa({},o,{numericAxisId:r,cateAxisId:n,items:a.items,stackedData:tc(e,a.items,i)}))}),{})),za(za({},t),{},Fa({},o,c))}),{})}(f,g,"".concat(y,"Id"),"".concat(v,"Id"),d,h),x=l.reduce((function(e,t){var r="".concat(t.axisType,"Map");return td(td({},e),{},rd({},r,pd(i,td(td({},t),{},{graphicalItems:g,stackGroups:t.axisType===y&&b,dataStartIndex:o,dataEndIndex:a}))))}),{}),w=function(e,t){var r=e.props,n=(e.graphicalItems,e.xAxisMap),i=void 0===n?{}:n,o=e.yAxisMap,a=void 0===o?{}:o,c=r.width,l=r.height,s=r.children,u=r.margin||{},p=Ro(s,cp),d=Ro(s,Da),f=Object.keys(a).reduce((function(e,t){var r=a[t],n=r.orientation;return r.mirror||r.hide?e:td(td({},e),{},rd({},n,e[n]+r.width))}),{left:u.left||0,right:u.right||0}),h=Object.keys(i).reduce((function(e,t){var r=i[t],n=r.orientation;return r.mirror||r.hide?e:td(td({},e),{},rd({},n,ai()(e,"".concat(n))+r.height))}),{top:u.top||0,bottom:u.bottom||0}),m=td(td({},h),f),y=m.bottom;p&&(m.bottom+=p.props.height||cp.defaultProps.height),d&&t&&(m=function(e,t,r,n){var i=r.children,o=r.width,a=r.margin,c=o-(a.left||0)-(a.right||0),l=_a({children:i,legendWidth:c});if(l){var s=n||{},u=s.width,p=s.height,d=l.align,f=l.verticalAlign,h=l.layout;if(("vertical"===h||"horizontal"===h&&"middle"===f)&&"center"!==d&&_i(e[d]))return za(za({},e),{},Fa({},d,e[d]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===d)&&"middle"!==f&&_i(e[f]))return za(za({},e),{},Fa({},f,e[f]+(p||0)))}return e}(m,0,r,t));var v=c-m.left-m.right,g=l-m.top-m.bottom;return td(td({brushBottom:y},m),{},{width:Math.max(v,0),height:Math.max(g,0)})}(td(td({},x),{},{props:i,graphicalItems:g}),null==t?void 0:t.legendBBox);Object.keys(x).forEach((function(e){x[e]=u(i,x[e],w,e.replace("Map",""),r)}));var O,k,j=x["".concat(v,"Map")],S=(O=$i(j),{tooltipTicks:k=Ya(O,!1,!0),orderedTooltipTicks:li()(k,(function(e){return e.coordinate})),tooltipAxis:O,tooltipAxisBandSize:lc(O,k)}),E=function(e,t){var r=t.graphicalItems,n=t.stackGroups,i=t.offset,o=t.updateId,a=t.dataStartIndex,c=t.dataEndIndex,s=e.barSize,u=e.layout,p=e.barGap,d=e.barCategoryGap,f=e.maxBarSize,h=fd(u),m=h.numericAxisName,y=h.cateAxisName,v=function(e){return!(!e||!e.length)&&e.some((function(e){var t=Co(e&&e.type);return t&&t.indexOf("Bar")>=0}))}(r),g=v&&function(e){var t=e.barSize,r=e.stackGroups,n=void 0===r?{}:r;if(!n)return{};for(var i={},o=Object.keys(n),a=0,c=o.length;a<c;a++)for(var l=n[o[a]].stackGroups,s=Object.keys(l),u=0,p=s.length;u<p;u++){var d=l[s[u]],f=d.items,h=d.cateAxisId,m=f.filter((function(e){return Co(e.type).indexOf("Bar")>=0}));if(m&&m.length){var y=m[0].props.barSize,v=m[0].props[h];i[v]||(i[v]=[]),i[v].push({item:m[0],stackList:m.slice(1),barSize:ei()(y)?t:y})}}return i}({barSize:s,stackGroups:n}),b=[];return r.forEach((function(r,s){var h=cd(e.data,{graphicalItems:[r],dataStartIndex:a,dataEndIndex:c}),v=r.props,x=v.dataKey,w=v.maxBarSize,O=r.props["".concat(m,"Id")],k=r.props["".concat(y,"Id")],j=l.reduce((function(e,n){var i,o=t["".concat(n.axisType,"Map")],a=r.props["".concat(n.axisType,"Id")];o&&o[a]||"zAxis"===n.axisType||gi()(!1);var c=o[a];return td(td({},e),{},(rd(i={},n.axisType,c),rd(i,"".concat(n.axisType,"Ticks"),Ya(c)),i))}),{}),S=j[y],E=j["".concat(y,"Ticks")],A=n&&n[O]&&n[O].hasStack&&function(e,t){var r=e.props.stackId;if(Bi(r)){var n=t[r];if(n){var i=n.items.indexOf(e);return i>=0?n.stackedData[i]:null}}return null}(r,n[O].stackGroups),P=Co(r.type).indexOf("Bar")>=0,T=lc(S,E),C=[];if(P){var I,D,M=ei()(w)?f:w,N=null!==(I=null!==(D=lc(S,E,!0))&&void 0!==D?D:M)&&void 0!==I?I:0;C=function(e){var t=e.barGap,r=e.barCategoryGap,n=e.bandSize,i=e.sizeList,o=void 0===i?[]:i,a=e.maxBarSize,c=o.length;if(c<1)return null;var l,s=Fi(t,n,0,!0),u=[];if(o[0].barSize===+o[0].barSize){var p=!1,d=n/c,f=o.reduce((function(e,t){return e+t.barSize||0}),0);(f+=(c-1)*s)>=n&&(f-=(c-1)*s,s=0),f>=n&&d>0&&(p=!0,f=c*(d*=.9));var h={offset:((n-f)/2|0)-s,size:0};l=o.reduce((function(e,t){var r={item:t.item,position:{offset:h.offset+h.size+s,size:p?d:t.barSize}},n=[].concat($a(e),[r]);return h=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:h})})),n}),u)}else{var m=Fi(r,n,0,!0);n-2*m-(c-1)*s<=0&&(s=0);var y=(n-2*m-(c-1)*s)/c;y>1&&(y>>=0);var v=a===+a?Math.min(y,a):y;l=o.reduce((function(e,t,r){var n=[].concat($a(e),[{item:t.item,position:{offset:m+(y+s)*r+(y-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:n[n.length-1].position})})),n}),u)}return l}({barGap:p,barCategoryGap:d,bandSize:N!==T?N:T,sizeList:g[k],maxBarSize:M}),N!==T&&(C=C.map((function(e){return td(td({},e),{},{position:td(td({},e.position),{},{offset:e.position.offset-N/2})})})))}var R,_,B,L=r&&r.type&&r.type.getComposedData;L&&b.push({props:td(td({},L(td(td({},j),{},{displayedData:h,props:e,dataKey:x,item:r,bandSize:T,barPosition:C,offset:i,stackedData:A,layout:u,dataStartIndex:a,dataEndIndex:c}))),{},(R={key:r.key||"item-".concat(s)},rd(R,m,j[m]),rd(R,y,j[y]),rd(R,"animationId",o),R)),childIndex:(_=r,B=e.children,Mo(B).indexOf(_)),item:r})})),b}(i,td(td({},x),{},{dataStartIndex:o,dataEndIndex:a,updateId:c,graphicalItems:g,stackGroups:b,offset:w}));return td(td({formattedGraphicalItems:E,graphicalItems:g,offset:w,stackGroups:b},S),x)};return t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vp(e,t)}(u,e);var t,n,i,a,l=(i=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Yp(i);if(a){var r=Yp(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Wp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Kp(e)}(this,e)});function u(e){var t,n,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),rd(Kp(i=l.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),rd(Kp(i),"accessibilityManager",new zp),rd(Kp(i),"handleLegendBBoxUpdate",(function(e){if(e){var t=i.state,r=t.dataStartIndex,n=t.dataEndIndex,o=t.updateId;i.setState(td({legendBBox:e},h({props:i.props,dataStartIndex:r,dataEndIndex:n,updateId:o},td(td({},i.state),{},{legendBBox:e}))))}})),rd(Kp(i),"handleReceiveSyncEvent",(function(e,t,r){if(i.props.syncId===e){if(r===i.eventEmitterSymbol&&"function"!=typeof i.props.syncMethod)return;i.applySyncEvent(t)}})),rd(Kp(i),"handleBrushChange",(function(e){var t=e.startIndex,r=e.endIndex;if(t!==i.state.dataStartIndex||r!==i.state.dataEndIndex){var n=i.state.updateId;i.setState((function(){return td({dataStartIndex:t,dataEndIndex:r},h({props:i.props,dataStartIndex:t,dataEndIndex:r,updateId:n},i.state))})),i.triggerSyncEvent({dataStartIndex:t,dataEndIndex:r})}})),rd(Kp(i),"handleMouseEnter",(function(e){var t=i.getMouseInfo(e);if(t){var r=td(td({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseEnter;ri()(n)&&n(r,e)}})),rd(Kp(i),"triggeredAfterMouseMove",(function(e){var t=i.getMouseInfo(e),r=t?td(td({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseMove;ri()(n)&&n(r,e)})),rd(Kp(i),"handleItemMouseEnter",(function(e){i.setState((function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}}))})),rd(Kp(i),"handleItemMouseLeave",(function(){i.setState((function(){return{isTooltipActive:!1}}))})),rd(Kp(i),"handleMouseMove",(function(e){e.persist(),i.throttleTriggeredAfterMouseMove(e)})),rd(Kp(i),"handleMouseLeave",(function(e){var t={isTooltipActive:!1};i.setState(t),i.triggerSyncEvent(t);var r=i.props.onMouseLeave;ri()(r)&&r(t,e)})),rd(Kp(i),"handleOuterEvent",(function(e){var t,r=function(e){var t=e&&e.type;return t&&To[t]?To[t]:null}(e),n=ai()(i.props,"".concat(r));r&&ri()(n)&&n(null!==(t=/.*touch.*/i.test(r)?i.getMouseInfo(e.changedTouches[0]):i.getMouseInfo(e))&&void 0!==t?t:{},e)})),rd(Kp(i),"handleClick",(function(e){var t=i.getMouseInfo(e);if(t){var r=td(td({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onClick;ri()(n)&&n(r,e)}})),rd(Kp(i),"handleMouseDown",(function(e){var t=i.props.onMouseDown;ri()(t)&&t(i.getMouseInfo(e),e)})),rd(Kp(i),"handleMouseUp",(function(e){var t=i.props.onMouseUp;ri()(t)&&t(i.getMouseInfo(e),e)})),rd(Kp(i),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.throttleTriggeredAfterMouseMove(e.changedTouches[0])})),rd(Kp(i),"handleTouchStart",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseDown(e.changedTouches[0])})),rd(Kp(i),"handleTouchEnd",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseUp(e.changedTouches[0])})),rd(Kp(i),"triggerSyncEvent",(function(e){void 0!==i.props.syncId&&Mp.emit(Np,i.props.syncId,e,i.eventEmitterSymbol)})),rd(Kp(i),"applySyncEvent",(function(e){var t=i.props,r=t.layout,n=t.syncMethod,o=i.state.updateId,a=e.dataStartIndex,c=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)i.setState(td({dataStartIndex:a,dataEndIndex:c},h({props:i.props,dataStartIndex:a,dataEndIndex:c,updateId:o},i.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,s=e.chartY,u=e.activeTooltipIndex,p=i.state,d=p.offset,f=p.tooltipTicks;if(!d)return;if("function"==typeof n)u=n(f,e);else if("value"===n){u=-1;for(var m=0;m<f.length;m++)if(f[m].value===e.activeLabel){u=m;break}}var y=td(td({},d),{},{x:d.left,y:d.top}),v=Math.min(l,y.x+y.width),g=Math.min(s,y.y+y.height),b=f[u]&&f[u].value,x=sd(i.state,i.props.data,u),w=f[u]?{x:"horizontal"===r?f[u].coordinate:v,y:"horizontal"===r?g:f[u].coordinate}:ad;i.setState(td(td({},e),{},{activeLabel:b,activeCoordinate:w,activePayload:x,activeTooltipIndex:u}))}else i.setState(e)})),rd(Kp(i),"verticalCoordinatesGenerator",(function(e,t){var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return Ka(Rs(td(td(td({},Uu.defaultProps),r),{},{ticks:Ya(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)})),rd(Kp(i),"horizontalCoordinatesGenerator",(function(e,t){var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return Ka(Rs(td(td(td({},Uu.defaultProps),r),{},{ticks:Ya(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)})),rd(Kp(i),"axesTicksGenerator",(function(e){return Ya(e,!0)})),rd(Kp(i),"renderCursor",(function(e){var t,n=i.state,o=n.isTooltipActive,a=n.activeCoordinate,c=n.activePayload,l=n.offset,s=n.activeTooltipIndex,u=n.tooltipAxisBandSize,p=i.getTooltipEventType(),f=null!==(t=e.props.active)&&void 0!==t?t:o;if(!e||!e.props.cursor||!f||!a||"ScatterChart"!==r&&"axis"!==p)return null;var h,m=i.props.layout,y=Ou;if("ScatterChart"===r)h=a,y=Pu;else if("BarChart"===r)h=function(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-i:r.left+.5,y:"horizontal"===e?r.top+.5:t.y-i,width:"horizontal"===e?n:r.width-1,height:"horizontal"===e?r.height-1:n}}(m,a,l,u),y=kl;else if("radial"===m){var v=Ai(a),g=v.cx,b=v.cy,x=v.radius;h={cx:g,cy:b,startAngle:v.startAngle,endAngle:v.endAngle,innerRadius:x,outerRadius:x},y=zl}else h={points:Fp(m,a,l)},y=Ou;var w=e.key||"_recharts-cursor",O=td(td(td(td({stroke:"#ccc",pointerEvents:"none"},l),h),zo(e.props.cursor)),{},{payload:c,payloadIndex:s,key:w,className:"recharts-tooltip-cursor"});return(0,d.isValidElement)(e.props.cursor)?(0,d.cloneElement)(e.props.cursor,O):(0,d.createElement)(y,O)})),rd(Kp(i),"renderPolarAxis",(function(e,t,r){var n=ai()(e,"type.axisType"),o=ai()(i.state,"".concat(n,"Map")),a=o&&o[e.props["".concat(n,"Id")]];return(0,d.cloneElement)(e,td(td({},a),{},{className:n,key:e.key||"".concat(t,"-").concat(r),ticks:Ya(a,!0)}))})),rd(Kp(i),"renderXAxis",(function(e,t,r){var n=i.state.xAxisMap[e.props.xAxisId];return i.renderAxis(n,e,t,r)})),rd(Kp(i),"renderYAxis",(function(e,t,r){var n=i.state.yAxisMap[e.props.yAxisId];return i.renderAxis(n,e,t,r)})),rd(Kp(i),"renderGrid",(function(e){var t=i.state,r=t.xAxisMap,n=t.yAxisMap,o=t.offset,a=i.props,c=a.width,l=a.height,s=$i(r),u=di()(n,(function(e){return hi()(e.domain,Number.isFinite)}))||$i(n),p=e.props||{};return(0,d.cloneElement)(e,{key:e.key||"grid",x:_i(p.x)?p.x:o.left,y:_i(p.y)?p.y:o.top,width:_i(p.width)?p.width:o.width,height:_i(p.height)?p.height:o.height,xAxis:s,yAxis:u,offset:o,chartWidth:c,chartHeight:l,verticalCoordinatesGenerator:p.verticalCoordinatesGenerator||i.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:p.horizontalCoordinatesGenerator||i.horizontalCoordinatesGenerator})})),rd(Kp(i),"renderPolarGrid",(function(e){var t=e.props,r=t.radialLines,n=t.polarAngles,o=t.polarRadius,a=i.state,c=a.radiusAxisMap,l=a.angleAxisMap,s=$i(c),u=$i(l),p=u.cx,f=u.cy,h=u.innerRadius,m=u.outerRadius;return(0,d.cloneElement)(e,{polarAngles:Array.isArray(n)?n:Ya(u,!0).map((function(e){return e.coordinate})),polarRadius:Array.isArray(o)?o:Ya(s,!0).map((function(e){return e.coordinate})),cx:p,cy:f,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:r})})),rd(Kp(i),"renderLegend",(function(){var e=i.state.formattedGraphicalItems,t=i.props,r=t.children,n=t.width,o=t.height,a=i.props.margin||{},c=n-(a.left||0)-(a.right||0),l=_a({children:r,formattedGraphicalItems:e,legendWidth:c,legendContent:s});if(!l)return null;var u=l.item,p=Gp(l,$p);return(0,d.cloneElement)(u,td(td({},p),{},{chartWidth:n,chartHeight:o,margin:a,onBBoxUpdate:i.handleLegendBBoxUpdate}))})),rd(Kp(i),"renderTooltip",(function(){var e,t=Ro(i.props.children,fu);if(!t)return null;var r=i.state,n=r.isTooltipActive,o=r.activeCoordinate,a=r.activePayload,c=r.activeLabel,l=r.offset,s=null!==(e=t.props.active)&&void 0!==e?e:n;return(0,d.cloneElement)(t,{viewBox:td(td({},l),{},{x:l.left,y:l.top}),active:s,label:c,payload:s?a:[],coordinate:o})})),rd(Kp(i),"renderBrush",(function(e){var t=i.props,r=t.margin,n=t.data,o=i.state,a=o.offset,c=o.dataStartIndex,l=o.dataEndIndex,s=o.updateId;return(0,d.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:Qa(i.handleBrushChange,e.props.onChange),data:n,x:_i(e.props.x)?e.props.x:a.left,y:_i(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(r.bottom||0),width:_i(e.props.width)?e.props.width:a.width,startIndex:c,endIndex:l,updateId:"brush-".concat(s)})})),rd(Kp(i),"renderReferenceElement",(function(e,t,r){if(!e)return null;var n=Kp(i).clipPathId,o=i.state,a=o.xAxisMap,c=o.yAxisMap,l=o.offset,s=e.props,u=s.xAxisId,p=s.yAxisId;return(0,d.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(r),xAxis:a[u],yAxis:c[p],viewBox:{x:l.left,y:l.top,width:l.width,height:l.height},clipPathId:n})})),rd(Kp(i),"renderActivePoints",(function(e){var t=e.item,r=e.activePoint,n=e.basePoint,i=e.childIndex,o=e.isRange,a=[],c=t.props.key,l=t.item.props,s=l.activeDot,p=td(td({index:i,dataKey:l.dataKey,cx:r.x,cy:r.y,r:4,fill:Ha(t.item),strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value,key:"".concat(c,"-activePoint-").concat(i)},zo(s)),ko(s));return a.push(u.renderActiveDot(s,p)),n?a.push(u.renderActiveDot(s,td(td({},p),{},{cx:n.x,cy:n.y,key:"".concat(c,"-basePoint-").concat(i)}))):o&&a.push(null),a})),rd(Kp(i),"renderGraphicChild",(function(e,t,r){var n=i.filterFormatItem(e,t,r);if(!n)return null;var o=i.getTooltipEventType(),a=i.state,c=a.isTooltipActive,l=a.tooltipAxis,s=a.activeTooltipIndex,u=a.activeLabel,p=Ro(i.props.children,fu),f=n.props,h=f.points,m=f.isRange,y=f.baseLine,v=n.item.props,g=v.activeDot,b=v.hide,x=v.activeBar,w=v.activeShape,O=Boolean(!b&&c&&p&&(g||x||w)),k={};"axis"!==o&&p&&"click"===p.props.trigger?k={onClick:Qa(i.handleItemMouseEnter,e.props.onClick)}:"axis"!==o&&(k={onMouseLeave:Qa(i.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:Qa(i.handleItemMouseEnter,e.props.onMouseEnter)});var j=(0,d.cloneElement)(e,td(td({},n.props),k));if(O){if(!(s>=0)){var S,E=(null!==(S=i.getItemByXY(i.state.activeCoordinate))&&void 0!==S?S:{graphicalItem:j}).graphicalItem,A=E.item,P=void 0===A?e:A,T=E.childIndex,C=td(td(td({},n.props),k),{},{activeIndex:T});return[(0,d.cloneElement)(P,C),null,null]}var I,D;if(l.dataKey&&!l.allowDuplicatedCategory){var M="function"==typeof l.dataKey?function(e){return"function"==typeof l.dataKey?l.dataKey(e.payload):null}:"payload.".concat(l.dataKey.toString());I=Wi(h,M,u),D=m&&y&&Wi(y,M,u)}else I=null==h?void 0:h[s],D=m&&y&&y[s];if(w||x){var N=void 0!==e.props.activeIndex?e.props.activeIndex:s;return[(0,d.cloneElement)(e,td(td(td({},n.props),k),{},{activeIndex:N})),null,null]}if(!ei()(I))return[j].concat(Zp(i.renderActivePoints({item:n,activePoint:I,basePoint:D,childIndex:s,isRange:m})))}return m?[j,null,null]:[j,null]})),rd(Kp(i),"renderCustomized",(function(e,t,r){return(0,d.cloneElement)(e,td(td({key:"recharts-customized-".concat(r)},i.props),i.state))})),rd(Kp(i),"renderMap",{CartesianGrid:{handler:i.renderGrid,once:!0},ReferenceArea:{handler:i.renderReferenceElement},ReferenceLine:{handler:i.renderReferenceElement},ReferenceDot:{handler:i.renderReferenceElement},XAxis:{handler:i.renderXAxis},YAxis:{handler:i.renderYAxis},Brush:{handler:i.renderBrush,once:!0},Bar:{handler:i.renderGraphicChild},Line:{handler:i.renderGraphicChild},Area:{handler:i.renderGraphicChild},Radar:{handler:i.renderGraphicChild},RadialBar:{handler:i.renderGraphicChild},Scatter:{handler:i.renderGraphicChild},Pie:{handler:i.renderGraphicChild},Funnel:{handler:i.renderGraphicChild},Tooltip:{handler:i.renderCursor,once:!0},PolarGrid:{handler:i.renderPolarGrid,once:!0},PolarAngleAxis:{handler:i.renderPolarAxis},PolarRadiusAxis:{handler:i.renderPolarAxis},Customized:{handler:i.renderCustomized}}),i.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:zi("recharts"),"-clip"),i.throttleTriggeredAfterMouseMove=ui()(i.triggeredAfterMouseMove,null!==(n=e.throttleDelay)&&void 0!==n?n:1e3/60),i.state={},i}return t=u,n=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:null!==(r=this.props.margin.left)&&void 0!==r?r:0,top:null!==(n=this.props.margin.top)&&void 0!==n?n:0}}),null):null;var r,n}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=Ro(this.props.children,fu);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return c.indexOf(t)>=0?t:o}return o}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t,r=this.container,n=r.getBoundingClientRect(),i=(t=n).top+window.scrollY-document.documentElement.clientTop,o=t.left+window.scrollX-document.documentElement.clientLeft,a={chartX:Math.round(e.pageX-o),chartY:Math.round(e.pageY-i)},c=n.width/r.offsetWidth||1,l=this.inRange(a.chartX,a.chartY,c);if(!l)return null;var s=this.state,u=s.xAxisMap,p=s.yAxisMap;if("axis"!==this.getTooltipEventType()&&u&&p){var d=$i(u).scale,f=$i(p).scale,h=d&&d.invert?d.invert(a.chartX):null,m=f&&f.invert?f.invert(a.chartY):null;return td(td({},a),{},{xValue:h,yValue:m})}var y=ud(this.state,this.props.data,this.props.layout,l);return y?td(td({},a),y):null}},{key:"inRange",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,i=e/r,o=t/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return i>=a.left&&i<=a.left+a.width&&o>=a.top&&o<=a.top+a.height?{x:i,y:o}:null}var c=this.state,l=c.angleAxisMap,s=c.radiusAxisMap;if(l&&s){var u=$i(l);return Ei({x:i,y:o},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),r=Ro(e,fu),n={};return r&&"axis"===t&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),td(td({},ko(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){Mp.on(Np,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Mp.removeListener(Np,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,r){for(var n=this.state.formattedGraphicalItems,i=0,o=n.length;i<o;i++){var a=n[i];if(a.item===e||a.props.key===e.key||t===Co(a.item.type)&&r===a.childIndex)return a}return null}},{key:"renderAxis",value:function(e,t,r,n){var i=this.props,o=i.width,a=i.height;return f().createElement(Uu,Hp({},e,{className:yi()("recharts-".concat(e.axisType," ").concat(e.axisType),e.className),key:t.key||"".concat(r,"-").concat(n),viewBox:{x:0,y:0,width:o,height:a},ticksGenerator:this.axesTicksGenerator}))}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,r=t.left,n=t.top,i=t.height,o=t.width;return f().createElement("defs",null,f().createElement("clipPath",{id:e},f().createElement("rect",{x:r,y:n,height:i,width:o})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Up(t,2),n=r[0],i=r[1];return td(td({},e),{},rd({},n,i.scale))}),{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Up(t,2),n=r[0],i=r[1];return td(td({},e),{},rd({},n,i.scale))}),{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,r=t.formattedGraphicalItems,n=t.activeItem;if(r&&r.length)for(var i=0,o=r.length;i<o;i++){var a=r[i],c=a.props,l=a.item,s=Co(l.type);if("Bar"===s){var u=(c.data||[]).find((function(t){return wl(e,t)}));if(u)return{graphicalItem:a,payload:u}}else if("RadialBar"===s){var p=(c.data||[]).find((function(t){return Ei(e,t)}));if(p)return{graphicalItem:a,payload:p}}else if(Xl(a,n)||Vl(a,n)||Kl(a,n)){var d=Jl({graphicalItem:a,activeTooltipItem:n,itemData:l.props.data}),f=void 0===l.props.activeIndex?d:l.props.activeIndex;return{graphicalItem:td(td({},a),{},{childIndex:f}),payload:Kl(a,n)?l.props.data[d]:a.props.data[d]}}}return null}},{key:"render",value:function(){var e=this;if(!_o(this))return null;var t,r,n=this.props,i=n.children,o=n.className,a=n.width,c=n.height,l=n.style,s=n.compact,u=n.title,p=n.desc,d=Gp(n,qp),h=zo(d);if(s)return f().createElement(Jo,Hp({},h,{width:a,height:c,title:u,desc:p}),this.renderClipPath(),qo(i,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(t=this.props.tabIndex)&&void 0!==t?t:0,h.role=null!==(r=this.props.role)&&void 0!==r?r:"img",h.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},h.onFocus=function(){e.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return f().createElement("div",Hp({className:yi()("recharts-wrapper",o),style:td({position:"relative",cursor:"default",width:a,height:c},l)},m,{ref:function(t){e.container=t},role:"region"}),f().createElement(Jo,Hp({},h,{width:a,height:c,title:u,desc:p,style:od}),this.renderClipPath(),qo(i,this.renderMap)),this.renderLegend(),this.renderTooltip())}}],n&&Xp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),u}(d.Component),rd(t,"displayName",r),rd(t,"defaultProps",td({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),rd(t,"getDerivedStateFromProps",(function(e,t){var r=e.dataKey,n=e.data,i=e.children,o=e.width,a=e.height,c=e.layout,l=e.stackOffset,s=e.margin;if(void 0===t.updateId){var u=dd(e);return td(td(td({},u),{},{updateId:0},h(td(td({props:e},u),{},{updateId:0}),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(r!==t.prevDataKey||n!==t.prevData||o!==t.prevWidth||a!==t.prevHeight||c!==t.prevLayout||l!==t.prevStackOffset||!vo(s,t.prevMargin)){var p=dd(e),d={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},f=td(td({},ud(t,n,c)),{},{updateId:t.updateId+1}),m=td(td(td({},p),d),f);return td(td(td({},m),h(td({props:e},m),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(!Fo(i,t.prevChildren)){var y=ei()(n)?t.updateId+1:t.updateId;return td(td({updateId:y},h(td(td({props:e},t),{},{updateId:y}),t)),{},{prevChildren:i})}return null})),rd(t,"renderActiveDot",(function(e,t){var r;return r=(0,d.isValidElement)(e)?(0,d.cloneElement)(e,t):ri()(e)?e(t):f().createElement(Cu,t),f().createElement(Ho,{className:"recharts-active-dot",key:t.key},r)})),t},md=["type","layout","connectNulls","ref"];function yd(e){return yd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yd(e)}function vd(){return vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vd.apply(this,arguments)}function gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gd(Object(r),!0).forEach((function(t){Ed(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xd(e){return function(e){if(Array.isArray(e))return wd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return wd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wd(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Od(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ad(n.key),n)}}function kd(e,t){return kd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kd(e,t)}function jd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sd(e){return Sd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sd(e)}function Ed(e,t,r){return(t=Ad(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ad(e){var t=function(e,t){if("object"!==yd(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==yd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yd(t)?t:String(t)}var Pd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kd(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Sd(i);if(o){var r=Sd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===yd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jd(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ed(jd(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0,totalLength:0}),Ed(jd(e),"generateSimpleStrokeDasharray",(function(e,t){return"".concat(t,"px ").concat(e-t,"px")})),Ed(jd(e),"getStrokeDasharray",(function(t,r,n){var i=n.reduce((function(e,t){return e+t}));if(!i)return e.generateSimpleStrokeDasharray(r,t);for(var o=Math.floor(t/i),a=t%i,l=r-t,s=[],u=0,p=0;u<n.length;p+=n[u],++u)if(p+n[u]>a){s=[].concat(xd(n.slice(0,u)),[a-p]);break}var d=s.length%2==0?[0,l]:[l];return[].concat(xd(c.repeat(n,o)),xd(s),d).map((function(e){return"".concat(e,"px")})).join(", ")})),Ed(jd(e),"id",zi("recharts-line-")),Ed(jd(e),"pathRef",(function(t){e.mainCurve=t})),Ed(jd(e),"handleAnimationEnd",(function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()})),Ed(jd(e),"handleAnimationStart",(function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(xd(e),[0]):e,n=[],i=0;i<t;++i)n=[].concat(xd(n),xd(r));return n}},{key:"renderDotItem",value:function(e,t){var r;if(f().isValidElement(e))r=f().cloneElement(e,t);else if(ri()(e))r=e(t);else{var n=yi()("recharts-line-dot",e?e.className:"");r=f().createElement(Cu,vd({},t,{className:n}))}return r}}],(r=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.points,i=r.xAxis,o=r.yAxis,a=r.layout,c=No(r.children,Ko);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:Wa(e.payload,t)}},s={clipPath:e?"url(#clipPath-".concat(t,")"):null};return f().createElement(Ho,s,c.map((function(e){return f().cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,dataPointFormatter:l})})))}},{key:"renderDots",value:function(e,t,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,i=n.dot,o=n.points,a=n.dataKey,l=zo(this.props),s=zo(i,!0),u=o.map((function(e,t){var r=bd(bd(bd({key:"dot-".concat(t),r:3},l),s),{},{value:e.value,dataKey:a,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(i,r)})),p={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return f().createElement(Ho,vd({className:"recharts-line-dots",key:"dots"},p),u)}},{key:"renderCurveStatically",value:function(e,t,r,n){var i=this.props,o=i.type,a=i.layout,c=i.connectNulls,l=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,md)),s=bd(bd(bd({},zo(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},n),{},{type:o,layout:a,connectNulls:c});return f().createElement(Ou,vd({},s,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.strokeDasharray,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=n.animateNewValues,d=n.width,h=n.height,m=this.state,y=m.prevPoints,v=m.totalLength;return f().createElement(dc(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"line-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(y){var c=y.length/i.length,l=i.map((function(e,t){var r=Math.floor(t*c);if(y[r]){var n=y[r],i=qi(n.x,e.x),o=qi(n.y,e.y);return bd(bd({},e),{},{x:i(a),y:o(a)})}if(p){var l=qi(2*d,e.x),s=qi(h/2,e.y);return bd(bd({},e),{},{x:l(a),y:s(a)})}return bd(bd({},e),{},{x:e.x,y:e.y})}));return r.renderCurveStatically(l,e,t)}var s,u=qi(0,v)(a);if(o){var f="".concat(o).split(/[,\s]+/gim).map((function(e){return parseFloat(e)}));s=r.getStrokeDasharray(u,v,f)}else s=r.generateSimpleStrokeDasharray(v,u);return r.renderCurveStatically(i,e,t,{strokeDasharray:s})}))}},{key:"renderCurve",value:function(e,t){var r=this.props,n=r.points,i=r.isAnimationActive,o=this.state,a=o.prevPoints,c=o.totalLength;return i&&n&&n.length&&(!a&&c>0||!po()(a,n))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(n,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.xAxis,c=t.yAxis,l=t.top,s=t.left,u=t.width,p=t.height,d=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=yi()("recharts-line",o),g=a&&a.allowDataOverflow,b=c&&c.allowDataOverflow,x=g||b,w=ei()(h)?this.id:h,O=null!==(e=zo(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,j=void 0===k?3:k,S=O.strokeWidth,E=void 0===S?2:S,A=(Lo(n)?n:{}).clipDot,P=void 0===A||A,T=2*j+E;return f().createElement(Ho,{className:v},g||b?f().createElement("defs",null,f().createElement("clipPath",{id:"clipPath-".concat(w)},f().createElement("rect",{x:g?s:s-u/2,y:b?l:l-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&f().createElement("clipPath",{id:"clipPath-dots-".concat(w)},f().createElement("rect",{x:s-T/2,y:l-T/2,width:u+T,height:p+T}))):null,!y&&this.renderCurve(x,w),this.renderErrorBar(x,w),(y||n)&&this.renderDots(x,P,w),(!d||m)&&ul.renderCallByParent(this.props,i))}}])&&Od(t.prototype,r),n&&Od(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);Ed(Pd,"displayName","Line"),Ed(Pd,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Ui.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),Ed(Pd,"getComposedData",(function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,a=e.dataKey,c=e.bandSize,l=e.displayedData,s=e.offset,u=t.layout;return bd({points:l.map((function(e,t){var l=Wa(e,a);return"horizontal"===u?{x:rc({axis:r,ticks:i,bandSize:c,entry:e,index:t}),y:ei()(l)?null:n.scale(l),value:l,payload:e}:{x:ei()(l)?null:r.scale(l),y:rc({axis:n,ticks:o,bandSize:c,entry:e,index:t}),value:l,payload:e}})),layout:u},s)}));var Td=function(){return null};Td.displayName="XAxis",Td.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0};var Cd=function(){return null};Cd.displayName="YAxis",Cd.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1};var Id,Dd=hd({chartName:"LineChart",GraphicalChild:Pd,axisComponents:[{axisType:"xAxis",AxisComp:Td},{axisType:"yAxis",AxisComp:Cd}],formatAxisMap:Ss}),Md=hd({chartName:"BarChart",GraphicalChild:gs,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Td},{axisType:"yAxis",AxisComp:Cd}],formatAxisMap:Ss}),Nd=["layout","type","stroke","connectNulls","isRange","ref"];function Rd(e){return Rd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rd(e)}function _d(){return _d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_d.apply(this,arguments)}function Bd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ld(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bd(Object(r),!0).forEach((function(t){Wd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ud(n.key),n)}}function Fd(e,t){return Fd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fd(e,t)}function $d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qd(e){return qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qd(e)}function Wd(e,t,r){return(t=Ud(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ud(e){var t=function(e,t){if("object"!==Rd(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Rd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Rd(t)?t:String(t)}var Hd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fd(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=qd(i);if(o){var r=qd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Rd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $d(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Wd($d(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0}),Wd($d(e),"id",zi("recharts-area-")),Wd($d(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),ri()(t)&&t()})),Wd($d(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),ri()(t)&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],(r=[{key:"renderDots",value:function(e,t,r){var n=this.props.isAnimationActive,i=this.state.isAnimationFinished;if(n&&!i)return null;var o=this.props,a=o.dot,l=o.points,s=o.dataKey,u=zo(this.props),p=zo(a,!0),d=l.map((function(e,t){var r=Ld(Ld(Ld({key:"dot-".concat(t),r:3},u),p),{},{dataKey:s,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return c.renderDotItem(a,r)})),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return f().createElement(Ho,_d({className:"recharts-area-dots"},h),d)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].x,a=n[n.length-1].x,c=e*Math.abs(o-a),l=no()(n.map((function(e){return e.y||0})));return _i(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(no()(r.map((function(e){return e.y||0}))),l)),_i(l)?f().createElement("rect",{x:o<a?o:o-c,y:0,width:c,height:Math.floor(l+(i?parseInt("".concat(i),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].y,a=n[n.length-1].y,c=e*Math.abs(o-a),l=no()(n.map((function(e){return e.x||0})));return _i(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(no()(r.map((function(e){return e.x||0}))),l)),_i(l)?f().createElement("rect",{x:0,y:o<a?o:o-c,width:l+(i?parseInt("".concat(i),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,r,n){var i=this.props,o=i.layout,a=i.type,c=i.stroke,l=i.connectNulls,s=i.isRange,u=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,Nd));return f().createElement(Ho,{clipPath:r?"url(#clipPath-".concat(n,")"):null},f().createElement(Ou,_d({},zo(u,!0),{points:e,connectNulls:l,type:a,baseLine:t,layout:o,stroke:"none",className:"recharts-area-area"})),"none"!==c&&f().createElement(Ou,_d({},zo(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:e})),"none"!==c&&s&&f().createElement(Ou,_d({},zo(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.baseLine,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=this.state,d=p.prevPoints,h=p.prevBaseLine;return f().createElement(dc(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"area-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(d){var c,l=d.length/i.length,s=i.map((function(e,t){var r=Math.floor(t*l);if(d[r]){var n=d[r],i=qi(n.x,e.x),o=qi(n.y,e.y);return Ld(Ld({},e),{},{x:i(a),y:o(a)})}return e}));return c=_i(o)&&"number"==typeof o?qi(h,o)(a):ei()(o)||Ii()(o)?qi(h,0)(a):o.map((function(e,t){var r=Math.floor(t*l);if(h[r]){var n=h[r],i=qi(n.x,e.x),o=qi(n.y,e.y);return Ld(Ld({},e),{},{x:i(a),y:o(a)})}return e})),r.renderAreaStatically(s,c,e,t)}return f().createElement(Ho,null,f().createElement("defs",null,f().createElement("clipPath",{id:"animationClipPath-".concat(t)},r.renderClipRect(a))),f().createElement(Ho,{clipPath:"url(#animationClipPath-".concat(t,")")},r.renderAreaStatically(i,o,e,t)))}))}},{key:"renderArea",value:function(e,t){var r=this.props,n=r.points,i=r.baseLine,o=r.isAnimationActive,a=this.state,c=a.prevPoints,l=a.prevBaseLine,s=a.totalLength;return o&&n&&n.length&&(!c&&s>0||!po()(c,n)||!po()(l,i))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(n,i,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.top,c=t.left,l=t.xAxis,s=t.yAxis,u=t.width,p=t.height,d=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=yi()("recharts-area",o),g=l&&l.allowDataOverflow,b=s&&s.allowDataOverflow,x=g||b,w=ei()(h)?this.id:h,O=null!==(e=zo(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,j=void 0===k?3:k,S=O.strokeWidth,E=void 0===S?2:S,A=(Lo(n)?n:{}).clipDot,P=void 0===A||A,T=2*j+E;return f().createElement(Ho,{className:v},g||b?f().createElement("defs",null,f().createElement("clipPath",{id:"clipPath-".concat(w)},f().createElement("rect",{x:g?c:c-u/2,y:b?a:a-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&f().createElement("clipPath",{id:"clipPath-dots-".concat(w)},f().createElement("rect",{x:c-T/2,y:a-T/2,width:u+T,height:p+T}))):null,y?null:this.renderArea(x,w),(n||y)&&this.renderDots(x,P,w),(!d||m)&&ul.renderCallByParent(this.props,i))}}])&&zd(t.prototype,r),n&&zd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(d.PureComponent);Id=Hd,Wd(Hd,"displayName","Area"),Wd(Hd,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Ui.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),Wd(Hd,"getBaseValue",(function(e,t,r,n){var i=e.layout,o=e.baseValue,a=t.props.baseValue,c=null!=a?a:o;if(_i(c)&&"number"==typeof c)return c;var l="horizontal"===i?n:r,s=l.scale.domain();if("number"===l.type){var u=Math.max(s[0],s[1]),p=Math.min(s[0],s[1]);return"dataMin"===c?p:"dataMax"===c||u<0?u:Math.max(Math.min(s[0],s[1]),0)}return"dataMin"===c?s[0]:"dataMax"===c?s[1]:s[0]})),Wd(Hd,"getComposedData",(function(e){var t,r=e.props,n=e.item,i=e.xAxis,o=e.yAxis,a=e.xAxisTicks,c=e.yAxisTicks,l=e.bandSize,s=e.dataKey,u=e.stackedData,p=e.dataStartIndex,d=e.displayedData,f=e.offset,h=r.layout,m=u&&u.length,y=Id.getBaseValue(r,n,i,o),v="horizontal"===h,g=!1,b=d.map((function(e,t){var r;m?r=u[p+t]:(r=Wa(e,s),Array.isArray(r)?g=!0:r=[y,r]);var n=null==r[1]||m&&null==Wa(e,s);return v?{x:rc({axis:i,ticks:a,bandSize:l,entry:e,index:t}),y:n?null:o.scale(r[1]),value:r,payload:e}:{x:n?null:i.scale(r[1]),y:rc({axis:o,ticks:c,bandSize:l,entry:e,index:t}),value:r,payload:e}}));return t=m||g?b.map((function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?o.scale(t):null}:{x:null!=t?i.scale(t):null,y:e.y}})):v?o.scale(y):i.scale(y),Ld({points:b,baseLine:t,layout:h,isRange:g},f)})),Wd(Hd,"renderDotItem",(function(e,t){return f().isValidElement(e)?f().cloneElement(e,t):ri()(e)?e(t):f().createElement(Cu,_d({},t,{className:"recharts-area-dot"}))}));var Gd=hd({chartName:"AreaChart",GraphicalChild:Hd,axisComponents:[{axisType:"xAxis",AxisComp:Td},{axisType:"yAxis",AxisComp:Cd}],formatAxisMap:Ss});function Xd(e){return Xd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(e)}function Vd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vd(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Xd(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Xd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Xd(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Zd=(0,d.forwardRef)((function(e,t){var r=e.aspect,n=e.initialDimension,i=void 0===n?{width:-1,height:-1}:n,o=e.width,a=void 0===o?"100%":o,c=e.height,l=void 0===c?"100%":c,s=e.minWidth,u=void 0===s?0:s,p=e.minHeight,h=e.maxHeight,m=e.children,y=e.debounce,v=void 0===y?0:y,g=e.id,b=e.className,x=e.onResize,w=e.style,O=void 0===w?{}:w,k=(0,d.useRef)(null),j=(0,d.useRef)();j.current=x,(0,d.useImperativeHandle)(t,(function(){return k}));var S,E,A=(S=(0,d.useState)({containerWidth:i.width,containerHeight:i.height}),E=2,function(e){if(Array.isArray(e))return e}(S)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(S,E)||function(e,t){if(e){if("string"==typeof e)return Yd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yd(e,t):void 0}}(S,E)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),P=A[0],T=A[1],C=(0,d.useCallback)((function(e,t){T((function(r){var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}}))}),[]);(0,d.useEffect)((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,i=r.height;C(n,i),null===(t=j.current)||void 0===t||t.call(j,n,i)};v>0&&(e=ui()(e,v,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=k.current.getBoundingClientRect(),n=r.width,i=r.height;return C(n,i),t.observe(k.current),function(){t.disconnect()}}),[C,v]);var I=(0,d.useMemo)((function(){var e=P.containerWidth,t=P.containerHeight;if(e<0||t<0)return null;Yo(Ri(a)||Ri(l),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",a,l),Yo(!r||r>0,"The aspect(%s) must be greater than zero.",r);var n=Ri(a)?e:a,i=Ri(l)?t:l;r&&r>0&&(n?i=n/r:i&&(n=i*r),h&&i>h&&(i=h)),Yo(n>0||i>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,i,a,l,u,p,r);var o=!Array.isArray(m)&&(0,yo.isElement)(m)&&Co(m.type).endsWith("Chart");return f().Children.map(m,(function(e){return(0,yo.isElement)(e)?(0,d.cloneElement)(e,Kd({width:n,height:i},o?{style:Kd({height:"100%",width:"100%",maxHeight:i,maxWidth:n},e.props.style)}:{})):e}))}),[r,m,l,h,p,u,P,a]);return f().createElement("div",{id:g?"".concat(g):void 0,className:yi()("recharts-responsive-container",b),style:Kd(Kd({},O),{},{width:a,height:l,minWidth:u,minHeight:p,maxHeight:h}),ref:k},I)})),Qd=function(){return Qd=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Qd.apply(this,arguments)},Jd={line:Dd,bar:Md,area:Gd};function ef(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function tf(t){var r=(0,d.useState)(t.defaultChartType||"line"),n=r[0],i=r[1],o=(0,d.useState)(null),a=o[0],c=o[1],l=(0,d.useState)(t.timeSeries),s=l[0],u=l[1],p=kn()(),f=s.length>0?Object.keys(s[0]):[],h=f[0],m=f.slice(1),y=(0,d.useState)(ef(m)),v=y[0],g=y[1];(0,d.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],t.timeSeries,!0);t.updatedData.forEach((function(t){e=e.concat(t.timeSeries),u(e)}))}}),[t.timeSeries,t.updatedData]);var b=Jd[n];function x(e){a?c(null):e&&c(e.currentTarget)}function O(e,r){return v[e]?t.chartColors[r%t.chartColors.length]:"grey"}function k(e){return v[e]?"none":"line-through"}if(0===s.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var j,S,E,A,P=t.timeSeries[t.timeSeries.length-1],T=(j=t.timeSeries[0][h],S=P[h],E=new Date(j),A=new Date(S),Math.round(Math.abs((A.getTime()-E.getTime())/864e5)));return(0,e.jsxs)(tn(),{className:"rustic-recharts-time-series",children:[!t.disableChartTypeToggle&&(0,e.jsxs)(Qn(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,e.jsx)(K(),{"aria-label":"chart options","aria-expanded":Boolean(a),"aria-haspopup":"true",onClick:x,color:"primary",children:(0,e.jsx)(se,{name:"more_vert"})}),(0,e.jsxs)(Hr(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,open:Boolean(a),onClose:function(e){return x(e)},children:[(0,e.jsx)(w(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(Jd).map((function(t){return(0,e.jsxs)(J(),{value:t,selected:t===n,onClick:function(){return function(e){i(e),x()}(t)},children:[t.charAt(0).toUpperCase()+t.slice(1)," ","Chart"]},t)}))]})]}),(0,e.jsxs)(tn(),{children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",className:"rustic-recharts-time-series-description",children:t.description}),(0,e.jsx)(Zd,{aspect:t.aspectRatio,width:t.width,maxHeight:t.maxHeight,minWidth:t.minChartWidth,children:(0,e.jsxs)(b,{data:s,margin:t.chartContainerMargin,children:[(0,e.jsx)(Td,{dataKey:h,tickFormatter:function(e){return N(e,T)},stroke:p.palette.text.primary}),(0,e.jsx)(Cd,{domain:["auto","auto"],width:t.yAxisLabelWidth,tickFormatter:t.yAxisTickFormatter,stroke:p.palette.text.primary}),(0,e.jsx)(fu,{labelFormatter:function(e){return[N(e,T)]},formatter:t.tooltipFormatter,contentStyle:{color:p.palette.common.black}}),(0,e.jsx)(Da,{content:function(){return(0,e.jsx)(tn(),{className:"rustic-recharts-time-series-legend",children:m.map((function(t,r){return(0,e.jsxs)(tn(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=v[e]&&!m.find((function(t){return t!==e&&v[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(v)){for(var n={},i=0,o=m;i<o.length;i++){var a=o[i],c=a===e;n[a]=c}g(n)}else g(r?ef(m):Qd(Qd({},v),((t={})[e]=!v[e],t)))}(t)},sx:{color:O(t,r)},children:[(0,e.jsx)(se,{name:"crop_16_9"}),(0,e.jsx)(w(),{variant:"body2",display:"inline",sx:{textDecorationLine:k(t)},children:t})]},r)}))})}}),m.map((function(r,i){return v[r]?function(r,i){var o=i%t.chartColors.length,a=v[r]?t.chartColors[o]:"transparent",c={onClick:t.onClick,cursor:"pointer"};switch(n){case"line":return(0,e.jsx)(Pd,{type:"monotone",isAnimationActive:!1,dataKey:r,name:r,dot:!1,stroke:a,activeDot:t.onClick&&c},r);case"bar":return(0,e.jsx)(gs,{dataKey:r,fill:a,onClick:t.onClick&&c.onClick,cursor:t.onClick&&c.cursor},r);case"area":return(0,e.jsxs)(d.Fragment,{children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"color".concat(r),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"5%",stopColor:a,stopOpacity:.8}),(0,e.jsx)("stop",{offset:"95%",stopColor:a,stopOpacity:0})]})}),(0,e.jsx)(Hd,{isAnimationActive:!1,dataKey:r,type:"monotone",stroke:a,fillOpacity:1,fill:"url(#color".concat(r,")"),activeDot:t.onClick&&c},r)]},r)}}(r,i):null})),t.referenceLineYAxis&&t.referenceLineYAxis.map((function(r,n){return(0,e.jsx)(kp,{y:r,label:t.referenceLineLabel&&t.referenceLineLabel[n],stroke:t.referenceLineColor&&t.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:t.referenceLineStrokeWidth&&t.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}tf.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const rf=tf,nf=require("mermaid");var of=i.n(nf),af=function(){return af=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},af.apply(this,arguments)};const cf=function(t){var r=(0,d.useRef)(null),n=(0,d.useState)(),i=n[0],o=n[1],a=kn()(),c=X();return(0,d.useEffect)((function(){var e="dark"===a.palette.mode?"dark":"neutral",n=a.typography.fontFamily;r.current&&(of().initialize(af({theme:e,themeVariables:{fontFamily:n}},t.config)),of().render("mermaid-svg-".concat(c),t.diagram,r.current).then((function(e){r.current&&(r.current.innerHTML=e.svg),o("")})).catch((function(){var e;null===(e=r.current)||void 0===e||e.replaceChildren(),o("Failed to render the diagram.")})))})),(0,e.jsxs)(Zr(),{className:"rustic-mermaid-container",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{className:"rustic-mermaid",ref:r}),i&&(0,e.jsx)(w(),{variant:"body2",children:i})]})},lf=(require("@finos/perspective-viewer"),require("@finos/perspective-viewer-datagrid"),require("@finos/perspective-viewer-d3fc"),require("@finos/perspective-viewer/dist/css/pro.css"),require("@finos/perspective-viewer/dist/css/pro-dark.css"),require("@finos/perspective"));var sf=i.n(lf),uf=function(){return uf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},uf.apply(this,arguments)};function pf(e){return e?e.reduce((function(e,t){var r=t.dataKey,n=t.label;return e[r]=n||r,e}),{}):{}}const df=function(t){if(0===t.data.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available."});var r=(0,d.useRef)(null),n=kn()(),i=(0,d.useState)(!1),o=i[0],a=i[1],c=n.palette.mode,l="dark"===c?"Pro Dark":"Pro Light",s=pf(t.headers),u="\n /* General Button Styles */\n button, .button:hover, #editor-container, .editable, #settings_button {\n border-radius: 16px !important;\n color: ".concat(n.palette.text.primary," !important;\n /* TODO: add background color after updating the theme */\n }\n \n #settings_button {\n border: 1px solid ").concat(n.palette.primary.light," !important;\n }\n \n /* Hide border for aggregate Selector */\n .aggregate-selector:hover {\n border: none !important;\n }\n \n /* Input and Select Elements */\n input, select, .noselect, #add-expression, .dropdown-width-container, \n .pivot-column-border, .pivot-column, .column-selector-column-border {\n border-radius: 8px !important;\n }\n \n /* Change background color */\n #settings_panel, #column_settings_sidebar {\n background: ").concat("dark"===c?"dark":"white"," !important;\n background-image: none !important;\n }\n \n /* Expression Edit Button */\n .expression-edit-button {\n display: none;\n }\n \n /* Add padding to expression input */\n #editor-container, .editable {\n padding: 8px !important;\n }\n \n /* Change Button Font Size */\n .button select, .button {\n font-size: 12px !important;\n }\n \n /* Button and Icon Colors */\n span.button {\n color: ").concat(n.palette.primary.main," !important;\n }\n \n span.button:hover:before {\n background-color: ").concat(n.palette.primary.main," !important;\n }\n \n .button select:hover, .button:hover, .psp-expression-editor__button:hover, \n .sidebar_close_button_inner:hover {\n background-color: ").concat(n.palette.primary.light," !important;\n }\n \n /* Enable Scrolling */\n #plugin_selector_container.open, #status_bar, #menu-bar, #app_panel {\n overflow: scroll !important;\n }\n \n /* Hide unused buttons */\n #debug_open_button.sidebar_close_button, .reset-default-style-disabled, \n .expression-edit-button, #theme, #status, #status_bar .input-sizer {\n display: none !important;\n }\n ");var p,f,h,m,y,v,g,b,x,O=t.config&&(f=(p=t.config).groupBy,h=p.splitBy,m=p.aggregates,y=p.sort,v=p.filter,g=p.columns,b=null==y?void 0:y.map((function(e){return[s[e[0]]||e[0],e[1]]})),x=m&&Object.fromEntries(Object.entries(m).map((function(e){var t=e[0],r=e[1];return[s[t]||t,r]}))),{group_by:null==f?void 0:f.map((function(e){return s[e]||e})),split_by:null==h?void 0:h.map((function(e){return s[e]||e})),aggregates:x,sort:b,filter:v&&function(e){return e.map((function(e){return[s[e[0]]||e[0],e[1],e[e.length-1]]}))}(v),columns:null==g?void 0:g.map((function(e){return s[e]||e}))});return(0,d.useEffect)((function(){sf().worker().table(function(e,t){var r=pf(t);return e.map((function(e){for(var t={},n=0,i=Object.entries(e);n<i.length;n++){var o=i[n],a=o[0],c=o[1];t[r[a]||a]=[c]}return t}))}(t.data,t.headers)).then((function(e){var n=r.current;n&&n.load(e).then((function(){if(n.restore(uf(uf({},O),{theme:l,title:t.title,settings:!1})),n.shadowRoot){var e=new CSSStyleSheet;e.replaceSync(u),n.shadowRoot.adoptedStyleSheets.push(e)}})).catch((function(){a(!0)}))})).catch((function(){a(!0)}))}),[t.data,l]),o?(0,e.jsx)(w(),{variant:"body2",children:"Failed to create table from data."}):(0,e.jsxs)(wn(),{direction:"column",className:"rustic-perspective-viz",children:[t.title&&(0,e.jsx)(w(),{variant:"h6",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"body1",children:t.description}),(0,e.jsx)("perspective-viewer",{ref:r,style:{fontFamily:n.typography.fontFamily}})]})},ff=require("react-dom/server"),hf=require("vega-embed");var mf=i.n(hf),yf=function(){return yf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},yf.apply(this,arguments)};function vf(t){var r=(0,d.useRef)(null),n=(0,d.useState)(!1),i=n[0],o=n[1],a=kn()(),c="dark"===a.palette.mode,l=a.typography.fontFamily,s={backgroundColor:a.palette.primary.main,color:a.palette.background.paper,borderRadius:a.shape.borderRadius+"px",padding:"4px 8px",fontSize:a.typography.caption.fontSize,fontFamily:l,fontWeight:a.typography.caption.fontWeight},u={formatTooltip:function(t,r){return(0,ff.renderToStaticMarkup)((0,e.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:s,children:Object.entries(t).map((function(t){var n=t[0],i=t[1];return(0,e.jsxs)("div",{children:[(0,e.jsxs)("strong",{children:[r(n),":"]})," ",r(i)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},p=[{label:"Save as SVG"},{label:"Save as PNG"}];function f(){var e,n,i,a;if(r.current&&t.spec){var s=yf(yf({config:{font:l}},t.options),{theme:c?null===(e=t.theme)||void 0===e?void 0:e.dark:null===(n=t.theme)||void 0===n?void 0:n.light,tooltip:u,actions:!1});(null===(a=null===(i=t.options)||void 0===i?void 0:i.config)||void 0===a?void 0:a.font)||(s.config.font=l),mf()(r.current,t.spec,s).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,i){var o="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,o).then((function(e){p[i].href=e,p[i].downloadFileName="".concat(r,".").concat(n)}))})),o(!1)})).catch((function(){o(!0)}))}}return(0,d.useEffect)((function(){function e(){f()}return f(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[t.spec,c]),i?(0,e.jsx)(w(),{variant:"body2",children:"Failed to load the chart."}):(0,e.jsxs)(wn(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,e.jsx)(tn(),{justifyContent:"end",display:"flex",children:(0,e.jsx)(Xr,{menuItems:p,ariaLabel:"Download options"})}),t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{ref:r,className:"rustic-vega-lite"})]})}const gf=vf;function bf(t){var r=(0,d.useState)(t.units),n=r[0],i=r[1];function o(e){return"metric"===t.units&&"imperial"===n?Math.round(1.8*e+32):"imperial"===t.units&&"metric"===n?Math.round(e*(5/9)-32):Math.round(e)}var a=new Date(1e3*t.weather[0].timestamp),c=B(t.weather[0].timestamp).shortName,s=a.getDate(),u=a.getFullYear().toString().slice(2),p="".concat(c," ").concat(s,"/").concat(u," TODAY"),f="HIGH: ".concat(o(t.weather[0].temp.high)," / LOW: ").concat(o(t.weather[0].temp.high)),h=t.weather.map((function(t,r){if(0!==r)return(0,e.jsxs)(we(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,e.jsx)(w(),{variant:"h5",component:"span",color:"text.secondary","aria-label":B(t.timestamp).fullName,children:B(t.timestamp).shortName}),(0,e.jsx)("img",{src:t.weatherIcon.icon,alt:t.weatherIcon.description}),(0,e.jsxs)(w(),{variant:"body2",color:"text.secondary",children:["High: ",o(t.temp.high),"°"]}),(0,e.jsxs)(w(),{variant:"body2",color:"text.secondary",children:["Low: ",o(t.temp.low),"°"]})]},r)}));return(0,e.jsxs)(we(),{variant:"outlined",className:"rustic-weather",children:[(0,e.jsx)(Xr,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:function(){return i("metric")}},{label:"Fahrenheit",endDecorator:"°F",onClick:function(){return i("imperial")}}]}),(0,e.jsxs)(Zr(),{alignItems:"center",children:[(0,e.jsx)(w(),{variant:"h4",component:"span",children:t.location}),(0,e.jsxs)(Zr(),{direction:"row",alignItems:"center",spacing:1,className:"rustic-current-weather-description",children:[(0,e.jsx)("img",{src:t.weather[0].weatherIcon.icon,alt:""}),(0,e.jsx)(w(),{variant:"body2",children:t.weather[0].weatherIcon.description})]}),t.weather[0].temp.current&&(0,e.jsxs)(w(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[o(t.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(n)]}),(0,e.jsxs)(Zr(),{direction:"row",spacing:2,children:[(0,e.jsx)(w(),{variant:"overline",children:p}),(0,e.jsx)(w(),{variant:"overline",children:f})]})]}),(0,e.jsx)(l(),{className:"rustic-daily-weather-container",children:h}),t.weatherProvider&&(0,e.jsxs)(Zr(),{alignItems:"center",direction:"row",spacing:1,alignSelf:"center",className:"rustic-weather-attribution",children:[(0,e.jsx)(se,{name:"cloud"}),(0,e.jsx)(w(),{variant:"body2",children:"Weather data provided by ".concat(t.weatherProvider)})]})]})}vf.defaultProps={theme:{dark:"dark"}};const xf=require("@mui/utils");var wf="#000000",Of="#FFFFFF",kf="#FF6928",jf="#E54500",Sf="#5F5C5A",Ef="#E7E7E7",Af="#CFCFCF",Pf="#A7A19E",Tf="#D6D0D0",Cf="#D0C4BE",If=(0,s.createTheme)({shape:{borderRadius:16},typography:{fontFamily:"Inter",h1:{fontStyle:"normal",fontWeight:300,fontSize:"94px",lineHeight:1.167,letterSpacing:"-1.5px"},h2:{fontStyle:"normal",fontWeight:300,fontSize:"59px",letterSpacing:"-0.5px",lineHeight:1.2},h3:{fontStyle:"normal",fontWeight:400,fontSize:"47px",letterSpacing:"0px",lineHeight:1.167},h4:{fontStyle:"normal",fontWeight:400,fontSize:"33px",letterSpacing:"0.25px",lineHeight:1.235},h5:{fontStyle:"normal",fontWeight:400,fontSize:"24px",letterSpacing:"0px",lineHeight:1.334},h6:{fontStyle:"normal",fontWeight:500,fontSize:"20px",letterSpacing:"0.15px",lineHeight:1.6},body1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.5px",lineHeight:1.5},body2:{fontStyle:"normal",fontWeight:400,fontSize:"14px",letterSpacing:"0.25px",lineHeight:1.43},subtitle1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.15px",lineHeight:1.75},subtitle2:{fontStyle:"normal",fontWeight:500,fontSize:"14px",letterSpacing:"0.1px",lineHeight:1.57},overline:{fontStyle:"normal",fontWeight:400,fontSize:"10px",letterSpacing:"1.5px",lineHeight:1.5,textTransform:"uppercase"},caption:{fontStyle:"normal",fontWeight:400,fontSize:"12px",letterSpacing:"0.4px",lineHeight:1.66},button:{textTransform:"capitalize"}},palette:{common:{black:wf,white:Of},error:{main:"#F82A43"},warning:{main:"#FFB800"},info:{main:"#0094FF"},success:{main:"#35A700"}},shadows:function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],(0,s.createTheme)({}).shadows.map((function(e,t){return 1===t?"0 4px 5px rgba(0, 0, 0, 0.05)":2===t?"0 4px 10px rgba(0, 0, 0, 0.1)":3===t?"0 4px 15px rgba(0, 0, 0, 0.15)":"none"})),!0),components:{MuiTableCell:{styleOverrides:{head:{backgroundColor:Ef},root:{borderBottom:"1px solid ".concat(Cf),padding:"8px 16px"}}},MuiTableSortLabel:{styleOverrides:{root:{"&.Mui-active":{color:wf,"& .MuiTableSortLabel-icon":{color:wf}}}}},MuiPopover:{styleOverrides:{paper:{border:"1px solid ".concat(Cf),backgroundImage:"none"}}}}}),Df="#3D3834",Mf=(0,s.createTheme)((0,xf.deepmerge)(If,{palette:{mode:"light",divider:Cf,text:{primary:"#1E0C04",secondary:"#4E443F",disabled:"#9C9795"},primary:{main:Df,dark:"#2D2825",light:"#716865"},secondary:{main:kf,light:"#FFDBCC",dark:jf},background:{default:"#F7F6F5",paper:Of},action:{active:Sf,hover:"#EFEAEA",selected:Tf,disabledBackground:Af,focus:Ef,disabled:Pf}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:Df,color:Of}}}}})),Nf="#2F2F2F",Rf="#FFFCFB",_f=(0,s.createTheme)((0,xf.deepmerge)(If,{palette:{mode:"dark",divider:Cf,primary:{main:Rf,dark:jf,light:"#FFDBCC"},secondary:{main:kf,light:"#FFA983",dark:jf},background:{default:"#040404",paper:Nf},text:{primary:Of,secondary:"#EBEBEB",disabled:"#C1C1C1"},action:{active:Sf,hover:"#9A9A9A",selected:Tf,focus:Ef,disabledBackground:Af,disabled:Pf}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:Rf,color:Nf}}}}}));Mf=(0,s.responsiveFontSizes)(Mf),_f=(0,s.responsiveFontSizes)(_f)})(),o})()));