backflow-ui-renderer 0.1.32 → 0.1.33

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.cjs CHANGED
@@ -10,7 +10,7 @@
10
10
  top: ${c}px !important;
11
11
  left: ${h}px !important;
12
12
  }
13
- `),()=>{document.head.removeChild(u)}},[t]),Ze.jsx(LI,{isPresent:t,childRef:r,sizeRef:i,children:Yn.cloneElement(e,{ref:r})})}const jI=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const l=_b(DI),c=v.useId(),h=v.useCallback(f=>{l.set(f,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),u=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:h,register:f=>(l.set(f,!1),()=>l.delete(f))}),o?[Math.random(),h]:[n,h]);return v.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),Yn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),s==="popLayout"&&(e=Ze.jsx(NI,{isPresent:n,children:e})),Ze.jsx(xp.Provider,{value:u,children:e})};function DI(){return new Map}function DT(e=!0){const t=v.useContext(xp);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=v.useId();v.useEffect(()=>{e&&i(o)},[e]);const s=v.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Qh=e=>e.key||"";function Nx(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Pb=typeof window<"u",BT=Pb?v.useLayoutEffect:v.useEffect,BI=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1})=>{const[l,c]=DT(s),h=v.useMemo(()=>Nx(e),[e]),u=s&&!l?[]:h.map(Qh),f=v.useRef(!0),m=v.useRef(h),y=_b(()=>new Map),[x,p]=v.useState(h),[b,P]=v.useState(h);BT(()=>{f.current=!1,m.current=h;for(let E=0;E<b.length;E++){const w=Qh(b[E]);u.includes(w)?y.delete(w):y.get(w)!==!0&&y.set(w,!1)}},[b,u.length,u.join("-")]);const S=[];if(h!==x){let E=[...h];for(let w=0;w<b.length;w++){const T=b[w],O=Qh(T);u.includes(O)||(E.splice(w,0,T),S.push(T))}o==="wait"&&S.length&&(E=S),P(Nx(E)),p(h);return}process.env.NODE_ENV!=="production"&&o==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=v.useContext(wb);return Ze.jsx(Ze.Fragment,{children:b.map(E=>{const w=Qh(E),T=s&&!l?!1:h===b||u.includes(w),O=()=>{if(y.has(w))y.set(w,!0);else return;let I=!0;y.forEach(N=>{N||(I=!1)}),I&&(A==null||A(),P(m.current),s&&(c==null||c()),r&&r())};return Ze.jsx(jI,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:i,mode:o,onExitComplete:T?void 0:O,children:E},w)})})},or=e=>e;let ec=or,Xo=or;process.env.NODE_ENV!=="production"&&(ec=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Xo=(e,t)=>{if(!e)throw new Error(t)});function Ab(e){let t;return()=>(t===void 0&&(t=e()),t)}const vl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},yi=e=>e*1e3,oo=e=>e/1e3,zI={useManualTiming:!1};function FI(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(h){o.has(h)&&(c.schedule(h),e()),h(s)}const c={schedule:(h,u=!1,f=!1)=>{const y=f&&r?t:n;return u&&o.add(h),y.has(h)||y.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(s=h,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(l),t.clear(),r=!1,i&&(i=!1,c.process(h))}};return c}const tf=["read","resolveKeyframes","update","preRender","render","postRender"],WI=40;function zT(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=tf.reduce((P,S)=>(P[S]=FI(o),P),{}),{read:l,resolveKeyframes:c,update:h,preRender:u,render:f,postRender:m}=s,y=()=>{const P=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(P-i.timestamp,WI),1),i.timestamp=P,i.isProcessing=!0,l.process(i),c.process(i),h.process(i),u.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,i.isProcessing||e(y)};return{schedule:tf.reduce((P,S)=>{const A=s[S];return P[S]=(E,w=!1,T=!1)=>(n||x(),A.schedule(E,w,T)),P},{}),cancel:P=>{for(let S=0;S<tf.length;S++)s[tf[S]].cancel(P)},state:i,steps:s}}const{schedule:He,cancel:Jo,state:Rn,steps:$m}=zT(typeof requestAnimationFrame<"u"?requestAnimationFrame:or,!0),FT=v.createContext({strict:!1}),jx={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},bl={};for(const e in jx)bl[e]={isEnabled:t=>jx[e].some(n=>!!t[n])};function VI(e){for(const t in e)bl[t]={...bl[t],...e[t]}}const UI=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Hf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||UI.has(e)}let WT=e=>!Hf(e);function HI(e){e&&(WT=t=>t.startsWith("on")?!Hf(t):e(t))}try{HI(require("@emotion/is-prop-valid").default)}catch{}function qI(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(WT(i)||n===!0&&Hf(i)||!t&&!Hf(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Dx=new Set;function wp(e,t,n){e||Dx.has(t)||(console.warn(t),Dx.add(t))}function GI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&wp(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const _p=v.createContext({});function Tu(e){return typeof e=="string"||Array.isArray(e)}function Sp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Tb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Eb=["initial",...Tb];function Pp(e){return Sp(e.animate)||Eb.some(t=>Tu(e[t]))}function VT(e){return!!(Pp(e)||e.variants)}function ZI(e,t){if(Pp(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tu(n)?n:void 0,animate:Tu(r)?r:void 0}}return e.inherit!==!1?t:{}}function YI(e){const{initial:t,animate:n}=ZI(e,v.useContext(_p));return v.useMemo(()=>({initial:t,animate:n}),[Bx(t),Bx(n)])}function Bx(e){return Array.isArray(e)?e.join(" "):e}const KI=Symbol.for("motionComponentSymbol");function Xa(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function XI(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Xa(n)&&(n.current=r))},[t])}const Cb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),JI="framerAppearId",UT="data-"+Cb(JI),{schedule:Ob}=zT(queueMicrotask,!1),HT=v.createContext({});function QI(e,t,n,r,i){var o,s;const{visualElement:l}=v.useContext(_p),c=v.useContext(FT),h=v.useContext(xp),u=v.useContext(Sb).reducedMotion,f=v.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:u}));const m=f.current,y=v.useContext(HT);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&tR(f.current,n,i,y);const x=v.useRef(!1);v.useInsertionEffect(()=>{m&&x.current&&m.update(n,h)});const p=n[UT],b=v.useRef(!!p&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,p))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,p)));return BT(()=>{m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),Ob.render(m.render),b.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)===null||P===void 0||P.call(window,p)}),b.current=!1))}),m}function tR(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:l,layoutScroll:c,layoutRoot:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:qT(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||l&&Xa(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:h})}function qT(e){if(e)return e.options.allowProjection!==!1?e.projection:qT(e.parent)}function eR({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var o,s;e&&VI(e);function l(h,u){let f;const m={...v.useContext(Sb),...h,layoutId:nR(h)},{isStatic:y}=m,x=YI(h),p=r(h,y);if(!y&&Pb){rR(m,e);const b=iR(m);f=b.MeasureLayout,x.visualElement=QI(i,p,m,t,b.ProjectionNode)}return Ze.jsxs(_p.Provider,{value:x,children:[f&&x.visualElement?Ze.jsx(f,{visualElement:x.visualElement,...m}):null,n(i,h,XI(p,x.visualElement,u),p,y,x.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(s=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&s!==void 0?s:""})`}`;const c=v.forwardRef(l);return c[KI]=i,c}function nR({layoutId:e}){const t=v.useContext(wb).id;return t&&e!==void 0?t+"-"+e:e}function rR(e,t){const n=v.useContext(FT).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ec(!1,r):Xo(!1,r)}}function iR(e){const{drag:t,layout:n}=bl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const oR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Mb(e){return typeof e!="string"||e.includes("-")?!1:!!(oR.indexOf(e)>-1||/[A-Z]/u.test(e))}function zx(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function kb(e,t,n,r){if(typeof t=="function"){const[i,o]=zx(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=zx(r);t=t(n!==void 0?n:e.custom,i,o)}return t}const ey=e=>Array.isArray(e),sR=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),aR=e=>ey(e)?e[e.length-1]||0:e,Vn=e=>!!(e&&e.getVelocity);function Lf(e){const t=Vn(e)?e.get():e;return sR(t)?t.toValue():t}function lR({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,o){const s={latestValues:cR(r,i,o,e),renderState:t()};return n&&(s.onMount=l=>n({props:r,current:l,...s}),s.onUpdate=l=>n(l)),s}const GT=e=>(t,n)=>{const r=v.useContext(_p),i=v.useContext(xp),o=()=>lR(e,t,r,i);return n?o():_b(o)};function cR(e,t,n,r){const i={},o=r(e,{});for(const m in o)i[m]=Lf(o[m]);let{initial:s,animate:l}=e;const c=Pp(e),h=VT(e);t&&h&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?l:s;if(f&&typeof f!="boolean"&&!Sp(f)){const m=Array.isArray(f)?f:[f];for(let y=0;y<m.length;y++){const x=kb(e,m[y]);if(x){const{transitionEnd:p,transition:b,...P}=x;for(const S in P){let A=P[S];if(Array.isArray(A)){const E=u?A.length-1:0;A=A[E]}A!==null&&(i[S]=A)}for(const S in p)i[S]=p[S]}}}return i}const nc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ba=new Set(nc),ZT=e=>t=>typeof t=="string"&&t.startsWith(e),YT=ZT("--"),uR=ZT("var(--"),$b=e=>uR(e)?hR.test(e.split("/*")[0].trim()):!1,hR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,KT=(e,t)=>t&&typeof e=="number"?t.transform(e):e,uo=(e,t,n)=>n>t?t:n<e?e:n,rc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Eu={...rc,transform:e=>uo(0,1,e)},ef={...rc,default:1},mh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Do=mh("deg"),vi=mh("%"),Ht=mh("px"),fR=mh("vh"),dR=mh("vw"),Fx={...vi,parse:e=>vi.parse(e)/100,transform:e=>vi.transform(e*100)},pR={borderWidth:Ht,borderTopWidth:Ht,borderRightWidth:Ht,borderBottomWidth:Ht,borderLeftWidth:Ht,borderRadius:Ht,radius:Ht,borderTopLeftRadius:Ht,borderTopRightRadius:Ht,borderBottomRightRadius:Ht,borderBottomLeftRadius:Ht,width:Ht,maxWidth:Ht,height:Ht,maxHeight:Ht,top:Ht,right:Ht,bottom:Ht,left:Ht,padding:Ht,paddingTop:Ht,paddingRight:Ht,paddingBottom:Ht,paddingLeft:Ht,margin:Ht,marginTop:Ht,marginRight:Ht,marginBottom:Ht,marginLeft:Ht,backgroundPositionX:Ht,backgroundPositionY:Ht},mR={rotate:Do,rotateX:Do,rotateY:Do,rotateZ:Do,scale:ef,scaleX:ef,scaleY:ef,scaleZ:ef,skew:Do,skewX:Do,skewY:Do,distance:Ht,translateX:Ht,translateY:Ht,translateZ:Ht,x:Ht,y:Ht,z:Ht,perspective:Ht,transformPerspective:Ht,opacity:Eu,originX:Fx,originY:Fx,originZ:Ht},Wx={...rc,transform:Math.round},Ib={...pR,...mR,zIndex:Wx,size:Ht,fillOpacity:Eu,strokeOpacity:Eu,numOctaves:Wx},gR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yR=nc.length;function vR(e,t,n){let r="",i=!0;for(let o=0;o<yR;o++){const s=nc[o],l=e[s];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(s.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const h=KT(l,Ib[s]);if(!c){i=!1;const u=gR[s]||s;r+=`${u}(${h}) `}n&&(t[s]=h)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Rb(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,l=!1;for(const c in t){const h=t[c];if(ba.has(c)){s=!0;continue}else if(YT(c)){i[c]=h;continue}else{const u=KT(h,Ib[c]);c.startsWith("origin")?(l=!0,o[c]=u):r[c]=u}}if(t.transform||(s||n?r.transform=vR(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:h="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${h} ${u}`}}const bR={offset:"stroke-dashoffset",array:"stroke-dasharray"},xR={offset:"strokeDashoffset",array:"strokeDasharray"};function wR(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?bR:xR;e[o.offset]=Ht.transform(-r);const s=Ht.transform(t),l=Ht.transform(n);e[o.array]=`${s} ${l}`}function Vx(e,t,n){return typeof e=="string"?e:Ht.transform(t+n*e)}function _R(e,t,n){const r=Vx(t,e.x,e.width),i=Vx(n,e.y,e.height);return`${r} ${i}`}function Lb(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:l=1,pathOffset:c=0,...h},u,f){if(Rb(e,h,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y,dimensions:x}=e;m.transform&&(x&&(y.transform=m.transform),delete m.transform),x&&(i!==void 0||o!==void 0||y.transform)&&(y.transformOrigin=_R(x,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&wR(m,s,l,c,!1)}const Nb=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),XT=()=>({...Nb(),attrs:{}}),jb=e=>typeof e=="string"&&e.toLowerCase()==="svg";function JT(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const QT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tE(e,t,n,r){JT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(QT.has(i)?i:Cb(i),t.attrs[i])}const qf={};function SR(e){Object.assign(qf,e)}function eE(e,{layout:t,layoutId:n}){return ba.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qf[e]||e==="opacity")}function Db(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(Vn(i[s])||t.style&&Vn(t.style[s])||eE(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function nE(e,t,n){const r=Db(e,t,n);for(const i in e)if(Vn(e[i])||Vn(t[i])){const o=nc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function PR(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Ux=["x","y","width","height","cx","cy","r"],AR={useVisualState:GT({scrapeMotionValuesFromProps:nE,createRenderState:XT,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let o=!!e.drag;if(!o){for(const l in i)if(ba.has(l)){o=!0;break}}if(!o)return;let s=!t;if(t)for(let l=0;l<Ux.length;l++){const c=Ux[l];e[c]!==t[c]&&(s=!0)}s&&He.read(()=>{PR(n,r),He.render(()=>{Lb(r,i,jb(n.tagName),e.transformTemplate),tE(n,r)})})}})},TR={useVisualState:GT({scrapeMotionValuesFromProps:Db,createRenderState:Nb})};function rE(e,t,n){for(const r in t)!Vn(t[r])&&!eE(r,n)&&(e[r]=t[r])}function ER({transformTemplate:e},t){return v.useMemo(()=>{const n=Nb();return Rb(n,t,e),Object.assign({},n.vars,n.style)},[t])}function CR(e,t){const n=e.style||{},r={};return rE(r,n,e),Object.assign(r,ER(e,t)),r}function OR(e,t){const n={},r=CR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function MR(e,t,n,r){const i=v.useMemo(()=>{const o=XT();return Lb(o,t,jb(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};rE(o,e.style,e),i.style={...o,...i.style}}return i}function kR(e=!1){return(n,r,i,{latestValues:o},s)=>{const c=(Mb(n)?MR:OR)(r,o,s,n),h=qI(r,typeof n=="string",e),u=n!==v.Fragment?{...h,...c,ref:i}:{},{children:f}=r,m=v.useMemo(()=>Vn(f)?f.get():f,[f]);return v.createElement(n,{...u,children:m})}}function $R(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...Mb(r)?AR:TR,preloadedFeatures:e,useRender:kR(i),createVisualElement:t,Component:r};return eR(s)}}function iE(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Ap(e,t,n){const r=e.getProps();return kb(r,t,n!==void 0?n:r.custom,e)}const IR=Ab(()=>window.ScrollTimeline!==void 0);class RR{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(IR()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class LR extends RR{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Bb(e,t){return e?e[t]||e.default||e:void 0}const ny=2e4;function oE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ny;)t+=n,r=e.next(t);return t>=ny?1/0:t}function zb(e){return typeof e=="function"}function Hx(e,t){e.timeline=t,e.onfinish=null}const Fb=e=>Array.isArray(e)&&typeof e[0]=="number",NR={linearEasing:void 0};function jR(e,t){const n=Ab(e);return()=>{var r;return(r=NR[t])!==null&&r!==void 0?r:n()}}const Gf=jR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sE=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=e(vl(0,i-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function aE(e){return!!(typeof e=="function"&&Gf()||!e||typeof e=="string"&&(e in ry||Gf())||Fb(e)||Array.isArray(e)&&e.every(aE))}const Qc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ry={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qc([0,.65,.55,1]),circOut:Qc([.55,0,1,.45]),backIn:Qc([.31,.01,.66,-.59]),backOut:Qc([.33,1.53,.69,.99])};function lE(e,t){if(e)return typeof e=="function"&&Gf()?sE(e,t):Fb(e)?Qc(e):Array.isArray(e)?e.map(n=>lE(n,t)||ry.easeOut):ry[e]}const Xr={x:!1,y:!1};function cE(){return Xr.x||Xr.y}function DR(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function uE(e,t){const n=DR(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function qx(e){return t=>{t.pointerType==="touch"||cE()||e(t)}}function BR(e,t,n={}){const[r,i,o]=uE(e,n),s=qx(l=>{const{target:c}=l,h=t(l);if(typeof h!="function"||!c)return;const u=qx(f=>{h(f),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return r.forEach(l=>{l.addEventListener("pointerenter",s,i)}),o}const hE=(e,t)=>t?e===t?!0:hE(e,t.parentElement):!1,Wb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,zR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function FR(e){return zR.has(e.tagName)||e.tabIndex!==-1}const tu=new WeakSet;function Gx(e){return t=>{t.key==="Enter"&&e(t)}}function Im(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WR=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Gx(()=>{if(tu.has(n))return;Im(n,"down");const i=Gx(()=>{Im(n,"up")}),o=()=>Im(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Zx(e){return Wb(e)&&!cE()}function VR(e,t,n={}){const[r,i,o]=uE(e,n),s=l=>{const c=l.currentTarget;if(!Zx(l)||tu.has(c))return;tu.add(c);const h=t(l),u=(y,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),!(!Zx(y)||!tu.has(c))&&(tu.delete(c),typeof h=="function"&&h(y,{success:x}))},f=y=>{u(y,n.useGlobalTarget||hE(c,y.target))},m=y=>{u(y,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(l=>{!FR(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",s,i),l.addEventListener("focus",h=>WR(h,i),i)}),o}function UR(e){return e==="x"||e==="y"?Xr[e]?null:(Xr[e]=!0,()=>{Xr[e]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}const fE=new Set(["width","height","top","left","right","bottom",...nc]);let Nf;function HR(){Nf=void 0}const bi={now:()=>(Nf===void 0&&bi.set(Rn.isProcessing||zI.useManualTiming?Rn.timestamp:performance.now()),Nf),set:e=>{Nf=e,queueMicrotask(HR)}};function Vb(e,t){e.indexOf(t)===-1&&e.push(t)}function Ub(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Hb{constructor(){this.subscriptions=[]}add(t){return Vb(this.subscriptions,t),()=>Ub(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function dE(e,t){return t?e*(1e3/t):0}const Yx=30,qR=e=>!isNaN(parseFloat(e));class GR{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=bi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=qR(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&wp(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Hb);const r=this.events[t].add(n);return t==="change"?()=>{r(),He.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=bi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Yx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Yx);return dE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cu(e,t){return new GR(e,t)}function ZR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Cu(n))}function YR(e,t){const n=Ap(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const l=aR(o[s]);ZR(e,s,l)}}function KR(e){return!!(Vn(e)&&e.add)}function iy(e,t){const n=e.getValue("willChange");if(KR(n))return n.add(t)}function pE(e){return e.props[UT]}const mE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,XR=1e-7,JR=12;function QR(e,t,n,r,i){let o,s,l=0;do s=t+(n-t)/2,o=mE(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>XR&&++l<JR);return s}function gh(e,t,n,r){if(e===t&&n===r)return or;const i=o=>QR(o,0,1,e,n);return o=>o===0||o===1?o:mE(i(o),t,r)}const gE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yE=e=>t=>1-e(1-t),vE=gh(.33,1.53,.69,.99),qb=yE(vE),bE=gE(qb),xE=e=>(e*=2)<1?.5*qb(e):.5*(2-Math.pow(2,-10*(e-1))),Gb=e=>1-Math.sin(Math.acos(e)),wE=yE(Gb),_E=gE(Gb),SE=e=>/^0[^.\s]+$/u.test(e);function tL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||SE(e):!0}const au=e=>Math.round(e*1e5)/1e5,Zb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function eL(e){return e==null}const nL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yb=(e,t)=>n=>!!(typeof n=="string"&&nL.test(n)&&n.startsWith(e)||t&&!eL(n)&&Object.prototype.hasOwnProperty.call(n,t)),PE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,l]=r.match(Zb);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},rL=e=>uo(0,255,e),Rm={...rc,transform:e=>Math.round(rL(e))},Ys={test:Yb("rgb","red"),parse:PE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rm.transform(e)+", "+Rm.transform(t)+", "+Rm.transform(n)+", "+au(Eu.transform(r))+")"};function iL(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const oy={test:Yb("#"),parse:iL,transform:Ys.transform},Ja={test:Yb("hsl","hue"),parse:PE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+vi.transform(au(t))+", "+vi.transform(au(n))+", "+au(Eu.transform(r))+")"},zn={test:e=>Ys.test(e)||oy.test(e)||Ja.test(e),parse:e=>Ys.test(e)?Ys.parse(e):Ja.test(e)?Ja.parse(e):oy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ys.transform(e):Ja.transform(e)},oL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Zb))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(oL))===null||n===void 0?void 0:n.length)||0)>0}const AE="number",TE="color",aL="var",lL="var(",Kx="${}",cL=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ou(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const l=t.replace(cL,c=>(zn.test(c)?(r.color.push(o),i.push(TE),n.push(zn.parse(c))):c.startsWith(lL)?(r.var.push(o),i.push(aL),n.push(c)):(r.number.push(o),i.push(AE),n.push(parseFloat(c))),++o,Kx)).split(Kx);return{values:n,split:l,indexes:r,types:i}}function EE(e){return Ou(e).values}function CE(e){const{split:t,types:n}=Ou(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const l=n[s];l===AE?o+=au(i[s]):l===TE?o+=zn.transform(i[s]):o+=i[s]}return o}}const uL=e=>typeof e=="number"?0:e;function hL(e){const t=EE(e);return CE(e)(t.map(uL))}const Qo={test:sL,parse:EE,createTransformer:CE,getAnimatableNone:hL},fL=new Set(["brightness","contrast","saturate","opacity"]);function dL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Zb)||[];if(!r)return e;const i=n.replace(r,"");let o=fL.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const pL=/\b([a-z-]*)\(.*?\)/gu,sy={...Qo,getAnimatableNone:e=>{const t=e.match(pL);return t?t.map(dL).join(" "):e}},mL={...Ib,color:zn,backgroundColor:zn,outlineColor:zn,fill:zn,stroke:zn,borderColor:zn,borderTopColor:zn,borderRightColor:zn,borderBottomColor:zn,borderLeftColor:zn,filter:sy,WebkitFilter:sy},Kb=e=>mL[e];function OE(e,t){let n=Kb(e);return n!==sy&&(n=Qo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const gL=new Set(["auto","none","0"]);function yL(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!gL.has(o)&&Ou(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=OE(n,i)}const Xx=e=>e===rc||e===Ht,Jx=(e,t)=>parseFloat(e.split(", ")[t]),Qx=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Jx(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?Jx(o[1],e):0}},vL=new Set(["x","y","z"]),bL=nc.filter(e=>!vL.has(e));function xL(e){const t=[];return bL.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const xl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Qx(4,13),y:Qx(5,14)};xl.translateX=xl.x;xl.translateY=xl.y;const ea=new Set;let ay=!1,ly=!1;function ME(){if(ly){const e=Array.from(ea).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=xL(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var l;(l=r.getValue(o))===null||l===void 0||l.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ly=!1,ay=!1,ea.forEach(e=>e.complete()),ea.clear()}function kE(){ea.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ly=!0)})}function wL(){kE(),ME()}class Xb{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ea.add(this),ay||(ay=!0,He.read(kE),He.resolveKeyframes(ME))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const s=i==null?void 0:i.get(),l=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&s===void 0&&i.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ea.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ea.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const $E=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_L=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function SL(e){const t=_L.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const PL=4;function IE(e,t,n=1){Xo(n<=PL,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=SL(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return $E(s)?parseFloat(s):s}return $b(i)?IE(i,t,n+1):i}const RE=e=>t=>t.test(e),AL={test:e=>e==="auto",parse:e=>e},LE=[rc,Ht,vi,Do,dR,fR,AL],tw=e=>LE.find(RE(e));class NE extends Xb{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),$b(h))){const u=IE(h,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!fE.has(r)||t.length!==2)return;const[i,o]=t,s=tw(i),l=tw(o);if(s!==l)if(Xx(s)&&Xx(l))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)tL(t[i])&&r.push(i);r.length&&yL(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,l=i[s];i[s]=xl[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,h])=>{n.getValue(c).set(h)}),this.resolveNoneKeyframes()}}const ew=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Qo.test(e)||e==="0")&&!e.startsWith("url("));function TL(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function EL(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=ew(i,t),l=ew(o,t);return ec(s===l,`You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!s||!l?!1:TL(e)||(n==="spring"||zb(n))&&r}const CL=e=>e!==null;function Tp(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(CL),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const OL=40;class jE{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>OL?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&wL(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=bi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:l,onUpdate:c,isGenerator:h}=this.options;if(!h&&!EL(t,r,i,o))if(s)this.options.duration=0;else{c&&c(Tp(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Qe=(e,t,n)=>e+(t-e)*n;function Lm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ML({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Lm(c,l,e+1/3),o=Lm(c,l,e),s=Lm(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function Zf(e,t){return n=>n>0?t:e}const Nm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},kL=[oy,Ys,Ja],$L=e=>kL.find(t=>t.test(e));function nw(e){const t=$L(e);if(ec(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Ja&&(n=ML(n)),n}const rw=(e,t)=>{const n=nw(e),r=nw(t);if(!n||!r)return Zf(e,t);const i={...n};return o=>(i.red=Nm(n.red,r.red,o),i.green=Nm(n.green,r.green,o),i.blue=Nm(n.blue,r.blue,o),i.alpha=Qe(n.alpha,r.alpha,o),Ys.transform(i))},IL=(e,t)=>n=>t(e(n)),yh=(...e)=>e.reduce(IL),cy=new Set(["none","hidden"]);function RL(e,t){return cy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function LL(e,t){return n=>Qe(e,t,n)}function Jb(e){return typeof e=="number"?LL:typeof e=="string"?$b(e)?Zf:zn.test(e)?rw:DL:Array.isArray(e)?DE:typeof e=="object"?zn.test(e)?rw:NL:Zf}function DE(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Jb(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function NL(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Jb(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function jL(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],l=e.indexes[s][i[s]],c=(n=e.values[l])!==null&&n!==void 0?n:0;r[o]=c,i[s]++}return r}const DL=(e,t)=>{const n=Qo.createTransformer(t),r=Ou(e),i=Ou(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?cy.has(e)&&!i.values.length||cy.has(t)&&!r.values.length?RL(e,t):yh(DE(jL(r,i),i.values),n):(ec(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Zf(e,t))};function BE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Qe(e,t,n):Jb(e)(e,t)}const BL=5;function zE(e,t,n){const r=Math.max(t-BL,0);return dE(n-e(r),t-r)}const Je={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},jm=.001;function zL({duration:e=Je.duration,bounce:t=Je.bounce,velocity:n=Je.velocity,mass:r=Je.mass}){let i,o;ec(e<=yi(Je.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=uo(Je.minDamping,Je.maxDamping,s),e=uo(Je.minDuration,Je.maxDuration,oo(e)),s<1?(i=h=>{const u=h*s,f=u*e,m=u-n,y=uy(h,s),x=Math.exp(-f);return jm-m/y*x},o=h=>{const f=h*s*e,m=f*n+n,y=Math.pow(s,2)*Math.pow(h,2)*e,x=Math.exp(-f),p=uy(Math.pow(h,2),s);return(-i(h)+jm>0?-1:1)*((m-y)*x)/p}):(i=h=>{const u=Math.exp(-h*e),f=(h-n)*e+1;return-jm+u*f},o=h=>{const u=Math.exp(-h*e),f=(n-h)*(e*e);return u*f});const l=5/e,c=WL(i,o,l);if(e=yi(e),isNaN(c))return{stiffness:Je.stiffness,damping:Je.damping,duration:e};{const h=Math.pow(c,2)*r;return{stiffness:h,damping:s*2*Math.sqrt(r*h),duration:e}}}const FL=12;function WL(e,t,n){let r=n;for(let i=1;i<FL;i++)r=r-e(r)/t(r);return r}function uy(e,t){return e*Math.sqrt(1-t*t)}const VL=["duration","bounce"],UL=["stiffness","damping","mass"];function iw(e,t){return t.some(n=>e[n]!==void 0)}function HL(e){let t={velocity:Je.velocity,stiffness:Je.stiffness,damping:Je.damping,mass:Je.mass,isResolvedFromDuration:!1,...e};if(!iw(e,UL)&&iw(e,VL))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*uo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Je.mass,stiffness:i,damping:o}}else{const n=zL(e);t={...t,...n,mass:Je.mass},t.isResolvedFromDuration=!0}return t}function FE(e=Je.visualDuration,t=Je.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:c,damping:h,mass:u,duration:f,velocity:m,isResolvedFromDuration:y}=HL({...n,velocity:-oo(n.velocity||0)}),x=m||0,p=h/(2*Math.sqrt(c*u)),b=s-o,P=oo(Math.sqrt(c/u)),S=Math.abs(b)<5;r||(r=S?Je.restSpeed.granular:Je.restSpeed.default),i||(i=S?Je.restDelta.granular:Je.restDelta.default);let A;if(p<1){const w=uy(P,p);A=T=>{const O=Math.exp(-p*P*T);return s-O*((x+p*P*b)/w*Math.sin(w*T)+b*Math.cos(w*T))}}else if(p===1)A=w=>s-Math.exp(-P*w)*(b+(x+P*b)*w);else{const w=P*Math.sqrt(p*p-1);A=T=>{const O=Math.exp(-p*P*T),I=Math.min(w*T,300);return s-O*((x+p*P*b)*Math.sinh(I)+w*b*Math.cosh(I))/w}}const E={calculatedDuration:y&&f||null,next:w=>{const T=A(w);if(y)l.done=w>=f;else{let O=0;p<1&&(O=w===0?yi(x):zE(A,w,T));const I=Math.abs(O)<=r,N=Math.abs(s-T)<=i;l.done=I&&N}return l.value=l.done?s:T,l},toString:()=>{const w=Math.min(oE(E),ny),T=sE(O=>E.next(w*O).value,w,30);return w+"ms "+T}};return E}function ow({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:l,max:c,restDelta:h=.5,restSpeed:u}){const f=e[0],m={done:!1,value:f},y=I=>l!==void 0&&I<l||c!==void 0&&I>c,x=I=>l===void 0?c:c===void 0||Math.abs(l-I)<Math.abs(c-I)?l:c;let p=n*t;const b=f+p,P=s===void 0?b:s(b);P!==b&&(p=P-f);const S=I=>-p*Math.exp(-I/r),A=I=>P+S(I),E=I=>{const N=S(I),F=A(I);m.done=Math.abs(N)<=h,m.value=m.done?P:F};let w,T;const O=I=>{y(m.value)&&(w=I,T=FE({keyframes:[m.value,x(m.value)],velocity:zE(A,I,m.value),damping:i,stiffness:o,restDelta:h,restSpeed:u}))};return O(0),{calculatedDuration:null,next:I=>{let N=!1;return!T&&w===void 0&&(N=!0,E(I),O(I)),w!==void 0&&I>=w?T.next(I-w):(!N&&E(I),m)}}}const qL=gh(.42,0,1,1),GL=gh(0,0,.58,1),WE=gh(.42,0,.58,1),ZL=e=>Array.isArray(e)&&typeof e[0]!="number",sw={linear:or,easeIn:qL,easeInOut:WE,easeOut:GL,circIn:Gb,circInOut:_E,circOut:wE,backIn:qb,backInOut:bE,backOut:vE,anticipate:xE},aw=e=>{if(Fb(e)){Xo(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return gh(t,n,r,i)}else if(typeof e=="string")return Xo(sw[e]!==void 0,`Invalid easing type '${e}'`),sw[e];return e};function YL(e,t,n){const r=[],i=n||BE,o=e.length-1;for(let s=0;s<o;s++){let l=i(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||or:t;l=yh(c,l)}r.push(l)}return r}function KL(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(Xo(o===t.length,"Both input and output ranges must be the same length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=YL(t,r,i),c=l.length,h=u=>{if(s&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const m=vl(e[f],e[f+1],u);return l[f](m)};return n?u=>h(uo(e[0],e[o-1],u)):h}function XL(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=vl(0,t,r);e.push(Qe(n,1,i))}}function JL(e){const t=[0];return XL(t,e.length-1),t}function QL(e,t){return e.map(n=>n*t)}function tN(e,t){return e.map(()=>t||WE).splice(0,e.length-1)}function Yf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=ZL(r)?r.map(aw):aw(r),o={done:!1,value:t[0]},s=QL(n&&n.length===t.length?n:JL(t),e),l=KL(s,t,{ease:Array.isArray(i)?i:tN(t,i)});return{calculatedDuration:e,next:c=>(o.value=l(c),o.done=c>=e,o)}}const eN=e=>{const t=({timestamp:n})=>e(n);return{start:()=>He.update(t,!0),stop:()=>Jo(t),now:()=>Rn.isProcessing?Rn.timestamp:bi.now()}},nN={decay:ow,inertia:ow,tween:Yf,keyframes:Yf,spring:FE},rN=e=>e/100;class Qb extends jE{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Xb,l=(c,h)=>this.onKeyframesResolved(c,h);this.resolver=new s(o,l,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,l=zb(n)?n:nN[n]||Yf;let c,h;l!==Yf&&typeof t[0]!="number"&&(process.env.NODE_ENV!=="production"&&Xo(t.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),c=yh(rN,BE(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});o==="mirror"&&(h=l({...this.options,keyframes:[...t].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=oE(u));const{calculatedDuration:f}=u,m=f+i,y=m*(r+1)-i;return{generator:u,mirroredGenerator:h,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:m,totalDuration:y}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:h,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return o.next(0);const{delay:m,repeat:y,repeatType:x,repeatDelay:p,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const P=this.currentTime-m*(this.speed>=0?1:-1),S=this.speed>=0?P<0:P>u;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let A=this.currentTime,E=o;if(y){const I=Math.min(this.currentTime,u)/f;let N=Math.floor(I),F=I%1;!F&&I>=1&&(F=1),F===1&&N--,N=Math.min(N,y+1),!!(N%2)&&(x==="reverse"?(F=1-F,p&&(F-=p/f)):x==="mirror"&&(E=s)),A=uo(0,1,F)*f}const w=S?{done:!1,value:c[0]}:E.next(A);l&&(w.value=l(w.value));let{done:T}=w;!S&&h!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return O&&i!==void 0&&(w.value=Tp(c,this.options,i)),b&&b(w.value),O&&this.finish(),w}get duration(){const{resolved:t}=this;return t?oo(t.calculatedDuration):0}get time(){return oo(this.currentTime)}set time(t){t=yi(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=oo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=eN,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const iN=new Set(["opacity","clipPath","filter","transform"]);function oN(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:l="easeInOut",times:c}={}){const h={[t]:n};c&&(h.offset=c);const u=lE(l,i);return Array.isArray(u)&&(h.easing=u),e.animate(h,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}const sN=Ab(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Kf=10,aN=2e4;function lN(e){return zb(e.type)||e.type==="spring"||!aE(e.ease)}function cN(e,t){const n=new Qb({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&o<aN;)r=n.sample(o),i.push(r.value),o+=Kf;return{times:void 0,keyframes:i,duration:o-Kf,ease:"linear"}}const VE={anticipate:xE,backInOut:bE,circInOut:_E};function uN(e){return e in VE}class lw extends jE{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:o}=this.options;this.resolver=new NE(o,(s,l)=>this.onKeyframesResolved(s,l),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:o,type:s,motionValue:l,name:c,startTime:h}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof o=="string"&&Gf()&&uN(o)&&(o=VE[o]),lN(this.options)){const{onComplete:f,onUpdate:m,motionValue:y,element:x,...p}=this.options,b=cN(t,p);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,o=b.ease,s="keyframes"}const u=oN(l.owner.current,c,t,{...this.options,duration:r,times:i,ease:o});return u.startTime=h??this.calcStartTime(),this.pendingTimeline?(Hx(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Tp(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return oo(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return oo(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=yi(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return or;const{animation:r}=n;Hx(r,t)}return or}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:h,onUpdate:u,onComplete:f,element:m,...y}=this.options,x=new Qb({...y,keyframes:r,duration:i,type:o,ease:s,times:l,isGenerator:!0}),p=yi(this.time);h.setWithVelocity(x.sample(p-Kf).value,x.sample(p).value,Kf)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=n.owner.getProps();return sN()&&r&&iN.has(r)&&!c&&!h&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}}const hN={type:"spring",stiffness:500,damping:25,restSpeed:10},fN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),dN={type:"keyframes",duration:.8},pN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mN=(e,{keyframes:t})=>t.length>2?dN:ba.has(e)?e.startsWith("scale")?fN(t[1]):hN:pN;function gN({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:l,from:c,elapsed:h,...u}){return!!Object.keys(u).length}const t0=(e,t,n,r={},i,o)=>s=>{const l=Bb(r,e)||{},c=l.delay||r.delay||0;let{elapsed:h=0}=r;h=h-yi(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-h,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:i};gN(l)||(u={...u,...mN(e,u)}),u.duration&&(u.duration=yi(u.duration)),u.repeatDelay&&(u.repeatDelay=yi(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!o&&t.get()!==void 0){const m=Tp(u.keyframes,l);if(m!==void 0)return He.update(()=>{u.onUpdate(m),u.onComplete()}),new LR([])}return!o&&lw.supports(u)?new lw(u):new Qb(u)};function yN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function UE(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(s=r);const h=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const m=e.getValue(f,(o=e.latestValues[f])!==null&&o!==void 0?o:null),y=c[f];if(y===void 0||u&&yN(u,f))continue;const x={delay:n,...Bb(s||{},f)};let p=!1;if(window.MotionHandoffAnimation){const P=pE(e);if(P){const S=window.MotionHandoffAnimation(P,f,He);S!==null&&(x.startTime=S,p=!0)}}iy(e,f),m.start(t0(f,m,y,e.shouldReduceMotion&&fE.has(f)?{type:!1}:x,e,p));const b=m.animation;b&&h.push(b)}return l&&Promise.all(h).then(()=>{He.update(()=>{l&&YR(e,l)})}),h}function hy(e,t,n={}){var r;const i=Ap(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(UE(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:m}=o;return vN(e,t,u+h,f,m,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[h,u]=c==="beforeChildren"?[s,l]:[l,s];return h().then(()=>u())}else return Promise.all([s(),l(n.delay)])}function vN(e,t,n=0,r=0,i=1,o){const s=[],l=(e.variantChildren.size-1)*r,c=i===1?(h=0)=>h*r:(h=0)=>l-h*r;return Array.from(e.variantChildren).sort(bN).forEach((h,u)=>{h.notify("AnimationStart",t),s.push(hy(h,t,{...o,delay:n+c(u)}).then(()=>h.notify("AnimationComplete",t)))}),Promise.all(s)}function bN(e,t){return e.sortNodePosition(t)}function xN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>hy(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=hy(e,t,n);else{const i=typeof t=="function"?Ap(e,t,n.custom):t;r=Promise.all(UE(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const wN=Eb.length;function HE(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?HE(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wN;n++){const r=Eb[n],i=e.props[r];(Tu(i)||i===!1)&&(t[r]=i)}return t}const _N=[...Tb].reverse(),SN=Tb.length;function PN(e){return t=>Promise.all(t.map(({animation:n,options:r})=>xN(e,n,r)))}function AN(e){let t=PN(e),n=cw(),r=!0;const i=c=>(h,u)=>{var f;const m=Ap(e,u,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(m){const{transition:y,transitionEnd:x,...p}=m;h={...h,...p,...x}}return h};function o(c){t=c(e)}function s(c){const{props:h}=e,u=HE(e.parent)||{},f=[],m=new Set;let y={},x=1/0;for(let b=0;b<SN;b++){const P=_N[b],S=n[P],A=h[P]!==void 0?h[P]:u[P],E=Tu(A),w=P===c?S.isActive:null;w===!1&&(x=b);let T=A===u[P]&&A!==h[P]&&E;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),S.protectedKeys={...y},!S.isActive&&w===null||!A&&!S.prevProp||Sp(A)||typeof A=="boolean")continue;const O=TN(S.prevProp,A);let I=O||P===c&&S.isActive&&!T&&E||b>x&&E,N=!1;const F=Array.isArray(A)?A:[A];let D=F.reduce(i(P),{});w===!1&&(D={});const{prevResolvedValues:j={}}=S,K={...j,...D},U=G=>{I=!0,m.has(G)&&(N=!0,m.delete(G)),S.needsAnimating[G]=!0;const X=e.getValue(G);X&&(X.liveStyle=!1)};for(const G in K){const X=D[G],lt=j[G];if(y.hasOwnProperty(G))continue;let H=!1;ey(X)&&ey(lt)?H=!iE(X,lt):H=X!==lt,H?X!=null?U(G):m.add(G):X!==void 0&&m.has(G)?U(G):S.protectedKeys[G]=!0}S.prevProp=A,S.prevResolvedValues=D,S.isActive&&(y={...y,...D}),r&&e.blockInitialAnimation&&(I=!1),I&&(!(T&&O)||N)&&f.push(...F.map(G=>({animation:G,options:{type:P}})))}if(m.size){const b={};m.forEach(P=>{const S=e.getBaseTarget(P),A=e.getValue(P);A&&(A.liveStyle=!0),b[P]=S??null}),f.push({animation:b})}let p=!!f.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function l(c,h){var u;if(n[c].isActive===h)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(m=>{var y;return(y=m.animationState)===null||y===void 0?void 0:y.setActive(c,h)}),n[c].isActive=h;const f=s(c);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:s,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=cw(),r=!0}}}function TN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!iE(t,e):!1}function Ns(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cw(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class rs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class EN extends rs{constructor(t){super(t),t.animationState||(t.animationState=AN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Sp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let CN=0;class ON extends rs{constructor(){super(...arguments),this.id=CN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const MN={animation:{Feature:EN},exit:{Feature:ON}};function Mu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vh(e){return{point:{x:e.pageX,y:e.pageY}}}const kN=e=>t=>Wb(t)&&e(t,vh(t));function lu(e,t,n,r){return Mu(e,t,kN(n),r)}const uw=(e,t)=>Math.abs(e-t);function $N(e,t){const n=uw(e.x,t.x),r=uw(e.y,t.y);return Math.sqrt(n**2+r**2)}class qE{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Bm(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=$N(f.offset,{x:0,y:0})>=3;if(!m&&!y)return;const{point:x}=f,{timestamp:p}=Rn;this.history.push({...x,timestamp:p});const{onStart:b,onMove:P}=this.handlers;m||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,f)},this.handlePointerMove=(f,m)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Dm(m,this.transformPagePoint),He.update(this.updatePoint,!0)},this.handlePointerUp=(f,m)=>{this.end();const{onEnd:y,onSessionEnd:x,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Bm(f.type==="pointercancel"?this.lastMoveEventInfo:Dm(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(f,b),x&&x(f,b)},!Wb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=vh(t),l=Dm(s,this.transformPagePoint),{point:c}=l,{timestamp:h}=Rn;this.history=[{...c,timestamp:h}];const{onSessionStart:u}=n;u&&u(t,Bm(l,this.history)),this.removeListeners=yh(lu(this.contextWindow,"pointermove",this.handlePointerMove),lu(this.contextWindow,"pointerup",this.handlePointerUp),lu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jo(this.updatePoint)}}function Dm(e,t){return t?{point:t(e.point)}:e}function hw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Bm({point:e},t){return{point:e,delta:hw(e,GE(t)),offset:hw(e,IN(t)),velocity:RN(t,.1)}}function IN(e){return e[0]}function GE(e){return e[e.length-1]}function RN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=GE(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>yi(t)));)n--;if(!r)return{x:0,y:0};const o=oo(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const ZE=1e-4,LN=1-ZE,NN=1+ZE,YE=.01,jN=0-YE,DN=0+YE;function Ar(e){return e.max-e.min}function BN(e,t,n){return Math.abs(e-t)<=n}function fw(e,t,n,r=.5){e.origin=r,e.originPoint=Qe(t.min,t.max,e.origin),e.scale=Ar(n)/Ar(t),e.translate=Qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=LN&&e.scale<=NN||isNaN(e.scale))&&(e.scale=1),(e.translate>=jN&&e.translate<=DN||isNaN(e.translate))&&(e.translate=0)}function cu(e,t,n,r){fw(e.x,t.x,n.x,r?r.originX:void 0),fw(e.y,t.y,n.y,r?r.originY:void 0)}function dw(e,t,n){e.min=n.min+t.min,e.max=e.min+Ar(t)}function zN(e,t,n){dw(e.x,t.x,n.x),dw(e.y,t.y,n.y)}function pw(e,t,n){e.min=t.min-n.min,e.max=e.min+Ar(t)}function uu(e,t,n){pw(e.x,t.x,n.x),pw(e.y,t.y,n.y)}function FN(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Qe(n,e,r.max):Math.min(e,n)),e}function mw(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function WN(e,{top:t,left:n,bottom:r,right:i}){return{x:mw(e.x,n,i),y:mw(e.y,t,r)}}function gw(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function VN(e,t){return{x:gw(e.x,t.x),y:gw(e.y,t.y)}}function UN(e,t){let n=.5;const r=Ar(e),i=Ar(t);return i>r?n=vl(t.min,t.max-r,e.min):r>i&&(n=vl(e.min,e.max-i,t.min)),uo(0,1,n)}function HN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fy=.35;function qN(e=fy){return e===!1?e=0:e===!0&&(e=fy),{x:yw(e,"left","right"),y:yw(e,"top","bottom")}}function yw(e,t,n){return{min:vw(e,t),max:vw(e,n)}}function vw(e,t){return typeof e=="number"?e:e[t]||0}const bw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qa=()=>({x:bw(),y:bw()}),xw=()=>({min:0,max:0}),sn=()=>({x:xw(),y:xw()});function Nr(e){return[e("x"),e("y")]}function KE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function GN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function zm(e){return e===void 0||e===1}function dy({scale:e,scaleX:t,scaleY:n}){return!zm(e)||!zm(t)||!zm(n)}function Ws(e){return dy(e)||XE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function XE(e){return ww(e.x)||ww(e.y)}function ww(e){return e&&e!=="0%"}function Xf(e,t,n){const r=e-n,i=t*r;return n+i}function _w(e,t,n,r,i){return i!==void 0&&(e=Xf(e,i,r)),Xf(e,n,r)+t}function py(e,t=0,n=1,r,i){e.min=_w(e.min,t,n,r,i),e.max=_w(e.max,t,n,r,i)}function JE(e,{x:t,y:n}){py(e.x,t.translate,t.scale,t.originPoint),py(e.y,n.translate,n.scale,n.originPoint)}const Sw=.999999999999,Pw=1.0000000000001;function YN(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let l=0;l<i;l++){o=n[l],s=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&el(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,JE(e,s)),r&&Ws(o.latestValues)&&el(e,o.latestValues))}t.x<Pw&&t.x>Sw&&(t.x=1),t.y<Pw&&t.y>Sw&&(t.y=1)}function tl(e,t){e.min=e.min+t,e.max=e.max+t}function Aw(e,t,n,r,i=.5){const o=Qe(e.min,e.max,i);py(e,t,n,o,r)}function el(e,t){Aw(e.x,t.x,t.scaleX,t.scale,t.originX),Aw(e.y,t.y,t.scaleY,t.scale,t.originY)}function QE(e,t){return KE(ZN(e.getBoundingClientRect(),t))}function KN(e,t,n){const r=QE(e,n),{scroll:i}=t;return i&&(tl(r.x,i.offset.x),tl(r.y,i.offset.y)),r}const tC=({current:e})=>e?e.ownerDocument.defaultView:null,XN=new WeakMap;class JN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vh(u).point)},o=(u,f)=>{const{drag:m,dragPropagation:y,onDragStart:x}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=UR(m),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nr(b=>{let P=this.getAxisMotionValue(b).get()||0;if(vi.test(P)){const{projection:S}=this.visualElement;if(S&&S.layout){const A=S.layout.layoutBox[b];A&&(P=Ar(A)*(parseFloat(P)/100))}}this.originPoint[b]=P}),x&&He.postRender(()=>x(u,f)),iy(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},s=(u,f)=>{const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:x,onDrag:p}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:b}=f;if(y&&this.currentDirection===null){this.currentDirection=QN(b),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),p&&p(u,f)},l=(u,f)=>this.stop(u,f),c=()=>Nr(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new qE(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,contextWindow:tC(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&He.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!nf(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=FN(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Xa(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=WN(i.layoutBox,n):this.constraints=!1,this.elastic=qN(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=HN(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xa(t))return!1;const r=t.current;Xo(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=KN(r,i.root,this.visualElement.getTransformPagePoint());let s=VN(i.layout.layoutBox,o);if(n){const l=n(GN(s));this.hasMutatedConstraints=!!l,l&&(s=KE(l))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},h=Nr(u=>{if(!nf(u,n,this.currentDirection))return;let f=c&&c[u]||{};s&&(f={min:0,max:0});const m=i?200:1e6,y=i?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(h).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return iy(this.visualElement,t),r.start(t0(t,r,0,n,this.visualElement,!1))}stopAnimation(){Nr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Nr(n=>{const{drag:r}=this.getProps();if(!nf(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:l}=i.layout.layoutBox[n];o.set(t[n]-Qe(s,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Xa(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nr(s=>{const l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){const c=l.get();i[s]=UN({min:c,max:c},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Nr(s=>{if(!nf(s,t,null))return;const l=this.getAxisMotionValue(s),{min:c,max:h}=this.constraints[s];l.set(Qe(c,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;XN.set(this.visualElement,this);const t=this.visualElement.current,n=lu(t,"pointerdown",c=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Xa(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),He.read(r);const s=Mu(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Nr(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=fy,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:l}}}function nf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function QN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tj extends rs{constructor(t){super(t),this.removeGroupControls=or,this.removeListeners=or,this.controls=new JN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||or}unmount(){this.removeGroupControls(),this.removeListeners()}}const Tw=e=>(t,n)=>{e&&He.postRender(()=>e(t,n))};class ej extends rs{constructor(){super(...arguments),this.removePointerDownListener=or}onPointerDown(t){this.session=new qE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Tw(t),onStart:Tw(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&He.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=lu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const jf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ew(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const zc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ht.test(e))e=parseFloat(e);else return e;const n=Ew(e,t.target.x),r=Ew(e,t.target.y);return`${n}% ${r}%`}},nj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Qo.parse(e);if(i.length>5)return r;const o=Qo.createTransformer(e),s=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=l,i[1+s]/=c;const h=Qe(l,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),o(i)}};class rj extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;SR(ij),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),jf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||He.postRender(()=>{const l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ob.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eC(e){const[t,n]=DT(),r=v.useContext(wb);return Ze.jsx(rj,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(HT),isPresent:t,safeToRemove:n})}const ij={borderRadius:{...zc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zc,borderTopRightRadius:zc,borderBottomLeftRadius:zc,borderBottomRightRadius:zc,boxShadow:nj};function oj(e,t,n){const r=Vn(e)?e:Cu(e);return r.start(t0("",r,t,n)),r.animation}function sj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const aj=(e,t)=>e.depth-t.depth;class lj{constructor(){this.children=[],this.isDirty=!1}add(t){Vb(this.children,t),this.isDirty=!0}remove(t){Ub(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(aj),this.isDirty=!1,this.children.forEach(t)}}function cj(e,t){const n=bi.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Jo(r),e(o-t))};return He.read(r,!0),()=>Jo(r)}const nC=["TopLeft","TopRight","BottomLeft","BottomRight"],uj=nC.length,Cw=e=>typeof e=="string"?parseFloat(e):e,Ow=e=>typeof e=="number"||Ht.test(e);function hj(e,t,n,r,i,o){i?(e.opacity=Qe(0,n.opacity!==void 0?n.opacity:1,fj(r)),e.opacityExit=Qe(t.opacity!==void 0?t.opacity:1,0,dj(r))):o&&(e.opacity=Qe(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<uj;s++){const l=`border${nC[s]}Radius`;let c=Mw(t,l),h=Mw(n,l);if(c===void 0&&h===void 0)continue;c||(c=0),h||(h=0),c===0||h===0||Ow(c)===Ow(h)?(e[l]=Math.max(Qe(Cw(c),Cw(h),r),0),(vi.test(h)||vi.test(c))&&(e[l]+="%")):e[l]=h}(t.rotate||n.rotate)&&(e.rotate=Qe(t.rotate||0,n.rotate||0,r))}function Mw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fj=rC(0,.5,wE),dj=rC(.5,.95,or);function rC(e,t,n){return r=>r<e?0:r>t?1:n(vl(e,t,r))}function kw(e,t){e.min=t.min,e.max=t.max}function $r(e,t){kw(e.x,t.x),kw(e.y,t.y)}function $w(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Iw(e,t,n,r,i){return e-=t,e=Xf(e,1/n,r),i!==void 0&&(e=Xf(e,1/i,r)),e}function pj(e,t=0,n=1,r=.5,i,o=e,s=e){if(vi.test(t)&&(t=parseFloat(t),t=Qe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let l=Qe(o.min,o.max,r);e===o&&(l-=t),e.min=Iw(e.min,t,n,l,i),e.max=Iw(e.max,t,n,l,i)}function Rw(e,t,[n,r,i],o,s){pj(e,t[n],t[r],t[i],t.scale,o,s)}const mj=["x","scaleX","originX"],gj=["y","scaleY","originY"];function Lw(e,t,n,r){Rw(e.x,t,mj,n?n.x:void 0,r?r.x:void 0),Rw(e.y,t,gj,n?n.y:void 0,r?r.y:void 0)}function Nw(e){return e.translate===0&&e.scale===1}function iC(e){return Nw(e.x)&&Nw(e.y)}function jw(e,t){return e.min===t.min&&e.max===t.max}function yj(e,t){return jw(e.x,t.x)&&jw(e.y,t.y)}function Dw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oC(e,t){return Dw(e.x,t.x)&&Dw(e.y,t.y)}function Bw(e){return Ar(e.x)/Ar(e.y)}function zw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class vj{constructor(){this.members=[]}add(t){Vb(this.members,t),t.scheduleRender()}remove(t){if(Ub(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function bj(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:f,rotateY:m,skewX:y,skewY:x}=n;h&&(r=`perspective(${h}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),y&&(r+=`skewX(${y}deg) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Vs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},eu=typeof window<"u"&&window.MotionDebug!==void 0,Fm=["","X","Y","Z"],xj={visibility:"hidden"},Fw=1e3;let wj=0;function Wm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function sC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=pE(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",He,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&sC(r)}function aC({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},l=t==null?void 0:t()){this.id=wj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,eu&&(Vs.totalNodes=Vs.resolvedTargetDeltas=Vs.recalculatedProjection=0),this.nodes.forEach(Pj),this.nodes.forEach(Oj),this.nodes.forEach(Mj),this.nodes.forEach(Aj),eu&&window.MotionDebug.record(Vs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new lj)}addEventListener(s,l){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Hb),this.eventHandlers.get(s).add(l)}notifyListeners(s,...l){const c=this.eventHandlers.get(s);c&&c.notify(...l)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=sj(s),this.instance=s;const{layoutId:c,layout:h,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(h||c)&&(this.isLayoutDirty=!0),e){let f;const m=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=cj(m,250),jf.hasAnimatedSinceResize&&(jf.hasAnimatedSinceResize=!1,this.nodes.forEach(Vw))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||h)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m,hasRelativeTargetChanged:y,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Lj,{onLayoutAnimationStart:b,onLayoutAnimationComplete:P}=u.getProps(),S=!this.targetLayout||!oC(this.targetLayout,x)||y,A=!m&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||m&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,A);const E={...Bb(p,"layout"),onPlay:b,onComplete:P};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else m||Vw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Jo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(kj),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ww);return}this.isUpdating||this.nodes.forEach(Ej),this.isUpdating=!1,this.nodes.forEach(Cj),this.nodes.forEach(_j),this.nodes.forEach(Sj),this.clearAllSnapshots();const l=bi.now();Rn.delta=uo(0,1e3/60,l-Rn.timestamp),Rn.timestamp=l,Rn.isProcessing=!0,$m.update.process(Rn),$m.preRender.process(Rn),$m.render.process(Rn),Rn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ob.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tj),this.sharedNodes.forEach($j)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,He.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){He.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=sn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!iC(this.projectionDelta),c=this.getTransformTemplate(),h=c?c(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&(l||Ws(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return s&&(c=this.removeTransform(c)),Nj(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:l}=this.options;if(!l)return sn();const c=l.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(jj))){const{scroll:u}=this.root;u&&(tl(c.x,u.offset.x),tl(c.y,u.offset.y))}return c}removeElementScroll(s){var l;const c=sn();if($r(c,s),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let h=0;h<this.path.length;h++){const u=this.path[h],{scroll:f,options:m}=u;u!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&$r(c,s),tl(c.x,f.offset.x),tl(c.y,f.offset.y))}return c}applyTransform(s,l=!1){const c=sn();$r(c,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&el(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ws(u.latestValues)&&el(c,u.latestValues)}return Ws(this.latestValues)&&el(c,this.latestValues),c}removeTransform(s){const l=sn();$r(l,s);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!h.instance||!Ws(h.latestValues))continue;dy(h.latestValues)&&h.updateSnapshot();const u=sn(),f=h.measurePageBox();$r(u,f),Lw(l,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Ws(this.latestValues)&&Lw(l,this.latestValues),l}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Rn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==c;if(!(s||h&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:m}=this.options;if(!(!this.layout||!(f||m))){if(this.resolvedRelativeTargetAt=Rn.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sn(),this.relativeTargetOrigin=sn(),uu(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),$r(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=sn(),this.targetWithTransforms=sn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$r(this.target,this.layout.layoutBox),JE(this.target,this.targetDelta)):$r(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sn(),this.relativeTargetOrigin=sn(),uu(this.relativeTargetOrigin,this.target,y.target),$r(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}eu&&Vs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||dy(this.parent.latestValues)||XE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(h=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Rn.timestamp&&(h=!1),h)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;$r(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,y=this.treeScale.y;YN(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=sn());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($w(this.prevProjectionDelta.x,this.projectionDelta.x),$w(this.prevProjectionDelta.y,this.projectionDelta.y)),cu(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==y||!zw(this.projectionDelta.x,this.prevProjectionDelta.x)||!zw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),eu&&Vs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),s){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qa(),this.projectionDelta=Qa(),this.projectionDeltaWithTransform=Qa()}setAnimationOrigin(s,l=!1){const c=this.snapshot,h=c?c.latestValues:{},u={...this.latestValues},f=Qa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=sn(),y=c?c.source:void 0,x=this.layout?this.layout.source:void 0,p=y!==x,b=this.getStack(),P=!b||b.members.length<=1,S=!!(p&&!P&&this.options.crossfade===!0&&!this.path.some(Rj));this.animationProgress=0;let A;this.mixTargetDelta=E=>{const w=E/1e3;Uw(f.x,s.x,w),Uw(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uu(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ij(this.relativeTarget,this.relativeTargetOrigin,m,w),A&&yj(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=sn()),$r(A,this.relativeTarget)),p&&(this.animationValues=u,hj(u,h,this.latestValues,w,S,P)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Jo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=He.update(()=>{jf.hasAnimatedSinceResize=!0,this.currentAnimation=oj(0,Fw,{...s,onUpdate:l=>{this.mixTargetDelta(l),s.onUpdate&&s.onUpdate(l)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Fw),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:l,target:c,layout:h,latestValues:u}=s;if(!(!l||!c||!h)){if(this!==s&&this.layout&&h&&lC(this.options.animationType,this.layout.layoutBox,h.layoutBox)){c=this.target||sn();const f=Ar(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const m=Ar(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+m}$r(l,c),el(l,u),cu(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new vj),this.sharedNodes.get(s).add(l);const h=l.options.initialPromotionConfig;l.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(l):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:l}=this.options;return l?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:l}=this.options;return l?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:c}={}){const h=this.getStack();h&&h.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let l=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const h={};c.z&&Wm("z",s,h,this.animationValues);for(let u=0;u<Fm.length;u++)Wm(`rotate${Fm[u]}`,s,h,this.animationValues),Wm(`skew${Fm[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}getProjectionStyles(s){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return xj;const h={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,h.opacity="",h.pointerEvents=Lf(s==null?void 0:s.pointerEvents)||"",h.transform=u?u(this.latestValues,""):"none",h;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Lf(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Ws(this.latestValues)&&(p.transform=u?u({},""):"none",this.hasProjected=!1),p}const m=f.animationValues||f.latestValues;this.applyTransformsToTarget(),h.transform=bj(this.projectionDeltaWithTransform,this.treeScale,m),u&&(h.transform=u(m,h.transform));const{x:y,y:x}=this.projectionDelta;h.transformOrigin=`${y.origin*100}% ${x.origin*100}% 0`,f.animationValues?h.opacity=f===this?(c=(l=m.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:h.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const p in qf){if(m[p]===void 0)continue;const{correct:b,applyTo:P}=qf[p],S=h.transform==="none"?m[p]:b(m[p],f);if(P){const A=P.length;for(let E=0;E<A;E++)h[P[E]]=S}else h[p]=S}return this.options.layoutId&&(h.pointerEvents=f===this?Lf(s==null?void 0:s.pointerEvents)||"":"none"),h}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var l;return(l=s.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Ww),this.root.sharedNodes.clear()}}}function _j(e){e.updateLayout()}function Sj(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Nr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Ar(m);m.min=r[f].min,m.max=m.min+y}):lC(o,n.layoutBox,r)&&Nr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Ar(r[f]);m.max=m.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+y)});const l=Qa();cu(l,r,n.layoutBox);const c=Qa();s?cu(c,e.applyTransform(i,!0),n.measuredBox):cu(c,r,n.layoutBox);const h=!iC(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:y}=f;if(m&&y){const x=sn();uu(x,n.layoutBox,m.layoutBox);const p=sn();uu(p,r,y.layoutBox),oC(x,p)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:h,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Pj(e){eu&&Vs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Aj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Tj(e){e.clearSnapshot()}function Ww(e){e.clearMeasurements()}function Ej(e){e.isLayoutDirty=!1}function Cj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Vw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Oj(e){e.resolveTargetDelta()}function Mj(e){e.calcProjection()}function kj(e){e.resetSkewAndRotation()}function $j(e){e.removeLeadSnapshot()}function Uw(e,t,n){e.translate=Qe(t.translate,0,n),e.scale=Qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hw(e,t,n,r){e.min=Qe(t.min,n.min,r),e.max=Qe(t.max,n.max,r)}function Ij(e,t,n,r){Hw(e.x,t.x,n.x,r),Hw(e.y,t.y,n.y,r)}function Rj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Lj={duration:.45,ease:[.4,0,.1,1]},qw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gw=qw("applewebkit/")&&!qw("chrome/")?Math.round:or;function Zw(e){e.min=Gw(e.min),e.max=Gw(e.max)}function Nj(e){Zw(e.x),Zw(e.y)}function lC(e,t,n){return e==="position"||e==="preserve-aspect"&&!BN(Bw(t),Bw(n),.2)}function jj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Dj=aC({attachResizeListener:(e,t)=>Mu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Vm={current:void 0},cC=aC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Vm.current){const e=new Dj({});e.mount(window),e.setOptions({layoutScroll:!0}),Vm.current=e}return Vm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Bj={pan:{Feature:ej},drag:{Feature:tj,ProjectionNode:cC,MeasureLayout:eC}};function Yw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&He.postRender(()=>o(t,vh(t)))}class zj extends rs{mount(){const{current:t}=this.node;t&&(this.unmount=BR(t,n=>(Yw(this.node,n,"Start"),r=>Yw(this.node,r,"End"))))}unmount(){}}class Fj extends rs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yh(Mu(this.node.current,"focus",()=>this.onFocus()),Mu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Kw(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&He.postRender(()=>o(t,vh(t)))}class Wj extends rs{mount(){const{current:t}=this.node;t&&(this.unmount=VR(t,n=>(Kw(this.node,n,"Start"),(r,{success:i})=>Kw(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const my=new WeakMap,Um=new WeakMap,Vj=e=>{const t=my.get(e.target);t&&t(e)},Uj=e=>{e.forEach(Vj)};function Hj({root:e,...t}){const n=e||document;Um.has(n)||Um.set(n,{});const r=Um.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Uj,{root:e,...t})),r[i]}function qj(e,t,n){const r=Hj(t);return my.set(e,n),r.observe(e),()=>{my.delete(e),r.unobserve(e)}}const Gj={some:0,all:1};class Zj extends rs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Gj[i]},l=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),m=h?u:f;m&&m(c)};return qj(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Yj(t,n))&&this.startObserver()}unmount(){}}function Yj({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Kj={inView:{Feature:Zj},tap:{Feature:Wj},focus:{Feature:Fj},hover:{Feature:zj}},Xj={layout:{ProjectionNode:cC,MeasureLayout:eC}},gy={current:null},uC={current:!1};function Jj(){if(uC.current=!0,!!Pb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gy.current=e.matches;e.addListener(t),t()}else gy.current=!1}const Qj=[...LE,zn,Qo],tD=e=>Qj.find(RE(e)),Xw=new WeakMap;function eD(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Vn(i))e.addValue(r,i),process.env.NODE_ENV==="development"&&wp(i.version==="11.18.2",`Attempting to mix Motion versions ${i.version} with 11.18.2 may not work as expected.`);else if(Vn(o))e.addValue(r,Cu(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Cu(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Jw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class nD{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=bi.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,He.render(this.render,!1,!0))};const{latestValues:c,renderState:h,onUpdate:u}=s;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Pp(n),this.isVariantNode=VT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const x=m[y];c[y]!==void 0&&Vn(x)&&x.set(c[y],!1)}}mount(t){this.current=t,Xw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),uC.current||Jj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gy.current,process.env.NODE_ENV!=="production"&&wp(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Xw.delete(this.current),this.projection&&this.projection.unmount(),Jo(this.notifyUpdate),Jo(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ba.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&He.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in bl){const n=bl[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Jw.length;r++){const i=Jw[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=eD(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Cu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&($E(i)||SE(i))?i=parseFloat(i):!tD(i)&&Qo.test(n)&&(i=OE(t,n)),this.setBaseTarget(t,Vn(i)?i.get():i)),Vn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=kb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Vn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Hb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hC extends nD{constructor(){super(...arguments),this.KeyframeResolver=NE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function rD(e){return window.getComputedStyle(e)}class iD extends hC{constructor(){super(...arguments),this.type="html",this.renderInstance=JT}readValueFromInstance(t,n){if(ba.has(n)){const r=Kb(n);return r&&r.default||0}else{const r=rD(t),i=(YT(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return QE(t,n)}build(t,n,r){Rb(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Db(t,n,r)}}class oD extends hC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ba.has(n)){const r=Kb(n);return r&&r.default||0}return n=QT.has(n)?n:Cb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return nE(t,n,r)}build(t,n,r){Lb(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){tE(t,n,r,i)}mount(t){this.isSVGTag=jb(t.tagName),super.mount(t)}}const sD=(e,t)=>Mb(e)?new oD(t):new iD(t,{allowProjection:e!==v.Fragment}),aD=$R({...MN,...Kj,...Bj,...Xj},sD),Jf=GI(aD),lD={div:"div",span:"span",p:"p",hr:"hr",a:"a",strong:"strong",em:"em",del:"del",li:"li",ul:"ul",ol:"ol",form:"form",img:"img",header:"header",footer:"footer",section:"section",nav:"nav",main:"main",article:"article",aside:"aside",figure:"figure",figcaption:"figcaption",th:"th",td:"td",caption:"caption",blockquote:"blockquote",address:"address",time:"time",legend:"legend",label:"label",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",code:"code"},cD=new Set(["motion","initial","animate","exit","transition","variants","whileHover","whileTap","whileFocus","whileInView","animateLayout"]);function V(e,t,...n){const{style:r,className:i,...o}=t||{};if(o.motion){const l={};for(const h of cD)if(h in o){const u=h==="animateLayout"?"layout":h;let f=o[h];u==="transition"&&f&&typeof f=="object"&&(f={...f,repeat:Math.max(0,Number(f.repeat)||0)}),l[u]=f,delete o[h]}const c=Jf[e]||Jf.div;return v.createElement(c,{...o,className:i,style:r||{},...l},...n)}delete o.animateLayout;const s=lD[e];return s?v.createElement(s,{...o,className:i,style:r||{}},...n):v.createElement(e,{...o,className:i,style:r||{}},...n)}const uD={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},fC={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},dC=["base","sm","md","lg","xl","2xl"],xn={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},rf={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},Qw={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",auto:"auto",screen:"100vw",fit:"fit-content",max:"max-content",min:"min-content"},of={"flex-row":"row","flex-row-reverse":"row-reverse","flex-col":"column","flex-col-reverse":"column-reverse"},sf={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-baseline":"baseline","items-stretch":"stretch"},af={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly"},lf={"rounded-none":"0px","rounded-sm":"0.125rem",rounded:"0.25rem","rounded-md":"0.375rem","rounded-lg":"0.5rem","rounded-xl":"0.75rem","rounded-2xl":"1rem","rounded-3xl":"1.5rem","rounded-full":"9999px"},hD=["hidden","block","flex","grid","inline","inline-block","inline-flex"];function e0(e,t,n,r){const i=new Map,o=e.split(/\s+/).filter(Boolean);for(const s of o){const l=new RegExp(n.source).exec(s);if(l){i.set(l[1],r(l));continue}const c=new RegExp(t.source).exec(s);c&&i.set("base",r([null,null,c[1]]))}return i}function pC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(flex-row|flex-row-reverse|flex-col|flex-col-reverse)$/);if(i&&of[i[2]]){t.set(i[1],of[i[2]]);continue}of[r]&&t.set("base",of[r])}return t}function mC(e){return e0(e,/^gap-(\d+(?:\.\d+)?)$/,/^(sm|md|lg|xl|2xl):gap-(\d+(?:\.\d+)?)$/,t=>xn[t[2]]||`${t[2]}px`)}function gC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):w-(.+)$/);if(i){const s=Qw[i[2]]||xn[i[2]]||i[2];s&&t.set(i[1],s);continue}const o=r.match(/^w-(.+)$/);if(o){const s=Qw[o[1]]||xn[o[1]]||o[1];s&&t.set("base",s)}}return t}function fD(e){return e0(e,/^min-h-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):min-h-\[([^\]]+)\]$/,t=>t[2])}function yC(e){const t=new Map,n=new Map,r=new Map,i=new Map,o=new Map,s=new Map,l=new Map,c=e.split(/\s+/).filter(Boolean);for(const h of c)for(const[u,f]of[["m-",t],["mt-",n],["mr-",r],["mb-",i],["ml-",o],["mx-",s],["my-",l]]){const m=h.match(new RegExp(`^(sm|md|lg|xl|2xl):${u}(\\d+(?:\\.\\d+)?)$`));if(m&&xn[m[2]]){f.set(m[1],xn[m[2]]);break}const y=h.match(new RegExp(`^${u}(\\d+(?:\\.\\d+)?)$`));if(y&&xn[y[1]]){f.set("base",xn[y[1]]);break}}return{all:t,t:n,r,b:i,l:o,x:s,y:l}}function vC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(items-start|items-end|items-center|items-baseline|items-stretch)$/);if(i&&sf[i[2]]){t.set(i[1],sf[i[2]]);continue}sf[r]&&t.set("base",sf[r])}return t}function bC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(justify-start|justify-end|justify-center|justify-between|justify-around|justify-evenly)$/);if(i&&af[i[2]]){t.set(i[1],af[i[2]]);continue}af[r]&&t.set("base",af[r])}return t}function xC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(rounded-none|rounded-sm|rounded|rounded-md|rounded-lg|rounded-xl|rounded-2xl|rounded-3xl|rounded-full)$/);if(i&&lf[i[2]]){t.set(i[1],lf[i[2]]);continue}lf[r]&&t.set("base",lf[r])}return t}function n0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(hidden|block|flex|grid|inline|inline-block|inline-flex)$/);if(i){t.set(i[1],i[2]==="hidden"?"none":i[2]);continue}hD.includes(r)&&t.set("base",r==="hidden"?"none":r)}return t}function r0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):grid-cols-(\d+)$/);if(i){t.set(i[1],parseInt(i[2],10));continue}const o=r.match(/^grid-cols-(\d+)$/);o&&t.set("base",parseInt(o[1],10))}return t}function dD(e){return e0(e,/^grid-cols-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):grid-cols-\[([^\]]+)\]$/,t=>t[2].replace(/_/g," "))}function i0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);if(i&&rf[i[2]]){t.set(i[1],rf[i[2]]);continue}const o=r.match(/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);o&&rf[o[1]]&&t.set("base",rf[o[1]])}return t}function o0(e){const t=new Map,n=new Map,r=new Map,i=e.split(/\s+/).filter(Boolean);for(const o of i){const s=o.match(/^(sm|md|lg|xl|2xl):px-(\d+(?:\.\d+)?)$/);if(s&&xn[s[2]]){t.set(s[1],xn[s[2]]);continue}const l=o.match(/^px-(\d+(?:\.\d+)?)$/);if(l&&xn[l[1]]){t.set("base",xn[l[1]]);continue}const c=o.match(/^(sm|md|lg|xl|2xl):py-(\d+(?:\.\d+)?)$/);if(c&&xn[c[2]]){n.set(c[1],xn[c[2]]);continue}const h=o.match(/^py-(\d+(?:\.\d+)?)$/);if(h&&xn[h[1]]){n.set("base",xn[h[1]]);continue}const u=o.match(/^(sm|md|lg|xl|2xl):p-(\d+(?:\.\d+)?)$/);if(u&&xn[u[2]]){r.set(u[1],xn[u[2]]);continue}const f=o.match(/^p-(\d+(?:\.\d+)?)$/);f&&xn[f[1]]&&r.set("base",xn[f[1]])}return{px:t,py:n,p:r}}function yy(e){return e.flexDirection.size>0||e.gap.size>0||e.width.size>0||e.minHeight.size>0||e.alignItems.size>0||e.justifyContent.size>0||e.padding.px.size>0||e.padding.py.size>0||e.padding.p.size>0||e.display.size>0||e.gridCols.size>0||e.gridTemplateColumns.size>0||e.textSize.size>0||e.borderRadius.size>0||e.margin.all.size>0||e.margin.t.size>0||e.margin.r.size>0||e.margin.b.size>0||e.margin.l.size>0||e.margin.x.size>0||e.margin.y.size>0}function vy(e){return{flexDirection:pC(e),gap:mC(e),width:gC(e),minHeight:fD(e),margin:yC(e),alignItems:vC(e),justifyContent:bC(e),padding:o0(e),display:n0(e),gridCols:r0(e),gridTemplateColumns:dD(e),textSize:i0(e),borderRadius:xC(e),any:!1}}const ku=uD;function pD(e){return r0(e)}function mD(e,t){let n=e.get("base")??1;const r=["2xl","xl","lg","md","sm"];if(t<=0){for(const i of r)if(e.has(i))return e.get(i);return n}for(const i of["sm","md","lg","xl","2xl"])t>=(ku[i]||0)&&e.has(i)&&(n=e.get(i));return n}function s0(e){return i0(e)}function Vt(e,t,n){let r=e.get("base")??n;for(const i of["sm","md","lg","xl","2xl"])t>=(ku[i]||0)&&e.has(i)&&(r=e.get(i));return r}function bh(e){return o0(e)}function ic(e){return n0(e)}function wC(e){const[t,n]=v.useState(()=>{var i;return((i=e.current)==null?void 0:i.offsetWidth)??0}),r=v.useRef(t);return v.useEffect(()=>{const i=e.current;if(!i)return;const o=i.offsetWidth;o>0&&o!==r.current&&(r.current=o,n(o));const s=new ResizeObserver(l=>{for(const c of l){const h=Math.round(c.contentRect.width);h>0&&h!==r.current&&(r.current=h,n(h))}});return s.observe(i),()=>{s.disconnect()}},[e]),t}function gD(e,t,n){var h,u,f;const i=(Array.isArray(t.tabItems)?t.tabItems:Array.isArray(t.tabs)?t.tabs:[]).filter(m=>!m.condition||!e.evaluateCondition||e.evaluateCondition(m.condition));if(i.length===0)return null;const o=`__tab_${n}`,s=e.sceneData[o]??(t.defaultTab||0),l={width:"100%",display:"flex",flexDirection:"column",...t.className?((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,...c},v.createElement("div",{style:{display:"flex",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,gap:"0"}},i.map((m,y)=>v.createElement("button",{key:`${n}-tab-${y}`,onClick:()=>e.setSceneData(x=>({...x,[o]:y})),style:{padding:"8px 16px",fontSize:"13px",fontWeight:s===y?600:400,color:s===y?e.cfg.colors.primary:e.cfg.colors.textMuted,borderBottom:s===y?`2px solid ${e.cfg.colors.primary}`:"2px solid transparent",background:"none",border:"none",borderBottomStyle:"solid",borderBottomWidth:"2px",borderBottomColor:s===y?e.cfg.colors.primary:"transparent",cursor:"pointer",transition:e.cfg.effects.transition}},m.label||m.title))),v.createElement("div",{style:{padding:"12px 0"}},(Array.isArray((u=i[s])==null?void 0:u.content)?i[s].content:Array.isArray((f=i[s])==null?void 0:f.children)?i[s].children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-tabcontent-${s}`))))}function yD(e,t,n){var s;Array.isArray(t.items)&&!Array.isArray(t.accordionItems)&&(t.accordionItems=t.items);const r=Array.isArray(t.accordionItems)?t.accordionItems:[];if(r.length===0)return null;const i={width:"100%",display:"flex",flexDirection:"column",gap:"1px",...t.className?((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},r.map((l,c)=>{const h=`__acc_${n}_${c}`,u=e.sceneData[h]??(l.defaultOpen||!1);return v.createElement("div",{key:`${n}-acc-${c}`},v.createElement("button",{onClick:()=>e.setSceneData(f=>({...f,[h]:!u})),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"none",border:"none",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.textSecondary,fontSize:e.cfg.typography.baseFontSize,fontWeight:500,cursor:"pointer",transition:e.cfg.effects.transition}},V("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.icon?e.renderIcon(l.icon,14,{color:e.cfg.colors.primary}):null,V("span",null,l.title)),V("span",{style:{transform:u?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",fontSize:"24px"}},"▾")),v.createElement(BI,{initial:!1},u&&v.createElement(Jf.div,{key:`${n}-acc-body-${c}`,initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.3,ease:"easeInOut"},opacity:{duration:.25}},style:{overflow:"hidden"}},v.createElement("div",{style:{padding:"8px 12px",display:"flex",flexDirection:"column",gap:"8px"}},(Array.isArray(l.content)?l.content:typeof l.content=="string"?[{type:"text",text:l.content}]:Array.isArray(l.children)?l.children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-acc-${c}-content`))))))}))}function vD(e,t,n){var y,x,p,b,P;const r=(y=e.paginationState)==null?void 0:y[n],i=t.pagination===!0&&r&&r.total>r.limit,o=t.pagination==="scroll",s=r?Math.ceil(r.total/r.limit):0,l=t.className||"flex flex-col gap-3 w-full",c=((x=e.parseClassNameResponsive)==null?void 0:x.call(e,l,n))??e.parseClassName(l);t.rawStyle&&Object.assign(c,t.rawStyle);const h=(p=e.loading)==null?void 0:p[n],u=(b=e.listData)==null?void 0:b[n],f=Array.isArray(u)?u:[],m=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{};return v.createElement("div",{key:n,className:l,style:c,"data-component-key":n,...m},h&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},V("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),!h&&f.length===0&&t.emptyComponent&&e.renderComponent(t.emptyComponent,0,`${n}-empty`),!h&&t.selectable&&e.sceneData._selectMode&&f.length>0&&V("div",{key:`${n}-sel-hdr`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:((P=t.selectionStyle)==null?void 0:P.headerPadding)||"0.5rem 2rem"}},V("button",{type:"button",onClick:()=>{const S=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[],A=f.map((w,T)=>String(w.id||T)),E=A.length>0&&A.every(w=>S.includes(w));e.setSceneData(w=>({...w,_selIds:E?[]:A}))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textSecondary,fontSize:"12px",fontFamily:"inherit",padding:"4px 0"}},(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).filter(S=>f.some(A=>String(A.id)===S)).length===f.filter(S=>S.id).length&&f.length>0?"Deselect all":"Select all"),(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length>0?V("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},...(Array.isArray(t.selectActions)?t.selectActions:[]).map((S,A)=>V("button",{key:A,type:"button",onClick:()=>{var w;const E=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[];E.length!==0&&((w=e.runBulkSelectAction)==null||w.call(e,S,t.dataSource,n,E))},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,transition:"all 0.15s ease",padding:"0"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor=e.cfg.colors.border,E.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent",E.currentTarget.style.color=e.cfg.colors.textSecondary}},e.renderIcon(S.icon,12))),V("span",{style:{fontSize:"12px",color:e.cfg.colors.textMuted}},`${(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length} selected`)):null),!h&&f.length>0&&(()=>{var G,X,lt,H,et;const S=(G=t.groupBy)==null?void 0:G.field,A=it=>{const st=it==null?void 0:it[S];if(st&&typeof st=="object"&&st._seconds)return st._seconds*1e3;const ct=Date.parse(st);return isNaN(ct)?0:ct},E=it=>{if(!it)return"Earlier";const st=new Date(it),ct=new Date,yt=Et=>`${Et.getFullYear()}-${Et.getMonth()}-${Et.getDate()}`;if(yt(st)===yt(ct))return"Today";const vt=new Date(ct);return vt.setDate(ct.getDate()-1),yt(st)===yt(vt)?"Yesterday":st.toLocaleDateString()},T=((X=t.sort)==null?void 0:X.field)||S?[...f].sort((it,st)=>{var yt;const ct=A(st)-A(it);return((yt=t.sort)==null?void 0:yt.direction)==="asc"?-ct:ct}):f,O=String(e.sceneData.recordingSearchApplied||"").trim().toLowerCase(),[I,N]=String(e.sceneData.recordingDateFilterApplied||"").split("|"),F=I?Date.parse(`${I}T00:00:00`):0,D=N?Date.parse(`${N}T23:59:59.999`):Number.POSITIVE_INFINITY,j=(lt=t.itemsFilter)!=null&&lt.eq?e.interpolateText(String(t.itemsFilter.eq)):"",U=((H=t.itemsFilter)!=null&&H.field&&j?T.filter(it=>String(it==null?void 0:it[t.itemsFilter.field])===j):T).filter(it=>{const st=!O||[it.url,it.title,it.prompt].some(yt=>String(yt||"").toLowerCase().includes(O)),ct=A(it);return st&&ct>=F&&ct<=D}),z={};if(S)for(const it of U)(z[et=E(A(it))]||(z[et]=[])).push(it);const Y=(it,st)=>{var ct,yt,vt,Et,Tt,ft,dt,Ct;if(t.renderItem){const nt=JSON.parse(JSON.stringify(t.renderItem)),Lt={...it};if(t.labelField&&t.labelMap){const Wt=String(t.labelField.split(".").reduce((ee,ne)=>ee==null?void 0:ee[ne],it)??"");Lt.label=t.labelMap[Wt]??""}const bt={};if(Array.isArray(nt.children)){for(const Wt of nt.children)if(Wt.content){const ee=Wt.content.match(/^\{\{(\w+)\}\}$/);if(ee){const ne=ee[1],Yt=it[ne];Array.isArray(Yt)&&(bt[ne]=Yt)}}}const ie=JSON.stringify(nt).replace(/\{\{([\w.]+)(?:\|(date|time|datetime|timeago))?\}\}/g,(Wt,ee,ne)=>{const Yt=ee.split(".").reduce((oe,Me)=>oe==null?void 0:oe[Me],Lt);if(Array.isArray(Yt))return Wt;if(Yt==null)return"";if(ne){const oe=Yt&&typeof Yt=="object"&&"_seconds"in Yt?new Date(Yt._seconds*1e3):new Date(Yt);if(!isNaN(oe.getTime())){if(ne==="timeago"){const Me=Math.floor((Date.now()-oe.getTime())/6e4);if(Me<1)return"just now";if(Me<60)return`${Me}m ago`;const se=Math.floor(Me/60);if(se<24)return`${se}h ago`;const on=Math.floor(se/24);return on<7?`${on}d ago`:oe.toLocaleDateString()}return ne==="date"?oe.toLocaleDateString():ne==="time"?oe.toLocaleTimeString():oe.toLocaleString()}}return typeof Yt=="string"?Yt.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):Yt!==void 0?JSON.stringify(Yt):""}),Xt=JSON.parse(ie);Xt.type==="widget"&&Xt.widgetId&&(Xt.props={...Lt,...Xt.props||{}});const Ne=Wt=>{if(!(!Wt||typeof Wt!="object")){Wt.condition&&(Wt.__conditionBase=Lt);for(const ee of Wt.children||[])Ne(ee)}};if(Ne(Xt),Xt.children&&(Xt.children=Xt.children.map(Wt=>{var Yt;const ee=Wt.fieldType||"text",ne=(Yt=Wt.content)==null?void 0:Yt.match(/^\{\{(\w+)\}\}$/);if(ne){const oe=ne[1],Me=bt[oe];if(Me)return ee==="dropdown"?{...Wt,type:"select",content:void 0,placeholder:Wt.fieldPlaceholder||`Select ${oe}...`,options:Me.map(se=>({label:typeof se=="object"?se.label||se.name||JSON.stringify(se):String(se),value:typeof se=="object"?se.value||se.id||JSON.stringify(se):String(se)})),name:`${n}-${st}-${oe}`,className:Wt.className||"w-full text-sm bg-slate-700 border border-slate-500 text-white rounded-lg px-3 py-1.5"}:ee==="multiselect"?{...Wt,type:"container",content:void 0,className:Wt.className||"flex flex-col gap-1 w-full",children:[...Wt.fieldPlaceholder?[{type:"text",content:Wt.fieldPlaceholder,className:"text-xs text-gray-400 mb-1"}]:[{type:"text",content:`Select ${oe}`,className:"text-xs text-gray-400 mb-1"}],...Me.map((se,on)=>({type:"checkbox",label:typeof se=="object"?se.label||se.name||JSON.stringify(se):String(se),name:`${n}-${st}-${oe}-${on}`,className:"text-sm text-gray-200"}))]}:ee==="image-grid"?{...Wt,type:"container",content:void 0,className:"flex flex-row gap-2 w-full overflow-x-auto py-1",children:Me.slice(0,10).map((se,on)=>({type:"image",src:typeof se=="string"?se:se.url||se.src||"",alt:`${oe} ${on+1}`,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0"}))}:{...Wt,type:"container",content:void 0,className:"flex flex-col gap-1 w-full",children:[{type:"text",content:`⚠ "${oe}" is an array (${Me.length} items)`,className:"text-xs font-semibold text-amber-400"},{type:"text",content:"Use ⚡ to fetch fields, then set type in sidebar",className:"text-xs text-amber-300 opacity-75"}]}}return ee==="image"&&Wt.content&&!Wt.content.includes("{{")?{...Wt,type:"image",src:Wt.content,alt:Wt.content,content:void 0,className:Wt.className||"w-full h-32 rounded-lg object-cover"}:Wt})),t.selectable&&e.sceneData._selectMode){const Wt=String(it.id||st),ee=Array.isArray(e.sceneData._selIds)&&e.sceneData._selIds.map(String).includes(Wt),ne=Yt=>Yt?[Yt.text,Yt.content,...Yt.children?Yt.children.flatMap(ne):[]].filter(oe=>typeof oe=="string"&&oe.trim()&&!oe.includes("{{")):[];return Xt.text||Xt.label||ne(Xt).slice(0,2).join(" — ")||String(it.id||st),V("div",{key:`${n}-item-${st}`,className:(ct=t.selectionStyle)==null?void 0:ct.className,style:{position:"relative",width:"100%",textAlign:"left",padding:"1rem 2rem",border:`1px solid ${ee?((yt=t.selectionStyle)==null?void 0:yt.selectedBorderColor)||e.cfg.colors.accent||"#fff":((vt=t.selectionStyle)==null?void 0:vt.borderColor)||e.cfg.colors.border}`,borderRadius:((Et=t.selectionStyle)==null?void 0:Et.borderRadius)||e.cfg.components.inputRadius||"8px",marginBottom:"0.5rem",backgroundColor:ee?((Tt=t.selectionStyle)==null?void 0:Tt.selectedBackgroundColor)||e.cfg.colors.surface:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontFamily:"inherit",fontSize:"14px",fontWeight:ee?600:400,transition:"all 0.15s ease",outline:"none"}},V("div",{style:{position:"absolute",inset:0,zIndex:1,pointerEvents:"none"}},V("button",{type:"button","aria-label":ee?"Deselect item":"Select item",onClick:()=>{e.setSceneData(Yt=>{const oe=Array.isArray(Yt._selIds)?Yt._selIds.map(String):[];return{...Yt,_selIds:oe.includes(Wt)?oe.filter(Me=>Me!==Wt):[...oe,Wt]}})},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",position:"absolute",top:"50%",left:"1.25rem",transform:"translateY(-50%)",pointerEvents:"auto",border:`1px solid ${ee?((ft=t.selectionStyle)==null?void 0:ft.selectedBorderColor)||e.cfg.colors.accent||"#fff":((dt=t.selectionStyle)==null?void 0:dt.borderColor)||e.cfg.colors.border}`,borderRadius:"5px",backgroundColor:ee?((Ct=t.selectionStyle)==null?void 0:Ct.selectedBorderColor)||e.cfg.colors.accent||"#fff":"transparent",color:ee?e.cfg.colors.background:"transparent",transition:"all 0.15s ease"}},ee?e.renderIcon("check",12):null)),e.renderComponent(Xt,st,`${n}-item`))}return V("div",{key:`${n}-row-${st}`,style:{display:"contents"},onClickCapture:()=>{e.rowContextRef&&(e.rowContextRef.current=it)}},e.renderComponent(Xt,st,`${n}-item`))}return null};return S?Object.entries(z).map(([it,st],ct)=>V("div",{key:`${n}-group-${ct}`,style:{display:"flex",flexDirection:"column",gap:"6px"}},V("div",{key:`${n}-group-hdr-${ct}`,style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:e.cfg.colors.textMuted,padding:"10px 4px 2px"}},it),st.map(Y))):U.map(Y)})(),o&&(r==null?void 0:r.hasMore)&&V("div",{"data-bf-scroll-load":n,style:{height:"48px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",...h&&((r==null?void 0:r.page)??0)>0?{}:{pointerEvents:"none",opacity:.55}}},h&&((r==null?void 0:r.page)??0)>0?V("div",{style:{width:"18px",height:"18px",border:"2px solid rgba(128,128,128,0.25)",borderTopColor:e.cfg.colors.primary,borderRadius:"50%",animation:"bf-spin 0.7s linear infinite"}}):V("div",{style:{width:"18px",height:"2px",borderRadius:"2px",background:e.cfg.colors.textMuted,opacity:.4}})),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),V("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${s}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function bD({api:e,c:t,componentKey:n}){var F,D,j,K;const r=(F=e.paginationState)==null?void 0:F[n],i=t.pagination!==!1&&r&&r.total>r.limit,o=r?Math.ceil(r.total/r.limit):0,s=t.className||"w-full overflow-x-auto rounded-xl bg-gray-800/50 border border-gray-700/50",l=((D=e.parseClassNameResponsive)==null?void 0:D.call(e,s,n))??e.parseClassName(s);t.rawStyle&&Object.assign(l,t.rawStyle);const c=(j=e.loading)==null?void 0:j[n],h=(K=e.listData)==null?void 0:K[n],u=Array.isArray(h)?h:[],f=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{},m=!!t.sortable,y=t.sortMode==="client"?"client":"server",[x,p]=v.useState(null),[b,P]=v.useState({}),S=v.useMemo(()=>{if(!x||y!=="client")return u;const U=x.dir==="asc"?1:-1;return[...u].sort((z,Y)=>{const G=z[x.key],X=Y[x.key];return G===X?0:G==null?1:X==null?-1:String(G).localeCompare(String(X),void 0,{numeric:!0})*U})},[u,x,y]),A=U=>{if(!m&&!U.sortable)return;const z=U.field||U.key;let Y=null;!x||x.key!==z?Y={key:z,dir:"asc"}:x.dir==="asc"&&(Y={key:z,dir:"desc"}),p(Y),y==="server"&&Y&&e.fetchListData(t.dataSource,n,0,(r==null?void 0:r.limit)||t.pageSize||10,Y.key,Y.dir)},E=(U,z)=>U.replace(/\{\{([\w.]+)(?:\s*\|\|\s*([^}]+))?\}\}/g,(Y,G,X)=>{const lt=G.split(".").reduce((H,et)=>H==null?void 0:H[et],z);return lt==null||lt===""?X??"":String(lt)}),w=async(U,z)=>{var X;const Y=b[U.id??""]||{},G=z.filter(lt=>lt.editable&&Y[lt.field||lt.key]!==void 0);for(const lt of G){const H=lt.field||lt.key,et=lt.onCellChange||t.onSave;if(!et)continue;const it=et.replace(/\{\{field\}\}/g,JSON.stringify(Y[H]));if(it.startsWith("sdk:"))await e.handleButtonClick(E(it,U),{});else{const st=E(it,U);await fetch(st,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[H]:Y[H]})})}}G.length&&((X=e.showToast)==null||X.call(e,(G.length===1,"Saved"),"success"),P(lt=>{const H={...lt};return delete H[U.id??""],H}),e.fetchListData(t.dataSource,n,(r==null?void 0:r.page)||0,(r==null?void 0:r.limit)||t.pageSize||10))},T=(U,z,Y)=>{const G=z.field||z.key,X=U.id??"";P(lt=>({...lt,[X]:{...lt[X]||{},[G]:Y}}))},O=(U,z)=>{const Y=U.field||U.key,G=z.id??"",X=b[G]||{},lt=X[Y]!==void 0?X[Y]:z[Y],H=U.fieldType||"text",et={style:{width:"100%",background:"transparent",color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",padding:"2px 6px",fontSize:"13px",fontFamily:"inherit"}},it=()=>{U.onCellChange&&X[U.key]!==void 0&&w(z,[U])};if(H==="select"||H==="dropdown")return V("select",{...et,value:String(lt??""),onChange:st=>{T(z,U,st.target.value),U.onCellChange&&w(z,[U])},children:(Array.isArray(U.fieldOptions)?U.fieldOptions:[]).map((st,ct)=>V("option",{key:ct,value:st.value,children:st.label??st.value}))});if(H==="multiselect"){const st=Array.isArray(lt)?lt:[];return V("div",{style:{display:"flex",flexDirection:"column",gap:2}},(Array.isArray(U.fieldOptions)?U.fieldOptions:[]).map((ct,yt)=>{const vt=st.includes(ct.value);return V("label",{key:yt,style:{display:"flex",alignItems:"center",gap:4,fontSize:12}},V("input",{type:"checkbox",checked:vt,onChange:Et=>{const Tt=Et.target.checked?[...st,ct.value]:st.filter(ft=>ft!==ct.value);T(z,U,Tt),U.onCellChange&&w(z,[U])}}),V("span",{children:ct.label??ct.value}))}))}return H==="image"?V("div",{style:{display:"flex",alignItems:"center",gap:6}},lt?V("img",{src:String(lt),alt:U.label,style:{width:32,height:32,borderRadius:4,objectFit:"cover"}}):null,V("input",{...et,value:String(lt??""),placeholder:U.fieldPlaceholder||"Image URL",onChange:st=>T(z,U,st.target.value),onBlur:it})):V("input",{...et,type:H==="number"?"number":"text",value:String(lt??""),placeholder:U.fieldPlaceholder||"",onChange:st=>T(z,U,H==="number"?Number(st.target.value):st.target.value),onBlur:it})},I=U=>{const z=b[U.id??""];return!!z&&Object.keys(z).some(Y=>{var G;return(G=t.columns)==null?void 0:G.some(X=>X.editable&&(X.field||X.key)===Y)})},N=!!t.onSave;return v.createElement("div",{key:n,className:s,style:l,"data-component-key":n,...f},c&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},V("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),v.createElement("table",{className:"w-full"},Array.isArray(t.columns)&&v.createElement("thead",{className:"bg-gray-900/50"},v.createElement("tr",{},t.columns.map(U=>v.createElement("th",{key:U.key,className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},(m||U.sortable)&&U.sortable!==!1?(()=>{const z=x&&x.key===U.key?x:null;return V("button",{type:"button",onClick:()=>A(U),style:{background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",cursor:"pointer",padding:0},children:`${U.label||U.key}${z?z.dir==="asc"?" ↑":" ↓":" ⇅"}`})})():U.label||U.key)),N&&v.createElement("th",{key:"__save",className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},""))),v.createElement("tbody",{className:"divide-y divide-gray-700/50"},S.map((U,z)=>{var Y;return v.createElement("tr",{key:U.id??z,className:"hover:bg-gray-700/30 transition-colors"},(Y=t.columns)==null?void 0:Y.map(G=>v.createElement("td",{key:G.key,className:"px-4 py-3 text-sm text-white"},G.editable?O(G,U):G.template?E(G.template,U):(()=>{const lt=(G.field||G.key).split(".").reduce((H,et)=>H==null?void 0:H[et],U);return lt==null||lt===""?"":String(lt)})())),N&&v.createElement("td",{key:"__save-cell",className:"px-4 py-3 text-sm"},V("button",{type:"button",disabled:!I(U)||c,onClick:()=>w(U,t.columns||[]),className:"px-3 py-1 rounded text-xs font-semibold border transition-all disabled:opacity-40 disabled:cursor-not-allowed",style:{background:I(U)?e.cfg.colors.primary:"transparent",color:I(U)?"#ffffff":e.cfg.colors.textSecondary,borderColor:e.cfg.colors.border},children:"Save"})))}))),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),V("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${o}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function xD(e,t,n){return v.createElement(bD,{api:e,c:t,componentKey:n})}function Re(e){var t=e.width,n=e.height;if(t<0)throw new Error("Negative width is not allowed for Size");if(n<0)throw new Error("Negative height is not allowed for Size");return{width:t,height:n}}function na(e,t){return e.width===t.width&&e.height===t.height}var wD=function(){function e(t){var n=this;this._resolutionListener=function(){return n._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t){var n=this,r={next:t};return this._observers.push(r),{unsubscribe:function(){n._observers=n._observers.filter(function(i){return i!==r})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var t=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(t,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach(function(n){return n.next(t._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function _D(e){return new wD(e)}var SD=function(){function e(t,n,r){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=Re({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=n??function(o){return o},this._allowResizeObserver=(i=r==null?void 0:r.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var t,n;if(this._canvasElement===null)throw new Error("Object is disposed");(t=this._canvasElementResizeObserver)===null||t===void 0||t.disconnect(),this._canvasElementResizeObserver=null,(n=this._devicePixelRatioObservable)===null||n===void 0||n.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitmapSize",{get:function(){return Re({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=Re(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(n){return n!==t})},Object.defineProperty(e.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(n){return n!==t})},e.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)}},e.prototype._resizeBitmap=function(t){var n=this.bitmapSize;na(n,t)||(this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(n,t))},e.prototype._emitBitmapSizeChanged=function(t,n){var r=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._suggestNewBitmapSize=function(t){var n=this._suggestedBitmapSize,r=Re(this._transformBitmapSize(t,this._canvasElementClientSize)),i=na(this.bitmapSize,r)?null:r;n===null&&i===null||n!==null&&i!==null&&na(n,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(n,i))},e.prototype._emitSuggestedBitmapSizeChanged=function(t,n){var r=this;this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._chooseAndInitObserver=function(){var t=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}AD().then(function(n){return n?t._initResizeObserver():t._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var t=this;if(this._canvasElement!==null){var n=t_(this._canvasElement);if(n===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=_D(n),this._devicePixelRatioObservable.subscribe(function(){return t._invalidateBitmapSize()}),this._invalidateBitmapSize()}},e.prototype._invalidateBitmapSize=function(){var t,n;if(this._canvasElement!==null){var r=t_(this._canvasElement);if(r!==null){var i=(n=(t=this._devicePixelRatioObservable)===null||t===void 0?void 0:t.value)!==null&&n!==void 0?n:r.devicePixelRatio,o=this._canvasElement.getClientRects(),s=o[0]!==void 0?TD(o[0],i):Re({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(s)}}},e.prototype._initResizeObserver=function(){var t=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(n){var r=n.find(function(s){return s.target===t._canvasElement});if(!(!r||!r.devicePixelContentBoxSize||!r.devicePixelContentBoxSize[0])){var i=r.devicePixelContentBoxSize[0],o=Re({width:i.inlineSize,height:i.blockSize});t._suggestNewBitmapSize(o)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},e}();function PD(e,t){return new SD(e,t.transform,t.options)}function t_(e){return e.ownerDocument.defaultView}function AD(){return new Promise(function(e){var t=new ResizeObserver(function(n){e(n.every(function(r){return"devicePixelContentBoxSize"in r})),t.disconnect()});t.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function TD(e,t){return Re({width:Math.round(e.left*t+e.width*t)-Math.round(e.left*t),height:Math.round(e.top*t+e.height*t)-Math.round(e.top*t)})}var ED=function(){function e(t,n,r){if(n.width===0||n.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=n,r.width===0||r.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=r,this._context=t}return e.prototype.useMediaCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),t({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),t({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function la(e,t){var n=e.canvasElementClientSize;if(n.width===0||n.height===0)return null;var r=e.bitmapSize;if(r.width===0||r.height===0)return null;var i=e.canvasElement.getContext("2d",t);return i===null?null:new ED(i,n,r)}/*!
13
+ `),()=>{document.head.removeChild(u)}},[t]),Ze.jsx(LI,{isPresent:t,childRef:r,sizeRef:i,children:Yn.cloneElement(e,{ref:r})})}const jI=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const l=_b(DI),c=v.useId(),h=v.useCallback(f=>{l.set(f,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),u=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:h,register:f=>(l.set(f,!1),()=>l.delete(f))}),o?[Math.random(),h]:[n,h]);return v.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),Yn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),s==="popLayout"&&(e=Ze.jsx(NI,{isPresent:n,children:e})),Ze.jsx(xp.Provider,{value:u,children:e})};function DI(){return new Map}function DT(e=!0){const t=v.useContext(xp);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=v.useId();v.useEffect(()=>{e&&i(o)},[e]);const s=v.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Qh=e=>e.key||"";function Nx(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Pb=typeof window<"u",BT=Pb?v.useLayoutEffect:v.useEffect,BI=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1})=>{const[l,c]=DT(s),h=v.useMemo(()=>Nx(e),[e]),u=s&&!l?[]:h.map(Qh),f=v.useRef(!0),m=v.useRef(h),y=_b(()=>new Map),[x,p]=v.useState(h),[b,P]=v.useState(h);BT(()=>{f.current=!1,m.current=h;for(let E=0;E<b.length;E++){const w=Qh(b[E]);u.includes(w)?y.delete(w):y.get(w)!==!0&&y.set(w,!1)}},[b,u.length,u.join("-")]);const S=[];if(h!==x){let E=[...h];for(let w=0;w<b.length;w++){const T=b[w],O=Qh(T);u.includes(O)||(E.splice(w,0,T),S.push(T))}o==="wait"&&S.length&&(E=S),P(Nx(E)),p(h);return}process.env.NODE_ENV!=="production"&&o==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=v.useContext(wb);return Ze.jsx(Ze.Fragment,{children:b.map(E=>{const w=Qh(E),T=s&&!l?!1:h===b||u.includes(w),O=()=>{if(y.has(w))y.set(w,!0);else return;let I=!0;y.forEach(N=>{N||(I=!1)}),I&&(A==null||A(),P(m.current),s&&(c==null||c()),r&&r())};return Ze.jsx(jI,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:i,mode:o,onExitComplete:T?void 0:O,children:E},w)})})},or=e=>e;let ec=or,Xo=or;process.env.NODE_ENV!=="production"&&(ec=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Xo=(e,t)=>{if(!e)throw new Error(t)});function Ab(e){let t;return()=>(t===void 0&&(t=e()),t)}const vl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},yi=e=>e*1e3,oo=e=>e/1e3,zI={useManualTiming:!1};function FI(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(h){o.has(h)&&(c.schedule(h),e()),h(s)}const c={schedule:(h,u=!1,f=!1)=>{const y=f&&r?t:n;return u&&o.add(h),y.has(h)||y.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(s=h,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(l),t.clear(),r=!1,i&&(i=!1,c.process(h))}};return c}const tf=["read","resolveKeyframes","update","preRender","render","postRender"],WI=40;function zT(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=tf.reduce((P,S)=>(P[S]=FI(o),P),{}),{read:l,resolveKeyframes:c,update:h,preRender:u,render:f,postRender:m}=s,y=()=>{const P=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(P-i.timestamp,WI),1),i.timestamp=P,i.isProcessing=!0,l.process(i),c.process(i),h.process(i),u.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,i.isProcessing||e(y)};return{schedule:tf.reduce((P,S)=>{const A=s[S];return P[S]=(E,w=!1,T=!1)=>(n||x(),A.schedule(E,w,T)),P},{}),cancel:P=>{for(let S=0;S<tf.length;S++)s[tf[S]].cancel(P)},state:i,steps:s}}const{schedule:He,cancel:Jo,state:Rn,steps:$m}=zT(typeof requestAnimationFrame<"u"?requestAnimationFrame:or,!0),FT=v.createContext({strict:!1}),jx={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},bl={};for(const e in jx)bl[e]={isEnabled:t=>jx[e].some(n=>!!t[n])};function VI(e){for(const t in e)bl[t]={...bl[t],...e[t]}}const UI=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Hf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||UI.has(e)}let WT=e=>!Hf(e);function HI(e){e&&(WT=t=>t.startsWith("on")?!Hf(t):e(t))}try{HI(require("@emotion/is-prop-valid").default)}catch{}function qI(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(WT(i)||n===!0&&Hf(i)||!t&&!Hf(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Dx=new Set;function wp(e,t,n){e||Dx.has(t)||(console.warn(t),Dx.add(t))}function GI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&wp(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const _p=v.createContext({});function Tu(e){return typeof e=="string"||Array.isArray(e)}function Sp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Tb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Eb=["initial",...Tb];function Pp(e){return Sp(e.animate)||Eb.some(t=>Tu(e[t]))}function VT(e){return!!(Pp(e)||e.variants)}function ZI(e,t){if(Pp(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tu(n)?n:void 0,animate:Tu(r)?r:void 0}}return e.inherit!==!1?t:{}}function YI(e){const{initial:t,animate:n}=ZI(e,v.useContext(_p));return v.useMemo(()=>({initial:t,animate:n}),[Bx(t),Bx(n)])}function Bx(e){return Array.isArray(e)?e.join(" "):e}const KI=Symbol.for("motionComponentSymbol");function Xa(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function XI(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Xa(n)&&(n.current=r))},[t])}const Cb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),JI="framerAppearId",UT="data-"+Cb(JI),{schedule:Ob}=zT(queueMicrotask,!1),HT=v.createContext({});function QI(e,t,n,r,i){var o,s;const{visualElement:l}=v.useContext(_p),c=v.useContext(FT),h=v.useContext(xp),u=v.useContext(Sb).reducedMotion,f=v.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:u}));const m=f.current,y=v.useContext(HT);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&tR(f.current,n,i,y);const x=v.useRef(!1);v.useInsertionEffect(()=>{m&&x.current&&m.update(n,h)});const p=n[UT],b=v.useRef(!!p&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,p))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,p)));return BT(()=>{m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),Ob.render(m.render),b.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)===null||P===void 0||P.call(window,p)}),b.current=!1))}),m}function tR(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:l,layoutScroll:c,layoutRoot:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:qT(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||l&&Xa(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:h})}function qT(e){if(e)return e.options.allowProjection!==!1?e.projection:qT(e.parent)}function eR({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var o,s;e&&VI(e);function l(h,u){let f;const m={...v.useContext(Sb),...h,layoutId:nR(h)},{isStatic:y}=m,x=YI(h),p=r(h,y);if(!y&&Pb){rR(m,e);const b=iR(m);f=b.MeasureLayout,x.visualElement=QI(i,p,m,t,b.ProjectionNode)}return Ze.jsxs(_p.Provider,{value:x,children:[f&&x.visualElement?Ze.jsx(f,{visualElement:x.visualElement,...m}):null,n(i,h,XI(p,x.visualElement,u),p,y,x.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(s=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&s!==void 0?s:""})`}`;const c=v.forwardRef(l);return c[KI]=i,c}function nR({layoutId:e}){const t=v.useContext(wb).id;return t&&e!==void 0?t+"-"+e:e}function rR(e,t){const n=v.useContext(FT).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ec(!1,r):Xo(!1,r)}}function iR(e){const{drag:t,layout:n}=bl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const oR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Mb(e){return typeof e!="string"||e.includes("-")?!1:!!(oR.indexOf(e)>-1||/[A-Z]/u.test(e))}function zx(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function kb(e,t,n,r){if(typeof t=="function"){const[i,o]=zx(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=zx(r);t=t(n!==void 0?n:e.custom,i,o)}return t}const ey=e=>Array.isArray(e),sR=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),aR=e=>ey(e)?e[e.length-1]||0:e,Vn=e=>!!(e&&e.getVelocity);function Lf(e){const t=Vn(e)?e.get():e;return sR(t)?t.toValue():t}function lR({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,o){const s={latestValues:cR(r,i,o,e),renderState:t()};return n&&(s.onMount=l=>n({props:r,current:l,...s}),s.onUpdate=l=>n(l)),s}const GT=e=>(t,n)=>{const r=v.useContext(_p),i=v.useContext(xp),o=()=>lR(e,t,r,i);return n?o():_b(o)};function cR(e,t,n,r){const i={},o=r(e,{});for(const m in o)i[m]=Lf(o[m]);let{initial:s,animate:l}=e;const c=Pp(e),h=VT(e);t&&h&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?l:s;if(f&&typeof f!="boolean"&&!Sp(f)){const m=Array.isArray(f)?f:[f];for(let y=0;y<m.length;y++){const x=kb(e,m[y]);if(x){const{transitionEnd:p,transition:b,...P}=x;for(const S in P){let A=P[S];if(Array.isArray(A)){const E=u?A.length-1:0;A=A[E]}A!==null&&(i[S]=A)}for(const S in p)i[S]=p[S]}}}return i}const nc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ba=new Set(nc),ZT=e=>t=>typeof t=="string"&&t.startsWith(e),YT=ZT("--"),uR=ZT("var(--"),$b=e=>uR(e)?hR.test(e.split("/*")[0].trim()):!1,hR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,KT=(e,t)=>t&&typeof e=="number"?t.transform(e):e,uo=(e,t,n)=>n>t?t:n<e?e:n,rc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Eu={...rc,transform:e=>uo(0,1,e)},ef={...rc,default:1},mh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Do=mh("deg"),vi=mh("%"),Ht=mh("px"),fR=mh("vh"),dR=mh("vw"),Fx={...vi,parse:e=>vi.parse(e)/100,transform:e=>vi.transform(e*100)},pR={borderWidth:Ht,borderTopWidth:Ht,borderRightWidth:Ht,borderBottomWidth:Ht,borderLeftWidth:Ht,borderRadius:Ht,radius:Ht,borderTopLeftRadius:Ht,borderTopRightRadius:Ht,borderBottomRightRadius:Ht,borderBottomLeftRadius:Ht,width:Ht,maxWidth:Ht,height:Ht,maxHeight:Ht,top:Ht,right:Ht,bottom:Ht,left:Ht,padding:Ht,paddingTop:Ht,paddingRight:Ht,paddingBottom:Ht,paddingLeft:Ht,margin:Ht,marginTop:Ht,marginRight:Ht,marginBottom:Ht,marginLeft:Ht,backgroundPositionX:Ht,backgroundPositionY:Ht},mR={rotate:Do,rotateX:Do,rotateY:Do,rotateZ:Do,scale:ef,scaleX:ef,scaleY:ef,scaleZ:ef,skew:Do,skewX:Do,skewY:Do,distance:Ht,translateX:Ht,translateY:Ht,translateZ:Ht,x:Ht,y:Ht,z:Ht,perspective:Ht,transformPerspective:Ht,opacity:Eu,originX:Fx,originY:Fx,originZ:Ht},Wx={...rc,transform:Math.round},Ib={...pR,...mR,zIndex:Wx,size:Ht,fillOpacity:Eu,strokeOpacity:Eu,numOctaves:Wx},gR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yR=nc.length;function vR(e,t,n){let r="",i=!0;for(let o=0;o<yR;o++){const s=nc[o],l=e[s];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(s.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const h=KT(l,Ib[s]);if(!c){i=!1;const u=gR[s]||s;r+=`${u}(${h}) `}n&&(t[s]=h)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Rb(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,l=!1;for(const c in t){const h=t[c];if(ba.has(c)){s=!0;continue}else if(YT(c)){i[c]=h;continue}else{const u=KT(h,Ib[c]);c.startsWith("origin")?(l=!0,o[c]=u):r[c]=u}}if(t.transform||(s||n?r.transform=vR(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:h="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${h} ${u}`}}const bR={offset:"stroke-dashoffset",array:"stroke-dasharray"},xR={offset:"strokeDashoffset",array:"strokeDasharray"};function wR(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?bR:xR;e[o.offset]=Ht.transform(-r);const s=Ht.transform(t),l=Ht.transform(n);e[o.array]=`${s} ${l}`}function Vx(e,t,n){return typeof e=="string"?e:Ht.transform(t+n*e)}function _R(e,t,n){const r=Vx(t,e.x,e.width),i=Vx(n,e.y,e.height);return`${r} ${i}`}function Lb(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:l=1,pathOffset:c=0,...h},u,f){if(Rb(e,h,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y,dimensions:x}=e;m.transform&&(x&&(y.transform=m.transform),delete m.transform),x&&(i!==void 0||o!==void 0||y.transform)&&(y.transformOrigin=_R(x,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&wR(m,s,l,c,!1)}const Nb=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),XT=()=>({...Nb(),attrs:{}}),jb=e=>typeof e=="string"&&e.toLowerCase()==="svg";function JT(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const QT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tE(e,t,n,r){JT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(QT.has(i)?i:Cb(i),t.attrs[i])}const qf={};function SR(e){Object.assign(qf,e)}function eE(e,{layout:t,layoutId:n}){return ba.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qf[e]||e==="opacity")}function Db(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(Vn(i[s])||t.style&&Vn(t.style[s])||eE(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function nE(e,t,n){const r=Db(e,t,n);for(const i in e)if(Vn(e[i])||Vn(t[i])){const o=nc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function PR(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Ux=["x","y","width","height","cx","cy","r"],AR={useVisualState:GT({scrapeMotionValuesFromProps:nE,createRenderState:XT,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let o=!!e.drag;if(!o){for(const l in i)if(ba.has(l)){o=!0;break}}if(!o)return;let s=!t;if(t)for(let l=0;l<Ux.length;l++){const c=Ux[l];e[c]!==t[c]&&(s=!0)}s&&He.read(()=>{PR(n,r),He.render(()=>{Lb(r,i,jb(n.tagName),e.transformTemplate),tE(n,r)})})}})},TR={useVisualState:GT({scrapeMotionValuesFromProps:Db,createRenderState:Nb})};function rE(e,t,n){for(const r in t)!Vn(t[r])&&!eE(r,n)&&(e[r]=t[r])}function ER({transformTemplate:e},t){return v.useMemo(()=>{const n=Nb();return Rb(n,t,e),Object.assign({},n.vars,n.style)},[t])}function CR(e,t){const n=e.style||{},r={};return rE(r,n,e),Object.assign(r,ER(e,t)),r}function OR(e,t){const n={},r=CR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function MR(e,t,n,r){const i=v.useMemo(()=>{const o=XT();return Lb(o,t,jb(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};rE(o,e.style,e),i.style={...o,...i.style}}return i}function kR(e=!1){return(n,r,i,{latestValues:o},s)=>{const c=(Mb(n)?MR:OR)(r,o,s,n),h=qI(r,typeof n=="string",e),u=n!==v.Fragment?{...h,...c,ref:i}:{},{children:f}=r,m=v.useMemo(()=>Vn(f)?f.get():f,[f]);return v.createElement(n,{...u,children:m})}}function $R(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...Mb(r)?AR:TR,preloadedFeatures:e,useRender:kR(i),createVisualElement:t,Component:r};return eR(s)}}function iE(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Ap(e,t,n){const r=e.getProps();return kb(r,t,n!==void 0?n:r.custom,e)}const IR=Ab(()=>window.ScrollTimeline!==void 0);class RR{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(IR()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class LR extends RR{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Bb(e,t){return e?e[t]||e.default||e:void 0}const ny=2e4;function oE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ny;)t+=n,r=e.next(t);return t>=ny?1/0:t}function zb(e){return typeof e=="function"}function Hx(e,t){e.timeline=t,e.onfinish=null}const Fb=e=>Array.isArray(e)&&typeof e[0]=="number",NR={linearEasing:void 0};function jR(e,t){const n=Ab(e);return()=>{var r;return(r=NR[t])!==null&&r!==void 0?r:n()}}const Gf=jR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sE=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=e(vl(0,i-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function aE(e){return!!(typeof e=="function"&&Gf()||!e||typeof e=="string"&&(e in ry||Gf())||Fb(e)||Array.isArray(e)&&e.every(aE))}const Qc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ry={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qc([0,.65,.55,1]),circOut:Qc([.55,0,1,.45]),backIn:Qc([.31,.01,.66,-.59]),backOut:Qc([.33,1.53,.69,.99])};function lE(e,t){if(e)return typeof e=="function"&&Gf()?sE(e,t):Fb(e)?Qc(e):Array.isArray(e)?e.map(n=>lE(n,t)||ry.easeOut):ry[e]}const Xr={x:!1,y:!1};function cE(){return Xr.x||Xr.y}function DR(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function uE(e,t){const n=DR(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function qx(e){return t=>{t.pointerType==="touch"||cE()||e(t)}}function BR(e,t,n={}){const[r,i,o]=uE(e,n),s=qx(l=>{const{target:c}=l,h=t(l);if(typeof h!="function"||!c)return;const u=qx(f=>{h(f),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return r.forEach(l=>{l.addEventListener("pointerenter",s,i)}),o}const hE=(e,t)=>t?e===t?!0:hE(e,t.parentElement):!1,Wb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,zR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function FR(e){return zR.has(e.tagName)||e.tabIndex!==-1}const tu=new WeakSet;function Gx(e){return t=>{t.key==="Enter"&&e(t)}}function Im(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WR=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Gx(()=>{if(tu.has(n))return;Im(n,"down");const i=Gx(()=>{Im(n,"up")}),o=()=>Im(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Zx(e){return Wb(e)&&!cE()}function VR(e,t,n={}){const[r,i,o]=uE(e,n),s=l=>{const c=l.currentTarget;if(!Zx(l)||tu.has(c))return;tu.add(c);const h=t(l),u=(y,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),!(!Zx(y)||!tu.has(c))&&(tu.delete(c),typeof h=="function"&&h(y,{success:x}))},f=y=>{u(y,n.useGlobalTarget||hE(c,y.target))},m=y=>{u(y,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(l=>{!FR(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",s,i),l.addEventListener("focus",h=>WR(h,i),i)}),o}function UR(e){return e==="x"||e==="y"?Xr[e]?null:(Xr[e]=!0,()=>{Xr[e]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}const fE=new Set(["width","height","top","left","right","bottom",...nc]);let Nf;function HR(){Nf=void 0}const bi={now:()=>(Nf===void 0&&bi.set(Rn.isProcessing||zI.useManualTiming?Rn.timestamp:performance.now()),Nf),set:e=>{Nf=e,queueMicrotask(HR)}};function Vb(e,t){e.indexOf(t)===-1&&e.push(t)}function Ub(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Hb{constructor(){this.subscriptions=[]}add(t){return Vb(this.subscriptions,t),()=>Ub(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function dE(e,t){return t?e*(1e3/t):0}const Yx=30,qR=e=>!isNaN(parseFloat(e));class GR{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=bi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=qR(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&wp(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Hb);const r=this.events[t].add(n);return t==="change"?()=>{r(),He.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=bi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Yx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Yx);return dE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cu(e,t){return new GR(e,t)}function ZR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Cu(n))}function YR(e,t){const n=Ap(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const l=aR(o[s]);ZR(e,s,l)}}function KR(e){return!!(Vn(e)&&e.add)}function iy(e,t){const n=e.getValue("willChange");if(KR(n))return n.add(t)}function pE(e){return e.props[UT]}const mE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,XR=1e-7,JR=12;function QR(e,t,n,r,i){let o,s,l=0;do s=t+(n-t)/2,o=mE(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>XR&&++l<JR);return s}function gh(e,t,n,r){if(e===t&&n===r)return or;const i=o=>QR(o,0,1,e,n);return o=>o===0||o===1?o:mE(i(o),t,r)}const gE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yE=e=>t=>1-e(1-t),vE=gh(.33,1.53,.69,.99),qb=yE(vE),bE=gE(qb),xE=e=>(e*=2)<1?.5*qb(e):.5*(2-Math.pow(2,-10*(e-1))),Gb=e=>1-Math.sin(Math.acos(e)),wE=yE(Gb),_E=gE(Gb),SE=e=>/^0[^.\s]+$/u.test(e);function tL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||SE(e):!0}const au=e=>Math.round(e*1e5)/1e5,Zb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function eL(e){return e==null}const nL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yb=(e,t)=>n=>!!(typeof n=="string"&&nL.test(n)&&n.startsWith(e)||t&&!eL(n)&&Object.prototype.hasOwnProperty.call(n,t)),PE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,l]=r.match(Zb);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},rL=e=>uo(0,255,e),Rm={...rc,transform:e=>Math.round(rL(e))},Ys={test:Yb("rgb","red"),parse:PE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rm.transform(e)+", "+Rm.transform(t)+", "+Rm.transform(n)+", "+au(Eu.transform(r))+")"};function iL(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const oy={test:Yb("#"),parse:iL,transform:Ys.transform},Ja={test:Yb("hsl","hue"),parse:PE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+vi.transform(au(t))+", "+vi.transform(au(n))+", "+au(Eu.transform(r))+")"},zn={test:e=>Ys.test(e)||oy.test(e)||Ja.test(e),parse:e=>Ys.test(e)?Ys.parse(e):Ja.test(e)?Ja.parse(e):oy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ys.transform(e):Ja.transform(e)},oL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Zb))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(oL))===null||n===void 0?void 0:n.length)||0)>0}const AE="number",TE="color",aL="var",lL="var(",Kx="${}",cL=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ou(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const l=t.replace(cL,c=>(zn.test(c)?(r.color.push(o),i.push(TE),n.push(zn.parse(c))):c.startsWith(lL)?(r.var.push(o),i.push(aL),n.push(c)):(r.number.push(o),i.push(AE),n.push(parseFloat(c))),++o,Kx)).split(Kx);return{values:n,split:l,indexes:r,types:i}}function EE(e){return Ou(e).values}function CE(e){const{split:t,types:n}=Ou(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const l=n[s];l===AE?o+=au(i[s]):l===TE?o+=zn.transform(i[s]):o+=i[s]}return o}}const uL=e=>typeof e=="number"?0:e;function hL(e){const t=EE(e);return CE(e)(t.map(uL))}const Qo={test:sL,parse:EE,createTransformer:CE,getAnimatableNone:hL},fL=new Set(["brightness","contrast","saturate","opacity"]);function dL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Zb)||[];if(!r)return e;const i=n.replace(r,"");let o=fL.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const pL=/\b([a-z-]*)\(.*?\)/gu,sy={...Qo,getAnimatableNone:e=>{const t=e.match(pL);return t?t.map(dL).join(" "):e}},mL={...Ib,color:zn,backgroundColor:zn,outlineColor:zn,fill:zn,stroke:zn,borderColor:zn,borderTopColor:zn,borderRightColor:zn,borderBottomColor:zn,borderLeftColor:zn,filter:sy,WebkitFilter:sy},Kb=e=>mL[e];function OE(e,t){let n=Kb(e);return n!==sy&&(n=Qo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const gL=new Set(["auto","none","0"]);function yL(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!gL.has(o)&&Ou(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=OE(n,i)}const Xx=e=>e===rc||e===Ht,Jx=(e,t)=>parseFloat(e.split(", ")[t]),Qx=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Jx(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?Jx(o[1],e):0}},vL=new Set(["x","y","z"]),bL=nc.filter(e=>!vL.has(e));function xL(e){const t=[];return bL.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const xl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Qx(4,13),y:Qx(5,14)};xl.translateX=xl.x;xl.translateY=xl.y;const ea=new Set;let ay=!1,ly=!1;function ME(){if(ly){const e=Array.from(ea).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=xL(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var l;(l=r.getValue(o))===null||l===void 0||l.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ly=!1,ay=!1,ea.forEach(e=>e.complete()),ea.clear()}function kE(){ea.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ly=!0)})}function wL(){kE(),ME()}class Xb{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ea.add(this),ay||(ay=!0,He.read(kE),He.resolveKeyframes(ME))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const s=i==null?void 0:i.get(),l=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&s===void 0&&i.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ea.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ea.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const $E=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_L=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function SL(e){const t=_L.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const PL=4;function IE(e,t,n=1){Xo(n<=PL,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=SL(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return $E(s)?parseFloat(s):s}return $b(i)?IE(i,t,n+1):i}const RE=e=>t=>t.test(e),AL={test:e=>e==="auto",parse:e=>e},LE=[rc,Ht,vi,Do,dR,fR,AL],tw=e=>LE.find(RE(e));class NE extends Xb{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),$b(h))){const u=IE(h,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!fE.has(r)||t.length!==2)return;const[i,o]=t,s=tw(i),l=tw(o);if(s!==l)if(Xx(s)&&Xx(l))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)tL(t[i])&&r.push(i);r.length&&yL(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,l=i[s];i[s]=xl[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,h])=>{n.getValue(c).set(h)}),this.resolveNoneKeyframes()}}const ew=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Qo.test(e)||e==="0")&&!e.startsWith("url("));function TL(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function EL(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=ew(i,t),l=ew(o,t);return ec(s===l,`You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!s||!l?!1:TL(e)||(n==="spring"||zb(n))&&r}const CL=e=>e!==null;function Tp(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(CL),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const OL=40;class jE{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>OL?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&wL(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=bi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:l,onUpdate:c,isGenerator:h}=this.options;if(!h&&!EL(t,r,i,o))if(s)this.options.duration=0;else{c&&c(Tp(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Qe=(e,t,n)=>e+(t-e)*n;function Lm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ML({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Lm(c,l,e+1/3),o=Lm(c,l,e),s=Lm(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function Zf(e,t){return n=>n>0?t:e}const Nm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},kL=[oy,Ys,Ja],$L=e=>kL.find(t=>t.test(e));function nw(e){const t=$L(e);if(ec(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Ja&&(n=ML(n)),n}const rw=(e,t)=>{const n=nw(e),r=nw(t);if(!n||!r)return Zf(e,t);const i={...n};return o=>(i.red=Nm(n.red,r.red,o),i.green=Nm(n.green,r.green,o),i.blue=Nm(n.blue,r.blue,o),i.alpha=Qe(n.alpha,r.alpha,o),Ys.transform(i))},IL=(e,t)=>n=>t(e(n)),yh=(...e)=>e.reduce(IL),cy=new Set(["none","hidden"]);function RL(e,t){return cy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function LL(e,t){return n=>Qe(e,t,n)}function Jb(e){return typeof e=="number"?LL:typeof e=="string"?$b(e)?Zf:zn.test(e)?rw:DL:Array.isArray(e)?DE:typeof e=="object"?zn.test(e)?rw:NL:Zf}function DE(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Jb(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function NL(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Jb(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function jL(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],l=e.indexes[s][i[s]],c=(n=e.values[l])!==null&&n!==void 0?n:0;r[o]=c,i[s]++}return r}const DL=(e,t)=>{const n=Qo.createTransformer(t),r=Ou(e),i=Ou(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?cy.has(e)&&!i.values.length||cy.has(t)&&!r.values.length?RL(e,t):yh(DE(jL(r,i),i.values),n):(ec(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Zf(e,t))};function BE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Qe(e,t,n):Jb(e)(e,t)}const BL=5;function zE(e,t,n){const r=Math.max(t-BL,0);return dE(n-e(r),t-r)}const Je={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},jm=.001;function zL({duration:e=Je.duration,bounce:t=Je.bounce,velocity:n=Je.velocity,mass:r=Je.mass}){let i,o;ec(e<=yi(Je.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=uo(Je.minDamping,Je.maxDamping,s),e=uo(Je.minDuration,Je.maxDuration,oo(e)),s<1?(i=h=>{const u=h*s,f=u*e,m=u-n,y=uy(h,s),x=Math.exp(-f);return jm-m/y*x},o=h=>{const f=h*s*e,m=f*n+n,y=Math.pow(s,2)*Math.pow(h,2)*e,x=Math.exp(-f),p=uy(Math.pow(h,2),s);return(-i(h)+jm>0?-1:1)*((m-y)*x)/p}):(i=h=>{const u=Math.exp(-h*e),f=(h-n)*e+1;return-jm+u*f},o=h=>{const u=Math.exp(-h*e),f=(n-h)*(e*e);return u*f});const l=5/e,c=WL(i,o,l);if(e=yi(e),isNaN(c))return{stiffness:Je.stiffness,damping:Je.damping,duration:e};{const h=Math.pow(c,2)*r;return{stiffness:h,damping:s*2*Math.sqrt(r*h),duration:e}}}const FL=12;function WL(e,t,n){let r=n;for(let i=1;i<FL;i++)r=r-e(r)/t(r);return r}function uy(e,t){return e*Math.sqrt(1-t*t)}const VL=["duration","bounce"],UL=["stiffness","damping","mass"];function iw(e,t){return t.some(n=>e[n]!==void 0)}function HL(e){let t={velocity:Je.velocity,stiffness:Je.stiffness,damping:Je.damping,mass:Je.mass,isResolvedFromDuration:!1,...e};if(!iw(e,UL)&&iw(e,VL))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*uo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Je.mass,stiffness:i,damping:o}}else{const n=zL(e);t={...t,...n,mass:Je.mass},t.isResolvedFromDuration=!0}return t}function FE(e=Je.visualDuration,t=Je.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:c,damping:h,mass:u,duration:f,velocity:m,isResolvedFromDuration:y}=HL({...n,velocity:-oo(n.velocity||0)}),x=m||0,p=h/(2*Math.sqrt(c*u)),b=s-o,P=oo(Math.sqrt(c/u)),S=Math.abs(b)<5;r||(r=S?Je.restSpeed.granular:Je.restSpeed.default),i||(i=S?Je.restDelta.granular:Je.restDelta.default);let A;if(p<1){const w=uy(P,p);A=T=>{const O=Math.exp(-p*P*T);return s-O*((x+p*P*b)/w*Math.sin(w*T)+b*Math.cos(w*T))}}else if(p===1)A=w=>s-Math.exp(-P*w)*(b+(x+P*b)*w);else{const w=P*Math.sqrt(p*p-1);A=T=>{const O=Math.exp(-p*P*T),I=Math.min(w*T,300);return s-O*((x+p*P*b)*Math.sinh(I)+w*b*Math.cosh(I))/w}}const E={calculatedDuration:y&&f||null,next:w=>{const T=A(w);if(y)l.done=w>=f;else{let O=0;p<1&&(O=w===0?yi(x):zE(A,w,T));const I=Math.abs(O)<=r,N=Math.abs(s-T)<=i;l.done=I&&N}return l.value=l.done?s:T,l},toString:()=>{const w=Math.min(oE(E),ny),T=sE(O=>E.next(w*O).value,w,30);return w+"ms "+T}};return E}function ow({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:l,max:c,restDelta:h=.5,restSpeed:u}){const f=e[0],m={done:!1,value:f},y=I=>l!==void 0&&I<l||c!==void 0&&I>c,x=I=>l===void 0?c:c===void 0||Math.abs(l-I)<Math.abs(c-I)?l:c;let p=n*t;const b=f+p,P=s===void 0?b:s(b);P!==b&&(p=P-f);const S=I=>-p*Math.exp(-I/r),A=I=>P+S(I),E=I=>{const N=S(I),F=A(I);m.done=Math.abs(N)<=h,m.value=m.done?P:F};let w,T;const O=I=>{y(m.value)&&(w=I,T=FE({keyframes:[m.value,x(m.value)],velocity:zE(A,I,m.value),damping:i,stiffness:o,restDelta:h,restSpeed:u}))};return O(0),{calculatedDuration:null,next:I=>{let N=!1;return!T&&w===void 0&&(N=!0,E(I),O(I)),w!==void 0&&I>=w?T.next(I-w):(!N&&E(I),m)}}}const qL=gh(.42,0,1,1),GL=gh(0,0,.58,1),WE=gh(.42,0,.58,1),ZL=e=>Array.isArray(e)&&typeof e[0]!="number",sw={linear:or,easeIn:qL,easeInOut:WE,easeOut:GL,circIn:Gb,circInOut:_E,circOut:wE,backIn:qb,backInOut:bE,backOut:vE,anticipate:xE},aw=e=>{if(Fb(e)){Xo(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return gh(t,n,r,i)}else if(typeof e=="string")return Xo(sw[e]!==void 0,`Invalid easing type '${e}'`),sw[e];return e};function YL(e,t,n){const r=[],i=n||BE,o=e.length-1;for(let s=0;s<o;s++){let l=i(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||or:t;l=yh(c,l)}r.push(l)}return r}function KL(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(Xo(o===t.length,"Both input and output ranges must be the same length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=YL(t,r,i),c=l.length,h=u=>{if(s&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const m=vl(e[f],e[f+1],u);return l[f](m)};return n?u=>h(uo(e[0],e[o-1],u)):h}function XL(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=vl(0,t,r);e.push(Qe(n,1,i))}}function JL(e){const t=[0];return XL(t,e.length-1),t}function QL(e,t){return e.map(n=>n*t)}function tN(e,t){return e.map(()=>t||WE).splice(0,e.length-1)}function Yf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=ZL(r)?r.map(aw):aw(r),o={done:!1,value:t[0]},s=QL(n&&n.length===t.length?n:JL(t),e),l=KL(s,t,{ease:Array.isArray(i)?i:tN(t,i)});return{calculatedDuration:e,next:c=>(o.value=l(c),o.done=c>=e,o)}}const eN=e=>{const t=({timestamp:n})=>e(n);return{start:()=>He.update(t,!0),stop:()=>Jo(t),now:()=>Rn.isProcessing?Rn.timestamp:bi.now()}},nN={decay:ow,inertia:ow,tween:Yf,keyframes:Yf,spring:FE},rN=e=>e/100;class Qb extends jE{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Xb,l=(c,h)=>this.onKeyframesResolved(c,h);this.resolver=new s(o,l,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,l=zb(n)?n:nN[n]||Yf;let c,h;l!==Yf&&typeof t[0]!="number"&&(process.env.NODE_ENV!=="production"&&Xo(t.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),c=yh(rN,BE(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});o==="mirror"&&(h=l({...this.options,keyframes:[...t].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=oE(u));const{calculatedDuration:f}=u,m=f+i,y=m*(r+1)-i;return{generator:u,mirroredGenerator:h,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:m,totalDuration:y}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:h,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return o.next(0);const{delay:m,repeat:y,repeatType:x,repeatDelay:p,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const P=this.currentTime-m*(this.speed>=0?1:-1),S=this.speed>=0?P<0:P>u;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let A=this.currentTime,E=o;if(y){const I=Math.min(this.currentTime,u)/f;let N=Math.floor(I),F=I%1;!F&&I>=1&&(F=1),F===1&&N--,N=Math.min(N,y+1),!!(N%2)&&(x==="reverse"?(F=1-F,p&&(F-=p/f)):x==="mirror"&&(E=s)),A=uo(0,1,F)*f}const w=S?{done:!1,value:c[0]}:E.next(A);l&&(w.value=l(w.value));let{done:T}=w;!S&&h!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return O&&i!==void 0&&(w.value=Tp(c,this.options,i)),b&&b(w.value),O&&this.finish(),w}get duration(){const{resolved:t}=this;return t?oo(t.calculatedDuration):0}get time(){return oo(this.currentTime)}set time(t){t=yi(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=oo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=eN,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const iN=new Set(["opacity","clipPath","filter","transform"]);function oN(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:l="easeInOut",times:c}={}){const h={[t]:n};c&&(h.offset=c);const u=lE(l,i);return Array.isArray(u)&&(h.easing=u),e.animate(h,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}const sN=Ab(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Kf=10,aN=2e4;function lN(e){return zb(e.type)||e.type==="spring"||!aE(e.ease)}function cN(e,t){const n=new Qb({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&o<aN;)r=n.sample(o),i.push(r.value),o+=Kf;return{times:void 0,keyframes:i,duration:o-Kf,ease:"linear"}}const VE={anticipate:xE,backInOut:bE,circInOut:_E};function uN(e){return e in VE}class lw extends jE{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:o}=this.options;this.resolver=new NE(o,(s,l)=>this.onKeyframesResolved(s,l),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:o,type:s,motionValue:l,name:c,startTime:h}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof o=="string"&&Gf()&&uN(o)&&(o=VE[o]),lN(this.options)){const{onComplete:f,onUpdate:m,motionValue:y,element:x,...p}=this.options,b=cN(t,p);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,o=b.ease,s="keyframes"}const u=oN(l.owner.current,c,t,{...this.options,duration:r,times:i,ease:o});return u.startTime=h??this.calcStartTime(),this.pendingTimeline?(Hx(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Tp(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return oo(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return oo(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=yi(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return or;const{animation:r}=n;Hx(r,t)}return or}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:h,onUpdate:u,onComplete:f,element:m,...y}=this.options,x=new Qb({...y,keyframes:r,duration:i,type:o,ease:s,times:l,isGenerator:!0}),p=yi(this.time);h.setWithVelocity(x.sample(p-Kf).value,x.sample(p).value,Kf)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=n.owner.getProps();return sN()&&r&&iN.has(r)&&!c&&!h&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}}const hN={type:"spring",stiffness:500,damping:25,restSpeed:10},fN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),dN={type:"keyframes",duration:.8},pN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mN=(e,{keyframes:t})=>t.length>2?dN:ba.has(e)?e.startsWith("scale")?fN(t[1]):hN:pN;function gN({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:l,from:c,elapsed:h,...u}){return!!Object.keys(u).length}const t0=(e,t,n,r={},i,o)=>s=>{const l=Bb(r,e)||{},c=l.delay||r.delay||0;let{elapsed:h=0}=r;h=h-yi(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-h,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:i};gN(l)||(u={...u,...mN(e,u)}),u.duration&&(u.duration=yi(u.duration)),u.repeatDelay&&(u.repeatDelay=yi(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!o&&t.get()!==void 0){const m=Tp(u.keyframes,l);if(m!==void 0)return He.update(()=>{u.onUpdate(m),u.onComplete()}),new LR([])}return!o&&lw.supports(u)?new lw(u):new Qb(u)};function yN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function UE(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(s=r);const h=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const m=e.getValue(f,(o=e.latestValues[f])!==null&&o!==void 0?o:null),y=c[f];if(y===void 0||u&&yN(u,f))continue;const x={delay:n,...Bb(s||{},f)};let p=!1;if(window.MotionHandoffAnimation){const P=pE(e);if(P){const S=window.MotionHandoffAnimation(P,f,He);S!==null&&(x.startTime=S,p=!0)}}iy(e,f),m.start(t0(f,m,y,e.shouldReduceMotion&&fE.has(f)?{type:!1}:x,e,p));const b=m.animation;b&&h.push(b)}return l&&Promise.all(h).then(()=>{He.update(()=>{l&&YR(e,l)})}),h}function hy(e,t,n={}){var r;const i=Ap(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(UE(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:m}=o;return vN(e,t,u+h,f,m,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[h,u]=c==="beforeChildren"?[s,l]:[l,s];return h().then(()=>u())}else return Promise.all([s(),l(n.delay)])}function vN(e,t,n=0,r=0,i=1,o){const s=[],l=(e.variantChildren.size-1)*r,c=i===1?(h=0)=>h*r:(h=0)=>l-h*r;return Array.from(e.variantChildren).sort(bN).forEach((h,u)=>{h.notify("AnimationStart",t),s.push(hy(h,t,{...o,delay:n+c(u)}).then(()=>h.notify("AnimationComplete",t)))}),Promise.all(s)}function bN(e,t){return e.sortNodePosition(t)}function xN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>hy(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=hy(e,t,n);else{const i=typeof t=="function"?Ap(e,t,n.custom):t;r=Promise.all(UE(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const wN=Eb.length;function HE(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?HE(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wN;n++){const r=Eb[n],i=e.props[r];(Tu(i)||i===!1)&&(t[r]=i)}return t}const _N=[...Tb].reverse(),SN=Tb.length;function PN(e){return t=>Promise.all(t.map(({animation:n,options:r})=>xN(e,n,r)))}function AN(e){let t=PN(e),n=cw(),r=!0;const i=c=>(h,u)=>{var f;const m=Ap(e,u,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(m){const{transition:y,transitionEnd:x,...p}=m;h={...h,...p,...x}}return h};function o(c){t=c(e)}function s(c){const{props:h}=e,u=HE(e.parent)||{},f=[],m=new Set;let y={},x=1/0;for(let b=0;b<SN;b++){const P=_N[b],S=n[P],A=h[P]!==void 0?h[P]:u[P],E=Tu(A),w=P===c?S.isActive:null;w===!1&&(x=b);let T=A===u[P]&&A!==h[P]&&E;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),S.protectedKeys={...y},!S.isActive&&w===null||!A&&!S.prevProp||Sp(A)||typeof A=="boolean")continue;const O=TN(S.prevProp,A);let I=O||P===c&&S.isActive&&!T&&E||b>x&&E,N=!1;const F=Array.isArray(A)?A:[A];let D=F.reduce(i(P),{});w===!1&&(D={});const{prevResolvedValues:j={}}=S,K={...j,...D},U=G=>{I=!0,m.has(G)&&(N=!0,m.delete(G)),S.needsAnimating[G]=!0;const X=e.getValue(G);X&&(X.liveStyle=!1)};for(const G in K){const X=D[G],lt=j[G];if(y.hasOwnProperty(G))continue;let H=!1;ey(X)&&ey(lt)?H=!iE(X,lt):H=X!==lt,H?X!=null?U(G):m.add(G):X!==void 0&&m.has(G)?U(G):S.protectedKeys[G]=!0}S.prevProp=A,S.prevResolvedValues=D,S.isActive&&(y={...y,...D}),r&&e.blockInitialAnimation&&(I=!1),I&&(!(T&&O)||N)&&f.push(...F.map(G=>({animation:G,options:{type:P}})))}if(m.size){const b={};m.forEach(P=>{const S=e.getBaseTarget(P),A=e.getValue(P);A&&(A.liveStyle=!0),b[P]=S??null}),f.push({animation:b})}let p=!!f.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function l(c,h){var u;if(n[c].isActive===h)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(m=>{var y;return(y=m.animationState)===null||y===void 0?void 0:y.setActive(c,h)}),n[c].isActive=h;const f=s(c);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:s,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=cw(),r=!0}}}function TN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!iE(t,e):!1}function Ns(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cw(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class rs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class EN extends rs{constructor(t){super(t),t.animationState||(t.animationState=AN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Sp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let CN=0;class ON extends rs{constructor(){super(...arguments),this.id=CN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const MN={animation:{Feature:EN},exit:{Feature:ON}};function Mu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vh(e){return{point:{x:e.pageX,y:e.pageY}}}const kN=e=>t=>Wb(t)&&e(t,vh(t));function lu(e,t,n,r){return Mu(e,t,kN(n),r)}const uw=(e,t)=>Math.abs(e-t);function $N(e,t){const n=uw(e.x,t.x),r=uw(e.y,t.y);return Math.sqrt(n**2+r**2)}class qE{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Bm(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=$N(f.offset,{x:0,y:0})>=3;if(!m&&!y)return;const{point:x}=f,{timestamp:p}=Rn;this.history.push({...x,timestamp:p});const{onStart:b,onMove:P}=this.handlers;m||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,f)},this.handlePointerMove=(f,m)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Dm(m,this.transformPagePoint),He.update(this.updatePoint,!0)},this.handlePointerUp=(f,m)=>{this.end();const{onEnd:y,onSessionEnd:x,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Bm(f.type==="pointercancel"?this.lastMoveEventInfo:Dm(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(f,b),x&&x(f,b)},!Wb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=vh(t),l=Dm(s,this.transformPagePoint),{point:c}=l,{timestamp:h}=Rn;this.history=[{...c,timestamp:h}];const{onSessionStart:u}=n;u&&u(t,Bm(l,this.history)),this.removeListeners=yh(lu(this.contextWindow,"pointermove",this.handlePointerMove),lu(this.contextWindow,"pointerup",this.handlePointerUp),lu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jo(this.updatePoint)}}function Dm(e,t){return t?{point:t(e.point)}:e}function hw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Bm({point:e},t){return{point:e,delta:hw(e,GE(t)),offset:hw(e,IN(t)),velocity:RN(t,.1)}}function IN(e){return e[0]}function GE(e){return e[e.length-1]}function RN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=GE(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>yi(t)));)n--;if(!r)return{x:0,y:0};const o=oo(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const ZE=1e-4,LN=1-ZE,NN=1+ZE,YE=.01,jN=0-YE,DN=0+YE;function Ar(e){return e.max-e.min}function BN(e,t,n){return Math.abs(e-t)<=n}function fw(e,t,n,r=.5){e.origin=r,e.originPoint=Qe(t.min,t.max,e.origin),e.scale=Ar(n)/Ar(t),e.translate=Qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=LN&&e.scale<=NN||isNaN(e.scale))&&(e.scale=1),(e.translate>=jN&&e.translate<=DN||isNaN(e.translate))&&(e.translate=0)}function cu(e,t,n,r){fw(e.x,t.x,n.x,r?r.originX:void 0),fw(e.y,t.y,n.y,r?r.originY:void 0)}function dw(e,t,n){e.min=n.min+t.min,e.max=e.min+Ar(t)}function zN(e,t,n){dw(e.x,t.x,n.x),dw(e.y,t.y,n.y)}function pw(e,t,n){e.min=t.min-n.min,e.max=e.min+Ar(t)}function uu(e,t,n){pw(e.x,t.x,n.x),pw(e.y,t.y,n.y)}function FN(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Qe(n,e,r.max):Math.min(e,n)),e}function mw(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function WN(e,{top:t,left:n,bottom:r,right:i}){return{x:mw(e.x,n,i),y:mw(e.y,t,r)}}function gw(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function VN(e,t){return{x:gw(e.x,t.x),y:gw(e.y,t.y)}}function UN(e,t){let n=.5;const r=Ar(e),i=Ar(t);return i>r?n=vl(t.min,t.max-r,e.min):r>i&&(n=vl(e.min,e.max-i,t.min)),uo(0,1,n)}function HN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fy=.35;function qN(e=fy){return e===!1?e=0:e===!0&&(e=fy),{x:yw(e,"left","right"),y:yw(e,"top","bottom")}}function yw(e,t,n){return{min:vw(e,t),max:vw(e,n)}}function vw(e,t){return typeof e=="number"?e:e[t]||0}const bw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qa=()=>({x:bw(),y:bw()}),xw=()=>({min:0,max:0}),sn=()=>({x:xw(),y:xw()});function Nr(e){return[e("x"),e("y")]}function KE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function GN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function zm(e){return e===void 0||e===1}function dy({scale:e,scaleX:t,scaleY:n}){return!zm(e)||!zm(t)||!zm(n)}function Ws(e){return dy(e)||XE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function XE(e){return ww(e.x)||ww(e.y)}function ww(e){return e&&e!=="0%"}function Xf(e,t,n){const r=e-n,i=t*r;return n+i}function _w(e,t,n,r,i){return i!==void 0&&(e=Xf(e,i,r)),Xf(e,n,r)+t}function py(e,t=0,n=1,r,i){e.min=_w(e.min,t,n,r,i),e.max=_w(e.max,t,n,r,i)}function JE(e,{x:t,y:n}){py(e.x,t.translate,t.scale,t.originPoint),py(e.y,n.translate,n.scale,n.originPoint)}const Sw=.999999999999,Pw=1.0000000000001;function YN(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let l=0;l<i;l++){o=n[l],s=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&el(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,JE(e,s)),r&&Ws(o.latestValues)&&el(e,o.latestValues))}t.x<Pw&&t.x>Sw&&(t.x=1),t.y<Pw&&t.y>Sw&&(t.y=1)}function tl(e,t){e.min=e.min+t,e.max=e.max+t}function Aw(e,t,n,r,i=.5){const o=Qe(e.min,e.max,i);py(e,t,n,o,r)}function el(e,t){Aw(e.x,t.x,t.scaleX,t.scale,t.originX),Aw(e.y,t.y,t.scaleY,t.scale,t.originY)}function QE(e,t){return KE(ZN(e.getBoundingClientRect(),t))}function KN(e,t,n){const r=QE(e,n),{scroll:i}=t;return i&&(tl(r.x,i.offset.x),tl(r.y,i.offset.y)),r}const tC=({current:e})=>e?e.ownerDocument.defaultView:null,XN=new WeakMap;class JN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vh(u).point)},o=(u,f)=>{const{drag:m,dragPropagation:y,onDragStart:x}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=UR(m),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nr(b=>{let P=this.getAxisMotionValue(b).get()||0;if(vi.test(P)){const{projection:S}=this.visualElement;if(S&&S.layout){const A=S.layout.layoutBox[b];A&&(P=Ar(A)*(parseFloat(P)/100))}}this.originPoint[b]=P}),x&&He.postRender(()=>x(u,f)),iy(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},s=(u,f)=>{const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:x,onDrag:p}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:b}=f;if(y&&this.currentDirection===null){this.currentDirection=QN(b),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),p&&p(u,f)},l=(u,f)=>this.stop(u,f),c=()=>Nr(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new qE(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,contextWindow:tC(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&He.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!nf(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=FN(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Xa(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=WN(i.layoutBox,n):this.constraints=!1,this.elastic=qN(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=HN(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xa(t))return!1;const r=t.current;Xo(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=KN(r,i.root,this.visualElement.getTransformPagePoint());let s=VN(i.layout.layoutBox,o);if(n){const l=n(GN(s));this.hasMutatedConstraints=!!l,l&&(s=KE(l))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},h=Nr(u=>{if(!nf(u,n,this.currentDirection))return;let f=c&&c[u]||{};s&&(f={min:0,max:0});const m=i?200:1e6,y=i?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(h).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return iy(this.visualElement,t),r.start(t0(t,r,0,n,this.visualElement,!1))}stopAnimation(){Nr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Nr(n=>{const{drag:r}=this.getProps();if(!nf(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:l}=i.layout.layoutBox[n];o.set(t[n]-Qe(s,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Xa(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nr(s=>{const l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){const c=l.get();i[s]=UN({min:c,max:c},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Nr(s=>{if(!nf(s,t,null))return;const l=this.getAxisMotionValue(s),{min:c,max:h}=this.constraints[s];l.set(Qe(c,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;XN.set(this.visualElement,this);const t=this.visualElement.current,n=lu(t,"pointerdown",c=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Xa(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),He.read(r);const s=Mu(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Nr(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=fy,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:l}}}function nf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function QN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tj extends rs{constructor(t){super(t),this.removeGroupControls=or,this.removeListeners=or,this.controls=new JN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||or}unmount(){this.removeGroupControls(),this.removeListeners()}}const Tw=e=>(t,n)=>{e&&He.postRender(()=>e(t,n))};class ej extends rs{constructor(){super(...arguments),this.removePointerDownListener=or}onPointerDown(t){this.session=new qE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Tw(t),onStart:Tw(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&He.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=lu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const jf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ew(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const zc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ht.test(e))e=parseFloat(e);else return e;const n=Ew(e,t.target.x),r=Ew(e,t.target.y);return`${n}% ${r}%`}},nj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Qo.parse(e);if(i.length>5)return r;const o=Qo.createTransformer(e),s=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=l,i[1+s]/=c;const h=Qe(l,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),o(i)}};class rj extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;SR(ij),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),jf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||He.postRender(()=>{const l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ob.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eC(e){const[t,n]=DT(),r=v.useContext(wb);return Ze.jsx(rj,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(HT),isPresent:t,safeToRemove:n})}const ij={borderRadius:{...zc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zc,borderTopRightRadius:zc,borderBottomLeftRadius:zc,borderBottomRightRadius:zc,boxShadow:nj};function oj(e,t,n){const r=Vn(e)?e:Cu(e);return r.start(t0("",r,t,n)),r.animation}function sj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const aj=(e,t)=>e.depth-t.depth;class lj{constructor(){this.children=[],this.isDirty=!1}add(t){Vb(this.children,t),this.isDirty=!0}remove(t){Ub(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(aj),this.isDirty=!1,this.children.forEach(t)}}function cj(e,t){const n=bi.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Jo(r),e(o-t))};return He.read(r,!0),()=>Jo(r)}const nC=["TopLeft","TopRight","BottomLeft","BottomRight"],uj=nC.length,Cw=e=>typeof e=="string"?parseFloat(e):e,Ow=e=>typeof e=="number"||Ht.test(e);function hj(e,t,n,r,i,o){i?(e.opacity=Qe(0,n.opacity!==void 0?n.opacity:1,fj(r)),e.opacityExit=Qe(t.opacity!==void 0?t.opacity:1,0,dj(r))):o&&(e.opacity=Qe(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<uj;s++){const l=`border${nC[s]}Radius`;let c=Mw(t,l),h=Mw(n,l);if(c===void 0&&h===void 0)continue;c||(c=0),h||(h=0),c===0||h===0||Ow(c)===Ow(h)?(e[l]=Math.max(Qe(Cw(c),Cw(h),r),0),(vi.test(h)||vi.test(c))&&(e[l]+="%")):e[l]=h}(t.rotate||n.rotate)&&(e.rotate=Qe(t.rotate||0,n.rotate||0,r))}function Mw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fj=rC(0,.5,wE),dj=rC(.5,.95,or);function rC(e,t,n){return r=>r<e?0:r>t?1:n(vl(e,t,r))}function kw(e,t){e.min=t.min,e.max=t.max}function $r(e,t){kw(e.x,t.x),kw(e.y,t.y)}function $w(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Iw(e,t,n,r,i){return e-=t,e=Xf(e,1/n,r),i!==void 0&&(e=Xf(e,1/i,r)),e}function pj(e,t=0,n=1,r=.5,i,o=e,s=e){if(vi.test(t)&&(t=parseFloat(t),t=Qe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let l=Qe(o.min,o.max,r);e===o&&(l-=t),e.min=Iw(e.min,t,n,l,i),e.max=Iw(e.max,t,n,l,i)}function Rw(e,t,[n,r,i],o,s){pj(e,t[n],t[r],t[i],t.scale,o,s)}const mj=["x","scaleX","originX"],gj=["y","scaleY","originY"];function Lw(e,t,n,r){Rw(e.x,t,mj,n?n.x:void 0,r?r.x:void 0),Rw(e.y,t,gj,n?n.y:void 0,r?r.y:void 0)}function Nw(e){return e.translate===0&&e.scale===1}function iC(e){return Nw(e.x)&&Nw(e.y)}function jw(e,t){return e.min===t.min&&e.max===t.max}function yj(e,t){return jw(e.x,t.x)&&jw(e.y,t.y)}function Dw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oC(e,t){return Dw(e.x,t.x)&&Dw(e.y,t.y)}function Bw(e){return Ar(e.x)/Ar(e.y)}function zw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class vj{constructor(){this.members=[]}add(t){Vb(this.members,t),t.scheduleRender()}remove(t){if(Ub(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function bj(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:f,rotateY:m,skewX:y,skewY:x}=n;h&&(r=`perspective(${h}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),y&&(r+=`skewX(${y}deg) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Vs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},eu=typeof window<"u"&&window.MotionDebug!==void 0,Fm=["","X","Y","Z"],xj={visibility:"hidden"},Fw=1e3;let wj=0;function Wm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function sC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=pE(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",He,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&sC(r)}function aC({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},l=t==null?void 0:t()){this.id=wj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,eu&&(Vs.totalNodes=Vs.resolvedTargetDeltas=Vs.recalculatedProjection=0),this.nodes.forEach(Pj),this.nodes.forEach(Oj),this.nodes.forEach(Mj),this.nodes.forEach(Aj),eu&&window.MotionDebug.record(Vs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new lj)}addEventListener(s,l){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Hb),this.eventHandlers.get(s).add(l)}notifyListeners(s,...l){const c=this.eventHandlers.get(s);c&&c.notify(...l)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=sj(s),this.instance=s;const{layoutId:c,layout:h,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(h||c)&&(this.isLayoutDirty=!0),e){let f;const m=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=cj(m,250),jf.hasAnimatedSinceResize&&(jf.hasAnimatedSinceResize=!1,this.nodes.forEach(Vw))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||h)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m,hasRelativeTargetChanged:y,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Lj,{onLayoutAnimationStart:b,onLayoutAnimationComplete:P}=u.getProps(),S=!this.targetLayout||!oC(this.targetLayout,x)||y,A=!m&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||m&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,A);const E={...Bb(p,"layout"),onPlay:b,onComplete:P};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else m||Vw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Jo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(kj),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ww);return}this.isUpdating||this.nodes.forEach(Ej),this.isUpdating=!1,this.nodes.forEach(Cj),this.nodes.forEach(_j),this.nodes.forEach(Sj),this.clearAllSnapshots();const l=bi.now();Rn.delta=uo(0,1e3/60,l-Rn.timestamp),Rn.timestamp=l,Rn.isProcessing=!0,$m.update.process(Rn),$m.preRender.process(Rn),$m.render.process(Rn),Rn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ob.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tj),this.sharedNodes.forEach($j)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,He.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){He.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=sn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!iC(this.projectionDelta),c=this.getTransformTemplate(),h=c?c(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&(l||Ws(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return s&&(c=this.removeTransform(c)),Nj(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:l}=this.options;if(!l)return sn();const c=l.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(jj))){const{scroll:u}=this.root;u&&(tl(c.x,u.offset.x),tl(c.y,u.offset.y))}return c}removeElementScroll(s){var l;const c=sn();if($r(c,s),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let h=0;h<this.path.length;h++){const u=this.path[h],{scroll:f,options:m}=u;u!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&$r(c,s),tl(c.x,f.offset.x),tl(c.y,f.offset.y))}return c}applyTransform(s,l=!1){const c=sn();$r(c,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&el(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ws(u.latestValues)&&el(c,u.latestValues)}return Ws(this.latestValues)&&el(c,this.latestValues),c}removeTransform(s){const l=sn();$r(l,s);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!h.instance||!Ws(h.latestValues))continue;dy(h.latestValues)&&h.updateSnapshot();const u=sn(),f=h.measurePageBox();$r(u,f),Lw(l,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Ws(this.latestValues)&&Lw(l,this.latestValues),l}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Rn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==c;if(!(s||h&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:m}=this.options;if(!(!this.layout||!(f||m))){if(this.resolvedRelativeTargetAt=Rn.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sn(),this.relativeTargetOrigin=sn(),uu(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),$r(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=sn(),this.targetWithTransforms=sn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$r(this.target,this.layout.layoutBox),JE(this.target,this.targetDelta)):$r(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sn(),this.relativeTargetOrigin=sn(),uu(this.relativeTargetOrigin,this.target,y.target),$r(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}eu&&Vs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||dy(this.parent.latestValues)||XE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(h=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Rn.timestamp&&(h=!1),h)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;$r(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,y=this.treeScale.y;YN(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=sn());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($w(this.prevProjectionDelta.x,this.projectionDelta.x),$w(this.prevProjectionDelta.y,this.projectionDelta.y)),cu(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==y||!zw(this.projectionDelta.x,this.prevProjectionDelta.x)||!zw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),eu&&Vs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),s){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qa(),this.projectionDelta=Qa(),this.projectionDeltaWithTransform=Qa()}setAnimationOrigin(s,l=!1){const c=this.snapshot,h=c?c.latestValues:{},u={...this.latestValues},f=Qa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=sn(),y=c?c.source:void 0,x=this.layout?this.layout.source:void 0,p=y!==x,b=this.getStack(),P=!b||b.members.length<=1,S=!!(p&&!P&&this.options.crossfade===!0&&!this.path.some(Rj));this.animationProgress=0;let A;this.mixTargetDelta=E=>{const w=E/1e3;Uw(f.x,s.x,w),Uw(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uu(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ij(this.relativeTarget,this.relativeTargetOrigin,m,w),A&&yj(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=sn()),$r(A,this.relativeTarget)),p&&(this.animationValues=u,hj(u,h,this.latestValues,w,S,P)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Jo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=He.update(()=>{jf.hasAnimatedSinceResize=!0,this.currentAnimation=oj(0,Fw,{...s,onUpdate:l=>{this.mixTargetDelta(l),s.onUpdate&&s.onUpdate(l)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Fw),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:l,target:c,layout:h,latestValues:u}=s;if(!(!l||!c||!h)){if(this!==s&&this.layout&&h&&lC(this.options.animationType,this.layout.layoutBox,h.layoutBox)){c=this.target||sn();const f=Ar(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const m=Ar(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+m}$r(l,c),el(l,u),cu(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new vj),this.sharedNodes.get(s).add(l);const h=l.options.initialPromotionConfig;l.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(l):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:l}=this.options;return l?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:l}=this.options;return l?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:c}={}){const h=this.getStack();h&&h.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let l=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const h={};c.z&&Wm("z",s,h,this.animationValues);for(let u=0;u<Fm.length;u++)Wm(`rotate${Fm[u]}`,s,h,this.animationValues),Wm(`skew${Fm[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}getProjectionStyles(s){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return xj;const h={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,h.opacity="",h.pointerEvents=Lf(s==null?void 0:s.pointerEvents)||"",h.transform=u?u(this.latestValues,""):"none",h;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Lf(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Ws(this.latestValues)&&(p.transform=u?u({},""):"none",this.hasProjected=!1),p}const m=f.animationValues||f.latestValues;this.applyTransformsToTarget(),h.transform=bj(this.projectionDeltaWithTransform,this.treeScale,m),u&&(h.transform=u(m,h.transform));const{x:y,y:x}=this.projectionDelta;h.transformOrigin=`${y.origin*100}% ${x.origin*100}% 0`,f.animationValues?h.opacity=f===this?(c=(l=m.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:h.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const p in qf){if(m[p]===void 0)continue;const{correct:b,applyTo:P}=qf[p],S=h.transform==="none"?m[p]:b(m[p],f);if(P){const A=P.length;for(let E=0;E<A;E++)h[P[E]]=S}else h[p]=S}return this.options.layoutId&&(h.pointerEvents=f===this?Lf(s==null?void 0:s.pointerEvents)||"":"none"),h}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var l;return(l=s.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Ww),this.root.sharedNodes.clear()}}}function _j(e){e.updateLayout()}function Sj(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Nr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Ar(m);m.min=r[f].min,m.max=m.min+y}):lC(o,n.layoutBox,r)&&Nr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Ar(r[f]);m.max=m.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+y)});const l=Qa();cu(l,r,n.layoutBox);const c=Qa();s?cu(c,e.applyTransform(i,!0),n.measuredBox):cu(c,r,n.layoutBox);const h=!iC(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:y}=f;if(m&&y){const x=sn();uu(x,n.layoutBox,m.layoutBox);const p=sn();uu(p,r,y.layoutBox),oC(x,p)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:h,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Pj(e){eu&&Vs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Aj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Tj(e){e.clearSnapshot()}function Ww(e){e.clearMeasurements()}function Ej(e){e.isLayoutDirty=!1}function Cj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Vw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Oj(e){e.resolveTargetDelta()}function Mj(e){e.calcProjection()}function kj(e){e.resetSkewAndRotation()}function $j(e){e.removeLeadSnapshot()}function Uw(e,t,n){e.translate=Qe(t.translate,0,n),e.scale=Qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hw(e,t,n,r){e.min=Qe(t.min,n.min,r),e.max=Qe(t.max,n.max,r)}function Ij(e,t,n,r){Hw(e.x,t.x,n.x,r),Hw(e.y,t.y,n.y,r)}function Rj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Lj={duration:.45,ease:[.4,0,.1,1]},qw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gw=qw("applewebkit/")&&!qw("chrome/")?Math.round:or;function Zw(e){e.min=Gw(e.min),e.max=Gw(e.max)}function Nj(e){Zw(e.x),Zw(e.y)}function lC(e,t,n){return e==="position"||e==="preserve-aspect"&&!BN(Bw(t),Bw(n),.2)}function jj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Dj=aC({attachResizeListener:(e,t)=>Mu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Vm={current:void 0},cC=aC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Vm.current){const e=new Dj({});e.mount(window),e.setOptions({layoutScroll:!0}),Vm.current=e}return Vm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Bj={pan:{Feature:ej},drag:{Feature:tj,ProjectionNode:cC,MeasureLayout:eC}};function Yw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&He.postRender(()=>o(t,vh(t)))}class zj extends rs{mount(){const{current:t}=this.node;t&&(this.unmount=BR(t,n=>(Yw(this.node,n,"Start"),r=>Yw(this.node,r,"End"))))}unmount(){}}class Fj extends rs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yh(Mu(this.node.current,"focus",()=>this.onFocus()),Mu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Kw(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&He.postRender(()=>o(t,vh(t)))}class Wj extends rs{mount(){const{current:t}=this.node;t&&(this.unmount=VR(t,n=>(Kw(this.node,n,"Start"),(r,{success:i})=>Kw(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const my=new WeakMap,Um=new WeakMap,Vj=e=>{const t=my.get(e.target);t&&t(e)},Uj=e=>{e.forEach(Vj)};function Hj({root:e,...t}){const n=e||document;Um.has(n)||Um.set(n,{});const r=Um.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Uj,{root:e,...t})),r[i]}function qj(e,t,n){const r=Hj(t);return my.set(e,n),r.observe(e),()=>{my.delete(e),r.unobserve(e)}}const Gj={some:0,all:1};class Zj extends rs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Gj[i]},l=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),m=h?u:f;m&&m(c)};return qj(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Yj(t,n))&&this.startObserver()}unmount(){}}function Yj({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Kj={inView:{Feature:Zj},tap:{Feature:Wj},focus:{Feature:Fj},hover:{Feature:zj}},Xj={layout:{ProjectionNode:cC,MeasureLayout:eC}},gy={current:null},uC={current:!1};function Jj(){if(uC.current=!0,!!Pb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gy.current=e.matches;e.addListener(t),t()}else gy.current=!1}const Qj=[...LE,zn,Qo],tD=e=>Qj.find(RE(e)),Xw=new WeakMap;function eD(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Vn(i))e.addValue(r,i),process.env.NODE_ENV==="development"&&wp(i.version==="11.18.2",`Attempting to mix Motion versions ${i.version} with 11.18.2 may not work as expected.`);else if(Vn(o))e.addValue(r,Cu(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Cu(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Jw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class nD{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=bi.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,He.render(this.render,!1,!0))};const{latestValues:c,renderState:h,onUpdate:u}=s;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Pp(n),this.isVariantNode=VT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const x=m[y];c[y]!==void 0&&Vn(x)&&x.set(c[y],!1)}}mount(t){this.current=t,Xw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),uC.current||Jj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gy.current,process.env.NODE_ENV!=="production"&&wp(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Xw.delete(this.current),this.projection&&this.projection.unmount(),Jo(this.notifyUpdate),Jo(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ba.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&He.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in bl){const n=bl[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Jw.length;r++){const i=Jw[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=eD(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Cu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&($E(i)||SE(i))?i=parseFloat(i):!tD(i)&&Qo.test(n)&&(i=OE(t,n)),this.setBaseTarget(t,Vn(i)?i.get():i)),Vn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=kb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Vn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Hb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hC extends nD{constructor(){super(...arguments),this.KeyframeResolver=NE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function rD(e){return window.getComputedStyle(e)}class iD extends hC{constructor(){super(...arguments),this.type="html",this.renderInstance=JT}readValueFromInstance(t,n){if(ba.has(n)){const r=Kb(n);return r&&r.default||0}else{const r=rD(t),i=(YT(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return QE(t,n)}build(t,n,r){Rb(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Db(t,n,r)}}class oD extends hC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ba.has(n)){const r=Kb(n);return r&&r.default||0}return n=QT.has(n)?n:Cb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return nE(t,n,r)}build(t,n,r){Lb(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){tE(t,n,r,i)}mount(t){this.isSVGTag=jb(t.tagName),super.mount(t)}}const sD=(e,t)=>Mb(e)?new oD(t):new iD(t,{allowProjection:e!==v.Fragment}),aD=$R({...MN,...Kj,...Bj,...Xj},sD),Jf=GI(aD),lD={div:"div",span:"span",p:"p",hr:"hr",a:"a",strong:"strong",em:"em",del:"del",li:"li",ul:"ul",ol:"ol",form:"form",img:"img",header:"header",footer:"footer",section:"section",nav:"nav",main:"main",article:"article",aside:"aside",figure:"figure",figcaption:"figcaption",th:"th",td:"td",caption:"caption",blockquote:"blockquote",address:"address",time:"time",legend:"legend",label:"label",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",code:"code"},cD=new Set(["motion","initial","animate","exit","transition","variants","whileHover","whileTap","whileFocus","whileInView","animateLayout"]);function V(e,t,...n){const{style:r,className:i,...o}=t||{};if(o.motion){const l={};for(const h of cD)if(h in o){const u=h==="animateLayout"?"layout":h;let f=o[h];u==="transition"&&f&&typeof f=="object"&&(f={...f,repeat:Math.max(0,Number(f.repeat)||0)}),l[u]=f,delete o[h]}const c=Jf[e]||Jf.div;return v.createElement(c,{...o,className:i,style:r||{},...l},...n)}delete o.animateLayout;const s=lD[e];return s?v.createElement(s,{...o,className:i,style:r||{}},...n):v.createElement(e,{...o,className:i,style:r||{}},...n)}const uD={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},fC={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},dC=["base","sm","md","lg","xl","2xl"],xn={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},rf={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},Qw={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",auto:"auto",screen:"100vw",fit:"fit-content",max:"max-content",min:"min-content"},of={"flex-row":"row","flex-row-reverse":"row-reverse","flex-col":"column","flex-col-reverse":"column-reverse"},sf={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-baseline":"baseline","items-stretch":"stretch"},af={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly"},lf={"rounded-none":"0px","rounded-sm":"0.125rem",rounded:"0.25rem","rounded-md":"0.375rem","rounded-lg":"0.5rem","rounded-xl":"0.75rem","rounded-2xl":"1rem","rounded-3xl":"1.5rem","rounded-full":"9999px"},hD=["hidden","block","flex","grid","inline","inline-block","inline-flex"];function e0(e,t,n,r){const i=new Map,o=e.split(/\s+/).filter(Boolean);for(const s of o){const l=new RegExp(n.source).exec(s);if(l){i.set(l[1],r(l));continue}const c=new RegExp(t.source).exec(s);c&&i.set("base",r([null,null,c[1]]))}return i}function pC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(flex-row|flex-row-reverse|flex-col|flex-col-reverse)$/);if(i&&of[i[2]]){t.set(i[1],of[i[2]]);continue}of[r]&&t.set("base",of[r])}return t}function mC(e){return e0(e,/^gap-(\d+(?:\.\d+)?)$/,/^(sm|md|lg|xl|2xl):gap-(\d+(?:\.\d+)?)$/,t=>xn[t[2]]||`${t[2]}px`)}function gC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):w-(.+)$/);if(i){const s=Qw[i[2]]||xn[i[2]]||i[2];s&&t.set(i[1],s);continue}const o=r.match(/^w-(.+)$/);if(o){const s=Qw[o[1]]||xn[o[1]]||o[1];s&&t.set("base",s)}}return t}function fD(e){return e0(e,/^min-h-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):min-h-\[([^\]]+)\]$/,t=>t[2])}function yC(e){const t=new Map,n=new Map,r=new Map,i=new Map,o=new Map,s=new Map,l=new Map,c=e.split(/\s+/).filter(Boolean);for(const h of c)for(const[u,f]of[["m-",t],["mt-",n],["mr-",r],["mb-",i],["ml-",o],["mx-",s],["my-",l]]){const m=h.match(new RegExp(`^(sm|md|lg|xl|2xl):${u}(\\d+(?:\\.\\d+)?)$`));if(m&&xn[m[2]]){f.set(m[1],xn[m[2]]);break}const y=h.match(new RegExp(`^${u}(\\d+(?:\\.\\d+)?)$`));if(y&&xn[y[1]]){f.set("base",xn[y[1]]);break}}return{all:t,t:n,r,b:i,l:o,x:s,y:l}}function vC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(items-start|items-end|items-center|items-baseline|items-stretch)$/);if(i&&sf[i[2]]){t.set(i[1],sf[i[2]]);continue}sf[r]&&t.set("base",sf[r])}return t}function bC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(justify-start|justify-end|justify-center|justify-between|justify-around|justify-evenly)$/);if(i&&af[i[2]]){t.set(i[1],af[i[2]]);continue}af[r]&&t.set("base",af[r])}return t}function xC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(rounded-none|rounded-sm|rounded|rounded-md|rounded-lg|rounded-xl|rounded-2xl|rounded-3xl|rounded-full)$/);if(i&&lf[i[2]]){t.set(i[1],lf[i[2]]);continue}lf[r]&&t.set("base",lf[r])}return t}function n0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(hidden|block|flex|grid|inline|inline-block|inline-flex)$/);if(i){t.set(i[1],i[2]==="hidden"?"none":i[2]);continue}hD.includes(r)&&t.set("base",r==="hidden"?"none":r)}return t}function r0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):grid-cols-(\d+)$/);if(i){t.set(i[1],parseInt(i[2],10));continue}const o=r.match(/^grid-cols-(\d+)$/);o&&t.set("base",parseInt(o[1],10))}return t}function dD(e){return e0(e,/^grid-cols-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):grid-cols-\[([^\]]+)\]$/,t=>t[2].replace(/_/g," "))}function i0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);if(i&&rf[i[2]]){t.set(i[1],rf[i[2]]);continue}const o=r.match(/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);o&&rf[o[1]]&&t.set("base",rf[o[1]])}return t}function o0(e){const t=new Map,n=new Map,r=new Map,i=e.split(/\s+/).filter(Boolean);for(const o of i){const s=o.match(/^(sm|md|lg|xl|2xl):px-(\d+(?:\.\d+)?)$/);if(s&&xn[s[2]]){t.set(s[1],xn[s[2]]);continue}const l=o.match(/^px-(\d+(?:\.\d+)?)$/);if(l&&xn[l[1]]){t.set("base",xn[l[1]]);continue}const c=o.match(/^(sm|md|lg|xl|2xl):py-(\d+(?:\.\d+)?)$/);if(c&&xn[c[2]]){n.set(c[1],xn[c[2]]);continue}const h=o.match(/^py-(\d+(?:\.\d+)?)$/);if(h&&xn[h[1]]){n.set("base",xn[h[1]]);continue}const u=o.match(/^(sm|md|lg|xl|2xl):p-(\d+(?:\.\d+)?)$/);if(u&&xn[u[2]]){r.set(u[1],xn[u[2]]);continue}const f=o.match(/^p-(\d+(?:\.\d+)?)$/);f&&xn[f[1]]&&r.set("base",xn[f[1]])}return{px:t,py:n,p:r}}function yy(e){return e.flexDirection.size>0||e.gap.size>0||e.width.size>0||e.minHeight.size>0||e.alignItems.size>0||e.justifyContent.size>0||e.padding.px.size>0||e.padding.py.size>0||e.padding.p.size>0||e.display.size>0||e.gridCols.size>0||e.gridTemplateColumns.size>0||e.textSize.size>0||e.borderRadius.size>0||e.margin.all.size>0||e.margin.t.size>0||e.margin.r.size>0||e.margin.b.size>0||e.margin.l.size>0||e.margin.x.size>0||e.margin.y.size>0}function vy(e){return{flexDirection:pC(e),gap:mC(e),width:gC(e),minHeight:fD(e),margin:yC(e),alignItems:vC(e),justifyContent:bC(e),padding:o0(e),display:n0(e),gridCols:r0(e),gridTemplateColumns:dD(e),textSize:i0(e),borderRadius:xC(e),any:!1}}const ku=uD;function pD(e){return r0(e)}function mD(e,t){let n=e.get("base")??1;const r=["2xl","xl","lg","md","sm"];if(t<=0){for(const i of r)if(e.has(i))return e.get(i);return n}for(const i of["sm","md","lg","xl","2xl"])t>=(ku[i]||0)&&e.has(i)&&(n=e.get(i));return n}function s0(e){return i0(e)}function Vt(e,t,n){let r=e.get("base")??n;for(const i of["sm","md","lg","xl","2xl"])t>=(ku[i]||0)&&e.has(i)&&(r=e.get(i));return r}function bh(e){return o0(e)}function ic(e){return n0(e)}function wC(e){const[t,n]=v.useState(()=>{var i;return((i=e.current)==null?void 0:i.offsetWidth)??0}),r=v.useRef(t);return v.useEffect(()=>{const i=e.current;if(!i)return;const o=i.offsetWidth;o>0&&o!==r.current&&(r.current=o,n(o));const s=new ResizeObserver(l=>{for(const c of l){const h=Math.round(c.contentRect.width);h>0&&h!==r.current&&(r.current=h,n(h))}});return s.observe(i),()=>{s.disconnect()}},[e]),t}function gD(e,t,n){var h,u,f;const i=(Array.isArray(t.tabItems)?t.tabItems:Array.isArray(t.tabs)?t.tabs:[]).filter(m=>!m.condition||!e.evaluateCondition||e.evaluateCondition(m.condition));if(i.length===0)return null;const o=`__tab_${n}`,s=e.sceneData[o]??(t.defaultTab||0),l={width:"100%",display:"flex",flexDirection:"column",...t.className?((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,...c},v.createElement("div",{style:{display:"flex",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,gap:"0"}},i.map((m,y)=>v.createElement("button",{key:`${n}-tab-${y}`,onClick:()=>e.setSceneData(x=>({...x,[o]:y})),style:{padding:"8px 16px",fontSize:"13px",fontWeight:s===y?600:400,color:s===y?e.cfg.colors.primary:e.cfg.colors.textMuted,borderBottom:s===y?`2px solid ${e.cfg.colors.primary}`:"2px solid transparent",background:"none",border:"none",borderBottomStyle:"solid",borderBottomWidth:"2px",borderBottomColor:s===y?e.cfg.colors.primary:"transparent",cursor:"pointer",transition:e.cfg.effects.transition}},m.label||m.title))),v.createElement("div",{style:{padding:"12px 0"}},(Array.isArray((u=i[s])==null?void 0:u.content)?i[s].content:Array.isArray((f=i[s])==null?void 0:f.children)?i[s].children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-tabcontent-${s}`))))}function yD(e,t,n){var s;Array.isArray(t.items)&&!Array.isArray(t.accordionItems)&&(t.accordionItems=t.items);const r=Array.isArray(t.accordionItems)?t.accordionItems:[];if(r.length===0)return null;const i={width:"100%",display:"flex",flexDirection:"column",gap:"1px",...t.className?((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},r.map((l,c)=>{const h=`__acc_${n}_${c}`,u=e.sceneData[h]??(l.defaultOpen||!1);return v.createElement("div",{key:`${n}-acc-${c}`},v.createElement("button",{onClick:()=>e.setSceneData(f=>({...f,[h]:!u})),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"none",border:"none",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.textSecondary,fontSize:e.cfg.typography.baseFontSize,fontWeight:500,cursor:"pointer",transition:e.cfg.effects.transition}},V("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.icon?e.renderIcon(l.icon,14,{color:e.cfg.colors.primary}):null,V("span",null,l.title)),V("span",{style:{transform:u?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",fontSize:"24px"}},"▾")),v.createElement(BI,{initial:!1},u&&v.createElement(Jf.div,{key:`${n}-acc-body-${c}`,initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.3,ease:"easeInOut"},opacity:{duration:.25}},style:{overflow:"hidden"}},v.createElement("div",{style:{padding:"8px 12px",display:"flex",flexDirection:"column",gap:"8px"}},(Array.isArray(l.content)?l.content:typeof l.content=="string"?[{type:"text",text:l.content}]:Array.isArray(l.children)?l.children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-acc-${c}-content`))))))}))}function vD(e,t,n){var y,x,p,b,P;const r=(y=e.paginationState)==null?void 0:y[n],i=t.pagination===!0&&r&&r.total>r.limit,o=t.pagination==="scroll",s=r?Math.ceil(r.total/r.limit):0,l=t.className||"flex flex-col gap-3 w-full",c=((x=e.parseClassNameResponsive)==null?void 0:x.call(e,l,n))??e.parseClassName(l);t.rawStyle&&Object.assign(c,t.rawStyle);const h=(p=e.loading)==null?void 0:p[n],u=(b=e.listData)==null?void 0:b[n],f=Array.isArray(u)?u:[],m=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{};return v.createElement("div",{key:n,className:l,style:c,"data-component-key":n,...m},h&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},V("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),!h&&f.length===0&&t.emptyComponent&&e.renderComponent(t.emptyComponent,0,`${n}-empty`),!h&&t.selectable&&e.sceneData._selectMode&&f.length>0&&V("div",{key:`${n}-sel-hdr`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:((P=t.selectionStyle)==null?void 0:P.headerPadding)||"0.5rem 2rem"}},V("button",{type:"button",onClick:()=>{const S=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[],A=f.map((w,T)=>String(w.id||T)),E=A.length>0&&A.every(w=>S.includes(w));e.setSceneData(w=>({...w,_selIds:E?[]:A}))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textSecondary,fontSize:"12px",fontFamily:"inherit",padding:"4px 0"}},(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).filter(S=>f.some(A=>String(A.id)===S)).length===f.filter(S=>S.id).length&&f.length>0?"Deselect all":"Select all"),(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length>0?V("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},...(Array.isArray(t.selectActions)?t.selectActions:[]).map((S,A)=>V("button",{key:A,type:"button",onClick:()=>{var w;const E=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[];E.length!==0&&((w=e.runBulkSelectAction)==null||w.call(e,S,t.dataSource,n,E))},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,transition:"all 0.15s ease",padding:"0"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor=e.cfg.colors.border,E.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent",E.currentTarget.style.color=e.cfg.colors.textSecondary}},e.renderIcon(S.icon,12))),V("span",{style:{fontSize:"12px",color:e.cfg.colors.textMuted}},`${(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length} selected`)):null),!h&&f.length>0&&(()=>{var G,X,lt,H,et;const S=(G=t.groupBy)==null?void 0:G.field,A=it=>{const at=it==null?void 0:it[S];if(at&&typeof at=="object"&&at._seconds)return at._seconds*1e3;const ct=Date.parse(at);return isNaN(ct)?0:ct},E=it=>{if(!it)return"Earlier";const at=new Date(it),ct=new Date,yt=Et=>`${Et.getFullYear()}-${Et.getMonth()}-${Et.getDate()}`;if(yt(at)===yt(ct))return"Today";const vt=new Date(ct);return vt.setDate(ct.getDate()-1),yt(at)===yt(vt)?"Yesterday":at.toLocaleDateString()},T=((X=t.sort)==null?void 0:X.field)||S?[...f].sort((it,at)=>{var yt;const ct=A(at)-A(it);return((yt=t.sort)==null?void 0:yt.direction)==="asc"?-ct:ct}):f,O=String(e.sceneData.recordingSearchApplied||"").trim().toLowerCase(),[I,N]=String(e.sceneData.recordingDateFilterApplied||"").split("|"),F=I?Date.parse(`${I}T00:00:00`):0,D=N?Date.parse(`${N}T23:59:59.999`):Number.POSITIVE_INFINITY,j=(lt=t.itemsFilter)!=null&&lt.eq?e.interpolateText(String(t.itemsFilter.eq)):"",U=((H=t.itemsFilter)!=null&&H.field&&j?T.filter(it=>String(it==null?void 0:it[t.itemsFilter.field])===j):T).filter(it=>{const at=!O||[it.url,it.title,it.prompt].some(yt=>String(yt||"").toLowerCase().includes(O)),ct=A(it);return at&&ct>=F&&ct<=D}),z={};if(S)for(const it of U)(z[et=E(A(it))]||(z[et]=[])).push(it);const Y=(it,at)=>{var ct,yt,vt,Et,Tt,ft,dt,Ct;if(t.renderItem){const nt=JSON.parse(JSON.stringify(t.renderItem)),Lt={...it};if(t.labelField&&t.labelMap){const Wt=String(t.labelField.split(".").reduce((ee,ne)=>ee==null?void 0:ee[ne],it)??"");Lt.label=t.labelMap[Wt]??""}const bt={};if(Array.isArray(nt.children)){for(const Wt of nt.children)if(Wt.content){const ee=Wt.content.match(/^\{\{(\w+)\}\}$/);if(ee){const ne=ee[1],Yt=it[ne];Array.isArray(Yt)&&(bt[ne]=Yt)}}}const ie=JSON.stringify(nt).replace(/\{\{([\w.]+)(?:\|(date|time|datetime|timeago))?\}\}/g,(Wt,ee,ne)=>{const Yt=ee.split(".").reduce((oe,Me)=>oe==null?void 0:oe[Me],Lt);if(Array.isArray(Yt))return Wt;if(Yt==null)return"";if(ne){const oe=Yt&&typeof Yt=="object"&&"_seconds"in Yt?new Date(Yt._seconds*1e3):new Date(Yt);if(!isNaN(oe.getTime())){if(ne==="timeago"){const Me=Math.floor((Date.now()-oe.getTime())/6e4);if(Me<1)return"just now";if(Me<60)return`${Me}m ago`;const se=Math.floor(Me/60);if(se<24)return`${se}h ago`;const on=Math.floor(se/24);return on<7?`${on}d ago`:oe.toLocaleDateString()}return ne==="date"?oe.toLocaleDateString():ne==="time"?oe.toLocaleTimeString():oe.toLocaleString()}}return typeof Yt=="string"?Yt.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):Yt!==void 0?JSON.stringify(Yt):""}),Xt=JSON.parse(ie);Xt.type==="widget"&&Xt.widgetId&&(Xt.props={...Lt,...Xt.props||{}});const Ne=Wt=>{if(!(!Wt||typeof Wt!="object")){Wt.condition&&(Wt.__conditionBase=Lt);for(const ee of Wt.children||[])Ne(ee)}};if(Ne(Xt),Xt.children&&(Xt.children=Xt.children.map(Wt=>{var Yt;const ee=Wt.fieldType||"text",ne=(Yt=Wt.content)==null?void 0:Yt.match(/^\{\{(\w+)\}\}$/);if(ne){const oe=ne[1],Me=bt[oe];if(Me)return ee==="dropdown"?{...Wt,type:"select",content:void 0,placeholder:Wt.fieldPlaceholder||`Select ${oe}...`,options:Me.map(se=>({label:typeof se=="object"?se.label||se.name||JSON.stringify(se):String(se),value:typeof se=="object"?se.value||se.id||JSON.stringify(se):String(se)})),name:`${n}-${at}-${oe}`,className:Wt.className||"w-full text-sm bg-slate-700 border border-slate-500 text-white rounded-lg px-3 py-1.5"}:ee==="multiselect"?{...Wt,type:"container",content:void 0,className:Wt.className||"flex flex-col gap-1 w-full",children:[...Wt.fieldPlaceholder?[{type:"text",content:Wt.fieldPlaceholder,className:"text-xs text-gray-400 mb-1"}]:[{type:"text",content:`Select ${oe}`,className:"text-xs text-gray-400 mb-1"}],...Me.map((se,on)=>({type:"checkbox",label:typeof se=="object"?se.label||se.name||JSON.stringify(se):String(se),name:`${n}-${at}-${oe}-${on}`,className:"text-sm text-gray-200"}))]}:ee==="image-grid"?{...Wt,type:"container",content:void 0,className:"flex flex-row gap-2 w-full overflow-x-auto py-1",children:Me.slice(0,10).map((se,on)=>({type:"image",src:typeof se=="string"?se:se.url||se.src||"",alt:`${oe} ${on+1}`,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0"}))}:{...Wt,type:"container",content:void 0,className:"flex flex-col gap-1 w-full",children:[{type:"text",content:`⚠ "${oe}" is an array (${Me.length} items)`,className:"text-xs font-semibold text-amber-400"},{type:"text",content:"Use ⚡ to fetch fields, then set type in sidebar",className:"text-xs text-amber-300 opacity-75"}]}}return ee==="image"&&Wt.content&&!Wt.content.includes("{{")?{...Wt,type:"image",src:Wt.content,alt:Wt.content,content:void 0,className:Wt.className||"w-full h-32 rounded-lg object-cover"}:Wt})),t.selectable&&e.sceneData._selectMode){const Wt=String(it.id||at),ee=Array.isArray(e.sceneData._selIds)&&e.sceneData._selIds.map(String).includes(Wt),ne=Yt=>Yt?[Yt.text,Yt.content,...Yt.children?Yt.children.flatMap(ne):[]].filter(oe=>typeof oe=="string"&&oe.trim()&&!oe.includes("{{")):[];return Xt.text||Xt.label||ne(Xt).slice(0,2).join(" — ")||String(it.id||at),V("div",{key:`${n}-item-${at}`,className:(ct=t.selectionStyle)==null?void 0:ct.className,style:{position:"relative",width:"100%",textAlign:"left",padding:"1rem 2rem",border:`1px solid ${ee?((yt=t.selectionStyle)==null?void 0:yt.selectedBorderColor)||e.cfg.colors.accent||"#fff":((vt=t.selectionStyle)==null?void 0:vt.borderColor)||e.cfg.colors.border}`,borderRadius:((Et=t.selectionStyle)==null?void 0:Et.borderRadius)||e.cfg.components.inputRadius||"8px",marginBottom:"0.5rem",backgroundColor:ee?((Tt=t.selectionStyle)==null?void 0:Tt.selectedBackgroundColor)||e.cfg.colors.surface:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontFamily:"inherit",fontSize:"14px",fontWeight:ee?600:400,transition:"all 0.15s ease",outline:"none"}},V("div",{style:{position:"absolute",inset:0,zIndex:1,pointerEvents:"none"}},V("button",{type:"button","aria-label":ee?"Deselect item":"Select item",onClick:()=>{e.setSceneData(Yt=>{const oe=Array.isArray(Yt._selIds)?Yt._selIds.map(String):[];return{...Yt,_selIds:oe.includes(Wt)?oe.filter(Me=>Me!==Wt):[...oe,Wt]}})},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",position:"absolute",top:"50%",left:"1.25rem",transform:"translateY(-50%)",pointerEvents:"auto",border:`1px solid ${ee?((ft=t.selectionStyle)==null?void 0:ft.selectedBorderColor)||e.cfg.colors.accent||"#fff":((dt=t.selectionStyle)==null?void 0:dt.borderColor)||e.cfg.colors.border}`,borderRadius:"5px",backgroundColor:ee?((Ct=t.selectionStyle)==null?void 0:Ct.selectedBorderColor)||e.cfg.colors.accent||"#fff":"transparent",color:ee?e.cfg.colors.background:"transparent",transition:"all 0.15s ease"}},ee?e.renderIcon("check",12):null)),e.renderComponent(Xt,at,`${n}-item`))}return V("div",{key:`${n}-row-${at}`,style:{display:"contents"},onClickCapture:()=>{e.rowContextRef&&(e.rowContextRef.current=it)}},e.renderComponent(Xt,at,`${n}-item`))}return null};return S?Object.entries(z).map(([it,at],ct)=>V("div",{key:`${n}-group-${ct}`,style:{display:"flex",flexDirection:"column",gap:"6px"}},V("div",{key:`${n}-group-hdr-${ct}`,style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:e.cfg.colors.textMuted,padding:"10px 4px 2px"}},it),at.map(Y))):U.map(Y)})(),o&&(r==null?void 0:r.hasMore)&&V("div",{"data-bf-scroll-load":n,style:{height:"48px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",...h&&((r==null?void 0:r.page)??0)>0?{}:{pointerEvents:"none",opacity:.55}}},h&&((r==null?void 0:r.page)??0)>0?V("div",{style:{width:"18px",height:"18px",border:"2px solid rgba(128,128,128,0.25)",borderTopColor:e.cfg.colors.primary,borderRadius:"50%",animation:"bf-spin 0.7s linear infinite"}}):V("div",{style:{width:"18px",height:"2px",borderRadius:"2px",background:e.cfg.colors.textMuted,opacity:.4}})),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),V("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${s}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function bD({api:e,c:t,componentKey:n}){var F,D,j,K;const r=(F=e.paginationState)==null?void 0:F[n],i=t.pagination!==!1&&r&&r.total>r.limit,o=r?Math.ceil(r.total/r.limit):0,s=t.className||"w-full overflow-x-auto rounded-xl bg-gray-800/50 border border-gray-700/50",l=((D=e.parseClassNameResponsive)==null?void 0:D.call(e,s,n))??e.parseClassName(s);t.rawStyle&&Object.assign(l,t.rawStyle);const c=(j=e.loading)==null?void 0:j[n],h=(K=e.listData)==null?void 0:K[n],u=Array.isArray(h)?h:[],f=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{},m=!!t.sortable,y=t.sortMode==="client"?"client":"server",[x,p]=v.useState(null),[b,P]=v.useState({}),S=v.useMemo(()=>{if(!x||y!=="client")return u;const U=x.dir==="asc"?1:-1;return[...u].sort((z,Y)=>{const G=z[x.key],X=Y[x.key];return G===X?0:G==null?1:X==null?-1:String(G).localeCompare(String(X),void 0,{numeric:!0})*U})},[u,x,y]),A=U=>{if(!m&&!U.sortable)return;const z=U.field||U.key;let Y=null;!x||x.key!==z?Y={key:z,dir:"asc"}:x.dir==="asc"&&(Y={key:z,dir:"desc"}),p(Y),y==="server"&&Y&&e.fetchListData(t.dataSource,n,0,(r==null?void 0:r.limit)||t.pageSize||10,Y.key,Y.dir)},E=(U,z)=>U.replace(/\{\{([\w.]+)(?:\s*\|\|\s*([^}]+))?\}\}/g,(Y,G,X)=>{const lt=G.split(".").reduce((H,et)=>H==null?void 0:H[et],z);return lt==null||lt===""?X??"":String(lt)}),w=async(U,z)=>{var X;const Y=b[U.id??""]||{},G=z.filter(lt=>lt.editable&&Y[lt.field||lt.key]!==void 0);for(const lt of G){const H=lt.field||lt.key,et=lt.onCellChange||t.onSave;if(!et)continue;const it=et.replace(/\{\{field\}\}/g,JSON.stringify(Y[H]));if(it.startsWith("sdk:"))await e.handleButtonClick(E(it,U),{});else{const at=E(it,U);await fetch(at,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[H]:Y[H]})})}}G.length&&((X=e.showToast)==null||X.call(e,(G.length===1,"Saved"),"success"),P(lt=>{const H={...lt};return delete H[U.id??""],H}),e.fetchListData(t.dataSource,n,(r==null?void 0:r.page)||0,(r==null?void 0:r.limit)||t.pageSize||10))},T=(U,z,Y)=>{const G=z.field||z.key,X=U.id??"";P(lt=>({...lt,[X]:{...lt[X]||{},[G]:Y}}))},O=(U,z)=>{const Y=U.field||U.key,G=z.id??"",X=b[G]||{},lt=X[Y]!==void 0?X[Y]:z[Y],H=U.fieldType||"text",et={style:{width:"100%",background:"transparent",color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",padding:"2px 6px",fontSize:"13px",fontFamily:"inherit"}},it=()=>{U.onCellChange&&X[U.key]!==void 0&&w(z,[U])};if(H==="select"||H==="dropdown")return V("select",{...et,value:String(lt??""),onChange:at=>{T(z,U,at.target.value),U.onCellChange&&w(z,[U])},children:(Array.isArray(U.fieldOptions)?U.fieldOptions:[]).map((at,ct)=>V("option",{key:ct,value:at.value,children:at.label??at.value}))});if(H==="multiselect"){const at=Array.isArray(lt)?lt:[];return V("div",{style:{display:"flex",flexDirection:"column",gap:2}},(Array.isArray(U.fieldOptions)?U.fieldOptions:[]).map((ct,yt)=>{const vt=at.includes(ct.value);return V("label",{key:yt,style:{display:"flex",alignItems:"center",gap:4,fontSize:12}},V("input",{type:"checkbox",checked:vt,onChange:Et=>{const Tt=Et.target.checked?[...at,ct.value]:at.filter(ft=>ft!==ct.value);T(z,U,Tt),U.onCellChange&&w(z,[U])}}),V("span",{children:ct.label??ct.value}))}))}return H==="image"?V("div",{style:{display:"flex",alignItems:"center",gap:6}},lt?V("img",{src:String(lt),alt:U.label,style:{width:32,height:32,borderRadius:4,objectFit:"cover"}}):null,V("input",{...et,value:String(lt??""),placeholder:U.fieldPlaceholder||"Image URL",onChange:at=>T(z,U,at.target.value),onBlur:it})):V("input",{...et,type:H==="number"?"number":"text",value:String(lt??""),placeholder:U.fieldPlaceholder||"",onChange:at=>T(z,U,H==="number"?Number(at.target.value):at.target.value),onBlur:it})},I=U=>{const z=b[U.id??""];return!!z&&Object.keys(z).some(Y=>{var G;return(G=t.columns)==null?void 0:G.some(X=>X.editable&&(X.field||X.key)===Y)})},N=!!t.onSave;return v.createElement("div",{key:n,className:s,style:l,"data-component-key":n,...f},c&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},V("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),v.createElement("table",{className:"w-full"},Array.isArray(t.columns)&&v.createElement("thead",{className:"bg-gray-900/50"},v.createElement("tr",{},t.columns.map(U=>v.createElement("th",{key:U.key,className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},(m||U.sortable)&&U.sortable!==!1?(()=>{const z=x&&x.key===U.key?x:null;return V("button",{type:"button",onClick:()=>A(U),style:{background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",cursor:"pointer",padding:0},children:`${U.label||U.key}${z?z.dir==="asc"?" ↑":" ↓":" ⇅"}`})})():U.label||U.key)),N&&v.createElement("th",{key:"__save",className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},""))),v.createElement("tbody",{className:"divide-y divide-gray-700/50"},S.map((U,z)=>{var Y;return v.createElement("tr",{key:U.id??z,className:"hover:bg-gray-700/30 transition-colors"},(Y=t.columns)==null?void 0:Y.map(G=>v.createElement("td",{key:G.key,className:"px-4 py-3 text-sm text-white"},G.editable?O(G,U):G.template?E(G.template,U):(()=>{const lt=(G.field||G.key).split(".").reduce((H,et)=>H==null?void 0:H[et],U);return lt==null||lt===""?"":String(lt)})())),N&&v.createElement("td",{key:"__save-cell",className:"px-4 py-3 text-sm"},V("button",{type:"button",disabled:!I(U)||c,onClick:()=>w(U,t.columns||[]),className:"px-3 py-1 rounded text-xs font-semibold border transition-all disabled:opacity-40 disabled:cursor-not-allowed",style:{background:I(U)?e.cfg.colors.primary:"transparent",color:I(U)?"#ffffff":e.cfg.colors.textSecondary,borderColor:e.cfg.colors.border},children:"Save"})))}))),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),V("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${o}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function xD(e,t,n){return v.createElement(bD,{api:e,c:t,componentKey:n})}function Re(e){var t=e.width,n=e.height;if(t<0)throw new Error("Negative width is not allowed for Size");if(n<0)throw new Error("Negative height is not allowed for Size");return{width:t,height:n}}function na(e,t){return e.width===t.width&&e.height===t.height}var wD=function(){function e(t){var n=this;this._resolutionListener=function(){return n._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t){var n=this,r={next:t};return this._observers.push(r),{unsubscribe:function(){n._observers=n._observers.filter(function(i){return i!==r})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var t=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(t,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach(function(n){return n.next(t._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function _D(e){return new wD(e)}var SD=function(){function e(t,n,r){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=Re({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=n??function(o){return o},this._allowResizeObserver=(i=r==null?void 0:r.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var t,n;if(this._canvasElement===null)throw new Error("Object is disposed");(t=this._canvasElementResizeObserver)===null||t===void 0||t.disconnect(),this._canvasElementResizeObserver=null,(n=this._devicePixelRatioObservable)===null||n===void 0||n.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitmapSize",{get:function(){return Re({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=Re(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(n){return n!==t})},Object.defineProperty(e.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(n){return n!==t})},e.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)}},e.prototype._resizeBitmap=function(t){var n=this.bitmapSize;na(n,t)||(this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(n,t))},e.prototype._emitBitmapSizeChanged=function(t,n){var r=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._suggestNewBitmapSize=function(t){var n=this._suggestedBitmapSize,r=Re(this._transformBitmapSize(t,this._canvasElementClientSize)),i=na(this.bitmapSize,r)?null:r;n===null&&i===null||n!==null&&i!==null&&na(n,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(n,i))},e.prototype._emitSuggestedBitmapSizeChanged=function(t,n){var r=this;this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._chooseAndInitObserver=function(){var t=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}AD().then(function(n){return n?t._initResizeObserver():t._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var t=this;if(this._canvasElement!==null){var n=t_(this._canvasElement);if(n===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=_D(n),this._devicePixelRatioObservable.subscribe(function(){return t._invalidateBitmapSize()}),this._invalidateBitmapSize()}},e.prototype._invalidateBitmapSize=function(){var t,n;if(this._canvasElement!==null){var r=t_(this._canvasElement);if(r!==null){var i=(n=(t=this._devicePixelRatioObservable)===null||t===void 0?void 0:t.value)!==null&&n!==void 0?n:r.devicePixelRatio,o=this._canvasElement.getClientRects(),s=o[0]!==void 0?TD(o[0],i):Re({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(s)}}},e.prototype._initResizeObserver=function(){var t=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(n){var r=n.find(function(s){return s.target===t._canvasElement});if(!(!r||!r.devicePixelContentBoxSize||!r.devicePixelContentBoxSize[0])){var i=r.devicePixelContentBoxSize[0],o=Re({width:i.inlineSize,height:i.blockSize});t._suggestNewBitmapSize(o)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},e}();function PD(e,t){return new SD(e,t.transform,t.options)}function t_(e){return e.ownerDocument.defaultView}function AD(){return new Promise(function(e){var t=new ResizeObserver(function(n){e(n.every(function(r){return"devicePixelContentBoxSize"in r})),t.disconnect()});t.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function TD(e,t){return Re({width:Math.round(e.left*t+e.width*t)-Math.round(e.left*t),height:Math.round(e.top*t+e.height*t)-Math.round(e.top*t)})}var ED=function(){function e(t,n,r){if(n.width===0||n.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=n,r.width===0||r.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=r,this._context=t}return e.prototype.useMediaCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),t({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),t({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function la(e,t){var n=e.canvasElementClientSize;if(n.width===0||n.height===0)return null;var r=e.bitmapSize;if(r.width===0||r.height===0)return null;var i=e.canvasElement.getContext("2d",t);return i===null?null:new ED(i,n,r)}/*!
14
14
  * @license
15
15
  * TradingView Lightweight Charts™ v5.2.1
16
16
  * Copyright (c) 2026 TradingView, Inc.
@@ -31,18 +31,18 @@
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var s1;function wW(){return s1||(s1=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),x=!1,p=!1,b=!1,P=!1,S=!1,A;A=Symbol.for("react.module.reference");function E(bt){return!!(typeof bt=="string"||typeof bt=="function"||bt===n||bt===i||S||bt===r||bt===h||bt===u||P||bt===y||x||p||b||typeof bt=="object"&&bt!==null&&(bt.$$typeof===m||bt.$$typeof===f||bt.$$typeof===o||bt.$$typeof===s||bt.$$typeof===c||bt.$$typeof===A||bt.getModuleId!==void 0))}function w(bt){if(typeof bt=="object"&&bt!==null){var me=bt.$$typeof;switch(me){case e:var ie=bt.type;switch(ie){case n:case i:case r:case h:case u:return ie;default:var Xt=ie&&ie.$$typeof;switch(Xt){case l:case s:case c:case m:case f:case o:return Xt;default:return me}}case t:return me}}}var T=s,O=o,I=e,N=c,F=n,D=m,j=f,K=t,U=i,z=r,Y=h,G=u,X=!1,lt=!1;function H(bt){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function et(bt){return lt||(lt=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function it(bt){return w(bt)===s}function st(bt){return w(bt)===o}function ct(bt){return typeof bt=="object"&&bt!==null&&bt.$$typeof===e}function yt(bt){return w(bt)===c}function vt(bt){return w(bt)===n}function Et(bt){return w(bt)===m}function Tt(bt){return w(bt)===f}function ft(bt){return w(bt)===t}function dt(bt){return w(bt)===i}function Ct(bt){return w(bt)===r}function nt(bt){return w(bt)===h}function Lt(bt){return w(bt)===u}_e.ContextConsumer=T,_e.ContextProvider=O,_e.Element=I,_e.ForwardRef=N,_e.Fragment=F,_e.Lazy=D,_e.Memo=j,_e.Portal=K,_e.Profiler=U,_e.StrictMode=z,_e.Suspense=Y,_e.SuspenseList=G,_e.isAsyncMode=H,_e.isConcurrentMode=et,_e.isContextConsumer=it,_e.isContextProvider=st,_e.isElement=ct,_e.isForwardRef=yt,_e.isFragment=vt,_e.isLazy=Et,_e.isMemo=Tt,_e.isPortal=ft,_e.isProfiler=dt,_e.isStrictMode=Ct,_e.isSuspense=nt,_e.isSuspenseList=Lt,_e.isValidElementType=E,_e.typeOf=w}()),_e}process.env.NODE_ENV==="production"?Ty.exports=xW():Ty.exports=wW();var _W=Ty.exports,SW=go,PW=yo,AW="[object Number]";function TW(e){return typeof e=="number"||PW(e)&&SW(e)==AW}var rO=TW;const EW=$e(rO);var CW=rO;function OW(e){return CW(e)&&e!=+e}var MW=OW;const uc=$e(MW);var qn=function(t){return t===0?0:t>0?1:-1},Ks=function(t){return fa(t)&&t.indexOf("%")===t.length-1},wt=function(t){return EW(t)&&!uc(t)},kW=function(t){return Zt(t)},wn=function(t){return wt(t)||fa(t)},$W=0,wa=function(t){var n=++$W;return"".concat(t||"").concat(n)},Gn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!wt(t)&&!fa(t))return r;var o;if(Ks(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return uc(o)&&(o=r),i&&o>n&&(o=n),o},Wo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},IW=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},An=function(t,n){return wt(t)&&wt(n)?function(r){return t+r*(n-t)}:function(){return n}};function id(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Pr(r,t))===n})}var RW=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,i=0,o=0,s=0,l=1/0,c=-1/0,h=0,u=0,f=0;f<n;f++)h=t[f].cx||0,u=t[f].cy||0,r+=h,i+=u,o+=h*u,s+=h*h,l=Math.min(l,h),c=Math.max(c,h);var m=n*s!==r*r?(n*o-r*i)/(n*s-r*r):0;return{xmin:l,xmax:c,a:m,b:(i-m*r)/n}},LW=function(t,n){return wt(t)&&wt(n)?t-n:fa(t)&&fa(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function fl(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Ey(e){"@babel/helpers - typeof";return Ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ey(e)}var NW=["viewBox","children"],jW=["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"],a1=["points","pathLength"],cg={svg:NW,polygon:a1,polyline:a1},S0=["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"],od=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!sc(r))return null;var i={};return Object.keys(r).forEach(function(o){S0.includes(o)&&(i[o]=n||function(s){return r[o](r,s)})}),i},DW=function(t,n,r){return function(i){return t(n,r,i),null}},es=function(t,n,r){if(!sc(t)||Ey(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var s=t[o];S0.includes(o)&&typeof s=="function"&&(i||(i={}),i[o]=DW(s,n,r))}),i},BW=["children"],zW=["children"];function l1(e,t){if(e==null)return{};var n=FW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}var c1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},so=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},u1=null,ug=null,P0=function e(t){if(t===u1&&Array.isArray(ug))return ug;var n=[];return v.Children.forEach(t,function(r){Zt(r)||(_W.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),ug=n,u1=t,n};function sr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return so(i)}):r=[so(t)],P0(e).forEach(function(i){var o=Pr(i,"type.displayName")||Pr(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function xr(e,t){var n=sr(e,t);return n&&n[0]}var h1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!wt(r)||r<=0||!wt(i)||i<=0)},WW=["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"],VW=function(t){return t&&t.type&&fa(t.type)&&WW.indexOf(t.type)>=0},UW=function(t){return t&&Cy(t)==="object"&&"clipDot"in t},HW=function(t,n,r,i){var o,s=(o=cg==null?void 0:cg[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!qt(t)&&(i&&s.includes(n)||jW.includes(n))||r&&S0.includes(n)},Dt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(v.isValidElement(t)&&(i=t.props),!sc(i))return null;var o={};return Object.keys(i).forEach(function(s){var l;HW((l=i)===null||l===void 0?void 0:l[s],s,n,r)&&(o[s]=i[s])}),o},Oy=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return f1(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],s=n[i];if(Array.isArray(o)||Array.isArray(s)){if(!e(o,s))return!1}else if(!f1(o,s))return!1}return!0},f1=function(t,n){if(Zt(t)&&Zt(n))return!0;if(!Zt(t)&&!Zt(n)){var r=t.props||{},i=r.children,o=l1(r,BW),s=n.props||{},l=s.children,c=l1(s,zW);return i&&l?fl(o,c)&&Oy(i,l):!i&&!l?fl(o,c):!1}return!1},d1=function(t,n){var r=[],i={};return P0(t).forEach(function(o,s){if(VW(o))r.push(o);else if(o){var l=so(o.type),c=n[l]||{},h=c.handler,u=c.once;if(h&&(!u||!i[l])){var f=h(o,l,s);r.push(f),i[l]=!0}}}),r},qW=function(t){var n=t&&t.type;return n&&c1[n]?c1[n]:null},GW=function(t,n){return P0(n).indexOf(t)},ZW=["children","width","height","viewBox","className","style","title","desc"];function My(){return My=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},My.apply(this,arguments)}function YW(e,t){if(e==null)return{};var n=KW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ky(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,l=e.title,c=e.desc,h=YW(e,ZW),u=i||{width:n,height:r,x:0,y:0},f=te("recharts-surface",o);return v.createElement("svg",My({},Dt(h,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),v.createElement("title",null,l),v.createElement("desc",null,c),t)}var XW=["children","className"];function $y(){return $y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$y.apply(this,arguments)}function JW(e,t){if(e==null)return{};var n=QW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fe=v.forwardRef(function(e,t){var n=e.children,r=e.className,i=JW(e,XW),o=te("recharts-layer",r);return v.createElement("g",$y({className:o},Dt(i,!0),{ref:t}),n)}),t4=process.env.NODE_ENV!=="production",ei=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];if(t4&&typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,function(){return i[s++]}))}};function e4(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var n4=e4,r4=n4;function i4(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:r4(e,t,n)}var o4=i4,s4="\\ud800-\\udfff",a4="\\u0300-\\u036f",l4="\\ufe20-\\ufe2f",c4="\\u20d0-\\u20ff",u4=a4+l4+c4,h4="\\ufe0e\\ufe0f",f4="\\u200d",d4=RegExp("["+f4+s4+u4+h4+"]");function p4(e){return d4.test(e)}var iO=p4;function m4(e){return e.split("")}var g4=m4,oO="\\ud800-\\udfff",y4="\\u0300-\\u036f",v4="\\ufe20-\\ufe2f",b4="\\u20d0-\\u20ff",x4=y4+v4+b4,w4="\\ufe0e\\ufe0f",_4="["+oO+"]",Iy="["+x4+"]",Ry="\\ud83c[\\udffb-\\udfff]",S4="(?:"+Iy+"|"+Ry+")",sO="[^"+oO+"]",aO="(?:\\ud83c[\\udde6-\\uddff]){2}",lO="[\\ud800-\\udbff][\\udc00-\\udfff]",P4="\\u200d",cO=S4+"?",uO="["+w4+"]?",A4="(?:"+P4+"(?:"+[sO,aO,lO].join("|")+")"+uO+cO+")*",T4=uO+cO+A4,E4="(?:"+[sO+Iy+"?",Iy,aO,lO,_4].join("|")+")",C4=RegExp(Ry+"(?="+Ry+")|"+E4+T4,"g");function O4(e){return e.match(C4)||[]}var M4=O4,k4=g4,$4=iO,I4=M4;function R4(e){return $4(e)?I4(e):k4(e)}var L4=R4,N4=o4,j4=iO,D4=L4,B4=tO;function z4(e){return function(t){t=B4(t);var n=j4(t)?D4(t):void 0,r=n?n[0]:t.charAt(0),i=n?N4(n,1).join(""):t.slice(1);return r[e]()+i}}var F4=z4,W4=F4,V4=W4("toUpperCase"),U4=V4;const Dp=$e(U4);function Be(e){return function(){return e}}const hO=Math.cos,sd=Math.sin,ri=Math.sqrt,ad=Math.PI,Bp=2*ad,Ly=Math.PI,Ny=2*Ly,Us=1e-6,H4=Ny-Us;function fO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function q4(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fO;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class G4{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fO:q4(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,l=this._y1,c=r-t,h=i-n,u=s-t,f=l-n,m=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>Us)if(!(Math.abs(f*c-h*u)>Us)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-s,x=i-l,p=c*c+h*h,b=y*y+x*x,P=Math.sqrt(p),S=Math.sqrt(m),A=o*Math.tan((Ly-Math.acos((p+m-b)/(2*P*S)))/2),E=A/S,w=A/P;Math.abs(E-1)>Us&&this._append`L${t+E*u},${n+E*f}`,this._append`A${o},${o},0,0,${+(f*y>u*x)},${this._x1=t+w*c},${this._y1=n+w*h}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),h=t+l,u=n+c,f=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${h},${u}`:(Math.abs(this._x1-h)>Us||Math.abs(this._y1-u)>Us)&&this._append`L${h},${u}`,r&&(m<0&&(m=m%Ny+Ny),m>H4?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=h},${this._y1=u}`:m>Us&&this._append`A${r},${r},0,${+(m>=Ly)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function A0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new G4(t)}function T0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dO(e){this._context=e}dO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function zp(e){return new dO(e)}function pO(e){return e[0]}function mO(e){return e[1]}function gO(e,t){var n=Be(!0),r=null,i=zp,o=null,s=A0(l);e=typeof e=="function"?e:e===void 0?pO:Be(e),t=typeof t=="function"?t:t===void 0?mO:Be(t);function l(c){var h,u=(c=T0(c)).length,f,m=!1,y;for(r==null&&(o=i(y=s())),h=0;h<=u;++h)!(h<u&&n(f=c[h],h,c))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+e(f,h,c),+t(f,h,c));if(y)return o=null,y+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Be(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Be(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Be(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),l):r},l}function bf(e,t,n){var r=null,i=Be(!0),o=null,s=zp,l=null,c=A0(h);e=typeof e=="function"?e:e===void 0?pO:Be(+e),t=typeof t=="function"?t:Be(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?mO:Be(+n);function h(f){var m,y,x,p=(f=T0(f)).length,b,P=!1,S,A=new Array(p),E=new Array(p);for(o==null&&(l=s(S=c())),m=0;m<=p;++m){if(!(m<p&&i(b=f[m],m,f))===P)if(P=!P)y=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=y;--x)l.point(A[x],E[x]);l.lineEnd(),l.areaEnd()}P&&(A[m]=+e(b,m,f),E[m]=+t(b,m,f),l.point(r?+r(b,m,f):A[m],n?+n(b,m,f):E[m]))}if(S)return l=null,S+""||null}function u(){return gO().defined(i).curve(s).context(o)}return h.x=function(f){return arguments.length?(e=typeof f=="function"?f:Be(+f),r=null,h):e},h.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Be(+f),h):e},h.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Be(+f),h):r},h.y=function(f){return arguments.length?(t=typeof f=="function"?f:Be(+f),n=null,h):t},h.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Be(+f),h):t},h.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Be(+f),h):n},h.lineX0=h.lineY0=function(){return u().x(e).y(t)},h.lineY1=function(){return u().x(e).y(n)},h.lineX1=function(){return u().x(r).y(t)},h.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Be(!!f),h):i},h.curve=function(f){return arguments.length?(s=f,o!=null&&(l=s(o)),h):s},h.context=function(f){return arguments.length?(f==null?o=l=null:l=s(o=f),h):o},h}class yO{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Z4(e){return new yO(e,!0)}function Y4(e){return new yO(e,!1)}const E0={draw(e,t){const n=ri(t/ad);e.moveTo(n,0),e.arc(0,0,n,0,Bp)}},K4={draw(e,t){const n=ri(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},vO=ri(1/3),X4=vO*2,J4={draw(e,t){const n=ri(t/X4),r=n*vO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Q4={draw(e,t){const n=ri(t),r=-n/2;e.rect(r,r,n,n)}},tV=.8908130915292852,bO=sd(ad/10)/sd(7*ad/10),eV=sd(Bp/10)*bO,nV=-hO(Bp/10)*bO,rV={draw(e,t){const n=ri(t*tV),r=eV*n,i=nV*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=Bp*o/5,l=hO(s),c=sd(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},hg=ri(3),iV={draw(e,t){const n=-ri(t/(hg*3));e.moveTo(0,n*2),e.lineTo(-hg*n,-n),e.lineTo(hg*n,-n),e.closePath()}},Ir=-.5,Rr=ri(3)/2,jy=1/ri(12),oV=(jy/2+1)*3,sV={draw(e,t){const n=ri(t/oV),r=n/2,i=n*jy,o=r,s=n*jy+n,l=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(l,c),e.lineTo(Ir*r-Rr*i,Rr*r+Ir*i),e.lineTo(Ir*o-Rr*s,Rr*o+Ir*s),e.lineTo(Ir*l-Rr*c,Rr*l+Ir*c),e.lineTo(Ir*r+Rr*i,Ir*i-Rr*r),e.lineTo(Ir*o+Rr*s,Ir*s-Rr*o),e.lineTo(Ir*l+Rr*c,Ir*c-Rr*l),e.closePath()}};function aV(e,t){let n=null,r=A0(i);e=typeof e=="function"?e:Be(e||E0),t=typeof t=="function"?t:Be(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Be(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Be(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function ld(){}function cd(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function xO(e){this._context=e}xO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:cd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:cd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lV(e){return new xO(e)}function wO(e){this._context=e}wO.prototype={areaStart:ld,areaEnd:ld,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:cd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cV(e){return new wO(e)}function _O(e){this._context=e}_O.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:cd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uV(e){return new _O(e)}function SO(e){this._context=e}SO.prototype={areaStart:ld,areaEnd:ld,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function hV(e){return new SO(e)}function p1(e){return e<0?-1:1}function m1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(o*i+s*r)/(r+i);return(p1(o)+p1(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(l))||0}function g1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function fg(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,l=(o-r)/3;e._context.bezierCurveTo(r+l,i+l*t,o-l,s-l*n,o,s)}function ud(e){this._context=e}ud.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:fg(this,this._t0,g1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,fg(this,g1(this,n=m1(this,e,t)),n);break;default:fg(this,this._t0,n=m1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function PO(e){this._context=new AO(e)}(PO.prototype=Object.create(ud.prototype)).point=function(e,t){ud.prototype.point.call(this,t,e)};function AO(e){this._context=e}AO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function fV(e){return new ud(e)}function dV(e){return new PO(e)}function TO(e){this._context=e}TO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=y1(e),i=y1(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function y1(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function pV(e){return new TO(e)}function Fp(e,t){this._context=e,this._t=t}Fp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function mV(e){return new Fp(e,.5)}function gV(e){return new Fp(e,0)}function yV(e){return new Fp(e,1)}function Sl(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,l=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<l;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Dy(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function vV(e,t){return e[t]}function bV(e){const t=[];return t.key=e,t}function xV(){var e=Be([]),t=Dy,n=Sl,r=vV;function i(o){var s=Array.from(e.apply(this,arguments),bV),l,c=s.length,h=-1,u;for(const f of o)for(l=0,++h;l<c;++l)(s[l][h]=[0,+r(f,s[l].key,h,o)]).data=f;for(l=0,u=T0(t(s));l<c;++l)s[u[l]].index=l;return n(s,u),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:Be(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:Be(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Dy:typeof o=="function"?o:Be(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Sl,i):n},i}function wV(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Sl(e,t)}}function _V(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}Sl(e,t)}}function SV(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var l=0,c=0,h=0;l<s;++l){for(var u=e[t[l]],f=u[r][1]||0,m=u[r-1][1]||0,y=(f-m)/2,x=0;x<l;++x){var p=e[t[x]],b=p[r][1]||0,P=p[r-1][1]||0;y+=b-P}c+=f,h+=y*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=h/c)}i[r-1][1]+=i[r-1][0]=n,Sl(e,t)}}function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}var PV=["type","size","sizeType"];function By(){return By=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},By.apply(this,arguments)}function v1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function b1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v1(Object(n),!0).forEach(function(r){AV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AV(e,t,n){return t=TV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TV(e){var t=EV(e,"string");return Ru(t)=="symbol"?t:t+""}function EV(e,t){if(Ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CV(e,t){if(e==null)return{};var n=OV(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function OV(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var EO={symbolCircle:E0,symbolCross:K4,symbolDiamond:J4,symbolSquare:Q4,symbolStar:rV,symbolTriangle:iV,symbolWye:sV},MV=Math.PI/180,kV=function(t){var n="symbol".concat(Dp(t));return EO[n]||E0},$V=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*MV;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},IV=function(t,n){EO["symbol".concat(Dp(t))]=n},Wp=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,l=s===void 0?"area":s,c=CV(t,PV),h=b1(b1({},c),{},{type:r,size:o,sizeType:l}),u=function(){var b=kV(r),P=aV().type(b).size($V(o,l,r));return P()},f=h.className,m=h.cx,y=h.cy,x=Dt(h,!0);return m===+m&&y===+y&&o===+o?v.createElement("path",By({},x,{className:te("recharts-symbols",f),transform:"translate(".concat(m,", ").concat(y,")"),d:u()})):null};Wp.registerSymbol=IV;function Pl(e){"@babel/helpers - typeof";return Pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pl(e)}function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zy.apply(this,arguments)}function x1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function RV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(n),!0).forEach(function(r){Lu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OO(r.key),r)}}function jV(e,t,n){return t&&NV(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function DV(e,t,n){return t=hd(t),BV(e,CO()?Reflect.construct(t,n||[],hd(e).constructor):t.apply(e,n))}function BV(e,t){if(t&&(Pl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zV(e)}function zV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CO=function(){return!!e})()}function hd(e){return hd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hd(e)}function FV(e,t){if(typeof t!="function"&&t!==null)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&&Fy(e,t)}function Fy(e,t){return Fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Fy(e,t)}function Lu(e,t,n){return t=OO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OO(e){var t=WV(e,"string");return Pl(t)=="symbol"?t:t+""}function WV(e,t){if(Pl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lr=32,C0=function(e){function t(){return LV(this,t),DV(this,t,arguments)}return FV(t,e),jV(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Lr/2,s=Lr/6,l=Lr/3,c=r.inactive?i:r.color;if(r.type==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Lr,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(o,"h").concat(l,`
34
+ */var s1;function wW(){return s1||(s1=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),x=!1,p=!1,b=!1,P=!1,S=!1,A;A=Symbol.for("react.module.reference");function E(bt){return!!(typeof bt=="string"||typeof bt=="function"||bt===n||bt===i||S||bt===r||bt===h||bt===u||P||bt===y||x||p||b||typeof bt=="object"&&bt!==null&&(bt.$$typeof===m||bt.$$typeof===f||bt.$$typeof===o||bt.$$typeof===s||bt.$$typeof===c||bt.$$typeof===A||bt.getModuleId!==void 0))}function w(bt){if(typeof bt=="object"&&bt!==null){var me=bt.$$typeof;switch(me){case e:var ie=bt.type;switch(ie){case n:case i:case r:case h:case u:return ie;default:var Xt=ie&&ie.$$typeof;switch(Xt){case l:case s:case c:case m:case f:case o:return Xt;default:return me}}case t:return me}}}var T=s,O=o,I=e,N=c,F=n,D=m,j=f,K=t,U=i,z=r,Y=h,G=u,X=!1,lt=!1;function H(bt){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function et(bt){return lt||(lt=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function it(bt){return w(bt)===s}function at(bt){return w(bt)===o}function ct(bt){return typeof bt=="object"&&bt!==null&&bt.$$typeof===e}function yt(bt){return w(bt)===c}function vt(bt){return w(bt)===n}function Et(bt){return w(bt)===m}function Tt(bt){return w(bt)===f}function ft(bt){return w(bt)===t}function dt(bt){return w(bt)===i}function Ct(bt){return w(bt)===r}function nt(bt){return w(bt)===h}function Lt(bt){return w(bt)===u}_e.ContextConsumer=T,_e.ContextProvider=O,_e.Element=I,_e.ForwardRef=N,_e.Fragment=F,_e.Lazy=D,_e.Memo=j,_e.Portal=K,_e.Profiler=U,_e.StrictMode=z,_e.Suspense=Y,_e.SuspenseList=G,_e.isAsyncMode=H,_e.isConcurrentMode=et,_e.isContextConsumer=it,_e.isContextProvider=at,_e.isElement=ct,_e.isForwardRef=yt,_e.isFragment=vt,_e.isLazy=Et,_e.isMemo=Tt,_e.isPortal=ft,_e.isProfiler=dt,_e.isStrictMode=Ct,_e.isSuspense=nt,_e.isSuspenseList=Lt,_e.isValidElementType=E,_e.typeOf=w}()),_e}process.env.NODE_ENV==="production"?Ty.exports=xW():Ty.exports=wW();var _W=Ty.exports,SW=go,PW=yo,AW="[object Number]";function TW(e){return typeof e=="number"||PW(e)&&SW(e)==AW}var rO=TW;const EW=$e(rO);var CW=rO;function OW(e){return CW(e)&&e!=+e}var MW=OW;const uc=$e(MW);var qn=function(t){return t===0?0:t>0?1:-1},Ks=function(t){return fa(t)&&t.indexOf("%")===t.length-1},wt=function(t){return EW(t)&&!uc(t)},kW=function(t){return Zt(t)},wn=function(t){return wt(t)||fa(t)},$W=0,wa=function(t){var n=++$W;return"".concat(t||"").concat(n)},Gn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!wt(t)&&!fa(t))return r;var o;if(Ks(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return uc(o)&&(o=r),i&&o>n&&(o=n),o},Wo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},IW=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},An=function(t,n){return wt(t)&&wt(n)?function(r){return t+r*(n-t)}:function(){return n}};function id(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Pr(r,t))===n})}var RW=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,i=0,o=0,s=0,l=1/0,c=-1/0,h=0,u=0,f=0;f<n;f++)h=t[f].cx||0,u=t[f].cy||0,r+=h,i+=u,o+=h*u,s+=h*h,l=Math.min(l,h),c=Math.max(c,h);var m=n*s!==r*r?(n*o-r*i)/(n*s-r*r):0;return{xmin:l,xmax:c,a:m,b:(i-m*r)/n}},LW=function(t,n){return wt(t)&&wt(n)?t-n:fa(t)&&fa(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function fl(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Ey(e){"@babel/helpers - typeof";return Ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ey(e)}var NW=["viewBox","children"],jW=["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"],a1=["points","pathLength"],cg={svg:NW,polygon:a1,polyline:a1},S0=["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"],od=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!sc(r))return null;var i={};return Object.keys(r).forEach(function(o){S0.includes(o)&&(i[o]=n||function(s){return r[o](r,s)})}),i},DW=function(t,n,r){return function(i){return t(n,r,i),null}},es=function(t,n,r){if(!sc(t)||Ey(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var s=t[o];S0.includes(o)&&typeof s=="function"&&(i||(i={}),i[o]=DW(s,n,r))}),i},BW=["children"],zW=["children"];function l1(e,t){if(e==null)return{};var n=FW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}var c1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},so=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},u1=null,ug=null,P0=function e(t){if(t===u1&&Array.isArray(ug))return ug;var n=[];return v.Children.forEach(t,function(r){Zt(r)||(_W.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),ug=n,u1=t,n};function sr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return so(i)}):r=[so(t)],P0(e).forEach(function(i){var o=Pr(i,"type.displayName")||Pr(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function xr(e,t){var n=sr(e,t);return n&&n[0]}var h1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!wt(r)||r<=0||!wt(i)||i<=0)},WW=["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"],VW=function(t){return t&&t.type&&fa(t.type)&&WW.indexOf(t.type)>=0},UW=function(t){return t&&Cy(t)==="object"&&"clipDot"in t},HW=function(t,n,r,i){var o,s=(o=cg==null?void 0:cg[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!qt(t)&&(i&&s.includes(n)||jW.includes(n))||r&&S0.includes(n)},Dt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(v.isValidElement(t)&&(i=t.props),!sc(i))return null;var o={};return Object.keys(i).forEach(function(s){var l;HW((l=i)===null||l===void 0?void 0:l[s],s,n,r)&&(o[s]=i[s])}),o},Oy=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return f1(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],s=n[i];if(Array.isArray(o)||Array.isArray(s)){if(!e(o,s))return!1}else if(!f1(o,s))return!1}return!0},f1=function(t,n){if(Zt(t)&&Zt(n))return!0;if(!Zt(t)&&!Zt(n)){var r=t.props||{},i=r.children,o=l1(r,BW),s=n.props||{},l=s.children,c=l1(s,zW);return i&&l?fl(o,c)&&Oy(i,l):!i&&!l?fl(o,c):!1}return!1},d1=function(t,n){var r=[],i={};return P0(t).forEach(function(o,s){if(VW(o))r.push(o);else if(o){var l=so(o.type),c=n[l]||{},h=c.handler,u=c.once;if(h&&(!u||!i[l])){var f=h(o,l,s);r.push(f),i[l]=!0}}}),r},qW=function(t){var n=t&&t.type;return n&&c1[n]?c1[n]:null},GW=function(t,n){return P0(n).indexOf(t)},ZW=["children","width","height","viewBox","className","style","title","desc"];function My(){return My=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},My.apply(this,arguments)}function YW(e,t){if(e==null)return{};var n=KW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ky(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,l=e.title,c=e.desc,h=YW(e,ZW),u=i||{width:n,height:r,x:0,y:0},f=te("recharts-surface",o);return v.createElement("svg",My({},Dt(h,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),v.createElement("title",null,l),v.createElement("desc",null,c),t)}var XW=["children","className"];function $y(){return $y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$y.apply(this,arguments)}function JW(e,t){if(e==null)return{};var n=QW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fe=v.forwardRef(function(e,t){var n=e.children,r=e.className,i=JW(e,XW),o=te("recharts-layer",r);return v.createElement("g",$y({className:o},Dt(i,!0),{ref:t}),n)}),t4=process.env.NODE_ENV!=="production",ei=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];if(t4&&typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,function(){return i[s++]}))}};function e4(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var n4=e4,r4=n4;function i4(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:r4(e,t,n)}var o4=i4,s4="\\ud800-\\udfff",a4="\\u0300-\\u036f",l4="\\ufe20-\\ufe2f",c4="\\u20d0-\\u20ff",u4=a4+l4+c4,h4="\\ufe0e\\ufe0f",f4="\\u200d",d4=RegExp("["+f4+s4+u4+h4+"]");function p4(e){return d4.test(e)}var iO=p4;function m4(e){return e.split("")}var g4=m4,oO="\\ud800-\\udfff",y4="\\u0300-\\u036f",v4="\\ufe20-\\ufe2f",b4="\\u20d0-\\u20ff",x4=y4+v4+b4,w4="\\ufe0e\\ufe0f",_4="["+oO+"]",Iy="["+x4+"]",Ry="\\ud83c[\\udffb-\\udfff]",S4="(?:"+Iy+"|"+Ry+")",sO="[^"+oO+"]",aO="(?:\\ud83c[\\udde6-\\uddff]){2}",lO="[\\ud800-\\udbff][\\udc00-\\udfff]",P4="\\u200d",cO=S4+"?",uO="["+w4+"]?",A4="(?:"+P4+"(?:"+[sO,aO,lO].join("|")+")"+uO+cO+")*",T4=uO+cO+A4,E4="(?:"+[sO+Iy+"?",Iy,aO,lO,_4].join("|")+")",C4=RegExp(Ry+"(?="+Ry+")|"+E4+T4,"g");function O4(e){return e.match(C4)||[]}var M4=O4,k4=g4,$4=iO,I4=M4;function R4(e){return $4(e)?I4(e):k4(e)}var L4=R4,N4=o4,j4=iO,D4=L4,B4=tO;function z4(e){return function(t){t=B4(t);var n=j4(t)?D4(t):void 0,r=n?n[0]:t.charAt(0),i=n?N4(n,1).join(""):t.slice(1);return r[e]()+i}}var F4=z4,W4=F4,V4=W4("toUpperCase"),U4=V4;const Dp=$e(U4);function Be(e){return function(){return e}}const hO=Math.cos,sd=Math.sin,ri=Math.sqrt,ad=Math.PI,Bp=2*ad,Ly=Math.PI,Ny=2*Ly,Us=1e-6,H4=Ny-Us;function fO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function q4(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fO;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class G4{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fO:q4(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,l=this._y1,c=r-t,h=i-n,u=s-t,f=l-n,m=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>Us)if(!(Math.abs(f*c-h*u)>Us)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-s,x=i-l,p=c*c+h*h,b=y*y+x*x,P=Math.sqrt(p),S=Math.sqrt(m),A=o*Math.tan((Ly-Math.acos((p+m-b)/(2*P*S)))/2),E=A/S,w=A/P;Math.abs(E-1)>Us&&this._append`L${t+E*u},${n+E*f}`,this._append`A${o},${o},0,0,${+(f*y>u*x)},${this._x1=t+w*c},${this._y1=n+w*h}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),h=t+l,u=n+c,f=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${h},${u}`:(Math.abs(this._x1-h)>Us||Math.abs(this._y1-u)>Us)&&this._append`L${h},${u}`,r&&(m<0&&(m=m%Ny+Ny),m>H4?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=h},${this._y1=u}`:m>Us&&this._append`A${r},${r},0,${+(m>=Ly)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function A0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new G4(t)}function T0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dO(e){this._context=e}dO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function zp(e){return new dO(e)}function pO(e){return e[0]}function mO(e){return e[1]}function gO(e,t){var n=Be(!0),r=null,i=zp,o=null,s=A0(l);e=typeof e=="function"?e:e===void 0?pO:Be(e),t=typeof t=="function"?t:t===void 0?mO:Be(t);function l(c){var h,u=(c=T0(c)).length,f,m=!1,y;for(r==null&&(o=i(y=s())),h=0;h<=u;++h)!(h<u&&n(f=c[h],h,c))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+e(f,h,c),+t(f,h,c));if(y)return o=null,y+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Be(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Be(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Be(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),l):r},l}function bf(e,t,n){var r=null,i=Be(!0),o=null,s=zp,l=null,c=A0(h);e=typeof e=="function"?e:e===void 0?pO:Be(+e),t=typeof t=="function"?t:Be(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?mO:Be(+n);function h(f){var m,y,x,p=(f=T0(f)).length,b,P=!1,S,A=new Array(p),E=new Array(p);for(o==null&&(l=s(S=c())),m=0;m<=p;++m){if(!(m<p&&i(b=f[m],m,f))===P)if(P=!P)y=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=y;--x)l.point(A[x],E[x]);l.lineEnd(),l.areaEnd()}P&&(A[m]=+e(b,m,f),E[m]=+t(b,m,f),l.point(r?+r(b,m,f):A[m],n?+n(b,m,f):E[m]))}if(S)return l=null,S+""||null}function u(){return gO().defined(i).curve(s).context(o)}return h.x=function(f){return arguments.length?(e=typeof f=="function"?f:Be(+f),r=null,h):e},h.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Be(+f),h):e},h.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Be(+f),h):r},h.y=function(f){return arguments.length?(t=typeof f=="function"?f:Be(+f),n=null,h):t},h.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Be(+f),h):t},h.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Be(+f),h):n},h.lineX0=h.lineY0=function(){return u().x(e).y(t)},h.lineY1=function(){return u().x(e).y(n)},h.lineX1=function(){return u().x(r).y(t)},h.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Be(!!f),h):i},h.curve=function(f){return arguments.length?(s=f,o!=null&&(l=s(o)),h):s},h.context=function(f){return arguments.length?(f==null?o=l=null:l=s(o=f),h):o},h}class yO{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Z4(e){return new yO(e,!0)}function Y4(e){return new yO(e,!1)}const E0={draw(e,t){const n=ri(t/ad);e.moveTo(n,0),e.arc(0,0,n,0,Bp)}},K4={draw(e,t){const n=ri(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},vO=ri(1/3),X4=vO*2,J4={draw(e,t){const n=ri(t/X4),r=n*vO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Q4={draw(e,t){const n=ri(t),r=-n/2;e.rect(r,r,n,n)}},tV=.8908130915292852,bO=sd(ad/10)/sd(7*ad/10),eV=sd(Bp/10)*bO,nV=-hO(Bp/10)*bO,rV={draw(e,t){const n=ri(t*tV),r=eV*n,i=nV*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=Bp*o/5,l=hO(s),c=sd(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},hg=ri(3),iV={draw(e,t){const n=-ri(t/(hg*3));e.moveTo(0,n*2),e.lineTo(-hg*n,-n),e.lineTo(hg*n,-n),e.closePath()}},Ir=-.5,Rr=ri(3)/2,jy=1/ri(12),oV=(jy/2+1)*3,sV={draw(e,t){const n=ri(t/oV),r=n/2,i=n*jy,o=r,s=n*jy+n,l=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(l,c),e.lineTo(Ir*r-Rr*i,Rr*r+Ir*i),e.lineTo(Ir*o-Rr*s,Rr*o+Ir*s),e.lineTo(Ir*l-Rr*c,Rr*l+Ir*c),e.lineTo(Ir*r+Rr*i,Ir*i-Rr*r),e.lineTo(Ir*o+Rr*s,Ir*s-Rr*o),e.lineTo(Ir*l+Rr*c,Ir*c-Rr*l),e.closePath()}};function aV(e,t){let n=null,r=A0(i);e=typeof e=="function"?e:Be(e||E0),t=typeof t=="function"?t:Be(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Be(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Be(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function ld(){}function cd(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function xO(e){this._context=e}xO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:cd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:cd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lV(e){return new xO(e)}function wO(e){this._context=e}wO.prototype={areaStart:ld,areaEnd:ld,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:cd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cV(e){return new wO(e)}function _O(e){this._context=e}_O.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:cd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uV(e){return new _O(e)}function SO(e){this._context=e}SO.prototype={areaStart:ld,areaEnd:ld,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function hV(e){return new SO(e)}function p1(e){return e<0?-1:1}function m1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(o*i+s*r)/(r+i);return(p1(o)+p1(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(l))||0}function g1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function fg(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,l=(o-r)/3;e._context.bezierCurveTo(r+l,i+l*t,o-l,s-l*n,o,s)}function ud(e){this._context=e}ud.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:fg(this,this._t0,g1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,fg(this,g1(this,n=m1(this,e,t)),n);break;default:fg(this,this._t0,n=m1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function PO(e){this._context=new AO(e)}(PO.prototype=Object.create(ud.prototype)).point=function(e,t){ud.prototype.point.call(this,t,e)};function AO(e){this._context=e}AO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function fV(e){return new ud(e)}function dV(e){return new PO(e)}function TO(e){this._context=e}TO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=y1(e),i=y1(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function y1(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function pV(e){return new TO(e)}function Fp(e,t){this._context=e,this._t=t}Fp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function mV(e){return new Fp(e,.5)}function gV(e){return new Fp(e,0)}function yV(e){return new Fp(e,1)}function Sl(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,l=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<l;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Dy(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function vV(e,t){return e[t]}function bV(e){const t=[];return t.key=e,t}function xV(){var e=Be([]),t=Dy,n=Sl,r=vV;function i(o){var s=Array.from(e.apply(this,arguments),bV),l,c=s.length,h=-1,u;for(const f of o)for(l=0,++h;l<c;++l)(s[l][h]=[0,+r(f,s[l].key,h,o)]).data=f;for(l=0,u=T0(t(s));l<c;++l)s[u[l]].index=l;return n(s,u),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:Be(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:Be(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Dy:typeof o=="function"?o:Be(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Sl,i):n},i}function wV(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Sl(e,t)}}function _V(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}Sl(e,t)}}function SV(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var l=0,c=0,h=0;l<s;++l){for(var u=e[t[l]],f=u[r][1]||0,m=u[r-1][1]||0,y=(f-m)/2,x=0;x<l;++x){var p=e[t[x]],b=p[r][1]||0,P=p[r-1][1]||0;y+=b-P}c+=f,h+=y*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=h/c)}i[r-1][1]+=i[r-1][0]=n,Sl(e,t)}}function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}var PV=["type","size","sizeType"];function By(){return By=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},By.apply(this,arguments)}function v1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function b1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v1(Object(n),!0).forEach(function(r){AV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AV(e,t,n){return t=TV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TV(e){var t=EV(e,"string");return Ru(t)=="symbol"?t:t+""}function EV(e,t){if(Ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CV(e,t){if(e==null)return{};var n=OV(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function OV(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var EO={symbolCircle:E0,symbolCross:K4,symbolDiamond:J4,symbolSquare:Q4,symbolStar:rV,symbolTriangle:iV,symbolWye:sV},MV=Math.PI/180,kV=function(t){var n="symbol".concat(Dp(t));return EO[n]||E0},$V=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*MV;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},IV=function(t,n){EO["symbol".concat(Dp(t))]=n},Wp=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,l=s===void 0?"area":s,c=CV(t,PV),h=b1(b1({},c),{},{type:r,size:o,sizeType:l}),u=function(){var b=kV(r),P=aV().type(b).size($V(o,l,r));return P()},f=h.className,m=h.cx,y=h.cy,x=Dt(h,!0);return m===+m&&y===+y&&o===+o?v.createElement("path",By({},x,{className:te("recharts-symbols",f),transform:"translate(".concat(m,", ").concat(y,")"),d:u()})):null};Wp.registerSymbol=IV;function Pl(e){"@babel/helpers - typeof";return Pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pl(e)}function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zy.apply(this,arguments)}function x1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function RV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(n),!0).forEach(function(r){Lu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OO(r.key),r)}}function jV(e,t,n){return t&&NV(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function DV(e,t,n){return t=hd(t),BV(e,CO()?Reflect.construct(t,n||[],hd(e).constructor):t.apply(e,n))}function BV(e,t){if(t&&(Pl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zV(e)}function zV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CO=function(){return!!e})()}function hd(e){return hd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hd(e)}function FV(e,t){if(typeof t!="function"&&t!==null)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&&Fy(e,t)}function Fy(e,t){return Fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Fy(e,t)}function Lu(e,t,n){return t=OO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OO(e){var t=WV(e,"string");return Pl(t)=="symbol"?t:t+""}function WV(e,t){if(Pl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lr=32,C0=function(e){function t(){return LV(this,t),DV(this,t,arguments)}return FV(t,e),jV(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Lr/2,s=Lr/6,l=Lr/3,c=r.inactive?i:r.color;if(r.type==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Lr,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(o,"h").concat(l,`
35
35
  A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(o,`
36
36
  H`).concat(Lr,"M").concat(2*l,",").concat(o,`
37
37
  A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return v.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Lr/8,"h").concat(Lr,"v").concat(Lr*3/4,"h").concat(-Lr,"z"),className:"recharts-legend-icon"});if(v.isValidElement(r.legendIcon)){var h=RV({},r);return delete h.legendIcon,v.cloneElement(r.legendIcon,h)}return v.createElement(Wp,{fill:c,cx:o,cy:o,size:Lr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,s=i.iconSize,l=i.layout,c=i.formatter,h=i.inactiveColor,u={x:0,y:0,width:Lr,height:Lr},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(y,x){var p=y.formatter||c,b=te(Lu(Lu({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",y.inactive));if(y.type==="none")return null;var P=qt(y.value)?null:y.value;ei(!qt(y.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 S=y.inactive?h:y.color;return v.createElement("li",zy({className:b,style:f,key:"legend-item-".concat(x)},es(r.props,y,x)),v.createElement(ky,{width:s,height:s,viewBox:u,style:m},r.renderIcon(y)),v.createElement("span",{className:"recharts-legend-item-text",style:{color:S}},p?p(P,y,x):P))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return v.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(v.PureComponent);Lu(C0,"displayName","Legend");Lu(C0,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var VV=Lp;function UV(){this.__data__=new VV,this.size=0}var HV=UV;function qV(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var GV=qV;function ZV(e){return this.__data__.get(e)}var YV=ZV;function KV(e){return this.__data__.has(e)}var XV=KV,JV=Lp,QV=v0,t6=b0,e6=200;function n6(e,t){var n=this.__data__;if(n instanceof JV){var r=n.__data__;if(!QV||r.length<e6-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new t6(r)}return n.set(e,t),this.size=n.size,this}var r6=n6,i6=Lp,o6=HV,s6=GV,a6=YV,l6=XV,c6=r6;function hc(e){var t=this.__data__=new i6(e);this.size=t.size}hc.prototype.clear=o6;hc.prototype.delete=s6;hc.prototype.get=a6;hc.prototype.has=l6;hc.prototype.set=c6;var MO=hc,u6="__lodash_hash_undefined__";function h6(e){return this.__data__.set(e,u6),this}var f6=h6;function d6(e){return this.__data__.has(e)}var p6=d6,m6=b0,g6=f6,y6=p6;function fd(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new m6;++t<n;)this.add(e[t])}fd.prototype.add=fd.prototype.push=g6;fd.prototype.has=y6;var kO=fd;function v6(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var $O=v6;function b6(e,t){return e.has(t)}var IO=b6,x6=kO,w6=$O,_6=IO,S6=1,P6=2;function A6(e,t,n,r,i,o){var s=n&S6,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var h=o.get(e),u=o.get(t);if(h&&u)return h==t&&u==e;var f=-1,m=!0,y=n&P6?new x6:void 0;for(o.set(e,t),o.set(t,e);++f<l;){var x=e[f],p=t[f];if(r)var b=s?r(p,x,f,t,e,o):r(x,p,f,e,t,o);if(b!==void 0){if(b)continue;m=!1;break}if(y){if(!w6(t,function(P,S){if(!_6(y,S)&&(x===P||i(x,P,n,r,o)))return y.push(S)})){m=!1;break}}else if(!(x===p||i(x,p,n,r,o))){m=!1;break}}return o.delete(e),o.delete(t),m}var RO=A6,T6=Pi,E6=T6.Uint8Array,C6=E6;function O6(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var M6=O6;function k6(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var O0=k6,w1=wh,_1=C6,$6=y0,I6=RO,R6=M6,L6=O0,N6=1,j6=2,D6="[object Boolean]",B6="[object Date]",z6="[object Error]",F6="[object Map]",W6="[object Number]",V6="[object RegExp]",U6="[object Set]",H6="[object String]",q6="[object Symbol]",G6="[object ArrayBuffer]",Z6="[object DataView]",S1=w1?w1.prototype:void 0,dg=S1?S1.valueOf:void 0;function Y6(e,t,n,r,i,o,s){switch(n){case Z6:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case G6:return!(e.byteLength!=t.byteLength||!o(new _1(e),new _1(t)));case D6:case B6:case W6:return $6(+e,+t);case z6:return e.name==t.name&&e.message==t.message;case V6:case H6:return e==t+"";case F6:var l=R6;case U6:var c=r&N6;if(l||(l=L6),e.size!=t.size&&!c)return!1;var h=s.get(e);if(h)return h==t;r|=j6,s.set(e,t);var u=I6(l(e),l(t),r,i,o,s);return s.delete(e),u;case q6:if(dg)return dg.call(e)==dg.call(t)}return!1}var K6=Y6;function X6(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var LO=X6,J6=LO,Q6=cr;function t8(e,t,n){var r=t(e);return Q6(e)?r:J6(r,n(e))}var e8=t8;function n8(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var r8=n8;function i8(){return[]}var o8=i8,s8=r8,a8=o8,l8=Object.prototype,c8=l8.propertyIsEnumerable,P1=Object.getOwnPropertySymbols,u8=P1?function(e){return e==null?[]:(e=Object(e),s8(P1(e),function(t){return c8.call(e,t)}))}:a8,h8=u8;function f8(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var d8=f8,p8=go,m8=yo,g8="[object Arguments]";function y8(e){return m8(e)&&p8(e)==g8}var v8=y8,A1=v8,b8=yo,NO=Object.prototype,x8=NO.hasOwnProperty,w8=NO.propertyIsEnumerable,_8=A1(function(){return arguments}())?A1:function(e){return b8(e)&&x8.call(e,"callee")&&!w8.call(e,"callee")},M0=_8,dd={exports:{}};function S8(){return!1}var P8=S8;dd.exports;(function(e,t){var n=Pi,r=P8,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,h=c||r;e.exports=h})(dd,dd.exports);var jO=dd.exports,A8=9007199254740991,T8=/^(?:0|[1-9]\d*)$/;function E8(e,t){var n=typeof e;return t=t??A8,!!t&&(n=="number"||n!="symbol"&&T8.test(e))&&e>-1&&e%1==0&&e<t}var k0=E8,C8=9007199254740991;function O8(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=C8}var $0=O8,M8=go,k8=$0,$8=yo,I8="[object Arguments]",R8="[object Array]",L8="[object Boolean]",N8="[object Date]",j8="[object Error]",D8="[object Function]",B8="[object Map]",z8="[object Number]",F8="[object Object]",W8="[object RegExp]",V8="[object Set]",U8="[object String]",H8="[object WeakMap]",q8="[object ArrayBuffer]",G8="[object DataView]",Z8="[object Float32Array]",Y8="[object Float64Array]",K8="[object Int8Array]",X8="[object Int16Array]",J8="[object Int32Array]",Q8="[object Uint8Array]",tU="[object Uint8ClampedArray]",eU="[object Uint16Array]",nU="[object Uint32Array]",Ve={};Ve[Z8]=Ve[Y8]=Ve[K8]=Ve[X8]=Ve[J8]=Ve[Q8]=Ve[tU]=Ve[eU]=Ve[nU]=!0;Ve[I8]=Ve[R8]=Ve[q8]=Ve[L8]=Ve[G8]=Ve[N8]=Ve[j8]=Ve[D8]=Ve[B8]=Ve[z8]=Ve[F8]=Ve[W8]=Ve[V8]=Ve[U8]=Ve[H8]=!1;function rU(e){return $8(e)&&k8(e.length)&&!!Ve[M8(e)]}var iU=rU;function oU(e){return function(t){return e(t)}}var DO=oU,pd={exports:{}};pd.exports;(function(e,t){var n=ZC,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l})(pd,pd.exports);var sU=pd.exports,aU=iU,lU=DO,T1=sU,E1=T1&&T1.isTypedArray,cU=E1?lU(E1):aU,BO=cU,uU=d8,hU=M0,fU=cr,dU=jO,pU=k0,mU=BO,gU=Object.prototype,yU=gU.hasOwnProperty;function vU(e,t){var n=fU(e),r=!n&&hU(e),i=!n&&!r&&dU(e),o=!n&&!r&&!i&&mU(e),s=n||r||i||o,l=s?uU(e.length,String):[],c=l.length;for(var h in e)(t||yU.call(e,h))&&!(s&&(h=="length"||i&&(h=="offset"||h=="parent")||o&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||pU(h,c)))&&l.push(h);return l}var bU=vU,xU=Object.prototype;function wU(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||xU;return e===n}var _U=wU;function SU(e,t){return function(n){return e(t(n))}}var zO=SU,PU=zO,AU=PU(Object.keys,Object),TU=AU,EU=_U,CU=TU,OU=Object.prototype,MU=OU.hasOwnProperty;function kU(e){if(!EU(e))return CU(e);var t=[];for(var n in Object(e))MU.call(e,n)&&n!="constructor"&&t.push(n);return t}var $U=kU,IU=g0,RU=$0;function LU(e){return e!=null&&RU(e.length)&&!IU(e)}var _h=LU,NU=bU,jU=$U,DU=_h;function BU(e){return DU(e)?NU(e):jU(e)}var Vp=BU,zU=e8,FU=h8,WU=Vp;function VU(e){return zU(e,WU,FU)}var UU=VU,C1=UU,HU=1,qU=Object.prototype,GU=qU.hasOwnProperty;function ZU(e,t,n,r,i,o){var s=n&HU,l=C1(e),c=l.length,h=C1(t),u=h.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var m=l[f];if(!(s?m in t:GU.call(t,m)))return!1}var y=o.get(e),x=o.get(t);if(y&&x)return y==t&&x==e;var p=!0;o.set(e,t),o.set(t,e);for(var b=s;++f<c;){m=l[f];var P=e[m],S=t[m];if(r)var A=s?r(S,P,m,t,e,o):r(P,S,m,e,t,o);if(!(A===void 0?P===S||i(P,S,n,r,o):A)){p=!1;break}b||(b=m=="constructor")}if(p&&!b){var E=e.constructor,w=t.constructor;E!=w&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof w=="function"&&w instanceof w)&&(p=!1)}return o.delete(e),o.delete(t),p}var YU=ZU,KU=xa,XU=Pi,JU=KU(XU,"DataView"),QU=JU,tH=xa,eH=Pi,nH=tH(eH,"Promise"),rH=nH,iH=xa,oH=Pi,sH=iH(oH,"Set"),FO=sH,aH=xa,lH=Pi,cH=aH(lH,"WeakMap"),uH=cH,Wy=QU,Vy=v0,Uy=rH,Hy=FO,qy=uH,WO=go,fc=KC,O1="[object Map]",hH="[object Object]",M1="[object Promise]",k1="[object Set]",$1="[object WeakMap]",I1="[object DataView]",fH=fc(Wy),dH=fc(Vy),pH=fc(Uy),mH=fc(Hy),gH=fc(qy),Hs=WO;(Wy&&Hs(new Wy(new ArrayBuffer(1)))!=I1||Vy&&Hs(new Vy)!=O1||Uy&&Hs(Uy.resolve())!=M1||Hy&&Hs(new Hy)!=k1||qy&&Hs(new qy)!=$1)&&(Hs=function(e){var t=WO(e),n=t==hH?e.constructor:void 0,r=n?fc(n):"";if(r)switch(r){case fH:return I1;case dH:return O1;case pH:return M1;case mH:return k1;case gH:return $1}return t});var yH=Hs,pg=MO,vH=RO,bH=K6,xH=YU,R1=yH,L1=cr,N1=jO,wH=BO,_H=1,j1="[object Arguments]",D1="[object Array]",xf="[object Object]",SH=Object.prototype,B1=SH.hasOwnProperty;function PH(e,t,n,r,i,o){var s=L1(e),l=L1(t),c=s?D1:R1(e),h=l?D1:R1(t);c=c==j1?xf:c,h=h==j1?xf:h;var u=c==xf,f=h==xf,m=c==h;if(m&&N1(e)){if(!N1(t))return!1;s=!0,u=!1}if(m&&!u)return o||(o=new pg),s||wH(e)?vH(e,t,n,r,i,o):bH(e,t,c,n,r,i,o);if(!(n&_H)){var y=u&&B1.call(e,"__wrapped__"),x=f&&B1.call(t,"__wrapped__");if(y||x){var p=y?e.value():e,b=x?t.value():t;return o||(o=new pg),i(p,b,n,r,o)}}return m?(o||(o=new pg),xH(e,t,n,r,i,o)):!1}var AH=PH,TH=AH,z1=yo;function VO(e,t,n,r,i){return e===t?!0:e==null||t==null||!z1(e)&&!z1(t)?e!==e&&t!==t:TH(e,t,n,r,VO,i)}var I0=VO,EH=MO,CH=I0,OH=1,MH=2;function kH(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var l=n[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){l=n[i];var c=l[0],h=e[c],u=l[1];if(s&&l[2]){if(h===void 0&&!(c in e))return!1}else{var f=new EH;if(r)var m=r(h,u,c,e,t,f);if(!(m===void 0?CH(u,h,OH|MH,r,f):m))return!1}}return!0}var $H=kH,IH=os;function RH(e){return e===e&&!IH(e)}var UO=RH,LH=UO,NH=Vp;function jH(e){for(var t=NH(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,LH(i)]}return t}var DH=jH;function BH(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var HO=BH,zH=$H,FH=DH,WH=HO;function VH(e){var t=FH(e);return t.length==1&&t[0][2]?WH(t[0][0],t[0][1]):function(n){return n===e||zH(n,e,t)}}var UH=VH;function HH(e,t){return e!=null&&t in Object(e)}var qH=HH,GH=eO,ZH=M0,YH=cr,KH=k0,XH=$0,JH=jp;function QH(e,t,n){t=GH(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=JH(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&XH(i)&&KH(s,i)&&(YH(e)||ZH(e)))}var tq=QH,eq=qH,nq=tq;function rq(e,t){return e!=null&&nq(e,t,eq)}var iq=rq,oq=I0,sq=nO,aq=iq,lq=m0,cq=UO,uq=HO,hq=jp,fq=1,dq=2;function pq(e,t){return lq(e)&&cq(t)?uq(hq(e),t):function(n){var r=sq(n,e);return r===void 0&&r===t?aq(n,e):oq(t,r,fq|dq)}}var mq=pq;function gq(e){return e}var dc=gq;function yq(e){return function(t){return t==null?void 0:t[e]}}var vq=yq,bq=_0;function xq(e){return function(t){return bq(t,e)}}var wq=xq,_q=vq,Sq=wq,Pq=m0,Aq=jp;function Tq(e){return Pq(e)?_q(Aq(e)):Sq(e)}var Eq=Tq,Cq=UH,Oq=mq,Mq=dc,kq=cr,$q=Eq;function Iq(e){return typeof e=="function"?e:e==null?Mq:typeof e=="object"?kq(e)?Oq(e[0],e[1]):Cq(e):$q(e)}var Ai=Iq;function Rq(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var qO=Rq;function Lq(e){return e!==e}var Nq=Lq;function jq(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Dq=jq,Bq=qO,zq=Nq,Fq=Dq;function Wq(e,t,n){return t===t?Fq(e,t,n):Bq(e,zq,n)}var Vq=Wq,Uq=Vq;function Hq(e,t){var n=e==null?0:e.length;return!!n&&Uq(e,t,0)>-1}var qq=Hq;function Gq(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Zq=Gq;function Yq(){}var Kq=Yq,mg=FO,Xq=Kq,Jq=O0,Qq=1/0,tG=mg&&1/Jq(new mg([,-0]))[1]==Qq?function(e){return new mg(e)}:Xq,eG=tG,nG=kO,rG=qq,iG=Zq,oG=IO,sG=eG,aG=O0,lG=200;function cG(e,t,n){var r=-1,i=rG,o=e.length,s=!0,l=[],c=l;if(n)s=!1,i=iG;else if(o>=lG){var h=t?null:sG(e);if(h)return aG(h);s=!1,i=oG,c=new nG}else c=t?[]:l;t:for(;++r<o;){var u=e[r],f=t?t(u):u;if(u=n||u!==0?u:0,s&&f===f){for(var m=c.length;m--;)if(c[m]===f)continue t;t&&c.push(f),l.push(u)}else i(c,f,n)||(c!==l&&c.push(f),l.push(u))}return l}var uG=cG,hG=Ai,fG=uG;function dG(e,t){return e&&e.length?fG(e,hG(t)):[]}var pG=dG;const F1=$e(pG);function GO(e,t,n){return t===!0?F1(e,n):qt(t)?F1(e,t):e}function Al(e){"@babel/helpers - typeof";return Al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Al(e)}var mG=["ref"];function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach(function(r){Up(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YO(r.key),r)}}function yG(e,t,n){return t&&V1(e.prototype,t),n&&V1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vG(e,t,n){return t=md(t),bG(e,ZO()?Reflect.construct(t,n||[],md(e).constructor):t.apply(e,n))}function bG(e,t){if(t&&(Al(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xG(e)}function xG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZO=function(){return!!e})()}function md(e){return md=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},md(e)}function wG(e,t){if(typeof t!="function"&&t!==null)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&&Gy(e,t)}function Gy(e,t){return Gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Gy(e,t)}function Up(e,t,n){return t=YO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YO(e){var t=_G(e,"string");return Al(t)=="symbol"?t:t+""}function _G(e,t){if(Al(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Al(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function SG(e,t){if(e==null)return{};var n=PG(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function PG(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function AG(e){return e.value}function TG(e,t){if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e=="function")return v.createElement(e,t);t.ref;var n=SG(t,mG);return v.createElement(C0,n)}var U1=1,ra=function(e){function t(){var n;gG(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=vG(this,t,[].concat(i)),Up(n,"lastBoundingBox",{width:-1,height:-1}),n}return wG(t,e),yG(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>U1||Math.abs(i.height-this.lastBoundingBox.height)>U1)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ji({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,l=i.verticalAlign,c=i.margin,h=i.chartWidth,u=i.chartHeight,f,m;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var y=this.getBBoxSnapshot();f={left:((h||0)-y.width)/2}}else f=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var x=this.getBBoxSnapshot();m={top:((u||0)-x.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ji(Ji({},f),m)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,l=i.height,c=i.wrapperStyle,h=i.payloadUniqBy,u=i.payload,f=Ji(Ji({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return v.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(y){r.wrapperNode=y}},TG(o,Ji(Ji({},this.props),{},{payload:GO(u,h,AG)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Ji(Ji({},this.defaultProps),r.props),s=o.layout;return s==="vertical"&&wt(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])}(v.PureComponent);Up(ra,"displayName","Legend");Up(ra,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var H1=wh,EG=M0,CG=cr,q1=H1?H1.isConcatSpreadable:void 0;function OG(e){return CG(e)||EG(e)||!!(q1&&e&&e[q1])}var MG=OG,kG=LO,$G=MG;function KO(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=$G),i||(i=[]);++o<s;){var l=e[o];t>0&&n(l)?t>1?KO(l,t-1,n,r,i):kG(i,l):r||(i[i.length]=l)}return i}var XO=KO;function IG(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),l=s.length;l--;){var c=s[e?l:++i];if(n(o[c],c,o)===!1)break}return t}}var RG=IG,LG=RG,NG=LG(),jG=NG,DG=jG,BG=Vp;function zG(e,t){return e&&DG(e,t,BG)}var JO=zG,FG=_h;function WG(e,t){return function(n,r){if(n==null)return n;if(!FG(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var VG=WG,UG=JO,HG=VG,qG=HG(UG),R0=qG,GG=R0,ZG=_h;function YG(e,t){var n=-1,r=ZG(e)?Array(e.length):[];return GG(e,function(i,o,s){r[++n]=t(i,o,s)}),r}var QO=YG;function KG(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var XG=KG,G1=oc;function JG(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,o=G1(e),s=t!==void 0,l=t===null,c=t===t,h=G1(t);if(!l&&!h&&!o&&e>t||o&&s&&c&&!l&&!h||r&&s&&c||!n&&c||!i)return 1;if(!r&&!o&&!h&&e<t||h&&n&&i&&!r&&!o||l&&n&&i||!s&&i||!c)return-1}return 0}var QG=JG,t9=QG;function e9(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,l=n.length;++r<s;){var c=t9(i[r],o[r]);if(c){if(r>=l)return c;var h=n[r];return c*(h=="desc"?-1:1)}}return e.index-t.index}var n9=e9,gg=w0,r9=_0,i9=Ai,o9=QO,s9=XG,a9=DO,l9=n9,c9=dc,u9=cr;function h9(e,t,n){t.length?t=gg(t,function(o){return u9(o)?function(s){return r9(s,o.length===1?o[0]:o)}:o}):t=[c9];var r=-1;t=gg(t,a9(i9));var i=o9(e,function(o,s,l){var c=gg(t,function(h){return h(o)});return{criteria:c,index:++r,value:o}});return s9(i,function(o,s){return l9(o,s,n)})}var f9=h9;function d9(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var p9=d9,m9=p9,Z1=Math.max;function g9(e,t,n){return t=Z1(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Z1(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(s),m9(e,this,l)}}var y9=g9;function v9(e){return function(){return e}}var b9=v9,x9=xa,w9=function(){try{var e=x9(Object,"defineProperty");return e({},"",{}),e}catch{}}(),tM=w9,_9=b9,Y1=tM,S9=dc,P9=Y1?function(e,t){return Y1(e,"toString",{configurable:!0,enumerable:!1,value:_9(t),writable:!0})}:S9,A9=P9,T9=800,E9=16,C9=Date.now;function O9(e){var t=0,n=0;return function(){var r=C9(),i=E9-(r-n);if(n=r,i>0){if(++t>=T9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var M9=O9,k9=A9,$9=M9,I9=$9(k9),R9=I9,L9=dc,N9=y9,j9=R9;function D9(e,t){return j9(N9(e,t,L9),e+"")}var B9=D9,z9=y0,F9=_h,W9=k0,V9=os;function U9(e,t,n){if(!V9(n))return!1;var r=typeof t;return(r=="number"?F9(n)&&W9(t,n.length):r=="string"&&t in n)?z9(n[t],e):!1}var Hp=U9,H9=XO,q9=f9,G9=B9,K1=Hp,Z9=G9(function(e,t){if(e==null)return[];var n=t.length;return n>1&&K1(e,t[0],t[1])?t=[]:n>2&&K1(t[0],t[1],t[2])&&(t=[t[0]]),q9(e,H9(t,1),[])}),Y9=Z9;const L0=$e(Y9);function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}function Zy(){return Zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zy.apply(this,arguments)}function K9(e,t){return t7(e)||Q9(e,t)||J9(e,t)||X9()}function X9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J9(e,t){if(e){if(typeof e=="string")return X1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X1(e,t)}}function X1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q9(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function t7(e){if(Array.isArray(e))return e}function J1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J1(Object(n),!0).forEach(function(r){e7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e7(e,t,n){return t=n7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n7(e){var t=r7(e,"string");return Nu(t)=="symbol"?t:t+""}function r7(e,t){if(Nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i7(e){return Array.isArray(e)&&wn(e[0])&&wn(e[1])?e.join(" ~ "):e}var o7=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,o=i===void 0?{}:i,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,h=c===void 0?{}:c,u=t.payload,f=t.formatter,m=t.itemSorter,y=t.wrapperClassName,x=t.labelClassName,p=t.label,b=t.labelFormatter,P=t.accessibilityLayer,S=P===void 0?!1:P,A=function(){if(u&&u.length){var j={padding:0,margin:0},K=(m?L0(u,m):u).map(function(U,z){if(U.type==="none")return null;var Y=yg({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},l),G=U.formatter||f||i7,X=U.value,lt=U.name,H=X,et=lt;if(G&&H!=null&&et!=null){var it=G(X,lt,U,z,u);if(Array.isArray(it)){var st=K9(it,2);H=st[0],et=st[1]}else H=it}return v.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:Y},wn(et)?v.createElement("span",{className:"recharts-tooltip-item-name"},et):null,wn(et)?v.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,v.createElement("span",{className:"recharts-tooltip-item-value"},H),v.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return v.createElement("ul",{className:"recharts-tooltip-item-list",style:j},K)}return null},E=yg({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),w=yg({margin:0},h),T=!Zt(p),O=T?p:"",I=te("recharts-default-tooltip",y),N=te("recharts-tooltip-label",x);T&&b&&u!==void 0&&u!==null&&(O=b(p,u));var F=S?{role:"status","aria-live":"assertive"}:{};return v.createElement("div",Zy({className:I,style:E},F),v.createElement("p",{className:N,style:w},v.isValidElement(O)?O:"".concat(O)),A())};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function wf(e,t,n){return t=s7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s7(e){var t=a7(e,"string");return ju(t)=="symbol"?t:t+""}function a7(e,t){if(ju(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ju(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uc="recharts-tooltip-wrapper",l7={visibility:"hidden"};function c7(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return te(Uc,wf(wf(wf(wf({},"".concat(Uc,"-right"),wt(n)&&t&&wt(t.x)&&n>=t.x),"".concat(Uc,"-left"),wt(n)&&t&&wt(t.x)&&n<t.x),"".concat(Uc,"-bottom"),wt(r)&&t&&wt(t.y)&&r>=t.y),"".concat(Uc,"-top"),wt(r)&&t&&wt(t.y)&&r<t.y))}function Q1(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,o=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,h=e.viewBoxDimension;if(o&&wt(o[r]))return o[r];var u=n[r]-l-i,f=n[r]+i;if(t[r])return s[r]?u:f;if(s[r]){var m=u,y=c[r];return m<y?Math.max(f,c[r]):Math.max(u,c[r])}var x=f+l,p=c[r]+h;return x>p?Math.max(u,c[r]):Math.max(f,c[r])}function u7(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function h7(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,h,u,f;return s.height>0&&s.width>0&&n?(u=Q1({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),f=Q1({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),h=u7({translateX:u,translateY:f,useTranslate3d:l})):h=l7,{cssProperties:h,cssClasses:c7({translateX:u,translateY:f,coordinate:n})}}function Tl(e){"@babel/helpers - typeof";return Tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(e)}function tS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tS(Object(n),!0).forEach(function(r){Ky(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d7(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nM(r.key),r)}}function p7(e,t,n){return t&&d7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function m7(e,t,n){return t=gd(t),g7(e,eM()?Reflect.construct(t,n||[],gd(e).constructor):t.apply(e,n))}function g7(e,t){if(t&&(Tl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y7(e)}function y7(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eM=function(){return!!e})()}function gd(e){return gd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gd(e)}function v7(e,t){if(typeof t!="function"&&t!==null)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&&Yy(e,t)}function Yy(e,t){return Yy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Yy(e,t)}function Ky(e,t,n){return t=nM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nM(e){var t=b7(e,"string");return Tl(t)=="symbol"?t:t+""}function b7(e,t){if(Tl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nS=1,x7=function(e){function t(){var n;f7(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=m7(this,t,[].concat(i)),Ky(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Ky(n,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,h,u;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(h=(u=n.props.coordinate)===null||u===void 0?void 0:u.y)!==null&&h!==void 0?h:0}})}}),n}return v7(t,e),p7(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>nS||Math.abs(r.height-this.state.lastBoundingBox.height)>nS)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,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 r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,h=i.children,u=i.coordinate,f=i.hasPayload,m=i.isAnimationActive,y=i.offset,x=i.position,p=i.reverseDirection,b=i.useTranslate3d,P=i.viewBox,S=i.wrapperStyle,A=h7({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:y,position:x,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:P}),E=A.cssClasses,w=A.cssProperties,T=eS(eS({transition:m&&o?"transform ".concat(l,"ms ").concat(c):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},S);return v.createElement("div",{tabIndex:-1,className:E,style:T,ref:function(I){r.wrapperNode=I}},h)}}])}(v.PureComponent),w7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ss={isSsr:w7()};function El(e){"@babel/helpers - typeof";return El=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},El(e)}function rS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function iS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rS(Object(n),!0).forEach(function(r){N0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S7(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iM(r.key),r)}}function P7(e,t,n){return t&&S7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function A7(e,t,n){return t=yd(t),T7(e,rM()?Reflect.construct(t,n||[],yd(e).constructor):t.apply(e,n))}function T7(e,t){if(t&&(El(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E7(e)}function E7(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rM=function(){return!!e})()}function yd(e){return yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},yd(e)}function C7(e,t){if(typeof t!="function"&&t!==null)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&&Xy(e,t)}function Xy(e,t){return Xy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Xy(e,t)}function N0(e,t,n){return t=iM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iM(e){var t=O7(e,"string");return El(t)=="symbol"?t:t+""}function O7(e,t){if(El(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(El(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function M7(e){return e.dataKey}function k7(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e=="function"?v.createElement(e,t):v.createElement(o7,t)}var wr=function(e){function t(){return _7(this,t),A7(this,t,arguments)}return C7(t,e),P7(t,[{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,h=i.content,u=i.coordinate,f=i.filterNull,m=i.isAnimationActive,y=i.offset,x=i.payload,p=i.payloadUniqBy,b=i.position,P=i.reverseDirection,S=i.useTranslate3d,A=i.viewBox,E=i.wrapperStyle,w=x??[];f&&w.length&&(w=GO(x.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),p,M7));var T=w.length>0;return v.createElement(x7,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:m,active:o,coordinate:u,hasPayload:T,offset:y,position:b,reverseDirection:P,useTranslate3d:S,viewBox:A,wrapperStyle:E},k7(h,iS(iS({},this.props),{},{payload:w})))}}])}(v.PureComponent);N0(wr,"displayName","Tooltip");N0(wr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ss.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 $7=Pi,I7=function(){return $7.Date.now()},R7=I7,L7=/\s/;function N7(e){for(var t=e.length;t--&&L7.test(e.charAt(t)););return t}var j7=N7,D7=j7,B7=/^\s+/;function z7(e){return e&&e.slice(0,D7(e)+1).replace(B7,"")}var F7=z7,W7=F7,oS=os,V7=oc,sS=NaN,U7=/^[-+]0x[0-9a-f]+$/i,H7=/^0b[01]+$/i,q7=/^0o[0-7]+$/i,G7=parseInt;function Z7(e){if(typeof e=="number")return e;if(V7(e))return sS;if(oS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=oS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=W7(e);var n=H7.test(e);return n||q7.test(e)?G7(e.slice(2),n?2:8):U7.test(e)?sS:+e}var oM=Z7,Y7=os,vg=R7,aS=oM,K7="Expected a function",X7=Math.max,J7=Math.min;function Q7(e,t,n){var r,i,o,s,l,c,h=0,u=!1,f=!1,m=!0;if(typeof e!="function")throw new TypeError(K7);t=aS(t)||0,Y7(n)&&(u=!!n.leading,f="maxWait"in n,o=f?X7(aS(n.maxWait)||0,t):o,m="trailing"in n?!!n.trailing:m);function y(T){var O=r,I=i;return r=i=void 0,h=T,s=e.apply(I,O),s}function x(T){return h=T,l=setTimeout(P,t),u?y(T):s}function p(T){var O=T-c,I=T-h,N=t-O;return f?J7(N,o-I):N}function b(T){var O=T-c,I=T-h;return c===void 0||O>=t||O<0||f&&I>=o}function P(){var T=vg();if(b(T))return S(T);l=setTimeout(P,p(T))}function S(T){return l=void 0,m&&r?y(T):(r=i=void 0,s)}function A(){l!==void 0&&clearTimeout(l),h=0,r=c=i=l=void 0}function E(){return l===void 0?s:S(vg())}function w(){var T=vg(),O=b(T);if(r=arguments,i=this,c=T,O){if(l===void 0)return x(c);if(f)return clearTimeout(l),l=setTimeout(P,t),y(c)}return l===void 0&&(l=setTimeout(P,t)),s}return w.cancel=A,w.flush=E,w}var tZ=Q7,eZ=tZ,nZ=os,rZ="Expected a function";function iZ(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(rZ);return nZ(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),eZ(e,t,{leading:r,maxWait:t,trailing:i})}var oZ=iZ;const sM=$e(oZ);function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}function lS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _f(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lS(Object(n),!0).forEach(function(r){sZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t,n){return t=aZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aZ(e){var t=lZ(e,"string");return Du(t)=="symbol"?t:t+""}function lZ(e,t){if(Du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cZ(e,t){return dZ(e)||fZ(e,t)||hZ(e,t)||uZ()}function uZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
39
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hZ(e,t){if(e){if(typeof e=="string")return cS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cS(e,t)}}function cS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function dZ(e){if(Array.isArray(e))return e}var qp=v.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,o=e.width,s=o===void 0?"100%":o,l=e.height,c=l===void 0?"100%":l,h=e.minWidth,u=h===void 0?0:h,f=e.minHeight,m=e.maxHeight,y=e.children,x=e.debounce,p=x===void 0?0:x,b=e.id,P=e.className,S=e.onResize,A=e.style,E=A===void 0?{}:A,w=v.useRef(null),T=v.useRef();T.current=S,v.useImperativeHandle(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var O=v.useState({containerWidth:i.width,containerHeight:i.height}),I=cZ(O,2),N=I[0],F=I[1],D=v.useCallback(function(K,U){F(function(z){var Y=Math.round(K),G=Math.round(U);return z.containerWidth===Y&&z.containerHeight===G?z:{containerWidth:Y,containerHeight:G}})},[]);v.useEffect(function(){var K=function(lt){var H,et=lt[0].contentRect,it=et.width,st=et.height;D(it,st),(H=T.current)===null||H===void 0||H.call(T,it,st)};p>0&&(K=sM(K,p,{trailing:!0,leading:!1}));var U=new ResizeObserver(K),z=w.current.getBoundingClientRect(),Y=z.width,G=z.height;return D(Y,G),U.observe(w.current),function(){U.disconnect()}},[D,p]);var j=v.useMemo(function(){var K=N.containerWidth,U=N.containerHeight;if(K<0||U<0)return null;ei(Ks(s)||Ks(c),`The width(%s) and height(%s) are both fixed numbers,
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J9(e,t){if(e){if(typeof e=="string")return X1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X1(e,t)}}function X1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q9(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function t7(e){if(Array.isArray(e))return e}function J1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J1(Object(n),!0).forEach(function(r){e7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e7(e,t,n){return t=n7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n7(e){var t=r7(e,"string");return Nu(t)=="symbol"?t:t+""}function r7(e,t){if(Nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i7(e){return Array.isArray(e)&&wn(e[0])&&wn(e[1])?e.join(" ~ "):e}var o7=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,o=i===void 0?{}:i,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,h=c===void 0?{}:c,u=t.payload,f=t.formatter,m=t.itemSorter,y=t.wrapperClassName,x=t.labelClassName,p=t.label,b=t.labelFormatter,P=t.accessibilityLayer,S=P===void 0?!1:P,A=function(){if(u&&u.length){var j={padding:0,margin:0},K=(m?L0(u,m):u).map(function(U,z){if(U.type==="none")return null;var Y=yg({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},l),G=U.formatter||f||i7,X=U.value,lt=U.name,H=X,et=lt;if(G&&H!=null&&et!=null){var it=G(X,lt,U,z,u);if(Array.isArray(it)){var at=K9(it,2);H=at[0],et=at[1]}else H=it}return v.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:Y},wn(et)?v.createElement("span",{className:"recharts-tooltip-item-name"},et):null,wn(et)?v.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,v.createElement("span",{className:"recharts-tooltip-item-value"},H),v.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return v.createElement("ul",{className:"recharts-tooltip-item-list",style:j},K)}return null},E=yg({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),w=yg({margin:0},h),T=!Zt(p),O=T?p:"",I=te("recharts-default-tooltip",y),N=te("recharts-tooltip-label",x);T&&b&&u!==void 0&&u!==null&&(O=b(p,u));var F=S?{role:"status","aria-live":"assertive"}:{};return v.createElement("div",Zy({className:I,style:E},F),v.createElement("p",{className:N,style:w},v.isValidElement(O)?O:"".concat(O)),A())};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function wf(e,t,n){return t=s7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s7(e){var t=a7(e,"string");return ju(t)=="symbol"?t:t+""}function a7(e,t){if(ju(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ju(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uc="recharts-tooltip-wrapper",l7={visibility:"hidden"};function c7(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return te(Uc,wf(wf(wf(wf({},"".concat(Uc,"-right"),wt(n)&&t&&wt(t.x)&&n>=t.x),"".concat(Uc,"-left"),wt(n)&&t&&wt(t.x)&&n<t.x),"".concat(Uc,"-bottom"),wt(r)&&t&&wt(t.y)&&r>=t.y),"".concat(Uc,"-top"),wt(r)&&t&&wt(t.y)&&r<t.y))}function Q1(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,o=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,h=e.viewBoxDimension;if(o&&wt(o[r]))return o[r];var u=n[r]-l-i,f=n[r]+i;if(t[r])return s[r]?u:f;if(s[r]){var m=u,y=c[r];return m<y?Math.max(f,c[r]):Math.max(u,c[r])}var x=f+l,p=c[r]+h;return x>p?Math.max(u,c[r]):Math.max(f,c[r])}function u7(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function h7(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,h,u,f;return s.height>0&&s.width>0&&n?(u=Q1({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),f=Q1({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),h=u7({translateX:u,translateY:f,useTranslate3d:l})):h=l7,{cssProperties:h,cssClasses:c7({translateX:u,translateY:f,coordinate:n})}}function Tl(e){"@babel/helpers - typeof";return Tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(e)}function tS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tS(Object(n),!0).forEach(function(r){Ky(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d7(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nM(r.key),r)}}function p7(e,t,n){return t&&d7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function m7(e,t,n){return t=gd(t),g7(e,eM()?Reflect.construct(t,n||[],gd(e).constructor):t.apply(e,n))}function g7(e,t){if(t&&(Tl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y7(e)}function y7(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eM=function(){return!!e})()}function gd(e){return gd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gd(e)}function v7(e,t){if(typeof t!="function"&&t!==null)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&&Yy(e,t)}function Yy(e,t){return Yy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Yy(e,t)}function Ky(e,t,n){return t=nM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nM(e){var t=b7(e,"string");return Tl(t)=="symbol"?t:t+""}function b7(e,t){if(Tl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nS=1,x7=function(e){function t(){var n;f7(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=m7(this,t,[].concat(i)),Ky(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Ky(n,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,h,u;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(h=(u=n.props.coordinate)===null||u===void 0?void 0:u.y)!==null&&h!==void 0?h:0}})}}),n}return v7(t,e),p7(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>nS||Math.abs(r.height-this.state.lastBoundingBox.height)>nS)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,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 r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,h=i.children,u=i.coordinate,f=i.hasPayload,m=i.isAnimationActive,y=i.offset,x=i.position,p=i.reverseDirection,b=i.useTranslate3d,P=i.viewBox,S=i.wrapperStyle,A=h7({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:y,position:x,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:P}),E=A.cssClasses,w=A.cssProperties,T=eS(eS({transition:m&&o?"transform ".concat(l,"ms ").concat(c):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},S);return v.createElement("div",{tabIndex:-1,className:E,style:T,ref:function(I){r.wrapperNode=I}},h)}}])}(v.PureComponent),w7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ss={isSsr:w7()};function El(e){"@babel/helpers - typeof";return El=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},El(e)}function rS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function iS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rS(Object(n),!0).forEach(function(r){N0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S7(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iM(r.key),r)}}function P7(e,t,n){return t&&S7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function A7(e,t,n){return t=yd(t),T7(e,rM()?Reflect.construct(t,n||[],yd(e).constructor):t.apply(e,n))}function T7(e,t){if(t&&(El(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E7(e)}function E7(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rM=function(){return!!e})()}function yd(e){return yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},yd(e)}function C7(e,t){if(typeof t!="function"&&t!==null)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&&Xy(e,t)}function Xy(e,t){return Xy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Xy(e,t)}function N0(e,t,n){return t=iM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iM(e){var t=O7(e,"string");return El(t)=="symbol"?t:t+""}function O7(e,t){if(El(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(El(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function M7(e){return e.dataKey}function k7(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e=="function"?v.createElement(e,t):v.createElement(o7,t)}var wr=function(e){function t(){return _7(this,t),A7(this,t,arguments)}return C7(t,e),P7(t,[{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,h=i.content,u=i.coordinate,f=i.filterNull,m=i.isAnimationActive,y=i.offset,x=i.payload,p=i.payloadUniqBy,b=i.position,P=i.reverseDirection,S=i.useTranslate3d,A=i.viewBox,E=i.wrapperStyle,w=x??[];f&&w.length&&(w=GO(x.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),p,M7));var T=w.length>0;return v.createElement(x7,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:m,active:o,coordinate:u,hasPayload:T,offset:y,position:b,reverseDirection:P,useTranslate3d:S,viewBox:A,wrapperStyle:E},k7(h,iS(iS({},this.props),{},{payload:w})))}}])}(v.PureComponent);N0(wr,"displayName","Tooltip");N0(wr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ss.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 $7=Pi,I7=function(){return $7.Date.now()},R7=I7,L7=/\s/;function N7(e){for(var t=e.length;t--&&L7.test(e.charAt(t)););return t}var j7=N7,D7=j7,B7=/^\s+/;function z7(e){return e&&e.slice(0,D7(e)+1).replace(B7,"")}var F7=z7,W7=F7,oS=os,V7=oc,sS=NaN,U7=/^[-+]0x[0-9a-f]+$/i,H7=/^0b[01]+$/i,q7=/^0o[0-7]+$/i,G7=parseInt;function Z7(e){if(typeof e=="number")return e;if(V7(e))return sS;if(oS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=oS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=W7(e);var n=H7.test(e);return n||q7.test(e)?G7(e.slice(2),n?2:8):U7.test(e)?sS:+e}var oM=Z7,Y7=os,vg=R7,aS=oM,K7="Expected a function",X7=Math.max,J7=Math.min;function Q7(e,t,n){var r,i,o,s,l,c,h=0,u=!1,f=!1,m=!0;if(typeof e!="function")throw new TypeError(K7);t=aS(t)||0,Y7(n)&&(u=!!n.leading,f="maxWait"in n,o=f?X7(aS(n.maxWait)||0,t):o,m="trailing"in n?!!n.trailing:m);function y(T){var O=r,I=i;return r=i=void 0,h=T,s=e.apply(I,O),s}function x(T){return h=T,l=setTimeout(P,t),u?y(T):s}function p(T){var O=T-c,I=T-h,N=t-O;return f?J7(N,o-I):N}function b(T){var O=T-c,I=T-h;return c===void 0||O>=t||O<0||f&&I>=o}function P(){var T=vg();if(b(T))return S(T);l=setTimeout(P,p(T))}function S(T){return l=void 0,m&&r?y(T):(r=i=void 0,s)}function A(){l!==void 0&&clearTimeout(l),h=0,r=c=i=l=void 0}function E(){return l===void 0?s:S(vg())}function w(){var T=vg(),O=b(T);if(r=arguments,i=this,c=T,O){if(l===void 0)return x(c);if(f)return clearTimeout(l),l=setTimeout(P,t),y(c)}return l===void 0&&(l=setTimeout(P,t)),s}return w.cancel=A,w.flush=E,w}var tZ=Q7,eZ=tZ,nZ=os,rZ="Expected a function";function iZ(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(rZ);return nZ(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),eZ(e,t,{leading:r,maxWait:t,trailing:i})}var oZ=iZ;const sM=$e(oZ);function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}function lS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _f(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lS(Object(n),!0).forEach(function(r){sZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t,n){return t=aZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aZ(e){var t=lZ(e,"string");return Du(t)=="symbol"?t:t+""}function lZ(e,t){if(Du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cZ(e,t){return dZ(e)||fZ(e,t)||hZ(e,t)||uZ()}function uZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hZ(e,t){if(e){if(typeof e=="string")return cS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cS(e,t)}}function cS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function dZ(e){if(Array.isArray(e))return e}var qp=v.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,o=e.width,s=o===void 0?"100%":o,l=e.height,c=l===void 0?"100%":l,h=e.minWidth,u=h===void 0?0:h,f=e.minHeight,m=e.maxHeight,y=e.children,x=e.debounce,p=x===void 0?0:x,b=e.id,P=e.className,S=e.onResize,A=e.style,E=A===void 0?{}:A,w=v.useRef(null),T=v.useRef();T.current=S,v.useImperativeHandle(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var O=v.useState({containerWidth:i.width,containerHeight:i.height}),I=cZ(O,2),N=I[0],F=I[1],D=v.useCallback(function(K,U){F(function(z){var Y=Math.round(K),G=Math.round(U);return z.containerWidth===Y&&z.containerHeight===G?z:{containerWidth:Y,containerHeight:G}})},[]);v.useEffect(function(){var K=function(lt){var H,et=lt[0].contentRect,it=et.width,at=et.height;D(it,at),(H=T.current)===null||H===void 0||H.call(T,it,at)};p>0&&(K=sM(K,p,{trailing:!0,leading:!1}));var U=new ResizeObserver(K),z=w.current.getBoundingClientRect(),Y=z.width,G=z.height;return D(Y,G),U.observe(w.current),function(){U.disconnect()}},[D,p]);var j=v.useMemo(function(){var K=N.containerWidth,U=N.containerHeight;if(K<0||U<0)return null;ei(Ks(s)||Ks(c),`The width(%s) and height(%s) are both fixed numbers,
40
40
  maybe you don't need to use a ResponsiveContainer.`,s,c),ei(!n||n>0,"The aspect(%s) must be greater than zero.",n);var z=Ks(s)?K:s,Y=Ks(c)?U:c;n&&n>0&&(z?Y=z/n:Y&&(z=Y*n),m&&Y>m&&(Y=m)),ei(z>0||Y>0,`The width(%s) and height(%s) of chart should be greater than 0,
41
41
  please check the style of container, or the props width(%s) and height(%s),
42
42
  or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
43
43
  height and width.`,z,Y,s,c,u,f,n);var G=!Array.isArray(y)&&so(y.type).endsWith("Chart");return v.Children.map(y,function(X){return v.isValidElement(X)?v.cloneElement(X,_f({width:z,height:Y},G?{style:_f({height:"100%",width:"100%",maxHeight:Y,maxWidth:z},X.props.style)}:{})):X})},[n,y,c,m,f,u,N,s]);return v.createElement("div",{id:b?"".concat(b):void 0,className:te("recharts-responsive-container",P),style:_f(_f({},E),{},{width:s,height:c,minWidth:u,minHeight:f,maxHeight:m}),ref:w},j)}),Sh=function(t){return null};Sh.displayName="Cell";function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function uS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uS(Object(n),!0).forEach(function(r){pZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZ(e,t,n){return t=mZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mZ(e){var t=gZ(e,"string");return Bu(t)=="symbol"?t:t+""}function gZ(e,t){if(Bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qa={widthCache:{},cacheCount:0},yZ=2e3,vZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},hS="recharts_measurement_span";function bZ(e){var t=Jy({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var pu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ss.isSsr)return{width:0,height:0};var r=bZ(n),i=JSON.stringify({text:t,copyStyle:r});if(qa.widthCache[i])return qa.widthCache[i];try{var o=document.getElementById(hS);o||(o=document.createElement("span"),o.setAttribute("id",hS),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=Jy(Jy({},vZ),r);Object.assign(o.style,s),o.textContent="".concat(t);var l=o.getBoundingClientRect(),c={width:l.width,height:l.height};return qa.widthCache[i]=c,++qa.cacheCount>yZ&&(qa.cacheCount=0,qa.widthCache={}),c}catch{return{width:0,height:0}}},xZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function vd(e,t){return PZ(e)||SZ(e,t)||_Z(e,t)||wZ()}function wZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
44
44
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Z(e,t){if(e){if(typeof e=="string")return fS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fS(e,t)}}function fS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function PZ(e){if(Array.isArray(e))return e}function AZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,EZ(r.key),r)}}function TZ(e,t,n){return t&&dS(e.prototype,t),n&&dS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function EZ(e){var t=CZ(e,"string");return zu(t)=="symbol"?t:t+""}function CZ(e,t){if(zu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,mS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,OZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,MZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,aM={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},kZ=Object.keys(aM),il="NaN";function $Z(e,t){return e*aM[t]}var Sf=function(){function e(t,n){AZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!OZ.test(n)&&(this.num=NaN,this.unit=""),kZ.includes(n)&&(this.num=$Z(t,n),this.unit="px")}return TZ(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=MZ.exec(n))!==null&&r!==void 0?r:[],o=vd(i,3),s=o[1],l=o[2];return new e(parseFloat(s),l??"")}}])}();function lM(e){if(e.includes(il))return il;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=pS.exec(t))!==null&&n!==void 0?n:[],i=vd(r,4),o=i[1],s=i[2],l=i[3],c=Sf.parse(o??""),h=Sf.parse(l??""),u=s==="*"?c.multiply(h):c.divide(h);if(u.isNaN())return il;t=t.replace(pS,u.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,m=(f=mS.exec(t))!==null&&f!==void 0?f:[],y=vd(m,4),x=y[1],p=y[2],b=y[3],P=Sf.parse(x??""),S=Sf.parse(b??""),A=p==="+"?P.add(S):P.subtract(S);if(A.isNaN())return il;t=t.replace(mS,A.toString())}return t}var gS=/\(([^()]*)\)/;function IZ(e){for(var t=e;t.includes("(");){var n=gS.exec(t),r=vd(n,2),i=r[1];t=t.replace(gS,lM(i))}return t}function RZ(e){var t=e.replace(/\s+/g,"");return t=IZ(t),t=lM(t),t}function LZ(e){try{return RZ(e)}catch{return il}}function bg(e){var t=LZ(e.slice(5,-1));return t===il?"":t}var NZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],jZ=["dx","dy","angle","className","breakAll"];function Qy(){return Qy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qy.apply(this,arguments)}function yS(e,t){if(e==null)return{};var n=DZ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vS(e,t){return WZ(e)||FZ(e,t)||zZ(e,t)||BZ()}function BZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zZ(e,t){if(e){if(typeof e=="string")return bS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bS(e,t)}}function bS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function WZ(e){if(Array.isArray(e))return e}var cM=/[ \f\n\r\t\v\u2028\u2029]+/,uM=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];Zt(n)||(r?o=n.toString().split(""):o=n.toString().split(cM));var s=o.map(function(c){return{word:c,width:pu(c,i).width}}),l=r?0:pu(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},VZ=function(t,n,r,i,o){var s=t.maxLines,l=t.children,c=t.style,h=t.breakAll,u=wt(s),f=l,m=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(Y,G){var X=G.word,lt=G.width,H=Y[Y.length-1];if(H&&(i==null||o||H.width+lt+r<Number(i)))H.words.push(X),H.width+=lt+r;else{var et={words:[X],width:lt};Y.push(et)}return Y},[])},y=m(n),x=function(z){return z.reduce(function(Y,G){return Y.width>G.width?Y:G})};if(!u)return y;for(var p="…",b=function(z){var Y=f.slice(0,z),G=uM({breakAll:h,style:c,children:Y+p}).wordsWithComputedWidth,X=m(G),lt=X.length>s||x(X).width>Number(i);return[lt,X]},P=0,S=f.length-1,A=0,E;P<=S&&A<=f.length-1;){var w=Math.floor((P+S)/2),T=w-1,O=b(T),I=vS(O,2),N=I[0],F=I[1],D=b(w),j=vS(D,1),K=j[0];if(!N&&!K&&(P=w+1),N&&K&&(S=w-1),!N&&K){E=F;break}A++}return E||y},xS=function(t){var n=Zt(t)?[]:t.toString().split(cM);return[{words:n}]},UZ=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,l=t.maxLines;if((n||r)&&!ss.isSsr){var c,h,u=uM({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,m=u.spaceWidth;c=f,h=m}else return xS(i);return VZ({breakAll:s,children:i,maxLines:l,style:o},c,h,n,r)}return xS(i)},wS="#808080",da=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,h=c===void 0?"0.71em":c,u=t.scaleToFit,f=u===void 0?!1:u,m=t.textAnchor,y=m===void 0?"start":m,x=t.verticalAnchor,p=x===void 0?"end":x,b=t.fill,P=b===void 0?wS:b,S=yS(t,NZ),A=v.useMemo(function(){return UZ({breakAll:S.breakAll,children:S.children,maxLines:S.maxLines,scaleToFit:f,style:S.style,width:S.width})},[S.breakAll,S.children,S.maxLines,f,S.style,S.width]),E=S.dx,w=S.dy,T=S.angle,O=S.className,I=S.breakAll,N=yS(S,jZ);if(!wn(r)||!wn(o))return null;var F=r+(wt(E)?E:0),D=o+(wt(w)?w:0),j;switch(p){case"start":j=bg("calc(".concat(h,")"));break;case"middle":j=bg("calc(".concat((A.length-1)/2," * -").concat(l," + (").concat(h," / 2))"));break;default:j=bg("calc(".concat(A.length-1," * -").concat(l,")"));break}var K=[];if(f){var U=A[0].width,z=S.width;K.push("scale(".concat((wt(z)?z/U:1)/U,")"))}return T&&K.push("rotate(".concat(T,", ").concat(F,", ").concat(D,")")),K.length&&(N.transform=K.join(" ")),v.createElement("text",Qy({},Dt(N,!0),{x:F,y:D,className:te("recharts-text",O),textAnchor:y,fill:P.includes("url")?wS:P}),A.map(function(Y,G){var X=Y.words.join(I?"":" ");return v.createElement("tspan",{x:F,dy:G===0?j:l,key:"".concat(X,"-").concat(G)},X)}))};function Yo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function HZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function j0(e){let t,n,r;e.length!==2?(t=Yo,n=(l,c)=>Yo(e(l),c),r=(l,c)=>e(l)-c):(t=e===Yo||e===HZ?e:qZ,n=e,r=e);function i(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<0?h=f+1:u=f}while(h<u)}return h}function o(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<=0?h=f+1:u=f}while(h<u)}return h}function s(l,c,h=0,u=l.length){const f=i(l,c,h,u-1);return f>h&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:s,right:o}}function qZ(){return 0}function hM(e){return e===null?NaN:+e}function*GZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ZZ=j0(Yo),Ph=ZZ.right;j0(hM).center;class _S extends Map{constructor(t,n=XZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(SS(this,t))}has(t){return super.has(SS(this,t))}set(t,n){return super.set(YZ(this,t),n)}delete(t){return super.delete(KZ(this,t))}}function SS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function KZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function JZ(e=Yo){if(e===Yo)return fM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function fM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const QZ=Math.sqrt(50),tY=Math.sqrt(10),eY=Math.sqrt(2);function bd(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=QZ?10:o>=tY?5:o>=eY?2:1;let l,c,h;return i<0?(h=Math.pow(10,-i)/s,l=Math.round(e*h),c=Math.round(t*h),l/h<e&&++l,c/h>t&&--c,h=-h):(h=Math.pow(10,i)*s,l=Math.round(e/h),c=Math.round(t/h),l*h<e&&++l,c*h>t&&--c),c<l&&.5<=n&&n<2?bd(e,t,n*2):[l,c,h]}function tv(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?bd(t,e,n):bd(e,t,n);if(!(o>=i))return[];const l=o-i+1,c=new Array(l);if(r)if(s<0)for(let h=0;h<l;++h)c[h]=(o-h)/-s;else for(let h=0;h<l;++h)c[h]=(o-h)*s;else if(s<0)for(let h=0;h<l;++h)c[h]=(i+h)/-s;else for(let h=0;h<l;++h)c[h]=(i+h)*s;return c}function ev(e,t,n){return t=+t,e=+e,n=+n,bd(e,t,n)[2]}function nv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ev(t,e,n):ev(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function PS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function AS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function dM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?fM:JZ(i);r>n;){if(r-n>600){const c=r-n+1,h=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(c-f)/c)*(h-c/2<0?-1:1),y=Math.max(n,Math.floor(t-h*f/c+m)),x=Math.min(r,Math.floor(t+(c-h)*f/c+m));dM(e,t,y,x,i)}const o=e[t];let s=n,l=r;for(Hc(e,n,t),i(e[r],o)>0&&Hc(e,n,r);s<l;){for(Hc(e,s,l),++s,--l;i(e[s],o)<0;)++s;for(;i(e[l],o)>0;)--l}i(e[n],o)===0?Hc(e,n,l):(++l,Hc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Hc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function nY(e,t,n){if(e=Float64Array.from(GZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return AS(e);if(t>=1)return PS(e);var r,i=(r-1)*t,o=Math.floor(i),s=PS(dM(e,o).subarray(0,o+1)),l=AS(e.subarray(o+1));return s+(l-s)*(i-o)}}function rY(e,t,n=hM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),l=+n(e[o+1],o+1,e);return s+(l-s)*(i-o)}}function iY(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Wr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function vo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const rv=Symbol("implicit");function D0(){var e=new _S,t=[],n=[],r=rv;function i(o){let s=e.get(o);if(s===void 0){if(r!==rv)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new _S;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return D0(t,n).unknown(r)},Wr.apply(i,arguments),i}function Fu(){var e=D0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,l=!1,c=0,h=0,u=.5;delete e.unknown;function f(){var m=t().length,y=i<r,x=y?i:r,p=y?r:i;o=(p-x)/Math.max(1,m-c+h*2),l&&(o=Math.floor(o)),x+=(p-x-o*(m-c))*u,s=o*(1-c),l&&(x=Math.round(x),s=Math.round(s));var b=iY(m).map(function(P){return x+o*P});return n(y?b.reverse():b)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([r,i]=m,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(m){return[r,i]=m,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,h=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(h=+m,f()):h},e.align=function(m){return arguments.length?(u=Math.max(0,Math.min(1,m)),f()):u},e.copy=function(){return Fu(t(),[r,i]).round(l).paddingInner(c).paddingOuter(h).align(u)},Wr.apply(f(),arguments)}function pM(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return pM(t())},e}function mu(){return pM(Fu.apply(null,arguments).paddingInner(1))}function B0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ah(){}var Wu=.7,xd=1/Wu,dl="\\s*([+-]?\\d+)\\s*",Vu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oY=/^#([0-9a-f]{3,8})$/,sY=new RegExp(`^rgb\\(${dl},${dl},${dl}\\)$`),aY=new RegExp(`^rgb\\(${xi},${xi},${xi}\\)$`),lY=new RegExp(`^rgba\\(${dl},${dl},${dl},${Vu}\\)$`),cY=new RegExp(`^rgba\\(${xi},${xi},${xi},${Vu}\\)$`),uY=new RegExp(`^hsl\\(${Vu},${xi},${xi}\\)$`),hY=new RegExp(`^hsla\\(${Vu},${xi},${xi},${Vu}\\)$`),TS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};B0(Ah,Uu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ES,formatHex:ES,formatHex8:fY,formatHsl:dY,formatRgb:CS,toString:CS});function ES(){return this.rgb().formatHex()}function fY(){return this.rgb().formatHex8()}function dY(){return gM(this).formatHsl()}function CS(){return this.rgb().formatRgb()}function Uu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=oY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?OS(t):n===3?new rr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=sY.exec(e))?new rr(t[1],t[2],t[3],1):(t=aY.exec(e))?new rr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lY.exec(e))?Pf(t[1],t[2],t[3],t[4]):(t=cY.exec(e))?Pf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uY.exec(e))?$S(t[1],t[2]/100,t[3]/100,1):(t=hY.exec(e))?$S(t[1],t[2]/100,t[3]/100,t[4]):TS.hasOwnProperty(e)?OS(TS[e]):e==="transparent"?new rr(NaN,NaN,NaN,0):null}function OS(e){return new rr(e>>16&255,e>>8&255,e&255,1)}function Pf(e,t,n,r){return r<=0&&(e=t=n=NaN),new rr(e,t,n,r)}function pY(e){return e instanceof Ah||(e=Uu(e)),e?(e=e.rgb(),new rr(e.r,e.g,e.b,e.opacity)):new rr}function iv(e,t,n,r){return arguments.length===1?pY(e):new rr(e,t,n,r??1)}function rr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}B0(rr,iv,mM(Ah,{brighter(e){return e=e==null?xd:Math.pow(xd,e),new rr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wu:Math.pow(Wu,e),new rr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rr(ia(this.r),ia(this.g),ia(this.b),wd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:MS,formatHex:MS,formatHex8:mY,formatRgb:kS,toString:kS}));function MS(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}`}function mY(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}${Xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function kS(){const e=wd(this.opacity);return`${e===1?"rgb(":"rgba("}${ia(this.r)}, ${ia(this.g)}, ${ia(this.b)}${e===1?")":`, ${e})`}`}function wd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ia(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xs(e){return e=ia(e),(e<16?"0":"")+e.toString(16)}function $S(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qr(e,t,n,r)}function gM(e){if(e instanceof Qr)return new Qr(e.h,e.s,e.l,e.opacity);if(e instanceof Ah||(e=Uu(e)),!e)return new Qr;if(e instanceof Qr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,c=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new Qr(s,l,c,e.opacity)}function gY(e,t,n,r){return arguments.length===1?gM(e):new Qr(e,t,n,r??1)}function Qr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}B0(Qr,gY,mM(Ah,{brighter(e){return e=e==null?xd:Math.pow(xd,e),new Qr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wu:Math.pow(Wu,e),new Qr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new rr(xg(e>=240?e-240:e+120,i,r),xg(e,i,r),xg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qr(IS(this.h),Af(this.s),Af(this.l),wd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wd(this.opacity);return`${e===1?"hsl(":"hsla("}${IS(this.h)}, ${Af(this.s)*100}%, ${Af(this.l)*100}%${e===1?")":`, ${e})`}`}}));function IS(e){return e=(e||0)%360,e<0?e+360:e}function Af(e){return Math.max(0,Math.min(1,e||0))}function xg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const z0=e=>()=>e;function yY(e,t){return function(n){return e+n*t}}function vY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function bY(e){return(e=+e)==1?yM:function(t,n){return n-t?vY(t,n,e):z0(isNaN(t)?n:t)}}function yM(e,t){var n=t-e;return n?yY(e,n):z0(isNaN(e)?t:e)}const RS=function e(t){var n=bY(t);function r(i,o){var s=n((i=iv(i)).r,(o=iv(o)).r),l=n(i.g,o.g),c=n(i.b,o.b),h=yM(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=l(u),i.b=c(u),i.opacity=h(u),i+""}}return r.gamma=e,r}(1);function xY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function wY(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _Y(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=pc(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(l){for(s=0;s<r;++s)o[s]=i[s](l);return o}}function SY(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _d(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function PY(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=pc(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var ov=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wg=new RegExp(ov.source,"g");function AY(e){return function(){return e}}function TY(e){return function(t){return e(t)+""}}function EY(e,t){var n=ov.lastIndex=wg.lastIndex=0,r,i,o,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=ov.exec(e))&&(i=wg.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:_d(r,i)})),n=wg.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?c[0]?TY(c[0].x):AY(t):(t=c.length,function(h){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(h);return l.join("")})}function pc(e,t){var n=typeof t,r;return t==null||n==="boolean"?z0(t):(n==="number"?_d:n==="string"?(r=Uu(t))?(t=r,RS):EY:t instanceof Uu?RS:t instanceof Date?SY:wY(t)?xY:Array.isArray(t)?_Y:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?PY:_d)(e,t)}function F0(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function CY(e,t){t===void 0&&(t=e,e=pc);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[l](s-l)}}function OY(e){return function(){return e}}function Sd(e){return+e}var LS=[0,1];function Zn(e){return e}function sv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:OY(isNaN(t)?NaN:.5)}function MY(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function kY(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=sv(i,r),o=n(s,o)):(r=sv(r,i),o=n(o,s)),function(l){return o(r(l))}}function $Y(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=sv(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(l){var c=Ph(e,l,1,r)-1;return o[c](i[c](l))}}function Th(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Gp(){var e=LS,t=LS,n=pc,r,i,o,s=Zn,l,c,h;function u(){var m=Math.min(e.length,t.length);return s!==Zn&&(s=MY(e[0],e[m-1])),l=m>2?$Y:kY,c=h=null,f}function f(m){return m==null||isNaN(m=+m)?o:(c||(c=l(e.map(r),t,n)))(r(s(m)))}return f.invert=function(m){return s(i((h||(h=l(t,e.map(r),_d)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,Sd),u()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),u()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),n=F0,u()},f.clamp=function(m){return arguments.length?(s=m?!0:Zn,u()):s!==Zn},f.interpolate=function(m){return arguments.length?(n=m,u()):n},f.unknown=function(m){return arguments.length?(o=m,f):o},function(m,y){return r=m,i=y,u()}}function W0(){return Gp()(Zn,Zn)}function IY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Pd(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Cl(e){return e=Pd(Math.abs(e)),e?e[1]:NaN}function RY(e,t){return function(n,r){for(var i=n.length,o=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),o.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return o.reverse().join(t)}}function LY(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hu(e){if(!(t=NY.exec(e)))throw new Error("invalid format: "+e);var t;return new V0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Hu.prototype=V0.prototype;function V0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}V0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function jY(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Ad;function DY(e,t){var n=Pd(e,t);if(!n)return Ad=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(Ad=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Pd(e,Math.max(0,t+o-1))[0]}function NS(e,t){var n=Pd(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const jS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:IY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>NS(e*100,t),r:NS,s:DY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function DS(e){return e}var BS=Array.prototype.map,zS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function BY(e){var t=e.grouping===void 0||e.thousands===void 0?DS:RY(BS.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?DS:LY(BS.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function h(f,m){f=Hu(f);var y=f.fill,x=f.align,p=f.sign,b=f.symbol,P=f.zero,S=f.width,A=f.comma,E=f.precision,w=f.trim,T=f.type;T==="n"?(A=!0,T="g"):jS[T]||(E===void 0&&(E=12),w=!0,T="g"),(P||y==="0"&&x==="=")&&(P=!0,y="0",x="=");var O=(m&&m.prefix!==void 0?m.prefix:"")+(b==="$"?n:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),I=(b==="$"?r:/[%p]/.test(T)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),N=jS[T],F=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(j){var K=O,U=I,z,Y,G;if(T==="c")U=N(j)+U,j="";else{j=+j;var X=j<0||1/j<0;if(j=isNaN(j)?c:N(Math.abs(j),E),w&&(j=jY(j)),X&&+j==0&&p!=="+"&&(X=!1),K=(X?p==="("?p:l:p==="-"||p==="("?"":p)+K,U=(T==="s"&&!isNaN(j)&&Ad!==void 0?zS[8+Ad/3]:"")+U+(X&&p==="("?")":""),F){for(z=-1,Y=j.length;++z<Y;)if(G=j.charCodeAt(z),48>G||G>57){U=(G===46?i+j.slice(z+1):j.slice(z))+U,j=j.slice(0,z);break}}}A&&!P&&(j=t(j,1/0));var lt=K.length+j.length+U.length,H=lt<S?new Array(S-lt+1).join(y):"";switch(A&&P&&(j=t(H+j,H.length?S-U.length:1/0),H=""),x){case"<":j=K+j+U+H;break;case"=":j=K+H+j+U;break;case"^":j=H.slice(0,lt=H.length>>1)+K+j+U+H.slice(lt);break;default:j=H+K+j+U;break}return o(j)}return D.toString=function(){return f+""},D}function u(f,m){var y=Math.max(-8,Math.min(8,Math.floor(Cl(m)/3)))*3,x=Math.pow(10,-y),p=h((f=Hu(f),f.type="f",f),{suffix:zS[8+y/3]});return function(b){return p(x*b)}}return{format:h,formatPrefix:u}}var Tf,U0,vM;zY({thousands:",",grouping:[3],currency:["$",""]});function zY(e){return Tf=BY(e),U0=Tf.format,vM=Tf.formatPrefix,Tf}function FY(e){return Math.max(0,-Cl(Math.abs(e)))}function WY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Cl(t)/3)))*3-Cl(Math.abs(e)))}function VY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Cl(t)-Cl(e))+1}function bM(e,t,n,r){var i=nv(e,t,n),o;switch(r=Hu(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=WY(i,s))&&(r.precision=o),vM(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=VY(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=FY(i))&&(r.precision=o-(r.type==="%")*2);break}}return U0(r)}function as(e){var t=e.domain;return e.ticks=function(n){var r=t();return tv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return bM(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],l=r[o],c,h,u=10;for(l<s&&(h=s,s=l,l=h,h=i,i=o,o=h);u-- >0;){if(h=ev(s,l,n),h===c)return r[i]=s,r[o]=l,t(r);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;c=h}return e},e}function Td(){var e=W0();return e.copy=function(){return Th(e,Td())},Wr.apply(e,arguments),as(e)}function xM(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Sd),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return xM(e).unknown(t)},e=arguments.length?Array.from(e,Sd):[0,1],as(n)}function wM(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function FS(e){return Math.log(e)}function WS(e){return Math.exp(e)}function UY(e){return-Math.log(-e)}function HY(e){return-Math.exp(-e)}function qY(e){return isFinite(e)?+("1e"+e):e<0?0:e}function GY(e){return e===10?qY:e===Math.E?Math.exp:t=>Math.pow(e,t)}function ZY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function VS(e){return(t,n)=>-e(-t,n)}function H0(e){const t=e(FS,WS),n=t.domain;let r=10,i,o;function s(){return i=ZY(r),o=GY(r),n()[0]<0?(i=VS(i),o=VS(o),e(UY,HY)):e(FS,WS),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let h=c[0],u=c[c.length-1];const f=u<h;f&&([h,u]=[u,h]);let m=i(h),y=i(u),x,p;const b=l==null?10:+l;let P=[];if(!(r%1)&&y-m<b){if(m=Math.floor(m),y=Math.ceil(y),h>0){for(;m<=y;++m)for(x=1;x<r;++x)if(p=m<0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}}else for(;m<=y;++m)for(x=r-1;x>=1;--x)if(p=m>0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}P.length*2<b&&(P=tv(h,u,b))}else P=tv(m,y,Math.min(y-m,b)).map(o);return f?P.reverse():P},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Hu(c)).precision==null&&(c.trim=!0),c=U0(c)),l===1/0)return c;const h=Math.max(1,r*l/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=h?c(u):""}},t.nice=()=>n(wM(n(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function _M(){const e=H0(Gp()).domain([1,10]);return e.copy=()=>Th(e,_M()).base(e.base()),Wr.apply(e,arguments),e}function US(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function HS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function q0(e){var t=1,n=e(US(t),HS(t));return n.constant=function(r){return arguments.length?e(US(t=+r),HS(t)):t},as(n)}function SM(){var e=q0(Gp());return e.copy=function(){return Th(e,SM()).constant(e.constant())},Wr.apply(e,arguments)}function qS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function YY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function KY(e){return e<0?-e*e:e*e}function G0(e){var t=e(Zn,Zn),n=1;function r(){return n===1?e(Zn,Zn):n===.5?e(YY,KY):e(qS(n),qS(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},as(t)}function Z0(){var e=G0(Gp());return e.copy=function(){return Th(e,Z0()).exponent(e.exponent())},Wr.apply(e,arguments),e}function XY(){return Z0.apply(null,arguments).exponent(.5)}function GS(e){return Math.sign(e)*e*e}function JY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function PM(){var e=W0(),t=[0,1],n=!1,r;function i(o){var s=JY(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(GS(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Sd)).map(GS)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return PM(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Wr.apply(i,arguments),as(i)}function AM(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=rY(e,s/l);return o}function o(s){return s==null||isNaN(s=+s)?r:t[Ph(n,s)]}return o.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Yo),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return AM().domain(e).range(t).unknown(r)},Wr.apply(o,arguments)}function TM(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function s(c){return c!=null&&c<=c?i[Ph(r,c,0,n)]:o}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var h=i.indexOf(c);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},s.unknown=function(c){return arguments.length&&(o=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return TM().domain([e,t]).range(i).unknown(o)},Wr.apply(as(s),arguments)}function EM(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Ph(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return EM().domain(e).range(t).unknown(n)},Wr.apply(i,arguments)}const _g=new Date,Sg=new Date;function _n(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),l=i.ceil(o);return o-s<l-o?s:l},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,l)=>{const c=[];if(o=i.ceil(o),l=l==null?1:Math.floor(l),!(o<s)||!(l>0))return c;let h;do c.push(h=new Date(+o)),t(o,l),e(o);while(h<o&&o<s);return c},i.filter=o=>_n(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!o(s););else for(;--l>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(_g.setTime(+o),Sg.setTime(+s),e(_g),e(Sg),Math.floor(n(_g,Sg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Ed=_n(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ed.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_n(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ed);Ed.range;const no=1e3,zr=no*60,ro=zr*60,ho=ro*24,Y0=ho*7,ZS=ho*30,Pg=ho*365,Js=_n(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*no)},(e,t)=>(t-e)/no,e=>e.getUTCSeconds());Js.range;const K0=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no)},(e,t)=>{e.setTime(+e+t*zr)},(e,t)=>(t-e)/zr,e=>e.getMinutes());K0.range;const X0=_n(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*zr)},(e,t)=>(t-e)/zr,e=>e.getUTCMinutes());X0.range;const J0=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no-e.getMinutes()*zr)},(e,t)=>{e.setTime(+e+t*ro)},(e,t)=>(t-e)/ro,e=>e.getHours());J0.range;const Q0=_n(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ro)},(e,t)=>(t-e)/ro,e=>e.getUTCHours());Q0.range;const Eh=_n(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*zr)/ho,e=>e.getDate()-1);Eh.range;const Zp=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ho,e=>e.getUTCDate()-1);Zp.range;const CM=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ho,e=>Math.floor(e/ho));CM.range;function _a(e){return _n(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*zr)/Y0)}const Yp=_a(0),Cd=_a(1),QY=_a(2),tK=_a(3),Ol=_a(4),eK=_a(5),nK=_a(6);Yp.range;Cd.range;QY.range;tK.range;Ol.range;eK.range;nK.range;function Sa(e){return _n(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Y0)}const Kp=Sa(0),Od=Sa(1),rK=Sa(2),iK=Sa(3),Ml=Sa(4),oK=Sa(5),sK=Sa(6);Kp.range;Od.range;rK.range;iK.range;Ml.range;oK.range;sK.range;const tx=_n(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());tx.range;const ex=_n(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ex.range;const fo=_n(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());fo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});fo.range;const po=_n(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());po.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});po.range;function OM(e,t,n,r,i,o){const s=[[Js,1,no],[Js,5,5*no],[Js,15,15*no],[Js,30,30*no],[o,1,zr],[o,5,5*zr],[o,15,15*zr],[o,30,30*zr],[i,1,ro],[i,3,3*ro],[i,6,6*ro],[i,12,12*ro],[r,1,ho],[r,2,2*ho],[n,1,Y0],[t,1,ZS],[t,3,3*ZS],[e,1,Pg]];function l(h,u,f){const m=u<h;m&&([h,u]=[u,h]);const y=f&&typeof f.range=="function"?f:c(h,u,f),x=y?y.range(h,+u+1):[];return m?x.reverse():x}function c(h,u,f){const m=Math.abs(u-h)/f,y=j0(([,,b])=>b).right(s,m);if(y===s.length)return e.every(nv(h/Pg,u/Pg,f));if(y===0)return Ed.every(Math.max(nv(h,u,f),1));const[x,p]=s[m/s[y-1][2]<s[y][2]/m?y-1:y];return x.every(p)}return[l,c]}const[aK,lK]=OM(po,ex,Kp,CM,Q0,X0),[cK,uK]=OM(fo,tx,Yp,Eh,J0,K0);function Ag(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Tg(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function qc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function hK(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,h=Gc(i),u=Zc(i),f=Gc(o),m=Zc(o),y=Gc(s),x=Zc(s),p=Gc(l),b=Zc(l),P=Gc(c),S=Zc(c),A={a:G,A:X,b:lt,B:H,c:null,d:tP,e:tP,f:RK,g:UK,G:qK,H:kK,I:$K,j:IK,L:MM,m:LK,M:NK,p:et,q:it,Q:rP,s:iP,S:jK,u:DK,U:BK,V:zK,w:FK,W:WK,x:null,X:null,y:VK,Y:HK,Z:GK,"%":nP},E={a:st,A:ct,b:yt,B:vt,c:null,d:eP,e:eP,f:XK,g:aX,G:cX,H:ZK,I:YK,j:KK,L:$M,m:JK,M:QK,p:Et,q:Tt,Q:rP,s:iP,S:tX,u:eX,U:nX,V:rX,w:iX,W:oX,x:null,X:null,y:sX,Y:lX,Z:uX,"%":nP},w={a:F,A:D,b:j,B:K,c:U,d:JS,e:JS,f:EK,g:XS,G:KS,H:QS,I:QS,j:SK,L:TK,m:_K,M:PK,p:N,q:wK,Q:OK,s:MK,S:AK,u:gK,U:yK,V:vK,w:mK,W:bK,x:z,X:Y,y:XS,Y:KS,Z:xK,"%":CK};A.x=T(n,A),A.X=T(r,A),A.c=T(t,A),E.x=T(n,E),E.X=T(r,E),E.c=T(t,E);function T(ft,dt){return function(Ct){var nt=[],Lt=-1,bt=0,me=ft.length,ie,Xt,Ne;for(Ct instanceof Date||(Ct=new Date(+Ct));++Lt<me;)ft.charCodeAt(Lt)===37&&(nt.push(ft.slice(bt,Lt)),(Xt=YS[ie=ft.charAt(++Lt)])!=null?ie=ft.charAt(++Lt):Xt=ie==="e"?" ":"0",(Ne=dt[ie])&&(ie=Ne(Ct,Xt)),nt.push(ie),bt=Lt+1);return nt.push(ft.slice(bt,Lt)),nt.join("")}}function O(ft,dt){return function(Ct){var nt=qc(1900,void 0,1),Lt=I(nt,ft,Ct+="",0),bt,me;if(Lt!=Ct.length)return null;if("Q"in nt)return new Date(nt.Q);if("s"in nt)return new Date(nt.s*1e3+("L"in nt?nt.L:0));if(dt&&!("Z"in nt)&&(nt.Z=0),"p"in nt&&(nt.H=nt.H%12+nt.p*12),nt.m===void 0&&(nt.m="q"in nt?nt.q:0),"V"in nt){if(nt.V<1||nt.V>53)return null;"w"in nt||(nt.w=1),"Z"in nt?(bt=Tg(qc(nt.y,0,1)),me=bt.getUTCDay(),bt=me>4||me===0?Od.ceil(bt):Od(bt),bt=Zp.offset(bt,(nt.V-1)*7),nt.y=bt.getUTCFullYear(),nt.m=bt.getUTCMonth(),nt.d=bt.getUTCDate()+(nt.w+6)%7):(bt=Ag(qc(nt.y,0,1)),me=bt.getDay(),bt=me>4||me===0?Cd.ceil(bt):Cd(bt),bt=Eh.offset(bt,(nt.V-1)*7),nt.y=bt.getFullYear(),nt.m=bt.getMonth(),nt.d=bt.getDate()+(nt.w+6)%7)}else("W"in nt||"U"in nt)&&("w"in nt||(nt.w="u"in nt?nt.u%7:"W"in nt?1:0),me="Z"in nt?Tg(qc(nt.y,0,1)).getUTCDay():Ag(qc(nt.y,0,1)).getDay(),nt.m=0,nt.d="W"in nt?(nt.w+6)%7+nt.W*7-(me+5)%7:nt.w+nt.U*7-(me+6)%7);return"Z"in nt?(nt.H+=nt.Z/100|0,nt.M+=nt.Z%100,Tg(nt)):Ag(nt)}}function I(ft,dt,Ct,nt){for(var Lt=0,bt=dt.length,me=Ct.length,ie,Xt;Lt<bt;){if(nt>=me)return-1;if(ie=dt.charCodeAt(Lt++),ie===37){if(ie=dt.charAt(Lt++),Xt=w[ie in YS?dt.charAt(Lt++):ie],!Xt||(nt=Xt(ft,Ct,nt))<0)return-1}else if(ie!=Ct.charCodeAt(nt++))return-1}return nt}function N(ft,dt,Ct){var nt=h.exec(dt.slice(Ct));return nt?(ft.p=u.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function F(ft,dt,Ct){var nt=y.exec(dt.slice(Ct));return nt?(ft.w=x.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function D(ft,dt,Ct){var nt=f.exec(dt.slice(Ct));return nt?(ft.w=m.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function j(ft,dt,Ct){var nt=P.exec(dt.slice(Ct));return nt?(ft.m=S.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function K(ft,dt,Ct){var nt=p.exec(dt.slice(Ct));return nt?(ft.m=b.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function U(ft,dt,Ct){return I(ft,t,dt,Ct)}function z(ft,dt,Ct){return I(ft,n,dt,Ct)}function Y(ft,dt,Ct){return I(ft,r,dt,Ct)}function G(ft){return s[ft.getDay()]}function X(ft){return o[ft.getDay()]}function lt(ft){return c[ft.getMonth()]}function H(ft){return l[ft.getMonth()]}function et(ft){return i[+(ft.getHours()>=12)]}function it(ft){return 1+~~(ft.getMonth()/3)}function st(ft){return s[ft.getUTCDay()]}function ct(ft){return o[ft.getUTCDay()]}function yt(ft){return c[ft.getUTCMonth()]}function vt(ft){return l[ft.getUTCMonth()]}function Et(ft){return i[+(ft.getUTCHours()>=12)]}function Tt(ft){return 1+~~(ft.getUTCMonth()/3)}return{format:function(ft){var dt=T(ft+="",A);return dt.toString=function(){return ft},dt},parse:function(ft){var dt=O(ft+="",!1);return dt.toString=function(){return ft},dt},utcFormat:function(ft){var dt=T(ft+="",E);return dt.toString=function(){return ft},dt},utcParse:function(ft){var dt=O(ft+="",!0);return dt.toString=function(){return ft},dt}}}var YS={"-":"",_:" ",0:"0"},En=/^\s*\d+/,fK=/^%/,dK=/[\\^$*+?|[\]().{}]/g;function ve(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function pK(e){return e.replace(dK,"\\$&")}function Gc(e){return new RegExp("^(?:"+e.map(pK).join("|")+")","i")}function Zc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function mK(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function gK(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function vK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function bK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function KS(e,t,n){var r=En.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function XS(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function wK(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function _K(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JS(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function SK(e,t,n){var r=En.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function QS(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function PK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function AK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function TK(e,t,n){var r=En.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function EK(e,t,n){var r=En.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function CK(e,t,n){var r=fK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function OK(e,t,n){var r=En.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function MK(e,t,n){var r=En.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tP(e,t){return ve(e.getDate(),t,2)}function kK(e,t){return ve(e.getHours(),t,2)}function $K(e,t){return ve(e.getHours()%12||12,t,2)}function IK(e,t){return ve(1+Eh.count(fo(e),e),t,3)}function MM(e,t){return ve(e.getMilliseconds(),t,3)}function RK(e,t){return MM(e,t)+"000"}function LK(e,t){return ve(e.getMonth()+1,t,2)}function NK(e,t){return ve(e.getMinutes(),t,2)}function jK(e,t){return ve(e.getSeconds(),t,2)}function DK(e){var t=e.getDay();return t===0?7:t}function BK(e,t){return ve(Yp.count(fo(e)-1,e),t,2)}function kM(e){var t=e.getDay();return t>=4||t===0?Ol(e):Ol.ceil(e)}function zK(e,t){return e=kM(e),ve(Ol.count(fo(e),e)+(fo(e).getDay()===4),t,2)}function FK(e){return e.getDay()}function WK(e,t){return ve(Cd.count(fo(e)-1,e),t,2)}function VK(e,t){return ve(e.getFullYear()%100,t,2)}function UK(e,t){return e=kM(e),ve(e.getFullYear()%100,t,2)}function HK(e,t){return ve(e.getFullYear()%1e4,t,4)}function qK(e,t){var n=e.getDay();return e=n>=4||n===0?Ol(e):Ol.ceil(e),ve(e.getFullYear()%1e4,t,4)}function GK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ve(t/60|0,"0",2)+ve(t%60,"0",2)}function eP(e,t){return ve(e.getUTCDate(),t,2)}function ZK(e,t){return ve(e.getUTCHours(),t,2)}function YK(e,t){return ve(e.getUTCHours()%12||12,t,2)}function KK(e,t){return ve(1+Zp.count(po(e),e),t,3)}function $M(e,t){return ve(e.getUTCMilliseconds(),t,3)}function XK(e,t){return $M(e,t)+"000"}function JK(e,t){return ve(e.getUTCMonth()+1,t,2)}function QK(e,t){return ve(e.getUTCMinutes(),t,2)}function tX(e,t){return ve(e.getUTCSeconds(),t,2)}function eX(e){var t=e.getUTCDay();return t===0?7:t}function nX(e,t){return ve(Kp.count(po(e)-1,e),t,2)}function IM(e){var t=e.getUTCDay();return t>=4||t===0?Ml(e):Ml.ceil(e)}function rX(e,t){return e=IM(e),ve(Ml.count(po(e),e)+(po(e).getUTCDay()===4),t,2)}function iX(e){return e.getUTCDay()}function oX(e,t){return ve(Od.count(po(e)-1,e),t,2)}function sX(e,t){return ve(e.getUTCFullYear()%100,t,2)}function aX(e,t){return e=IM(e),ve(e.getUTCFullYear()%100,t,2)}function lX(e,t){return ve(e.getUTCFullYear()%1e4,t,4)}function cX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ml(e):Ml.ceil(e),ve(e.getUTCFullYear()%1e4,t,4)}function uX(){return"+0000"}function nP(){return"%"}function rP(e){return+e}function iP(e){return Math.floor(+e/1e3)}var Ga,RM,LM;hX({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function hX(e){return Ga=hK(e),RM=Ga.format,Ga.parse,LM=Ga.utcFormat,Ga.utcParse,Ga}function fX(e){return new Date(e)}function dX(e){return e instanceof Date?+e:+new Date(+e)}function nx(e,t,n,r,i,o,s,l,c,h){var u=W0(),f=u.invert,m=u.domain,y=h(".%L"),x=h(":%S"),p=h("%I:%M"),b=h("%I %p"),P=h("%a %d"),S=h("%b %d"),A=h("%B"),E=h("%Y");function w(T){return(c(T)<T?y:l(T)<T?x:s(T)<T?p:o(T)<T?b:r(T)<T?i(T)<T?P:S:n(T)<T?A:E)(T)}return u.invert=function(T){return new Date(f(T))},u.domain=function(T){return arguments.length?m(Array.from(T,dX)):m().map(fX)},u.ticks=function(T){var O=m();return e(O[0],O[O.length-1],T??10)},u.tickFormat=function(T,O){return O==null?w:h(O)},u.nice=function(T){var O=m();return(!T||typeof T.range!="function")&&(T=t(O[0],O[O.length-1],T??10)),T?m(wM(O,T)):u},u.copy=function(){return Th(u,nx(e,t,n,r,i,o,s,l,c,h))},u}function pX(){return Wr.apply(nx(cK,uK,fo,tx,Yp,Eh,J0,K0,Js,RM).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function mX(){return Wr.apply(nx(aK,lK,po,ex,Kp,Zp,Q0,X0,Js,LM).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Xp(){var e=0,t=1,n,r,i,o,s=Zn,l=!1,c;function h(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(o(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}h.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(f){return arguments.length?(l=!!f,h):l},h.interpolator=function(f){return arguments.length?(s=f,h):s};function u(f){return function(m){var y,x;return arguments.length?([y,x]=m,s=f(y,x),h):[s(0),s(1)]}}return h.range=u(pc),h.rangeRound=u(F0),h.unknown=function(f){return arguments.length?(c=f,h):c},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),h}}function ls(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function NM(){var e=as(Xp()(Zn));return e.copy=function(){return ls(e,NM())},vo.apply(e,arguments)}function jM(){var e=H0(Xp()).domain([1,10]);return e.copy=function(){return ls(e,jM()).base(e.base())},vo.apply(e,arguments)}function DM(){var e=q0(Xp());return e.copy=function(){return ls(e,DM()).constant(e.constant())},vo.apply(e,arguments)}function rx(){var e=G0(Xp());return e.copy=function(){return ls(e,rx()).exponent(e.exponent())},vo.apply(e,arguments)}function gX(){return rx.apply(null,arguments).exponent(.5)}function BM(){var e=[],t=Zn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ph(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Yo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>nY(e,o/r))},n.copy=function(){return BM(t).domain(e)},vo.apply(n,arguments)}function Jp(){var e=0,t=.5,n=1,r=1,i,o,s,l,c,h=Zn,u,f=!1,m;function y(p){return isNaN(p=+p)?m:(p=.5+((p=+u(p))-o)*(r*p<r*o?l:c),h(f?Math.max(0,Math.min(1,p)):p))}y.domain=function(p){return arguments.length?([e,t,n]=p,i=u(e=+e),o=u(t=+t),s=u(n=+n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y):[e,t,n]},y.clamp=function(p){return arguments.length?(f=!!p,y):f},y.interpolator=function(p){return arguments.length?(h=p,y):h};function x(p){return function(b){var P,S,A;return arguments.length?([P,S,A]=b,h=CY(p,[P,S,A]),y):[h(0),h(.5),h(1)]}}return y.range=x(pc),y.rangeRound=x(F0),y.unknown=function(p){return arguments.length?(m=p,y):m},function(p){return u=p,i=p(e),o=p(t),s=p(n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y}}function zM(){var e=as(Jp()(Zn));return e.copy=function(){return ls(e,zM())},vo.apply(e,arguments)}function FM(){var e=H0(Jp()).domain([.1,1,10]);return e.copy=function(){return ls(e,FM()).base(e.base())},vo.apply(e,arguments)}function WM(){var e=q0(Jp());return e.copy=function(){return ls(e,WM()).constant(e.constant())},vo.apply(e,arguments)}function ix(){var e=G0(Jp());return e.copy=function(){return ls(e,ix()).exponent(e.exponent())},vo.apply(e,arguments)}function yX(){return ix.apply(null,arguments).exponent(.5)}const oP=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Fu,scaleDiverging:zM,scaleDivergingLog:FM,scaleDivergingPow:ix,scaleDivergingSqrt:yX,scaleDivergingSymlog:WM,scaleIdentity:xM,scaleImplicit:rv,scaleLinear:Td,scaleLog:_M,scaleOrdinal:D0,scalePoint:mu,scalePow:Z0,scaleQuantile:AM,scaleQuantize:TM,scaleRadial:PM,scaleSequential:NM,scaleSequentialLog:jM,scaleSequentialPow:rx,scaleSequentialQuantile:BM,scaleSequentialSqrt:gX,scaleSequentialSymlog:DM,scaleSqrt:XY,scaleSymlog:SM,scaleThreshold:EM,scaleTime:pX,scaleUtc:mX,tickFormat:bM},Symbol.toStringTag,{value:"Module"}));var vX=oc;function bX(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(l===void 0?s===s&&!vX(s):n(s,l)))var l=s,c=o}return c}var Qp=bX;function xX(e,t){return e>t}var VM=xX,wX=Qp,_X=VM,SX=dc;function PX(e){return e&&e.length?wX(e,SX,_X):void 0}var AX=PX;const Ho=$e(AX);function TX(e,t){return e<t}var UM=TX,EX=Qp,CX=UM,OX=dc;function MX(e){return e&&e.length?EX(e,OX,CX):void 0}var kX=MX;const tm=$e(kX);var $X=w0,IX=Ai,RX=QO,LX=cr;function NX(e,t){var n=LX(e)?$X:RX;return n(e,IX(t))}var jX=NX,DX=XO,BX=jX;function zX(e,t){return DX(BX(e,t),1)}var FX=zX;const WX=$e(FX);var VX=I0;function UX(e,t){return VX(e,t)}var HX=UX;const pa=$e(HX);var mc=1e9,qX={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},sx,Ye=!0,Fr="[DecimalError] ",oa=Fr+"Invalid argument: ",ox=Fr+"Exponent out of range: ",gc=Math.floor,qs=Math.pow,GX=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_r,Pn=1e7,Ue=7,HM=9007199254740991,Md=gc(HM/Ue),$t={};$t.absoluteValue=$t.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};$t.comparedTo=$t.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};$t.decimalPlaces=$t.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ue;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};$t.dividedBy=$t.div=function(e){return ao(this,new this.constructor(e))};$t.dividedToIntegerBy=$t.idiv=function(e){var t=this,n=t.constructor;return Le(ao(t,new n(e),0,1),n.precision)};$t.equals=$t.eq=function(e){return!this.cmp(e)};$t.exponent=function(){return mn(this)};$t.greaterThan=$t.gt=function(e){return this.cmp(e)>0};$t.greaterThanOrEqualTo=$t.gte=function(e){return this.cmp(e)>=0};$t.isInteger=$t.isint=function(){return this.e>this.d.length-2};$t.isNegative=$t.isneg=function(){return this.s<0};$t.isPositive=$t.ispos=function(){return this.s>0};$t.isZero=function(){return this.s===0};$t.lessThan=$t.lt=function(e){return this.cmp(e)<0};$t.lessThanOrEqualTo=$t.lte=function(e){return this.cmp(e)<1};$t.logarithm=$t.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(_r))throw Error(Fr+"NaN");if(n.s<1)throw Error(Fr+(n.s?"NaN":"-Infinity"));return n.eq(_r)?new r(0):(Ye=!1,t=ao(qu(n,o),qu(e,o),o),Ye=!0,Le(t,i))};$t.minus=$t.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ZM(t,e):qM(t,(e.s=-e.s,e))};$t.modulo=$t.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Fr+"NaN");return n.s?(Ye=!1,t=ao(n,e,0,1).times(e),Ye=!0,n.minus(t)):Le(new r(n),i)};$t.naturalExponential=$t.exp=function(){return GM(this)};$t.naturalLogarithm=$t.ln=function(){return qu(this)};$t.negated=$t.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};$t.plus=$t.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qM(t,e):ZM(t,(e.s=-e.s,e))};$t.precision=$t.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(oa+e);if(t=mn(i)+1,r=i.d.length-1,n=r*Ue+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};$t.squareRoot=$t.sqrt=function(){var e,t,n,r,i,o,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Fr+"NaN")}for(e=mn(l),Ye=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=mi(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=gc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(o=r,r=o.plus(ao(l,o,s+2)).times(.5),mi(o.d).slice(0,s)===(t=mi(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Le(o,n+1,0),o.times(o).eq(l)){r=o;break}}else if(t!="9999")break;s+=4}return Ye=!0,Le(r,n)};$t.times=$t.mul=function(e){var t,n,r,i,o,s,l,c,h,u=this,f=u.constructor,m=u.d,y=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,c=m.length,h=y.length,c<h&&(o=m,m=y,y=o,s=c,c=h,h=s),o=[],s=c+h,r=s;r--;)o.push(0);for(r=h;--r>=0;){for(t=0,i=c+r;i>r;)l=o[i]+y[r]*m[i-r-1]+t,o[i--]=l%Pn|0,t=l/Pn|0;o[i]=(o[i]+t)%Pn|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Ye?Le(e,f.precision):e};$t.toDecimalPlaces=$t.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Si(e,0,mc),t===void 0?t=r.rounding:Si(t,0,8),Le(n,e+mn(n)+1,t))};$t.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ma(r,!0):(Si(e,0,mc),t===void 0?t=i.rounding:Si(t,0,8),r=Le(new i(r),e+1,t),n=ma(r,!0,e+1)),n};$t.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?ma(i):(Si(e,0,mc),t===void 0?t=o.rounding:Si(t,0,8),r=Le(new o(i),e+mn(i)+1,t),n=ma(r.abs(),!1,e+mn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};$t.toInteger=$t.toint=function(){var e=this,t=e.constructor;return Le(new t(e),mn(e)+1,t.rounding)};$t.toNumber=function(){return+this};$t.toPower=$t.pow=function(e){var t,n,r,i,o,s,l=this,c=l.constructor,h=12,u=+(e=new c(e));if(!e.s)return new c(_r);if(l=new c(l),!l.s){if(e.s<1)throw Error(Fr+"Infinity");return l}if(l.eq(_r))return l;if(r=c.precision,e.eq(_r))return Le(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=l.s,s){if((n=u<0?-u:u)<=HM){for(i=new c(_r),t=Math.ceil(r/Ue+4),Ye=!1;n%2&&(i=i.times(l),aP(i.d,t)),n=gc(n/2),n!==0;)l=l.times(l),aP(l.d,t);return Ye=!0,e.s<0?new c(_r).div(i):Le(i,r)}}else if(o<0)throw Error(Fr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Ye=!1,i=e.times(qu(l,r+h)),Ye=!0,i=GM(i),i.s=o,i};$t.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=mn(i),r=ma(i,n<=o.toExpNeg||n>=o.toExpPos)):(Si(e,1,mc),t===void 0?t=o.rounding:Si(t,0,8),i=Le(new o(i),e,t),n=mn(i),r=ma(i,e<=n||n<=o.toExpNeg,e)),r};$t.toSignificantDigits=$t.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Si(e,1,mc),t===void 0?t=r.rounding:Si(t,0,8)),Le(new r(n),e,t)};$t.toString=$t.valueOf=$t.val=$t.toJSON=$t[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return ma(e,t<=n.toExpNeg||t>=n.toExpPos)};function qM(e,t){var n,r,i,o,s,l,c,h,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Ye?Le(t,f):t;if(c=e.d,h=t.d,s=e.e,i=t.e,c=c.slice(),o=s-i,o){for(o<0?(r=c,o=-o,l=h.length):(r=h,i=s,l=c.length),s=Math.ceil(f/Ue),l=s>l?s+1:l+1,o>l&&(o=l,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(l=c.length,o=h.length,l-o<0&&(o=l,r=h,h=c,c=r),n=0;o;)n=(c[--o]=c[o]+h[o]+n)/Pn|0,c[o]%=Pn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Ye?Le(t,f):t}function Si(e,t,n){if(e!==~~e||e<t||e>n)throw Error(oa+e)}function mi(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",n=Ue-r.length,n&&(o+=zo(n)),o+=r;s=e[t],r=s+"",n=Ue-r.length,n&&(o+=zo(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}var ao=function(){function e(r,i){var o,s=0,l=r.length;for(r=r.slice();l--;)o=r[l]*i+s,r[l]=o%Pn|0,s=o/Pn|0;return s&&r.unshift(s),r}function t(r,i,o,s){var l,c;if(o!=s)c=o>s?1:-1;else for(l=c=0;l<o;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]<i[o]?1:0,r[o]=s*Pn+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s){var l,c,h,u,f,m,y,x,p,b,P,S,A,E,w,T,O,I,N=r.constructor,F=r.s==i.s?1:-1,D=r.d,j=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(Fr+"Division by zero");for(c=r.e-i.e,O=j.length,w=D.length,y=new N(F),x=y.d=[],h=0;j[h]==(D[h]||0);)++h;if(j[h]>(D[h]||0)&&--c,o==null?S=o=N.precision:s?S=o+(mn(r)-mn(i))+1:S=o,S<0)return new N(0);if(S=S/Ue+2|0,h=0,O==1)for(u=0,j=j[0],S++;(h<w||u)&&S--;h++)A=u*Pn+(D[h]||0),x[h]=A/j|0,u=A%j|0;else{for(u=Pn/(j[0]+1)|0,u>1&&(j=e(j,u),D=e(D,u),O=j.length,w=D.length),E=O,p=D.slice(0,O),b=p.length;b<O;)p[b++]=0;I=j.slice(),I.unshift(0),T=j[0],j[1]>=Pn/2&&++T;do u=0,l=t(j,p,O,b),l<0?(P=p[0],O!=b&&(P=P*Pn+(p[1]||0)),u=P/T|0,u>1?(u>=Pn&&(u=Pn-1),f=e(j,u),m=f.length,b=p.length,l=t(f,p,m,b),l==1&&(u--,n(f,O<m?I:j,m))):(u==0&&(l=u=1),f=j.slice()),m=f.length,m<b&&f.unshift(0),n(p,f,b),l==-1&&(b=p.length,l=t(j,p,O,b),l<1&&(u++,n(p,O<b?I:j,b))),b=p.length):l===0&&(u++,p=[0]),x[h++]=u,l&&p[0]?p[b++]=D[E]||0:(p=[D[E]],b=1);while((E++<w||p[0]!==void 0)&&S--)}return x[0]||x.shift(),y.e=c,Le(y,s?o+mn(y)+1:o)}}();function GM(e,t){var n,r,i,o,s,l,c=0,h=0,u=e.constructor,f=u.precision;if(mn(e)>16)throw Error(ox+mn(e));if(!e.s)return new u(_r);for(Ye=!1,l=f,s=new u(.03125);e.abs().gte(.1);)e=e.times(s),h+=5;for(r=Math.log(qs(2,h))/Math.LN10*2+5|0,l+=r,n=i=o=new u(_r),u.precision=l;;){if(i=Le(i.times(e),l),n=n.times(++c),s=o.plus(ao(i,n,l)),mi(s.d).slice(0,l)===mi(o.d).slice(0,l)){for(;h--;)o=Le(o.times(o),l);return u.precision=f,t==null?(Ye=!0,Le(o,f)):o}o=s}}function mn(e){for(var t=e.e*Ue,n=e.d[0];n>=10;n/=10)t++;return t}function Eg(e,t,n){if(t>e.LN10.sd())throw Ye=!0,n&&(e.precision=n),Error(Fr+"LN10 precision limit exceeded");return Le(new e(e.LN10),t)}function zo(e){for(var t="";e--;)t+="0";return t}function qu(e,t){var n,r,i,o,s,l,c,h,u,f=1,m=10,y=e,x=y.d,p=y.constructor,b=p.precision;if(y.s<1)throw Error(Fr+(y.s?"NaN":"-Infinity"));if(y.eq(_r))return new p(0);if(t==null?(Ye=!1,h=b):h=t,y.eq(10))return t==null&&(Ye=!0),Eg(p,h);if(h+=m,p.precision=h,n=mi(x),r=n.charAt(0),o=mn(y),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=mi(y.d),r=n.charAt(0),f++;o=mn(y),r>1?(y=new p("0."+n),o++):y=new p(r+"."+n.slice(1))}else return c=Eg(p,h+2,b).times(o+""),y=qu(new p(r+"."+n.slice(1)),h-m).plus(c),p.precision=b,t==null?(Ye=!0,Le(y,b)):y;for(l=s=y=ao(y.minus(_r),y.plus(_r),h),u=Le(y.times(y),h),i=3;;){if(s=Le(s.times(u),h),c=l.plus(ao(s,new p(i),h)),mi(c.d).slice(0,h)===mi(l.d).slice(0,h))return l=l.times(2),o!==0&&(l=l.plus(Eg(p,h+2,b).times(o+""))),l=ao(l,new p(f),h),p.precision=b,t==null?(Ye=!0,Le(l,b)):l;l=c,i+=2}}function sP(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=gc(n/Ue),e.d=[],r=(n+1)%Ue,n<0&&(r+=Ue),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Ue;r<i;)e.d.push(+t.slice(r,r+=Ue));t=t.slice(r),r=Ue-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Ye&&(e.e>Md||e.e<-Md))throw Error(ox+n)}else e.s=0,e.e=0,e.d=[0];return e}function Le(e,t,n){var r,i,o,s,l,c,h,u,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=Ue,i=t,h=f[u=0];else{if(u=Math.ceil((r+1)/Ue),o=f.length,u>=o)return e;for(h=o=f[u],s=1;o>=10;o/=10)s++;r%=Ue,i=r-Ue+s}if(n!==void 0&&(o=qs(10,s-i-1),l=h/o%10|0,c=t<0||f[u+1]!==void 0||h%o,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?h/qs(10,s-i):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(o=mn(e),f.length=1,t=t-o-1,f[0]=qs(10,(Ue-t%Ue)%Ue),e.e=gc(-t/Ue)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=qs(10,Ue-r),f[u]=i>0?(h/qs(10,s-i)%qs(10,i)|0)*o:0),c)for(;;)if(u==0){(f[0]+=o)==Pn&&(f[0]=1,++e.e);break}else{if(f[u]+=o,f[u]!=Pn)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(Ye&&(e.e>Md||e.e<-Md))throw Error(ox+mn(e));return e}function ZM(e,t){var n,r,i,o,s,l,c,h,u,f,m=e.constructor,y=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Ye?Le(t,y):t;if(c=e.d,f=t.d,r=t.e,h=e.e,c=c.slice(),s=h-r,s){for(u=s<0,u?(n=c,s=-s,l=f.length):(n=f,r=h,l=c.length),i=Math.max(Math.ceil(y/Ue),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,u=i<l,u&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){u=c[i]<f[i];break}s=0}for(u&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(o=i;o&&c[--o]===0;)c[o]=Pn-1;--c[o],c[i]+=Pn}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Ye?Le(t,y):t):new m(0)}function ma(e,t,n){var r,i=mn(e),o=mi(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+zo(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+zo(-i-1)+o,n&&(r=n-s)>0&&(o+=zo(r))):i>=s?(o+=zo(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+zo(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=zo(r))),e.s<0?"-"+o:o}function aP(e,t){if(e.length>t)return e.length=t,!0}function YM(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(oa+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return sP(s,o.toString())}else if(typeof o!="string")throw Error(oa+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,GX.test(o))sP(s,o);else throw Error(oa+o)}if(i.prototype=$t,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=YM,i.config=i.set=ZX,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function ZX(e){if(!e||typeof e!="object")throw Error(Fr+"Object expected");var t,n,r,i=["precision",1,mc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(gc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(oa+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(oa+n+": "+r);return this}var sx=YM(qX);_r=new sx(1);const ke=sx;function YX(e){return QX(e)||JX(e)||XX(e)||KX()}function KX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
45
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zZ(e,t){if(e){if(typeof e=="string")return bS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bS(e,t)}}function bS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function WZ(e){if(Array.isArray(e))return e}var cM=/[ \f\n\r\t\v\u2028\u2029]+/,uM=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];Zt(n)||(r?o=n.toString().split(""):o=n.toString().split(cM));var s=o.map(function(c){return{word:c,width:pu(c,i).width}}),l=r?0:pu(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},VZ=function(t,n,r,i,o){var s=t.maxLines,l=t.children,c=t.style,h=t.breakAll,u=wt(s),f=l,m=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(Y,G){var X=G.word,lt=G.width,H=Y[Y.length-1];if(H&&(i==null||o||H.width+lt+r<Number(i)))H.words.push(X),H.width+=lt+r;else{var et={words:[X],width:lt};Y.push(et)}return Y},[])},y=m(n),x=function(z){return z.reduce(function(Y,G){return Y.width>G.width?Y:G})};if(!u)return y;for(var p="…",b=function(z){var Y=f.slice(0,z),G=uM({breakAll:h,style:c,children:Y+p}).wordsWithComputedWidth,X=m(G),lt=X.length>s||x(X).width>Number(i);return[lt,X]},P=0,S=f.length-1,A=0,E;P<=S&&A<=f.length-1;){var w=Math.floor((P+S)/2),T=w-1,O=b(T),I=vS(O,2),N=I[0],F=I[1],D=b(w),j=vS(D,1),K=j[0];if(!N&&!K&&(P=w+1),N&&K&&(S=w-1),!N&&K){E=F;break}A++}return E||y},xS=function(t){var n=Zt(t)?[]:t.toString().split(cM);return[{words:n}]},UZ=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,l=t.maxLines;if((n||r)&&!ss.isSsr){var c,h,u=uM({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,m=u.spaceWidth;c=f,h=m}else return xS(i);return VZ({breakAll:s,children:i,maxLines:l,style:o},c,h,n,r)}return xS(i)},wS="#808080",da=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,h=c===void 0?"0.71em":c,u=t.scaleToFit,f=u===void 0?!1:u,m=t.textAnchor,y=m===void 0?"start":m,x=t.verticalAnchor,p=x===void 0?"end":x,b=t.fill,P=b===void 0?wS:b,S=yS(t,NZ),A=v.useMemo(function(){return UZ({breakAll:S.breakAll,children:S.children,maxLines:S.maxLines,scaleToFit:f,style:S.style,width:S.width})},[S.breakAll,S.children,S.maxLines,f,S.style,S.width]),E=S.dx,w=S.dy,T=S.angle,O=S.className,I=S.breakAll,N=yS(S,jZ);if(!wn(r)||!wn(o))return null;var F=r+(wt(E)?E:0),D=o+(wt(w)?w:0),j;switch(p){case"start":j=bg("calc(".concat(h,")"));break;case"middle":j=bg("calc(".concat((A.length-1)/2," * -").concat(l," + (").concat(h," / 2))"));break;default:j=bg("calc(".concat(A.length-1," * -").concat(l,")"));break}var K=[];if(f){var U=A[0].width,z=S.width;K.push("scale(".concat((wt(z)?z/U:1)/U,")"))}return T&&K.push("rotate(".concat(T,", ").concat(F,", ").concat(D,")")),K.length&&(N.transform=K.join(" ")),v.createElement("text",Qy({},Dt(N,!0),{x:F,y:D,className:te("recharts-text",O),textAnchor:y,fill:P.includes("url")?wS:P}),A.map(function(Y,G){var X=Y.words.join(I?"":" ");return v.createElement("tspan",{x:F,dy:G===0?j:l,key:"".concat(X,"-").concat(G)},X)}))};function Yo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function HZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function j0(e){let t,n,r;e.length!==2?(t=Yo,n=(l,c)=>Yo(e(l),c),r=(l,c)=>e(l)-c):(t=e===Yo||e===HZ?e:qZ,n=e,r=e);function i(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<0?h=f+1:u=f}while(h<u)}return h}function o(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<=0?h=f+1:u=f}while(h<u)}return h}function s(l,c,h=0,u=l.length){const f=i(l,c,h,u-1);return f>h&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:s,right:o}}function qZ(){return 0}function hM(e){return e===null?NaN:+e}function*GZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ZZ=j0(Yo),Ph=ZZ.right;j0(hM).center;class _S extends Map{constructor(t,n=XZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(SS(this,t))}has(t){return super.has(SS(this,t))}set(t,n){return super.set(YZ(this,t),n)}delete(t){return super.delete(KZ(this,t))}}function SS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function KZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function JZ(e=Yo){if(e===Yo)return fM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function fM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const QZ=Math.sqrt(50),tY=Math.sqrt(10),eY=Math.sqrt(2);function bd(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=QZ?10:o>=tY?5:o>=eY?2:1;let l,c,h;return i<0?(h=Math.pow(10,-i)/s,l=Math.round(e*h),c=Math.round(t*h),l/h<e&&++l,c/h>t&&--c,h=-h):(h=Math.pow(10,i)*s,l=Math.round(e/h),c=Math.round(t/h),l*h<e&&++l,c*h>t&&--c),c<l&&.5<=n&&n<2?bd(e,t,n*2):[l,c,h]}function tv(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?bd(t,e,n):bd(e,t,n);if(!(o>=i))return[];const l=o-i+1,c=new Array(l);if(r)if(s<0)for(let h=0;h<l;++h)c[h]=(o-h)/-s;else for(let h=0;h<l;++h)c[h]=(o-h)*s;else if(s<0)for(let h=0;h<l;++h)c[h]=(i+h)/-s;else for(let h=0;h<l;++h)c[h]=(i+h)*s;return c}function ev(e,t,n){return t=+t,e=+e,n=+n,bd(e,t,n)[2]}function nv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ev(t,e,n):ev(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function PS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function AS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function dM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?fM:JZ(i);r>n;){if(r-n>600){const c=r-n+1,h=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(c-f)/c)*(h-c/2<0?-1:1),y=Math.max(n,Math.floor(t-h*f/c+m)),x=Math.min(r,Math.floor(t+(c-h)*f/c+m));dM(e,t,y,x,i)}const o=e[t];let s=n,l=r;for(Hc(e,n,t),i(e[r],o)>0&&Hc(e,n,r);s<l;){for(Hc(e,s,l),++s,--l;i(e[s],o)<0;)++s;for(;i(e[l],o)>0;)--l}i(e[n],o)===0?Hc(e,n,l):(++l,Hc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Hc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function nY(e,t,n){if(e=Float64Array.from(GZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return AS(e);if(t>=1)return PS(e);var r,i=(r-1)*t,o=Math.floor(i),s=PS(dM(e,o).subarray(0,o+1)),l=AS(e.subarray(o+1));return s+(l-s)*(i-o)}}function rY(e,t,n=hM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),l=+n(e[o+1],o+1,e);return s+(l-s)*(i-o)}}function iY(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Wr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function vo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const rv=Symbol("implicit");function D0(){var e=new _S,t=[],n=[],r=rv;function i(o){let s=e.get(o);if(s===void 0){if(r!==rv)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new _S;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return D0(t,n).unknown(r)},Wr.apply(i,arguments),i}function Fu(){var e=D0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,l=!1,c=0,h=0,u=.5;delete e.unknown;function f(){var m=t().length,y=i<r,x=y?i:r,p=y?r:i;o=(p-x)/Math.max(1,m-c+h*2),l&&(o=Math.floor(o)),x+=(p-x-o*(m-c))*u,s=o*(1-c),l&&(x=Math.round(x),s=Math.round(s));var b=iY(m).map(function(P){return x+o*P});return n(y?b.reverse():b)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([r,i]=m,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(m){return[r,i]=m,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,h=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(h=+m,f()):h},e.align=function(m){return arguments.length?(u=Math.max(0,Math.min(1,m)),f()):u},e.copy=function(){return Fu(t(),[r,i]).round(l).paddingInner(c).paddingOuter(h).align(u)},Wr.apply(f(),arguments)}function pM(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return pM(t())},e}function mu(){return pM(Fu.apply(null,arguments).paddingInner(1))}function B0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ah(){}var Wu=.7,xd=1/Wu,dl="\\s*([+-]?\\d+)\\s*",Vu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oY=/^#([0-9a-f]{3,8})$/,sY=new RegExp(`^rgb\\(${dl},${dl},${dl}\\)$`),aY=new RegExp(`^rgb\\(${xi},${xi},${xi}\\)$`),lY=new RegExp(`^rgba\\(${dl},${dl},${dl},${Vu}\\)$`),cY=new RegExp(`^rgba\\(${xi},${xi},${xi},${Vu}\\)$`),uY=new RegExp(`^hsl\\(${Vu},${xi},${xi}\\)$`),hY=new RegExp(`^hsla\\(${Vu},${xi},${xi},${Vu}\\)$`),TS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};B0(Ah,Uu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ES,formatHex:ES,formatHex8:fY,formatHsl:dY,formatRgb:CS,toString:CS});function ES(){return this.rgb().formatHex()}function fY(){return this.rgb().formatHex8()}function dY(){return gM(this).formatHsl()}function CS(){return this.rgb().formatRgb()}function Uu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=oY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?OS(t):n===3?new rr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=sY.exec(e))?new rr(t[1],t[2],t[3],1):(t=aY.exec(e))?new rr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lY.exec(e))?Pf(t[1],t[2],t[3],t[4]):(t=cY.exec(e))?Pf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uY.exec(e))?$S(t[1],t[2]/100,t[3]/100,1):(t=hY.exec(e))?$S(t[1],t[2]/100,t[3]/100,t[4]):TS.hasOwnProperty(e)?OS(TS[e]):e==="transparent"?new rr(NaN,NaN,NaN,0):null}function OS(e){return new rr(e>>16&255,e>>8&255,e&255,1)}function Pf(e,t,n,r){return r<=0&&(e=t=n=NaN),new rr(e,t,n,r)}function pY(e){return e instanceof Ah||(e=Uu(e)),e?(e=e.rgb(),new rr(e.r,e.g,e.b,e.opacity)):new rr}function iv(e,t,n,r){return arguments.length===1?pY(e):new rr(e,t,n,r??1)}function rr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}B0(rr,iv,mM(Ah,{brighter(e){return e=e==null?xd:Math.pow(xd,e),new rr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wu:Math.pow(Wu,e),new rr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rr(ia(this.r),ia(this.g),ia(this.b),wd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:MS,formatHex:MS,formatHex8:mY,formatRgb:kS,toString:kS}));function MS(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}`}function mY(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}${Xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function kS(){const e=wd(this.opacity);return`${e===1?"rgb(":"rgba("}${ia(this.r)}, ${ia(this.g)}, ${ia(this.b)}${e===1?")":`, ${e})`}`}function wd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ia(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xs(e){return e=ia(e),(e<16?"0":"")+e.toString(16)}function $S(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qr(e,t,n,r)}function gM(e){if(e instanceof Qr)return new Qr(e.h,e.s,e.l,e.opacity);if(e instanceof Ah||(e=Uu(e)),!e)return new Qr;if(e instanceof Qr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,c=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new Qr(s,l,c,e.opacity)}function gY(e,t,n,r){return arguments.length===1?gM(e):new Qr(e,t,n,r??1)}function Qr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}B0(Qr,gY,mM(Ah,{brighter(e){return e=e==null?xd:Math.pow(xd,e),new Qr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wu:Math.pow(Wu,e),new Qr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new rr(xg(e>=240?e-240:e+120,i,r),xg(e,i,r),xg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qr(IS(this.h),Af(this.s),Af(this.l),wd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wd(this.opacity);return`${e===1?"hsl(":"hsla("}${IS(this.h)}, ${Af(this.s)*100}%, ${Af(this.l)*100}%${e===1?")":`, ${e})`}`}}));function IS(e){return e=(e||0)%360,e<0?e+360:e}function Af(e){return Math.max(0,Math.min(1,e||0))}function xg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const z0=e=>()=>e;function yY(e,t){return function(n){return e+n*t}}function vY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function bY(e){return(e=+e)==1?yM:function(t,n){return n-t?vY(t,n,e):z0(isNaN(t)?n:t)}}function yM(e,t){var n=t-e;return n?yY(e,n):z0(isNaN(e)?t:e)}const RS=function e(t){var n=bY(t);function r(i,o){var s=n((i=iv(i)).r,(o=iv(o)).r),l=n(i.g,o.g),c=n(i.b,o.b),h=yM(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=l(u),i.b=c(u),i.opacity=h(u),i+""}}return r.gamma=e,r}(1);function xY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function wY(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _Y(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=pc(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(l){for(s=0;s<r;++s)o[s]=i[s](l);return o}}function SY(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _d(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function PY(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=pc(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var ov=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wg=new RegExp(ov.source,"g");function AY(e){return function(){return e}}function TY(e){return function(t){return e(t)+""}}function EY(e,t){var n=ov.lastIndex=wg.lastIndex=0,r,i,o,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=ov.exec(e))&&(i=wg.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:_d(r,i)})),n=wg.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?c[0]?TY(c[0].x):AY(t):(t=c.length,function(h){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(h);return l.join("")})}function pc(e,t){var n=typeof t,r;return t==null||n==="boolean"?z0(t):(n==="number"?_d:n==="string"?(r=Uu(t))?(t=r,RS):EY:t instanceof Uu?RS:t instanceof Date?SY:wY(t)?xY:Array.isArray(t)?_Y:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?PY:_d)(e,t)}function F0(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function CY(e,t){t===void 0&&(t=e,e=pc);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[l](s-l)}}function OY(e){return function(){return e}}function Sd(e){return+e}var LS=[0,1];function Zn(e){return e}function sv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:OY(isNaN(t)?NaN:.5)}function MY(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function kY(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=sv(i,r),o=n(s,o)):(r=sv(r,i),o=n(o,s)),function(l){return o(r(l))}}function $Y(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=sv(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(l){var c=Ph(e,l,1,r)-1;return o[c](i[c](l))}}function Th(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Gp(){var e=LS,t=LS,n=pc,r,i,o,s=Zn,l,c,h;function u(){var m=Math.min(e.length,t.length);return s!==Zn&&(s=MY(e[0],e[m-1])),l=m>2?$Y:kY,c=h=null,f}function f(m){return m==null||isNaN(m=+m)?o:(c||(c=l(e.map(r),t,n)))(r(s(m)))}return f.invert=function(m){return s(i((h||(h=l(t,e.map(r),_d)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,Sd),u()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),u()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),n=F0,u()},f.clamp=function(m){return arguments.length?(s=m?!0:Zn,u()):s!==Zn},f.interpolate=function(m){return arguments.length?(n=m,u()):n},f.unknown=function(m){return arguments.length?(o=m,f):o},function(m,y){return r=m,i=y,u()}}function W0(){return Gp()(Zn,Zn)}function IY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Pd(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Cl(e){return e=Pd(Math.abs(e)),e?e[1]:NaN}function RY(e,t){return function(n,r){for(var i=n.length,o=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),o.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return o.reverse().join(t)}}function LY(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hu(e){if(!(t=NY.exec(e)))throw new Error("invalid format: "+e);var t;return new V0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Hu.prototype=V0.prototype;function V0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}V0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function jY(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Ad;function DY(e,t){var n=Pd(e,t);if(!n)return Ad=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(Ad=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Pd(e,Math.max(0,t+o-1))[0]}function NS(e,t){var n=Pd(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const jS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:IY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>NS(e*100,t),r:NS,s:DY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function DS(e){return e}var BS=Array.prototype.map,zS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function BY(e){var t=e.grouping===void 0||e.thousands===void 0?DS:RY(BS.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?DS:LY(BS.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function h(f,m){f=Hu(f);var y=f.fill,x=f.align,p=f.sign,b=f.symbol,P=f.zero,S=f.width,A=f.comma,E=f.precision,w=f.trim,T=f.type;T==="n"?(A=!0,T="g"):jS[T]||(E===void 0&&(E=12),w=!0,T="g"),(P||y==="0"&&x==="=")&&(P=!0,y="0",x="=");var O=(m&&m.prefix!==void 0?m.prefix:"")+(b==="$"?n:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),I=(b==="$"?r:/[%p]/.test(T)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),N=jS[T],F=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(j){var K=O,U=I,z,Y,G;if(T==="c")U=N(j)+U,j="";else{j=+j;var X=j<0||1/j<0;if(j=isNaN(j)?c:N(Math.abs(j),E),w&&(j=jY(j)),X&&+j==0&&p!=="+"&&(X=!1),K=(X?p==="("?p:l:p==="-"||p==="("?"":p)+K,U=(T==="s"&&!isNaN(j)&&Ad!==void 0?zS[8+Ad/3]:"")+U+(X&&p==="("?")":""),F){for(z=-1,Y=j.length;++z<Y;)if(G=j.charCodeAt(z),48>G||G>57){U=(G===46?i+j.slice(z+1):j.slice(z))+U,j=j.slice(0,z);break}}}A&&!P&&(j=t(j,1/0));var lt=K.length+j.length+U.length,H=lt<S?new Array(S-lt+1).join(y):"";switch(A&&P&&(j=t(H+j,H.length?S-U.length:1/0),H=""),x){case"<":j=K+j+U+H;break;case"=":j=K+H+j+U;break;case"^":j=H.slice(0,lt=H.length>>1)+K+j+U+H.slice(lt);break;default:j=H+K+j+U;break}return o(j)}return D.toString=function(){return f+""},D}function u(f,m){var y=Math.max(-8,Math.min(8,Math.floor(Cl(m)/3)))*3,x=Math.pow(10,-y),p=h((f=Hu(f),f.type="f",f),{suffix:zS[8+y/3]});return function(b){return p(x*b)}}return{format:h,formatPrefix:u}}var Tf,U0,vM;zY({thousands:",",grouping:[3],currency:["$",""]});function zY(e){return Tf=BY(e),U0=Tf.format,vM=Tf.formatPrefix,Tf}function FY(e){return Math.max(0,-Cl(Math.abs(e)))}function WY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Cl(t)/3)))*3-Cl(Math.abs(e)))}function VY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Cl(t)-Cl(e))+1}function bM(e,t,n,r){var i=nv(e,t,n),o;switch(r=Hu(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=WY(i,s))&&(r.precision=o),vM(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=VY(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=FY(i))&&(r.precision=o-(r.type==="%")*2);break}}return U0(r)}function as(e){var t=e.domain;return e.ticks=function(n){var r=t();return tv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return bM(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],l=r[o],c,h,u=10;for(l<s&&(h=s,s=l,l=h,h=i,i=o,o=h);u-- >0;){if(h=ev(s,l,n),h===c)return r[i]=s,r[o]=l,t(r);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;c=h}return e},e}function Td(){var e=W0();return e.copy=function(){return Th(e,Td())},Wr.apply(e,arguments),as(e)}function xM(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Sd),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return xM(e).unknown(t)},e=arguments.length?Array.from(e,Sd):[0,1],as(n)}function wM(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function FS(e){return Math.log(e)}function WS(e){return Math.exp(e)}function UY(e){return-Math.log(-e)}function HY(e){return-Math.exp(-e)}function qY(e){return isFinite(e)?+("1e"+e):e<0?0:e}function GY(e){return e===10?qY:e===Math.E?Math.exp:t=>Math.pow(e,t)}function ZY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function VS(e){return(t,n)=>-e(-t,n)}function H0(e){const t=e(FS,WS),n=t.domain;let r=10,i,o;function s(){return i=ZY(r),o=GY(r),n()[0]<0?(i=VS(i),o=VS(o),e(UY,HY)):e(FS,WS),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let h=c[0],u=c[c.length-1];const f=u<h;f&&([h,u]=[u,h]);let m=i(h),y=i(u),x,p;const b=l==null?10:+l;let P=[];if(!(r%1)&&y-m<b){if(m=Math.floor(m),y=Math.ceil(y),h>0){for(;m<=y;++m)for(x=1;x<r;++x)if(p=m<0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}}else for(;m<=y;++m)for(x=r-1;x>=1;--x)if(p=m>0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}P.length*2<b&&(P=tv(h,u,b))}else P=tv(m,y,Math.min(y-m,b)).map(o);return f?P.reverse():P},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Hu(c)).precision==null&&(c.trim=!0),c=U0(c)),l===1/0)return c;const h=Math.max(1,r*l/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=h?c(u):""}},t.nice=()=>n(wM(n(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function _M(){const e=H0(Gp()).domain([1,10]);return e.copy=()=>Th(e,_M()).base(e.base()),Wr.apply(e,arguments),e}function US(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function HS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function q0(e){var t=1,n=e(US(t),HS(t));return n.constant=function(r){return arguments.length?e(US(t=+r),HS(t)):t},as(n)}function SM(){var e=q0(Gp());return e.copy=function(){return Th(e,SM()).constant(e.constant())},Wr.apply(e,arguments)}function qS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function YY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function KY(e){return e<0?-e*e:e*e}function G0(e){var t=e(Zn,Zn),n=1;function r(){return n===1?e(Zn,Zn):n===.5?e(YY,KY):e(qS(n),qS(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},as(t)}function Z0(){var e=G0(Gp());return e.copy=function(){return Th(e,Z0()).exponent(e.exponent())},Wr.apply(e,arguments),e}function XY(){return Z0.apply(null,arguments).exponent(.5)}function GS(e){return Math.sign(e)*e*e}function JY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function PM(){var e=W0(),t=[0,1],n=!1,r;function i(o){var s=JY(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(GS(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Sd)).map(GS)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return PM(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Wr.apply(i,arguments),as(i)}function AM(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=rY(e,s/l);return o}function o(s){return s==null||isNaN(s=+s)?r:t[Ph(n,s)]}return o.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Yo),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return AM().domain(e).range(t).unknown(r)},Wr.apply(o,arguments)}function TM(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function s(c){return c!=null&&c<=c?i[Ph(r,c,0,n)]:o}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var h=i.indexOf(c);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},s.unknown=function(c){return arguments.length&&(o=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return TM().domain([e,t]).range(i).unknown(o)},Wr.apply(as(s),arguments)}function EM(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Ph(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return EM().domain(e).range(t).unknown(n)},Wr.apply(i,arguments)}const _g=new Date,Sg=new Date;function _n(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),l=i.ceil(o);return o-s<l-o?s:l},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,l)=>{const c=[];if(o=i.ceil(o),l=l==null?1:Math.floor(l),!(o<s)||!(l>0))return c;let h;do c.push(h=new Date(+o)),t(o,l),e(o);while(h<o&&o<s);return c},i.filter=o=>_n(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!o(s););else for(;--l>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(_g.setTime(+o),Sg.setTime(+s),e(_g),e(Sg),Math.floor(n(_g,Sg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Ed=_n(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ed.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_n(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ed);Ed.range;const no=1e3,zr=no*60,ro=zr*60,ho=ro*24,Y0=ho*7,ZS=ho*30,Pg=ho*365,Js=_n(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*no)},(e,t)=>(t-e)/no,e=>e.getUTCSeconds());Js.range;const K0=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no)},(e,t)=>{e.setTime(+e+t*zr)},(e,t)=>(t-e)/zr,e=>e.getMinutes());K0.range;const X0=_n(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*zr)},(e,t)=>(t-e)/zr,e=>e.getUTCMinutes());X0.range;const J0=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no-e.getMinutes()*zr)},(e,t)=>{e.setTime(+e+t*ro)},(e,t)=>(t-e)/ro,e=>e.getHours());J0.range;const Q0=_n(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ro)},(e,t)=>(t-e)/ro,e=>e.getUTCHours());Q0.range;const Eh=_n(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*zr)/ho,e=>e.getDate()-1);Eh.range;const Zp=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ho,e=>e.getUTCDate()-1);Zp.range;const CM=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ho,e=>Math.floor(e/ho));CM.range;function _a(e){return _n(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*zr)/Y0)}const Yp=_a(0),Cd=_a(1),QY=_a(2),tK=_a(3),Ol=_a(4),eK=_a(5),nK=_a(6);Yp.range;Cd.range;QY.range;tK.range;Ol.range;eK.range;nK.range;function Sa(e){return _n(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Y0)}const Kp=Sa(0),Od=Sa(1),rK=Sa(2),iK=Sa(3),Ml=Sa(4),oK=Sa(5),sK=Sa(6);Kp.range;Od.range;rK.range;iK.range;Ml.range;oK.range;sK.range;const tx=_n(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());tx.range;const ex=_n(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ex.range;const fo=_n(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());fo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});fo.range;const po=_n(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());po.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});po.range;function OM(e,t,n,r,i,o){const s=[[Js,1,no],[Js,5,5*no],[Js,15,15*no],[Js,30,30*no],[o,1,zr],[o,5,5*zr],[o,15,15*zr],[o,30,30*zr],[i,1,ro],[i,3,3*ro],[i,6,6*ro],[i,12,12*ro],[r,1,ho],[r,2,2*ho],[n,1,Y0],[t,1,ZS],[t,3,3*ZS],[e,1,Pg]];function l(h,u,f){const m=u<h;m&&([h,u]=[u,h]);const y=f&&typeof f.range=="function"?f:c(h,u,f),x=y?y.range(h,+u+1):[];return m?x.reverse():x}function c(h,u,f){const m=Math.abs(u-h)/f,y=j0(([,,b])=>b).right(s,m);if(y===s.length)return e.every(nv(h/Pg,u/Pg,f));if(y===0)return Ed.every(Math.max(nv(h,u,f),1));const[x,p]=s[m/s[y-1][2]<s[y][2]/m?y-1:y];return x.every(p)}return[l,c]}const[aK,lK]=OM(po,ex,Kp,CM,Q0,X0),[cK,uK]=OM(fo,tx,Yp,Eh,J0,K0);function Ag(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Tg(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function qc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function hK(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,h=Gc(i),u=Zc(i),f=Gc(o),m=Zc(o),y=Gc(s),x=Zc(s),p=Gc(l),b=Zc(l),P=Gc(c),S=Zc(c),A={a:G,A:X,b:lt,B:H,c:null,d:tP,e:tP,f:RK,g:UK,G:qK,H:kK,I:$K,j:IK,L:MM,m:LK,M:NK,p:et,q:it,Q:rP,s:iP,S:jK,u:DK,U:BK,V:zK,w:FK,W:WK,x:null,X:null,y:VK,Y:HK,Z:GK,"%":nP},E={a:at,A:ct,b:yt,B:vt,c:null,d:eP,e:eP,f:XK,g:aX,G:cX,H:ZK,I:YK,j:KK,L:$M,m:JK,M:QK,p:Et,q:Tt,Q:rP,s:iP,S:tX,u:eX,U:nX,V:rX,w:iX,W:oX,x:null,X:null,y:sX,Y:lX,Z:uX,"%":nP},w={a:F,A:D,b:j,B:K,c:U,d:JS,e:JS,f:EK,g:XS,G:KS,H:QS,I:QS,j:SK,L:TK,m:_K,M:PK,p:N,q:wK,Q:OK,s:MK,S:AK,u:gK,U:yK,V:vK,w:mK,W:bK,x:z,X:Y,y:XS,Y:KS,Z:xK,"%":CK};A.x=T(n,A),A.X=T(r,A),A.c=T(t,A),E.x=T(n,E),E.X=T(r,E),E.c=T(t,E);function T(ft,dt){return function(Ct){var nt=[],Lt=-1,bt=0,me=ft.length,ie,Xt,Ne;for(Ct instanceof Date||(Ct=new Date(+Ct));++Lt<me;)ft.charCodeAt(Lt)===37&&(nt.push(ft.slice(bt,Lt)),(Xt=YS[ie=ft.charAt(++Lt)])!=null?ie=ft.charAt(++Lt):Xt=ie==="e"?" ":"0",(Ne=dt[ie])&&(ie=Ne(Ct,Xt)),nt.push(ie),bt=Lt+1);return nt.push(ft.slice(bt,Lt)),nt.join("")}}function O(ft,dt){return function(Ct){var nt=qc(1900,void 0,1),Lt=I(nt,ft,Ct+="",0),bt,me;if(Lt!=Ct.length)return null;if("Q"in nt)return new Date(nt.Q);if("s"in nt)return new Date(nt.s*1e3+("L"in nt?nt.L:0));if(dt&&!("Z"in nt)&&(nt.Z=0),"p"in nt&&(nt.H=nt.H%12+nt.p*12),nt.m===void 0&&(nt.m="q"in nt?nt.q:0),"V"in nt){if(nt.V<1||nt.V>53)return null;"w"in nt||(nt.w=1),"Z"in nt?(bt=Tg(qc(nt.y,0,1)),me=bt.getUTCDay(),bt=me>4||me===0?Od.ceil(bt):Od(bt),bt=Zp.offset(bt,(nt.V-1)*7),nt.y=bt.getUTCFullYear(),nt.m=bt.getUTCMonth(),nt.d=bt.getUTCDate()+(nt.w+6)%7):(bt=Ag(qc(nt.y,0,1)),me=bt.getDay(),bt=me>4||me===0?Cd.ceil(bt):Cd(bt),bt=Eh.offset(bt,(nt.V-1)*7),nt.y=bt.getFullYear(),nt.m=bt.getMonth(),nt.d=bt.getDate()+(nt.w+6)%7)}else("W"in nt||"U"in nt)&&("w"in nt||(nt.w="u"in nt?nt.u%7:"W"in nt?1:0),me="Z"in nt?Tg(qc(nt.y,0,1)).getUTCDay():Ag(qc(nt.y,0,1)).getDay(),nt.m=0,nt.d="W"in nt?(nt.w+6)%7+nt.W*7-(me+5)%7:nt.w+nt.U*7-(me+6)%7);return"Z"in nt?(nt.H+=nt.Z/100|0,nt.M+=nt.Z%100,Tg(nt)):Ag(nt)}}function I(ft,dt,Ct,nt){for(var Lt=0,bt=dt.length,me=Ct.length,ie,Xt;Lt<bt;){if(nt>=me)return-1;if(ie=dt.charCodeAt(Lt++),ie===37){if(ie=dt.charAt(Lt++),Xt=w[ie in YS?dt.charAt(Lt++):ie],!Xt||(nt=Xt(ft,Ct,nt))<0)return-1}else if(ie!=Ct.charCodeAt(nt++))return-1}return nt}function N(ft,dt,Ct){var nt=h.exec(dt.slice(Ct));return nt?(ft.p=u.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function F(ft,dt,Ct){var nt=y.exec(dt.slice(Ct));return nt?(ft.w=x.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function D(ft,dt,Ct){var nt=f.exec(dt.slice(Ct));return nt?(ft.w=m.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function j(ft,dt,Ct){var nt=P.exec(dt.slice(Ct));return nt?(ft.m=S.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function K(ft,dt,Ct){var nt=p.exec(dt.slice(Ct));return nt?(ft.m=b.get(nt[0].toLowerCase()),Ct+nt[0].length):-1}function U(ft,dt,Ct){return I(ft,t,dt,Ct)}function z(ft,dt,Ct){return I(ft,n,dt,Ct)}function Y(ft,dt,Ct){return I(ft,r,dt,Ct)}function G(ft){return s[ft.getDay()]}function X(ft){return o[ft.getDay()]}function lt(ft){return c[ft.getMonth()]}function H(ft){return l[ft.getMonth()]}function et(ft){return i[+(ft.getHours()>=12)]}function it(ft){return 1+~~(ft.getMonth()/3)}function at(ft){return s[ft.getUTCDay()]}function ct(ft){return o[ft.getUTCDay()]}function yt(ft){return c[ft.getUTCMonth()]}function vt(ft){return l[ft.getUTCMonth()]}function Et(ft){return i[+(ft.getUTCHours()>=12)]}function Tt(ft){return 1+~~(ft.getUTCMonth()/3)}return{format:function(ft){var dt=T(ft+="",A);return dt.toString=function(){return ft},dt},parse:function(ft){var dt=O(ft+="",!1);return dt.toString=function(){return ft},dt},utcFormat:function(ft){var dt=T(ft+="",E);return dt.toString=function(){return ft},dt},utcParse:function(ft){var dt=O(ft+="",!0);return dt.toString=function(){return ft},dt}}}var YS={"-":"",_:" ",0:"0"},En=/^\s*\d+/,fK=/^%/,dK=/[\\^$*+?|[\]().{}]/g;function ve(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function pK(e){return e.replace(dK,"\\$&")}function Gc(e){return new RegExp("^(?:"+e.map(pK).join("|")+")","i")}function Zc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function mK(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function gK(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function vK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function bK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function KS(e,t,n){var r=En.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function XS(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function wK(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function _K(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JS(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function SK(e,t,n){var r=En.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function QS(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function PK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function AK(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function TK(e,t,n){var r=En.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function EK(e,t,n){var r=En.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function CK(e,t,n){var r=fK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function OK(e,t,n){var r=En.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function MK(e,t,n){var r=En.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tP(e,t){return ve(e.getDate(),t,2)}function kK(e,t){return ve(e.getHours(),t,2)}function $K(e,t){return ve(e.getHours()%12||12,t,2)}function IK(e,t){return ve(1+Eh.count(fo(e),e),t,3)}function MM(e,t){return ve(e.getMilliseconds(),t,3)}function RK(e,t){return MM(e,t)+"000"}function LK(e,t){return ve(e.getMonth()+1,t,2)}function NK(e,t){return ve(e.getMinutes(),t,2)}function jK(e,t){return ve(e.getSeconds(),t,2)}function DK(e){var t=e.getDay();return t===0?7:t}function BK(e,t){return ve(Yp.count(fo(e)-1,e),t,2)}function kM(e){var t=e.getDay();return t>=4||t===0?Ol(e):Ol.ceil(e)}function zK(e,t){return e=kM(e),ve(Ol.count(fo(e),e)+(fo(e).getDay()===4),t,2)}function FK(e){return e.getDay()}function WK(e,t){return ve(Cd.count(fo(e)-1,e),t,2)}function VK(e,t){return ve(e.getFullYear()%100,t,2)}function UK(e,t){return e=kM(e),ve(e.getFullYear()%100,t,2)}function HK(e,t){return ve(e.getFullYear()%1e4,t,4)}function qK(e,t){var n=e.getDay();return e=n>=4||n===0?Ol(e):Ol.ceil(e),ve(e.getFullYear()%1e4,t,4)}function GK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ve(t/60|0,"0",2)+ve(t%60,"0",2)}function eP(e,t){return ve(e.getUTCDate(),t,2)}function ZK(e,t){return ve(e.getUTCHours(),t,2)}function YK(e,t){return ve(e.getUTCHours()%12||12,t,2)}function KK(e,t){return ve(1+Zp.count(po(e),e),t,3)}function $M(e,t){return ve(e.getUTCMilliseconds(),t,3)}function XK(e,t){return $M(e,t)+"000"}function JK(e,t){return ve(e.getUTCMonth()+1,t,2)}function QK(e,t){return ve(e.getUTCMinutes(),t,2)}function tX(e,t){return ve(e.getUTCSeconds(),t,2)}function eX(e){var t=e.getUTCDay();return t===0?7:t}function nX(e,t){return ve(Kp.count(po(e)-1,e),t,2)}function IM(e){var t=e.getUTCDay();return t>=4||t===0?Ml(e):Ml.ceil(e)}function rX(e,t){return e=IM(e),ve(Ml.count(po(e),e)+(po(e).getUTCDay()===4),t,2)}function iX(e){return e.getUTCDay()}function oX(e,t){return ve(Od.count(po(e)-1,e),t,2)}function sX(e,t){return ve(e.getUTCFullYear()%100,t,2)}function aX(e,t){return e=IM(e),ve(e.getUTCFullYear()%100,t,2)}function lX(e,t){return ve(e.getUTCFullYear()%1e4,t,4)}function cX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ml(e):Ml.ceil(e),ve(e.getUTCFullYear()%1e4,t,4)}function uX(){return"+0000"}function nP(){return"%"}function rP(e){return+e}function iP(e){return Math.floor(+e/1e3)}var Ga,RM,LM;hX({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function hX(e){return Ga=hK(e),RM=Ga.format,Ga.parse,LM=Ga.utcFormat,Ga.utcParse,Ga}function fX(e){return new Date(e)}function dX(e){return e instanceof Date?+e:+new Date(+e)}function nx(e,t,n,r,i,o,s,l,c,h){var u=W0(),f=u.invert,m=u.domain,y=h(".%L"),x=h(":%S"),p=h("%I:%M"),b=h("%I %p"),P=h("%a %d"),S=h("%b %d"),A=h("%B"),E=h("%Y");function w(T){return(c(T)<T?y:l(T)<T?x:s(T)<T?p:o(T)<T?b:r(T)<T?i(T)<T?P:S:n(T)<T?A:E)(T)}return u.invert=function(T){return new Date(f(T))},u.domain=function(T){return arguments.length?m(Array.from(T,dX)):m().map(fX)},u.ticks=function(T){var O=m();return e(O[0],O[O.length-1],T??10)},u.tickFormat=function(T,O){return O==null?w:h(O)},u.nice=function(T){var O=m();return(!T||typeof T.range!="function")&&(T=t(O[0],O[O.length-1],T??10)),T?m(wM(O,T)):u},u.copy=function(){return Th(u,nx(e,t,n,r,i,o,s,l,c,h))},u}function pX(){return Wr.apply(nx(cK,uK,fo,tx,Yp,Eh,J0,K0,Js,RM).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function mX(){return Wr.apply(nx(aK,lK,po,ex,Kp,Zp,Q0,X0,Js,LM).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Xp(){var e=0,t=1,n,r,i,o,s=Zn,l=!1,c;function h(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(o(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}h.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(f){return arguments.length?(l=!!f,h):l},h.interpolator=function(f){return arguments.length?(s=f,h):s};function u(f){return function(m){var y,x;return arguments.length?([y,x]=m,s=f(y,x),h):[s(0),s(1)]}}return h.range=u(pc),h.rangeRound=u(F0),h.unknown=function(f){return arguments.length?(c=f,h):c},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),h}}function ls(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function NM(){var e=as(Xp()(Zn));return e.copy=function(){return ls(e,NM())},vo.apply(e,arguments)}function jM(){var e=H0(Xp()).domain([1,10]);return e.copy=function(){return ls(e,jM()).base(e.base())},vo.apply(e,arguments)}function DM(){var e=q0(Xp());return e.copy=function(){return ls(e,DM()).constant(e.constant())},vo.apply(e,arguments)}function rx(){var e=G0(Xp());return e.copy=function(){return ls(e,rx()).exponent(e.exponent())},vo.apply(e,arguments)}function gX(){return rx.apply(null,arguments).exponent(.5)}function BM(){var e=[],t=Zn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ph(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Yo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>nY(e,o/r))},n.copy=function(){return BM(t).domain(e)},vo.apply(n,arguments)}function Jp(){var e=0,t=.5,n=1,r=1,i,o,s,l,c,h=Zn,u,f=!1,m;function y(p){return isNaN(p=+p)?m:(p=.5+((p=+u(p))-o)*(r*p<r*o?l:c),h(f?Math.max(0,Math.min(1,p)):p))}y.domain=function(p){return arguments.length?([e,t,n]=p,i=u(e=+e),o=u(t=+t),s=u(n=+n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y):[e,t,n]},y.clamp=function(p){return arguments.length?(f=!!p,y):f},y.interpolator=function(p){return arguments.length?(h=p,y):h};function x(p){return function(b){var P,S,A;return arguments.length?([P,S,A]=b,h=CY(p,[P,S,A]),y):[h(0),h(.5),h(1)]}}return y.range=x(pc),y.rangeRound=x(F0),y.unknown=function(p){return arguments.length?(m=p,y):m},function(p){return u=p,i=p(e),o=p(t),s=p(n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y}}function zM(){var e=as(Jp()(Zn));return e.copy=function(){return ls(e,zM())},vo.apply(e,arguments)}function FM(){var e=H0(Jp()).domain([.1,1,10]);return e.copy=function(){return ls(e,FM()).base(e.base())},vo.apply(e,arguments)}function WM(){var e=q0(Jp());return e.copy=function(){return ls(e,WM()).constant(e.constant())},vo.apply(e,arguments)}function ix(){var e=G0(Jp());return e.copy=function(){return ls(e,ix()).exponent(e.exponent())},vo.apply(e,arguments)}function yX(){return ix.apply(null,arguments).exponent(.5)}const oP=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Fu,scaleDiverging:zM,scaleDivergingLog:FM,scaleDivergingPow:ix,scaleDivergingSqrt:yX,scaleDivergingSymlog:WM,scaleIdentity:xM,scaleImplicit:rv,scaleLinear:Td,scaleLog:_M,scaleOrdinal:D0,scalePoint:mu,scalePow:Z0,scaleQuantile:AM,scaleQuantize:TM,scaleRadial:PM,scaleSequential:NM,scaleSequentialLog:jM,scaleSequentialPow:rx,scaleSequentialQuantile:BM,scaleSequentialSqrt:gX,scaleSequentialSymlog:DM,scaleSqrt:XY,scaleSymlog:SM,scaleThreshold:EM,scaleTime:pX,scaleUtc:mX,tickFormat:bM},Symbol.toStringTag,{value:"Module"}));var vX=oc;function bX(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(l===void 0?s===s&&!vX(s):n(s,l)))var l=s,c=o}return c}var Qp=bX;function xX(e,t){return e>t}var VM=xX,wX=Qp,_X=VM,SX=dc;function PX(e){return e&&e.length?wX(e,SX,_X):void 0}var AX=PX;const Ho=$e(AX);function TX(e,t){return e<t}var UM=TX,EX=Qp,CX=UM,OX=dc;function MX(e){return e&&e.length?EX(e,OX,CX):void 0}var kX=MX;const tm=$e(kX);var $X=w0,IX=Ai,RX=QO,LX=cr;function NX(e,t){var n=LX(e)?$X:RX;return n(e,IX(t))}var jX=NX,DX=XO,BX=jX;function zX(e,t){return DX(BX(e,t),1)}var FX=zX;const WX=$e(FX);var VX=I0;function UX(e,t){return VX(e,t)}var HX=UX;const pa=$e(HX);var mc=1e9,qX={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},sx,Ye=!0,Fr="[DecimalError] ",oa=Fr+"Invalid argument: ",ox=Fr+"Exponent out of range: ",gc=Math.floor,qs=Math.pow,GX=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_r,Pn=1e7,Ue=7,HM=9007199254740991,Md=gc(HM/Ue),$t={};$t.absoluteValue=$t.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};$t.comparedTo=$t.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};$t.decimalPlaces=$t.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ue;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};$t.dividedBy=$t.div=function(e){return ao(this,new this.constructor(e))};$t.dividedToIntegerBy=$t.idiv=function(e){var t=this,n=t.constructor;return Le(ao(t,new n(e),0,1),n.precision)};$t.equals=$t.eq=function(e){return!this.cmp(e)};$t.exponent=function(){return mn(this)};$t.greaterThan=$t.gt=function(e){return this.cmp(e)>0};$t.greaterThanOrEqualTo=$t.gte=function(e){return this.cmp(e)>=0};$t.isInteger=$t.isint=function(){return this.e>this.d.length-2};$t.isNegative=$t.isneg=function(){return this.s<0};$t.isPositive=$t.ispos=function(){return this.s>0};$t.isZero=function(){return this.s===0};$t.lessThan=$t.lt=function(e){return this.cmp(e)<0};$t.lessThanOrEqualTo=$t.lte=function(e){return this.cmp(e)<1};$t.logarithm=$t.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(_r))throw Error(Fr+"NaN");if(n.s<1)throw Error(Fr+(n.s?"NaN":"-Infinity"));return n.eq(_r)?new r(0):(Ye=!1,t=ao(qu(n,o),qu(e,o),o),Ye=!0,Le(t,i))};$t.minus=$t.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ZM(t,e):qM(t,(e.s=-e.s,e))};$t.modulo=$t.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Fr+"NaN");return n.s?(Ye=!1,t=ao(n,e,0,1).times(e),Ye=!0,n.minus(t)):Le(new r(n),i)};$t.naturalExponential=$t.exp=function(){return GM(this)};$t.naturalLogarithm=$t.ln=function(){return qu(this)};$t.negated=$t.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};$t.plus=$t.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qM(t,e):ZM(t,(e.s=-e.s,e))};$t.precision=$t.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(oa+e);if(t=mn(i)+1,r=i.d.length-1,n=r*Ue+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};$t.squareRoot=$t.sqrt=function(){var e,t,n,r,i,o,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Fr+"NaN")}for(e=mn(l),Ye=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=mi(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=gc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(o=r,r=o.plus(ao(l,o,s+2)).times(.5),mi(o.d).slice(0,s)===(t=mi(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Le(o,n+1,0),o.times(o).eq(l)){r=o;break}}else if(t!="9999")break;s+=4}return Ye=!0,Le(r,n)};$t.times=$t.mul=function(e){var t,n,r,i,o,s,l,c,h,u=this,f=u.constructor,m=u.d,y=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,c=m.length,h=y.length,c<h&&(o=m,m=y,y=o,s=c,c=h,h=s),o=[],s=c+h,r=s;r--;)o.push(0);for(r=h;--r>=0;){for(t=0,i=c+r;i>r;)l=o[i]+y[r]*m[i-r-1]+t,o[i--]=l%Pn|0,t=l/Pn|0;o[i]=(o[i]+t)%Pn|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Ye?Le(e,f.precision):e};$t.toDecimalPlaces=$t.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Si(e,0,mc),t===void 0?t=r.rounding:Si(t,0,8),Le(n,e+mn(n)+1,t))};$t.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ma(r,!0):(Si(e,0,mc),t===void 0?t=i.rounding:Si(t,0,8),r=Le(new i(r),e+1,t),n=ma(r,!0,e+1)),n};$t.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?ma(i):(Si(e,0,mc),t===void 0?t=o.rounding:Si(t,0,8),r=Le(new o(i),e+mn(i)+1,t),n=ma(r.abs(),!1,e+mn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};$t.toInteger=$t.toint=function(){var e=this,t=e.constructor;return Le(new t(e),mn(e)+1,t.rounding)};$t.toNumber=function(){return+this};$t.toPower=$t.pow=function(e){var t,n,r,i,o,s,l=this,c=l.constructor,h=12,u=+(e=new c(e));if(!e.s)return new c(_r);if(l=new c(l),!l.s){if(e.s<1)throw Error(Fr+"Infinity");return l}if(l.eq(_r))return l;if(r=c.precision,e.eq(_r))return Le(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=l.s,s){if((n=u<0?-u:u)<=HM){for(i=new c(_r),t=Math.ceil(r/Ue+4),Ye=!1;n%2&&(i=i.times(l),aP(i.d,t)),n=gc(n/2),n!==0;)l=l.times(l),aP(l.d,t);return Ye=!0,e.s<0?new c(_r).div(i):Le(i,r)}}else if(o<0)throw Error(Fr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Ye=!1,i=e.times(qu(l,r+h)),Ye=!0,i=GM(i),i.s=o,i};$t.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=mn(i),r=ma(i,n<=o.toExpNeg||n>=o.toExpPos)):(Si(e,1,mc),t===void 0?t=o.rounding:Si(t,0,8),i=Le(new o(i),e,t),n=mn(i),r=ma(i,e<=n||n<=o.toExpNeg,e)),r};$t.toSignificantDigits=$t.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Si(e,1,mc),t===void 0?t=r.rounding:Si(t,0,8)),Le(new r(n),e,t)};$t.toString=$t.valueOf=$t.val=$t.toJSON=$t[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return ma(e,t<=n.toExpNeg||t>=n.toExpPos)};function qM(e,t){var n,r,i,o,s,l,c,h,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Ye?Le(t,f):t;if(c=e.d,h=t.d,s=e.e,i=t.e,c=c.slice(),o=s-i,o){for(o<0?(r=c,o=-o,l=h.length):(r=h,i=s,l=c.length),s=Math.ceil(f/Ue),l=s>l?s+1:l+1,o>l&&(o=l,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(l=c.length,o=h.length,l-o<0&&(o=l,r=h,h=c,c=r),n=0;o;)n=(c[--o]=c[o]+h[o]+n)/Pn|0,c[o]%=Pn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Ye?Le(t,f):t}function Si(e,t,n){if(e!==~~e||e<t||e>n)throw Error(oa+e)}function mi(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",n=Ue-r.length,n&&(o+=zo(n)),o+=r;s=e[t],r=s+"",n=Ue-r.length,n&&(o+=zo(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}var ao=function(){function e(r,i){var o,s=0,l=r.length;for(r=r.slice();l--;)o=r[l]*i+s,r[l]=o%Pn|0,s=o/Pn|0;return s&&r.unshift(s),r}function t(r,i,o,s){var l,c;if(o!=s)c=o>s?1:-1;else for(l=c=0;l<o;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]<i[o]?1:0,r[o]=s*Pn+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s){var l,c,h,u,f,m,y,x,p,b,P,S,A,E,w,T,O,I,N=r.constructor,F=r.s==i.s?1:-1,D=r.d,j=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(Fr+"Division by zero");for(c=r.e-i.e,O=j.length,w=D.length,y=new N(F),x=y.d=[],h=0;j[h]==(D[h]||0);)++h;if(j[h]>(D[h]||0)&&--c,o==null?S=o=N.precision:s?S=o+(mn(r)-mn(i))+1:S=o,S<0)return new N(0);if(S=S/Ue+2|0,h=0,O==1)for(u=0,j=j[0],S++;(h<w||u)&&S--;h++)A=u*Pn+(D[h]||0),x[h]=A/j|0,u=A%j|0;else{for(u=Pn/(j[0]+1)|0,u>1&&(j=e(j,u),D=e(D,u),O=j.length,w=D.length),E=O,p=D.slice(0,O),b=p.length;b<O;)p[b++]=0;I=j.slice(),I.unshift(0),T=j[0],j[1]>=Pn/2&&++T;do u=0,l=t(j,p,O,b),l<0?(P=p[0],O!=b&&(P=P*Pn+(p[1]||0)),u=P/T|0,u>1?(u>=Pn&&(u=Pn-1),f=e(j,u),m=f.length,b=p.length,l=t(f,p,m,b),l==1&&(u--,n(f,O<m?I:j,m))):(u==0&&(l=u=1),f=j.slice()),m=f.length,m<b&&f.unshift(0),n(p,f,b),l==-1&&(b=p.length,l=t(j,p,O,b),l<1&&(u++,n(p,O<b?I:j,b))),b=p.length):l===0&&(u++,p=[0]),x[h++]=u,l&&p[0]?p[b++]=D[E]||0:(p=[D[E]],b=1);while((E++<w||p[0]!==void 0)&&S--)}return x[0]||x.shift(),y.e=c,Le(y,s?o+mn(y)+1:o)}}();function GM(e,t){var n,r,i,o,s,l,c=0,h=0,u=e.constructor,f=u.precision;if(mn(e)>16)throw Error(ox+mn(e));if(!e.s)return new u(_r);for(Ye=!1,l=f,s=new u(.03125);e.abs().gte(.1);)e=e.times(s),h+=5;for(r=Math.log(qs(2,h))/Math.LN10*2+5|0,l+=r,n=i=o=new u(_r),u.precision=l;;){if(i=Le(i.times(e),l),n=n.times(++c),s=o.plus(ao(i,n,l)),mi(s.d).slice(0,l)===mi(o.d).slice(0,l)){for(;h--;)o=Le(o.times(o),l);return u.precision=f,t==null?(Ye=!0,Le(o,f)):o}o=s}}function mn(e){for(var t=e.e*Ue,n=e.d[0];n>=10;n/=10)t++;return t}function Eg(e,t,n){if(t>e.LN10.sd())throw Ye=!0,n&&(e.precision=n),Error(Fr+"LN10 precision limit exceeded");return Le(new e(e.LN10),t)}function zo(e){for(var t="";e--;)t+="0";return t}function qu(e,t){var n,r,i,o,s,l,c,h,u,f=1,m=10,y=e,x=y.d,p=y.constructor,b=p.precision;if(y.s<1)throw Error(Fr+(y.s?"NaN":"-Infinity"));if(y.eq(_r))return new p(0);if(t==null?(Ye=!1,h=b):h=t,y.eq(10))return t==null&&(Ye=!0),Eg(p,h);if(h+=m,p.precision=h,n=mi(x),r=n.charAt(0),o=mn(y),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=mi(y.d),r=n.charAt(0),f++;o=mn(y),r>1?(y=new p("0."+n),o++):y=new p(r+"."+n.slice(1))}else return c=Eg(p,h+2,b).times(o+""),y=qu(new p(r+"."+n.slice(1)),h-m).plus(c),p.precision=b,t==null?(Ye=!0,Le(y,b)):y;for(l=s=y=ao(y.minus(_r),y.plus(_r),h),u=Le(y.times(y),h),i=3;;){if(s=Le(s.times(u),h),c=l.plus(ao(s,new p(i),h)),mi(c.d).slice(0,h)===mi(l.d).slice(0,h))return l=l.times(2),o!==0&&(l=l.plus(Eg(p,h+2,b).times(o+""))),l=ao(l,new p(f),h),p.precision=b,t==null?(Ye=!0,Le(l,b)):l;l=c,i+=2}}function sP(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=gc(n/Ue),e.d=[],r=(n+1)%Ue,n<0&&(r+=Ue),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Ue;r<i;)e.d.push(+t.slice(r,r+=Ue));t=t.slice(r),r=Ue-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Ye&&(e.e>Md||e.e<-Md))throw Error(ox+n)}else e.s=0,e.e=0,e.d=[0];return e}function Le(e,t,n){var r,i,o,s,l,c,h,u,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=Ue,i=t,h=f[u=0];else{if(u=Math.ceil((r+1)/Ue),o=f.length,u>=o)return e;for(h=o=f[u],s=1;o>=10;o/=10)s++;r%=Ue,i=r-Ue+s}if(n!==void 0&&(o=qs(10,s-i-1),l=h/o%10|0,c=t<0||f[u+1]!==void 0||h%o,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?h/qs(10,s-i):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(o=mn(e),f.length=1,t=t-o-1,f[0]=qs(10,(Ue-t%Ue)%Ue),e.e=gc(-t/Ue)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=qs(10,Ue-r),f[u]=i>0?(h/qs(10,s-i)%qs(10,i)|0)*o:0),c)for(;;)if(u==0){(f[0]+=o)==Pn&&(f[0]=1,++e.e);break}else{if(f[u]+=o,f[u]!=Pn)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(Ye&&(e.e>Md||e.e<-Md))throw Error(ox+mn(e));return e}function ZM(e,t){var n,r,i,o,s,l,c,h,u,f,m=e.constructor,y=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Ye?Le(t,y):t;if(c=e.d,f=t.d,r=t.e,h=e.e,c=c.slice(),s=h-r,s){for(u=s<0,u?(n=c,s=-s,l=f.length):(n=f,r=h,l=c.length),i=Math.max(Math.ceil(y/Ue),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,u=i<l,u&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){u=c[i]<f[i];break}s=0}for(u&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(o=i;o&&c[--o]===0;)c[o]=Pn-1;--c[o],c[i]+=Pn}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Ye?Le(t,y):t):new m(0)}function ma(e,t,n){var r,i=mn(e),o=mi(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+zo(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+zo(-i-1)+o,n&&(r=n-s)>0&&(o+=zo(r))):i>=s?(o+=zo(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+zo(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=zo(r))),e.s<0?"-"+o:o}function aP(e,t){if(e.length>t)return e.length=t,!0}function YM(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(oa+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return sP(s,o.toString())}else if(typeof o!="string")throw Error(oa+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,GX.test(o))sP(s,o);else throw Error(oa+o)}if(i.prototype=$t,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=YM,i.config=i.set=ZX,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function ZX(e){if(!e||typeof e!="object")throw Error(Fr+"Object expected");var t,n,r,i=["precision",1,mc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(gc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(oa+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(oa+n+": "+r);return this}var sx=YM(qX);_r=new sx(1);const ke=sx;function YX(e){return QX(e)||JX(e)||XX(e)||KX()}function KX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
46
46
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XX(e,t){if(e){if(typeof e=="string")return av(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return av(e,t)}}function JX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function QX(e){if(Array.isArray(e))return av(e)}function av(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tJ=function(t){return t},KM={},XM=function(t){return t===KM},lP=function(t){return function n(){return arguments.length===0||arguments.length===1&&XM(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},eJ=function e(t,n){return t===1?n:lP(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=i.filter(function(l){return l!==KM}).length;return s>=t?n.apply(void 0,i):e(t-s,lP(function(){for(var l=arguments.length,c=new Array(l),h=0;h<l;h++)c[h]=arguments[h];var u=i.map(function(f){return XM(f)?c.shift():f});return n.apply(void 0,YX(u).concat(c))}))})},em=function(t){return eJ(t.length,t)},lv=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},nJ=em(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),rJ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return tJ;var i=n.reverse(),o=i[0],s=i.slice(1);return function(){return s.reduce(function(l,c){return c(l)},o.apply(void 0,arguments))}},cv=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},JM=function(t){var n=null,r=null;return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n&&o.every(function(l,c){return l===n[c]})||(n=o,r=t.apply(void 0,o)),r}};function iJ(e){var t;return e===0?t=1:t=Math.floor(new ke(e).abs().log(10).toNumber())+1,t}function oJ(e,t,n){for(var r=new ke(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var sJ=em(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),aJ=em(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),lJ=em(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const nm={rangeStep:oJ,getDigitCount:iJ,interpolateNumber:sJ,uninterpolateNumber:aJ,uninterpolateTruncation:lJ};function uv(e){return hJ(e)||uJ(e)||QM(e)||cJ()}function cJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function hJ(e){if(Array.isArray(e))return hv(e)}function Gu(e,t){return pJ(e)||dJ(e,t)||QM(e,t)||fJ()}function fJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QM(e,t){if(e){if(typeof e=="string")return hv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hv(e,t)}}function hv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dJ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),l;!(r=(l=s.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){i=!0,o=c}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function pJ(e){if(Array.isArray(e))return e}function tk(e){var t=Gu(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function ek(e,t,n){if(e.lte(0))return new ke(0);var r=nm.getDigitCount(e.toNumber()),i=new ke(10).pow(r),o=e.div(i),s=r!==1?.05:.1,l=new ke(Math.ceil(o.div(s).toNumber())).add(n).mul(s),c=l.mul(i);return t?c:new ke(Math.ceil(c))}function mJ(e,t,n){var r=1,i=new ke(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new ke(10).pow(nm.getDigitCount(e)-1),i=new ke(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new ke(Math.floor(e)))}else e===0?i=new ke(Math.floor((t-1)/2)):n||(i=new ke(Math.floor(e)));var s=Math.floor((t-1)/2),l=rJ(nJ(function(c){return i.add(new ke(c-s).mul(r)).toNumber()}),lv);return l(0,t)}function nk(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new ke(0),tickMin:new ke(0),tickMax:new ke(0)};var o=ek(new ke(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new ke(0):(s=new ke(e).add(t).div(2),s=s.sub(new ke(s).mod(o)));var l=Math.ceil(s.sub(e).div(o).toNumber()),c=Math.ceil(new ke(t).sub(s).div(o).toNumber()),h=l+c+1;return h>n?nk(e,t,n,r,i+1):(h<n&&(c=t>0?c+(n-h):c,l=t>0?l:l+(n-h)),{step:o,tickMin:s.sub(new ke(l).mul(o)),tickMax:s.add(new ke(c).mul(o))})}function gJ(e){var t=Gu(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),l=tk([n,r]),c=Gu(l,2),h=c[0],u=c[1];if(h===-1/0||u===1/0){var f=u===1/0?[h].concat(uv(lv(0,i-1).map(function(){return 1/0}))):[].concat(uv(lv(0,i-1).map(function(){return-1/0})),[u]);return n>r?cv(f):f}if(h===u)return mJ(h,i,o);var m=nk(h,u,s,o),y=m.step,x=m.tickMin,p=m.tickMax,b=nm.rangeStep(x,p.add(new ke(.1).mul(y)),y);return n>r?cv(b):b}function yJ(e,t){var n=Gu(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=tk([r,i]),l=Gu(s,2),c=l[0],h=l[1];if(c===-1/0||h===1/0)return[r,i];if(c===h)return[c];var u=Math.max(t,2),f=ek(new ke(h).sub(c).div(u-1),o,0),m=[].concat(uv(nm.rangeStep(new ke(c),new ke(h).sub(new ke(.99).mul(f)),f)),[h]);return r>i?cv(m):m}var vJ=JM(gJ),bJ=JM(yJ),xJ=process.env.NODE_ENV==="production",Cg="Invariant failed";function ir(e,t){if(xJ)throw new Error(Cg);var n=typeof t=="function"?t():t,r=n?"".concat(Cg,": ").concat(n):Cg;throw new Error(r)}var wJ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function kl(e){"@babel/helpers - typeof";return kl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kl(e)}function kd(){return kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kd.apply(this,arguments)}function _J(e,t){return TJ(e)||AJ(e,t)||PJ(e,t)||SJ()}function SJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -83,12 +83,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
83
83
  *
84
84
  * This source code is licensed under the MIT license found in the
85
85
  * LICENSE file in the root directory of this source tree.
86
- */var kP;function mtt(){return kP||(kP=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,P=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function A(nt){return typeof nt=="string"||typeof nt=="function"||nt===r||nt===h||nt===o||nt===i||nt===f||nt===m||typeof nt=="object"&&nt!==null&&(nt.$$typeof===x||nt.$$typeof===y||nt.$$typeof===s||nt.$$typeof===l||nt.$$typeof===u||nt.$$typeof===b||nt.$$typeof===P||nt.$$typeof===S||nt.$$typeof===p)}function E(nt){if(typeof nt=="object"&&nt!==null){var Lt=nt.$$typeof;switch(Lt){case t:var bt=nt.type;switch(bt){case c:case h:case r:case o:case i:case f:return bt;default:var me=bt&&bt.$$typeof;switch(me){case l:case u:case x:case y:case s:return me;default:return Lt}}case n:return Lt}}}var w=c,T=h,O=l,I=s,N=t,F=u,D=r,j=x,K=y,U=n,z=o,Y=i,G=f,X=!1;function lt(nt){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(nt)||E(nt)===c}function H(nt){return E(nt)===h}function et(nt){return E(nt)===l}function it(nt){return E(nt)===s}function st(nt){return typeof nt=="object"&&nt!==null&&nt.$$typeof===t}function ct(nt){return E(nt)===u}function yt(nt){return E(nt)===r}function vt(nt){return E(nt)===x}function Et(nt){return E(nt)===y}function Tt(nt){return E(nt)===n}function ft(nt){return E(nt)===o}function dt(nt){return E(nt)===i}function Ct(nt){return E(nt)===f}Pe.AsyncMode=w,Pe.ConcurrentMode=T,Pe.ContextConsumer=O,Pe.ContextProvider=I,Pe.Element=N,Pe.ForwardRef=F,Pe.Fragment=D,Pe.Lazy=j,Pe.Memo=K,Pe.Portal=U,Pe.Profiler=z,Pe.StrictMode=Y,Pe.Suspense=G,Pe.isAsyncMode=lt,Pe.isConcurrentMode=H,Pe.isContextConsumer=et,Pe.isContextProvider=it,Pe.isElement=st,Pe.isForwardRef=ct,Pe.isFragment=yt,Pe.isLazy=vt,Pe.isMemo=Et,Pe.isPortal=Tt,Pe.isProfiler=ft,Pe.isStrictMode=dt,Pe.isSuspense=Ct,Pe.isValidElementType=A,Pe.typeOf=E}()),Pe}var $P;function _k(){return $P||($P=1,process.env.NODE_ENV==="production"?Mf.exports=ptt():Mf.exports=mtt()),Mf.exports}/*
86
+ */var kP;function mtt(){return kP||(kP=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,P=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function A(nt){return typeof nt=="string"||typeof nt=="function"||nt===r||nt===h||nt===o||nt===i||nt===f||nt===m||typeof nt=="object"&&nt!==null&&(nt.$$typeof===x||nt.$$typeof===y||nt.$$typeof===s||nt.$$typeof===l||nt.$$typeof===u||nt.$$typeof===b||nt.$$typeof===P||nt.$$typeof===S||nt.$$typeof===p)}function E(nt){if(typeof nt=="object"&&nt!==null){var Lt=nt.$$typeof;switch(Lt){case t:var bt=nt.type;switch(bt){case c:case h:case r:case o:case i:case f:return bt;default:var me=bt&&bt.$$typeof;switch(me){case l:case u:case x:case y:case s:return me;default:return Lt}}case n:return Lt}}}var w=c,T=h,O=l,I=s,N=t,F=u,D=r,j=x,K=y,U=n,z=o,Y=i,G=f,X=!1;function lt(nt){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(nt)||E(nt)===c}function H(nt){return E(nt)===h}function et(nt){return E(nt)===l}function it(nt){return E(nt)===s}function at(nt){return typeof nt=="object"&&nt!==null&&nt.$$typeof===t}function ct(nt){return E(nt)===u}function yt(nt){return E(nt)===r}function vt(nt){return E(nt)===x}function Et(nt){return E(nt)===y}function Tt(nt){return E(nt)===n}function ft(nt){return E(nt)===o}function dt(nt){return E(nt)===i}function Ct(nt){return E(nt)===f}Pe.AsyncMode=w,Pe.ConcurrentMode=T,Pe.ContextConsumer=O,Pe.ContextProvider=I,Pe.Element=N,Pe.ForwardRef=F,Pe.Fragment=D,Pe.Lazy=j,Pe.Memo=K,Pe.Portal=U,Pe.Profiler=z,Pe.StrictMode=Y,Pe.Suspense=G,Pe.isAsyncMode=lt,Pe.isConcurrentMode=H,Pe.isContextConsumer=et,Pe.isContextProvider=it,Pe.isElement=at,Pe.isForwardRef=ct,Pe.isFragment=yt,Pe.isLazy=vt,Pe.isMemo=Et,Pe.isPortal=Tt,Pe.isProfiler=ft,Pe.isStrictMode=dt,Pe.isSuspense=Ct,Pe.isValidElementType=A,Pe.typeOf=E}()),Pe}var $P;function _k(){return $P||($P=1,process.env.NODE_ENV==="production"?Mf.exports=ptt():Mf.exports=mtt()),Mf.exports}/*
87
87
  object-assign
88
88
  (c) Sindre Sorhus
89
89
  @license MIT
90
- */var Mg,IP;function gtt(){if(IP)return Mg;IP=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(c.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(u){h[u]=u}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Mg=i()?Object.assign:function(o,s){for(var l,c=r(o),h,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(c[f]=l[f]);if(e){h=e(l);for(var m=0;m<h.length;m++)n.call(l,h[m])&&(c[h[m]]=l[h[m]])}}return c},Mg}var kg,RP;function lx(){if(RP)return kg;RP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return kg=e,kg}var $g,LP;function Sk(){return LP||(LP=1,$g=Function.call.bind(Object.prototype.hasOwnProperty)),$g}var Ig,NP;function ytt(){if(NP)return Ig;NP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=lx(),n={},r=Sk();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,l,c,h){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var f;try{if(typeof o[u]!="function"){var m=Error((c||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}f=o[u](s,u,c,l,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var y=h?h():"";e("Failed "+l+" type: "+f.message+(y??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ig=i,Ig}var Rg,jP;function vtt(){if(jP)return Rg;jP=1;var e=_k(),t=gtt(),n=lx(),r=Sk(),i=ytt(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function s(){return null}return Rg=function(l,c){var h=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(H){var et=H&&(h&&H[h]||H[u]);if(typeof et=="function")return et}var m="<<anonymous>>",y={array:P("array"),bigint:P("bigint"),bool:P("boolean"),func:P("function"),number:P("number"),object:P("object"),string:P("string"),symbol:P("symbol"),any:S(),arrayOf:A,element:E(),elementType:w(),instanceOf:T,node:F(),objectOf:I,oneOf:O,oneOfType:N,shape:j,exact:K};function x(H,et){return H===et?H!==0||1/H===1/et:H!==H&&et!==et}function p(H,et){this.message=H,this.data=et&&typeof et=="object"?et:{},this.stack=""}p.prototype=Error.prototype;function b(H){if(process.env.NODE_ENV!=="production")var et={},it=0;function st(yt,vt,Et,Tt,ft,dt,Ct){if(Tt=Tt||m,dt=dt||Et,Ct!==n){if(c){var nt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw nt.name="Invariant Violation",nt}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Lt=Tt+":"+Et;!et[Lt]&&it<3&&(o("You are manually calling a React.PropTypes validation function for the `"+dt+"` prop on `"+Tt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),et[Lt]=!0,it++)}}return vt[Et]==null?yt?vt[Et]===null?new p("The "+ft+" `"+dt+"` is marked as required "+("in `"+Tt+"`, but its value is `null`.")):new p("The "+ft+" `"+dt+"` is marked as required in "+("`"+Tt+"`, but its value is `undefined`.")):null:H(vt,Et,Tt,ft,dt)}var ct=st.bind(null,!1);return ct.isRequired=st.bind(null,!0),ct}function P(H){function et(it,st,ct,yt,vt,Et){var Tt=it[st],ft=Y(Tt);if(ft!==H){var dt=G(Tt);return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+dt+"` supplied to `"+ct+"`, expected ")+("`"+H+"`."),{expectedType:H})}return null}return b(et)}function S(){return b(s)}function A(H){function et(it,st,ct,yt,vt){if(typeof H!="function")return new p("Property `"+vt+"` of component `"+ct+"` has invalid PropType notation inside arrayOf.");var Et=it[st];if(!Array.isArray(Et)){var Tt=Y(Et);return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an array."))}for(var ft=0;ft<Et.length;ft++){var dt=H(Et,ft,ct,yt,vt+"["+ft+"]",n);if(dt instanceof Error)return dt}return null}return b(et)}function E(){function H(et,it,st,ct,yt){var vt=et[it];if(!l(vt)){var Et=Y(vt);return new p("Invalid "+ct+" `"+yt+"` of type "+("`"+Et+"` supplied to `"+st+"`, expected a single ReactElement."))}return null}return b(H)}function w(){function H(et,it,st,ct,yt){var vt=et[it];if(!e.isValidElementType(vt)){var Et=Y(vt);return new p("Invalid "+ct+" `"+yt+"` of type "+("`"+Et+"` supplied to `"+st+"`, expected a single ReactElement type."))}return null}return b(H)}function T(H){function et(it,st,ct,yt,vt){if(!(it[st]instanceof H)){var Et=H.name||m,Tt=lt(it[st]);return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected ")+("instance of `"+Et+"`."))}return null}return b(et)}function O(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function et(it,st,ct,yt,vt){for(var Et=it[st],Tt=0;Tt<H.length;Tt++)if(x(Et,H[Tt]))return null;var ft=JSON.stringify(H,function(Ct,nt){var Lt=G(nt);return Lt==="symbol"?String(nt):nt});return new p("Invalid "+yt+" `"+vt+"` of value `"+String(Et)+"` "+("supplied to `"+ct+"`, expected one of "+ft+"."))}return b(et)}function I(H){function et(it,st,ct,yt,vt){if(typeof H!="function")return new p("Property `"+vt+"` of component `"+ct+"` has invalid PropType notation inside objectOf.");var Et=it[st],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an object."));for(var ft in Et)if(r(Et,ft)){var dt=H(Et,ft,ct,yt,vt+"."+ft,n);if(dt instanceof Error)return dt}return null}return b(et)}function N(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var et=0;et<H.length;et++){var it=H[et];if(typeof it!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(it)+" at index "+et+"."),s}function st(ct,yt,vt,Et,Tt){for(var ft=[],dt=0;dt<H.length;dt++){var Ct=H[dt],nt=Ct(ct,yt,vt,Et,Tt,n);if(nt==null)return null;nt.data&&r(nt.data,"expectedType")&&ft.push(nt.data.expectedType)}var Lt=ft.length>0?", expected one of type ["+ft.join(", ")+"]":"";return new p("Invalid "+Et+" `"+Tt+"` supplied to "+("`"+vt+"`"+Lt+"."))}return b(st)}function F(){function H(et,it,st,ct,yt){return U(et[it])?null:new p("Invalid "+ct+" `"+yt+"` supplied to "+("`"+st+"`, expected a ReactNode."))}return b(H)}function D(H,et,it,st,ct){return new p((H||"React class")+": "+et+" type `"+it+"."+st+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ct+"`.")}function j(H){function et(it,st,ct,yt,vt){var Et=it[st],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+yt+" `"+vt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));for(var ft in H){var dt=H[ft];if(typeof dt!="function")return D(ct,yt,vt,ft,G(dt));var Ct=dt(Et,ft,ct,yt,vt+"."+ft,n);if(Ct)return Ct}return null}return b(et)}function K(H){function et(it,st,ct,yt,vt){var Et=it[st],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+yt+" `"+vt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));var ft=t({},it[st],H);for(var dt in ft){var Ct=H[dt];if(r(H,dt)&&typeof Ct!="function")return D(ct,yt,vt,dt,G(Ct));if(!Ct)return new p("Invalid "+yt+" `"+vt+"` key `"+dt+"` supplied to `"+ct+"`.\nBad object: "+JSON.stringify(it[st],null," ")+`
91
- Valid keys: `+JSON.stringify(Object.keys(H),null," "));var nt=Ct(Et,dt,ct,yt,vt+"."+dt,n);if(nt)return nt}return null}return b(et)}function U(H){switch(typeof H){case"number":case"string":case"undefined":return!0;case"boolean":return!H;case"object":if(Array.isArray(H))return H.every(U);if(H===null||l(H))return!0;var et=f(H);if(et){var it=et.call(H),st;if(et!==H.entries){for(;!(st=it.next()).done;)if(!U(st.value))return!1}else for(;!(st=it.next()).done;){var ct=st.value;if(ct&&!U(ct[1]))return!1}}else return!1;return!0;default:return!1}}function z(H,et){return H==="symbol"?!0:et?et["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&et instanceof Symbol:!1}function Y(H){var et=typeof H;return Array.isArray(H)?"array":H instanceof RegExp?"object":z(et,H)?"symbol":et}function G(H){if(typeof H>"u"||H===null)return""+H;var et=Y(H);if(et==="object"){if(H instanceof Date)return"date";if(H instanceof RegExp)return"regexp"}return et}function X(H){var et=G(H);switch(et){case"array":case"object":return"an "+et;case"boolean":case"date":case"regexp":return"a "+et;default:return et}}function lt(H){return!H.constructor||!H.constructor.name?m:H.constructor.name}return y.checkPropTypes=i,y.resetWarningCache=i.resetWarningCache,y.PropTypes=y,y},Rg}var Lg,DP;function btt(){if(DP)return Lg;DP=1;var e=lx();function t(){}function n(){}return n.resetWarningCache=t,Lg=function(){function r(s,l,c,h,u,f){if(f!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Lg}if(process.env.NODE_ENV!=="production"){var xtt=_k(),wtt=!0;bv.exports=vtt()(xtt.isElement,wtt)}else bv.exports=btt()();var _tt=bv.exports;const Ae=$e(_tt),{getOwnPropertyNames:Stt,getOwnPropertySymbols:Ptt}=Object,{hasOwnProperty:Att}=Object.prototype;function Ng(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function kf(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),l=o.get(r);if(s&&l)return s===r&&l===n;o.set(n,r),o.set(r,n);const c=e(n,r,i);return o.delete(n),o.delete(r),c}}function Ttt(e){return e!=null?e[Symbol.toStringTag]:void 0}function BP(e){return Stt(e).concat(Ptt(e))}const Ett=Object.hasOwn||((e,t)=>Att.call(e,t));function Pa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ctt="__v",Ott="__o",Mtt="_owner",{getOwnPropertyDescriptor:zP,keys:FP}=Object;function ktt(e,t){return e.byteLength===t.byteLength&&jd(new Uint8Array(e),new Uint8Array(t))}function $tt(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Itt(e,t){return e.byteLength===t.byteLength&&jd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Rtt(e,t){return Pa(e.getTime(),t.getTime())}function Ltt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ntt(e,t){return e===t}function WP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,l,c=0;for(;(s=o.next())&&!s.done;){const h=t.entries();let u=!1,f=0;for(;(l=h.next())&&!l.done;){if(i[f]){f++;continue}const m=s.value,y=l.value;if(n.equals(m[0],y[0],c,f,e,t,n)&&n.equals(m[1],y[1],m[0],y[0],e,t,n)){u=i[f]=!0;break}f++}if(!u)return!1;c++}return!0}const jtt=Pa;function Dtt(e,t,n){const r=FP(e);let i=r.length;if(FP(t).length!==i)return!1;for(;i-- >0;)if(!Pk(e,t,n,r[i]))return!1;return!0}function Xc(e,t,n){const r=BP(e);let i=r.length;if(BP(t).length!==i)return!1;let o,s,l;for(;i-- >0;)if(o=r[i],!Pk(e,t,n,o)||(s=zP(e,o),l=zP(t,o),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function Btt(e,t){return Pa(e.valueOf(),t.valueOf())}function ztt(e,t){return e.source===t.source&&e.flags===t.flags}function VP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,l;for(;(s=o.next())&&!s.done;){const c=t.values();let h=!1,u=0;for(;(l=c.next())&&!l.done;){if(!i[u]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){h=i[u]=!0;break}u++}if(!h)return!1}return!0}function jd(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Ftt(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Pk(e,t,n,r){return(r===Mtt||r===Ott||r===Ctt)&&(e.$$typeof||t.$$typeof)?!0:Ett(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Wtt="[object ArrayBuffer]",Vtt="[object Arguments]",Utt="[object Boolean]",Htt="[object DataView]",qtt="[object Date]",Gtt="[object Error]",Ztt="[object Map]",Ytt="[object Number]",Ktt="[object Object]",Xtt="[object RegExp]",Jtt="[object Set]",Qtt="[object String]",tet={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},eet="[object URL]",net=Object.prototype.toString;function ret({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:h,areRegExpsEqual:u,areSetsEqual:f,areTypedArraysEqual:m,areUrlsEqual:y,unknownTagComparators:x}){return function(b,P,S){if(b===P)return!0;if(b==null||P==null)return!1;const A=typeof b;if(A!==typeof P)return!1;if(A!=="object")return A==="number"?l(b,P,S):A==="function"?o(b,P,S):!1;const E=b.constructor;if(E!==P.constructor)return!1;if(E===Object)return c(b,P,S);if(Array.isArray(b))return t(b,P,S);if(E===Date)return r(b,P,S);if(E===RegExp)return u(b,P,S);if(E===Map)return s(b,P,S);if(E===Set)return f(b,P,S);const w=net.call(b);if(w===qtt)return r(b,P,S);if(w===Xtt)return u(b,P,S);if(w===Ztt)return s(b,P,S);if(w===Jtt)return f(b,P,S);if(w===Ktt)return typeof b.then!="function"&&typeof P.then!="function"&&c(b,P,S);if(w===eet)return y(b,P,S);if(w===Gtt)return i(b,P,S);if(w===Vtt)return c(b,P,S);if(tet[w])return m(b,P,S);if(w===Wtt)return e(b,P,S);if(w===Htt)return n(b,P,S);if(w===Utt||w===Ytt||w===Qtt)return h(b,P,S);if(x){let T=x[w];if(!T){const O=Ttt(b);O&&(T=x[O])}if(T)return T(b,P,S)}return!1}}function iet({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ktt,areArraysEqual:n?Xc:$tt,areDataViewsEqual:Itt,areDatesEqual:Rtt,areErrorsEqual:Ltt,areFunctionsEqual:Ntt,areMapsEqual:n?Ng(WP,Xc):WP,areNumbersEqual:jtt,areObjectsEqual:n?Xc:Dtt,arePrimitiveWrappersEqual:Btt,areRegExpsEqual:ztt,areSetsEqual:n?Ng(VP,Xc):VP,areTypedArraysEqual:n?Ng(jd,Xc):jd,areUrlsEqual:Ftt,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=kf(r.areArraysEqual),o=kf(r.areMapsEqual),s=kf(r.areObjectsEqual),l=kf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return r}function oet(e){return function(t,n,r,i,o,s,l){return e(t,n,l)}}function set({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(l,c){const{cache:h=e?new WeakMap:void 0,meta:u}=n();return t(l,c,{cache:h,equals:r,meta:u,strict:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,o)}}const aet=cs();cs({strict:!0});cs({circular:!0});cs({circular:!0,strict:!0});cs({createInternalComparator:()=>Pa});cs({strict:!0,createInternalComparator:()=>Pa});cs({circular:!0,createInternalComparator:()=>Pa});cs({circular:!0,createInternalComparator:()=>Pa,strict:!0});function cs(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=iet(e),s=ret(o),l=n?n(s):oet(s);return set({circular:t,comparator:s,createState:r,equals:l,strict:i})}function cet(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function UP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):cet(i)};requestAnimationFrame(r)}function xv(e){"@babel/helpers - typeof";return xv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xv(e)}function uet(e){return pet(e)||det(e)||fet(e)||het()}function het(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
90
+ */var Mg,IP;function gtt(){if(IP)return Mg;IP=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(c.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(u){h[u]=u}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Mg=i()?Object.assign:function(o,s){for(var l,c=r(o),h,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(c[f]=l[f]);if(e){h=e(l);for(var m=0;m<h.length;m++)n.call(l,h[m])&&(c[h[m]]=l[h[m]])}}return c},Mg}var kg,RP;function lx(){if(RP)return kg;RP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return kg=e,kg}var $g,LP;function Sk(){return LP||(LP=1,$g=Function.call.bind(Object.prototype.hasOwnProperty)),$g}var Ig,NP;function ytt(){if(NP)return Ig;NP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=lx(),n={},r=Sk();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,l,c,h){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var f;try{if(typeof o[u]!="function"){var m=Error((c||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}f=o[u](s,u,c,l,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var y=h?h():"";e("Failed "+l+" type: "+f.message+(y??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ig=i,Ig}var Rg,jP;function vtt(){if(jP)return Rg;jP=1;var e=_k(),t=gtt(),n=lx(),r=Sk(),i=ytt(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function s(){return null}return Rg=function(l,c){var h=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(H){var et=H&&(h&&H[h]||H[u]);if(typeof et=="function")return et}var m="<<anonymous>>",y={array:P("array"),bigint:P("bigint"),bool:P("boolean"),func:P("function"),number:P("number"),object:P("object"),string:P("string"),symbol:P("symbol"),any:S(),arrayOf:A,element:E(),elementType:w(),instanceOf:T,node:F(),objectOf:I,oneOf:O,oneOfType:N,shape:j,exact:K};function x(H,et){return H===et?H!==0||1/H===1/et:H!==H&&et!==et}function p(H,et){this.message=H,this.data=et&&typeof et=="object"?et:{},this.stack=""}p.prototype=Error.prototype;function b(H){if(process.env.NODE_ENV!=="production")var et={},it=0;function at(yt,vt,Et,Tt,ft,dt,Ct){if(Tt=Tt||m,dt=dt||Et,Ct!==n){if(c){var nt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw nt.name="Invariant Violation",nt}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Lt=Tt+":"+Et;!et[Lt]&&it<3&&(o("You are manually calling a React.PropTypes validation function for the `"+dt+"` prop on `"+Tt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),et[Lt]=!0,it++)}}return vt[Et]==null?yt?vt[Et]===null?new p("The "+ft+" `"+dt+"` is marked as required "+("in `"+Tt+"`, but its value is `null`.")):new p("The "+ft+" `"+dt+"` is marked as required in "+("`"+Tt+"`, but its value is `undefined`.")):null:H(vt,Et,Tt,ft,dt)}var ct=at.bind(null,!1);return ct.isRequired=at.bind(null,!0),ct}function P(H){function et(it,at,ct,yt,vt,Et){var Tt=it[at],ft=Y(Tt);if(ft!==H){var dt=G(Tt);return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+dt+"` supplied to `"+ct+"`, expected ")+("`"+H+"`."),{expectedType:H})}return null}return b(et)}function S(){return b(s)}function A(H){function et(it,at,ct,yt,vt){if(typeof H!="function")return new p("Property `"+vt+"` of component `"+ct+"` has invalid PropType notation inside arrayOf.");var Et=it[at];if(!Array.isArray(Et)){var Tt=Y(Et);return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an array."))}for(var ft=0;ft<Et.length;ft++){var dt=H(Et,ft,ct,yt,vt+"["+ft+"]",n);if(dt instanceof Error)return dt}return null}return b(et)}function E(){function H(et,it,at,ct,yt){var vt=et[it];if(!l(vt)){var Et=Y(vt);return new p("Invalid "+ct+" `"+yt+"` of type "+("`"+Et+"` supplied to `"+at+"`, expected a single ReactElement."))}return null}return b(H)}function w(){function H(et,it,at,ct,yt){var vt=et[it];if(!e.isValidElementType(vt)){var Et=Y(vt);return new p("Invalid "+ct+" `"+yt+"` of type "+("`"+Et+"` supplied to `"+at+"`, expected a single ReactElement type."))}return null}return b(H)}function T(H){function et(it,at,ct,yt,vt){if(!(it[at]instanceof H)){var Et=H.name||m,Tt=lt(it[at]);return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected ")+("instance of `"+Et+"`."))}return null}return b(et)}function O(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function et(it,at,ct,yt,vt){for(var Et=it[at],Tt=0;Tt<H.length;Tt++)if(x(Et,H[Tt]))return null;var ft=JSON.stringify(H,function(Ct,nt){var Lt=G(nt);return Lt==="symbol"?String(nt):nt});return new p("Invalid "+yt+" `"+vt+"` of value `"+String(Et)+"` "+("supplied to `"+ct+"`, expected one of "+ft+"."))}return b(et)}function I(H){function et(it,at,ct,yt,vt){if(typeof H!="function")return new p("Property `"+vt+"` of component `"+ct+"` has invalid PropType notation inside objectOf.");var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+yt+" `"+vt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an object."));for(var ft in Et)if(r(Et,ft)){var dt=H(Et,ft,ct,yt,vt+"."+ft,n);if(dt instanceof Error)return dt}return null}return b(et)}function N(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var et=0;et<H.length;et++){var it=H[et];if(typeof it!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(it)+" at index "+et+"."),s}function at(ct,yt,vt,Et,Tt){for(var ft=[],dt=0;dt<H.length;dt++){var Ct=H[dt],nt=Ct(ct,yt,vt,Et,Tt,n);if(nt==null)return null;nt.data&&r(nt.data,"expectedType")&&ft.push(nt.data.expectedType)}var Lt=ft.length>0?", expected one of type ["+ft.join(", ")+"]":"";return new p("Invalid "+Et+" `"+Tt+"` supplied to "+("`"+vt+"`"+Lt+"."))}return b(at)}function F(){function H(et,it,at,ct,yt){return U(et[it])?null:new p("Invalid "+ct+" `"+yt+"` supplied to "+("`"+at+"`, expected a ReactNode."))}return b(H)}function D(H,et,it,at,ct){return new p((H||"React class")+": "+et+" type `"+it+"."+at+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ct+"`.")}function j(H){function et(it,at,ct,yt,vt){var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+yt+" `"+vt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));for(var ft in H){var dt=H[ft];if(typeof dt!="function")return D(ct,yt,vt,ft,G(dt));var Ct=dt(Et,ft,ct,yt,vt+"."+ft,n);if(Ct)return Ct}return null}return b(et)}function K(H){function et(it,at,ct,yt,vt){var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+yt+" `"+vt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));var ft=t({},it[at],H);for(var dt in ft){var Ct=H[dt];if(r(H,dt)&&typeof Ct!="function")return D(ct,yt,vt,dt,G(Ct));if(!Ct)return new p("Invalid "+yt+" `"+vt+"` key `"+dt+"` supplied to `"+ct+"`.\nBad object: "+JSON.stringify(it[at],null," ")+`
91
+ Valid keys: `+JSON.stringify(Object.keys(H),null," "));var nt=Ct(Et,dt,ct,yt,vt+"."+dt,n);if(nt)return nt}return null}return b(et)}function U(H){switch(typeof H){case"number":case"string":case"undefined":return!0;case"boolean":return!H;case"object":if(Array.isArray(H))return H.every(U);if(H===null||l(H))return!0;var et=f(H);if(et){var it=et.call(H),at;if(et!==H.entries){for(;!(at=it.next()).done;)if(!U(at.value))return!1}else for(;!(at=it.next()).done;){var ct=at.value;if(ct&&!U(ct[1]))return!1}}else return!1;return!0;default:return!1}}function z(H,et){return H==="symbol"?!0:et?et["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&et instanceof Symbol:!1}function Y(H){var et=typeof H;return Array.isArray(H)?"array":H instanceof RegExp?"object":z(et,H)?"symbol":et}function G(H){if(typeof H>"u"||H===null)return""+H;var et=Y(H);if(et==="object"){if(H instanceof Date)return"date";if(H instanceof RegExp)return"regexp"}return et}function X(H){var et=G(H);switch(et){case"array":case"object":return"an "+et;case"boolean":case"date":case"regexp":return"a "+et;default:return et}}function lt(H){return!H.constructor||!H.constructor.name?m:H.constructor.name}return y.checkPropTypes=i,y.resetWarningCache=i.resetWarningCache,y.PropTypes=y,y},Rg}var Lg,DP;function btt(){if(DP)return Lg;DP=1;var e=lx();function t(){}function n(){}return n.resetWarningCache=t,Lg=function(){function r(s,l,c,h,u,f){if(f!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Lg}if(process.env.NODE_ENV!=="production"){var xtt=_k(),wtt=!0;bv.exports=vtt()(xtt.isElement,wtt)}else bv.exports=btt()();var _tt=bv.exports;const Ae=$e(_tt),{getOwnPropertyNames:Stt,getOwnPropertySymbols:Ptt}=Object,{hasOwnProperty:Att}=Object.prototype;function Ng(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function kf(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),l=o.get(r);if(s&&l)return s===r&&l===n;o.set(n,r),o.set(r,n);const c=e(n,r,i);return o.delete(n),o.delete(r),c}}function Ttt(e){return e!=null?e[Symbol.toStringTag]:void 0}function BP(e){return Stt(e).concat(Ptt(e))}const Ett=Object.hasOwn||((e,t)=>Att.call(e,t));function Pa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ctt="__v",Ott="__o",Mtt="_owner",{getOwnPropertyDescriptor:zP,keys:FP}=Object;function ktt(e,t){return e.byteLength===t.byteLength&&jd(new Uint8Array(e),new Uint8Array(t))}function $tt(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Itt(e,t){return e.byteLength===t.byteLength&&jd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Rtt(e,t){return Pa(e.getTime(),t.getTime())}function Ltt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ntt(e,t){return e===t}function WP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,l,c=0;for(;(s=o.next())&&!s.done;){const h=t.entries();let u=!1,f=0;for(;(l=h.next())&&!l.done;){if(i[f]){f++;continue}const m=s.value,y=l.value;if(n.equals(m[0],y[0],c,f,e,t,n)&&n.equals(m[1],y[1],m[0],y[0],e,t,n)){u=i[f]=!0;break}f++}if(!u)return!1;c++}return!0}const jtt=Pa;function Dtt(e,t,n){const r=FP(e);let i=r.length;if(FP(t).length!==i)return!1;for(;i-- >0;)if(!Pk(e,t,n,r[i]))return!1;return!0}function Xc(e,t,n){const r=BP(e);let i=r.length;if(BP(t).length!==i)return!1;let o,s,l;for(;i-- >0;)if(o=r[i],!Pk(e,t,n,o)||(s=zP(e,o),l=zP(t,o),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function Btt(e,t){return Pa(e.valueOf(),t.valueOf())}function ztt(e,t){return e.source===t.source&&e.flags===t.flags}function VP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,l;for(;(s=o.next())&&!s.done;){const c=t.values();let h=!1,u=0;for(;(l=c.next())&&!l.done;){if(!i[u]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){h=i[u]=!0;break}u++}if(!h)return!1}return!0}function jd(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Ftt(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Pk(e,t,n,r){return(r===Mtt||r===Ott||r===Ctt)&&(e.$$typeof||t.$$typeof)?!0:Ett(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Wtt="[object ArrayBuffer]",Vtt="[object Arguments]",Utt="[object Boolean]",Htt="[object DataView]",qtt="[object Date]",Gtt="[object Error]",Ztt="[object Map]",Ytt="[object Number]",Ktt="[object Object]",Xtt="[object RegExp]",Jtt="[object Set]",Qtt="[object String]",tet={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},eet="[object URL]",net=Object.prototype.toString;function ret({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:h,areRegExpsEqual:u,areSetsEqual:f,areTypedArraysEqual:m,areUrlsEqual:y,unknownTagComparators:x}){return function(b,P,S){if(b===P)return!0;if(b==null||P==null)return!1;const A=typeof b;if(A!==typeof P)return!1;if(A!=="object")return A==="number"?l(b,P,S):A==="function"?o(b,P,S):!1;const E=b.constructor;if(E!==P.constructor)return!1;if(E===Object)return c(b,P,S);if(Array.isArray(b))return t(b,P,S);if(E===Date)return r(b,P,S);if(E===RegExp)return u(b,P,S);if(E===Map)return s(b,P,S);if(E===Set)return f(b,P,S);const w=net.call(b);if(w===qtt)return r(b,P,S);if(w===Xtt)return u(b,P,S);if(w===Ztt)return s(b,P,S);if(w===Jtt)return f(b,P,S);if(w===Ktt)return typeof b.then!="function"&&typeof P.then!="function"&&c(b,P,S);if(w===eet)return y(b,P,S);if(w===Gtt)return i(b,P,S);if(w===Vtt)return c(b,P,S);if(tet[w])return m(b,P,S);if(w===Wtt)return e(b,P,S);if(w===Htt)return n(b,P,S);if(w===Utt||w===Ytt||w===Qtt)return h(b,P,S);if(x){let T=x[w];if(!T){const O=Ttt(b);O&&(T=x[O])}if(T)return T(b,P,S)}return!1}}function iet({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ktt,areArraysEqual:n?Xc:$tt,areDataViewsEqual:Itt,areDatesEqual:Rtt,areErrorsEqual:Ltt,areFunctionsEqual:Ntt,areMapsEqual:n?Ng(WP,Xc):WP,areNumbersEqual:jtt,areObjectsEqual:n?Xc:Dtt,arePrimitiveWrappersEqual:Btt,areRegExpsEqual:ztt,areSetsEqual:n?Ng(VP,Xc):VP,areTypedArraysEqual:n?Ng(jd,Xc):jd,areUrlsEqual:Ftt,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=kf(r.areArraysEqual),o=kf(r.areMapsEqual),s=kf(r.areObjectsEqual),l=kf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return r}function oet(e){return function(t,n,r,i,o,s,l){return e(t,n,l)}}function set({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(l,c){const{cache:h=e?new WeakMap:void 0,meta:u}=n();return t(l,c,{cache:h,equals:r,meta:u,strict:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,o)}}const aet=cs();cs({strict:!0});cs({circular:!0});cs({circular:!0,strict:!0});cs({createInternalComparator:()=>Pa});cs({strict:!0,createInternalComparator:()=>Pa});cs({circular:!0,createInternalComparator:()=>Pa});cs({circular:!0,createInternalComparator:()=>Pa,strict:!0});function cs(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=iet(e),s=ret(o),l=n?n(s):oet(s);return set({circular:t,comparator:s,createState:r,equals:l,strict:i})}function cet(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function UP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):cet(i)};requestAnimationFrame(r)}function xv(e){"@babel/helpers - typeof";return xv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xv(e)}function uet(e){return pet(e)||det(e)||fet(e)||het()}function het(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
92
92
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fet(e,t){if(e){if(typeof e=="string")return HP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HP(e,t)}}function HP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function det(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pet(e){if(Array.isArray(e))return e}function met(){var e={},t=function(){return null},n=!1,r=function i(o){if(!n){if(Array.isArray(o)){if(!o.length)return;var s=o,l=uet(s),c=l[0],h=l.slice(1);if(typeof c=="number"){UP(i.bind(null,h),c);return}i(c),UP(i.bind(null,h));return}xv(o)==="object"&&(e=o,t(e)),typeof o=="function"&&o()}};return{stop:function(){n=!0},start:function(o){n=!1,r(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}function nh(e){"@babel/helpers - typeof";return nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nh(e)}function qP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function GP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){Ak(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ak(e,t,n){return t=get(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function get(e){var t=yet(e,"string");return nh(t)==="symbol"?t:String(t)}function yet(e,t){if(nh(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nh(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vet=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(o){return i.includes(o)})})},bet=function(t){return t},xet=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},yu=function(t,n){return Object.keys(n).reduce(function(r,i){return GP(GP({},r),{},Ak({},i,t(i,n[i])))},{})},ZP=function(t,n,r){return t.map(function(i){return"".concat(xet(i)," ").concat(n,"ms ").concat(r)}).join(",")},wet=process.env.NODE_ENV!=="production",Dd=function(t,n,r,i,o,s,l,c){if(wet&&typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[r,i,o,s,l,c],u=0;console.warn(n.replace(/%s/g,function(){return h[u++]}))}};function _et(e,t){return Tet(e)||Aet(e,t)||Tk(e,t)||Pet()}function Pet(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
93
93
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aet(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function Tet(e){if(Array.isArray(e))return e}function Eet(e){return Met(e)||Oet(e)||Tk(e)||Cet()}function Cet(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
94
94
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tk(e,t){if(e){if(typeof e=="string")return wv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wv(e,t)}}function Oet(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Met(e){if(Array.isArray(e))return wv(e)}function wv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bd=1e-4,Ek=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},Ck=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},YP=function(t,n){return function(r){var i=Ek(t,n);return Ck(i,r)}},ket=function(t,n){return function(r){var i=Ek(t,n),o=[].concat(Eet(i.map(function(s,l){return s*l}).slice(1)),[0]);return Ck(o,r)}},KP=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],o=n[1],s=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,o=0,s=1,l=1;break;case"ease":i=.25,o=.1,s=.25,l=1;break;case"ease-in":i=.42,o=0,s=1,l=1;break;case"ease-out":i=.42,o=0,s=.58,l=1;break;case"ease-in-out":i=0,o=0,s=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var h=c[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),u=_et(h,4);i=u[0],o=u[1],s=u[2],l=u[3]}else Dd(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",n)}}Dd([i,s,o,l].every(function(b){return typeof b=="number"&&b>=0&&b<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",n);var f=YP(i,s),m=YP(o,l),y=ket(i,s),x=function(P){return P>1?1:P<0?0:P},p=function(P){for(var S=P>1?1:P,A=S,E=0;E<8;++E){var w=f(A)-S,T=y(A);if(Math.abs(w-S)<Bd||T<Bd)return m(A);A=x(A-w/T)}return m(A)};return p.isStepper=!1,p},$et=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,o=i===void 0?8:i,s=t.dt,l=s===void 0?17:s,c=function(u,f,m){var y=-(u-f)*r,x=m*o,p=m+(y-x)*l/1e3,b=m*l/1e3+u;return Math.abs(b-f)<Bd&&Math.abs(p)<Bd?[f,0]:[b,p]};return c.isStepper=!0,c.dt=l,c},Iet=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return KP(i);case"spring":return $et();default:if(i.split("(")[0]==="cubic-bezier")return KP(i);Dd(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",n)}return typeof i=="function"?i:(Dd(!1,"[configEasing]: first argument type should be function or string, instead received %s",n),null)};function rh(e){"@babel/helpers - typeof";return rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rh(e)}function XP(e){return Net(e)||Let(e)||Ok(e)||Ret()}function Ret(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -109,24 +109,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
109
109
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bnt(e,t){if(e){if(typeof e=="string")return Ov(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ov(e,t)}}function xnt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wnt(e){if(Array.isArray(e))return Ov(e)}function Ov(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var oA=function(t){return t&&t.x===+t.x&&t.y===+t.y},_nt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){oA(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),oA(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},vu=function(t,n){var r=_nt(t);n&&(r=[r.reduce(function(o,s){return[].concat(iA(o),iA(s))},[])]);var i=r.map(function(o){return o.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Snt=function(t,n,r){var i=vu(t,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(vu(n.reverse(),r).slice(1))},Pnt=function(t){var n=t.points,r=t.className,i=t.baseLinePoints,o=t.connectNulls,s=gnt(t,mnt);if(!n||!n.length)return null;var l=te("recharts-polygon",r);if(i&&i.length){var c=s.stroke&&s.stroke!=="none",h=Snt(n,i,o);return v.createElement("g",{className:l},v.createElement("path",ol({},Dt(s,!0),{fill:h.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:h})),c?v.createElement("path",ol({},Dt(s,!0),{fill:"none",d:vu(n,o)})):null,c?v.createElement("path",ol({},Dt(s,!0),{fill:"none",d:vu(i,o)})):null)}var u=vu(n,o);return v.createElement("path",ol({},Dt(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",className:l,d:u}))};function Mv(){return Mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mv.apply(this,arguments)}var rm=function(t){var n=t.cx,r=t.cy,i=t.r,o=t.className,s=te("recharts-dot",o);return n===+n&&r===+r&&i===+i?Yn.createElement("circle",Mv({},Dt(t,!1),od(t),{className:s,cx:n,cy:r,r:i})):null};function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}var Ant=["x","y","top","left","width","height","className"];function kv(){return kv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kv.apply(this,arguments)}function sA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tnt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sA(Object(n),!0).forEach(function(r){Ent(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ent(e,t,n){return t=Cnt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cnt(e){var t=Ont(e,"string");return oh(t)=="symbol"?t:t+""}function Ont(e,t){if(oh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mnt(e,t){if(e==null)return{};var n=knt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function knt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var $nt=function(t,n,r,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},Int=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.top,l=s===void 0?0:s,c=t.left,h=c===void 0?0:c,u=t.width,f=u===void 0?0:u,m=t.height,y=m===void 0?0:m,x=t.className,p=Mnt(t,Ant),b=Tnt({x:r,y:o,top:l,left:h,width:f,height:y},p);return!wt(r)||!wt(o)||!wt(f)||!wt(y)||!wt(l)||!wt(h)?null:v.createElement("path",kv({},Dt(b,!0),{className:te("recharts-cross",x),d:$nt(r,o,f,y,l,h)}))},Rnt=Qp,Lnt=VM,Nnt=Ai;function jnt(e,t){return e&&e.length?Rnt(e,Nnt(t),Lnt):void 0}var Dnt=jnt;const Bnt=$e(Dnt);var znt=Qp,Fnt=Ai,Wnt=UM;function Vnt(e,t){return e&&e.length?znt(e,Fnt(t),Wnt):void 0}var Unt=Vnt;const Hnt=$e(Unt);var qnt=["cx","cy","angle","ticks","axisLine"],Gnt=["ticks","tick","angle","tickFormatter","stroke"];function Il(e){"@babel/helpers - typeof";return Il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Il(e)}function bu(){return bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bu.apply(this,arguments)}function aA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aA(Object(n),!0).forEach(function(r){im(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lA(e,t){if(e==null)return{};var n=Znt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Znt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ynt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$k(r.key),r)}}function Knt(e,t,n){return t&&cA(e.prototype,t),n&&cA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xnt(e,t,n){return t=Vd(t),Jnt(e,kk()?Reflect.construct(t,n||[],Vd(e).constructor):t.apply(e,n))}function Jnt(e,t){if(t&&(Il(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qnt(e)}function Qnt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kk=function(){return!!e})()}function Vd(e){return Vd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vd(e)}function trt(e,t){if(typeof t!="function"&&t!==null)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&&$v(e,t)}function $v(e,t){return $v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$v(e,t)}function im(e,t,n){return t=$k(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $k(e){var t=ert(e,"string");return Il(t)=="symbol"?t:t+""}function ert(e,t){if(Il(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Il(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var om=function(e){function t(){return Ynt(this,t),Xnt(this,t,arguments)}return trt(t,e),Knt(t,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,o=this.props,s=o.angle,l=o.cx,c=o.cy;return Fe(l,c,i,s)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,l=r.ticks,c=Bnt(l,function(u){return u.coordinate||0}),h=Hnt(l,function(u){return u.coordinate||0});return{cx:i,cy:o,startAngle:s,endAngle:s,innerRadius:h.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,l=r.ticks,c=r.axisLine,h=lA(r,qnt),u=l.reduce(function(x,p){return[Math.min(x[0],p.coordinate),Math.max(x[1],p.coordinate)]},[1/0,-1/0]),f=Fe(i,o,u[0],s),m=Fe(i,o,u[1],s),y=Bs(Bs(Bs({},Dt(h,!1)),{},{fill:"none"},Dt(c,!1)),{},{x1:f.x,y1:f.y,x2:m.x,y2:m.y});return v.createElement("line",bu({className:"recharts-polar-radius-axis-line"},y))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,l=i.angle,c=i.tickFormatter,h=i.stroke,u=lA(i,Gnt),f=this.getTickTextAnchor(),m=Dt(u,!1),y=Dt(s,!1),x=o.map(function(p,b){var P=r.getTickValueCoord(p),S=Bs(Bs(Bs(Bs({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(P.x,", ").concat(P.y,")")},m),{},{stroke:"none",fill:h},y),{},{index:b},P),{},{payload:p});return v.createElement(fe,bu({className:te("recharts-polar-radius-axis-tick",vk(s)),key:"tick-".concat(p.coordinate)},es(r.props,p,b)),t.renderTickItem(s,S,c?c(p.value,b):p.value))});return v.createElement(fe,{className:"recharts-polar-radius-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.axisLine,s=r.tick;return!i||!i.length?null:v.createElement(fe,{className:te("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),s&&this.renderTicks(),Tn.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return v.isValidElement(r)?s=v.cloneElement(r,i):qt(r)?s=r(i):s=v.createElement(da,bu({},i,{className:"recharts-polar-radius-axis-tick-value"}),o),s}}])}(v.PureComponent);im(om,"displayName","PolarRadiusAxis");im(om,"axisType","radiusAxis");im(om,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Rl(e){"@babel/helpers - typeof";return Rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(e)}function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(this,arguments)}function uA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uA(Object(n),!0).forEach(function(r){sm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nrt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rk(r.key),r)}}function rrt(e,t,n){return t&&hA(e.prototype,t),n&&hA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function irt(e,t,n){return t=Ud(t),ort(e,Ik()?Reflect.construct(t,n||[],Ud(e).constructor):t.apply(e,n))}function ort(e,t){if(t&&(Rl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return srt(e)}function srt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ik(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ik=function(){return!!e})()}function Ud(e){return Ud=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ud(e)}function art(e,t){if(typeof t!="function"&&t!==null)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&&Iv(e,t)}function Iv(e,t){return Iv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Iv(e,t)}function sm(e,t,n){return t=Rk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rk(e){var t=lrt(e,"string");return Rl(t)=="symbol"?t:t+""}function lrt(e,t){if(Rl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var crt=Math.PI/180,fA=1e-5,am=function(e){function t(){return nrt(this,t),irt(this,t,arguments)}return art(t,e),rrt(t,[{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.cx,s=i.cy,l=i.radius,c=i.orientation,h=i.tickSize,u=h||8,f=Fe(o,s,l,r.coordinate),m=Fe(o,s,l+(c==="inner"?-1:1)*u,r.coordinate);return{x1:f.x,y1:f.y,x2:m.x,y2:m.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,o=Math.cos(-r.coordinate*crt),s;return o>fA?s=i==="outer"?"start":"end":o<-fA?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.radius,l=r.axisLine,c=r.axisLineType,h=zs(zs({},Dt(this.props,!1)),{},{fill:"none"},Dt(l,!1));if(c==="circle")return v.createElement(rm,Zs({className:"recharts-polar-angle-axis-line"},h,{cx:i,cy:o,r:s}));var u=this.props.ticks,f=u.map(function(m){return Fe(i,o,s,m.coordinate)});return v.createElement(Pnt,Zs({className:"recharts-polar-angle-axis-line"},h,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,l=i.tickLine,c=i.tickFormatter,h=i.stroke,u=Dt(this.props,!1),f=Dt(s,!1),m=zs(zs({},u),{},{fill:"none"},Dt(l,!1)),y=o.map(function(x,p){var b=r.getTickLineCoord(x),P=r.getTickTextAnchor(x),S=zs(zs(zs({textAnchor:P},u),{},{stroke:"none",fill:h},f),{},{index:p,payload:x,x:b.x2,y:b.y2});return v.createElement(fe,Zs({className:te("recharts-polar-angle-axis-tick",vk(s)),key:"tick-".concat(x.coordinate)},es(r.props,x,p)),l&&v.createElement("line",Zs({className:"recharts-polar-angle-axis-tick-line"},m,b)),s&&t.renderTickItem(s,S,c?c(x.value,p):x.value))});return v.createElement(fe,{className:"recharts-polar-angle-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.radius,s=r.axisLine;return o<=0||!i||!i.length?null:v.createElement(fe,{className:te("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,o){var s;return v.isValidElement(r)?s=v.cloneElement(r,i):qt(r)?s=r(i):s=v.createElement(da,Zs({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])}(v.PureComponent);sm(am,"displayName","PolarAngleAxis");sm(am,"axisType","angleAxis");sm(am,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var urt=zO,hrt=urt(Object.getPrototypeOf,Object),frt=hrt,drt=go,prt=frt,mrt=yo,grt="[object Object]",yrt=Function.prototype,vrt=Object.prototype,Lk=yrt.toString,brt=vrt.hasOwnProperty,xrt=Lk.call(Object);function wrt(e){if(!mrt(e)||drt(e)!=grt)return!1;var t=prt(e);if(t===null)return!0;var n=brt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Lk.call(n)==xrt}var _rt=wrt;const Srt=$e(_rt);var Prt=go,Art=yo,Trt="[object Boolean]";function Ert(e){return e===!0||e===!1||Art(e)&&Prt(e)==Trt}var Crt=Ert;const Ort=$e(Crt);function sh(e){"@babel/helpers - typeof";return sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sh(e)}function Hd(){return Hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hd.apply(this,arguments)}function Mrt(e,t){return Rrt(e)||Irt(e,t)||$rt(e,t)||krt()}function krt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
110
110
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $rt(e,t){if(e){if(typeof e=="string")return dA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dA(e,t)}}function dA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Irt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function Rrt(e){if(Array.isArray(e))return e}function pA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pA(Object(n),!0).forEach(function(r){Lrt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lrt(e,t,n){return t=Nrt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nrt(e){var t=jrt(e,"string");return sh(t)=="symbol"?t:t+""}function jrt(e,t){if(sh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gA=function(t,n,r,i,o){var s=r-i,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-s/2,",").concat(n+o),l+="L ".concat(t+r-s/2-i,",").concat(n+o),l+="L ".concat(t,",").concat(n," Z"),l},Drt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Brt=function(t){var n=mA(mA({},Drt),t),r=v.useRef(),i=v.useState(-1),o=Mrt(i,2),s=o[0],l=o[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&l(A)}catch{}},[]);var c=n.x,h=n.y,u=n.upperWidth,f=n.lowerWidth,m=n.height,y=n.className,x=n.animationEasing,p=n.animationDuration,b=n.animationBegin,P=n.isUpdateAnimationActive;if(c!==+c||h!==+h||u!==+u||f!==+f||m!==+m||u===0&&f===0||m===0)return null;var S=te("recharts-trapezoid",y);return P?v.createElement(ni,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:h},to:{upperWidth:u,lowerWidth:f,height:m,x:c,y:h},duration:p,animationEasing:x,isActive:P},function(A){var E=A.upperWidth,w=A.lowerWidth,T=A.height,O=A.x,I=A.y;return v.createElement(ni,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:p,easing:x},v.createElement("path",Hd({},Dt(n,!0),{className:S,d:gA(O,I,E,w,T),ref:r})))}):v.createElement("g",null,v.createElement("path",Hd({},Dt(n,!0),{className:S,d:gA(c,h,u,f,m)})))},zrt=["option","shapeType","propTransformer","activeClassName","isActive"];function ah(e){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ah(e)}function Frt(e,t){if(e==null)return{};var n=Wrt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wrt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yA(Object(n),!0).forEach(function(r){Vrt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vrt(e,t,n){return t=Urt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Urt(e){var t=Hrt(e,"string");return ah(t)=="symbol"?t:t+""}function Hrt(e,t){if(ah(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ah(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qrt(e,t){return qd(qd({},t),e)}function Grt(e,t){return e==="symbols"}function vA(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return v.createElement(cx,n);case"trapezoid":return v.createElement(Brt,n);case"sector":return v.createElement(wk,n);case"symbols":if(Grt(t))return v.createElement(Wp,n);break;default:return null}}function Zrt(e){return v.isValidElement(e)?e.props:e}function Gd(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?qrt:r,o=e.activeClassName,s=o===void 0?"recharts-active-shape":o,l=e.isActive,c=Frt(e,zrt),h;if(v.isValidElement(t))h=v.cloneElement(t,qd(qd({},c),Zrt(t)));else if(qt(t))h=t(c);else if(Srt(t)&&!Ort(t)){var u=i(t,c);h=v.createElement(vA,{shapeType:n,elementProps:u})}else{var f=c;h=v.createElement(vA,{shapeType:n,elementProps:f})}return l?v.createElement(fe,{className:s},h):h}function lm(e,t){return t!=null&&"trapezoids"in e.props}function cm(e,t){return t!=null&&"sectors"in e.props}function lh(e,t){return t!=null&&"points"in e.props}function Yrt(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,o=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&o}function Krt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Xrt(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function Jrt(e,t){var n;return lm(e,t)?n=Yrt:cm(e,t)?n=Krt:lh(e,t)&&(n=Xrt),n}function Qrt(e,t){var n;return lm(e,t)?n="trapezoids":cm(e,t)?n="sectors":lh(e,t)&&(n="points"),n}function tit(e,t){if(lm(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(cm(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return lh(e,t)?t.payload:{}}function eit(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=Qrt(n,t),o=tit(n,t),s=r.filter(function(c,h){var u=pa(o,c),f=n.props[i].filter(function(x){var p=Jrt(n,t);return p(x,t)}),m=n.props[i].indexOf(f[f.length-1]),y=h===m;return u&&y}),l=r.indexOf(s[s.length-1]);return l}var Ff;function Ll(e){"@babel/helpers - typeof";return Ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ll(e)}function sl(){return sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sl.apply(this,arguments)}function bA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bA(Object(n),!0).forEach(function(r){Br(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jk(r.key),r)}}function rit(e,t,n){return t&&xA(e.prototype,t),n&&xA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iit(e,t,n){return t=Zd(t),oit(e,Nk()?Reflect.construct(t,n||[],Zd(e).constructor):t.apply(e,n))}function oit(e,t){if(t&&(Ll(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sit(e)}function sit(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nk=function(){return!!e})()}function Zd(e){return Zd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zd(e)}function ait(e,t){if(typeof t!="function"&&t!==null)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&&Rv(e,t)}function Rv(e,t){return Rv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Rv(e,t)}function Br(e,t,n){return t=jk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jk(e){var t=lit(e,"string");return Ll(t)=="symbol"?t:t+""}function lit(e,t){if(Ll(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ll(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bo=function(e){function t(n){var r;return nit(this,t),r=iit(this,t,[n]),Br(r,"pieRef",null),Br(r,"sectorRefs",[]),Br(r,"id",wa("recharts-pie-")),Br(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),qt(i)&&i()}),Br(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),qt(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return ait(t,e),rit(t,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.label,l=o.labelLine,c=o.dataKey,h=o.valueKey,u=Dt(this.props,!1),f=Dt(s,!1),m=Dt(l,!1),y=s&&s.offsetRadius||20,x=r.map(function(p,b){var P=(p.startAngle+p.endAngle)/2,S=Fe(p.cx,p.cy,p.outerRadius+y,P),A=De(De(De(De({},u),p),{},{stroke:"none"},f),{},{index:b,textAnchor:t.getTextAnchor(S.x,p.cx)},S),E=De(De(De(De({},u),p),{},{fill:"none",stroke:p.fill},m),{},{index:b,points:[Fe(p.cx,p.cy,p.outerRadius,P),S]}),w=c;return Zt(c)&&Zt(h)?w="value":Zt(c)&&(w=h),v.createElement(fe,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(b)},l&&t.renderLabelLineItem(l,E,"line"),t.renderLabelItem(s,A,tn(p,w)))});return v.createElement(fe,{className:"recharts-pie-labels"},x)}},{key:"renderSectorsStatically",value:function(r){var i=this,o=this.props,s=o.activeShape,l=o.blendStroke,c=o.inactiveShape;return r.map(function(h,u){if((h==null?void 0:h.startAngle)===0&&(h==null?void 0:h.endAngle)===0&&r.length!==1)return null;var f=i.isActiveIndex(u),m=c&&i.hasActiveIndex()?c:null,y=f?s:m,x=De(De({},h),{},{stroke:l?h.fill:h.stroke,tabIndex:-1});return v.createElement(fe,sl({ref:function(b){b&&!i.sectorRefs.includes(b)&&i.sectorRefs.push(b)},tabIndex:-1,className:"recharts-pie-sector"},es(i.props,h,u),{key:"sector-".concat(h==null?void 0:h.startAngle,"-").concat(h==null?void 0:h.endAngle,"-").concat(h.midAngle,"-").concat(u)}),v.createElement(Gd,sl({option:y,isActive:f,shapeType:"sector"},x)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,o=i.sectors,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,h=i.animationEasing,u=i.animationId,f=this.state,m=f.prevSectors,y=f.prevIsAnimationActive;return v.createElement(ni,{begin:l,duration:c,isActive:s,easing:h,from:{t:0},to:{t:1},key:"pie-".concat(u,"-").concat(y),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(x){var p=x.t,b=[],P=o&&o[0],S=P.startAngle;return o.forEach(function(A,E){var w=m&&m[E],T=E>0?Pr(A,"paddingAngle",0):0;if(w){var O=An(w.endAngle-w.startAngle,A.endAngle-A.startAngle),I=De(De({},A),{},{startAngle:S+T,endAngle:S+O(p)+T});b.push(I),S=I.endAngle}else{var N=A.endAngle,F=A.startAngle,D=An(0,N-F),j=D(p),K=De(De({},A),{},{startAngle:S+T,endAngle:S+j+T});b.push(K),S=K.endAngle}}),v.createElement(fe,null,r.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,o=r.isAnimationActive,s=this.state.prevSectors;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,o=i.hide,s=i.sectors,l=i.className,c=i.label,h=i.cx,u=i.cy,f=i.innerRadius,m=i.outerRadius,y=i.isAnimationActive,x=this.state.isAnimationFinished;if(o||!s||!s.length||!wt(h)||!wt(u)||!wt(f)||!wt(m))return null;var p=te("recharts-pie",l);return v.createElement(fe,{tabIndex:this.props.rootTabIndex,className:p,ref:function(P){r.pieRef=P}},this.renderSectors(),c&&this.renderLabels(s),Tn.renderCallByParent(this.props,null,!1),(!y||x)&&wi.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,o){if(v.isValidElement(r))return v.cloneElement(r,i);if(qt(r))return r(i);var s=te("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return v.createElement(sa,sl({},i,{key:o,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(r,i,o){if(v.isValidElement(r))return v.cloneElement(r,i);var s=o;if(qt(r)&&(s=r(i),v.isValidElement(s)))return s;var l=te("recharts-pie-label-text",typeof r!="boolean"&&!qt(r)?r.className:"");return v.createElement(da,sl({},i,{alignmentBaseline:"middle",className:l}),s)}}])}(v.PureComponent);Ff=bo;Br(bo,"displayName","Pie");Br(bo,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!ss.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Br(bo,"parseDeltaAngle",function(e,t){var n=qn(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Br(bo,"getRealPieData",function(e){var t=e.data,n=e.children,r=Dt(e,!1),i=sr(n,Sh);return t&&t.length?t.map(function(o,s){return De(De(De({payload:o},r),o),i&&i[s]&&i[s].props)}):i&&i.length?i.map(function(o){return De(De({},r),o.props)}):[]});Br(bo,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,i=t.width,o=t.height,s=yk(i,o),l=r+Gn(e.cx,i,i/2),c=n+Gn(e.cy,o,o/2),h=Gn(e.innerRadius,s,0),u=Gn(e.outerRadius,s,s*.8),f=e.maxRadius||Math.sqrt(i*i+o*o)/2;return{cx:l,cy:c,innerRadius:h,outerRadius:u,maxRadius:f}});Br(bo,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?De(De({},t.type.defaultProps),t.props):t.props,i=Ff.getRealPieData(r);if(!i||!i.length)return null;var o=r.cornerRadius,s=r.startAngle,l=r.endAngle,c=r.paddingAngle,h=r.dataKey,u=r.nameKey,f=r.valueKey,m=r.tooltipType,y=Math.abs(r.minAngle),x=Ff.parseCoordinateOfPie(r,n),p=Ff.parseDeltaAngle(s,l),b=Math.abs(p),P=h;Zt(h)&&Zt(f)?(ei(!1,`Use "dataKey" to specify the value of pie,
111
111
  the props "valueKey" will be deprecated in 1.1.0`),P="value"):Zt(h)&&(ei(!1,`Use "dataKey" to specify the value of pie,
112
- the props "valueKey" will be deprecated in 1.1.0`),P=f);var S=i.filter(function(I){return tn(I,P,0)!==0}).length,A=(b>=360?S:S-1)*c,E=b-S*y-A,w=i.reduce(function(I,N){var F=tn(N,P,0);return I+(wt(F)?F:0)},0),T;if(w>0){var O;T=i.map(function(I,N){var F=tn(I,P,0),D=tn(I,u,N),j=(wt(F)?F:0)/w,K;N?K=O.endAngle+qn(p)*c*(F!==0?1:0):K=s;var U=K+qn(p)*((F!==0?y:0)+j*E),z=(K+U)/2,Y=(x.innerRadius+x.outerRadius)/2,G=[{name:D,value:F,payload:I,dataKey:P,type:m}],X=Fe(x.cx,x.cy,Y,z);return O=De(De(De({percent:j,cornerRadius:o,name:D,tooltipPayload:G,midAngle:z,middleRadius:Y,tooltipPosition:X},I),x),{},{value:tn(I,P),startAngle:K,endAngle:U,payload:I,paddingAngle:qn(p)*c}),O})}return De(De({},x),{},{sectors:T,data:i})});var cit=Math.ceil,uit=Math.max;function hit(e,t,n,r){for(var i=-1,o=uit(cit((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}var fit=hit,dit=oM,wA=1/0,pit=17976931348623157e292;function mit(e){if(!e)return e===0?e:0;if(e=dit(e),e===wA||e===-wA){var t=e<0?-1:1;return t*pit}return e===e?e:0}var Dk=mit,git=fit,yit=Hp,Dg=Dk;function vit(e){return function(t,n,r){return r&&typeof r!="number"&&yit(t,n,r)&&(n=r=void 0),t=Dg(t),n===void 0?(n=t,t=0):n=Dg(n),r=r===void 0?t<n?1:-1:Dg(r),git(t,n,r,e)}}var bit=vit,xit=bit,wit=xit(),_it=wit;const Yd=$e(_it);function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(e)}function _A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function SA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_A(Object(n),!0).forEach(function(r){Bk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_A(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bk(e,t,n){return t=Sit(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sit(e){var t=Pit(e,"string");return ch(t)=="symbol"?t:t+""}function Pit(e,t){if(ch(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ch(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ait=["Webkit","Moz","O","ms"],Tit=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),i=Ait.reduce(function(o,s){return SA(SA({},o),{},Bk({},s+r,n))},{});return i[t]=n,i};function Nl(e){"@babel/helpers - typeof";return Nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(e)}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kd.apply(this,arguments)}function PA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PA(Object(n),!0).forEach(function(r){br(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Fk(r.key),r)}}function Cit(e,t,n){return t&&AA(e.prototype,t),n&&AA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oit(e,t,n){return t=Xd(t),Mit(e,zk()?Reflect.construct(t,n||[],Xd(e).constructor):t.apply(e,n))}function Mit(e,t){if(t&&(Nl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kit(e)}function kit(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zk=function(){return!!e})()}function Xd(e){return Xd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xd(e)}function $it(e,t){if(typeof t!="function"&&t!==null)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&&Lv(e,t)}function Lv(e,t){return Lv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Lv(e,t)}function br(e,t,n){return t=Fk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fk(e){var t=Iit(e,"string");return Nl(t)=="symbol"?t:t+""}function Iit(e,t){if(Nl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rit=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,o=t.x,s=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,h=mu().domain(Yd(0,c)).range([o,o+s-l]),u=h.domain().map(function(f){return h(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:h(r),endX:h(i),scale:h,scaleValues:u}},TA=function(t){return t.changedTouches&&!!t.changedTouches.length},jl=function(e){function t(n){var r;return Eit(this,t),r=Oit(this,t,[n]),br(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),br(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),br(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:o,startIndex:l})}),r.detachDragEndListener()}),br(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),br(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),br(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),br(r,"handleSlideDragStart",function(i){var o=TA(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return $it(t,e),Cit(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,l=this.props,c=l.gap,h=l.data,u=h.length-1,f=Math.min(i,o),m=Math.max(i,o),y=t.getIndexInRange(s,f),x=t.getIndexInRange(s,m);return{startIndex:y-y%c,endIndex:x===u?u:x-x%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,l=i.dataKey,c=tn(o[r],l,r);return qt(s)?s(c,r):c}},{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(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,h=c.x,u=c.width,f=c.travellerWidth,m=c.startIndex,y=c.endIndex,x=c.onChange,p=r.pageX-o;p>0?p=Math.min(p,h+u-f-l,h+u-f-s):p<0&&(p=Math.max(p,h-s,h-l));var b=this.getIndex({startX:s+p,endX:l+p});(b.startIndex!==m||b.endIndex!==y)&&x&&x(b),this.setState({startX:s+p,endX:l+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=TA(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,l=i.endX,c=i.startX,h=this.state[s],u=this.props,f=u.x,m=u.width,y=u.travellerWidth,x=u.onChange,p=u.gap,b=u.data,P={startX:this.state.startX,endX:this.state.endX},S=r.pageX-o;S>0?S=Math.min(S,f+m-y-h):S<0&&(S=Math.max(S,f-h)),P[s]=h+S;var A=this.getIndex(P),E=A.startIndex,w=A.endIndex,T=function(){var I=b.length-1;return s==="startX"&&(l>c?E%p===0:w%p===0)||l<c&&w===I||s==="endX"&&(l>c?w%p===0:E%p===0)||l>c&&w===I};this.setState(br(br({},s,h+S),"brushMoveStartX",r.pageX),function(){x&&T()&&x(A)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,l=s.scaleValues,c=s.startX,h=s.endX,u=this.state[i],f=l.indexOf(u);if(f!==-1){var m=f+r;if(!(m===-1||m>=l.length)){var y=l[m];i==="startX"&&y>=h||i==="endX"&&y<=c||this.setState(br({},i,y),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.fill,h=r.stroke;return v.createElement("rect",{stroke:h,fill:c,x:i,y:o,width:s,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.data,h=r.children,u=r.padding,f=v.Children.only(h);return f?v.cloneElement(f,{x:i,y:o,width:s,height:l,margin:u,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,l=this,c=this.props,h=c.y,u=c.travellerWidth,f=c.height,m=c.traveller,y=c.ariaLabel,x=c.data,p=c.startIndex,b=c.endIndex,P=Math.max(r,this.props.x),S=Bg(Bg({},Dt(this.props,!1)),{},{x:P,y:h,width:u,height:f}),A=y||"Min value: ".concat((o=x[p])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=x[b])===null||s===void 0?void 0:s.name);return v.createElement(fe,{tabIndex:0,role:"slider","aria-label":A,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),l.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,S))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,l=o.height,c=o.stroke,h=o.travellerWidth,u=Math.min(r,i)+h,f=Math.max(Math.abs(i-r)-h,0);return v.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:u,y:s,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,l=r.height,c=r.travellerWidth,h=r.stroke,u=this.state,f=u.startX,m=u.endX,y=5,x={pointerEvents:"none",fill:h};return v.createElement(fe,{className:"recharts-brush-texts"},v.createElement(da,Kd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,m)-y,y:s+l/2},x),this.getTextOfTick(i)),v.createElement(da,Kd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,m)+c+y,y:s+l/2},x),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,l=r.x,c=r.y,h=r.width,u=r.height,f=r.alwaysShowText,m=this.state,y=m.startX,x=m.endX,p=m.isTextActive,b=m.isSlideMoving,P=m.isTravellerMoving,S=m.isTravellerFocused;if(!i||!i.length||!wt(l)||!wt(c)||!wt(h)||!wt(u)||h<=0||u<=0)return null;var A=te("recharts-brush",o),E=v.Children.count(s)===1,w=Tit("userSelect","none");return v.createElement(fe,{className:A,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(y,x),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(x,"endX"),(p||b||P||S||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,l=r.height,c=r.stroke,h=Math.floor(o+l/2)-1;return v.createElement(v.Fragment,null,v.createElement("rect",{x:i,y:o,width:s,height:l,fill:c,stroke:"none"}),v.createElement("line",{x1:i+1,y1:h,x2:i+s-1,y2:h,fill:"none",stroke:"#fff"}),v.createElement("line",{x1:i+1,y1:h+2,x2:i+s-1,y2:h+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return v.isValidElement(r)?o=v.cloneElement(r,i):qt(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,l=r.x,c=r.travellerWidth,h=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||h!==i.prevUpdateId)return Bg({prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s},o&&o.length?Rit({data:o,width:s,x:l,travellerWidth:c,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]);var m=i.scale.domain().map(function(y){return i.scale(y)});return{prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,l=o-1;l-s>1;){var c=Math.floor((s+l)/2);r[c]>i?l=c:s=c}return i>=r[l]?l:s}}])}(v.PureComponent);br(jl,"displayName","Brush");br(jl,"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 Lit=R0;function Nit(e,t){var n;return Lit(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var jit=Nit,Dit=$O,Bit=Ai,zit=jit,Fit=cr,Wit=Hp;function Vit(e,t,n){var r=Fit(e)?Dit:zit;return n&&Wit(e,t,n)&&(t=void 0),r(e,Bit(t))}var Uit=Vit;const Hit=$e(Uit);var _i=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},EA=tM;function qit(e,t,n){t=="__proto__"&&EA?EA(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Git=qit,Zit=Git,Yit=JO,Kit=Ai;function Xit(e,t){var n={};return t=Kit(t),Yit(e,function(r,i,o){Zit(n,i,t(r,i,o))}),n}var Jit=Xit;const Qit=$e(Jit);function tot(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var eot=tot,not=R0;function rot(e,t){var n=!0;return not(e,function(r,i,o){return n=!!t(r,i,o),n}),n}var iot=rot,oot=eot,sot=iot,aot=Ai,lot=cr,cot=Hp;function uot(e,t,n){var r=lot(e)?oot:sot;return n&&cot(e,t,n)&&(t=void 0),r(e,aot(t))}var hot=uot;const Wk=$e(hot);var fot=["x","y"];function Dl(e){"@babel/helpers - typeof";return Dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dl(e)}function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nv.apply(this,arguments)}function CA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CA(Object(n),!0).forEach(function(r){dot(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dot(e,t,n){return t=pot(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pot(e){var t=mot(e,"string");return Dl(t)=="symbol"?t:t+""}function mot(e,t){if(Dl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function got(e,t){if(e==null)return{};var n=yot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vot(e,t){var n=e.x,r=e.y,i=got(e,fot),o="".concat(n),s=parseInt(o,10),l="".concat(r),c=parseInt(l,10),h="".concat(t.height||i.height),u=parseInt(h,10),f="".concat(t.width||i.width),m=parseInt(f,10);return Jc(Jc(Jc(Jc(Jc({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:u,width:m,name:t.name,radius:t.radius})}function OA(e){return v.createElement(Gd,Nv({shapeType:"rectangle",propTransformer:vot,activeClassName:"recharts-active-bar"},e))}var bot=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=wt(r)||kW(r);return o?t(r,i):(o||(process.env.NODE_ENV!=="production"?ir(!1,"minPointSize callback function received a value with type of ".concat(Dl(r),". Currently only numbers or null/undefined are supported.")):ir()),n)}},xot=["value","background"],Vk;function Bl(e){"@babel/helpers - typeof";return Bl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bl(e)}function wot(e,t){if(e==null)return{};var n=_ot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _ot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jd.apply(this,arguments)}function MA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MA(Object(n),!0).forEach(function(r){qo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hk(r.key),r)}}function Pot(e,t,n){return t&&kA(e.prototype,t),n&&kA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aot(e,t,n){return t=Qd(t),Tot(e,Uk()?Reflect.construct(t,n||[],Qd(e).constructor):t.apply(e,n))}function Tot(e,t){if(t&&(Bl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eot(e)}function Eot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Uk=function(){return!!e})()}function Qd(e){return Qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qd(e)}function Cot(e,t){if(typeof t!="function"&&t!==null)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&&jv(e,t)}function jv(e,t){return jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jv(e,t)}function qo(e,t,n){return t=Hk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hk(e){var t=Oot(e,"string");return Bl(t)=="symbol"?t:t+""}function Oot(e,t){if(Bl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Aa=function(e){function t(){var n;Sot(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Aot(this,t,[].concat(i)),qo(n,"state",{isAnimationFinished:!1}),qo(n,"id",wa("recharts-bar-")),qo(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),qo(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return Cot(t,e),Pot(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,o=this.props,s=o.shape,l=o.dataKey,c=o.activeIndex,h=o.activeBar,u=Dt(this.props,!1);return r&&r.map(function(f,m){var y=m===c,x=y?h:s,p=pn(pn(pn({},u),f),{},{isActive:y,option:x,index:m,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return v.createElement(fe,Jd({className:"recharts-bar-rectangle"},es(i.props,f,m),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(m)}),v.createElement(OA,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,o=i.data,s=i.layout,l=i.isAnimationActive,c=i.animationBegin,h=i.animationDuration,u=i.animationEasing,f=i.animationId,m=this.state.prevData;return v.createElement(ni,{begin:c,duration:h,isActive:l,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var x=y.t,p=o.map(function(b,P){var S=m&&m[P];if(S){var A=An(S.x,b.x),E=An(S.y,b.y),w=An(S.width,b.width),T=An(S.height,b.height);return pn(pn({},b),{},{x:A(x),y:E(x),width:w(x),height:T(x)})}if(s==="horizontal"){var O=An(0,b.height),I=O(x);return pn(pn({},b),{},{y:b.y+b.height-I,height:I})}var N=An(0,b.width),F=N(x);return pn(pn({},b),{},{width:F})});return v.createElement(fe,null,r.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,o=r.isAnimationActive,s=this.state.prevData;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,o=i.data,s=i.dataKey,l=i.activeIndex,c=Dt(this.props.background,!1);return o.map(function(h,u){h.value;var f=h.background,m=wot(h,xot);if(!f)return null;var y=pn(pn(pn(pn(pn({},m),{},{fill:"#eee"},f),c),es(r.props,h,u)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:u,className:"recharts-bar-background-rectangle"});return v.createElement(OA,Jd({key:"background-bar-".concat(u),option:r.props.background,isActive:u===l},y))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.data,l=o.xAxis,c=o.yAxis,h=o.layout,u=o.children,f=sr(u,Ch);if(!f)return null;var m=h==="vertical"?s[0].height/2:s[0].width/2,y=function(b,P){var S=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:S,errorVal:tn(b,P)}},x={clipPath:r?"url(#clipPath-".concat(i,")"):null};return v.createElement(fe,x,f.map(function(p){return v.cloneElement(p,{key:"error-bar-".concat(i,"-").concat(p.props.dataKey),data:s,xAxis:l,yAxis:c,layout:h,offset:m,dataPointFormatter:y})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.data,s=r.className,l=r.xAxis,c=r.yAxis,h=r.left,u=r.top,f=r.width,m=r.height,y=r.isAnimationActive,x=r.background,p=r.id;if(i||!o||!o.length)return null;var b=this.state.isAnimationFinished,P=te("recharts-bar",s),S=l&&l.allowDataOverflow,A=c&&c.allowDataOverflow,E=S||A,w=Zt(p)?this.id:p;return v.createElement(fe,{className:P},S||A?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(w)},v.createElement("rect",{x:S?h:h-f/2,y:A?u:u-m/2,width:S?f:f*2,height:A?m:m*2}))):null,v.createElement(fe,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(w,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,w),(!y||b)&&wi.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(v.PureComponent);Vk=Aa;qo(Aa,"displayName","Bar");qo(Aa,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ss.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});qo(Aa,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,o=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,h=e.stackedData,u=e.dataStartIndex,f=e.displayedData,m=e.offset,y=JJ(r,n);if(!y)return null;var x=t.layout,p=n.type.defaultProps,b=p!==void 0?pn(pn({},p),n.props):n.props,P=b.dataKey,S=b.children,A=b.minPointSize,E=x==="horizontal"?s:o,w=h?E.scale.domain():null,T=oQ({numericAxis:E}),O=sr(S,Sh),I=f.map(function(N,F){var D,j,K,U,z,Y;h?D=QJ(h[u+F],w):(D=tn(N,P),Array.isArray(D)||(D=[T,D]));var G=bot(A,Vk.defaultProps.minPointSize)(D[1],F);if(x==="horizontal"){var X,lt=[s.scale(D[0]),s.scale(D[1])],H=lt[0],et=lt[1];j=pP({axis:o,ticks:l,bandSize:i,offset:y.offset,entry:N,index:F}),K=(X=et??H)!==null&&X!==void 0?X:void 0,U=y.size;var it=H-et;if(z=Number.isNaN(it)?0:it,Y={x:j,y:s.y,width:U,height:s.height},Math.abs(G)>0&&Math.abs(z)<Math.abs(G)){var st=qn(z||G)*(Math.abs(G)-Math.abs(z));K-=st,z+=st}}else{var ct=[o.scale(D[0]),o.scale(D[1])],yt=ct[0],vt=ct[1];if(j=yt,K=pP({axis:s,ticks:c,bandSize:i,offset:y.offset,entry:N,index:F}),U=vt-yt,z=y.size,Y={x:o.x,y:K,width:o.width,height:z},Math.abs(G)>0&&Math.abs(U)<Math.abs(G)){var Et=qn(U||G)*(Math.abs(G)-Math.abs(U));U+=Et}}return pn(pn(pn({},N),{},{x:j,y:K,width:U,height:z,value:h?D:D[1],payload:N,background:Y},O&&O[F]&&O[F].props),{},{tooltipPayload:[mk(n,N)],tooltipPosition:{x:j+U/2,y:K+z/2}})});return pn({data:I,layout:x},m)});function uh(e){"@babel/helpers - typeof";return uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uh(e)}function Mot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qk(r.key),r)}}function kot(e,t,n){return t&&$A(e.prototype,t),n&&$A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function IA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IA(Object(n),!0).forEach(function(r){um(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function um(e,t,n){return t=qk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qk(e){var t=$ot(e,"string");return uh(t)=="symbol"?t:t+""}function $ot(e,t){if(uh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ux=function(t,n,r,i,o){var s=t.width,l=t.height,c=t.layout,h=t.children,u=Object.keys(n),f={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},m=!!xr(h,Aa);return u.reduce(function(y,x){var p=n[x],b=p.orientation,P=p.domain,S=p.padding,A=S===void 0?{}:S,E=p.mirror,w=p.reversed,T="".concat(b).concat(E?"Mirror":""),O,I,N,F,D;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var j=P[1]-P[0],K=1/0,U=p.categoricalDomain.sort(LW);if(U.forEach(function(ct,yt){yt>0&&(K=Math.min((ct||0)-(U[yt-1]||0),K))}),Number.isFinite(K)){var z=K/j,Y=p.layout==="vertical"?r.height:r.width;if(p.padding==="gap"&&(O=z*Y/2),p.padding==="no-gap"){var G=Gn(t.barCategoryGap,z*Y),X=z*Y/2;O=X-G-(X-G)/Y*G}}}i==="xAxis"?I=[r.left+(A.left||0)+(O||0),r.left+r.width-(A.right||0)-(O||0)]:i==="yAxis"?I=c==="horizontal"?[r.top+r.height-(A.bottom||0),r.top+(A.top||0)]:[r.top+(A.top||0)+(O||0),r.top+r.height-(A.bottom||0)-(O||0)]:I=p.range,w&&(I=[I[1],I[0]]);var lt=hk(p,o,m),H=lt.scale,et=lt.realScaleType;H.domain(P).range(I),fk(H);var it=dk(H,Jr(Jr({},p),{},{realScaleType:et}));i==="xAxis"?(D=b==="top"&&!E||b==="bottom"&&E,N=r.left,F=f[T]-D*p.height):i==="yAxis"&&(D=b==="left"&&!E||b==="right"&&E,N=f[T]-D*p.width,F=r.top);var st=Jr(Jr(Jr({},p),it),{},{realScaleType:et,x:N,y:F,scale:H,width:i==="xAxis"?r.width:p.width,height:i==="yAxis"?r.height:p.height});return st.bandSize=Rd(st,it),!p.hide&&i==="xAxis"?f[T]+=(D?-1:1)*st.height:p.hide||(f[T]+=(D?-1:1)*st.width),Jr(Jr({},y),{},um({},x,st))},{})},Gk=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},Iot=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return Gk({x:n,y:r},{x:i,y:o})},Zk=function(){function e(t){Mot(this,e),this.scale=t}return kot(e,[{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(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();um(Zk,"EPS",1e-4);var hx=function(t){var n=Object.keys(t).reduce(function(r,i){return Jr(Jr({},r),{},um({},i,Zk.create(t[i])))},{});return Jr(Jr({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,l=o.position;return Qit(i,function(c,h){return n[h].apply(c,{bandAware:s,position:l})})},isInRange:function(i){return Wk(i,function(o,s){return n[s].isInRange(o)})}})};function Rot(e){return(e%180+180)%180}var Lot=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Rot(i),s=o*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},Not=Ai,jot=_h,Dot=Vp;function Bot(e){return function(t,n,r){var i=Object(t);if(!jot(t)){var o=Not(n);t=Dot(t),n=function(l){return o(i[l],l,i)}}var s=e(t,n,r);return s>-1?i[o?t[s]:s]:void 0}}var zot=Bot,Fot=Dk;function Wot(e){var t=Fot(e),n=t%1;return t===t?n?t-n:t:0}var Vot=Wot,Uot=qO,Hot=Ai,qot=Vot,Got=Math.max;function Zot(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:qot(n);return i<0&&(i=Got(r+i,0)),Uot(e,Hot(t),i)}var Yot=Zot,Kot=zot,Xot=Yot,Jot=Kot(Xot),Qot=Jot;const tst=$e(Qot);var est=j3(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")});function tp(e){"@babel/helpers - typeof";return tp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tp(e)}var fx=v.createContext(void 0),dx=v.createContext(void 0),Yk=v.createContext(void 0),Kk=v.createContext({}),Xk=v.createContext(void 0),Jk=v.createContext(0),Qk=v.createContext(0),RA=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,l=t.children,c=t.width,h=t.height,u=est(o);return v.createElement(fx.Provider,{value:r},v.createElement(dx.Provider,{value:i},v.createElement(Kk.Provider,{value:o},v.createElement(Yk.Provider,{value:u},v.createElement(Xk.Provider,{value:s},v.createElement(Jk.Provider,{value:h},v.createElement(Qk.Provider,{value:c},l)))))))},nst=function(){return v.useContext(Xk)};function t$(e){var t=Object.keys(e);return t.length===0?"There are no available ids.":"Available ids are: ".concat(t,".")}var e$=function(t){var n=v.useContext(fx);n==null&&(process.env.NODE_ENV!=="production"?ir(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):ir());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?ir(!1,'Could not find xAxis by id "'.concat(t,'" [').concat(tp(t),"]. ").concat(t$(n))):ir()),r},rst=function(){var t=v.useContext(fx);return Wo(t)},ist=function(){var t=v.useContext(dx),n=tst(t,function(r){return Wk(r.domain,Number.isFinite)});return n||Wo(t)},n$=function(t){var n=v.useContext(dx);n==null&&(process.env.NODE_ENV!=="production"?ir(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):ir());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?ir(!1,'Could not find yAxis by id "'.concat(t,'" [').concat(tp(t),"]. ").concat(t$(n))):ir()),r},ost=function(){var t=v.useContext(Yk);return t},sst=function(){return v.useContext(Kk)},px=function(){return v.useContext(Qk)},mx=function(){return v.useContext(Jk)};function zl(e){"@babel/helpers - typeof";return zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zl(e)}function ast(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lst(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i$(r.key),r)}}function cst(e,t,n){return t&&lst(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ust(e,t,n){return t=ep(t),hst(e,r$()?Reflect.construct(t,n||[],ep(e).constructor):t.apply(e,n))}function hst(e,t){if(t&&(zl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fst(e)}function fst(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r$=function(){return!!e})()}function ep(e){return ep=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ep(e)}function dst(e,t){if(typeof t!="function"&&t!==null)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&&Dv(e,t)}function Dv(e,t){return Dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Dv(e,t)}function LA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LA(Object(n),!0).forEach(function(r){gx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gx(e,t,n){return t=i$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i$(e){var t=pst(e,"string");return zl(t)=="symbol"?t:t+""}function pst(e,t){if(zl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function mst(e,t){return bst(e)||vst(e,t)||yst(e,t)||gst()}function gst(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
112
+ the props "valueKey" will be deprecated in 1.1.0`),P=f);var S=i.filter(function(I){return tn(I,P,0)!==0}).length,A=(b>=360?S:S-1)*c,E=b-S*y-A,w=i.reduce(function(I,N){var F=tn(N,P,0);return I+(wt(F)?F:0)},0),T;if(w>0){var O;T=i.map(function(I,N){var F=tn(I,P,0),D=tn(I,u,N),j=(wt(F)?F:0)/w,K;N?K=O.endAngle+qn(p)*c*(F!==0?1:0):K=s;var U=K+qn(p)*((F!==0?y:0)+j*E),z=(K+U)/2,Y=(x.innerRadius+x.outerRadius)/2,G=[{name:D,value:F,payload:I,dataKey:P,type:m}],X=Fe(x.cx,x.cy,Y,z);return O=De(De(De({percent:j,cornerRadius:o,name:D,tooltipPayload:G,midAngle:z,middleRadius:Y,tooltipPosition:X},I),x),{},{value:tn(I,P),startAngle:K,endAngle:U,payload:I,paddingAngle:qn(p)*c}),O})}return De(De({},x),{},{sectors:T,data:i})});var cit=Math.ceil,uit=Math.max;function hit(e,t,n,r){for(var i=-1,o=uit(cit((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}var fit=hit,dit=oM,wA=1/0,pit=17976931348623157e292;function mit(e){if(!e)return e===0?e:0;if(e=dit(e),e===wA||e===-wA){var t=e<0?-1:1;return t*pit}return e===e?e:0}var Dk=mit,git=fit,yit=Hp,Dg=Dk;function vit(e){return function(t,n,r){return r&&typeof r!="number"&&yit(t,n,r)&&(n=r=void 0),t=Dg(t),n===void 0?(n=t,t=0):n=Dg(n),r=r===void 0?t<n?1:-1:Dg(r),git(t,n,r,e)}}var bit=vit,xit=bit,wit=xit(),_it=wit;const Yd=$e(_it);function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(e)}function _A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function SA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_A(Object(n),!0).forEach(function(r){Bk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_A(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bk(e,t,n){return t=Sit(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sit(e){var t=Pit(e,"string");return ch(t)=="symbol"?t:t+""}function Pit(e,t){if(ch(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ch(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ait=["Webkit","Moz","O","ms"],Tit=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),i=Ait.reduce(function(o,s){return SA(SA({},o),{},Bk({},s+r,n))},{});return i[t]=n,i};function Nl(e){"@babel/helpers - typeof";return Nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(e)}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kd.apply(this,arguments)}function PA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PA(Object(n),!0).forEach(function(r){br(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Fk(r.key),r)}}function Cit(e,t,n){return t&&AA(e.prototype,t),n&&AA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oit(e,t,n){return t=Xd(t),Mit(e,zk()?Reflect.construct(t,n||[],Xd(e).constructor):t.apply(e,n))}function Mit(e,t){if(t&&(Nl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kit(e)}function kit(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zk=function(){return!!e})()}function Xd(e){return Xd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xd(e)}function $it(e,t){if(typeof t!="function"&&t!==null)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&&Lv(e,t)}function Lv(e,t){return Lv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Lv(e,t)}function br(e,t,n){return t=Fk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fk(e){var t=Iit(e,"string");return Nl(t)=="symbol"?t:t+""}function Iit(e,t){if(Nl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rit=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,o=t.x,s=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,h=mu().domain(Yd(0,c)).range([o,o+s-l]),u=h.domain().map(function(f){return h(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:h(r),endX:h(i),scale:h,scaleValues:u}},TA=function(t){return t.changedTouches&&!!t.changedTouches.length},jl=function(e){function t(n){var r;return Eit(this,t),r=Oit(this,t,[n]),br(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),br(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),br(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:o,startIndex:l})}),r.detachDragEndListener()}),br(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),br(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),br(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),br(r,"handleSlideDragStart",function(i){var o=TA(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return $it(t,e),Cit(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,l=this.props,c=l.gap,h=l.data,u=h.length-1,f=Math.min(i,o),m=Math.max(i,o),y=t.getIndexInRange(s,f),x=t.getIndexInRange(s,m);return{startIndex:y-y%c,endIndex:x===u?u:x-x%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,l=i.dataKey,c=tn(o[r],l,r);return qt(s)?s(c,r):c}},{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(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,h=c.x,u=c.width,f=c.travellerWidth,m=c.startIndex,y=c.endIndex,x=c.onChange,p=r.pageX-o;p>0?p=Math.min(p,h+u-f-l,h+u-f-s):p<0&&(p=Math.max(p,h-s,h-l));var b=this.getIndex({startX:s+p,endX:l+p});(b.startIndex!==m||b.endIndex!==y)&&x&&x(b),this.setState({startX:s+p,endX:l+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=TA(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,l=i.endX,c=i.startX,h=this.state[s],u=this.props,f=u.x,m=u.width,y=u.travellerWidth,x=u.onChange,p=u.gap,b=u.data,P={startX:this.state.startX,endX:this.state.endX},S=r.pageX-o;S>0?S=Math.min(S,f+m-y-h):S<0&&(S=Math.max(S,f-h)),P[s]=h+S;var A=this.getIndex(P),E=A.startIndex,w=A.endIndex,T=function(){var I=b.length-1;return s==="startX"&&(l>c?E%p===0:w%p===0)||l<c&&w===I||s==="endX"&&(l>c?w%p===0:E%p===0)||l>c&&w===I};this.setState(br(br({},s,h+S),"brushMoveStartX",r.pageX),function(){x&&T()&&x(A)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,l=s.scaleValues,c=s.startX,h=s.endX,u=this.state[i],f=l.indexOf(u);if(f!==-1){var m=f+r;if(!(m===-1||m>=l.length)){var y=l[m];i==="startX"&&y>=h||i==="endX"&&y<=c||this.setState(br({},i,y),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.fill,h=r.stroke;return v.createElement("rect",{stroke:h,fill:c,x:i,y:o,width:s,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.data,h=r.children,u=r.padding,f=v.Children.only(h);return f?v.cloneElement(f,{x:i,y:o,width:s,height:l,margin:u,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,l=this,c=this.props,h=c.y,u=c.travellerWidth,f=c.height,m=c.traveller,y=c.ariaLabel,x=c.data,p=c.startIndex,b=c.endIndex,P=Math.max(r,this.props.x),S=Bg(Bg({},Dt(this.props,!1)),{},{x:P,y:h,width:u,height:f}),A=y||"Min value: ".concat((o=x[p])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=x[b])===null||s===void 0?void 0:s.name);return v.createElement(fe,{tabIndex:0,role:"slider","aria-label":A,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),l.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,S))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,l=o.height,c=o.stroke,h=o.travellerWidth,u=Math.min(r,i)+h,f=Math.max(Math.abs(i-r)-h,0);return v.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:u,y:s,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,l=r.height,c=r.travellerWidth,h=r.stroke,u=this.state,f=u.startX,m=u.endX,y=5,x={pointerEvents:"none",fill:h};return v.createElement(fe,{className:"recharts-brush-texts"},v.createElement(da,Kd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,m)-y,y:s+l/2},x),this.getTextOfTick(i)),v.createElement(da,Kd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,m)+c+y,y:s+l/2},x),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,l=r.x,c=r.y,h=r.width,u=r.height,f=r.alwaysShowText,m=this.state,y=m.startX,x=m.endX,p=m.isTextActive,b=m.isSlideMoving,P=m.isTravellerMoving,S=m.isTravellerFocused;if(!i||!i.length||!wt(l)||!wt(c)||!wt(h)||!wt(u)||h<=0||u<=0)return null;var A=te("recharts-brush",o),E=v.Children.count(s)===1,w=Tit("userSelect","none");return v.createElement(fe,{className:A,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(y,x),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(x,"endX"),(p||b||P||S||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,l=r.height,c=r.stroke,h=Math.floor(o+l/2)-1;return v.createElement(v.Fragment,null,v.createElement("rect",{x:i,y:o,width:s,height:l,fill:c,stroke:"none"}),v.createElement("line",{x1:i+1,y1:h,x2:i+s-1,y2:h,fill:"none",stroke:"#fff"}),v.createElement("line",{x1:i+1,y1:h+2,x2:i+s-1,y2:h+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return v.isValidElement(r)?o=v.cloneElement(r,i):qt(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,l=r.x,c=r.travellerWidth,h=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||h!==i.prevUpdateId)return Bg({prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s},o&&o.length?Rit({data:o,width:s,x:l,travellerWidth:c,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]);var m=i.scale.domain().map(function(y){return i.scale(y)});return{prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,l=o-1;l-s>1;){var c=Math.floor((s+l)/2);r[c]>i?l=c:s=c}return i>=r[l]?l:s}}])}(v.PureComponent);br(jl,"displayName","Brush");br(jl,"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 Lit=R0;function Nit(e,t){var n;return Lit(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var jit=Nit,Dit=$O,Bit=Ai,zit=jit,Fit=cr,Wit=Hp;function Vit(e,t,n){var r=Fit(e)?Dit:zit;return n&&Wit(e,t,n)&&(t=void 0),r(e,Bit(t))}var Uit=Vit;const Hit=$e(Uit);var _i=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},EA=tM;function qit(e,t,n){t=="__proto__"&&EA?EA(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Git=qit,Zit=Git,Yit=JO,Kit=Ai;function Xit(e,t){var n={};return t=Kit(t),Yit(e,function(r,i,o){Zit(n,i,t(r,i,o))}),n}var Jit=Xit;const Qit=$e(Jit);function tot(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var eot=tot,not=R0;function rot(e,t){var n=!0;return not(e,function(r,i,o){return n=!!t(r,i,o),n}),n}var iot=rot,oot=eot,sot=iot,aot=Ai,lot=cr,cot=Hp;function uot(e,t,n){var r=lot(e)?oot:sot;return n&&cot(e,t,n)&&(t=void 0),r(e,aot(t))}var hot=uot;const Wk=$e(hot);var fot=["x","y"];function Dl(e){"@babel/helpers - typeof";return Dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dl(e)}function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nv.apply(this,arguments)}function CA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CA(Object(n),!0).forEach(function(r){dot(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dot(e,t,n){return t=pot(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pot(e){var t=mot(e,"string");return Dl(t)=="symbol"?t:t+""}function mot(e,t){if(Dl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function got(e,t){if(e==null)return{};var n=yot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vot(e,t){var n=e.x,r=e.y,i=got(e,fot),o="".concat(n),s=parseInt(o,10),l="".concat(r),c=parseInt(l,10),h="".concat(t.height||i.height),u=parseInt(h,10),f="".concat(t.width||i.width),m=parseInt(f,10);return Jc(Jc(Jc(Jc(Jc({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:u,width:m,name:t.name,radius:t.radius})}function OA(e){return v.createElement(Gd,Nv({shapeType:"rectangle",propTransformer:vot,activeClassName:"recharts-active-bar"},e))}var bot=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=wt(r)||kW(r);return o?t(r,i):(o||(process.env.NODE_ENV!=="production"?ir(!1,"minPointSize callback function received a value with type of ".concat(Dl(r),". Currently only numbers or null/undefined are supported.")):ir()),n)}},xot=["value","background"],Vk;function Bl(e){"@babel/helpers - typeof";return Bl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bl(e)}function wot(e,t){if(e==null)return{};var n=_ot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _ot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jd.apply(this,arguments)}function MA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MA(Object(n),!0).forEach(function(r){qo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hk(r.key),r)}}function Pot(e,t,n){return t&&kA(e.prototype,t),n&&kA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aot(e,t,n){return t=Qd(t),Tot(e,Uk()?Reflect.construct(t,n||[],Qd(e).constructor):t.apply(e,n))}function Tot(e,t){if(t&&(Bl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eot(e)}function Eot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Uk=function(){return!!e})()}function Qd(e){return Qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qd(e)}function Cot(e,t){if(typeof t!="function"&&t!==null)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&&jv(e,t)}function jv(e,t){return jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jv(e,t)}function qo(e,t,n){return t=Hk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hk(e){var t=Oot(e,"string");return Bl(t)=="symbol"?t:t+""}function Oot(e,t){if(Bl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Aa=function(e){function t(){var n;Sot(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Aot(this,t,[].concat(i)),qo(n,"state",{isAnimationFinished:!1}),qo(n,"id",wa("recharts-bar-")),qo(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),qo(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return Cot(t,e),Pot(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,o=this.props,s=o.shape,l=o.dataKey,c=o.activeIndex,h=o.activeBar,u=Dt(this.props,!1);return r&&r.map(function(f,m){var y=m===c,x=y?h:s,p=pn(pn(pn({},u),f),{},{isActive:y,option:x,index:m,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return v.createElement(fe,Jd({className:"recharts-bar-rectangle"},es(i.props,f,m),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(m)}),v.createElement(OA,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,o=i.data,s=i.layout,l=i.isAnimationActive,c=i.animationBegin,h=i.animationDuration,u=i.animationEasing,f=i.animationId,m=this.state.prevData;return v.createElement(ni,{begin:c,duration:h,isActive:l,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var x=y.t,p=o.map(function(b,P){var S=m&&m[P];if(S){var A=An(S.x,b.x),E=An(S.y,b.y),w=An(S.width,b.width),T=An(S.height,b.height);return pn(pn({},b),{},{x:A(x),y:E(x),width:w(x),height:T(x)})}if(s==="horizontal"){var O=An(0,b.height),I=O(x);return pn(pn({},b),{},{y:b.y+b.height-I,height:I})}var N=An(0,b.width),F=N(x);return pn(pn({},b),{},{width:F})});return v.createElement(fe,null,r.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,o=r.isAnimationActive,s=this.state.prevData;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,o=i.data,s=i.dataKey,l=i.activeIndex,c=Dt(this.props.background,!1);return o.map(function(h,u){h.value;var f=h.background,m=wot(h,xot);if(!f)return null;var y=pn(pn(pn(pn(pn({},m),{},{fill:"#eee"},f),c),es(r.props,h,u)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:u,className:"recharts-bar-background-rectangle"});return v.createElement(OA,Jd({key:"background-bar-".concat(u),option:r.props.background,isActive:u===l},y))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.data,l=o.xAxis,c=o.yAxis,h=o.layout,u=o.children,f=sr(u,Ch);if(!f)return null;var m=h==="vertical"?s[0].height/2:s[0].width/2,y=function(b,P){var S=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:S,errorVal:tn(b,P)}},x={clipPath:r?"url(#clipPath-".concat(i,")"):null};return v.createElement(fe,x,f.map(function(p){return v.cloneElement(p,{key:"error-bar-".concat(i,"-").concat(p.props.dataKey),data:s,xAxis:l,yAxis:c,layout:h,offset:m,dataPointFormatter:y})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.data,s=r.className,l=r.xAxis,c=r.yAxis,h=r.left,u=r.top,f=r.width,m=r.height,y=r.isAnimationActive,x=r.background,p=r.id;if(i||!o||!o.length)return null;var b=this.state.isAnimationFinished,P=te("recharts-bar",s),S=l&&l.allowDataOverflow,A=c&&c.allowDataOverflow,E=S||A,w=Zt(p)?this.id:p;return v.createElement(fe,{className:P},S||A?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(w)},v.createElement("rect",{x:S?h:h-f/2,y:A?u:u-m/2,width:S?f:f*2,height:A?m:m*2}))):null,v.createElement(fe,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(w,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,w),(!y||b)&&wi.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(v.PureComponent);Vk=Aa;qo(Aa,"displayName","Bar");qo(Aa,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ss.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});qo(Aa,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,o=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,h=e.stackedData,u=e.dataStartIndex,f=e.displayedData,m=e.offset,y=JJ(r,n);if(!y)return null;var x=t.layout,p=n.type.defaultProps,b=p!==void 0?pn(pn({},p),n.props):n.props,P=b.dataKey,S=b.children,A=b.minPointSize,E=x==="horizontal"?s:o,w=h?E.scale.domain():null,T=oQ({numericAxis:E}),O=sr(S,Sh),I=f.map(function(N,F){var D,j,K,U,z,Y;h?D=QJ(h[u+F],w):(D=tn(N,P),Array.isArray(D)||(D=[T,D]));var G=bot(A,Vk.defaultProps.minPointSize)(D[1],F);if(x==="horizontal"){var X,lt=[s.scale(D[0]),s.scale(D[1])],H=lt[0],et=lt[1];j=pP({axis:o,ticks:l,bandSize:i,offset:y.offset,entry:N,index:F}),K=(X=et??H)!==null&&X!==void 0?X:void 0,U=y.size;var it=H-et;if(z=Number.isNaN(it)?0:it,Y={x:j,y:s.y,width:U,height:s.height},Math.abs(G)>0&&Math.abs(z)<Math.abs(G)){var at=qn(z||G)*(Math.abs(G)-Math.abs(z));K-=at,z+=at}}else{var ct=[o.scale(D[0]),o.scale(D[1])],yt=ct[0],vt=ct[1];if(j=yt,K=pP({axis:s,ticks:c,bandSize:i,offset:y.offset,entry:N,index:F}),U=vt-yt,z=y.size,Y={x:o.x,y:K,width:o.width,height:z},Math.abs(G)>0&&Math.abs(U)<Math.abs(G)){var Et=qn(U||G)*(Math.abs(G)-Math.abs(U));U+=Et}}return pn(pn(pn({},N),{},{x:j,y:K,width:U,height:z,value:h?D:D[1],payload:N,background:Y},O&&O[F]&&O[F].props),{},{tooltipPayload:[mk(n,N)],tooltipPosition:{x:j+U/2,y:K+z/2}})});return pn({data:I,layout:x},m)});function uh(e){"@babel/helpers - typeof";return uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uh(e)}function Mot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qk(r.key),r)}}function kot(e,t,n){return t&&$A(e.prototype,t),n&&$A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function IA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IA(Object(n),!0).forEach(function(r){um(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function um(e,t,n){return t=qk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qk(e){var t=$ot(e,"string");return uh(t)=="symbol"?t:t+""}function $ot(e,t){if(uh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ux=function(t,n,r,i,o){var s=t.width,l=t.height,c=t.layout,h=t.children,u=Object.keys(n),f={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},m=!!xr(h,Aa);return u.reduce(function(y,x){var p=n[x],b=p.orientation,P=p.domain,S=p.padding,A=S===void 0?{}:S,E=p.mirror,w=p.reversed,T="".concat(b).concat(E?"Mirror":""),O,I,N,F,D;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var j=P[1]-P[0],K=1/0,U=p.categoricalDomain.sort(LW);if(U.forEach(function(ct,yt){yt>0&&(K=Math.min((ct||0)-(U[yt-1]||0),K))}),Number.isFinite(K)){var z=K/j,Y=p.layout==="vertical"?r.height:r.width;if(p.padding==="gap"&&(O=z*Y/2),p.padding==="no-gap"){var G=Gn(t.barCategoryGap,z*Y),X=z*Y/2;O=X-G-(X-G)/Y*G}}}i==="xAxis"?I=[r.left+(A.left||0)+(O||0),r.left+r.width-(A.right||0)-(O||0)]:i==="yAxis"?I=c==="horizontal"?[r.top+r.height-(A.bottom||0),r.top+(A.top||0)]:[r.top+(A.top||0)+(O||0),r.top+r.height-(A.bottom||0)-(O||0)]:I=p.range,w&&(I=[I[1],I[0]]);var lt=hk(p,o,m),H=lt.scale,et=lt.realScaleType;H.domain(P).range(I),fk(H);var it=dk(H,Jr(Jr({},p),{},{realScaleType:et}));i==="xAxis"?(D=b==="top"&&!E||b==="bottom"&&E,N=r.left,F=f[T]-D*p.height):i==="yAxis"&&(D=b==="left"&&!E||b==="right"&&E,N=f[T]-D*p.width,F=r.top);var at=Jr(Jr(Jr({},p),it),{},{realScaleType:et,x:N,y:F,scale:H,width:i==="xAxis"?r.width:p.width,height:i==="yAxis"?r.height:p.height});return at.bandSize=Rd(at,it),!p.hide&&i==="xAxis"?f[T]+=(D?-1:1)*at.height:p.hide||(f[T]+=(D?-1:1)*at.width),Jr(Jr({},y),{},um({},x,at))},{})},Gk=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},Iot=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return Gk({x:n,y:r},{x:i,y:o})},Zk=function(){function e(t){Mot(this,e),this.scale=t}return kot(e,[{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(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();um(Zk,"EPS",1e-4);var hx=function(t){var n=Object.keys(t).reduce(function(r,i){return Jr(Jr({},r),{},um({},i,Zk.create(t[i])))},{});return Jr(Jr({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,l=o.position;return Qit(i,function(c,h){return n[h].apply(c,{bandAware:s,position:l})})},isInRange:function(i){return Wk(i,function(o,s){return n[s].isInRange(o)})}})};function Rot(e){return(e%180+180)%180}var Lot=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Rot(i),s=o*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},Not=Ai,jot=_h,Dot=Vp;function Bot(e){return function(t,n,r){var i=Object(t);if(!jot(t)){var o=Not(n);t=Dot(t),n=function(l){return o(i[l],l,i)}}var s=e(t,n,r);return s>-1?i[o?t[s]:s]:void 0}}var zot=Bot,Fot=Dk;function Wot(e){var t=Fot(e),n=t%1;return t===t?n?t-n:t:0}var Vot=Wot,Uot=qO,Hot=Ai,qot=Vot,Got=Math.max;function Zot(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:qot(n);return i<0&&(i=Got(r+i,0)),Uot(e,Hot(t),i)}var Yot=Zot,Kot=zot,Xot=Yot,Jot=Kot(Xot),Qot=Jot;const tst=$e(Qot);var est=j3(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")});function tp(e){"@babel/helpers - typeof";return tp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tp(e)}var fx=v.createContext(void 0),dx=v.createContext(void 0),Yk=v.createContext(void 0),Kk=v.createContext({}),Xk=v.createContext(void 0),Jk=v.createContext(0),Qk=v.createContext(0),RA=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,l=t.children,c=t.width,h=t.height,u=est(o);return v.createElement(fx.Provider,{value:r},v.createElement(dx.Provider,{value:i},v.createElement(Kk.Provider,{value:o},v.createElement(Yk.Provider,{value:u},v.createElement(Xk.Provider,{value:s},v.createElement(Jk.Provider,{value:h},v.createElement(Qk.Provider,{value:c},l)))))))},nst=function(){return v.useContext(Xk)};function t$(e){var t=Object.keys(e);return t.length===0?"There are no available ids.":"Available ids are: ".concat(t,".")}var e$=function(t){var n=v.useContext(fx);n==null&&(process.env.NODE_ENV!=="production"?ir(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):ir());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?ir(!1,'Could not find xAxis by id "'.concat(t,'" [').concat(tp(t),"]. ").concat(t$(n))):ir()),r},rst=function(){var t=v.useContext(fx);return Wo(t)},ist=function(){var t=v.useContext(dx),n=tst(t,function(r){return Wk(r.domain,Number.isFinite)});return n||Wo(t)},n$=function(t){var n=v.useContext(dx);n==null&&(process.env.NODE_ENV!=="production"?ir(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):ir());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?ir(!1,'Could not find yAxis by id "'.concat(t,'" [').concat(tp(t),"]. ").concat(t$(n))):ir()),r},ost=function(){var t=v.useContext(Yk);return t},sst=function(){return v.useContext(Kk)},px=function(){return v.useContext(Qk)},mx=function(){return v.useContext(Jk)};function zl(e){"@babel/helpers - typeof";return zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zl(e)}function ast(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lst(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i$(r.key),r)}}function cst(e,t,n){return t&&lst(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ust(e,t,n){return t=ep(t),hst(e,r$()?Reflect.construct(t,n||[],ep(e).constructor):t.apply(e,n))}function hst(e,t){if(t&&(zl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fst(e)}function fst(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r$=function(){return!!e})()}function ep(e){return ep=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ep(e)}function dst(e,t){if(typeof t!="function"&&t!==null)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&&Dv(e,t)}function Dv(e,t){return Dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Dv(e,t)}function LA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LA(Object(n),!0).forEach(function(r){gx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gx(e,t,n){return t=i$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i$(e){var t=pst(e,"string");return zl(t)=="symbol"?t:t+""}function pst(e,t){if(zl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function mst(e,t){return bst(e)||vst(e,t)||yst(e,t)||gst()}function gst(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
113
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yst(e,t){if(e){if(typeof e=="string")return jA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jA(e,t)}}function jA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vst(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function bst(e){if(Array.isArray(e))return e}function Bv(){return Bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bv.apply(this,arguments)}var xst=function(t,n){var r;return v.isValidElement(t)?r=v.cloneElement(t,n):qt(t)?r=t(n):r=v.createElement("line",Bv({},n,{className:"recharts-reference-line-line"})),r},wst=function(t,n,r,i,o,s,l,c,h){var u=o.x,f=o.y,m=o.width,y=o.height;if(r){var x=h.y,p=t.y.apply(x,{position:s});if(_i(h,"discard")&&!t.y.isInRange(p))return null;var b=[{x:u+m,y:p},{x:u,y:p}];return c==="left"?b.reverse():b}if(n){var P=h.x,S=t.x.apply(P,{position:s});if(_i(h,"discard")&&!t.x.isInRange(S))return null;var A=[{x:S,y:f+y},{x:S,y:f}];return l==="top"?A.reverse():A}if(i){var E=h.segment,w=E.map(function(T){return t.apply(T,{position:s})});return _i(h,"discard")&&Hit(w,function(T){return!t.isInRange(T)})?null:w}return null};function _st(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,o=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,h=nst(),u=e$(i),f=n$(o),m=ost();if(!h||!m)return null;ei(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var y=hx({x:u.scale,y:f.scale}),x=wn(t),p=wn(n),b=r&&r.length===2,P=wst(y,x,p,b,m,e.position,u.orientation,f.orientation,e);if(!P)return null;var S=mst(P,2),A=S[0],E=A.x,w=A.y,T=S[1],O=T.x,I=T.y,N=_i(e,"hidden")?"url(#".concat(h,")"):void 0,F=NA(NA({clipPath:N},Dt(e,!0)),{},{x1:E,y1:w,x2:O,y2:I});return v.createElement(fe,{className:te("recharts-reference-line",l)},xst(s,F),Tn.renderCallByParent(e,Iot({x1:E,y1:w,x2:O,y2:I})))}var yx=function(e){function t(){return ast(this,t),ust(this,t,arguments)}return dst(t,e),cst(t,[{key:"render",value:function(){return v.createElement(_st,this.props)}}])}(v.Component);gx(yx,"displayName","ReferenceLine");gx(yx,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function zv(){return zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zv.apply(this,arguments)}function Fl(e){"@babel/helpers - typeof";return Fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fl(e)}function DA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DA(Object(n),!0).forEach(function(r){hm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sst(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pst(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s$(r.key),r)}}function Ast(e,t,n){return t&&Pst(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tst(e,t,n){return t=np(t),Est(e,o$()?Reflect.construct(t,n||[],np(e).constructor):t.apply(e,n))}function Est(e,t){if(t&&(Fl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cst(e)}function Cst(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o$=function(){return!!e})()}function np(e){return np=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},np(e)}function Ost(e,t){if(typeof t!="function"&&t!==null)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&&Fv(e,t)}function Fv(e,t){return Fv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Fv(e,t)}function hm(e,t,n){return t=s$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s$(e){var t=Mst(e,"string");return Fl(t)=="symbol"?t:t+""}function Mst(e,t){if(Fl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kst=function(t){var n=t.x,r=t.y,i=t.xAxis,o=t.yAxis,s=hx({x:i.scale,y:o.scale}),l=s.apply({x:n,y:r},{bandAware:!0});return _i(t,"discard")&&!s.isInRange(l)?null:l},fm=function(e){function t(){return Sst(this,t),Tst(this,t,arguments)}return Ost(t,e),Ast(t,[{key:"render",value:function(){var r=this.props,i=r.x,o=r.y,s=r.r,l=r.alwaysShow,c=r.clipPathId,h=wn(i),u=wn(o);if(ei(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!h||!u)return null;var f=kst(this.props);if(!f)return null;var m=f.x,y=f.y,x=this.props,p=x.shape,b=x.className,P=_i(this.props,"hidden")?"url(#".concat(c,")"):void 0,S=BA(BA({clipPath:P},Dt(this.props,!0)),{},{cx:m,cy:y});return v.createElement(fe,{className:te("recharts-reference-dot",b)},t.renderDot(p,S),Tn.renderCallByParent(this.props,{x:m-s,y:y-s,width:2*s,height:2*s}))}}])}(v.Component);hm(fm,"displayName","ReferenceDot");hm(fm,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});hm(fm,"renderDot",function(e,t){var n;return v.isValidElement(e)?n=v.cloneElement(e,t):qt(e)?n=e(t):n=v.createElement(rm,zv({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Wv(){return Wv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wv.apply(this,arguments)}function Wl(e){"@babel/helpers - typeof";return Wl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wl(e)}function zA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function FA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zA(Object(n),!0).forEach(function(r){dm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $st(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ist(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l$(r.key),r)}}function Rst(e,t,n){return t&&Ist(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lst(e,t,n){return t=rp(t),Nst(e,a$()?Reflect.construct(t,n||[],rp(e).constructor):t.apply(e,n))}function Nst(e,t){if(t&&(Wl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jst(e)}function jst(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(a$=function(){return!!e})()}function rp(e){return rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rp(e)}function Dst(e,t){if(typeof t!="function"&&t!==null)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&&Vv(e,t)}function Vv(e,t){return Vv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Vv(e,t)}function dm(e,t,n){return t=l$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l$(e){var t=Bst(e,"string");return Wl(t)=="symbol"?t:t+""}function Bst(e,t){if(Wl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zst=function(t,n,r,i,o){var s=o.x1,l=o.x2,c=o.y1,h=o.y2,u=o.xAxis,f=o.yAxis;if(!u||!f)return null;var m=hx({x:u.scale,y:f.scale}),y={x:t?m.x.apply(s,{position:"start"}):m.x.rangeMin,y:r?m.y.apply(c,{position:"start"}):m.y.rangeMin},x={x:n?m.x.apply(l,{position:"end"}):m.x.rangeMax,y:i?m.y.apply(h,{position:"end"}):m.y.rangeMax};return _i(o,"discard")&&(!m.isInRange(y)||!m.isInRange(x))?null:Gk(y,x)},pm=function(e){function t(){return $st(this,t),Lst(this,t,arguments)}return Dst(t,e),Rst(t,[{key:"render",value:function(){var r=this.props,i=r.x1,o=r.x2,s=r.y1,l=r.y2,c=r.className,h=r.alwaysShow,u=r.clipPathId;ei(h===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=wn(i),m=wn(o),y=wn(s),x=wn(l),p=this.props.shape;if(!f&&!m&&!y&&!x&&!p)return null;var b=zst(f,m,y,x,this.props);if(!b&&!p)return null;var P=_i(this.props,"hidden")?"url(#".concat(u,")"):void 0;return v.createElement(fe,{className:te("recharts-reference-area",c)},t.renderRect(p,FA(FA({clipPath:P},Dt(this.props,!0)),b)),Tn.renderCallByParent(this.props,b))}}])}(v.Component);dm(pm,"displayName","ReferenceArea");dm(pm,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});dm(pm,"renderRect",function(e,t){var n;return v.isValidElement(e)?n=v.cloneElement(e,t):qt(e)?n=e(t):n=v.createElement(cx,Wv({},t,{className:"recharts-reference-area-rect"})),n});function c$(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function Fst(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Lot(r,n)}function Wst(e,t,n){var r=n==="width",i=e.x,o=e.y,s=e.width,l=e.height;return t===1?{start:r?i:o,end:r?i+s:o+l}:{start:r?i+s:o+l,end:r?i:o}}function ip(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function Vst(e,t){return c$(e,t+1)}function Ust(e,t,n,r,i){for(var o=(r||[]).slice(),s=t.start,l=t.end,c=0,h=1,u=s,f=function(){var x=r==null?void 0:r[c];if(x===void 0)return{v:c$(r,h)};var p=c,b,P=function(){return b===void 0&&(b=n(x,p)),b},S=x.coordinate,A=c===0||ip(e,S,P,u,l);A||(c=0,u=s,h+=1),A&&(u=S+e*(P()/2+i),c+=h)},m;h<=o.length;)if(m=f(),m)return m.v;return[]}function hh(e){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hh(e)}function WA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WA(Object(n),!0).forEach(function(r){Hst(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hst(e,t,n){return t=qst(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qst(e){var t=Gst(e,"string");return hh(t)=="symbol"?t:t+""}function Gst(e,t){if(hh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zst(e,t,n,r,i){for(var o=(r||[]).slice(),s=o.length,l=t.start,c=t.end,h=function(m){var y=o[m],x,p=function(){return x===void 0&&(x=n(y,m)),x};if(m===s-1){var b=e*(y.coordinate+e*p()/2-c);o[m]=y=Fn(Fn({},y),{},{tickCoord:b>0?y.coordinate-b*e:y.coordinate})}else o[m]=y=Fn(Fn({},y),{},{tickCoord:y.coordinate});var P=ip(e,y.tickCoord,p,l,c);P&&(c=y.tickCoord-e*(p()/2+i),o[m]=Fn(Fn({},y),{},{isShow:!0}))},u=s-1;u>=0;u--)h(u);return o}function Yst(e,t,n,r,i,o){var s=(r||[]).slice(),l=s.length,c=t.start,h=t.end;if(o){var u=r[l-1],f=n(u,l-1),m=e*(u.coordinate+e*f/2-h);s[l-1]=u=Fn(Fn({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate});var y=ip(e,u.tickCoord,function(){return f},c,h);y&&(h=u.tickCoord-e*(f/2+i),s[l-1]=Fn(Fn({},u),{},{isShow:!0}))}for(var x=o?l-1:l,p=function(S){var A=s[S],E,w=function(){return E===void 0&&(E=n(A,S)),E};if(S===0){var T=e*(A.coordinate-e*w()/2-c);s[S]=A=Fn(Fn({},A),{},{tickCoord:T<0?A.coordinate-T*e:A.coordinate})}else s[S]=A=Fn(Fn({},A),{},{tickCoord:A.coordinate});var O=ip(e,A.tickCoord,w,c,h);O&&(c=A.tickCoord+e*(w()/2+i),s[S]=Fn(Fn({},A),{},{isShow:!0}))},b=0;b<x;b++)p(b);return s}function vx(e,t,n){var r=e.tick,i=e.ticks,o=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,h=e.tickFormatter,u=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(wt(c)||ss.isSsr)return Vst(i,typeof c=="number"&&wt(c)?c:0);var m=[],y=l==="top"||l==="bottom"?"width":"height",x=u&&y==="width"?pu(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},p=function(A,E){var w=qt(h)?h(A.value,E):A.value;return y==="width"?Fst(pu(w,{fontSize:t,letterSpacing:n}),x,f):pu(w,{fontSize:t,letterSpacing:n})[y]},b=i.length>=2?qn(i[1].coordinate-i[0].coordinate):1,P=Wst(o,b,y);return c==="equidistantPreserveStart"?Ust(b,P,p,i,s):(c==="preserveStart"||c==="preserveStartEnd"?m=Yst(b,P,p,i,s,c==="preserveStartEnd"):m=Zst(b,P,p,i,s),m.filter(function(S){return S.isShow}))}var Kst=["viewBox"],Xst=["viewBox"],Jst=["ticks"];function Vl(e){"@babel/helpers - typeof";return Vl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vl(e)}function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},al.apply(this,arguments)}function VA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VA(Object(n),!0).forEach(function(r){bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zg(e,t){if(e==null)return{};var n=Qst(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qst(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function tat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h$(r.key),r)}}function eat(e,t,n){return t&&UA(e.prototype,t),n&&UA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nat(e,t,n){return t=op(t),rat(e,u$()?Reflect.construct(t,n||[],op(e).constructor):t.apply(e,n))}function rat(e,t){if(t&&(Vl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iat(e)}function iat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u$=function(){return!!e})()}function op(e){return op=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},op(e)}function oat(e,t){if(typeof t!="function"&&t!==null)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&&Uv(e,t)}function Uv(e,t){return Uv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Uv(e,t)}function bx(e,t,n){return t=h$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h$(e){var t=sat(e,"string");return Vl(t)=="symbol"?t:t+""}function sat(e,t){if(Vl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yc=function(e){function t(n){var r;return tat(this,t),r=nat(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return oat(t,e),eat(t,[{key:"shouldComponentUpdate",value:function(r,i){var o=r.viewBox,s=zg(r,Kst),l=this.props,c=l.viewBox,h=zg(l,Xst);return!fl(o,c)||!fl(s,h)||!fl(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.x,s=i.y,l=i.width,c=i.height,h=i.orientation,u=i.tickSize,f=i.mirror,m=i.tickMargin,y,x,p,b,P,S,A=f?-1:1,E=r.tickSize||u,w=wt(r.tickCoord)?r.tickCoord:r.coordinate;switch(h){case"top":y=x=r.coordinate,b=s+ +!f*c,p=b-A*E,S=p-A*m,P=w;break;case"left":p=b=r.coordinate,x=o+ +!f*l,y=x-A*E,P=y-A*m,S=w;break;case"right":p=b=r.coordinate,x=o+ +f*l,y=x+A*E,P=y+A*m,S=w;break;default:y=x=r.coordinate,b=s+ +f*c,p=b+A*E,S=p+A*m,P=w;break}return{line:{x1:y,y1:p,x2:x,y2:b},tick:{x:P,y:S}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s;switch(i){case"left":s=o?"start":"end";break;case"right":s=o?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=o?"start":"end";break;default:s=o?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.orientation,h=r.mirror,u=r.axisLine,f=vn(vn(vn({},Dt(this.props,!1)),Dt(u,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var m=+(c==="top"&&!h||c==="bottom"&&h);f=vn(vn({},f),{},{x1:i,y1:o+m*l,x2:i+s,y2:o+m*l})}else{var y=+(c==="left"&&!h||c==="right"&&h);f=vn(vn({},f),{},{x1:i+y*s,y1:o,x2:i+y*s,y2:o+l})}return v.createElement("line",al({},f,{className:te("recharts-cartesian-axis-line",Pr(u,"className"))}))}},{key:"renderTicks",value:function(r,i,o){var s=this,l=this.props,c=l.tickLine,h=l.stroke,u=l.tick,f=l.tickFormatter,m=l.unit,y=vx(vn(vn({},this.props),{},{ticks:r}),i,o),x=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),b=Dt(this.props,!1),P=Dt(u,!1),S=vn(vn({},b),{},{fill:"none"},Dt(c,!1)),A=y.map(function(E,w){var T=s.getTickLineCoord(E),O=T.line,I=T.tick,N=vn(vn(vn(vn({textAnchor:x,verticalAnchor:p},b),{},{stroke:"none",fill:h},P),I),{},{index:w,payload:E,visibleTicksCount:y.length,tickFormatter:f});return v.createElement(fe,al({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},es(s.props,E,w)),c&&v.createElement("line",al({},S,O,{className:te("recharts-cartesian-axis-tick-line",Pr(c,"className"))})),u&&t.renderTickItem(u,N,"".concat(qt(f)?f(E.value,w):E.value).concat(m||"")))});return v.createElement("g",{className:"recharts-cartesian-axis-ticks"},A)}},{key:"render",value:function(){var r=this,i=this.props,o=i.axisLine,s=i.width,l=i.height,c=i.ticksGenerator,h=i.className,u=i.hide;if(u)return null;var f=this.props,m=f.ticks,y=zg(f,Jst),x=m;return qt(c)&&(x=m&&m.length>0?c(this.props):c(y)),s<=0||l<=0||!x||!x.length?null:v.createElement(fe,{className:te("recharts-cartesian-axis",h),ref:function(b){r.layerReference=b}},o&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),Tn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s,l=te(i.className,"recharts-cartesian-axis-tick-value");return v.isValidElement(r)?s=v.cloneElement(r,vn(vn({},i),{},{className:l})):qt(r)?s=r(vn(vn({},i),{},{className:l})):s=v.createElement(da,al({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])}(v.Component);bx(yc,"displayName","CartesianAxis");bx(yc,"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 aat=["x1","y1","x2","y2","key"],lat=["offset"];function ga(e){"@babel/helpers - typeof";return ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(e)}function HA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HA(Object(n),!0).forEach(function(r){cat(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cat(e,t,n){return t=uat(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uat(e){var t=hat(e,"string");return ga(t)=="symbol"?t:t+""}function hat(e,t){if(ga(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ga(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qs(){return Qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qs.apply(this,arguments)}function qA(e,t){if(e==null)return{};var n=fat(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fat(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var dat=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,o=t.y,s=t.width,l=t.height,c=t.ry;return v.createElement("rect",{x:i,y:o,ry:c,width:s,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function f$(e,t){var n;if(v.isValidElement(e))n=v.cloneElement(e,t);else if(qt(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,s=t.y2,l=t.key,c=qA(t,aat),h=Dt(c,!1);h.offset;var u=qA(h,lat);n=v.createElement("line",Qs({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:l}))}return n}function pat(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(l,c){var h=Wn(Wn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return f$(i,h)});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function mat(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(l,c){var h=Wn(Wn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return f$(i,h)});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function gat(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,h=c===void 0?!0:c;if(!h||!t||!t.length)return null;var u=l.map(function(m){return Math.round(m+i-i)}).sort(function(m,y){return m-y});i!==u[0]&&u.unshift(0);var f=u.map(function(m,y){var x=!u[y+1],p=x?i+s-m:u[y+1]-m;if(p<=0)return null;var b=y%t.length;return v.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:p,width:o,stroke:"none",fill:t[b],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function yat(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,l=e.width,c=e.height,h=e.verticalPoints;if(!n||!r||!r.length)return null;var u=h.map(function(m){return Math.round(m+o-o)}).sort(function(m,y){return m-y});o!==u[0]&&u.unshift(0);var f=u.map(function(m,y){var x=!u[y+1],p=x?o+l-m:u[y+1]-m;if(p<=0)return null;var b=y%r.length;return v.createElement("rect",{key:"react-".concat(y),x:m,y:s,width:p,height:c,stroke:"none",fill:r[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var vat=function(t,n){var r=t.xAxis,i=t.width,o=t.height,s=t.offset;return uk(vx(Wn(Wn(Wn({},yc.defaultProps),r),{},{ticks:io(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},bat=function(t,n){var r=t.yAxis,i=t.width,o=t.height,s=t.offset;return uk(vx(Wn(Wn(Wn({},yc.defaultProps),r),{},{ticks:io(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},Za={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function mm(e){var t,n,r,i,o,s,l=px(),c=mx(),h=sst(),u=Wn(Wn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Za.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Za.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Za.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Za.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:Za.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Za.verticalFill,x:wt(e.x)?e.x:h.left,y:wt(e.y)?e.y:h.top,width:wt(e.width)?e.width:h.width,height:wt(e.height)?e.height:h.height}),f=u.x,m=u.y,y=u.width,x=u.height,p=u.syncWithTicks,b=u.horizontalValues,P=u.verticalValues,S=rst(),A=ist();if(!wt(y)||y<=0||!wt(x)||x<=0||!wt(f)||f!==+f||!wt(m)||m!==+m)return null;var E=u.verticalCoordinatesGenerator||vat,w=u.horizontalCoordinatesGenerator||bat,T=u.horizontalPoints,O=u.verticalPoints;if((!T||!T.length)&&qt(w)){var I=b&&b.length,N=w({yAxis:A?Wn(Wn({},A),{},{ticks:I?b:A.ticks}):void 0,width:l,height:c,offset:h},I?!0:p);ei(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ga(N),"]")),Array.isArray(N)&&(T=N)}if((!O||!O.length)&&qt(E)){var F=P&&P.length,D=E({xAxis:S?Wn(Wn({},S),{},{ticks:F?P:S.ticks}):void 0,width:l,height:c,offset:h},F?!0:p);ei(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ga(D),"]")),Array.isArray(D)&&(O=D)}return v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(dat,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),v.createElement(pat,Qs({},u,{offset:h,horizontalPoints:T,xAxis:S,yAxis:A})),v.createElement(mat,Qs({},u,{offset:h,verticalPoints:O,xAxis:S,yAxis:A})),v.createElement(gat,Qs({},u,{horizontalPoints:T})),v.createElement(yat,Qs({},u,{verticalPoints:O})))}mm.displayName="CartesianGrid";var xat=["layout","type","stroke","connectNulls","isRange","ref"],wat=["key"],d$;function Ul(e){"@babel/helpers - typeof";return Ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ul(e)}function p$(e,t){if(e==null)return{};var n=_at(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _at(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ta(){return ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}function GA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GA(Object(n),!0).forEach(function(r){gi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g$(r.key),r)}}function Pat(e,t,n){return t&&ZA(e.prototype,t),n&&ZA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aat(e,t,n){return t=sp(t),Tat(e,m$()?Reflect.construct(t,n||[],sp(e).constructor):t.apply(e,n))}function Tat(e,t){if(t&&(Ul(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eat(e)}function Eat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m$=function(){return!!e})()}function sp(e){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sp(e)}function Cat(e,t){if(typeof t!="function"&&t!==null)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&&Hv(e,t)}function Hv(e,t){return Hv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Hv(e,t)}function gi(e,t,n){return t=g$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g$(e){var t=Oat(e,"string");return Ul(t)=="symbol"?t:t+""}function Oat(e,t){if(Ul(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ul(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var us=function(e){function t(){var n;Sat(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Aat(this,t,[].concat(i)),gi(n,"state",{isAnimationFinished:!0}),gi(n,"id",wa("recharts-area-")),gi(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),qt(s)&&s()}),gi(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),qt(s)&&s()}),n}return Cat(t,e),Pat(t,[{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(s&&!l)return null;var c=this.props,h=c.dot,u=c.points,f=c.dataKey,m=Dt(this.props,!1),y=Dt(h,!0),x=u.map(function(b,P){var S=Bo(Bo(Bo({key:"dot-".concat(P),r:3},m),y),{},{index:P,cx:b.x,cy:b.y,dataKey:f,value:b.value,payload:b.payload,points:u});return t.renderDotItem(h,S)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return v.createElement(fe,ta({className:"recharts-area-dots"},p),x)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,o=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].x,h=s[s.length-1].x,u=r*Math.abs(c-h),f=Ho(s.map(function(m){return m.y||0}));return wt(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Ho(o.map(function(m){return m.y||0})),f)),wt(f)?v.createElement("rect",{x:c<h?c:c-u,y:0,width:u,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,o=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].y,h=s[s.length-1].y,u=r*Math.abs(c-h),f=Ho(s.map(function(m){return m.x||0}));return wt(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Ho(o.map(function(m){return m.x||0})),f)),wt(f)?v.createElement("rect",{x:0,y:c<h?c:c-u,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,o,s){var l=this.props,c=l.layout,h=l.type,u=l.stroke,f=l.connectNulls,m=l.isRange;l.ref;var y=p$(l,xat);return v.createElement(fe,{clipPath:o?"url(#clipPath-".concat(s,")"):null},v.createElement(sa,ta({},Dt(y,!0),{points:r,connectNulls:f,type:h,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),u!=="none"&&v.createElement(sa,ta({},Dt(this.props,!1),{className:"recharts-area-curve",layout:c,type:h,connectNulls:f,fill:"none",points:r})),u!=="none"&&m&&v.createElement(sa,ta({},Dt(this.props,!1),{className:"recharts-area-curve",layout:c,type:h,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var o=this,s=this.props,l=s.points,c=s.baseLine,h=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,m=s.animationEasing,y=s.animationId,x=this.state,p=x.prevPoints,b=x.prevBaseLine;return v.createElement(ni,{begin:u,duration:f,isActive:h,easing:m,from:{t:0},to:{t:1},key:"area-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var S=P.t;if(p){var A=p.length/l.length,E=l.map(function(I,N){var F=Math.floor(N*A);if(p[F]){var D=p[F],j=An(D.x,I.x),K=An(D.y,I.y);return Bo(Bo({},I),{},{x:j(S),y:K(S)})}return I}),w;if(wt(c)&&typeof c=="number"){var T=An(b,c);w=T(S)}else if(Zt(c)||uc(c)){var O=An(b,0);w=O(S)}else w=c.map(function(I,N){var F=Math.floor(N*A);if(b[F]){var D=b[F],j=An(D.x,I.x),K=An(D.y,I.y);return Bo(Bo({},I),{},{x:j(S),y:K(S)})}return I});return o.renderAreaStatically(E,w,r,i)}return v.createElement(fe,null,v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(i)},o.renderClipRect(S))),v.createElement(fe,{clipPath:"url(#animationClipPath-".concat(i,")")},o.renderAreaStatically(l,c,r,i)))})}},{key:"renderArea",value:function(r,i){var o=this.props,s=o.points,l=o.baseLine,c=o.isAnimationActive,h=this.state,u=h.prevPoints,f=h.prevBaseLine,m=h.totalLength;return c&&s&&s.length&&(!u&&m>0||!pa(u,s)||!pa(f,l))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,l,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,l=i.points,c=i.className,h=i.top,u=i.left,f=i.xAxis,m=i.yAxis,y=i.width,x=i.height,p=i.isAnimationActive,b=i.id;if(o||!l||!l.length)return null;var P=this.state.isAnimationFinished,S=l.length===1,A=te("recharts-area",c),E=f&&f.allowDataOverflow,w=m&&m.allowDataOverflow,T=E||w,O=Zt(b)?this.id:b,I=(r=Dt(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},N=I.r,F=N===void 0?3:N,D=I.strokeWidth,j=D===void 0?2:D,K=UW(s)?s:{},U=K.clipDot,z=U===void 0?!0:U,Y=F*2+j;return v.createElement(fe,{className:A},E||w?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(O)},v.createElement("rect",{x:E?u:u-y/2,y:w?h:h-x/2,width:E?y:y*2,height:w?x:x*2})),!z&&v.createElement("clipPath",{id:"clipPath-dots-".concat(O)},v.createElement("rect",{x:u-Y/2,y:h-Y/2,width:y+Y,height:x+Y}))):null,S?null:this.renderArea(T,O),(s||S)&&this.renderDots(T,z,O),(!p||P)&&wi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(v.PureComponent);d$=us;gi(us,"displayName","Area");gi(us,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ss.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});gi(us,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,s=t.props.baseValue,l=s??o;if(wt(l)&&typeof l=="number")return l;var c=i==="horizontal"?r:n,h=c.scale.domain();if(c.type==="number"){var u=Math.max(h[0],h[1]),f=Math.min(h[0],h[1]);return l==="dataMin"?f:l==="dataMax"||u<0?u:Math.max(Math.min(h[0],h[1]),0)}return l==="dataMin"?h[0]:l==="dataMax"?h[1]:h[0]});gi(us,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,s=e.yAxisTicks,l=e.bandSize,c=e.dataKey,h=e.stackedData,u=e.dataStartIndex,f=e.displayedData,m=e.offset,y=t.layout,x=h&&h.length,p=d$.getBaseValue(t,n,r,i),b=y==="horizontal",P=!1,S=f.map(function(E,w){var T;x?T=h[u+w]:(T=tn(E,c),Array.isArray(T)?P=!0:T=[p,T]);var O=T[1]==null||x&&tn(E,c)==null;return b?{x:Id({axis:r,ticks:o,bandSize:l,entry:E,index:w}),y:O?null:i.scale(T[1]),value:T,payload:E}:{x:O?null:r.scale(T[1]),y:Id({axis:i,ticks:s,bandSize:l,entry:E,index:w}),value:T,payload:E}}),A;return x||P?A=S.map(function(E){var w=Array.isArray(E.value)?E.value[0]:null;return b?{x:E.x,y:w!=null&&E.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:E.y}}):A=b?i.scale(p):r.scale(p),Bo({points:S,baseLine:A,layout:y,isRange:P},m)});gi(us,"renderDotItem",function(e,t){var n;if(v.isValidElement(e))n=v.cloneElement(e,t);else if(qt(e))n=e(t);else{var r=te("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=p$(t,wat);n=v.createElement(rm,ta({},o,{key:i,className:r}))}return n});function Hl(e){"@babel/helpers - typeof";return Hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hl(e)}function Mat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kat(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b$(r.key),r)}}function $at(e,t,n){return t&&kat(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iat(e,t,n){return t=ap(t),Rat(e,y$()?Reflect.construct(t,n||[],ap(e).constructor):t.apply(e,n))}function Rat(e,t){if(t&&(Hl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lat(e)}function Lat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y$=function(){return!!e})()}function ap(e){return ap=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ap(e)}function Nat(e,t){if(typeof t!="function"&&t!==null)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&&qv(e,t)}function qv(e,t){return qv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qv(e,t)}function v$(e,t,n){return t=b$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b$(e){var t=jat(e,"string");return Hl(t)=="symbol"?t:t+""}function jat(e,t){if(Hl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Oh=function(e){function t(){return Mat(this,t),Iat(this,t,arguments)}return Nat(t,e),$at(t,[{key:"render",value:function(){return null}}])}(Yn.Component);v$(Oh,"displayName","ZAxis");v$(Oh,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var Dat=["option","isActive"];function xu(){return xu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xu.apply(this,arguments)}function Bat(e,t){if(e==null)return{};var n=zat(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zat(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Fat(e){var t=e.option,n=e.isActive,r=Bat(e,Dat);return typeof t=="string"?Yn.createElement(Gd,xu({option:Yn.createElement(Wp,xu({type:t},r)),isActive:n,shapeType:"symbols"},r)):Yn.createElement(Gd,xu({option:t,isActive:n,shapeType:"symbols"},r))}function ql(e){"@babel/helpers - typeof";return ql=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ql(e)}function wu(){return wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wu.apply(this,arguments)}function YA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YA(Object(n),!0).forEach(function(r){Go(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w$(r.key),r)}}function Vat(e,t,n){return t&&KA(e.prototype,t),n&&KA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uat(e,t,n){return t=lp(t),Hat(e,x$()?Reflect.construct(t,n||[],lp(e).constructor):t.apply(e,n))}function Hat(e,t){if(t&&(ql(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qat(e)}function qat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x$=function(){return!!e})()}function lp(e){return lp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lp(e)}function Gat(e,t){if(typeof t!="function"&&t!==null)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&&Gv(e,t)}function Gv(e,t){return Gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Gv(e,t)}function Go(e,t,n){return t=w$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w$(e){var t=Zat(e,"string");return ql(t)=="symbol"?t:t+""}function Zat(e,t){if(ql(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ql(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Mh=function(e){function t(){var n;Wat(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Uat(this,t,[].concat(i)),Go(n,"state",{isAnimationFinished:!1}),Go(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),Go(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),Go(n,"id",wa("recharts-scatter-")),n}return Gat(t,e),Vat(t,[{key:"renderSymbolsStatically",value:function(r){var i=this,o=this.props,s=o.shape,l=o.activeShape,c=o.activeIndex,h=Dt(this.props,!1);return r.map(function(u,f){var m=c===f,y=m?l:s,x=jr(jr({},h),u);return v.createElement(fe,wu({className:"recharts-scatter-symbol",key:"symbol-".concat(u==null?void 0:u.cx,"-").concat(u==null?void 0:u.cy,"-").concat(u==null?void 0:u.size,"-").concat(f)},es(i.props,u,f),{role:"img"}),v.createElement(Fat,wu({option:y,isActive:m,key:"symbol-".concat(f)},x)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,i=this.props,o=i.points,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,h=i.animationEasing,u=i.animationId,f=this.state.prevPoints;return v.createElement(ni,{begin:l,duration:c,isActive:s,easing:h,from:{t:0},to:{t:1},key:"pie-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var y=m.t,x=o.map(function(p,b){var P=f&&f[b];if(P){var S=An(P.cx,p.cx),A=An(P.cy,p.cy),E=An(P.size,p.size);return jr(jr({},p),{},{cx:S(y),cy:A(y),size:E(y)})}var w=An(0,p.size);return jr(jr({},p),{},{size:w(y)})});return v.createElement(fe,null,r.renderSymbolsStatically(x))})}},{key:"renderSymbols",value:function(){var r=this.props,i=r.points,o=r.isAnimationActive,s=this.state.prevPoints;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(i)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,l=i.yAxis,c=i.children,h=sr(c,Ch);return h?h.map(function(u,f){var m=u.props,y=m.direction,x=m.dataKey;return v.cloneElement(u,{key:"".concat(y,"-").concat(x,"-").concat(o[f]),data:o,xAxis:s,yAxis:l,layout:y==="x"?"vertical":"horizontal",dataPointFormatter:function(b,P){return{x:b.cx,y:b.cy,value:y==="x"?+b.node.x:+b.node.y,errorVal:tn(b,P)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,i=r.points,o=r.line,s=r.lineType,l=r.lineJointType,c=Dt(this.props,!1),h=Dt(o,!1),u,f;if(s==="joint")u=i.map(function(A){return{x:A.cx,y:A.cy}});else if(s==="fitting"){var m=RW(i),y=m.xmin,x=m.xmax,p=m.a,b=m.b,P=function(E){return p*E+b};u=[{x:y,y:P(y)},{x,y:P(x)}]}var S=jr(jr(jr({},c),{},{fill:"none",stroke:c&&c.fill},h),{},{points:u});return v.isValidElement(o)?f=v.cloneElement(o,S):qt(o)?f=o(S):f=v.createElement(sa,wu({},S,{type:l})),v.createElement(fe,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.points,s=r.line,l=r.className,c=r.xAxis,h=r.yAxis,u=r.left,f=r.top,m=r.width,y=r.height,x=r.id,p=r.isAnimationActive;if(i||!o||!o.length)return null;var b=this.state.isAnimationFinished,P=te("recharts-scatter",l),S=c&&c.allowDataOverflow,A=h&&h.allowDataOverflow,E=S||A,w=Zt(x)?this.id:x;return v.createElement(fe,{className:P,clipPath:E?"url(#clipPath-".concat(w,")"):null},S||A?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(w)},v.createElement("rect",{x:S?u:u-m/2,y:A?f:f-y/2,width:S?m:m*2,height:A?y:y*2}))):null,s&&this.renderLine(),this.renderErrorBar(),v.createElement(fe,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!p||b)&&wi.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}}])}(v.PureComponent);Go(Mh,"displayName","Scatter");Go(Mh,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!ss.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});Go(Mh,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,i=e.item,o=e.displayedData,s=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,h=i.props.tooltipType,u=sr(i.props.children,Sh),f=Zt(t.dataKey)?i.props.dataKey:t.dataKey,m=Zt(n.dataKey)?i.props.dataKey:n.dataKey,y=r&&r.dataKey,x=r?r.range:Oh.defaultProps.range,p=x&&x[0],b=t.scale.bandwidth?t.scale.bandwidth():0,P=n.scale.bandwidth?n.scale.bandwidth():0,S=o.map(function(A,E){var w=tn(A,f),T=tn(A,m),O=!Zt(y)&&tn(A,y)||"-",I=[{name:Zt(t.dataKey)?i.props.name:t.name||t.dataKey,unit:t.unit||"",value:w,payload:A,dataKey:f,type:h},{name:Zt(n.dataKey)?i.props.name:n.name||n.dataKey,unit:n.unit||"",value:T,payload:A,dataKey:m,type:h}];O!=="-"&&I.push({name:r.name||r.dataKey,unit:r.unit||"",value:O,payload:A,dataKey:y,type:h});var N=Id({axis:t,ticks:s,bandSize:b,entry:A,index:E,dataKey:f}),F=Id({axis:n,ticks:l,bandSize:P,entry:A,index:E,dataKey:m}),D=O!=="-"?r.scale(O):p,j=Math.sqrt(Math.max(D,0)/Math.PI);return jr(jr({},A),{},{cx:N,cy:F,x:N-j,y:F-j,xAxis:t,yAxis:n,zAxis:r,width:2*j,height:2*j,size:D,node:{x:w,y:T,z:O},tooltipPayload:I,tooltipPosition:{x:N,y:F},payload:A},u&&u[E]&&u[E].props)});return jr({points:S},c)});function Gl(e){"@babel/helpers - typeof";return Gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gl(e)}function Yat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kat(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P$(r.key),r)}}function Xat(e,t,n){return t&&Kat(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jat(e,t,n){return t=cp(t),Qat(e,_$()?Reflect.construct(t,n||[],cp(e).constructor):t.apply(e,n))}function Qat(e,t){if(t&&(Gl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tlt(e)}function tlt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_$=function(){return!!e})()}function cp(e){return cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cp(e)}function elt(e,t){if(typeof t!="function"&&t!==null)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&&Zv(e,t)}function Zv(e,t){return Zv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Zv(e,t)}function S$(e,t,n){return t=P$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P$(e){var t=nlt(e,"string");return Gl(t)=="symbol"?t:t+""}function nlt(e,t){if(Gl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Yv(){return Yv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yv.apply(this,arguments)}function rlt(e){var t=e.xAxisId,n=px(),r=mx(),i=e$(t);return i==null?null:Yn.createElement(yc,Yv({},i,{className:te("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return io(s,!0)}}))}var hs=function(e){function t(){return Yat(this,t),Jat(this,t,arguments)}return elt(t,e),Xat(t,[{key:"render",value:function(){return Yn.createElement(rlt,this.props)}}])}(Yn.Component);S$(hs,"displayName","XAxis");S$(hs,"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});function Zl(e){"@babel/helpers - typeof";return Zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zl(e)}function ilt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function olt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E$(r.key),r)}}function slt(e,t,n){return t&&olt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function alt(e,t,n){return t=up(t),llt(e,A$()?Reflect.construct(t,n||[],up(e).constructor):t.apply(e,n))}function llt(e,t){if(t&&(Zl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return clt(e)}function clt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A$=function(){return!!e})()}function up(e){return up=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},up(e)}function ult(e,t){if(typeof t!="function"&&t!==null)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&&Kv(e,t)}function Kv(e,t){return Kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Kv(e,t)}function T$(e,t,n){return t=E$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E$(e){var t=hlt(e,"string");return Zl(t)=="symbol"?t:t+""}function hlt(e,t){if(Zl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xv.apply(this,arguments)}var flt=function(t){var n=t.yAxisId,r=px(),i=mx(),o=n$(n);return o==null?null:Yn.createElement(yc,Xv({},o,{className:te("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return io(l,!0)}}))},fs=function(e){function t(){return ilt(this,t),alt(this,t,arguments)}return ult(t,e),slt(t,[{key:"render",value:function(){return Yn.createElement(flt,this.props)}}])}(Yn.Component);T$(fs,"displayName","YAxis");T$(fs,"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});function XA(e){return glt(e)||mlt(e)||plt(e)||dlt()}function dlt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
114
114
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function plt(e,t){if(e){if(typeof e=="string")return Jv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jv(e,t)}}function mlt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function glt(e){if(Array.isArray(e))return Jv(e)}function Jv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qv=function(t,n,r,i,o){var s=sr(t,yx),l=sr(t,fm),c=[].concat(XA(s),XA(l)),h=sr(t,pm),u="".concat(i,"Id"),f=i[0],m=n;if(c.length&&(m=c.reduce(function(p,b){if(b.props[u]===r&&_i(b.props,"extendDomain")&&wt(b.props[f])){var P=b.props[f];return[Math.min(p[0],P),Math.max(p[1],P)]}return p},m)),h.length){var y="".concat(f,"1"),x="".concat(f,"2");m=h.reduce(function(p,b){if(b.props[u]===r&&_i(b.props,"extendDomain")&&wt(b.props[y])&&wt(b.props[x])){var P=b.props[y],S=b.props[x];return[Math.min(p[0],P,S),Math.max(p[1],P,S)]}return p},m)}return o&&o.length&&(m=o.reduce(function(p,b){return wt(b)?[Math.min(p[0],b),Math.max(p[1],b)]:p},m)),m},C$={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,h,u){this.fn=c,this.context=h,this.once=u||!1}function o(c,h,u,f,m){if(typeof u!="function")throw new TypeError("The listener must be a function");var y=new i(u,f||c,m),x=n?n+h:h;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],y]:c._events[x].push(y):(c._events[x]=y,c._eventsCount++),c}function s(c,h){--c._eventsCount===0?c._events=new r:delete c._events[h]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],u,f;if(this._eventsCount===0)return h;for(f in u=this._events)t.call(u,f)&&h.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(u)):h},l.prototype.listeners=function(h){var u=n?n+h:h,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,y=f.length,x=new Array(y);m<y;m++)x[m]=f[m].fn;return x},l.prototype.listenerCount=function(h){var u=n?n+h:h,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(h,u,f,m,y,x){var p=n?n+h:h;if(!this._events[p])return!1;var b=this._events[p],P=arguments.length,S,A;if(b.fn){switch(b.once&&this.removeListener(h,b.fn,void 0,!0),P){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,u),!0;case 3:return b.fn.call(b.context,u,f),!0;case 4:return b.fn.call(b.context,u,f,m),!0;case 5:return b.fn.call(b.context,u,f,m,y),!0;case 6:return b.fn.call(b.context,u,f,m,y,x),!0}for(A=1,S=new Array(P-1);A<P;A++)S[A-1]=arguments[A];b.fn.apply(b.context,S)}else{var E=b.length,w;for(A=0;A<E;A++)switch(b[A].once&&this.removeListener(h,b[A].fn,void 0,!0),P){case 1:b[A].fn.call(b[A].context);break;case 2:b[A].fn.call(b[A].context,u);break;case 3:b[A].fn.call(b[A].context,u,f);break;case 4:b[A].fn.call(b[A].context,u,f,m);break;default:if(!S)for(w=1,S=new Array(P-1);w<P;w++)S[w-1]=arguments[w];b[A].fn.apply(b[A].context,S)}}return!0},l.prototype.on=function(h,u,f){return o(this,h,u,f,!1)},l.prototype.once=function(h,u,f){return o(this,h,u,f,!0)},l.prototype.removeListener=function(h,u,f,m){var y=n?n+h:h;if(!this._events[y])return this;if(!u)return s(this,y),this;var x=this._events[y];if(x.fn)x.fn===u&&(!m||x.once)&&(!f||x.context===f)&&s(this,y);else{for(var p=0,b=[],P=x.length;p<P;p++)(x[p].fn!==u||m&&!x[p].once||f&&x[p].context!==f)&&b.push(x[p]);b.length?this._events[y]=b.length===1?b[0]:b:s(this,y)}return this},l.prototype.removeAllListeners=function(h){var u;return h?(u=n?n+h:h,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(C$);var ylt=C$.exports;const vlt=$e(ylt);var Fg=new vlt,Wg="recharts.syncMouseEvents";function fh(e){"@babel/helpers - typeof";return fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fh(e)}function blt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xlt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O$(r.key),r)}}function wlt(e,t,n){return t&&xlt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vg(e,t,n){return t=O$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O$(e){var t=_lt(e,"string");return fh(t)=="symbol"?t:t+""}function _lt(e,t){if(fh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Slt=function(){function e(){blt(this,e),Vg(this,"activeIndex",0),Vg(this,"coordinateList",[]),Vg(this,"layout","horizontal")}return wlt(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,s=n.container,l=s===void 0?null:s,c=n.layout,h=c===void 0?null:c,u=n.offset,f=u===void 0?null:u,m=n.mouseHandlerCallback,y=m===void 0?null:m;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=h??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=y??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(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,s=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,h=((n=window)===null||n===void 0?void 0:n.scrollX)||0,u=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=o+c+h,m=s+this.offset.top+l/2+u;this.mouseHandlerCallback({pageX:f,pageY:m})}}}])}();function Plt(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&wt(r)&&wt(i))return!0}return!1}function Alt(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function M$(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle,s=Fe(t,n,r,i),l=Fe(t,n,r,o);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function Tlt(e,t,n){var r,i,o,s;if(e==="horizontal")r=t.x,o=r,i=n.top,s=n.top+n.height;else if(e==="vertical")i=t.y,s=i,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,h=t.innerRadius,u=t.outerRadius,f=t.angle,m=Fe(l,c,h,f),y=Fe(l,c,u,f);r=m.x,i=m.y,o=y.x,s=y.y}else return M$(t);return[{x:r,y:i},{x:o,y:s}]}function dh(e){"@babel/helpers - typeof";return dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dh(e)}function JA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $f(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JA(Object(n),!0).forEach(function(r){Elt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Elt(e,t,n){return t=Clt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Clt(e){var t=Olt(e,"string");return dh(t)=="symbol"?t:t+""}function Olt(e,t){if(dh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mlt(e){var t,n,r=e.element,i=e.tooltipEventType,o=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,h=e.activeTooltipIndex,u=e.tooltipAxisBandSize,f=e.layout,m=e.chartName,y=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!y||!o||!s||m!=="ScatterChart"&&i!=="axis")return null;var x,p=sa;if(m==="ScatterChart")x=s,p=Int;else if(m==="BarChart")x=Alt(f,s,c,u),p=cx;else if(f==="radial"){var b=M$(s),P=b.cx,S=b.cy,A=b.radius,E=b.startAngle,w=b.endAngle;x={cx:P,cy:S,startAngle:E,endAngle:w,innerRadius:A,outerRadius:A},p=wk}else x={points:Tlt(f,s,c)},p=sa;var T=$f($f($f($f({stroke:"#ccc",pointerEvents:"none"},c),x),Dt(y,!1)),{},{payload:l,payloadIndex:h,className:te("recharts-tooltip-cursor",y.className)});return v.isValidElement(y)?v.cloneElement(y,T):v.createElement(p,T)}var klt=["item"],$lt=["children","className","width","height","style","compact","title","desc"];function Yl(e){"@babel/helpers - typeof";return Yl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yl(e)}function ll(){return ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ll.apply(this,arguments)}function QA(e,t){return Llt(e)||Rlt(e,t)||$$(e,t)||Ilt()}function Ilt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
115
115
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rlt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function Llt(e){if(Array.isArray(e))return e}function tT(e,t){if(e==null)return{};var n=Nlt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nlt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jlt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dlt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,I$(r.key),r)}}function Blt(e,t,n){return t&&Dlt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zlt(e,t,n){return t=hp(t),Flt(e,k$()?Reflect.construct(t,n||[],hp(e).constructor):t.apply(e,n))}function Flt(e,t){if(t&&(Yl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wlt(e)}function Wlt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(k$=function(){return!!e})()}function hp(e){return hp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hp(e)}function Vlt(e,t){if(typeof t!="function"&&t!==null)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&&tb(e,t)}function tb(e,t){return tb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},tb(e,t)}function Kl(e){return qlt(e)||Hlt(e)||$$(e)||Ult()}function Ult(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
116
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $$(e,t){if(e){if(typeof e=="string")return eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eb(e,t)}}function Hlt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qlt(e){if(Array.isArray(e))return eb(e)}function eb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ht(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eT(Object(n),!0).forEach(function(r){Ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ut(e,t,n){return t=I$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I$(e){var t=Glt(e,"string");return Yl(t)=="symbol"?t:t+""}function Glt(e,t){if(Yl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zlt={xAxis:["bottom","top"],yAxis:["left","right"]},Ylt={width:"100%",height:"100%"},R$={x:0,y:0};function If(e){return e}var Klt=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Xlt=function(t,n,r,i){var o=n.find(function(u){return u&&u.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,l=i.radius;return ht(ht(ht({},i),Fe(i.cx,i.cy,l,s)),{},{angle:s,radius:l})}var c=o.coordinate,h=i.angle;return ht(ht(ht({},i),Fe(i.cx,i.cy,c,h)),{},{angle:h,radius:c})}return R$},gm=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(l,c){var h=c.props.data;return h&&h.length?[].concat(Kl(l),Kl(h)):l},[]);return s.length>0?s:t&&t.length&&wt(i)&&wt(o)?t.slice(i,o+1):[]};function L$(e){return e==="number"?[0,"auto"]:void 0}var nb=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,l=gm(n,t);return r<0||!o||!o.length||r>=l.length?null:o.reduce(function(c,h){var u,f=(u=h.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var y=f===void 0?l:f;m=id(y,s.dataKey,i)}else m=f&&f[r]||l[r];return m?[].concat(Kl(c),[mk(h,m)]):c},[])},nT=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=Klt(o,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,h=t.tooltipTicks,u=qJ(s,l,h,c);if(u>=0&&h){var f=h[u]&&h[u].value,m=nb(t,n,u,f),y=Xlt(r,l,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:m,activeCoordinate:y}}return null},Jlt=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=t.stackOffset,y=ck(u,o);return r.reduce(function(x,p){var b,P=p.type.defaultProps!==void 0?ht(ht({},p.type.defaultProps),p.props):p.props,S=P.type,A=P.dataKey,E=P.allowDataOverflow,w=P.allowDuplicatedCategory,T=P.scale,O=P.ticks,I=P.includeHidden,N=P[s];if(x[N])return x;var F=gm(t.data,{graphicalItems:i.filter(function(it){var st,ct=s in it.props?it.props[s]:(st=it.type.defaultProps)===null||st===void 0?void 0:st[s];return ct===N}),dataStartIndex:c,dataEndIndex:h}),D=F.length,j,K,U;Plt(P.domain,E,S)&&(j=pv(P.domain,null,E),y&&(S==="number"||T!=="auto")&&(U=gu(F,A,"category")));var z=L$(S);if(!j||j.length===0){var Y,G=(Y=P.domain)!==null&&Y!==void 0?Y:z;if(A){if(j=gu(F,A,S),S==="category"&&y){var X=IW(j);w&&X?(K=j,j=Yd(0,D)):w||(j=yP(G,j,p).reduce(function(it,st){return it.indexOf(st)>=0?it:[].concat(Kl(it),[st])},[]))}else if(S==="category")w?j=j.filter(function(it){return it!==""&&!Zt(it)}):j=yP(G,j,p).reduce(function(it,st){return it.indexOf(st)>=0||st===""||Zt(st)?it:[].concat(Kl(it),[st])},[]);else if(S==="number"){var lt=XJ(F,i.filter(function(it){var st,ct,yt=s in it.props?it.props[s]:(st=it.type.defaultProps)===null||st===void 0?void 0:st[s],vt="hide"in it.props?it.props.hide:(ct=it.type.defaultProps)===null||ct===void 0?void 0:ct.hide;return yt===N&&(I||!vt)}),A,o,u);lt&&(j=lt)}y&&(S==="number"||T!=="auto")&&(U=gu(F,A,"category"))}else y?j=Yd(0,D):l&&l[N]&&l[N].hasStack&&S==="number"?j=m==="expand"?[0,1]:pk(l[N].stackGroups,c,h):j=lk(F,i.filter(function(it){var st=s in it.props?it.props[s]:it.type.defaultProps[s],ct="hide"in it.props?it.props.hide:it.type.defaultProps.hide;return st===N&&(I||!ct)}),S,u,!0);if(S==="number")j=Qv(f,j,N,o,O),G&&(j=pv(G,j,E));else if(S==="category"&&G){var H=G,et=j.every(function(it){return H.indexOf(it)>=0});et&&(j=H)}}return ht(ht({},x),{},Ut({},N,ht(ht({},P),{},{axisType:o,domain:j,categoricalDomain:U,duplicateDomain:K,originalDomain:(b=P.domain)!==null&&b!==void 0?b:z,isCategorical:y,layout:u})))},{})},Qlt=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=gm(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:h}),y=m.length,x=ck(u,o),p=-1;return r.reduce(function(b,P){var S=P.type.defaultProps!==void 0?ht(ht({},P.type.defaultProps),P.props):P.props,A=S[s],E=L$("number");if(!b[A]){p++;var w;return x?w=Yd(0,y):l&&l[A]&&l[A].hasStack?(w=pk(l[A].stackGroups,c,h),w=Qv(f,w,A,o)):(w=pv(E,lk(m,r.filter(function(T){var O,I,N=s in T.props?T.props[s]:(O=T.type.defaultProps)===null||O===void 0?void 0:O[s],F="hide"in T.props?T.props.hide:(I=T.type.defaultProps)===null||I===void 0?void 0:I.hide;return N===A&&!F}),"number",u),i.defaultProps.allowDataOverflow),w=Qv(f,w,A,o)),ht(ht({},b),{},Ut({},A,ht(ht({axisType:o},i.defaultProps),{},{hide:!0,orientation:Pr(Zlt,"".concat(o,".").concat(p%2),null),domain:w,originalDomain:E,isCategorical:x,layout:u})))}return b},{})},tct=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),m=sr(u,o),y={};return m&&m.length?y=Jlt(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h}):s&&s.length&&(y=Qlt(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h})),y},ect=function(t){var n=Wo(t),r=io(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:L0(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Rd(n,r)}},rT=function(t){var n=t.children,r=t.defaultShowTooltip,i=xr(n,jl),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},nct=function(t){return!t||!t.length?!1:t.some(function(n){var r=so(n&&n.type);return r&&r.indexOf("Bar")>=0})},iT=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},rct=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,l=t.yAxisMap,c=l===void 0?{}:l,h=r.width,u=r.height,f=r.children,m=r.margin||{},y=xr(f,jl),x=xr(f,ra),p=Object.keys(c).reduce(function(w,T){var O=c[T],I=O.orientation;return!O.mirror&&!O.hide?ht(ht({},w),{},Ut({},I,w[I]+O.width)):w},{left:m.left||0,right:m.right||0}),b=Object.keys(s).reduce(function(w,T){var O=s[T],I=O.orientation;return!O.mirror&&!O.hide?ht(ht({},w),{},Ut({},I,Pr(w,"".concat(I))+O.height)):w},{top:m.top||0,bottom:m.bottom||0}),P=ht(ht({},b),p),S=P.bottom;y&&(P.bottom+=y.props.height||jl.defaultProps.height),x&&n&&(P=YJ(P,i,r,n));var A=h-P.left-P.right,E=u-P.top-P.bottom;return ht(ht({brushBottom:S},P),{},{width:Math.max(A,0),height:Math.max(E,0)})},ict=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},ym=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,h=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,m=function(P,S){var A=S.graphicalItems,E=S.stackGroups,w=S.offset,T=S.updateId,O=S.dataStartIndex,I=S.dataEndIndex,N=P.barSize,F=P.layout,D=P.barGap,j=P.barCategoryGap,K=P.maxBarSize,U=iT(F),z=U.numericAxisName,Y=U.cateAxisName,G=nct(A),X=[];return A.forEach(function(lt,H){var et=gm(P.data,{graphicalItems:[lt],dataStartIndex:O,dataEndIndex:I}),it=lt.type.defaultProps!==void 0?ht(ht({},lt.type.defaultProps),lt.props):lt.props,st=it.dataKey,ct=it.maxBarSize,yt=it["".concat(z,"Id")],vt=it["".concat(Y,"Id")],Et={},Tt=c.reduce(function(ne,Yt){var oe,Me,se=S["".concat(Yt.axisType,"Map")],on=it["".concat(Yt.axisType,"Id")];se&&se[on]||Yt.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?ir(!1,"Specifying a(n) ".concat(Yt.axisType,"Id requires a corresponding ").concat(Yt.axisType,"Id on the targeted graphical component ").concat((oe=lt==null||(Me=lt.type)===null||Me===void 0?void 0:Me.displayName)!==null&&oe!==void 0?oe:"")):ir());var en=se[on];return ht(ht({},ne),{},Ut(Ut({},Yt.axisType,en),"".concat(Yt.axisType,"Ticks"),io(en)))},Et),ft=Tt[Y],dt=Tt["".concat(Y,"Ticks")],Ct=E&&E[yt]&&E[yt].hasStack&&sQ(lt,E[yt].stackGroups),nt=so(lt.type).indexOf("Bar")>=0,Lt=Rd(ft,dt),bt=[],me=G&&GJ({barSize:N,stackGroups:E,totalSize:ict(Tt,Y)});if(nt){var ie,Xt,Ne=Zt(ct)?K:ct,Wt=(ie=(Xt=Rd(ft,dt,!0))!==null&&Xt!==void 0?Xt:Ne)!==null&&ie!==void 0?ie:0;bt=ZJ({barGap:D,barCategoryGap:j,bandSize:Wt!==Lt?Wt:Lt,sizeList:me[vt],maxBarSize:Ne}),Wt!==Lt&&(bt=bt.map(function(ne){return ht(ht({},ne),{},{position:ht(ht({},ne.position),{},{offset:ne.position.offset-Wt/2})})}))}var ee=lt&&lt.type&&lt.type.getComposedData;ee&&X.push({props:ht(ht({},ee(ht(ht({},Tt),{},{displayedData:et,props:P,dataKey:st,item:lt,bandSize:Lt,barPosition:bt,offset:w,stackedData:Ct,layout:F,dataStartIndex:O,dataEndIndex:I}))),{},Ut(Ut(Ut({key:lt.key||"item-".concat(H)},z,Tt[z]),Y,Tt[Y]),"animationId",T)),childIndex:GW(lt,P.children),item:lt})}),X},y=function(P,S){var A=P.props,E=P.dataStartIndex,w=P.dataEndIndex,T=P.updateId;if(!h1({props:A}))return null;var O=A.children,I=A.layout,N=A.stackOffset,F=A.data,D=A.reverseStackOrder,j=iT(I),K=j.numericAxisName,U=j.cateAxisName,z=sr(O,r),Y=iQ(F,z,"".concat(K,"Id"),"".concat(U,"Id"),N,D),G=c.reduce(function(it,st){var ct="".concat(st.axisType,"Map");return ht(ht({},it),{},Ut({},ct,tct(A,ht(ht({},st),{},{graphicalItems:z,stackGroups:st.axisType===K&&Y,dataStartIndex:E,dataEndIndex:w}))))},{}),X=rct(ht(ht({},G),{},{props:A,graphicalItems:z}),S==null?void 0:S.legendBBox);Object.keys(G).forEach(function(it){G[it]=u(A,G[it],X,it.replace("Map",""),n)});var lt=G["".concat(U,"Map")],H=ect(lt),et=m(A,ht(ht({},G),{},{dataStartIndex:E,dataEndIndex:w,updateId:T,graphicalItems:z,stackGroups:Y,offset:X}));return ht(ht({formattedGraphicalItems:et,graphicalItems:z,offset:X,stackGroups:Y},H),G)},x=function(b){function P(S){var A,E,w;return jlt(this,P),w=zlt(this,P,[S]),Ut(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ut(w,"accessibilityManager",new Slt),Ut(w,"handleLegendBBoxUpdate",function(T){if(T){var O=w.state,I=O.dataStartIndex,N=O.dataEndIndex,F=O.updateId;w.setState(ht({legendBBox:T},y({props:w.props,dataStartIndex:I,dataEndIndex:N,updateId:F},ht(ht({},w.state),{},{legendBBox:T}))))}}),Ut(w,"handleReceiveSyncEvent",function(T,O,I){if(w.props.syncId===T){if(I===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),Ut(w,"handleBrushChange",function(T){var O=T.startIndex,I=T.endIndex;if(O!==w.state.dataStartIndex||I!==w.state.dataEndIndex){var N=w.state.updateId;w.setState(function(){return ht({dataStartIndex:O,dataEndIndex:I},y({props:w.props,dataStartIndex:O,dataEndIndex:I,updateId:N},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:I})}}),Ut(w,"handleMouseEnter",function(T){var O=w.getMouseInfo(T);if(O){var I=ht(ht({},O),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseEnter;qt(N)&&N(I,T)}}),Ut(w,"triggeredAfterMouseMove",function(T){var O=w.getMouseInfo(T),I=O?ht(ht({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseMove;qt(N)&&N(I,T)}),Ut(w,"handleItemMouseEnter",function(T){w.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Ut(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Ut(w,"handleMouseMove",function(T){T.persist(),w.throttleTriggeredAfterMouseMove(T)}),Ut(w,"handleMouseLeave",function(T){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var I=w.props.onMouseLeave;qt(I)&&I(O,T)}),Ut(w,"handleOuterEvent",function(T){var O=qW(T),I=Pr(w.props,"".concat(O));if(O&&qt(I)){var N,F;/.*touch.*/i.test(O)?F=w.getMouseInfo(T.changedTouches[0]):F=w.getMouseInfo(T),I((N=F)!==null&&N!==void 0?N:{},T)}}),Ut(w,"handleClick",function(T){var O=w.getMouseInfo(T);if(O){var I=ht(ht({},O),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onClick;qt(N)&&N(I,T)}}),Ut(w,"handleMouseDown",function(T){var O=w.props.onMouseDown;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"handleMouseUp",function(T){var O=w.props.onMouseUp;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Ut(w,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseDown(T.changedTouches[0])}),Ut(w,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseUp(T.changedTouches[0])}),Ut(w,"handleDoubleClick",function(T){var O=w.props.onDoubleClick;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"handleContextMenu",function(T){var O=w.props.onContextMenu;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"triggerSyncEvent",function(T){w.props.syncId!==void 0&&Fg.emit(Wg,w.props.syncId,T,w.eventEmitterSymbol)}),Ut(w,"applySyncEvent",function(T){var O=w.props,I=O.layout,N=O.syncMethod,F=w.state.updateId,D=T.dataStartIndex,j=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)w.setState(ht({dataStartIndex:D,dataEndIndex:j},y({props:w.props,dataStartIndex:D,dataEndIndex:j,updateId:F},w.state)));else if(T.activeTooltipIndex!==void 0){var K=T.chartX,U=T.chartY,z=T.activeTooltipIndex,Y=w.state,G=Y.offset,X=Y.tooltipTicks;if(!G)return;if(typeof N=="function")z=N(X,T);else if(N==="value"){z=-1;for(var lt=0;lt<X.length;lt++)if(X[lt].value===T.activeLabel){z=lt;break}}var H=ht(ht({},G),{},{x:G.left,y:G.top}),et=Math.min(K,H.x+H.width),it=Math.min(U,H.y+H.height),st=X[z]&&X[z].value,ct=nb(w.state,w.props.data,z),yt=X[z]?{x:I==="horizontal"?X[z].coordinate:et,y:I==="horizontal"?it:X[z].coordinate}:R$;w.setState(ht(ht({},T),{},{activeLabel:st,activeCoordinate:yt,activePayload:ct,activeTooltipIndex:z}))}else w.setState(T)}),Ut(w,"renderCursor",function(T){var O,I=w.state,N=I.isTooltipActive,F=I.activeCoordinate,D=I.activePayload,j=I.offset,K=I.activeTooltipIndex,U=I.tooltipAxisBandSize,z=w.getTooltipEventType(),Y=(O=T.props.active)!==null&&O!==void 0?O:N,G=w.props.layout,X=T.key||"_recharts-cursor";return v.createElement(Mlt,{key:X,activeCoordinate:F,activePayload:D,activeTooltipIndex:K,chartName:n,element:T,isActive:Y,layout:G,offset:j,tooltipAxisBandSize:U,tooltipEventType:z})}),Ut(w,"renderPolarAxis",function(T,O,I){var N=Pr(T,"type.axisType"),F=Pr(w.state,"".concat(N,"Map")),D=T.type.defaultProps,j=D!==void 0?ht(ht({},D),T.props):T.props,K=F&&F[j["".concat(N,"Id")]];return v.cloneElement(T,ht(ht({},K),{},{className:te(N,K.className),key:T.key||"".concat(O,"-").concat(I),ticks:io(K,!0)}))}),Ut(w,"renderPolarGrid",function(T){var O=T.props,I=O.radialLines,N=O.polarAngles,F=O.polarRadius,D=w.state,j=D.radiusAxisMap,K=D.angleAxisMap,U=Wo(j),z=Wo(K),Y=z.cx,G=z.cy,X=z.innerRadius,lt=z.outerRadius;return v.cloneElement(T,{polarAngles:Array.isArray(N)?N:io(z,!0).map(function(H){return H.coordinate}),polarRadius:Array.isArray(F)?F:io(U,!0).map(function(H){return H.coordinate}),cx:Y,cy:G,innerRadius:X,outerRadius:lt,key:T.key||"polar-grid",radialLines:I})}),Ut(w,"renderLegend",function(){var T=w.state.formattedGraphicalItems,O=w.props,I=O.children,N=O.width,F=O.height,D=w.props.margin||{},j=N-(D.left||0)-(D.right||0),K=sk({children:I,formattedGraphicalItems:T,legendWidth:j,legendContent:h});if(!K)return null;var U=K.item,z=tT(K,klt);return v.cloneElement(U,ht(ht({},z),{},{chartWidth:N,chartHeight:F,margin:D,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Ut(w,"renderTooltip",function(){var T,O=w.props,I=O.children,N=O.accessibilityLayer,F=xr(I,wr);if(!F)return null;var D=w.state,j=D.isTooltipActive,K=D.activeCoordinate,U=D.activePayload,z=D.activeLabel,Y=D.offset,G=(T=F.props.active)!==null&&T!==void 0?T:j;return v.cloneElement(F,{viewBox:ht(ht({},Y),{},{x:Y.left,y:Y.top}),active:G,label:z,payload:G?U:[],coordinate:K,accessibilityLayer:N})}),Ut(w,"renderBrush",function(T){var O=w.props,I=O.margin,N=O.data,F=w.state,D=F.offset,j=F.dataStartIndex,K=F.dataEndIndex,U=F.updateId;return v.cloneElement(T,{key:T.key||"_recharts-brush",onChange:Ef(w.handleBrushChange,T.props.onChange),data:N,x:wt(T.props.x)?T.props.x:D.left,y:wt(T.props.y)?T.props.y:D.top+D.height+D.brushBottom-(I.bottom||0),width:wt(T.props.width)?T.props.width:D.width,startIndex:j,endIndex:K,updateId:"brush-".concat(U)})}),Ut(w,"renderReferenceElement",function(T,O,I){if(!T)return null;var N=w,F=N.clipPathId,D=w.state,j=D.xAxisMap,K=D.yAxisMap,U=D.offset,z=T.type.defaultProps||{},Y=T.props,G=Y.xAxisId,X=G===void 0?z.xAxisId:G,lt=Y.yAxisId,H=lt===void 0?z.yAxisId:lt;return v.cloneElement(T,{key:T.key||"".concat(O,"-").concat(I),xAxis:j[X],yAxis:K[H],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:F})}),Ut(w,"renderActivePoints",function(T){var O=T.item,I=T.activePoint,N=T.basePoint,F=T.childIndex,D=T.isRange,j=[],K=O.props.key,U=O.item.type.defaultProps!==void 0?ht(ht({},O.item.type.defaultProps),O.item.props):O.item.props,z=U.activeDot,Y=U.dataKey,G=ht(ht({index:F,dataKey:Y,cx:I.x,cy:I.y,r:4,fill:ax(O.item),strokeWidth:2,stroke:"#fff",payload:I.payload,value:I.value},Dt(z,!1)),od(z));return j.push(P.renderActiveDot(z,G,"".concat(K,"-activePoint-").concat(F))),N?j.push(P.renderActiveDot(z,ht(ht({},G),{},{cx:N.x,cy:N.y}),"".concat(K,"-basePoint-").concat(F))):D&&j.push(null),j}),Ut(w,"renderGraphicChild",function(T,O,I){var N=w.filterFormatItem(T,O,I);if(!N)return null;var F=w.getTooltipEventType(),D=w.state,j=D.isTooltipActive,K=D.tooltipAxis,U=D.activeTooltipIndex,z=D.activeLabel,Y=w.props.children,G=xr(Y,wr),X=N.props,lt=X.points,H=X.isRange,et=X.baseLine,it=N.item.type.defaultProps!==void 0?ht(ht({},N.item.type.defaultProps),N.item.props):N.item.props,st=it.activeDot,ct=it.hide,yt=it.activeBar,vt=it.activeShape,Et=!!(!ct&&j&&G&&(st||yt||vt)),Tt={};F!=="axis"&&G&&G.props.trigger==="click"?Tt={onClick:Ef(w.handleItemMouseEnter,T.props.onClick)}:F!=="axis"&&(Tt={onMouseLeave:Ef(w.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:Ef(w.handleItemMouseEnter,T.props.onMouseEnter)});var ft=v.cloneElement(T,ht(ht({},N.props),Tt));function dt(Yt){return typeof K.dataKey=="function"?K.dataKey(Yt.payload):null}if(Et)if(U>=0){var Ct,nt;if(K.dataKey&&!K.allowDuplicatedCategory){var Lt=typeof K.dataKey=="function"?dt:"payload.".concat(K.dataKey.toString());Ct=id(lt,Lt,z),nt=H&&et&&id(et,Lt,z)}else Ct=lt==null?void 0:lt[U],nt=H&&et&&et[U];if(vt||yt){var bt=T.props.activeIndex!==void 0?T.props.activeIndex:U;return[v.cloneElement(T,ht(ht(ht({},N.props),Tt),{},{activeIndex:bt})),null,null]}if(!Zt(Ct))return[ft].concat(Kl(w.renderActivePoints({item:N,activePoint:Ct,basePoint:nt,childIndex:U,isRange:H})))}else{var me,ie=(me=w.getItemByXY(w.state.activeCoordinate))!==null&&me!==void 0?me:{graphicalItem:ft},Xt=ie.graphicalItem,Ne=Xt.item,Wt=Ne===void 0?T:Ne,ee=Xt.childIndex,ne=ht(ht(ht({},N.props),Tt),{},{activeIndex:ee});return[v.cloneElement(Wt,ne),null,null]}return H?[ft,null,null]:[ft,null]}),Ut(w,"renderCustomized",function(T,O,I){return v.cloneElement(T,ht(ht({key:"recharts-customized-".concat(I)},w.props),w.state))}),Ut(w,"renderMap",{CartesianGrid:{handler:If,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:If},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:If},YAxis:{handler:If},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((A=S.id)!==null&&A!==void 0?A:wa("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=sM(w.triggeredAfterMouseMove,(E=S.throttleDelay)!==null&&E!==void 0?E:1e3/60),w.state={},w}return Vlt(P,b),Blt(P,[{key:"componentDidMount",value:function(){var A,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var A=this.props,E=A.children,w=A.data,T=A.height,O=A.layout,I=xr(E,wr);if(I){var N=I.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var F=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,D=nb(this.state,w,N,F),j=this.state.tooltipTicks[N].coordinate,K=(this.state.offset.top+T)/2,U=O==="horizontal",z=U?{x:j,y:K}:{y:j,x:K},Y=this.state.formattedGraphicalItems.find(function(X){var lt=X.item;return lt.type.name==="Scatter"});Y&&(z=ht(ht({},z),Y.props.points[N].tooltipPosition),D=Y.props.points[N].tooltipPayload);var G={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:F,activePayload:D,activeCoordinate:z};this.setState(G),this.renderCursor(I),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(A,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==A.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==A.margin){var w,T;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(A){Oy([xr(A.children,wr)],[xr(this.props.children,wr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var A=xr(this.props.children,wr);if(A&&typeof A.props.shared=="boolean"){var E=A.props.shared?"axis":"item";return l.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(A){if(!this.container)return null;var E=this.container,w=E.getBoundingClientRect(),T=xZ(w),O={chartX:Math.round(A.pageX-T.left),chartY:Math.round(A.pageY-T.top)},I=w.width/E.offsetWidth||1,N=this.inRange(O.chartX,O.chartY,I);if(!N)return null;var F=this.state,D=F.xAxisMap,j=F.yAxisMap,K=this.getTooltipEventType(),U=nT(this.state,this.props.data,this.props.layout,N);if(K!=="axis"&&D&&j){var z=Wo(D).scale,Y=Wo(j).scale,G=z&&z.invert?z.invert(O.chartX):null,X=Y&&Y.invert?Y.invert(O.chartY):null;return ht(ht({},O),{},{xValue:G,yValue:X},U)}return U?ht(ht({},O),U):null}},{key:"inRange",value:function(A,E){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,O=A/w,I=E/w;if(T==="horizontal"||T==="vertical"){var N=this.state.offset,F=O>=N.left&&O<=N.left+N.width&&I>=N.top&&I<=N.top+N.height;return F?{x:O,y:I}:null}var D=this.state,j=D.angleAxisMap,K=D.radiusAxisMap;if(j&&K){var U=Wo(j);return xP({x:O,y:I},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var A=this.props.children,E=this.getTooltipEventType(),w=xr(A,wr),T={};w&&E==="axis"&&(w.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=od(this.props,this.handleOuterEvent);return ht(ht({},O),T)}},{key:"addListener",value:function(){Fg.on(Wg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Fg.removeListener(Wg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(A,E,w){for(var T=this.state.formattedGraphicalItems,O=0,I=T.length;O<I;O++){var N=T[O];if(N.item===A||N.props.key===A.key||E===so(N.item.type)&&w===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var A=this.clipPathId,E=this.state.offset,w=E.left,T=E.top,O=E.height,I=E.width;return v.createElement("defs",null,v.createElement("clipPath",{id:A},v.createElement("rect",{x:w,y:T,height:O,width:I})))}},{key:"getXScales",value:function(){var A=this.state.xAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=QA(w,2),O=T[0],I=T[1];return ht(ht({},E),{},Ut({},O,I.scale))},{}):null}},{key:"getYScales",value:function(){var A=this.state.yAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=QA(w,2),O=T[0],I=T[1];return ht(ht({},E),{},Ut({},O,I.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(A){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(A){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(A){var E=this.state,w=E.formattedGraphicalItems,T=E.activeItem;if(w&&w.length)for(var O=0,I=w.length;O<I;O++){var N=w[O],F=N.props,D=N.item,j=D.type.defaultProps!==void 0?ht(ht({},D.type.defaultProps),D.props):D.props,K=so(D.type);if(K==="Bar"){var U=(F.data||[]).find(function(X){return dnt(A,X)});if(U)return{graphicalItem:N,payload:U}}else if(K==="RadialBar"){var z=(F.data||[]).find(function(X){return xP(A,X)});if(z)return{graphicalItem:N,payload:z}}else if(lm(N,T)||cm(N,T)||lh(N,T)){var Y=eit({graphicalItem:N,activeTooltipItem:T,itemData:j.data}),G=j.activeIndex===void 0?Y:j.activeIndex;return{graphicalItem:ht(ht({},N),{},{childIndex:G}),payload:lh(N,T)?j.data[Y]:N.props.data[Y]}}}return null}},{key:"render",value:function(){var A=this;if(!h1(this))return null;var E=this.props,w=E.children,T=E.className,O=E.width,I=E.height,N=E.style,F=E.compact,D=E.title,j=E.desc,K=tT(E,$lt),U=Dt(K,!1);if(F)return v.createElement(RA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement(ky,ll({},U,{width:O,height:I,title:D,desc:j}),this.renderClipPath(),d1(w,this.renderMap)));if(this.props.accessibilityLayer){var z,Y;U.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,U.role=(Y=this.props.role)!==null&&Y!==void 0?Y:"application",U.onKeyDown=function(X){A.accessibilityManager.keyboardEvent(X)},U.onFocus=function(){A.accessibilityManager.focus()}}var G=this.parseEventsOfWrapper();return v.createElement(RA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement("div",ll({className:te("recharts-wrapper",T),style:ht({position:"relative",cursor:"default",width:O,height:I},N)},G,{ref:function(lt){A.container=lt}}),v.createElement(ky,ll({},U,{width:O,height:I,title:D,desc:j,style:Ylt}),this.renderClipPath(),d1(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(v.Component);Ut(x,"displayName",n),Ut(x,"defaultProps",ht({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ut(x,"getDerivedStateFromProps",function(b,P){var S=b.dataKey,A=b.data,E=b.children,w=b.width,T=b.height,O=b.layout,I=b.stackOffset,N=b.margin,F=P.dataStartIndex,D=P.dataEndIndex;if(P.updateId===void 0){var j=rT(b);return ht(ht(ht({},j),{},{updateId:0},y(ht(ht({props:b},j),{},{updateId:0}),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:I,prevMargin:N,prevChildren:E})}if(S!==P.prevDataKey||A!==P.prevData||w!==P.prevWidth||T!==P.prevHeight||O!==P.prevLayout||I!==P.prevStackOffset||!fl(N,P.prevMargin)){var K=rT(b),U={chartX:P.chartX,chartY:P.chartY,isTooltipActive:P.isTooltipActive},z=ht(ht({},nT(P,A,O)),{},{updateId:P.updateId+1}),Y=ht(ht(ht({},K),U),z);return ht(ht(ht({},Y),y(ht({props:b},Y),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:I,prevMargin:N,prevChildren:E})}if(!Oy(E,P.prevChildren)){var G,X,lt,H,et=xr(E,jl),it=et&&(G=(X=et.props)===null||X===void 0?void 0:X.startIndex)!==null&&G!==void 0?G:F,st=et&&(lt=(H=et.props)===null||H===void 0?void 0:H.endIndex)!==null&&lt!==void 0?lt:D,ct=it!==F||st!==D,yt=!Zt(A),vt=yt&&!ct?P.updateId:P.updateId+1;return ht(ht({updateId:vt},y(ht(ht({props:b},P),{},{updateId:vt,dataStartIndex:it,dataEndIndex:st}),P)),{},{prevChildren:E,dataStartIndex:it,dataEndIndex:st})}return null}),Ut(x,"renderActiveDot",function(b,P,S){var A;return v.isValidElement(b)?A=v.cloneElement(b,P):qt(b)?A=b(P):A=v.createElement(rm,P),v.createElement(fe,{className:"recharts-active-dot",key:S},A)});var p=v.forwardRef(function(P,S){return v.createElement(x,ll({},P,{ref:S}))});return p.displayName=x.displayName,p},oct=ym({chartName:"BarChart",GraphicalChild:Aa,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:hs},{axisType:"yAxis",AxisComp:fs}],formatAxisMap:ux}),sct=ym({chartName:"PieChart",GraphicalChild:bo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:am},{axisType:"radiusAxis",AxisComp:om}],formatAxisMap:gQ,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),act=ym({chartName:"ScatterChart",GraphicalChild:Mh,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:hs},{axisType:"yAxis",AxisComp:fs},{axisType:"zAxis",AxisComp:Oh}],formatAxisMap:ux}),lct=ym({chartName:"AreaChart",GraphicalChild:us,axisComponents:[{axisType:"xAxis",AxisComp:hs},{axisType:"yAxis",AxisComp:fs}],formatAxisMap:ux});const cct=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},fp=(...e)=>{cct()&&console.warn(...e)};function uct(e,t,n){var s,l;const r=t.expression?((s=e.evaluateExpression)==null?void 0:s.call(e,t.expression,t.expressionUrl,n,t.expressionKey))??e.interpolateText(t.expression):e.interpolateText(t.text||"");if(t.className){const c=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const u=s0(t.className);if(u.size>0){const m=Vt(u,e.containerWidth,"1rem");c.fontSize=m}const f=ic(t.className);f.size>0&&(c.display=Vt(f,e.containerWidth,"block"))}const h=e.getCommonProps(n,c,t);return V("p",{key:n,className:t.className,...h},r)}const i={};t.fontSize!==void 0&&(i.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(i.fontWeight=t.fontWeight),t.color!==void 0&&(i.color=t.color),t.textAlign!==void 0&&(i.textAlign=t.textAlign);const o=e.getCommonProps(n,i,t);return V("p",{key:n,...o},r)}function hct(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<iframe[\s\S]*?<\/iframe>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"")}function fct(e,t,n){const r=String(e.apiUrl||"").replace(/\/$/,""),i=e.interpolateText(t.text||t.html||"").replace(/(src|href)=("|')\/(?!\/)/g,r?`$1=$2${r}/`:"$1=$2/"),o=e.getCommonProps(n,{color:e.cfg.colors.text},t);return V("div",{key:n,className:t.className,...o,dangerouslySetInnerHTML:{__html:hct(i)}})}function dct(e,t,n){var l,c,h,u,f;const r=()=>{t.onClick?e.handleButtonClick(t.onClick,{onSuccess:t.onSuccess,onError:t.onError},{optimistic:t.optimistic,feedback:t.feedback}):t.href&&(t.href.startsWith("http")||e.previewMode?window.open(t.href,"_blank","noopener,noreferrer"):window.location.href=t.href)},i=()=>{var m;if(!e.interactionDisabled){if((m=t.confirmation)!=null&&m.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:14}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{r()}});return}r()}};if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const x=ic(t.className);x.size>0&&(m.display=Vt(x,e.containerWidth,"inline"));const p=s0(t.className);if(p.size>0){const b=Vt(p,e.containerWidth,"1rem");m.fontSize=b}}t.icon&&(m.display="inline-flex",m.alignItems="center",m.gap=6);const y=e.getCommonProps(n,m,t);return V("a",{key:n,className:t.className,...y,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(c=t.href)!=null&&c.startsWith("http")?"_blank":void 0,rel:(h=t.href)!=null&&h.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}const o={cursor:"pointer",textDecoration:"none",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:6},s=e.getCommonProps(n,o,t);return V("a",{key:n,...s,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(u=t.href)!=null&&u.startsWith("http")?"_blank":void 0,rel:(f=t.href)!=null&&f.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}function pct(e,t,n){var x,p,b,P,S;let r=!1;if(t.activeWhen){if(t.activeWhen===e.currentSceneId)r=!0;else if(typeof t.activeWhen=="string"){const A=t.activeWhen.split("=",2);A.length===2&&(r=String(((x=e.sceneData)==null?void 0:x[A[0]])??"")===A[1])}}const i=r?{onClick:t.activeOnClick||t.onClick,onSuccess:t.activeOnSuccess||t.onSuccess,onError:t.activeOnError||t.onError,icon:t.activeIcon||t.icon,text:t.activeText||t.text,label:t.activeText||t.label}:{onClick:t.onClick,onSuccess:t.onSuccess,onError:t.onError,icon:t.icon,text:t.text,label:t.label},o=t.disabled?((p=e.evaluateCondition)==null?void 0:p.call(e,t.disabled))??!1:!1,s=A=>{const E=()=>e.handleButtonClick(i.onClick||"",{onSuccess:i.onSuccess,onError:i.onError},{optimistic:t.optimistic,feedback:t.feedback,payload:t.payload,refetchScope:t.refetchScope,mergeResponse:t.mergeResponse,anchorElement:A==null?void 0:A.currentTarget});(e.withLoading?e.withLoading(n,E):E()).catch(T=>{var I,N;const O=((I=t.onError)==null?void 0:I.message)||(T==null?void 0:T.message)||"An error occurred";(N=e.showToast)==null||N.call(e,O,"error")})},l=A=>{var E;if((E=t.confirmation)!=null&&E.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:16}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{s(A)}});return}s(A)},c=(b=e.buttonLoading)==null?void 0:b[n];if(t.className){let A=((P=e.parseClassNameResponsive)==null?void 0:P.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const D=ic(t.className);D.size>0&&(A.display=Vt(D,e.containerWidth,"inline-flex"));const j=s0(t.className);j.size>0&&(A.fontSize=Vt(j,e.containerWidth,"1rem"))}let E=t.className;if(r&&t.activeClass){const D=((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.activeClass,n))??e.parseClassName(t.activeClass);A={...A,...D},E=`${t.className} ${t.activeClass}`}const w={display:"inline-flex",alignItems:"center",justifyContent:A.textAlign==="left"?"flex-start":A.textAlign==="right"?"flex-end":"center",gap:"6px",...A,...t.color&&{color:t.color},...t.background&&{background:t.background},...t.borderRadius!==void 0&&{borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius},...t.borderColor&&{borderColor:t.borderColor},...c&&{opacity:.6,pointerEvents:"none"}},T={},O=(t.className||"").split(/\s+/).filter(Boolean);for(const D of O)if(D.startsWith("hover:")){const j=D.replace("hover:","");if(j.startsWith("bg-")||j.startsWith("text-")||j.startsWith("border-")){const K=e.parseClassName(j);Object.assign(T,K)}}const I=e.getCommonProps(n,w,t),N=[];i.icon&&!c&&N.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.text?{marginRight:"6px"}:{}}},e.renderIcon(i.icon,t.iconSize||16))),c&&N.unshift(V("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),Array.isArray(t.children)&&t.children.length>0?t.children.forEach((D,j)=>{N.push(e.renderComponent(D,j,n))}):N.push(i.label||i.text||(i.icon?"":"Button"));const F={};return Object.keys(T).length>0&&(F.onMouseEnter=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=T.backgroundColor),T.color&&(D.currentTarget.style.color=T.color),T.borderColor&&(D.currentTarget.style.borderColor=T.borderColor)},F.onMouseLeave=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=w.backgroundColor||""),T.color&&(D.currentTarget.style.color=w.color||""),T.borderColor&&(D.currentTarget.style.borderColor=w.borderColor||"")}),V("button",{key:n,className:E,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...I,...F,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...N)}const h=e.cfg.colors.primary,u=e.cfg.colors.accent,f={display:"inline-flex",alignItems:"center",gap:"6px",padding:"0.75rem 1.5rem",borderRadius:"0.75rem",fontWeight:600,transition:e.cfg.effects.transition,color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.text,background:r?e.cfg.colors.primary:`linear-gradient(to right, ${h}, ${u})`,boxShadow:r?"none":`0 10px 15px -3px ${h}40`,...c&&{opacity:.6,pointerEvents:"none"}},m=e.getCommonProps(n,f,t),y=[];return c&&y.push(V("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),i.icon&&!c&&y.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(i.icon,t.iconSize||16))),y.push(i.label||i.text||(i.icon?"":"Button")),V("button",{key:n,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...m,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...y)}function mct(e,t,n){var h;const r=e.interpolateText(t.src||""),i=!r||r==="placeholder",o=e.imageErrors[n];if(t.skipEmpty&&i)return null;const s={border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",padding:10,height:"200px",borderRadius:"0.75rem"};if(i){const u=e.getCommonProps(n,s,t);return V("div",{key:n,...u},V("span",{style:{color:e.cfg.colors.textPlaceholder,fontSize:"0.875rem"}},"Image"))}if(o)return null;if(t.className){const u=((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className),f=e.getCommonProps(n,u,t),m={key:`${n}-${r}`,src:r,alt:t.alt||"",className:t.className,...f,onError:()=>e.setImageErrors(y=>({...y,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(m.onClick=()=>e.handleButtonClick(t.onClick)),V("img",m)}const l={width:t.w||t.width||"100%",height:t.h||t.height||"auto",objectFit:"cover",borderRadius:"0.75rem"};t.onClick&&(l.cursor="pointer");const c={key:`${n}-${r}`,src:r,alt:t.alt||"",...e.getCommonProps(n,l,t),onError:()=>e.setImageErrors(u=>({...u,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(c.onClick=()=>e.handleButtonClick(t.onClick)),V("img",c)}function gct(e,t,n){var o;if(t.className){const s=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return V("input",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",style:{colorScheme:e.cfg.colorMode==="light"?"light":"dark"},onClick:t.openPickerOnClick?c=>{var h,u;return(u=(h=c.currentTarget).showPicker)==null?void 0:u.call(h)}:void 0,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value})),onKeyDown:t.onKeyDown?c=>{c.key==="Enter"&&e.handleButtonClick(t.onKeyDown)}:void 0})}const r={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition},i=e.getCommonProps(n,r,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return V("div",{key:n,...s},V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("input",{...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))}))}return V("input",{key:n,...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:s=>e.setSceneData(l=>({...l,[t.name||""]:s.target.value}))})}function yct(e,t,n){const r=t.value?e.interpolateText(String(t.value)):e.sceneData[t.name||""]??"";return V("input",{key:n,type:"hidden",name:t.name,value:r})}function vct(e,t,n){var s;const r=()=>{var l;return[t.placeholder&&V("option",{key:"__placeholder",value:""},t.placeholder),...((l=t.options)==null?void 0:l.map(c=>V("option",{key:c.value,value:c.value},c.label)))||[]]};if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=e.getCommonProps(n,l,t);return V("select",{key:n,className:t.className,...c,name:t.name,value:e.sceneData[t.name||""]??"",onChange:h=>e.setSceneData(u=>({...u,[t.name||""]:h.target.value}))},...r())}const i={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,cursor:"pointer",appearance:"none"},o=e.getCommonProps(n,i,t);if(t.label){const l=e.getCommonProps(n,{width:"100%"},t);return V("div",{key:n,...l},V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("select",{...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value}))},...r()))}return V("select",{key:n,...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))},...r())}function bct(e,t,n){const r=t.className||"flex items-center gap-3 cursor-pointer text-white",i=e.parseClassName(r),o="w-5 h-5 rounded border-gray-600 bg-gray-800 accent-primary",s=e.parseClassName(o),l=e.getCommonProps(n,i,t);return V("label",{key:n,className:r,...l},V("input",{type:"checkbox",className:o,style:s,checked:e.sceneData[t.name||""]||!1,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.checked}))}),V("span",{},t.label||""))}function xct(e,t,n){const r={green:{bg:"#065f4620",color:"#22c55e",border:"#22c55e40"},blue:{bg:"#1e40af20",color:"#3b82f6",border:"#3b82f640"},red:{bg:"#7f1d1d20",color:"#ef4444",border:"#ef444440"},yellow:{bg:"#71370220",color:"#eab308",border:"#eab30840"},purple:{bg:"#581c8720",color:"#a855f7",border:"#a855f740"},orange:{bg:"#7c2d1220",color:"#f97316",border:"#f9731640"},gray:{bg:"#37415120",color:"#9ca3af",border:"#9ca3af40"},cyan:{bg:"#0e727020",color:"#06b6d4",border:"#06b6d440"},pink:{bg:"#83184420",color:"#ec4899",border:"#ec489940"}};let o=t.colorScheme||"gray";if(t.colorBy&&typeof t.colorBy=="object"){const u=(e.interpolateText(t.text||t.label||"")||"").trim().toLowerCase();t.colorBy[u]&&(o=t.colorBy[u])}const s=r[o]||r.gray,l=t.variant||"subtle";let c={display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,letterSpacing:"0.025em",textTransform:"uppercase",whiteSpace:"nowrap"};l==="solid"?(c.backgroundColor=s.color,c.color="#fff"):l==="outline"?(c.backgroundColor="transparent",c.color=s.color,c.border=`1px solid ${s.border||s.color}`):(c.backgroundColor=s.bg,c.color=s.color,t.bordered&&(c.border=`1px solid ${s.border||s.color}`)),t.pill&&(c.borderRadius="9999px"),t.className&&(c={...c,...e.parseClassName(t.className)});const h=e.getCommonProps(n,c,t);return V("span",{key:n,...h},e.interpolateText(t.text||t.label||""))}function wct(e,t,n){const r={display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500,backgroundColor:t.bg||e.cfg.colors.surfaceHover,color:t.color||e.cfg.colors.textSecondary,...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return V("span",{key:n,...i},e.interpolateText(t.text||t.label||""))}function _ct(e,t,n){const i={sm:32,md:40,lg:48,xl:64}[t.size||"md"]||40,o=i*.4;if(t.src){const h={width:`${i}px`,height:`${i}px`,borderRadius:"50%",objectFit:"cover",...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return V("img",{key:n,src:t.src,alt:t.alt||t.label||"",...u})}const s=t.initials||(t.label||t.text||"").split(" ").map(h=>h[0]).join("").slice(0,2).toUpperCase()||"?",l={width:`${i}px`,height:`${i}px`,borderRadius:"50%",backgroundColor:t.bg||e.cfg.colors.primary,color:t.color||e.cfg.colors.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${o}px`,fontWeight:600,flexShrink:0,...t.className?e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return V("div",{key:n,...c},s)}function Sct(e,t,n){const r=t.progressValue??t.value??0,i=t.progressMax??100,o=(y,x)=>{if(typeof y=="string")return Number(e.interpolateText(y))||x;const p=Number(y);return Number.isFinite(p)?p:x},s=o(r,0),l=o(i,100),c=Math.min(100,Math.max(0,s/l*100)),u=s>l?e.cfg.colors.danger:t.color||e.cfg.colors.primary,f={width:"100%",display:"flex",flexDirection:"column",gap:"4px",...t.className?e.parseClassName(t.className):{}},m=e.getCommonProps(n,f,t);return V("div",{key:n,...m},(t.progressLabel||t.label)&&v.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:e.cfg.colors.textMuted}},V("span",null,e.interpolateText(t.progressLabel||t.label||"")),V("span",null,`${s}/${l}`)),v.createElement("div",{style:{width:"100%",height:"8px",backgroundColor:e.cfg.colors.surfaceHover,borderRadius:"4px",overflow:"hidden"}},V("div",{style:{width:`${Math.min(c,100)}%`,height:"100%",backgroundColor:u,borderRadius:"4px",transition:"width 0.3s ease"}})))}function Pct(e,t,n){const r={position:"relative",width:"100%",...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return V("div",{key:n,...i},V("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:e.cfg.colors.textPlaceholder,fontSize:"14px",pointerEvents:"none"}},e.renderIcon("search",14)),V("input",{type:"text",name:t.name||"search",placeholder:t.placeholder||"Search...",value:e.sceneData[t.name||"search"]??"",onChange:o=>{e.setSceneData(s=>({...s,[t.name||"search"]:o.target.value}))},style:{width:"100%",padding:"8px 12px 8px 36px",borderRadius:e.cfg.layout.borderRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",fontSize:e.cfg.typography.baseFontSize,transition:e.cfg.effects.transition}}))}function Act(e,t,n){const r=Array.isArray(t.breadcrumbItems)?t.breadcrumbItems:[],i={display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",...t.className?e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return V("nav",{key:n,...o,"aria-label":"Breadcrumb"},r.map((s,l)=>{const c=l===r.length-1,h=e.interpolateText(s.label);return v.createElement(v.Fragment,{key:`${n}-bc-${l}`},v.createElement(c?"span":"a",{style:{color:c?e.cfg.colors.textSecondary:e.cfg.colors.textMuted,fontWeight:c?600:400,cursor:c?"default":"pointer",textDecoration:"none",transition:e.cfg.effects.transition},...!c&&s.href?{href:s.href}:{},...!c&&s.onClick?{onClick:()=>e.handleButtonClick(s.onClick,{})}:{}},h),!c&&V("span",{style:{color:e.cfg.colors.border,margin:"0 2px"}},"/"))}))}function Tct(e,t,n){const r=Array.isArray(t.items)?t.items:[],[i,o]=v.useState(0),s=t.autoplay!==!1&&r.length>1,l=t.interval||4e3,c=t.effect==="fade"?"fade":"slide";v.useEffect(()=>{if(!s||r.length<2)return;const S=setInterval(()=>o(A=>(A+1)%r.length),l);return()=>clearInterval(S)},[s,l,r.length]);const h=S=>o((S%r.length+r.length)%r.length),u=t.showArrows!==!1&&r.length>1,f=t.showDots!==!1&&r.length>1,m={position:"relative",overflow:"hidden",...t.className?e.parseClassName(t.className):{}};t.aspectRatio&&(m.aspectRatio=t.aspectRatio),!t.aspectRatio&&!t.height&&(m.height="320px");const y=e.getCommonProps(n,m,t),x=S=>typeof S=="string"?{type:"text",text:S}:S&&S.image?{type:"image",src:S.image,alt:S.alt||"",title:S.title}:S,p=r.map((S,A)=>{const E=e.renderComponent({...x(S),key:void 0},A,`${n}-slide`),w={width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"};return c==="fade"?(w.position="absolute",w.inset="0",w.opacity=A===i?1:0,w.transition="opacity .5s ease",w.pointerEvents=A===i?"auto":"none"):w.flexShrink=0,V("div",{key:`${n}-item-${A}`,style:w},E)}),b=c==="fade"?{position:"relative",width:"100%",height:"100%"}:{display:"flex",height:"100%",transition:"transform .5s ease",transform:`translateX(-${i*100}%)`},P={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:"36px",height:"36px",borderRadius:"50%",border:"none",background:"rgba(0,0,0,0.45)",color:"#fff",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"};return V("div",{key:n,...y},V("div",{style:b},p),u&&V("div",{style:{...P,left:"8px"}},V("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i-1),"aria-label":"Previous slide"},"<")),u&&V("div",{style:{...P,right:"8px"}},V("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i+1),"aria-label":"Next slide"},">")),f&&V("div",{style:{position:"absolute",bottom:"10px",left:"50%",transform:"translateX(-50%)",display:"flex",gap:"6px",zIndex:2}},r.map((S,A)=>V("button",{key:`${n}-dot-${A}`,"aria-label":`Slide ${A+1}`,onClick:()=>h(A),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",padding:0,background:A===i?"rgba(255,255,255,0.95)":"rgba(255,255,255,0.4)",transition:"background .3s ease"}}))))}function Ect(e,t,n){const r=Array.isArray(t.items)?t.items:[],i=t.speed||20,o={overflow:"hidden",width:"100%",...t.className?e.parseClassName(t.className):{}},s=e.getCommonProps(n,o,t),l=c=>V("div",{key:c,style:{display:"inline-flex",alignItems:"center",gap:t.gap||"24px",paddingRight:t.gap||"24px",animation:`bf-marquee ${i}s linear infinite`,willChange:"transform",flexShrink:0}},r.map((h,u)=>{const f=typeof h=="string"?{type:"text",text:h}:h&&h.image?{type:"image",src:h.image,alt:h.alt||"",height:t.itemHeight||"48px"}:h;return e.renderComponent(f,u,`${c}-${n}-marq`)}));return V("div",{key:n,...s},V("div",{style:{display:"flex",width:"max-content"}},l("a"),l("b")))}function Cct(e,t,n){const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState("idle"),[c,h]=v.useState(""),[u,f]=v.useState(!1),m=t.fieldName||"capture",y=t.captureMode==="qr",x=e.apiUrl||window.location.origin,p=t.uploadPath||"/api/files/upload",b=()=>{var F;(F=i.current)==null||F.getTracks().forEach(D=>D.stop()),i.current=null},P=async F=>{var U,z,Y;const D=new FormData;D.append("file",F,`${m}-${Date.now()}.jpg`);const j=await fetch(new URL(p,x).toString(),{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:D});if(!j.ok)throw new Error("Upload failed");const K=await j.json();return((U=K==null?void 0:K.file)==null?void 0:U.url)||((z=K==null?void 0:K.file)==null?void 0:z.publicUrl)||((Y=K==null?void 0:K.file)==null?void 0:Y.path)||(K==null?void 0:K.url)||(K==null?void 0:K.path)||""},S=async(F,D)=>{var j,K;if(s!=="done"){b();try{f(!0);const U=D||await P(F);e.setSceneData(z=>({...z,[m]:U})),h(U),l("done"),(j=e.showToast)==null||j.call(e,t.successMessage||(D?"Scanned!":"Captured & uploaded"),"success")}catch{l("error"),(K=e.showToast)==null||K.call(e,"Capture failed","error")}finally{f(!1)}}},A=()=>{var j;const F=r.current;if(!F||!F.videoWidth)return;const D=document.createElement("canvas");D.width=F.videoWidth,D.height=F.videoHeight,(j=D.getContext("2d"))==null||j.drawImage(F,0,0),D.toBlob(K=>K&&S(K),"image/jpeg",t.quality||.85)},E=async()=>{var F,D;try{const j=await navigator.mediaDevices.getUserMedia({video:{facingMode:t.facingMode||"user",...t.aspectRatio?{aspectRatio:Number(t.aspectRatio)}:{}},audio:!1});if(i.current=j,r.current&&(r.current.srcObject=j,await r.current.play().catch(()=>{})),l("running"),y){const U=window.BarcodeDetector;if(!U){l("error"),(F=e.showToast)==null||F.call(e,"QR scanning not supported in this browser","error");return}const z=new U;o.current=window.setInterval(async()=>{const Y=r.current;if(!(!Y||!Y.videoWidth||s==="done"))try{const G=await z.detect(Y);G!=null&&G.length&&S(new Blob,G[0].rawValue)}catch{}},400)}}catch{l("error"),(D=e.showToast)==null||D.call(e,"Camera access denied","error")}};v.useEffect(()=>(E(),()=>{o.current&&window.clearInterval(o.current),b()}),[]);const w={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",width:"100%",...t.className?e.parseClassName(t.className):{}},T=e.getCommonProps(n,w,t),O=V("video",{key:"cam-video",ref:r,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a",display:y||s!=="done"?void 0:"none"}}),I=c?V("img",{key:"cam-result",src:c,alt:"captured",style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a"}}):null,N=V("div",{key:"cam-actions",style:{display:"flex",gap:"10px",flexWrap:"wrap",justifyContent:"center"}},s!=="done"?V("button",{key:"cam-capture",onClick:A,disabled:u||s!=="running",style:{padding:"10px 22px",borderRadius:"9999px",border:"none",cursor:u?"wait":"pointer",background:"#3B82F6",color:"#fff",fontWeight:600}},u?"Uploading...":y?t.captureLabel||"Scan QR":t.captureLabel||"Capture"):V("button",{key:"cam-retake",onClick:()=>{h(""),l("idle"),E()},style:{padding:"10px 22px",borderRadius:"9999px",border:"1px solid #94a3b8",cursor:"pointer",background:"transparent"}},"Retake"));return V("div",{key:n,...T},O,I,t.captureLabel===!1?null:N,s==="error"?V("p",{key:"cam-err",style:{color:"#EF4444",fontSize:"13px"}},"Camera unavailable — check permissions"):null)}function Oct(e,t,n){var i;if(t.className){const o=((i=e.parseClassNameResponsive)==null?void 0:i.call(e,t.className,n))??e.parseClassName(t.className),s=e.getCommonProps(n,o,t);return V("div",{key:n,className:t.className,...s})}const r=e.getCommonProps(n,{height:t.h||t.height||"24px"},t);return V("div",{key:n,...r})}function Mct(e,t,n){const r=t.className||"border-gray-700 my-4",i=e.parseClassName(r),o=e.getCommonProps(n,i,t);return V("hr",{key:n,className:r,...o})}function kct(e,t,n){var u;const r=t.loaderVariant||"spinner",i=t.rows||3,o=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};t.rawStyle&&Object.assign(o,t.rawStyle);const s=e.getCommonProps(n,o,t),l=`${e.scopeId}-${n}`,c=e.renderMode==="css-driven"?{"data-bf-r":l}:{};if(r==="skeleton"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(V("div",{key:m,className:"bf-loader-skeleton",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return V("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="shimmer"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(V("div",{key:m,className:"bf-loader-shimmer",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return V("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="dots"){const f=t.color||"currentColor";return V("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",gap:"6px",...o},...s,...c},[0,1,2].map(m=>V("div",{key:m,className:"bf-loader-dot",style:{width:t.size||"8px",height:t.size||"8px",borderRadius:"50%",backgroundColor:f,animationDelay:`${m*.16}s`}})))}if(r==="pulse")return V("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},V("div",{className:"bf-loader-pulse",style:{width:t.size||"32px",height:t.size||"32px",borderRadius:"50%",border:`3px solid ${t.color||"currentColor"}`}}));if(r==="progress")return V("div",{key:n,className:t.className,style:{width:"100%",...o},...s,...c},V("div",{style:{height:t.height||"4px",width:"100%",backgroundColor:"rgba(128,128,128,0.2)",borderRadius:"4px",overflow:"hidden"}},V("div",{className:"bf-loader-progress-bar",style:{height:"100%",width:"30%",backgroundColor:t.color||"currentColor",borderRadius:"4px"}})));const h=t.size||"24px";return V("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},V("div",{className:"bf-loader-spinner",style:{width:h,height:h,border:`3px solid ${t.color?t.color+"33":"rgba(128,128,128,0.2)"}`,borderTopColor:t.color||"currentColor",borderRadius:"50%"}}))}function $ct(e,t,n){const r=t.rows||4;if(t.className){const s=e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return V("textarea",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,rows:r})}const i={width:"100%",padding:"0.75rem 1rem",borderRadius:e.cfg.components.inputRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,resize:"vertical",fontFamily:"inherit"},o=e.getCommonProps(n,i,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return V("div",{key:n,...s},V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("textarea",{...o,name:t.name,placeholder:t.placeholder,rows:r}))}return V("textarea",{key:n,...o,name:t.name,placeholder:t.placeholder,rows:r})}function Ict(e,t,n){const r=t.icon||t.name||"",i=t.size||24,o=e.renderIcon(r,i);if(t.className){const s=e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return V("span",{key:n,className:t.className,...l},o)}return v.cloneElement(o,{key:n})}function Rct(e,t,n){const r=t.metricSize||"md",i=r==="sm"?"1.25rem":r==="lg"?"2.5rem":"1.75rem",o=r==="sm"?"0.75rem":r==="lg"?"1rem":"0.875rem",s=t.color||e.cfg.colors.primary,l=t.trend==="up"?"↑":t.trend==="down"?"↓":"",c=t.trendColor||(t.trend==="up"?e.cfg.colors.success:t.trend==="down"?e.cfg.colors.danger:e.cfg.colors.textMuted),h={display:"flex",flexDirection:"column",gap:"2px",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return V("div",{key:n,...u},t.label&&V("span",{style:{fontSize:o,color:e.cfg.colors.textSecondary,fontWeight:500}},e.interpolateText(t.label)),v.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px",marginTop:"4px"}},t.prefix&&V("span",{style:{fontSize:i,fontWeight:700,color:s}},t.prefix),V("span",{style:{fontSize:i,fontWeight:700,color:e.cfg.colors.text}},typeof t.value=="number"?t.value.toLocaleString():e.interpolateText(String(t.value??""))),t.suffix&&V("span",{style:{fontSize:i,fontWeight:700,color:s}},t.suffix),t.delta&&V("span",{style:{fontSize:"0.75rem",fontWeight:600,color:c,marginLeft:"4px"}},`${l} ${t.delta}`)))}function Lct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||200,o=t.barColor||e.cfg.colors.primary,s=t.horizontal===!0,l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},c=s?{type:"number",axisLine:!1,tickLine:!1}:{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:e.cfg.colors.textMuted,fontSize:12}},h=s?{dataKey:"label",type:"category",axisLine:!1,tickLine:!1,width:88,tick:{fill:e.cfg.colors.textMuted,fontSize:12}}:{axisLine:!1,tickLine:!1,width:36},u=v.createElement(qp,{width:"100%",height:i},v.createElement(oct,{data:r,layout:s?"vertical":"horizontal"},v.createElement(mm,{vertical:!s,stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(hs,c),v.createElement(fs,h),v.createElement(wr,{cursor:{fill:t.cursorColor||e.cfg.colors.surfaceHover,fillOpacity:t.cursorOpacity??.5},content:v.createElement(N$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:o,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(Aa,{dataKey:"value",fill:o,radius:s?[0,4,4,0]:[4,4,0,0],isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})));return V("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&V("div",{style:{marginBottom:"0.75rem"}},t.title),u)}function oT(e,t,n,r=!1){const i=t.chartData||t.data||[];if(!Array.isArray(i)||i.length===0)return null;const o=Number(t.height)||240,s=Array.isArray(t.colors)&&t.colors.length?t.colors:[e.cfg.colors.primary,e.cfg.colors.accent,"#317150","#d95020","#638173"],l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return V("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&V("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(qp,{width:"100%",height:o},v.createElement(sct,null,v.createElement(wr,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),t.showLegend!==!1&&v.createElement(ra,{iconType:"circle",wrapperStyle:{fontSize:12}}),v.createElement(bo,{data:i,dataKey:"value",nameKey:"label",cx:"50%",cy:"50%",innerRadius:r?"55%":0,outerRadius:"80%",paddingAngle:2,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750},...i.map((c,h)=>v.createElement(Sh,{key:`${c.label||h}-${h}`,fill:c.color||s[h%s.length]}))))))}function Nct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||260,o=t.xKey||"x",s=t.yKey||"y",l=t.zKey||"size",c={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return V("div",{key:n,style:e.getCommonProps(n,c,t)},t.title&&V("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(qp,{width:"100%",height:i},v.createElement(act,{margin:{top:16,right:12,bottom:8,left:0}},v.createElement(mm,{stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(hs,{dataKey:o,type:"number",axisLine:!1,tickLine:!1}),v.createElement(fs,{dataKey:s,type:"number",axisLine:!1,tickLine:!1}),v.createElement(Oh,{dataKey:l,range:t.zRange||[50,360]}),v.createElement(wr,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),v.createElement(Mh,{data:r,fill:t.color||e.cfg.colors.primary,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750}))))}function N$({active:e,payload:t,label:n,prefix:r,labelText:i,lineColor:o,backgroundColor:s,textColor:l,borderColor:c}){var u;const h=Number((u=t==null?void 0:t[0])==null?void 0:u.value);return!e||!Number.isFinite(h)?null:v.createElement("div",{style:{padding:10,border:`1px solid ${c}`,borderRadius:6,backgroundColor:s,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.16)",color:l}},v.createElement("p",{style:{margin:0,fontSize:14}},n),v.createElement("p",{style:{margin:"8px 0 0",color:o,fontSize:14}},`${i||"Indicative price / kg"}: ${r||""}${h.toLocaleString()}`))}function jct({api:e,c:t,data:n,height:r,lineColor:i,fillColor:o,filled:s}){return v.createElement(qp,{width:"100%",height:r},v.createElement(lct,{data:n,margin:{top:16,right:8,left:0,bottom:0}},t.showGrid!==!1&&v.createElement(mm,{vertical:!1,stroke:"#dce4dc",strokeDasharray:"3 3"}),v.createElement(hs,{dataKey:"label",axisLine:!1,tickLine:!1,height:30,tick:{fill:"#638173",fontSize:12}}),v.createElement(fs,{axisLine:!1,tickLine:!1,width:40,tickCount:5,domain:[0,"auto"],tick:{fill:"#638173",fontSize:12},tickFormatter:l=>`${t.tooltipPrefix||""}${Number(l/1e3).toFixed(1).replace(".0","")}k`}),v.createElement(wr,{cursor:{stroke:"#638173",strokeDasharray:"3 3"},content:v.createElement(N$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:i,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(us,{type:"monotone",dataKey:"value",stroke:i,fill:s?o:"transparent",strokeWidth:3,dot:!1,activeDot:{r:6,fill:i,stroke:e.cfg.colors.surface,strokeWidth:3},isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})))}function Ug(e,t,n,r=!1,i=!1){const o=Array.isArray(t.chartData)?t.chartData:[];if(o.length===0)return null;const s=o.flatMap(b=>i?[b.low,b.high]:[b.value]).map(Number).filter(Number.isFinite);if(s.length===0)return null;const l=Math.min(...s),h=Math.max(...s)-l||1,u=Number(t.height)||220,f=b=>u-(b-l)/h*u,m=t.lineColor||e.cfg.colors.accent,y=t.fillColor||`${m}33`,x={width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},p=i?o.map((b,P)=>{const S=Number(b.open),A=Number(b.close),E=Number(b.high),w=Number(b.low),T=A>=S;return V("div",{key:P,style:{flex:1,height:"100%",position:"relative"}},V("div",{style:{position:"absolute",left:"50%",top:`${f(E)}px`,height:`${Math.max(1,f(w)-f(E))}px`,borderLeft:`1px solid ${T?"#22c55e":"#ef4444"}`}}),V("div",{style:{position:"absolute",left:"25%",right:"25%",top:`${f(Math.max(S,A))}px`,height:`${Math.max(3,Math.abs(f(A)-f(S)))}px`,background:T?"#22c55e":"#ef4444",borderRadius:"2px"}}))}):v.createElement(jct,{api:e,c:t,data:o,height:u,lineColor:m,fillColor:y,filled:r});return V("div",{key:n,style:e.getCommonProps(n,x,t)},t.title&&V("div",{style:{color:e.cfg.colors.textSecondary,fontWeight:600,marginBottom:"0.75rem"}},t.title),V("div",{style:{display:"flex",alignItems:"stretch",gap:i?"4px":void 0,height:u}},p),i&&V("div",{style:{display:"flex",justifyContent:"space-between",color:e.cfg.colors.textMuted,fontSize:"0.7rem",marginTop:"4px"}},...o.map((b,P)=>V("span",{key:P},b.label||""))))}function Dct(e,t,n){const r=Array.isArray(t.chartData)?t.chartData[0]||{}:{},i=t.ticker||r.ticker||r.symbol||"EUR/USD",o=t.bid??r.bid??r.price,s=t.ask??r.ask,l=t.change??r.change,c=Number(l),h=Number.isFinite(c)&&c>=0,u=e.getCommonProps(n,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",width:"100%",padding:"0.9rem 1rem",backgroundColor:e.cfg.colors.surface,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:e.cfg.layout.borderRadiusLg,...t.className?e.parseClassName(t.className):{}},t);return V("div",{key:n,...u},V("div",{},V("div",{style:{color:e.cfg.colors.text,fontWeight:700}},i),t.label&&V("div",{style:{color:e.cfg.colors.textMuted,fontSize:"0.75rem"}},t.label)),V("div",{style:{display:"flex",gap:"1rem",alignItems:"baseline",fontVariantNumeric:"tabular-nums"}},o!=null&&V("span",{style:{color:e.cfg.colors.text,fontWeight:700}},String(o)),s!=null&&V("span",{style:{color:e.cfg.colors.textSecondary}},String(s)),l!=null&&V("span",{style:{color:h?"#22c55e":"#ef4444",fontSize:"0.8rem",fontWeight:600}},`${h?"+":""}${l}`)))}function Bct({api:e,c:t,componentKey:n}){var b,P,S,A;const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState(null),c=v.useRef(null),[h,u]=v.useState(()=>Array.isArray(t.chartData)?t.chartData:[]);v.useEffect(()=>{Array.isArray(t.chartData)&&u(t.chartData)},[t.chartData]);const f=e.interpolateText(((b=t.realtime)==null?void 0:b.channel)||""),m=e.interpolateText(((P=t.timeRange)==null?void 0:P.from)||""),y=e.interpolateText(((S=t.timeRange)==null?void 0:S.to)||""),x=Array.isArray(t.timeframes)?t.timeframes:[];v.useEffect(()=>{var O,I;const E=e.sdk;if(!(((O=t.realtime)==null?void 0:O.mode)==="ws"&&e.isAuthenticated&&f&&((I=E==null?void 0:E.client)==null?void 0:I.createWebSocket)))return;const T=E.client.createWebSocket(f);return T.onmessage=N=>{var F;try{const D=typeof N.data=="string"?JSON.parse(N.data):N.data,j=(D==null?void 0:D.tick)||((F=D==null?void 0:D.data)==null?void 0:F.tick)||(D==null?void 0:D.data)||D,K=Number((j==null?void 0:j.quote)??(j==null?void 0:j.price)??(j==null?void 0:j.close));if(!Number.isFinite(K))return;const U=Number((j==null?void 0:j.epoch)??(j==null?void 0:j.timestamp)??Date.now()/1e3),z=Math.floor(U/60)*60;u(Y=>{const G=Y[Y.length-1];if((G==null?void 0:G.time)===z)return[...Y.slice(0,-1),{...G,high:Math.max(Number(G.high),K),low:Math.min(Number(G.low),K),close:K}];const X=Number((G==null?void 0:G.close)??K);return[...Y.slice(-99),{time:z,open:X,high:K,low:K,close:K}]})}catch{}},()=>{var N;return(N=T.close)==null?void 0:N.call(T)}},[e.isAuthenticated,(A=t.realtime)==null?void 0:A.mode,f]);const p=v.useMemo(()=>h.map((E,w)=>{const T=E.time||E.timestamp;return{time:typeof T=="string"&&T.includes("T")?Math.floor(new Date(T).getTime()/1e3):T||`2024-01-${String(w+1).padStart(2,"0")}`,...t.chartType==="candlestick"?{open:Number(E.open),high:Number(E.high),low:Number(E.low),close:Number(E.close)}:{value:Number(E.value??E.close)}}}),[t.chartType,h]);return c.current=p[p.length-1],v.useEffect(()=>{const E=r.current;if(!E)return;const w=Lz(E,{autoSize:!0,height:Number(t.height)||280,layout:{background:{color:"transparent"},textColor:e.cfg.colors.textSecondary},grid:{vertLines:{color:e.cfg.colors.borderSubtle},horzLines:{color:e.cfg.colors.borderSubtle}},rightPriceScale:{borderColor:e.cfg.colors.borderSubtle},timeScale:{borderColor:e.cfg.colors.borderSubtle,timeVisible:!0}}),T=t.chartType||"candlestick",O=T==="line"?w.addSeries(Wz,{color:t.lineColor||e.cfg.colors.accent}):T==="area"?w.addSeries(Kz,{lineColor:t.lineColor||e.cfg.colors.accent,topColor:t.fillColor||`${e.cfg.colors.accent}66`,bottomColor:"transparent"}):w.addSeries(t5,{upColor:"#22c55e",downColor:"#ef4444",borderVisible:!1,wickUpColor:"#22c55e",wickDownColor:"#ef4444"});return o.current=w,i.current=O,()=>{i.current=null,o.current=null,w.remove()}},[e.cfg.colors.accent,e.cfg.colors.borderSubtle,e.cfg.colors.textSecondary,t.chartType,t.height,t.lineColor,t.fillColor]),v.useEffect(()=>{var E,w;!i.current||p.length===0||(i.current.setData(p),m&&y?(E=o.current)==null||E.timeScale().setVisibleRange({from:m,to:y}):(w=o.current)!=null&&w.timeScale().getVisibleLogicalRange()||o.current.timeScale().fitContent())},[p,m,y]),v.useEffect(()=>{if(!s||!o.current||!c.current)return;const E={"1H":3600,"4H":14400,"1D":86400,"1W":604800}[s],w=Number(c.current.time);E&&Number.isFinite(w)&&o.current.timeScale().setVisibleRange({from:w-E,to:w})},[s]),V("div",{key:n,style:{width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}}},x.length>0&&V("div",{style:{display:"flex",gap:"0.35rem",marginBottom:"0.5rem"}},...x.map(E=>V("button",{key:E,type:"button",onClick:()=>l(E),style:{padding:"0.3rem 0.6rem",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:4,color:e.cfg.colors.text,background:s===E?e.cfg.colors.surfaceHover:"transparent",cursor:"pointer"}},E))),V("div",{ref:r,style:{width:"100%",height:Number(t.height)||280}}))}function zct(e,t,n){return v.createElement(Bct,{api:e,c:t,componentKey:n})}function Fct(e,t,n){const r=t.json||t.data||t.diagram||{},i=e.getCommonProps(n,{display:"flex",flexDirection:"column",minHeight:"300px"},t);return V("div",{key:n,className:t.className,...i},v.createElement("pre",{style:{fontSize:"12px",whiteSpace:"pre-wrap",margin:0}},typeof r=="string"?r:JSON.stringify(r,null,2)))}function Wct({api:e,c:t,componentKey:n}){const r=t.data||t.json||t.diagram||{},{_config:i,...o}=r||{},s=Object.keys(o).length?o:r,{nodes:l,edges:c}=v.useMemo(()=>Ax.createFlowDiagram(s),[s]),[h,u]=v.useState("LR"),f=e.cfg.fullscreen===!0,m=t.height||(f?"100%":320),y=e.getCommonProps(n,{width:"100%",height:m,...f?{minHeight:0}:{}},t);return V("div",{key:n,className:t.className,...y},v.createElement(Ax.FlowDiagram,{nodes:l,edges:c,config:{direction:h,layout:(i==null?void 0:i.layout)||"dagre",colorMode:(i==null?void 0:i.colorMode)||(e.cfg.colorMode==="dark"?"dark":"light"),backgroundPattern:(i==null?void 0:i.backgroundPattern)||"dot"},callbacks:{onDirectionChange:x=>u(x)},showBottomBar:(i==null?void 0:i.showBottomBar)||!1,style:{width:"100%",height:"100%"}}))}function Vct(e,t,n){return v.createElement(Wct,{api:e,c:t,componentKey:n})}function Uct(e,t,n){var r;if(t.className){const i=((r=e.parseClassNameResponsive)==null?void 0:r.call(e,t.className,n))??e.parseClassName(t.className);i.display==null&&(i.display="flex"),i.flexDirection==null&&(i.flexDirection=/(^|\s)flex(\s|$)/.test(t.className||"")||t.layout==="row"?"row":"column");const o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,className:t.className,...o},(Array.isArray(t.children)?t.children:[]).map((s,l)=>e.renderComponent(s,l,n)))}return null}const Hct=v.memo(({api:e,field:t,fieldName:n,value:r,onChange:i})=>{v.useEffect(()=>{r!==void 0&&r!==""&&i&&i(r)},[]);const o=v.useRef(null),[s,l]=v.useState(!1),c=v.useRef(null),h=v.useRef(null),[u,f]=v.useState(!1),[m,y]=v.useState(""),[x,p]=v.useState(!1),b=t.html!==!1,P=S=>b?S:S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\n/g,"<br>");return v.useEffect(()=>{o.current&&!o.current.innerHTML&&(o.current.innerHTML=P(r))},[]),v.useEffect(()=>{o.current&&document.activeElement!==o.current&&o.current.innerHTML!==r&&(o.current.innerHTML=P(r))},[r]),v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},t.label?V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,v.createElement("div",{style:{border:`1px solid ${s?e.cfg.colors.primary:e.cfg.colors.border}`,borderRadius:e.cfg.components.inputRadius,overflow:"hidden",transition:"border-color 0.2s",position:"relative"}},v.createElement("div",{style:{display:"flex",gap:"4px",padding:"6px 8px",borderBottom:`1px solid ${e.cfg.colors.border}`,backgroundColor:e.cfg.colors.surface}},...[{cmd:"bold",label:"B"},{cmd:"italic",label:"I"},{cmd:"underline",label:"U"}].map(S=>V("button",{key:S.cmd,type:"button",onMouseDown:A=>{var E;A.preventDefault(),document.execCommand(S.cmd,!1),(E=o.current)==null||E.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontWeight:600,fontSize:"13px"},onMouseEnter:A=>A.target.style.borderColor=e.cfg.colors.border,onMouseLeave:A=>A.target.style.borderColor="transparent"},S.label)),V("span",{key:"spacer",style:{flex:1}}),V("button",{key:"list-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),document.execCommand("insertUnorderedList",!1),(A=o.current)==null||A.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},"☰"),V("span",{key:"divider",style:{width:"1px",height:"16px",backgroundColor:e.cfg.colors.border,margin:"0 4px",alignSelf:"center"}}),V("button",{key:"img-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=c.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("image",14)),V("button",{key:"att-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=h.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("paperclip",14)),V("button",{key:"ai-btn",type:"button",onMouseDown:S=>{S.preventDefault(),f(!u)},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:u?e.cfg.colors.border:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("sparkles",14))),V("div",{ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onInput:S=>i(S.currentTarget.innerHTML),onFocus:()=>l(!0),onBlur:()=>l(!1),style:{minHeight:(t.rows||10)*20+"px",padding:"0.75rem 1rem",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,outline:"none",fontSize:"0.875rem",lineHeight:"1.6"}}),t.expandAction?v.createElement("button",{type:"button",key:"expand",style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.55)",border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"3px 5px",display:"flex",alignItems:"center",justifyContent:"center",opacity:.5,transition:"opacity 0.2s",zIndex:1},onMouseEnter:S=>{S.currentTarget.style.opacity="0.85"},onMouseLeave:S=>{S.currentTarget.style.opacity="0.5"},onClick:S=>{S.preventDefault(),S.stopPropagation(),e.handleButtonClick(t.expandAction,{})}},e.renderIcon("maximize-2",13)):null,V("input",{key:"img-input",ref:c,type:"file",accept:"image/*",style:{display:"none"},onChange:async S=>{var E,w,T,O,I,N;const A=(E=S.target.files)==null?void 0:E[0];if(A){try{const F=(w=e.showToast)==null?void 0:w.call(e,"Uploading image (0%)…","success",0),D=e.uploadFile?await e.uploadFile(A,t.upload,j=>{var K;return(K=F==null?void 0:F.update)==null?void 0:K.call(F,`Uploading image (${j}%)`)}):"";if((T=F==null?void 0:F.dismiss)==null||T.call(F),!D)throw Error();(O=o.current)==null||O.focus(),document.execCommand("insertImage",!1,D),i(((I=o.current)==null?void 0:I.innerHTML)||"")}catch{(N=e.showToast)==null||N.call(e,"Failed to upload image","error")}S.target.value=""}}}),V("input",{key:"att-input",ref:h,type:"file",multiple:!0,style:{display:"none"},onChange:async S=>{var O,I,N,F,D;const A=Array.from(S.target.files||[]);S.target.value="";const E=[];let w=0;const T=(O=e.showToast)==null?void 0:O.call(e,`Uploading 0/${A.length}…`,"success",0);for(const j of A){try{const K=e.uploadFile?await e.uploadFile(j,t.upload,U=>{var z;return(z=T==null?void 0:T.update)==null?void 0:z.call(T,`Uploading ${j.name} (${U}%)`)}):"";if(!K)throw Error();E.push(`<a href="${K}">${j.name}</a>`)}catch{(I=e.showToast)==null||I.call(e,`Failed to upload ${j.name}`,"error")}w++,(N=T==null?void 0:T.update)==null||N.call(T,`Uploading ${w}/${A.length}…`)}if((F=T==null?void 0:T.dismiss)==null||F.call(T),E.length>0&&o.current){o.current.focus();const j=window.getSelection();if(j){j.removeAllRanges();const K=document.createRange();K.selectNodeContents(o.current),K.collapse(!1),j.addRange(K)}document.execCommand("insertHTML",!1,`<br><br>${E.join(", ")}`),i(((D=o.current)==null?void 0:D.innerHTML)||"")}}}),u?V("div",{key:"ai-popup",style:{position:"absolute",bottom:"100%",left:"8px",right:"8px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",padding:"12px",zIndex:10,boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"}},V("textarea",{value:m,onChange:S=>y(S.target.value),placeholder:"Ask AI to draft a reply...",rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"4px",border:`1px solid ${e.cfg.colors.borderSubtle}`,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,fontSize:"13px",outline:"none",fontFamily:"inherit",resize:"none",boxSizing:"border-box"}}),V("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"8px"}},V("button",{type:"button",onClick:()=>{f(!1),y("")},style:{padding:"6px 14px",borderRadius:"6px",border:`1px solid ${e.cfg.colors.borderSubtle}`,cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textMuted,fontSize:"12px",fontFamily:"inherit"}},"Cancel"),V("button",{type:"button",disabled:x||!m.trim(),onClick:async()=>{var S,A,E,w;if(!(!m.trim()||x)){p(!0);try{const T=((S=o.current)==null?void 0:S.innerHTML)||"",O=await fetch("/api/tenant/email/ai/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:m,context:T})});if(!O.ok)throw Error();const I=await O.json(),N=I.response||I.text||I.content||"";(A=o.current)==null||A.focus(),document.execCommand("insertText",!1,N),i(((E=o.current)==null?void 0:E.innerHTML)||""),f(!1),y("")}catch{(w=e.showToast)==null||w.call(e,"AI request failed","error")}p(!1)}},style:{padding:"6px 14px",borderRadius:"6px",border:"none",cursor:x||!m.trim()?"not-allowed":"pointer",backgroundColor:x||!m.trim()?e.cfg.colors.surfaceHover:e.cfg.colors.background,color:x||!m.trim()?e.cfg.colors.textSecondary:e.cfg.colors.text,fontSize:"12px",fontWeight:600,fontFamily:"inherit"}},x?"Thinking...":"Generate"))):null))}),qct=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),o=v.useRef(null),[s,l]=v.useState([]),c=t.name?`bf_persist_${t.name}`:null;v.useEffect(()=>{t.dataSource&&(async()=>{var f;try{const m=e.interpolateText(t.dataSource),y=(f=e.selectDynamicOptions)==null?void 0:f[m];if(y&&y.length>0){l(y);return}Zo[m]||(Zo[m]=(async()=>{var p;try{const b=await fetch(m,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!b.ok)return[];const P=await b.json(),S=t.dataField||"configs",A=t.optionLabel||"label",E=t.optionValue||"value",w=P[S]||P.data||P,T=Array.isArray(w)?w.map(O=>({label:O[A]||O.name||O.label,value:O[E]||O.id||O.name||O.label})):[];return(p=e.setSelectDynamicOptions)==null||p.call(e,O=>({...O,[m]:T})),T}catch{return delete Zo[m],[]}})());const x=await Zo[m];x.length>0&&l(x)}catch{}})()},[t.dataSource]),v.useEffect(()=>{if(c&&t.name&&!e.sceneData[t.name]){const m=localStorage.getItem(c);m&&e.setSceneData(y=>({...y,[t.name]:m}))}},[c,t.name,e.sceneData[t.name]]),v.useEffect(()=>{if(!r)return;const f=y=>{o.current&&!o.current.contains(y.target)&&i(!1)},m=setTimeout(()=>{document.addEventListener("mousedown",f)},0);return()=>{clearTimeout(m),document.removeEventListener("mousedown",f)}},[r]);const h=t.variant==="selector",u=Array.isArray(t.items)?t.items:s;if(h){const f=t.name&&(e.sceneData[t.name||""]||c&&localStorage.getItem(c))||"",m=f||t.placeholder||"Select...";return V("div",{ref:o,style:{position:"relative",display:"inline-flex"}},v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:t.fontSize||"1rem",fontWeight:t.fontWeight||600,color:t.color||e.cfg.colors.text,padding:"2px 0",outline:"none",lineHeight:"1.5"},onClick:y=>{y.preventDefault(),i(!r)}},V("span",{key:"text"},m),V("span",{key:"caret",style:{display:"flex",alignItems:"center",opacity:.6,marginLeft:"2px"}},e.renderIcon("chevron-down",14))),r?v.createElement("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden",minWidth:"200px"}},...u.map((y,x)=>v.createElement("button",{key:x,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none",whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},onClick:p=>{p.preventDefault(),p.stopPropagation(),i(!1),t.name&&y.value!==f&&e.setSceneData(b=>({...b,[t.name]:y.value}))}},y.label||""))):null)}return v.createElement("div",{ref:o,style:{position:"relative",display:"flex",width:"100%"}},(()=>{var y;const f=!!((y=e.buttonLoading)!=null&&y[n]),m=[];return f?m.push(V("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):t.icon&&m.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(t.icon,t.iconSize||16))),m.push(V("span",{key:"text",style:{lineHeight:"1"}},t.text||"Button")),v.createElement("button",{type:"button",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontSize:"0.875rem",fontWeight:600,fontFamily:"inherit",lineHeight:"1.25rem",transition:"all 0.15s ease",outline:"none"},onMouseEnter:x=>{x.currentTarget.style.backgroundColor=e.cfg.colors.border,x.currentTarget.style.color=e.cfg.colorMode==="light"?"#111827":e.cfg.colors.text},onMouseLeave:x=>{x.currentTarget.style.backgroundColor=e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",x.currentTarget.style.color=e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary},onClick:x=>{if(x.preventDefault(),u.length>0&&u[0].onClick){const p=()=>e.handleButtonClick(u[0].onClick,{onSuccess:u[0].onSuccess,onError:u[0].onError},{feedback:u[0].feedback,optimistic:u[0].optimistic,payload:u[0].payload});(e.withLoading?e.withLoading(n,p):p()).catch(()=>{})}}},...m)})(),u.length>0?v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.75rem 0.5rem",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,borderLeft:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontFamily:"inherit",transition:"all 0.15s ease",outline:"none"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor=e.cfg.colors.border,f.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent",f.currentTarget.style.color=e.cfg.colors.textSecondary},onClick:f=>{f.preventDefault(),f.stopPropagation(),i(!r)}},e.renderIcon("chevron-down",16)):null,r?v.createElement("div",{style:{position:"absolute",bottom:"100%",left:"0",right:"0",marginBottom:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 -8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden"}},...u.map((f,m)=>{var b;const y=`${n}-item-${m}`,x=!!((b=e.buttonLoading)!=null&&b[y]),p=[];return x?p.push(V("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"12px",height:"12px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):f.icon&&p.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"8px"}},e.renderIcon(f.icon,14))),p.push(f.label||""),v.createElement("button",{key:m,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none"},onMouseEnter:P=>{P.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:P=>{P.currentTarget.style.backgroundColor="transparent"},onClick:P=>{if(P.preventDefault(),P.stopPropagation(),!f.onClick)return;const S=f.loading==="self"?y:n;f.loading==="self"?i(!0):i(!1);const A=()=>e.handleButtonClick(f.onClick,{onSuccess:f.onSuccess,onError:f.onError},{feedback:f.feedback,optimistic:f.optimistic,payload:f.payload});(e.withLoading?e.withLoading(S,A):A()).finally(()=>{f.loading==="self"&&i(!1)}).catch(()=>{})}},...p)})):null)});function Gct(e,t,n){return v.createElement(qct,{key:n,api:e,c:t,componentKey:n})}function Zct(e,t,n){var c,h;const r=t.widgetId;if(!r)return null;const o=(e.widgets||[]).find(u=>u.id===r);if(!o||!Array.isArray(o.components))return fp(`[renderer] widget "${r}" not found`),null;if(e.widgetStack&&e.widgetStack.includes(r))return fp(`[renderer] circular widget reference "${r}"`),null;(c=e.widgetStack)==null||c.push(r);const s=t.props||{},l=rb(o.components,s).map((u,f)=>e.renderComponent(u,f,`${n}-${r}`));return(h=e.widgetStack)==null||h.pop(),v.createElement(v.Fragment,null,...l)}function rb(e,t){if(!t||Object.keys(t).length===0)return e;if(Array.isArray(e))return e.map(n=>rb(n,t));if(e&&typeof e=="object"){const n={};for(const[r,i]of Object.entries(e))typeof i=="string"&&i.includes("{{")?n[r]=i.replace(/\{\{\s*(?:props\.)?([\w.]+)(?:\|(\w+))?\s*\}\}/g,(o,s,l)=>{let c=t;for(const f of s.split("."))c=c==null?void 0:c[f];if(c==null)return o;const h=c&&typeof c=="object"&&"_seconds"in c?c._seconds*1e3:c&&typeof c=="object"&&"seconds"in c?c.seconds*1e3:c,u=l?new Date(h):null;if(l&&Number.isNaN(u==null?void 0:u.getTime()))return"";if(l==="datetime")return u.toLocaleString();if(l==="timeago"){const f=Math.floor((Date.now()-u.getTime())/6e4);if(f<1)return"just now";if(f<60)return`${f}m ago`;const m=Math.floor(f/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`}return typeof c=="object"?JSON.stringify(c):String(c)}):n[r]=rb(i,t);return e.condition&&(n.__conditionBase=t),n}return e}const j$=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),[o,s]=v.useState(""),l=v.useRef(null),c=v.useMemo(()=>(Array.isArray(t.options)?t.options:[]).map(b=>typeof b=="string"?{label:b,value:b}:{label:b.label??b.value,value:b.value??b.label}),[t.options]),h=e.sceneData[t.name||""]??"",u=c.find(p=>p.value===h),f=t.className?e.parseClassName(t.className):{},m=v.useMemo(()=>{if(!o)return c;const p=o.toLowerCase();return c.filter(b=>b.label.toLowerCase().includes(p))},[c,o]),y=t.custom&&o&&!c.find(p=>p.value===o||p.label===o);v.useEffect(()=>{if(!r){s("");return}const p=b=>{l.current&&!l.current.contains(b.target)&&i(!1)};return setTimeout(()=>document.addEventListener("mousedown",p),0),()=>document.removeEventListener("mousedown",p)},[r]);const x=p=>{e.setSceneData(b=>({...b,[t.name||""]:p})),i(!1)};return V("div",{key:n,ref:l,style:{position:"relative",width:"100%",...f}},t.label&&V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("button",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 8px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontSize:"14px",textAlign:"left",gap:"8px"},onClick:()=>i(!r)},V("span",null,u?u.label:t.placeholder||"Select..."),V("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},V("path",{d:"m6 9 6 6 6-6"}))),r&&V("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:50,marginTop:"4px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:e.cfg.colors.surface,overflow:"hidden",maxHeight:"260px",display:"flex",flexDirection:"column"}},t.searchable!==!1&&V("input",{style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.text,outline:"none",fontSize:"13px"},placeholder:"Search...",value:o,onChange:p=>{s(p.target.value),p.stopPropagation()},onClick:p=>p.stopPropagation()}),V("div",{style:{overflow:"auto",flex:1}},m.map(p=>V("button",{key:p.value,style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",background:p.value===h?"rgba(59,130,246,0.2)":"transparent",color:p.value===h?e.cfg.colors.primary:e.cfg.colors.text,cursor:"pointer",fontSize:"13px"},onMouseEnter:b=>{b.currentTarget.style.background=e.cfg.colors.surfaceHover},onMouseLeave:b=>{b.currentTarget.style.background=p.value===h?"rgba(59,130,246,0.2)":"transparent"},onClick:()=>x(p.value)},p.label)),y&&V("button",{style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",borderTop:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.primary,cursor:"pointer",fontSize:"13px",fontStyle:"italic"},onClick:()=>x(o)},`+ Add "${o}"`))))});function Yct(e,t,n){return v.createElement(j$,{api:e,c:t,componentKey:n})}const Zo={},Kct=v.memo(({api:e,field:t,fieldName:n,fieldKey:r,fieldStyle:i,fieldWrapperStyle:o})=>{const[s,l]=v.useState([]);v.useEffect(()=>{t.dataSource&&(async()=>{var u;try{const f=e.interpolateText(t.dataSource),m=(u=e.selectDynamicOptions)==null?void 0:u[f];if(m&&m.length>0){l(m);return}Zo[f]||(Zo[f]=(async()=>{var x;try{const p=await fetch(f,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!p.ok)return[];const b=await p.json(),P=t.dataField||"configs",S=t.optionLabel||"label",A=t.optionValue||"value",E=b[P]||b.data||b,w=Array.isArray(E)?E.map(T=>({label:T[S]||T.name||T.label,value:T[A]||T.id||T.name||T.label})):[];return(x=e.setSelectDynamicOptions)==null||x.call(e,T=>({...T,[f]:w})),w}catch{return delete Zo[f],[]}})());const y=await Zo[f];y.length>0&&l(y)}catch{}})()},[t.dataSource]);const c=s.length>0?s:Array.isArray(t.options)?t.options:[],h=t.placeholder||t.label||"Select...";return v.createElement("div",{key:r,style:o||{width:"100%"}},t.label?V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,V("select",{name:n,value:e.sceneData[n]??"",required:t.required,className:t.className,style:{...i,fontSize:"0.875rem"},size:"md",onChange:u=>e.setSceneData(f=>({...f,[n]:u.target.value}))},V("option",{key:"__placeholder",value:"",disabled:!0,hidden:!0},h),c.map((u,f)=>V("option",{key:f,value:typeof u=="string"?u:u.value},typeof u=="string"?u:u.label))))});function Xct(e,t,n){var c;const r=t.className||"",i=((c=e.parseClassNameResponsive)==null?void 0:c.call(e,r,n))??e.parseClassName(r),o=e.getCommonProps(n,i,t),s=Array.isArray(t.fields)?t.fields:[],l=t.submitButton;return t.collection&&e.fetchEntitySchema?v.createElement(Jct,{api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}):D$(e,t,n,r,i,o,s,l)}function Jct({api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}){const[c,h]=v.useState(s),[u,f]=v.useState(!0);return v.useEffect(()=>{if(!e.fetchEntitySchema){f(!1);return}e.fetchEntitySchema(t.collection).then(m=>{if(!Array.isArray(m==null?void 0:m.fields)){f(!1);return}const y=new Map(m.fields.map(p=>[p.name,p])),x=s.map(p=>{var P;const b=y.get(p.name||((P=p.label)==null?void 0:P.toLowerCase()));return b?{...p,required:p.required??b.required,validation:p.validation??(b.validation?{...b.validation}:void 0),placeholder:p.placeholder??b.placeholder}:p});h(x),f(!1)}).catch(()=>f(!1))},[t.collection]),u?V("div",{key:n,style:{padding:"1rem",textAlign:"center",color:e.cfg.colors.textMuted,fontSize:"0.8rem"}},"Loading fields..."):D$(e,t,n,r,i,o,c,l)}const Qct=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,inputType:s,label:l,fieldStyle:c,onKeyDown:h,openPickerOnClick:u}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const f=v.useRef(r);f.current=r;const m=v.useRef(c);m.current=c;const y=v.useCallback(p=>{f.current(p.target.value)},[]),x=v.createElement("input",{name:t,placeholder:i,required:o,type:s||"text",value:n??"",onChange:y,onClick:u?p=>{var b,P;return(P=(b=p.currentTarget).showPicker)==null?void 0:P.call(b)}:void 0,onKeyDown:h?p=>{p.key==="Enter"&&h()}:void 0,style:m.current});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:c.color,marginBottom:"0.75rem"}},l),x):x}),tut=v.memo(function({api:t,field:n,fieldName:r,label:i,fieldStyle:o}){const s=v.useRef(null),[l,c]=v.useState(!1),h=t.sceneData[r]||"",u=t.sceneData[r+"_name"]||"",f=async m=>{var x,p,b,P;const y=(x=m.target.files)==null?void 0:x[0];if(m.target.value="",!!y){c(!0);try{const S=(p=t.showToast)==null?void 0:p.call(t,"Uploading test case (0%)…","success",0),A=t.uploadFile?await t.uploadFile(y,n.upload,E=>{var w;return(w=S==null?void 0:S.update)==null?void 0:w.call(S,`Uploading test case (${E}%)`)}):"";if((b=S==null?void 0:S.dismiss)==null||b.call(S),!A)throw new Error;t.setSceneData(E=>({...E,[r]:A,[r+"_name"]:y.name}))}catch{(P=t.showToast)==null||P.call(t,"Upload failed","error")}finally{c(!1)}}};return v.createElement("div",{style:{width:"100%"}},i&&V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.75rem"}},i),h?v.createElement("div",{style:{...o,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}},V("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},"📎 "+(u||"Test case uploaded")),V("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:t.cfg.colors.danger,fontSize:"13px"},onClick:()=>t.setSceneData(m=>{const y={...m};return delete y[r],delete y[r+"_name"],y})},"Remove")):v.createElement("button",{type:"button",onClick:()=>{var m;return(m=s.current)==null?void 0:m.click()},style:{...o,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",color:t.cfg.colors.textMuted,fontSize:"14px"}},l?"Uploading…":"⬆ Upload a test case"),V("input",{key:"file-input",ref:s,type:"file",accept:n.accept||".pdf,.docx,.txt,.md,.csv,.json",style:{display:"none"},onChange:f}))}),eut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,options:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("select",{name:t,required:o,value:n??"",onChange:f,style:{...u.current,cursor:"pointer",appearance:"none"}},i?v.createElement("option",{key:"__placeholder",value:""},i):null,...s.map((y,x)=>v.createElement("option",{key:x,value:typeof y=="string"?y:y.value},typeof y=="string"?y:y.label)));return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m}),nut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,rows:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("textarea",{name:t,placeholder:i,required:o,rows:s||4,value:n??"",onChange:f,style:{...u.current,resize:"vertical",fontFamily:"inherit"}});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m});function D$(e,t,n,r,i,o,s,l){var y,x;const c=[],h=Math.max(1,Math.floor(Number(t.columns)||1)),u=typeof window>"u"?1/0:window.innerWidth,m=Math.min(e.containerWidth||1/0,u)<640?1:h;if(s.forEach((p,b)=>{var O,I;const P=`${n}-field-${b}`,S=p.name||((O=p.label)==null?void 0:O.toLowerCase())||"",A=p.className?((I=e.parseClassNameResponsive)==null?void 0:I.call(e,p.className,P))??e.parseClassName(p.className):{},E={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:p.borderless?p.backgroundColor||"transparent":e.cfg.colors.surface,color:p.textColor||e.cfg.colors.text,colorScheme:e.cfg.colorMode==="light"?"light":"dark",border:p.borderless?"none":`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,...A},w={width:"100%",marginBottom:"1rem"},T=N=>N.value?e.interpolateText(String(N.value)):"";if(p.type==="richtext")c.push(v.createElement(Hct,{key:P,api:e,field:p,fieldName:S,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(F=>({...F,[S]:N}))}));else if(p.type==="textarea"){const N=p.rows||4;c.push(v.createElement(nut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:F=>e.setSceneData(D=>({...D,[S]:F})),placeholder:p.placeholder||p.label,required:p.required,rows:N,label:p.label,fieldStyle:E}))}else if(p.type==="select")if(p.dataSource)c.push(v.createElement(Kct,{key:P,api:e,field:p,fieldName:S,fieldKey:P,fieldStyle:E,fieldWrapperStyle:w}));else{const N=Array.isArray(p.options)?p.options:[];c.push(v.createElement(eut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:F=>e.setSceneData(D=>({...D,[S]:F})),placeholder:p.placeholder||p.label||"Select...",required:p.required,options:N,label:p.label,fieldStyle:E}))}else if(p.type==="advanced-select")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(j$,{key:P,api:e,c:{...p,name:S,options:p.options},componentKey:P})));else if(p.type==="file")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(tut,{key:P,api:e,field:p,fieldName:S,label:p.label,fieldStyle:E})));else if(p.tags)c.push(v.createElement(rut,{key:P,api:e,field:p,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(F=>({...F,[S]:N}))}));else{const N=p.type==="email"?"email":p.type==="password"?"password":p.type==="number"?"number":p.type==="date"?"date":p.type==="datetime-local"?"datetime-local":"text";c.push(v.createElement(Qct,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:F=>e.setSceneData(D=>({...D,[S]:F})),placeholder:p.placeholder||p.label,required:p.required,inputType:N,label:p.label,fieldStyle:E,openPickerOnClick:p.openPickerOnClick,onKeyDown:p.onKeyDown?()=>e.handleButtonClick(p.onKeyDown):void 0}))}}),h>1){const p=c.splice(0);c.push(...p.map((b,P)=>{var A;const S=Math.min(m,Math.max(1,Number((A=s[P])==null?void 0:A.fieldSpan)||1));return V("div",{key:`${n}-field-grid-${P}`,style:{gridColumn:`span ${S} / span ${S}`,minWidth:0}},b)}))}if(l){const p={padding:"0.75rem 1.5rem",borderRadius:e.cfg.components.inputRadius,cursor:"pointer",fontWeight:600,width:"100%",marginTop:"1rem",...h>1?{gridColumn:"1 / -1",marginTop:0}:{}},b=l.className?((y=e.parseClassNameResponsive)==null?void 0:y.call(e,l.className,`${n}-submit`))??e.parseClassName(l.className):{},P=!!l.className&&/(^|\s)bg-[^\s]+/.test(l.className),S=!!l.className&&/(^|\s)text-[^\s]+/.test(l.className),A={...p,...b,...!P&&{backgroundColor:e.cfg.colors.primary},...!S&&{color:"#fff",border:"none"}},E=`${n}-submit`,w=!!((x=e.buttonLoading)!=null&&x[E]),T=()=>{var j,K,U,z,Y;const F=[],D=e.sceneData||{};for(const G of s){const X=G.name||((j=G.label)==null?void 0:j.toLowerCase()),lt=D[X],H=G.label||X;if(G.required&&(lt==null||String(lt).trim()==="")){F.push(`${H} is required`);continue}lt==null||String(lt).trim()===""||((K=G.validation)!=null&&K.pattern&&!new RegExp(G.validation.pattern).test(String(lt))&&F.push(`${H} is invalid`),((U=G.validation)==null?void 0:U.min)!==void 0&&Number(lt)<Number(G.validation.min)&&F.push(`${H} must be at least ${G.validation.min}`),((z=G.validation)==null?void 0:z.max)!==void 0&&Number(lt)>Number(G.validation.max)&&F.push(`${H} must be at most ${G.validation.max}`),((Y=G.validation)==null?void 0:Y.minLength)!==void 0&&String(lt).length<Number(G.validation.minLength)&&F.push(`${H} must be at least ${G.validation.minLength} characters`))}return F},O=()=>{var K,U;const F=T();if(F.length){(K=e.showToast)==null||K.call(e,F,"error");return}const D=()=>l.onClick?e.handleButtonClick(l.onClick,{onSuccess:l.onSuccess,onError:l.onError},{optimistic:l.optimistic,feedback:l.feedback,payload:l.payload}):Promise.resolve(),j=e.withLoading?e.withLoading(E,D):D();(U=j==null?void 0:j.catch)==null||U.call(j,()=>{})},I=l.onClick?()=>O():void 0,N=[];w?N.push(V("span",{key:"spinner",className:"bf-btn-spinner",style:{display:"inline-flex",width:"14px",height:"14px",marginRight:"6px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):l.icon&&N.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(l.icon,l.iconSize||16))),N.push(V("span",{key:"text"},l.text||"Submit")),c.push(V("button",{key:E,type:l.type||"submit",className:l.className,...e.getCommonProps(E,A,l),disabled:w||void 0,onClick:I},...N))}return V("form",{key:n,className:r,...o,style:{...o.style||{},...h>1?{display:"grid",gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,columnGap:"1rem",rowGap:"1.25rem"}:{}},onSubmit:p=>p.preventDefault()},...c)}const rut=v.memo(({api:e,field:t,value:n,onChange:r})=>{v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const i=v.useRef(null),o=(n||"").split(",").filter(Boolean).map(y=>y.trim()),[s,l]=v.useState(""),[c,h]=v.useState(!1),u=y=>{const x=y.target.value;if(x.includes(",")||x.includes(";")){const p=x.split(/[,;]+/).map(b=>b.trim()).filter(Boolean);if(p.length>0){const b=[...new Set([...o,...p])].join(", ");r(b)}l("")}else l(x)},f=y=>{if(y.key==="Enter"||y.key===","||y.key===";"){y.preventDefault();const x=s.trim();x&&(r([...new Set([...o,x])].join(", ")),l(""))}else y.key==="Backspace"&&!s&&o.length>0&&r(o.slice(0,-1).join(", "))},m=()=>{const y=s.trim();y&&(r([...new Set([...o,y])].join(", ")),l(""))};return V("div",{key:"tags",style:{width:"100%",marginBottom:"1rem"}},t.label?V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,V("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"0.5rem 0.75rem",borderRadius:e.cfg.components.inputRadius||"8px",backgroundColor:e.cfg.colors.surface,border:`1px solid ${c?e.cfg.colors.primary:e.cfg.colors.border}`,cursor:"text",outline:"none",transition:"border-color 0.2s"},onClick:()=>{var y;return(y=i.current)==null?void 0:y.focus()}},...o.map((y,x)=>V("span",{key:x,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",backgroundColor:e.cfg.colors.background,border:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.text,fontSize:"13px",lineHeight:"1.4"}},V("span",null,y),V("button",{type:"button",onMouseDown:p=>{p.preventDefault(),p.stopPropagation(),r(o.filter((b,P)=>P!==x).join(", "))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"0",fontSize:"14px",lineHeight:"1",display:"flex",alignItems:"center",fontFamily:"inherit"}},"×"))),V("input",{ref:i,type:"text",value:s,onChange:u,onKeyDown:f,onFocus:()=>h(!0),onBlur:()=>{h(!1),m()},placeholder:t.placeholder||(o.length>0?"":"Add email..."),style:{flex:1,minWidth:"100px",border:"none",outline:"none",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"14px",fontFamily:"inherit",padding:"2px 0"}})))});function iut(e,t,n){let r=e.interpolateText(t.text||t.content||"");if(!r)return null;!r.includes(`
116
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $$(e,t){if(e){if(typeof e=="string")return eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eb(e,t)}}function Hlt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qlt(e){if(Array.isArray(e))return eb(e)}function eb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ht(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eT(Object(n),!0).forEach(function(r){Ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ut(e,t,n){return t=I$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I$(e){var t=Glt(e,"string");return Yl(t)=="symbol"?t:t+""}function Glt(e,t){if(Yl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zlt={xAxis:["bottom","top"],yAxis:["left","right"]},Ylt={width:"100%",height:"100%"},R$={x:0,y:0};function If(e){return e}var Klt=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Xlt=function(t,n,r,i){var o=n.find(function(u){return u&&u.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,l=i.radius;return ht(ht(ht({},i),Fe(i.cx,i.cy,l,s)),{},{angle:s,radius:l})}var c=o.coordinate,h=i.angle;return ht(ht(ht({},i),Fe(i.cx,i.cy,c,h)),{},{angle:h,radius:c})}return R$},gm=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(l,c){var h=c.props.data;return h&&h.length?[].concat(Kl(l),Kl(h)):l},[]);return s.length>0?s:t&&t.length&&wt(i)&&wt(o)?t.slice(i,o+1):[]};function L$(e){return e==="number"?[0,"auto"]:void 0}var nb=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,l=gm(n,t);return r<0||!o||!o.length||r>=l.length?null:o.reduce(function(c,h){var u,f=(u=h.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var y=f===void 0?l:f;m=id(y,s.dataKey,i)}else m=f&&f[r]||l[r];return m?[].concat(Kl(c),[mk(h,m)]):c},[])},nT=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=Klt(o,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,h=t.tooltipTicks,u=qJ(s,l,h,c);if(u>=0&&h){var f=h[u]&&h[u].value,m=nb(t,n,u,f),y=Xlt(r,l,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:m,activeCoordinate:y}}return null},Jlt=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=t.stackOffset,y=ck(u,o);return r.reduce(function(x,p){var b,P=p.type.defaultProps!==void 0?ht(ht({},p.type.defaultProps),p.props):p.props,S=P.type,A=P.dataKey,E=P.allowDataOverflow,w=P.allowDuplicatedCategory,T=P.scale,O=P.ticks,I=P.includeHidden,N=P[s];if(x[N])return x;var F=gm(t.data,{graphicalItems:i.filter(function(it){var at,ct=s in it.props?it.props[s]:(at=it.type.defaultProps)===null||at===void 0?void 0:at[s];return ct===N}),dataStartIndex:c,dataEndIndex:h}),D=F.length,j,K,U;Plt(P.domain,E,S)&&(j=pv(P.domain,null,E),y&&(S==="number"||T!=="auto")&&(U=gu(F,A,"category")));var z=L$(S);if(!j||j.length===0){var Y,G=(Y=P.domain)!==null&&Y!==void 0?Y:z;if(A){if(j=gu(F,A,S),S==="category"&&y){var X=IW(j);w&&X?(K=j,j=Yd(0,D)):w||(j=yP(G,j,p).reduce(function(it,at){return it.indexOf(at)>=0?it:[].concat(Kl(it),[at])},[]))}else if(S==="category")w?j=j.filter(function(it){return it!==""&&!Zt(it)}):j=yP(G,j,p).reduce(function(it,at){return it.indexOf(at)>=0||at===""||Zt(at)?it:[].concat(Kl(it),[at])},[]);else if(S==="number"){var lt=XJ(F,i.filter(function(it){var at,ct,yt=s in it.props?it.props[s]:(at=it.type.defaultProps)===null||at===void 0?void 0:at[s],vt="hide"in it.props?it.props.hide:(ct=it.type.defaultProps)===null||ct===void 0?void 0:ct.hide;return yt===N&&(I||!vt)}),A,o,u);lt&&(j=lt)}y&&(S==="number"||T!=="auto")&&(U=gu(F,A,"category"))}else y?j=Yd(0,D):l&&l[N]&&l[N].hasStack&&S==="number"?j=m==="expand"?[0,1]:pk(l[N].stackGroups,c,h):j=lk(F,i.filter(function(it){var at=s in it.props?it.props[s]:it.type.defaultProps[s],ct="hide"in it.props?it.props.hide:it.type.defaultProps.hide;return at===N&&(I||!ct)}),S,u,!0);if(S==="number")j=Qv(f,j,N,o,O),G&&(j=pv(G,j,E));else if(S==="category"&&G){var H=G,et=j.every(function(it){return H.indexOf(it)>=0});et&&(j=H)}}return ht(ht({},x),{},Ut({},N,ht(ht({},P),{},{axisType:o,domain:j,categoricalDomain:U,duplicateDomain:K,originalDomain:(b=P.domain)!==null&&b!==void 0?b:z,isCategorical:y,layout:u})))},{})},Qlt=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=gm(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:h}),y=m.length,x=ck(u,o),p=-1;return r.reduce(function(b,P){var S=P.type.defaultProps!==void 0?ht(ht({},P.type.defaultProps),P.props):P.props,A=S[s],E=L$("number");if(!b[A]){p++;var w;return x?w=Yd(0,y):l&&l[A]&&l[A].hasStack?(w=pk(l[A].stackGroups,c,h),w=Qv(f,w,A,o)):(w=pv(E,lk(m,r.filter(function(T){var O,I,N=s in T.props?T.props[s]:(O=T.type.defaultProps)===null||O===void 0?void 0:O[s],F="hide"in T.props?T.props.hide:(I=T.type.defaultProps)===null||I===void 0?void 0:I.hide;return N===A&&!F}),"number",u),i.defaultProps.allowDataOverflow),w=Qv(f,w,A,o)),ht(ht({},b),{},Ut({},A,ht(ht({axisType:o},i.defaultProps),{},{hide:!0,orientation:Pr(Zlt,"".concat(o,".").concat(p%2),null),domain:w,originalDomain:E,isCategorical:x,layout:u})))}return b},{})},tct=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),m=sr(u,o),y={};return m&&m.length?y=Jlt(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h}):s&&s.length&&(y=Qlt(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h})),y},ect=function(t){var n=Wo(t),r=io(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:L0(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Rd(n,r)}},rT=function(t){var n=t.children,r=t.defaultShowTooltip,i=xr(n,jl),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},nct=function(t){return!t||!t.length?!1:t.some(function(n){var r=so(n&&n.type);return r&&r.indexOf("Bar")>=0})},iT=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},rct=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,l=t.yAxisMap,c=l===void 0?{}:l,h=r.width,u=r.height,f=r.children,m=r.margin||{},y=xr(f,jl),x=xr(f,ra),p=Object.keys(c).reduce(function(w,T){var O=c[T],I=O.orientation;return!O.mirror&&!O.hide?ht(ht({},w),{},Ut({},I,w[I]+O.width)):w},{left:m.left||0,right:m.right||0}),b=Object.keys(s).reduce(function(w,T){var O=s[T],I=O.orientation;return!O.mirror&&!O.hide?ht(ht({},w),{},Ut({},I,Pr(w,"".concat(I))+O.height)):w},{top:m.top||0,bottom:m.bottom||0}),P=ht(ht({},b),p),S=P.bottom;y&&(P.bottom+=y.props.height||jl.defaultProps.height),x&&n&&(P=YJ(P,i,r,n));var A=h-P.left-P.right,E=u-P.top-P.bottom;return ht(ht({brushBottom:S},P),{},{width:Math.max(A,0),height:Math.max(E,0)})},ict=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},ym=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,h=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,m=function(P,S){var A=S.graphicalItems,E=S.stackGroups,w=S.offset,T=S.updateId,O=S.dataStartIndex,I=S.dataEndIndex,N=P.barSize,F=P.layout,D=P.barGap,j=P.barCategoryGap,K=P.maxBarSize,U=iT(F),z=U.numericAxisName,Y=U.cateAxisName,G=nct(A),X=[];return A.forEach(function(lt,H){var et=gm(P.data,{graphicalItems:[lt],dataStartIndex:O,dataEndIndex:I}),it=lt.type.defaultProps!==void 0?ht(ht({},lt.type.defaultProps),lt.props):lt.props,at=it.dataKey,ct=it.maxBarSize,yt=it["".concat(z,"Id")],vt=it["".concat(Y,"Id")],Et={},Tt=c.reduce(function(ne,Yt){var oe,Me,se=S["".concat(Yt.axisType,"Map")],on=it["".concat(Yt.axisType,"Id")];se&&se[on]||Yt.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?ir(!1,"Specifying a(n) ".concat(Yt.axisType,"Id requires a corresponding ").concat(Yt.axisType,"Id on the targeted graphical component ").concat((oe=lt==null||(Me=lt.type)===null||Me===void 0?void 0:Me.displayName)!==null&&oe!==void 0?oe:"")):ir());var en=se[on];return ht(ht({},ne),{},Ut(Ut({},Yt.axisType,en),"".concat(Yt.axisType,"Ticks"),io(en)))},Et),ft=Tt[Y],dt=Tt["".concat(Y,"Ticks")],Ct=E&&E[yt]&&E[yt].hasStack&&sQ(lt,E[yt].stackGroups),nt=so(lt.type).indexOf("Bar")>=0,Lt=Rd(ft,dt),bt=[],me=G&&GJ({barSize:N,stackGroups:E,totalSize:ict(Tt,Y)});if(nt){var ie,Xt,Ne=Zt(ct)?K:ct,Wt=(ie=(Xt=Rd(ft,dt,!0))!==null&&Xt!==void 0?Xt:Ne)!==null&&ie!==void 0?ie:0;bt=ZJ({barGap:D,barCategoryGap:j,bandSize:Wt!==Lt?Wt:Lt,sizeList:me[vt],maxBarSize:Ne}),Wt!==Lt&&(bt=bt.map(function(ne){return ht(ht({},ne),{},{position:ht(ht({},ne.position),{},{offset:ne.position.offset-Wt/2})})}))}var ee=lt&&lt.type&&lt.type.getComposedData;ee&&X.push({props:ht(ht({},ee(ht(ht({},Tt),{},{displayedData:et,props:P,dataKey:at,item:lt,bandSize:Lt,barPosition:bt,offset:w,stackedData:Ct,layout:F,dataStartIndex:O,dataEndIndex:I}))),{},Ut(Ut(Ut({key:lt.key||"item-".concat(H)},z,Tt[z]),Y,Tt[Y]),"animationId",T)),childIndex:GW(lt,P.children),item:lt})}),X},y=function(P,S){var A=P.props,E=P.dataStartIndex,w=P.dataEndIndex,T=P.updateId;if(!h1({props:A}))return null;var O=A.children,I=A.layout,N=A.stackOffset,F=A.data,D=A.reverseStackOrder,j=iT(I),K=j.numericAxisName,U=j.cateAxisName,z=sr(O,r),Y=iQ(F,z,"".concat(K,"Id"),"".concat(U,"Id"),N,D),G=c.reduce(function(it,at){var ct="".concat(at.axisType,"Map");return ht(ht({},it),{},Ut({},ct,tct(A,ht(ht({},at),{},{graphicalItems:z,stackGroups:at.axisType===K&&Y,dataStartIndex:E,dataEndIndex:w}))))},{}),X=rct(ht(ht({},G),{},{props:A,graphicalItems:z}),S==null?void 0:S.legendBBox);Object.keys(G).forEach(function(it){G[it]=u(A,G[it],X,it.replace("Map",""),n)});var lt=G["".concat(U,"Map")],H=ect(lt),et=m(A,ht(ht({},G),{},{dataStartIndex:E,dataEndIndex:w,updateId:T,graphicalItems:z,stackGroups:Y,offset:X}));return ht(ht({formattedGraphicalItems:et,graphicalItems:z,offset:X,stackGroups:Y},H),G)},x=function(b){function P(S){var A,E,w;return jlt(this,P),w=zlt(this,P,[S]),Ut(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ut(w,"accessibilityManager",new Slt),Ut(w,"handleLegendBBoxUpdate",function(T){if(T){var O=w.state,I=O.dataStartIndex,N=O.dataEndIndex,F=O.updateId;w.setState(ht({legendBBox:T},y({props:w.props,dataStartIndex:I,dataEndIndex:N,updateId:F},ht(ht({},w.state),{},{legendBBox:T}))))}}),Ut(w,"handleReceiveSyncEvent",function(T,O,I){if(w.props.syncId===T){if(I===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),Ut(w,"handleBrushChange",function(T){var O=T.startIndex,I=T.endIndex;if(O!==w.state.dataStartIndex||I!==w.state.dataEndIndex){var N=w.state.updateId;w.setState(function(){return ht({dataStartIndex:O,dataEndIndex:I},y({props:w.props,dataStartIndex:O,dataEndIndex:I,updateId:N},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:I})}}),Ut(w,"handleMouseEnter",function(T){var O=w.getMouseInfo(T);if(O){var I=ht(ht({},O),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseEnter;qt(N)&&N(I,T)}}),Ut(w,"triggeredAfterMouseMove",function(T){var O=w.getMouseInfo(T),I=O?ht(ht({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseMove;qt(N)&&N(I,T)}),Ut(w,"handleItemMouseEnter",function(T){w.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Ut(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Ut(w,"handleMouseMove",function(T){T.persist(),w.throttleTriggeredAfterMouseMove(T)}),Ut(w,"handleMouseLeave",function(T){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var I=w.props.onMouseLeave;qt(I)&&I(O,T)}),Ut(w,"handleOuterEvent",function(T){var O=qW(T),I=Pr(w.props,"".concat(O));if(O&&qt(I)){var N,F;/.*touch.*/i.test(O)?F=w.getMouseInfo(T.changedTouches[0]):F=w.getMouseInfo(T),I((N=F)!==null&&N!==void 0?N:{},T)}}),Ut(w,"handleClick",function(T){var O=w.getMouseInfo(T);if(O){var I=ht(ht({},O),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onClick;qt(N)&&N(I,T)}}),Ut(w,"handleMouseDown",function(T){var O=w.props.onMouseDown;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"handleMouseUp",function(T){var O=w.props.onMouseUp;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Ut(w,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseDown(T.changedTouches[0])}),Ut(w,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseUp(T.changedTouches[0])}),Ut(w,"handleDoubleClick",function(T){var O=w.props.onDoubleClick;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"handleContextMenu",function(T){var O=w.props.onContextMenu;if(qt(O)){var I=w.getMouseInfo(T);O(I,T)}}),Ut(w,"triggerSyncEvent",function(T){w.props.syncId!==void 0&&Fg.emit(Wg,w.props.syncId,T,w.eventEmitterSymbol)}),Ut(w,"applySyncEvent",function(T){var O=w.props,I=O.layout,N=O.syncMethod,F=w.state.updateId,D=T.dataStartIndex,j=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)w.setState(ht({dataStartIndex:D,dataEndIndex:j},y({props:w.props,dataStartIndex:D,dataEndIndex:j,updateId:F},w.state)));else if(T.activeTooltipIndex!==void 0){var K=T.chartX,U=T.chartY,z=T.activeTooltipIndex,Y=w.state,G=Y.offset,X=Y.tooltipTicks;if(!G)return;if(typeof N=="function")z=N(X,T);else if(N==="value"){z=-1;for(var lt=0;lt<X.length;lt++)if(X[lt].value===T.activeLabel){z=lt;break}}var H=ht(ht({},G),{},{x:G.left,y:G.top}),et=Math.min(K,H.x+H.width),it=Math.min(U,H.y+H.height),at=X[z]&&X[z].value,ct=nb(w.state,w.props.data,z),yt=X[z]?{x:I==="horizontal"?X[z].coordinate:et,y:I==="horizontal"?it:X[z].coordinate}:R$;w.setState(ht(ht({},T),{},{activeLabel:at,activeCoordinate:yt,activePayload:ct,activeTooltipIndex:z}))}else w.setState(T)}),Ut(w,"renderCursor",function(T){var O,I=w.state,N=I.isTooltipActive,F=I.activeCoordinate,D=I.activePayload,j=I.offset,K=I.activeTooltipIndex,U=I.tooltipAxisBandSize,z=w.getTooltipEventType(),Y=(O=T.props.active)!==null&&O!==void 0?O:N,G=w.props.layout,X=T.key||"_recharts-cursor";return v.createElement(Mlt,{key:X,activeCoordinate:F,activePayload:D,activeTooltipIndex:K,chartName:n,element:T,isActive:Y,layout:G,offset:j,tooltipAxisBandSize:U,tooltipEventType:z})}),Ut(w,"renderPolarAxis",function(T,O,I){var N=Pr(T,"type.axisType"),F=Pr(w.state,"".concat(N,"Map")),D=T.type.defaultProps,j=D!==void 0?ht(ht({},D),T.props):T.props,K=F&&F[j["".concat(N,"Id")]];return v.cloneElement(T,ht(ht({},K),{},{className:te(N,K.className),key:T.key||"".concat(O,"-").concat(I),ticks:io(K,!0)}))}),Ut(w,"renderPolarGrid",function(T){var O=T.props,I=O.radialLines,N=O.polarAngles,F=O.polarRadius,D=w.state,j=D.radiusAxisMap,K=D.angleAxisMap,U=Wo(j),z=Wo(K),Y=z.cx,G=z.cy,X=z.innerRadius,lt=z.outerRadius;return v.cloneElement(T,{polarAngles:Array.isArray(N)?N:io(z,!0).map(function(H){return H.coordinate}),polarRadius:Array.isArray(F)?F:io(U,!0).map(function(H){return H.coordinate}),cx:Y,cy:G,innerRadius:X,outerRadius:lt,key:T.key||"polar-grid",radialLines:I})}),Ut(w,"renderLegend",function(){var T=w.state.formattedGraphicalItems,O=w.props,I=O.children,N=O.width,F=O.height,D=w.props.margin||{},j=N-(D.left||0)-(D.right||0),K=sk({children:I,formattedGraphicalItems:T,legendWidth:j,legendContent:h});if(!K)return null;var U=K.item,z=tT(K,klt);return v.cloneElement(U,ht(ht({},z),{},{chartWidth:N,chartHeight:F,margin:D,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Ut(w,"renderTooltip",function(){var T,O=w.props,I=O.children,N=O.accessibilityLayer,F=xr(I,wr);if(!F)return null;var D=w.state,j=D.isTooltipActive,K=D.activeCoordinate,U=D.activePayload,z=D.activeLabel,Y=D.offset,G=(T=F.props.active)!==null&&T!==void 0?T:j;return v.cloneElement(F,{viewBox:ht(ht({},Y),{},{x:Y.left,y:Y.top}),active:G,label:z,payload:G?U:[],coordinate:K,accessibilityLayer:N})}),Ut(w,"renderBrush",function(T){var O=w.props,I=O.margin,N=O.data,F=w.state,D=F.offset,j=F.dataStartIndex,K=F.dataEndIndex,U=F.updateId;return v.cloneElement(T,{key:T.key||"_recharts-brush",onChange:Ef(w.handleBrushChange,T.props.onChange),data:N,x:wt(T.props.x)?T.props.x:D.left,y:wt(T.props.y)?T.props.y:D.top+D.height+D.brushBottom-(I.bottom||0),width:wt(T.props.width)?T.props.width:D.width,startIndex:j,endIndex:K,updateId:"brush-".concat(U)})}),Ut(w,"renderReferenceElement",function(T,O,I){if(!T)return null;var N=w,F=N.clipPathId,D=w.state,j=D.xAxisMap,K=D.yAxisMap,U=D.offset,z=T.type.defaultProps||{},Y=T.props,G=Y.xAxisId,X=G===void 0?z.xAxisId:G,lt=Y.yAxisId,H=lt===void 0?z.yAxisId:lt;return v.cloneElement(T,{key:T.key||"".concat(O,"-").concat(I),xAxis:j[X],yAxis:K[H],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:F})}),Ut(w,"renderActivePoints",function(T){var O=T.item,I=T.activePoint,N=T.basePoint,F=T.childIndex,D=T.isRange,j=[],K=O.props.key,U=O.item.type.defaultProps!==void 0?ht(ht({},O.item.type.defaultProps),O.item.props):O.item.props,z=U.activeDot,Y=U.dataKey,G=ht(ht({index:F,dataKey:Y,cx:I.x,cy:I.y,r:4,fill:ax(O.item),strokeWidth:2,stroke:"#fff",payload:I.payload,value:I.value},Dt(z,!1)),od(z));return j.push(P.renderActiveDot(z,G,"".concat(K,"-activePoint-").concat(F))),N?j.push(P.renderActiveDot(z,ht(ht({},G),{},{cx:N.x,cy:N.y}),"".concat(K,"-basePoint-").concat(F))):D&&j.push(null),j}),Ut(w,"renderGraphicChild",function(T,O,I){var N=w.filterFormatItem(T,O,I);if(!N)return null;var F=w.getTooltipEventType(),D=w.state,j=D.isTooltipActive,K=D.tooltipAxis,U=D.activeTooltipIndex,z=D.activeLabel,Y=w.props.children,G=xr(Y,wr),X=N.props,lt=X.points,H=X.isRange,et=X.baseLine,it=N.item.type.defaultProps!==void 0?ht(ht({},N.item.type.defaultProps),N.item.props):N.item.props,at=it.activeDot,ct=it.hide,yt=it.activeBar,vt=it.activeShape,Et=!!(!ct&&j&&G&&(at||yt||vt)),Tt={};F!=="axis"&&G&&G.props.trigger==="click"?Tt={onClick:Ef(w.handleItemMouseEnter,T.props.onClick)}:F!=="axis"&&(Tt={onMouseLeave:Ef(w.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:Ef(w.handleItemMouseEnter,T.props.onMouseEnter)});var ft=v.cloneElement(T,ht(ht({},N.props),Tt));function dt(Yt){return typeof K.dataKey=="function"?K.dataKey(Yt.payload):null}if(Et)if(U>=0){var Ct,nt;if(K.dataKey&&!K.allowDuplicatedCategory){var Lt=typeof K.dataKey=="function"?dt:"payload.".concat(K.dataKey.toString());Ct=id(lt,Lt,z),nt=H&&et&&id(et,Lt,z)}else Ct=lt==null?void 0:lt[U],nt=H&&et&&et[U];if(vt||yt){var bt=T.props.activeIndex!==void 0?T.props.activeIndex:U;return[v.cloneElement(T,ht(ht(ht({},N.props),Tt),{},{activeIndex:bt})),null,null]}if(!Zt(Ct))return[ft].concat(Kl(w.renderActivePoints({item:N,activePoint:Ct,basePoint:nt,childIndex:U,isRange:H})))}else{var me,ie=(me=w.getItemByXY(w.state.activeCoordinate))!==null&&me!==void 0?me:{graphicalItem:ft},Xt=ie.graphicalItem,Ne=Xt.item,Wt=Ne===void 0?T:Ne,ee=Xt.childIndex,ne=ht(ht(ht({},N.props),Tt),{},{activeIndex:ee});return[v.cloneElement(Wt,ne),null,null]}return H?[ft,null,null]:[ft,null]}),Ut(w,"renderCustomized",function(T,O,I){return v.cloneElement(T,ht(ht({key:"recharts-customized-".concat(I)},w.props),w.state))}),Ut(w,"renderMap",{CartesianGrid:{handler:If,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:If},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:If},YAxis:{handler:If},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((A=S.id)!==null&&A!==void 0?A:wa("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=sM(w.triggeredAfterMouseMove,(E=S.throttleDelay)!==null&&E!==void 0?E:1e3/60),w.state={},w}return Vlt(P,b),Blt(P,[{key:"componentDidMount",value:function(){var A,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var A=this.props,E=A.children,w=A.data,T=A.height,O=A.layout,I=xr(E,wr);if(I){var N=I.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var F=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,D=nb(this.state,w,N,F),j=this.state.tooltipTicks[N].coordinate,K=(this.state.offset.top+T)/2,U=O==="horizontal",z=U?{x:j,y:K}:{y:j,x:K},Y=this.state.formattedGraphicalItems.find(function(X){var lt=X.item;return lt.type.name==="Scatter"});Y&&(z=ht(ht({},z),Y.props.points[N].tooltipPosition),D=Y.props.points[N].tooltipPayload);var G={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:F,activePayload:D,activeCoordinate:z};this.setState(G),this.renderCursor(I),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(A,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==A.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==A.margin){var w,T;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(A){Oy([xr(A.children,wr)],[xr(this.props.children,wr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var A=xr(this.props.children,wr);if(A&&typeof A.props.shared=="boolean"){var E=A.props.shared?"axis":"item";return l.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(A){if(!this.container)return null;var E=this.container,w=E.getBoundingClientRect(),T=xZ(w),O={chartX:Math.round(A.pageX-T.left),chartY:Math.round(A.pageY-T.top)},I=w.width/E.offsetWidth||1,N=this.inRange(O.chartX,O.chartY,I);if(!N)return null;var F=this.state,D=F.xAxisMap,j=F.yAxisMap,K=this.getTooltipEventType(),U=nT(this.state,this.props.data,this.props.layout,N);if(K!=="axis"&&D&&j){var z=Wo(D).scale,Y=Wo(j).scale,G=z&&z.invert?z.invert(O.chartX):null,X=Y&&Y.invert?Y.invert(O.chartY):null;return ht(ht({},O),{},{xValue:G,yValue:X},U)}return U?ht(ht({},O),U):null}},{key:"inRange",value:function(A,E){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,O=A/w,I=E/w;if(T==="horizontal"||T==="vertical"){var N=this.state.offset,F=O>=N.left&&O<=N.left+N.width&&I>=N.top&&I<=N.top+N.height;return F?{x:O,y:I}:null}var D=this.state,j=D.angleAxisMap,K=D.radiusAxisMap;if(j&&K){var U=Wo(j);return xP({x:O,y:I},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var A=this.props.children,E=this.getTooltipEventType(),w=xr(A,wr),T={};w&&E==="axis"&&(w.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=od(this.props,this.handleOuterEvent);return ht(ht({},O),T)}},{key:"addListener",value:function(){Fg.on(Wg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Fg.removeListener(Wg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(A,E,w){for(var T=this.state.formattedGraphicalItems,O=0,I=T.length;O<I;O++){var N=T[O];if(N.item===A||N.props.key===A.key||E===so(N.item.type)&&w===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var A=this.clipPathId,E=this.state.offset,w=E.left,T=E.top,O=E.height,I=E.width;return v.createElement("defs",null,v.createElement("clipPath",{id:A},v.createElement("rect",{x:w,y:T,height:O,width:I})))}},{key:"getXScales",value:function(){var A=this.state.xAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=QA(w,2),O=T[0],I=T[1];return ht(ht({},E),{},Ut({},O,I.scale))},{}):null}},{key:"getYScales",value:function(){var A=this.state.yAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=QA(w,2),O=T[0],I=T[1];return ht(ht({},E),{},Ut({},O,I.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(A){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(A){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(A){var E=this.state,w=E.formattedGraphicalItems,T=E.activeItem;if(w&&w.length)for(var O=0,I=w.length;O<I;O++){var N=w[O],F=N.props,D=N.item,j=D.type.defaultProps!==void 0?ht(ht({},D.type.defaultProps),D.props):D.props,K=so(D.type);if(K==="Bar"){var U=(F.data||[]).find(function(X){return dnt(A,X)});if(U)return{graphicalItem:N,payload:U}}else if(K==="RadialBar"){var z=(F.data||[]).find(function(X){return xP(A,X)});if(z)return{graphicalItem:N,payload:z}}else if(lm(N,T)||cm(N,T)||lh(N,T)){var Y=eit({graphicalItem:N,activeTooltipItem:T,itemData:j.data}),G=j.activeIndex===void 0?Y:j.activeIndex;return{graphicalItem:ht(ht({},N),{},{childIndex:G}),payload:lh(N,T)?j.data[Y]:N.props.data[Y]}}}return null}},{key:"render",value:function(){var A=this;if(!h1(this))return null;var E=this.props,w=E.children,T=E.className,O=E.width,I=E.height,N=E.style,F=E.compact,D=E.title,j=E.desc,K=tT(E,$lt),U=Dt(K,!1);if(F)return v.createElement(RA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement(ky,ll({},U,{width:O,height:I,title:D,desc:j}),this.renderClipPath(),d1(w,this.renderMap)));if(this.props.accessibilityLayer){var z,Y;U.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,U.role=(Y=this.props.role)!==null&&Y!==void 0?Y:"application",U.onKeyDown=function(X){A.accessibilityManager.keyboardEvent(X)},U.onFocus=function(){A.accessibilityManager.focus()}}var G=this.parseEventsOfWrapper();return v.createElement(RA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement("div",ll({className:te("recharts-wrapper",T),style:ht({position:"relative",cursor:"default",width:O,height:I},N)},G,{ref:function(lt){A.container=lt}}),v.createElement(ky,ll({},U,{width:O,height:I,title:D,desc:j,style:Ylt}),this.renderClipPath(),d1(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(v.Component);Ut(x,"displayName",n),Ut(x,"defaultProps",ht({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ut(x,"getDerivedStateFromProps",function(b,P){var S=b.dataKey,A=b.data,E=b.children,w=b.width,T=b.height,O=b.layout,I=b.stackOffset,N=b.margin,F=P.dataStartIndex,D=P.dataEndIndex;if(P.updateId===void 0){var j=rT(b);return ht(ht(ht({},j),{},{updateId:0},y(ht(ht({props:b},j),{},{updateId:0}),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:I,prevMargin:N,prevChildren:E})}if(S!==P.prevDataKey||A!==P.prevData||w!==P.prevWidth||T!==P.prevHeight||O!==P.prevLayout||I!==P.prevStackOffset||!fl(N,P.prevMargin)){var K=rT(b),U={chartX:P.chartX,chartY:P.chartY,isTooltipActive:P.isTooltipActive},z=ht(ht({},nT(P,A,O)),{},{updateId:P.updateId+1}),Y=ht(ht(ht({},K),U),z);return ht(ht(ht({},Y),y(ht({props:b},Y),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:I,prevMargin:N,prevChildren:E})}if(!Oy(E,P.prevChildren)){var G,X,lt,H,et=xr(E,jl),it=et&&(G=(X=et.props)===null||X===void 0?void 0:X.startIndex)!==null&&G!==void 0?G:F,at=et&&(lt=(H=et.props)===null||H===void 0?void 0:H.endIndex)!==null&&lt!==void 0?lt:D,ct=it!==F||at!==D,yt=!Zt(A),vt=yt&&!ct?P.updateId:P.updateId+1;return ht(ht({updateId:vt},y(ht(ht({props:b},P),{},{updateId:vt,dataStartIndex:it,dataEndIndex:at}),P)),{},{prevChildren:E,dataStartIndex:it,dataEndIndex:at})}return null}),Ut(x,"renderActiveDot",function(b,P,S){var A;return v.isValidElement(b)?A=v.cloneElement(b,P):qt(b)?A=b(P):A=v.createElement(rm,P),v.createElement(fe,{className:"recharts-active-dot",key:S},A)});var p=v.forwardRef(function(P,S){return v.createElement(x,ll({},P,{ref:S}))});return p.displayName=x.displayName,p},oct=ym({chartName:"BarChart",GraphicalChild:Aa,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:hs},{axisType:"yAxis",AxisComp:fs}],formatAxisMap:ux}),sct=ym({chartName:"PieChart",GraphicalChild:bo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:am},{axisType:"radiusAxis",AxisComp:om}],formatAxisMap:gQ,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),act=ym({chartName:"ScatterChart",GraphicalChild:Mh,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:hs},{axisType:"yAxis",AxisComp:fs},{axisType:"zAxis",AxisComp:Oh}],formatAxisMap:ux}),lct=ym({chartName:"AreaChart",GraphicalChild:us,axisComponents:[{axisType:"xAxis",AxisComp:hs},{axisType:"yAxis",AxisComp:fs}],formatAxisMap:ux});const cct=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},fp=(...e)=>{cct()&&console.warn(...e)};function uct(e,t,n){var s,l;const r=t.expression?((s=e.evaluateExpression)==null?void 0:s.call(e,t.expression,t.expressionUrl,n,t.expressionKey))??e.interpolateText(t.expression):e.interpolateText(t.text||"");if(t.className){const c=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const u=s0(t.className);if(u.size>0){const m=Vt(u,e.containerWidth,"1rem");c.fontSize=m}const f=ic(t.className);f.size>0&&(c.display=Vt(f,e.containerWidth,"block"))}const h=e.getCommonProps(n,c,t);return V("p",{key:n,className:t.className,...h},r)}const i={};t.fontSize!==void 0&&(i.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(i.fontWeight=t.fontWeight),t.color!==void 0&&(i.color=t.color),t.textAlign!==void 0&&(i.textAlign=t.textAlign);const o=e.getCommonProps(n,i,t);return V("p",{key:n,...o},r)}function hct(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<iframe[\s\S]*?<\/iframe>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"")}function fct(e,t,n){const r=String(e.apiUrl||"").replace(/\/$/,""),i=e.interpolateText(t.text||t.html||"").replace(/(src|href)=("|')\/(?!\/)/g,r?`$1=$2${r}/`:"$1=$2/"),o=e.getCommonProps(n,{color:e.cfg.colors.text},t);return V("div",{key:n,className:t.className,...o,dangerouslySetInnerHTML:{__html:hct(i)}})}function dct(e,t,n){var l,c,h,u,f;const r=()=>{t.onClick?e.handleButtonClick(t.onClick,{onSuccess:t.onSuccess,onError:t.onError},{optimistic:t.optimistic,feedback:t.feedback}):t.href&&(t.href.startsWith("http")||e.previewMode?window.open(t.href,"_blank","noopener,noreferrer"):window.location.href=t.href)},i=()=>{var m;if(!e.interactionDisabled){if((m=t.confirmation)!=null&&m.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:14}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{r()}});return}r()}};if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const x=ic(t.className);x.size>0&&(m.display=Vt(x,e.containerWidth,"inline"));const p=s0(t.className);if(p.size>0){const b=Vt(p,e.containerWidth,"1rem");m.fontSize=b}}t.icon&&(m.display="inline-flex",m.alignItems="center",m.gap=6);const y=e.getCommonProps(n,m,t);return V("a",{key:n,className:t.className,...y,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(c=t.href)!=null&&c.startsWith("http")?"_blank":void 0,rel:(h=t.href)!=null&&h.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}const o={cursor:"pointer",textDecoration:"none",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:6},s=e.getCommonProps(n,o,t);return V("a",{key:n,...s,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(u=t.href)!=null&&u.startsWith("http")?"_blank":void 0,rel:(f=t.href)!=null&&f.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}function pct(e,t,n){var x,p,b,P,S;let r=!1;if(t.activeWhen){if(t.activeWhen===e.currentSceneId)r=!0;else if(typeof t.activeWhen=="string"){const A=t.activeWhen.split("=",2);A.length===2&&(r=String(((x=e.sceneData)==null?void 0:x[A[0]])??"")===A[1])}}const i=r?{onClick:t.activeOnClick||t.onClick,onSuccess:t.activeOnSuccess||t.onSuccess,onError:t.activeOnError||t.onError,icon:t.activeIcon||t.icon,text:t.activeText||t.text,label:t.activeText||t.label}:{onClick:t.onClick,onSuccess:t.onSuccess,onError:t.onError,icon:t.icon,text:t.text,label:t.label},o=t.disabled?((p=e.evaluateCondition)==null?void 0:p.call(e,t.disabled))??!1:!1,s=A=>{const E=()=>e.handleButtonClick(i.onClick||"",{onSuccess:i.onSuccess,onError:i.onError},{optimistic:t.optimistic,feedback:t.feedback,payload:t.payload,refetchScope:t.refetchScope,mergeResponse:t.mergeResponse,anchorElement:A==null?void 0:A.currentTarget,openUrl:t.openUrl});(e.withLoading?e.withLoading(n,E):E()).catch(T=>{var I,N;const O=((I=t.onError)==null?void 0:I.message)||(T==null?void 0:T.message)||"An error occurred";(N=e.showToast)==null||N.call(e,O,"error")})},l=A=>{var E;if((E=t.confirmation)!=null&&E.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:16}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{s(A)}});return}s(A)},c=(b=e.buttonLoading)==null?void 0:b[n];if(t.className){let A=((P=e.parseClassNameResponsive)==null?void 0:P.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const D=ic(t.className);D.size>0&&(A.display=Vt(D,e.containerWidth,"inline-flex"));const j=s0(t.className);j.size>0&&(A.fontSize=Vt(j,e.containerWidth,"1rem"))}let E=t.className;if(r&&t.activeClass){const D=((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.activeClass,n))??e.parseClassName(t.activeClass);A={...A,...D},E=`${t.className} ${t.activeClass}`}const w={display:"inline-flex",alignItems:"center",justifyContent:A.textAlign==="left"?"flex-start":A.textAlign==="right"?"flex-end":"center",gap:"6px",...A,...t.color&&{color:t.color},...t.background&&{background:t.background},...t.borderRadius!==void 0&&{borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius},...t.borderColor&&{borderColor:t.borderColor},...c&&{opacity:.6,pointerEvents:"none"}},T={},O=(t.className||"").split(/\s+/).filter(Boolean);for(const D of O)if(D.startsWith("hover:")){const j=D.replace("hover:","");if(j.startsWith("bg-")||j.startsWith("text-")||j.startsWith("border-")){const K=e.parseClassName(j);Object.assign(T,K)}}const I=e.getCommonProps(n,w,t),N=[];i.icon&&!c&&N.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.text?{marginRight:"6px"}:{}}},e.renderIcon(i.icon,t.iconSize||16))),c&&N.unshift(V("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),Array.isArray(t.children)&&t.children.length>0?t.children.forEach((D,j)=>{N.push(e.renderComponent(D,j,n))}):N.push(i.label||i.text||(i.icon?"":"Button"));const F={};return Object.keys(T).length>0&&(F.onMouseEnter=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=T.backgroundColor),T.color&&(D.currentTarget.style.color=T.color),T.borderColor&&(D.currentTarget.style.borderColor=T.borderColor)},F.onMouseLeave=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=w.backgroundColor||""),T.color&&(D.currentTarget.style.color=w.color||""),T.borderColor&&(D.currentTarget.style.borderColor=w.borderColor||"")}),V("button",{key:n,className:E,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...I,...F,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...N)}const h=e.cfg.colors.primary,u=e.cfg.colors.accent,f={display:"inline-flex",alignItems:"center",gap:"6px",padding:"0.75rem 1.5rem",borderRadius:"0.75rem",fontWeight:600,transition:e.cfg.effects.transition,color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.text,background:r?e.cfg.colors.primary:`linear-gradient(to right, ${h}, ${u})`,boxShadow:r?"none":`0 10px 15px -3px ${h}40`,...c&&{opacity:.6,pointerEvents:"none"}},m=e.getCommonProps(n,f,t),y=[];return c&&y.push(V("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),i.icon&&!c&&y.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(i.icon,t.iconSize||16))),y.push(i.label||i.text||(i.icon?"":"Button")),V("button",{key:n,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...m,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...y)}function mct(e,t,n){var h;const r=e.interpolateText(t.src||""),i=!r||r==="placeholder",o=e.imageErrors[n];if(t.skipEmpty&&i)return null;const s={border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",padding:10,height:"200px",borderRadius:"0.75rem"};if(i){const u=e.getCommonProps(n,s,t);return V("div",{key:n,...u},V("span",{style:{color:e.cfg.colors.textPlaceholder,fontSize:"0.875rem"}},"Image"))}if(o)return null;if(t.className){const u=((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className),f=e.getCommonProps(n,u,t),m={key:`${n}-${r}`,src:r,alt:t.alt||"",className:t.className,...f,onError:()=>e.setImageErrors(y=>({...y,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(m.onClick=()=>e.handleButtonClick(t.onClick)),V("img",m)}const l={width:t.w||t.width||"100%",height:t.h||t.height||"auto",objectFit:"cover",borderRadius:"0.75rem"};t.onClick&&(l.cursor="pointer");const c={key:`${n}-${r}`,src:r,alt:t.alt||"",...e.getCommonProps(n,l,t),onError:()=>e.setImageErrors(u=>({...u,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(c.onClick=()=>e.handleButtonClick(t.onClick)),V("img",c)}function gct(e,t,n){var o;if(t.className){const s=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return V("input",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",style:{colorScheme:e.cfg.colorMode==="light"?"light":"dark"},onClick:t.openPickerOnClick?c=>{var h,u;return(u=(h=c.currentTarget).showPicker)==null?void 0:u.call(h)}:void 0,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value})),onKeyDown:t.onKeyDown?c=>{c.key==="Enter"&&e.handleButtonClick(t.onKeyDown)}:void 0})}const r={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition},i=e.getCommonProps(n,r,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return V("div",{key:n,...s},V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("input",{...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))}))}return V("input",{key:n,...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:s=>e.setSceneData(l=>({...l,[t.name||""]:s.target.value}))})}function yct(e,t,n){const r=t.value?e.interpolateText(String(t.value)):e.sceneData[t.name||""]??"";return V("input",{key:n,type:"hidden",name:t.name,value:r})}function vct(e,t,n){var s;const r=()=>{var l;return[t.placeholder&&V("option",{key:"__placeholder",value:""},t.placeholder),...((l=t.options)==null?void 0:l.map(c=>V("option",{key:c.value,value:c.value},c.label)))||[]]};if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=e.getCommonProps(n,l,t);return V("select",{key:n,className:t.className,...c,name:t.name,value:e.sceneData[t.name||""]??"",onChange:h=>e.setSceneData(u=>({...u,[t.name||""]:h.target.value}))},...r())}const i={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,cursor:"pointer",appearance:"none"},o=e.getCommonProps(n,i,t);if(t.label){const l=e.getCommonProps(n,{width:"100%"},t);return V("div",{key:n,...l},V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("select",{...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value}))},...r()))}return V("select",{key:n,...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))},...r())}function bct(e,t,n){const r=t.className||"flex items-center gap-3 cursor-pointer text-white",i=e.parseClassName(r),o="w-5 h-5 rounded border-gray-600 bg-gray-800 accent-primary",s=e.parseClassName(o),l=e.getCommonProps(n,i,t);return V("label",{key:n,className:r,...l},V("input",{type:"checkbox",className:o,style:s,checked:e.sceneData[t.name||""]||!1,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.checked}))}),V("span",{},t.label||""))}function xct(e,t,n){const r={green:{bg:"#065f4620",color:"#22c55e",border:"#22c55e40"},blue:{bg:"#1e40af20",color:"#3b82f6",border:"#3b82f640"},red:{bg:"#7f1d1d20",color:"#ef4444",border:"#ef444440"},yellow:{bg:"#71370220",color:"#eab308",border:"#eab30840"},purple:{bg:"#581c8720",color:"#a855f7",border:"#a855f740"},orange:{bg:"#7c2d1220",color:"#f97316",border:"#f9731640"},gray:{bg:"#37415120",color:"#9ca3af",border:"#9ca3af40"},cyan:{bg:"#0e727020",color:"#06b6d4",border:"#06b6d440"},pink:{bg:"#83184420",color:"#ec4899",border:"#ec489940"}};let o=t.colorScheme||"gray";if(t.colorBy&&typeof t.colorBy=="object"){const u=(e.interpolateText(t.text||t.label||"")||"").trim().toLowerCase();t.colorBy[u]&&(o=t.colorBy[u])}const s=r[o]||r.gray,l=t.variant||"subtle";let c={display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,letterSpacing:"0.025em",textTransform:"uppercase",whiteSpace:"nowrap"};l==="solid"?(c.backgroundColor=s.color,c.color="#fff"):l==="outline"?(c.backgroundColor="transparent",c.color=s.color,c.border=`1px solid ${s.border||s.color}`):(c.backgroundColor=s.bg,c.color=s.color,t.bordered&&(c.border=`1px solid ${s.border||s.color}`)),t.pill&&(c.borderRadius="9999px"),t.className&&(c={...c,...e.parseClassName(t.className)});const h=e.getCommonProps(n,c,t);return V("span",{key:n,...h},e.interpolateText(t.text||t.label||""))}function wct(e,t,n){const r={display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500,backgroundColor:t.bg||e.cfg.colors.surfaceHover,color:t.color||e.cfg.colors.textSecondary,...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return V("span",{key:n,...i},e.interpolateText(t.text||t.label||""))}function _ct(e,t,n){const i={sm:32,md:40,lg:48,xl:64}[t.size||"md"]||40,o=i*.4;if(t.src){const h={width:`${i}px`,height:`${i}px`,borderRadius:"50%",objectFit:"cover",...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return V("img",{key:n,src:t.src,alt:t.alt||t.label||"",...u})}const s=t.initials||(t.label||t.text||"").split(" ").map(h=>h[0]).join("").slice(0,2).toUpperCase()||"?",l={width:`${i}px`,height:`${i}px`,borderRadius:"50%",backgroundColor:t.bg||e.cfg.colors.primary,color:t.color||e.cfg.colors.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${o}px`,fontWeight:600,flexShrink:0,...t.className?e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return V("div",{key:n,...c},s)}function Sct(e,t,n){const r=t.progressValue??t.value??0,i=t.progressMax??100,o=(y,x)=>{if(typeof y=="string")return Number(e.interpolateText(y))||x;const p=Number(y);return Number.isFinite(p)?p:x},s=o(r,0),l=o(i,100),c=Math.min(100,Math.max(0,s/l*100)),u=s>l?e.cfg.colors.danger:t.color||e.cfg.colors.primary,f={width:"100%",display:"flex",flexDirection:"column",gap:"4px",...t.className?e.parseClassName(t.className):{}},m=e.getCommonProps(n,f,t);return V("div",{key:n,...m},(t.progressLabel||t.label)&&v.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:e.cfg.colors.textMuted}},V("span",null,e.interpolateText(t.progressLabel||t.label||"")),V("span",null,`${s}/${l}`)),v.createElement("div",{style:{width:"100%",height:"8px",backgroundColor:e.cfg.colors.surfaceHover,borderRadius:"4px",overflow:"hidden"}},V("div",{style:{width:`${Math.min(c,100)}%`,height:"100%",backgroundColor:u,borderRadius:"4px",transition:"width 0.3s ease"}})))}function Pct(e,t,n){const r={position:"relative",width:"100%",...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return V("div",{key:n,...i},V("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:e.cfg.colors.textPlaceholder,fontSize:"14px",pointerEvents:"none"}},e.renderIcon("search",14)),V("input",{type:"text",name:t.name||"search",placeholder:t.placeholder||"Search...",value:e.sceneData[t.name||"search"]??"",onChange:o=>{e.setSceneData(s=>({...s,[t.name||"search"]:o.target.value}))},style:{width:"100%",padding:"8px 12px 8px 36px",borderRadius:e.cfg.layout.borderRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",fontSize:e.cfg.typography.baseFontSize,transition:e.cfg.effects.transition}}))}function Act(e,t,n){const r=Array.isArray(t.breadcrumbItems)?t.breadcrumbItems:[],i={display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",...t.className?e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return V("nav",{key:n,...o,"aria-label":"Breadcrumb"},r.map((s,l)=>{const c=l===r.length-1,h=e.interpolateText(s.label);return v.createElement(v.Fragment,{key:`${n}-bc-${l}`},v.createElement(c?"span":"a",{style:{color:c?e.cfg.colors.textSecondary:e.cfg.colors.textMuted,fontWeight:c?600:400,cursor:c?"default":"pointer",textDecoration:"none",transition:e.cfg.effects.transition},...!c&&s.href?{href:s.href}:{},...!c&&s.onClick?{onClick:()=>e.handleButtonClick(s.onClick,{})}:{}},h),!c&&V("span",{style:{color:e.cfg.colors.border,margin:"0 2px"}},"/"))}))}function Tct(e,t,n){const r=Array.isArray(t.items)?t.items:[],[i,o]=v.useState(0),s=t.autoplay!==!1&&r.length>1,l=t.interval||4e3,c=t.effect==="fade"?"fade":"slide";v.useEffect(()=>{if(!s||r.length<2)return;const S=setInterval(()=>o(A=>(A+1)%r.length),l);return()=>clearInterval(S)},[s,l,r.length]);const h=S=>o((S%r.length+r.length)%r.length),u=t.showArrows!==!1&&r.length>1,f=t.showDots!==!1&&r.length>1,m={position:"relative",overflow:"hidden",...t.className?e.parseClassName(t.className):{}};t.aspectRatio&&(m.aspectRatio=t.aspectRatio),!t.aspectRatio&&!t.height&&(m.height="320px");const y=e.getCommonProps(n,m,t),x=S=>typeof S=="string"?{type:"text",text:S}:S&&S.image?{type:"image",src:S.image,alt:S.alt||"",title:S.title}:S,p=r.map((S,A)=>{const E=e.renderComponent({...x(S),key:void 0},A,`${n}-slide`),w={width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"};return c==="fade"?(w.position="absolute",w.inset="0",w.opacity=A===i?1:0,w.transition="opacity .5s ease",w.pointerEvents=A===i?"auto":"none"):w.flexShrink=0,V("div",{key:`${n}-item-${A}`,style:w},E)}),b=c==="fade"?{position:"relative",width:"100%",height:"100%"}:{display:"flex",height:"100%",transition:"transform .5s ease",transform:`translateX(-${i*100}%)`},P={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:"36px",height:"36px",borderRadius:"50%",border:"none",background:"rgba(0,0,0,0.45)",color:"#fff",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"};return V("div",{key:n,...y},V("div",{style:b},p),u&&V("div",{style:{...P,left:"8px"}},V("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i-1),"aria-label":"Previous slide"},"<")),u&&V("div",{style:{...P,right:"8px"}},V("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i+1),"aria-label":"Next slide"},">")),f&&V("div",{style:{position:"absolute",bottom:"10px",left:"50%",transform:"translateX(-50%)",display:"flex",gap:"6px",zIndex:2}},r.map((S,A)=>V("button",{key:`${n}-dot-${A}`,"aria-label":`Slide ${A+1}`,onClick:()=>h(A),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",padding:0,background:A===i?"rgba(255,255,255,0.95)":"rgba(255,255,255,0.4)",transition:"background .3s ease"}}))))}function Ect(e,t,n){const r=Array.isArray(t.items)?t.items:[],i=t.speed||20,o={overflow:"hidden",width:"100%",...t.className?e.parseClassName(t.className):{}},s=e.getCommonProps(n,o,t),l=c=>V("div",{key:c,style:{display:"inline-flex",alignItems:"center",gap:t.gap||"24px",paddingRight:t.gap||"24px",animation:`bf-marquee ${i}s linear infinite`,willChange:"transform",flexShrink:0}},r.map((h,u)=>{const f=typeof h=="string"?{type:"text",text:h}:h&&h.image?{type:"image",src:h.image,alt:h.alt||"",height:t.itemHeight||"48px"}:h;return e.renderComponent(f,u,`${c}-${n}-marq`)}));return V("div",{key:n,...s},V("div",{style:{display:"flex",width:"max-content"}},l("a"),l("b")))}function Cct(e,t,n){const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState("idle"),[c,h]=v.useState(""),[u,f]=v.useState(!1),m=t.fieldName||"capture",y=t.captureMode==="qr",x=e.apiUrl||window.location.origin,p=t.uploadPath||"/api/files/upload",b=()=>{var F;(F=i.current)==null||F.getTracks().forEach(D=>D.stop()),i.current=null},P=async F=>{var U,z,Y;const D=new FormData;D.append("file",F,`${m}-${Date.now()}.jpg`);const j=await fetch(new URL(p,x).toString(),{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:D});if(!j.ok)throw new Error("Upload failed");const K=await j.json();return((U=K==null?void 0:K.file)==null?void 0:U.url)||((z=K==null?void 0:K.file)==null?void 0:z.publicUrl)||((Y=K==null?void 0:K.file)==null?void 0:Y.path)||(K==null?void 0:K.url)||(K==null?void 0:K.path)||""},S=async(F,D)=>{var j,K;if(s!=="done"){b();try{f(!0);const U=D||await P(F);e.setSceneData(z=>({...z,[m]:U})),h(U),l("done"),(j=e.showToast)==null||j.call(e,t.successMessage||(D?"Scanned!":"Captured & uploaded"),"success")}catch{l("error"),(K=e.showToast)==null||K.call(e,"Capture failed","error")}finally{f(!1)}}},A=()=>{var j;const F=r.current;if(!F||!F.videoWidth)return;const D=document.createElement("canvas");D.width=F.videoWidth,D.height=F.videoHeight,(j=D.getContext("2d"))==null||j.drawImage(F,0,0),D.toBlob(K=>K&&S(K),"image/jpeg",t.quality||.85)},E=async()=>{var F,D;try{const j=await navigator.mediaDevices.getUserMedia({video:{facingMode:t.facingMode||"user",...t.aspectRatio?{aspectRatio:Number(t.aspectRatio)}:{}},audio:!1});if(i.current=j,r.current&&(r.current.srcObject=j,await r.current.play().catch(()=>{})),l("running"),y){const U=window.BarcodeDetector;if(!U){l("error"),(F=e.showToast)==null||F.call(e,"QR scanning not supported in this browser","error");return}const z=new U;o.current=window.setInterval(async()=>{const Y=r.current;if(!(!Y||!Y.videoWidth||s==="done"))try{const G=await z.detect(Y);G!=null&&G.length&&S(new Blob,G[0].rawValue)}catch{}},400)}}catch{l("error"),(D=e.showToast)==null||D.call(e,"Camera access denied","error")}};v.useEffect(()=>(E(),()=>{o.current&&window.clearInterval(o.current),b()}),[]);const w={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",width:"100%",...t.className?e.parseClassName(t.className):{}},T=e.getCommonProps(n,w,t),O=V("video",{key:"cam-video",ref:r,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a",display:y||s!=="done"?void 0:"none"}}),I=c?V("img",{key:"cam-result",src:c,alt:"captured",style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a"}}):null,N=V("div",{key:"cam-actions",style:{display:"flex",gap:"10px",flexWrap:"wrap",justifyContent:"center"}},s!=="done"?V("button",{key:"cam-capture",onClick:A,disabled:u||s!=="running",style:{padding:"10px 22px",borderRadius:"9999px",border:"none",cursor:u?"wait":"pointer",background:"#3B82F6",color:"#fff",fontWeight:600}},u?"Uploading...":y?t.captureLabel||"Scan QR":t.captureLabel||"Capture"):V("button",{key:"cam-retake",onClick:()=>{h(""),l("idle"),E()},style:{padding:"10px 22px",borderRadius:"9999px",border:"1px solid #94a3b8",cursor:"pointer",background:"transparent"}},"Retake"));return V("div",{key:n,...T},O,I,t.captureLabel===!1?null:N,s==="error"?V("p",{key:"cam-err",style:{color:"#EF4444",fontSize:"13px"}},"Camera unavailable — check permissions"):null)}function Oct(e,t,n){var i;if(t.className){const o=((i=e.parseClassNameResponsive)==null?void 0:i.call(e,t.className,n))??e.parseClassName(t.className),s=e.getCommonProps(n,o,t);return V("div",{key:n,className:t.className,...s})}const r=e.getCommonProps(n,{height:t.h||t.height||"24px"},t);return V("div",{key:n,...r})}function Mct(e,t,n){const r=t.className||"border-gray-700 my-4",i=e.parseClassName(r),o=e.getCommonProps(n,i,t);return V("hr",{key:n,className:r,...o})}function kct(e,t,n){var u;const r=t.loaderVariant||"spinner",i=t.rows||3,o=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};t.rawStyle&&Object.assign(o,t.rawStyle);const s=e.getCommonProps(n,o,t),l=`${e.scopeId}-${n}`,c=e.renderMode==="css-driven"?{"data-bf-r":l}:{};if(r==="skeleton"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(V("div",{key:m,className:"bf-loader-skeleton",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return V("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="shimmer"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(V("div",{key:m,className:"bf-loader-shimmer",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return V("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="dots"){const f=t.color||"currentColor";return V("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",gap:"6px",...o},...s,...c},[0,1,2].map(m=>V("div",{key:m,className:"bf-loader-dot",style:{width:t.size||"8px",height:t.size||"8px",borderRadius:"50%",backgroundColor:f,animationDelay:`${m*.16}s`}})))}if(r==="pulse")return V("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},V("div",{className:"bf-loader-pulse",style:{width:t.size||"32px",height:t.size||"32px",borderRadius:"50%",border:`3px solid ${t.color||"currentColor"}`}}));if(r==="progress")return V("div",{key:n,className:t.className,style:{width:"100%",...o},...s,...c},V("div",{style:{height:t.height||"4px",width:"100%",backgroundColor:"rgba(128,128,128,0.2)",borderRadius:"4px",overflow:"hidden"}},V("div",{className:"bf-loader-progress-bar",style:{height:"100%",width:"30%",backgroundColor:t.color||"currentColor",borderRadius:"4px"}})));const h=t.size||"24px";return V("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},V("div",{className:"bf-loader-spinner",style:{width:h,height:h,border:`3px solid ${t.color?t.color+"33":"rgba(128,128,128,0.2)"}`,borderTopColor:t.color||"currentColor",borderRadius:"50%"}}))}function $ct(e,t,n){const r=t.rows||4;if(t.className){const s=e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return V("textarea",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,rows:r})}const i={width:"100%",padding:"0.75rem 1rem",borderRadius:e.cfg.components.inputRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,resize:"vertical",fontFamily:"inherit"},o=e.getCommonProps(n,i,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return V("div",{key:n,...s},V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("textarea",{...o,name:t.name,placeholder:t.placeholder,rows:r}))}return V("textarea",{key:n,...o,name:t.name,placeholder:t.placeholder,rows:r})}function Ict(e,t,n){const r=t.icon||t.name||"",i=t.size||24,o=e.renderIcon(r,i);if(t.className){const s=e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return V("span",{key:n,className:t.className,...l},o)}return v.cloneElement(o,{key:n})}function Rct(e,t,n){const r=t.metricSize||"md",i=r==="sm"?"1.25rem":r==="lg"?"2.5rem":"1.75rem",o=r==="sm"?"0.75rem":r==="lg"?"1rem":"0.875rem",s=t.color||e.cfg.colors.primary,l=t.trend==="up"?"↑":t.trend==="down"?"↓":"",c=t.trendColor||(t.trend==="up"?e.cfg.colors.success:t.trend==="down"?e.cfg.colors.danger:e.cfg.colors.textMuted),h={display:"flex",flexDirection:"column",gap:"2px",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return V("div",{key:n,...u},t.label&&V("span",{style:{fontSize:o,color:e.cfg.colors.textSecondary,fontWeight:500}},e.interpolateText(t.label)),v.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px",marginTop:"4px"}},t.prefix&&V("span",{style:{fontSize:i,fontWeight:700,color:s}},t.prefix),V("span",{style:{fontSize:i,fontWeight:700,color:e.cfg.colors.text}},typeof t.value=="number"?t.value.toLocaleString():e.interpolateText(String(t.value??""))),t.suffix&&V("span",{style:{fontSize:i,fontWeight:700,color:s}},t.suffix),t.delta&&V("span",{style:{fontSize:"0.75rem",fontWeight:600,color:c,marginLeft:"4px"}},`${l} ${t.delta}`)))}function Lct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||200,o=t.barColor||e.cfg.colors.primary,s=t.horizontal===!0,l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},c=s?{type:"number",axisLine:!1,tickLine:!1}:{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:e.cfg.colors.textMuted,fontSize:12}},h=s?{dataKey:"label",type:"category",axisLine:!1,tickLine:!1,width:88,tick:{fill:e.cfg.colors.textMuted,fontSize:12}}:{axisLine:!1,tickLine:!1,width:36},u=v.createElement(qp,{width:"100%",height:i},v.createElement(oct,{data:r,layout:s?"vertical":"horizontal"},v.createElement(mm,{vertical:!s,stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(hs,c),v.createElement(fs,h),v.createElement(wr,{cursor:{fill:t.cursorColor||e.cfg.colors.surfaceHover,fillOpacity:t.cursorOpacity??.5},content:v.createElement(N$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:o,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(Aa,{dataKey:"value",fill:o,radius:s?[0,4,4,0]:[4,4,0,0],isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})));return V("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&V("div",{style:{marginBottom:"0.75rem"}},t.title),u)}function oT(e,t,n,r=!1){const i=t.chartData||t.data||[];if(!Array.isArray(i)||i.length===0)return null;const o=Number(t.height)||240,s=Array.isArray(t.colors)&&t.colors.length?t.colors:[e.cfg.colors.primary,e.cfg.colors.accent,"#317150","#d95020","#638173"],l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return V("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&V("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(qp,{width:"100%",height:o},v.createElement(sct,null,v.createElement(wr,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),t.showLegend!==!1&&v.createElement(ra,{iconType:"circle",wrapperStyle:{fontSize:12}}),v.createElement(bo,{data:i,dataKey:"value",nameKey:"label",cx:"50%",cy:"50%",innerRadius:r?"55%":0,outerRadius:"80%",paddingAngle:2,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750},...i.map((c,h)=>v.createElement(Sh,{key:`${c.label||h}-${h}`,fill:c.color||s[h%s.length]}))))))}function Nct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||260,o=t.xKey||"x",s=t.yKey||"y",l=t.zKey||"size",c={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return V("div",{key:n,style:e.getCommonProps(n,c,t)},t.title&&V("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(qp,{width:"100%",height:i},v.createElement(act,{margin:{top:16,right:12,bottom:8,left:0}},v.createElement(mm,{stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(hs,{dataKey:o,type:"number",axisLine:!1,tickLine:!1}),v.createElement(fs,{dataKey:s,type:"number",axisLine:!1,tickLine:!1}),v.createElement(Oh,{dataKey:l,range:t.zRange||[50,360]}),v.createElement(wr,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),v.createElement(Mh,{data:r,fill:t.color||e.cfg.colors.primary,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750}))))}function N$({active:e,payload:t,label:n,prefix:r,labelText:i,lineColor:o,backgroundColor:s,textColor:l,borderColor:c}){var u;const h=Number((u=t==null?void 0:t[0])==null?void 0:u.value);return!e||!Number.isFinite(h)?null:v.createElement("div",{style:{padding:10,border:`1px solid ${c}`,borderRadius:6,backgroundColor:s,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.16)",color:l}},v.createElement("p",{style:{margin:0,fontSize:14}},n),v.createElement("p",{style:{margin:"8px 0 0",color:o,fontSize:14}},`${i||"Indicative price / kg"}: ${r||""}${h.toLocaleString()}`))}function jct({api:e,c:t,data:n,height:r,lineColor:i,fillColor:o,filled:s}){return v.createElement(qp,{width:"100%",height:r},v.createElement(lct,{data:n,margin:{top:16,right:8,left:0,bottom:0}},t.showGrid!==!1&&v.createElement(mm,{vertical:!1,stroke:"#dce4dc",strokeDasharray:"3 3"}),v.createElement(hs,{dataKey:"label",axisLine:!1,tickLine:!1,height:30,tick:{fill:"#638173",fontSize:12}}),v.createElement(fs,{axisLine:!1,tickLine:!1,width:40,tickCount:5,domain:[0,"auto"],tick:{fill:"#638173",fontSize:12},tickFormatter:l=>`${t.tooltipPrefix||""}${Number(l/1e3).toFixed(1).replace(".0","")}k`}),v.createElement(wr,{cursor:{stroke:"#638173",strokeDasharray:"3 3"},content:v.createElement(N$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:i,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(us,{type:"monotone",dataKey:"value",stroke:i,fill:s?o:"transparent",strokeWidth:3,dot:!1,activeDot:{r:6,fill:i,stroke:e.cfg.colors.surface,strokeWidth:3},isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})))}function Ug(e,t,n,r=!1,i=!1){const o=Array.isArray(t.chartData)?t.chartData:[];if(o.length===0)return null;const s=o.flatMap(b=>i?[b.low,b.high]:[b.value]).map(Number).filter(Number.isFinite);if(s.length===0)return null;const l=Math.min(...s),h=Math.max(...s)-l||1,u=Number(t.height)||220,f=b=>u-(b-l)/h*u,m=t.lineColor||e.cfg.colors.accent,y=t.fillColor||`${m}33`,x={width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},p=i?o.map((b,P)=>{const S=Number(b.open),A=Number(b.close),E=Number(b.high),w=Number(b.low),T=A>=S;return V("div",{key:P,style:{flex:1,height:"100%",position:"relative"}},V("div",{style:{position:"absolute",left:"50%",top:`${f(E)}px`,height:`${Math.max(1,f(w)-f(E))}px`,borderLeft:`1px solid ${T?"#22c55e":"#ef4444"}`}}),V("div",{style:{position:"absolute",left:"25%",right:"25%",top:`${f(Math.max(S,A))}px`,height:`${Math.max(3,Math.abs(f(A)-f(S)))}px`,background:T?"#22c55e":"#ef4444",borderRadius:"2px"}}))}):v.createElement(jct,{api:e,c:t,data:o,height:u,lineColor:m,fillColor:y,filled:r});return V("div",{key:n,style:e.getCommonProps(n,x,t)},t.title&&V("div",{style:{color:e.cfg.colors.textSecondary,fontWeight:600,marginBottom:"0.75rem"}},t.title),V("div",{style:{display:"flex",alignItems:"stretch",gap:i?"4px":void 0,height:u}},p),i&&V("div",{style:{display:"flex",justifyContent:"space-between",color:e.cfg.colors.textMuted,fontSize:"0.7rem",marginTop:"4px"}},...o.map((b,P)=>V("span",{key:P},b.label||""))))}function Dct(e,t,n){const r=Array.isArray(t.chartData)?t.chartData[0]||{}:{},i=t.ticker||r.ticker||r.symbol||"EUR/USD",o=t.bid??r.bid??r.price,s=t.ask??r.ask,l=t.change??r.change,c=Number(l),h=Number.isFinite(c)&&c>=0,u=e.getCommonProps(n,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",width:"100%",padding:"0.9rem 1rem",backgroundColor:e.cfg.colors.surface,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:e.cfg.layout.borderRadiusLg,...t.className?e.parseClassName(t.className):{}},t);return V("div",{key:n,...u},V("div",{},V("div",{style:{color:e.cfg.colors.text,fontWeight:700}},i),t.label&&V("div",{style:{color:e.cfg.colors.textMuted,fontSize:"0.75rem"}},t.label)),V("div",{style:{display:"flex",gap:"1rem",alignItems:"baseline",fontVariantNumeric:"tabular-nums"}},o!=null&&V("span",{style:{color:e.cfg.colors.text,fontWeight:700}},String(o)),s!=null&&V("span",{style:{color:e.cfg.colors.textSecondary}},String(s)),l!=null&&V("span",{style:{color:h?"#22c55e":"#ef4444",fontSize:"0.8rem",fontWeight:600}},`${h?"+":""}${l}`)))}function Bct({api:e,c:t,componentKey:n}){var b,P,S,A;const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState(null),c=v.useRef(null),[h,u]=v.useState(()=>Array.isArray(t.chartData)?t.chartData:[]);v.useEffect(()=>{Array.isArray(t.chartData)&&u(t.chartData)},[t.chartData]);const f=e.interpolateText(((b=t.realtime)==null?void 0:b.channel)||""),m=e.interpolateText(((P=t.timeRange)==null?void 0:P.from)||""),y=e.interpolateText(((S=t.timeRange)==null?void 0:S.to)||""),x=Array.isArray(t.timeframes)?t.timeframes:[];v.useEffect(()=>{var O,I;const E=e.sdk;if(!(((O=t.realtime)==null?void 0:O.mode)==="ws"&&e.isAuthenticated&&f&&((I=E==null?void 0:E.client)==null?void 0:I.createWebSocket)))return;const T=E.client.createWebSocket(f);return T.onmessage=N=>{var F;try{const D=typeof N.data=="string"?JSON.parse(N.data):N.data,j=(D==null?void 0:D.tick)||((F=D==null?void 0:D.data)==null?void 0:F.tick)||(D==null?void 0:D.data)||D,K=Number((j==null?void 0:j.quote)??(j==null?void 0:j.price)??(j==null?void 0:j.close));if(!Number.isFinite(K))return;const U=Number((j==null?void 0:j.epoch)??(j==null?void 0:j.timestamp)??Date.now()/1e3),z=Math.floor(U/60)*60;u(Y=>{const G=Y[Y.length-1];if((G==null?void 0:G.time)===z)return[...Y.slice(0,-1),{...G,high:Math.max(Number(G.high),K),low:Math.min(Number(G.low),K),close:K}];const X=Number((G==null?void 0:G.close)??K);return[...Y.slice(-99),{time:z,open:X,high:K,low:K,close:K}]})}catch{}},()=>{var N;return(N=T.close)==null?void 0:N.call(T)}},[e.isAuthenticated,(A=t.realtime)==null?void 0:A.mode,f]);const p=v.useMemo(()=>h.map((E,w)=>{const T=E.time||E.timestamp;return{time:typeof T=="string"&&T.includes("T")?Math.floor(new Date(T).getTime()/1e3):T||`2024-01-${String(w+1).padStart(2,"0")}`,...t.chartType==="candlestick"?{open:Number(E.open),high:Number(E.high),low:Number(E.low),close:Number(E.close)}:{value:Number(E.value??E.close)}}}),[t.chartType,h]);return c.current=p[p.length-1],v.useEffect(()=>{const E=r.current;if(!E)return;const w=Lz(E,{autoSize:!0,height:Number(t.height)||280,layout:{background:{color:"transparent"},textColor:e.cfg.colors.textSecondary},grid:{vertLines:{color:e.cfg.colors.borderSubtle},horzLines:{color:e.cfg.colors.borderSubtle}},rightPriceScale:{borderColor:e.cfg.colors.borderSubtle},timeScale:{borderColor:e.cfg.colors.borderSubtle,timeVisible:!0}}),T=t.chartType||"candlestick",O=T==="line"?w.addSeries(Wz,{color:t.lineColor||e.cfg.colors.accent}):T==="area"?w.addSeries(Kz,{lineColor:t.lineColor||e.cfg.colors.accent,topColor:t.fillColor||`${e.cfg.colors.accent}66`,bottomColor:"transparent"}):w.addSeries(t5,{upColor:"#22c55e",downColor:"#ef4444",borderVisible:!1,wickUpColor:"#22c55e",wickDownColor:"#ef4444"});return o.current=w,i.current=O,()=>{i.current=null,o.current=null,w.remove()}},[e.cfg.colors.accent,e.cfg.colors.borderSubtle,e.cfg.colors.textSecondary,t.chartType,t.height,t.lineColor,t.fillColor]),v.useEffect(()=>{var E,w;!i.current||p.length===0||(i.current.setData(p),m&&y?(E=o.current)==null||E.timeScale().setVisibleRange({from:m,to:y}):(w=o.current)!=null&&w.timeScale().getVisibleLogicalRange()||o.current.timeScale().fitContent())},[p,m,y]),v.useEffect(()=>{if(!s||!o.current||!c.current)return;const E={"1H":3600,"4H":14400,"1D":86400,"1W":604800}[s],w=Number(c.current.time);E&&Number.isFinite(w)&&o.current.timeScale().setVisibleRange({from:w-E,to:w})},[s]),V("div",{key:n,style:{width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}}},x.length>0&&V("div",{style:{display:"flex",gap:"0.35rem",marginBottom:"0.5rem"}},...x.map(E=>V("button",{key:E,type:"button",onClick:()=>l(E),style:{padding:"0.3rem 0.6rem",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:4,color:e.cfg.colors.text,background:s===E?e.cfg.colors.surfaceHover:"transparent",cursor:"pointer"}},E))),V("div",{ref:r,style:{width:"100%",height:Number(t.height)||280}}))}function zct(e,t,n){return v.createElement(Bct,{api:e,c:t,componentKey:n})}function Fct(e,t,n){const r=t.json||t.data||t.diagram||{},i=e.getCommonProps(n,{display:"flex",flexDirection:"column",minHeight:"300px"},t);return V("div",{key:n,className:t.className,...i},v.createElement("pre",{style:{fontSize:"12px",whiteSpace:"pre-wrap",margin:0}},typeof r=="string"?r:JSON.stringify(r,null,2)))}function Wct({api:e,c:t,componentKey:n}){const r=t.data||t.json||t.diagram||{},{_config:i,...o}=r||{},s=Object.keys(o).length?o:r,{nodes:l,edges:c}=v.useMemo(()=>Ax.createFlowDiagram(s),[s]),[h,u]=v.useState("LR"),f=e.cfg.fullscreen===!0,m=t.height||(f?"100%":320),y=e.getCommonProps(n,{width:"100%",height:m,...f?{minHeight:0}:{}},t);return V("div",{key:n,className:t.className,...y},v.createElement(Ax.FlowDiagram,{nodes:l,edges:c,config:{direction:h,layout:(i==null?void 0:i.layout)||"dagre",colorMode:(i==null?void 0:i.colorMode)||(e.cfg.colorMode==="dark"?"dark":"light"),backgroundPattern:(i==null?void 0:i.backgroundPattern)||"dot"},callbacks:{onDirectionChange:x=>u(x)},showBottomBar:(i==null?void 0:i.showBottomBar)||!1,style:{width:"100%",height:"100%"}}))}function Vct(e,t,n){return v.createElement(Wct,{api:e,c:t,componentKey:n})}function Uct(e,t,n){var r;if(t.className){const i=((r=e.parseClassNameResponsive)==null?void 0:r.call(e,t.className,n))??e.parseClassName(t.className);i.display==null&&(i.display="flex"),i.flexDirection==null&&(i.flexDirection=/(^|\s)flex(\s|$)/.test(t.className||"")||t.layout==="row"?"row":"column");const o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,className:t.className,...o},(Array.isArray(t.children)?t.children:[]).map((s,l)=>e.renderComponent(s,l,n)))}return null}const Hct=v.memo(({api:e,field:t,fieldName:n,value:r,onChange:i})=>{v.useEffect(()=>{r!==void 0&&r!==""&&i&&i(r)},[]);const o=v.useRef(null),[s,l]=v.useState(!1),c=v.useRef(null),h=v.useRef(null),[u,f]=v.useState(!1),[m,y]=v.useState(""),[x,p]=v.useState(!1),b=t.html!==!1,P=S=>b?S:S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\n/g,"<br>");return v.useEffect(()=>{o.current&&!o.current.innerHTML&&(o.current.innerHTML=P(r))},[]),v.useEffect(()=>{o.current&&document.activeElement!==o.current&&o.current.innerHTML!==r&&(o.current.innerHTML=P(r))},[r]),v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},t.label?V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,v.createElement("div",{style:{border:`1px solid ${s?e.cfg.colors.primary:e.cfg.colors.border}`,borderRadius:e.cfg.components.inputRadius,overflow:"hidden",transition:"border-color 0.2s",position:"relative"}},v.createElement("div",{style:{display:"flex",gap:"4px",padding:"6px 8px",borderBottom:`1px solid ${e.cfg.colors.border}`,backgroundColor:e.cfg.colors.surface}},...[{cmd:"bold",label:"B"},{cmd:"italic",label:"I"},{cmd:"underline",label:"U"}].map(S=>V("button",{key:S.cmd,type:"button",onMouseDown:A=>{var E;A.preventDefault(),document.execCommand(S.cmd,!1),(E=o.current)==null||E.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontWeight:600,fontSize:"13px"},onMouseEnter:A=>A.target.style.borderColor=e.cfg.colors.border,onMouseLeave:A=>A.target.style.borderColor="transparent"},S.label)),V("span",{key:"spacer",style:{flex:1}}),V("button",{key:"list-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),document.execCommand("insertUnorderedList",!1),(A=o.current)==null||A.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},"☰"),V("span",{key:"divider",style:{width:"1px",height:"16px",backgroundColor:e.cfg.colors.border,margin:"0 4px",alignSelf:"center"}}),V("button",{key:"img-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=c.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("image",14)),V("button",{key:"att-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=h.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("paperclip",14)),V("button",{key:"ai-btn",type:"button",onMouseDown:S=>{S.preventDefault(),f(!u)},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:u?e.cfg.colors.border:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("sparkles",14))),V("div",{ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onInput:S=>i(S.currentTarget.innerHTML),onFocus:()=>l(!0),onBlur:()=>l(!1),style:{minHeight:(t.rows||10)*20+"px",padding:"0.75rem 1rem",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,outline:"none",fontSize:"0.875rem",lineHeight:"1.6"}}),t.expandAction?v.createElement("button",{type:"button",key:"expand",style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.55)",border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"3px 5px",display:"flex",alignItems:"center",justifyContent:"center",opacity:.5,transition:"opacity 0.2s",zIndex:1},onMouseEnter:S=>{S.currentTarget.style.opacity="0.85"},onMouseLeave:S=>{S.currentTarget.style.opacity="0.5"},onClick:S=>{S.preventDefault(),S.stopPropagation(),e.handleButtonClick(t.expandAction,{})}},e.renderIcon("maximize-2",13)):null,V("input",{key:"img-input",ref:c,type:"file",accept:"image/*",style:{display:"none"},onChange:async S=>{var E,w,T,O,I,N;const A=(E=S.target.files)==null?void 0:E[0];if(A){try{const F=(w=e.showToast)==null?void 0:w.call(e,"Uploading image (0%)…","success",0),D=e.uploadFile?await e.uploadFile(A,t.upload,j=>{var K;return(K=F==null?void 0:F.update)==null?void 0:K.call(F,`Uploading image (${j}%)`)}):"";if((T=F==null?void 0:F.dismiss)==null||T.call(F),!D)throw Error();(O=o.current)==null||O.focus(),document.execCommand("insertImage",!1,D),i(((I=o.current)==null?void 0:I.innerHTML)||"")}catch{(N=e.showToast)==null||N.call(e,"Failed to upload image","error")}S.target.value=""}}}),V("input",{key:"att-input",ref:h,type:"file",multiple:!0,style:{display:"none"},onChange:async S=>{var O,I,N,F,D;const A=Array.from(S.target.files||[]);S.target.value="";const E=[];let w=0;const T=(O=e.showToast)==null?void 0:O.call(e,`Uploading 0/${A.length}…`,"success",0);for(const j of A){try{const K=e.uploadFile?await e.uploadFile(j,t.upload,U=>{var z;return(z=T==null?void 0:T.update)==null?void 0:z.call(T,`Uploading ${j.name} (${U}%)`)}):"";if(!K)throw Error();E.push(`<a href="${K}">${j.name}</a>`)}catch{(I=e.showToast)==null||I.call(e,`Failed to upload ${j.name}`,"error")}w++,(N=T==null?void 0:T.update)==null||N.call(T,`Uploading ${w}/${A.length}…`)}if((F=T==null?void 0:T.dismiss)==null||F.call(T),E.length>0&&o.current){o.current.focus();const j=window.getSelection();if(j){j.removeAllRanges();const K=document.createRange();K.selectNodeContents(o.current),K.collapse(!1),j.addRange(K)}document.execCommand("insertHTML",!1,`<br><br>${E.join(", ")}`),i(((D=o.current)==null?void 0:D.innerHTML)||"")}}}),u?V("div",{key:"ai-popup",style:{position:"absolute",bottom:"100%",left:"8px",right:"8px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",padding:"12px",zIndex:10,boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"}},V("textarea",{value:m,onChange:S=>y(S.target.value),placeholder:"Ask AI to draft a reply...",rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"4px",border:`1px solid ${e.cfg.colors.borderSubtle}`,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,fontSize:"13px",outline:"none",fontFamily:"inherit",resize:"none",boxSizing:"border-box"}}),V("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"8px"}},V("button",{type:"button",onClick:()=>{f(!1),y("")},style:{padding:"6px 14px",borderRadius:"6px",border:`1px solid ${e.cfg.colors.borderSubtle}`,cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textMuted,fontSize:"12px",fontFamily:"inherit"}},"Cancel"),V("button",{type:"button",disabled:x||!m.trim(),onClick:async()=>{var S,A,E,w;if(!(!m.trim()||x)){p(!0);try{const T=((S=o.current)==null?void 0:S.innerHTML)||"",O=await fetch("/api/tenant/email/ai/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:m,context:T})});if(!O.ok)throw Error();const I=await O.json(),N=I.response||I.text||I.content||"";(A=o.current)==null||A.focus(),document.execCommand("insertText",!1,N),i(((E=o.current)==null?void 0:E.innerHTML)||""),f(!1),y("")}catch{(w=e.showToast)==null||w.call(e,"AI request failed","error")}p(!1)}},style:{padding:"6px 14px",borderRadius:"6px",border:"none",cursor:x||!m.trim()?"not-allowed":"pointer",backgroundColor:x||!m.trim()?e.cfg.colors.surfaceHover:e.cfg.colors.background,color:x||!m.trim()?e.cfg.colors.textSecondary:e.cfg.colors.text,fontSize:"12px",fontWeight:600,fontFamily:"inherit"}},x?"Thinking...":"Generate"))):null))}),qct=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),o=v.useRef(null),[s,l]=v.useState([]),c=t.name?`bf_persist_${t.name}`:null;v.useEffect(()=>{t.dataSource&&(async()=>{var f;try{const m=e.interpolateText(t.dataSource),y=(f=e.selectDynamicOptions)==null?void 0:f[m];if(y&&y.length>0){l(y);return}Zo[m]||(Zo[m]=(async()=>{var p;try{const b=await fetch(m,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!b.ok)return[];const P=await b.json(),S=t.dataField||"configs",A=t.optionLabel||"label",E=t.optionValue||"value",w=P[S]||P.data||P,T=Array.isArray(w)?w.map(O=>({label:O[A]||O.name||O.label,value:O[E]||O.id||O.name||O.label})):[];return(p=e.setSelectDynamicOptions)==null||p.call(e,O=>({...O,[m]:T})),T}catch{return delete Zo[m],[]}})());const x=await Zo[m];x.length>0&&l(x)}catch{}})()},[t.dataSource]),v.useEffect(()=>{if(c&&t.name&&!e.sceneData[t.name]){const m=localStorage.getItem(c);m&&e.setSceneData(y=>({...y,[t.name]:m}))}},[c,t.name,e.sceneData[t.name]]),v.useEffect(()=>{if(!r)return;const f=y=>{o.current&&!o.current.contains(y.target)&&i(!1)},m=setTimeout(()=>{document.addEventListener("mousedown",f)},0);return()=>{clearTimeout(m),document.removeEventListener("mousedown",f)}},[r]);const h=t.variant==="selector",u=Array.isArray(t.items)?t.items:s;if(h){const f=t.name&&(e.sceneData[t.name||""]||c&&localStorage.getItem(c))||"",m=f||t.placeholder||"Select...";return V("div",{ref:o,style:{position:"relative",display:"inline-flex"}},v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:t.fontSize||"1rem",fontWeight:t.fontWeight||600,color:t.color||e.cfg.colors.text,padding:"2px 0",outline:"none",lineHeight:"1.5"},onClick:y=>{y.preventDefault(),i(!r)}},V("span",{key:"text"},m),V("span",{key:"caret",style:{display:"flex",alignItems:"center",opacity:.6,marginLeft:"2px"}},e.renderIcon("chevron-down",14))),r?v.createElement("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden",minWidth:"200px"}},...u.map((y,x)=>v.createElement("button",{key:x,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none",whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},onClick:p=>{p.preventDefault(),p.stopPropagation(),i(!1),t.name&&y.value!==f&&e.setSceneData(b=>({...b,[t.name]:y.value}))}},y.label||""))):null)}return v.createElement("div",{ref:o,style:{position:"relative",display:"flex",width:"100%"}},(()=>{var y;const f=!!((y=e.buttonLoading)!=null&&y[n]),m=[];return f?m.push(V("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):t.icon&&m.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(t.icon,t.iconSize||16))),m.push(V("span",{key:"text",style:{lineHeight:"1"}},t.text||"Button")),v.createElement("button",{type:"button",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontSize:"0.875rem",fontWeight:600,fontFamily:"inherit",lineHeight:"1.25rem",transition:"all 0.15s ease",outline:"none"},onMouseEnter:x=>{x.currentTarget.style.backgroundColor=e.cfg.colors.border,x.currentTarget.style.color=e.cfg.colorMode==="light"?"#111827":e.cfg.colors.text},onMouseLeave:x=>{x.currentTarget.style.backgroundColor=e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",x.currentTarget.style.color=e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary},onClick:x=>{if(x.preventDefault(),u.length>0&&u[0].onClick){const p=()=>e.handleButtonClick(u[0].onClick,{onSuccess:u[0].onSuccess,onError:u[0].onError},{feedback:u[0].feedback,optimistic:u[0].optimistic,payload:u[0].payload});(e.withLoading?e.withLoading(n,p):p()).catch(()=>{})}}},...m)})(),u.length>0?v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.75rem 0.5rem",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,borderLeft:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontFamily:"inherit",transition:"all 0.15s ease",outline:"none"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor=e.cfg.colors.border,f.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent",f.currentTarget.style.color=e.cfg.colors.textSecondary},onClick:f=>{f.preventDefault(),f.stopPropagation(),i(!r)}},e.renderIcon("chevron-down",16)):null,r?v.createElement("div",{style:{position:"absolute",bottom:"100%",left:"0",right:"0",marginBottom:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 -8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden"}},...u.map((f,m)=>{var b;const y=`${n}-item-${m}`,x=!!((b=e.buttonLoading)!=null&&b[y]),p=[];return x?p.push(V("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"12px",height:"12px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):f.icon&&p.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"8px"}},e.renderIcon(f.icon,14))),p.push(f.label||""),v.createElement("button",{key:m,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none"},onMouseEnter:P=>{P.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:P=>{P.currentTarget.style.backgroundColor="transparent"},onClick:P=>{if(P.preventDefault(),P.stopPropagation(),!f.onClick)return;const S=f.loading==="self"?y:n;f.loading==="self"?i(!0):i(!1);const A=()=>e.handleButtonClick(f.onClick,{onSuccess:f.onSuccess,onError:f.onError},{feedback:f.feedback,optimistic:f.optimistic,payload:f.payload});(e.withLoading?e.withLoading(S,A):A()).finally(()=>{f.loading==="self"&&i(!1)}).catch(()=>{})}},...p)})):null)});function Gct(e,t,n){return v.createElement(qct,{key:n,api:e,c:t,componentKey:n})}function Zct(e,t,n){var c,h;const r=t.widgetId;if(!r)return null;const o=(e.widgets||[]).find(u=>u.id===r);if(!o||!Array.isArray(o.components))return fp(`[renderer] widget "${r}" not found`),null;if(e.widgetStack&&e.widgetStack.includes(r))return fp(`[renderer] circular widget reference "${r}"`),null;(c=e.widgetStack)==null||c.push(r);const s=t.props||{},l=rb(o.components,s).map((u,f)=>e.renderComponent(u,f,`${n}-${r}`));return(h=e.widgetStack)==null||h.pop(),v.createElement(v.Fragment,null,...l)}function rb(e,t){if(!t||Object.keys(t).length===0)return e;if(Array.isArray(e))return e.map(n=>rb(n,t));if(e&&typeof e=="object"){const n={};for(const[r,i]of Object.entries(e))typeof i=="string"&&i.includes("{{")?n[r]=i.replace(/\{\{\s*(?:props\.)?([\w.]+)(?:\|(\w+))?\s*\}\}/g,(o,s,l)=>{let c=t;for(const f of s.split("."))c=c==null?void 0:c[f];if(c==null)return o;const h=c&&typeof c=="object"&&"_seconds"in c?c._seconds*1e3:c&&typeof c=="object"&&"seconds"in c?c.seconds*1e3:c,u=l?new Date(h):null;if(l&&Number.isNaN(u==null?void 0:u.getTime()))return"";if(l==="datetime")return u.toLocaleString();if(l==="timeago"){const f=Math.floor((Date.now()-u.getTime())/6e4);if(f<1)return"just now";if(f<60)return`${f}m ago`;const m=Math.floor(f/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`}return typeof c=="object"?JSON.stringify(c):String(c)}):n[r]=rb(i,t);return e.condition&&(n.__conditionBase=t),n}return e}const j$=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),[o,s]=v.useState(""),l=v.useRef(null),c=v.useMemo(()=>(Array.isArray(t.options)?t.options:[]).map(b=>typeof b=="string"?{label:b,value:b}:{label:b.label??b.value,value:b.value??b.label}),[t.options]),h=e.sceneData[t.name||""]??"",u=c.find(p=>p.value===h),f=t.className?e.parseClassName(t.className):{},m=v.useMemo(()=>{if(!o)return c;const p=o.toLowerCase();return c.filter(b=>b.label.toLowerCase().includes(p))},[c,o]),y=t.custom&&o&&!c.find(p=>p.value===o||p.label===o);v.useEffect(()=>{if(!r){s("");return}const p=b=>{l.current&&!l.current.contains(b.target)&&i(!1)};return setTimeout(()=>document.addEventListener("mousedown",p),0),()=>document.removeEventListener("mousedown",p)},[r]);const x=p=>{e.setSceneData(b=>({...b,[t.name||""]:p})),i(!1)};return V("div",{key:n,ref:l,style:{position:"relative",width:"100%",...f}},t.label&&V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),V("button",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 8px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontSize:"14px",textAlign:"left",gap:"8px"},onClick:()=>i(!r)},V("span",null,u?u.label:t.placeholder||"Select..."),V("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},V("path",{d:"m6 9 6 6 6-6"}))),r&&V("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:50,marginTop:"4px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:e.cfg.colors.surface,overflow:"hidden",maxHeight:"260px",display:"flex",flexDirection:"column"}},t.searchable!==!1&&V("input",{style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.text,outline:"none",fontSize:"13px"},placeholder:"Search...",value:o,onChange:p=>{s(p.target.value),p.stopPropagation()},onClick:p=>p.stopPropagation()}),V("div",{style:{overflow:"auto",flex:1}},m.map(p=>V("button",{key:p.value,style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",background:p.value===h?"rgba(59,130,246,0.2)":"transparent",color:p.value===h?e.cfg.colors.primary:e.cfg.colors.text,cursor:"pointer",fontSize:"13px"},onMouseEnter:b=>{b.currentTarget.style.background=e.cfg.colors.surfaceHover},onMouseLeave:b=>{b.currentTarget.style.background=p.value===h?"rgba(59,130,246,0.2)":"transparent"},onClick:()=>x(p.value)},p.label)),y&&V("button",{style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",borderTop:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.primary,cursor:"pointer",fontSize:"13px",fontStyle:"italic"},onClick:()=>x(o)},`+ Add "${o}"`))))});function Yct(e,t,n){return v.createElement(j$,{api:e,c:t,componentKey:n})}const Zo={},Kct=v.memo(({api:e,field:t,fieldName:n,fieldKey:r,fieldStyle:i,fieldWrapperStyle:o})=>{const[s,l]=v.useState([]);v.useEffect(()=>{t.dataSource&&(async()=>{var u;try{const f=e.interpolateText(t.dataSource),m=(u=e.selectDynamicOptions)==null?void 0:u[f];if(m&&m.length>0){l(m);return}Zo[f]||(Zo[f]=(async()=>{var x;try{const p=await fetch(f,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!p.ok)return[];const b=await p.json(),P=t.dataField||"configs",S=t.optionLabel||"label",A=t.optionValue||"value",E=b[P]||b.data||b,w=Array.isArray(E)?E.map(T=>({label:T[S]||T.name||T.label,value:T[A]||T.id||T.name||T.label})):[];return(x=e.setSelectDynamicOptions)==null||x.call(e,T=>({...T,[f]:w})),w}catch{return delete Zo[f],[]}})());const y=await Zo[f];y.length>0&&l(y)}catch{}})()},[t.dataSource]);const c=s.length>0?s:Array.isArray(t.options)?t.options:[],h=t.placeholder||t.label||"Select...";return v.createElement("div",{key:r,style:o||{width:"100%"}},t.label?V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,V("select",{name:n,value:e.sceneData[n]??"",required:t.required,className:t.className,style:{...i,fontSize:"0.875rem"},size:"md",onChange:u=>e.setSceneData(f=>({...f,[n]:u.target.value}))},V("option",{key:"__placeholder",value:"",disabled:!0,hidden:!0},h),c.map((u,f)=>V("option",{key:f,value:typeof u=="string"?u:u.value},typeof u=="string"?u:u.label))))});function Xct(e,t,n){var c;const r=t.className||"",i=((c=e.parseClassNameResponsive)==null?void 0:c.call(e,r,n))??e.parseClassName(r),o=e.getCommonProps(n,i,t),s=Array.isArray(t.fields)?t.fields:[],l=t.submitButton;return t.collection&&e.fetchEntitySchema?v.createElement(Jct,{api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}):D$(e,t,n,r,i,o,s,l)}function Jct({api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}){const[c,h]=v.useState(s),[u,f]=v.useState(!0);return v.useEffect(()=>{if(!e.fetchEntitySchema){f(!1);return}e.fetchEntitySchema(t.collection).then(m=>{if(!Array.isArray(m==null?void 0:m.fields)){f(!1);return}const y=new Map(m.fields.map(p=>[p.name,p])),x=s.map(p=>{var P;const b=y.get(p.name||((P=p.label)==null?void 0:P.toLowerCase()));return b?{...p,required:p.required??b.required,validation:p.validation??(b.validation?{...b.validation}:void 0),placeholder:p.placeholder??b.placeholder}:p});h(x),f(!1)}).catch(()=>f(!1))},[t.collection]),u?V("div",{key:n,style:{padding:"1rem",textAlign:"center",color:e.cfg.colors.textMuted,fontSize:"0.8rem"}},"Loading fields..."):D$(e,t,n,r,i,o,c,l)}const Qct=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,inputType:s,label:l,fieldStyle:c,onKeyDown:h,openPickerOnClick:u}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const f=v.useRef(r);f.current=r;const m=v.useRef(c);m.current=c;const y=v.useCallback(p=>{f.current(p.target.value)},[]),x=v.createElement("input",{name:t,placeholder:i,required:o,type:s||"text",value:n??"",onChange:y,onClick:u?p=>{var b,P;return(P=(b=p.currentTarget).showPicker)==null?void 0:P.call(b)}:void 0,onKeyDown:h?p=>{p.key==="Enter"&&h()}:void 0,style:m.current});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:c.color,marginBottom:"0.75rem"}},l),x):x}),tut=v.memo(function({api:t,field:n,fieldName:r,label:i,fieldStyle:o}){const s=v.useRef(null),[l,c]=v.useState(!1),h=t.sceneData[r]||"",u=t.sceneData[r+"_name"]||"",f=async m=>{var x,p,b,P;const y=(x=m.target.files)==null?void 0:x[0];if(m.target.value="",!!y){c(!0);try{const S=(p=t.showToast)==null?void 0:p.call(t,"Uploading test case (0%)…","success",0),A=t.uploadFile?await t.uploadFile(y,n.upload,E=>{var w;return(w=S==null?void 0:S.update)==null?void 0:w.call(S,`Uploading test case (${E}%)`)}):"";if((b=S==null?void 0:S.dismiss)==null||b.call(S),!A)throw new Error;t.setSceneData(E=>({...E,[r]:A,[r+"_name"]:y.name}))}catch{(P=t.showToast)==null||P.call(t,"Upload failed","error")}finally{c(!1)}}};return v.createElement("div",{style:{width:"100%"}},i&&V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.75rem"}},i),h?v.createElement("div",{style:{...o,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}},V("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},"📎 "+(u||"Test case uploaded")),V("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:t.cfg.colors.danger,fontSize:"13px"},onClick:()=>t.setSceneData(m=>{const y={...m};return delete y[r],delete y[r+"_name"],y})},"Remove")):v.createElement("button",{type:"button",onClick:()=>{var m;return(m=s.current)==null?void 0:m.click()},style:{...o,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",color:t.cfg.colors.textMuted,fontSize:"14px"}},l?"Uploading…":"⬆ Upload a test case"),V("input",{key:"file-input",ref:s,type:"file",accept:n.accept||".pdf,.docx,.txt,.md,.csv,.json",style:{display:"none"},onChange:f}))}),eut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,options:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("select",{name:t,required:o,value:n??"",onChange:f,style:{...u.current,cursor:"pointer",appearance:"none"}},i?v.createElement("option",{key:"__placeholder",value:""},i):null,...s.map((y,x)=>v.createElement("option",{key:x,value:typeof y=="string"?y:y.value},typeof y=="string"?y:y.label)));return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m}),nut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,rows:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("textarea",{name:t,placeholder:i,required:o,rows:s||4,value:n??"",onChange:f,style:{...u.current,resize:"vertical",fontFamily:"inherit"}});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m});function D$(e,t,n,r,i,o,s,l){var y,x;const c=[],h=Math.max(1,Math.floor(Number(t.columns)||1)),u=typeof window>"u"?1/0:window.innerWidth,m=Math.min(e.containerWidth||1/0,u)<640?1:h;if(s.forEach((p,b)=>{var O,I;const P=`${n}-field-${b}`,S=p.name||((O=p.label)==null?void 0:O.toLowerCase())||"",A=p.className?((I=e.parseClassNameResponsive)==null?void 0:I.call(e,p.className,P))??e.parseClassName(p.className):{},E={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:p.borderless?p.backgroundColor||"transparent":e.cfg.colors.surface,color:p.textColor||e.cfg.colors.text,colorScheme:e.cfg.colorMode==="light"?"light":"dark",border:p.borderless?"none":`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,...A},w={width:"100%",marginBottom:"1rem"},T=N=>N.value?e.interpolateText(String(N.value)):"";if(p.type==="richtext")c.push(v.createElement(Hct,{key:P,api:e,field:p,fieldName:S,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(F=>({...F,[S]:N}))}));else if(p.type==="textarea"){const N=p.rows||4;c.push(v.createElement(nut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:F=>e.setSceneData(D=>({...D,[S]:F})),placeholder:p.placeholder||p.label,required:p.required,rows:N,label:p.label,fieldStyle:E}))}else if(p.type==="select")if(p.dataSource)c.push(v.createElement(Kct,{key:P,api:e,field:p,fieldName:S,fieldKey:P,fieldStyle:E,fieldWrapperStyle:w}));else{const N=Array.isArray(p.options)?p.options:[];c.push(v.createElement(eut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:F=>e.setSceneData(D=>({...D,[S]:F})),placeholder:p.placeholder||p.label||"Select...",required:p.required,options:N,label:p.label,fieldStyle:E}))}else if(p.type==="advanced-select")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(j$,{key:P,api:e,c:{...p,name:S,options:p.options},componentKey:P})));else if(p.type==="file")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(tut,{key:P,api:e,field:p,fieldName:S,label:p.label,fieldStyle:E})));else if(p.tags)c.push(v.createElement(rut,{key:P,api:e,field:p,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(F=>({...F,[S]:N}))}));else{const N=p.type==="email"?"email":p.type==="password"?"password":p.type==="number"?"number":p.type==="date"?"date":p.type==="datetime-local"?"datetime-local":"text";c.push(v.createElement(Qct,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:F=>e.setSceneData(D=>({...D,[S]:F})),placeholder:p.placeholder||p.label,required:p.required,inputType:N,label:p.label,fieldStyle:E,openPickerOnClick:p.openPickerOnClick,onKeyDown:p.onKeyDown?()=>e.handleButtonClick(p.onKeyDown):void 0}))}}),h>1){const p=c.splice(0);c.push(...p.map((b,P)=>{var A;const S=Math.min(m,Math.max(1,Number((A=s[P])==null?void 0:A.fieldSpan)||1));return V("div",{key:`${n}-field-grid-${P}`,style:{gridColumn:`span ${S} / span ${S}`,minWidth:0}},b)}))}if(l){const p={padding:"0.75rem 1.5rem",borderRadius:e.cfg.components.inputRadius,cursor:"pointer",fontWeight:600,width:"100%",marginTop:"1rem",...h>1?{gridColumn:"1 / -1",marginTop:0}:{}},b=l.className?((y=e.parseClassNameResponsive)==null?void 0:y.call(e,l.className,`${n}-submit`))??e.parseClassName(l.className):{},P=!!l.className&&/(^|\s)bg-[^\s]+/.test(l.className),S=!!l.className&&/(^|\s)text-[^\s]+/.test(l.className),A={...p,...b,...!P&&{backgroundColor:e.cfg.colors.primary},...!S&&{color:"#fff",border:"none"}},E=`${n}-submit`,w=!!((x=e.buttonLoading)!=null&&x[E]),T=()=>{var j,K,U,z,Y;const F=[],D=e.sceneData||{};for(const G of s){const X=G.name||((j=G.label)==null?void 0:j.toLowerCase()),lt=D[X],H=G.label||X;if(G.required&&(lt==null||String(lt).trim()==="")){F.push(`${H} is required`);continue}lt==null||String(lt).trim()===""||((K=G.validation)!=null&&K.pattern&&!new RegExp(G.validation.pattern).test(String(lt))&&F.push(`${H} is invalid`),((U=G.validation)==null?void 0:U.min)!==void 0&&Number(lt)<Number(G.validation.min)&&F.push(`${H} must be at least ${G.validation.min}`),((z=G.validation)==null?void 0:z.max)!==void 0&&Number(lt)>Number(G.validation.max)&&F.push(`${H} must be at most ${G.validation.max}`),((Y=G.validation)==null?void 0:Y.minLength)!==void 0&&String(lt).length<Number(G.validation.minLength)&&F.push(`${H} must be at least ${G.validation.minLength} characters`))}return F},O=()=>{var K,U;const F=T();if(F.length){(K=e.showToast)==null||K.call(e,F,"error");return}const D=()=>l.onClick?e.handleButtonClick(l.onClick,{onSuccess:l.onSuccess,onError:l.onError},{optimistic:l.optimistic,feedback:l.feedback,payload:l.payload}):Promise.resolve(),j=e.withLoading?e.withLoading(E,D):D();(U=j==null?void 0:j.catch)==null||U.call(j,()=>{})},I=l.onClick?()=>O():void 0,N=[];w?N.push(V("span",{key:"spinner",className:"bf-btn-spinner",style:{display:"inline-flex",width:"14px",height:"14px",marginRight:"6px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):l.icon&&N.push(V("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(l.icon,l.iconSize||16))),N.push(V("span",{key:"text"},l.text||"Submit")),c.push(V("button",{key:E,type:l.type||"submit",className:l.className,...e.getCommonProps(E,A,l),disabled:w||void 0,onClick:I},...N))}return V("form",{key:n,className:r,...o,style:{...o.style||{},...h>1?{display:"grid",gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,columnGap:"1rem",rowGap:"1.25rem"}:{}},onSubmit:p=>p.preventDefault()},...c)}const rut=v.memo(({api:e,field:t,value:n,onChange:r})=>{v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const i=v.useRef(null),o=(n||"").split(",").filter(Boolean).map(y=>y.trim()),[s,l]=v.useState(""),[c,h]=v.useState(!1),u=y=>{const x=y.target.value;if(x.includes(",")||x.includes(";")){const p=x.split(/[,;]+/).map(b=>b.trim()).filter(Boolean);if(p.length>0){const b=[...new Set([...o,...p])].join(", ");r(b)}l("")}else l(x)},f=y=>{if(y.key==="Enter"||y.key===","||y.key===";"){y.preventDefault();const x=s.trim();x&&(r([...new Set([...o,x])].join(", ")),l(""))}else y.key==="Backspace"&&!s&&o.length>0&&r(o.slice(0,-1).join(", "))},m=()=>{const y=s.trim();y&&(r([...new Set([...o,y])].join(", ")),l(""))};return V("div",{key:"tags",style:{width:"100%",marginBottom:"1rem"}},t.label?V("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,V("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"0.5rem 0.75rem",borderRadius:e.cfg.components.inputRadius||"8px",backgroundColor:e.cfg.colors.surface,border:`1px solid ${c?e.cfg.colors.primary:e.cfg.colors.border}`,cursor:"text",outline:"none",transition:"border-color 0.2s"},onClick:()=>{var y;return(y=i.current)==null?void 0:y.focus()}},...o.map((y,x)=>V("span",{key:x,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",backgroundColor:e.cfg.colors.background,border:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.text,fontSize:"13px",lineHeight:"1.4"}},V("span",null,y),V("button",{type:"button",onMouseDown:p=>{p.preventDefault(),p.stopPropagation(),r(o.filter((b,P)=>P!==x).join(", "))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"0",fontSize:"14px",lineHeight:"1",display:"flex",alignItems:"center",fontFamily:"inherit"}},"×"))),V("input",{ref:i,type:"text",value:s,onChange:u,onKeyDown:f,onFocus:()=>h(!0),onBlur:()=>{h(!1),m()},placeholder:t.placeholder||(o.length>0?"":"Add email..."),style:{flex:1,minWidth:"100px",border:"none",outline:"none",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"14px",fontFamily:"inherit",padding:"2px 0"}})))});function iut(e,t,n){let r=e.interpolateText(t.text||t.content||"");if(!r)return null;!r.includes(`
117
117
  `)&&r.includes("\\n")&&(r=r.replace(/\\n/g,`
118
118
  `));const i=p=>{const b=[],P=/(\*\*(.+?)\*\*)|(\*(.+?)\*)|(`(.+?)`)|(\[(.+?)\]\((.+?)\))|(~~(.+?)~~)/g;let S=0,A;for(;(A=P.exec(p))!==null;)A.index>S&&b.push(p.slice(S,A.index)),A[2]?b.push(V("strong",{key:b.length},A[2])):A[4]?b.push(V("em",{key:b.length},A[4])):A[6]?b.push(V("code",{key:b.length},A[6])):A[8]?b.push(V("a",{key:b.length,href:A[9],target:"_blank",rel:"noopener noreferrer"},A[8])):A[11]&&b.push(V("del",{key:b.length},A[11])),S=A.index+A[0].length;return S<p.length&&b.push(p.slice(S)),b},o=r.split(`
119
119
  `),s=[];let l=null,c=!1,h=[];const u=p=>{l&&(s.push(v.createElement(l.type,{key:p,style:{paddingLeft:"1.5rem",margin:"0.5rem 0",listStyleType:l.type==="ul"?"disc":"decimal"}},l.items.map((b,P)=>V("li",{key:`${p}-${P}`},b)))),l=null)},f=p=>{if(h.length===0)return;const b=h.join(`
120
120
  `);s.push(V("div",{key:p,style:{position:"relative",background:"#1e1e2e",borderRadius:"8px",margin:"0.5rem 0"}},V("button",{style:{position:"absolute",top:"8px",right:"8px",background:"transparent",border:"none",color:"#666",cursor:"pointer",padding:"4px",borderRadius:"4px",lineHeight:"1",zIndex:1,display:"inline-flex",alignItems:"center",fontSize:"14px"},onClick:P=>{P.preventDefault(),P.stopPropagation(),(A=>{navigator.clipboard.writeText(A).catch(()=>{const E=document.createElement("textarea");E.value=A,E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)})})(b)}},V("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},V("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),V("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),V("pre",{style:{padding:"16px 12px",margin:0,overflow:"auto",fontSize:"13px",lineHeight:"1.5",color:"#e2e8f0"}},V("code",null,b)))),h=[]};for(let p=0;p<o.length;p++){const b=o[p],P=b.trim();if(P.startsWith("```")){c?(f(`code-${p}`),c=!1):(u(`list-${p}`),c=!0,h=[]);continue}if(c){h.push(b);continue}if(!P){u(`list-${p}`);continue}const S=P.match(/^(#{1,3})\s+(.+)/);if(S){u(`list-${p}`);const E=S[1].length,w=`h${E}`,T={1:"1.5em",2:"1.25em",3:"1.1em"}[E];s.push(v.createElement(w,{key:p,style:{margin:"0.75rem 0 0.25rem",fontSize:T,fontWeight:700}},...i(S[2])));continue}if(P.startsWith("- ")||P.startsWith("* ")){const E=P.slice(2);l?l.type!=="ul"&&(u(`list-${p}`),l={type:"ul",items:[]}):l={type:"ul",items:[]},l.items.push(v.createElement(v.Fragment,{},...i(E)));continue}const A=P.match(/^\d+\.\s+(.+)/);if(A){l?l.type!=="ol"&&(u(`list-${p}`),l={type:"ol",items:[]}):l={type:"ol",items:[]},l.items.push(v.createElement(v.Fragment,{},...i(A[1])));continue}u(`list-${p}`),s.push(V("p",{key:p,style:{margin:"0.25rem 0"}},...i(P)))}c&&f("code-end"),u("list-end");const m={};t.fontSize!==void 0&&(m.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(m.fontWeight=t.fontWeight),t.color!==void 0&&(m.color=t.color),t.textAlign!==void 0&&(m.textAlign=t.textAlign);const y=t.className?{...m,...e.parseClassName(t.className)}:m,x=e.getCommonProps(n,y,t);return V("div",{key:n,...x},...s)}function out(e,t,n){const r=e.cfg.colors,i={position:"relative",marginTop:"auto",bottom:0,left:0,right:0,zIndex:40,display:"flex",justifyContent:"space-around",alignItems:"stretch",backgroundColor:r.surfaceHover,borderTop:`1px solid ${r.border}`,padding:"6px 0",boxShadow:"0 -2px 8px rgba(0,0,0,0.08)"},s=(Array.isArray(t.items)?t.items:[]).map((c,h)=>{const u=c.active||!1,f=()=>{const m=()=>e.handleButtonClick(c.onClick||"");(e.withLoading?e.withLoading(`${n}-bn-${h}`,m):m()).catch(()=>{})};return V("button",{key:`${n}-bn-${h}`,onClick:f,style:{background:"none",border:"none",cursor:"pointer",flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:2,padding:"6px 0",color:u?r.primary:r.textMuted,fontSize:11,fontFamily:"inherit"},"aria-label":c.label||c.icon||"nav item"},c.icon?e.renderIcon(c.icon,20):null,c.label?V("span",{},c.label):null)}),l=e.getCommonProps(n,i,t);return V("div",{key:n,...l},...s)}function sut(e,t,n){const r=Array.isArray(t.panes)?t.panes:[],i=t.className?{display:"flex",flexDirection:"row",alignItems:"stretch",...e.parseClassName(t.className)}:{display:"flex",flexDirection:"row",alignItems:"stretch",width:"100%",flex:1,minHeight:0},o=r.map((l,c)=>{const u={width:l.width!==void 0?l.width:c===r.length-1?"1fr":"50%",minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"},f=`${n}-split-${c}`;return V("div",{key:f,style:u},l.component?e.renderComponent(l.component,c,`${n}-split`):null)}),s=e.getCommonProps(n,i,t);return V("div",{key:n,...s},...o)}function aut(e,t,n){const r=e.cfg.colorMode!=="light",i=()=>{var l;return(l=e.setColorMode)==null?void 0:l.call(e,r?"light":"dark")},o=t.className?e.parseClassName(t.className):{background:"none",border:`1px solid ${e.cfg.colors.border}`,borderRadius:8,cursor:"pointer",display:"flex",alignItems:"center",gap:6,padding:"6px 10px",color:e.cfg.colors.text,fontSize:14,fontFamily:"inherit"},s=e.getCommonProps(n,o,t);return V("button",{key:n,...s,onClick:i,"aria-label":r?"Switch to light mode":"Switch to dark mode"},V("span",{},r?"☀️":"🌙"),t.text?V("span",{},t.text):null)}function lut(e){var o;const{api:t,config:n}=e,r=t.interpolateText(n.channel||""),i=t.interpolateText(n.entityId||"");return v.useEffect(()=>{var b;const s=t.sdk;if(!t.isAuthenticated||!((b=s==null?void 0:s.client)!=null&&b.createWebSocket)||!r)return;let l=null,c=null,h=[],u=!1,f=null;const m=()=>{const P=t.interpolateText(n.resolution||"")||"",S=String(P).match(/(\d+)\s*x\s*(\d+)/);return S?{width:Number(S[1]),height:Number(S[2])}:{width:Number(t.interpolateText(n.width))||1280,height:Number(t.interpolateText(n.height))||720}},y=Number(t.interpolateText(n.fps))||10,x=async()=>{var S;if(u)return;u=!0,c&&c.state!=="inactive"&&await new Promise(A=>{c.onstop=()=>A(),c.stop()}),(S=l==null?void 0:l.close)==null||S.call(l);const P=new Blob(h,{type:"video/webm"});if(h=[],P.size!==0)try{const A=t.interpolateText(n.entityId||"")||"cast",E=t.interpolateText(n.fileName||"")||`${n.entityType||"video"}-${A}.webm`,w=new File([P],E,{type:"video/webm"}),T=await s.files.upload(w,{bucket:n.bucket||"backflow-storage",entityType:n.entityType||"video",entityId:A});t.setSceneData(O=>({...O,sessionId:A,[n.assetField||"asset_id"]:T==null?void 0:T.id,_recorded:T})),n.onRecorded&&t.handleButtonClick(String(n.onRecorded),{})}catch(A){fp("[recorder] upload failed:",A)}},p=()=>{if(c)return;const{width:P,height:S}=m(),A=document.createElement("canvas");A.width=P,A.height=S;const E=A.getContext("2d");if(E){f=w=>{const T=new Image;T.onload=()=>E.drawImage(T,0,0,P,S),T.src=w};try{const w=A.captureStream(y);c=new MediaRecorder(w,{mimeType:"video/webm",videoBitsPerSecond:5e6}),c.ondataavailable=T=>{T.data.size&&h.push(T.data)},c.start(500)}catch(w){fp("[recorder] start failed:",w),c=null}}};return l=s.client.createWebSocket(r),l.onmessage=P=>{let S=P==null?void 0:P.data;if(typeof S=="string")try{S=JSON.parse(S)}catch{return}(S==null?void 0:S.type)==="screencast_frame"&&S.frame?(p(),f==null||f(S.frame)):((S==null?void 0:S.status)==="completed"||(S==null?void 0:S.status)==="failed"||(S==null?void 0:S.type)==="workflow_completed"||(S==null?void 0:S.type)==="workflow_failed")&&x()},l.onclose=()=>x(),l.onerror=()=>x(),()=>{var P,S;u=!0,(P=c==null?void 0:c.stop)==null||P.call(c),(S=l==null?void 0:l.close)==null||S.call(l)}},[t.isAuthenticated,r,i,(o=e.config)==null?void 0:o.channel]),null}function cut(e){const{api:t,config:n,componentKey:r}=e,i=t.interpolateText(n.channel||""),o=v.useRef(null),s=v.useRef(null),[l,c]=v.useState(!1);v.useEffect(()=>{const u=()=>c(document.fullscreenElement===o.current);return document.addEventListener("fullscreenchange",u),()=>document.removeEventListener("fullscreenchange",u)},[]);const h=async u=>{var m,y;u.preventDefault(),u.stopPropagation();const f=o.current;if(f){if(document.fullscreenElement){await((m=document.exitFullscreen)==null?void 0:m.call(document));return}await((y=f.requestFullscreen)==null?void 0:y.call(f))}};return v.useEffect(()=>{var p;const u=t.sdk;if(!t.isAuthenticated||!((p=u==null?void 0:u.client)!=null&&p.createWebSocket)||!i)return;let f=null,m=!1;const y=b=>{const P=s.current;if(!P)return;const S=new Image;S.onload=()=>{if(m)return;const A=P.getContext("2d");A&&(P.width=S.width,P.height=S.height,A.drawImage(S,0,0,P.width,P.height))},S.src=b},x=()=>{m||(f=u.client.createWebSocket(i),f.onmessage=b=>{let P=b==null?void 0:b.data;if(typeof P=="string")try{P=JSON.parse(P)}catch{return}(P==null?void 0:P.type)==="screencast_frame"&&P.frame&&y(P.frame)},f.onclose=()=>{m||setTimeout(x,3e3)},f.onerror=()=>{var b;(b=f==null?void 0:f.close)==null||b.call(f)})};return x(),()=>{var b;m=!0,(b=f==null?void 0:f.close)==null||b.call(f)}},[t.isAuthenticated,i,r]),v.createElement("div",{key:r,ref:o,className:"relative w-full h-full bg-black group",style:{width:"100%",height:"100%"}},v.createElement("canvas",{ref:s,className:t.parseClassName(n.className||"w-full h-full object-contain bg-black [aspect-ratio:16/9]"),style:{width:"100%",height:"100%",objectFit:"contain"}}),n.fullscreen===!1?null:v.createElement("button",{type:"button",onClick:h,title:l?"Exit fullscreen":"Open fullscreen","aria-label":l?"Exit fullscreen":"Open fullscreen",className:"absolute top-2 right-2 z-20 inline-flex h-8 w-8 items-center justify-center rounded-full bg-black/55 text-white transition-opacity hover:bg-black/75"},t.renderIcon(l?"minimize-2":"maximize-2",16)))}function uut(e){var n;const t=e.apiUrl||((n=e.sdk)==null?void 0:n.endpoint)||window.location.origin;return`${String(t).replace(/\/+$/,"")}/diagnostics-chat`}function hut({api:e,config:t,componentKey:n}){var S;const[r,i]=v.useState([]),[o,s]=v.useState(""),[l,c]=v.useState(""),[h,u]=v.useState(!1),f=String(e.sceneData.remoteSessionId||"").trim(),m=async A=>{A.preventDefault();const E=o.trim();if(!(!E||h||!f)){i(w=>[...w,{role:"user",content:E},{role:"assistant",content:""}]),s(""),u(!0),c("Inspecting the active UI");try{const w=await fetch(uut(e),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({message:E,remoteSessionId:f})});if(!w.ok){const O=await w.json().catch(()=>null);throw new Error((O==null?void 0:O.error)||"Could not reach the diagnostic agent")}const T=await w.json();if(typeof(T==null?void 0:T.message)!="string")throw new Error("The diagnostic agent returned an invalid response");i(O=>{const I=[...O];return I[I.length-1]={role:"assistant",content:T.message},I})}catch(w){i(T=>{const O=[...T],I=O.length-1;return O[I]={role:"assistant",content:w.message},O})}finally{u(!1),c("")}}},y=t.className?((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.className,n))||e.parseClassName(t.className):{},x=e.getCommonProps(n,y,t),p=e.cfg.colors.surface,b=e.cfg.colors.text,P=e.cfg.colors.textMuted;return v.createElement("section",{...x,style:{...x.style,...y,display:"flex",flexDirection:"column",gap:"12px"}},v.createElement("div",{style:{minHeight:"180px",maxHeight:"380px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"10px"}},r.length===0?v.createElement("span",{style:{color:P,fontSize:"13px"}},"Ask about a UI error, render issue, or unexpected request."):r.map((A,E)=>v.createElement("div",{key:`${A.role}-${E}`,style:{alignSelf:A.role==="user"?"flex-end":"stretch",maxWidth:A.role==="user"?"84%":"100%",padding:"10px 12px",borderRadius:"8px",background:A.role==="user"?e.cfg.colors.primary:p,color:b,whiteSpace:"pre-wrap",fontSize:"13px",lineHeight:1.5}},A.content||l||"Working..."))),f?null:v.createElement("span",{style:{color:e.cfg.colors.warning,fontSize:"12px"}},"A live remote UI session is required."),v.createElement("form",{onSubmit:m,style:{display:"flex",gap:"8px",alignItems:"flex-end"}},v.createElement("textarea",{value:o,disabled:h||!f,onChange:A=>s(A.target.value),placeholder:t.placeholder||"Ask the diagnostic agent",rows:3,style:{flex:1,resize:"vertical",minHeight:"72px",padding:"10px 12px",borderRadius:"8px",border:`1px solid ${e.cfg.colors.borderSubtle}`,background:p,color:b}}),v.createElement("button",{type:"submit",disabled:h||!o.trim()||!f,"aria-label":"Send diagnostic question",style:{width:"40px",height:"40px",border:"none",borderRadius:"8px",background:e.cfg.colors.primary,color:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.renderIcon("send",16))))}function B$(e,t){const n=v.useRef(t);v.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}function z$(e,t,n){t.center!==n.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==n.radius&&e.setRadius(t.radius)}const fut=1;function dut(e){return Object.freeze({__version:fut,map:e})}function vm(e,t){return Object.freeze({...e,...t})}const F$=v.createContext(null),W$=F$.Provider;function bm(){const e=v.useContext(F$);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function put(e){function t(n,r){const{instance:i,context:o}=e(n).current;return v.useImperativeHandle(r,()=>i),n.children==null?null:v.createElement(W$,{value:o},n.children)}return v.forwardRef(t)}function mut(e){function t(n,r){const[i,o]=v.useState(!1),{instance:s}=e(n,o).current;v.useImperativeHandle(r,()=>s),v.useEffect(function(){i&&s.update()},[s,i,n.children]);const l=s._contentNode;return l?cb.createPortal(n.children,l):null}return v.forwardRef(t)}function gut(e){function t(n,r){const{instance:i}=e(n).current;return v.useImperativeHandle(r,()=>i),null}return v.forwardRef(t)}function xx(e,t){const n=v.useRef();v.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function xm(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function yut(e,t){return function(r,i){const o=bm(),s=e(xm(r,o),o);return B$(o.map,r.attribution),xx(s.current,r.eventHandlers),t(s.current,o,r,i),s}}var ib={exports:{}};/* @preserve
121
121
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
122
122
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
123
- */(function(e,t){(function(n,r){r(t)})(iu,function(n){var r="1.9.4";function i(a){var d,g,_,C;for(g=1,_=arguments.length;g<_;g++){C=arguments[g];for(d in C)a[d]=C[d]}return a}var o=Object.create||function(){function a(){}return function(d){return a.prototype=d,new a}}();function s(a,d){var g=Array.prototype.slice;if(a.bind)return a.bind.apply(a,g.call(arguments,1));var _=g.call(arguments,2);return function(){return a.apply(d,_.length?_.concat(g.call(arguments)):arguments)}}var l=0;function c(a){return"_leaflet_id"in a||(a._leaflet_id=++l),a._leaflet_id}function h(a,d,g){var _,C,R,q;return q=function(){_=!1,C&&(R.apply(g,C),C=!1)},R=function(){_?C=arguments:(a.apply(g,arguments),setTimeout(q,d),_=!0)},R}function u(a,d,g){var _=d[1],C=d[0],R=_-C;return a===_&&g?a:((a-C)%R+R)%R+C}function f(){return!1}function m(a,d){if(d===!1)return a;var g=Math.pow(10,d===void 0?6:d);return Math.round(a*g)/g}function y(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function x(a){return y(a).split(/\s+/)}function p(a,d){Object.prototype.hasOwnProperty.call(a,"options")||(a.options=a.options?o(a.options):{});for(var g in d)a.options[g]=d[g];return a.options}function b(a,d,g){var _=[];for(var C in a)_.push(encodeURIComponent(g?C.toUpperCase():C)+"="+encodeURIComponent(a[C]));return(!d||d.indexOf("?")===-1?"?":"&")+_.join("&")}var P=/\{ *([\w_ -]+) *\}/g;function S(a,d){return a.replace(P,function(g,_){var C=d[_];if(C===void 0)throw new Error("No value provided for variable "+g);return typeof C=="function"&&(C=C(d)),C})}var A=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};function E(a,d){for(var g=0;g<a.length;g++)if(a[g]===d)return g;return-1}var w="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function T(a){return window["webkit"+a]||window["moz"+a]||window["ms"+a]}var O=0;function I(a){var d=+new Date,g=Math.max(0,16-(d-O));return O=d+g,window.setTimeout(a,g)}var N=window.requestAnimationFrame||T("RequestAnimationFrame")||I,F=window.cancelAnimationFrame||T("CancelAnimationFrame")||T("CancelRequestAnimationFrame")||function(a){window.clearTimeout(a)};function D(a,d,g){if(g&&N===I)a.call(d);else return N.call(window,s(a,d))}function j(a){a&&F.call(window,a)}var K={__proto__:null,extend:i,create:o,bind:s,get lastId(){return l},stamp:c,throttle:h,wrapNum:u,falseFn:f,formatNum:m,trim:y,splitWords:x,setOptions:p,getParamString:b,template:S,isArray:A,indexOf:E,emptyImageUrl:w,requestFn:N,cancelFn:F,requestAnimFrame:D,cancelAnimFrame:j};function U(){}U.extend=function(a){var d=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},g=d.__super__=this.prototype,_=o(g);_.constructor=d,d.prototype=_;for(var C in this)Object.prototype.hasOwnProperty.call(this,C)&&C!=="prototype"&&C!=="__super__"&&(d[C]=this[C]);return a.statics&&i(d,a.statics),a.includes&&(z(a.includes),i.apply(null,[_].concat(a.includes))),i(_,a),delete _.statics,delete _.includes,_.options&&(_.options=g.options?o(g.options):{},i(_.options,a.options)),_._initHooks=[],_.callInitHooks=function(){if(!this._initHooksCalled){g.callInitHooks&&g.callInitHooks.call(this),this._initHooksCalled=!0;for(var R=0,q=_._initHooks.length;R<q;R++)_._initHooks[R].call(this)}},d},U.include=function(a){var d=this.prototype.options;return i(this.prototype,a),a.options&&(this.prototype.options=d,this.mergeOptions(a.options)),this},U.mergeOptions=function(a){return i(this.prototype.options,a),this},U.addInitHook=function(a){var d=Array.prototype.slice.call(arguments,1),g=typeof a=="function"?a:function(){this[a].apply(this,d)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(g),this};function z(a){if(!(typeof L>"u"||!L||!L.Mixin)){a=A(a)?a:[a];for(var d=0;d<a.length;d++)a[d]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Y={on:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d);else{a=x(a);for(var C=0,R=a.length;C<R;C++)this._on(a[C],d,g)}return this},off:function(a,d,g){if(!arguments.length)delete this._events;else if(typeof a=="object")for(var _ in a)this._off(_,a[_],d);else{a=x(a);for(var C=arguments.length===1,R=0,q=a.length;R<q;R++)C?this._off(a[R]):this._off(a[R],d,g)}return this},_on:function(a,d,g,_){if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}if(this._listens(a,d,g)===!1){g===this&&(g=void 0);var C={fn:d,ctx:g};_&&(C.once=!0),this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(C)}},_off:function(a,d,g){var _,C,R;if(this._events&&(_=this._events[a],!!_)){if(arguments.length===1){if(this._firingCount)for(C=0,R=_.length;C<R;C++)_[C].fn=f;delete this._events[a];return}if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}var q=this._listens(a,d,g);if(q!==!1){var rt=_[q];this._firingCount&&(rt.fn=f,this._events[a]=_=_.slice()),_.splice(q,1)}}},fire:function(a,d,g){if(!this.listens(a,g))return this;var _=i({},d,{type:a,target:this,sourceTarget:d&&d.sourceTarget||this});if(this._events){var C=this._events[a];if(C){this._firingCount=this._firingCount+1||1;for(var R=0,q=C.length;R<q;R++){var rt=C[R],ot=rt.fn;rt.once&&this.off(a,ot,rt.ctx),ot.call(rt.ctx||this,_)}this._firingCount--}}return g&&this._propagateEvent(_),this},listens:function(a,d,g,_){typeof a!="string"&&console.warn('"string" type argument expected');var C=d;typeof d!="function"&&(_=!!d,C=void 0,g=void 0);var R=this._events&&this._events[a];if(R&&R.length&&this._listens(a,C,g)!==!1)return!0;if(_){for(var q in this._eventParents)if(this._eventParents[q].listens(a,d,g,_))return!0}return!1},_listens:function(a,d,g){if(!this._events)return!1;var _=this._events[a]||[];if(!d)return!!_.length;g===this&&(g=void 0);for(var C=0,R=_.length;C<R;C++)if(_[C].fn===d&&_[C].ctx===g)return C;return!1},once:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d,!0);else{a=x(a);for(var C=0,R=a.length;C<R;C++)this._on(a[C],d,g,!0)}return this},addEventParent:function(a){return this._eventParents=this._eventParents||{},this._eventParents[c(a)]=a,this},removeEventParent:function(a){return this._eventParents&&delete this._eventParents[c(a)],this},_propagateEvent:function(a){for(var d in this._eventParents)this._eventParents[d].fire(a.type,i({layer:a.target,propagatedFrom:a.target},a),!0)}};Y.addEventListener=Y.on,Y.removeEventListener=Y.clearAllEventListeners=Y.off,Y.addOneTimeEventListener=Y.once,Y.fireEvent=Y.fire,Y.hasEventListeners=Y.listens;var G=U.extend(Y);function X(a,d,g){this.x=g?Math.round(a):a,this.y=g?Math.round(d):d}var lt=Math.trunc||function(a){return a>0?Math.floor(a):Math.ceil(a)};X.prototype={clone:function(){return new X(this.x,this.y)},add:function(a){return this.clone()._add(H(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(H(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},scaleBy:function(a){return new X(this.x*a.x,this.y*a.y)},unscaleBy:function(a){return new X(this.x/a.x,this.y/a.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=lt(this.x),this.y=lt(this.y),this},distanceTo:function(a){a=H(a);var d=a.x-this.x,g=a.y-this.y;return Math.sqrt(d*d+g*g)},equals:function(a){return a=H(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=H(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function H(a,d,g){return a instanceof X?a:A(a)?new X(a[0],a[1]):a==null?a:typeof a=="object"&&"x"in a&&"y"in a?new X(a.x,a.y):new X(a,d,g)}function et(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}et.prototype={extend:function(a){var d,g;if(!a)return this;if(a instanceof X||typeof a[0]=="number"||"x"in a)d=g=H(a);else if(a=it(a),d=a.min,g=a.max,!d||!g)return this;return!this.min&&!this.max?(this.min=d.clone(),this.max=g.clone()):(this.min.x=Math.min(d.x,this.min.x),this.max.x=Math.max(g.x,this.max.x),this.min.y=Math.min(d.y,this.min.y),this.max.y=Math.max(g.y,this.max.y)),this},getCenter:function(a){return H((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return H(this.min.x,this.max.y)},getTopRight:function(){return H(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var d,g;return typeof a[0]=="number"||a instanceof X?a=H(a):a=it(a),a instanceof et?(d=a.min,g=a.max):d=g=a,d.x>=this.min.x&&g.x<=this.max.x&&d.y>=this.min.y&&g.y<=this.max.y},intersects:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,R=C.x>=d.x&&_.x<=g.x,q=C.y>=d.y&&_.y<=g.y;return R&&q},overlaps:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,R=C.x>d.x&&_.x<g.x,q=C.y>d.y&&_.y<g.y;return R&&q},isValid:function(){return!!(this.min&&this.max)},pad:function(a){var d=this.min,g=this.max,_=Math.abs(d.x-g.x)*a,C=Math.abs(d.y-g.y)*a;return it(H(d.x-_,d.y-C),H(g.x+_,g.y+C))},equals:function(a){return a?(a=it(a),this.min.equals(a.getTopLeft())&&this.max.equals(a.getBottomRight())):!1}};function it(a,d){return!a||a instanceof et?a:new et(a,d)}function st(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}st.prototype={extend:function(a){var d=this._southWest,g=this._northEast,_,C;if(a instanceof yt)_=a,C=a;else if(a instanceof st){if(_=a._southWest,C=a._northEast,!_||!C)return this}else return a?this.extend(vt(a)||ct(a)):this;return!d&&!g?(this._southWest=new yt(_.lat,_.lng),this._northEast=new yt(C.lat,C.lng)):(d.lat=Math.min(_.lat,d.lat),d.lng=Math.min(_.lng,d.lng),g.lat=Math.max(C.lat,g.lat),g.lng=Math.max(C.lng,g.lng)),this},pad:function(a){var d=this._southWest,g=this._northEast,_=Math.abs(d.lat-g.lat)*a,C=Math.abs(d.lng-g.lng)*a;return new st(new yt(d.lat-_,d.lng-C),new yt(g.lat+_,g.lng+C))},getCenter:function(){return new yt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new yt(this.getNorth(),this.getWest())},getSouthEast:function(){return new yt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){typeof a[0]=="number"||a instanceof yt||"lat"in a?a=vt(a):a=ct(a);var d=this._southWest,g=this._northEast,_,C;return a instanceof st?(_=a.getSouthWest(),C=a.getNorthEast()):_=C=a,_.lat>=d.lat&&C.lat<=g.lat&&_.lng>=d.lng&&C.lng<=g.lng},intersects:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),R=C.lat>=d.lat&&_.lat<=g.lat,q=C.lng>=d.lng&&_.lng<=g.lng;return R&&q},overlaps:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),R=C.lat>d.lat&&_.lat<g.lat,q=C.lng>d.lng&&_.lng<g.lng;return R&&q},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a,d){return a?(a=ct(a),this._southWest.equals(a.getSouthWest(),d)&&this._northEast.equals(a.getNorthEast(),d)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ct(a,d){return a instanceof st?a:new st(a,d)}function yt(a,d,g){if(isNaN(a)||isNaN(d))throw new Error("Invalid LatLng object: ("+a+", "+d+")");this.lat=+a,this.lng=+d,g!==void 0&&(this.alt=+g)}yt.prototype={equals:function(a,d){if(!a)return!1;a=vt(a);var g=Math.max(Math.abs(this.lat-a.lat),Math.abs(this.lng-a.lng));return g<=(d===void 0?1e-9:d)},toString:function(a){return"LatLng("+m(this.lat,a)+", "+m(this.lng,a)+")"},distanceTo:function(a){return Tt.distance(this,vt(a))},wrap:function(){return Tt.wrapLatLng(this)},toBounds:function(a){var d=180*a/40075017,g=d/Math.cos(Math.PI/180*this.lat);return ct([this.lat-d,this.lng-g],[this.lat+d,this.lng+g])},clone:function(){return new yt(this.lat,this.lng,this.alt)}};function vt(a,d,g){return a instanceof yt?a:A(a)&&typeof a[0]!="object"?a.length===3?new yt(a[0],a[1],a[2]):a.length===2?new yt(a[0],a[1]):null:a==null?a:typeof a=="object"&&"lat"in a?new yt(a.lat,"lng"in a?a.lng:a.lon,a.alt):d===void 0?null:new yt(a,d,g)}var Et={latLngToPoint:function(a,d){var g=this.projection.project(a),_=this.scale(d);return this.transformation._transform(g,_)},pointToLatLng:function(a,d){var g=this.scale(d),_=this.transformation.untransform(a,g);return this.projection.unproject(_)},project:function(a){return this.projection.project(a)},unproject:function(a){return this.projection.unproject(a)},scale:function(a){return 256*Math.pow(2,a)},zoom:function(a){return Math.log(a/256)/Math.LN2},getProjectedBounds:function(a){if(this.infinite)return null;var d=this.projection.bounds,g=this.scale(a),_=this.transformation.transform(d.min,g),C=this.transformation.transform(d.max,g);return new et(_,C)},infinite:!1,wrapLatLng:function(a){var d=this.wrapLng?u(a.lng,this.wrapLng,!0):a.lng,g=this.wrapLat?u(a.lat,this.wrapLat,!0):a.lat,_=a.alt;return new yt(g,d,_)},wrapLatLngBounds:function(a){var d=a.getCenter(),g=this.wrapLatLng(d),_=d.lat-g.lat,C=d.lng-g.lng;if(_===0&&C===0)return a;var R=a.getSouthWest(),q=a.getNorthEast(),rt=new yt(R.lat-_,R.lng-C),ot=new yt(q.lat-_,q.lng-C);return new st(rt,ot)}},Tt=i({},Et,{wrapLng:[-180,180],R:6371e3,distance:function(a,d){var g=Math.PI/180,_=a.lat*g,C=d.lat*g,R=Math.sin((d.lat-a.lat)*g/2),q=Math.sin((d.lng-a.lng)*g/2),rt=R*R+Math.cos(_)*Math.cos(C)*q*q,ot=2*Math.atan2(Math.sqrt(rt),Math.sqrt(1-rt));return this.R*ot}}),ft=6378137,dt={R:ft,MAX_LATITUDE:85.0511287798,project:function(a){var d=Math.PI/180,g=this.MAX_LATITUDE,_=Math.max(Math.min(g,a.lat),-g),C=Math.sin(_*d);return new X(this.R*a.lng*d,this.R*Math.log((1+C)/(1-C))/2)},unproject:function(a){var d=180/Math.PI;return new yt((2*Math.atan(Math.exp(a.y/this.R))-Math.PI/2)*d,a.x*d/this.R)},bounds:function(){var a=ft*Math.PI;return new et([-a,-a],[a,a])}()};function Ct(a,d,g,_){if(A(a)){this._a=a[0],this._b=a[1],this._c=a[2],this._d=a[3];return}this._a=a,this._b=d,this._c=g,this._d=_}Ct.prototype={transform:function(a,d){return this._transform(a.clone(),d)},_transform:function(a,d){return d=d||1,a.x=d*(this._a*a.x+this._b),a.y=d*(this._c*a.y+this._d),a},untransform:function(a,d){return d=d||1,new X((a.x/d-this._b)/this._a,(a.y/d-this._d)/this._c)}};function nt(a,d,g,_){return new Ct(a,d,g,_)}var Lt=i({},Tt,{code:"EPSG:3857",projection:dt,transformation:function(){var a=.5/(Math.PI*dt.R);return nt(a,.5,-a,.5)}()}),bt=i({},Lt,{code:"EPSG:900913"});function me(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function ie(a,d){var g="",_,C,R,q,rt,ot;for(_=0,R=a.length;_<R;_++){for(rt=a[_],C=0,q=rt.length;C<q;C++)ot=rt[C],g+=(C?"L":"M")+ot.x+" "+ot.y;g+=d?It.svg?"z":"x":""}return g||"M0 0"}var Xt=document.documentElement.style,Ne="ActiveXObject"in window,Wt=Ne&&!document.addEventListener,ee="msLaunchUri"in navigator&&!("documentMode"in document),ne=Cn("webkit"),Yt=Cn("android"),oe=Cn("android 2")||Cn("android 3"),Me=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),se=Yt&&Cn("Google")&&Me<537&&!("AudioNode"in window),on=!!window.opera,en=!ee&&Cn("chrome"),Ke=Cn("gecko")&&!ne&&!on&&!Ne,xo=!en&&Cn("safari"),ln=Cn("phantom"),kt="OTransition"in Xt,Nn=navigator.platform.indexOf("Win")===0,We=Ne&&"transition"in Xt,Ti="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!oe,wo="MozPerspective"in Xt,_o=!window.L_DISABLE_3D&&(We||Ti||wo)&&!kt&&!ln,de=typeof orientation<"u"||Cn("mobile"),ae=de&&ne,Ei=de&&Ti,Ci=!window.PointerEvent&&window.MSPointerEvent,Tr=!!(window.PointerEvent||Ci),Oi="ontouchstart"in window||!!window.TouchEvent,ds=!window.L_NO_TOUCH&&(Oi||Tr),Mi=de&&on,ii=de&&Ke,ki=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Vr=function(){var a=!1;try{var d=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("testPassiveEventSupport",f,d),window.removeEventListener("testPassiveEventSupport",f,d)}catch{}return a}(),So=function(){return!!document.createElement("canvas").getContext}(),$i=!!(document.createElementNS&&me("svg").createSVGRect),Ii=!!$i&&function(){var a=document.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Er=!$i&&function(){try{var a=document.createElement("div");a.innerHTML='<v:shape adj="1"/>';var d=a.firstChild;return d.style.behavior="url(#default#VML)",d&&typeof d.adj=="object"}catch{return!1}}(),Ri=navigator.platform.indexOf("Mac")===0,Li=navigator.platform.indexOf("Linux")===0;function Cn(a){return navigator.userAgent.toLowerCase().indexOf(a)>=0}var It={ie:Ne,ielt9:Wt,edge:ee,webkit:ne,android:Yt,android23:oe,androidStock:se,opera:on,chrome:en,gecko:Ke,safari:xo,phantom:ln,opera12:kt,win:Nn,ie3d:We,webkit3d:Ti,gecko3d:wo,any3d:_o,mobile:de,mobileWebkit:ae,mobileWebkit3d:Ei,msPointer:Ci,pointer:Tr,touch:ds,touchNative:Oi,mobileOpera:Mi,mobileGecko:ii,retina:ki,passiveEvents:Vr,canvas:So,svg:$i,vml:Er,inlineSvg:Ii,mac:Ri,linux:Li},Po=It.msPointer?"MSPointerDown":"pointerdown",On=It.msPointer?"MSPointerMove":"pointermove",Ni=It.msPointer?"MSPointerUp":"pointerup",Ao=It.msPointer?"MSPointerCancel":"pointercancel",oi={touchstart:Po,touchmove:On,touchend:Ni,touchcancel:Ao},ji={touchstart:cn,touchmove:Te,touchend:Te,touchcancel:Te},ur={},Di=!1;function ps(a,d,g){return d==="touchstart"&&ys(),ji[d]?(g=ji[d].bind(this,g),a.addEventListener(oi[d],g,!1),g):(console.warn("wrong event specified:",d),f)}function Ur(a,d,g){if(!oi[d]){console.warn("wrong event specified:",d);return}a.removeEventListener(oi[d],g,!1)}function To(a){ur[a.pointerId]=a}function ms(a){ur[a.pointerId]&&(ur[a.pointerId]=a)}function gs(a){delete ur[a.pointerId]}function ys(){Di||(document.addEventListener(Po,To,!0),document.addEventListener(On,ms,!0),document.addEventListener(Ni,gs,!0),document.addEventListener(Ao,gs,!0),Di=!0)}function Te(a,d){if(d.pointerType!==(d.MSPOINTER_TYPE_MOUSE||"mouse")){d.touches=[];for(var g in ur)d.touches.push(ur[g]);d.changedTouches=[d],a(d)}}function cn(a,d){d.MSPOINTER_TYPE_TOUCH&&d.pointerType===d.MSPOINTER_TYPE_TOUCH&&hn(d),Te(a,d)}function Ea(a){var d={},g,_;for(_ in a)g=a[_],d[_]=g&&g.bind?g.bind(a):g;return a=d,d.type="dblclick",d.detail=2,d.isTrusted=!1,d._simulated=!0,d}var vs=200;function bs(a,d){a.addEventListener("dblclick",d);var g=0,_;function C(R){if(R.detail!==1){_=R.detail;return}if(!(R.pointerType==="mouse"||R.sourceCapabilities&&!R.sourceCapabilities.firesTouchEvents)){var q=Ma(R);if(!(q.some(function(ot){return ot instanceof HTMLLabelElement&&ot.attributes.for})&&!q.some(function(ot){return ot instanceof HTMLInputElement||ot instanceof HTMLSelectElement}))){var rt=Date.now();rt-g<=vs?(_++,_===2&&d(Ea(R))):_=1,g=rt}}}return a.addEventListener("click",C),{dblclick:d,simDblclick:C}}function Bi(a,d){a.removeEventListener("dblclick",d.dblclick),a.removeEventListener("click",d.simDblclick)}var Sn=un(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Xn=un(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Eo=Xn==="webkitTransition"||Xn==="OTransition"?Xn+"End":"transitionend";function si(a){return typeof a=="string"?document.getElementById(a):a}function Mn(a,d){var g=a.style[d]||a.currentStyle&&a.currentStyle[d];if((!g||g==="auto")&&document.defaultView){var _=document.defaultView.getComputedStyle(a,null);g=_?_[d]:null}return g==="auto"?null:g}function re(a,d,g){var _=document.createElement(a);return _.className=d||"",g&&g.appendChild(_),_}function Kt(a){var d=a.parentNode;d&&d.removeChild(a)}function hr(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function be(a){var d=a.parentNode;d&&d.lastChild!==a&&d.appendChild(a)}function St(a){var d=a.parentNode;d&&d.firstChild!==a&&d.insertBefore(a,d.firstChild)}function xe(a,d){if(a.classList!==void 0)return a.classList.contains(d);var g=zi(a);return g.length>0&&new RegExp("(^|\\s)"+d+"(\\s|$)").test(g)}function Rt(a,d){if(a.classList!==void 0)for(var g=x(d),_=0,C=g.length;_<C;_++)a.classList.add(g[_]);else if(!xe(a,d)){var R=zi(a);xs(a,(R?R+" ":"")+d)}}function le(a,d){a.classList!==void 0?a.classList.remove(d):xs(a,y((" "+zi(a)+" ").replace(" "+d+" "," ")))}function xs(a,d){a.className.baseVal===void 0?a.className=d:a.className.baseVal=d}function zi(a){return a.correspondingElement&&(a=a.correspondingElement),a.className.baseVal===void 0?a.className:a.className.baseVal}function kn(a,d){"opacity"in a.style?a.style.opacity=d:"filter"in a.style&&ai(a,d)}function ai(a,d){var g=!1,_="DXImageTransform.Microsoft.Alpha";try{g=a.filters.item(_)}catch{if(d===1)return}d=Math.round(d*100),g?(g.Enabled=d!==100,g.Opacity=d):a.style.filter+=" progid:"+_+"(opacity="+d+")"}function un(a){for(var d=document.documentElement.style,g=0;g<a.length;g++)if(a[g]in d)return a[g];return!1}function Ge(a,d,g){var _=d||new X(0,0);a.style[Sn]=(It.ie3d?"translate("+_.x+"px,"+_.y+"px)":"translate3d("+_.x+"px,"+_.y+"px,0)")+(g?" scale("+g+")":"")}function Ie(a,d){a._leaflet_pos=d,It.any3d?Ge(a,d):(a.style.left=d.x+"px",a.style.top=d.y+"px")}function Ee(a){return a._leaflet_pos||new X(0,0)}var ws,Hr,Fi;if("onselectstart"in document)ws=function(){Ft(window,"selectstart",hn)},Hr=function(){Ce(window,"selectstart",hn)};else{var _s=un(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ws=function(){if(_s){var a=document.documentElement.style;Fi=a[_s],a[_s]="none"}},Hr=function(){_s&&(document.documentElement.style[_s]=Fi,Fi=void 0)}}function Cr(){Ft(window,"dragstart",hn)}function Co(){Ce(window,"dragstart",hn)}var Wi,bc;function ce(a){for(;a.tabIndex===-1;)a=a.parentNode;a.style&&(Ss(),Wi=a,bc=a.style.outlineStyle,a.style.outlineStyle="none",Ft(window,"keydown",Ss))}function Ss(){Wi&&(Wi.style.outlineStyle=bc,Wi=void 0,bc=void 0,Ce(window,"keydown",Ss))}function kh(a){do a=a.parentNode;while((!a.offsetWidth||!a.offsetHeight)&&a!==document.body);return a}function Oo(a){var d=a.getBoundingClientRect();return{x:d.width/a.offsetWidth||1,y:d.height/a.offsetHeight||1,boundingClientRect:d}}var _m={__proto__:null,TRANSFORM:Sn,TRANSITION:Xn,TRANSITION_END:Eo,get:si,getStyle:Mn,create:re,remove:Kt,empty:hr,toFront:be,toBack:St,hasClass:xe,addClass:Rt,removeClass:le,setClass:xs,getClass:zi,setOpacity:kn,testProp:un,setTransform:Ge,setPosition:Ie,getPosition:Ee,get disableTextSelection(){return ws},get enableTextSelection(){return Hr},disableImageDrag:Cr,enableImageDrag:Co,preventOutline:ce,restoreOutline:Ss,getSizedParentNode:kh,getScale:Oo};function Ft(a,d,g,_){if(d&&typeof d=="object")for(var C in d)Ca(a,C,d[C],g);else{d=x(d);for(var R=0,q=d.length;R<q;R++)Ca(a,d[R],g,_)}return this}var ge="_leaflet_events";function Ce(a,d,g,_){if(arguments.length===1)xc(a),delete a[ge];else if(d&&typeof d=="object")for(var C in d)Oa(a,C,d[C],g);else if(d=x(d),arguments.length===2)xc(a,function(rt){return E(d,rt)!==-1});else for(var R=0,q=d.length;R<q;R++)Oa(a,d[R],g,_);return this}function xc(a,d){for(var g in a[ge]){var _=g.split(/\d/)[0];(!d||d(_))&&Oa(a,_,null,null,g)}}var qr={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ca(a,d,g,_){var C=d+c(g)+(_?"_"+c(_):"");if(a[ge]&&a[ge][C])return this;var R=function(rt){return g.call(_||a,rt||window.event)},q=R;!It.touchNative&&It.pointer&&d.indexOf("touch")===0?R=ps(a,d,R):It.touch&&d==="dblclick"?R=bs(a,R):"addEventListener"in a?d==="touchstart"||d==="touchmove"||d==="wheel"||d==="mousewheel"?a.addEventListener(qr[d]||d,R,It.passiveEvents?{passive:!1}:!1):d==="mouseenter"||d==="mouseleave"?(R=function(rt){rt=rt||window.event,Ps(a,rt)&&q(rt)},a.addEventListener(qr[d],R,!1)):a.addEventListener(d,q,!1):a.attachEvent("on"+d,R),a[ge]=a[ge]||{},a[ge][C]=R}function Oa(a,d,g,_,C){C=C||d+c(g)+(_?"_"+c(_):"");var R=a[ge]&&a[ge][C];if(!R)return this;!It.touchNative&&It.pointer&&d.indexOf("touch")===0?Ur(a,d,R):It.touch&&d==="dblclick"?Bi(a,R):"removeEventListener"in a?a.removeEventListener(qr[d]||d,R,!1):a.detachEvent("on"+d,R),a[ge][C]=null}function Vi(a){return a.stopPropagation?a.stopPropagation():a.originalEvent?a.originalEvent._stopped=!0:a.cancelBubble=!0,this}function li(a){return Ca(a,"wheel",Vi),this}function Ui(a){return Ft(a,"mousedown touchstart dblclick contextmenu",Vi),a._leaflet_disable_click=!0,this}function hn(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this}function jn(a){return hn(a),Vi(a),this}function Ma(a){if(a.composedPath)return a.composedPath();for(var d=[],g=a.target;g;)d.push(g),g=g.parentNode;return d}function Mo(a,d){if(!d)return new X(a.clientX,a.clientY);var g=Oo(d),_=g.boundingClientRect;return new X((a.clientX-_.left)/g.x-d.clientLeft,(a.clientY-_.top)/g.y-d.clientTop)}var Dn=It.linux&&It.chrome?window.devicePixelRatio:It.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function fr(a){return It.edge?a.wheelDeltaY/2:a.deltaY&&a.deltaMode===0?-a.deltaY/Dn:a.deltaY&&a.deltaMode===1?-a.deltaY*20:a.deltaY&&a.deltaMode===2?-a.deltaY*60:a.deltaX||a.deltaZ?0:a.wheelDelta?(a.wheelDeltaY||a.wheelDelta)/2:a.detail&&Math.abs(a.detail)<32765?-a.detail*20:a.detail?a.detail/-32765*60:0}function Ps(a,d){var g=d.relatedTarget;if(!g)return!0;try{for(;g&&g!==a;)g=g.parentNode}catch{return!1}return g!==a}var $h={__proto__:null,on:Ft,off:Ce,stopPropagation:Vi,disableScrollPropagation:li,disableClickPropagation:Ui,preventDefault:hn,stop:jn,getPropagationPath:Ma,getMousePosition:Mo,getWheelDelta:fr,isExternalTarget:Ps,addListener:Ft,removeListener:Ce},Or=G.extend({run:function(a,d,g,_){this.stop(),this._el=a,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(_||.5,.2),this._startPos=Ee(a),this._offset=d.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=D(this._animate,this),this._step()},_step:function(a){var d=+new Date-this._startTime,g=this._duration*1e3;d<g?this._runFrame(this._easeOut(d/g),a):(this._runFrame(1),this._complete())},_runFrame:function(a,d){var g=this._startPos.add(this._offset.multiplyBy(a));d&&g._round(),Ie(this._el,g),this.fire("step")},_complete:function(){j(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),pe=G.extend({options:{crs:Lt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(a,d){d=p(this,d),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(a),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),d.maxBounds&&this.setMaxBounds(d.maxBounds),d.zoom!==void 0&&(this._zoom=this._limitZoom(d.zoom)),d.center&&d.zoom!==void 0&&this.setView(vt(d.center),d.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Xn&&It.any3d&&!It.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ft(this._proxy,Eo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(a,d,g){if(d=d===void 0?this._zoom:this._limitZoom(d),a=this._limitCenter(vt(a),d,this.options.maxBounds),g=g||{},this._stop(),this._loaded&&!g.reset&&g!==!0){g.animate!==void 0&&(g.zoom=i({animate:g.animate},g.zoom),g.pan=i({animate:g.animate,duration:g.duration},g.pan));var _=this._zoom!==d?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,d,g.zoom):this._tryAnimatedPan(a,g.pan);if(_)return clearTimeout(this._sizeTimer),this}return this._resetView(a,d,g.pan&&g.pan.noMoveStart),this},setZoom:function(a,d){return this._loaded?this.setView(this.getCenter(),a,{zoom:d}):(this._zoom=a,this)},zoomIn:function(a,d){return a=a||(It.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+a,d)},zoomOut:function(a,d){return a=a||(It.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-a,d)},setZoomAround:function(a,d,g){var _=this.getZoomScale(d),C=this.getSize().divideBy(2),R=a instanceof X?a:this.latLngToContainerPoint(a),q=R.subtract(C).multiplyBy(1-1/_),rt=this.containerPointToLatLng(C.add(q));return this.setView(rt,d,{zoom:g})},_getBoundsCenterZoom:function(a,d){d=d||{},a=a.getBounds?a.getBounds():ct(a);var g=H(d.paddingTopLeft||d.padding||[0,0]),_=H(d.paddingBottomRight||d.padding||[0,0]),C=this.getBoundsZoom(a,!1,g.add(_));if(C=typeof d.maxZoom=="number"?Math.min(d.maxZoom,C):C,C===1/0)return{center:a.getCenter(),zoom:C};var R=_.subtract(g).divideBy(2),q=this.project(a.getSouthWest(),C),rt=this.project(a.getNorthEast(),C),ot=this.unproject(q.add(rt).divideBy(2).add(R),C);return{center:ot,zoom:C}},fitBounds:function(a,d){if(a=ct(a),!a.isValid())throw new Error("Bounds are not valid.");var g=this._getBoundsCenterZoom(a,d);return this.setView(g.center,g.zoom,d)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,d){return this.setView(a,this._zoom,{pan:d})},panBy:function(a,d){if(a=H(a).round(),d=d||{},!a.x&&!a.y)return this.fire("moveend");if(d.animate!==!0&&!this.getSize().contains(a))return this._resetView(this.unproject(this.project(this.getCenter()).add(a)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Or,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),d.noMoveStart||this.fire("movestart"),d.animate!==!1){Rt(this._mapPane,"leaflet-pan-anim");var g=this._getMapPanePos().subtract(a).round();this._panAnim.run(this._mapPane,g,d.duration||.25,d.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},flyTo:function(a,d,g){if(g=g||{},g.animate===!1||!It.any3d)return this.setView(a,d,g);this._stop();var _=this.project(this.getCenter()),C=this.project(a),R=this.getSize(),q=this._zoom;a=vt(a),d=d===void 0?q:d;var rt=Math.max(R.x,R.y),ot=rt*this.getZoomScale(q,d),pt=C.distanceTo(_)||1,Ot=1.42,zt=Ot*Ot;function Nt(Xe){var Wa=Xe?-1:1,jc=Xe?ot:rt,nr=ot*ot-rt*rt+Wa*zt*zt*pt*pt,Jh=2*jc*zt*pt,Va=nr/Jh,Dc=Math.sqrt(Va*Va+1)-Va,Px=Dc<1e-9?-18:Math.log(Dc);return Px}function _t(Xe){return(Math.exp(Xe)-Math.exp(-Xe))/2}function jt(Xe){return(Math.exp(Xe)+Math.exp(-Xe))/2}function Gt(Xe){return _t(Xe)/jt(Xe)}var ue=Nt(0);function Oe(Xe){return rt*(jt(ue)/jt(ue+Ot*Xe))}function Ki(Xe){return rt*(jt(ue)*Gt(ue+Ot*Xe)-_t(ue))/zt}function Hn(Xe){return 1-Math.pow(1-Xe,1.5)}var Ls=Date.now(),er=(Nt(1)-ue)/Ot,kr=g.duration?1e3*g.duration:1e3*er*.8;function Xh(){var Xe=(Date.now()-Ls)/kr,Wa=Hn(Xe)*er;Xe<=1?(this._flyToFrame=D(Xh,this),this._move(this.unproject(_.add(C.subtract(_).multiplyBy(Ki(Wa)/pt)),q),this.getScaleZoom(rt/Oe(Wa),q),{flyTo:!0})):this._move(a,d)._moveEnd(!0)}return this._moveStart(!0,g.noMoveStart),Xh.call(this),this},flyToBounds:function(a,d){var g=this._getBoundsCenterZoom(a,d);return this.flyTo(g.center,g.zoom,d)},setMaxBounds:function(a){return a=ct(a),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),a.isValid()?(this.options.maxBounds=a,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(a){var d=this.options.minZoom;return this.options.minZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(a):this},setMaxZoom:function(a){var d=this.options.maxZoom;return this.options.maxZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(a):this},panInsideBounds:function(a,d){this._enforcingBounds=!0;var g=this.getCenter(),_=this._limitCenter(g,this._zoom,ct(a));return g.equals(_)||this.panTo(_,d),this._enforcingBounds=!1,this},panInside:function(a,d){d=d||{};var g=H(d.paddingTopLeft||d.padding||[0,0]),_=H(d.paddingBottomRight||d.padding||[0,0]),C=this.project(this.getCenter()),R=this.project(a),q=this.getPixelBounds(),rt=it([q.min.add(g),q.max.subtract(_)]),ot=rt.getSize();if(!rt.contains(R)){this._enforcingBounds=!0;var pt=R.subtract(rt.getCenter()),Ot=rt.extend(R).getSize().subtract(ot);C.x+=pt.x<0?-Ot.x:Ot.x,C.y+=pt.y<0?-Ot.y:Ot.y,this.panTo(this.unproject(C),d),this._enforcingBounds=!1}return this},invalidateSize:function(a){if(!this._loaded)return this;a=i({animate:!1,pan:!0},a===!0?{animate:!0}:a);var d=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),_=d.divideBy(2).round(),C=g.divideBy(2).round(),R=_.subtract(C);return!R.x&&!R.y?this:(a.animate&&a.pan?this.panBy(R):(a.pan&&this._rawPanBy(R),this.fire("move"),a.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:d,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(a){if(a=this._locateOptions=i({timeout:1e4,watch:!1},a),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var d=s(this._handleGeolocationResponse,this),g=s(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(d,g,a):navigator.geolocation.getCurrentPosition(d,g,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){if(this._container._leaflet_id){var d=a.code,g=a.message||(d===1?"permission denied":d===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:d,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(a){if(this._container._leaflet_id){var d=a.coords.latitude,g=a.coords.longitude,_=new yt(d,g),C=_.toBounds(a.coords.accuracy*2),R=this._locateOptions;if(R.setView){var q=this.getBoundsZoom(C);this.setView(_,R.maxZoom?Math.min(q,R.maxZoom):q)}var rt={latlng:_,bounds:C,timestamp:a.timestamp};for(var ot in a.coords)typeof a.coords[ot]=="number"&&(rt[ot]=a.coords[ot]);this.fire("locationfound",rt)}},addHandler:function(a,d){if(!d)return this;var g=this[a]=new d(this);return this._handlers.push(g),this.options[a]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Kt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(j(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var a;for(a in this._layers)this._layers[a].remove();for(a in this._panes)Kt(this._panes[a]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(a,d){var g="leaflet-pane"+(a?" leaflet-"+a.replace("Pane","")+"-pane":""),_=re("div",g,d||this._mapPane);return a&&(this._panes[a]=_),_},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var a=this.getPixelBounds(),d=this.unproject(a.getBottomLeft()),g=this.unproject(a.getTopRight());return new st(d,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(a,d,g){a=ct(a),g=H(g||[0,0]);var _=this.getZoom()||0,C=this.getMinZoom(),R=this.getMaxZoom(),q=a.getNorthWest(),rt=a.getSouthEast(),ot=this.getSize().subtract(g),pt=it(this.project(rt,_),this.project(q,_)).getSize(),Ot=It.any3d?this.options.zoomSnap:1,zt=ot.x/pt.x,Nt=ot.y/pt.y,_t=d?Math.max(zt,Nt):Math.min(zt,Nt);return _=this.getScaleZoom(_t,_),Ot&&(_=Math.round(_/(Ot/100))*(Ot/100),_=d?Math.ceil(_/Ot)*Ot:Math.floor(_/Ot)*Ot),Math.max(C,Math.min(R,_))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new X(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(a,d){var g=this._getTopLeftPoint(a,d);return new et(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(a){return this.options.crs.getProjectedBounds(a===void 0?this.getZoom():a)},getPane:function(a){return typeof a=="string"?this._panes[a]:a},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a,d){var g=this.options.crs;return d=d===void 0?this._zoom:d,g.scale(a)/g.scale(d)},getScaleZoom:function(a,d){var g=this.options.crs;d=d===void 0?this._zoom:d;var _=g.zoom(a*g.scale(d));return isNaN(_)?1/0:_},project:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.latLngToPoint(vt(a),d)},unproject:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.pointToLatLng(H(a),d)},layerPointToLatLng:function(a){var d=H(a).add(this.getPixelOrigin());return this.unproject(d)},latLngToLayerPoint:function(a){var d=this.project(vt(a))._round();return d._subtract(this.getPixelOrigin())},wrapLatLng:function(a){return this.options.crs.wrapLatLng(vt(a))},wrapLatLngBounds:function(a){return this.options.crs.wrapLatLngBounds(ct(a))},distance:function(a,d){return this.options.crs.distance(vt(a),vt(d))},containerPointToLayerPoint:function(a){return H(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return H(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var d=this.containerPointToLayerPoint(H(a));return this.layerPointToLatLng(d)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(vt(a)))},mouseEventToContainerPoint:function(a){return Mo(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var d=this._container=si(a);if(d){if(d._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ft(d,"scroll",this._onScroll,this),this._containerId=c(d)},_initLayout:function(){var a=this._container;this._fadeAnimated=this.options.fadeAnimation&&It.any3d,Rt(a,"leaflet-container"+(It.touch?" leaflet-touch":"")+(It.retina?" leaflet-retina":"")+(It.ielt9?" leaflet-oldie":"")+(It.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var d=Mn(a,"position");d!=="absolute"&&d!=="relative"&&d!=="fixed"&&d!=="sticky"&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ie(this._mapPane,new X(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Rt(a.markerPane,"leaflet-zoom-hide"),Rt(a.shadowPane,"leaflet-zoom-hide"))},_resetView:function(a,d,g){Ie(this._mapPane,new X(0,0));var _=!this._loaded;this._loaded=!0,d=this._limitZoom(d),this.fire("viewprereset");var C=this._zoom!==d;this._moveStart(C,g)._move(a,d)._moveEnd(C),this.fire("viewreset"),_&&this.fire("load")},_moveStart:function(a,d){return a&&this.fire("zoomstart"),d||this.fire("movestart"),this},_move:function(a,d,g,_){d===void 0&&(d=this._zoom);var C=this._zoom!==d;return this._zoom=d,this._lastCenter=a,this._pixelOrigin=this._getNewPixelOrigin(a),_?g&&g.pinch&&this.fire("zoom",g):((C||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(a){return a&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return j(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(a){Ie(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(a){this._targets={},this._targets[c(this._container)]=this;var d=a?Ce:Ft;d(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&d(window,"resize",this._onResize,this),It.any3d&&this.options.transform3DLimit&&(a?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){j(this._resizeRequest),this._resizeRequest=D(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var a=this._getMapPanePos();Math.max(Math.abs(a.x),Math.abs(a.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(a,d){for(var g=[],_,C=d==="mouseout"||d==="mouseover",R=a.target||a.srcElement,q=!1;R;){if(_=this._targets[c(R)],_&&(d==="click"||d==="preclick")&&this._draggableMoved(_)){q=!0;break}if(_&&_.listens(d,!0)&&(C&&!Ps(R,a)||(g.push(_),C))||R===this._container)break;R=R.parentNode}return!g.length&&!q&&!C&&this.listens(d,!0)&&(g=[this]),g},_isClickDisabled:function(a){for(;a&&a!==this._container;){if(a._leaflet_disable_click)return!0;a=a.parentNode}},_handleDOMEvent:function(a){var d=a.target||a.srcElement;if(!(!this._loaded||d._leaflet_disable_events||a.type==="click"&&this._isClickDisabled(d))){var g=a.type;g==="mousedown"&&ce(d),this._fireDOMEvent(a,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(a,d,g){if(a.type==="click"){var _=i({},a);_.type="preclick",this._fireDOMEvent(_,_.type,g)}var C=this._findEventTargets(a,d);if(g){for(var R=[],q=0;q<g.length;q++)g[q].listens(d,!0)&&R.push(g[q]);C=R.concat(C)}if(C.length){d==="contextmenu"&&hn(a);var rt=C[0],ot={originalEvent:a};if(a.type!=="keypress"&&a.type!=="keydown"&&a.type!=="keyup"){var pt=rt.getLatLng&&(!rt._radius||rt._radius<=10);ot.containerPoint=pt?this.latLngToContainerPoint(rt.getLatLng()):this.mouseEventToContainerPoint(a),ot.layerPoint=this.containerPointToLayerPoint(ot.containerPoint),ot.latlng=pt?rt.getLatLng():this.layerPointToLatLng(ot.layerPoint)}for(q=0;q<C.length;q++)if(C[q].fire(d,ot,!0),ot.originalEvent._stopped||C[q].options.bubblingMouseEvents===!1&&E(this._mouseEvents,d)!==-1)return}},_draggableMoved:function(a){return a=a.dragging&&a.dragging.enabled()?a:this,a.dragging&&a.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var a=0,d=this._handlers.length;a<d;a++)this._handlers[a].disable()},whenReady:function(a,d){return this._loaded?a.call(d||this,{target:this}):this.on("load",a,d),this},_getMapPanePos:function(){return Ee(this._mapPane)||new X(0,0)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(a,d){var g=a&&d!==void 0?this._getNewPixelOrigin(a,d):this.getPixelOrigin();return g.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(a,d){var g=this.getSize()._divideBy(2);return this.project(a,d)._subtract(g)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return this.project(a,d)._subtract(_)},_latLngBoundsToNewLayerBounds:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return it([this.project(a.getSouthWest(),d)._subtract(_),this.project(a.getNorthWest(),d)._subtract(_),this.project(a.getSouthEast(),d)._subtract(_),this.project(a.getNorthEast(),d)._subtract(_)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitCenter:function(a,d,g){if(!g)return a;var _=this.project(a,d),C=this.getSize().divideBy(2),R=new et(_.subtract(C),_.add(C)),q=this._getBoundsOffset(R,g,d);return Math.abs(q.x)<=1&&Math.abs(q.y)<=1?a:this.unproject(_.add(q),d)},_limitOffset:function(a,d){if(!d)return a;var g=this.getPixelBounds(),_=new et(g.min.add(a),g.max.add(a));return a.add(this._getBoundsOffset(_,d))},_getBoundsOffset:function(a,d,g){var _=it(this.project(d.getNorthEast(),g),this.project(d.getSouthWest(),g)),C=_.min.subtract(a.min),R=_.max.subtract(a.max),q=this._rebound(C.x,-R.x),rt=this._rebound(C.y,-R.y);return new X(q,rt)},_rebound:function(a,d){return a+d>0?Math.round(a-d)/2:Math.max(0,Math.ceil(a))-Math.max(0,Math.floor(d))},_limitZoom:function(a){var d=this.getMinZoom(),g=this.getMaxZoom(),_=It.any3d?this.options.zoomSnap:1;return _&&(a=Math.round(a/_)*_),Math.max(d,Math.min(g,a))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){le(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,d){var g=this._getCenterOffset(a)._trunc();return(d&&d.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,d),!0)},_createAnimProxy:function(){var a=this._proxy=re("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(a),this.on("zoomanim",function(d){var g=Sn,_=this._proxy.style[g];Ge(this._proxy,this.project(d.center,d.zoom),this.getZoomScale(d.zoom,1)),_===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Kt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var a=this.getCenter(),d=this.getZoom();Ge(this._proxy,this.project(a,d),this.getZoomScale(d,1))},_catchTransitionEnd:function(a){this._animatingZoom&&a.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(a,d,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(d-this._zoom)>this.options.zoomAnimationThreshold)return!1;var _=this.getZoomScale(d),C=this._getCenterOffset(a)._divideBy(1-1/_);return g.animate!==!0&&!this.getSize().contains(C)?!1:(D(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(a,d,!0)},this),!0)},_animateZoom:function(a,d,g,_){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=a,this._animateToZoom=d,Rt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:a,zoom:d,noUpdate:_}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&le(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ka(a,d){return new pe(a,d)}var dr=U.extend({options:{position:"topright"},initialize:function(a){p(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var d=this._map;return d&&d.removeControl(this),this.options.position=a,d&&d.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this.remove(),this._map=a;var d=this._container=this.onAdd(a),g=this.getPosition(),_=a._controlCorners[g];return Rt(d,"leaflet-control"),g.indexOf("bottom")!==-1?_.insertBefore(d,_.firstChild):_.appendChild(d),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Kt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(a){this._map&&a&&a.screenX>0&&a.screenY>0&&this._map.getContainer().focus()}}),As=function(a){return new dr(a)};pe.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.remove(),this},_initControlPos:function(){var a=this._controlCorners={},d="leaflet-",g=this._controlContainer=re("div",d+"control-container",this._container);function _(C,R){var q=d+C+" "+d+R;a[C+R]=re("div",q,g)}_("top","left"),_("top","right"),_("bottom","left"),_("bottom","right")},_clearControlPos:function(){for(var a in this._controlCorners)Kt(this._controlCorners[a]);Kt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ih=dr.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(a,d,g,_){return g<_?-1:_<g?1:0}},initialize:function(a,d,g){p(this,g),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var _ in a)this._addLayer(a[_],_);for(_ in d)this._addLayer(d[_],_,!0)},onAdd:function(a){this._initLayout(),this._update(),this._map=a,a.on("zoomend",this._checkDisabledLayers,this);for(var d=0;d<this._layers.length;d++)this._layers[d].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(a){return dr.prototype.addTo.call(this,a),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var a=0;a<this._layers.length;a++)this._layers[a].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(a,d){return this._addLayer(a,d),this._map?this._update():this},addOverlay:function(a,d){return this._addLayer(a,d,!0),this._map?this._update():this},removeLayer:function(a){a.off("add remove",this._onLayerChange,this);var d=this._getLayer(c(a));return d&&this._layers.splice(this._layers.indexOf(d),1),this._map?this._update():this},expand:function(){Rt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var a=this._map.getSize().y-(this._container.offsetTop+50);return a<this._section.clientHeight?(Rt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=a+"px"):le(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return le(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var a="leaflet-control-layers",d=this._container=re("div",a),g=this.options.collapsed;d.setAttribute("aria-haspopup",!0),Ui(d),li(d);var _=this._section=re("section",a+"-list");g&&(this._map.on("click",this.collapse,this),Ft(d,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var C=this._layersLink=re("a",a+"-toggle",d);C.href="#",C.title="Layers",C.setAttribute("role","button"),Ft(C,{keydown:function(R){R.keyCode===13&&this._expandSafely()},click:function(R){hn(R),this._expandSafely()}},this),g||this.expand(),this._baseLayersList=re("div",a+"-base",_),this._separator=re("div",a+"-separator",_),this._overlaysList=re("div",a+"-overlays",_),d.appendChild(_)},_getLayer:function(a){for(var d=0;d<this._layers.length;d++)if(this._layers[d]&&c(this._layers[d].layer)===a)return this._layers[d]},_addLayer:function(a,d,g){this._map&&a.on("add remove",this._onLayerChange,this),this._layers.push({layer:a,name:d,overlay:g}),this.options.sortLayers&&this._layers.sort(s(function(_,C){return this.options.sortFunction(_.layer,C.layer,_.name,C.name)},this)),this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;hr(this._baseLayersList),hr(this._overlaysList),this._layerControlInputs=[];var a,d,g,_,C=0;for(g=0;g<this._layers.length;g++)_=this._layers[g],this._addItem(_),d=d||_.overlay,a=a||!_.overlay,C+=_.overlay?0:1;return this.options.hideSingleBase&&(a=a&&C>1,this._baseLayersList.style.display=a?"":"none"),this._separator.style.display=d&&a?"":"none",this},_onLayerChange:function(a){this._handlingClick||this._update();var d=this._getLayer(c(a.target)),g=d.overlay?a.type==="add"?"overlayadd":"overlayremove":a.type==="add"?"baselayerchange":null;g&&this._map.fire(g,d)},_createRadioElement:function(a,d){var g='<input type="radio" class="leaflet-control-layers-selector" name="'+a+'"'+(d?' checked="checked"':"")+"/>",_=document.createElement("div");return _.innerHTML=g,_.firstChild},_addItem:function(a){var d=document.createElement("label"),g=this._map.hasLayer(a.layer),_;a.overlay?(_=document.createElement("input"),_.type="checkbox",_.className="leaflet-control-layers-selector",_.defaultChecked=g):_=this._createRadioElement("leaflet-base-layers_"+c(this),g),this._layerControlInputs.push(_),_.layerId=c(a.layer),Ft(_,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+a.name;var R=document.createElement("span");d.appendChild(R),R.appendChild(_),R.appendChild(C);var q=a.overlay?this._overlaysList:this._baseLayersList;return q.appendChild(d),this._checkDisabledLayers(),d},_onInputClick:function(){if(!this._preventClick){var a=this._layerControlInputs,d,g,_=[],C=[];this._handlingClick=!0;for(var R=a.length-1;R>=0;R--)d=a[R],g=this._getLayer(d.layerId).layer,d.checked?_.push(g):d.checked||C.push(g);for(R=0;R<C.length;R++)this._map.hasLayer(C[R])&&this._map.removeLayer(C[R]);for(R=0;R<_.length;R++)this._map.hasLayer(_[R])||this._map.addLayer(_[R]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var a=this._layerControlInputs,d,g,_=this._map.getZoom(),C=a.length-1;C>=0;C--)d=a[C],g=this._getLayer(d.layerId).layer,d.disabled=g.options.minZoom!==void 0&&_<g.options.minZoom||g.options.maxZoom!==void 0&&_>g.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var a=this._section;this._preventClick=!0,Ft(a,"click",hn),this.expand();var d=this;setTimeout(function(){Ce(a,"click",hn),d._preventClick=!1})}}),Sm=function(a,d,g){return new Ih(a,d,g)},gn=dr.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(a){var d="leaflet-control-zoom",g=re("div",d+" leaflet-bar"),_=this.options;return this._zoomInButton=this._createButton(_.zoomInText,_.zoomInTitle,d+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(_.zoomOutText,_.zoomOutTitle,d+"-out",g,this._zoomOut),this._updateDisabled(),a.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(a){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(a.shiftKey?3:1))},_zoomOut:function(a){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(a.shiftKey?3:1))},_createButton:function(a,d,g,_,C){var R=re("a",g,_);return R.innerHTML=a,R.href="#",R.title=d,R.setAttribute("role","button"),R.setAttribute("aria-label",d),Ui(R),Ft(R,"click",jn),Ft(R,"click",C,this),Ft(R,"click",this._refocusOnMap,this),R},_updateDisabled:function(){var a=this._map,d="leaflet-disabled";le(this._zoomInButton,d),le(this._zoomOutButton,d),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||a._zoom===a.getMinZoom())&&(Rt(this._zoomOutButton,d),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||a._zoom===a.getMaxZoom())&&(Rt(this._zoomInButton,d),this._zoomInButton.setAttribute("aria-disabled","true"))}});pe.mergeOptions({zoomControl:!0}),pe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new gn,this.addControl(this.zoomControl))});var Pm=function(a){return new gn(a)},Rh=dr.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(a){var d="leaflet-control-scale",g=re("div",d),_=this.options;return this._addScales(_,d+"-line",g),a.on(_.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),g},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,d,g){a.metric&&(this._mScale=re("div",d,g)),a.imperial&&(this._iScale=re("div",d,g))},_update:function(){var a=this._map,d=a.getSize().y/2,g=a.distance(a.containerPointToLatLng([0,d]),a.containerPointToLatLng([this.options.maxWidth,d]));this._updateScales(g)},_updateScales:function(a){this.options.metric&&a&&this._updateMetric(a),this.options.imperial&&a&&this._updateImperial(a)},_updateMetric:function(a){var d=this._getRoundNum(a),g=d<1e3?d+" m":d/1e3+" km";this._updateScale(this._mScale,g,d/a)},_updateImperial:function(a){var d=a*3.2808399,g,_,C;d>5280?(g=d/5280,_=this._getRoundNum(g),this._updateScale(this._iScale,_+" mi",_/g)):(C=this._getRoundNum(d),this._updateScale(this._iScale,C+" ft",C/d))},_updateScale:function(a,d,g){a.style.width=Math.round(this.options.maxWidth*g)+"px",a.innerHTML=d},_getRoundNum:function(a){var d=Math.pow(10,(Math.floor(a)+"").length-1),g=a/d;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,d*g}}),ko=function(a){return new Rh(a)},Ts='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',pr=dr.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(It.inlineSvg?Ts+" ":"")+"Leaflet</a>"},initialize:function(a){p(this,a),this._attributions={}},onAdd:function(a){a.attributionControl=this,this._container=re("div","leaflet-control-attribution"),Ui(this._container);for(var d in a._layers)a._layers[d].getAttribution&&this.addAttribution(a._layers[d].getAttribution());return this._update(),a.on("layeradd",this._addAttribution,this),this._container},onRemove:function(a){a.off("layeradd",this._addAttribution,this)},_addAttribution:function(a){a.layer.getAttribution&&(this.addAttribution(a.layer.getAttribution()),a.layer.once("remove",function(){this.removeAttribution(a.layer.getAttribution())},this))},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):this},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):this},_update:function(){if(this._map){var a=[];for(var d in this._attributions)this._attributions[d]&&a.push(d);var g=[];this.options.prefix&&g.push(this.options.prefix),a.length&&g.push(a.join(", ")),this._container.innerHTML=g.join(' <span aria-hidden="true">|</span> ')}}});pe.mergeOptions({attributionControl:!0}),pe.addInitHook(function(){this.options.attributionControl&&new pr().addTo(this)});var wc=function(a){return new pr(a)};dr.Layers=Ih,dr.Zoom=gn,dr.Scale=Rh,dr.Attribution=pr,As.layers=Sm,As.zoom=Pm,As.scale=ko,As.attribution=wc;var Jn=U.extend({initialize:function(a){this._map=a},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Jn.addTo=function(a,d){return a.addHandler(d,this),this};var je={Events:Y},Hi=It.touch?"touchstart mousedown":"mousedown",ci=G.extend({options:{clickTolerance:3},initialize:function(a,d,g,_){p(this,_),this._element=a,this._dragStartTarget=d||a,this._preventOutline=g},enable:function(){this._enabled||(Ft(this._dragStartTarget,Hi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ci._dragging===this&&this.finishDrag(!0),Ce(this._dragStartTarget,Hi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(a){if(this._enabled&&(this._moved=!1,!xe(this._element,"leaflet-zoom-anim"))){if(a.touches&&a.touches.length!==1){ci._dragging===this&&this.finishDrag();return}if(!(ci._dragging||a.shiftKey||a.which!==1&&a.button!==1&&!a.touches)&&(ci._dragging=this,this._preventOutline&&ce(this._element),Cr(),ws(),!this._moving)){this.fire("down");var d=a.touches?a.touches[0]:a,g=kh(this._element);this._startPoint=new X(d.clientX,d.clientY),this._startPos=Ee(this._element),this._parentScale=Oo(g);var _=a.type==="mousedown";Ft(document,_?"mousemove":"touchmove",this._onMove,this),Ft(document,_?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(a){if(this._enabled){if(a.touches&&a.touches.length>1){this._moved=!0;return}var d=a.touches&&a.touches.length===1?a.touches[0]:a,g=new X(d.clientX,d.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)<this.options.clickTolerance||(g.x/=this._parentScale.x,g.y/=this._parentScale.y,hn(a),this._moved||(this.fire("dragstart"),this._moved=!0,Rt(document.body,"leaflet-dragging"),this._lastTarget=a.target||a.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Rt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(g),this._moving=!0,this._lastEvent=a,this._updatePosition())}},_updatePosition:function(){var a={originalEvent:this._lastEvent};this.fire("predrag",a),Ie(this._element,this._newPos),this.fire("drag",a)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(a){le(document.body,"leaflet-dragging"),this._lastTarget&&(le(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ce(document,"mousemove touchmove",this._onMove,this),Ce(document,"mouseup touchend touchcancel",this._onUp,this),Co(),Hr();var d=this._moved&&this._moving;this._moving=!1,ci._dragging=!1,d&&this.fire("dragend",{noInertia:a,distance:this._newPos.distanceTo(this._startPos)})}});function $a(a,d,g){var _,C=[1,4,2,8],R,q,rt,ot,pt,Ot,zt,Nt;for(R=0,Ot=a.length;R<Ot;R++)a[R]._code=qi(a[R],d);for(rt=0;rt<4;rt++){for(zt=C[rt],_=[],R=0,Ot=a.length,q=Ot-1;R<Ot;q=R++)ot=a[R],pt=a[q],ot._code&zt?pt._code&zt||(Nt=Os(pt,ot,zt,d,g),Nt._code=qi(Nt,d),_.push(Nt)):(pt._code&zt&&(Nt=Os(pt,ot,zt,d,g),Nt._code=qi(Nt,d),_.push(Nt)),_.push(ot));a=_}return a}function _c(a,d){var g,_,C,R,q,rt,ot,pt,Ot;if(!a||a.length===0)throw new Error("latlngs not passed");Qn(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var zt=vt([0,0]),Nt=ct(a),_t=Nt.getNorthWest().distanceTo(Nt.getSouthWest())*Nt.getNorthEast().distanceTo(Nt.getNorthWest());_t<1700&&(zt=Gr(a));var jt=a.length,Gt=[];for(g=0;g<jt;g++){var ue=vt(a[g]);Gt.push(d.project(vt([ue.lat-zt.lat,ue.lng-zt.lng])))}for(rt=ot=pt=0,g=0,_=jt-1;g<jt;_=g++)C=Gt[g],R=Gt[_],q=C.y*R.x-R.y*C.x,ot+=(C.x+R.x)*q,pt+=(C.y+R.y)*q,rt+=q*3;rt===0?Ot=Gt[0]:Ot=[ot/rt,pt/rt];var Oe=d.unproject(H(Ot));return vt([Oe.lat+zt.lat,Oe.lng+zt.lng])}function Gr(a){for(var d=0,g=0,_=0,C=0;C<a.length;C++){var R=vt(a[C]);d+=R.lat,g+=R.lng,_++}return vt([d/_,g/_])}var fn={__proto__:null,clipPolygon:$a,polygonCenter:_c,centroid:Gr};function Zr(a,d){if(!d||!a.length)return a.slice();var g=d*d;return a=jh(a,g),a=Nh(a,g),a}function Ia(a,d,g){return Math.sqrt(Ms(a,d,g,!0))}function Lh(a,d,g){return Ms(a,d,g)}function Nh(a,d){var g=a.length,_=typeof Uint8Array<"u"?Uint8Array:Array,C=new _(g);C[0]=C[g-1]=1,Sc(a,C,d,0,g-1);var R,q=[];for(R=0;R<g;R++)C[R]&&q.push(a[R]);return q}function Sc(a,d,g,_,C){var R=0,q,rt,ot;for(rt=_+1;rt<=C-1;rt++)ot=Ms(a[rt],a[_],a[C],!0),ot>R&&(q=rt,R=ot);R>g&&(d[q]=1,Sc(a,d,g,_,q),Sc(a,d,g,q,C))}function jh(a,d){for(var g=[a[0]],_=1,C=0,R=a.length;_<R;_++)Am(a[_],a[C])>d&&(g.push(a[_]),C=_);return C<R-1&&g.push(a[R-1]),g}var Es;function Cs(a,d,g,_,C){var R=_?Es:qi(a,g),q=qi(d,g),rt,ot,pt;for(Es=q;;){if(!(R|q))return[a,d];if(R&q)return!1;rt=R||q,ot=Os(a,d,rt,g,C),pt=qi(ot,g),rt===R?(a=ot,R=pt):(d=ot,q=pt)}}function Os(a,d,g,_,C){var R=d.x-a.x,q=d.y-a.y,rt=_.min,ot=_.max,pt,Ot;return g&8?(pt=a.x+R*(ot.y-a.y)/q,Ot=ot.y):g&4?(pt=a.x+R*(rt.y-a.y)/q,Ot=rt.y):g&2?(pt=ot.x,Ot=a.y+q*(ot.x-a.x)/R):g&1&&(pt=rt.x,Ot=a.y+q*(rt.x-a.x)/R),new X(pt,Ot,C)}function qi(a,d){var g=0;return a.x<d.min.x?g|=1:a.x>d.max.x&&(g|=2),a.y<d.min.y?g|=4:a.y>d.max.y&&(g|=8),g}function Am(a,d){var g=d.x-a.x,_=d.y-a.y;return g*g+_*_}function Ms(a,d,g,_){var C=d.x,R=d.y,q=g.x-C,rt=g.y-R,ot=q*q+rt*rt,pt;return ot>0&&(pt=((a.x-C)*q+(a.y-R)*rt)/ot,pt>1?(C=g.x,R=g.y):pt>0&&(C+=q*pt,R+=rt*pt)),q=a.x-C,rt=a.y-R,_?q*q+rt*rt:new X(C,R)}function Qn(a){return!A(a[0])||typeof a[0][0]!="object"&&typeof a[0][0]<"u"}function Pc(a){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Qn(a)}function Dh(a,d){var g,_,C,R,q,rt,ot,pt;if(!a||a.length===0)throw new Error("latlngs not passed");Qn(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var Ot=vt([0,0]),zt=ct(a),Nt=zt.getNorthWest().distanceTo(zt.getSouthWest())*zt.getNorthEast().distanceTo(zt.getNorthWest());Nt<1700&&(Ot=Gr(a));var _t=a.length,jt=[];for(g=0;g<_t;g++){var Gt=vt(a[g]);jt.push(d.project(vt([Gt.lat-Ot.lat,Gt.lng-Ot.lng])))}for(g=0,_=0;g<_t-1;g++)_+=jt[g].distanceTo(jt[g+1])/2;if(_===0)pt=jt[0];else for(g=0,R=0;g<_t-1;g++)if(q=jt[g],rt=jt[g+1],C=q.distanceTo(rt),R+=C,R>_){ot=(R-_)/C,pt=[rt.x-ot*(rt.x-q.x),rt.y-ot*(rt.y-q.y)];break}var ue=d.unproject(H(pt));return vt([ue.lat+Ot.lat,ue.lng+Ot.lng])}var Un={__proto__:null,simplify:Zr,pointToSegmentDistance:Ia,closestPointOnSegment:Lh,clipSegment:Cs,_getEdgeIntersection:Os,_getBitCode:qi,_sqClosestPointOnSegment:Ms,isFlat:Qn,_flat:Pc,polylineCenter:Dh},yn={project:function(a){return new X(a.lng,a.lat)},unproject:function(a){return new yt(a.y,a.x)},bounds:new et([-180,-90],[180,90])},Ra={R:6378137,R_MINOR:6356752314245179e-9,bounds:new et([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(a){var d=Math.PI/180,g=this.R,_=a.lat*d,C=this.R_MINOR/g,R=Math.sqrt(1-C*C),q=R*Math.sin(_),rt=Math.tan(Math.PI/4-_/2)/Math.pow((1-q)/(1+q),R/2);return _=-g*Math.log(Math.max(rt,1e-10)),new X(a.lng*d*g,_)},unproject:function(a){for(var d=180/Math.PI,g=this.R,_=this.R_MINOR/g,C=Math.sqrt(1-_*_),R=Math.exp(-a.y/g),q=Math.PI/2-2*Math.atan(R),rt=0,ot=.1,pt;rt<15&&Math.abs(ot)>1e-7;rt++)pt=C*Math.sin(q),pt=Math.pow((1-pt)/(1+pt),C/2),ot=Math.PI/2-2*Math.atan(R*pt)-q,q+=ot;return new yt(q*d,a.x*d/g)}},La={__proto__:null,LonLat:yn,Mercator:Ra,SphericalMercator:dt},Ac=i({},Tt,{code:"EPSG:3395",projection:Ra,transformation:function(){var a=.5/(Math.PI*Ra.R);return nt(a,.5,-a,.5)}()}),Tc=i({},Tt,{code:"EPSG:4326",projection:yn,transformation:nt(1/180,1,-1/180,.5)}),Ec=i({},Et,{projection:yn,transformation:nt(1,0,-1,0),scale:function(a){return Math.pow(2,a)},zoom:function(a){return Math.log(a)/Math.LN2},distance:function(a,d){var g=d.lng-a.lng,_=d.lat-a.lat;return Math.sqrt(g*g+_*_)},infinite:!0});Et.Earth=Tt,Et.EPSG3395=Ac,Et.EPSG3857=Lt,Et.EPSG900913=bt,Et.EPSG4326=Tc,Et.Simple=Ec;var tr=G.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(a){return a.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(a){return a&&a.removeLayer(this),this},getPane:function(a){return this._map.getPane(a?this.options[a]||a:this.options.pane)},addInteractiveTarget:function(a){return this._map._targets[c(a)]=this,this},removeInteractiveTarget:function(a){return delete this._map._targets[c(a)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(a){var d=a.target;if(d.hasLayer(this)){if(this._map=d,this._zoomAnimated=d._zoomAnimated,this.getEvents){var g=this.getEvents();d.on(g,this),this.once("remove",function(){d.off(g,this)},this)}this.onAdd(d),this.fire("add"),d.fire("layeradd",{layer:this})}}});pe.include({addLayer:function(a){if(!a._layerAdd)throw new Error("The provided object is not a Layer.");var d=c(a);return this._layers[d]?this:(this._layers[d]=a,a._mapToAdd=this,a.beforeAdd&&a.beforeAdd(this),this.whenReady(a._layerAdd,a),this)},removeLayer:function(a){var d=c(a);return this._layers[d]?(this._loaded&&a.onRemove(this),delete this._layers[d],this._loaded&&(this.fire("layerremove",{layer:a}),a.fire("remove")),a._map=a._mapToAdd=null,this):this},hasLayer:function(a){return c(a)in this._layers},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},_addLayers:function(a){a=a?A(a)?a:[a]:[];for(var d=0,g=a.length;d<g;d++)this.addLayer(a[d])},_addZoomLimit:function(a){(!isNaN(a.options.maxZoom)||!isNaN(a.options.minZoom))&&(this._zoomBoundLayers[c(a)]=a,this._updateZoomLevels())},_removeZoomLimit:function(a){var d=c(a);this._zoomBoundLayers[d]&&(delete this._zoomBoundLayers[d],this._updateZoomLevels())},_updateZoomLevels:function(){var a=1/0,d=-1/0,g=this._getZoomSpan();for(var _ in this._zoomBoundLayers){var C=this._zoomBoundLayers[_].options;a=C.minZoom===void 0?a:Math.min(a,C.minZoom),d=C.maxZoom===void 0?d:Math.max(d,C.maxZoom)}this._layersMaxZoom=d===-1/0?void 0:d,this._layersMinZoom=a===1/0?void 0:a,g!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Gi=tr.extend({initialize:function(a,d){p(this,d),this._layers={};var g,_;if(a)for(g=0,_=a.length;g<_;g++)this.addLayer(a[g])},addLayer:function(a){var d=this.getLayerId(a);return this._layers[d]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var d=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[d]&&this._map.removeLayer(this._layers[d]),delete this._layers[d],this},hasLayer:function(a){var d=typeof a=="number"?a:this.getLayerId(a);return d in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(a){var d=Array.prototype.slice.call(arguments,1),g,_;for(g in this._layers)_=this._layers[g],_[a]&&_[a].apply(_,d);return this},onAdd:function(a){this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a)},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];return this.eachLayer(a.push,a),a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return c(a)}}),Bh=function(a,d){return new Gi(a,d)},mr=Gi.extend({addLayer:function(a){return this.hasLayer(a)?this:(a.addEventParent(this),Gi.prototype.addLayer.call(this,a),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return this.hasLayer(a)?(a in this._layers&&(a=this._layers[a]),a.removeEventParent(this),Gi.prototype.removeLayer.call(this,a),this.fire("layerremove",{layer:a})):this},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new st;for(var d in this._layers){var g=this._layers[d];a.extend(g.getBounds?g.getBounds():g.getLatLng())}return a}}),Cc=function(a,d){return new mr(a,d)},gr=U.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(a){p(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,d){var g=this._getIconUrl(a);if(!g){if(a==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var _=this._createImg(g,d&&d.tagName==="IMG"?d:null);return this._setIconStyles(_,a),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),_},_setIconStyles:function(a,d){var g=this.options,_=g[d+"Size"];typeof _=="number"&&(_=[_,_]);var C=H(_),R=H(d==="shadow"&&g.shadowAnchor||g.iconAnchor||C&&C.divideBy(2,!0));a.className="leaflet-marker-"+d+" "+(g.className||""),R&&(a.style.marginLeft=-R.x+"px",a.style.marginTop=-R.y+"px"),C&&(a.style.width=C.x+"px",a.style.height=C.y+"px")},_createImg:function(a,d){return d=d||document.createElement("img"),d.src=a,d},_getIconUrl:function(a){return It.retina&&this.options[a+"RetinaUrl"]||this.options[a+"Url"]}});function Oc(a){return new gr(a)}var $o=gr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(a){return typeof $o.imagePath!="string"&&($o.imagePath=this._detectIconPath()),(this.options.imagePath||$o.imagePath)+gr.prototype._getIconUrl.call(this,a)},_stripUrl:function(a){var d=function(g,_,C){var R=_.exec(g);return R&&R[C]};return a=d(a,/^url\((['"])?(.+)\1\)$/,2),a&&d(a,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var a=re("div","leaflet-default-icon-path",document.body),d=Mn(a,"background-image")||Mn(a,"backgroundImage");if(document.body.removeChild(a),d=this._stripUrl(d),d)return d;var g=document.querySelector('link[href$="leaflet.css"]');return g?g.href.substring(0,g.href.length-11-1):""}}),Zi=Jn.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new ci(a,a,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Rt(a,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&le(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(a){var d=this._marker,g=d._map,_=this._marker.options.autoPanSpeed,C=this._marker.options.autoPanPadding,R=Ee(d._icon),q=g.getPixelBounds(),rt=g.getPixelOrigin(),ot=it(q.min._subtract(rt).add(C),q.max._subtract(rt).subtract(C));if(!ot.contains(R)){var pt=H((Math.max(ot.max.x,R.x)-ot.max.x)/(q.max.x-ot.max.x)-(Math.min(ot.min.x,R.x)-ot.min.x)/(q.min.x-ot.min.x),(Math.max(ot.max.y,R.y)-ot.max.y)/(q.max.y-ot.max.y)-(Math.min(ot.min.y,R.y)-ot.min.y)/(q.min.y-ot.min.y)).multiplyBy(_);g.panBy(pt,{animate:!1}),this._draggable._newPos._add(pt),this._draggable._startPos._add(pt),Ie(d._icon,this._draggable._newPos),this._onDrag(a),this._panRequest=D(this._adjustPan.bind(this,a))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(a){this._marker.options.autoPan&&(j(this._panRequest),this._panRequest=D(this._adjustPan.bind(this,a)))},_onDrag:function(a){var d=this._marker,g=d._shadow,_=Ee(d._icon),C=d._map.layerPointToLatLng(_);g&&Ie(g,_),d._latlng=C,a.latlng=C,a.oldLatLng=this._oldLatLng,d.fire("move",a).fire("drag",a)},_onDragEnd:function(a){j(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",a)}}),ks=tr.extend({options:{icon:new $o,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(a,d){p(this,d),this._latlng=vt(a)},onAdd:function(a){this._zoomAnimated=this._zoomAnimated&&a.options.markerZoomAnimation,this._zoomAnimated&&a.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(a){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&a.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(a){var d=this._latlng;return this._latlng=vt(a),this.update(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update()},getIcon:function(){return this.options.icon},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var a=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(a)}return this},_initIcon:function(){var a=this.options,d="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),g=a.icon.createIcon(this._icon),_=!1;g!==this._icon&&(this._icon&&this._removeIcon(),_=!0,a.title&&(g.title=a.title),g.tagName==="IMG"&&(g.alt=a.alt||"")),Rt(g,d),a.keyboard&&(g.tabIndex="0",g.setAttribute("role","button")),this._icon=g,a.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ft(g,"focus",this._panOnFocus,this);var C=a.icon.createShadow(this._shadow),R=!1;C!==this._shadow&&(this._removeShadow(),R=!0),C&&(Rt(C,d),C.alt=""),this._shadow=C,a.opacity<1&&this._updateOpacity(),_&&this.getPane().appendChild(this._icon),this._initInteraction(),C&&R&&this.getPane(a.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ce(this._icon,"focus",this._panOnFocus,this),Kt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Kt(this._shadow),this._shadow=null},_setPos:function(a){this._icon&&Ie(this._icon,a),this._shadow&&Ie(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon&&(this._icon.style.zIndex=this._zIndex+a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center).round();this._setPos(d)},_initInteraction:function(){if(this.options.interactive&&(Rt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Zi)){var a=this.options.draggable;this.dragging&&(a=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Zi(this),a&&this.dragging.enable()}},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var a=this.options.opacity;this._icon&&kn(this._icon,a),this._shadow&&kn(this._shadow,a)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var a=this._map;if(a){var d=this.options.icon.options,g=d.iconSize?H(d.iconSize):H(0,0),_=d.iconAnchor?H(d.iconAnchor):H(0,0);a.panInside(this._latlng,{paddingTopLeft:_,paddingBottomRight:g.subtract(_)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Na(a,d){return new ks(a,d)}var Jt=tr.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(a){this._renderer=a.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(a){return p(this,a),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&a&&Object.prototype.hasOwnProperty.call(a,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ui=Jt.extend({options:{fill:!0,radius:10},initialize:function(a,d){p(this,d),this._latlng=vt(a),this._radius=this.options.radius},setLatLng:function(a){var d=this._latlng;return this._latlng=vt(a),this.redraw(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(a){return this.options.radius=this._radius=a,this.redraw()},getRadius:function(){return this._radius},setStyle:function(a){var d=a&&a.radius||this._radius;return Jt.prototype.setStyle.call(this,a),this.setRadius(d),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var a=this._radius,d=this._radiusY||a,g=this._clickTolerance(),_=[a+g,d+g];this._pxBounds=new et(this._point.subtract(_),this._point.add(_))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(a){return a.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function zh(a,d){return new ui(a,d)}var Io=ui.extend({initialize:function(a,d,g){if(typeof d=="number"&&(d=i({},g,{radius:d})),p(this,d),this._latlng=vt(a),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(a){return this._mRadius=a,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var a=[this._radius,this._radiusY||this._radius];return new st(this._map.layerPointToLatLng(this._point.subtract(a)),this._map.layerPointToLatLng(this._point.add(a)))},setStyle:Jt.prototype.setStyle,_project:function(){var a=this._latlng.lng,d=this._latlng.lat,g=this._map,_=g.options.crs;if(_.distance===Tt.distance){var C=Math.PI/180,R=this._mRadius/Tt.R/C,q=g.project([d+R,a]),rt=g.project([d-R,a]),ot=q.add(rt).divideBy(2),pt=g.unproject(ot).lat,Ot=Math.acos((Math.cos(R*C)-Math.sin(d*C)*Math.sin(pt*C))/(Math.cos(d*C)*Math.cos(pt*C)))/C;(isNaN(Ot)||Ot===0)&&(Ot=R/Math.cos(Math.PI/180*d)),this._point=ot.subtract(g.getPixelOrigin()),this._radius=isNaN(Ot)?0:ot.x-g.project([pt,a-Ot]).x,this._radiusY=ot.y-q.y}else{var zt=_.unproject(_.project(this._latlng).subtract([this._mRadius,0]));this._point=g.latLngToLayerPoint(this._latlng),this._radius=this._point.x-g.latLngToLayerPoint(zt).x}this._updateBounds()}});function ja(a,d,g){return new Io(a,d,g)}var Yr=Jt.extend({options:{smoothFactor:1,noClip:!1},initialize:function(a,d){p(this,d),this._setLatLngs(a)},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._setLatLngs(a),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(a){for(var d=1/0,g=null,_=Ms,C,R,q=0,rt=this._parts.length;q<rt;q++)for(var ot=this._parts[q],pt=1,Ot=ot.length;pt<Ot;pt++){C=ot[pt-1],R=ot[pt];var zt=_(a,C,R,!0);zt<d&&(d=zt,g=_(a,C,R))}return g&&(g.distance=Math.sqrt(d)),g},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Dh(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(a,d){return d=d||this._defaultShape(),a=vt(a),d.push(a),this._bounds.extend(a),this.redraw()},_setLatLngs:function(a){this._bounds=new st,this._latlngs=this._convertLatLngs(a)},_defaultShape:function(){return Qn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(a){for(var d=[],g=Qn(a),_=0,C=a.length;_<C;_++)g?(d[_]=vt(a[_]),this._bounds.extend(d[_])):d[_]=this._convertLatLngs(a[_]);return d},_project:function(){var a=new et;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,a),this._bounds.isValid()&&a.isValid()&&(this._rawPxBounds=a,this._updateBounds())},_updateBounds:function(){var a=this._clickTolerance(),d=new X(a,a);this._rawPxBounds&&(this._pxBounds=new et([this._rawPxBounds.min.subtract(d),this._rawPxBounds.max.add(d)]))},_projectLatlngs:function(a,d,g){var _=a[0]instanceof yt,C=a.length,R,q;if(_){for(q=[],R=0;R<C;R++)q[R]=this._map.latLngToLayerPoint(a[R]),g.extend(q[R]);d.push(q)}else for(R=0;R<C;R++)this._projectLatlngs(a[R],d,g)},_clipPoints:function(){var a=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}var d=this._parts,g,_,C,R,q,rt,ot;for(g=0,C=0,R=this._rings.length;g<R;g++)for(ot=this._rings[g],_=0,q=ot.length;_<q-1;_++)rt=Cs(ot[_],ot[_+1],a,_,!0),rt&&(d[C]=d[C]||[],d[C].push(rt[0]),(rt[1]!==ot[_+1]||_===q-2)&&(d[C].push(rt[1]),C++))}},_simplifyPoints:function(){for(var a=this._parts,d=this.options.smoothFactor,g=0,_=a.length;g<_;g++)a[g]=Zr(a[g],d)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(a,d){var g,_,C,R,q,rt,ot=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(g=0,R=this._parts.length;g<R;g++)for(rt=this._parts[g],_=0,q=rt.length,C=q-1;_<q;C=_++)if(!(!d&&_===0)&&Ia(a,rt[C],rt[_])<=ot)return!0;return!1}});function Fh(a,d){return new Yr(a,d)}Yr._flat=Pc;var Ro=Yr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return _c(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(a){var d=Yr.prototype._convertLatLngs.call(this,a),g=d.length;return g>=2&&d[0]instanceof yt&&d[0].equals(d[g-1])&&d.pop(),d},_setLatLngs:function(a){Yr.prototype._setLatLngs.call(this,a),Qn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Qn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var a=this._renderer._bounds,d=this.options.weight,g=new X(d,d);if(a=new et(a.min.subtract(g),a.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}for(var _=0,C=this._rings.length,R;_<C;_++)R=$a(this._rings[_],a,!0),R.length&&this._parts.push(R)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(a){var d=!1,g,_,C,R,q,rt,ot,pt;if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(R=0,ot=this._parts.length;R<ot;R++)for(g=this._parts[R],q=0,pt=g.length,rt=pt-1;q<pt;rt=q++)_=g[q],C=g[rt],_.y>a.y!=C.y>a.y&&a.x<(C.x-_.x)*(a.y-_.y)/(C.y-_.y)+_.x&&(d=!d);return d||Yr.prototype._containsPoint.call(this,a,!0)}});function Wh(a,d){return new Ro(a,d)}var hi=mr.extend({initialize:function(a,d){p(this,d),this._layers={},a&&this.addData(a)},addData:function(a){var d=A(a)?a:a.features,g,_,C;if(d){for(g=0,_=d.length;g<_;g++)C=d[g],(C.geometries||C.geometry||C.features||C.coordinates)&&this.addData(C);return this}var R=this.options;if(R.filter&&!R.filter(a))return this;var q=Da(a,R);return q?(q.feature=za(a),q.defaultOptions=q.options,this.resetStyle(q),R.onEachFeature&&R.onEachFeature(a,q),this.addLayer(q)):this},resetStyle:function(a){return a===void 0?this.eachLayer(this.resetStyle,this):(a.options=i({},a.defaultOptions),this._setLayerStyle(a,this.options.style),this)},setStyle:function(a){return this.eachLayer(function(d){this._setLayerStyle(d,a)},this)},_setLayerStyle:function(a,d){a.setStyle&&(typeof d=="function"&&(d=d(a.feature)),a.setStyle(d))}});function Da(a,d){var g=a.type==="Feature"?a.geometry:a,_=g?g.coordinates:null,C=[],R=d&&d.pointToLayer,q=d&&d.coordsToLatLng||Mc,rt,ot,pt,Ot;if(!_&&!g)return null;switch(g.type){case"Point":return rt=q(_),Tm(R,a,rt,d);case"MultiPoint":for(pt=0,Ot=_.length;pt<Ot;pt++)rt=q(_[pt]),C.push(Tm(R,a,rt,d));return new mr(C);case"LineString":case"MultiLineString":return ot=yr(_,g.type==="LineString"?0:1,q),new Yr(ot,d);case"Polygon":case"MultiPolygon":return ot=yr(_,g.type==="Polygon"?1:2,q),new Ro(ot,d);case"GeometryCollection":for(pt=0,Ot=g.geometries.length;pt<Ot;pt++){var zt=Da({geometry:g.geometries[pt],type:"Feature",properties:a.properties},d);zt&&C.push(zt)}return new mr(C);case"FeatureCollection":for(pt=0,Ot=g.features.length;pt<Ot;pt++){var Nt=Da(g.features[pt],d);Nt&&C.push(Nt)}return new mr(C);default:throw new Error("Invalid GeoJSON object.")}}function Tm(a,d,g,_){return a?a(d,g):new ks(g,_&&_.markersInheritOptions&&_)}function Mc(a){return new yt(a[1],a[0],a[2])}function yr(a,d,g){for(var _=[],C=0,R=a.length,q;C<R;C++)q=d?yr(a[C],d-1,g):(g||Mc)(a[C]),_.push(q);return _}function Ba(a,d){return a=vt(a),a.alt!==void 0?[m(a.lng,d),m(a.lat,d),m(a.alt,d)]:[m(a.lng,d),m(a.lat,d)]}function $s(a,d,g,_){for(var C=[],R=0,q=a.length;R<q;R++)C.push(d?$s(a[R],Qn(a[R])?0:d-1,g,_):Ba(a[R],_));return!d&&g&&C.length>0&&C.push(C[0].slice()),C}function fi(a,d){return a.feature?i({},a.feature,{geometry:d}):za(d)}function za(a){return a.type==="Feature"||a.type==="FeatureCollection"?a:{type:"Feature",properties:{},geometry:a}}var kc={toGeoJSON:function(a){return fi(this,{type:"Point",coordinates:Ba(this.getLatLng(),a)})}};ks.include(kc),Io.include(kc),ui.include(kc),Yr.include({toGeoJSON:function(a){var d=!Qn(this._latlngs),g=$s(this._latlngs,d?1:0,!1,a);return fi(this,{type:(d?"Multi":"")+"LineString",coordinates:g})}}),Ro.include({toGeoJSON:function(a){var d=!Qn(this._latlngs),g=d&&!Qn(this._latlngs[0]),_=$s(this._latlngs,g?2:d?1:0,!0,a);return d||(_=[_]),fi(this,{type:(g?"Multi":"")+"Polygon",coordinates:_})}}),Gi.include({toMultiPoint:function(a){var d=[];return this.eachLayer(function(g){d.push(g.toGeoJSON(a).geometry.coordinates)}),fi(this,{type:"MultiPoint",coordinates:d})},toGeoJSON:function(a){var d=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(d==="MultiPoint")return this.toMultiPoint(a);var g=d==="GeometryCollection",_=[];return this.eachLayer(function(C){if(C.toGeoJSON){var R=C.toGeoJSON(a);if(g)_.push(R.geometry);else{var q=za(R);q.type==="FeatureCollection"?_.push.apply(_,q.features):_.push(q)}}}),g?fi(this,{geometries:_,type:"GeometryCollection"}):{type:"FeatureCollection",features:_}}});function Vh(a,d){return new hi(a,d)}var Em=Vh,Fa=tr.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(a,d,g){this._url=a,this._bounds=ct(d),p(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Rt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Kt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(a){return this.options.opacity=a,this._image&&this._updateOpacity(),this},setStyle:function(a){return a.opacity&&this.setOpacity(a.opacity),this},bringToFront:function(){return this._map&&be(this._image),this},bringToBack:function(){return this._map&&St(this._image),this},setUrl:function(a){return this._url=a,this._image&&(this._image.src=a),this},setBounds:function(a){return this._bounds=ct(a),this._map&&this._reset(),this},getEvents:function(){var a={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var a=this._url.tagName==="IMG",d=this._image=a?this._url:re("img");if(Rt(d,"leaflet-image-layer"),this._zoomAnimated&&Rt(d,"leaflet-zoom-animated"),this.options.className&&Rt(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onload=s(this.fire,this,"load"),d.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(d.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),a){this._url=d.src;return}d.src=this._url,d.alt=this.options.alt},_animateZoom:function(a){var d=this._map.getZoomScale(a.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,a.zoom,a.center).min;Ge(this._image,g,d)},_reset:function(){var a=this._image,d=new et(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=d.getSize();Ie(a,d.min),a.style.width=g.x+"px",a.style.height=g.y+"px"},_updateOpacity:function(){kn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var a=this.options.errorOverlayUrl;a&&this._url!==a&&(this._url=a,this._image.src=a)},getCenter:function(){return this._bounds.getCenter()}}),Sx=function(a,d,g){return new Fa(a,d,g)},Uh=Fa.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var a=this._url.tagName==="VIDEO",d=this._image=a?this._url:re("video");if(Rt(d,"leaflet-image-layer"),this._zoomAnimated&&Rt(d,"leaflet-zoom-animated"),this.options.className&&Rt(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onloadeddata=s(this.fire,this,"load"),a){for(var g=d.getElementsByTagName("source"),_=[],C=0;C<g.length;C++)_.push(g[C].src);this._url=g.length>0?_:[d.src];return}A(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(d.style,"objectFit")&&(d.style.objectFit="fill"),d.autoplay=!!this.options.autoplay,d.loop=!!this.options.loop,d.muted=!!this.options.muted,d.playsInline=!!this.options.playsInline;for(var R=0;R<this._url.length;R++){var q=re("source");q.src=this._url[R],d.appendChild(q)}}});function Cm(a,d,g){return new Uh(a,d,g)}var Hh=Fa.extend({_initImage:function(){var a=this._image=this._url;Rt(a,"leaflet-image-layer"),this._zoomAnimated&&Rt(a,"leaflet-zoom-animated"),this.options.className&&Rt(a,this.options.className),a.onselectstart=f,a.onmousemove=f}});function Om(a,d,g){return new Hh(a,d,g)}var vr=tr.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(a,d){a&&(a instanceof yt||A(a))?(this._latlng=vt(a),p(this,d)):(p(this,a),this._source=d),this.options.content&&(this._content=this.options.content)},openOn:function(a){return a=arguments.length?a:this._source._map,a.hasLayer(this)||a.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(a){return this._map?this.close():(arguments.length?this._source=a:a=this._source,this._prepareOpen(),this.openOn(a._map)),this},onAdd:function(a){this._zoomAnimated=a._zoomAnimated,this._container||this._initLayout(),a._fadeAnimated&&kn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),a._fadeAnimated&&kn(this._container,1),this.bringToFront(),this.options.interactive&&(Rt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(a){a._fadeAnimated?(kn(this._container,0),this._removeTimeout=setTimeout(s(Kt,void 0,this._container),200)):Kt(this._container),this.options.interactive&&(le(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=vt(a),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(a){return this._content=a,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var a={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&be(this._container),this},bringToBack:function(){return this._map&&St(this._container),this},_prepareOpen:function(a){var d=this._source;if(!d._map)return!1;if(d instanceof mr){d=null;var g=this._source._layers;for(var _ in g)if(g[_]._map){d=g[_];break}if(!d)return!1;this._source=d}if(!a)if(d.getCenter)a=d.getCenter();else if(d.getLatLng)a=d.getLatLng();else if(d.getBounds)a=d.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(a),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var a=this._contentNode,d=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof d=="string")a.innerHTML=d;else{for(;a.hasChildNodes();)a.removeChild(a.firstChild);a.appendChild(d)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),d=H(this.options.offset),g=this._getAnchor();this._zoomAnimated?Ie(this._container,a.add(g)):d=d.add(a).add(g);var _=this._containerBottom=-d.y,C=this._containerLeft=-Math.round(this._containerWidth/2)+d.x;this._container.style.bottom=_+"px",this._container.style.left=C+"px"}},_getAnchor:function(){return[0,0]}});pe.include({_initOverlay:function(a,d,g,_){var C=d;return C instanceof a||(C=new a(_).setContent(d)),g&&C.setLatLng(g),C}}),tr.include({_initOverlay:function(a,d,g,_){var C=g;return C instanceof a?(p(C,_),C._source=this):(C=d&&!_?d:new a(_,this),C.setContent(g)),C}});var Is=vr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(a){return a=arguments.length?a:this._source._map,!a.hasLayer(this)&&a._popup&&a._popup.options.autoClose&&a.removeLayer(a._popup),a._popup=this,vr.prototype.openOn.call(this,a)},onAdd:function(a){vr.prototype.onAdd.call(this,a),a.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Jt||this._source.on("preclick",Vi))},onRemove:function(a){vr.prototype.onRemove.call(this,a),a.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Jt||this._source.off("preclick",Vi))},getEvents:function(){var a=vr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(a.preclick=this.close),this.options.keepInView&&(a.moveend=this._adjustPan),a},_initLayout:function(){var a="leaflet-popup",d=this._container=re("div",a+" "+(this.options.className||"")+" leaflet-zoom-animated"),g=this._wrapper=re("div",a+"-content-wrapper",d);if(this._contentNode=re("div",a+"-content",g),Ui(d),li(this._contentNode),Ft(d,"contextmenu",Vi),this._tipContainer=re("div",a+"-tip-container",d),this._tip=re("div",a+"-tip",this._tipContainer),this.options.closeButton){var _=this._closeButton=re("a",a+"-close-button",d);_.setAttribute("role","button"),_.setAttribute("aria-label","Close popup"),_.href="#close",_.innerHTML='<span aria-hidden="true">&#215;</span>',Ft(_,"click",function(C){hn(C),this.close()},this)}},_updateLayout:function(){var a=this._contentNode,d=a.style;d.width="",d.whiteSpace="nowrap";var g=a.offsetWidth;g=Math.min(g,this.options.maxWidth),g=Math.max(g,this.options.minWidth),d.width=g+1+"px",d.whiteSpace="",d.height="";var _=a.offsetHeight,C=this.options.maxHeight,R="leaflet-popup-scrolled";C&&_>C?(d.height=C+"px",Rt(a,R)):le(a,R),this._containerWidth=this._container.offsetWidth},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center),g=this._getAnchor();Ie(this._container,d.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var a=this._map,d=parseInt(Mn(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+d,_=this._containerWidth,C=new X(this._containerLeft,-g-this._containerBottom);C._add(Ee(this._container));var R=a.layerPointToContainerPoint(C),q=H(this.options.autoPanPadding),rt=H(this.options.autoPanPaddingTopLeft||q),ot=H(this.options.autoPanPaddingBottomRight||q),pt=a.getSize(),Ot=0,zt=0;R.x+_+ot.x>pt.x&&(Ot=R.x+_-pt.x+ot.x),R.x-Ot-rt.x<0&&(Ot=R.x-rt.x),R.y+g+ot.y>pt.y&&(zt=R.y+g-pt.y+ot.y),R.y-zt-rt.y<0&&(zt=R.y-rt.y),(Ot||zt)&&(this.options.keepInView&&(this._autopanning=!0),a.fire("autopanstart").panBy([Ot,zt]))}},_getAnchor:function(){return H(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),qh=function(a,d){return new Is(a,d)};pe.mergeOptions({closePopupOnClick:!0}),pe.include({openPopup:function(a,d,g){return this._initOverlay(Is,a,d,g).openOn(this),this},closePopup:function(a){return a=arguments.length?a:this._popup,a&&a.close(),this}}),tr.include({bindPopup:function(a,d){return this._popup=this._initOverlay(Is,this._popup,a,d),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(a){return this._popup&&(this instanceof mr||(this._popup._source=this),this._popup._prepareOpen(a||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},getPopup:function(){return this._popup},_openPopup:function(a){if(!(!this._popup||!this._map)){jn(a);var d=a.layer||a.target;if(this._popup._source===d&&!(d instanceof Jt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(a.latlng);return}this._popup._source=d,this.openPopup(a.latlng)}},_movePopup:function(a){this._popup.setLatLng(a.latlng)},_onKeyPress:function(a){a.originalEvent.keyCode===13&&this._openPopup(a)}});var Rs=vr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(a){vr.prototype.onAdd.call(this,a),this.setOpacity(this.options.opacity),a.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(a){vr.prototype.onRemove.call(this,a),a.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var a=vr.prototype.getEvents.call(this);return this.options.permanent||(a.preclick=this.close),a},_initLayout:function(){var a="leaflet-tooltip",d=a+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=re("div",d),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(a){var d,g,_=this._map,C=this._container,R=_.latLngToContainerPoint(_.getCenter()),q=_.layerPointToContainerPoint(a),rt=this.options.direction,ot=C.offsetWidth,pt=C.offsetHeight,Ot=H(this.options.offset),zt=this._getAnchor();rt==="top"?(d=ot/2,g=pt):rt==="bottom"?(d=ot/2,g=0):rt==="center"?(d=ot/2,g=pt/2):rt==="right"?(d=0,g=pt/2):rt==="left"?(d=ot,g=pt/2):q.x<R.x?(rt="right",d=0,g=pt/2):(rt="left",d=ot+(Ot.x+zt.x)*2,g=pt/2),a=a.subtract(H(d,g,!0)).add(Ot).add(zt),le(C,"leaflet-tooltip-right"),le(C,"leaflet-tooltip-left"),le(C,"leaflet-tooltip-top"),le(C,"leaflet-tooltip-bottom"),Rt(C,"leaflet-tooltip-"+rt),Ie(C,a)},_updatePosition:function(){var a=this._map.latLngToLayerPoint(this._latlng);this._setPosition(a)},setOpacity:function(a){this.options.opacity=a,this._container&&kn(this._container,a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);this._setPosition(d)},_getAnchor:function(){return H(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Gh=function(a,d){return new Rs(a,d)};pe.include({openTooltip:function(a,d,g){return this._initOverlay(Rs,a,d,g).openOn(this),this},closeTooltip:function(a){return a.close(),this}}),tr.include({bindTooltip:function(a,d){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Rs,this._tooltip,a,d),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(a){if(!(!a&&this._tooltipHandlersAdded)){var d=a?"off":"on",g={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?g.add=this._openTooltip:(g.mouseover=this._openTooltip,g.mouseout=this.closeTooltip,g.click=this._openTooltip,this._map?this._addFocusListeners():g.add=this._addFocusListeners),this._tooltip.options.sticky&&(g.mousemove=this._moveTooltip),this[d](g),this._tooltipHandlersAdded=!a}},openTooltip:function(a){return this._tooltip&&(this instanceof mr||(this._tooltip._source=this),this._tooltip._prepareOpen(a)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(a){return this._tooltip&&this._tooltip.setContent(a),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&(Ft(d,"focus",function(){this._tooltip._source=a,this.openTooltip()},this),Ft(d,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&d.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(a){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var d=this;this._map.once("moveend",function(){d._openOnceFlag=!1,d._openTooltip(a)});return}this._tooltip._source=a.layer||a.target,this.openTooltip(this._tooltip.options.sticky?a.latlng:void 0)}},_moveTooltip:function(a){var d=a.latlng,g,_;this._tooltip.options.sticky&&a.originalEvent&&(g=this._map.mouseEventToContainerPoint(a.originalEvent),_=this._map.containerPointToLayerPoint(g),d=this._map.layerPointToLatLng(_)),this._tooltip.setLatLng(d)}});var $c=gr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(a){var d=a&&a.tagName==="DIV"?a:document.createElement("div"),g=this.options;if(g.html instanceof Element?(hr(d),d.appendChild(g.html)):d.innerHTML=g.html!==!1?g.html:"",g.bgPos){var _=H(g.bgPos);d.style.backgroundPosition=-_.x+"px "+-_.y+"px"}return this._setIconStyles(d,"icon"),d},createShadow:function(){return null}});function Zh(a){return new $c(a)}gr.Default=$o;var Lo=tr.extend({options:{tileSize:256,opacity:1,updateWhenIdle:It.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(a){p(this,a)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(a){a._addZoomLimit(this)},onRemove:function(a){this._removeAllTiles(),Kt(this._container),a._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(be(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(St(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var a=this._clampZoom(this._map.getZoom());a!==this._tileZoom&&(this._tileZoom=a,this._updateLevels()),this._update()}return this},getEvents:function(){var a={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=h(this._onMoveEnd,this.options.updateInterval,this)),a.move=this._onMove),this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},createTile:function(){return document.createElement("div")},getTileSize:function(){var a=this.options.tileSize;return a instanceof X?a:new X(a,a)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a){for(var d=this.getPane().children,g=-a(-1/0,1/0),_=0,C=d.length,R;_<C;_++)R=d[_].style.zIndex,d[_]!==this._container&&R&&(g=a(g,+R));isFinite(g)&&(this.options.zIndex=g+a(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!It.ielt9){kn(this._container,this.options.opacity);var a=+new Date,d=!1,g=!1;for(var _ in this._tiles){var C=this._tiles[_];if(!(!C.current||!C.loaded)){var R=Math.min(1,(a-C.loaded)/200);kn(C.el,R),R<1?d=!0:(C.active?g=!0:this._onOpaqueTile(C),C.active=!0)}}g&&!this._noPrune&&this._pruneTiles(),d&&(j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this))}},_onOpaqueTile:f,_initContainer:function(){this._container||(this._container=re("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var a=this._tileZoom,d=this.options.maxZoom;if(a!==void 0){for(var g in this._levels)g=Number(g),this._levels[g].el.children.length||g===a?(this._levels[g].el.style.zIndex=d-Math.abs(a-g),this._onUpdateLevel(g)):(Kt(this._levels[g].el),this._removeTilesAtZoom(g),this._onRemoveLevel(g),delete this._levels[g]);var _=this._levels[a],C=this._map;return _||(_=this._levels[a]={},_.el=re("div","leaflet-tile-container leaflet-zoom-animated",this._container),_.el.style.zIndex=d,_.origin=C.project(C.unproject(C.getPixelOrigin()),a).round(),_.zoom=a,this._setZoomTransform(_,C.getCenter(),C.getZoom()),f(_.el.offsetWidth),this._onCreateLevel(_)),this._level=_,_}},_onUpdateLevel:f,_onRemoveLevel:f,_onCreateLevel:f,_pruneTiles:function(){if(this._map){var a,d,g=this._map.getZoom();if(g>this.options.maxZoom||g<this.options.minZoom){this._removeAllTiles();return}for(a in this._tiles)d=this._tiles[a],d.retain=d.current;for(a in this._tiles)if(d=this._tiles[a],d.current&&!d.active){var _=d.coords;this._retainParent(_.x,_.y,_.z,_.z-5)||this._retainChildren(_.x,_.y,_.z,_.z+2)}for(a in this._tiles)this._tiles[a].retain||this._removeTile(a)}},_removeTilesAtZoom:function(a){for(var d in this._tiles)this._tiles[d].coords.z===a&&this._removeTile(d)},_removeAllTiles:function(){for(var a in this._tiles)this._removeTile(a)},_invalidateAll:function(){for(var a in this._levels)Kt(this._levels[a].el),this._onRemoveLevel(Number(a)),delete this._levels[a];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(a,d,g,_){var C=Math.floor(a/2),R=Math.floor(d/2),q=g-1,rt=new X(+C,+R);rt.z=+q;var ot=this._tileCoordsToKey(rt),pt=this._tiles[ot];return pt&&pt.active?(pt.retain=!0,!0):(pt&&pt.loaded&&(pt.retain=!0),q>_?this._retainParent(C,R,q,_):!1)},_retainChildren:function(a,d,g,_){for(var C=2*a;C<2*a+2;C++)for(var R=2*d;R<2*d+2;R++){var q=new X(C,R);q.z=g+1;var rt=this._tileCoordsToKey(q),ot=this._tiles[rt];if(ot&&ot.active){ot.retain=!0;continue}else ot&&ot.loaded&&(ot.retain=!0);g+1<_&&this._retainChildren(C,R,g+1,_)}},_resetView:function(a){var d=a&&(a.pinch||a.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),d,d)},_animateZoom:function(a){this._setView(a.center,a.zoom,!0,a.noUpdate)},_clampZoom:function(a){var d=this.options;return d.minNativeZoom!==void 0&&a<d.minNativeZoom?d.minNativeZoom:d.maxNativeZoom!==void 0&&d.maxNativeZoom<a?d.maxNativeZoom:a},_setView:function(a,d,g,_){var C=Math.round(d);this.options.maxZoom!==void 0&&C>this.options.maxZoom||this.options.minZoom!==void 0&&C<this.options.minZoom?C=void 0:C=this._clampZoom(C);var R=this.options.updateWhenZooming&&C!==this._tileZoom;(!_||R)&&(this._tileZoom=C,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),C!==void 0&&this._update(a),g||this._pruneTiles(),this._noPrune=!!g),this._setZoomTransforms(a,d)},_setZoomTransforms:function(a,d){for(var g in this._levels)this._setZoomTransform(this._levels[g],a,d)},_setZoomTransform:function(a,d,g){var _=this._map.getZoomScale(g,a.zoom),C=a.origin.multiplyBy(_).subtract(this._map._getNewPixelOrigin(d,g)).round();It.any3d?Ge(a.el,C,_):Ie(a.el,C)},_resetGrid:function(){var a=this._map,d=a.options.crs,g=this._tileSize=this.getTileSize(),_=this._tileZoom,C=this._map.getPixelWorldBounds(this._tileZoom);C&&(this._globalTileRange=this._pxBoundsToTileRange(C)),this._wrapX=d.wrapLng&&!this.options.noWrap&&[Math.floor(a.project([0,d.wrapLng[0]],_).x/g.x),Math.ceil(a.project([0,d.wrapLng[1]],_).x/g.y)],this._wrapY=d.wrapLat&&!this.options.noWrap&&[Math.floor(a.project([d.wrapLat[0],0],_).y/g.x),Math.ceil(a.project([d.wrapLat[1],0],_).y/g.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(a){var d=this._map,g=d._animatingZoom?Math.max(d._animateToZoom,d.getZoom()):d.getZoom(),_=d.getZoomScale(g,this._tileZoom),C=d.project(a,this._tileZoom).floor(),R=d.getSize().divideBy(_*2);return new et(C.subtract(R),C.add(R))},_update:function(a){var d=this._map;if(d){var g=this._clampZoom(d.getZoom());if(a===void 0&&(a=d.getCenter()),this._tileZoom!==void 0){var _=this._getTiledPixelBounds(a),C=this._pxBoundsToTileRange(_),R=C.getCenter(),q=[],rt=this.options.keepBuffer,ot=new et(C.getBottomLeft().subtract([rt,-rt]),C.getTopRight().add([rt,-rt]));if(!(isFinite(C.min.x)&&isFinite(C.min.y)&&isFinite(C.max.x)&&isFinite(C.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var pt in this._tiles){var Ot=this._tiles[pt].coords;(Ot.z!==this._tileZoom||!ot.contains(new X(Ot.x,Ot.y)))&&(this._tiles[pt].current=!1)}if(Math.abs(g-this._tileZoom)>1){this._setView(a,g);return}for(var zt=C.min.y;zt<=C.max.y;zt++)for(var Nt=C.min.x;Nt<=C.max.x;Nt++){var _t=new X(Nt,zt);if(_t.z=this._tileZoom,!!this._isValidTile(_t)){var jt=this._tiles[this._tileCoordsToKey(_t)];jt?jt.current=!0:q.push(_t)}}if(q.sort(function(ue,Oe){return ue.distanceTo(R)-Oe.distanceTo(R)}),q.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Gt=document.createDocumentFragment();for(Nt=0;Nt<q.length;Nt++)this._addTile(q[Nt],Gt);this._level.el.appendChild(Gt)}}}},_isValidTile:function(a){var d=this._map.options.crs;if(!d.infinite){var g=this._globalTileRange;if(!d.wrapLng&&(a.x<g.min.x||a.x>g.max.x)||!d.wrapLat&&(a.y<g.min.y||a.y>g.max.y))return!1}if(!this.options.bounds)return!0;var _=this._tileCoordsToBounds(a);return ct(this.options.bounds).overlaps(_)},_keyToBounds:function(a){return this._tileCoordsToBounds(this._keyToTileCoords(a))},_tileCoordsToNwSe:function(a){var d=this._map,g=this.getTileSize(),_=a.scaleBy(g),C=_.add(g),R=d.unproject(_,a.z),q=d.unproject(C,a.z);return[R,q]},_tileCoordsToBounds:function(a){var d=this._tileCoordsToNwSe(a),g=new st(d[0],d[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(a){return a.x+":"+a.y+":"+a.z},_keyToTileCoords:function(a){var d=a.split(":"),g=new X(+d[0],+d[1]);return g.z=+d[2],g},_removeTile:function(a){var d=this._tiles[a];d&&(Kt(d.el),delete this._tiles[a],this.fire("tileunload",{tile:d.el,coords:this._keyToTileCoords(a)}))},_initTile:function(a){Rt(a,"leaflet-tile");var d=this.getTileSize();a.style.width=d.x+"px",a.style.height=d.y+"px",a.onselectstart=f,a.onmousemove=f,It.ielt9&&this.options.opacity<1&&kn(a,this.options.opacity)},_addTile:function(a,d){var g=this._getTilePos(a),_=this._tileCoordsToKey(a),C=this.createTile(this._wrapCoords(a),s(this._tileReady,this,a));this._initTile(C),this.createTile.length<2&&D(s(this._tileReady,this,a,null,C)),Ie(C,g),this._tiles[_]={el:C,coords:a,current:!0},d.appendChild(C),this.fire("tileloadstart",{tile:C,coords:a})},_tileReady:function(a,d,g){d&&this.fire("tileerror",{error:d,tile:g,coords:a});var _=this._tileCoordsToKey(a);g=this._tiles[_],g&&(g.loaded=+new Date,this._map._fadeAnimated?(kn(g.el,0),j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),d||(Rt(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:a})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),It.ielt9||!this._map._fadeAnimated?D(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(a){return a.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(a){var d=new X(this._wrapX?u(a.x,this._wrapX):a.x,this._wrapY?u(a.y,this._wrapY):a.y);return d.z=a.z,d},_pxBoundsToTileRange:function(a){var d=this.getTileSize();return new et(a.min.unscaleBy(d).floor(),a.max.unscaleBy(d).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var a in this._tiles)if(!this._tiles[a].loaded)return!1;return!0}});function Yh(a){return new Lo(a)}var Yi=Lo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(a,d){this._url=a,d=p(this,d),d.detectRetina&&It.retina&&d.maxZoom>0?(d.tileSize=Math.floor(d.tileSize/2),d.zoomReverse?(d.zoomOffset--,d.minZoom=Math.min(d.maxZoom,d.minZoom+1)):(d.zoomOffset++,d.maxZoom=Math.max(d.minZoom,d.maxZoom-1)),d.minZoom=Math.max(0,d.minZoom)):d.zoomReverse?d.minZoom=Math.min(d.maxZoom,d.minZoom):d.maxZoom=Math.max(d.minZoom,d.maxZoom),typeof d.subdomains=="string"&&(d.subdomains=d.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(a,d){return this._url===a&&d===void 0&&(d=!0),this._url=a,d||this.redraw(),this},createTile:function(a,d){var g=document.createElement("img");return Ft(g,"load",s(this._tileOnLoad,this,d,g)),Ft(g,"error",s(this._tileOnError,this,d,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(a),g},getTileUrl:function(a){var d={r:It.retina?"@2x":"",s:this._getSubdomain(a),x:a.x,y:a.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-a.y;this.options.tms&&(d.y=g),d["-y"]=g}return S(this._url,i(d,this.options))},_tileOnLoad:function(a,d){It.ielt9?setTimeout(s(a,this,null,d),0):a(null,d)},_tileOnError:function(a,d,g){var _=this.options.errorTileUrl;_&&d.getAttribute("src")!==_&&(d.src=_),a(g,d)},_onTileRemove:function(a){a.tile.onload=null},_getZoomForUrl:function(){var a=this._tileZoom,d=this.options.maxZoom,g=this.options.zoomReverse,_=this.options.zoomOffset;return g&&(a=d-a),a+_},_getSubdomain:function(a){var d=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[d]},_abortLoading:function(){var a,d;for(a in this._tiles)if(this._tiles[a].coords.z!==this._tileZoom&&(d=this._tiles[a].el,d.onload=f,d.onerror=f,!d.complete)){d.src=w;var g=this._tiles[a].coords;Kt(d),delete this._tiles[a],this.fire("tileabort",{tile:d,coords:g})}},_removeTile:function(a){var d=this._tiles[a];if(d)return d.el.setAttribute("src",w),Lo.prototype._removeTile.call(this,a)},_tileReady:function(a,d,g){if(!(!this._map||g&&g.getAttribute("src")===w))return Lo.prototype._tileReady.call(this,a,d,g)}});function Ic(a,d){return new Yi(a,d)}var Rc=Yi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(a,d){this._url=a;var g=i({},this.defaultWmsParams);for(var _ in d)_ in this.options||(g[_]=d[_]);d=p(this,d);var C=d.detectRetina&&It.retina?2:1,R=this.getTileSize();g.width=R.x*C,g.height=R.y*C,this.wmsParams=g},onAdd:function(a){this._crs=this.options.crs||a.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var d=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[d]=this._crs.code,Yi.prototype.onAdd.call(this,a)},getTileUrl:function(a){var d=this._tileCoordsToNwSe(a),g=this._crs,_=it(g.project(d[0]),g.project(d[1])),C=_.min,R=_.max,q=(this._wmsVersion>=1.3&&this._crs===Tc?[C.y,C.x,R.y,R.x]:[C.x,C.y,R.x,R.y]).join(","),rt=Yi.prototype.getTileUrl.call(this,a);return rt+b(this.wmsParams,rt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+q},setParams:function(a,d){return i(this.wmsParams,a),d||this.redraw(),this}});function Kh(a,d){return new Rc(a,d)}Yi.WMS=Rc,Ic.wms=Kh;var Mr=tr.extend({options:{padding:.1},initialize:function(a){p(this,a),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Rt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var a={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(a.zoomanim=this._onAnimZoom),a},_onAnimZoom:function(a){this._updateTransform(a.center,a.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(a,d){var g=this._map.getZoomScale(d,this._zoom),_=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,d),R=_.multiplyBy(-g).add(C).subtract(this._map._getNewPixelOrigin(a,d));It.any3d?Ge(this._container,R,g):Ie(this._container,R)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var a in this._layers)this._layers[a]._reset()},_onZoomEnd:function(){for(var a in this._layers)this._layers[a]._project()},_updatePaths:function(){for(var a in this._layers)this._layers[a]._update()},_update:function(){var a=this.options.padding,d=this._map.getSize(),g=this._map.containerPointToLayerPoint(d.multiplyBy(-a)).round();this._bounds=new et(g,g.add(d.multiplyBy(1+a*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Lc=Mr.extend({options:{tolerance:0},getEvents:function(){var a=Mr.prototype.getEvents.call(this);return a.viewprereset=this._onViewPreReset,a},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Mr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var a=this._container=document.createElement("canvas");Ft(a,"mousemove",this._onMouseMove,this),Ft(a,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ft(a,"mouseout",this._handleMouseOut,this),a._leaflet_disable_events=!0,this._ctx=a.getContext("2d")},_destroyContainer:function(){j(this._redrawRequest),delete this._ctx,Kt(this._container),Ce(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var a;this._redrawBounds=null;for(var d in this._layers)a=this._layers[d],a._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=this._container,g=a.getSize(),_=It.retina?2:1;Ie(d,a.min),d.width=_*g.x,d.height=_*g.y,d.style.width=g.x+"px",d.style.height=g.y+"px",It.retina&&this._ctx.scale(2,2),this._ctx.translate(-a.min.x,-a.min.y),this.fire("update")}},_reset:function(){Mr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(a){this._updateDashArray(a),this._layers[c(a)]=a;var d=a._order={layer:a,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=d),this._drawLast=d,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(a){this._requestRedraw(a)},_removePath:function(a){var d=a._order,g=d.next,_=d.prev;g?g.prev=_:this._drawLast=_,_?_.next=g:this._drawFirst=g,delete a._order,delete this._layers[c(a)],this._requestRedraw(a)},_updatePath:function(a){this._extendRedrawBounds(a),a._project(),a._update(),this._requestRedraw(a)},_updateStyle:function(a){this._updateDashArray(a),this._requestRedraw(a)},_updateDashArray:function(a){if(typeof a.options.dashArray=="string"){var d=a.options.dashArray.split(/[, ]+/),g=[],_,C;for(C=0;C<d.length;C++){if(_=Number(d[C]),isNaN(_))return;g.push(_)}a.options._dashArray=g}else a.options._dashArray=a.options.dashArray},_requestRedraw:function(a){this._map&&(this._extendRedrawBounds(a),this._redrawRequest=this._redrawRequest||D(this._redraw,this))},_extendRedrawBounds:function(a){if(a._pxBounds){var d=(a.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new et,this._redrawBounds.extend(a._pxBounds.min.subtract([d,d])),this._redrawBounds.extend(a._pxBounds.max.add([d,d]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var a=this._redrawBounds;if(a){var d=a.getSize();this._ctx.clearRect(a.min.x,a.min.y,d.x,d.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var a,d=this._redrawBounds;if(this._ctx.save(),d){var g=d.getSize();this._ctx.beginPath(),this._ctx.rect(d.min.x,d.min.y,g.x,g.y),this._ctx.clip()}this._drawing=!0;for(var _=this._drawFirst;_;_=_.next)a=_.layer,(!d||a._pxBounds&&a._pxBounds.intersects(d))&&a._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(a,d){if(this._drawing){var g,_,C,R,q=a._parts,rt=q.length,ot=this._ctx;if(rt){for(ot.beginPath(),g=0;g<rt;g++){for(_=0,C=q[g].length;_<C;_++)R=q[g][_],ot[_?"lineTo":"moveTo"](R.x,R.y);d&&ot.closePath()}this._fillStroke(ot,a)}}},_updateCircle:function(a){if(!(!this._drawing||a._empty())){var d=a._point,g=this._ctx,_=Math.max(Math.round(a._radius),1),C=(Math.max(Math.round(a._radiusY),1)||_)/_;C!==1&&(g.save(),g.scale(1,C)),g.beginPath(),g.arc(d.x,d.y/C,_,0,Math.PI*2,!1),C!==1&&g.restore(),this._fillStroke(g,a)}},_fillStroke:function(a,d){var g=d.options;g.fill&&(a.globalAlpha=g.fillOpacity,a.fillStyle=g.fillColor||g.color,a.fill(g.fillRule||"evenodd")),g.stroke&&g.weight!==0&&(a.setLineDash&&a.setLineDash(d.options&&d.options._dashArray||[]),a.globalAlpha=g.opacity,a.lineWidth=g.weight,a.strokeStyle=g.color,a.lineCap=g.lineCap,a.lineJoin=g.lineJoin,a.stroke())},_onClick:function(a){for(var d=this._map.mouseEventToLayerPoint(a),g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(!(a.type==="click"||a.type==="preclick")||!this._map._draggableMoved(g))&&(_=g);this._fireEvent(_?[_]:!1,a)},_onMouseMove:function(a){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var d=this._map.mouseEventToLayerPoint(a);this._handleMouseHover(a,d)}},_handleMouseOut:function(a){var d=this._hoveredLayer;d&&(le(this._container,"leaflet-interactive"),this._fireEvent([d],a,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(a,d){if(!this._mouseHoverThrottled){for(var g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(_=g);_!==this._hoveredLayer&&(this._handleMouseOut(a),_&&(Rt(this._container,"leaflet-interactive"),this._fireEvent([_],a,"mouseover"),this._hoveredLayer=_)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,a),this._mouseHoverThrottled=!0,setTimeout(s(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(a,d,g){this._map._fireDOMEvent(d,g||d.type,a)},_bringToFront:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(g)g.prev=_;else return;_?_.next=g:g&&(this._drawFirst=g),d.prev=this._drawLast,this._drawLast.next=d,d.next=null,this._drawLast=d,this._requestRedraw(a)}},_bringToBack:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(_)_.next=g;else return;g?g.prev=_:_&&(this._drawLast=_),d.prev=null,d.next=this._drawFirst,this._drawFirst.prev=d,this._drawFirst=d,this._requestRedraw(a)}}});function Nc(a){return It.canvas?new Lc(a):null}var M=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return document.createElement("<lvml:"+a+' class="lvml">')}}catch{}return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),$={_initContainer:function(){this._container=re("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Mr.prototype._update.call(this),this.fire("update"))},_initPath:function(a){var d=a._container=M("shape");Rt(d,"leaflet-vml-shape "+(this.options.className||"")),d.coordsize="1 1",a._path=M("path"),d.appendChild(a._path),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){var d=a._container;this._container.appendChild(d),a.options.interactive&&a.addInteractiveTarget(d)},_removePath:function(a){var d=a._container;Kt(d),a.removeInteractiveTarget(d),delete this._layers[c(a)]},_updateStyle:function(a){var d=a._stroke,g=a._fill,_=a.options,C=a._container;C.stroked=!!_.stroke,C.filled=!!_.fill,_.stroke?(d||(d=a._stroke=M("stroke")),C.appendChild(d),d.weight=_.weight+"px",d.color=_.color,d.opacity=_.opacity,_.dashArray?d.dashStyle=A(_.dashArray)?_.dashArray.join(" "):_.dashArray.replace(/( *, *)/g," "):d.dashStyle="",d.endcap=_.lineCap.replace("butt","flat"),d.joinstyle=_.lineJoin):d&&(C.removeChild(d),a._stroke=null),_.fill?(g||(g=a._fill=M("fill")),C.appendChild(g),g.color=_.fillColor||_.color,g.opacity=_.fillOpacity):g&&(C.removeChild(g),a._fill=null)},_updateCircle:function(a){var d=a._point.round(),g=Math.round(a._radius),_=Math.round(a._radiusY||g);this._setPath(a,a._empty()?"M0 0":"AL "+d.x+","+d.y+" "+g+","+_+" 0,"+65535*360)},_setPath:function(a,d){a._path.v=d},_bringToFront:function(a){be(a._container)},_bringToBack:function(a){St(a._container)}},k=It.vml?M:me,Z=Mr.extend({_initContainer:function(){this._container=k("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=k("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Kt(this._container),Ce(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=a.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(d))&&(this._svgSize=d,g.setAttribute("width",d.x),g.setAttribute("height",d.y)),Ie(g,a.min),g.setAttribute("viewBox",[a.min.x,a.min.y,d.x,d.y].join(" ")),this.fire("update")}},_initPath:function(a){var d=a._path=k("path");a.options.className&&Rt(d,a.options.className),a.options.interactive&&Rt(d,"leaflet-interactive"),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(a._path),a.addInteractiveTarget(a._path)},_removePath:function(a){Kt(a._path),a.removeInteractiveTarget(a._path),delete this._layers[c(a)]},_updatePath:function(a){a._project(),a._update()},_updateStyle:function(a){var d=a._path,g=a.options;d&&(g.stroke?(d.setAttribute("stroke",g.color),d.setAttribute("stroke-opacity",g.opacity),d.setAttribute("stroke-width",g.weight),d.setAttribute("stroke-linecap",g.lineCap),d.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?d.setAttribute("stroke-dasharray",g.dashArray):d.removeAttribute("stroke-dasharray"),g.dashOffset?d.setAttribute("stroke-dashoffset",g.dashOffset):d.removeAttribute("stroke-dashoffset")):d.setAttribute("stroke","none"),g.fill?(d.setAttribute("fill",g.fillColor||g.color),d.setAttribute("fill-opacity",g.fillOpacity),d.setAttribute("fill-rule",g.fillRule||"evenodd")):d.setAttribute("fill","none"))},_updatePoly:function(a,d){this._setPath(a,ie(a._parts,d))},_updateCircle:function(a){var d=a._point,g=Math.max(Math.round(a._radius),1),_=Math.max(Math.round(a._radiusY),1)||g,C="a"+g+","+_+" 0 1,0 ",R=a._empty()?"M0 0":"M"+(d.x-g)+","+d.y+C+g*2+",0 "+C+-g*2+",0 ";this._setPath(a,R)},_setPath:function(a,d){a._path.setAttribute("d",d)},_bringToFront:function(a){be(a._path)},_bringToBack:function(a){St(a._path)}});It.vml&&Z.include($);function B(a){return It.svg||It.vml?new Z(a):null}pe.include({getRenderer:function(a){var d=a.options.renderer||this._getPaneRenderer(a.options.pane)||this.options.renderer||this._renderer;return d||(d=this._renderer=this._createRenderer()),this.hasLayer(d)||this.addLayer(d),d},_getPaneRenderer:function(a){if(a==="overlayPane"||a===void 0)return!1;var d=this._paneRenderers[a];return d===void 0&&(d=this._createRenderer({pane:a}),this._paneRenderers[a]=d),d},_createRenderer:function(a){return this.options.preferCanvas&&Nc(a)||B(a)}});var W=Ro.extend({initialize:function(a,d){Ro.prototype.initialize.call(this,this._boundsToLatLngs(a),d)},setBounds:function(a){return this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=ct(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}});function tt(a,d){return new W(a,d)}Z.create=k,Z.pointsToPath=ie,hi.geometryToLayer=Da,hi.coordsToLatLng=Mc,hi.coordsToLatLngs=yr,hi.latLngToCoords=Ba,hi.latLngsToCoords=$s,hi.getFeature=fi,hi.asFeature=za,pe.mergeOptions({boxZoom:!0});var Q=Jn.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane,this._resetStateTimeout=0,a.on("unload",this._destroy,this)},addHooks:function(){Ft(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ce(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Kt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(a){if(!a.shiftKey||a.which!==1&&a.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ws(),Cr(),this._startPoint=this._map.mouseEventToContainerPoint(a),Ft(document,{contextmenu:jn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(a){this._moved||(this._moved=!0,this._box=re("div","leaflet-zoom-box",this._container),Rt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(a);var d=new et(this._point,this._startPoint),g=d.getSize();Ie(this._box,d.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(Kt(this._box),le(this._container,"leaflet-crosshair")),Hr(),Co(),Ce(document,{contextmenu:jn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(a){if(!(a.which!==1&&a.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var d=new st(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(d).fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){a.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});pe.addInitHook("addHandler","boxZoom",Q),pe.mergeOptions({doubleClickZoom:!0});var J=Jn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(a){var d=this._map,g=d.getZoom(),_=d.options.zoomDelta,C=a.originalEvent.shiftKey?g-_:g+_;d.options.doubleClickZoom==="center"?d.setZoom(C):d.setZoomAround(a.containerPoint,C)}});pe.addInitHook("addHandler","doubleClickZoom",J),pe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var at=Jn.extend({addHooks:function(){if(!this._draggable){var a=this._map;this._draggable=new ci(a._mapPane,a._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),a.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),a.on("zoomend",this._onZoomEnd,this),a.whenReady(this._onZoomEnd,this))}Rt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){le(this._map._container,"leaflet-grab"),le(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var a=this._map;if(a._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var d=ct(this._map.options.maxBounds);this._offsetLimit=it(this._map.latLngToContainerPoint(d.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(d.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;a.fire("movestart").fire("dragstart"),a.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(a){if(this._map.options.inertia){var d=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(d),this._prunePositions(d)}this._map.fire("move",a).fire("drag",a)},_prunePositions:function(a){for(;this._positions.length>1&&a-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var a=this._map.getSize().divideBy(2),d=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=d.subtract(a).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(a,d){return a-(a-d)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var a=this._draggable._newPos.subtract(this._draggable._startPos),d=this._offsetLimit;a.x<d.min.x&&(a.x=this._viscousLimit(a.x,d.min.x)),a.y<d.min.y&&(a.y=this._viscousLimit(a.y,d.min.y)),a.x>d.max.x&&(a.x=this._viscousLimit(a.x,d.max.x)),a.y>d.max.y&&(a.y=this._viscousLimit(a.y,d.max.y)),this._draggable._newPos=this._draggable._startPos.add(a)}},_onPreDragWrap:function(){var a=this._worldWidth,d=Math.round(a/2),g=this._initialWorldOffset,_=this._draggable._newPos.x,C=(_-d+g)%a+d-g,R=(_+d+g)%a-d-g,q=Math.abs(C+g)<Math.abs(R+g)?C:R;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=q},_onDragEnd:function(a){var d=this._map,g=d.options,_=!g.inertia||a.noInertia||this._times.length<2;if(d.fire("dragend",a),_)d.fire("moveend");else{this._prunePositions(+new Date);var C=this._lastPos.subtract(this._positions[0]),R=(this._lastTime-this._times[0])/1e3,q=g.easeLinearity,rt=C.multiplyBy(q/R),ot=rt.distanceTo([0,0]),pt=Math.min(g.inertiaMaxSpeed,ot),Ot=rt.multiplyBy(pt/ot),zt=pt/(g.inertiaDeceleration*q),Nt=Ot.multiplyBy(-zt/2).round();!Nt.x&&!Nt.y?d.fire("moveend"):(Nt=d._limitOffset(Nt,d.options.maxBounds),D(function(){d.panBy(Nt,{duration:zt,easeLinearity:q,noMoveStart:!0,animate:!0})}))}}});pe.addInitHook("addHandler","dragging",at),pe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ut=Jn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(a){this._map=a,this._setPanDelta(a.options.keyboardPanDelta),this._setZoomDelta(a.options.zoomDelta)},addHooks:function(){var a=this._map._container;a.tabIndex<=0&&(a.tabIndex="0"),Ft(a,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ce(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var a=document.body,d=document.documentElement,g=a.scrollTop||d.scrollTop,_=a.scrollLeft||d.scrollLeft;this._map._container.focus(),window.scrollTo(_,g)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(a){var d=this._panKeys={},g=this.keyCodes,_,C;for(_=0,C=g.left.length;_<C;_++)d[g.left[_]]=[-1*a,0];for(_=0,C=g.right.length;_<C;_++)d[g.right[_]]=[a,0];for(_=0,C=g.down.length;_<C;_++)d[g.down[_]]=[0,a];for(_=0,C=g.up.length;_<C;_++)d[g.up[_]]=[0,-1*a]},_setZoomDelta:function(a){var d=this._zoomKeys={},g=this.keyCodes,_,C;for(_=0,C=g.zoomIn.length;_<C;_++)d[g.zoomIn[_]]=a;for(_=0,C=g.zoomOut.length;_<C;_++)d[g.zoomOut[_]]=-a},_addHooks:function(){Ft(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ce(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){var d=a.keyCode,g=this._map,_;if(d in this._panKeys){if(!g._panAnim||!g._panAnim._inProgress)if(_=this._panKeys[d],a.shiftKey&&(_=H(_).multiplyBy(3)),g.options.maxBounds&&(_=g._limitOffset(H(_),g.options.maxBounds)),g.options.worldCopyJump){var C=g.wrapLatLng(g.unproject(g.project(g.getCenter()).add(_)));g.panTo(C)}else g.panBy(_)}else if(d in this._zoomKeys)g.setZoom(g.getZoom()+(a.shiftKey?3:1)*this._zoomKeys[d]);else if(d===27&&g._popup&&g._popup.options.closeOnEscapeKey)g.closePopup();else return;jn(a)}}});pe.addInitHook("addHandler","keyboard",ut),pe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var gt=Jn.extend({addHooks:function(){Ft(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ce(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(a){var d=fr(a),g=this._map.options.wheelDebounceTime;this._delta+=d,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var _=Math.max(g-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),_),jn(a)},_performZoom:function(){var a=this._map,d=a.getZoom(),g=this._map.options.zoomSnap||0;a._stop();var _=this._delta/(this._map.options.wheelPxPerZoomLevel*4),C=4*Math.log(2/(1+Math.exp(-Math.abs(_))))/Math.LN2,R=g?Math.ceil(C/g)*g:C,q=a._limitZoom(d+(this._delta>0?R:-R))-d;this._delta=0,this._startTime=null,q&&(a.options.scrollWheelZoom==="center"?a.setZoom(d+q):a.setZoomAround(this._lastMousePos,d+q))}});pe.addInitHook("addHandler","scrollWheelZoom",gt);var xt=600;pe.mergeOptions({tapHold:It.touchNative&&It.safari&&It.mobile,tapTolerance:15});var Mt=Jn.extend({addHooks:function(){Ft(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ce(this._map._container,"touchstart",this._onDown,this)},_onDown:function(a){if(clearTimeout(this._holdTimeout),a.touches.length===1){var d=a.touches[0];this._startPos=this._newPos=new X(d.clientX,d.clientY),this._holdTimeout=setTimeout(s(function(){this._cancel(),this._isTapValid()&&(Ft(document,"touchend",hn),Ft(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",d))},this),xt),Ft(document,"touchend touchcancel contextmenu",this._cancel,this),Ft(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function a(){Ce(document,"touchend",hn),Ce(document,"touchend touchcancel",a)},_cancel:function(){clearTimeout(this._holdTimeout),Ce(document,"touchend touchcancel contextmenu",this._cancel,this),Ce(document,"touchmove",this._onMove,this)},_onMove:function(a){var d=a.touches[0];this._newPos=new X(d.clientX,d.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(a,d){var g=new MouseEvent(a,{bubbles:!0,cancelable:!0,view:window,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY});g._simulated=!0,d.target.dispatchEvent(g)}});pe.addInitHook("addHandler","tapHold",Mt),pe.mergeOptions({touchZoom:It.touch,bounceAtZoomLimits:!0});var mt=Jn.extend({addHooks:function(){Rt(this._map._container,"leaflet-touch-zoom"),Ft(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){le(this._map._container,"leaflet-touch-zoom"),Ce(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(a){var d=this._map;if(!(!a.touches||a.touches.length!==2||d._animatingZoom||this._zooming)){var g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]);this._centerPoint=d.getSize()._divideBy(2),this._startLatLng=d.containerPointToLatLng(this._centerPoint),d.options.touchZoom!=="center"&&(this._pinchStartLatLng=d.containerPointToLatLng(g.add(_)._divideBy(2))),this._startDist=g.distanceTo(_),this._startZoom=d.getZoom(),this._moved=!1,this._zooming=!0,d._stop(),Ft(document,"touchmove",this._onTouchMove,this),Ft(document,"touchend touchcancel",this._onTouchEnd,this),hn(a)}},_onTouchMove:function(a){if(!(!a.touches||a.touches.length!==2||!this._zooming)){var d=this._map,g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]),C=g.distanceTo(_)/this._startDist;if(this._zoom=d.getScaleZoom(C,this._startZoom),!d.options.bounceAtZoomLimits&&(this._zoom<d.getMinZoom()&&C<1||this._zoom>d.getMaxZoom()&&C>1)&&(this._zoom=d._limitZoom(this._zoom)),d.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var R=g._add(_)._divideBy(2)._subtract(this._centerPoint);if(C===1&&R.x===0&&R.y===0)return;this._center=d.unproject(d.project(this._pinchStartLatLng,this._zoom).subtract(R),this._zoom)}this._moved||(d._moveStart(!0,!1),this._moved=!0),j(this._animRequest);var q=s(d._move,d,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(q,this,!0),hn(a)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,j(this._animRequest),Ce(document,"touchmove",this._onTouchMove,this),Ce(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});pe.addInitHook("addHandler","touchZoom",mt),pe.BoxZoom=Q,pe.DoubleClickZoom=J,pe.Drag=at,pe.Keyboard=ut,pe.ScrollWheelZoom=gt,pe.TapHold=Mt,pe.TouchZoom=mt,n.Bounds=et,n.Browser=It,n.CRS=Et,n.Canvas=Lc,n.Circle=Io,n.CircleMarker=ui,n.Class=U,n.Control=dr,n.DivIcon=$c,n.DivOverlay=vr,n.DomEvent=$h,n.DomUtil=_m,n.Draggable=ci,n.Evented=G,n.FeatureGroup=mr,n.GeoJSON=hi,n.GridLayer=Lo,n.Handler=Jn,n.Icon=gr,n.ImageOverlay=Fa,n.LatLng=yt,n.LatLngBounds=st,n.Layer=tr,n.LayerGroup=Gi,n.LineUtil=Un,n.Map=pe,n.Marker=ks,n.Mixin=je,n.Path=Jt,n.Point=X,n.PolyUtil=fn,n.Polygon=Ro,n.Polyline=Yr,n.Popup=Is,n.PosAnimation=Or,n.Projection=La,n.Rectangle=W,n.Renderer=Mr,n.SVG=Z,n.SVGOverlay=Hh,n.TileLayer=Yi,n.Tooltip=Rs,n.Transformation=Ct,n.Util=K,n.VideoOverlay=Uh,n.bind=s,n.bounds=it,n.canvas=Nc,n.circle=ja,n.circleMarker=zh,n.control=As,n.divIcon=Zh,n.extend=i,n.featureGroup=Cc,n.geoJSON=Vh,n.geoJson=Em,n.gridLayer=Yh,n.icon=Oc,n.imageOverlay=Sx,n.latLng=vt,n.latLngBounds=ct,n.layerGroup=Bh,n.map=ka,n.marker=Na,n.point=H,n.polygon=Wh,n.polyline=Fh,n.popup=qh,n.rectangle=tt,n.setOptions=p,n.stamp=c,n.svg=B,n.svgOverlay=Om,n.tileLayer=Ic,n.tooltip=Gh,n.transformation=nt,n.version=r,n.videoOverlay=Cm;var At=window.L;n.noConflict=function(){return window.L=At,this},window.L=n})})(ib,ib.exports);var Ta=ib.exports;function vc(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function wx(e,t){return t==null?function(r,i){const o=v.useRef();return o.current||(o.current=e(r,i)),o}:function(r,i){const o=v.useRef();o.current||(o.current=e(r,i));const s=v.useRef(r),{instance:l}=o.current;return v.useEffect(function(){s.current!==r&&(t(l,r,s.current),s.current=r)},[l,r,i]),o}}function V$(e,t){v.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var o;(o=t.layerContainer)==null||o.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function vut(e){return function(n){const r=bm(),i=e(xm(n,r),r);return B$(r.map,n.attribution),xx(i.current,n.eventHandlers),V$(i.current,r),i}}function but(e,t){const n=v.useRef();v.useEffect(function(){if(t.pathOptions!==n.current){const i=t.pathOptions??{};e.instance.setStyle(i),n.current=i}},[e,t])}function xut(e){return function(n){const r=bm(),i=e(xm(n,r),r);return xx(i.current,n.eventHandlers),V$(i.current,r),but(i.current,n),i}}function wut(e,t){const n=wx(e),r=yut(n,t);return mut(r)}function wm(e,t){const n=wx(e,t),r=xut(n);return put(r)}function _ut(e,t){const n=wx(e,t),r=vut(n);return gut(r)}function Sut(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function U$(){return bm().map}function Put(e){const t=U$();return v.useEffect(function(){return t.on(e),function(){t.off(e)}},[t,e]),t}const Aut=wm(function({center:t,children:n,...r},i){const o=new Ta.Circle(t,r);return vc(o,vm(i,{overlayContainer:o}))},z$),sT=wm(function({center:t,children:n,...r},i){const o=new Ta.CircleMarker(t,r);return vc(o,vm(i,{overlayContainer:o}))},z$);function ob(){return ob=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ob.apply(this,arguments)}function Tut({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:o,placeholder:s,style:l,whenReady:c,zoom:h,...u},f){const[m]=v.useState({className:i,id:o,style:l}),[y,x]=v.useState(null);v.useImperativeHandle(f,()=>(y==null?void 0:y.map)??null,[y]);const p=v.useCallback(P=>{if(P!==null&&y===null){const S=new Ta.Map(P,u);n!=null&&h!=null?S.setView(n,h):e!=null&&S.fitBounds(e,t),c!=null&&S.whenReady(c),x(dut(S))}},[]);v.useEffect(()=>()=>{y==null||y.map.remove()},[y]);const b=y?v.createElement(W$,{value:y},r):s??null;return v.createElement("div",ob({},m,{ref:p}),b)}const Eut=v.forwardRef(Tut),aT=wm(function({positions:t,...n},r){const i=new Ta.Polygon(t,n);return vc(i,vm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),lT=wm(function({positions:t,...n},r){const i=new Ta.Polyline(t,n);return vc(i,vm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),Cut=_ut(function({url:t,...n},r){const i=new Ta.TileLayer(t,xm(n,r));return vc(i,r)},function(t,n,r){Sut(t,n,r);const{url:i}=n;i!=null&&i!==r.url&&t.setUrl(i)}),Out=wut(function(t,n){const r=new Ta.Tooltip(t,n.overlayContainer);return vc(r,n)},function(t,n,{position:r},i){v.useEffect(function(){const s=n.overlayContainer;if(s==null)return;const{instance:l}=t,c=u=>{u.tooltip===l&&(r!=null&&l.setLatLng(r),l.update(),i(!0))},h=u=>{u.tooltip===l&&i(!1)};return s.on({tooltipopen:c,tooltipclose:h}),s.bindTooltip(l),function(){s.off({tooltipopen:c,tooltipclose:h}),s._map!=null&&s.unbindTooltip()}},[t,n,i,r])});function Vo(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function pi(e,t){let n=t;if(typeof n=="string"){const l=e.interpolateText(n);try{n=JSON.parse(l)}catch{n=l.split(",")}}const r=Array.isArray(n)?n[0]:(n==null?void 0:n.latitude)??(n==null?void 0:n.lat),i=Array.isArray(n)?n[1]:(n==null?void 0:n.longitude)??(n==null?void 0:n.lng),o=Number(e.interpolateText(String(r??""))),s=Number(e.interpolateText(String(i??"")));return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}function Hg(e,t,n){return e[t||""]??n.map(r=>e[r]).find(Boolean)??""}function sb(e,t,n,r,i){if(e.interactionDisabled)return;const o={...r,latitude:n[0],longitude:n[1],[t.latitudeKey||"latitude"]:n[0],[t.longitudeKey||"longitude"]:n[1]};e.rowContextRef&&(e.rowContextRef.current=o),e.setSceneData(s=>({...s,...o})),i&&e.handleButtonClick(e.interpolateText(i)).catch(()=>{})}function Mut({api:e,drawing:t,active:n,points:r}){if(!t||t.controls===!1)return null;const i=t.activeKey||"isDrawing",o=t.activeValue??!0,s=t.inactiveValue??!1,l=t.pointsKey||"draftGeofencePoints",c=u=>e.setSceneData(f=>({...f,...u})),h={alignItems:"center",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"6px",color:"#0f172a",cursor:"pointer",display:"flex",fontSize:"12px",fontWeight:700,gap:"6px",minHeight:"34px",padding:"7px 10px"};return V("div",{"aria-live":"polite",style:{display:"flex",flexDirection:"column",gap:"6px",position:"absolute",right:"12px",top:"12px",zIndex:1001}},n?V("div",{style:{background:"#0f172a",borderRadius:"6px",color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 10px"}},`Drawing polygon: ${r.length} points`):V("button",{"aria-label":"Draw geofence",onClick:()=>c({[i]:o,[l]:[]}),style:h,title:"Draw geofence",type:"button"},e.renderIcon("pencil-ruler",15),"Draw fence"),n?V("button",{"aria-label":"Finish geofence",disabled:r.length<3,onClick:()=>c({[i]:s}),style:{...h,opacity:r.length<3?.5:1},title:"Finish geofence",type:"button"},e.renderIcon("check",15),"Finish"):null,V("button",{"aria-label":"Clear geofence draft",onClick:()=>c({[i]:s,[l]:[]}),style:h,title:"Clear geofence draft",type:"button"},e.renderIcon("trash-2",15),"Clear"))}function kut({center:e,points:t,fitBounds:n,location:r,followLocation:i,followDuration:o}){const s=U$(),l=v.useRef(!1),c=t.map(u=>u.join(",")).join("|"),h=(r==null?void 0:r.join(","))||"";return v.useEffect(()=>{const u=n&&t.length>1,f=u&&!l.current;if(i?f:u){l.current=!0,s.fitBounds(t,{padding:[24,24],maxZoom:16});return}if(i&&r){l.current=!0,s.panTo(r,{animate:!0,duration:Number(o)||.45});return}l.current=!0,s.setView(e,s.getZoom())},[e[0],e[1],n,o,i,h,s,c]),null}function $ut({enabled:e,drawingEnabled:t,onSelect:n,onDrawPoint:r}){return Put({click:i=>{if(!e)return;const o=[i.latlng.lat,i.latlng.lng];t?r(o):n(o)}}),null}function Iut(e,t){if(!t)return!1;const n=t.activeKey?e.sceneData[t.activeKey]:t.enabled;return t.activeValue===void 0?n===!0||n==="true":String(n)===String(t.activeValue)}function Rut(e,t){return t?Vo(e.sceneData[t.pointsKey||"draftGeofencePoints"]).map(n=>pi(e,n)).filter(n=>n!==null):[]}function Lut(e,t,n){const r=pi(n,t.center);if(r&&t.radius){const o=(e[0]-r[0])*111320,s=(e[1]-r[1])*111320*Math.cos(r[0]*Math.PI/180);return Math.hypot(o,s)<=Number(t.radius)}const i=Vo(typeof t.points=="string"?n.interpolateText(t.points):t.points).map(o=>pi(n,o)).filter(o=>o!==null);return i.length<3?!1:i.reduce((o,s,l)=>{const c=i[(l+i.length-1)%i.length];return s[0]>e[0]!=c[0]>e[0]&&e[1]<(c[1]-s[1])*(e[0]-s[0])/(c[0]-s[0])+s[1]?!o:o},!1)}function Nut({api:e,config:t,location:n,fences:r}){const i=JSON.stringify(r),o=(n==null?void 0:n.join(","))||"";return v.useEffect(()=>{if(!n)return;const s=new Set(r.filter(u=>Lut(n,u,e)).map((u,f)=>u.id||String(f))),l=t.geofenceKey||"activeGeofences",c=new Set(Array.isArray(e.sceneData[l])?e.sceneData[l].map(String):[]);(s.size!==c.size||[...s].some(u=>!c.has(u)))&&(e.setSceneData(u=>({...u,[l]:[...s]})),r.forEach((u,f)=>{const m=u.id||String(f),y=s.has(m)&&!c.has(m),x=!s.has(m)&&c.has(m),p=y?u.onEnter||t.onGeofenceEnter:x?u.onExit||t.onGeofenceExit:void 0;p&&sb(e,t,n,{...u,geofenceId:m},p)}))},[e,t,i,r,n,o]),null}function jut({api:e,config:t,componentKey:n}){var w,T;const r=e.interpolateText(t.dataSource||""),{fetchListData:i}=e;v.useEffect(()=>{r&&i(r,n,0,t.pageSize||50).catch(()=>{})},[n,t.pageSize,r,i]);const s=(r?((w=e.listData)==null?void 0:w[n])||[]:Vo(typeof t.markers=="string"?e.interpolateText(t.markers):t.markers)).map(O=>({source:O,location:pi(e,O)})).filter(O=>O.location!==null),l=Vo(typeof t.route=="string"?e.interpolateText(t.route):t.route).map(O=>pi(e,O)).filter(O=>O!==null),c=pi(e,t.location),h=pi(e,t.center||t)||c||((T=s[0])==null?void 0:T.location)||l[0];t.marker&&h&&s.length===0&&s.push({source:{},location:h});const u=Vo(typeof t.geofences=="string"?e.interpolateText(t.geofences):t.geofences),f=t.drawing,m=Iut(e,f),y=Rut(e,f),x=y.length>2?{id:f.id||f.pointsKey||"drawn-geofence",label:f.label||"Drawn geofence",color:f.color||e.cfg.colors.accent,points:y}:null,p=x?[...u,x]:u,b=(f==null?void 0:f.color)||e.cfg.colors.accent,P={width:"100%",height:t.height||t.h||"360px",minHeight:"180px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",overflow:"hidden",position:"relative",...t.className?e.parseClassName(t.className):{}},S=e.getCommonProps(n,P,t);if(!h)return V("div",{key:n,...S},t.emptyText||"Map location unavailable");const A=t.interactive!==!1&&!e.interactionDisabled,E=[...s.map(O=>O.location),...l,...c?[c]:[]];return Ze.jsxs("div",{className:t.className,...S,children:[Ze.jsxs(Eut,{center:h,zoom:Math.min(19,Math.max(1,Number(t.zoom)||14)),dragging:A,scrollWheelZoom:A,zoomControl:A,attributionControl:!1,style:{width:"100%",height:"100%"},children:[Ze.jsx(Cut,{url:t.tileUrl||"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:t.tileAttribution||"&copy; OpenStreetMap contributors"}),Ze.jsx(kut,{center:h,points:E,fitBounds:t.fitBounds??E.length>1,location:c,followLocation:t.followLocation===!0,followDuration:t.followDuration}),Ze.jsx($ut,{enabled:A,drawingEnabled:m,onSelect:O=>sb(e,t,O,{},t.onMapClick||t.onClick),onDrawPoint:O=>{const I=(f==null?void 0:f.pointsKey)||"draftGeofencePoints";e.setSceneData(N=>({...N,[I]:[...Vo(N[I]),O]}))}}),Ze.jsx(Nut,{api:e,config:t,location:c,fences:p}),l.length>1&&Ze.jsx(lT,{positions:l,pathOptions:{color:t.routeColor||e.cfg.colors.primary,weight:5}}),f&&y.length===1&&Ze.jsx(sT,{center:y[0],radius:6,pathOptions:{color:b,fillColor:b}}),f&&y.length>1&&Ze.jsx(lT,{positions:y,pathOptions:{color:b,dashArray:"8 8",weight:3}}),f&&y.length>2&&Ze.jsx(aT,{positions:y,pathOptions:{color:b,fillColor:b,fillOpacity:.18,weight:2}}),u.map((O,I)=>{const N=O.color||e.cfg.colors.primary,F=pi(e,O.center),D=Vo(typeof O.points=="string"?e.interpolateText(O.points):O.points).map(K=>pi(e,K)).filter(K=>K!==null),j={color:N,fillColor:N,fillOpacity:.14,weight:2};return F&&O.radius?Ze.jsx(Aut,{center:F,radius:Number(O.radius),pathOptions:j},O.id||I):D.length>2?Ze.jsx(aT,{positions:D,pathOptions:j},O.id||I):null}),s.map(({source:O,location:I})=>Ze.jsx(sT,{center:I,radius:Number(O.radius||t.markerRadius)||9,pathOptions:{color:O.color||t.markerColor||e.cfg.colors.primary,fillColor:O.color||t.markerColor||e.cfg.colors.primary,fillOpacity:.9,weight:2},eventHandlers:{click:()=>sb(e,t,I,O,O.onClick||t.onMarkerClick)},children:O.label||O.name?Ze.jsx(Out,{children:e.interpolateText(O.label||O.name)}):null},O.id||I.join("-")))]}),Ze.jsx(Mut,{api:e,drawing:f,active:m,points:y})]},n)}function Xl(e,t,n,r,i,o=!1){if(!Array.isArray(t)||t.length===0)return null;if(r==="row"||o)return t.map((u,f)=>e.renderComponent(u,f,n));const s=[];let l=[];const c=u=>u&&(u.type==="button"||i&&(u.type==="link"||u.type==="a")),h=u=>{l.length!==0&&(l.length===1?s.push(e.renderComponent(l[0],u,n)):s.push(V("div",{key:`${n}-btns-${u}`,style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",gap:"0.75rem"}},...l.map((f,m)=>e.renderComponent(f,u+m,n)))),l=[])};return t.forEach((u,f)=>{c(u)?l.push(u):(h(f),s.push(e.renderComponent(u,f,n)))}),h(t.length),s}function H$(e){return e.className?/\bhidden\b/.test(e.className)&&/\b(sm|md|lg|xl):(?:block|flex|inline|inline-block|inline-flex)\b/.test(e.className):!1}function q$(e){return e.children?e.children.filter(t=>H$(t)):[]}function Dut(e){return e.children?e.children.filter(t=>!H$(t)):[]}function G$(e){var t;return Array.isArray((t=e==null?void 0:e.mobileMenu)==null?void 0:t.items)?e.mobileMenu.items:[]}function But(e){if(!(e.layout==="row"||e.className&&/\bflex-row\b/.test(e.className)))return!1;const n=q$(e),r=G$(e);if(n.length===0&&r.length===0)return!1;const i=["text","link","button","accordion"];if(!(n.length===0||n.every(c=>i.includes(c.type))))return!1;const s=e.className||"";return/\b(sticky|fixed)\b/.test(s)||/\btop-0\b/.test(s)||/\bz-(10|20|30|40|50)\b/.test(s)||/\bjustify-between\b/.test(s)||e.justify==="space-between"}function cT(e){const t=G$(e);return t.length>0?t:q$(e)}function uT(e){return Dut(e)}function hT(e,t,n){return v.createElement("button",{key:"hamburger-icon",onClick:()=>t(!e),style:{background:"none",border:"none",cursor:"pointer",width:"40px",height:"40px",padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",color:n||"inherit",fontSize:"24px",lineHeight:1},"aria-label":e?"Close navigation menu":"Open navigation menu"},v.createElement(e?Qt.FiX:Qt.FiMenu,{size:20}))}function Z$(e){return e=String(e??""),e.replace(/\bhidden\b/g,"").replace(/\b(sm|md|lg|xl|2xl):(block|flex|inline|inline-block|inline-flex)\b/g,"").replace(/\s+/g," ").trim()}function fT(e){const t=(e==null?void 0:e.className)||"";return/\bdrawer\b/.test(t)&&!/\bdrawer-(item|item-[a-z]+)\b/.test(t)}function Ya(e){return/\bburger-first\b/.test((e==null?void 0:e.className)||"")}function dT({navLinks:e,parentKey:t,renderComponentFn:n,open:r,onClose:i,colorMode:o,portalTarget:s,mobileMenu:l,parseMenuClassName:c}){const[h,u]=v.useState(r);if(v.useEffect(()=>{r&&u(!0)},[r]),!r&&!h)return null;const f=e.map(P=>({...P,className:P.className?Z$(P.className):void 0})),m=o!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",y=l!=null&&l.className&&c?c(l.className,`${t}-side-drawer-class`):{},x=l!=null&&l.headerClassName&&c?c(l.headerClassName,`${t}-side-header-class`):{},p=()=>{u(!1),i()},b=v.createElement(v.Fragment,null,v.createElement("div",{key:`${t}-side-backdrop`,onClick:p,style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.45)",zIndex:90,opacity:r?1:0,transition:"opacity 0.25s ease",pointerEvents:r?"auto":"none"}}),v.createElement("div",{key:`${t}-side-drawer`,className:l==null?void 0:l.className,style:{position:"absolute",top:0,bottom:0,left:0,width:"min(300px, 85%)",backgroundColor:m,zIndex:100,overflowY:"auto",transform:r?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease",boxShadow:"2px 0 12px rgba(0, 0, 0, 0.25)",display:"flex",flexDirection:"column",gap:"4px",padding:"16px 12px",...y}},v.createElement("div",{key:`${t}-side-header`,className:l==null?void 0:l.headerClassName,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 8px 12px",borderBottom:"1px solid rgba(128, 128, 128, 0.2)",marginBottom:"8px",fontSize:18,fontWeight:700,...x}},(l==null?void 0:l.title)||"Menu",v.createElement("button",{onClick:p,"aria-label":"Close menu",style:{background:"none",border:"none",cursor:"pointer",fontSize:22,color:"inherit",lineHeight:1}},"✕")),f.map((P,S)=>v.createElement(Y$,{key:`${t}-drawer-item-${S}`,link:P,idx:S,parentKey:t,renderComponentFn:n,onClose:p,itemClassName:P.drawerClassName||(l==null?void 0:l.itemClassName),itemStyle:(P.drawerClassName||l!=null&&l.itemClassName)&&c?c(P.drawerClassName||l.itemClassName,`${t}-drawer-item-class-${S}`):void 0}))));return s?cb.createPortal(b,s):b}function Y$({link:e,idx:t,parentKey:n,renderComponentFn:r,onClose:i,itemClassName:o,itemStyle:s}){const[l,c]=v.useState(!1),h=e.type==="link"||e.type==="button";return v.createElement("div",{key:`${n}-drawer-item-${t}`,className:o,style:{display:"flex",flexDirection:"row",alignItems:"center",gap:10,width:"100%",padding:"10px 12px",borderRadius:8,cursor:h?"pointer":"default",backgroundColor:l?"rgba(128, 128, 128, 0.12)":"transparent",transition:"background-color 0.15s ease",...s},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:u=>{var m;!u.target.closest("a, button, [role='button']")&&h&&((m=u.currentTarget.querySelector("a, button, [role='button']"))==null||m.click()),h&&i()}},r(e,t+1,`${n}-drawer`))}function pT(e,t,n,r,i,o,s,l){if(!r)return null;const c=e.map(x=>({...x,className:x.className?Z$(x.className):void 0})),h=i!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",u=i!=="light"?"rgba(75, 85, 99, 0.5)":"rgba(209, 213, 219, 0.5)",f=s!=null&&s.className&&l?l(s.className,`${t}-mobile-drawer-class`):{},m=(s==null?void 0:s.rawStyle)??{},y=!!(s!=null&&s.inFlow);return v.createElement("div",{key:`${t}-mobile-drawer`,className:s==null?void 0:s.className,style:{position:y?"relative":"absolute",top:y?0:"100%",left:0,right:0,flexBasis:y?"100%":void 0,backgroundColor:h,borderTop:`1px solid ${u}`,padding:"12px",display:"flex",flexDirection:"column",gap:"4px",zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",...f,...m}},c.map((x,p)=>v.createElement(Y$,{key:`${t}-drawer-item-${p}`,link:x,idx:p,parentKey:t,renderComponentFn:n,onClose:()=>o==null?void 0:o(!1),itemClassName:x.drawerClassName||(s==null?void 0:s.itemClassName),itemStyle:(x.drawerClassName||s!=null&&s.itemClassName)&&l?l(x.drawerClassName||s.itemClassName,`${t}-drawer-item-class-${p}`):void 0})))}function zut(e,t,n){var s;if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=/\bspace-x-/.test(t.className),h=/\bspace-y-/.test(t.className);if(l.display==null&&(l.display=t.layout==="row"||c||h?"flex":"block"),l.flexDirection==null){const f=t.className||"",m=f.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(m)l.flexDirection=m[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(f)){const y=/\bmin-h-(screen|\[[^\]]+\])/.test(f)&&/\bitems-center\b/.test(f),x=Array.isArray(t.children)&&t.children.length>0&&t.children.every(p=>p&&["h1","h2","h3","h4","p","text"].includes(p.type));l.flexDirection=y||x?"column":"row"}else c||h?l.flexDirection=c?"row":"column":l.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const f=bh(t.className);if(f.px.size>0){const y=Vt(f.px,e.containerWidth,"0px");l.paddingLeft=y,l.paddingRight=y}if(f.py.size>0){const y=Vt(f.py,e.containerWidth,"0px");l.paddingTop=y,l.paddingBottom=y}if(f.p.size>0){const y=Vt(f.p,e.containerWidth,"0px");l.padding=y}const m=ic(t.className);m.size>0&&(l.display=Vt(m,e.containerWidth,"flex"))}const u=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,className:t.className,...u},Xl(e,Array.isArray(t.children)?t.children:[],n,l.flexDirection))}const r=e.cfg.colorMode==="light",i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"1rem",padding:"1.5rem",borderRadius:"1rem",backdropFilter:"blur(8px)",border:r?"1px solid rgba(0, 0, 0, 0.1)":"1px solid rgba(55, 65, 81, 0.5)"},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},Xl(e,t.children,n,i.flexDirection))}function Fut(e,t,n){var l,c,h,u,f;const r=e.isMobileView&&But(t);if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className),y=/\bspace-x-/.test(t.className),x=/\bspace-y-/.test(t.className);if(m.display==null&&(m.display=t.layout==="row"||y||x?"flex":"block"),m.flexDirection==null){const P=t.className||"",S=P.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(S)m.flexDirection=S[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(P)){const A=/\bmin-h-(screen|\[[^\]]+\])/.test(P)&&/\bitems-center\b/.test(P),E=Array.isArray(t.children)&&t.children.length>0&&t.children.every(w=>w&&["h1","h2","h3","h4","p","text"].includes(w.type));m.flexDirection=A||E?"column":"row"}else y||x?m.flexDirection=y?"row":"column":m.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const P=bh(t.className);if(P.px.size>0){const A=Vt(P.px,e.containerWidth,"0px");m.paddingLeft=A,m.paddingRight=A}if(P.py.size>0){const A=Vt(P.py,e.containerWidth,"0px");m.paddingTop=A,m.paddingBottom=A}if(P.p.size>0){const A=Vt(P.p,e.containerWidth,"0px");m.padding=A}const S=ic(t.className);S.size>0&&(m.display=Vt(S,e.containerWidth,"flex"))}if(r&&t.children&&t.children.length>0){const P=uT(t),S=cT(t),A=!!((c=t.mobileMenu)!=null&&c.inFlow);m.position="relative",m.display="flex",m.alignItems="center",m.justifyContent=Ya(t)?"flex-start":"space-between",Ya(t)&&(m.gap=10),A&&(m.flexWrap="wrap",m.height="auto",m.minHeight="64px",m.paddingTop="12px");const E=e.getCommonProps(n,m,t),w=hT(e.mobileMenuOpen,e.setMobileMenuOpen,(h=t.mobileMenu)==null?void 0:h.iconColor),T=(I,N)=>{var F;return((F=e.parseClassNameResponsive)==null?void 0:F.call(e,I,N))??e.parseClassName(I)},O=P.map((I,N)=>e.renderComponent(I,N,n));return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...E},...Ya(t)?[w,...O]:[...O,w],fT(t)?v.createElement(dT,{navLinks:S,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:T}):pT(S,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,T))}const p=e.getCommonProps(n,m,t),b=t.onClick?{onClick:P=>{P.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...p,...b},Xl(e,Array.isArray(t.children)?t.children:[],n,m.flexDirection,!1,/\bflex-col\b|\bspace-y-/.test(t.className)))}const i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"16px"};if(t.align){const m={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};i.alignItems=m[t.align]}if(t.justify){const m={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between"};i.justifyContent=m[t.justify]}if(t.padding!==void 0&&(i.padding=`${t.padding}px`),r&&t.children&&t.children.length>0){const m=uT(t),y=cT(t),x=!!((u=t.mobileMenu)!=null&&u.inFlow);i.position="relative",i.display="flex",i.alignItems="center",i.justifyContent=Ya(t)?"flex-start":"space-between",Ya(t)&&(i.gap=10),x&&(i.flexWrap="wrap",i.height="auto",i.minHeight="64px",i.paddingTop="12px");const p=e.getCommonProps(n,i,t),b=hT(e.mobileMenuOpen,e.setMobileMenuOpen,(f=t.mobileMenu)==null?void 0:f.iconColor),P=(A,E)=>{var w;return((w=e.parseClassNameResponsive)==null?void 0:w.call(e,A,E))??e.parseClassName(A)},S=m.map((A,E)=>e.renderComponent(A,E,n));return v.createElement("div",{key:n,...p},...Ya(t)?[b,...S]:[...S,b],fT(t)?v.createElement(dT,{navLinks:y,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:P}):pT(y,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,P))}const o=e.getCommonProps(n,i,t),s=t.onClick?{onClick:m=>{m.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,...o,...s},Xl(e,t.children,n,i.flexDirection))}function Wut(e,t,n){var o,s;if(t.className){const l=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className);let c;if(e.renderMode!=="css-driven"){const u=pD(t.className),f=u.size>0?mD(u,e.containerWidth):void 0;c={display:"grid",...l,...f!==void 0&&{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`}}}else c={display:"grid",...l};const h=e.getCommonProps(n,c,t);return v.createElement("div",{key:n,className:t.className,...h},(Array.isArray(t.children)?t.children:[]).map((u,f)=>e.renderComponent(u,f,n)))}const r={display:"grid",width:"100%",gridTemplateColumns:`repeat(${t.cols||2}, minmax(0, 1fr))`,gap:t.gap!==void 0?`${t.gap}px`:"16px"},i=e.getCommonProps(n,r,t);return v.createElement("div",{key:n,...i},(s=t.children)==null?void 0:s.map((l,c)=>e.renderComponent(l,c,n)))}function Vut(e,t,n){var l,c;if(t.className){const u={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:e.containerWidth>0&&e.containerWidth<ku.md?"300px":"500px",gap:"24px"};(t.bg||t.backgroundColor)&&(u.background=t.bg||t.backgroundColor),t.bgImage&&(u.backgroundImage=`url(${t.bgImage})`,u.backgroundSize="cover",u.backgroundPosition="center");const f={...u,...((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className)};if(Array.isArray(t.children)&&t.children.some(x=>x.type==="grid")||(f.textAlign="center"),e.renderMode!=="css-driven"){const x=bh(t.className);if(x.px.size>0){const p=Vt(x.px,e.containerWidth,"0px");f.paddingLeft=p,f.paddingRight=p}if(x.py.size>0){const p=Vt(x.py,e.containerWidth,"0px");f.paddingTop=p,f.paddingBottom=p}if(x.p.size>0){const p=Vt(x.p,e.containerWidth,"0px");f.padding=p}}const y=e.getCommonProps(n,f,t);return v.createElement("div",{key:n,className:t.className,...y},Xl(e,Array.isArray(t.children)?t.children:[],n,f.flexDirection))}const r=e.containerWidth<ku.md,i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:r?"300px":"500px",padding:r?"1.5rem":"3rem",background:t.bg||t.backgroundColor,gap:"24px"};t.bgImage&&(i.backgroundImage=`url(${t.bgImage})`,i.backgroundSize="cover",i.backgroundPosition="center"),Array.isArray(t.children)&&t.children.some(h=>h.type==="grid")||(i.textAlign="center");const s=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...s},(c=t.children)==null?void 0:c.map((h,u)=>e.renderComponent(h,u,n)))}function Uut(e,t,n){var s;const r={display:"flex",flexDirection:"row",alignItems:"center",width:"100%",flexShrink:0,position:"sticky",top:0,zIndex:50,gap:"1.25rem",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colors.surface,borderBottom:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const l=bh(t.className);l.px.size>0&&(r.paddingLeft=Vt(l.px,e.containerWidth,"0px"),r.paddingRight=Vt(l.px,e.containerWidth,"0px")),l.py.size>0&&(r.paddingTop=Vt(l.py,e.containerWidth,"0px"),r.paddingBottom=Vt(l.py,e.containerWidth,"0px"));const c=ic(t.className);c.size>0&&(r.display=Vt(c,e.containerWidth,"flex"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};return v.createElement("header",o,(Array.isArray(t.children)?t.children:[]).filter(l=>Array.isArray(l.visibleOn)?l.visibleOn.includes(e.currentSceneId):Array.isArray(l.hiddenOn)?!l.hiddenOn.includes(e.currentSceneId):!0).map((l,c)=>e.renderComponent(l,c,n)))}function Hut(e,t,n){var c;const r={display:"flex",flexDirection:t.layout==="row"?"row":"column",width:"100%",flexShrink:0,marginTop:"auto",gap:"1rem",padding:"2.5rem 1.5rem",backgroundColor:e.cfg.colors.surfaceHover,borderTop:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((c=e.parseClassNameResponsive)==null?void 0:c.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const h=bh(t.className);h.px.size>0&&(r.paddingLeft=Vt(h.px,e.containerWidth,"0px"),r.paddingRight=Vt(h.px,e.containerWidth,"0px")),h.py.size>0&&(r.paddingTop=Vt(h.py,e.containerWidth,"0px"),r.paddingBottom=Vt(h.py,e.containerWidth,"0px"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};let s=Array.isArray(t.children)?t.children:[];const l=s[0];return l&&l.type==="text"&&/^(\u00a9|\(c\)|copyright)/i.test(String(l.text).trim())&&(s=[...s.slice(1),l]),v.createElement("footer",o,Xl(e,s,n,r.flexDirection,!0))}function qut({api:e,config:t,componentKey:n}){var b,P;const r=t.queryKey||"placeQuery",i=String(e.sceneData[r]||""),[o,s]=v.useState(i),l=e.interpolateText(t.dataSource||""),c=Number(t.minChars)||3,h=Number(t.debounceMs)||300,{fetchListData:u}=e;v.useEffect(()=>{i!==o&&s(i)},[o,i]),v.useEffect(()=>{if(!l||o.trim().length<c)return;const S=window.setTimeout(()=>{u(l,n,0,t.pageSize||8).catch(()=>{})},h);return()=>window.clearTimeout(S)},[n,t.pageSize,l,h,u,c,o]);const f=l?((b=e.listData)==null?void 0:b[n])||[]:Vo(typeof t.places=="string"?e.interpolateText(t.places):t.places),m={display:"flex",flexDirection:"column",gap:"8px",width:"100%",...t.className?e.parseClassName(t.className):{}},y=e.getCommonProps(n,m,t),x=S=>{const A=Hg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]),E=pi(e,S),w={...S,[t.valueKey||"address"]:A,...E?{latitude:E[0],longitude:E[1]}:{},...E&&t.latitudeKey?{[t.latitudeKey]:E[0]}:{},...E&&t.longitudeKey?{[t.longitudeKey]:E[1]}:{}};e.rowContextRef&&(e.rowContextRef.current=w),e.setSceneData(O=>({...O,...w}));const T=S.onClick||t.onPlaceClick||t.onClick;T&&e.handleButtonClick(e.interpolateText(T)).catch(()=>{})},p=!((P=e.loading)!=null&&P[n])&&f.length===0&&(!l||o.trim().length>=c);return V("div",{key:n,className:t.className,...y},l&&t.searchable!==!1?V("input",{type:"search",value:o,placeholder:e.interpolateText(t.placeholder||"Search address"),autoComplete:"off",onChange:S=>{const A=S.target.value;s(A),e.setSceneData(E=>({...E,[r]:A}))},style:{width:"100%",padding:"10px 12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text}}):null,...f.map((S,A)=>{const E=e.interpolateText(Hg(S,t.labelField,["name","title","label"])),w=e.interpolateText(Hg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]));return V("button",{key:S.id||`${n}-${A}`,type:"button",onClick:()=>!e.interactionDisabled&&x(S),disabled:e.interactionDisabled||void 0,"aria-label":`Select ${E||w||"place"}`,style:{display:"flex",alignItems:"center",gap:"10px",padding:"12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,cursor:e.interactionDisabled?"default":"pointer",textAlign:"left",...t.itemClassName?e.parseClassName(t.itemClassName):{}}},e.renderIcon("map-pin",18),V("span",{style:{display:"flex",flex:1,flexDirection:"column",gap:"3px",minWidth:0}},V("strong",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},E||w),E&&w?V("span",{style:{color:e.cfg.colors.textSecondary,fontSize:"13px"}},w):null))}),p?V("span",{style:{color:e.cfg.colors.textMuted,fontSize:"13px"}},t.emptyText||"No addresses found"):null)}const mT=new Map;function Gut(e){let t=mT.get(e);return t||(t=Jf.create(e),mT.set(e,t)),t}function Bt(e,t){if(!(e!=null&&e.motion)||!v.isValidElement(t))return t;const n=t,r=n.props,i=Gut(n.type);return v.createElement(i,{key:n.key,...r,initial:e.initial,animate:e.animate,exit:e.exit,transition:e.transition,variants:e.variants,whileHover:e.whileHover,whileTap:e.whileTap,whileFocus:e.whileFocus,whileInView:e.whileInView,layout:e.animateLayout},r==null?void 0:r.children)}function Wf(e,t,n,r=""){var s,l;const i=t,o=`${r}-${n}`;if(Array.isArray(i.hiddenOn)&&i.hiddenOn.includes(e.currentSceneId)||Array.isArray(i.visibleOn)&&!i.visibleOn.includes(e.currentSceneId)||i.condition&&e.evaluateCondition&&!e.evaluateCondition(i.condition,i.__conditionBase))return null;if(!Array.isArray(i.children)&&Array.isArray(i.components)&&(i.children=i.components),i.type==="custom"){const c=i.tagName||"div",h=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,i.className||"",o))??(i.className?e.parseClassName(i.className):{});i.rawStyle&&Object.assign(h,i.rawStyle);const u=e.getCommonProps(o,h,i),f=Array.isArray(i.children)?i.children.map((y,x)=>e.renderComponent(y,x,o)):[],m=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,exit:i.exit,transition:i.transition,variants:i.variants,whileHover:i.whileHover,whileTap:i.whileTap,whileFocus:i.whileFocus,whileInView:i.whileInView,animateLayout:i.animateLayout}:{};return V(c,{key:o,className:i.className,...u,...m},...f)}if(/^h[1-6]$/.test(i.type)||i.type==="p"||i.type==="span"||i.type==="label"||i.type==="blockquote"||i.type==="strong"||i.type==="em"||i.type==="li"||i.type==="figcaption"||i.type==="th"||i.type==="td"||i.type==="heading"||i.type==="paragraph"||i.type==="address"||i.type==="time"||i.type==="legend"||i.type==="caption"?i.type="text":i.type==="div"||i.type==="article"||i.type==="aside"||i.type==="main"||i.type==="figure"?i.type=i.children?"section":"text":i.type==="a"?i.type="link":i.type==="img"?i.type="image":i.type==="ul"||i.type==="ol"?i.type="list":i.type==="table"||i.type==="thead"||i.type==="tbody"||i.type==="tfoot"||i.type==="tr"?i.type="table":i.type==="br"?i.type="spacer":i.type==="hr"?i.type="divider":i.type==="details"||i.type==="summary"?i.type=i.children?"section":"text":i.type==="nav"?i.type="section":(i.type==="form"&&!i.fields||i.type==="listItem")&&(i.type=i.children?"section":"text"),i.type==="select"&&Array.isArray(i.options)&&typeof i.options[0]=="string"&&(i.options=i.options.map(c=>({label:c,value:c}))),i.type==="dropdown-button"&&!i.items&&i.options&&(i.items=Array.isArray(i.options)&&typeof i.options[0]=="string"?i.options.map(c=>({label:c,value:c})):i.options),(i.type==="input"||i.type==="textarea")&&!i.placeholder&&i.label&&(i.placeholder=i.label),e.imageReplacements&&e.imageReplacements.size>0){const c=e.imageReplacements.get(o);if(c&&c.url){const h={width:"100%",height:"auto",maxHeight:"300px",objectFit:"cover",borderRadius:"0.75rem"},u=e.getCommonProps(o,h,i),f=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,whileHover:i.whileHover,whileTap:i.whileTap,transition:i.transition,animateLayout:i.animateLayout}:{};return V("img",{key:`${o}-${c.url}`,src:c.url,alt:c.name||"Replacement image",...u,...f})}}switch(i.type){case"text":return Bt(i,uct(e,i,o));case"html":return Bt(i,fct(e,i,o));case"link":return Bt(i,dct(e,i,o));case"button":return Bt(i,pct(e,i,o));case"image":return Bt(i,mct(e,i,o));case"input":return Bt(i,gct(e,i,o));case"hidden":return Bt(i,yct(e,i,o));case"select":return Bt(i,vct(e,i,o));case"checkbox":return Bt(i,bct(e,i,o));case"card":return Bt(i,zut(e,i,o));case"section":case"container":case"cta_section":return Bt(i,Fut(e,i,o));case"header":return Bt(i,Uut(e,i,o));case"grid":case"features_grid":return Bt(i,Wut(e,i,o));case"hero":return Bt(i,Vut(e,i,o));case"footer":return Bt(i,Hut(e,i,o));case"spacer":return Bt(i,Oct(e,i,o));case"divider":return Bt(i,Mct(e,i,o));case"list":return Bt(i,vD(e,i,o));case"table":return Bt(i,xD(e,i,o));case"badge":return Bt(i,xct(e,i,o));case"tag":return Bt(i,wct(e,i,o));case"avatar":return Bt(i,_ct(e,i,o));case"progress":return Bt(i,Sct(e,i,o));case"recorder":return v.createElement(lut,{api:e,config:i,key:o});case"live-cast":return v.createElement(cut,{api:e,config:i,componentKey:o,key:o});case"tabs":return Bt(i,gD(e,i,o));case"accordion":return Bt(i,yD(e,i,o));case"bottom_nav":return Bt(i,out(e,i,o));case"split":return Bt(i,sut(e,i,o));case"theme_toggle":return Bt(i,aut(e,i,o));case"slider":case"carousel":return Bt(i,Tct(e,i,o));case"marquee":return Bt(i,Ect(e,i,o));case"camera":case"capture":return Bt(i,Cct(e,i,o));case"phaser_game":return Bt(i,((l=e.renderPhaserGame)==null?void 0:l.call(e,i,o))??null);case"search":return Bt(i,Pct(e,i,o));case"breadcrumb":return Bt(i,Act(e,i,o));case"form":return Bt(i,Xct(e,i,o));case"textarea":return Bt(i,$ct(e,i,o));case"diagnostics_chat":return Bt(i,v.createElement(hut,{api:e,config:i,componentKey:o}));case"icon":return Bt(i,Ict(e,i,o));case"markdown":return Bt(i,iut(e,i,o));case"dropdown-button":return Bt(i,Gct(e,i,o));case"widget":return Bt(i,Zct(e,i,o));case"advanced-select":return Bt(i,Yct(e,i,o));case"metric_display":return Bt(i,Rct(e,i,o));case"bar_chart":return Bt(i,Lct(e,i,o));case"line_chart":return Bt(i,Ug(e,i,o,!1));case"area_chart":return Bt(i,Ug(e,i,o,!0));case"pie_chart":return Bt(i,oT(e,i,o));case"donut_chart":return Bt(i,oT(e,i,o,!0));case"scatter_chart":return Bt(i,Nct(e,i,o));case"candlestick":return Bt(i,Ug(e,i,o,!1,!0));case"fx_ticker":return Bt(i,Dct(e,i,o));case"trading_view":return Bt(i,zct(e,i,o));case"loader":return Bt(i,kct(e,i,o));case"map":return v.createElement(jut,{api:e,config:i,componentKey:o,key:o});case"places":return v.createElement(qut,{api:e,config:i,componentKey:o,key:o});case"flow_diagram":return Bt(i,Fct(e,i,o));case"flow":return Bt(i,Vct(e,i,o));default:return Bt(i,Uct(e,i,o))}}function K$(e){const t=new Map,n=new Map;for(const r of e)if(r.type==="render_scene"&&r.route){const i=r.route.startsWith("/")?r.route:`/${r.route}`;t.set(r.id,i),n.set(i,r.id)}for(const r of e)if(r.type==="render_scene"&&!t.has(r.id)){const i=`/${r.id}`;t.set(r.id,i),n.set(i,r.id)}return{sceneToRoute:t,routeToScene:n}}function ab(e){if(typeof window>"u")return null;const t=window.location.hash;if(!t||t==="#")return null;const n=t.slice(1);return e.get(n)||null}function gT(e){return typeof window>"u"?null:e.get(window.location.pathname)||null}function Vf(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r)return;const i=`#${r}`;window.location.hash!==i&&(n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i))}function qg(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r||window.location.pathname===r)return;const i=`${r}${window.location.search}`;n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i)}const Zut=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1};async function Uf(e,t,n={},r){var i;try{const o=t.indexOf(".");if(o===-1)throw new Error(`Invalid SDK call syntax: ${t}`);const s=t.slice(0,o),l=t.slice(o+1),c=l.indexOf("(");if(c===-1)throw new Error(`Invalid SDK call syntax (missing parentheses): ${t}`);const h=l.slice(0,c),u=l.slice(c+1,-1),f=Yut(u,n);let m=e[s];if(!m)throw new Error(`Unknown SDK resource: ${String(s)}`);const y=h.split(".");for(let b=0;b<y.length-1;b++){const P=y[b];if(P&&(m=m[P],!m))throw new Error(`Unknown path ${y.slice(0,b+1).join(".")} on resource ${String(s)}`)}const x=y[y.length-1],p=m[x];if(typeof p!="function")throw new Error(`Unknown method ${x} on ${String(s)}.${y.slice(0,-1).join(".")}`);return await p.apply(m,f)}catch(o){throw Zut()&&console.error("[SDK Executor] Error:",o),(i=r==null?void 0:r.onError)==null||i.call(r,o),o}}function Yut(e,t){if(!e.trim())return[];const r=e.replace(/\{\{([\w.]+)\}\}/g,(i,o)=>{if(o==="now")return JSON.stringify(new Date().toISOString());const s=Xut(t,o);return s===void 0?"null":typeof s=="string"?`"${s}"`:JSON.stringify(s)}).replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":').replace(/'((?:[^'\\]|\\.)*)'/g,(i,o)=>`"${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`);try{return JSON.parse(`[${r}]`)}catch{return Kut(r).map(i=>{const o=i.trim();if(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))return o.slice(1,-1);if(!isNaN(Number(o)))return Number(o);if(o==="true")return!0;if(o==="false")return!1;if(o==="null")return null;try{return JSON.parse(o)}catch{return o}})}}function Kut(e){const t=[];let n="",r=0,i=null;for(let o=0;o<e.length;o++){const s=e[o],l=e[o-1];if((s==='"'||s==="'")&&l!=="\\"&&(i===s?i=null:i||(i=s)),!i&&((s==="{"||s==="["||s==="(")&&r++,(s==="}"||s==="]"||s===")")&&r--,s===","&&r===0)){t.push(n),n="";continue}n+=s}return n.trim()&&t.push(n),t}function Xut(e,t){const n=t.split(".");let r=e;for(const i of n){if(r==null)return;r=r[i]}return r}function _u(e){return e.startsWith("sdk:")}function su(e){return _u(e)?e.slice(4):e}function Jut(e,t,...n){const r=n.map(i=>typeof i=="string"?`'${i}'`:JSON.stringify(i)).join(", ");return`sdk:${e}.${t}(${r})`}function Qut(e,t){const n=new Map,r=(i,o)=>{o.size>0&&n.set(i,o)};return r("--bf-fd",e.flexDirection),r("--bf-gap",e.gap),r("--bf-w",e.width),r("--bf-min-h",e.minHeight),r("--bf-items",e.alignItems),r("--bf-justify",e.justifyContent),r("--bf-display",e.display),r("--bf-cols",e.gridCols),r("--bf-grid-template",e.gridTemplateColumns),r("--bf-text",e.textSize),r("--bf-radius",e.borderRadius),e.padding.p.size>0&&r("--bf-p",e.padding.p),e.padding.px.size>0&&r("--bf-px",e.padding.px),e.padding.py.size>0&&r("--bf-py",e.padding.py),e.margin.all.size>0&&r("--bf-m",e.margin.all),e.margin.t.size>0&&r("--bf-mt",e.margin.t),e.margin.r.size>0&&r("--bf-mr",e.margin.r),e.margin.b.size>0&&r("--bf-mb",e.margin.b),e.margin.l.size>0&&r("--bf-ml",e.margin.l),e.margin.x.size>0&&r("--bf-mx",e.margin.x),e.margin.y.size>0&&r("--bf-my",e.margin.y),n}function tht(e,t){const n=String(t).replace(/[^a-zA-Z0-9_-]/g,"_");return`${e}-${n}`}function X$(e,t,n){const r=Qut(n);if(r.size===0)return"";const i=`[data-bf-r="${e}-${t}"]`,o=[];for(const s of dC){if(s==="base")continue;const l=fC[s],c=[];for(const[h,u]of r)if(u.has(s)){const f=tht(h,t);c.push(` ${f}: ${u.get(s)};`)}c.length>0&&o.push(`@media (min-width: ${l}px) {
123
+ */(function(e,t){(function(n,r){r(t)})(iu,function(n){var r="1.9.4";function i(a){var d,g,_,C;for(g=1,_=arguments.length;g<_;g++){C=arguments[g];for(d in C)a[d]=C[d]}return a}var o=Object.create||function(){function a(){}return function(d){return a.prototype=d,new a}}();function s(a,d){var g=Array.prototype.slice;if(a.bind)return a.bind.apply(a,g.call(arguments,1));var _=g.call(arguments,2);return function(){return a.apply(d,_.length?_.concat(g.call(arguments)):arguments)}}var l=0;function c(a){return"_leaflet_id"in a||(a._leaflet_id=++l),a._leaflet_id}function h(a,d,g){var _,C,R,q;return q=function(){_=!1,C&&(R.apply(g,C),C=!1)},R=function(){_?C=arguments:(a.apply(g,arguments),setTimeout(q,d),_=!0)},R}function u(a,d,g){var _=d[1],C=d[0],R=_-C;return a===_&&g?a:((a-C)%R+R)%R+C}function f(){return!1}function m(a,d){if(d===!1)return a;var g=Math.pow(10,d===void 0?6:d);return Math.round(a*g)/g}function y(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function x(a){return y(a).split(/\s+/)}function p(a,d){Object.prototype.hasOwnProperty.call(a,"options")||(a.options=a.options?o(a.options):{});for(var g in d)a.options[g]=d[g];return a.options}function b(a,d,g){var _=[];for(var C in a)_.push(encodeURIComponent(g?C.toUpperCase():C)+"="+encodeURIComponent(a[C]));return(!d||d.indexOf("?")===-1?"?":"&")+_.join("&")}var P=/\{ *([\w_ -]+) *\}/g;function S(a,d){return a.replace(P,function(g,_){var C=d[_];if(C===void 0)throw new Error("No value provided for variable "+g);return typeof C=="function"&&(C=C(d)),C})}var A=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};function E(a,d){for(var g=0;g<a.length;g++)if(a[g]===d)return g;return-1}var w="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function T(a){return window["webkit"+a]||window["moz"+a]||window["ms"+a]}var O=0;function I(a){var d=+new Date,g=Math.max(0,16-(d-O));return O=d+g,window.setTimeout(a,g)}var N=window.requestAnimationFrame||T("RequestAnimationFrame")||I,F=window.cancelAnimationFrame||T("CancelAnimationFrame")||T("CancelRequestAnimationFrame")||function(a){window.clearTimeout(a)};function D(a,d,g){if(g&&N===I)a.call(d);else return N.call(window,s(a,d))}function j(a){a&&F.call(window,a)}var K={__proto__:null,extend:i,create:o,bind:s,get lastId(){return l},stamp:c,throttle:h,wrapNum:u,falseFn:f,formatNum:m,trim:y,splitWords:x,setOptions:p,getParamString:b,template:S,isArray:A,indexOf:E,emptyImageUrl:w,requestFn:N,cancelFn:F,requestAnimFrame:D,cancelAnimFrame:j};function U(){}U.extend=function(a){var d=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},g=d.__super__=this.prototype,_=o(g);_.constructor=d,d.prototype=_;for(var C in this)Object.prototype.hasOwnProperty.call(this,C)&&C!=="prototype"&&C!=="__super__"&&(d[C]=this[C]);return a.statics&&i(d,a.statics),a.includes&&(z(a.includes),i.apply(null,[_].concat(a.includes))),i(_,a),delete _.statics,delete _.includes,_.options&&(_.options=g.options?o(g.options):{},i(_.options,a.options)),_._initHooks=[],_.callInitHooks=function(){if(!this._initHooksCalled){g.callInitHooks&&g.callInitHooks.call(this),this._initHooksCalled=!0;for(var R=0,q=_._initHooks.length;R<q;R++)_._initHooks[R].call(this)}},d},U.include=function(a){var d=this.prototype.options;return i(this.prototype,a),a.options&&(this.prototype.options=d,this.mergeOptions(a.options)),this},U.mergeOptions=function(a){return i(this.prototype.options,a),this},U.addInitHook=function(a){var d=Array.prototype.slice.call(arguments,1),g=typeof a=="function"?a:function(){this[a].apply(this,d)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(g),this};function z(a){if(!(typeof L>"u"||!L||!L.Mixin)){a=A(a)?a:[a];for(var d=0;d<a.length;d++)a[d]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Y={on:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d);else{a=x(a);for(var C=0,R=a.length;C<R;C++)this._on(a[C],d,g)}return this},off:function(a,d,g){if(!arguments.length)delete this._events;else if(typeof a=="object")for(var _ in a)this._off(_,a[_],d);else{a=x(a);for(var C=arguments.length===1,R=0,q=a.length;R<q;R++)C?this._off(a[R]):this._off(a[R],d,g)}return this},_on:function(a,d,g,_){if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}if(this._listens(a,d,g)===!1){g===this&&(g=void 0);var C={fn:d,ctx:g};_&&(C.once=!0),this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(C)}},_off:function(a,d,g){var _,C,R;if(this._events&&(_=this._events[a],!!_)){if(arguments.length===1){if(this._firingCount)for(C=0,R=_.length;C<R;C++)_[C].fn=f;delete this._events[a];return}if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}var q=this._listens(a,d,g);if(q!==!1){var rt=_[q];this._firingCount&&(rt.fn=f,this._events[a]=_=_.slice()),_.splice(q,1)}}},fire:function(a,d,g){if(!this.listens(a,g))return this;var _=i({},d,{type:a,target:this,sourceTarget:d&&d.sourceTarget||this});if(this._events){var C=this._events[a];if(C){this._firingCount=this._firingCount+1||1;for(var R=0,q=C.length;R<q;R++){var rt=C[R],st=rt.fn;rt.once&&this.off(a,st,rt.ctx),st.call(rt.ctx||this,_)}this._firingCount--}}return g&&this._propagateEvent(_),this},listens:function(a,d,g,_){typeof a!="string"&&console.warn('"string" type argument expected');var C=d;typeof d!="function"&&(_=!!d,C=void 0,g=void 0);var R=this._events&&this._events[a];if(R&&R.length&&this._listens(a,C,g)!==!1)return!0;if(_){for(var q in this._eventParents)if(this._eventParents[q].listens(a,d,g,_))return!0}return!1},_listens:function(a,d,g){if(!this._events)return!1;var _=this._events[a]||[];if(!d)return!!_.length;g===this&&(g=void 0);for(var C=0,R=_.length;C<R;C++)if(_[C].fn===d&&_[C].ctx===g)return C;return!1},once:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d,!0);else{a=x(a);for(var C=0,R=a.length;C<R;C++)this._on(a[C],d,g,!0)}return this},addEventParent:function(a){return this._eventParents=this._eventParents||{},this._eventParents[c(a)]=a,this},removeEventParent:function(a){return this._eventParents&&delete this._eventParents[c(a)],this},_propagateEvent:function(a){for(var d in this._eventParents)this._eventParents[d].fire(a.type,i({layer:a.target,propagatedFrom:a.target},a),!0)}};Y.addEventListener=Y.on,Y.removeEventListener=Y.clearAllEventListeners=Y.off,Y.addOneTimeEventListener=Y.once,Y.fireEvent=Y.fire,Y.hasEventListeners=Y.listens;var G=U.extend(Y);function X(a,d,g){this.x=g?Math.round(a):a,this.y=g?Math.round(d):d}var lt=Math.trunc||function(a){return a>0?Math.floor(a):Math.ceil(a)};X.prototype={clone:function(){return new X(this.x,this.y)},add:function(a){return this.clone()._add(H(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(H(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},scaleBy:function(a){return new X(this.x*a.x,this.y*a.y)},unscaleBy:function(a){return new X(this.x/a.x,this.y/a.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=lt(this.x),this.y=lt(this.y),this},distanceTo:function(a){a=H(a);var d=a.x-this.x,g=a.y-this.y;return Math.sqrt(d*d+g*g)},equals:function(a){return a=H(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=H(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function H(a,d,g){return a instanceof X?a:A(a)?new X(a[0],a[1]):a==null?a:typeof a=="object"&&"x"in a&&"y"in a?new X(a.x,a.y):new X(a,d,g)}function et(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}et.prototype={extend:function(a){var d,g;if(!a)return this;if(a instanceof X||typeof a[0]=="number"||"x"in a)d=g=H(a);else if(a=it(a),d=a.min,g=a.max,!d||!g)return this;return!this.min&&!this.max?(this.min=d.clone(),this.max=g.clone()):(this.min.x=Math.min(d.x,this.min.x),this.max.x=Math.max(g.x,this.max.x),this.min.y=Math.min(d.y,this.min.y),this.max.y=Math.max(g.y,this.max.y)),this},getCenter:function(a){return H((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return H(this.min.x,this.max.y)},getTopRight:function(){return H(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var d,g;return typeof a[0]=="number"||a instanceof X?a=H(a):a=it(a),a instanceof et?(d=a.min,g=a.max):d=g=a,d.x>=this.min.x&&g.x<=this.max.x&&d.y>=this.min.y&&g.y<=this.max.y},intersects:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,R=C.x>=d.x&&_.x<=g.x,q=C.y>=d.y&&_.y<=g.y;return R&&q},overlaps:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,R=C.x>d.x&&_.x<g.x,q=C.y>d.y&&_.y<g.y;return R&&q},isValid:function(){return!!(this.min&&this.max)},pad:function(a){var d=this.min,g=this.max,_=Math.abs(d.x-g.x)*a,C=Math.abs(d.y-g.y)*a;return it(H(d.x-_,d.y-C),H(g.x+_,g.y+C))},equals:function(a){return a?(a=it(a),this.min.equals(a.getTopLeft())&&this.max.equals(a.getBottomRight())):!1}};function it(a,d){return!a||a instanceof et?a:new et(a,d)}function at(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}at.prototype={extend:function(a){var d=this._southWest,g=this._northEast,_,C;if(a instanceof yt)_=a,C=a;else if(a instanceof at){if(_=a._southWest,C=a._northEast,!_||!C)return this}else return a?this.extend(vt(a)||ct(a)):this;return!d&&!g?(this._southWest=new yt(_.lat,_.lng),this._northEast=new yt(C.lat,C.lng)):(d.lat=Math.min(_.lat,d.lat),d.lng=Math.min(_.lng,d.lng),g.lat=Math.max(C.lat,g.lat),g.lng=Math.max(C.lng,g.lng)),this},pad:function(a){var d=this._southWest,g=this._northEast,_=Math.abs(d.lat-g.lat)*a,C=Math.abs(d.lng-g.lng)*a;return new at(new yt(d.lat-_,d.lng-C),new yt(g.lat+_,g.lng+C))},getCenter:function(){return new yt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new yt(this.getNorth(),this.getWest())},getSouthEast:function(){return new yt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){typeof a[0]=="number"||a instanceof yt||"lat"in a?a=vt(a):a=ct(a);var d=this._southWest,g=this._northEast,_,C;return a instanceof at?(_=a.getSouthWest(),C=a.getNorthEast()):_=C=a,_.lat>=d.lat&&C.lat<=g.lat&&_.lng>=d.lng&&C.lng<=g.lng},intersects:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),R=C.lat>=d.lat&&_.lat<=g.lat,q=C.lng>=d.lng&&_.lng<=g.lng;return R&&q},overlaps:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),R=C.lat>d.lat&&_.lat<g.lat,q=C.lng>d.lng&&_.lng<g.lng;return R&&q},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a,d){return a?(a=ct(a),this._southWest.equals(a.getSouthWest(),d)&&this._northEast.equals(a.getNorthEast(),d)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ct(a,d){return a instanceof at?a:new at(a,d)}function yt(a,d,g){if(isNaN(a)||isNaN(d))throw new Error("Invalid LatLng object: ("+a+", "+d+")");this.lat=+a,this.lng=+d,g!==void 0&&(this.alt=+g)}yt.prototype={equals:function(a,d){if(!a)return!1;a=vt(a);var g=Math.max(Math.abs(this.lat-a.lat),Math.abs(this.lng-a.lng));return g<=(d===void 0?1e-9:d)},toString:function(a){return"LatLng("+m(this.lat,a)+", "+m(this.lng,a)+")"},distanceTo:function(a){return Tt.distance(this,vt(a))},wrap:function(){return Tt.wrapLatLng(this)},toBounds:function(a){var d=180*a/40075017,g=d/Math.cos(Math.PI/180*this.lat);return ct([this.lat-d,this.lng-g],[this.lat+d,this.lng+g])},clone:function(){return new yt(this.lat,this.lng,this.alt)}};function vt(a,d,g){return a instanceof yt?a:A(a)&&typeof a[0]!="object"?a.length===3?new yt(a[0],a[1],a[2]):a.length===2?new yt(a[0],a[1]):null:a==null?a:typeof a=="object"&&"lat"in a?new yt(a.lat,"lng"in a?a.lng:a.lon,a.alt):d===void 0?null:new yt(a,d,g)}var Et={latLngToPoint:function(a,d){var g=this.projection.project(a),_=this.scale(d);return this.transformation._transform(g,_)},pointToLatLng:function(a,d){var g=this.scale(d),_=this.transformation.untransform(a,g);return this.projection.unproject(_)},project:function(a){return this.projection.project(a)},unproject:function(a){return this.projection.unproject(a)},scale:function(a){return 256*Math.pow(2,a)},zoom:function(a){return Math.log(a/256)/Math.LN2},getProjectedBounds:function(a){if(this.infinite)return null;var d=this.projection.bounds,g=this.scale(a),_=this.transformation.transform(d.min,g),C=this.transformation.transform(d.max,g);return new et(_,C)},infinite:!1,wrapLatLng:function(a){var d=this.wrapLng?u(a.lng,this.wrapLng,!0):a.lng,g=this.wrapLat?u(a.lat,this.wrapLat,!0):a.lat,_=a.alt;return new yt(g,d,_)},wrapLatLngBounds:function(a){var d=a.getCenter(),g=this.wrapLatLng(d),_=d.lat-g.lat,C=d.lng-g.lng;if(_===0&&C===0)return a;var R=a.getSouthWest(),q=a.getNorthEast(),rt=new yt(R.lat-_,R.lng-C),st=new yt(q.lat-_,q.lng-C);return new at(rt,st)}},Tt=i({},Et,{wrapLng:[-180,180],R:6371e3,distance:function(a,d){var g=Math.PI/180,_=a.lat*g,C=d.lat*g,R=Math.sin((d.lat-a.lat)*g/2),q=Math.sin((d.lng-a.lng)*g/2),rt=R*R+Math.cos(_)*Math.cos(C)*q*q,st=2*Math.atan2(Math.sqrt(rt),Math.sqrt(1-rt));return this.R*st}}),ft=6378137,dt={R:ft,MAX_LATITUDE:85.0511287798,project:function(a){var d=Math.PI/180,g=this.MAX_LATITUDE,_=Math.max(Math.min(g,a.lat),-g),C=Math.sin(_*d);return new X(this.R*a.lng*d,this.R*Math.log((1+C)/(1-C))/2)},unproject:function(a){var d=180/Math.PI;return new yt((2*Math.atan(Math.exp(a.y/this.R))-Math.PI/2)*d,a.x*d/this.R)},bounds:function(){var a=ft*Math.PI;return new et([-a,-a],[a,a])}()};function Ct(a,d,g,_){if(A(a)){this._a=a[0],this._b=a[1],this._c=a[2],this._d=a[3];return}this._a=a,this._b=d,this._c=g,this._d=_}Ct.prototype={transform:function(a,d){return this._transform(a.clone(),d)},_transform:function(a,d){return d=d||1,a.x=d*(this._a*a.x+this._b),a.y=d*(this._c*a.y+this._d),a},untransform:function(a,d){return d=d||1,new X((a.x/d-this._b)/this._a,(a.y/d-this._d)/this._c)}};function nt(a,d,g,_){return new Ct(a,d,g,_)}var Lt=i({},Tt,{code:"EPSG:3857",projection:dt,transformation:function(){var a=.5/(Math.PI*dt.R);return nt(a,.5,-a,.5)}()}),bt=i({},Lt,{code:"EPSG:900913"});function me(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function ie(a,d){var g="",_,C,R,q,rt,st;for(_=0,R=a.length;_<R;_++){for(rt=a[_],C=0,q=rt.length;C<q;C++)st=rt[C],g+=(C?"L":"M")+st.x+" "+st.y;g+=d?It.svg?"z":"x":""}return g||"M0 0"}var Xt=document.documentElement.style,Ne="ActiveXObject"in window,Wt=Ne&&!document.addEventListener,ee="msLaunchUri"in navigator&&!("documentMode"in document),ne=Cn("webkit"),Yt=Cn("android"),oe=Cn("android 2")||Cn("android 3"),Me=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),se=Yt&&Cn("Google")&&Me<537&&!("AudioNode"in window),on=!!window.opera,en=!ee&&Cn("chrome"),Ke=Cn("gecko")&&!ne&&!on&&!Ne,xo=!en&&Cn("safari"),ln=Cn("phantom"),kt="OTransition"in Xt,Nn=navigator.platform.indexOf("Win")===0,We=Ne&&"transition"in Xt,Ti="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!oe,wo="MozPerspective"in Xt,_o=!window.L_DISABLE_3D&&(We||Ti||wo)&&!kt&&!ln,de=typeof orientation<"u"||Cn("mobile"),ae=de&&ne,Ei=de&&Ti,Ci=!window.PointerEvent&&window.MSPointerEvent,Tr=!!(window.PointerEvent||Ci),Oi="ontouchstart"in window||!!window.TouchEvent,ds=!window.L_NO_TOUCH&&(Oi||Tr),Mi=de&&on,ii=de&&Ke,ki=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Vr=function(){var a=!1;try{var d=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("testPassiveEventSupport",f,d),window.removeEventListener("testPassiveEventSupport",f,d)}catch{}return a}(),So=function(){return!!document.createElement("canvas").getContext}(),$i=!!(document.createElementNS&&me("svg").createSVGRect),Ii=!!$i&&function(){var a=document.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Er=!$i&&function(){try{var a=document.createElement("div");a.innerHTML='<v:shape adj="1"/>';var d=a.firstChild;return d.style.behavior="url(#default#VML)",d&&typeof d.adj=="object"}catch{return!1}}(),Ri=navigator.platform.indexOf("Mac")===0,Li=navigator.platform.indexOf("Linux")===0;function Cn(a){return navigator.userAgent.toLowerCase().indexOf(a)>=0}var It={ie:Ne,ielt9:Wt,edge:ee,webkit:ne,android:Yt,android23:oe,androidStock:se,opera:on,chrome:en,gecko:Ke,safari:xo,phantom:ln,opera12:kt,win:Nn,ie3d:We,webkit3d:Ti,gecko3d:wo,any3d:_o,mobile:de,mobileWebkit:ae,mobileWebkit3d:Ei,msPointer:Ci,pointer:Tr,touch:ds,touchNative:Oi,mobileOpera:Mi,mobileGecko:ii,retina:ki,passiveEvents:Vr,canvas:So,svg:$i,vml:Er,inlineSvg:Ii,mac:Ri,linux:Li},Po=It.msPointer?"MSPointerDown":"pointerdown",On=It.msPointer?"MSPointerMove":"pointermove",Ni=It.msPointer?"MSPointerUp":"pointerup",Ao=It.msPointer?"MSPointerCancel":"pointercancel",oi={touchstart:Po,touchmove:On,touchend:Ni,touchcancel:Ao},ji={touchstart:cn,touchmove:Te,touchend:Te,touchcancel:Te},ur={},Di=!1;function ps(a,d,g){return d==="touchstart"&&ys(),ji[d]?(g=ji[d].bind(this,g),a.addEventListener(oi[d],g,!1),g):(console.warn("wrong event specified:",d),f)}function Ur(a,d,g){if(!oi[d]){console.warn("wrong event specified:",d);return}a.removeEventListener(oi[d],g,!1)}function To(a){ur[a.pointerId]=a}function ms(a){ur[a.pointerId]&&(ur[a.pointerId]=a)}function gs(a){delete ur[a.pointerId]}function ys(){Di||(document.addEventListener(Po,To,!0),document.addEventListener(On,ms,!0),document.addEventListener(Ni,gs,!0),document.addEventListener(Ao,gs,!0),Di=!0)}function Te(a,d){if(d.pointerType!==(d.MSPOINTER_TYPE_MOUSE||"mouse")){d.touches=[];for(var g in ur)d.touches.push(ur[g]);d.changedTouches=[d],a(d)}}function cn(a,d){d.MSPOINTER_TYPE_TOUCH&&d.pointerType===d.MSPOINTER_TYPE_TOUCH&&hn(d),Te(a,d)}function Ea(a){var d={},g,_;for(_ in a)g=a[_],d[_]=g&&g.bind?g.bind(a):g;return a=d,d.type="dblclick",d.detail=2,d.isTrusted=!1,d._simulated=!0,d}var vs=200;function bs(a,d){a.addEventListener("dblclick",d);var g=0,_;function C(R){if(R.detail!==1){_=R.detail;return}if(!(R.pointerType==="mouse"||R.sourceCapabilities&&!R.sourceCapabilities.firesTouchEvents)){var q=Ma(R);if(!(q.some(function(st){return st instanceof HTMLLabelElement&&st.attributes.for})&&!q.some(function(st){return st instanceof HTMLInputElement||st instanceof HTMLSelectElement}))){var rt=Date.now();rt-g<=vs?(_++,_===2&&d(Ea(R))):_=1,g=rt}}}return a.addEventListener("click",C),{dblclick:d,simDblclick:C}}function Bi(a,d){a.removeEventListener("dblclick",d.dblclick),a.removeEventListener("click",d.simDblclick)}var Sn=un(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Xn=un(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Eo=Xn==="webkitTransition"||Xn==="OTransition"?Xn+"End":"transitionend";function si(a){return typeof a=="string"?document.getElementById(a):a}function Mn(a,d){var g=a.style[d]||a.currentStyle&&a.currentStyle[d];if((!g||g==="auto")&&document.defaultView){var _=document.defaultView.getComputedStyle(a,null);g=_?_[d]:null}return g==="auto"?null:g}function re(a,d,g){var _=document.createElement(a);return _.className=d||"",g&&g.appendChild(_),_}function Kt(a){var d=a.parentNode;d&&d.removeChild(a)}function hr(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function be(a){var d=a.parentNode;d&&d.lastChild!==a&&d.appendChild(a)}function St(a){var d=a.parentNode;d&&d.firstChild!==a&&d.insertBefore(a,d.firstChild)}function xe(a,d){if(a.classList!==void 0)return a.classList.contains(d);var g=zi(a);return g.length>0&&new RegExp("(^|\\s)"+d+"(\\s|$)").test(g)}function Rt(a,d){if(a.classList!==void 0)for(var g=x(d),_=0,C=g.length;_<C;_++)a.classList.add(g[_]);else if(!xe(a,d)){var R=zi(a);xs(a,(R?R+" ":"")+d)}}function le(a,d){a.classList!==void 0?a.classList.remove(d):xs(a,y((" "+zi(a)+" ").replace(" "+d+" "," ")))}function xs(a,d){a.className.baseVal===void 0?a.className=d:a.className.baseVal=d}function zi(a){return a.correspondingElement&&(a=a.correspondingElement),a.className.baseVal===void 0?a.className:a.className.baseVal}function kn(a,d){"opacity"in a.style?a.style.opacity=d:"filter"in a.style&&ai(a,d)}function ai(a,d){var g=!1,_="DXImageTransform.Microsoft.Alpha";try{g=a.filters.item(_)}catch{if(d===1)return}d=Math.round(d*100),g?(g.Enabled=d!==100,g.Opacity=d):a.style.filter+=" progid:"+_+"(opacity="+d+")"}function un(a){for(var d=document.documentElement.style,g=0;g<a.length;g++)if(a[g]in d)return a[g];return!1}function Ge(a,d,g){var _=d||new X(0,0);a.style[Sn]=(It.ie3d?"translate("+_.x+"px,"+_.y+"px)":"translate3d("+_.x+"px,"+_.y+"px,0)")+(g?" scale("+g+")":"")}function Ie(a,d){a._leaflet_pos=d,It.any3d?Ge(a,d):(a.style.left=d.x+"px",a.style.top=d.y+"px")}function Ee(a){return a._leaflet_pos||new X(0,0)}var ws,Hr,Fi;if("onselectstart"in document)ws=function(){Ft(window,"selectstart",hn)},Hr=function(){Ce(window,"selectstart",hn)};else{var _s=un(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ws=function(){if(_s){var a=document.documentElement.style;Fi=a[_s],a[_s]="none"}},Hr=function(){_s&&(document.documentElement.style[_s]=Fi,Fi=void 0)}}function Cr(){Ft(window,"dragstart",hn)}function Co(){Ce(window,"dragstart",hn)}var Wi,bc;function ce(a){for(;a.tabIndex===-1;)a=a.parentNode;a.style&&(Ss(),Wi=a,bc=a.style.outlineStyle,a.style.outlineStyle="none",Ft(window,"keydown",Ss))}function Ss(){Wi&&(Wi.style.outlineStyle=bc,Wi=void 0,bc=void 0,Ce(window,"keydown",Ss))}function kh(a){do a=a.parentNode;while((!a.offsetWidth||!a.offsetHeight)&&a!==document.body);return a}function Oo(a){var d=a.getBoundingClientRect();return{x:d.width/a.offsetWidth||1,y:d.height/a.offsetHeight||1,boundingClientRect:d}}var _m={__proto__:null,TRANSFORM:Sn,TRANSITION:Xn,TRANSITION_END:Eo,get:si,getStyle:Mn,create:re,remove:Kt,empty:hr,toFront:be,toBack:St,hasClass:xe,addClass:Rt,removeClass:le,setClass:xs,getClass:zi,setOpacity:kn,testProp:un,setTransform:Ge,setPosition:Ie,getPosition:Ee,get disableTextSelection(){return ws},get enableTextSelection(){return Hr},disableImageDrag:Cr,enableImageDrag:Co,preventOutline:ce,restoreOutline:Ss,getSizedParentNode:kh,getScale:Oo};function Ft(a,d,g,_){if(d&&typeof d=="object")for(var C in d)Ca(a,C,d[C],g);else{d=x(d);for(var R=0,q=d.length;R<q;R++)Ca(a,d[R],g,_)}return this}var ge="_leaflet_events";function Ce(a,d,g,_){if(arguments.length===1)xc(a),delete a[ge];else if(d&&typeof d=="object")for(var C in d)Oa(a,C,d[C],g);else if(d=x(d),arguments.length===2)xc(a,function(rt){return E(d,rt)!==-1});else for(var R=0,q=d.length;R<q;R++)Oa(a,d[R],g,_);return this}function xc(a,d){for(var g in a[ge]){var _=g.split(/\d/)[0];(!d||d(_))&&Oa(a,_,null,null,g)}}var qr={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ca(a,d,g,_){var C=d+c(g)+(_?"_"+c(_):"");if(a[ge]&&a[ge][C])return this;var R=function(rt){return g.call(_||a,rt||window.event)},q=R;!It.touchNative&&It.pointer&&d.indexOf("touch")===0?R=ps(a,d,R):It.touch&&d==="dblclick"?R=bs(a,R):"addEventListener"in a?d==="touchstart"||d==="touchmove"||d==="wheel"||d==="mousewheel"?a.addEventListener(qr[d]||d,R,It.passiveEvents?{passive:!1}:!1):d==="mouseenter"||d==="mouseleave"?(R=function(rt){rt=rt||window.event,Ps(a,rt)&&q(rt)},a.addEventListener(qr[d],R,!1)):a.addEventListener(d,q,!1):a.attachEvent("on"+d,R),a[ge]=a[ge]||{},a[ge][C]=R}function Oa(a,d,g,_,C){C=C||d+c(g)+(_?"_"+c(_):"");var R=a[ge]&&a[ge][C];if(!R)return this;!It.touchNative&&It.pointer&&d.indexOf("touch")===0?Ur(a,d,R):It.touch&&d==="dblclick"?Bi(a,R):"removeEventListener"in a?a.removeEventListener(qr[d]||d,R,!1):a.detachEvent("on"+d,R),a[ge][C]=null}function Vi(a){return a.stopPropagation?a.stopPropagation():a.originalEvent?a.originalEvent._stopped=!0:a.cancelBubble=!0,this}function li(a){return Ca(a,"wheel",Vi),this}function Ui(a){return Ft(a,"mousedown touchstart dblclick contextmenu",Vi),a._leaflet_disable_click=!0,this}function hn(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this}function jn(a){return hn(a),Vi(a),this}function Ma(a){if(a.composedPath)return a.composedPath();for(var d=[],g=a.target;g;)d.push(g),g=g.parentNode;return d}function Mo(a,d){if(!d)return new X(a.clientX,a.clientY);var g=Oo(d),_=g.boundingClientRect;return new X((a.clientX-_.left)/g.x-d.clientLeft,(a.clientY-_.top)/g.y-d.clientTop)}var Dn=It.linux&&It.chrome?window.devicePixelRatio:It.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function fr(a){return It.edge?a.wheelDeltaY/2:a.deltaY&&a.deltaMode===0?-a.deltaY/Dn:a.deltaY&&a.deltaMode===1?-a.deltaY*20:a.deltaY&&a.deltaMode===2?-a.deltaY*60:a.deltaX||a.deltaZ?0:a.wheelDelta?(a.wheelDeltaY||a.wheelDelta)/2:a.detail&&Math.abs(a.detail)<32765?-a.detail*20:a.detail?a.detail/-32765*60:0}function Ps(a,d){var g=d.relatedTarget;if(!g)return!0;try{for(;g&&g!==a;)g=g.parentNode}catch{return!1}return g!==a}var $h={__proto__:null,on:Ft,off:Ce,stopPropagation:Vi,disableScrollPropagation:li,disableClickPropagation:Ui,preventDefault:hn,stop:jn,getPropagationPath:Ma,getMousePosition:Mo,getWheelDelta:fr,isExternalTarget:Ps,addListener:Ft,removeListener:Ce},Or=G.extend({run:function(a,d,g,_){this.stop(),this._el=a,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(_||.5,.2),this._startPos=Ee(a),this._offset=d.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=D(this._animate,this),this._step()},_step:function(a){var d=+new Date-this._startTime,g=this._duration*1e3;d<g?this._runFrame(this._easeOut(d/g),a):(this._runFrame(1),this._complete())},_runFrame:function(a,d){var g=this._startPos.add(this._offset.multiplyBy(a));d&&g._round(),Ie(this._el,g),this.fire("step")},_complete:function(){j(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),pe=G.extend({options:{crs:Lt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(a,d){d=p(this,d),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(a),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),d.maxBounds&&this.setMaxBounds(d.maxBounds),d.zoom!==void 0&&(this._zoom=this._limitZoom(d.zoom)),d.center&&d.zoom!==void 0&&this.setView(vt(d.center),d.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Xn&&It.any3d&&!It.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ft(this._proxy,Eo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(a,d,g){if(d=d===void 0?this._zoom:this._limitZoom(d),a=this._limitCenter(vt(a),d,this.options.maxBounds),g=g||{},this._stop(),this._loaded&&!g.reset&&g!==!0){g.animate!==void 0&&(g.zoom=i({animate:g.animate},g.zoom),g.pan=i({animate:g.animate,duration:g.duration},g.pan));var _=this._zoom!==d?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,d,g.zoom):this._tryAnimatedPan(a,g.pan);if(_)return clearTimeout(this._sizeTimer),this}return this._resetView(a,d,g.pan&&g.pan.noMoveStart),this},setZoom:function(a,d){return this._loaded?this.setView(this.getCenter(),a,{zoom:d}):(this._zoom=a,this)},zoomIn:function(a,d){return a=a||(It.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+a,d)},zoomOut:function(a,d){return a=a||(It.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-a,d)},setZoomAround:function(a,d,g){var _=this.getZoomScale(d),C=this.getSize().divideBy(2),R=a instanceof X?a:this.latLngToContainerPoint(a),q=R.subtract(C).multiplyBy(1-1/_),rt=this.containerPointToLatLng(C.add(q));return this.setView(rt,d,{zoom:g})},_getBoundsCenterZoom:function(a,d){d=d||{},a=a.getBounds?a.getBounds():ct(a);var g=H(d.paddingTopLeft||d.padding||[0,0]),_=H(d.paddingBottomRight||d.padding||[0,0]),C=this.getBoundsZoom(a,!1,g.add(_));if(C=typeof d.maxZoom=="number"?Math.min(d.maxZoom,C):C,C===1/0)return{center:a.getCenter(),zoom:C};var R=_.subtract(g).divideBy(2),q=this.project(a.getSouthWest(),C),rt=this.project(a.getNorthEast(),C),st=this.unproject(q.add(rt).divideBy(2).add(R),C);return{center:st,zoom:C}},fitBounds:function(a,d){if(a=ct(a),!a.isValid())throw new Error("Bounds are not valid.");var g=this._getBoundsCenterZoom(a,d);return this.setView(g.center,g.zoom,d)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,d){return this.setView(a,this._zoom,{pan:d})},panBy:function(a,d){if(a=H(a).round(),d=d||{},!a.x&&!a.y)return this.fire("moveend");if(d.animate!==!0&&!this.getSize().contains(a))return this._resetView(this.unproject(this.project(this.getCenter()).add(a)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Or,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),d.noMoveStart||this.fire("movestart"),d.animate!==!1){Rt(this._mapPane,"leaflet-pan-anim");var g=this._getMapPanePos().subtract(a).round();this._panAnim.run(this._mapPane,g,d.duration||.25,d.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},flyTo:function(a,d,g){if(g=g||{},g.animate===!1||!It.any3d)return this.setView(a,d,g);this._stop();var _=this.project(this.getCenter()),C=this.project(a),R=this.getSize(),q=this._zoom;a=vt(a),d=d===void 0?q:d;var rt=Math.max(R.x,R.y),st=rt*this.getZoomScale(q,d),pt=C.distanceTo(_)||1,Ot=1.42,zt=Ot*Ot;function Nt(Xe){var Wa=Xe?-1:1,jc=Xe?st:rt,nr=st*st-rt*rt+Wa*zt*zt*pt*pt,Jh=2*jc*zt*pt,Va=nr/Jh,Dc=Math.sqrt(Va*Va+1)-Va,Px=Dc<1e-9?-18:Math.log(Dc);return Px}function _t(Xe){return(Math.exp(Xe)-Math.exp(-Xe))/2}function jt(Xe){return(Math.exp(Xe)+Math.exp(-Xe))/2}function Gt(Xe){return _t(Xe)/jt(Xe)}var ue=Nt(0);function Oe(Xe){return rt*(jt(ue)/jt(ue+Ot*Xe))}function Ki(Xe){return rt*(jt(ue)*Gt(ue+Ot*Xe)-_t(ue))/zt}function Hn(Xe){return 1-Math.pow(1-Xe,1.5)}var Ls=Date.now(),er=(Nt(1)-ue)/Ot,kr=g.duration?1e3*g.duration:1e3*er*.8;function Xh(){var Xe=(Date.now()-Ls)/kr,Wa=Hn(Xe)*er;Xe<=1?(this._flyToFrame=D(Xh,this),this._move(this.unproject(_.add(C.subtract(_).multiplyBy(Ki(Wa)/pt)),q),this.getScaleZoom(rt/Oe(Wa),q),{flyTo:!0})):this._move(a,d)._moveEnd(!0)}return this._moveStart(!0,g.noMoveStart),Xh.call(this),this},flyToBounds:function(a,d){var g=this._getBoundsCenterZoom(a,d);return this.flyTo(g.center,g.zoom,d)},setMaxBounds:function(a){return a=ct(a),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),a.isValid()?(this.options.maxBounds=a,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(a){var d=this.options.minZoom;return this.options.minZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(a):this},setMaxZoom:function(a){var d=this.options.maxZoom;return this.options.maxZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(a):this},panInsideBounds:function(a,d){this._enforcingBounds=!0;var g=this.getCenter(),_=this._limitCenter(g,this._zoom,ct(a));return g.equals(_)||this.panTo(_,d),this._enforcingBounds=!1,this},panInside:function(a,d){d=d||{};var g=H(d.paddingTopLeft||d.padding||[0,0]),_=H(d.paddingBottomRight||d.padding||[0,0]),C=this.project(this.getCenter()),R=this.project(a),q=this.getPixelBounds(),rt=it([q.min.add(g),q.max.subtract(_)]),st=rt.getSize();if(!rt.contains(R)){this._enforcingBounds=!0;var pt=R.subtract(rt.getCenter()),Ot=rt.extend(R).getSize().subtract(st);C.x+=pt.x<0?-Ot.x:Ot.x,C.y+=pt.y<0?-Ot.y:Ot.y,this.panTo(this.unproject(C),d),this._enforcingBounds=!1}return this},invalidateSize:function(a){if(!this._loaded)return this;a=i({animate:!1,pan:!0},a===!0?{animate:!0}:a);var d=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),_=d.divideBy(2).round(),C=g.divideBy(2).round(),R=_.subtract(C);return!R.x&&!R.y?this:(a.animate&&a.pan?this.panBy(R):(a.pan&&this._rawPanBy(R),this.fire("move"),a.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:d,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(a){if(a=this._locateOptions=i({timeout:1e4,watch:!1},a),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var d=s(this._handleGeolocationResponse,this),g=s(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(d,g,a):navigator.geolocation.getCurrentPosition(d,g,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){if(this._container._leaflet_id){var d=a.code,g=a.message||(d===1?"permission denied":d===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:d,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(a){if(this._container._leaflet_id){var d=a.coords.latitude,g=a.coords.longitude,_=new yt(d,g),C=_.toBounds(a.coords.accuracy*2),R=this._locateOptions;if(R.setView){var q=this.getBoundsZoom(C);this.setView(_,R.maxZoom?Math.min(q,R.maxZoom):q)}var rt={latlng:_,bounds:C,timestamp:a.timestamp};for(var st in a.coords)typeof a.coords[st]=="number"&&(rt[st]=a.coords[st]);this.fire("locationfound",rt)}},addHandler:function(a,d){if(!d)return this;var g=this[a]=new d(this);return this._handlers.push(g),this.options[a]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Kt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(j(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var a;for(a in this._layers)this._layers[a].remove();for(a in this._panes)Kt(this._panes[a]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(a,d){var g="leaflet-pane"+(a?" leaflet-"+a.replace("Pane","")+"-pane":""),_=re("div",g,d||this._mapPane);return a&&(this._panes[a]=_),_},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var a=this.getPixelBounds(),d=this.unproject(a.getBottomLeft()),g=this.unproject(a.getTopRight());return new at(d,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(a,d,g){a=ct(a),g=H(g||[0,0]);var _=this.getZoom()||0,C=this.getMinZoom(),R=this.getMaxZoom(),q=a.getNorthWest(),rt=a.getSouthEast(),st=this.getSize().subtract(g),pt=it(this.project(rt,_),this.project(q,_)).getSize(),Ot=It.any3d?this.options.zoomSnap:1,zt=st.x/pt.x,Nt=st.y/pt.y,_t=d?Math.max(zt,Nt):Math.min(zt,Nt);return _=this.getScaleZoom(_t,_),Ot&&(_=Math.round(_/(Ot/100))*(Ot/100),_=d?Math.ceil(_/Ot)*Ot:Math.floor(_/Ot)*Ot),Math.max(C,Math.min(R,_))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new X(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(a,d){var g=this._getTopLeftPoint(a,d);return new et(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(a){return this.options.crs.getProjectedBounds(a===void 0?this.getZoom():a)},getPane:function(a){return typeof a=="string"?this._panes[a]:a},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a,d){var g=this.options.crs;return d=d===void 0?this._zoom:d,g.scale(a)/g.scale(d)},getScaleZoom:function(a,d){var g=this.options.crs;d=d===void 0?this._zoom:d;var _=g.zoom(a*g.scale(d));return isNaN(_)?1/0:_},project:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.latLngToPoint(vt(a),d)},unproject:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.pointToLatLng(H(a),d)},layerPointToLatLng:function(a){var d=H(a).add(this.getPixelOrigin());return this.unproject(d)},latLngToLayerPoint:function(a){var d=this.project(vt(a))._round();return d._subtract(this.getPixelOrigin())},wrapLatLng:function(a){return this.options.crs.wrapLatLng(vt(a))},wrapLatLngBounds:function(a){return this.options.crs.wrapLatLngBounds(ct(a))},distance:function(a,d){return this.options.crs.distance(vt(a),vt(d))},containerPointToLayerPoint:function(a){return H(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return H(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var d=this.containerPointToLayerPoint(H(a));return this.layerPointToLatLng(d)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(vt(a)))},mouseEventToContainerPoint:function(a){return Mo(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var d=this._container=si(a);if(d){if(d._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ft(d,"scroll",this._onScroll,this),this._containerId=c(d)},_initLayout:function(){var a=this._container;this._fadeAnimated=this.options.fadeAnimation&&It.any3d,Rt(a,"leaflet-container"+(It.touch?" leaflet-touch":"")+(It.retina?" leaflet-retina":"")+(It.ielt9?" leaflet-oldie":"")+(It.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var d=Mn(a,"position");d!=="absolute"&&d!=="relative"&&d!=="fixed"&&d!=="sticky"&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ie(this._mapPane,new X(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Rt(a.markerPane,"leaflet-zoom-hide"),Rt(a.shadowPane,"leaflet-zoom-hide"))},_resetView:function(a,d,g){Ie(this._mapPane,new X(0,0));var _=!this._loaded;this._loaded=!0,d=this._limitZoom(d),this.fire("viewprereset");var C=this._zoom!==d;this._moveStart(C,g)._move(a,d)._moveEnd(C),this.fire("viewreset"),_&&this.fire("load")},_moveStart:function(a,d){return a&&this.fire("zoomstart"),d||this.fire("movestart"),this},_move:function(a,d,g,_){d===void 0&&(d=this._zoom);var C=this._zoom!==d;return this._zoom=d,this._lastCenter=a,this._pixelOrigin=this._getNewPixelOrigin(a),_?g&&g.pinch&&this.fire("zoom",g):((C||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(a){return a&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return j(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(a){Ie(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(a){this._targets={},this._targets[c(this._container)]=this;var d=a?Ce:Ft;d(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&d(window,"resize",this._onResize,this),It.any3d&&this.options.transform3DLimit&&(a?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){j(this._resizeRequest),this._resizeRequest=D(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var a=this._getMapPanePos();Math.max(Math.abs(a.x),Math.abs(a.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(a,d){for(var g=[],_,C=d==="mouseout"||d==="mouseover",R=a.target||a.srcElement,q=!1;R;){if(_=this._targets[c(R)],_&&(d==="click"||d==="preclick")&&this._draggableMoved(_)){q=!0;break}if(_&&_.listens(d,!0)&&(C&&!Ps(R,a)||(g.push(_),C))||R===this._container)break;R=R.parentNode}return!g.length&&!q&&!C&&this.listens(d,!0)&&(g=[this]),g},_isClickDisabled:function(a){for(;a&&a!==this._container;){if(a._leaflet_disable_click)return!0;a=a.parentNode}},_handleDOMEvent:function(a){var d=a.target||a.srcElement;if(!(!this._loaded||d._leaflet_disable_events||a.type==="click"&&this._isClickDisabled(d))){var g=a.type;g==="mousedown"&&ce(d),this._fireDOMEvent(a,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(a,d,g){if(a.type==="click"){var _=i({},a);_.type="preclick",this._fireDOMEvent(_,_.type,g)}var C=this._findEventTargets(a,d);if(g){for(var R=[],q=0;q<g.length;q++)g[q].listens(d,!0)&&R.push(g[q]);C=R.concat(C)}if(C.length){d==="contextmenu"&&hn(a);var rt=C[0],st={originalEvent:a};if(a.type!=="keypress"&&a.type!=="keydown"&&a.type!=="keyup"){var pt=rt.getLatLng&&(!rt._radius||rt._radius<=10);st.containerPoint=pt?this.latLngToContainerPoint(rt.getLatLng()):this.mouseEventToContainerPoint(a),st.layerPoint=this.containerPointToLayerPoint(st.containerPoint),st.latlng=pt?rt.getLatLng():this.layerPointToLatLng(st.layerPoint)}for(q=0;q<C.length;q++)if(C[q].fire(d,st,!0),st.originalEvent._stopped||C[q].options.bubblingMouseEvents===!1&&E(this._mouseEvents,d)!==-1)return}},_draggableMoved:function(a){return a=a.dragging&&a.dragging.enabled()?a:this,a.dragging&&a.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var a=0,d=this._handlers.length;a<d;a++)this._handlers[a].disable()},whenReady:function(a,d){return this._loaded?a.call(d||this,{target:this}):this.on("load",a,d),this},_getMapPanePos:function(){return Ee(this._mapPane)||new X(0,0)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(a,d){var g=a&&d!==void 0?this._getNewPixelOrigin(a,d):this.getPixelOrigin();return g.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(a,d){var g=this.getSize()._divideBy(2);return this.project(a,d)._subtract(g)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return this.project(a,d)._subtract(_)},_latLngBoundsToNewLayerBounds:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return it([this.project(a.getSouthWest(),d)._subtract(_),this.project(a.getNorthWest(),d)._subtract(_),this.project(a.getSouthEast(),d)._subtract(_),this.project(a.getNorthEast(),d)._subtract(_)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitCenter:function(a,d,g){if(!g)return a;var _=this.project(a,d),C=this.getSize().divideBy(2),R=new et(_.subtract(C),_.add(C)),q=this._getBoundsOffset(R,g,d);return Math.abs(q.x)<=1&&Math.abs(q.y)<=1?a:this.unproject(_.add(q),d)},_limitOffset:function(a,d){if(!d)return a;var g=this.getPixelBounds(),_=new et(g.min.add(a),g.max.add(a));return a.add(this._getBoundsOffset(_,d))},_getBoundsOffset:function(a,d,g){var _=it(this.project(d.getNorthEast(),g),this.project(d.getSouthWest(),g)),C=_.min.subtract(a.min),R=_.max.subtract(a.max),q=this._rebound(C.x,-R.x),rt=this._rebound(C.y,-R.y);return new X(q,rt)},_rebound:function(a,d){return a+d>0?Math.round(a-d)/2:Math.max(0,Math.ceil(a))-Math.max(0,Math.floor(d))},_limitZoom:function(a){var d=this.getMinZoom(),g=this.getMaxZoom(),_=It.any3d?this.options.zoomSnap:1;return _&&(a=Math.round(a/_)*_),Math.max(d,Math.min(g,a))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){le(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,d){var g=this._getCenterOffset(a)._trunc();return(d&&d.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,d),!0)},_createAnimProxy:function(){var a=this._proxy=re("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(a),this.on("zoomanim",function(d){var g=Sn,_=this._proxy.style[g];Ge(this._proxy,this.project(d.center,d.zoom),this.getZoomScale(d.zoom,1)),_===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Kt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var a=this.getCenter(),d=this.getZoom();Ge(this._proxy,this.project(a,d),this.getZoomScale(d,1))},_catchTransitionEnd:function(a){this._animatingZoom&&a.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(a,d,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(d-this._zoom)>this.options.zoomAnimationThreshold)return!1;var _=this.getZoomScale(d),C=this._getCenterOffset(a)._divideBy(1-1/_);return g.animate!==!0&&!this.getSize().contains(C)?!1:(D(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(a,d,!0)},this),!0)},_animateZoom:function(a,d,g,_){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=a,this._animateToZoom=d,Rt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:a,zoom:d,noUpdate:_}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&le(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ka(a,d){return new pe(a,d)}var dr=U.extend({options:{position:"topright"},initialize:function(a){p(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var d=this._map;return d&&d.removeControl(this),this.options.position=a,d&&d.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this.remove(),this._map=a;var d=this._container=this.onAdd(a),g=this.getPosition(),_=a._controlCorners[g];return Rt(d,"leaflet-control"),g.indexOf("bottom")!==-1?_.insertBefore(d,_.firstChild):_.appendChild(d),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Kt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(a){this._map&&a&&a.screenX>0&&a.screenY>0&&this._map.getContainer().focus()}}),As=function(a){return new dr(a)};pe.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.remove(),this},_initControlPos:function(){var a=this._controlCorners={},d="leaflet-",g=this._controlContainer=re("div",d+"control-container",this._container);function _(C,R){var q=d+C+" "+d+R;a[C+R]=re("div",q,g)}_("top","left"),_("top","right"),_("bottom","left"),_("bottom","right")},_clearControlPos:function(){for(var a in this._controlCorners)Kt(this._controlCorners[a]);Kt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ih=dr.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(a,d,g,_){return g<_?-1:_<g?1:0}},initialize:function(a,d,g){p(this,g),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var _ in a)this._addLayer(a[_],_);for(_ in d)this._addLayer(d[_],_,!0)},onAdd:function(a){this._initLayout(),this._update(),this._map=a,a.on("zoomend",this._checkDisabledLayers,this);for(var d=0;d<this._layers.length;d++)this._layers[d].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(a){return dr.prototype.addTo.call(this,a),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var a=0;a<this._layers.length;a++)this._layers[a].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(a,d){return this._addLayer(a,d),this._map?this._update():this},addOverlay:function(a,d){return this._addLayer(a,d,!0),this._map?this._update():this},removeLayer:function(a){a.off("add remove",this._onLayerChange,this);var d=this._getLayer(c(a));return d&&this._layers.splice(this._layers.indexOf(d),1),this._map?this._update():this},expand:function(){Rt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var a=this._map.getSize().y-(this._container.offsetTop+50);return a<this._section.clientHeight?(Rt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=a+"px"):le(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return le(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var a="leaflet-control-layers",d=this._container=re("div",a),g=this.options.collapsed;d.setAttribute("aria-haspopup",!0),Ui(d),li(d);var _=this._section=re("section",a+"-list");g&&(this._map.on("click",this.collapse,this),Ft(d,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var C=this._layersLink=re("a",a+"-toggle",d);C.href="#",C.title="Layers",C.setAttribute("role","button"),Ft(C,{keydown:function(R){R.keyCode===13&&this._expandSafely()},click:function(R){hn(R),this._expandSafely()}},this),g||this.expand(),this._baseLayersList=re("div",a+"-base",_),this._separator=re("div",a+"-separator",_),this._overlaysList=re("div",a+"-overlays",_),d.appendChild(_)},_getLayer:function(a){for(var d=0;d<this._layers.length;d++)if(this._layers[d]&&c(this._layers[d].layer)===a)return this._layers[d]},_addLayer:function(a,d,g){this._map&&a.on("add remove",this._onLayerChange,this),this._layers.push({layer:a,name:d,overlay:g}),this.options.sortLayers&&this._layers.sort(s(function(_,C){return this.options.sortFunction(_.layer,C.layer,_.name,C.name)},this)),this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;hr(this._baseLayersList),hr(this._overlaysList),this._layerControlInputs=[];var a,d,g,_,C=0;for(g=0;g<this._layers.length;g++)_=this._layers[g],this._addItem(_),d=d||_.overlay,a=a||!_.overlay,C+=_.overlay?0:1;return this.options.hideSingleBase&&(a=a&&C>1,this._baseLayersList.style.display=a?"":"none"),this._separator.style.display=d&&a?"":"none",this},_onLayerChange:function(a){this._handlingClick||this._update();var d=this._getLayer(c(a.target)),g=d.overlay?a.type==="add"?"overlayadd":"overlayremove":a.type==="add"?"baselayerchange":null;g&&this._map.fire(g,d)},_createRadioElement:function(a,d){var g='<input type="radio" class="leaflet-control-layers-selector" name="'+a+'"'+(d?' checked="checked"':"")+"/>",_=document.createElement("div");return _.innerHTML=g,_.firstChild},_addItem:function(a){var d=document.createElement("label"),g=this._map.hasLayer(a.layer),_;a.overlay?(_=document.createElement("input"),_.type="checkbox",_.className="leaflet-control-layers-selector",_.defaultChecked=g):_=this._createRadioElement("leaflet-base-layers_"+c(this),g),this._layerControlInputs.push(_),_.layerId=c(a.layer),Ft(_,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+a.name;var R=document.createElement("span");d.appendChild(R),R.appendChild(_),R.appendChild(C);var q=a.overlay?this._overlaysList:this._baseLayersList;return q.appendChild(d),this._checkDisabledLayers(),d},_onInputClick:function(){if(!this._preventClick){var a=this._layerControlInputs,d,g,_=[],C=[];this._handlingClick=!0;for(var R=a.length-1;R>=0;R--)d=a[R],g=this._getLayer(d.layerId).layer,d.checked?_.push(g):d.checked||C.push(g);for(R=0;R<C.length;R++)this._map.hasLayer(C[R])&&this._map.removeLayer(C[R]);for(R=0;R<_.length;R++)this._map.hasLayer(_[R])||this._map.addLayer(_[R]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var a=this._layerControlInputs,d,g,_=this._map.getZoom(),C=a.length-1;C>=0;C--)d=a[C],g=this._getLayer(d.layerId).layer,d.disabled=g.options.minZoom!==void 0&&_<g.options.minZoom||g.options.maxZoom!==void 0&&_>g.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var a=this._section;this._preventClick=!0,Ft(a,"click",hn),this.expand();var d=this;setTimeout(function(){Ce(a,"click",hn),d._preventClick=!1})}}),Sm=function(a,d,g){return new Ih(a,d,g)},gn=dr.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(a){var d="leaflet-control-zoom",g=re("div",d+" leaflet-bar"),_=this.options;return this._zoomInButton=this._createButton(_.zoomInText,_.zoomInTitle,d+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(_.zoomOutText,_.zoomOutTitle,d+"-out",g,this._zoomOut),this._updateDisabled(),a.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(a){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(a.shiftKey?3:1))},_zoomOut:function(a){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(a.shiftKey?3:1))},_createButton:function(a,d,g,_,C){var R=re("a",g,_);return R.innerHTML=a,R.href="#",R.title=d,R.setAttribute("role","button"),R.setAttribute("aria-label",d),Ui(R),Ft(R,"click",jn),Ft(R,"click",C,this),Ft(R,"click",this._refocusOnMap,this),R},_updateDisabled:function(){var a=this._map,d="leaflet-disabled";le(this._zoomInButton,d),le(this._zoomOutButton,d),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||a._zoom===a.getMinZoom())&&(Rt(this._zoomOutButton,d),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||a._zoom===a.getMaxZoom())&&(Rt(this._zoomInButton,d),this._zoomInButton.setAttribute("aria-disabled","true"))}});pe.mergeOptions({zoomControl:!0}),pe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new gn,this.addControl(this.zoomControl))});var Pm=function(a){return new gn(a)},Rh=dr.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(a){var d="leaflet-control-scale",g=re("div",d),_=this.options;return this._addScales(_,d+"-line",g),a.on(_.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),g},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,d,g){a.metric&&(this._mScale=re("div",d,g)),a.imperial&&(this._iScale=re("div",d,g))},_update:function(){var a=this._map,d=a.getSize().y/2,g=a.distance(a.containerPointToLatLng([0,d]),a.containerPointToLatLng([this.options.maxWidth,d]));this._updateScales(g)},_updateScales:function(a){this.options.metric&&a&&this._updateMetric(a),this.options.imperial&&a&&this._updateImperial(a)},_updateMetric:function(a){var d=this._getRoundNum(a),g=d<1e3?d+" m":d/1e3+" km";this._updateScale(this._mScale,g,d/a)},_updateImperial:function(a){var d=a*3.2808399,g,_,C;d>5280?(g=d/5280,_=this._getRoundNum(g),this._updateScale(this._iScale,_+" mi",_/g)):(C=this._getRoundNum(d),this._updateScale(this._iScale,C+" ft",C/d))},_updateScale:function(a,d,g){a.style.width=Math.round(this.options.maxWidth*g)+"px",a.innerHTML=d},_getRoundNum:function(a){var d=Math.pow(10,(Math.floor(a)+"").length-1),g=a/d;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,d*g}}),ko=function(a){return new Rh(a)},Ts='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',pr=dr.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(It.inlineSvg?Ts+" ":"")+"Leaflet</a>"},initialize:function(a){p(this,a),this._attributions={}},onAdd:function(a){a.attributionControl=this,this._container=re("div","leaflet-control-attribution"),Ui(this._container);for(var d in a._layers)a._layers[d].getAttribution&&this.addAttribution(a._layers[d].getAttribution());return this._update(),a.on("layeradd",this._addAttribution,this),this._container},onRemove:function(a){a.off("layeradd",this._addAttribution,this)},_addAttribution:function(a){a.layer.getAttribution&&(this.addAttribution(a.layer.getAttribution()),a.layer.once("remove",function(){this.removeAttribution(a.layer.getAttribution())},this))},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):this},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):this},_update:function(){if(this._map){var a=[];for(var d in this._attributions)this._attributions[d]&&a.push(d);var g=[];this.options.prefix&&g.push(this.options.prefix),a.length&&g.push(a.join(", ")),this._container.innerHTML=g.join(' <span aria-hidden="true">|</span> ')}}});pe.mergeOptions({attributionControl:!0}),pe.addInitHook(function(){this.options.attributionControl&&new pr().addTo(this)});var wc=function(a){return new pr(a)};dr.Layers=Ih,dr.Zoom=gn,dr.Scale=Rh,dr.Attribution=pr,As.layers=Sm,As.zoom=Pm,As.scale=ko,As.attribution=wc;var Jn=U.extend({initialize:function(a){this._map=a},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Jn.addTo=function(a,d){return a.addHandler(d,this),this};var je={Events:Y},Hi=It.touch?"touchstart mousedown":"mousedown",ci=G.extend({options:{clickTolerance:3},initialize:function(a,d,g,_){p(this,_),this._element=a,this._dragStartTarget=d||a,this._preventOutline=g},enable:function(){this._enabled||(Ft(this._dragStartTarget,Hi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ci._dragging===this&&this.finishDrag(!0),Ce(this._dragStartTarget,Hi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(a){if(this._enabled&&(this._moved=!1,!xe(this._element,"leaflet-zoom-anim"))){if(a.touches&&a.touches.length!==1){ci._dragging===this&&this.finishDrag();return}if(!(ci._dragging||a.shiftKey||a.which!==1&&a.button!==1&&!a.touches)&&(ci._dragging=this,this._preventOutline&&ce(this._element),Cr(),ws(),!this._moving)){this.fire("down");var d=a.touches?a.touches[0]:a,g=kh(this._element);this._startPoint=new X(d.clientX,d.clientY),this._startPos=Ee(this._element),this._parentScale=Oo(g);var _=a.type==="mousedown";Ft(document,_?"mousemove":"touchmove",this._onMove,this),Ft(document,_?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(a){if(this._enabled){if(a.touches&&a.touches.length>1){this._moved=!0;return}var d=a.touches&&a.touches.length===1?a.touches[0]:a,g=new X(d.clientX,d.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)<this.options.clickTolerance||(g.x/=this._parentScale.x,g.y/=this._parentScale.y,hn(a),this._moved||(this.fire("dragstart"),this._moved=!0,Rt(document.body,"leaflet-dragging"),this._lastTarget=a.target||a.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Rt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(g),this._moving=!0,this._lastEvent=a,this._updatePosition())}},_updatePosition:function(){var a={originalEvent:this._lastEvent};this.fire("predrag",a),Ie(this._element,this._newPos),this.fire("drag",a)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(a){le(document.body,"leaflet-dragging"),this._lastTarget&&(le(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ce(document,"mousemove touchmove",this._onMove,this),Ce(document,"mouseup touchend touchcancel",this._onUp,this),Co(),Hr();var d=this._moved&&this._moving;this._moving=!1,ci._dragging=!1,d&&this.fire("dragend",{noInertia:a,distance:this._newPos.distanceTo(this._startPos)})}});function $a(a,d,g){var _,C=[1,4,2,8],R,q,rt,st,pt,Ot,zt,Nt;for(R=0,Ot=a.length;R<Ot;R++)a[R]._code=qi(a[R],d);for(rt=0;rt<4;rt++){for(zt=C[rt],_=[],R=0,Ot=a.length,q=Ot-1;R<Ot;q=R++)st=a[R],pt=a[q],st._code&zt?pt._code&zt||(Nt=Os(pt,st,zt,d,g),Nt._code=qi(Nt,d),_.push(Nt)):(pt._code&zt&&(Nt=Os(pt,st,zt,d,g),Nt._code=qi(Nt,d),_.push(Nt)),_.push(st));a=_}return a}function _c(a,d){var g,_,C,R,q,rt,st,pt,Ot;if(!a||a.length===0)throw new Error("latlngs not passed");Qn(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var zt=vt([0,0]),Nt=ct(a),_t=Nt.getNorthWest().distanceTo(Nt.getSouthWest())*Nt.getNorthEast().distanceTo(Nt.getNorthWest());_t<1700&&(zt=Gr(a));var jt=a.length,Gt=[];for(g=0;g<jt;g++){var ue=vt(a[g]);Gt.push(d.project(vt([ue.lat-zt.lat,ue.lng-zt.lng])))}for(rt=st=pt=0,g=0,_=jt-1;g<jt;_=g++)C=Gt[g],R=Gt[_],q=C.y*R.x-R.y*C.x,st+=(C.x+R.x)*q,pt+=(C.y+R.y)*q,rt+=q*3;rt===0?Ot=Gt[0]:Ot=[st/rt,pt/rt];var Oe=d.unproject(H(Ot));return vt([Oe.lat+zt.lat,Oe.lng+zt.lng])}function Gr(a){for(var d=0,g=0,_=0,C=0;C<a.length;C++){var R=vt(a[C]);d+=R.lat,g+=R.lng,_++}return vt([d/_,g/_])}var fn={__proto__:null,clipPolygon:$a,polygonCenter:_c,centroid:Gr};function Zr(a,d){if(!d||!a.length)return a.slice();var g=d*d;return a=jh(a,g),a=Nh(a,g),a}function Ia(a,d,g){return Math.sqrt(Ms(a,d,g,!0))}function Lh(a,d,g){return Ms(a,d,g)}function Nh(a,d){var g=a.length,_=typeof Uint8Array<"u"?Uint8Array:Array,C=new _(g);C[0]=C[g-1]=1,Sc(a,C,d,0,g-1);var R,q=[];for(R=0;R<g;R++)C[R]&&q.push(a[R]);return q}function Sc(a,d,g,_,C){var R=0,q,rt,st;for(rt=_+1;rt<=C-1;rt++)st=Ms(a[rt],a[_],a[C],!0),st>R&&(q=rt,R=st);R>g&&(d[q]=1,Sc(a,d,g,_,q),Sc(a,d,g,q,C))}function jh(a,d){for(var g=[a[0]],_=1,C=0,R=a.length;_<R;_++)Am(a[_],a[C])>d&&(g.push(a[_]),C=_);return C<R-1&&g.push(a[R-1]),g}var Es;function Cs(a,d,g,_,C){var R=_?Es:qi(a,g),q=qi(d,g),rt,st,pt;for(Es=q;;){if(!(R|q))return[a,d];if(R&q)return!1;rt=R||q,st=Os(a,d,rt,g,C),pt=qi(st,g),rt===R?(a=st,R=pt):(d=st,q=pt)}}function Os(a,d,g,_,C){var R=d.x-a.x,q=d.y-a.y,rt=_.min,st=_.max,pt,Ot;return g&8?(pt=a.x+R*(st.y-a.y)/q,Ot=st.y):g&4?(pt=a.x+R*(rt.y-a.y)/q,Ot=rt.y):g&2?(pt=st.x,Ot=a.y+q*(st.x-a.x)/R):g&1&&(pt=rt.x,Ot=a.y+q*(rt.x-a.x)/R),new X(pt,Ot,C)}function qi(a,d){var g=0;return a.x<d.min.x?g|=1:a.x>d.max.x&&(g|=2),a.y<d.min.y?g|=4:a.y>d.max.y&&(g|=8),g}function Am(a,d){var g=d.x-a.x,_=d.y-a.y;return g*g+_*_}function Ms(a,d,g,_){var C=d.x,R=d.y,q=g.x-C,rt=g.y-R,st=q*q+rt*rt,pt;return st>0&&(pt=((a.x-C)*q+(a.y-R)*rt)/st,pt>1?(C=g.x,R=g.y):pt>0&&(C+=q*pt,R+=rt*pt)),q=a.x-C,rt=a.y-R,_?q*q+rt*rt:new X(C,R)}function Qn(a){return!A(a[0])||typeof a[0][0]!="object"&&typeof a[0][0]<"u"}function Pc(a){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Qn(a)}function Dh(a,d){var g,_,C,R,q,rt,st,pt;if(!a||a.length===0)throw new Error("latlngs not passed");Qn(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var Ot=vt([0,0]),zt=ct(a),Nt=zt.getNorthWest().distanceTo(zt.getSouthWest())*zt.getNorthEast().distanceTo(zt.getNorthWest());Nt<1700&&(Ot=Gr(a));var _t=a.length,jt=[];for(g=0;g<_t;g++){var Gt=vt(a[g]);jt.push(d.project(vt([Gt.lat-Ot.lat,Gt.lng-Ot.lng])))}for(g=0,_=0;g<_t-1;g++)_+=jt[g].distanceTo(jt[g+1])/2;if(_===0)pt=jt[0];else for(g=0,R=0;g<_t-1;g++)if(q=jt[g],rt=jt[g+1],C=q.distanceTo(rt),R+=C,R>_){st=(R-_)/C,pt=[rt.x-st*(rt.x-q.x),rt.y-st*(rt.y-q.y)];break}var ue=d.unproject(H(pt));return vt([ue.lat+Ot.lat,ue.lng+Ot.lng])}var Un={__proto__:null,simplify:Zr,pointToSegmentDistance:Ia,closestPointOnSegment:Lh,clipSegment:Cs,_getEdgeIntersection:Os,_getBitCode:qi,_sqClosestPointOnSegment:Ms,isFlat:Qn,_flat:Pc,polylineCenter:Dh},yn={project:function(a){return new X(a.lng,a.lat)},unproject:function(a){return new yt(a.y,a.x)},bounds:new et([-180,-90],[180,90])},Ra={R:6378137,R_MINOR:6356752314245179e-9,bounds:new et([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(a){var d=Math.PI/180,g=this.R,_=a.lat*d,C=this.R_MINOR/g,R=Math.sqrt(1-C*C),q=R*Math.sin(_),rt=Math.tan(Math.PI/4-_/2)/Math.pow((1-q)/(1+q),R/2);return _=-g*Math.log(Math.max(rt,1e-10)),new X(a.lng*d*g,_)},unproject:function(a){for(var d=180/Math.PI,g=this.R,_=this.R_MINOR/g,C=Math.sqrt(1-_*_),R=Math.exp(-a.y/g),q=Math.PI/2-2*Math.atan(R),rt=0,st=.1,pt;rt<15&&Math.abs(st)>1e-7;rt++)pt=C*Math.sin(q),pt=Math.pow((1-pt)/(1+pt),C/2),st=Math.PI/2-2*Math.atan(R*pt)-q,q+=st;return new yt(q*d,a.x*d/g)}},La={__proto__:null,LonLat:yn,Mercator:Ra,SphericalMercator:dt},Ac=i({},Tt,{code:"EPSG:3395",projection:Ra,transformation:function(){var a=.5/(Math.PI*Ra.R);return nt(a,.5,-a,.5)}()}),Tc=i({},Tt,{code:"EPSG:4326",projection:yn,transformation:nt(1/180,1,-1/180,.5)}),Ec=i({},Et,{projection:yn,transformation:nt(1,0,-1,0),scale:function(a){return Math.pow(2,a)},zoom:function(a){return Math.log(a)/Math.LN2},distance:function(a,d){var g=d.lng-a.lng,_=d.lat-a.lat;return Math.sqrt(g*g+_*_)},infinite:!0});Et.Earth=Tt,Et.EPSG3395=Ac,Et.EPSG3857=Lt,Et.EPSG900913=bt,Et.EPSG4326=Tc,Et.Simple=Ec;var tr=G.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(a){return a.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(a){return a&&a.removeLayer(this),this},getPane:function(a){return this._map.getPane(a?this.options[a]||a:this.options.pane)},addInteractiveTarget:function(a){return this._map._targets[c(a)]=this,this},removeInteractiveTarget:function(a){return delete this._map._targets[c(a)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(a){var d=a.target;if(d.hasLayer(this)){if(this._map=d,this._zoomAnimated=d._zoomAnimated,this.getEvents){var g=this.getEvents();d.on(g,this),this.once("remove",function(){d.off(g,this)},this)}this.onAdd(d),this.fire("add"),d.fire("layeradd",{layer:this})}}});pe.include({addLayer:function(a){if(!a._layerAdd)throw new Error("The provided object is not a Layer.");var d=c(a);return this._layers[d]?this:(this._layers[d]=a,a._mapToAdd=this,a.beforeAdd&&a.beforeAdd(this),this.whenReady(a._layerAdd,a),this)},removeLayer:function(a){var d=c(a);return this._layers[d]?(this._loaded&&a.onRemove(this),delete this._layers[d],this._loaded&&(this.fire("layerremove",{layer:a}),a.fire("remove")),a._map=a._mapToAdd=null,this):this},hasLayer:function(a){return c(a)in this._layers},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},_addLayers:function(a){a=a?A(a)?a:[a]:[];for(var d=0,g=a.length;d<g;d++)this.addLayer(a[d])},_addZoomLimit:function(a){(!isNaN(a.options.maxZoom)||!isNaN(a.options.minZoom))&&(this._zoomBoundLayers[c(a)]=a,this._updateZoomLevels())},_removeZoomLimit:function(a){var d=c(a);this._zoomBoundLayers[d]&&(delete this._zoomBoundLayers[d],this._updateZoomLevels())},_updateZoomLevels:function(){var a=1/0,d=-1/0,g=this._getZoomSpan();for(var _ in this._zoomBoundLayers){var C=this._zoomBoundLayers[_].options;a=C.minZoom===void 0?a:Math.min(a,C.minZoom),d=C.maxZoom===void 0?d:Math.max(d,C.maxZoom)}this._layersMaxZoom=d===-1/0?void 0:d,this._layersMinZoom=a===1/0?void 0:a,g!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Gi=tr.extend({initialize:function(a,d){p(this,d),this._layers={};var g,_;if(a)for(g=0,_=a.length;g<_;g++)this.addLayer(a[g])},addLayer:function(a){var d=this.getLayerId(a);return this._layers[d]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var d=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[d]&&this._map.removeLayer(this._layers[d]),delete this._layers[d],this},hasLayer:function(a){var d=typeof a=="number"?a:this.getLayerId(a);return d in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(a){var d=Array.prototype.slice.call(arguments,1),g,_;for(g in this._layers)_=this._layers[g],_[a]&&_[a].apply(_,d);return this},onAdd:function(a){this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a)},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];return this.eachLayer(a.push,a),a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return c(a)}}),Bh=function(a,d){return new Gi(a,d)},mr=Gi.extend({addLayer:function(a){return this.hasLayer(a)?this:(a.addEventParent(this),Gi.prototype.addLayer.call(this,a),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return this.hasLayer(a)?(a in this._layers&&(a=this._layers[a]),a.removeEventParent(this),Gi.prototype.removeLayer.call(this,a),this.fire("layerremove",{layer:a})):this},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new at;for(var d in this._layers){var g=this._layers[d];a.extend(g.getBounds?g.getBounds():g.getLatLng())}return a}}),Cc=function(a,d){return new mr(a,d)},gr=U.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(a){p(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,d){var g=this._getIconUrl(a);if(!g){if(a==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var _=this._createImg(g,d&&d.tagName==="IMG"?d:null);return this._setIconStyles(_,a),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),_},_setIconStyles:function(a,d){var g=this.options,_=g[d+"Size"];typeof _=="number"&&(_=[_,_]);var C=H(_),R=H(d==="shadow"&&g.shadowAnchor||g.iconAnchor||C&&C.divideBy(2,!0));a.className="leaflet-marker-"+d+" "+(g.className||""),R&&(a.style.marginLeft=-R.x+"px",a.style.marginTop=-R.y+"px"),C&&(a.style.width=C.x+"px",a.style.height=C.y+"px")},_createImg:function(a,d){return d=d||document.createElement("img"),d.src=a,d},_getIconUrl:function(a){return It.retina&&this.options[a+"RetinaUrl"]||this.options[a+"Url"]}});function Oc(a){return new gr(a)}var $o=gr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(a){return typeof $o.imagePath!="string"&&($o.imagePath=this._detectIconPath()),(this.options.imagePath||$o.imagePath)+gr.prototype._getIconUrl.call(this,a)},_stripUrl:function(a){var d=function(g,_,C){var R=_.exec(g);return R&&R[C]};return a=d(a,/^url\((['"])?(.+)\1\)$/,2),a&&d(a,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var a=re("div","leaflet-default-icon-path",document.body),d=Mn(a,"background-image")||Mn(a,"backgroundImage");if(document.body.removeChild(a),d=this._stripUrl(d),d)return d;var g=document.querySelector('link[href$="leaflet.css"]');return g?g.href.substring(0,g.href.length-11-1):""}}),Zi=Jn.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new ci(a,a,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Rt(a,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&le(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(a){var d=this._marker,g=d._map,_=this._marker.options.autoPanSpeed,C=this._marker.options.autoPanPadding,R=Ee(d._icon),q=g.getPixelBounds(),rt=g.getPixelOrigin(),st=it(q.min._subtract(rt).add(C),q.max._subtract(rt).subtract(C));if(!st.contains(R)){var pt=H((Math.max(st.max.x,R.x)-st.max.x)/(q.max.x-st.max.x)-(Math.min(st.min.x,R.x)-st.min.x)/(q.min.x-st.min.x),(Math.max(st.max.y,R.y)-st.max.y)/(q.max.y-st.max.y)-(Math.min(st.min.y,R.y)-st.min.y)/(q.min.y-st.min.y)).multiplyBy(_);g.panBy(pt,{animate:!1}),this._draggable._newPos._add(pt),this._draggable._startPos._add(pt),Ie(d._icon,this._draggable._newPos),this._onDrag(a),this._panRequest=D(this._adjustPan.bind(this,a))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(a){this._marker.options.autoPan&&(j(this._panRequest),this._panRequest=D(this._adjustPan.bind(this,a)))},_onDrag:function(a){var d=this._marker,g=d._shadow,_=Ee(d._icon),C=d._map.layerPointToLatLng(_);g&&Ie(g,_),d._latlng=C,a.latlng=C,a.oldLatLng=this._oldLatLng,d.fire("move",a).fire("drag",a)},_onDragEnd:function(a){j(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",a)}}),ks=tr.extend({options:{icon:new $o,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(a,d){p(this,d),this._latlng=vt(a)},onAdd:function(a){this._zoomAnimated=this._zoomAnimated&&a.options.markerZoomAnimation,this._zoomAnimated&&a.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(a){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&a.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(a){var d=this._latlng;return this._latlng=vt(a),this.update(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update()},getIcon:function(){return this.options.icon},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var a=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(a)}return this},_initIcon:function(){var a=this.options,d="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),g=a.icon.createIcon(this._icon),_=!1;g!==this._icon&&(this._icon&&this._removeIcon(),_=!0,a.title&&(g.title=a.title),g.tagName==="IMG"&&(g.alt=a.alt||"")),Rt(g,d),a.keyboard&&(g.tabIndex="0",g.setAttribute("role","button")),this._icon=g,a.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ft(g,"focus",this._panOnFocus,this);var C=a.icon.createShadow(this._shadow),R=!1;C!==this._shadow&&(this._removeShadow(),R=!0),C&&(Rt(C,d),C.alt=""),this._shadow=C,a.opacity<1&&this._updateOpacity(),_&&this.getPane().appendChild(this._icon),this._initInteraction(),C&&R&&this.getPane(a.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ce(this._icon,"focus",this._panOnFocus,this),Kt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Kt(this._shadow),this._shadow=null},_setPos:function(a){this._icon&&Ie(this._icon,a),this._shadow&&Ie(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon&&(this._icon.style.zIndex=this._zIndex+a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center).round();this._setPos(d)},_initInteraction:function(){if(this.options.interactive&&(Rt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Zi)){var a=this.options.draggable;this.dragging&&(a=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Zi(this),a&&this.dragging.enable()}},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var a=this.options.opacity;this._icon&&kn(this._icon,a),this._shadow&&kn(this._shadow,a)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var a=this._map;if(a){var d=this.options.icon.options,g=d.iconSize?H(d.iconSize):H(0,0),_=d.iconAnchor?H(d.iconAnchor):H(0,0);a.panInside(this._latlng,{paddingTopLeft:_,paddingBottomRight:g.subtract(_)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Na(a,d){return new ks(a,d)}var Jt=tr.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(a){this._renderer=a.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(a){return p(this,a),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&a&&Object.prototype.hasOwnProperty.call(a,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ui=Jt.extend({options:{fill:!0,radius:10},initialize:function(a,d){p(this,d),this._latlng=vt(a),this._radius=this.options.radius},setLatLng:function(a){var d=this._latlng;return this._latlng=vt(a),this.redraw(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(a){return this.options.radius=this._radius=a,this.redraw()},getRadius:function(){return this._radius},setStyle:function(a){var d=a&&a.radius||this._radius;return Jt.prototype.setStyle.call(this,a),this.setRadius(d),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var a=this._radius,d=this._radiusY||a,g=this._clickTolerance(),_=[a+g,d+g];this._pxBounds=new et(this._point.subtract(_),this._point.add(_))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(a){return a.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function zh(a,d){return new ui(a,d)}var Io=ui.extend({initialize:function(a,d,g){if(typeof d=="number"&&(d=i({},g,{radius:d})),p(this,d),this._latlng=vt(a),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(a){return this._mRadius=a,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var a=[this._radius,this._radiusY||this._radius];return new at(this._map.layerPointToLatLng(this._point.subtract(a)),this._map.layerPointToLatLng(this._point.add(a)))},setStyle:Jt.prototype.setStyle,_project:function(){var a=this._latlng.lng,d=this._latlng.lat,g=this._map,_=g.options.crs;if(_.distance===Tt.distance){var C=Math.PI/180,R=this._mRadius/Tt.R/C,q=g.project([d+R,a]),rt=g.project([d-R,a]),st=q.add(rt).divideBy(2),pt=g.unproject(st).lat,Ot=Math.acos((Math.cos(R*C)-Math.sin(d*C)*Math.sin(pt*C))/(Math.cos(d*C)*Math.cos(pt*C)))/C;(isNaN(Ot)||Ot===0)&&(Ot=R/Math.cos(Math.PI/180*d)),this._point=st.subtract(g.getPixelOrigin()),this._radius=isNaN(Ot)?0:st.x-g.project([pt,a-Ot]).x,this._radiusY=st.y-q.y}else{var zt=_.unproject(_.project(this._latlng).subtract([this._mRadius,0]));this._point=g.latLngToLayerPoint(this._latlng),this._radius=this._point.x-g.latLngToLayerPoint(zt).x}this._updateBounds()}});function ja(a,d,g){return new Io(a,d,g)}var Yr=Jt.extend({options:{smoothFactor:1,noClip:!1},initialize:function(a,d){p(this,d),this._setLatLngs(a)},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._setLatLngs(a),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(a){for(var d=1/0,g=null,_=Ms,C,R,q=0,rt=this._parts.length;q<rt;q++)for(var st=this._parts[q],pt=1,Ot=st.length;pt<Ot;pt++){C=st[pt-1],R=st[pt];var zt=_(a,C,R,!0);zt<d&&(d=zt,g=_(a,C,R))}return g&&(g.distance=Math.sqrt(d)),g},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Dh(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(a,d){return d=d||this._defaultShape(),a=vt(a),d.push(a),this._bounds.extend(a),this.redraw()},_setLatLngs:function(a){this._bounds=new at,this._latlngs=this._convertLatLngs(a)},_defaultShape:function(){return Qn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(a){for(var d=[],g=Qn(a),_=0,C=a.length;_<C;_++)g?(d[_]=vt(a[_]),this._bounds.extend(d[_])):d[_]=this._convertLatLngs(a[_]);return d},_project:function(){var a=new et;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,a),this._bounds.isValid()&&a.isValid()&&(this._rawPxBounds=a,this._updateBounds())},_updateBounds:function(){var a=this._clickTolerance(),d=new X(a,a);this._rawPxBounds&&(this._pxBounds=new et([this._rawPxBounds.min.subtract(d),this._rawPxBounds.max.add(d)]))},_projectLatlngs:function(a,d,g){var _=a[0]instanceof yt,C=a.length,R,q;if(_){for(q=[],R=0;R<C;R++)q[R]=this._map.latLngToLayerPoint(a[R]),g.extend(q[R]);d.push(q)}else for(R=0;R<C;R++)this._projectLatlngs(a[R],d,g)},_clipPoints:function(){var a=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}var d=this._parts,g,_,C,R,q,rt,st;for(g=0,C=0,R=this._rings.length;g<R;g++)for(st=this._rings[g],_=0,q=st.length;_<q-1;_++)rt=Cs(st[_],st[_+1],a,_,!0),rt&&(d[C]=d[C]||[],d[C].push(rt[0]),(rt[1]!==st[_+1]||_===q-2)&&(d[C].push(rt[1]),C++))}},_simplifyPoints:function(){for(var a=this._parts,d=this.options.smoothFactor,g=0,_=a.length;g<_;g++)a[g]=Zr(a[g],d)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(a,d){var g,_,C,R,q,rt,st=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(g=0,R=this._parts.length;g<R;g++)for(rt=this._parts[g],_=0,q=rt.length,C=q-1;_<q;C=_++)if(!(!d&&_===0)&&Ia(a,rt[C],rt[_])<=st)return!0;return!1}});function Fh(a,d){return new Yr(a,d)}Yr._flat=Pc;var Ro=Yr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return _c(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(a){var d=Yr.prototype._convertLatLngs.call(this,a),g=d.length;return g>=2&&d[0]instanceof yt&&d[0].equals(d[g-1])&&d.pop(),d},_setLatLngs:function(a){Yr.prototype._setLatLngs.call(this,a),Qn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Qn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var a=this._renderer._bounds,d=this.options.weight,g=new X(d,d);if(a=new et(a.min.subtract(g),a.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}for(var _=0,C=this._rings.length,R;_<C;_++)R=$a(this._rings[_],a,!0),R.length&&this._parts.push(R)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(a){var d=!1,g,_,C,R,q,rt,st,pt;if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(R=0,st=this._parts.length;R<st;R++)for(g=this._parts[R],q=0,pt=g.length,rt=pt-1;q<pt;rt=q++)_=g[q],C=g[rt],_.y>a.y!=C.y>a.y&&a.x<(C.x-_.x)*(a.y-_.y)/(C.y-_.y)+_.x&&(d=!d);return d||Yr.prototype._containsPoint.call(this,a,!0)}});function Wh(a,d){return new Ro(a,d)}var hi=mr.extend({initialize:function(a,d){p(this,d),this._layers={},a&&this.addData(a)},addData:function(a){var d=A(a)?a:a.features,g,_,C;if(d){for(g=0,_=d.length;g<_;g++)C=d[g],(C.geometries||C.geometry||C.features||C.coordinates)&&this.addData(C);return this}var R=this.options;if(R.filter&&!R.filter(a))return this;var q=Da(a,R);return q?(q.feature=za(a),q.defaultOptions=q.options,this.resetStyle(q),R.onEachFeature&&R.onEachFeature(a,q),this.addLayer(q)):this},resetStyle:function(a){return a===void 0?this.eachLayer(this.resetStyle,this):(a.options=i({},a.defaultOptions),this._setLayerStyle(a,this.options.style),this)},setStyle:function(a){return this.eachLayer(function(d){this._setLayerStyle(d,a)},this)},_setLayerStyle:function(a,d){a.setStyle&&(typeof d=="function"&&(d=d(a.feature)),a.setStyle(d))}});function Da(a,d){var g=a.type==="Feature"?a.geometry:a,_=g?g.coordinates:null,C=[],R=d&&d.pointToLayer,q=d&&d.coordsToLatLng||Mc,rt,st,pt,Ot;if(!_&&!g)return null;switch(g.type){case"Point":return rt=q(_),Tm(R,a,rt,d);case"MultiPoint":for(pt=0,Ot=_.length;pt<Ot;pt++)rt=q(_[pt]),C.push(Tm(R,a,rt,d));return new mr(C);case"LineString":case"MultiLineString":return st=yr(_,g.type==="LineString"?0:1,q),new Yr(st,d);case"Polygon":case"MultiPolygon":return st=yr(_,g.type==="Polygon"?1:2,q),new Ro(st,d);case"GeometryCollection":for(pt=0,Ot=g.geometries.length;pt<Ot;pt++){var zt=Da({geometry:g.geometries[pt],type:"Feature",properties:a.properties},d);zt&&C.push(zt)}return new mr(C);case"FeatureCollection":for(pt=0,Ot=g.features.length;pt<Ot;pt++){var Nt=Da(g.features[pt],d);Nt&&C.push(Nt)}return new mr(C);default:throw new Error("Invalid GeoJSON object.")}}function Tm(a,d,g,_){return a?a(d,g):new ks(g,_&&_.markersInheritOptions&&_)}function Mc(a){return new yt(a[1],a[0],a[2])}function yr(a,d,g){for(var _=[],C=0,R=a.length,q;C<R;C++)q=d?yr(a[C],d-1,g):(g||Mc)(a[C]),_.push(q);return _}function Ba(a,d){return a=vt(a),a.alt!==void 0?[m(a.lng,d),m(a.lat,d),m(a.alt,d)]:[m(a.lng,d),m(a.lat,d)]}function $s(a,d,g,_){for(var C=[],R=0,q=a.length;R<q;R++)C.push(d?$s(a[R],Qn(a[R])?0:d-1,g,_):Ba(a[R],_));return!d&&g&&C.length>0&&C.push(C[0].slice()),C}function fi(a,d){return a.feature?i({},a.feature,{geometry:d}):za(d)}function za(a){return a.type==="Feature"||a.type==="FeatureCollection"?a:{type:"Feature",properties:{},geometry:a}}var kc={toGeoJSON:function(a){return fi(this,{type:"Point",coordinates:Ba(this.getLatLng(),a)})}};ks.include(kc),Io.include(kc),ui.include(kc),Yr.include({toGeoJSON:function(a){var d=!Qn(this._latlngs),g=$s(this._latlngs,d?1:0,!1,a);return fi(this,{type:(d?"Multi":"")+"LineString",coordinates:g})}}),Ro.include({toGeoJSON:function(a){var d=!Qn(this._latlngs),g=d&&!Qn(this._latlngs[0]),_=$s(this._latlngs,g?2:d?1:0,!0,a);return d||(_=[_]),fi(this,{type:(g?"Multi":"")+"Polygon",coordinates:_})}}),Gi.include({toMultiPoint:function(a){var d=[];return this.eachLayer(function(g){d.push(g.toGeoJSON(a).geometry.coordinates)}),fi(this,{type:"MultiPoint",coordinates:d})},toGeoJSON:function(a){var d=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(d==="MultiPoint")return this.toMultiPoint(a);var g=d==="GeometryCollection",_=[];return this.eachLayer(function(C){if(C.toGeoJSON){var R=C.toGeoJSON(a);if(g)_.push(R.geometry);else{var q=za(R);q.type==="FeatureCollection"?_.push.apply(_,q.features):_.push(q)}}}),g?fi(this,{geometries:_,type:"GeometryCollection"}):{type:"FeatureCollection",features:_}}});function Vh(a,d){return new hi(a,d)}var Em=Vh,Fa=tr.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(a,d,g){this._url=a,this._bounds=ct(d),p(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Rt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Kt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(a){return this.options.opacity=a,this._image&&this._updateOpacity(),this},setStyle:function(a){return a.opacity&&this.setOpacity(a.opacity),this},bringToFront:function(){return this._map&&be(this._image),this},bringToBack:function(){return this._map&&St(this._image),this},setUrl:function(a){return this._url=a,this._image&&(this._image.src=a),this},setBounds:function(a){return this._bounds=ct(a),this._map&&this._reset(),this},getEvents:function(){var a={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var a=this._url.tagName==="IMG",d=this._image=a?this._url:re("img");if(Rt(d,"leaflet-image-layer"),this._zoomAnimated&&Rt(d,"leaflet-zoom-animated"),this.options.className&&Rt(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onload=s(this.fire,this,"load"),d.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(d.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),a){this._url=d.src;return}d.src=this._url,d.alt=this.options.alt},_animateZoom:function(a){var d=this._map.getZoomScale(a.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,a.zoom,a.center).min;Ge(this._image,g,d)},_reset:function(){var a=this._image,d=new et(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=d.getSize();Ie(a,d.min),a.style.width=g.x+"px",a.style.height=g.y+"px"},_updateOpacity:function(){kn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var a=this.options.errorOverlayUrl;a&&this._url!==a&&(this._url=a,this._image.src=a)},getCenter:function(){return this._bounds.getCenter()}}),Sx=function(a,d,g){return new Fa(a,d,g)},Uh=Fa.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var a=this._url.tagName==="VIDEO",d=this._image=a?this._url:re("video");if(Rt(d,"leaflet-image-layer"),this._zoomAnimated&&Rt(d,"leaflet-zoom-animated"),this.options.className&&Rt(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onloadeddata=s(this.fire,this,"load"),a){for(var g=d.getElementsByTagName("source"),_=[],C=0;C<g.length;C++)_.push(g[C].src);this._url=g.length>0?_:[d.src];return}A(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(d.style,"objectFit")&&(d.style.objectFit="fill"),d.autoplay=!!this.options.autoplay,d.loop=!!this.options.loop,d.muted=!!this.options.muted,d.playsInline=!!this.options.playsInline;for(var R=0;R<this._url.length;R++){var q=re("source");q.src=this._url[R],d.appendChild(q)}}});function Cm(a,d,g){return new Uh(a,d,g)}var Hh=Fa.extend({_initImage:function(){var a=this._image=this._url;Rt(a,"leaflet-image-layer"),this._zoomAnimated&&Rt(a,"leaflet-zoom-animated"),this.options.className&&Rt(a,this.options.className),a.onselectstart=f,a.onmousemove=f}});function Om(a,d,g){return new Hh(a,d,g)}var vr=tr.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(a,d){a&&(a instanceof yt||A(a))?(this._latlng=vt(a),p(this,d)):(p(this,a),this._source=d),this.options.content&&(this._content=this.options.content)},openOn:function(a){return a=arguments.length?a:this._source._map,a.hasLayer(this)||a.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(a){return this._map?this.close():(arguments.length?this._source=a:a=this._source,this._prepareOpen(),this.openOn(a._map)),this},onAdd:function(a){this._zoomAnimated=a._zoomAnimated,this._container||this._initLayout(),a._fadeAnimated&&kn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),a._fadeAnimated&&kn(this._container,1),this.bringToFront(),this.options.interactive&&(Rt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(a){a._fadeAnimated?(kn(this._container,0),this._removeTimeout=setTimeout(s(Kt,void 0,this._container),200)):Kt(this._container),this.options.interactive&&(le(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=vt(a),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(a){return this._content=a,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var a={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&be(this._container),this},bringToBack:function(){return this._map&&St(this._container),this},_prepareOpen:function(a){var d=this._source;if(!d._map)return!1;if(d instanceof mr){d=null;var g=this._source._layers;for(var _ in g)if(g[_]._map){d=g[_];break}if(!d)return!1;this._source=d}if(!a)if(d.getCenter)a=d.getCenter();else if(d.getLatLng)a=d.getLatLng();else if(d.getBounds)a=d.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(a),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var a=this._contentNode,d=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof d=="string")a.innerHTML=d;else{for(;a.hasChildNodes();)a.removeChild(a.firstChild);a.appendChild(d)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),d=H(this.options.offset),g=this._getAnchor();this._zoomAnimated?Ie(this._container,a.add(g)):d=d.add(a).add(g);var _=this._containerBottom=-d.y,C=this._containerLeft=-Math.round(this._containerWidth/2)+d.x;this._container.style.bottom=_+"px",this._container.style.left=C+"px"}},_getAnchor:function(){return[0,0]}});pe.include({_initOverlay:function(a,d,g,_){var C=d;return C instanceof a||(C=new a(_).setContent(d)),g&&C.setLatLng(g),C}}),tr.include({_initOverlay:function(a,d,g,_){var C=g;return C instanceof a?(p(C,_),C._source=this):(C=d&&!_?d:new a(_,this),C.setContent(g)),C}});var Is=vr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(a){return a=arguments.length?a:this._source._map,!a.hasLayer(this)&&a._popup&&a._popup.options.autoClose&&a.removeLayer(a._popup),a._popup=this,vr.prototype.openOn.call(this,a)},onAdd:function(a){vr.prototype.onAdd.call(this,a),a.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Jt||this._source.on("preclick",Vi))},onRemove:function(a){vr.prototype.onRemove.call(this,a),a.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Jt||this._source.off("preclick",Vi))},getEvents:function(){var a=vr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(a.preclick=this.close),this.options.keepInView&&(a.moveend=this._adjustPan),a},_initLayout:function(){var a="leaflet-popup",d=this._container=re("div",a+" "+(this.options.className||"")+" leaflet-zoom-animated"),g=this._wrapper=re("div",a+"-content-wrapper",d);if(this._contentNode=re("div",a+"-content",g),Ui(d),li(this._contentNode),Ft(d,"contextmenu",Vi),this._tipContainer=re("div",a+"-tip-container",d),this._tip=re("div",a+"-tip",this._tipContainer),this.options.closeButton){var _=this._closeButton=re("a",a+"-close-button",d);_.setAttribute("role","button"),_.setAttribute("aria-label","Close popup"),_.href="#close",_.innerHTML='<span aria-hidden="true">&#215;</span>',Ft(_,"click",function(C){hn(C),this.close()},this)}},_updateLayout:function(){var a=this._contentNode,d=a.style;d.width="",d.whiteSpace="nowrap";var g=a.offsetWidth;g=Math.min(g,this.options.maxWidth),g=Math.max(g,this.options.minWidth),d.width=g+1+"px",d.whiteSpace="",d.height="";var _=a.offsetHeight,C=this.options.maxHeight,R="leaflet-popup-scrolled";C&&_>C?(d.height=C+"px",Rt(a,R)):le(a,R),this._containerWidth=this._container.offsetWidth},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center),g=this._getAnchor();Ie(this._container,d.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var a=this._map,d=parseInt(Mn(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+d,_=this._containerWidth,C=new X(this._containerLeft,-g-this._containerBottom);C._add(Ee(this._container));var R=a.layerPointToContainerPoint(C),q=H(this.options.autoPanPadding),rt=H(this.options.autoPanPaddingTopLeft||q),st=H(this.options.autoPanPaddingBottomRight||q),pt=a.getSize(),Ot=0,zt=0;R.x+_+st.x>pt.x&&(Ot=R.x+_-pt.x+st.x),R.x-Ot-rt.x<0&&(Ot=R.x-rt.x),R.y+g+st.y>pt.y&&(zt=R.y+g-pt.y+st.y),R.y-zt-rt.y<0&&(zt=R.y-rt.y),(Ot||zt)&&(this.options.keepInView&&(this._autopanning=!0),a.fire("autopanstart").panBy([Ot,zt]))}},_getAnchor:function(){return H(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),qh=function(a,d){return new Is(a,d)};pe.mergeOptions({closePopupOnClick:!0}),pe.include({openPopup:function(a,d,g){return this._initOverlay(Is,a,d,g).openOn(this),this},closePopup:function(a){return a=arguments.length?a:this._popup,a&&a.close(),this}}),tr.include({bindPopup:function(a,d){return this._popup=this._initOverlay(Is,this._popup,a,d),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(a){return this._popup&&(this instanceof mr||(this._popup._source=this),this._popup._prepareOpen(a||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},getPopup:function(){return this._popup},_openPopup:function(a){if(!(!this._popup||!this._map)){jn(a);var d=a.layer||a.target;if(this._popup._source===d&&!(d instanceof Jt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(a.latlng);return}this._popup._source=d,this.openPopup(a.latlng)}},_movePopup:function(a){this._popup.setLatLng(a.latlng)},_onKeyPress:function(a){a.originalEvent.keyCode===13&&this._openPopup(a)}});var Rs=vr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(a){vr.prototype.onAdd.call(this,a),this.setOpacity(this.options.opacity),a.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(a){vr.prototype.onRemove.call(this,a),a.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var a=vr.prototype.getEvents.call(this);return this.options.permanent||(a.preclick=this.close),a},_initLayout:function(){var a="leaflet-tooltip",d=a+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=re("div",d),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(a){var d,g,_=this._map,C=this._container,R=_.latLngToContainerPoint(_.getCenter()),q=_.layerPointToContainerPoint(a),rt=this.options.direction,st=C.offsetWidth,pt=C.offsetHeight,Ot=H(this.options.offset),zt=this._getAnchor();rt==="top"?(d=st/2,g=pt):rt==="bottom"?(d=st/2,g=0):rt==="center"?(d=st/2,g=pt/2):rt==="right"?(d=0,g=pt/2):rt==="left"?(d=st,g=pt/2):q.x<R.x?(rt="right",d=0,g=pt/2):(rt="left",d=st+(Ot.x+zt.x)*2,g=pt/2),a=a.subtract(H(d,g,!0)).add(Ot).add(zt),le(C,"leaflet-tooltip-right"),le(C,"leaflet-tooltip-left"),le(C,"leaflet-tooltip-top"),le(C,"leaflet-tooltip-bottom"),Rt(C,"leaflet-tooltip-"+rt),Ie(C,a)},_updatePosition:function(){var a=this._map.latLngToLayerPoint(this._latlng);this._setPosition(a)},setOpacity:function(a){this.options.opacity=a,this._container&&kn(this._container,a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);this._setPosition(d)},_getAnchor:function(){return H(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Gh=function(a,d){return new Rs(a,d)};pe.include({openTooltip:function(a,d,g){return this._initOverlay(Rs,a,d,g).openOn(this),this},closeTooltip:function(a){return a.close(),this}}),tr.include({bindTooltip:function(a,d){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Rs,this._tooltip,a,d),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(a){if(!(!a&&this._tooltipHandlersAdded)){var d=a?"off":"on",g={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?g.add=this._openTooltip:(g.mouseover=this._openTooltip,g.mouseout=this.closeTooltip,g.click=this._openTooltip,this._map?this._addFocusListeners():g.add=this._addFocusListeners),this._tooltip.options.sticky&&(g.mousemove=this._moveTooltip),this[d](g),this._tooltipHandlersAdded=!a}},openTooltip:function(a){return this._tooltip&&(this instanceof mr||(this._tooltip._source=this),this._tooltip._prepareOpen(a)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(a){return this._tooltip&&this._tooltip.setContent(a),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&(Ft(d,"focus",function(){this._tooltip._source=a,this.openTooltip()},this),Ft(d,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&d.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(a){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var d=this;this._map.once("moveend",function(){d._openOnceFlag=!1,d._openTooltip(a)});return}this._tooltip._source=a.layer||a.target,this.openTooltip(this._tooltip.options.sticky?a.latlng:void 0)}},_moveTooltip:function(a){var d=a.latlng,g,_;this._tooltip.options.sticky&&a.originalEvent&&(g=this._map.mouseEventToContainerPoint(a.originalEvent),_=this._map.containerPointToLayerPoint(g),d=this._map.layerPointToLatLng(_)),this._tooltip.setLatLng(d)}});var $c=gr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(a){var d=a&&a.tagName==="DIV"?a:document.createElement("div"),g=this.options;if(g.html instanceof Element?(hr(d),d.appendChild(g.html)):d.innerHTML=g.html!==!1?g.html:"",g.bgPos){var _=H(g.bgPos);d.style.backgroundPosition=-_.x+"px "+-_.y+"px"}return this._setIconStyles(d,"icon"),d},createShadow:function(){return null}});function Zh(a){return new $c(a)}gr.Default=$o;var Lo=tr.extend({options:{tileSize:256,opacity:1,updateWhenIdle:It.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(a){p(this,a)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(a){a._addZoomLimit(this)},onRemove:function(a){this._removeAllTiles(),Kt(this._container),a._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(be(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(St(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var a=this._clampZoom(this._map.getZoom());a!==this._tileZoom&&(this._tileZoom=a,this._updateLevels()),this._update()}return this},getEvents:function(){var a={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=h(this._onMoveEnd,this.options.updateInterval,this)),a.move=this._onMove),this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},createTile:function(){return document.createElement("div")},getTileSize:function(){var a=this.options.tileSize;return a instanceof X?a:new X(a,a)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a){for(var d=this.getPane().children,g=-a(-1/0,1/0),_=0,C=d.length,R;_<C;_++)R=d[_].style.zIndex,d[_]!==this._container&&R&&(g=a(g,+R));isFinite(g)&&(this.options.zIndex=g+a(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!It.ielt9){kn(this._container,this.options.opacity);var a=+new Date,d=!1,g=!1;for(var _ in this._tiles){var C=this._tiles[_];if(!(!C.current||!C.loaded)){var R=Math.min(1,(a-C.loaded)/200);kn(C.el,R),R<1?d=!0:(C.active?g=!0:this._onOpaqueTile(C),C.active=!0)}}g&&!this._noPrune&&this._pruneTiles(),d&&(j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this))}},_onOpaqueTile:f,_initContainer:function(){this._container||(this._container=re("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var a=this._tileZoom,d=this.options.maxZoom;if(a!==void 0){for(var g in this._levels)g=Number(g),this._levels[g].el.children.length||g===a?(this._levels[g].el.style.zIndex=d-Math.abs(a-g),this._onUpdateLevel(g)):(Kt(this._levels[g].el),this._removeTilesAtZoom(g),this._onRemoveLevel(g),delete this._levels[g]);var _=this._levels[a],C=this._map;return _||(_=this._levels[a]={},_.el=re("div","leaflet-tile-container leaflet-zoom-animated",this._container),_.el.style.zIndex=d,_.origin=C.project(C.unproject(C.getPixelOrigin()),a).round(),_.zoom=a,this._setZoomTransform(_,C.getCenter(),C.getZoom()),f(_.el.offsetWidth),this._onCreateLevel(_)),this._level=_,_}},_onUpdateLevel:f,_onRemoveLevel:f,_onCreateLevel:f,_pruneTiles:function(){if(this._map){var a,d,g=this._map.getZoom();if(g>this.options.maxZoom||g<this.options.minZoom){this._removeAllTiles();return}for(a in this._tiles)d=this._tiles[a],d.retain=d.current;for(a in this._tiles)if(d=this._tiles[a],d.current&&!d.active){var _=d.coords;this._retainParent(_.x,_.y,_.z,_.z-5)||this._retainChildren(_.x,_.y,_.z,_.z+2)}for(a in this._tiles)this._tiles[a].retain||this._removeTile(a)}},_removeTilesAtZoom:function(a){for(var d in this._tiles)this._tiles[d].coords.z===a&&this._removeTile(d)},_removeAllTiles:function(){for(var a in this._tiles)this._removeTile(a)},_invalidateAll:function(){for(var a in this._levels)Kt(this._levels[a].el),this._onRemoveLevel(Number(a)),delete this._levels[a];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(a,d,g,_){var C=Math.floor(a/2),R=Math.floor(d/2),q=g-1,rt=new X(+C,+R);rt.z=+q;var st=this._tileCoordsToKey(rt),pt=this._tiles[st];return pt&&pt.active?(pt.retain=!0,!0):(pt&&pt.loaded&&(pt.retain=!0),q>_?this._retainParent(C,R,q,_):!1)},_retainChildren:function(a,d,g,_){for(var C=2*a;C<2*a+2;C++)for(var R=2*d;R<2*d+2;R++){var q=new X(C,R);q.z=g+1;var rt=this._tileCoordsToKey(q),st=this._tiles[rt];if(st&&st.active){st.retain=!0;continue}else st&&st.loaded&&(st.retain=!0);g+1<_&&this._retainChildren(C,R,g+1,_)}},_resetView:function(a){var d=a&&(a.pinch||a.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),d,d)},_animateZoom:function(a){this._setView(a.center,a.zoom,!0,a.noUpdate)},_clampZoom:function(a){var d=this.options;return d.minNativeZoom!==void 0&&a<d.minNativeZoom?d.minNativeZoom:d.maxNativeZoom!==void 0&&d.maxNativeZoom<a?d.maxNativeZoom:a},_setView:function(a,d,g,_){var C=Math.round(d);this.options.maxZoom!==void 0&&C>this.options.maxZoom||this.options.minZoom!==void 0&&C<this.options.minZoom?C=void 0:C=this._clampZoom(C);var R=this.options.updateWhenZooming&&C!==this._tileZoom;(!_||R)&&(this._tileZoom=C,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),C!==void 0&&this._update(a),g||this._pruneTiles(),this._noPrune=!!g),this._setZoomTransforms(a,d)},_setZoomTransforms:function(a,d){for(var g in this._levels)this._setZoomTransform(this._levels[g],a,d)},_setZoomTransform:function(a,d,g){var _=this._map.getZoomScale(g,a.zoom),C=a.origin.multiplyBy(_).subtract(this._map._getNewPixelOrigin(d,g)).round();It.any3d?Ge(a.el,C,_):Ie(a.el,C)},_resetGrid:function(){var a=this._map,d=a.options.crs,g=this._tileSize=this.getTileSize(),_=this._tileZoom,C=this._map.getPixelWorldBounds(this._tileZoom);C&&(this._globalTileRange=this._pxBoundsToTileRange(C)),this._wrapX=d.wrapLng&&!this.options.noWrap&&[Math.floor(a.project([0,d.wrapLng[0]],_).x/g.x),Math.ceil(a.project([0,d.wrapLng[1]],_).x/g.y)],this._wrapY=d.wrapLat&&!this.options.noWrap&&[Math.floor(a.project([d.wrapLat[0],0],_).y/g.x),Math.ceil(a.project([d.wrapLat[1],0],_).y/g.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(a){var d=this._map,g=d._animatingZoom?Math.max(d._animateToZoom,d.getZoom()):d.getZoom(),_=d.getZoomScale(g,this._tileZoom),C=d.project(a,this._tileZoom).floor(),R=d.getSize().divideBy(_*2);return new et(C.subtract(R),C.add(R))},_update:function(a){var d=this._map;if(d){var g=this._clampZoom(d.getZoom());if(a===void 0&&(a=d.getCenter()),this._tileZoom!==void 0){var _=this._getTiledPixelBounds(a),C=this._pxBoundsToTileRange(_),R=C.getCenter(),q=[],rt=this.options.keepBuffer,st=new et(C.getBottomLeft().subtract([rt,-rt]),C.getTopRight().add([rt,-rt]));if(!(isFinite(C.min.x)&&isFinite(C.min.y)&&isFinite(C.max.x)&&isFinite(C.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var pt in this._tiles){var Ot=this._tiles[pt].coords;(Ot.z!==this._tileZoom||!st.contains(new X(Ot.x,Ot.y)))&&(this._tiles[pt].current=!1)}if(Math.abs(g-this._tileZoom)>1){this._setView(a,g);return}for(var zt=C.min.y;zt<=C.max.y;zt++)for(var Nt=C.min.x;Nt<=C.max.x;Nt++){var _t=new X(Nt,zt);if(_t.z=this._tileZoom,!!this._isValidTile(_t)){var jt=this._tiles[this._tileCoordsToKey(_t)];jt?jt.current=!0:q.push(_t)}}if(q.sort(function(ue,Oe){return ue.distanceTo(R)-Oe.distanceTo(R)}),q.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Gt=document.createDocumentFragment();for(Nt=0;Nt<q.length;Nt++)this._addTile(q[Nt],Gt);this._level.el.appendChild(Gt)}}}},_isValidTile:function(a){var d=this._map.options.crs;if(!d.infinite){var g=this._globalTileRange;if(!d.wrapLng&&(a.x<g.min.x||a.x>g.max.x)||!d.wrapLat&&(a.y<g.min.y||a.y>g.max.y))return!1}if(!this.options.bounds)return!0;var _=this._tileCoordsToBounds(a);return ct(this.options.bounds).overlaps(_)},_keyToBounds:function(a){return this._tileCoordsToBounds(this._keyToTileCoords(a))},_tileCoordsToNwSe:function(a){var d=this._map,g=this.getTileSize(),_=a.scaleBy(g),C=_.add(g),R=d.unproject(_,a.z),q=d.unproject(C,a.z);return[R,q]},_tileCoordsToBounds:function(a){var d=this._tileCoordsToNwSe(a),g=new at(d[0],d[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(a){return a.x+":"+a.y+":"+a.z},_keyToTileCoords:function(a){var d=a.split(":"),g=new X(+d[0],+d[1]);return g.z=+d[2],g},_removeTile:function(a){var d=this._tiles[a];d&&(Kt(d.el),delete this._tiles[a],this.fire("tileunload",{tile:d.el,coords:this._keyToTileCoords(a)}))},_initTile:function(a){Rt(a,"leaflet-tile");var d=this.getTileSize();a.style.width=d.x+"px",a.style.height=d.y+"px",a.onselectstart=f,a.onmousemove=f,It.ielt9&&this.options.opacity<1&&kn(a,this.options.opacity)},_addTile:function(a,d){var g=this._getTilePos(a),_=this._tileCoordsToKey(a),C=this.createTile(this._wrapCoords(a),s(this._tileReady,this,a));this._initTile(C),this.createTile.length<2&&D(s(this._tileReady,this,a,null,C)),Ie(C,g),this._tiles[_]={el:C,coords:a,current:!0},d.appendChild(C),this.fire("tileloadstart",{tile:C,coords:a})},_tileReady:function(a,d,g){d&&this.fire("tileerror",{error:d,tile:g,coords:a});var _=this._tileCoordsToKey(a);g=this._tiles[_],g&&(g.loaded=+new Date,this._map._fadeAnimated?(kn(g.el,0),j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),d||(Rt(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:a})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),It.ielt9||!this._map._fadeAnimated?D(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(a){return a.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(a){var d=new X(this._wrapX?u(a.x,this._wrapX):a.x,this._wrapY?u(a.y,this._wrapY):a.y);return d.z=a.z,d},_pxBoundsToTileRange:function(a){var d=this.getTileSize();return new et(a.min.unscaleBy(d).floor(),a.max.unscaleBy(d).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var a in this._tiles)if(!this._tiles[a].loaded)return!1;return!0}});function Yh(a){return new Lo(a)}var Yi=Lo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(a,d){this._url=a,d=p(this,d),d.detectRetina&&It.retina&&d.maxZoom>0?(d.tileSize=Math.floor(d.tileSize/2),d.zoomReverse?(d.zoomOffset--,d.minZoom=Math.min(d.maxZoom,d.minZoom+1)):(d.zoomOffset++,d.maxZoom=Math.max(d.minZoom,d.maxZoom-1)),d.minZoom=Math.max(0,d.minZoom)):d.zoomReverse?d.minZoom=Math.min(d.maxZoom,d.minZoom):d.maxZoom=Math.max(d.minZoom,d.maxZoom),typeof d.subdomains=="string"&&(d.subdomains=d.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(a,d){return this._url===a&&d===void 0&&(d=!0),this._url=a,d||this.redraw(),this},createTile:function(a,d){var g=document.createElement("img");return Ft(g,"load",s(this._tileOnLoad,this,d,g)),Ft(g,"error",s(this._tileOnError,this,d,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(a),g},getTileUrl:function(a){var d={r:It.retina?"@2x":"",s:this._getSubdomain(a),x:a.x,y:a.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-a.y;this.options.tms&&(d.y=g),d["-y"]=g}return S(this._url,i(d,this.options))},_tileOnLoad:function(a,d){It.ielt9?setTimeout(s(a,this,null,d),0):a(null,d)},_tileOnError:function(a,d,g){var _=this.options.errorTileUrl;_&&d.getAttribute("src")!==_&&(d.src=_),a(g,d)},_onTileRemove:function(a){a.tile.onload=null},_getZoomForUrl:function(){var a=this._tileZoom,d=this.options.maxZoom,g=this.options.zoomReverse,_=this.options.zoomOffset;return g&&(a=d-a),a+_},_getSubdomain:function(a){var d=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[d]},_abortLoading:function(){var a,d;for(a in this._tiles)if(this._tiles[a].coords.z!==this._tileZoom&&(d=this._tiles[a].el,d.onload=f,d.onerror=f,!d.complete)){d.src=w;var g=this._tiles[a].coords;Kt(d),delete this._tiles[a],this.fire("tileabort",{tile:d,coords:g})}},_removeTile:function(a){var d=this._tiles[a];if(d)return d.el.setAttribute("src",w),Lo.prototype._removeTile.call(this,a)},_tileReady:function(a,d,g){if(!(!this._map||g&&g.getAttribute("src")===w))return Lo.prototype._tileReady.call(this,a,d,g)}});function Ic(a,d){return new Yi(a,d)}var Rc=Yi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(a,d){this._url=a;var g=i({},this.defaultWmsParams);for(var _ in d)_ in this.options||(g[_]=d[_]);d=p(this,d);var C=d.detectRetina&&It.retina?2:1,R=this.getTileSize();g.width=R.x*C,g.height=R.y*C,this.wmsParams=g},onAdd:function(a){this._crs=this.options.crs||a.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var d=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[d]=this._crs.code,Yi.prototype.onAdd.call(this,a)},getTileUrl:function(a){var d=this._tileCoordsToNwSe(a),g=this._crs,_=it(g.project(d[0]),g.project(d[1])),C=_.min,R=_.max,q=(this._wmsVersion>=1.3&&this._crs===Tc?[C.y,C.x,R.y,R.x]:[C.x,C.y,R.x,R.y]).join(","),rt=Yi.prototype.getTileUrl.call(this,a);return rt+b(this.wmsParams,rt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+q},setParams:function(a,d){return i(this.wmsParams,a),d||this.redraw(),this}});function Kh(a,d){return new Rc(a,d)}Yi.WMS=Rc,Ic.wms=Kh;var Mr=tr.extend({options:{padding:.1},initialize:function(a){p(this,a),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Rt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var a={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(a.zoomanim=this._onAnimZoom),a},_onAnimZoom:function(a){this._updateTransform(a.center,a.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(a,d){var g=this._map.getZoomScale(d,this._zoom),_=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,d),R=_.multiplyBy(-g).add(C).subtract(this._map._getNewPixelOrigin(a,d));It.any3d?Ge(this._container,R,g):Ie(this._container,R)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var a in this._layers)this._layers[a]._reset()},_onZoomEnd:function(){for(var a in this._layers)this._layers[a]._project()},_updatePaths:function(){for(var a in this._layers)this._layers[a]._update()},_update:function(){var a=this.options.padding,d=this._map.getSize(),g=this._map.containerPointToLayerPoint(d.multiplyBy(-a)).round();this._bounds=new et(g,g.add(d.multiplyBy(1+a*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Lc=Mr.extend({options:{tolerance:0},getEvents:function(){var a=Mr.prototype.getEvents.call(this);return a.viewprereset=this._onViewPreReset,a},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Mr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var a=this._container=document.createElement("canvas");Ft(a,"mousemove",this._onMouseMove,this),Ft(a,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ft(a,"mouseout",this._handleMouseOut,this),a._leaflet_disable_events=!0,this._ctx=a.getContext("2d")},_destroyContainer:function(){j(this._redrawRequest),delete this._ctx,Kt(this._container),Ce(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var a;this._redrawBounds=null;for(var d in this._layers)a=this._layers[d],a._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=this._container,g=a.getSize(),_=It.retina?2:1;Ie(d,a.min),d.width=_*g.x,d.height=_*g.y,d.style.width=g.x+"px",d.style.height=g.y+"px",It.retina&&this._ctx.scale(2,2),this._ctx.translate(-a.min.x,-a.min.y),this.fire("update")}},_reset:function(){Mr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(a){this._updateDashArray(a),this._layers[c(a)]=a;var d=a._order={layer:a,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=d),this._drawLast=d,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(a){this._requestRedraw(a)},_removePath:function(a){var d=a._order,g=d.next,_=d.prev;g?g.prev=_:this._drawLast=_,_?_.next=g:this._drawFirst=g,delete a._order,delete this._layers[c(a)],this._requestRedraw(a)},_updatePath:function(a){this._extendRedrawBounds(a),a._project(),a._update(),this._requestRedraw(a)},_updateStyle:function(a){this._updateDashArray(a),this._requestRedraw(a)},_updateDashArray:function(a){if(typeof a.options.dashArray=="string"){var d=a.options.dashArray.split(/[, ]+/),g=[],_,C;for(C=0;C<d.length;C++){if(_=Number(d[C]),isNaN(_))return;g.push(_)}a.options._dashArray=g}else a.options._dashArray=a.options.dashArray},_requestRedraw:function(a){this._map&&(this._extendRedrawBounds(a),this._redrawRequest=this._redrawRequest||D(this._redraw,this))},_extendRedrawBounds:function(a){if(a._pxBounds){var d=(a.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new et,this._redrawBounds.extend(a._pxBounds.min.subtract([d,d])),this._redrawBounds.extend(a._pxBounds.max.add([d,d]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var a=this._redrawBounds;if(a){var d=a.getSize();this._ctx.clearRect(a.min.x,a.min.y,d.x,d.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var a,d=this._redrawBounds;if(this._ctx.save(),d){var g=d.getSize();this._ctx.beginPath(),this._ctx.rect(d.min.x,d.min.y,g.x,g.y),this._ctx.clip()}this._drawing=!0;for(var _=this._drawFirst;_;_=_.next)a=_.layer,(!d||a._pxBounds&&a._pxBounds.intersects(d))&&a._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(a,d){if(this._drawing){var g,_,C,R,q=a._parts,rt=q.length,st=this._ctx;if(rt){for(st.beginPath(),g=0;g<rt;g++){for(_=0,C=q[g].length;_<C;_++)R=q[g][_],st[_?"lineTo":"moveTo"](R.x,R.y);d&&st.closePath()}this._fillStroke(st,a)}}},_updateCircle:function(a){if(!(!this._drawing||a._empty())){var d=a._point,g=this._ctx,_=Math.max(Math.round(a._radius),1),C=(Math.max(Math.round(a._radiusY),1)||_)/_;C!==1&&(g.save(),g.scale(1,C)),g.beginPath(),g.arc(d.x,d.y/C,_,0,Math.PI*2,!1),C!==1&&g.restore(),this._fillStroke(g,a)}},_fillStroke:function(a,d){var g=d.options;g.fill&&(a.globalAlpha=g.fillOpacity,a.fillStyle=g.fillColor||g.color,a.fill(g.fillRule||"evenodd")),g.stroke&&g.weight!==0&&(a.setLineDash&&a.setLineDash(d.options&&d.options._dashArray||[]),a.globalAlpha=g.opacity,a.lineWidth=g.weight,a.strokeStyle=g.color,a.lineCap=g.lineCap,a.lineJoin=g.lineJoin,a.stroke())},_onClick:function(a){for(var d=this._map.mouseEventToLayerPoint(a),g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(!(a.type==="click"||a.type==="preclick")||!this._map._draggableMoved(g))&&(_=g);this._fireEvent(_?[_]:!1,a)},_onMouseMove:function(a){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var d=this._map.mouseEventToLayerPoint(a);this._handleMouseHover(a,d)}},_handleMouseOut:function(a){var d=this._hoveredLayer;d&&(le(this._container,"leaflet-interactive"),this._fireEvent([d],a,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(a,d){if(!this._mouseHoverThrottled){for(var g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(_=g);_!==this._hoveredLayer&&(this._handleMouseOut(a),_&&(Rt(this._container,"leaflet-interactive"),this._fireEvent([_],a,"mouseover"),this._hoveredLayer=_)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,a),this._mouseHoverThrottled=!0,setTimeout(s(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(a,d,g){this._map._fireDOMEvent(d,g||d.type,a)},_bringToFront:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(g)g.prev=_;else return;_?_.next=g:g&&(this._drawFirst=g),d.prev=this._drawLast,this._drawLast.next=d,d.next=null,this._drawLast=d,this._requestRedraw(a)}},_bringToBack:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(_)_.next=g;else return;g?g.prev=_:_&&(this._drawLast=_),d.prev=null,d.next=this._drawFirst,this._drawFirst.prev=d,this._drawFirst=d,this._requestRedraw(a)}}});function Nc(a){return It.canvas?new Lc(a):null}var M=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return document.createElement("<lvml:"+a+' class="lvml">')}}catch{}return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),$={_initContainer:function(){this._container=re("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Mr.prototype._update.call(this),this.fire("update"))},_initPath:function(a){var d=a._container=M("shape");Rt(d,"leaflet-vml-shape "+(this.options.className||"")),d.coordsize="1 1",a._path=M("path"),d.appendChild(a._path),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){var d=a._container;this._container.appendChild(d),a.options.interactive&&a.addInteractiveTarget(d)},_removePath:function(a){var d=a._container;Kt(d),a.removeInteractiveTarget(d),delete this._layers[c(a)]},_updateStyle:function(a){var d=a._stroke,g=a._fill,_=a.options,C=a._container;C.stroked=!!_.stroke,C.filled=!!_.fill,_.stroke?(d||(d=a._stroke=M("stroke")),C.appendChild(d),d.weight=_.weight+"px",d.color=_.color,d.opacity=_.opacity,_.dashArray?d.dashStyle=A(_.dashArray)?_.dashArray.join(" "):_.dashArray.replace(/( *, *)/g," "):d.dashStyle="",d.endcap=_.lineCap.replace("butt","flat"),d.joinstyle=_.lineJoin):d&&(C.removeChild(d),a._stroke=null),_.fill?(g||(g=a._fill=M("fill")),C.appendChild(g),g.color=_.fillColor||_.color,g.opacity=_.fillOpacity):g&&(C.removeChild(g),a._fill=null)},_updateCircle:function(a){var d=a._point.round(),g=Math.round(a._radius),_=Math.round(a._radiusY||g);this._setPath(a,a._empty()?"M0 0":"AL "+d.x+","+d.y+" "+g+","+_+" 0,"+65535*360)},_setPath:function(a,d){a._path.v=d},_bringToFront:function(a){be(a._container)},_bringToBack:function(a){St(a._container)}},k=It.vml?M:me,Z=Mr.extend({_initContainer:function(){this._container=k("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=k("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Kt(this._container),Ce(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=a.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(d))&&(this._svgSize=d,g.setAttribute("width",d.x),g.setAttribute("height",d.y)),Ie(g,a.min),g.setAttribute("viewBox",[a.min.x,a.min.y,d.x,d.y].join(" ")),this.fire("update")}},_initPath:function(a){var d=a._path=k("path");a.options.className&&Rt(d,a.options.className),a.options.interactive&&Rt(d,"leaflet-interactive"),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(a._path),a.addInteractiveTarget(a._path)},_removePath:function(a){Kt(a._path),a.removeInteractiveTarget(a._path),delete this._layers[c(a)]},_updatePath:function(a){a._project(),a._update()},_updateStyle:function(a){var d=a._path,g=a.options;d&&(g.stroke?(d.setAttribute("stroke",g.color),d.setAttribute("stroke-opacity",g.opacity),d.setAttribute("stroke-width",g.weight),d.setAttribute("stroke-linecap",g.lineCap),d.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?d.setAttribute("stroke-dasharray",g.dashArray):d.removeAttribute("stroke-dasharray"),g.dashOffset?d.setAttribute("stroke-dashoffset",g.dashOffset):d.removeAttribute("stroke-dashoffset")):d.setAttribute("stroke","none"),g.fill?(d.setAttribute("fill",g.fillColor||g.color),d.setAttribute("fill-opacity",g.fillOpacity),d.setAttribute("fill-rule",g.fillRule||"evenodd")):d.setAttribute("fill","none"))},_updatePoly:function(a,d){this._setPath(a,ie(a._parts,d))},_updateCircle:function(a){var d=a._point,g=Math.max(Math.round(a._radius),1),_=Math.max(Math.round(a._radiusY),1)||g,C="a"+g+","+_+" 0 1,0 ",R=a._empty()?"M0 0":"M"+(d.x-g)+","+d.y+C+g*2+",0 "+C+-g*2+",0 ";this._setPath(a,R)},_setPath:function(a,d){a._path.setAttribute("d",d)},_bringToFront:function(a){be(a._path)},_bringToBack:function(a){St(a._path)}});It.vml&&Z.include($);function B(a){return It.svg||It.vml?new Z(a):null}pe.include({getRenderer:function(a){var d=a.options.renderer||this._getPaneRenderer(a.options.pane)||this.options.renderer||this._renderer;return d||(d=this._renderer=this._createRenderer()),this.hasLayer(d)||this.addLayer(d),d},_getPaneRenderer:function(a){if(a==="overlayPane"||a===void 0)return!1;var d=this._paneRenderers[a];return d===void 0&&(d=this._createRenderer({pane:a}),this._paneRenderers[a]=d),d},_createRenderer:function(a){return this.options.preferCanvas&&Nc(a)||B(a)}});var W=Ro.extend({initialize:function(a,d){Ro.prototype.initialize.call(this,this._boundsToLatLngs(a),d)},setBounds:function(a){return this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=ct(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}});function tt(a,d){return new W(a,d)}Z.create=k,Z.pointsToPath=ie,hi.geometryToLayer=Da,hi.coordsToLatLng=Mc,hi.coordsToLatLngs=yr,hi.latLngToCoords=Ba,hi.latLngsToCoords=$s,hi.getFeature=fi,hi.asFeature=za,pe.mergeOptions({boxZoom:!0});var Q=Jn.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane,this._resetStateTimeout=0,a.on("unload",this._destroy,this)},addHooks:function(){Ft(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ce(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Kt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(a){if(!a.shiftKey||a.which!==1&&a.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ws(),Cr(),this._startPoint=this._map.mouseEventToContainerPoint(a),Ft(document,{contextmenu:jn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(a){this._moved||(this._moved=!0,this._box=re("div","leaflet-zoom-box",this._container),Rt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(a);var d=new et(this._point,this._startPoint),g=d.getSize();Ie(this._box,d.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(Kt(this._box),le(this._container,"leaflet-crosshair")),Hr(),Co(),Ce(document,{contextmenu:jn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(a){if(!(a.which!==1&&a.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var d=new at(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(d).fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){a.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});pe.addInitHook("addHandler","boxZoom",Q),pe.mergeOptions({doubleClickZoom:!0});var J=Jn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(a){var d=this._map,g=d.getZoom(),_=d.options.zoomDelta,C=a.originalEvent.shiftKey?g-_:g+_;d.options.doubleClickZoom==="center"?d.setZoom(C):d.setZoomAround(a.containerPoint,C)}});pe.addInitHook("addHandler","doubleClickZoom",J),pe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ot=Jn.extend({addHooks:function(){if(!this._draggable){var a=this._map;this._draggable=new ci(a._mapPane,a._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),a.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),a.on("zoomend",this._onZoomEnd,this),a.whenReady(this._onZoomEnd,this))}Rt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){le(this._map._container,"leaflet-grab"),le(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var a=this._map;if(a._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var d=ct(this._map.options.maxBounds);this._offsetLimit=it(this._map.latLngToContainerPoint(d.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(d.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;a.fire("movestart").fire("dragstart"),a.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(a){if(this._map.options.inertia){var d=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(d),this._prunePositions(d)}this._map.fire("move",a).fire("drag",a)},_prunePositions:function(a){for(;this._positions.length>1&&a-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var a=this._map.getSize().divideBy(2),d=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=d.subtract(a).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(a,d){return a-(a-d)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var a=this._draggable._newPos.subtract(this._draggable._startPos),d=this._offsetLimit;a.x<d.min.x&&(a.x=this._viscousLimit(a.x,d.min.x)),a.y<d.min.y&&(a.y=this._viscousLimit(a.y,d.min.y)),a.x>d.max.x&&(a.x=this._viscousLimit(a.x,d.max.x)),a.y>d.max.y&&(a.y=this._viscousLimit(a.y,d.max.y)),this._draggable._newPos=this._draggable._startPos.add(a)}},_onPreDragWrap:function(){var a=this._worldWidth,d=Math.round(a/2),g=this._initialWorldOffset,_=this._draggable._newPos.x,C=(_-d+g)%a+d-g,R=(_+d+g)%a-d-g,q=Math.abs(C+g)<Math.abs(R+g)?C:R;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=q},_onDragEnd:function(a){var d=this._map,g=d.options,_=!g.inertia||a.noInertia||this._times.length<2;if(d.fire("dragend",a),_)d.fire("moveend");else{this._prunePositions(+new Date);var C=this._lastPos.subtract(this._positions[0]),R=(this._lastTime-this._times[0])/1e3,q=g.easeLinearity,rt=C.multiplyBy(q/R),st=rt.distanceTo([0,0]),pt=Math.min(g.inertiaMaxSpeed,st),Ot=rt.multiplyBy(pt/st),zt=pt/(g.inertiaDeceleration*q),Nt=Ot.multiplyBy(-zt/2).round();!Nt.x&&!Nt.y?d.fire("moveend"):(Nt=d._limitOffset(Nt,d.options.maxBounds),D(function(){d.panBy(Nt,{duration:zt,easeLinearity:q,noMoveStart:!0,animate:!0})}))}}});pe.addInitHook("addHandler","dragging",ot),pe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ut=Jn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(a){this._map=a,this._setPanDelta(a.options.keyboardPanDelta),this._setZoomDelta(a.options.zoomDelta)},addHooks:function(){var a=this._map._container;a.tabIndex<=0&&(a.tabIndex="0"),Ft(a,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ce(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var a=document.body,d=document.documentElement,g=a.scrollTop||d.scrollTop,_=a.scrollLeft||d.scrollLeft;this._map._container.focus(),window.scrollTo(_,g)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(a){var d=this._panKeys={},g=this.keyCodes,_,C;for(_=0,C=g.left.length;_<C;_++)d[g.left[_]]=[-1*a,0];for(_=0,C=g.right.length;_<C;_++)d[g.right[_]]=[a,0];for(_=0,C=g.down.length;_<C;_++)d[g.down[_]]=[0,a];for(_=0,C=g.up.length;_<C;_++)d[g.up[_]]=[0,-1*a]},_setZoomDelta:function(a){var d=this._zoomKeys={},g=this.keyCodes,_,C;for(_=0,C=g.zoomIn.length;_<C;_++)d[g.zoomIn[_]]=a;for(_=0,C=g.zoomOut.length;_<C;_++)d[g.zoomOut[_]]=-a},_addHooks:function(){Ft(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ce(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){var d=a.keyCode,g=this._map,_;if(d in this._panKeys){if(!g._panAnim||!g._panAnim._inProgress)if(_=this._panKeys[d],a.shiftKey&&(_=H(_).multiplyBy(3)),g.options.maxBounds&&(_=g._limitOffset(H(_),g.options.maxBounds)),g.options.worldCopyJump){var C=g.wrapLatLng(g.unproject(g.project(g.getCenter()).add(_)));g.panTo(C)}else g.panBy(_)}else if(d in this._zoomKeys)g.setZoom(g.getZoom()+(a.shiftKey?3:1)*this._zoomKeys[d]);else if(d===27&&g._popup&&g._popup.options.closeOnEscapeKey)g.closePopup();else return;jn(a)}}});pe.addInitHook("addHandler","keyboard",ut),pe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var gt=Jn.extend({addHooks:function(){Ft(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ce(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(a){var d=fr(a),g=this._map.options.wheelDebounceTime;this._delta+=d,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var _=Math.max(g-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),_),jn(a)},_performZoom:function(){var a=this._map,d=a.getZoom(),g=this._map.options.zoomSnap||0;a._stop();var _=this._delta/(this._map.options.wheelPxPerZoomLevel*4),C=4*Math.log(2/(1+Math.exp(-Math.abs(_))))/Math.LN2,R=g?Math.ceil(C/g)*g:C,q=a._limitZoom(d+(this._delta>0?R:-R))-d;this._delta=0,this._startTime=null,q&&(a.options.scrollWheelZoom==="center"?a.setZoom(d+q):a.setZoomAround(this._lastMousePos,d+q))}});pe.addInitHook("addHandler","scrollWheelZoom",gt);var xt=600;pe.mergeOptions({tapHold:It.touchNative&&It.safari&&It.mobile,tapTolerance:15});var Mt=Jn.extend({addHooks:function(){Ft(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ce(this._map._container,"touchstart",this._onDown,this)},_onDown:function(a){if(clearTimeout(this._holdTimeout),a.touches.length===1){var d=a.touches[0];this._startPos=this._newPos=new X(d.clientX,d.clientY),this._holdTimeout=setTimeout(s(function(){this._cancel(),this._isTapValid()&&(Ft(document,"touchend",hn),Ft(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",d))},this),xt),Ft(document,"touchend touchcancel contextmenu",this._cancel,this),Ft(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function a(){Ce(document,"touchend",hn),Ce(document,"touchend touchcancel",a)},_cancel:function(){clearTimeout(this._holdTimeout),Ce(document,"touchend touchcancel contextmenu",this._cancel,this),Ce(document,"touchmove",this._onMove,this)},_onMove:function(a){var d=a.touches[0];this._newPos=new X(d.clientX,d.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(a,d){var g=new MouseEvent(a,{bubbles:!0,cancelable:!0,view:window,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY});g._simulated=!0,d.target.dispatchEvent(g)}});pe.addInitHook("addHandler","tapHold",Mt),pe.mergeOptions({touchZoom:It.touch,bounceAtZoomLimits:!0});var mt=Jn.extend({addHooks:function(){Rt(this._map._container,"leaflet-touch-zoom"),Ft(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){le(this._map._container,"leaflet-touch-zoom"),Ce(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(a){var d=this._map;if(!(!a.touches||a.touches.length!==2||d._animatingZoom||this._zooming)){var g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]);this._centerPoint=d.getSize()._divideBy(2),this._startLatLng=d.containerPointToLatLng(this._centerPoint),d.options.touchZoom!=="center"&&(this._pinchStartLatLng=d.containerPointToLatLng(g.add(_)._divideBy(2))),this._startDist=g.distanceTo(_),this._startZoom=d.getZoom(),this._moved=!1,this._zooming=!0,d._stop(),Ft(document,"touchmove",this._onTouchMove,this),Ft(document,"touchend touchcancel",this._onTouchEnd,this),hn(a)}},_onTouchMove:function(a){if(!(!a.touches||a.touches.length!==2||!this._zooming)){var d=this._map,g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]),C=g.distanceTo(_)/this._startDist;if(this._zoom=d.getScaleZoom(C,this._startZoom),!d.options.bounceAtZoomLimits&&(this._zoom<d.getMinZoom()&&C<1||this._zoom>d.getMaxZoom()&&C>1)&&(this._zoom=d._limitZoom(this._zoom)),d.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var R=g._add(_)._divideBy(2)._subtract(this._centerPoint);if(C===1&&R.x===0&&R.y===0)return;this._center=d.unproject(d.project(this._pinchStartLatLng,this._zoom).subtract(R),this._zoom)}this._moved||(d._moveStart(!0,!1),this._moved=!0),j(this._animRequest);var q=s(d._move,d,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(q,this,!0),hn(a)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,j(this._animRequest),Ce(document,"touchmove",this._onTouchMove,this),Ce(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});pe.addInitHook("addHandler","touchZoom",mt),pe.BoxZoom=Q,pe.DoubleClickZoom=J,pe.Drag=ot,pe.Keyboard=ut,pe.ScrollWheelZoom=gt,pe.TapHold=Mt,pe.TouchZoom=mt,n.Bounds=et,n.Browser=It,n.CRS=Et,n.Canvas=Lc,n.Circle=Io,n.CircleMarker=ui,n.Class=U,n.Control=dr,n.DivIcon=$c,n.DivOverlay=vr,n.DomEvent=$h,n.DomUtil=_m,n.Draggable=ci,n.Evented=G,n.FeatureGroup=mr,n.GeoJSON=hi,n.GridLayer=Lo,n.Handler=Jn,n.Icon=gr,n.ImageOverlay=Fa,n.LatLng=yt,n.LatLngBounds=at,n.Layer=tr,n.LayerGroup=Gi,n.LineUtil=Un,n.Map=pe,n.Marker=ks,n.Mixin=je,n.Path=Jt,n.Point=X,n.PolyUtil=fn,n.Polygon=Ro,n.Polyline=Yr,n.Popup=Is,n.PosAnimation=Or,n.Projection=La,n.Rectangle=W,n.Renderer=Mr,n.SVG=Z,n.SVGOverlay=Hh,n.TileLayer=Yi,n.Tooltip=Rs,n.Transformation=Ct,n.Util=K,n.VideoOverlay=Uh,n.bind=s,n.bounds=it,n.canvas=Nc,n.circle=ja,n.circleMarker=zh,n.control=As,n.divIcon=Zh,n.extend=i,n.featureGroup=Cc,n.geoJSON=Vh,n.geoJson=Em,n.gridLayer=Yh,n.icon=Oc,n.imageOverlay=Sx,n.latLng=vt,n.latLngBounds=ct,n.layerGroup=Bh,n.map=ka,n.marker=Na,n.point=H,n.polygon=Wh,n.polyline=Fh,n.popup=qh,n.rectangle=tt,n.setOptions=p,n.stamp=c,n.svg=B,n.svgOverlay=Om,n.tileLayer=Ic,n.tooltip=Gh,n.transformation=nt,n.version=r,n.videoOverlay=Cm;var At=window.L;n.noConflict=function(){return window.L=At,this},window.L=n})})(ib,ib.exports);var Ta=ib.exports;function vc(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function wx(e,t){return t==null?function(r,i){const o=v.useRef();return o.current||(o.current=e(r,i)),o}:function(r,i){const o=v.useRef();o.current||(o.current=e(r,i));const s=v.useRef(r),{instance:l}=o.current;return v.useEffect(function(){s.current!==r&&(t(l,r,s.current),s.current=r)},[l,r,i]),o}}function V$(e,t){v.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var o;(o=t.layerContainer)==null||o.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function vut(e){return function(n){const r=bm(),i=e(xm(n,r),r);return B$(r.map,n.attribution),xx(i.current,n.eventHandlers),V$(i.current,r),i}}function but(e,t){const n=v.useRef();v.useEffect(function(){if(t.pathOptions!==n.current){const i=t.pathOptions??{};e.instance.setStyle(i),n.current=i}},[e,t])}function xut(e){return function(n){const r=bm(),i=e(xm(n,r),r);return xx(i.current,n.eventHandlers),V$(i.current,r),but(i.current,n),i}}function wut(e,t){const n=wx(e),r=yut(n,t);return mut(r)}function wm(e,t){const n=wx(e,t),r=xut(n);return put(r)}function _ut(e,t){const n=wx(e,t),r=vut(n);return gut(r)}function Sut(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function U$(){return bm().map}function Put(e){const t=U$();return v.useEffect(function(){return t.on(e),function(){t.off(e)}},[t,e]),t}const Aut=wm(function({center:t,children:n,...r},i){const o=new Ta.Circle(t,r);return vc(o,vm(i,{overlayContainer:o}))},z$),sT=wm(function({center:t,children:n,...r},i){const o=new Ta.CircleMarker(t,r);return vc(o,vm(i,{overlayContainer:o}))},z$);function ob(){return ob=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ob.apply(this,arguments)}function Tut({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:o,placeholder:s,style:l,whenReady:c,zoom:h,...u},f){const[m]=v.useState({className:i,id:o,style:l}),[y,x]=v.useState(null);v.useImperativeHandle(f,()=>(y==null?void 0:y.map)??null,[y]);const p=v.useCallback(P=>{if(P!==null&&y===null){const S=new Ta.Map(P,u);n!=null&&h!=null?S.setView(n,h):e!=null&&S.fitBounds(e,t),c!=null&&S.whenReady(c),x(dut(S))}},[]);v.useEffect(()=>()=>{y==null||y.map.remove()},[y]);const b=y?v.createElement(W$,{value:y},r):s??null;return v.createElement("div",ob({},m,{ref:p}),b)}const Eut=v.forwardRef(Tut),aT=wm(function({positions:t,...n},r){const i=new Ta.Polygon(t,n);return vc(i,vm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),lT=wm(function({positions:t,...n},r){const i=new Ta.Polyline(t,n);return vc(i,vm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),Cut=_ut(function({url:t,...n},r){const i=new Ta.TileLayer(t,xm(n,r));return vc(i,r)},function(t,n,r){Sut(t,n,r);const{url:i}=n;i!=null&&i!==r.url&&t.setUrl(i)}),Out=wut(function(t,n){const r=new Ta.Tooltip(t,n.overlayContainer);return vc(r,n)},function(t,n,{position:r},i){v.useEffect(function(){const s=n.overlayContainer;if(s==null)return;const{instance:l}=t,c=u=>{u.tooltip===l&&(r!=null&&l.setLatLng(r),l.update(),i(!0))},h=u=>{u.tooltip===l&&i(!1)};return s.on({tooltipopen:c,tooltipclose:h}),s.bindTooltip(l),function(){s.off({tooltipopen:c,tooltipclose:h}),s._map!=null&&s.unbindTooltip()}},[t,n,i,r])});function Vo(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function pi(e,t){let n=t;if(typeof n=="string"){const l=e.interpolateText(n);try{n=JSON.parse(l)}catch{n=l.split(",")}}const r=Array.isArray(n)?n[0]:(n==null?void 0:n.latitude)??(n==null?void 0:n.lat),i=Array.isArray(n)?n[1]:(n==null?void 0:n.longitude)??(n==null?void 0:n.lng),o=Number(e.interpolateText(String(r??""))),s=Number(e.interpolateText(String(i??"")));return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}function Hg(e,t,n){return e[t||""]??n.map(r=>e[r]).find(Boolean)??""}function sb(e,t,n,r,i){if(e.interactionDisabled)return;const o={...r,latitude:n[0],longitude:n[1],[t.latitudeKey||"latitude"]:n[0],[t.longitudeKey||"longitude"]:n[1]};e.rowContextRef&&(e.rowContextRef.current=o),e.setSceneData(s=>({...s,...o})),i&&e.handleButtonClick(e.interpolateText(i)).catch(()=>{})}function Mut({api:e,drawing:t,active:n,points:r}){if(!t||t.controls===!1)return null;const i=t.activeKey||"isDrawing",o=t.activeValue??!0,s=t.inactiveValue??!1,l=t.pointsKey||"draftGeofencePoints",c=u=>e.setSceneData(f=>({...f,...u})),h={alignItems:"center",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"6px",color:"#0f172a",cursor:"pointer",display:"flex",fontSize:"12px",fontWeight:700,gap:"6px",minHeight:"34px",padding:"7px 10px"};return V("div",{"aria-live":"polite",style:{display:"flex",flexDirection:"column",gap:"6px",position:"absolute",right:"12px",top:"12px",zIndex:1001}},n?V("div",{style:{background:"#0f172a",borderRadius:"6px",color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 10px"}},`Drawing polygon: ${r.length} points`):V("button",{"aria-label":"Draw geofence",onClick:()=>c({[i]:o,[l]:[]}),style:h,title:"Draw geofence",type:"button"},e.renderIcon("pencil-ruler",15),"Draw fence"),n?V("button",{"aria-label":"Finish geofence",disabled:r.length<3,onClick:()=>c({[i]:s}),style:{...h,opacity:r.length<3?.5:1},title:"Finish geofence",type:"button"},e.renderIcon("check",15),"Finish"):null,V("button",{"aria-label":"Clear geofence draft",onClick:()=>c({[i]:s,[l]:[]}),style:h,title:"Clear geofence draft",type:"button"},e.renderIcon("trash-2",15),"Clear"))}function kut({center:e,points:t,fitBounds:n,location:r,followLocation:i,followDuration:o}){const s=U$(),l=v.useRef(!1),c=t.map(u=>u.join(",")).join("|"),h=(r==null?void 0:r.join(","))||"";return v.useEffect(()=>{const u=n&&t.length>1,f=u&&!l.current;if(i?f:u){l.current=!0,s.fitBounds(t,{padding:[24,24],maxZoom:16});return}if(i&&r){l.current=!0,s.panTo(r,{animate:!0,duration:Number(o)||.45});return}l.current=!0,s.setView(e,s.getZoom())},[e[0],e[1],n,o,i,h,s,c]),null}function $ut({enabled:e,drawingEnabled:t,onSelect:n,onDrawPoint:r}){return Put({click:i=>{if(!e)return;const o=[i.latlng.lat,i.latlng.lng];t?r(o):n(o)}}),null}function Iut(e,t){if(!t)return!1;const n=t.activeKey?e.sceneData[t.activeKey]:t.enabled;return t.activeValue===void 0?n===!0||n==="true":String(n)===String(t.activeValue)}function Rut(e,t){return t?Vo(e.sceneData[t.pointsKey||"draftGeofencePoints"]).map(n=>pi(e,n)).filter(n=>n!==null):[]}function Lut(e,t,n){const r=pi(n,t.center);if(r&&t.radius){const o=(e[0]-r[0])*111320,s=(e[1]-r[1])*111320*Math.cos(r[0]*Math.PI/180);return Math.hypot(o,s)<=Number(t.radius)}const i=Vo(typeof t.points=="string"?n.interpolateText(t.points):t.points).map(o=>pi(n,o)).filter(o=>o!==null);return i.length<3?!1:i.reduce((o,s,l)=>{const c=i[(l+i.length-1)%i.length];return s[0]>e[0]!=c[0]>e[0]&&e[1]<(c[1]-s[1])*(e[0]-s[0])/(c[0]-s[0])+s[1]?!o:o},!1)}function Nut({api:e,config:t,location:n,fences:r}){const i=JSON.stringify(r),o=(n==null?void 0:n.join(","))||"";return v.useEffect(()=>{if(!n)return;const s=new Set(r.filter(u=>Lut(n,u,e)).map((u,f)=>u.id||String(f))),l=t.geofenceKey||"activeGeofences",c=new Set(Array.isArray(e.sceneData[l])?e.sceneData[l].map(String):[]);(s.size!==c.size||[...s].some(u=>!c.has(u)))&&(e.setSceneData(u=>({...u,[l]:[...s]})),r.forEach((u,f)=>{const m=u.id||String(f),y=s.has(m)&&!c.has(m),x=!s.has(m)&&c.has(m),p=y?u.onEnter||t.onGeofenceEnter:x?u.onExit||t.onGeofenceExit:void 0;p&&sb(e,t,n,{...u,geofenceId:m},p)}))},[e,t,i,r,n,o]),null}function jut({api:e,config:t,componentKey:n}){var w,T;const r=e.interpolateText(t.dataSource||""),{fetchListData:i}=e;v.useEffect(()=>{r&&i(r,n,0,t.pageSize||50).catch(()=>{})},[n,t.pageSize,r,i]);const s=(r?((w=e.listData)==null?void 0:w[n])||[]:Vo(typeof t.markers=="string"?e.interpolateText(t.markers):t.markers)).map(O=>({source:O,location:pi(e,O)})).filter(O=>O.location!==null),l=Vo(typeof t.route=="string"?e.interpolateText(t.route):t.route).map(O=>pi(e,O)).filter(O=>O!==null),c=pi(e,t.location),h=pi(e,t.center||t)||c||((T=s[0])==null?void 0:T.location)||l[0];t.marker&&h&&s.length===0&&s.push({source:{},location:h});const u=Vo(typeof t.geofences=="string"?e.interpolateText(t.geofences):t.geofences),f=t.drawing,m=Iut(e,f),y=Rut(e,f),x=y.length>2?{id:f.id||f.pointsKey||"drawn-geofence",label:f.label||"Drawn geofence",color:f.color||e.cfg.colors.accent,points:y}:null,p=x?[...u,x]:u,b=(f==null?void 0:f.color)||e.cfg.colors.accent,P={width:"100%",height:t.height||t.h||"360px",minHeight:"180px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",overflow:"hidden",position:"relative",...t.className?e.parseClassName(t.className):{}},S=e.getCommonProps(n,P,t);if(!h)return V("div",{key:n,...S},t.emptyText||"Map location unavailable");const A=t.interactive!==!1&&!e.interactionDisabled,E=[...s.map(O=>O.location),...l,...c?[c]:[]];return Ze.jsxs("div",{className:t.className,...S,children:[Ze.jsxs(Eut,{center:h,zoom:Math.min(19,Math.max(1,Number(t.zoom)||14)),dragging:A,scrollWheelZoom:A,zoomControl:A,attributionControl:!1,style:{width:"100%",height:"100%"},children:[Ze.jsx(Cut,{url:t.tileUrl||"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:t.tileAttribution||"&copy; OpenStreetMap contributors"}),Ze.jsx(kut,{center:h,points:E,fitBounds:t.fitBounds??E.length>1,location:c,followLocation:t.followLocation===!0,followDuration:t.followDuration}),Ze.jsx($ut,{enabled:A,drawingEnabled:m,onSelect:O=>sb(e,t,O,{},t.onMapClick||t.onClick),onDrawPoint:O=>{const I=(f==null?void 0:f.pointsKey)||"draftGeofencePoints";e.setSceneData(N=>({...N,[I]:[...Vo(N[I]),O]}))}}),Ze.jsx(Nut,{api:e,config:t,location:c,fences:p}),l.length>1&&Ze.jsx(lT,{positions:l,pathOptions:{color:t.routeColor||e.cfg.colors.primary,weight:5}}),f&&y.length===1&&Ze.jsx(sT,{center:y[0],radius:6,pathOptions:{color:b,fillColor:b}}),f&&y.length>1&&Ze.jsx(lT,{positions:y,pathOptions:{color:b,dashArray:"8 8",weight:3}}),f&&y.length>2&&Ze.jsx(aT,{positions:y,pathOptions:{color:b,fillColor:b,fillOpacity:.18,weight:2}}),u.map((O,I)=>{const N=O.color||e.cfg.colors.primary,F=pi(e,O.center),D=Vo(typeof O.points=="string"?e.interpolateText(O.points):O.points).map(K=>pi(e,K)).filter(K=>K!==null),j={color:N,fillColor:N,fillOpacity:.14,weight:2};return F&&O.radius?Ze.jsx(Aut,{center:F,radius:Number(O.radius),pathOptions:j},O.id||I):D.length>2?Ze.jsx(aT,{positions:D,pathOptions:j},O.id||I):null}),s.map(({source:O,location:I})=>Ze.jsx(sT,{center:I,radius:Number(O.radius||t.markerRadius)||9,pathOptions:{color:O.color||t.markerColor||e.cfg.colors.primary,fillColor:O.color||t.markerColor||e.cfg.colors.primary,fillOpacity:.9,weight:2},eventHandlers:{click:()=>sb(e,t,I,O,O.onClick||t.onMarkerClick)},children:O.label||O.name?Ze.jsx(Out,{children:e.interpolateText(O.label||O.name)}):null},O.id||I.join("-")))]}),Ze.jsx(Mut,{api:e,drawing:f,active:m,points:y})]},n)}function Xl(e,t,n,r,i,o=!1){if(!Array.isArray(t)||t.length===0)return null;if(r==="row"||o)return t.map((u,f)=>e.renderComponent(u,f,n));const s=[];let l=[];const c=u=>u&&(u.type==="button"||i&&(u.type==="link"||u.type==="a")),h=u=>{l.length!==0&&(l.length===1?s.push(e.renderComponent(l[0],u,n)):s.push(V("div",{key:`${n}-btns-${u}`,style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",gap:"0.75rem"}},...l.map((f,m)=>e.renderComponent(f,u+m,n)))),l=[])};return t.forEach((u,f)=>{c(u)?l.push(u):(h(f),s.push(e.renderComponent(u,f,n)))}),h(t.length),s}function H$(e){return e.className?/\bhidden\b/.test(e.className)&&/\b(sm|md|lg|xl):(?:block|flex|inline|inline-block|inline-flex)\b/.test(e.className):!1}function q$(e){return e.children?e.children.filter(t=>H$(t)):[]}function Dut(e){return e.children?e.children.filter(t=>!H$(t)):[]}function G$(e){var t;return Array.isArray((t=e==null?void 0:e.mobileMenu)==null?void 0:t.items)?e.mobileMenu.items:[]}function But(e){if(!(e.layout==="row"||e.className&&/\bflex-row\b/.test(e.className)))return!1;const n=q$(e),r=G$(e);if(n.length===0&&r.length===0)return!1;const i=["text","link","button","accordion"];if(!(n.length===0||n.every(c=>i.includes(c.type))))return!1;const s=e.className||"";return/\b(sticky|fixed)\b/.test(s)||/\btop-0\b/.test(s)||/\bz-(10|20|30|40|50)\b/.test(s)||/\bjustify-between\b/.test(s)||e.justify==="space-between"}function cT(e){const t=G$(e);return t.length>0?t:q$(e)}function uT(e){return Dut(e)}function hT(e,t,n){return v.createElement("button",{key:"hamburger-icon",onClick:()=>t(!e),style:{background:"none",border:"none",cursor:"pointer",width:"40px",height:"40px",padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",color:n||"inherit",fontSize:"24px",lineHeight:1},"aria-label":e?"Close navigation menu":"Open navigation menu"},v.createElement(e?Qt.FiX:Qt.FiMenu,{size:20}))}function Z$(e){return e=String(e??""),e.replace(/\bhidden\b/g,"").replace(/\b(sm|md|lg|xl|2xl):(block|flex|inline|inline-block|inline-flex)\b/g,"").replace(/\s+/g," ").trim()}function fT(e){const t=(e==null?void 0:e.className)||"";return/\bdrawer\b/.test(t)&&!/\bdrawer-(item|item-[a-z]+)\b/.test(t)}function Ya(e){return/\bburger-first\b/.test((e==null?void 0:e.className)||"")}function dT({navLinks:e,parentKey:t,renderComponentFn:n,open:r,onClose:i,colorMode:o,portalTarget:s,mobileMenu:l,parseMenuClassName:c}){const[h,u]=v.useState(r);if(v.useEffect(()=>{r&&u(!0)},[r]),!r&&!h)return null;const f=e.map(P=>({...P,className:P.className?Z$(P.className):void 0})),m=o!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",y=l!=null&&l.className&&c?c(l.className,`${t}-side-drawer-class`):{},x=l!=null&&l.headerClassName&&c?c(l.headerClassName,`${t}-side-header-class`):{},p=()=>{u(!1),i()},b=v.createElement(v.Fragment,null,v.createElement("div",{key:`${t}-side-backdrop`,onClick:p,style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.45)",zIndex:90,opacity:r?1:0,transition:"opacity 0.25s ease",pointerEvents:r?"auto":"none"}}),v.createElement("div",{key:`${t}-side-drawer`,className:l==null?void 0:l.className,style:{position:"absolute",top:0,bottom:0,left:0,width:"min(300px, 85%)",backgroundColor:m,zIndex:100,overflowY:"auto",transform:r?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease",boxShadow:"2px 0 12px rgba(0, 0, 0, 0.25)",display:"flex",flexDirection:"column",gap:"4px",padding:"16px 12px",...y}},v.createElement("div",{key:`${t}-side-header`,className:l==null?void 0:l.headerClassName,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 8px 12px",borderBottom:"1px solid rgba(128, 128, 128, 0.2)",marginBottom:"8px",fontSize:18,fontWeight:700,...x}},(l==null?void 0:l.title)||"Menu",v.createElement("button",{onClick:p,"aria-label":"Close menu",style:{background:"none",border:"none",cursor:"pointer",fontSize:22,color:"inherit",lineHeight:1}},"✕")),f.map((P,S)=>v.createElement(Y$,{key:`${t}-drawer-item-${S}`,link:P,idx:S,parentKey:t,renderComponentFn:n,onClose:p,itemClassName:P.drawerClassName||(l==null?void 0:l.itemClassName),itemStyle:(P.drawerClassName||l!=null&&l.itemClassName)&&c?c(P.drawerClassName||l.itemClassName,`${t}-drawer-item-class-${S}`):void 0}))));return s?cb.createPortal(b,s):b}function Y$({link:e,idx:t,parentKey:n,renderComponentFn:r,onClose:i,itemClassName:o,itemStyle:s}){const[l,c]=v.useState(!1),h=e.type==="link"||e.type==="button";return v.createElement("div",{key:`${n}-drawer-item-${t}`,className:o,style:{display:"flex",flexDirection:"row",alignItems:"center",gap:10,width:"100%",padding:"10px 12px",borderRadius:8,cursor:h?"pointer":"default",backgroundColor:l?"rgba(128, 128, 128, 0.12)":"transparent",transition:"background-color 0.15s ease",...s},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:u=>{var m;!u.target.closest("a, button, [role='button']")&&h&&((m=u.currentTarget.querySelector("a, button, [role='button']"))==null||m.click()),h&&i()}},r(e,t+1,`${n}-drawer`))}function pT(e,t,n,r,i,o,s,l){if(!r)return null;const c=e.map(x=>({...x,className:x.className?Z$(x.className):void 0})),h=i!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",u=i!=="light"?"rgba(75, 85, 99, 0.5)":"rgba(209, 213, 219, 0.5)",f=s!=null&&s.className&&l?l(s.className,`${t}-mobile-drawer-class`):{},m=(s==null?void 0:s.rawStyle)??{},y=!!(s!=null&&s.inFlow);return v.createElement("div",{key:`${t}-mobile-drawer`,className:s==null?void 0:s.className,style:{position:y?"relative":"absolute",top:y?0:"100%",left:0,right:0,flexBasis:y?"100%":void 0,backgroundColor:h,borderTop:`1px solid ${u}`,padding:"12px",display:"flex",flexDirection:"column",gap:"4px",zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",...f,...m}},c.map((x,p)=>v.createElement(Y$,{key:`${t}-drawer-item-${p}`,link:x,idx:p,parentKey:t,renderComponentFn:n,onClose:()=>o==null?void 0:o(!1),itemClassName:x.drawerClassName||(s==null?void 0:s.itemClassName),itemStyle:(x.drawerClassName||s!=null&&s.itemClassName)&&l?l(x.drawerClassName||s.itemClassName,`${t}-drawer-item-class-${p}`):void 0})))}function zut(e,t,n){var s;if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=/\bspace-x-/.test(t.className),h=/\bspace-y-/.test(t.className);if(l.display==null&&(l.display=t.layout==="row"||c||h?"flex":"block"),l.flexDirection==null){const f=t.className||"",m=f.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(m)l.flexDirection=m[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(f)){const y=/\bmin-h-(screen|\[[^\]]+\])/.test(f)&&/\bitems-center\b/.test(f),x=Array.isArray(t.children)&&t.children.length>0&&t.children.every(p=>p&&["h1","h2","h3","h4","p","text"].includes(p.type));l.flexDirection=y||x?"column":"row"}else c||h?l.flexDirection=c?"row":"column":l.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const f=bh(t.className);if(f.px.size>0){const y=Vt(f.px,e.containerWidth,"0px");l.paddingLeft=y,l.paddingRight=y}if(f.py.size>0){const y=Vt(f.py,e.containerWidth,"0px");l.paddingTop=y,l.paddingBottom=y}if(f.p.size>0){const y=Vt(f.p,e.containerWidth,"0px");l.padding=y}const m=ic(t.className);m.size>0&&(l.display=Vt(m,e.containerWidth,"flex"))}const u=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,className:t.className,...u},Xl(e,Array.isArray(t.children)?t.children:[],n,l.flexDirection))}const r=e.cfg.colorMode==="light",i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"1rem",padding:"1.5rem",borderRadius:"1rem",backdropFilter:"blur(8px)",border:r?"1px solid rgba(0, 0, 0, 0.1)":"1px solid rgba(55, 65, 81, 0.5)"},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},Xl(e,t.children,n,i.flexDirection))}function Fut(e,t,n){var l,c,h,u,f;const r=e.isMobileView&&But(t);if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className),y=/\bspace-x-/.test(t.className),x=/\bspace-y-/.test(t.className);if(m.display==null&&(m.display=t.layout==="row"||y||x?"flex":"block"),m.flexDirection==null){const P=t.className||"",S=P.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(S)m.flexDirection=S[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(P)){const A=/\bmin-h-(screen|\[[^\]]+\])/.test(P)&&/\bitems-center\b/.test(P),E=Array.isArray(t.children)&&t.children.length>0&&t.children.every(w=>w&&["h1","h2","h3","h4","p","text"].includes(w.type));m.flexDirection=A||E?"column":"row"}else y||x?m.flexDirection=y?"row":"column":m.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const P=bh(t.className);if(P.px.size>0){const A=Vt(P.px,e.containerWidth,"0px");m.paddingLeft=A,m.paddingRight=A}if(P.py.size>0){const A=Vt(P.py,e.containerWidth,"0px");m.paddingTop=A,m.paddingBottom=A}if(P.p.size>0){const A=Vt(P.p,e.containerWidth,"0px");m.padding=A}const S=ic(t.className);S.size>0&&(m.display=Vt(S,e.containerWidth,"flex"))}if(r&&t.children&&t.children.length>0){const P=uT(t),S=cT(t),A=!!((c=t.mobileMenu)!=null&&c.inFlow);m.position="relative",m.display="flex",m.alignItems="center",m.justifyContent=Ya(t)?"flex-start":"space-between",Ya(t)&&(m.gap=10),A&&(m.flexWrap="wrap",m.height="auto",m.minHeight="64px",m.paddingTop="12px");const E=e.getCommonProps(n,m,t),w=hT(e.mobileMenuOpen,e.setMobileMenuOpen,(h=t.mobileMenu)==null?void 0:h.iconColor),T=(I,N)=>{var F;return((F=e.parseClassNameResponsive)==null?void 0:F.call(e,I,N))??e.parseClassName(I)},O=P.map((I,N)=>e.renderComponent(I,N,n));return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...E},...Ya(t)?[w,...O]:[...O,w],fT(t)?v.createElement(dT,{navLinks:S,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:T}):pT(S,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,T))}const p=e.getCommonProps(n,m,t),b=t.onClick?{onClick:P=>{P.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...p,...b},Xl(e,Array.isArray(t.children)?t.children:[],n,m.flexDirection,!1,/\bflex-col\b|\bspace-y-/.test(t.className)))}const i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"16px"};if(t.align){const m={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};i.alignItems=m[t.align]}if(t.justify){const m={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between"};i.justifyContent=m[t.justify]}if(t.padding!==void 0&&(i.padding=`${t.padding}px`),r&&t.children&&t.children.length>0){const m=uT(t),y=cT(t),x=!!((u=t.mobileMenu)!=null&&u.inFlow);i.position="relative",i.display="flex",i.alignItems="center",i.justifyContent=Ya(t)?"flex-start":"space-between",Ya(t)&&(i.gap=10),x&&(i.flexWrap="wrap",i.height="auto",i.minHeight="64px",i.paddingTop="12px");const p=e.getCommonProps(n,i,t),b=hT(e.mobileMenuOpen,e.setMobileMenuOpen,(f=t.mobileMenu)==null?void 0:f.iconColor),P=(A,E)=>{var w;return((w=e.parseClassNameResponsive)==null?void 0:w.call(e,A,E))??e.parseClassName(A)},S=m.map((A,E)=>e.renderComponent(A,E,n));return v.createElement("div",{key:n,...p},...Ya(t)?[b,...S]:[...S,b],fT(t)?v.createElement(dT,{navLinks:y,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:P}):pT(y,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,P))}const o=e.getCommonProps(n,i,t),s=t.onClick?{onClick:m=>{m.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,...o,...s},Xl(e,t.children,n,i.flexDirection))}function Wut(e,t,n){var o,s;if(t.className){const l=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className);let c;if(e.renderMode!=="css-driven"){const u=pD(t.className),f=u.size>0?mD(u,e.containerWidth):void 0;c={display:"grid",...l,...f!==void 0&&{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`}}}else c={display:"grid",...l};const h=e.getCommonProps(n,c,t);return v.createElement("div",{key:n,className:t.className,...h},(Array.isArray(t.children)?t.children:[]).map((u,f)=>e.renderComponent(u,f,n)))}const r={display:"grid",width:"100%",gridTemplateColumns:`repeat(${t.cols||2}, minmax(0, 1fr))`,gap:t.gap!==void 0?`${t.gap}px`:"16px"},i=e.getCommonProps(n,r,t);return v.createElement("div",{key:n,...i},(s=t.children)==null?void 0:s.map((l,c)=>e.renderComponent(l,c,n)))}function Vut(e,t,n){var l,c;if(t.className){const u={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:e.containerWidth>0&&e.containerWidth<ku.md?"300px":"500px",gap:"24px"};(t.bg||t.backgroundColor)&&(u.background=t.bg||t.backgroundColor),t.bgImage&&(u.backgroundImage=`url(${t.bgImage})`,u.backgroundSize="cover",u.backgroundPosition="center");const f={...u,...((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className)};if(Array.isArray(t.children)&&t.children.some(x=>x.type==="grid")||(f.textAlign="center"),e.renderMode!=="css-driven"){const x=bh(t.className);if(x.px.size>0){const p=Vt(x.px,e.containerWidth,"0px");f.paddingLeft=p,f.paddingRight=p}if(x.py.size>0){const p=Vt(x.py,e.containerWidth,"0px");f.paddingTop=p,f.paddingBottom=p}if(x.p.size>0){const p=Vt(x.p,e.containerWidth,"0px");f.padding=p}}const y=e.getCommonProps(n,f,t);return v.createElement("div",{key:n,className:t.className,...y},Xl(e,Array.isArray(t.children)?t.children:[],n,f.flexDirection))}const r=e.containerWidth<ku.md,i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:r?"300px":"500px",padding:r?"1.5rem":"3rem",background:t.bg||t.backgroundColor,gap:"24px"};t.bgImage&&(i.backgroundImage=`url(${t.bgImage})`,i.backgroundSize="cover",i.backgroundPosition="center"),Array.isArray(t.children)&&t.children.some(h=>h.type==="grid")||(i.textAlign="center");const s=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...s},(c=t.children)==null?void 0:c.map((h,u)=>e.renderComponent(h,u,n)))}function Uut(e,t,n){var s;const r={display:"flex",flexDirection:"row",alignItems:"center",width:"100%",flexShrink:0,position:"sticky",top:0,zIndex:50,gap:"1.25rem",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colors.surface,borderBottom:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const l=bh(t.className);l.px.size>0&&(r.paddingLeft=Vt(l.px,e.containerWidth,"0px"),r.paddingRight=Vt(l.px,e.containerWidth,"0px")),l.py.size>0&&(r.paddingTop=Vt(l.py,e.containerWidth,"0px"),r.paddingBottom=Vt(l.py,e.containerWidth,"0px"));const c=ic(t.className);c.size>0&&(r.display=Vt(c,e.containerWidth,"flex"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};return v.createElement("header",o,(Array.isArray(t.children)?t.children:[]).filter(l=>Array.isArray(l.visibleOn)?l.visibleOn.includes(e.currentSceneId):Array.isArray(l.hiddenOn)?!l.hiddenOn.includes(e.currentSceneId):!0).map((l,c)=>e.renderComponent(l,c,n)))}function Hut(e,t,n){var c;const r={display:"flex",flexDirection:t.layout==="row"?"row":"column",width:"100%",flexShrink:0,marginTop:"auto",gap:"1rem",padding:"2.5rem 1.5rem",backgroundColor:e.cfg.colors.surfaceHover,borderTop:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((c=e.parseClassNameResponsive)==null?void 0:c.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const h=bh(t.className);h.px.size>0&&(r.paddingLeft=Vt(h.px,e.containerWidth,"0px"),r.paddingRight=Vt(h.px,e.containerWidth,"0px")),h.py.size>0&&(r.paddingTop=Vt(h.py,e.containerWidth,"0px"),r.paddingBottom=Vt(h.py,e.containerWidth,"0px"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};let s=Array.isArray(t.children)?t.children:[];const l=s[0];return l&&l.type==="text"&&/^(\u00a9|\(c\)|copyright)/i.test(String(l.text).trim())&&(s=[...s.slice(1),l]),v.createElement("footer",o,Xl(e,s,n,r.flexDirection,!0))}function qut({api:e,config:t,componentKey:n}){var b,P;const r=t.queryKey||"placeQuery",i=String(e.sceneData[r]||""),[o,s]=v.useState(i),l=e.interpolateText(t.dataSource||""),c=Number(t.minChars)||3,h=Number(t.debounceMs)||300,{fetchListData:u}=e;v.useEffect(()=>{i!==o&&s(i)},[o,i]),v.useEffect(()=>{if(!l||o.trim().length<c)return;const S=window.setTimeout(()=>{u(l,n,0,t.pageSize||8).catch(()=>{})},h);return()=>window.clearTimeout(S)},[n,t.pageSize,l,h,u,c,o]);const f=l?((b=e.listData)==null?void 0:b[n])||[]:Vo(typeof t.places=="string"?e.interpolateText(t.places):t.places),m={display:"flex",flexDirection:"column",gap:"8px",width:"100%",...t.className?e.parseClassName(t.className):{}},y=e.getCommonProps(n,m,t),x=S=>{const A=Hg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]),E=pi(e,S),w={...S,[t.valueKey||"address"]:A,...E?{latitude:E[0],longitude:E[1]}:{},...E&&t.latitudeKey?{[t.latitudeKey]:E[0]}:{},...E&&t.longitudeKey?{[t.longitudeKey]:E[1]}:{}};e.rowContextRef&&(e.rowContextRef.current=w),e.setSceneData(O=>({...O,...w}));const T=S.onClick||t.onPlaceClick||t.onClick;T&&e.handleButtonClick(e.interpolateText(T)).catch(()=>{})},p=!((P=e.loading)!=null&&P[n])&&f.length===0&&(!l||o.trim().length>=c);return V("div",{key:n,className:t.className,...y},l&&t.searchable!==!1?V("input",{type:"search",value:o,placeholder:e.interpolateText(t.placeholder||"Search address"),autoComplete:"off",onChange:S=>{const A=S.target.value;s(A),e.setSceneData(E=>({...E,[r]:A}))},style:{width:"100%",padding:"10px 12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text}}):null,...f.map((S,A)=>{const E=e.interpolateText(Hg(S,t.labelField,["name","title","label"])),w=e.interpolateText(Hg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]));return V("button",{key:S.id||`${n}-${A}`,type:"button",onClick:()=>!e.interactionDisabled&&x(S),disabled:e.interactionDisabled||void 0,"aria-label":`Select ${E||w||"place"}`,style:{display:"flex",alignItems:"center",gap:"10px",padding:"12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,cursor:e.interactionDisabled?"default":"pointer",textAlign:"left",...t.itemClassName?e.parseClassName(t.itemClassName):{}}},e.renderIcon("map-pin",18),V("span",{style:{display:"flex",flex:1,flexDirection:"column",gap:"3px",minWidth:0}},V("strong",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},E||w),E&&w?V("span",{style:{color:e.cfg.colors.textSecondary,fontSize:"13px"}},w):null))}),p?V("span",{style:{color:e.cfg.colors.textMuted,fontSize:"13px"}},t.emptyText||"No addresses found"):null)}const mT=new Map;function Gut(e){let t=mT.get(e);return t||(t=Jf.create(e),mT.set(e,t)),t}function Bt(e,t){if(!(e!=null&&e.motion)||!v.isValidElement(t))return t;const n=t,r=n.props,i=Gut(n.type);return v.createElement(i,{key:n.key,...r,initial:e.initial,animate:e.animate,exit:e.exit,transition:e.transition,variants:e.variants,whileHover:e.whileHover,whileTap:e.whileTap,whileFocus:e.whileFocus,whileInView:e.whileInView,layout:e.animateLayout},r==null?void 0:r.children)}function Wf(e,t,n,r=""){var s,l;const i=t,o=`${r}-${n}`;if(Array.isArray(i.hiddenOn)&&i.hiddenOn.includes(e.currentSceneId)||Array.isArray(i.visibleOn)&&!i.visibleOn.includes(e.currentSceneId)||i.condition&&e.evaluateCondition&&!e.evaluateCondition(i.condition,i.__conditionBase))return null;if(!Array.isArray(i.children)&&Array.isArray(i.components)&&(i.children=i.components),i.type==="custom"){const c=i.tagName||"div",h=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,i.className||"",o))??(i.className?e.parseClassName(i.className):{});i.rawStyle&&Object.assign(h,i.rawStyle);const u=e.getCommonProps(o,h,i),f=Array.isArray(i.children)?i.children.map((y,x)=>e.renderComponent(y,x,o)):[],m=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,exit:i.exit,transition:i.transition,variants:i.variants,whileHover:i.whileHover,whileTap:i.whileTap,whileFocus:i.whileFocus,whileInView:i.whileInView,animateLayout:i.animateLayout}:{};return V(c,{key:o,className:i.className,...u,...m},...f)}if(/^h[1-6]$/.test(i.type)||i.type==="p"||i.type==="span"||i.type==="label"||i.type==="blockquote"||i.type==="strong"||i.type==="em"||i.type==="li"||i.type==="figcaption"||i.type==="th"||i.type==="td"||i.type==="heading"||i.type==="paragraph"||i.type==="address"||i.type==="time"||i.type==="legend"||i.type==="caption"?i.type="text":i.type==="div"||i.type==="article"||i.type==="aside"||i.type==="main"||i.type==="figure"?i.type=i.children?"section":"text":i.type==="a"?i.type="link":i.type==="img"?i.type="image":i.type==="ul"||i.type==="ol"?i.type="list":i.type==="table"||i.type==="thead"||i.type==="tbody"||i.type==="tfoot"||i.type==="tr"?i.type="table":i.type==="br"?i.type="spacer":i.type==="hr"?i.type="divider":i.type==="details"||i.type==="summary"?i.type=i.children?"section":"text":i.type==="nav"?i.type="section":(i.type==="form"&&!i.fields||i.type==="listItem")&&(i.type=i.children?"section":"text"),i.type==="select"&&Array.isArray(i.options)&&typeof i.options[0]=="string"&&(i.options=i.options.map(c=>({label:c,value:c}))),i.type==="dropdown-button"&&!i.items&&i.options&&(i.items=Array.isArray(i.options)&&typeof i.options[0]=="string"?i.options.map(c=>({label:c,value:c})):i.options),(i.type==="input"||i.type==="textarea")&&!i.placeholder&&i.label&&(i.placeholder=i.label),e.imageReplacements&&e.imageReplacements.size>0){const c=e.imageReplacements.get(o);if(c&&c.url){const h={width:"100%",height:"auto",maxHeight:"300px",objectFit:"cover",borderRadius:"0.75rem"},u=e.getCommonProps(o,h,i),f=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,whileHover:i.whileHover,whileTap:i.whileTap,transition:i.transition,animateLayout:i.animateLayout}:{};return V("img",{key:`${o}-${c.url}`,src:c.url,alt:c.name||"Replacement image",...u,...f})}}switch(i.type){case"text":return Bt(i,uct(e,i,o));case"html":return Bt(i,fct(e,i,o));case"link":return Bt(i,dct(e,i,o));case"button":return Bt(i,pct(e,i,o));case"image":return Bt(i,mct(e,i,o));case"input":return Bt(i,gct(e,i,o));case"hidden":return Bt(i,yct(e,i,o));case"select":return Bt(i,vct(e,i,o));case"checkbox":return Bt(i,bct(e,i,o));case"card":return Bt(i,zut(e,i,o));case"section":case"container":case"cta_section":return Bt(i,Fut(e,i,o));case"header":return Bt(i,Uut(e,i,o));case"grid":case"features_grid":return Bt(i,Wut(e,i,o));case"hero":return Bt(i,Vut(e,i,o));case"footer":return Bt(i,Hut(e,i,o));case"spacer":return Bt(i,Oct(e,i,o));case"divider":return Bt(i,Mct(e,i,o));case"list":return Bt(i,vD(e,i,o));case"table":return Bt(i,xD(e,i,o));case"badge":return Bt(i,xct(e,i,o));case"tag":return Bt(i,wct(e,i,o));case"avatar":return Bt(i,_ct(e,i,o));case"progress":return Bt(i,Sct(e,i,o));case"recorder":return v.createElement(lut,{api:e,config:i,key:o});case"live-cast":return v.createElement(cut,{api:e,config:i,componentKey:o,key:o});case"tabs":return Bt(i,gD(e,i,o));case"accordion":return Bt(i,yD(e,i,o));case"bottom_nav":return Bt(i,out(e,i,o));case"split":return Bt(i,sut(e,i,o));case"theme_toggle":return Bt(i,aut(e,i,o));case"slider":case"carousel":return Bt(i,Tct(e,i,o));case"marquee":return Bt(i,Ect(e,i,o));case"camera":case"capture":return Bt(i,Cct(e,i,o));case"phaser_game":return Bt(i,((l=e.renderPhaserGame)==null?void 0:l.call(e,i,o))??null);case"search":return Bt(i,Pct(e,i,o));case"breadcrumb":return Bt(i,Act(e,i,o));case"form":return Bt(i,Xct(e,i,o));case"textarea":return Bt(i,$ct(e,i,o));case"diagnostics_chat":return Bt(i,v.createElement(hut,{api:e,config:i,componentKey:o}));case"icon":return Bt(i,Ict(e,i,o));case"markdown":return Bt(i,iut(e,i,o));case"dropdown-button":return Bt(i,Gct(e,i,o));case"widget":return Bt(i,Zct(e,i,o));case"advanced-select":return Bt(i,Yct(e,i,o));case"metric_display":return Bt(i,Rct(e,i,o));case"bar_chart":return Bt(i,Lct(e,i,o));case"line_chart":return Bt(i,Ug(e,i,o,!1));case"area_chart":return Bt(i,Ug(e,i,o,!0));case"pie_chart":return Bt(i,oT(e,i,o));case"donut_chart":return Bt(i,oT(e,i,o,!0));case"scatter_chart":return Bt(i,Nct(e,i,o));case"candlestick":return Bt(i,Ug(e,i,o,!1,!0));case"fx_ticker":return Bt(i,Dct(e,i,o));case"trading_view":return Bt(i,zct(e,i,o));case"loader":return Bt(i,kct(e,i,o));case"map":return v.createElement(jut,{api:e,config:i,componentKey:o,key:o});case"places":return v.createElement(qut,{api:e,config:i,componentKey:o,key:o});case"flow_diagram":return Bt(i,Fct(e,i,o));case"flow":return Bt(i,Vct(e,i,o));default:return Bt(i,Uct(e,i,o))}}function K$(e){const t=new Map,n=new Map;for(const r of e)if(r.type==="render_scene"&&r.route){const i=r.route.startsWith("/")?r.route:`/${r.route}`;t.set(r.id,i),n.set(i,r.id)}for(const r of e)if(r.type==="render_scene"&&!t.has(r.id)){const i=`/${r.id}`;t.set(r.id,i),n.set(i,r.id)}return{sceneToRoute:t,routeToScene:n}}function ab(e){if(typeof window>"u")return null;const t=window.location.hash;if(!t||t==="#")return null;const n=t.slice(1);return e.get(n)||null}function gT(e){return typeof window>"u"?null:e.get(window.location.pathname)||null}function Vf(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r)return;const i=`#${r}`;window.location.hash!==i&&(n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i))}function qg(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r||window.location.pathname===r)return;const i=`${r}${window.location.search}`;n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i)}const Zut=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1};async function Uf(e,t,n={},r){var i;try{const o=t.indexOf(".");if(o===-1)throw new Error(`Invalid SDK call syntax: ${t}`);const s=t.slice(0,o),l=t.slice(o+1),c=l.indexOf("(");if(c===-1)throw new Error(`Invalid SDK call syntax (missing parentheses): ${t}`);const h=l.slice(0,c),u=l.slice(c+1,-1),f=Yut(u,n);let m=e[s];if(!m)throw new Error(`Unknown SDK resource: ${String(s)}`);const y=h.split(".");for(let b=0;b<y.length-1;b++){const P=y[b];if(P&&(m=m[P],!m))throw new Error(`Unknown path ${y.slice(0,b+1).join(".")} on resource ${String(s)}`)}const x=y[y.length-1],p=m[x];if(typeof p!="function")throw new Error(`Unknown method ${x} on ${String(s)}.${y.slice(0,-1).join(".")}`);return await p.apply(m,f)}catch(o){throw Zut()&&console.error("[SDK Executor] Error:",o),(i=r==null?void 0:r.onError)==null||i.call(r,o),o}}function Yut(e,t){if(!e.trim())return[];const r=e.replace(/\{\{([\w.]+)\}\}/g,(i,o)=>{if(o==="now")return JSON.stringify(new Date().toISOString());const s=Xut(t,o);return s===void 0?"null":typeof s=="string"?`"${s}"`:JSON.stringify(s)}).replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":').replace(/'((?:[^'\\]|\\.)*)'/g,(i,o)=>`"${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`);try{return JSON.parse(`[${r}]`)}catch{return Kut(r).map(i=>{const o=i.trim();if(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))return o.slice(1,-1);if(!isNaN(Number(o)))return Number(o);if(o==="true")return!0;if(o==="false")return!1;if(o==="null")return null;try{return JSON.parse(o)}catch{return o}})}}function Kut(e){const t=[];let n="",r=0,i=null;for(let o=0;o<e.length;o++){const s=e[o],l=e[o-1];if((s==='"'||s==="'")&&l!=="\\"&&(i===s?i=null:i||(i=s)),!i&&((s==="{"||s==="["||s==="(")&&r++,(s==="}"||s==="]"||s===")")&&r--,s===","&&r===0)){t.push(n),n="";continue}n+=s}return n.trim()&&t.push(n),t}function Xut(e,t){const n=t.split(".");let r=e;for(const i of n){if(r==null)return;r=r[i]}return r}function _u(e){return e.startsWith("sdk:")}function su(e){return _u(e)?e.slice(4):e}function Jut(e,t,...n){const r=n.map(i=>typeof i=="string"?`'${i}'`:JSON.stringify(i)).join(", ");return`sdk:${e}.${t}(${r})`}function Qut(e,t){const n=new Map,r=(i,o)=>{o.size>0&&n.set(i,o)};return r("--bf-fd",e.flexDirection),r("--bf-gap",e.gap),r("--bf-w",e.width),r("--bf-min-h",e.minHeight),r("--bf-items",e.alignItems),r("--bf-justify",e.justifyContent),r("--bf-display",e.display),r("--bf-cols",e.gridCols),r("--bf-grid-template",e.gridTemplateColumns),r("--bf-text",e.textSize),r("--bf-radius",e.borderRadius),e.padding.p.size>0&&r("--bf-p",e.padding.p),e.padding.px.size>0&&r("--bf-px",e.padding.px),e.padding.py.size>0&&r("--bf-py",e.padding.py),e.margin.all.size>0&&r("--bf-m",e.margin.all),e.margin.t.size>0&&r("--bf-mt",e.margin.t),e.margin.r.size>0&&r("--bf-mr",e.margin.r),e.margin.b.size>0&&r("--bf-mb",e.margin.b),e.margin.l.size>0&&r("--bf-ml",e.margin.l),e.margin.x.size>0&&r("--bf-mx",e.margin.x),e.margin.y.size>0&&r("--bf-my",e.margin.y),n}function tht(e,t){const n=String(t).replace(/[^a-zA-Z0-9_-]/g,"_");return`${e}-${n}`}function X$(e,t,n){const r=Qut(n);if(r.size===0)return"";const i=`[data-bf-r="${e}-${t}"]`,o=[];for(const s of dC){if(s==="base")continue;const l=fC[s],c=[];for(const[h,u]of r)if(u.has(s)){const f=tht(h,t);c.push(` ${f}: ${u.get(s)};`)}c.length>0&&o.push(`@media (min-width: ${l}px) {
124
124
  ${i} {
125
125
  ${c.join(`
126
126
  `)}
127
127
  }
128
128
  }`)}return o.join(`
129
- `)}const eht={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},lb={transparent:"transparent",current:"currentColor",inherit:"inherit",black:"#000000",white:"#ffffff",primary:"#3b82f6",secondary:"#64748b",accent:"#ec4899",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"};for(const[e,t]of Object.entries(eht))for(const[n,r]of Object.entries(t))lb[`${e}-${n}`]=r;const he={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},nht={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1"},"6xl":{fontSize:"3.75rem",lineHeight:"1"},"7xl":{fontSize:"4.5rem",lineHeight:"1"},"8xl":{fontSize:"6rem",lineHeight:"1"},"9xl":{fontSize:"8rem",lineHeight:"1"}};function _x(e,t,n=!0){if(!e)return{};e=String(e);const{colorMode:r,...i}=t||{},o=r==="light",s=e.match(/(?:^|\s)dark:([^\s]+)/g)||[],l=e.replace(/(?:^|\s)dark:[^\s]+/g," ").replace(/\s+/g," ").trim();!o&&s.length?e=l?`${l} ${s.map(p=>p.trim().replace(/^dark:/,"")).join(" ")}`:s.map(p=>p.trim().replace(/^dark:/,"")).join(" "):e=l;const c=i?{...lb,...Object.fromEntries(Object.entries(i).filter(([,p])=>p))}:lb;o&&n&&(c.white="#000000",c.black="#ffffff",c["gray-300"]="#4b5563",c["gray-400"]="#374151",c["gray-500"]="#374151",c["gray-600"]="#1f2937",c["gray-700"]="#111827",c["gray-800"]="#0f172a",c["slate-300"]="#475569",c["slate-400"]="#334155",c["slate-500"]="#334155",c["slate-600"]="#1e293b");const h=e.split(/\s+/).filter(Boolean),u={};let f="",m="",y="",x="";for(let p of h){if(p.startsWith("hover:")||p.startsWith("focus:")||p.startsWith("active:")||p.startsWith("group-hover:")||p==="transition"||p==="transition-all"||p==="transition-colors"||p==="transition-opacity"||p==="transition-transform"||p.startsWith("duration-")||p.startsWith("ease-")||p==="cursor-pointer"||p==="grayscale"||((p.startsWith("sm:")||p.startsWith("md:")||p.startsWith("lg:")||p.startsWith("xl:")||p.startsWith("2xl:"))&&(p=p.replace(/^(sm:|md:|lg:|xl:|2xl:)/,"")),p.startsWith("placeholder-"))||p.startsWith("disabled:"))continue;const b=p.match(/^bg-\[([^\]]+)\]$/);if(b){const St=b[1];St.startsWith("url(")?u.backgroundImage=St:u.backgroundColor=St;continue}const P=p.match(/^text-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\)|hsl[a]?\([^)]+\))\]$/);if(P){u.color=P[1];continue}const S=p.match(/^text-\[(\d+(?:\.\d+)?(?:px|rem|em|%))\]$/);if(S){u.fontSize=S[1];continue}const A=p.match(/^w-\[([^\]]+)\]$/);if(A){u.width=A[1];continue}const E=p.match(/^h-\[([^\]]+)\]$/);if(E){u.height=E[1];continue}const w=p.match(/^min-w-\[([^\]]+)\]$/);if(w){u.minWidth=w[1];continue}const T=p.match(/^max-w-\[([^\]]+)\]$/);if(T){u.maxWidth=T[1];continue}const O=p.match(/^min-h-\[([^\]]+)\]$/);if(O){u.minHeight=O[1];continue}const I=p.match(/^max-h-\[([^\]]+)\]$/);if(I){u.maxHeight=I[1];continue}const N=p.match(/^p-\[([^\]]+)\]$/);if(N){u.padding=N[1];continue}const F=p.match(/^px-\[([^\]]+)\]$/);if(F){u.paddingLeft=F[1],u.paddingRight=F[1];continue}const D=p.match(/^py-\[([^\]]+)\]$/);if(D){u.paddingTop=D[1],u.paddingBottom=D[1];continue}const j=p.match(/^pt-\[([^\]]+)\]$/);if(j){u.paddingTop=j[1];continue}const K=p.match(/^pr-\[([^\]]+)\]$/);if(K){u.paddingRight=K[1];continue}const U=p.match(/^pb-\[([^\]]+)\]$/);if(U){u.paddingBottom=U[1];continue}const z=p.match(/^pl-\[([^\]]+)\]$/);if(z){u.paddingLeft=z[1];continue}const Y=p.match(/^m-\[([^\]]+)\]$/);if(Y){u.margin=Y[1];continue}const G=p.match(/^mx-\[([^\]]+)\]$/);if(G){u.marginLeft=G[1],u.marginRight=G[1];continue}const X=p.match(/^my-\[([^\]]+)\]$/);if(X){u.marginTop=X[1],u.marginBottom=X[1];continue}const lt=p.match(/^mt-\[([^\]]+)\]$/);if(lt){u.marginTop=lt[1];continue}const H=p.match(/^mr-\[([^\]]+)\]$/);if(H){u.marginRight=H[1];continue}const et=p.match(/^mb-\[([^\]]+)\]$/);if(et){u.marginBottom=et[1];continue}const it=p.match(/^ml-\[([^\]]+)\]$/);if(it){u.marginLeft=it[1];continue}const st=p.match(/^gap-\[([^\]]+)\]$/);if(st){u.gap=st[1];continue}const ct=p.match(/^gap-x-\[([^\]]+)\]$/);if(ct){u.columnGap=ct[1];continue}const yt=p.match(/^gap-y-\[([^\]]+)\]$/);if(yt){u.rowGap=yt[1];continue}const vt=p.match(/^rounded-\[([^\]]+)\]$/);if(vt){u.borderRadius=vt[1];continue}const Et=p.match(/^border-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\))\]$/);if(Et){u.borderColor=Et[1];continue}const Tt=p.match(/^border-\[(\d+(?:\.\d+)?(?:px)?)\]$/);if(Tt){u.borderWidth=Tt[1];continue}const ft=p.match(/^top-\[([^\]]+)\]$/);if(ft){u.top=ft[1];continue}const dt=p.match(/^right-\[([^\]]+)\]$/);if(dt){u.right=dt[1];continue}const Ct=p.match(/^bottom-\[([^\]]+)\]$/);if(Ct){u.bottom=Ct[1];continue}const nt=p.match(/^left-\[([^\]]+)\]$/);if(nt){u.left=nt[1];continue}const Lt=p.match(/^inset-\[([^\]]+)\]$/);if(Lt){u.inset=Lt[1];continue}const bt=p.match(/^z-\[([^\]]+)\]$/);if(bt){u.zIndex=parseInt(bt[1])||bt[1];continue}const me=p.match(/^opacity-\[([^\]]+)\]$/);if(me){u.opacity=parseFloat(me[1]);continue}const ie=p.match(/^leading-\[([^\]]+)\]$/);if(ie){u.lineHeight=ie[1];continue}if(p==="flex"){u.display="flex";continue}if(p==="grid"){u.display="grid";continue}if(p==="block"){u.display="block";continue}if(p==="inline"){u.display="inline";continue}if(p==="inline-flex"){u.display="inline-flex";continue}if(p==="inline-block"){u.display="inline-block";continue}if(p==="hidden"){u.display="none";continue}if(p==="flex-col"){u.flexDirection="column";continue}if(p==="flex-row"){u.flexDirection="row";continue}if(p==="flex-wrap"){u.flexWrap="wrap";continue}if(p==="flex-nowrap"){u.flexWrap="nowrap";continue}if(p==="flex-col-reverse"){u.flexDirection="column-reverse";continue}if(p==="flex-row-reverse"){u.flexDirection="row-reverse";continue}if(p==="flex-1"){u.flex="1 1 0%";continue}if(p==="flex-auto"){u.flex="1 1 auto";continue}if(p==="flex-initial"){u.flex="0 1 auto";continue}if(p==="flex-none"){u.flex="none";continue}if(p==="grow"){u.flexGrow=1;continue}if(p==="grow-0"){u.flexGrow=0;continue}if(p==="shrink"){u.flexShrink=1;continue}if(p==="shrink-0"){u.flexShrink=0;continue}if(p==="items-start"){u.alignItems="flex-start";continue}if(p==="items-center"){u.alignItems="center";continue}if(p==="items-end"){u.alignItems="flex-end";continue}if(p==="items-stretch"){u.alignItems="stretch";continue}if(p==="items-baseline"){u.alignItems="baseline";continue}if(p==="justify-start"){u.justifyContent="flex-start";continue}if(p==="justify-center"){u.justifyContent="center";continue}if(p==="justify-end"){u.justifyContent="flex-end";continue}if(p==="justify-between"){u.justifyContent="space-between";continue}if(p==="justify-around"){u.justifyContent="space-around";continue}if(p==="justify-evenly"){u.justifyContent="space-evenly";continue}if(p==="justify-items-start"){u.justifyItems="start";continue}if(p==="justify-items-center"){u.justifyItems="center";continue}if(p==="justify-items-end"){u.justifyItems="end";continue}if(p==="justify-items-stretch"){u.justifyItems="stretch";continue}if(p==="self-auto"){u.alignSelf="auto";continue}if(p==="self-start"){u.alignSelf="flex-start";continue}if(p==="self-center"){u.alignSelf="center";continue}if(p==="self-end"){u.alignSelf="flex-end";continue}if(p==="self-stretch"){u.alignSelf="stretch";continue}if(p==="self-baseline"){u.alignSelf="baseline";continue}if(p==="justify-self-auto"){u.justifySelf="auto";continue}if(p==="justify-self-start"){u.justifySelf="start";continue}if(p==="justify-self-center"){u.justifySelf="center";continue}if(p==="justify-self-end"){u.justifySelf="end";continue}if(p==="justify-self-stretch"){u.justifySelf="stretch";continue}if(p==="place-content-center"){u.placeContent="center";continue}if(p==="place-content-start"){u.placeContent="start";continue}if(p==="place-content-end"){u.placeContent="end";continue}if(p==="place-content-between"){u.placeContent="space-between";continue}if(p==="place-content-around"){u.placeContent="space-around";continue}if(p==="place-content-evenly"){u.placeContent="space-evenly";continue}if(p==="place-content-stretch"){u.placeContent="stretch";continue}if(p==="place-items-start"){u.placeItems="start";continue}if(p==="place-items-center"){u.placeItems="center";continue}if(p==="place-items-end"){u.placeItems="end";continue}if(p==="place-items-stretch"){u.placeItems="stretch";continue}if(p==="text-left"){u.textAlign="left";continue}if(p==="text-center"){u.textAlign="center";continue}if(p==="text-right"){u.textAlign="right";continue}if(p==="text-justify"){u.textAlign="justify";continue}if(p==="text-start"){u.textAlign="start";continue}if(p==="text-end"){u.textAlign="end";continue}if(p==="whitespace-normal"){u.whiteSpace="normal";continue}if(p==="whitespace-nowrap"){u.whiteSpace="nowrap";continue}if(p==="whitespace-pre"){u.whiteSpace="pre";continue}if(p==="whitespace-pre-line"){u.whiteSpace="pre-line";continue}if(p==="whitespace-pre-wrap"){u.whiteSpace="pre-wrap";continue}if(p==="whitespace-break-spaces"){u.whiteSpace="break-spaces";continue}if(p==="break-normal"){u.wordBreak="normal",u.overflowWrap="normal";continue}if(p==="break-words"){u.overflowWrap="break-word";continue}if(p==="break-all"){u.wordBreak="break-all";continue}if(p==="break-keep"){u.wordBreak="keep-all";continue}if(p==="truncate"){u.overflow="hidden",u.textOverflow="ellipsis",u.whiteSpace="nowrap";continue}if(p==="text-ellipsis"){u.textOverflow="ellipsis";continue}if(p==="text-clip"){u.textOverflow="clip";continue}if(p==="underline"){u.textDecoration="underline";continue}if(p==="overline"){u.textDecoration="overline";continue}if(p==="line-through"){u.textDecoration="line-through";continue}if(p==="no-underline"){u.textDecoration="none";continue}if(p==="uppercase"){u.textTransform="uppercase";continue}if(p==="lowercase"){u.textTransform="lowercase";continue}if(p==="capitalize"){u.textTransform="capitalize";continue}if(p==="normal-case"){u.textTransform="none";continue}if(p==="italic"){u.fontStyle="italic";continue}if(p==="not-italic"){u.fontStyle="normal";continue}if(p==="font-thin"){u.fontWeight=100;continue}if(p==="font-extralight"){u.fontWeight=200;continue}if(p==="font-light"){u.fontWeight=300;continue}if(p==="font-normal"){u.fontWeight=400;continue}if(p==="font-medium"){u.fontWeight=500;continue}if(p==="font-semibold"){u.fontWeight=600;continue}if(p==="font-bold"){u.fontWeight=700;continue}if(p==="font-extrabold"){u.fontWeight=800;continue}if(p==="font-black"){u.fontWeight=900;continue}if(p==="w-full"){u.width="100%";continue}if(p==="w-screen"){u.width="100vw";continue}if(p==="w-auto"){u.width="auto";continue}if(p==="w-fit"){u.width="fit-content";continue}if(p==="w-min"){u.width="min-content";continue}if(p==="w-max"){u.width="max-content";continue}const Xt=p.match(/^w-(\d+(?:\.\d+)?)$/);if(Xt){u.width=he[Xt[1]]||`${parseFloat(Xt[1])*.25}rem`;continue}const Ne=p.match(/^w-(\d+)\/(\d+)$/);if(Ne){const St=parseInt(Ne[1])/parseInt(Ne[2])*100;u.width=`${St}%`;continue}if(p==="h-full"){u.height="100%";continue}if(p==="h-screen"){u.height="100vh";continue}if(p==="h-auto"){u.height="auto";continue}if(p==="h-fit"){u.height="fit-content";continue}if(p==="h-min"){u.height="min-content";continue}if(p==="h-max"){u.height="max-content";continue}const Wt=p.match(/^h-(\d+(?:\.\d+)?)$/);if(Wt){u.height=he[Wt[1]]||`${parseFloat(Wt[1])*.25}rem`;continue}const ee=p.match(/^h-(\d+)\/(\d+)$/);if(ee){const St=parseInt(ee[1])/parseInt(ee[2])*100;u.height=`${St}%`;continue}if(p==="min-h-screen"){u.minHeight="100vh";continue}if(p==="min-h-full"){u.minHeight="100%";continue}if(p==="min-h-0"){u.minHeight="0";continue}if(p==="min-h-fit"){u.minHeight="fit-content";continue}const ne=p.match(/^min-h-(\d+(?:\.\d+)?)$/);if(ne){u.minHeight=he[ne[1]]||`${parseFloat(ne[1])*.25}rem`;continue}if(p==="min-w-0"){u.minWidth="0";continue}if(p==="min-w-full"){u.minWidth="100%";continue}if(p==="min-w-fit"){u.minWidth="fit-content";continue}const Yt=p.match(/^min-w-(\d+(?:\.\d+)?)$/);if(Yt){u.minWidth=he[Yt[1]]||`${parseFloat(Yt[1])*.25}rem`;continue}if(p==="max-w-none"){u.maxWidth="none";continue}if(p==="max-w-xs"){u.maxWidth="20rem";continue}if(p==="max-w-sm"){u.maxWidth="24rem";continue}if(p==="max-w-md"){u.maxWidth="28rem";continue}if(p==="max-w-lg"){u.maxWidth="32rem";continue}if(p==="max-w-xl"){u.maxWidth="36rem";continue}if(p==="max-w-2xl"){u.maxWidth="42rem";continue}if(p==="max-w-3xl"){u.maxWidth="48rem";continue}if(p==="max-w-4xl"){u.maxWidth="56rem";continue}if(p==="max-w-5xl"){u.maxWidth="64rem";continue}if(p==="max-w-6xl"){u.maxWidth="72rem";continue}if(p==="max-w-7xl"){u.maxWidth="80rem";continue}if(p==="max-w-full"){u.maxWidth="100%";continue}if(p==="max-w-prose"){u.maxWidth="65ch";continue}if(p==="max-w-screen-sm"){u.maxWidth="640px";continue}if(p==="max-w-screen-md"){u.maxWidth="768px";continue}if(p==="max-w-screen-lg"){u.maxWidth="1024px";continue}if(p==="max-w-screen-xl"){u.maxWidth="1280px";continue}if(p==="max-w-screen-2xl"){u.maxWidth="1536px";continue}if(p==="max-h-none"){u.maxHeight="none";continue}if(p==="max-h-full"){u.maxHeight="100%";continue}if(p==="max-h-screen"){u.maxHeight="100vh";continue}if(p==="max-h-fit"){u.maxHeight="fit-content";continue}const oe=p.match(/^max-h-(\d+(?:\.\d+)?)$/);if(oe){u.maxHeight=he[oe[1]]||`${parseFloat(oe[1])*.25}rem`;continue}if(p==="relative"){u.position="relative";continue}if(p==="absolute"){u.position="absolute";continue}if(p==="fixed"){u.position="fixed";continue}if(p==="sticky"){u.position="sticky";continue}if(p==="inset-0"){u.top="0",u.right="0",u.bottom="0",u.left="0";continue}if(p==="inset-auto"){u.top="auto",u.right="auto",u.bottom="auto",u.left="auto";continue}if(p==="inset-x-0"){u.left="0",u.right="0";continue}if(p==="inset-y-0"){u.top="0",u.bottom="0";continue}const Me=p.match(/^inset-(\d+(?:\.\d+)?)$/);if(Me){const St=he[Me[1]]||`${parseFloat(Me[1])*.25}rem`;u.top=St,u.right=St,u.bottom=St,u.left=St;continue}const se=p.match(/^inset-x-(\d+(?:\.\d+)?)$/);if(se){const St=he[se[1]]||`${parseFloat(se[1])*.25}rem`;u.left=St,u.right=St;continue}const on=p.match(/^inset-y-(\d+(?:\.\d+)?)$/);if(on){const St=he[on[1]]||`${parseFloat(on[1])*.25}rem`;u.top=St,u.bottom=St;continue}if(p==="top-0"){u.top="0";continue}if(p==="top-auto"){u.top="auto";continue}if(p==="top-full"){u.top="100%";continue}const en=p.match(/^top-(\d+(?:\.\d+)?)$/);if(en){u.top=he[en[1]]||`${parseFloat(en[1])*.25}rem`;continue}const Ke=p.match(/^-top-(\d+(?:\.\d+)?)$/);if(Ke){const St=he[Ke[1]]||`${parseFloat(Ke[1])*.25}rem`;u.top=`-${St}`;continue}if(p==="right-0"){u.right="0";continue}if(p==="right-auto"){u.right="auto";continue}if(p==="right-full"){u.right="100%";continue}const xo=p.match(/^right-(\d+(?:\.\d+)?)$/);if(xo){u.right=he[xo[1]]||`${parseFloat(xo[1])*.25}rem`;continue}const ln=p.match(/^-right-(\d+(?:\.\d+)?)$/);if(ln){const St=he[ln[1]]||`${parseFloat(ln[1])*.25}rem`;u.right=`-${St}`;continue}if(p==="bottom-0"){u.bottom="0";continue}if(p==="bottom-auto"){u.bottom="auto";continue}if(p==="bottom-full"){u.bottom="100%";continue}const kt=p.match(/^bottom-(\d+(?:\.\d+)?)$/);if(kt){u.bottom=he[kt[1]]||`${parseFloat(kt[1])*.25}rem`;continue}const Nn=p.match(/^-bottom-(\d+(?:\.\d+)?)$/);if(Nn){const St=he[Nn[1]]||`${parseFloat(Nn[1])*.25}rem`;u.bottom=`-${St}`;continue}if(p==="left-0"){u.left="0";continue}if(p==="left-auto"){u.left="auto";continue}if(p==="left-full"){u.left="100%";continue}const We=p.match(/^left-(\d+(?:\.\d+)?)$/);if(We){u.left=he[We[1]]||`${parseFloat(We[1])*.25}rem`;continue}const Ti=p.match(/^-left-(\d+(?:\.\d+)?)$/);if(Ti){const St=he[Ti[1]]||`${parseFloat(Ti[1])*.25}rem`;u.left=`-${St}`;continue}if(p==="overflow-hidden"){u.overflow="hidden";continue}if(p==="overflow-auto"){u.overflow="auto";continue}if(p==="overflow-scroll"){u.overflow="scroll";continue}if(p==="overflow-visible"){u.overflow="visible";continue}if(p==="overflow-x-auto"){u.overflowX="auto";continue}if(p==="overflow-y-auto"){u.overflowY="auto";continue}if(p==="overflow-x-hidden"){u.overflowX="hidden";continue}if(p==="overflow-y-hidden"){u.overflowY="hidden";continue}if(p==="overflow-x-scroll"){u.overflowX="scroll";continue}if(p==="overflow-y-scroll"){u.overflowY="scroll";continue}if(p==="object-cover"){u.objectFit="cover";continue}if(p==="object-contain"){u.objectFit="contain";continue}if(p==="object-fill"){u.objectFit="fill";continue}if(p==="object-center"){u.objectPosition="center";continue}if(p==="z-0"){u.zIndex=0;continue}if(p==="z-10"){u.zIndex=10;continue}if(p==="z-20"){u.zIndex=20;continue}if(p==="z-30"){u.zIndex=30;continue}if(p==="z-40"){u.zIndex=40;continue}if(p==="z-50"){u.zIndex=50;continue}const wo=p.match(/^opacity-(\d+)$/);if(wo){u.opacity=parseInt(wo[1])/100;continue}const _o=p.match(/^text-(xs|sm|base|lg|xl|[2-9]xl)$/);if(_o){const St=nht[_o[1]];St&&(u.fontSize=St.fontSize,u.lineHeight=St.lineHeight);continue}const de=p.match(/^text-([\w-]+)(?:\/([\d]+))?$/);if(de&&!p.startsWith("text-center")&&!p.startsWith("text-left")&&!p.startsWith("text-right")){const St=de[1],xe=de[2],le=o?c[St]:{black:"#e5e7eb","gray-600":"#9ca3af","gray-700":"#d1d5db","gray-800":"#e5e7eb","gray-900":"#f3f4f6","slate-700":"#cbd5e1","slate-800":"#e2e8f0","slate-900":"#f1f5f9"}[St]||c[St];le&&(xe?u.color=Fs(le,parseInt(xe)/100):u.color=le);continue}if(p==="bg-clip-text"){u.WebkitBackgroundClip="text",u.backgroundClip="text",u.WebkitTextFillColor="transparent";continue}if(p==="bg-fixed"){u.backgroundAttachment="fixed";continue}if(p==="bg-scroll"){u.backgroundAttachment="scroll";continue}const ae=p.match(/^bg-([\w-]+)(?:\/([\d]+))?$/);if(ae&&!p.startsWith("bg-gradient")){const St=ae[1],xe=ae[2],le=o?c[St]:{white:"#1f2937","gray-50":"#1f2937","gray-100":"#1f2937","gray-200":"#374151","gray-300":"#4b5563","slate-50":"#1f2937","slate-100":"#1f2937","slate-200":"#334155"}[St]||c[St];le&&(xe?u.backgroundColor=Fs(le,parseInt(xe)/100):u.backgroundColor=le);continue}if(p==="bg-gradient-to-t"){f="to top";continue}if(p==="bg-gradient-to-tr"){f="to top right";continue}if(p==="bg-gradient-to-r"){f="to right";continue}if(p==="bg-gradient-to-br"){f="to bottom right";continue}if(p==="bg-gradient-to-b"){f="to bottom";continue}if(p==="bg-gradient-to-bl"){f="to bottom left";continue}if(p==="bg-gradient-to-l"){f="to left";continue}if(p==="bg-gradient-to-tl"){f="to top left";continue}const Ei=p.match(/^from-([\w-]+)(?:\/([\d]+))?$/);if(Ei){const St=Ei[1],xe=Ei[2],Rt=c[St];Rt&&(m=xe?Fs(Rt,parseInt(xe)/100):Rt);continue}const Ci=p.match(/^via-([\w-]+)(?:\/([\d]+))?$/);if(Ci){const St=Ci[1],xe=Ci[2],Rt=c[St];Rt&&(y=xe?Fs(Rt,parseInt(xe)/100):Rt);continue}const Tr=p.match(/^to-([\w-]+)(?:\/([\d]+))?$/);if(Tr){const St=Tr[1],xe=Tr[2],Rt=c[St];Rt&&(x=xe?Fs(Rt,parseInt(xe)/100):Rt);continue}const Oi=p.match(/^p-(\d+(?:\.\d+)?)$/);if(Oi){u.padding=he[Oi[1]]||`${parseFloat(Oi[1])*.25}rem`;continue}const ds=p.match(/^px-(\d+(?:\.\d+)?)$/);if(ds){const St=he[ds[1]]||`${parseFloat(ds[1])*.25}rem`;u.paddingLeft=St,u.paddingRight=St;continue}const Mi=p.match(/^py-(\d+(?:\.\d+)?)$/);if(Mi){const St=he[Mi[1]]||`${parseFloat(Mi[1])*.25}rem`;u.paddingTop=St,u.paddingBottom=St;continue}const ii=p.match(/^pt-(\d+(?:\.\d+)?)$/);if(ii){u.paddingTop=he[ii[1]]||`${parseFloat(ii[1])*.25}rem`;continue}const ki=p.match(/^pr-(\d+(?:\.\d+)?)$/);if(ki){u.paddingRight=he[ki[1]]||`${parseFloat(ki[1])*.25}rem`;continue}const Vr=p.match(/^pb-(\d+(?:\.\d+)?)$/);if(Vr){u.paddingBottom=he[Vr[1]]||`${parseFloat(Vr[1])*.25}rem`;continue}const So=p.match(/^pl-(\d+(?:\.\d+)?)$/);if(So){u.paddingLeft=he[So[1]]||`${parseFloat(So[1])*.25}rem`;continue}const $i=p.match(/^m-(\d+(?:\.\d+)?)$/);if($i){u.margin=he[$i[1]]||`${parseFloat($i[1])*.25}rem`;continue}const Ii=p.match(/^mx-(\d+(?:\.\d+)?|auto)$/);if(Ii){const St=Ii[1]==="auto"?"auto":he[Ii[1]]||`${parseFloat(Ii[1])*.25}rem`;u.marginLeft=St,u.marginRight=St;continue}const Er=p.match(/^my-(\d+(?:\.\d+)?|auto)$/);if(Er){const St=Er[1]==="auto"?"auto":he[Er[1]]||`${parseFloat(Er[1])*.25}rem`;u.marginTop=St,u.marginBottom=St;continue}const Ri=p.match(/^mt-(\d+(?:\.\d+)?|auto)$/);if(Ri){u.marginTop=Ri[1]==="auto"?"auto":he[Ri[1]]||`${parseFloat(Ri[1])*.25}rem`;continue}const Li=p.match(/^mr-(\d+(?:\.\d+)?|auto)$/);if(Li){u.marginRight=Li[1]==="auto"?"auto":he[Li[1]]||`${parseFloat(Li[1])*.25}rem`;continue}const Cn=p.match(/^mb-(\d+(?:\.\d+)?)$/);if(Cn){u.marginBottom=he[Cn[1]]||`${parseFloat(Cn[1])*.25}rem`;continue}const It=p.match(/^ml-(\d+(?:\.\d+)?|auto)$/);if(It){u.marginLeft=It[1]==="auto"?"auto":he[It[1]]||`${parseFloat(It[1])*.25}rem`;continue}if(p==="mt-auto"){u.marginTop="auto";continue}const Po=p.match(/^gap-(\d+(?:\.\d+)?)$/);if(Po){u.gap=he[Po[1]]||`${parseFloat(Po[1])*.25}rem`;continue}const On=p.match(/^gap-x-(\d+(?:\.\d+)?)$/);if(On){u.columnGap=he[On[1]]||`${parseFloat(On[1])*.25}rem`;continue}const Ni=p.match(/^gap-y-(\d+(?:\.\d+)?)$/);if(Ni){u.rowGap=he[Ni[1]]||`${parseFloat(Ni[1])*.25}rem`;continue}const Ao=p.match(/^space-x-(\d+(?:\.\d+)?)$/);if(Ao){u.columnGap=he[Ao[1]]||`${parseFloat(Ao[1])*.25}rem`;continue}const oi=p.match(/^space-y-(\d+(?:\.\d+)?)$/);if(oi){u.rowGap=he[oi[1]]||`${parseFloat(oi[1])*.25}rem`;continue}const ji=p.match(/^space-x-\[([^\]]+)\]$/);if(ji){u.columnGap=ji[1];continue}const ur=p.match(/^space-y-\[([^\]]+)\]$/);if(ur){u.rowGap=ur[1];continue}const Di=p.match(/^grid-cols-(\d+)$/);if(Di){u.gridTemplateColumns=`repeat(${Di[1]}, minmax(0, 1fr))`;continue}if(p==="rounded"){u.borderRadius="0.25rem";continue}if(p==="rounded-none"){u.borderRadius="0";continue}if(p==="rounded-sm"){u.borderRadius="0.125rem";continue}if(p==="rounded-md"){u.borderRadius="0.375rem";continue}if(p==="rounded-lg"){u.borderRadius="0.5rem";continue}if(p==="rounded-xl"){u.borderRadius="0.75rem";continue}if(p==="rounded-2xl"){u.borderRadius="1rem";continue}if(p==="rounded-3xl"){u.borderRadius="1.5rem";continue}if(p==="rounded-full"){u.borderRadius="9999px";continue}if(p==="border"){u.borderWidth="1px",u.borderStyle="solid";continue}if(p==="border-0"){u.borderWidth="0";continue}if(p==="border-2"){u.borderWidth="2px",u.borderStyle="solid";continue}if(p==="border-t"){u.borderTopWidth="1px",u.borderStyle="solid";continue}if(p==="border-b"){u.borderBottomWidth="1px",u.borderStyle="solid";continue}if(p==="border-l"){u.borderLeftWidth="1px",u.borderStyle="solid";continue}if(p==="border-r"){u.borderRightWidth="1px",u.borderStyle="solid";continue}const ps=p.match(/^border-t-(\d+)$/);if(ps){u.borderTopWidth=`${ps[1]}px`,u.borderStyle="solid";continue}const Ur=p.match(/^border-b-(\d+)$/);if(Ur){u.borderBottomWidth=`${Ur[1]}px`,u.borderStyle="solid";continue}const To=p.match(/^border-l-(\d+)$/);if(To){u.borderLeftWidth=`${To[1]}px`,u.borderStyle="solid";continue}const ms=p.match(/^border-r-(\d+)$/);if(ms){u.borderRightWidth=`${ms[1]}px`,u.borderStyle="solid";continue}const gs=p.match(/^border-(\d+)$/);if(gs){u.borderWidth=`${gs[1]}px`,u.borderStyle="solid";continue}const ys=p.match(/^border-([\w-]+)(?:\/([\d]+))?$/);if(ys&&!p.match(/^border-[trbl]$/)){const St=ys[1],xe=ys[2],le=o?c[St]:{white:"#374151","gray-100":"#374151","gray-200":"#374151","gray-300":"#4b5563","slate-100":"#334155","slate-200":"#334155","slate-300":"#475569"}[St]||c[St];le&&(u.borderColor=xe?Fs(le,parseInt(xe)/100):le);continue}if(p==="shadow"){u.boxShadow="0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-sm"){u.boxShadow="0 1px 2px 0 rgb(0 0 0 / 0.05)";continue}if(p==="shadow-md"){u.boxShadow="0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-lg"){u.boxShadow="0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-xl"){u.boxShadow="0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-2xl"){u.boxShadow="0 25px 50px -12px rgb(0 0 0 / 0.25)";continue}if(p==="shadow-none"){u.boxShadow="none";continue}if(p==="ring"){u.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-0"){u.boxShadow="0 0 0 0px transparent";continue}if(p==="ring-1"){u.boxShadow="0 0 0 1px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-2"){u.boxShadow="0 0 0 2px rgba(59, 130, 246, 0.5)";continue}const Te=p.match(/^ring-([\w-]+)(?:\/([\d]+))?$/);if(Te&&!p.match(/^ring-\d$/)){const St=Te[1],xe=Te[2],Rt=c[St];if(Rt){const le=xe?parseInt(xe)/100:1;u.boxShadow&&u.boxShadow.includes("0 0 0")&&(u.boxShadow=u.boxShadow.replace(/rgba\([^)]+\)/,Fs(Rt,le)))}continue}if(p==="backdrop-blur"){u.backdropFilter="blur(8px)";continue}if(p==="backdrop-blur-none"){u.backdropFilter="blur(0)";continue}if(p==="backdrop-blur-sm"){u.backdropFilter="blur(4px)";continue}if(p==="backdrop-blur-md"){u.backdropFilter="blur(12px)";continue}if(p==="backdrop-blur-lg"){u.backdropFilter="blur(16px)";continue}if(p==="backdrop-blur-xl"){u.backdropFilter="blur(24px)";continue}if(p==="backdrop-blur-2xl"){u.backdropFilter="blur(40px)";continue}if(p==="backdrop-blur-3xl"){u.backdropFilter="blur(64px)";continue}if(p==="blur"){u.filter="blur(8px)";continue}if(p==="blur-none"){u.filter="blur(0)";continue}if(p==="blur-sm"){u.filter="blur(4px)";continue}if(p==="blur-md"){u.filter="blur(12px)";continue}if(p==="blur-lg"){u.filter="blur(16px)";continue}if(p==="blur-xl"){u.filter="blur(24px)";continue}if(p==="blur-2xl"){u.filter="blur(40px)";continue}if(p==="blur-3xl"){u.filter="blur(64px)";continue}const cn=p.match(/^scale-(\d+)$/);if(cn){const St=parseInt(cn[1])/100;u.transform=`scale(${St})`;continue}const Ea=p.match(/^scale-x-(\d+)$/);if(Ea){const St=parseInt(Ea[1])/100;u.transform=`scaleX(${St})`;continue}const vs=p.match(/^scale-y-(\d+)$/);if(vs){const St=parseInt(vs[1])/100;u.transform=`scaleY(${St})`;continue}const bs=p.match(/^rotate-(\d+)$/);if(bs){u.transform=`rotate(${bs[1]}deg)`;continue}const Bi=p.match(/^-rotate-(\d+)$/);if(Bi){u.transform=`rotate(-${Bi[1]}deg)`;continue}const Sn=p.match(/^translate-x-(\d+(?:\.\d+)?)$/);if(Sn){const St=he[Sn[1]]||`${parseFloat(Sn[1])*.25}rem`;u.transform=`translateX(${St})`;continue}const Xn=p.match(/^-translate-x-(\d+(?:\.\d+)?)$/);if(Xn){const St=he[Xn[1]]||`${parseFloat(Xn[1])*.25}rem`;u.transform=`translateX(-${St})`;continue}const Eo=p.match(/^translate-y-(\d+(?:\.\d+)?)$/);if(Eo){const St=he[Eo[1]]||`${parseFloat(Eo[1])*.25}rem`;u.transform=`translateY(${St})`;continue}const si=p.match(/^-translate-y-(\d+(?:\.\d+)?)$/);if(si){const St=he[si[1]]||`${parseFloat(si[1])*.25}rem`;u.transform=`translateY(-${St})`;continue}if(p==="translate-x-full"){u.transform="translateX(100%)";continue}if(p==="-translate-x-full"){u.transform="translateX(-100%)";continue}if(p==="translate-y-full"){u.transform="translateY(100%)";continue}if(p==="-translate-y-full"){u.transform="translateY(-100%)";continue}if(p==="translate-x-1/2"){u.transform="translateX(50%)";continue}if(p==="-translate-x-1/2"){u.transform="translateX(-50%)";continue}if(p==="translate-y-1/2"){u.transform="translateY(50%)";continue}if(p==="-translate-y-1/2"){u.transform="translateY(-50%)";continue}if(p.startsWith("animate-")||p.startsWith("divide-")||p.startsWith("group-"))continue;if(p==="leading-none"){u.lineHeight="1";continue}if(p==="leading-tight"){u.lineHeight="1.25";continue}if(p==="leading-snug"){u.lineHeight="1.375";continue}if(p==="leading-normal"){u.lineHeight="1.5";continue}if(p==="leading-relaxed"){u.lineHeight="1.625";continue}if(p==="leading-loose"){u.lineHeight="2";continue}if(p==="tracking-tighter"){u.letterSpacing="-0.05em";continue}if(p==="tracking-tight"){u.letterSpacing="-0.025em";continue}if(p==="tracking-normal"){u.letterSpacing="0em";continue}if(p==="tracking-wide"){u.letterSpacing="0.025em";continue}if(p==="tracking-wider"){u.letterSpacing="0.05em";continue}if(p==="tracking-widest"){u.letterSpacing="0.1em";continue}const Mn=p.match(/^tracking-\[(.+)\]$/);if(Mn){u.letterSpacing=Mn[1];continue}const re=p.match(/^w-\[(.+)\]$/);if(re){u.width=re[1];continue}const Kt=p.match(/^h-\[(.+)\]$/);if(Kt){u.height=Kt[1];continue}const hr=p.match(/^min-h-\[(.+)\]$/);if(hr){u.minHeight=hr[1];continue}const be=p.match(/^max-w-\[(.+)\]$/);if(be){u.maxWidth=be[1];continue}}return f&&m&&(y?u.backgroundImage=`linear-gradient(${f}, ${m}, ${y}, ${x||m})`:x?u.backgroundImage=`linear-gradient(${f}, ${m}, ${x})`:u.backgroundImage=`linear-gradient(${f}, ${m}, transparent)`),u}function Fs(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${i}, ${t})`}const yT={margin:0,padding:0,boxSizing:"border-box",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"};function rht(e){return`
129
+ `)}const eht={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},lb={transparent:"transparent",current:"currentColor",inherit:"inherit",black:"#000000",white:"#ffffff",primary:"#3b82f6",secondary:"#64748b",accent:"#ec4899",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"};for(const[e,t]of Object.entries(eht))for(const[n,r]of Object.entries(t))lb[`${e}-${n}`]=r;const he={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},nht={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1"},"6xl":{fontSize:"3.75rem",lineHeight:"1"},"7xl":{fontSize:"4.5rem",lineHeight:"1"},"8xl":{fontSize:"6rem",lineHeight:"1"},"9xl":{fontSize:"8rem",lineHeight:"1"}};function _x(e,t,n=!0){if(!e)return{};e=String(e);const{colorMode:r,...i}=t||{},o=r==="light",s=e.match(/(?:^|\s)dark:([^\s]+)/g)||[],l=e.replace(/(?:^|\s)dark:[^\s]+/g," ").replace(/\s+/g," ").trim();!o&&s.length?e=l?`${l} ${s.map(p=>p.trim().replace(/^dark:/,"")).join(" ")}`:s.map(p=>p.trim().replace(/^dark:/,"")).join(" "):e=l;const c=i?{...lb,...Object.fromEntries(Object.entries(i).filter(([,p])=>p))}:lb;o&&n&&(c.white="#000000",c.black="#ffffff",c["gray-300"]="#4b5563",c["gray-400"]="#374151",c["gray-500"]="#374151",c["gray-600"]="#1f2937",c["gray-700"]="#111827",c["gray-800"]="#0f172a",c["slate-300"]="#475569",c["slate-400"]="#334155",c["slate-500"]="#334155",c["slate-600"]="#1e293b");const h=e.split(/\s+/).filter(Boolean),u={};let f="",m="",y="",x="";for(let p of h){if(p.startsWith("hover:")||p.startsWith("focus:")||p.startsWith("active:")||p.startsWith("group-hover:")||p==="transition"||p==="transition-all"||p==="transition-colors"||p==="transition-opacity"||p==="transition-transform"||p.startsWith("duration-")||p.startsWith("ease-")||p==="cursor-pointer"||p==="grayscale"||((p.startsWith("sm:")||p.startsWith("md:")||p.startsWith("lg:")||p.startsWith("xl:")||p.startsWith("2xl:"))&&(p=p.replace(/^(sm:|md:|lg:|xl:|2xl:)/,"")),p.startsWith("placeholder-"))||p.startsWith("disabled:"))continue;const b=p.match(/^bg-\[([^\]]+)\]$/);if(b){const St=b[1];St.startsWith("url(")?u.backgroundImage=St:u.backgroundColor=St;continue}const P=p.match(/^text-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\)|hsl[a]?\([^)]+\))\]$/);if(P){u.color=P[1];continue}const S=p.match(/^text-\[(\d+(?:\.\d+)?(?:px|rem|em|%))\]$/);if(S){u.fontSize=S[1];continue}const A=p.match(/^w-\[([^\]]+)\]$/);if(A){u.width=A[1];continue}const E=p.match(/^h-\[([^\]]+)\]$/);if(E){u.height=E[1];continue}const w=p.match(/^min-w-\[([^\]]+)\]$/);if(w){u.minWidth=w[1];continue}const T=p.match(/^max-w-\[([^\]]+)\]$/);if(T){u.maxWidth=T[1];continue}const O=p.match(/^min-h-\[([^\]]+)\]$/);if(O){u.minHeight=O[1];continue}const I=p.match(/^max-h-\[([^\]]+)\]$/);if(I){u.maxHeight=I[1];continue}const N=p.match(/^p-\[([^\]]+)\]$/);if(N){u.padding=N[1];continue}const F=p.match(/^px-\[([^\]]+)\]$/);if(F){u.paddingLeft=F[1],u.paddingRight=F[1];continue}const D=p.match(/^py-\[([^\]]+)\]$/);if(D){u.paddingTop=D[1],u.paddingBottom=D[1];continue}const j=p.match(/^pt-\[([^\]]+)\]$/);if(j){u.paddingTop=j[1];continue}const K=p.match(/^pr-\[([^\]]+)\]$/);if(K){u.paddingRight=K[1];continue}const U=p.match(/^pb-\[([^\]]+)\]$/);if(U){u.paddingBottom=U[1];continue}const z=p.match(/^pl-\[([^\]]+)\]$/);if(z){u.paddingLeft=z[1];continue}const Y=p.match(/^m-\[([^\]]+)\]$/);if(Y){u.margin=Y[1];continue}const G=p.match(/^mx-\[([^\]]+)\]$/);if(G){u.marginLeft=G[1],u.marginRight=G[1];continue}const X=p.match(/^my-\[([^\]]+)\]$/);if(X){u.marginTop=X[1],u.marginBottom=X[1];continue}const lt=p.match(/^mt-\[([^\]]+)\]$/);if(lt){u.marginTop=lt[1];continue}const H=p.match(/^mr-\[([^\]]+)\]$/);if(H){u.marginRight=H[1];continue}const et=p.match(/^mb-\[([^\]]+)\]$/);if(et){u.marginBottom=et[1];continue}const it=p.match(/^ml-\[([^\]]+)\]$/);if(it){u.marginLeft=it[1];continue}const at=p.match(/^gap-\[([^\]]+)\]$/);if(at){u.gap=at[1];continue}const ct=p.match(/^gap-x-\[([^\]]+)\]$/);if(ct){u.columnGap=ct[1];continue}const yt=p.match(/^gap-y-\[([^\]]+)\]$/);if(yt){u.rowGap=yt[1];continue}const vt=p.match(/^rounded-\[([^\]]+)\]$/);if(vt){u.borderRadius=vt[1];continue}const Et=p.match(/^border-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\))\]$/);if(Et){u.borderColor=Et[1];continue}const Tt=p.match(/^border-\[(\d+(?:\.\d+)?(?:px)?)\]$/);if(Tt){u.borderWidth=Tt[1];continue}const ft=p.match(/^top-\[([^\]]+)\]$/);if(ft){u.top=ft[1];continue}const dt=p.match(/^right-\[([^\]]+)\]$/);if(dt){u.right=dt[1];continue}const Ct=p.match(/^bottom-\[([^\]]+)\]$/);if(Ct){u.bottom=Ct[1];continue}const nt=p.match(/^left-\[([^\]]+)\]$/);if(nt){u.left=nt[1];continue}const Lt=p.match(/^inset-\[([^\]]+)\]$/);if(Lt){u.inset=Lt[1];continue}const bt=p.match(/^z-\[([^\]]+)\]$/);if(bt){u.zIndex=parseInt(bt[1])||bt[1];continue}const me=p.match(/^opacity-\[([^\]]+)\]$/);if(me){u.opacity=parseFloat(me[1]);continue}const ie=p.match(/^leading-\[([^\]]+)\]$/);if(ie){u.lineHeight=ie[1];continue}if(p==="flex"){u.display="flex";continue}if(p==="grid"){u.display="grid";continue}if(p==="block"){u.display="block";continue}if(p==="inline"){u.display="inline";continue}if(p==="inline-flex"){u.display="inline-flex";continue}if(p==="inline-block"){u.display="inline-block";continue}if(p==="hidden"){u.display="none";continue}if(p==="flex-col"){u.flexDirection="column";continue}if(p==="flex-row"){u.flexDirection="row";continue}if(p==="flex-wrap"){u.flexWrap="wrap";continue}if(p==="flex-nowrap"){u.flexWrap="nowrap";continue}if(p==="flex-col-reverse"){u.flexDirection="column-reverse";continue}if(p==="flex-row-reverse"){u.flexDirection="row-reverse";continue}if(p==="flex-1"){u.flex="1 1 0%";continue}if(p==="flex-auto"){u.flex="1 1 auto";continue}if(p==="flex-initial"){u.flex="0 1 auto";continue}if(p==="flex-none"){u.flex="none";continue}if(p==="grow"){u.flexGrow=1;continue}if(p==="grow-0"){u.flexGrow=0;continue}if(p==="shrink"){u.flexShrink=1;continue}if(p==="shrink-0"){u.flexShrink=0;continue}if(p==="items-start"){u.alignItems="flex-start";continue}if(p==="items-center"){u.alignItems="center";continue}if(p==="items-end"){u.alignItems="flex-end";continue}if(p==="items-stretch"){u.alignItems="stretch";continue}if(p==="items-baseline"){u.alignItems="baseline";continue}if(p==="justify-start"){u.justifyContent="flex-start";continue}if(p==="justify-center"){u.justifyContent="center";continue}if(p==="justify-end"){u.justifyContent="flex-end";continue}if(p==="justify-between"){u.justifyContent="space-between";continue}if(p==="justify-around"){u.justifyContent="space-around";continue}if(p==="justify-evenly"){u.justifyContent="space-evenly";continue}if(p==="justify-items-start"){u.justifyItems="start";continue}if(p==="justify-items-center"){u.justifyItems="center";continue}if(p==="justify-items-end"){u.justifyItems="end";continue}if(p==="justify-items-stretch"){u.justifyItems="stretch";continue}if(p==="self-auto"){u.alignSelf="auto";continue}if(p==="self-start"){u.alignSelf="flex-start";continue}if(p==="self-center"){u.alignSelf="center";continue}if(p==="self-end"){u.alignSelf="flex-end";continue}if(p==="self-stretch"){u.alignSelf="stretch";continue}if(p==="self-baseline"){u.alignSelf="baseline";continue}if(p==="justify-self-auto"){u.justifySelf="auto";continue}if(p==="justify-self-start"){u.justifySelf="start";continue}if(p==="justify-self-center"){u.justifySelf="center";continue}if(p==="justify-self-end"){u.justifySelf="end";continue}if(p==="justify-self-stretch"){u.justifySelf="stretch";continue}if(p==="place-content-center"){u.placeContent="center";continue}if(p==="place-content-start"){u.placeContent="start";continue}if(p==="place-content-end"){u.placeContent="end";continue}if(p==="place-content-between"){u.placeContent="space-between";continue}if(p==="place-content-around"){u.placeContent="space-around";continue}if(p==="place-content-evenly"){u.placeContent="space-evenly";continue}if(p==="place-content-stretch"){u.placeContent="stretch";continue}if(p==="place-items-start"){u.placeItems="start";continue}if(p==="place-items-center"){u.placeItems="center";continue}if(p==="place-items-end"){u.placeItems="end";continue}if(p==="place-items-stretch"){u.placeItems="stretch";continue}if(p==="text-left"){u.textAlign="left";continue}if(p==="text-center"){u.textAlign="center";continue}if(p==="text-right"){u.textAlign="right";continue}if(p==="text-justify"){u.textAlign="justify";continue}if(p==="text-start"){u.textAlign="start";continue}if(p==="text-end"){u.textAlign="end";continue}if(p==="whitespace-normal"){u.whiteSpace="normal";continue}if(p==="whitespace-nowrap"){u.whiteSpace="nowrap";continue}if(p==="whitespace-pre"){u.whiteSpace="pre";continue}if(p==="whitespace-pre-line"){u.whiteSpace="pre-line";continue}if(p==="whitespace-pre-wrap"){u.whiteSpace="pre-wrap";continue}if(p==="whitespace-break-spaces"){u.whiteSpace="break-spaces";continue}if(p==="break-normal"){u.wordBreak="normal",u.overflowWrap="normal";continue}if(p==="break-words"){u.overflowWrap="break-word";continue}if(p==="break-all"){u.wordBreak="break-all";continue}if(p==="break-keep"){u.wordBreak="keep-all";continue}if(p==="truncate"){u.overflow="hidden",u.textOverflow="ellipsis",u.whiteSpace="nowrap";continue}if(p==="text-ellipsis"){u.textOverflow="ellipsis";continue}if(p==="text-clip"){u.textOverflow="clip";continue}if(p==="underline"){u.textDecoration="underline";continue}if(p==="overline"){u.textDecoration="overline";continue}if(p==="line-through"){u.textDecoration="line-through";continue}if(p==="no-underline"){u.textDecoration="none";continue}if(p==="uppercase"){u.textTransform="uppercase";continue}if(p==="lowercase"){u.textTransform="lowercase";continue}if(p==="capitalize"){u.textTransform="capitalize";continue}if(p==="normal-case"){u.textTransform="none";continue}if(p==="italic"){u.fontStyle="italic";continue}if(p==="not-italic"){u.fontStyle="normal";continue}if(p==="font-thin"){u.fontWeight=100;continue}if(p==="font-extralight"){u.fontWeight=200;continue}if(p==="font-light"){u.fontWeight=300;continue}if(p==="font-normal"){u.fontWeight=400;continue}if(p==="font-medium"){u.fontWeight=500;continue}if(p==="font-semibold"){u.fontWeight=600;continue}if(p==="font-bold"){u.fontWeight=700;continue}if(p==="font-extrabold"){u.fontWeight=800;continue}if(p==="font-black"){u.fontWeight=900;continue}if(p==="w-full"){u.width="100%";continue}if(p==="w-screen"){u.width="100vw";continue}if(p==="w-auto"){u.width="auto";continue}if(p==="w-fit"){u.width="fit-content";continue}if(p==="w-min"){u.width="min-content";continue}if(p==="w-max"){u.width="max-content";continue}const Xt=p.match(/^w-(\d+(?:\.\d+)?)$/);if(Xt){u.width=he[Xt[1]]||`${parseFloat(Xt[1])*.25}rem`;continue}const Ne=p.match(/^w-(\d+)\/(\d+)$/);if(Ne){const St=parseInt(Ne[1])/parseInt(Ne[2])*100;u.width=`${St}%`;continue}if(p==="h-full"){u.height="100%";continue}if(p==="h-screen"){u.height="100vh";continue}if(p==="h-auto"){u.height="auto";continue}if(p==="h-fit"){u.height="fit-content";continue}if(p==="h-min"){u.height="min-content";continue}if(p==="h-max"){u.height="max-content";continue}const Wt=p.match(/^h-(\d+(?:\.\d+)?)$/);if(Wt){u.height=he[Wt[1]]||`${parseFloat(Wt[1])*.25}rem`;continue}const ee=p.match(/^h-(\d+)\/(\d+)$/);if(ee){const St=parseInt(ee[1])/parseInt(ee[2])*100;u.height=`${St}%`;continue}if(p==="min-h-screen"){u.minHeight="100vh";continue}if(p==="min-h-full"){u.minHeight="100%";continue}if(p==="min-h-0"){u.minHeight="0";continue}if(p==="min-h-fit"){u.minHeight="fit-content";continue}const ne=p.match(/^min-h-(\d+(?:\.\d+)?)$/);if(ne){u.minHeight=he[ne[1]]||`${parseFloat(ne[1])*.25}rem`;continue}if(p==="min-w-0"){u.minWidth="0";continue}if(p==="min-w-full"){u.minWidth="100%";continue}if(p==="min-w-fit"){u.minWidth="fit-content";continue}const Yt=p.match(/^min-w-(\d+(?:\.\d+)?)$/);if(Yt){u.minWidth=he[Yt[1]]||`${parseFloat(Yt[1])*.25}rem`;continue}if(p==="max-w-none"){u.maxWidth="none";continue}if(p==="max-w-xs"){u.maxWidth="20rem";continue}if(p==="max-w-sm"){u.maxWidth="24rem";continue}if(p==="max-w-md"){u.maxWidth="28rem";continue}if(p==="max-w-lg"){u.maxWidth="32rem";continue}if(p==="max-w-xl"){u.maxWidth="36rem";continue}if(p==="max-w-2xl"){u.maxWidth="42rem";continue}if(p==="max-w-3xl"){u.maxWidth="48rem";continue}if(p==="max-w-4xl"){u.maxWidth="56rem";continue}if(p==="max-w-5xl"){u.maxWidth="64rem";continue}if(p==="max-w-6xl"){u.maxWidth="72rem";continue}if(p==="max-w-7xl"){u.maxWidth="80rem";continue}if(p==="max-w-full"){u.maxWidth="100%";continue}if(p==="max-w-prose"){u.maxWidth="65ch";continue}if(p==="max-w-screen-sm"){u.maxWidth="640px";continue}if(p==="max-w-screen-md"){u.maxWidth="768px";continue}if(p==="max-w-screen-lg"){u.maxWidth="1024px";continue}if(p==="max-w-screen-xl"){u.maxWidth="1280px";continue}if(p==="max-w-screen-2xl"){u.maxWidth="1536px";continue}if(p==="max-h-none"){u.maxHeight="none";continue}if(p==="max-h-full"){u.maxHeight="100%";continue}if(p==="max-h-screen"){u.maxHeight="100vh";continue}if(p==="max-h-fit"){u.maxHeight="fit-content";continue}const oe=p.match(/^max-h-(\d+(?:\.\d+)?)$/);if(oe){u.maxHeight=he[oe[1]]||`${parseFloat(oe[1])*.25}rem`;continue}if(p==="relative"){u.position="relative";continue}if(p==="absolute"){u.position="absolute";continue}if(p==="fixed"){u.position="fixed";continue}if(p==="sticky"){u.position="sticky";continue}if(p==="inset-0"){u.top="0",u.right="0",u.bottom="0",u.left="0";continue}if(p==="inset-auto"){u.top="auto",u.right="auto",u.bottom="auto",u.left="auto";continue}if(p==="inset-x-0"){u.left="0",u.right="0";continue}if(p==="inset-y-0"){u.top="0",u.bottom="0";continue}const Me=p.match(/^inset-(\d+(?:\.\d+)?)$/);if(Me){const St=he[Me[1]]||`${parseFloat(Me[1])*.25}rem`;u.top=St,u.right=St,u.bottom=St,u.left=St;continue}const se=p.match(/^inset-x-(\d+(?:\.\d+)?)$/);if(se){const St=he[se[1]]||`${parseFloat(se[1])*.25}rem`;u.left=St,u.right=St;continue}const on=p.match(/^inset-y-(\d+(?:\.\d+)?)$/);if(on){const St=he[on[1]]||`${parseFloat(on[1])*.25}rem`;u.top=St,u.bottom=St;continue}if(p==="top-0"){u.top="0";continue}if(p==="top-auto"){u.top="auto";continue}if(p==="top-full"){u.top="100%";continue}const en=p.match(/^top-(\d+(?:\.\d+)?)$/);if(en){u.top=he[en[1]]||`${parseFloat(en[1])*.25}rem`;continue}const Ke=p.match(/^-top-(\d+(?:\.\d+)?)$/);if(Ke){const St=he[Ke[1]]||`${parseFloat(Ke[1])*.25}rem`;u.top=`-${St}`;continue}if(p==="right-0"){u.right="0";continue}if(p==="right-auto"){u.right="auto";continue}if(p==="right-full"){u.right="100%";continue}const xo=p.match(/^right-(\d+(?:\.\d+)?)$/);if(xo){u.right=he[xo[1]]||`${parseFloat(xo[1])*.25}rem`;continue}const ln=p.match(/^-right-(\d+(?:\.\d+)?)$/);if(ln){const St=he[ln[1]]||`${parseFloat(ln[1])*.25}rem`;u.right=`-${St}`;continue}if(p==="bottom-0"){u.bottom="0";continue}if(p==="bottom-auto"){u.bottom="auto";continue}if(p==="bottom-full"){u.bottom="100%";continue}const kt=p.match(/^bottom-(\d+(?:\.\d+)?)$/);if(kt){u.bottom=he[kt[1]]||`${parseFloat(kt[1])*.25}rem`;continue}const Nn=p.match(/^-bottom-(\d+(?:\.\d+)?)$/);if(Nn){const St=he[Nn[1]]||`${parseFloat(Nn[1])*.25}rem`;u.bottom=`-${St}`;continue}if(p==="left-0"){u.left="0";continue}if(p==="left-auto"){u.left="auto";continue}if(p==="left-full"){u.left="100%";continue}const We=p.match(/^left-(\d+(?:\.\d+)?)$/);if(We){u.left=he[We[1]]||`${parseFloat(We[1])*.25}rem`;continue}const Ti=p.match(/^-left-(\d+(?:\.\d+)?)$/);if(Ti){const St=he[Ti[1]]||`${parseFloat(Ti[1])*.25}rem`;u.left=`-${St}`;continue}if(p==="overflow-hidden"){u.overflow="hidden";continue}if(p==="overflow-auto"){u.overflow="auto";continue}if(p==="overflow-scroll"){u.overflow="scroll";continue}if(p==="overflow-visible"){u.overflow="visible";continue}if(p==="overflow-x-auto"){u.overflowX="auto";continue}if(p==="overflow-y-auto"){u.overflowY="auto";continue}if(p==="overflow-x-hidden"){u.overflowX="hidden";continue}if(p==="overflow-y-hidden"){u.overflowY="hidden";continue}if(p==="overflow-x-scroll"){u.overflowX="scroll";continue}if(p==="overflow-y-scroll"){u.overflowY="scroll";continue}if(p==="object-cover"){u.objectFit="cover";continue}if(p==="object-contain"){u.objectFit="contain";continue}if(p==="object-fill"){u.objectFit="fill";continue}if(p==="object-center"){u.objectPosition="center";continue}if(p==="z-0"){u.zIndex=0;continue}if(p==="z-10"){u.zIndex=10;continue}if(p==="z-20"){u.zIndex=20;continue}if(p==="z-30"){u.zIndex=30;continue}if(p==="z-40"){u.zIndex=40;continue}if(p==="z-50"){u.zIndex=50;continue}const wo=p.match(/^opacity-(\d+)$/);if(wo){u.opacity=parseInt(wo[1])/100;continue}const _o=p.match(/^text-(xs|sm|base|lg|xl|[2-9]xl)$/);if(_o){const St=nht[_o[1]];St&&(u.fontSize=St.fontSize,u.lineHeight=St.lineHeight);continue}const de=p.match(/^text-([\w-]+)(?:\/([\d]+))?$/);if(de&&!p.startsWith("text-center")&&!p.startsWith("text-left")&&!p.startsWith("text-right")){const St=de[1],xe=de[2],le=o?c[St]:{black:"#e5e7eb","gray-600":"#9ca3af","gray-700":"#d1d5db","gray-800":"#e5e7eb","gray-900":"#f3f4f6","slate-700":"#cbd5e1","slate-800":"#e2e8f0","slate-900":"#f1f5f9"}[St]||c[St];le&&(xe?u.color=Fs(le,parseInt(xe)/100):u.color=le);continue}if(p==="bg-clip-text"){u.WebkitBackgroundClip="text",u.backgroundClip="text",u.WebkitTextFillColor="transparent";continue}if(p==="bg-fixed"){u.backgroundAttachment="fixed";continue}if(p==="bg-scroll"){u.backgroundAttachment="scroll";continue}const ae=p.match(/^bg-([\w-]+)(?:\/([\d]+))?$/);if(ae&&!p.startsWith("bg-gradient")){const St=ae[1],xe=ae[2],le=o?c[St]:{white:"#1f2937","gray-50":"#1f2937","gray-100":"#1f2937","gray-200":"#374151","gray-300":"#4b5563","slate-50":"#1f2937","slate-100":"#1f2937","slate-200":"#334155"}[St]||c[St];le&&(xe?u.backgroundColor=Fs(le,parseInt(xe)/100):u.backgroundColor=le);continue}if(p==="bg-gradient-to-t"){f="to top";continue}if(p==="bg-gradient-to-tr"){f="to top right";continue}if(p==="bg-gradient-to-r"){f="to right";continue}if(p==="bg-gradient-to-br"){f="to bottom right";continue}if(p==="bg-gradient-to-b"){f="to bottom";continue}if(p==="bg-gradient-to-bl"){f="to bottom left";continue}if(p==="bg-gradient-to-l"){f="to left";continue}if(p==="bg-gradient-to-tl"){f="to top left";continue}const Ei=p.match(/^from-([\w-]+)(?:\/([\d]+))?$/);if(Ei){const St=Ei[1],xe=Ei[2],Rt=c[St];Rt&&(m=xe?Fs(Rt,parseInt(xe)/100):Rt);continue}const Ci=p.match(/^via-([\w-]+)(?:\/([\d]+))?$/);if(Ci){const St=Ci[1],xe=Ci[2],Rt=c[St];Rt&&(y=xe?Fs(Rt,parseInt(xe)/100):Rt);continue}const Tr=p.match(/^to-([\w-]+)(?:\/([\d]+))?$/);if(Tr){const St=Tr[1],xe=Tr[2],Rt=c[St];Rt&&(x=xe?Fs(Rt,parseInt(xe)/100):Rt);continue}const Oi=p.match(/^p-(\d+(?:\.\d+)?)$/);if(Oi){u.padding=he[Oi[1]]||`${parseFloat(Oi[1])*.25}rem`;continue}const ds=p.match(/^px-(\d+(?:\.\d+)?)$/);if(ds){const St=he[ds[1]]||`${parseFloat(ds[1])*.25}rem`;u.paddingLeft=St,u.paddingRight=St;continue}const Mi=p.match(/^py-(\d+(?:\.\d+)?)$/);if(Mi){const St=he[Mi[1]]||`${parseFloat(Mi[1])*.25}rem`;u.paddingTop=St,u.paddingBottom=St;continue}const ii=p.match(/^pt-(\d+(?:\.\d+)?)$/);if(ii){u.paddingTop=he[ii[1]]||`${parseFloat(ii[1])*.25}rem`;continue}const ki=p.match(/^pr-(\d+(?:\.\d+)?)$/);if(ki){u.paddingRight=he[ki[1]]||`${parseFloat(ki[1])*.25}rem`;continue}const Vr=p.match(/^pb-(\d+(?:\.\d+)?)$/);if(Vr){u.paddingBottom=he[Vr[1]]||`${parseFloat(Vr[1])*.25}rem`;continue}const So=p.match(/^pl-(\d+(?:\.\d+)?)$/);if(So){u.paddingLeft=he[So[1]]||`${parseFloat(So[1])*.25}rem`;continue}const $i=p.match(/^m-(\d+(?:\.\d+)?)$/);if($i){u.margin=he[$i[1]]||`${parseFloat($i[1])*.25}rem`;continue}const Ii=p.match(/^mx-(\d+(?:\.\d+)?|auto)$/);if(Ii){const St=Ii[1]==="auto"?"auto":he[Ii[1]]||`${parseFloat(Ii[1])*.25}rem`;u.marginLeft=St,u.marginRight=St;continue}const Er=p.match(/^my-(\d+(?:\.\d+)?|auto)$/);if(Er){const St=Er[1]==="auto"?"auto":he[Er[1]]||`${parseFloat(Er[1])*.25}rem`;u.marginTop=St,u.marginBottom=St;continue}const Ri=p.match(/^mt-(\d+(?:\.\d+)?|auto)$/);if(Ri){u.marginTop=Ri[1]==="auto"?"auto":he[Ri[1]]||`${parseFloat(Ri[1])*.25}rem`;continue}const Li=p.match(/^mr-(\d+(?:\.\d+)?|auto)$/);if(Li){u.marginRight=Li[1]==="auto"?"auto":he[Li[1]]||`${parseFloat(Li[1])*.25}rem`;continue}const Cn=p.match(/^mb-(\d+(?:\.\d+)?)$/);if(Cn){u.marginBottom=he[Cn[1]]||`${parseFloat(Cn[1])*.25}rem`;continue}const It=p.match(/^ml-(\d+(?:\.\d+)?|auto)$/);if(It){u.marginLeft=It[1]==="auto"?"auto":he[It[1]]||`${parseFloat(It[1])*.25}rem`;continue}if(p==="mt-auto"){u.marginTop="auto";continue}const Po=p.match(/^gap-(\d+(?:\.\d+)?)$/);if(Po){u.gap=he[Po[1]]||`${parseFloat(Po[1])*.25}rem`;continue}const On=p.match(/^gap-x-(\d+(?:\.\d+)?)$/);if(On){u.columnGap=he[On[1]]||`${parseFloat(On[1])*.25}rem`;continue}const Ni=p.match(/^gap-y-(\d+(?:\.\d+)?)$/);if(Ni){u.rowGap=he[Ni[1]]||`${parseFloat(Ni[1])*.25}rem`;continue}const Ao=p.match(/^space-x-(\d+(?:\.\d+)?)$/);if(Ao){u.columnGap=he[Ao[1]]||`${parseFloat(Ao[1])*.25}rem`;continue}const oi=p.match(/^space-y-(\d+(?:\.\d+)?)$/);if(oi){u.rowGap=he[oi[1]]||`${parseFloat(oi[1])*.25}rem`;continue}const ji=p.match(/^space-x-\[([^\]]+)\]$/);if(ji){u.columnGap=ji[1];continue}const ur=p.match(/^space-y-\[([^\]]+)\]$/);if(ur){u.rowGap=ur[1];continue}const Di=p.match(/^grid-cols-(\d+)$/);if(Di){u.gridTemplateColumns=`repeat(${Di[1]}, minmax(0, 1fr))`;continue}if(p==="rounded"){u.borderRadius="0.25rem";continue}if(p==="rounded-none"){u.borderRadius="0";continue}if(p==="rounded-sm"){u.borderRadius="0.125rem";continue}if(p==="rounded-md"){u.borderRadius="0.375rem";continue}if(p==="rounded-lg"){u.borderRadius="0.5rem";continue}if(p==="rounded-xl"){u.borderRadius="0.75rem";continue}if(p==="rounded-2xl"){u.borderRadius="1rem";continue}if(p==="rounded-3xl"){u.borderRadius="1.5rem";continue}if(p==="rounded-full"){u.borderRadius="9999px";continue}if(p==="border"){u.borderWidth="1px",u.borderStyle="solid";continue}if(p==="border-0"){u.borderWidth="0";continue}if(p==="border-2"){u.borderWidth="2px",u.borderStyle="solid";continue}if(p==="border-t"){u.borderTopWidth="1px",u.borderStyle="solid";continue}if(p==="border-b"){u.borderBottomWidth="1px",u.borderStyle="solid";continue}if(p==="border-l"){u.borderLeftWidth="1px",u.borderStyle="solid";continue}if(p==="border-r"){u.borderRightWidth="1px",u.borderStyle="solid";continue}const ps=p.match(/^border-t-(\d+)$/);if(ps){u.borderTopWidth=`${ps[1]}px`,u.borderStyle="solid";continue}const Ur=p.match(/^border-b-(\d+)$/);if(Ur){u.borderBottomWidth=`${Ur[1]}px`,u.borderStyle="solid";continue}const To=p.match(/^border-l-(\d+)$/);if(To){u.borderLeftWidth=`${To[1]}px`,u.borderStyle="solid";continue}const ms=p.match(/^border-r-(\d+)$/);if(ms){u.borderRightWidth=`${ms[1]}px`,u.borderStyle="solid";continue}const gs=p.match(/^border-(\d+)$/);if(gs){u.borderWidth=`${gs[1]}px`,u.borderStyle="solid";continue}const ys=p.match(/^border-([\w-]+)(?:\/([\d]+))?$/);if(ys&&!p.match(/^border-[trbl]$/)){const St=ys[1],xe=ys[2],le=o?c[St]:{white:"#374151","gray-100":"#374151","gray-200":"#374151","gray-300":"#4b5563","slate-100":"#334155","slate-200":"#334155","slate-300":"#475569"}[St]||c[St];le&&(u.borderColor=xe?Fs(le,parseInt(xe)/100):le);continue}if(p==="shadow"){u.boxShadow="0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-sm"){u.boxShadow="0 1px 2px 0 rgb(0 0 0 / 0.05)";continue}if(p==="shadow-md"){u.boxShadow="0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-lg"){u.boxShadow="0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-xl"){u.boxShadow="0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-2xl"){u.boxShadow="0 25px 50px -12px rgb(0 0 0 / 0.25)";continue}if(p==="shadow-none"){u.boxShadow="none";continue}if(p==="ring"){u.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-0"){u.boxShadow="0 0 0 0px transparent";continue}if(p==="ring-1"){u.boxShadow="0 0 0 1px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-2"){u.boxShadow="0 0 0 2px rgba(59, 130, 246, 0.5)";continue}const Te=p.match(/^ring-([\w-]+)(?:\/([\d]+))?$/);if(Te&&!p.match(/^ring-\d$/)){const St=Te[1],xe=Te[2],Rt=c[St];if(Rt){const le=xe?parseInt(xe)/100:1;u.boxShadow&&u.boxShadow.includes("0 0 0")&&(u.boxShadow=u.boxShadow.replace(/rgba\([^)]+\)/,Fs(Rt,le)))}continue}if(p==="backdrop-blur"){u.backdropFilter="blur(8px)";continue}if(p==="backdrop-blur-none"){u.backdropFilter="blur(0)";continue}if(p==="backdrop-blur-sm"){u.backdropFilter="blur(4px)";continue}if(p==="backdrop-blur-md"){u.backdropFilter="blur(12px)";continue}if(p==="backdrop-blur-lg"){u.backdropFilter="blur(16px)";continue}if(p==="backdrop-blur-xl"){u.backdropFilter="blur(24px)";continue}if(p==="backdrop-blur-2xl"){u.backdropFilter="blur(40px)";continue}if(p==="backdrop-blur-3xl"){u.backdropFilter="blur(64px)";continue}if(p==="blur"){u.filter="blur(8px)";continue}if(p==="blur-none"){u.filter="blur(0)";continue}if(p==="blur-sm"){u.filter="blur(4px)";continue}if(p==="blur-md"){u.filter="blur(12px)";continue}if(p==="blur-lg"){u.filter="blur(16px)";continue}if(p==="blur-xl"){u.filter="blur(24px)";continue}if(p==="blur-2xl"){u.filter="blur(40px)";continue}if(p==="blur-3xl"){u.filter="blur(64px)";continue}const cn=p.match(/^scale-(\d+)$/);if(cn){const St=parseInt(cn[1])/100;u.transform=`scale(${St})`;continue}const Ea=p.match(/^scale-x-(\d+)$/);if(Ea){const St=parseInt(Ea[1])/100;u.transform=`scaleX(${St})`;continue}const vs=p.match(/^scale-y-(\d+)$/);if(vs){const St=parseInt(vs[1])/100;u.transform=`scaleY(${St})`;continue}const bs=p.match(/^rotate-(\d+)$/);if(bs){u.transform=`rotate(${bs[1]}deg)`;continue}const Bi=p.match(/^-rotate-(\d+)$/);if(Bi){u.transform=`rotate(-${Bi[1]}deg)`;continue}const Sn=p.match(/^translate-x-(\d+(?:\.\d+)?)$/);if(Sn){const St=he[Sn[1]]||`${parseFloat(Sn[1])*.25}rem`;u.transform=`translateX(${St})`;continue}const Xn=p.match(/^-translate-x-(\d+(?:\.\d+)?)$/);if(Xn){const St=he[Xn[1]]||`${parseFloat(Xn[1])*.25}rem`;u.transform=`translateX(-${St})`;continue}const Eo=p.match(/^translate-y-(\d+(?:\.\d+)?)$/);if(Eo){const St=he[Eo[1]]||`${parseFloat(Eo[1])*.25}rem`;u.transform=`translateY(${St})`;continue}const si=p.match(/^-translate-y-(\d+(?:\.\d+)?)$/);if(si){const St=he[si[1]]||`${parseFloat(si[1])*.25}rem`;u.transform=`translateY(-${St})`;continue}if(p==="translate-x-full"){u.transform="translateX(100%)";continue}if(p==="-translate-x-full"){u.transform="translateX(-100%)";continue}if(p==="translate-y-full"){u.transform="translateY(100%)";continue}if(p==="-translate-y-full"){u.transform="translateY(-100%)";continue}if(p==="translate-x-1/2"){u.transform="translateX(50%)";continue}if(p==="-translate-x-1/2"){u.transform="translateX(-50%)";continue}if(p==="translate-y-1/2"){u.transform="translateY(50%)";continue}if(p==="-translate-y-1/2"){u.transform="translateY(-50%)";continue}if(p.startsWith("animate-")||p.startsWith("divide-")||p.startsWith("group-"))continue;if(p==="leading-none"){u.lineHeight="1";continue}if(p==="leading-tight"){u.lineHeight="1.25";continue}if(p==="leading-snug"){u.lineHeight="1.375";continue}if(p==="leading-normal"){u.lineHeight="1.5";continue}if(p==="leading-relaxed"){u.lineHeight="1.625";continue}if(p==="leading-loose"){u.lineHeight="2";continue}if(p==="tracking-tighter"){u.letterSpacing="-0.05em";continue}if(p==="tracking-tight"){u.letterSpacing="-0.025em";continue}if(p==="tracking-normal"){u.letterSpacing="0em";continue}if(p==="tracking-wide"){u.letterSpacing="0.025em";continue}if(p==="tracking-wider"){u.letterSpacing="0.05em";continue}if(p==="tracking-widest"){u.letterSpacing="0.1em";continue}const Mn=p.match(/^tracking-\[(.+)\]$/);if(Mn){u.letterSpacing=Mn[1];continue}const re=p.match(/^w-\[(.+)\]$/);if(re){u.width=re[1];continue}const Kt=p.match(/^h-\[(.+)\]$/);if(Kt){u.height=Kt[1];continue}const hr=p.match(/^min-h-\[(.+)\]$/);if(hr){u.minHeight=hr[1];continue}const be=p.match(/^max-w-\[(.+)\]$/);if(be){u.maxWidth=be[1];continue}}return f&&m&&(y?u.backgroundImage=`linear-gradient(${f}, ${m}, ${y}, ${x||m})`:x?u.backgroundImage=`linear-gradient(${f}, ${m}, ${x})`:u.backgroundImage=`linear-gradient(${f}, ${m}, transparent)`),u}function Fs(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${i}, ${t})`}const yT={margin:0,padding:0,boxSizing:"border-box",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"};function rht(e){return`
130
130
  #${e} {
131
131
  isolation: isolate;
132
132
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
@@ -191,10 +191,10 @@ ${c.join(`
191
191
  font-weight: inherit;
192
192
  margin: 0;
193
193
  }
194
- `}function iht(e,t,n,r){return v.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",minHeight:"100%",backgroundColor:e.colors.background,gap:"16px"}},V("p",{style:{color:e.colors.text,fontSize:"1.125rem"}},"Scene not found"),v.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"center"}},t>0&&v.createElement("button",{onClick:n,style:{padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.surfaceHover,color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:e.effects.transition},onMouseOver:i=>i.target.style.backgroundColor=e.colors.border,onMouseOut:i=>i.target.style.backgroundColor=e.colors.surfaceHover},"← Go Back"),r&&v.createElement("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"6px",padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.primary,variant:"outline",color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:"opacity 0.2s"},onMouseOver:i=>i.target.style.opacity="0.85",onMouseOut:i=>i.target.style.opacity="1"},v.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},V("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),"Generate Scene")))}function oht(e){return v.createElement("div",{key:"preview-modal",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},v.createElement("div",{style:{backgroundColor:e.colors.background,borderRadius:"12px",padding:"24px",maxWidth:"360px",width:"90%",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.4)",border:"1px solid rgba(255, 255, 255, 0.08)"}},V("h3",{style:{color:e.colors.text,fontSize:"16px",fontWeight:600,marginBottom:"12px"}},"Sample Modal"),V("p",{style:{color:e.colors.textSecondary,fontSize:"14px",marginBottom:"20px"}},"This is a preview of the modal component for styling."),v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"}},V("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:"rgba(255,255,255,0.08)",color:e.colors.text,border:`1px solid ${e.colors.borderSubtle}`}},"Cancel"),V("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:e.colors.primary,color:e.colors.text,border:"none"}},"Confirm"))))}function vT(e,t,n,r,i,o,s){var O,I,N,F,D,j,K,U,z,Y,G;if(!e)return null;const{definition:l,closing:c}=e,h=l.variant?(O=l.variants)==null?void 0:O[l.variant]:void 0,u={...l,...h,style:{...l.style,...h==null?void 0:h.style},components:(h==null?void 0:h.components)||l.components,actions:(h==null?void 0:h.actions)||l.actions},f=u.popover===!0,m=(I=u.style)==null?void 0:I.placement,y=m==="left"||m==="right"||m==="bottom"?m:"center",x=u.drawer===!0||y==="left"||y==="right",p=y==="bottom",b=c===!0,P=u.className||"",S=P?((N=n.parseClassNameResponsive)==null?void 0:N.call(n,P,`modal-${e.id}`))??n.parseClassName(P):{},A=f&&s&&s.top>window.innerHeight/2&&s.bottom+300>window.innerHeight,E=s?Math.min(Math.max(12,s.left),Math.max(12,window.innerWidth-372)):void 0,w=()=>{var X;b||(X=i||n.dismissModal)==null||X()},T=v.createElement("div",{key:`modal-overlay-${e.id||"base"}`,style:{position:"fixed",top:0,left:0,right:0,bottom:0,animation:b?"bf-fade-out 0.2s ease forwards":"bf-fade-in 0.15s ease",backdropFilter:f?void 0:"blur(4px)",WebkitBackdropFilter:f?void 0:"blur(4px)",display:"flex",alignItems:f?"flex-start":p?"flex-end":"center",justifyContent:f?"flex-end":x?y==="left"?"flex-start":"flex-end":"center",paddingTop:void 0,paddingRight:void 0,backgroundColor:f?"transparent":((F=u.style)==null?void 0:F.overlayColor)||"rgba(0,0,0,0.45)",pointerEvents:"auto",zIndex:o||1e4},onClick:X=>{X.target===X.currentTarget&&w()}},v.createElement("div",{className:P||void 0,style:{pointerEvents:f?"auto":void 0,...f?{position:"fixed",top:A||!s?A?void 0:"116px":`${s.bottom+8}px`,bottom:A?`${Math.max(12,window.innerHeight-s.top+8)}px`:void 0,left:E===void 0?void 0:`${E}px`,right:E===void 0?"24px":void 0}:{},backgroundColor:((D=u.style)==null?void 0:D.backgroundColor)||r||t.colors.background,borderRadius:x?"0px":((j=u.style)==null?void 0:j.borderRadius)||(p?"16px 16px 0 0":"12px"),padding:x?"0.5rem":p?"16px":"24px",height:x?"100%":"auto",maxHeight:p?"90vh":x?void 0:"85vh",maxWidth:x?"520px":p?n.isMobileView?"none":"640px":((K=u.style)==null?void 0:K.width)||{sm:"min(360px, 92vw)",md:"min(480px, 92vw)",lg:"min(720px, 92vw)",full:"90vw"}[u.size||"sm"]||"min(400px, 92vw)",width:(U=u.style)!=null&&U.width?"100%":x?"90vw":p?"100%":"90%",boxShadow:x?y==="left"?"4px 0 24px rgba(0, 0, 0, 0.4)":"-4px 0 24px rgba(0, 0, 0, 0.4)":p?"0 -8px 32px rgba(0, 0, 0, 0.45)":"0 20px 40px rgba(0, 0, 0, 0.4)",...f?{minWidth:"min(360px, 92vw)",marginRight:"0px",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.45)"}:{},border:"none",borderLeft:x&&y==="right"?`1px solid ${((z=u.style)==null?void 0:z.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",borderRight:x&&y==="left"?`1px solid ${((Y=u.style)==null?void 0:Y.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",overflow:"auto",animation:x?b?y==="left"?"bf-slide-out-left 0.2s ease forwards":"bf-slide-out-right 0.2s ease forwards":y==="left"?"bf-slide-in-left 0.2s ease":"bf-slide-in-right 0.2s ease":p?b?"bf-slide-out-down 0.2s ease forwards":"bf-slide-in-up 0.25s ease":b?"bf-fade-out 0.2s ease forwards":void 0,...S}},p?v.createElement("div",{key:"bf-sheet-handle",style:{width:"40px",height:"4px",borderRadius:"2px",backgroundColor:"rgba(255, 255, 255, 0.2)",margin:"0 auto 12px",flexShrink:0}}):null,u.icon?v.createElement("div",{style:{textAlign:"center",marginBottom:"12px",display:"flex",justifyContent:"center"}},n.renderIcon(u.icon,32)):null,u.title?v.createElement("h3",{style:{color:t.colors.text,fontSize:u.icon?"18px":"16px",fontWeight:600,marginBottom:"12px",marginTop:"4px",paddingLeft:x?"1.5rem":"0px",paddingRight:x?"1.5rem":"0px",textAlign:u.icon?"center":"left"}},n.interpolateText(u.title)):null,...(u.components||[]).map((X,lt)=>Wf(n,X,lt,"modal")),(((G=u.actions)==null?void 0:G.length)||0)>0?v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"20px"}},...(u.actions||[]).map((X,lt)=>{const et=(ct=>{const yt=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ct);if(!yt)return!1;const[vt,Et,Tt]=[parseInt(yt[1],16),parseInt(yt[2],16),parseInt(yt[3],16)];return(vt*299+Et*587+Tt*114)/1e3>150})(t.colors.primary)?"#000000":"#ffffff",it={primary:{background:t.colors.primary,color:et,border:"none"},secondary:{background:"rgba(255, 255, 255, 0.08)",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},ghost:{background:"transparent",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},danger:{background:t.colors.danger,color:"#ffffff",border:"none"}},st=it[X.variant||"primary"]||it.primary;return v.createElement("button",{key:lt,onClick:()=>{if(e.legacyOnConfirm&&X.label==="Confirm"){w(),setTimeout(()=>{var ct;return(ct=e.legacyOnConfirm)==null?void 0:ct.call(e)},250);return}X.onClick&&n.handleButtonClick(X.onClick,{onSuccess:X.onSuccess,onError:X.onError}),X.dismiss&&w()},style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,...st}},X.label)})):null));return f&&typeof document<"u"?cb.createPortal(T,document.body):T}const sht=new va,dp=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},Gg=(...e)=>{dp()&&console.log(...e)},Zg=(...e)=>{dp()&&console.warn(...e)};let J$=null;window.addEventListener("message",e=>{var t,n,r;(((t=e.data)==null?void 0:t.type)==="auth"||((n=e.data)==null?void 0:n.type)==="auth-token")&&((r=e.data)!=null&&r.token)&&(J$=e.data.token,localStorage.setItem("token",e.data.token),e.data.refreshToken&&localStorage.setItem("backflow_refresh_token",e.data.refreshToken),e.data.userId&&localStorage.setItem("backflow_refresh_user_id",e.data.userId))});function Rf(e){try{const t=JSON.parse(atob(e.split(".")[1]));return typeof t.exp!="number"||t.exp*1e3<=Date.now()}catch{return!0}}function aht({workflow:e,sdk:t,iconResolver:n,authToken:r,nativeAction:i,onRouteExecute:o,onJobProgress:s,appName:l,appIcon:c,selectedComponentKey:h,selectedComponentClass:u,styleOverrides:f,interactionDisabled:m,theme:y,imageReplacements:x,currentSceneId:p,onSceneChange:b,onGenerateScene:P,enableRouting:S,routingMode:A,previewElement:E,tenantId:w,appId:T,renderPhaserGame:O,renderMode:I,apiUrl:N,workflowBaseUrl:F,initialScene:D,previewMode:j,remoteSessionId:K,devDiagnostics:U}){var vr,Is,qh,Rs,Gh,$c,Zh,Lo,Yh,Yi,Ic,Rc,Kh,Mr,Lc,Nc;const z=(()=>{const M=J$||localStorage.getItem("token");return!!M&&!Rf(M)})(),[Y,G]=v.useState(!z),[X,lt]=v.useState(null),H=v.useMemo(()=>Array.isArray(e==null?void 0:e.steps)?e.steps:[],[e]),et=v.useMemo(()=>{const M=H;return e&&!Array.isArray(e.steps)&&(Zg("[WorkflowRenderer] NON-ARRAY steps:",typeof e.steps,JSON.stringify(e.steps).slice(0,500)),Zg("[WorkflowRenderer] Workflow keys:",Object.keys(e))),Y!==!0?M:M.filter($=>{var k,Z;return!($.requiresAuth===!0||((k=$.config)==null?void 0:k.requireAuth)===!0||((Z=$.config)==null?void 0:Z.requiresAuth)===!0)})},[e,Y,H]),it=v.useCallback(M=>{var k;const $=H.find(Z=>Z.id===M);return((k=$==null?void 0:$.config)==null?void 0:k.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0},[H]),st=e&&!((vr=e.config)!=null&&vr.colorMode)?fI(e):void 0,ct=NT(st?{...(e==null?void 0:e.config)||{},colorMode:st}:e==null?void 0:e.config,void 0,y),yt=!((Is=e==null?void 0:e.config)!=null&&Is.colorMode)&&!st&&!(y!=null&&y.colorMode),vt=M=>_x(M,{primary:ce.colors.primary,accent:ce.colors.accent,colorMode:ce.colorMode},yt),Et=I||"legacy",Tt=A||(S?"hash":"memory"),ft=Tt!=="memory",[dt,Ct]=v.useState(z),[nt,Lt]=v.useState(!1),[bt,me]=v.useState(!1),{sceneToRoute:ie,routeToScene:Xt}=v.useMemo(()=>K$(et),[et]),Ne=v.useMemo(()=>{var $,k;if(D&&et.some(Z=>Z.id===D))return D;const M=et.filter(Z=>Z.type==="render_scene");return(($=M.find(Z=>Z.route==="/"))==null?void 0:$.id)||((k=M[0])==null?void 0:k.id)||""},[et,D]),Wt=v.useMemo(()=>{if(ft){const M=Tt==="hash"?ab(Xt):gT(Xt);if(M)return M}return Ne},[Ne,ft,Tt,Xt]),[ee,ne]=v.useState([]),[Yt,oe]=v.useState(Wt),Me=v.useRef(null),se=wC(Me),on=v.useRef(!1);v.useRef(null);const en=v.useRef(!1),Ke=v.useRef(!1),xo=v.useRef(0),ln=v.useRef(null);v.useEffect(()=>(en.current=!1,LT(),()=>{en.current=!0}),[]),v.useEffect(()=>{r&&localStorage.setItem("token",r)},[r]);const kt=p??Yt;v.useEffect(()=>{var Q,J,at;const M=et.find(ut=>ut.id===kt),$=!!((Q=e==null?void 0:e.config)!=null&&Q.remoteControl)&&!!(M!=null&&M.remoteScene);if(AT($),TT($&&!!((at=(J=e==null?void 0:e.config)==null?void 0:J.mouse)!=null&&at.enabled)),!$||!K){Xg();return}const k=N||(t==null?void 0:t.endpoint),Z=k&&/^https?:\/\//.test(k)?k:window.location.origin,B=new URL("/ws",Z);B.protocol=B.protocol==="https:"?"wss:":"ws:";const W=B.toString(),tt=`agent:${w||"default"}:${K}`;return RT(W,tt,r||localStorage.getItem("token")||void 0),()=>Xg()},[(qh=e==null?void 0:e.config)==null?void 0:qh.remoteControl,(Gh=(Rs=e==null?void 0:e.config)==null?void 0:Rs.mouse)==null?void 0:Gh.enabled,et,kt,K,w,N,t,r]);const Nn=v.useCallback(M=>{oe(M),b==null||b(M)},[b]);v.useEffect(()=>{var k;const M=et.find(Z=>Z.id===kt),$=((k=M==null?void 0:M.config)==null?void 0:k.requireAuth)===!0||(M==null?void 0:M.requiresAuth)===!0;kt&&!$&&Lt(!1)},[kt,et]);const We=(e==null?void 0:e.modals)||{};v.useEffect(()=>{if(!dt)return;const M=ce.startupModal;!M||!We[M]||localStorage.getItem(`backflow_startup_modal_${M}`)||cn({id:M,definition:We[M]})},[dt]);const Ti=v.useRef(typeof window>"u"?null:new URLSearchParams(window.location.search).get("customer_session_token"));v.useEffect(()=>{if(!dt||!Ti.current||!We["payment-success"])return;window.history.replaceState({},"",window.location.pathname);const $=setTimeout(()=>{We["payment-success"]&&cn({id:"payment-success",definition:We["payment-success"]})},400);return()=>clearTimeout($)},[dt,We["payment-success"]]),v.useEffect(()=>{Y===!0&&(!kt||et.some(M=>M.id===kt)||Ne&&Nn(Ne))},[Y,et,kt,Ne]),v.useEffect(()=>{if(ft){if(on.current){on.current=!1;return}Tt==="hash"?Vf(kt,ie,!1):qg(kt,ie,!1)}},[kt,ft,Tt,ie]),v.useEffect(()=>{ft&&(Tt==="hash"?Vf(kt,ie,!0):qg(kt,ie,!0))},[]);const wo=v.useRef(!0);v.useEffect(()=>{const M=setTimeout(()=>{wo.current=!1},1500);return()=>clearTimeout(M)},[]),v.useEffect(()=>{if(!ft)return;const M=$=>{var Z;if(wo.current)return;const k=((Z=$.state)==null?void 0:Z.sceneId)||(Tt==="hash"?ab(Xt):gT(Xt));k&&k!==kt&&(on.current=!0,Nn(k),ne(B=>B.length>0&&B[B.length-1]===k?B.slice(0,-1):B))};return window.addEventListener("popstate",M),()=>window.removeEventListener("popstate",M)},[ft,Tt,Xt,kt,Nn]),v.useEffect(()=>{var $;const M=(($=et.find(k=>k.type==="render_scene"))==null?void 0:$.id)||"";if(M&&M!==kt){if(oe(M),ne([]),b==null||b(M),!ft)return;Tt==="hash"?Vf(M,ie,!0):qg(M,ie,!0)}},[e]),v.useEffect(()=>{p&&p!==Yt&&oe(p)},[p]);const _o=v.useCallback(()=>{if(ft){window.history.back();return}if(ee.length>0){const M=ee[ee.length-1];ne($=>$.slice(0,-1)),Nn(M)}},[ee,ft]),[de,ae]=v.useState({}),Ei=v.useRef(de);v.useEffect(()=>{Ei.current=de},[de]),v.useEffect(()=>{K&&ae(M=>M.remoteSessionId===K?M:{...M,remoteSessionId:K})},[K]);const Ci=v.useMemo(()=>Array.isArray(e==null?void 0:e.workflowRefs)?e.workflowRefs:[],[e]),Tr=v.useMemo(()=>Ci.filter(M=>M.sceneIds==="*"||Array.isArray(M.sceneIds)&&M.sceneIds.includes(kt)),[kt,Ci]),[Oi,ds]=v.useState({}),Mi=v.useRef({}),ii=v.useCallback(async(M,$=!1)=>{if(!dt||!M.appId)return;const k=N||(t==null?void 0:t.endpoint)||window.location.origin,Z=!N&&typeof k=="string"&&k.startsWith("/")?k.replace(/\/+$/,""):"",B=/^https?:\/\//.test(k)?k:window.location.origin,W=`${Z}/mobile/apps/${encodeURIComponent(M.appId)}/workflow`,tt=await fetch(new URL(W,B).toString(),{cache:$?"no-cache":"default",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!tt.ok)throw new Error(`Workflow reference ${M.id} failed`);const Q=await tt.json(),J=(Q==null?void 0:Q.app)||Q;if(!Array.isArray(J==null?void 0:J.steps))throw new Error(`Workflow reference ${M.id} is invalid`);ds(at=>({...at,[M.id]:J}))},[N,r,dt,t]);v.useEffect(()=>{let M=!1;for(const $ of Tr){const k=`${$.appId}:${$.sourceSceneId||""}`;Mi.current[$.id]!==k&&(Mi.current[$.id]=k,ii($).catch(()=>{M||delete Mi.current[$.id]}))}return()=>{M=!0}},[Tr,ii]),v.useEffect(()=>{var Z;const M=Tr.filter(B=>{var W;return((W=B.realtime)==null?void 0:W.mode)==="ws"});if(M.length===0||!w)return;const $=(Z=t==null?void 0:t.client)==null?void 0:Z.createWebSocket;if(!$)return;const k=$(`tenant:${w}:entities`);return k.onmessage=B=>{let W;try{W=JSON.parse(B.data)}catch{return}if(!(W.type!=="entity_changed"||W.entity!=="mobile_apps"))for(const tt of M)W.id===tt.appId&&ii(tt,!0).catch(()=>{})},()=>k.close()},[Tr,ii,w,t]);const[ki,Vr]=v.useState({}),So=v.useRef(new Set),[$i,Ii]=v.useState({}),[Er,Ri]=v.useState({}),[Li,Cn]=v.useState({}),[It,Po]=v.useState({}),[On,Ni]=v.useState({}),[Ao,oi]=v.useState([]),ji=v.useRef(new Set),ur=v.useRef(new Map),Di=v.useCallback((M,$)=>{if(!(U??dp()))return;const k=`${M}:${$}`;ji.current.has(k)||(ji.current.add(k),oi(Z=>[...Z,{level:"warn",code:M,where:`runtime:${kt}`,msg:$}]))},[kt,U]),ps=v.useCallback((M,$)=>{if(!(U??dp()))return;const k=Date.now(),Z=(ur.current.get(M)||[]).filter(tt=>k-tt.at<2e3),B=Z.find(tt=>tt.componentKey!==$&&k-tt.at<500);Z.push({componentKey:$,at:k}),ur.current.set(M,Z),B&&Di("DATASOURCE_DUPLICATE_RUNTIME",`"${M}" fetched by ${B.componentKey} and ${$} within 500ms`);const W=Z.filter(tt=>tt.componentKey===$);W.length>=3&&Di("RENDER_FETCH_LOOP",`"${M}" fetched ${W.length} times by ${$} within 2s`)},[U,Di]);v.useEffect(()=>{ji.current.clear(),ur.current.clear(),oi([])},[kt]);const Ur=v.useRef(new Map),To=v.useRef(new Map),ms=v.useRef(new Set),[gs,ys]=v.useState(!1),[Te,cn]=v.useState(null),[Ea,vs]=v.useState(null),bs=v.useRef(null);v.useEffect(()=>{var $;if(!(($=Te==null?void 0:Te.definition)!=null&&$.popover))return;const M=()=>{const k=bs.current;k&&vs(k.getBoundingClientRect())};return window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),M(),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[Te==null?void 0:Te.id,($c=Te==null?void 0:Te.definition)==null?void 0:$c.popover]);const Bi=v.useCallback(()=>{cn(M=>M?{...M,closing:!0}:null),setTimeout(()=>cn(null),250)},[]),[Sn,Xn]=v.useState(null),Eo=v.useCallback(()=>{Xn(M=>M?{...M,closing:!0}:null),setTimeout(()=>Xn(null),250)},[]),si=se>0&&se<ku.md;v.useEffect(()=>{e&&typeof e=="object"&&(e.auth={signedIn:dt})},[e,dt]),v.useEffect(()=>{const M=e;if(!(M!=null&&M.config))return;if(c){M.config.logo=c,ae(k=>k&&{...k});return}if(!F)return;let $=!1;return(async()=>{for(const k of["svg","png","jpg","jpeg"]){const Z=`${F}logo.${k}`;try{if((await fetch(Z,{method:"HEAD"})).ok&&!$){M.config.logo=Z,ae(W=>W&&{...W});return}}catch{}}})(),()=>{$=!0}},[e,F,c]);const[Mn,re]=v.useState("login"),[Kt,hr]=v.useState(""),[be,St]=v.useState(""),[xe,Rt]=v.useState(""),[le,xs]=v.useState({}),[zi,kn]=v.useState(""),[ai,un]=v.useState(null),[Ge,Ie]=v.useState(!1),[Ee,ws]=v.useState({}),Hr=M=>M?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M)?null:"Invalid email address":null,Fi=M=>M?M.length>=6?null:"Password must be at least 6 characters":null,_s=(M,$)=>$?$===M?null:"Passwords do not match":null,Cr=(M,$)=>ws(k=>({...k,[M]:$||""})),Co=M=>{var $,k;return M?typeof M=="string"?M:Array.isArray(M)?(($=M[0])==null?void 0:$.message)||"Validation failed":typeof M.message=="string"?M.message:typeof M.error=="string"?M.error:(k=M.error)!=null&&k.message?M.error.message:"An error occurred":"An error occurred"},Wi=(de==null?void 0:de._colorMode)||ct.colorMode,bc=Wi==="dark"?Pu:Au,ce=Wi!==ct.colorMode?{...ct,colorMode:Wi,colors:{...bc,...ct.colors&&Wi==="dark"?ct.colors:{}}}:ct;v.useEffect(()=>{typeof document>"u"||document.documentElement.setAttribute("data-theme",ce.colorMode==="dark"?"dark":"light")},[ce.colorMode]);const Ss=v.useCallback(M=>{try{localStorage.setItem("bf_theme",M)}catch{}ae($=>({...$,_colorMode:M}))},[]);v.useEffect(()=>{if(typeof localStorage>"u")return;const M=localStorage.getItem("bf_theme");(M==="dark"||M==="light")&&ae($=>({...$,_colorMode:M}))},[]),v.useEffect(()=>{const M=localStorage.getItem("token"),$=!!M&&!Rf(M);$?(Ke.current=!1,G(!1)):G(!0),Ct($);const k=()=>{const W=localStorage.getItem("token"),tt=!!W&&!Rf(W);tt?(Ke.current=!1,G(!1)):G(!0),Ct(tt)};window.addEventListener("storage",k);const Z=W=>{var tt,Q,J;if((((tt=W.data)==null?void 0:tt.type)==="auth"||((Q=W.data)==null?void 0:Q.type)==="auth-token")&&((J=W.data)!=null&&J.token)){if(localStorage.setItem("token",W.data.token),W.data.refreshToken&&localStorage.setItem("backflow_refresh_token",W.data.refreshToken),W.data.userId&&localStorage.setItem("backflow_refresh_user_id",W.data.userId),Rf(W.data.token)){Ke.current=!0,Ct(!1);return}if(!dt&&(nt||Ke.current||!!ln.current)){window.location.reload();return}Ct(!0),Lt(!1),G(!1),Ke.current=!1}};window.addEventListener("message",Z);const B=()=>{var W;if(!Ke.current){const tt=et.find(J=>J.id===kt);if(!(((W=tt==null?void 0:tt.config)==null?void 0:W.requireAuth)===!0||(tt==null?void 0:tt.requiresAuth)===!0))return;Ke.current=!0,Ct(!1),Lt(!0)}};return window.addEventListener("auth:required",B),()=>{window.removeEventListener("storage",k),window.removeEventListener("message",Z),window.removeEventListener("auth:required",B)}},[]);const kh=async()=>{var k;const M=localStorage.getItem("backflow_refresh_token"),$=localStorage.getItem("backflow_refresh_user_id");if(!M||!$)return!1;try{const B=await(await fetch(`${window.location.origin}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:M,userId:$})})).json();if(B.success&&((k=B.data)!=null&&k.token))return B.data.refreshToken&&localStorage.setItem("backflow_refresh_token",B.data.refreshToken),localStorage.setItem("token",B.data.token),!0}catch{}return localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),!1},Oo=async(M,$=!1)=>{var k;if(M.status===401&&!nt){if(await kh())return!1;if(Gg("[bf] 401 intercepted, showAuth:",nt,"authInterceptedRef:",Ke.current),!Ke.current){Ke.current=!0,localStorage.removeItem("token"),Ct(!1);const B=et.find(tt=>tt.id===kt),W=((k=B==null?void 0:B.config)==null?void 0:k.requireAuth)===!0||(B==null?void 0:B.requiresAuth)===!0;($||W)&&(Lt(!0),kt&&(ln.current=kt))}return!0}return!1},_m=kt&&et.some(M=>M.id===kt)?kt:(Zh=et[0])==null?void 0:Zh.id,Ft=et.find(M=>M.id===_m),ge=(Ft==null?void 0:Ft.type)==="render_scene"?Ft.config:null;v.useEffect(()=>{if(!ge)return;const M=w||"default",$={TENANT_ID:M,tenantId:M,role:"user"};ae(k=>{const Z={};for(const B of Object.keys(k))B.startsWith("_")&&(Z[B]=k[B]);return{...$,...ge.sceneData||{},...Z}})},[kt,ge]),v.useEffect(()=>{const M=ce.persistedKeys;if(!M||M.length===0)return;const $={};for(const k of M){const Z=localStorage.getItem(`bf_persist_${k}`);Z&&($[k]=Z)}Object.keys($).length>0&&ae(k=>({...k,...$}))},[kt]),v.useEffect(()=>{const M=ce.persistedKeys;if(!(!M||M.length===0))for(const $ of M){const k=de[$];k&&localStorage.setItem(`bf_persist_${$}`,String(k))}});const Ce=M=>{const $=M.match(/^(GET|POST|PATCH|DELETE|PUT)\s+(.+)/);return{method:$?$[1]:"POST",path:$?$[2]:M}},xc=M=>{const $={...M};return delete $.TENANT_ID,delete $.tenantId,delete $.role,$},qr=v.useCallback(async M=>{var Z,B,W;if(!M.action)return;const $=String(M.action),k=Ei.current;try{if($.startsWith("execute_workflow:")){if(!dt)return;const{method:tt,path:Q}=Ce($.replace("execute_workflow:","")),J=Q.replace(/:(\w+)/g,(Mt,mt)=>{const At=k[mt];return At===void 0?Mt:String(At)}).replace(/\{\{(\w+)\}\}/g,(Mt,mt)=>{const At=k[mt];return At===void 0?Mt:String(At)}),at=fr(),ut=tt!=="GET"&&tt!=="DELETE";tt!=="GET"&&pe(tt,J,k,!0);const gt=await fetch(new URL(J,at).toString(),{method:tt,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...ut?{body:JSON.stringify(xc(k))}:{}});if(en.current||await Oo(gt)||en.current)return;if(!gt.ok)throw Or(J),new Error(`Route failed: ${gt.statusText}`);const xt=await gt.json();if(en.current)return;if(xt&&typeof xt=="object"&&!Array.isArray(xt)&&ae(Mt=>({...Mt,feedback:xt})),((Z=M.onSuccess)==null?void 0:Z.type)==="toast"&&M.onSuccess.value)je(M.onSuccess.value,"success");else if(((B=M.onSuccess)==null?void 0:B.type)==="navigate"&&M.onSuccess.value){const Mt=M.onSuccess.value;if(it(Mt)&&!dt){ln.current=Mt,Lt(!0);return}ne(At=>[...At,kt]),Nn(Mt)}xt!=null&&xt.data&&ae(Mt=>({...Mt,...xt.data})),xt!=null&&xt.user&&typeof xt.user=="object"&&ae(Mt=>({...Mt,user:xt.user})),fn.current[J.replace(/^\//,"")]={response:xt},ae(Mt=>({...Mt}))}else if($.startsWith("navigate:")){const tt=$.replace("navigate:","");if(it(tt)&&!dt){ln.current=tt,Lt(!0);return}ne(J=>[...J,kt]),Nn(tt)}else if($.startsWith("go_to_step:")){const tt=$.replace("go_to_step:","").split("?")[0].trim();if(it(tt)&&!dt){ln.current=tt,Lt(!0);return}ne(J=>[...J,kt]),Nn(tt)}else if($.startsWith("show_toast:")){const tt=$.replace("show_toast:","");tt&&je(tt,"success")}else if($.startsWith("show_modal:")){const tt=$.replace("show_modal:","");if(We[tt]){const Q=We[tt],J=Q.clearFormKeys;ae(at=>{const ut={...at};let gt=Array.isArray(J)&&J.length>0;if(gt)for(const xt of J)delete ut[xt];for(const xt of Object.keys(ut))xt.startsWith("__acc_")&&(delete ut[xt],gt=!0);return gt?ut:at}),Q.preload&&await Ts(String(Q.preload)),cn({id:tt,definition:Q})}else{const Q=tt.split("|");cn({id:"__legacy",definition:{title:Q[0]||"Notice",components:Q[1]?[{type:"text",text:Q[1],color:ce.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}}else if($.startsWith("toast:")){const tt=$.replace("toast:","");je(tt,"success")}}catch(tt){if(tt instanceof ko&&Jn(tt,M==null?void 0:M.onError))return;(W=M.onError)!=null&&W.message&&je(M.onError.message,"error")}},[kt,et,dt]),Ca=v.useRef(null),Oa=v.useRef(null);v.useEffect(()=>{const M=Oa.current;Oa.current=kt;const $=ge==null?void 0:ge.events,k=Array.isArray($==null?void 0:$.onLoad)?$.onLoad:$!=null&&$.onLoad?[$.onLoad]:[];k.length!==0&&M!==kt&&k.forEach(Z=>qr(Z))},[kt,ge==null?void 0:ge.events,qr]),v.useEffect(()=>{var $,k;const M=Ca.current;if(Ca.current=kt,M&&M!==kt){const Z=et.find(W=>W.id===M),B=(Z==null?void 0:Z.type)==="render_scene"?Z.config:null;(k=($=B==null?void 0:B.events)==null?void 0:$.onLeave)!=null&&k.action&&qr(B.events.onLeave)}},[kt,et,qr]),v.useEffect(()=>{const M=ge==null?void 0:ge.events;if(!(M!=null&&M.onVisibilityChange))return;const $=()=>{var k,Z,B,W;document.hidden?(Z=(k=M.onVisibilityChange)==null?void 0:k.onHidden)!=null&&Z.action&&qr(M.onVisibilityChange.onHidden):(W=(B=M.onVisibilityChange)==null?void 0:B.onVisible)!=null&&W.action&&qr(M.onVisibilityChange.onVisible)};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},[kt,ge==null?void 0:ge.events,qr]);const Vi=v.useCallback(async(M,$)=>{Cn(k=>({...k,[M]:!0}));try{await $()}finally{Cn(k=>({...k,[M]:!1}))}},[]),li=v.useRef({}),Ui=v.useRef(new Set),hn=v.useRef(new Set),jn=v.useRef(null),Ma=v.useRef([]),Mo=v.useRef({}),Dn=v.useCallback(async(M,$,k=0,Z=10,B,W,tt,Q=!1)=>{var at;if(!M||Ke.current||!dt)return;li.current[$]=M;const J=M.match(/^\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*\}\}$/);if(J){const ut=Zr(`${J[1]}${J[2]?"."+J[2]:""}`);if(Array.isArray(ut))return Vr(gt=>({...gt,[$]:ut})),fn.current[$]=ut,fn.current[M]=ut,Ni(gt=>({...gt,[$]:{page:k,limit:Z,total:ut.length,hasMore:(k+1)*Z<ut.length}})),ut}So.current.has($)||Ri(ut=>({...ut,[$]:!0}));try{let ut=[],gt=0,xt;const Mt=Ei.current;if(ps(M,$),_u(M)&&t){const mt=Sm(M,{limit:Z,page:k}),At=B?Ih(mt,B,W):mt,a=su(At),d=await Uf(t,a,Mt);xt=d,ut=(d==null?void 0:d.emails)||(d==null?void 0:d.items)||(d==null?void 0:d.data)||(d==null?void 0:d.history)||(Array.isArray(d)?d:[]),gt=((at=d==null?void 0:d.pagination)==null?void 0:at.total)??(d==null?void 0:d.count)??ut.length}else if(!_u(M)){const mt=t==null?void 0:t.endpoint,At=N||(mt&&/^https?:\/\//.test(mt)?mt:window.location.origin);let a=M;!N&&mt&&!/^https?:\/\//.test(mt)&&typeof mt=="string"&&(a=`${mt.replace(/\/+$/,"")}${M.startsWith("/")?M:`/${M}`}`),Gg("[fetchListData] apiUrl=%s baseUrl=%s dataSource=%s origin=%s",N,At,M,window.location.origin);const d=new URL(a,At);d.searchParams.set("limit",String(Z)),d.searchParams.set("offset",String(k*Z)),B&&(d.searchParams.set("sort",B),d.searchParams.set("dir",W||"asc"));const g=await fetch(d.toString(),{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(await Oo(g)||en.current)return;let _=null;try{_=await g.json()}catch{}if(!g.ok){const C=typeof(_==null?void 0:_.message)=="string"&&_.message||typeof(_==null?void 0:_.error)=="string"&&_.error||`Request failed: ${g.statusText}`;throw new ko([C],_||void 0)}if(xt=_,en.current)return;ut=Array.isArray(_)?_:Array.isArray(_.data)?_.data:Array.isArray(_.items)?_.items:[],gt=_.count??_.total??ut.length}if(Vr(mt=>{if(Q&&Array.isArray(mt[$])){const At=new Set(mt[$].map(d=>d==null?void 0:d.id)),a=[...mt[$],...ut.filter(d=>!At.has(d==null?void 0:d.id))];return{...mt,[$]:a}}return{...mt,[$]:ut}}),So.current.add($),fn.current[$]=ut,M&&(fn.current[M]=ut),tt&&(fn.current[tt]={items:ut,response:xt},M)){const mt=Mo.current[tt];mt&&mt!==M&&Zg(`[renderer] duplicate list key "${tt}" used for both ${mt} and ${M}`),Mo.current[tt]=M}{const mt=String(M||"").replace(/^\//,"").split("?")[0];mt&&(fn.current[mt]={response:xt})}return Ni(mt=>({...mt,[$]:{page:k,limit:Z,total:gt,hasMore:(k+1)*Z<gt}})),ut}catch(ut){if(ut instanceof ko&&Jn(ut))return;Vr(gt=>{const xt=gt[$];return Array.isArray(xt)&&xt.length>0?gt:{...gt,[$]:[]}})}finally{Ri(ut=>({...ut,[$]:!1}))}},[t,dt,ps]),fr=()=>{const M=N||(t==null?void 0:t.endpoint);return M&&/^https?:\/\//.test(M)?M:M!=null&&M.startsWith("/")?`${window.location.origin}${M}`:window.location.origin},Ps=v.useRef(null);v.useEffect(()=>{var B;if(!dt)return;const M=r||localStorage.getItem("token");if(!M){G(!0);return}const $=((e==null?void 0:e.steps)||[]).find(W=>W.id===kt);if(!(((B=$==null?void 0:$.config)==null?void 0:B.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0||nt)||Ps.current===M)return;let Z=!1;return(async()=>{var W;try{const tt=await fetch(`${fr()}/admin/users/me`,{headers:{Authorization:`Bearer ${M}`}});if(Z)return;if(tt.ok){const Q=await tt.json().catch(()=>null);Ps.current=M,G(!1),lt(typeof((W=Q==null?void 0:Q.user)==null?void 0:W.emailVerified)=="boolean"?Q.user.emailVerified:null)}else kt&&(ln.current=kt),Ps.current=null,G(!0),Ct(!1),lt(null)}catch{Z||(kt&&(ln.current=kt),G(!0))}})(),()=>{Z=!0}},[dt,kt,e==null?void 0:e.steps]);const $h=v.useCallback((M,$,k)=>{!M||$.length===0||Vr(Z=>{const B={...Z};for(const[W,tt]of Object.entries(li.current)){if(tt!==M||!Z[W])continue;const Q=Z[W];k==="remove"&&(B[W]=Q.filter(J=>!$.includes(J.id)))}return B})},[]),Or=v.useCallback((M,$)=>{var tt,Q;const k=new Map;for(const[J,at]of Object.entries(Mo.current))k.set(at,J);const Z=new Map;for(const[J,at]of Object.entries(li.current))Z.set(J,{ds:at,dataKey:k.get(at)});for(const[J,at]of Object.entries(Mo.current))Object.values(li.current).includes(at)||Z.set(J,{ds:at,dataKey:J});if(Z.size===0)return;const B=Array.isArray($)?new Set($):void 0,W=(J,at)=>Ui.current.has(J)||(at?Ui.current.has(at):!1);for(const[J,{ds:at,dataKey:ut}]of Z){if(!W(J,ut))continue;const gt=!!(B!=null&&B.has(J)||ut&&(B!=null&&B.has(ut)));if($==="view"||gt){Dn(at,J,0,((tt=On[J])==null?void 0:tt.limit)||10,void 0,void 0,ut);continue}const xt=at==null?void 0:at.split("?")[0];xt&&M.startsWith(xt)&&Dn(at,J,0,((Q=On[J])==null?void 0:Q.limit)||10,void 0,void 0,ut)}},[Dn,On]),pe=v.useCallback((M,$,k,Z)=>{const B=String(M||"").toUpperCase();if(B==="GET"||Z===!1)return;const W=Z==="remove"||Z==="merge"||Z==="add"||Z==="refresh"?Z:B==="DELETE"?"remove":B==="PUT"||B==="PATCH"?"merge":B==="POST"?"add":null;if(!W||W==="refresh")return;const tt=()=>{const J=String($).match(/\/([^/]+)\/?$/);return J?decodeURIComponent(J[1]):void 0},Q=[];for(const[J,at]of Object.entries(li.current))at&&$.startsWith(at)&&Q.push({key:J,ds:at});Q.length!==0&&Vr(J=>{const at={...J};for(const{key:ut,ds:gt}of Q){const xt=J[ut]||[];if(W==="remove"){const Mt=(k==null?void 0:k.id)||tt();at[ut]=xt.filter(mt=>mt.id!==Mt)}else if(W==="merge"){const Mt=(k==null?void 0:k.id)||tt();at[ut]=xt.map(mt=>mt.id===Mt?{...mt,...k}:mt)}else{const Mt={...k||{},id:(k==null?void 0:k.id)||`temp_${Date.now()}`};W==="add"&&Mt.status===void 0&&(Mt.status="queued"),at[ut]=[Mt,...xt]}}return at})},[]),ka=v.useCallback((M,$,k,Z)=>{var J;const B=fr();let W=!1;const tt=at=>{W||(W=!0,at())},Q=t==null?void 0:t.queues;if(M==="sse"&&(Q!=null&&Q.subscribe))try{const at=Z.sseUrl||`${B}/queues/bulk-operations/jobs/${$}/subscribe?token=${encodeURIComponent(k)}`,ut=((t==null?void 0:t.endpoint)||B).replace(/\/$/,""),gt=at.startsWith(ut)?at.slice(ut.length):at;Q.subscribe(gt,{onComplete:xt=>tt(()=>Z.onComplete(xt)),onFailed:xt=>tt(()=>Z.onFailed({message:xt||"Subscription failed",kind:"transport"})),onError:()=>tt(()=>Z.onFailed({message:"Stream error",kind:"transport"})),onConnected:()=>{},onProgress:xt=>{var Mt;return(Mt=Z.onProgress)==null?void 0:Mt.call(Z,xt)}}),setTimeout(()=>tt(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="ws"&&((J=t==null?void 0:t.client)!=null&&J.createWebSocket))try{const at=t.client.createWebSocket(`job:${$}`);at.onmessage=ut=>{try{const gt=JSON.parse(ut.data);(gt==null?void 0:gt.type)==="completed"?tt(()=>Z.onComplete(gt.result)):(gt==null?void 0:gt.type)==="failed"&&tt(()=>Z.onFailed({message:gt.error||"Job failed",kind:"job"}))}catch{}},at.onerror=()=>tt(()=>Z.onFailed({message:"Connection error",kind:"transport"})),setTimeout(()=>tt(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="poll"&&(Q!=null&&Q.getJob)){const at=window.setInterval(async()=>{var ut;try{const gt=await Q.getJob("bulk-operations",$),xt=(gt==null?void 0:gt.status)||((ut=gt==null?void 0:gt.job)==null?void 0:ut.status),Mt=(gt==null?void 0:gt.result)||(gt==null?void 0:gt.data);xt==="failed"||Mt!=null&&Mt.final?(window.clearInterval(at),tt(()=>xt==="failed"?Z.onFailed({message:(Mt==null?void 0:Mt.error)||"Job failed",kind:"job"}):Z.onComplete(Mt))):xt==="completed"&&(window.clearInterval(at),tt(()=>Z.onComplete(Mt)))}catch{}},600);setTimeout(()=>{window.clearInterval(at),tt(()=>Z.onFailed({message:"Timed out",kind:"transport"}))},3e4);return}tt(()=>Z.onFailed({message:"Feedback transport unavailable",kind:"transport"}))},[]),dr=v.useCallback(async(M,$,k)=>{var ut,gt;const Z=t==null?void 0:t.files,B=encodeURIComponent(r||localStorage.getItem("token")||"");if(Z!=null&&Z.upload){const xt=await Z.upload(M,$||{},k),Mt=(xt==null?void 0:xt.url)||(xt==null?void 0:xt.path)||"";return Mt?(xt==null?void 0:xt.visibility)==="public"?Mt:`${fr()}${Mt}?token=${B}`:""}const W=new FormData;W.append("file",M),$!=null&&$.entityType&&W.append("entityType",$.entityType),$!=null&&$.entityId&&W.append("entityId",$.entityId),$!=null&&$.visibility&&W.append("visibility",$.visibility);const tt=await fetch(`${fr()}/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:W});if(!tt.ok)throw new Error("Upload failed");const Q=await tt.json(),J=((ut=Q==null?void 0:Q.asset)==null?void 0:ut.url)||(Q==null?void 0:Q.url)||(Q==null?void 0:Q.path)||(Q==null?void 0:Q.id)||"";return J?((gt=Q==null?void 0:Q.asset)==null?void 0:gt.visibility)==="public"?J:`${fr()}${J}?token=${B}`:""},[]),As=v.useCallback(async(M,$,k,Z)=>{var tt;if(!(M!=null&&M.endpoint)||Z.length===0)return;const B=M.endpoint,W=M.optimistic??!0;try{const Q=await fetch(fr()+B,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:JSON.stringify({ids:Z})});let J={};try{J=await Q.json()}catch{}if(!Q.ok){je(((tt=J==null?void 0:J.error)==null?void 0:tt.message)||"Request failed","error");return}W!==!1&&(W==="remove"||W==="refresh"?W:J.softUpdate||(M.action==="delete"?"remove":"refresh"))==="remove"&&$h($,Z,"remove"),ae(ut=>({...ut,_selIds:[],_selectMode:!1}));const at=(ut,gt,xt)=>{var Mt;if(ut)je(xt||"Bulk operation failed","error");else{const mt=gt||{},At=mt.total??Z.length,a=mt.successful??At;je(a>=At?`${a} ${M.action}d`:`${a} of ${At} ${M.action}d`,"success")}Dn($,k,0,((Mt=On[k])==null?void 0:Mt.limit)||10)};J.jobId&&J.token&&M.feedback?ka(M.feedback,J.jobId,J.token,{onComplete:ut=>at(!1,ut),onFailed:ut=>{var gt;if(ut.kind==="transport"){Dn($,k,0,((gt=On[k])==null?void 0:gt.limit)||10);return}at(!0,null,ut.message)}}):at(!1,J)}catch{je("Request failed","error")}},[$h,ka,Dn,On]),Ih=(M,$,k)=>{const Z=su(M),B=Z.indexOf("(");if(B===-1)return M;const W=Z.slice(B+1,-1).trim(),tt=`sort: "${$}", dir: ${k==="desc"?'"desc"':'"asc"'}`;if(!W)return M.replace(/\(\)$/,`({${tt}})`);const Q=W.lastIndexOf(",");if(Q===-1)return M.replace(/\(([^)]*)\)$/,`(${W}, {${tt}})`);const J=W.slice(Q+1).trim();return J.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${W.slice(0,Q)}, {${J.slice(1,-1)}, ${tt}})`):M.replace(/\(([^)]*)\)$/,`(${W}, {${tt}})`)},Sm=(M,$)=>{const k=su(M),Z=k.indexOf("(");if(Z===-1)return M;const B=k.slice(Z+1,-1).trim(),W=`limit: ${$.limit}, page: ${$.page}`;if(!B)return M.replace(/\(\)$/,`({${W}})`);const tt=B.lastIndexOf(",");if(tt===-1)return M.replace(/\(([^)]*)\)$/,`(${B}, {${W}})`);const Q=B.slice(tt+1).trim();return Q.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${B.slice(0,tt)}, {${Q.slice(1,-1)}, ${W}})`):M.replace(/\(([^)]*)\)$/,`(${B}, {${W}})`)};v.useEffect(()=>()=>{en.current=!0},[]),ce.colors.background;const gn=v.useMemo(()=>`bf-preview-${Math.random().toString(36).slice(2,9)}`,[]),Pm=M=>M.replace(/:(\w+)/g,($,k)=>{const Z=de[k];return Z===void 0?$:String(Z)}),Rh=M=>{try{const $=JSON.parse(M);if(Array.isArray($)&&$.length>0)return $.map(k=>{var Z;return k.message||`${((Z=k.path)==null?void 0:Z.join("."))||"field"} is invalid`})}catch{}return null};class ko extends Error{constructor(k,Z){super(k.join(", "));Mm(this,"errors");Mm(this,"body");this.errors=k,this.body=Z}}const Ts=async(M,$)=>{var Mt,mt,At,a,d;if(Ke.current||!dt)return;const{method:k,path:Z}=Ce(M),B=Pm(Z),W=k!=="GET"&&k!=="DELETE",tt=fr();k!=="GET"&&pe(k,B,de,($==null?void 0:$.optimistic)??!0);let Q;if($!=null&&$.payload&&typeof $.payload=="object"){Q={};for(const[g,_]of Object.entries($.payload))Q[g]=typeof _=="string"&&_.includes("{{")?Es(_):_}else Q=de;Q=xc(Q);const J=await fetch(new URL(B,tt).toString(),{method:k,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...W?{body:JSON.stringify(Q)}:{}});if(await Oo(J)||en.current)return;let at;try{at=await J.json()}catch{if(en.current)return;if(!J.ok)throw new ko([`Request failed: ${J.statusText}`]);return}if(!J.ok||at.success===!1){Or(B,$==null?void 0:$.refetchScope);let g=["Something went wrong"];throw(Mt=at.error)!=null&&Mt.message?g=Rh(at.error.message)||[at.error.message]:at.message&&(g=[at.message]),new ko(g,at)}at.token&&localStorage.setItem("token",at.token),at&&typeof at=="object"&&!Array.isArray(at)&&ae(g=>({...g,feedback:at})),at.data&&($==null?void 0:$.mergeResponse)!==!1&&ae(g=>({...g,...at.data})),at.user&&typeof at.user=="object"?ae(g=>({...g,user:at.user})):ae(g=>({...g})),fn.current[B.replace(/^\//,"")]={response:at};for(const[g,_]of Object.entries(Mo.current))if(_===B||_.endsWith(B)){const C=fn.current[g];fn.current[g]={items:Array.isArray(C)?C:Array.isArray(C==null?void 0:C.items)?C.items:[],response:at}}const ut=(At=(mt=at.subscribe)==null?void 0:mt.websocket)==null?void 0:At.workflowChannel;ut&&($==null?void 0:$.mergeResponse)!==!1&&ae(g=>{var _,C,R,q;return{...g,liveCastChannel:ut,execution_id:at.draftId||g.execution_id,id:at.sessionId||g.id,status:"running",test_session:{...g.test_session||{},id:at.sessionId||((_=g.test_session)==null?void 0:_.id),execution_id:at.draftId||((C=g.test_session)==null?void 0:C.execution_id),status:"running",liveCastChannel:ut,prompt:(Q==null?void 0:Q.prompt)||((R=g.test_session)==null?void 0:R.prompt),url:(Q==null?void 0:Q.url)||((q=g.test_session)==null?void 0:q.url)}}}),Or(B,$==null?void 0:$.refetchScope);const gt=$==null?void 0:$.feedback,xt=typeof gt=="string"?gt:gt==null?void 0:gt.transport;if(xt&&at.jobId&&(at.token||(a=at.subscribe)!=null&&a.sse||typeof gt=="object")){let g=(d=at.subscribe)!=null&&d.sse?/^https?:\/\//.test(at.subscribe.sse)?at.subscribe.sse:tt+at.subscribe.sse:void 0;if(typeof gt=="object"&&gt.subscribeUrl){const _=String(gt.subscribeUrl).trim(),C=_.startsWith("{{")&&_.endsWith("}}")?_.slice(2,-2).trim():_,R=C.match(/^\[(.+?)\](?:\.(.*))?$/),q=R?Zr(`${R[1]}${R[2]?"."+R[2]:""}`):C.split(".").reduce((rt,ot)=>rt==null?void 0:rt[ot],at);q&&(g=/^https?:\/\//.test(q)?q:tt+q)}if(g){ka(xt,at.jobId,at.token,{sseUrl:g,onProgress:_=>{s==null||s(_);const C=Date.now();C-xo.current>=2e3&&(xo.current=C,Or(B,$==null?void 0:$.refetchScope))},onComplete:_=>{const C=(_==null?void 0:_.result)??_;if(C&&typeof C=="object"){const R=B.replace(/^\//,"");fn.current[R]={response:C},ae(q=>({...q}))}Or(B,$==null?void 0:$.refetchScope)},onFailed:_=>{Or(B,$==null?void 0:$.refetchScope),_.kind!=="transport"&&je(_.message||"Job failed","error")}});return}ka(xt,at.jobId,at.token,{onComplete:_=>{const C=_||{},R=C.total,q=C.successful;R!==void 0&&je(q>=R?`${q} completed`:`${q} of ${R} completed`,"success"),Or(B,$==null?void 0:$.refetchScope)},onFailed:_=>{if(_.kind==="transport"){Or(B,$==null?void 0:$.refetchScope);return}je(_.message||"Job failed","error"),Or(B,$==null?void 0:$.refetchScope)}})}},pr=M=>{var Z,B;cn(null);const $=M==="/"&&(((Z=et.find(W=>W.route==="/"))==null?void 0:Z.id)||((B=et.find(W=>W.type==="render_scene"))==null?void 0:B.id))||M;if(it($)&&!dt){ln.current=$,Lt(!0);return}ne(W=>[...W,kt]),Nn($)},wc=(M,$="error")=>{if(ae(k=>({...k,gateTitle:M.uiTitle||"Usage Notice",gateMessage:M.message})),M.uiVariant!=="modal"){const k=M.uiTitle?`${M.uiTitle}
194
+ `}function iht(e,t,n,r){return v.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",minHeight:"100%",backgroundColor:e.colors.background,gap:"16px"}},V("p",{style:{color:e.colors.text,fontSize:"1.125rem"}},"Scene not found"),v.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"center"}},t>0&&v.createElement("button",{onClick:n,style:{padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.surfaceHover,color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:e.effects.transition},onMouseOver:i=>i.target.style.backgroundColor=e.colors.border,onMouseOut:i=>i.target.style.backgroundColor=e.colors.surfaceHover},"← Go Back"),r&&v.createElement("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"6px",padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.primary,variant:"outline",color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:"opacity 0.2s"},onMouseOver:i=>i.target.style.opacity="0.85",onMouseOut:i=>i.target.style.opacity="1"},v.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},V("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),"Generate Scene")))}function oht(e){return v.createElement("div",{key:"preview-modal",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},v.createElement("div",{style:{backgroundColor:e.colors.background,borderRadius:"12px",padding:"24px",maxWidth:"360px",width:"90%",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.4)",border:"1px solid rgba(255, 255, 255, 0.08)"}},V("h3",{style:{color:e.colors.text,fontSize:"16px",fontWeight:600,marginBottom:"12px"}},"Sample Modal"),V("p",{style:{color:e.colors.textSecondary,fontSize:"14px",marginBottom:"20px"}},"This is a preview of the modal component for styling."),v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"}},V("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:"rgba(255,255,255,0.08)",color:e.colors.text,border:`1px solid ${e.colors.borderSubtle}`}},"Cancel"),V("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:e.colors.primary,color:e.colors.text,border:"none"}},"Confirm"))))}function vT(e,t,n,r,i,o,s){var O,I,N,F,D,j,K,U,z,Y,G;if(!e)return null;const{definition:l,closing:c}=e,h=l.variant?(O=l.variants)==null?void 0:O[l.variant]:void 0,u={...l,...h,style:{...l.style,...h==null?void 0:h.style},components:(h==null?void 0:h.components)||l.components,actions:(h==null?void 0:h.actions)||l.actions},f=u.popover===!0,m=(I=u.style)==null?void 0:I.placement,y=m==="left"||m==="right"||m==="bottom"?m:"center",x=u.drawer===!0||y==="left"||y==="right",p=y==="bottom",b=c===!0,P=u.className||"",S=P?((N=n.parseClassNameResponsive)==null?void 0:N.call(n,P,`modal-${e.id}`))??n.parseClassName(P):{},A=f&&s&&s.top>window.innerHeight/2&&s.bottom+300>window.innerHeight,E=s?Math.min(Math.max(12,s.left),Math.max(12,window.innerWidth-372)):void 0,w=()=>{var X;b||(X=i||n.dismissModal)==null||X()},T=v.createElement("div",{key:`modal-overlay-${e.id||"base"}`,style:{position:"fixed",top:0,left:0,right:0,bottom:0,animation:b?"bf-fade-out 0.2s ease forwards":"bf-fade-in 0.15s ease",backdropFilter:f?void 0:"blur(4px)",WebkitBackdropFilter:f?void 0:"blur(4px)",display:"flex",alignItems:f?"flex-start":p?"flex-end":"center",justifyContent:f?"flex-end":x?y==="left"?"flex-start":"flex-end":"center",paddingTop:void 0,paddingRight:void 0,backgroundColor:f?"transparent":((F=u.style)==null?void 0:F.overlayColor)||"rgba(0,0,0,0.45)",pointerEvents:"auto",zIndex:o||1e4},onClick:X=>{X.target===X.currentTarget&&w()}},v.createElement("div",{className:P||void 0,style:{pointerEvents:f?"auto":void 0,...f?{position:"fixed",top:A||!s?A?void 0:"116px":`${s.bottom+8}px`,bottom:A?`${Math.max(12,window.innerHeight-s.top+8)}px`:void 0,left:E===void 0?void 0:`${E}px`,right:E===void 0?"24px":void 0}:{},backgroundColor:((D=u.style)==null?void 0:D.backgroundColor)||r||t.colors.background,borderRadius:x?"0px":((j=u.style)==null?void 0:j.borderRadius)||(p?"16px 16px 0 0":"12px"),padding:x?"0.5rem":p?"16px":"24px",height:x?"100%":"auto",maxHeight:p?"90vh":x?void 0:"85vh",maxWidth:x?"520px":p?n.isMobileView?"none":"640px":((K=u.style)==null?void 0:K.width)||{sm:"min(360px, 92vw)",md:"min(480px, 92vw)",lg:"min(720px, 92vw)",full:"90vw"}[u.size||"sm"]||"min(400px, 92vw)",width:(U=u.style)!=null&&U.width?"100%":x?"90vw":p?"100%":"90%",boxShadow:x?y==="left"?"4px 0 24px rgba(0, 0, 0, 0.4)":"-4px 0 24px rgba(0, 0, 0, 0.4)":p?"0 -8px 32px rgba(0, 0, 0, 0.45)":"0 20px 40px rgba(0, 0, 0, 0.4)",...f?{minWidth:"min(360px, 92vw)",marginRight:"0px",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.45)"}:{},border:"none",borderLeft:x&&y==="right"?`1px solid ${((z=u.style)==null?void 0:z.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",borderRight:x&&y==="left"?`1px solid ${((Y=u.style)==null?void 0:Y.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",overflow:"auto",animation:x?b?y==="left"?"bf-slide-out-left 0.2s ease forwards":"bf-slide-out-right 0.2s ease forwards":y==="left"?"bf-slide-in-left 0.2s ease":"bf-slide-in-right 0.2s ease":p?b?"bf-slide-out-down 0.2s ease forwards":"bf-slide-in-up 0.25s ease":b?"bf-fade-out 0.2s ease forwards":void 0,...S}},p?v.createElement("div",{key:"bf-sheet-handle",style:{width:"40px",height:"4px",borderRadius:"2px",backgroundColor:"rgba(255, 255, 255, 0.2)",margin:"0 auto 12px",flexShrink:0}}):null,u.icon?v.createElement("div",{style:{textAlign:"center",marginBottom:"12px",display:"flex",justifyContent:"center"}},n.renderIcon(u.icon,32)):null,u.title?v.createElement("h3",{style:{color:t.colors.text,fontSize:u.icon?"18px":"16px",fontWeight:600,marginBottom:"12px",marginTop:"4px",paddingLeft:x?"1.5rem":"0px",paddingRight:x?"1.5rem":"0px",textAlign:u.icon?"center":"left"}},n.interpolateText(u.title)):null,...(u.components||[]).map((X,lt)=>Wf(n,X,lt,"modal")),(((G=u.actions)==null?void 0:G.length)||0)>0?v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"20px"}},...(u.actions||[]).map((X,lt)=>{const et=(ct=>{const yt=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ct);if(!yt)return!1;const[vt,Et,Tt]=[parseInt(yt[1],16),parseInt(yt[2],16),parseInt(yt[3],16)];return(vt*299+Et*587+Tt*114)/1e3>150})(t.colors.primary)?"#000000":"#ffffff",it={primary:{background:t.colors.primary,color:et,border:"none"},secondary:{background:"rgba(255, 255, 255, 0.08)",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},ghost:{background:"transparent",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},danger:{background:t.colors.danger,color:"#ffffff",border:"none"}},at=it[X.variant||"primary"]||it.primary;return v.createElement("button",{key:lt,onClick:()=>{if(e.legacyOnConfirm&&X.label==="Confirm"){w(),setTimeout(()=>{var ct;return(ct=e.legacyOnConfirm)==null?void 0:ct.call(e)},250);return}X.onClick&&n.handleButtonClick(X.onClick,{onSuccess:X.onSuccess,onError:X.onError}),X.dismiss&&w()},style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,...at}},X.label)})):null));return f&&typeof document<"u"?cb.createPortal(T,document.body):T}const sht=new va,dp=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},Gg=(...e)=>{dp()&&console.log(...e)},Zg=(...e)=>{dp()&&console.warn(...e)};let J$=null;window.addEventListener("message",e=>{var t,n,r;(((t=e.data)==null?void 0:t.type)==="auth"||((n=e.data)==null?void 0:n.type)==="auth-token")&&((r=e.data)!=null&&r.token)&&(J$=e.data.token,localStorage.setItem("token",e.data.token),e.data.refreshToken&&localStorage.setItem("backflow_refresh_token",e.data.refreshToken),e.data.userId&&localStorage.setItem("backflow_refresh_user_id",e.data.userId))});function Rf(e){try{const t=JSON.parse(atob(e.split(".")[1]));return typeof t.exp!="number"||t.exp*1e3<=Date.now()}catch{return!0}}function aht({workflow:e,sdk:t,iconResolver:n,authToken:r,nativeAction:i,onRouteExecute:o,onJobProgress:s,appName:l,appIcon:c,selectedComponentKey:h,selectedComponentClass:u,styleOverrides:f,interactionDisabled:m,theme:y,imageReplacements:x,currentSceneId:p,onSceneChange:b,onGenerateScene:P,enableRouting:S,routingMode:A,previewElement:E,tenantId:w,appId:T,renderPhaserGame:O,renderMode:I,apiUrl:N,workflowBaseUrl:F,initialScene:D,previewMode:j,remoteSessionId:K,devDiagnostics:U}){var vr,Is,qh,Rs,Gh,$c,Zh,Lo,Yh,Yi,Ic,Rc,Kh,Mr,Lc,Nc;const z=(()=>{const M=J$||localStorage.getItem("token");return!!M&&!Rf(M)})(),[Y,G]=v.useState(!z),[X,lt]=v.useState(null),H=v.useMemo(()=>Array.isArray(e==null?void 0:e.steps)?e.steps:[],[e]),et=v.useMemo(()=>{const M=H;return e&&!Array.isArray(e.steps)&&(Zg("[WorkflowRenderer] NON-ARRAY steps:",typeof e.steps,JSON.stringify(e.steps).slice(0,500)),Zg("[WorkflowRenderer] Workflow keys:",Object.keys(e))),Y!==!0?M:M.filter($=>{var k,Z;return!($.requiresAuth===!0||((k=$.config)==null?void 0:k.requireAuth)===!0||((Z=$.config)==null?void 0:Z.requiresAuth)===!0)})},[e,Y,H]),it=v.useCallback(M=>{var k;const $=H.find(Z=>Z.id===M);return((k=$==null?void 0:$.config)==null?void 0:k.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0},[H]),at=e&&!((vr=e.config)!=null&&vr.colorMode)?fI(e):void 0,ct=NT(at?{...(e==null?void 0:e.config)||{},colorMode:at}:e==null?void 0:e.config,void 0,y),yt=!((Is=e==null?void 0:e.config)!=null&&Is.colorMode)&&!at&&!(y!=null&&y.colorMode),vt=M=>_x(M,{primary:ce.colors.primary,accent:ce.colors.accent,colorMode:ce.colorMode},yt),Et=I||"legacy",Tt=A||(S?"hash":"memory"),ft=Tt!=="memory",[dt,Ct]=v.useState(z),[nt,Lt]=v.useState(!1),[bt,me]=v.useState(!1),{sceneToRoute:ie,routeToScene:Xt}=v.useMemo(()=>K$(et),[et]),Ne=v.useMemo(()=>{var $,k;if(D&&et.some(Z=>Z.id===D))return D;const M=et.filter(Z=>Z.type==="render_scene");return(($=M.find(Z=>Z.route==="/"))==null?void 0:$.id)||((k=M[0])==null?void 0:k.id)||""},[et,D]),Wt=v.useMemo(()=>{if(ft){const M=Tt==="hash"?ab(Xt):gT(Xt);if(M)return M}return Ne},[Ne,ft,Tt,Xt]),[ee,ne]=v.useState([]),[Yt,oe]=v.useState(Wt),Me=v.useRef(null),se=wC(Me),on=v.useRef(!1);v.useRef(null);const en=v.useRef(!1),Ke=v.useRef(!1),xo=v.useRef(0),ln=v.useRef(null);v.useEffect(()=>(en.current=!1,LT(),()=>{en.current=!0}),[]),v.useEffect(()=>{r&&localStorage.setItem("token",r)},[r]);const kt=p??Yt;v.useEffect(()=>{var Q,J,ot;const M=et.find(ut=>ut.id===kt),$=!!((Q=e==null?void 0:e.config)!=null&&Q.remoteControl)&&!!(M!=null&&M.remoteScene);if(AT($),TT($&&!!((ot=(J=e==null?void 0:e.config)==null?void 0:J.mouse)!=null&&ot.enabled)),!$||!K){Xg();return}const k=N||(t==null?void 0:t.endpoint),Z=k&&/^https?:\/\//.test(k)?k:window.location.origin,B=new URL("/ws",Z);B.protocol=B.protocol==="https:"?"wss:":"ws:";const W=B.toString(),tt=`agent:${w||"default"}:${K}`;return RT(W,tt,r||localStorage.getItem("token")||void 0),()=>Xg()},[(qh=e==null?void 0:e.config)==null?void 0:qh.remoteControl,(Gh=(Rs=e==null?void 0:e.config)==null?void 0:Rs.mouse)==null?void 0:Gh.enabled,et,kt,K,w,N,t,r]);const Nn=v.useCallback(M=>{oe(M),b==null||b(M)},[b]);v.useEffect(()=>{var k;const M=et.find(Z=>Z.id===kt),$=((k=M==null?void 0:M.config)==null?void 0:k.requireAuth)===!0||(M==null?void 0:M.requiresAuth)===!0;kt&&!$&&Lt(!1)},[kt,et]);const We=(e==null?void 0:e.modals)||{};v.useEffect(()=>{if(!dt)return;const M=ce.startupModal;!M||!We[M]||localStorage.getItem(`backflow_startup_modal_${M}`)||cn({id:M,definition:We[M]})},[dt]);const Ti=v.useRef(typeof window>"u"?null:new URLSearchParams(window.location.search).get("customer_session_token"));v.useEffect(()=>{if(!dt||!Ti.current||!We["payment-success"])return;window.history.replaceState({},"",window.location.pathname);const $=setTimeout(()=>{We["payment-success"]&&cn({id:"payment-success",definition:We["payment-success"]})},400);return()=>clearTimeout($)},[dt,We["payment-success"]]),v.useEffect(()=>{Y===!0&&(!kt||et.some(M=>M.id===kt)||Ne&&Nn(Ne))},[Y,et,kt,Ne]),v.useEffect(()=>{if(ft){if(on.current){on.current=!1;return}Tt==="hash"?Vf(kt,ie,!1):qg(kt,ie,!1)}},[kt,ft,Tt,ie]),v.useEffect(()=>{ft&&(Tt==="hash"?Vf(kt,ie,!0):qg(kt,ie,!0))},[]);const wo=v.useRef(!0);v.useEffect(()=>{const M=setTimeout(()=>{wo.current=!1},1500);return()=>clearTimeout(M)},[]),v.useEffect(()=>{if(!ft)return;const M=$=>{var Z;if(wo.current)return;const k=((Z=$.state)==null?void 0:Z.sceneId)||(Tt==="hash"?ab(Xt):gT(Xt));k&&k!==kt&&(on.current=!0,Nn(k),ne(B=>B.length>0&&B[B.length-1]===k?B.slice(0,-1):B))};return window.addEventListener("popstate",M),()=>window.removeEventListener("popstate",M)},[ft,Tt,Xt,kt,Nn]),v.useEffect(()=>{var $;const M=(($=et.find(k=>k.type==="render_scene"))==null?void 0:$.id)||"";if(M&&M!==kt){if(oe(M),ne([]),b==null||b(M),!ft)return;Tt==="hash"?Vf(M,ie,!0):qg(M,ie,!0)}},[e]),v.useEffect(()=>{p&&p!==Yt&&oe(p)},[p]);const _o=v.useCallback(()=>{if(ft){window.history.back();return}if(ee.length>0){const M=ee[ee.length-1];ne($=>$.slice(0,-1)),Nn(M)}},[ee,ft]),[de,ae]=v.useState({}),Ei=v.useRef(de);v.useEffect(()=>{Ei.current=de},[de]),v.useEffect(()=>{K&&ae(M=>M.remoteSessionId===K?M:{...M,remoteSessionId:K})},[K]);const Ci=v.useMemo(()=>Array.isArray(e==null?void 0:e.workflowRefs)?e.workflowRefs:[],[e]),Tr=v.useMemo(()=>Ci.filter(M=>M.sceneIds==="*"||Array.isArray(M.sceneIds)&&M.sceneIds.includes(kt)),[kt,Ci]),[Oi,ds]=v.useState({}),Mi=v.useRef({}),ii=v.useCallback(async(M,$=!1)=>{if(!dt||!M.appId)return;const k=N||(t==null?void 0:t.endpoint)||window.location.origin,Z=!N&&typeof k=="string"&&k.startsWith("/")?k.replace(/\/+$/,""):"",B=/^https?:\/\//.test(k)?k:window.location.origin,W=`${Z}/mobile/apps/${encodeURIComponent(M.appId)}/workflow`,tt=await fetch(new URL(W,B).toString(),{cache:$?"no-cache":"default",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!tt.ok)throw new Error(`Workflow reference ${M.id} failed`);const Q=await tt.json(),J=(Q==null?void 0:Q.app)||Q;if(!Array.isArray(J==null?void 0:J.steps))throw new Error(`Workflow reference ${M.id} is invalid`);ds(ot=>({...ot,[M.id]:J}))},[N,r,dt,t]);v.useEffect(()=>{let M=!1;for(const $ of Tr){const k=`${$.appId}:${$.sourceSceneId||""}`;Mi.current[$.id]!==k&&(Mi.current[$.id]=k,ii($).catch(()=>{M||delete Mi.current[$.id]}))}return()=>{M=!0}},[Tr,ii]),v.useEffect(()=>{var Z;const M=Tr.filter(B=>{var W;return((W=B.realtime)==null?void 0:W.mode)==="ws"});if(M.length===0||!w)return;const $=(Z=t==null?void 0:t.client)==null?void 0:Z.createWebSocket;if(!$)return;const k=$(`tenant:${w}:entities`);return k.onmessage=B=>{let W;try{W=JSON.parse(B.data)}catch{return}if(!(W.type!=="entity_changed"||W.entity!=="mobile_apps"))for(const tt of M)W.id===tt.appId&&ii(tt,!0).catch(()=>{})},()=>k.close()},[Tr,ii,w,t]);const[ki,Vr]=v.useState({}),So=v.useRef(new Set),[$i,Ii]=v.useState({}),[Er,Ri]=v.useState({}),[Li,Cn]=v.useState({}),[It,Po]=v.useState({}),[On,Ni]=v.useState({}),[Ao,oi]=v.useState([]),ji=v.useRef(new Set),ur=v.useRef(new Map),Di=v.useCallback((M,$)=>{if(!(U??dp()))return;const k=`${M}:${$}`;ji.current.has(k)||(ji.current.add(k),oi(Z=>[...Z,{level:"warn",code:M,where:`runtime:${kt}`,msg:$}]))},[kt,U]),ps=v.useCallback((M,$)=>{if(!(U??dp()))return;const k=Date.now(),Z=(ur.current.get(M)||[]).filter(tt=>k-tt.at<2e3),B=Z.find(tt=>tt.componentKey!==$&&k-tt.at<500);Z.push({componentKey:$,at:k}),ur.current.set(M,Z),B&&Di("DATASOURCE_DUPLICATE_RUNTIME",`"${M}" fetched by ${B.componentKey} and ${$} within 500ms`);const W=Z.filter(tt=>tt.componentKey===$);W.length>=3&&Di("RENDER_FETCH_LOOP",`"${M}" fetched ${W.length} times by ${$} within 2s`)},[U,Di]);v.useEffect(()=>{ji.current.clear(),ur.current.clear(),oi([])},[kt]);const Ur=v.useRef(new Map),To=v.useRef(new Map),ms=v.useRef(new Set),[gs,ys]=v.useState(!1),[Te,cn]=v.useState(null),[Ea,vs]=v.useState(null),bs=v.useRef(null);v.useEffect(()=>{var $;if(!(($=Te==null?void 0:Te.definition)!=null&&$.popover))return;const M=()=>{const k=bs.current;k&&vs(k.getBoundingClientRect())};return window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),M(),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[Te==null?void 0:Te.id,($c=Te==null?void 0:Te.definition)==null?void 0:$c.popover]);const Bi=v.useCallback(()=>{cn(M=>M?{...M,closing:!0}:null),setTimeout(()=>cn(null),250)},[]),[Sn,Xn]=v.useState(null),Eo=v.useCallback(()=>{Xn(M=>M?{...M,closing:!0}:null),setTimeout(()=>Xn(null),250)},[]),si=se>0&&se<ku.md;v.useEffect(()=>{e&&typeof e=="object"&&(e.auth={signedIn:dt})},[e,dt]),v.useEffect(()=>{const M=e;if(!(M!=null&&M.config))return;if(c){M.config.logo=c,ae(k=>k&&{...k});return}if(!F)return;let $=!1;return(async()=>{for(const k of["svg","png","jpg","jpeg"]){const Z=`${F}logo.${k}`;try{if((await fetch(Z,{method:"HEAD"})).ok&&!$){M.config.logo=Z,ae(W=>W&&{...W});return}}catch{}}})(),()=>{$=!0}},[e,F,c]);const[Mn,re]=v.useState("login"),[Kt,hr]=v.useState(""),[be,St]=v.useState(""),[xe,Rt]=v.useState(""),[le,xs]=v.useState({}),[zi,kn]=v.useState(""),[ai,un]=v.useState(null),[Ge,Ie]=v.useState(!1),[Ee,ws]=v.useState({}),Hr=M=>M?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M)?null:"Invalid email address":null,Fi=M=>M?M.length>=6?null:"Password must be at least 6 characters":null,_s=(M,$)=>$?$===M?null:"Passwords do not match":null,Cr=(M,$)=>ws(k=>({...k,[M]:$||""})),Co=M=>{var $,k;return M?typeof M=="string"?M:Array.isArray(M)?(($=M[0])==null?void 0:$.message)||"Validation failed":typeof M.message=="string"?M.message:typeof M.error=="string"?M.error:(k=M.error)!=null&&k.message?M.error.message:"An error occurred":"An error occurred"},Wi=(de==null?void 0:de._colorMode)||ct.colorMode,bc=Wi==="dark"?Pu:Au,ce=Wi!==ct.colorMode?{...ct,colorMode:Wi,colors:{...bc,...ct.colors&&Wi==="dark"?ct.colors:{}}}:ct;v.useEffect(()=>{typeof document>"u"||document.documentElement.setAttribute("data-theme",ce.colorMode==="dark"?"dark":"light")},[ce.colorMode]);const Ss=v.useCallback(M=>{try{localStorage.setItem("bf_theme",M)}catch{}ae($=>({...$,_colorMode:M}))},[]);v.useEffect(()=>{if(typeof localStorage>"u")return;const M=localStorage.getItem("bf_theme");(M==="dark"||M==="light")&&ae($=>({...$,_colorMode:M}))},[]),v.useEffect(()=>{const M=localStorage.getItem("token"),$=!!M&&!Rf(M);$?(Ke.current=!1,G(!1)):G(!0),Ct($);const k=()=>{const W=localStorage.getItem("token"),tt=!!W&&!Rf(W);tt?(Ke.current=!1,G(!1)):G(!0),Ct(tt)};window.addEventListener("storage",k);const Z=W=>{var tt,Q,J;if((((tt=W.data)==null?void 0:tt.type)==="auth"||((Q=W.data)==null?void 0:Q.type)==="auth-token")&&((J=W.data)!=null&&J.token)){if(localStorage.setItem("token",W.data.token),W.data.refreshToken&&localStorage.setItem("backflow_refresh_token",W.data.refreshToken),W.data.userId&&localStorage.setItem("backflow_refresh_user_id",W.data.userId),Rf(W.data.token)){Ke.current=!0,Ct(!1);return}if(!dt&&(nt||Ke.current||!!ln.current)){window.location.reload();return}Ct(!0),Lt(!1),G(!1),Ke.current=!1}};window.addEventListener("message",Z);const B=()=>{var W;if(!Ke.current){const tt=et.find(J=>J.id===kt);if(!(((W=tt==null?void 0:tt.config)==null?void 0:W.requireAuth)===!0||(tt==null?void 0:tt.requiresAuth)===!0))return;Ke.current=!0,Ct(!1),Lt(!0)}};return window.addEventListener("auth:required",B),()=>{window.removeEventListener("storage",k),window.removeEventListener("message",Z),window.removeEventListener("auth:required",B)}},[]);const kh=async()=>{var k;const M=localStorage.getItem("backflow_refresh_token"),$=localStorage.getItem("backflow_refresh_user_id");if(!M||!$)return!1;try{const B=await(await fetch(`${window.location.origin}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:M,userId:$})})).json();if(B.success&&((k=B.data)!=null&&k.token))return B.data.refreshToken&&localStorage.setItem("backflow_refresh_token",B.data.refreshToken),localStorage.setItem("token",B.data.token),!0}catch{}return localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),!1},Oo=async(M,$=!1)=>{var k;if(M.status===401&&!nt){if(await kh())return!1;if(Gg("[bf] 401 intercepted, showAuth:",nt,"authInterceptedRef:",Ke.current),!Ke.current){Ke.current=!0,localStorage.removeItem("token"),Ct(!1);const B=et.find(tt=>tt.id===kt),W=((k=B==null?void 0:B.config)==null?void 0:k.requireAuth)===!0||(B==null?void 0:B.requiresAuth)===!0;($||W)&&(Lt(!0),kt&&(ln.current=kt))}return!0}return!1},_m=kt&&et.some(M=>M.id===kt)?kt:(Zh=et[0])==null?void 0:Zh.id,Ft=et.find(M=>M.id===_m),ge=(Ft==null?void 0:Ft.type)==="render_scene"?Ft.config:null;v.useEffect(()=>{if(!ge)return;const M=w||"default",$={TENANT_ID:M,tenantId:M,role:"user"};ae(k=>{const Z={};for(const B of Object.keys(k))B.startsWith("_")&&(Z[B]=k[B]);return{...$,...ge.sceneData||{},...Z}})},[kt,ge]),v.useEffect(()=>{const M=ce.persistedKeys;if(!M||M.length===0)return;const $={};for(const k of M){const Z=localStorage.getItem(`bf_persist_${k}`);Z&&($[k]=Z)}Object.keys($).length>0&&ae(k=>({...k,...$}))},[kt]),v.useEffect(()=>{const M=ce.persistedKeys;if(!(!M||M.length===0))for(const $ of M){const k=de[$];k&&localStorage.setItem(`bf_persist_${$}`,String(k))}});const Ce=M=>{const $=M.match(/^(GET|POST|PATCH|DELETE|PUT)\s+(.+)/);return{method:$?$[1]:"POST",path:$?$[2]:M}},xc=M=>{const $={...M};return delete $.TENANT_ID,delete $.tenantId,delete $.role,$},qr=v.useCallback(async M=>{var Z,B,W;if(!M.action)return;const $=String(M.action),k=Ei.current;try{if($.startsWith("execute_workflow:")){if(!dt)return;const{method:tt,path:Q}=Ce($.replace("execute_workflow:","")),J=Q.replace(/:(\w+)/g,(Mt,mt)=>{const At=k[mt];return At===void 0?Mt:String(At)}).replace(/\{\{(\w+)\}\}/g,(Mt,mt)=>{const At=k[mt];return At===void 0?Mt:String(At)}),ot=fr(),ut=tt!=="GET"&&tt!=="DELETE";tt!=="GET"&&pe(tt,J,k,!0);const gt=await fetch(new URL(J,ot).toString(),{method:tt,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...ut?{body:JSON.stringify(xc(k))}:{}});if(en.current||await Oo(gt)||en.current)return;if(!gt.ok)throw Or(J),new Error(`Route failed: ${gt.statusText}`);const xt=await gt.json();if(en.current)return;if(xt&&typeof xt=="object"&&!Array.isArray(xt)&&ae(Mt=>({...Mt,feedback:xt})),((Z=M.onSuccess)==null?void 0:Z.type)==="toast"&&M.onSuccess.value)je(M.onSuccess.value,"success");else if(((B=M.onSuccess)==null?void 0:B.type)==="navigate"&&M.onSuccess.value){const Mt=M.onSuccess.value;if(it(Mt)&&!dt){ln.current=Mt,Lt(!0);return}ne(At=>[...At,kt]),Nn(Mt)}xt!=null&&xt.data&&ae(Mt=>({...Mt,...xt.data})),xt!=null&&xt.user&&typeof xt.user=="object"&&ae(Mt=>({...Mt,user:xt.user})),fn.current[J.replace(/^\//,"")]={response:xt},ae(Mt=>({...Mt}))}else if($.startsWith("navigate:")){const tt=$.replace("navigate:","");if(it(tt)&&!dt){ln.current=tt,Lt(!0);return}ne(J=>[...J,kt]),Nn(tt)}else if($.startsWith("go_to_step:")){const tt=$.replace("go_to_step:","").split("?")[0].trim();if(it(tt)&&!dt){ln.current=tt,Lt(!0);return}ne(J=>[...J,kt]),Nn(tt)}else if($.startsWith("show_toast:")){const tt=$.replace("show_toast:","");tt&&je(tt,"success")}else if($.startsWith("show_modal:")){const tt=$.replace("show_modal:","");if(We[tt]){const Q=We[tt],J=Q.clearFormKeys;ae(ot=>{const ut={...ot};let gt=Array.isArray(J)&&J.length>0;if(gt)for(const xt of J)delete ut[xt];for(const xt of Object.keys(ut))xt.startsWith("__acc_")&&(delete ut[xt],gt=!0);return gt?ut:ot}),Q.preload&&await Ts(String(Q.preload)),cn({id:tt,definition:Q})}else{const Q=tt.split("|");cn({id:"__legacy",definition:{title:Q[0]||"Notice",components:Q[1]?[{type:"text",text:Q[1],color:ce.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}}else if($.startsWith("toast:")){const tt=$.replace("toast:","");je(tt,"success")}}catch(tt){if(tt instanceof ko&&Jn(tt,M==null?void 0:M.onError))return;(W=M.onError)!=null&&W.message&&je(M.onError.message,"error")}},[kt,et,dt]),Ca=v.useRef(null),Oa=v.useRef(null);v.useEffect(()=>{const M=Oa.current;Oa.current=kt;const $=ge==null?void 0:ge.events,k=Array.isArray($==null?void 0:$.onLoad)?$.onLoad:$!=null&&$.onLoad?[$.onLoad]:[];k.length!==0&&M!==kt&&k.forEach(Z=>qr(Z))},[kt,ge==null?void 0:ge.events,qr]),v.useEffect(()=>{var $,k;const M=Ca.current;if(Ca.current=kt,M&&M!==kt){const Z=et.find(W=>W.id===M),B=(Z==null?void 0:Z.type)==="render_scene"?Z.config:null;(k=($=B==null?void 0:B.events)==null?void 0:$.onLeave)!=null&&k.action&&qr(B.events.onLeave)}},[kt,et,qr]),v.useEffect(()=>{const M=ge==null?void 0:ge.events;if(!(M!=null&&M.onVisibilityChange))return;const $=()=>{var k,Z,B,W;document.hidden?(Z=(k=M.onVisibilityChange)==null?void 0:k.onHidden)!=null&&Z.action&&qr(M.onVisibilityChange.onHidden):(W=(B=M.onVisibilityChange)==null?void 0:B.onVisible)!=null&&W.action&&qr(M.onVisibilityChange.onVisible)};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},[kt,ge==null?void 0:ge.events,qr]);const Vi=v.useCallback(async(M,$)=>{Cn(k=>({...k,[M]:!0}));try{await $()}finally{Cn(k=>({...k,[M]:!1}))}},[]),li=v.useRef({}),Ui=v.useRef(new Set),hn=v.useRef(new Set),jn=v.useRef(null),Ma=v.useRef([]),Mo=v.useRef({}),Dn=v.useCallback(async(M,$,k=0,Z=10,B,W,tt,Q=!1)=>{var ot;if(!M||Ke.current||!dt)return;li.current[$]=M;const J=M.match(/^\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*\}\}$/);if(J){const ut=Zr(`${J[1]}${J[2]?"."+J[2]:""}`);if(Array.isArray(ut))return Vr(gt=>({...gt,[$]:ut})),fn.current[$]=ut,fn.current[M]=ut,Ni(gt=>({...gt,[$]:{page:k,limit:Z,total:ut.length,hasMore:(k+1)*Z<ut.length}})),ut}So.current.has($)||Ri(ut=>({...ut,[$]:!0}));try{let ut=[],gt=0,xt;const Mt=Ei.current;if(ps(M,$),_u(M)&&t){const mt=Sm(M,{limit:Z,page:k}),At=B?Ih(mt,B,W):mt,a=su(At),d=await Uf(t,a,Mt);xt=d,ut=(d==null?void 0:d.emails)||(d==null?void 0:d.items)||(d==null?void 0:d.data)||(d==null?void 0:d.history)||(Array.isArray(d)?d:[]),gt=((ot=d==null?void 0:d.pagination)==null?void 0:ot.total)??(d==null?void 0:d.count)??ut.length}else if(!_u(M)){const mt=t==null?void 0:t.endpoint,At=N||(mt&&/^https?:\/\//.test(mt)?mt:window.location.origin);let a=M;!N&&mt&&!/^https?:\/\//.test(mt)&&typeof mt=="string"&&(a=`${mt.replace(/\/+$/,"")}${M.startsWith("/")?M:`/${M}`}`),Gg("[fetchListData] apiUrl=%s baseUrl=%s dataSource=%s origin=%s",N,At,M,window.location.origin);const d=new URL(a,At);d.searchParams.set("limit",String(Z)),d.searchParams.set("offset",String(k*Z)),B&&(d.searchParams.set("sort",B),d.searchParams.set("dir",W||"asc"));const g=await fetch(d.toString(),{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(await Oo(g)||en.current)return;let _=null;try{_=await g.json()}catch{}if(!g.ok){const C=typeof(_==null?void 0:_.message)=="string"&&_.message||typeof(_==null?void 0:_.error)=="string"&&_.error||`Request failed: ${g.statusText}`;throw new ko([C],_||void 0)}if(xt=_,en.current)return;ut=Array.isArray(_)?_:Array.isArray(_.data)?_.data:Array.isArray(_.items)?_.items:[],gt=_.count??_.total??ut.length}if(Vr(mt=>{if(Q&&Array.isArray(mt[$])){const At=new Set(mt[$].map(d=>d==null?void 0:d.id)),a=[...mt[$],...ut.filter(d=>!At.has(d==null?void 0:d.id))];return{...mt,[$]:a}}return{...mt,[$]:ut}}),So.current.add($),fn.current[$]=ut,M&&(fn.current[M]=ut),tt&&(fn.current[tt]={items:ut,response:xt},M)){const mt=Mo.current[tt];mt&&mt!==M&&Zg(`[renderer] duplicate list key "${tt}" used for both ${mt} and ${M}`),Mo.current[tt]=M}{const mt=String(M||"").replace(/^\//,"").split("?")[0];mt&&(fn.current[mt]={response:xt})}return Ni(mt=>({...mt,[$]:{page:k,limit:Z,total:gt,hasMore:(k+1)*Z<gt}})),ut}catch(ut){if(ut instanceof ko&&Jn(ut))return;Vr(gt=>{const xt=gt[$];return Array.isArray(xt)&&xt.length>0?gt:{...gt,[$]:[]}})}finally{Ri(ut=>({...ut,[$]:!1}))}},[t,dt,ps]),fr=()=>{const M=N||(t==null?void 0:t.endpoint);return M&&/^https?:\/\//.test(M)?M:M!=null&&M.startsWith("/")?`${window.location.origin}${M}`:window.location.origin},Ps=v.useRef(null);v.useEffect(()=>{var B;if(!dt)return;const M=r||localStorage.getItem("token");if(!M){G(!0);return}const $=((e==null?void 0:e.steps)||[]).find(W=>W.id===kt);if(!(((B=$==null?void 0:$.config)==null?void 0:B.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0||nt)||Ps.current===M)return;let Z=!1;return(async()=>{var W;try{const tt=await fetch(`${fr()}/admin/users/me`,{headers:{Authorization:`Bearer ${M}`}});if(Z)return;if(tt.ok){const Q=await tt.json().catch(()=>null);Ps.current=M,G(!1),lt(typeof((W=Q==null?void 0:Q.user)==null?void 0:W.emailVerified)=="boolean"?Q.user.emailVerified:null)}else kt&&(ln.current=kt),Ps.current=null,G(!0),Ct(!1),lt(null)}catch{Z||(kt&&(ln.current=kt),G(!0))}})(),()=>{Z=!0}},[dt,kt,e==null?void 0:e.steps]);const $h=v.useCallback((M,$,k)=>{!M||$.length===0||Vr(Z=>{const B={...Z};for(const[W,tt]of Object.entries(li.current)){if(tt!==M||!Z[W])continue;const Q=Z[W];k==="remove"&&(B[W]=Q.filter(J=>!$.includes(J.id)))}return B})},[]),Or=v.useCallback((M,$)=>{var tt,Q;const k=new Map;for(const[J,ot]of Object.entries(Mo.current))k.set(ot,J);const Z=new Map;for(const[J,ot]of Object.entries(li.current))Z.set(J,{ds:ot,dataKey:k.get(ot)});for(const[J,ot]of Object.entries(Mo.current))Object.values(li.current).includes(ot)||Z.set(J,{ds:ot,dataKey:J});if(Z.size===0)return;const B=Array.isArray($)?new Set($):void 0,W=(J,ot)=>Ui.current.has(J)||(ot?Ui.current.has(ot):!1);for(const[J,{ds:ot,dataKey:ut}]of Z){if(!W(J,ut))continue;const gt=!!(B!=null&&B.has(J)||ut&&(B!=null&&B.has(ut)));if($==="view"||gt){Dn(ot,J,0,((tt=On[J])==null?void 0:tt.limit)||10,void 0,void 0,ut);continue}const xt=ot==null?void 0:ot.split("?")[0];xt&&M.startsWith(xt)&&Dn(ot,J,0,((Q=On[J])==null?void 0:Q.limit)||10,void 0,void 0,ut)}},[Dn,On]),pe=v.useCallback((M,$,k,Z)=>{const B=String(M||"").toUpperCase();if(B==="GET"||Z===!1)return;const W=Z==="remove"||Z==="merge"||Z==="add"||Z==="refresh"?Z:B==="DELETE"?"remove":B==="PUT"||B==="PATCH"?"merge":B==="POST"?"add":null;if(!W||W==="refresh")return;const tt=()=>{const J=String($).match(/\/([^/]+)\/?$/);return J?decodeURIComponent(J[1]):void 0},Q=[];for(const[J,ot]of Object.entries(li.current))ot&&$.startsWith(ot)&&Q.push({key:J,ds:ot});Q.length!==0&&Vr(J=>{const ot={...J};for(const{key:ut,ds:gt}of Q){const xt=J[ut]||[];if(W==="remove"){const Mt=(k==null?void 0:k.id)||tt();ot[ut]=xt.filter(mt=>mt.id!==Mt)}else if(W==="merge"){const Mt=(k==null?void 0:k.id)||tt();ot[ut]=xt.map(mt=>mt.id===Mt?{...mt,...k}:mt)}else{const Mt={...k||{},id:(k==null?void 0:k.id)||`temp_${Date.now()}`};W==="add"&&Mt.status===void 0&&(Mt.status="queued"),ot[ut]=[Mt,...xt]}}return ot})},[]),ka=v.useCallback((M,$,k,Z)=>{var J;const B=fr();let W=!1;const tt=ot=>{W||(W=!0,ot())},Q=t==null?void 0:t.queues;if(M==="sse"&&(Q!=null&&Q.subscribe))try{const ot=Z.sseUrl||`${B}/queues/bulk-operations/jobs/${$}/subscribe?token=${encodeURIComponent(k)}`,ut=((t==null?void 0:t.endpoint)||B).replace(/\/$/,""),gt=ot.startsWith(ut)?ot.slice(ut.length):ot;Q.subscribe(gt,{onComplete:xt=>tt(()=>Z.onComplete(xt)),onFailed:xt=>tt(()=>Z.onFailed({message:xt||"Subscription failed",kind:"transport"})),onError:()=>tt(()=>Z.onFailed({message:"Stream error",kind:"transport"})),onConnected:()=>{},onProgress:xt=>{var Mt;return(Mt=Z.onProgress)==null?void 0:Mt.call(Z,xt)}}),setTimeout(()=>tt(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="ws"&&((J=t==null?void 0:t.client)!=null&&J.createWebSocket))try{const ot=t.client.createWebSocket(`job:${$}`);ot.onmessage=ut=>{try{const gt=JSON.parse(ut.data);(gt==null?void 0:gt.type)==="completed"?tt(()=>Z.onComplete(gt.result)):(gt==null?void 0:gt.type)==="failed"&&tt(()=>Z.onFailed({message:gt.error||"Job failed",kind:"job"}))}catch{}},ot.onerror=()=>tt(()=>Z.onFailed({message:"Connection error",kind:"transport"})),setTimeout(()=>tt(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="poll"&&(Q!=null&&Q.getJob)){const ot=window.setInterval(async()=>{var ut;try{const gt=await Q.getJob("bulk-operations",$),xt=(gt==null?void 0:gt.status)||((ut=gt==null?void 0:gt.job)==null?void 0:ut.status),Mt=(gt==null?void 0:gt.result)||(gt==null?void 0:gt.data);xt==="failed"||Mt!=null&&Mt.final?(window.clearInterval(ot),tt(()=>xt==="failed"?Z.onFailed({message:(Mt==null?void 0:Mt.error)||"Job failed",kind:"job"}):Z.onComplete(Mt))):xt==="completed"&&(window.clearInterval(ot),tt(()=>Z.onComplete(Mt)))}catch{}},600);setTimeout(()=>{window.clearInterval(ot),tt(()=>Z.onFailed({message:"Timed out",kind:"transport"}))},3e4);return}tt(()=>Z.onFailed({message:"Feedback transport unavailable",kind:"transport"}))},[]),dr=v.useCallback(async(M,$,k)=>{var ut,gt;const Z=t==null?void 0:t.files,B=encodeURIComponent(r||localStorage.getItem("token")||"");if(Z!=null&&Z.upload){const xt=await Z.upload(M,$||{},k),Mt=(xt==null?void 0:xt.url)||(xt==null?void 0:xt.path)||"";return Mt?(xt==null?void 0:xt.visibility)==="public"?Mt:`${fr()}${Mt}?token=${B}`:""}const W=new FormData;W.append("file",M),$!=null&&$.entityType&&W.append("entityType",$.entityType),$!=null&&$.entityId&&W.append("entityId",$.entityId),$!=null&&$.visibility&&W.append("visibility",$.visibility);const tt=await fetch(`${fr()}/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:W});if(!tt.ok)throw new Error("Upload failed");const Q=await tt.json(),J=((ut=Q==null?void 0:Q.asset)==null?void 0:ut.url)||(Q==null?void 0:Q.url)||(Q==null?void 0:Q.path)||(Q==null?void 0:Q.id)||"";return J?((gt=Q==null?void 0:Q.asset)==null?void 0:gt.visibility)==="public"?J:`${fr()}${J}?token=${B}`:""},[]),As=v.useCallback(async(M,$,k,Z)=>{var tt;if(!(M!=null&&M.endpoint)||Z.length===0)return;const B=M.endpoint,W=M.optimistic??!0;try{const Q=await fetch(fr()+B,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:JSON.stringify({ids:Z})});let J={};try{J=await Q.json()}catch{}if(!Q.ok){je(((tt=J==null?void 0:J.error)==null?void 0:tt.message)||"Request failed","error");return}W!==!1&&(W==="remove"||W==="refresh"?W:J.softUpdate||(M.action==="delete"?"remove":"refresh"))==="remove"&&$h($,Z,"remove"),ae(ut=>({...ut,_selIds:[],_selectMode:!1}));const ot=(ut,gt,xt)=>{var Mt;if(ut)je(xt||"Bulk operation failed","error");else{const mt=gt||{},At=mt.total??Z.length,a=mt.successful??At;je(a>=At?`${a} ${M.action}d`:`${a} of ${At} ${M.action}d`,"success")}Dn($,k,0,((Mt=On[k])==null?void 0:Mt.limit)||10)};J.jobId&&J.token&&M.feedback?ka(M.feedback,J.jobId,J.token,{onComplete:ut=>ot(!1,ut),onFailed:ut=>{var gt;if(ut.kind==="transport"){Dn($,k,0,((gt=On[k])==null?void 0:gt.limit)||10);return}ot(!0,null,ut.message)}}):ot(!1,J)}catch{je("Request failed","error")}},[$h,ka,Dn,On]),Ih=(M,$,k)=>{const Z=su(M),B=Z.indexOf("(");if(B===-1)return M;const W=Z.slice(B+1,-1).trim(),tt=`sort: "${$}", dir: ${k==="desc"?'"desc"':'"asc"'}`;if(!W)return M.replace(/\(\)$/,`({${tt}})`);const Q=W.lastIndexOf(",");if(Q===-1)return M.replace(/\(([^)]*)\)$/,`(${W}, {${tt}})`);const J=W.slice(Q+1).trim();return J.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${W.slice(0,Q)}, {${J.slice(1,-1)}, ${tt}})`):M.replace(/\(([^)]*)\)$/,`(${W}, {${tt}})`)},Sm=(M,$)=>{const k=su(M),Z=k.indexOf("(");if(Z===-1)return M;const B=k.slice(Z+1,-1).trim(),W=`limit: ${$.limit}, page: ${$.page}`;if(!B)return M.replace(/\(\)$/,`({${W}})`);const tt=B.lastIndexOf(",");if(tt===-1)return M.replace(/\(([^)]*)\)$/,`(${B}, {${W}})`);const Q=B.slice(tt+1).trim();return Q.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${B.slice(0,tt)}, {${Q.slice(1,-1)}, ${W}})`):M.replace(/\(([^)]*)\)$/,`(${B}, {${W}})`)};v.useEffect(()=>()=>{en.current=!0},[]),ce.colors.background;const gn=v.useMemo(()=>`bf-preview-${Math.random().toString(36).slice(2,9)}`,[]),Pm=M=>M.replace(/:(\w+)/g,($,k)=>{const Z=de[k];return Z===void 0?$:String(Z)}),Rh=M=>{try{const $=JSON.parse(M);if(Array.isArray($)&&$.length>0)return $.map(k=>{var Z;return k.message||`${((Z=k.path)==null?void 0:Z.join("."))||"field"} is invalid`})}catch{}return null};class ko extends Error{constructor(k,Z){super(k.join(", "));Mm(this,"errors");Mm(this,"body");this.errors=k,this.body=Z}}const Ts=async(M,$)=>{var Mt,mt,At,a,d;if(Ke.current||!dt)return;const{method:k,path:Z}=Ce(M),B=Pm(Z),W=k!=="GET"&&k!=="DELETE",tt=fr();k!=="GET"&&pe(k,B,de,($==null?void 0:$.optimistic)??!0);let Q;if($!=null&&$.payload&&typeof $.payload=="object"){Q={};for(const[g,_]of Object.entries($.payload))Q[g]=typeof _=="string"&&_.includes("{{")?Es(_):_}else Q=de;Q=xc(Q);const J=await fetch(new URL(B,tt).toString(),{method:k,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...W?{body:JSON.stringify(Q)}:{}});if(await Oo(J)||en.current)return;let ot;try{ot=await J.json()}catch{if(en.current)return;if(!J.ok)throw new ko([`Request failed: ${J.statusText}`]);return}if(!J.ok||ot.success===!1){Or(B,$==null?void 0:$.refetchScope);let g=["Something went wrong"];throw(Mt=ot.error)!=null&&Mt.message?g=Rh(ot.error.message)||[ot.error.message]:ot.message&&(g=[ot.message]),new ko(g,ot)}ot.token&&localStorage.setItem("token",ot.token),$!=null&&$.openUrl&&(ot!=null&&ot.url)&&String(ot.url).startsWith("http")&&window.open(String(ot.url),"_blank","noopener,noreferrer"),ot&&typeof ot=="object"&&!Array.isArray(ot)&&ae(g=>({...g,feedback:ot})),ot.data&&($==null?void 0:$.mergeResponse)!==!1&&ae(g=>({...g,...ot.data})),ot.user&&typeof ot.user=="object"?ae(g=>({...g,user:ot.user})):ae(g=>({...g})),fn.current[B.replace(/^\//,"")]={response:ot};for(const[g,_]of Object.entries(Mo.current))if(_===B||_.endsWith(B)){const C=fn.current[g];fn.current[g]={items:Array.isArray(C)?C:Array.isArray(C==null?void 0:C.items)?C.items:[],response:ot}}const ut=(At=(mt=ot.subscribe)==null?void 0:mt.websocket)==null?void 0:At.workflowChannel;ut&&($==null?void 0:$.mergeResponse)!==!1&&ae(g=>{var _,C,R,q;return{...g,liveCastChannel:ut,execution_id:ot.draftId||g.execution_id,id:ot.sessionId||g.id,status:"running",test_session:{...g.test_session||{},id:ot.sessionId||((_=g.test_session)==null?void 0:_.id),execution_id:ot.draftId||((C=g.test_session)==null?void 0:C.execution_id),status:"running",liveCastChannel:ut,prompt:(Q==null?void 0:Q.prompt)||((R=g.test_session)==null?void 0:R.prompt),url:(Q==null?void 0:Q.url)||((q=g.test_session)==null?void 0:q.url)}}}),Or(B,$==null?void 0:$.refetchScope);const gt=$==null?void 0:$.feedback,xt=typeof gt=="string"?gt:gt==null?void 0:gt.transport;if(xt&&ot.jobId&&(ot.token||(a=ot.subscribe)!=null&&a.sse||typeof gt=="object")){let g=(d=ot.subscribe)!=null&&d.sse?/^https?:\/\//.test(ot.subscribe.sse)?ot.subscribe.sse:tt+ot.subscribe.sse:void 0;if(typeof gt=="object"&&gt.subscribeUrl){const _=String(gt.subscribeUrl).trim(),C=_.startsWith("{{")&&_.endsWith("}}")?_.slice(2,-2).trim():_,R=C.match(/^\[(.+?)\](?:\.(.*))?$/),q=R?Zr(`${R[1]}${R[2]?"."+R[2]:""}`):C.split(".").reduce((rt,st)=>rt==null?void 0:rt[st],ot);q&&(g=/^https?:\/\//.test(q)?q:tt+q)}if(g){ka(xt,ot.jobId,ot.token,{sseUrl:g,onProgress:_=>{s==null||s(_);const C=Date.now();C-xo.current>=2e3&&(xo.current=C,Or(B,$==null?void 0:$.refetchScope))},onComplete:_=>{const C=(_==null?void 0:_.result)??_;if(C&&typeof C=="object"){const R=B.replace(/^\//,"");fn.current[R]={response:C},ae(q=>({...q}))}Or(B,$==null?void 0:$.refetchScope)},onFailed:_=>{Or(B,$==null?void 0:$.refetchScope),_.kind!=="transport"&&je(_.message||"Job failed","error")}});return}ka(xt,ot.jobId,ot.token,{onComplete:_=>{const C=_||{},R=C.total,q=C.successful;R!==void 0&&je(q>=R?`${q} completed`:`${q} of ${R} completed`,"success"),Or(B,$==null?void 0:$.refetchScope)},onFailed:_=>{if(_.kind==="transport"){Or(B,$==null?void 0:$.refetchScope);return}je(_.message||"Job failed","error"),Or(B,$==null?void 0:$.refetchScope)}})}},pr=M=>{var Z,B;cn(null);const $=M==="/"&&(((Z=et.find(W=>W.route==="/"))==null?void 0:Z.id)||((B=et.find(W=>W.type==="render_scene"))==null?void 0:B.id))||M;if(it($)&&!dt){ln.current=$,Lt(!0);return}ne(W=>[...W,kt]),Nn($)},wc=(M,$="error")=>{if(ae(k=>({...k,gateTitle:M.uiTitle||"Usage Notice",gateMessage:M.message})),M.uiVariant!=="modal"){const k=M.uiTitle?`${M.uiTitle}
195
195
  ${M.message}`:M.message;je(k,$);return}if(M.modalId&&We[M.modalId]){cn({id:M.modalId,definition:We[M.modalId]});return}cn({id:"__legacy",definition:{title:M.uiTitle||"Usage Notice",components:[{type:"text",text:M.message,color:ce.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})},Jn=(M,$)=>{const k=M.body;if(!k)return!1;const Z=typeof(k==null?void 0:k.message)=="string"&&k.message||M.errors[0]||"Request blocked by limits",B=()=>wc({message:Z,uiVariant:k.uiVariant,uiTitle:typeof(k==null?void 0:k.uiTitle)=="string"?k.uiTitle:void 0,modalId:typeof(k==null?void 0:k.modalId)=="string"?k.modalId:void 0});return k.gateAction==="login"?(re("login"),!0):k.gateAction==="upgrade"?k.uiVariant==="modal"||typeof(k==null?void 0:k.modalId)=="string"?(B(),!0):$!=null&&$.upgradeScene?(pr($.upgradeScene),!0):(B(),!0):k.gateAction==="block"||k.gateAction==="warn"||k.warning?(B(),!0):!1};v.useEffect(()=>{if(!dt||Y)return;const M=ln.current;!M||!et.some($=>$.id===M)||(ln.current=null,pr(M))},[dt,Y,et]);const je=(M,$="success",k)=>{const Z=Array.isArray(M)?M.join(`
196
- `):M,B=$==="success",W=B?"#10B981":"#EF4444",tt=ce.toast||{},Q=k??tt.duration??3e3,J=tt.position||"bottom-right",at={"bottom-right":{right:"24px",bottom:"24px"},"bottom-left":{left:"24px",bottom:"24px"},"bottom-center":{left:"50%",bottom:"24px",transform:"translateX(-50%)"},"top-right":{right:"24px",top:"24px"},"top-left":{left:"24px",top:"24px"},"top-center":{left:"50%",top:"24px",transform:"translateX(-50%)"}},ut=at[J]||at["bottom-right"],gt=document.createElement("div"),xt=document.createElement("span");xt.textContent=B?"✓":"✕",Object.assign(xt.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"22px",height:"22px",minWidth:"22px",borderRadius:"50%",backgroundColor:`${W}26`,color:W,fontSize:"12px",fontWeight:"700"});const Mt=document.createElement("span");Mt.textContent=Z,Object.assign(Mt.style,{color:"rgba(255, 255, 255, 0.92)",fontSize:"13.5px",lineHeight:"1.45",whiteSpace:"pre-line"}),Object.assign(gt.style,{position:"fixed",...ut,zIndex:"2147483647",display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px 16px",borderRadius:"12px",backgroundColor:"rgba(23, 25, 35, 0.97)",border:"1px solid rgba(148, 163, 184, 0.25)",boxShadow:"0 8px 28px rgba(0, 0, 0, 0.4)",maxWidth:"380px",opacity:"0",pointerEvents:"auto"}),gt.appendChild(xt),gt.appendChild(Mt),document.body.appendChild(gt),gt.animate([{opacity:0,transform:"translateX(24px)"},{opacity:1,transform:"translateX(0)"}],{duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"both"}).finished.catch(()=>{});const At=()=>{gt.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:"translateX(16px)"}],{duration:200,easing:"ease",fill:"both"}).finished.then(()=>gt.remove()).catch(()=>gt.remove())};return Q>0&&setTimeout(At,Q),{update:a=>{Mt.textContent=Array.isArray(a)?a.join(`
197
- `):a},dismiss:At}},Hi=(M,$=!0)=>{if($&&(M!=null&&M.onSuccess)){const k=Array.isArray(M.onSuccess)?M.onSuccess:[M.onSuccess];for(const Z of k){const{type:B,value:W,title:tt,key:Q}=Z;switch(B){case"toast":je(W||"Success!","success");break;case"navigate":W&&pr(W);break;case"redirect":W&&(window.location.href=W);break;case"modal":W&&We[W]?cn({id:W,definition:We[W]}):cn({id:"__legacy",definition:{title:tt||"Success",components:W?[{type:"text",text:W,color:ce.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}});break;case"route":W&&Ts(W);break;case"set_data":Q&&W!==void 0&&ae(J=>({...J,[Q]:W}));break}}}else!$&&(M!=null&&M.onError)&&je(M.onError.message||"An error occurred","error")},ci=()=>{var q,rt,ot,pt,Ot,zt,Nt;const M=async()=>{var Gt,ue,Oe,Ki,Hn,Ls;if(!Kt||!be||Mn==="register"&&!xe)return;const _t=Hr(Kt),jt=Fi(be);if(_t||jt){un(_t||jt);return}if(Mn==="register"&&xe!==be){Cr("confirm","Passwords do not match"),un("Passwords do not match");return}Ie(!0),un(null);try{const er=Mn==="login"?"/auth/login":"/auth/register",kr=`${fr().replace(/\/+$/,"")}${er}`,Xh=Mn==="login"?{email:Kt,password:be,tenantId:w}:{email:Kt,password:be,displayName:Kt.split("@")[0],tenantId:w},Xe={"Content-Type":"application/json"},Wa=["localhost","127.0.0.1","[::1]"].includes(window.location.hostname);T&&!Wa&&(Xe["x-app-id"]=T);const jc=await fetch(kr,{method:"POST",headers:Xe,body:JSON.stringify(Xh)});if(!jc.ok){const Q$=await jc.json().catch(()=>({error:"Authentication failed"}));throw new Error(Co(Q$))}const nr=await jc.json();if(Array.isArray(nr)||nr.success===!1)throw new Error(Co(nr));const Jh=((Gt=nr.data)==null?void 0:Gt.token)||nr.token||nr.accessToken||nr.idToken;Jh&&localStorage.setItem("token",Jh);const Va=((ue=nr.data)==null?void 0:ue.refreshToken)||nr.refreshToken;Va&&localStorage.setItem("backflow_refresh_token",Va);const Dc=((Ki=(Oe=nr.data)==null?void 0:Oe.user)==null?void 0:Ki.id)||((Hn=nr.user)==null?void 0:Hn.id)||((Ls=nr.data)==null?void 0:Ls.userId);if(Dc&&localStorage.setItem("backflow_refresh_user_id",Dc),!dt&&(nt||Ke.current||!!ln.current)){window.location.reload();return}Ke.current=!1,Ct(!0),Lt(!1),G(!1),hr(""),St(""),Rt(""),xs({}),un(null)}catch(er){const kr=typeof er=="string"?er:(er==null?void 0:er.message)||JSON.stringify(er)||"Authentication failed";un(kr),je(kr,"error")}finally{Ie(!1)}},$=async()=>{if(!Kt)return;const _t=Hr(Kt);if(_t){un(_t);return}Ie(!0),un(null);try{const jt=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Kt})});if(!jt.ok){const Gt=await jt.json().catch(()=>({error:"Failed to send reset email"}));throw new Error(Co(Gt))}re("reset"),kn(""),St(""),un(null)}catch(jt){const Gt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to send reset email";un(Gt),je(Gt,"error")}finally{Ie(!1)}},k=async()=>{if(!zi||!be)return;const _t=Fi(be);if(_t){un(_t);return}Ie(!0),un(null);try{const jt=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:zi,password:be})});if(!jt.ok){const Gt=await jt.json().catch(()=>({error:"Failed to reset password"}));throw new Error(Co(Gt))}re("login"),hr(""),St(""),kn(""),un(null)}catch(jt){const Gt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to reset password";un(Gt),je(Gt,"error")}finally{Ie(!1)}},Z=_t=>{re(_t),un(null),_t!=="reset"&&(kn(""),St("")),Rt(""),xs({})},B=ce.colorMode==="dark",W=B?"#f3f4f6":"#111827",tt=B?"#9ca3af":"#6b7280",Q=B?"#374151":"#f3f4f6",J=B?"#4b5563":"#d1d5db",at=B?"#ffffff":"#000000",ut=B?"#000000":"#ffffff",gt=B?"#1f2937":"#ffffff",xt="#ef4444",Mt=(_t="12px")=>({width:"100%",padding:"12px 16px",border:`1px solid ${J}`,borderRadius:"8px",fontSize:"14px",backgroundColor:Q,color:W,outline:"none",marginBottom:_t,boxSizing:"border-box"}),mt=(_t,jt,Gt,ue,Oe,Ki)=>v.createElement("div",{key:_t,style:{position:"relative",marginBottom:"12px"}},V("input",{key:"input",type:le[_t]?"text":"password",placeholder:jt,value:Gt,onChange:Hn=>ue(Hn.target.value),onKeyDown:Hn=>{Hn.key==="Enter"&&Oe()},style:{...Mt("0px"),paddingRight:"40px",borderColor:Ki?xt:J}}),v.createElement("button",{key:"toggle",type:"button","aria-label":le[_t]?"Hide password":"Show password",onClick:()=>xs(Hn=>({...Hn,[_t]:!Hn[_t]})),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:tt,display:"flex",alignItems:"center",padding:"4px"}},Un.renderIcon(le[_t]?"eye-off":"eye",16)));l||e!=null&&e.title;const At=(q=e==null?void 0:e.config)!=null&&q.logo&&((rt=e==null?void 0:e.config)==null?void 0:rt.logo)!==""?e.config.logo:"",a=c||((ot=e==null?void 0:e.navigation)==null?void 0:ot.logo)||"mail",d=[];d.push(v.createElement("div",{key:"brand",role:"button","aria-label":"Go back home",onClick:()=>{pr("/"),Lt(!1),Ke.current=!1,ln.current=null},style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px",cursor:"pointer"}},At?v.createElement("img",{src:At,alt:"",style:{width:"56px",height:"56px",objectFit:"contain"}}):Un.renderIcon(a,56))),Mn==="login"?(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Sign In")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Enter your credentials to continue")),d.push(V("input",{key:"email",type:"email",placeholder:"Email Address",value:Kt,onChange:_t=>{hr(_t.target.value),Cr("email",Hr(_t.target.value))},style:{...Mt(),borderColor:Ee.email&&Kt?xt:J}})),Ee.email&&Kt&&d.push(v.createElement("p",{key:"email-err",style:{color:xt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Ee.email)),d.push(mt("pass","Password",be,_t=>{St(_t),Cr("pass",Fi(_t))},M,!!(Ee.pass&&be))),Ee.pass&&be&&d.push(v.createElement("p",{key:"pass-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.pass)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:M,disabled:Ge||!Kt||!be,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":at,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"8px"}},Ge?"Please wait...":"Sign In")),d.push(v.createElement("p",{key:"forgot",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer",marginBottom:"16px"},onClick:()=>Z("forgot")},"Forgot password?")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("register")},"Don’t have an account? Register"))):Mn==="register"?(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Create Account")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Create an account to get started")),d.push(V("input",{key:"email",type:"email",placeholder:"Email",value:Kt,onChange:_t=>{hr(_t.target.value),Cr("email",Hr(_t.target.value))},style:{...Mt(),borderColor:Ee.email&&Kt?xt:J}})),Ee.email&&Kt&&d.push(v.createElement("p",{key:"email-err",style:{color:xt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Ee.email)),d.push(mt("pass","Password",be,_t=>{St(_t),Cr("pass",Fi(_t))},M,!!(Ee.pass&&be))),Ee.pass&&be&&d.push(v.createElement("p",{key:"pass-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.pass)),d.push(mt("confirm","Confirm password",xe,_t=>{Rt(_t),Cr("confirm",_s(be,_t))},M,!!(Ee.confirm&&xe))),Ee.confirm&&xe&&d.push(v.createElement("p",{key:"confirm-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.confirm)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:M,disabled:Ge||!Kt||!be||!xe,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":at,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"16px"}},Ge?"Please wait...":"Create Account")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Already have an account? Sign In"))):Mn==="forgot"?(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Reset Password")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Enter your email to receive a reset link")),d.push(V("input",{key:"email",type:"email",placeholder:"Email",value:Kt,onChange:_t=>{hr(_t.target.value),Cr("email",Hr(_t.target.value))},onKeyDown:_t=>{_t.key==="Enter"&&$()},style:{...Mt("16px"),borderColor:Ee.email&&Kt?xt:J}})),Ee.email&&Kt&&d.push(v.createElement("p",{key:"email-err",style:{color:xt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Ee.email)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:$,disabled:Ge||!Kt,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":at,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"16px"}},Ge?"Please wait...":"Send Reset Link")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In"))):Mn==="reset"&&(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Set New Password")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Enter the reset code and your new password")),d.push(V("input",{key:"code",type:"text",placeholder:"Reset code",value:zi,onChange:_t=>kn(_t.target.value),style:Mt()})),d.push(mt("pass","New password",be,_t=>{St(_t),Cr("pass",Fi(_t))},k,!!(Ee.pass&&be))),Ee.pass&&be&&d.push(v.createElement("p",{key:"pass-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.pass)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:k,disabled:Ge||!zi||!be,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":at,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"16px"}},Ge?"Please wait...":"Reset Password")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In")));const g=((pt=e==null?void 0:e.config)==null?void 0:pt.auth)||{},_=g.style==="page"?"page":"modal",C=g.containerStyle||{},R=v.createElement("div",{key:"auth-box",style:{width:"100%",maxWidth:_==="page"?"400px":"360px",padding:"24px",backgroundColor:"#000000",borderRadius:"12px",...C}},...d);if(_==="page"){const _t=((Ot=ce.colors)==null?void 0:Ot.primary)||"#4f46e5",jt=g.coverImage?`url(${g.coverImage}) center/cover no-repeat`:_t,Gt=(zt=e==null?void 0:e.config)!=null&&zt.logo&&((Nt=e==null?void 0:e.config)==null?void 0:Nt.logo)!==""?e.config.logo:"",ue=Gt?v.createElement("img",{src:Gt,alt:"",style:{position:"absolute",bottom:"-6%",left:"50%",width:"90%",maxWidth:"660px",height:"auto",objectFit:"contain",transform:"translateX(-50%) rotate(-8deg)",opacity:.92,filter:"brightness(0) invert(1)"}}):v.createElement("div",{style:{color:"#ffffff",opacity:.95}},Un.renderIcon(a,96));return v.createElement("div",{key:"auth-page",style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",backgroundColor:gt,zIndex:1e4,animation:"bf-fade-in 0.2s ease"}},v.createElement("div",{style:{flex:si?"1 1 100%":"0 0 40%",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",backgroundColor:"#000000"}},R),v.createElement("div",{style:{flex:"0 0 60%",background:jt,display:si?"none":"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"}},ue))}return v.createElement("div",{key:"auth-form",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},R)},$a=async(M,$,k)=>{var Z,B;try{let W=String(Es(M)??"");const tt=W.match(/^\{\{\s*(.+?)\s*\?\s*(.*?)\s+:\s+(.*?)\s*\}\}$/);tt&&(W=Os(tt[1])?tt[2]:tt[3]);const Q=W.split(";").map(mt=>mt.trim()).filter(Boolean);if(Q.length>1){for(const mt of Q)await $a(mt,void 0,k);return}if(W==="go_back"){_o();return}if(W==="toggle_theme"){Ss((de._colorMode||ce.colorMode)==="dark"?"light":"dark");return}if(W==="close_modal"){Bi();return}const J=W.match(/^(toast|show_toast):(.*)$/);if(J){const mt=J[2].trim();mt&&je(mt,"success");return}const at=W.match(/^scroll_to:([\w-]+)$/);if(at){(Z=document.getElementById(at[1]))==null||Z.scrollIntoView({behavior:"smooth",block:"start"});return}const ut=W.match(/^set_data:([\w.]+)=(.*)$/);if(ut){ae(mt=>({...mt,[ut[1]]:ut[2]}));return}const gt=W.match(/^native:([a-z][\w.-]*)$/i);if(gt){if(!i){je("Native app required","error");return}const mt=gt[1],At=await i(mt,de);if(At&&typeof At=="object"&&!Array.isArray(At)){const a=mt.replace(/[^\w]/g,"_");ae(d=>({...d,native:{...d.native||{},[a]:At}}))}return}const xt=W.match(/^copy_to_clipboard:(.*)$/);if(xt){const mt=xt[1];try{await navigator.clipboard.writeText(mt)}catch{const At=document.createElement("textarea");At.value=mt,At.style.position="fixed",At.style.opacity="0",document.body.appendChild(At),At.select(),document.execCommand("copy"),At.remove()}je("API key copied","success");return}const Mt=W.match(/^auth:(login|register|forgot|reset|logout)$/);if(Mt){if(Mt[1]==="logout"){if(!dt)return;localStorage.removeItem("token"),localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),Ke.current=!1,ln.current=null,Ct(!1),Lt(!1),lt(null),G(!1),pr("/");return}if(dt)return;un(null),re(Mt[1]),Lt(!0);return}if(W==="accept_startup_modal"){const mt=ce.startupModal;mt&&localStorage.setItem(`backflow_startup_modal_${mt}`,"1"),Bi();const At=et.find(a=>a.route==="/");At&&(ne(a=>[...a,kt]),Nn(At.id));return}if(W==="decline_startup_modal"){Bi();const mt=et.find(At=>At.route==="/");mt&&(ne(At=>[...At,kt]),Nn(mt.id));return}if(W==="toggle_select"){ae(mt=>({...mt,_selectMode:!mt._selectMode,...mt._selectMode?{_selIds:[]}:{}}));return}if(W.startsWith("go_to_step:"))pr(W.replace("go_to_step:","")),Hi($,!0);else if(W.startsWith("navigate:"))pr(W.replace("navigate:","")),Hi($,!0);else if(_u(W)&&t){const mt=su(W),At=await Uf(t,mt,de);At!=null&&At.data?ae(a=>({...a,...At.data})):At&&typeof At=="object"&&!Array.isArray(At)&&ae(a=>({...a,...At})),At!=null&&At.url&&String(At.url).startsWith("http")&&window.open(String(At.url),"_blank","noopener,noreferrer"),Hi($,!0)}else if(W.startsWith("show_modal:")){const mt=W.replace("show_modal:","");if(We[mt]){const At=We[mt];if(vs(At.popover&&(k!=null&&k.anchorElement)?k.anchorElement.getBoundingClientRect():null),bs.current=At.popover&&(k==null?void 0:k.anchorElement)||null,jn.current&&typeof jn.current=="object"){const g=Object.keys(jn.current);ae(_=>{const C={..._};for(const R of Ma.current)g.includes(R)||delete C[R];return{...C,...jn.current}}),Ma.current=g}const a=At.clearFormKeys;Array.isArray(a)&&a.length>0&&ae(g=>{const _={...g};for(const C of a)delete _[C];return _});const d=At.defaults;d&&typeof d=="object"&&ae(g=>{const _={...g};for(const[C,R]of Object.entries(d))_[C]===void 0&&(_[C]=R);return _}),At.preload&&await Ts(String(At.preload)),(Te==null?void 0:Te.id)===mt||(Sn==null?void 0:Sn.id)===mt||(Xn(null),cn({id:mt,definition:At}))}else{const At=mt.split("|");cn({id:"__legacy",definition:{title:At[0]||"Notice",components:At[1]?[{type:"text",text:At[1],color:"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}Hi($,!0)}else W.startsWith("execute_workflow:")?(await Ts(W.replace("execute_workflow:",""),k),Hi($,!0)):W.startsWith("fetch:")&&(await Ts(W.replace("fetch:",""),k),o==null||o(W.replace("fetch:","")),Hi($,!0))}catch(W){if(Gg("[handleButtonClick] caught error:",W,"callbacks:",$),(W==null?void 0:W.status)===401){await Oo({status:401},!0);return}if(W instanceof ko){if(Jn(W,$==null?void 0:$.onError))return;je(W.errors.length>1?W.errors:W.errors[0],"error")}else(B=$==null?void 0:$.onError)!=null&&B.message?je($.onError.message,"error"):je(W instanceof Error?W.message:"An error occurred","error")}},_c=M=>{const $=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(isNaN($.getTime()))return String(M??"");const k=Math.floor((Date.now()-$.getTime())/6e4);if(k<1)return"just now";if(k<60)return`${k}m ago`;const Z=Math.floor(k/60);if(Z<24)return`${Z}h ago`;const B=Math.floor(Z/24);return B<7?`${B}d ago`:$.toLocaleDateString()},Gr=(M,$)=>{if($==="timeago")return _c(M);const k=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(!isNaN(k.getTime())){if($==="date")return k.toLocaleDateString();if($==="time")return k.toLocaleTimeString();if($==="datetime")return k.toLocaleString()}return String(M??"")},fn=v.useRef({}),Zr=M=>{const $=M.split(".").filter(Boolean);if($.length===0)return;let k=fn.current[$[0]]??de[$[0]];for(let Z=1;Z<$.length;Z++){if(k==null)return;const B=$[Z];if(Array.isArray(k))if(B==="first")k=k[0];else if(B==="last")k=k[k.length-1];else if(B==="length")k=k.length;else if(/^\d+$/.test(B))k=k[Number(B)];else if(B==="index")k=k[0];else return;else if(k&&typeof k=="object"&&Array.isArray(k.items))B==="response"?k=k.response:B==="first"?k=k.items[0]:B==="last"?k=k.items[k.items.length-1]:B==="length"?k=k.items.length:/^\d+$/.test(B)?k=k.items[Number(B)]:B==="index"?k=k.items[0]:k=k[B];else if(typeof k=="object")k=k[B];else return}return k},Ia=v.useRef({}),[Lh,Nh]=v.useState({}),Sc=v.useCallback(M=>(Ia.current[M]||(Ia.current[M]=import(M).catch(()=>fetch(M).then($=>$.text()).then($=>{const k={};return new Function("module","exports",$)(k,k),k.exports||k}))),Ia.current[M]),[]),jh=(M,$,k,Z)=>{if(!M)return"";if(M.startsWith("sdk:")){const tt=k||"",Q=Lh[tt];if(tt&&Q!==void 0)return Q;const J=M.slice(4);return t&&Uf(t,J,{...de,$data:fn.current}).then(at=>{en.current||(Z&&(fn.current[Z]=at),Nh(ut=>({...ut,[tt]:String(at??"")})))}).catch(()=>{}),""}const B=M.match(/^([A-Za-z_]\w*)\s*\(\s*(.*?)\s*\)$/s);if(B){const tt=B[1],Q=jh(B[2]);if($){const J=Lh[k||""];return k&&J!==void 0?J:(Sc($).then(at=>{var gt,xt;const ut=at&&(at[tt]||((gt=at.default)==null?void 0:gt[tt])||((xt=at.exports)==null?void 0:xt[tt]))||(typeof at=="function"?at:void 0);typeof ut=="function"&&k&&Promise.resolve(ut(Q,{data:fn.current})).then(Mt=>{en.current||(Z&&(fn.current[Z]=Mt),Nh(mt=>({...mt,[k]:String(Mt??"")})))})}).catch(()=>{}),"")}return tt==="timeago"?_c(Q):tt==="date"?Gr(Q,"date"):tt==="time"?Gr(Q,"time"):tt==="datetime"?Gr(Q,"datetime"):tt==="upper"?String(Q).toUpperCase():tt==="lower"?String(Q).toLowerCase():String(Q??"")}if(M.startsWith("{{")&&M.endsWith("}}")){const Q=M.slice(2,-2).trim().split("|").map(gt=>gt.trim()),J=Q[0],at=Q[1],ut=J.startsWith("{")&&J.endsWith("}")?Zr(J.slice(1,-1)):J.startsWith("$")?Zr(J.slice(1)):de[J];return at?Gr(ut,at):String(ut??"")}if(M.startsWith("{")&&M.endsWith("}"))return String(Zr(M.slice(1,-1))??"");const W=M.trim();return/^[A-Za-z_][\w.-]*$/.test(W)?String(Zr(W)??""):String(M??"")},Es=M=>M?M.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+(?:\|\w+)?))?\s*(?:\|\|\s*(.+?))?\}\}/g,($,k,Z,B)=>{let W,tt=Z;if(Z!=null&&Z.includes("|")){const J=Z.split("|");tt=J[0],W=J[1]}const Q=Zr(tt?`${k}.${tt}`:k);if(Q!=null){const J=W?Gr(Q,W):Q;return Array.isArray(J)||typeof J=="object"?JSON.stringify(J):String(J)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}).replace(/\{\{(\w+(?:\.\w+)*)\s*(?:\|(date|time|datetime|timeago)\s*)?(?:\|\|\s*(.+?))?\}\}/g,($,k,Z,B)=>{const W=k.split(".");let tt=de;for(const Q of W)tt=tt==null?void 0:tt[Q];if(tt!==void 0)return Z?Gr(tt,Z):String(tt);if(jn.current){let Q=jn.current;for(const J of W)Q=Q==null?void 0:Q[J];if(Q!==void 0)return Z?Gr(Q,Z):String(Q)}if(W[0]==="config"){let Q=e==null?void 0:e.config;for(const J of W.slice(1))Q=Q==null?void 0:Q[J];if(Q!==void 0)return String(Q)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}):"",Cs=(M,$)=>{if(!M)return!0;if(typeof M=="object")try{const W=Q=>{const J=Date.parse(String(Q));return Number.isNaN(J)?Number(Q):J},tt={...de,...$,now:()=>Date.now(),date:W,isAfter:(Q,J)=>W(Q)>W(J),isBefore:(Q,J)=>W(Q)<W(J),includes:(Q,J)=>Array.isArray(Q)?Q.includes(J):String(Q??"").includes(String(J??"")),length:Q=>String(Q??"").length,lower:Q=>String(Q??"").toLowerCase(),upper:Q=>String(Q??"").toUpperCase(),round:Math.round,abs:Math.abs};return!!sht.evaluate(M.expression,tt)}catch{return!1}const k=W=>{var Q;if(W==="auth"){const J=(Q=e==null?void 0:e.auth)==null?void 0:Q.signedIn;return J===void 0?dt:J}if(W.startsWith("[")&&W.includes("]")){const J=W.indexOf("]"),at=fn.current[W.slice(1,J)],ut=W.slice(J+1).replace(/^\./,"");let gt;const xt=ut.split(".").filter(Boolean);xt[0]==="response"||xt[0]==="items"?gt=at:gt=(at==null?void 0:at.items)??at;for(const Mt of xt){if(gt==null)return;Array.isArray(gt)&&Mt==="length"?gt=gt.length:gt=gt==null?void 0:gt[Mt]}return gt}let tt=$;for(const J of W.split("."))tt=tt==null?void 0:tt[J];return tt},Z=M.trim();if(Z.includes("||"))return Z.split("||").some(W=>Cs(W,$));if(Z.includes("&&"))return Z.split("&&").every(W=>Cs(W,$));if(Z.startsWith("!"))return!k(Z.slice(1).trim());const B=Z.match(/^(\[[^\]]+\](?:\.\w+)*|\w+(?:\.\w+)*)\s*(==|!=|>|<|>=|<=)\s*(.+)$/);if(B){const W=k(B[1]),tt=B[3].trim().replace(/^["']|["']$/g,"");switch(B[2]){case"==":return String(W)===tt;case"!=":return String(W)!==tt;case">":return Number(W)>Number(tt);case"<":return Number(W)<Number(tt);case">=":return Number(W)>=Number(tt);case"<=":return Number(W)<=Number(tt)}}return!!k(Z)},Os=(M,$)=>Cs(M,$||de),qi=(M,$,k)=>{if(!f||h!==$&&!(u&&k&&u===k))return M;const B={...M};return f.size!==void 0&&(B.transform=`scale(${f.size/100})`,B.transformOrigin="center center"),f.spacing!==void 0&&(B.margin=`${f.spacing}px`),f.alignment&&(B.textAlign=f.alignment,f.alignment==="left"?(B.marginLeft="0",B.marginRight="auto"):f.alignment==="right"&&(B.marginLeft="auto",B.marginRight="0")),f.color&&(B.color=f.color),f.gridCols!==void 0&&(B.gridTemplateColumns=`repeat(${f.gridCols}, minmax(0, 1fr))`),f.gridGap!==void 0&&(B.gap=`${f.gridGap}px`),f.buttonBackground&&(B.background=f.buttonBackground),f.buttonTextColor&&(B.color=f.buttonTextColor),f.buttonBorderRadius!==void 0&&(B.borderRadius=`${f.buttonBorderRadius}px`),f.linkColor&&(B.color=f.linkColor),f.linkTextDecoration&&(B.textDecoration=f.linkTextDecoration),f.flexDirection&&(B.flexDirection=f.flexDirection),f.flexGap!==void 0&&(B.gap=`${f.flexGap}px`),B},Am=(M,$)=>{const k={...M};return $.scale!==void 0&&$.scale!==100&&(k.transform=`scale(${$.scale/100})`,k.transformOrigin="center center"),$.spacing!==void 0&&$.spacing!==0&&(k.margin=`${$.spacing}px`),$.alignment&&$.alignment!=="center"&&(k.textAlign=$.alignment,$.alignment==="left"?(k.marginLeft="0",k.marginRight="auto"):$.alignment==="right"&&(k.marginLeft="auto",k.marginRight="0")),$.color&&(k.color=$.color),$.background&&(k.backgroundColor=$.background),$.borderColor&&(k.borderColor=$.borderColor),k},Ms=(M,$,k)=>{const Z=k==null?void 0:k.componentClass,W=h===M||u&&Z&&u===Z,tt=k?Am($,k):$,Q=qi(tt,M,Z),J=(k==null?void 0:k.className)||"";/\bfont-serif\b/.test(J)&&(Q.fontFamily=ce.typography.headingFontFamily),/\bfont-sans\b/.test(J)&&(Q.fontFamily=ce.typography.fontFamily),k!=null&&k.fieldSpan&&k.fieldSpan>1&&(Q.gridColumn=`span ${k.fieldSpan} / span ${k.fieldSpan}`),k!=null&&k.rawStyle&&Object.assign(Q,k.rawStyle);const at=Et==="css-driven"?{"data-bf-r":`${gn}-${M}`}:{};if(W){const gt=Q.boxShadow?`${Q.boxShadow}, `:"";return{"data-component-key":M,...at,style:{...Q,boxShadow:`${gt}0 0 0 3px ${ce.colors.primary}`}}}return Object.keys(Q).length>0?{"data-component-key":M,...at,style:Q}:{"data-component-key":M,...at}},Qn=(M,$)=>{var tt;if(!M)return{};const k=vy(M),Z=M.split(/\s+/).filter(Q=>!/^(sm|md|lg|xl|2xl):/.test(Q)).join(" "),B=vt(Z||"flex");if(!yy(k))return B;if(Et==="css-driven"){const Q={flexDirection:"fd",gap:"gap",width:"w",minHeight:"min-h",alignItems:"items",justifyContent:"justify",display:"display",gridTemplateColumns:"grid-template",fontSize:"text",borderRadius:"radius",padding:"p",paddingLeft:"px",paddingRight:"px",paddingTop:"py",paddingBottom:"py",margin:"m",marginTop:"mt",marginRight:"mr",marginBottom:"mb",marginLeft:"ml"},J=(at,ut)=>`var(--bf-${Q[at]||at}-${$}, ${B[at]||ut})`;if(k.flexDirection.size>0&&(B.flexDirection=J("flexDirection","column")),k.gap.size>0&&(B.gap=J("gap","0px")),k.width.size>0&&(B.width=J("width","auto")),k.minHeight.size>0&&(B.minHeight=J("minHeight","0px")),k.alignItems.size>0&&(B.alignItems=J("alignItems","stretch")),k.justifyContent.size>0&&(B.justifyContent=J("justifyContent","flex-start")),k.display.size>0&&(B.display=J("display","flex")),k.gridCols.size>0){const at=B.gridTemplateColumns||"1",ut=typeof at=="string"?(tt=at.match(/^repeat\((\d+)/))==null?void 0:tt[1]:at;B.gridTemplateColumns=`repeat(var(--bf-cols-${$}, ${ut||"1"}), minmax(0, 1fr))`}return k.gridTemplateColumns.size>0&&(B.gridTemplateColumns=J("gridTemplateColumns",String(B.gridTemplateColumns||"none"))),k.textSize.size>0&&(B.fontSize=J("fontSize","1rem")),k.borderRadius.size>0&&(B.borderRadius=J("borderRadius","0px")),k.padding.p.size>0&&(B.padding=J("padding","0px")),k.padding.px.size>0&&(B.paddingLeft=J("paddingLeft","0px"),B.paddingRight=J("paddingRight","0px")),k.padding.py.size>0&&(B.paddingTop=J("paddingTop","0px"),B.paddingBottom=J("paddingBottom","0px")),k.margin.all.size>0&&(B.margin=J("margin","0px")),k.margin.t.size>0&&(B.marginTop=J("marginTop","0px")),k.margin.r.size>0&&(B.marginRight=J("marginRight","0px")),k.margin.b.size>0&&(B.marginBottom=J("marginBottom","0px")),k.margin.l.size>0&&(B.marginLeft=J("marginLeft","0px")),k.margin.x.size>0&&(B.marginLeft=J("marginLeft","0px"),B.marginRight=J("marginRight","0px")),k.margin.y.size>0&&(B.marginTop=J("marginTop","0px"),B.marginBottom=J("marginBottom","0px")),B}const W=se;if(k.flexDirection.size>0&&(B.flexDirection=Vt(k.flexDirection,W,"column")),k.gap.size>0&&(B.gap=Vt(k.gap,W,"0px")),k.width.size>0&&(B.width=Vt(k.width,W,"auto")),k.minHeight.size>0&&(B.minHeight=Vt(k.minHeight,W,"0px")),k.alignItems.size>0&&(B.alignItems=Vt(k.alignItems,W,"stretch")),k.justifyContent.size>0&&(B.justifyContent=Vt(k.justifyContent,W,"flex-start")),k.display.size>0&&(B.display=Vt(k.display,W,"flex")),k.gridCols.size>0){const Q=Vt(k.gridCols,W,1);B.gridTemplateColumns=`repeat(${Q}, minmax(0, 1fr))`}return k.gridTemplateColumns.size>0&&(B.gridTemplateColumns=Vt(k.gridTemplateColumns,W,String(B.gridTemplateColumns||"none"))),k.textSize.size>0&&(B.fontSize=Vt(k.textSize,W,"1rem")),k.borderRadius.size>0&&(B.borderRadius=Vt(k.borderRadius,W,"0px")),k.padding.p.size>0&&(B.padding=Vt(k.padding.p,W,"0px")),k.padding.px.size>0&&(B.paddingLeft=Vt(k.padding.px,W,"0px"),B.paddingRight=Vt(k.padding.px,W,"0px")),k.padding.py.size>0&&(B.paddingTop=Vt(k.padding.py,W,"0px"),B.paddingBottom=Vt(k.padding.py,W,"0px")),k.margin.all.size>0&&(B.margin=Vt(k.margin.all,W,"0px")),k.margin.t.size>0&&(B.marginTop=Vt(k.margin.t,W,"0px")),k.margin.r.size>0&&(B.marginRight=Vt(k.margin.r,W,"0px")),k.margin.b.size>0&&(B.marginBottom=Vt(k.margin.b,W,"0px")),k.margin.l.size>0&&(B.marginLeft=Vt(k.margin.l,W,"0px")),k.margin.x.size>0&&(B.marginLeft=Vt(k.margin.x,W,"0px"),B.marginRight=Vt(k.margin.x,W,"0px")),k.margin.y.size>0&&(B.marginTop=Vt(k.margin.y,W,"0px"),B.marginBottom=Vt(k.margin.y,W,"0px")),B},Pc=v.useRef(new Map),Dh=v.useCallback(async M=>{const $=Pc.current.get(M);if($)return $;try{const k=r||localStorage.getItem("token")||"",Z=await fetch(`/api/admin/schema?collection=${encodeURIComponent(M)}`,{headers:{Authorization:`Bearer ${k}`}});if(!Z.ok)return null;const B=await Z.json(),tt=(Array.isArray(B)?B:Array.isArray(B==null?void 0:B.data)?B.data:[]).find(Q=>Q.collection===M)||null;return Pc.current.set(M,tt),tt}catch{return null}},[r]),Un={cfg:ce,sdk:t,apiUrl:N,renderMode:Et,scopeId:gn,widgets:[...Array.isArray(e==null?void 0:e.widgets)?e.widgets:[],...Object.values(Oi).flatMap(M=>M.widgets||[])],widgetStack:[],parseClassName:vt,containerWidth:se,interactionDisabled:m,previewMode:j,isAuthenticated:dt,styleOverrides:f,selectedComponentKey:h,selectedComponentClass:u,sceneData:de,setSceneData:ae,setColorMode:M=>Ss(M),portalTarget:Me.current,imageErrors:It,setImageErrors:Po,handleButtonClick:$a,interpolateText:Es,evaluateExpression:jh,evaluateCondition:Os,showToast:je,setActiveModal:cn,dismissModal:Bi,setOverlayModal:Xn,dismissOverlayModal:Eo,fetchListData:Dn,fetchEntitySchema:Dh,goBack:_o,currentSceneId:kt,isMobileView:si,navigateToScene:pr,mobileMenuOpen:gs,setMobileMenuOpen:ys,renderComponent:(M,$,k)=>Wf(Un,M,$,k),renderIcon:(M,$,k)=>(n==null?void 0:n(M,$,k))??xb(M,$,k),getCommonProps:Ms,imageReplacements:x,listData:ki,rowContextRef:jn,uploadFile:dr,runBulkSelectAction:As,selectDynamicOptions:$i,setSelectDynamicOptions:Ii,loading:Er,buttonLoading:Li,withLoading:Vi,paginationState:On,parseClassNameResponsive:Qn};O&&(Un.renderPhaserGame=(M,$)=>O(Un,M,$));let yn=[];const Ra=v.useMemo(()=>{const M={};for(const[$,k]of Object.entries(de))$.startsWith("_")||(M[$]=k);return JSON.stringify(M)},[de]),La=v.useRef({}),Ac=v.useRef(""),Tc=v.useRef(""),Ec=v.useRef({}),tr=v.useRef({}),Gi=v.useRef(On);Gi.current=On;const Bh=v.useRef(Er);Bh.current=Er;const mr=v.useRef({}),Cc=v.useRef(new Set),gr=v.useRef(null);v.useEffect(()=>{if(!ge||!dt){Ur.current.forEach($=>$()),Ur.current.clear(),To.current.clear();return}const M=$=>{var Z;const k=$.getAttribute("data-bf-scroll-load");!k||Cc.current.has(k)||(Cc.current.add(k),(Z=gr.current)==null||Z.observe($))};gr.current||(gr.current=new IntersectionObserver($=>{for(const k of $){if(!k.isIntersecting)continue;const Z=k.target.getAttribute("data-bf-scroll-load");if(!Z||mr.current[Z])continue;const B=Gi.current[Z],W=li.current[Z];if(!W||!(B!=null&&B.hasMore)||Bh.current[Z])continue;mr.current[Z]=!0;const tt=Ec.current[Z]||1;Ec.current[Z]=tt+1;const Q=tr.current[Z];Dn(W,Z,tt,B.limit,Q==null?void 0:Q.field,Q==null?void 0:Q.direction,void 0,!0).finally(()=>{var J;if(mr.current[Z]=!1,k.target.isConnected){const at=k.target.getBoundingClientRect();at.bottom>-160&&at.top<(window.innerHeight||800)+160&&((J=gr.current)==null||J.observe(k.target))}})}},{rootMargin:"160px 0px"})),document.querySelectorAll("[data-bf-scroll-load]").forEach(M)},[kt,ge,Dn,ki,Er,On]),v.useEffect(()=>()=>{var M;(M=gr.current)==null||M.disconnect(),gr.current=null,Cc.current=new Set},[kt]),v.useEffect(()=>{if(!ge)return;const M=tt=>typeof tt=="string"?tt.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*(?:\|\|\s*(.+?))?\}\}/g,(Q,J,at,ut)=>{const gt=Zr(at?`${J}.${at}`:J);return gt!=null?String(gt):ut!==void 0?ut.replace(/^["']|["']$/g,""):""}).replace(/\{\{([\w.]+)\}\}/g,(Q,J)=>{const at=J.split(".").reduce((ut,gt)=>ut==null?void 0:ut[gt],de);return at!=null?String(at):""}):"";Ac.current!==kt&&(Ac.current=kt);let $=new Set;const k=(tt,Q="")=>{Array.isArray(tt)&&tt.forEach((J,at)=>{var Mt;const ut=`${Q}-${at}`;if((J.type==="list"||J.type==="table")&&J.dataSource){$.add(ut),J.key&&$.add(J.key),tr.current[ut]=J.sort||{};const mt=M(J.dataSource),At=La.current[ut]!==mt;At&&(La.current[ut]=mt,Ec.current[ut]=1,Dn(mt,ut,0,J.pageSize||10,void 0,void 0,J.key));const a=J.realtime,d=a?M(a.channel||""):"",g=a?M(a.url||""):"",_=a?M(a.event||""):"",C=a?`${g}|${d}|${_}`:"",R=To.current.get(ut)!==C;if(a&&(At||R)){To.current.set(ut,C);const q=Ur.current.get(ut);q&&q();const rt=J.pageSize||10;let ot;const pt=Nt=>{if(!a.bind)return;let _t=Nt;try{_t=typeof Nt=="string"?JSON.parse(Nt):Nt}catch{}a.bindField&&(!_t||_t[a.bindField]===void 0)||_t&&typeof _t=="object"&&ae(jt=>({...jt,[a.bind]:_t}))},Ot=Nt=>{if(!a.filter)return!0;let _t=Nt;if(typeof _t=="string")try{_t=JSON.parse(_t)}catch{return!1}return!_t||typeof _t!="object"?!1:Object.entries(a.filter).every(([jt,Gt])=>{const ue=typeof Gt=="string"?Es(Gt):Gt;return ue===""||_t[jt]===ue})},zt=(Nt,_t)=>{if(!a.onEvent||!Array.isArray(_t))return;let jt=Nt;if(typeof jt=="string")try{jt=JSON.parse(jt)}catch{return}const Gt=jt==null?void 0:jt.id,ue=_t.find(Oe=>(Oe==null?void 0:Oe.id)===Gt);if(ue&&!(a.onEvent.when&&!Cs(a.onEvent.when,ue))){if(a.onEvent.once===!0){const Oe=[ut,a.onEvent.action,a.onEvent.when||"",(ue==null?void 0:ue.id)||Gt||""].join(":");if(ms.current.has(Oe))return;ms.current.add(Oe)}jn.current=ue,Ma.current=Object.keys(ue),ae(Oe=>({...Oe,...ue})),$a(a.onEvent.action,{}).catch(()=>{})}};switch(a.mode){case"poll":{const Nt=a.interval||5e3,_t=window.setInterval(()=>Dn(mt,ut,0,rt),Nt);ot=()=>clearInterval(_t);break}case"sse":{if(!g&&!d){ot=()=>{};break}const Nt=r||localStorage.getItem("token")||"",_t=g||`/events?channel=${d}`,jt=Nt&&!_t.includes("token=")?`${_t}${_t.includes("?")?"&":"?"}token=${encodeURIComponent(Nt)}`:_t,Gt=new EventSource(jt),ue=Oe=>{Ot(Oe.data)&&(pt(Oe.data),Dn(mt,ut,0,rt))};_?Gt.addEventListener(_,ue):Gt.onmessage=ue,Gt.onerror=()=>Gt.close(),ot=()=>Gt.close();break}case"ws":{const Nt=d||(w?`tenant:${w}:entities`:"");if(!g&&!Nt){ot=()=>{};break}let _t=null;const jt=()=>{var ue;let Gt;if(Nt&&((ue=t==null?void 0:t.client)!=null&&ue.createWebSocket))Gt=t.client.createWebSocket(Nt);else{const Oe=g||`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws?channel=${Nt}`;Gt=new WebSocket(Oe)}Gt.onmessage=Oe=>{Ot(Oe.data)&&(pt(Oe.data),Dn(mt,ut,0,rt).then(Ki=>{const Hn=Array.isArray(Ki)?Ki:ki[ut];a.onEvent&&zt(Oe.data,Hn);const Ls=de==null?void 0:de.id;if(Ls&&Array.isArray(Hn)&&Ac.current===kt){const er=Hn.find(kr=>(kr==null?void 0:kr.id)===Ls);er&&ae(kr=>({...kr,...er}))}}))},Gt.onclose=()=>setTimeout(jt,3e3),_t=Gt};jt(),ot=()=>_t==null?void 0:_t.close();break}default:ot=()=>{}}Ur.current.set(ut,ot)}}if(J.type==="select"&&J.dataSource){const mt=`${ut}-sel`,At=M(J.dataSource);La.current[mt]!==At&&(La.current[mt]=At,(async()=>{try{const a=J.dataSource,d=M(a),g=await fetch(d,{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!g.ok)return;const _=await g.json(),C=J.dataField||"configs",R=J.optionLabel||"label",q=J.optionValue||"value",rt=_[C]||_.data||_,ot=Array.isArray(rt)?rt.map(pt=>({label:pt[R]||pt.name||pt.label,value:pt[q]||pt.id||pt.name||pt.label})):[];Ii(pt=>({...pt,[ut]:ot}))}catch{}})())}J.children&&k(J.children,ut);const gt=J.accordionItems||(J.type==="accordion"?J.items:null);Array.isArray(gt)&&gt.forEach((mt,At)=>{Array.isArray(mt==null?void 0:mt.content)&&k(mt.content,`${ut}-acc-${At}-content`)}),Array.isArray(J.tabItems)&&J.tabItems.forEach((mt,At)=>{const a=Array.isArray(mt==null?void 0:mt.content)?mt.content:Array.isArray(mt==null?void 0:mt.children)?mt.children:null;a&&k(a,`${ut}-tabcontent-${At}`)});const xt=J;if(xt.type==="widget"&&xt.widgetId){const mt=(Mt=e==null?void 0:e.widgets)==null?void 0:Mt.find(At=>At.id===xt.widgetId);mt&&Array.isArray(mt.components)&&k(mt.components,`${ut}-${xt.widgetId}`)}})},Z=`${kt}|${Ra}|${dt}`;Tc.current!==Z&&(Tc.current=Z,k(yn),hn.current=$);const B=Te||Sn,W=B?We==null?void 0:We[B.id]:void 0;$=new Set,W&&Array.isArray(W==null?void 0:W.components)&&k(W.components,"modal"),Ui.current=new Set([...hn.current,...$])},[kt,Dn,Ra,Te==null?void 0:Te.id,Sn==null?void 0:Sn.id,dt]),v.useEffect(()=>()=>{Ur.current.forEach(M=>M()),Ur.current.clear()},[kt]);const Oc=v.useMemo(()=>{if(!ge||Et!=="css-driven")return null;const M=new Map,$=(k,Z)=>{k.forEach((B,W)=>{const tt=`${Z}-${W}`;if(B.className){const Q=vy(B.className);if(yy(Q)){const J=X$(gn,tt,Q);J&&M.set(tt,J)}}B.children&&$(B.children,tt)})};return $(yn,""),M},[kt,yn,Et,gn]),$o=v.useRef(wc);$o.current=wc;const Zi=ce.realtime,ks=Zi==null?void 0:Zi.mode,Na=Zi==null?void 0:Zi.url;if(v.useEffect(()=>{if(!dt||ks!=="sse"||!Na)return;const M=r||localStorage.getItem("token");if(!M)return;let $=null,k=!1;return(async()=>{try{const Z=N||(t==null?void 0:t.endpoint)||window.location.origin,B=await fetch(`${Z}${Na}/token`,{headers:{Authorization:`Bearer ${M}`}});if(!B.ok)return;const{token:W}=await B.json();if(!W||k)return;$=new EventSource(`${Z}${Na}/subscribe?token=${encodeURIComponent(W)}`),$.onmessage=tt=>{try{const Q=JSON.parse(tt.data);Q!=null&&Q.message&&$o.current(Q,"success")}catch{}},$.onerror=()=>$==null?void 0:$.close()}catch{}})(),()=>{k=!0,$==null||$.close()}},[dt,N,r,ks,Na]),!ge)return v.createElement(v.Fragment,null,iht(ct,ee.length,_o,P));const Jt=ge,ui=Jt.backgroundColor,zh=ui&&Jg(ui)!==(ce.colorMode==="dark"?"dark":"light")?Jg(ui)==="dark"?Pu.text:Au.text:ce.colors.text,Io=Jt.height!==void 0?typeof Jt.height=="number"?`${Jt.height}px`:Jt.height:void 0,ja=Jt.minHeight!==void 0?typeof Jt.minHeight=="number"?`${Jt.minHeight}px`:Jt.minHeight:void 0,Yr=Jt.className?{...yT,fontFamily:ce.typography.fontFamily,display:"flex",flexDirection:"column",width:"100%",maxWidth:"100%",position:"relative",...Io?{height:Io}:{},...ja?{minHeight:ja}:{},backgroundColor:ui||ce.colors.background,color:zh,...vt(Jt.className)}:{...yT,fontFamily:ce.typography.fontFamily,display:"flex",flexDirection:"column",position:"relative",width:"100%",maxWidth:"100%",...Io?{height:Io}:{},...ja?{minHeight:ja}:{},backgroundColor:ui||ce.colors.background,color:zh},Fh=Array.isArray(Jt.components)?Jt.components:[],Ro=rht(gn),Wh=(ge==null?void 0:ge.requireAuth)===!0||(Jt==null?void 0:Jt.requiresAuth)===!0||(Ft==null?void 0:Ft.requiresAuth)===!0||((Lo=Ft==null?void 0:Ft.config)==null?void 0:Lo.requiresAuth)===!0,Da=(Wh||nt)&&!dt?ci():null,Mc=dt&&Wh&&X===!1&&!bt?v.createElement("div",{key:"email-banner",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"10px 40px",backgroundColor:ce.colorMode==="dark"?"#78350f":"#fef3c7",color:ce.colorMode==="dark"?"#fef3c7":"#92400e",fontSize:"13px",fontWeight:500,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}},Un.renderIcon("alert-triangle",14),v.createElement("span",null,"Verify your email — check your inbox for the confirmation link."),v.createElement("button",{"aria-label":"Dismiss",onClick:()=>me(!0),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",padding:"4px"}},Un.renderIcon("x",16))):null,yr=e,Ba=Array.isArray(yr==null?void 0:yr.widgets)?yr.widgets:[],$s=new Set,fi=M=>{if(Array.isArray(M))for(const $ of M)$&&$.type==="widget"&&$.widgetId&&$s.add($.widgetId),$&&Array.isArray($.children)&&fi($.children)};fi(Fh);for(const M of Ba)fi(M.components);const za=Ba.filter(M=>$s.has(M.id)?!1:M.sceneIds==="*"?!0:Array.isArray(M.sceneIds)?M.sceneIds.includes("*")||M.sceneIds.includes(kt):!1),kc=Tr.map(M=>{var Z,B,W;const $=Oi[M.id],k=M.sourceSceneId?(Z=$==null?void 0:$.steps)==null?void 0:Z.find(tt=>tt.id===M.sourceSceneId):(B=$==null?void 0:$.steps)==null?void 0:B.find(tt=>tt.type==="render_scene");return(W=k==null?void 0:k.config)!=null&&W.components?{...M,components:k.config.components}:null}).filter(Boolean);yn=[...Fh],(Yi=(Yh=yr.layout)==null?void 0:Yh.header)!=null&&Yi.length?yn.splice(0,0,...yr.layout.header):(Rc=(Ic=Jt==null?void 0:Jt.layout)==null?void 0:Ic.header)!=null&&Rc.length&&yn.splice(0,0,...Jt.layout.header);for(const M of za||[]){const $=M.components||[];if(!$.length)continue;if(M.targetKey){const Z=M.targetKey.split("-").filter(Boolean).map(Number);if(Z.length>0){let B=yn,W=Z[0];for(let Q=0;Q<Z.length-1;Q++){const J=B[Z[Q]];if(!J||!Array.isArray(J.children))break;B=J.children,W=Z[Q+1]}const tt=M.targetPosition||"before";if(tt==="inside"){const Q=B[W];Q&&(Array.isArray(Q.children)||(Q.children=[]),Q.children.unshift(...$))}else tt==="after"?B.splice(W+1,0,...$):B.splice(W,0,...$);continue}}const k=M.index??yn.length;yn.splice(k,0,...$)}for(const M of kc){if(M.targetKey){const $=M.targetKey.split("-").filter(Boolean).map(Number);let k=yn,Z=$[0];for(let W=0;W<$.length-1;W++){const tt=k[$[W]];if(!tt||!Array.isArray(tt.children))break;k=tt.children,Z=$[W+1]}const B=M.targetPosition||"before";if(B==="inside"){const W=k[Z];W&&(Array.isArray(W.children)||(W.children=[]),W.children.unshift(...M.components))}else B==="after"?k.splice(Z+1,0,...M.components):k.splice(Z,0,...M.components);continue}yn.splice(M.index??yn.length,0,...M.components)}(Mr=(Kh=yr.layout)==null?void 0:Kh.footer)!=null&&Mr.length?yn.push(...yr.layout.footer):(Nc=(Lc=Jt==null?void 0:Jt.layout)==null?void 0:Lc.footer)!=null&&Nc.length&&yn.push(...Jt.layout.footer);const Vh=Oc&&Oc.size>0?v.createElement("style",{key:"bf-responsive"},Array.from(Oc.values()).join(`
196
+ `):M,B=$==="success",W=B?"#10B981":"#EF4444",tt=ce.toast||{},Q=k??tt.duration??3e3,J=tt.position||"bottom-right",ot={"bottom-right":{right:"24px",bottom:"24px"},"bottom-left":{left:"24px",bottom:"24px"},"bottom-center":{left:"50%",bottom:"24px",transform:"translateX(-50%)"},"top-right":{right:"24px",top:"24px"},"top-left":{left:"24px",top:"24px"},"top-center":{left:"50%",top:"24px",transform:"translateX(-50%)"}},ut=ot[J]||ot["bottom-right"],gt=document.createElement("div"),xt=document.createElement("span");xt.textContent=B?"✓":"✕",Object.assign(xt.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"22px",height:"22px",minWidth:"22px",borderRadius:"50%",backgroundColor:`${W}26`,color:W,fontSize:"12px",fontWeight:"700"});const Mt=document.createElement("span");Mt.textContent=Z,Object.assign(Mt.style,{color:"rgba(255, 255, 255, 0.92)",fontSize:"13.5px",lineHeight:"1.45",whiteSpace:"pre-line"}),Object.assign(gt.style,{position:"fixed",...ut,zIndex:"2147483647",display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px 16px",borderRadius:"12px",backgroundColor:"rgba(23, 25, 35, 0.97)",border:"1px solid rgba(148, 163, 184, 0.25)",boxShadow:"0 8px 28px rgba(0, 0, 0, 0.4)",maxWidth:"380px",opacity:"0",pointerEvents:"auto"}),gt.appendChild(xt),gt.appendChild(Mt),document.body.appendChild(gt),gt.animate([{opacity:0,transform:"translateX(24px)"},{opacity:1,transform:"translateX(0)"}],{duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"both"}).finished.catch(()=>{});const At=()=>{gt.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:"translateX(16px)"}],{duration:200,easing:"ease",fill:"both"}).finished.then(()=>gt.remove()).catch(()=>gt.remove())};return Q>0&&setTimeout(At,Q),{update:a=>{Mt.textContent=Array.isArray(a)?a.join(`
197
+ `):a},dismiss:At}},Hi=(M,$=!0)=>{if($&&(M!=null&&M.onSuccess)){const k=Array.isArray(M.onSuccess)?M.onSuccess:[M.onSuccess];for(const Z of k){const{type:B,value:W,title:tt,key:Q}=Z;switch(B){case"toast":je(W||"Success!","success");break;case"navigate":W&&pr(W);break;case"redirect":W&&(window.location.href=W);break;case"modal":W&&We[W]?cn({id:W,definition:We[W]}):cn({id:"__legacy",definition:{title:tt||"Success",components:W?[{type:"text",text:W,color:ce.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}});break;case"route":W&&Ts(W);break;case"set_data":Q&&W!==void 0&&ae(J=>({...J,[Q]:W}));break}}}else!$&&(M!=null&&M.onError)&&je(M.onError.message||"An error occurred","error")},ci=()=>{var q,rt,st,pt,Ot,zt,Nt;const M=async()=>{var Gt,ue,Oe,Ki,Hn,Ls;if(!Kt||!be||Mn==="register"&&!xe)return;const _t=Hr(Kt),jt=Fi(be);if(_t||jt){un(_t||jt);return}if(Mn==="register"&&xe!==be){Cr("confirm","Passwords do not match"),un("Passwords do not match");return}Ie(!0),un(null);try{const er=Mn==="login"?"/auth/login":"/auth/register",kr=`${fr().replace(/\/+$/,"")}${er}`,Xh=Mn==="login"?{email:Kt,password:be,tenantId:w}:{email:Kt,password:be,displayName:Kt.split("@")[0],tenantId:w},Xe={"Content-Type":"application/json"},Wa=["localhost","127.0.0.1","[::1]"].includes(window.location.hostname);T&&!Wa&&(Xe["x-app-id"]=T);const jc=await fetch(kr,{method:"POST",headers:Xe,body:JSON.stringify(Xh)});if(!jc.ok){const Q$=await jc.json().catch(()=>({error:"Authentication failed"}));throw new Error(Co(Q$))}const nr=await jc.json();if(Array.isArray(nr)||nr.success===!1)throw new Error(Co(nr));const Jh=((Gt=nr.data)==null?void 0:Gt.token)||nr.token||nr.accessToken||nr.idToken;Jh&&localStorage.setItem("token",Jh);const Va=((ue=nr.data)==null?void 0:ue.refreshToken)||nr.refreshToken;Va&&localStorage.setItem("backflow_refresh_token",Va);const Dc=((Ki=(Oe=nr.data)==null?void 0:Oe.user)==null?void 0:Ki.id)||((Hn=nr.user)==null?void 0:Hn.id)||((Ls=nr.data)==null?void 0:Ls.userId);if(Dc&&localStorage.setItem("backflow_refresh_user_id",Dc),!dt&&(nt||Ke.current||!!ln.current)){window.location.reload();return}Ke.current=!1,Ct(!0),Lt(!1),G(!1),hr(""),St(""),Rt(""),xs({}),un(null)}catch(er){const kr=typeof er=="string"?er:(er==null?void 0:er.message)||JSON.stringify(er)||"Authentication failed";un(kr),je(kr,"error")}finally{Ie(!1)}},$=async()=>{if(!Kt)return;const _t=Hr(Kt);if(_t){un(_t);return}Ie(!0),un(null);try{const jt=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Kt})});if(!jt.ok){const Gt=await jt.json().catch(()=>({error:"Failed to send reset email"}));throw new Error(Co(Gt))}re("reset"),kn(""),St(""),un(null)}catch(jt){const Gt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to send reset email";un(Gt),je(Gt,"error")}finally{Ie(!1)}},k=async()=>{if(!zi||!be)return;const _t=Fi(be);if(_t){un(_t);return}Ie(!0),un(null);try{const jt=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:zi,password:be})});if(!jt.ok){const Gt=await jt.json().catch(()=>({error:"Failed to reset password"}));throw new Error(Co(Gt))}re("login"),hr(""),St(""),kn(""),un(null)}catch(jt){const Gt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to reset password";un(Gt),je(Gt,"error")}finally{Ie(!1)}},Z=_t=>{re(_t),un(null),_t!=="reset"&&(kn(""),St("")),Rt(""),xs({})},B=ce.colorMode==="dark",W=B?"#f3f4f6":"#111827",tt=B?"#9ca3af":"#6b7280",Q=B?"#374151":"#f3f4f6",J=B?"#4b5563":"#d1d5db",ot=B?"#ffffff":"#000000",ut=B?"#000000":"#ffffff",gt=B?"#1f2937":"#ffffff",xt="#ef4444",Mt=(_t="12px")=>({width:"100%",padding:"12px 16px",border:`1px solid ${J}`,borderRadius:"8px",fontSize:"14px",backgroundColor:Q,color:W,outline:"none",marginBottom:_t,boxSizing:"border-box"}),mt=(_t,jt,Gt,ue,Oe,Ki)=>v.createElement("div",{key:_t,style:{position:"relative",marginBottom:"12px"}},V("input",{key:"input",type:le[_t]?"text":"password",placeholder:jt,value:Gt,onChange:Hn=>ue(Hn.target.value),onKeyDown:Hn=>{Hn.key==="Enter"&&Oe()},style:{...Mt("0px"),paddingRight:"40px",borderColor:Ki?xt:J}}),v.createElement("button",{key:"toggle",type:"button","aria-label":le[_t]?"Hide password":"Show password",onClick:()=>xs(Hn=>({...Hn,[_t]:!Hn[_t]})),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:tt,display:"flex",alignItems:"center",padding:"4px"}},Un.renderIcon(le[_t]?"eye-off":"eye",16)));l||e!=null&&e.title;const At=(q=e==null?void 0:e.config)!=null&&q.logo&&((rt=e==null?void 0:e.config)==null?void 0:rt.logo)!==""?e.config.logo:"",a=c||((st=e==null?void 0:e.navigation)==null?void 0:st.logo)||"mail",d=[];d.push(v.createElement("div",{key:"brand",role:"button","aria-label":"Go back home",onClick:()=>{pr("/"),Lt(!1),Ke.current=!1,ln.current=null},style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px",cursor:"pointer"}},At?v.createElement("img",{src:At,alt:"",style:{width:"56px",height:"56px",objectFit:"contain"}}):Un.renderIcon(a,56))),Mn==="login"?(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Sign In")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Enter your credentials to continue")),d.push(V("input",{key:"email",type:"email",placeholder:"Email Address",value:Kt,onChange:_t=>{hr(_t.target.value),Cr("email",Hr(_t.target.value))},style:{...Mt(),borderColor:Ee.email&&Kt?xt:J}})),Ee.email&&Kt&&d.push(v.createElement("p",{key:"email-err",style:{color:xt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Ee.email)),d.push(mt("pass","Password",be,_t=>{St(_t),Cr("pass",Fi(_t))},M,!!(Ee.pass&&be))),Ee.pass&&be&&d.push(v.createElement("p",{key:"pass-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.pass)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:M,disabled:Ge||!Kt||!be,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":ot,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"8px"}},Ge?"Please wait...":"Sign In")),d.push(v.createElement("p",{key:"forgot",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer",marginBottom:"16px"},onClick:()=>Z("forgot")},"Forgot password?")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("register")},"Don’t have an account? Register"))):Mn==="register"?(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Create Account")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Create an account to get started")),d.push(V("input",{key:"email",type:"email",placeholder:"Email",value:Kt,onChange:_t=>{hr(_t.target.value),Cr("email",Hr(_t.target.value))},style:{...Mt(),borderColor:Ee.email&&Kt?xt:J}})),Ee.email&&Kt&&d.push(v.createElement("p",{key:"email-err",style:{color:xt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Ee.email)),d.push(mt("pass","Password",be,_t=>{St(_t),Cr("pass",Fi(_t))},M,!!(Ee.pass&&be))),Ee.pass&&be&&d.push(v.createElement("p",{key:"pass-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.pass)),d.push(mt("confirm","Confirm password",xe,_t=>{Rt(_t),Cr("confirm",_s(be,_t))},M,!!(Ee.confirm&&xe))),Ee.confirm&&xe&&d.push(v.createElement("p",{key:"confirm-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.confirm)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:M,disabled:Ge||!Kt||!be||!xe,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":ot,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"16px"}},Ge?"Please wait...":"Create Account")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Already have an account? Sign In"))):Mn==="forgot"?(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Reset Password")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Enter your email to receive a reset link")),d.push(V("input",{key:"email",type:"email",placeholder:"Email",value:Kt,onChange:_t=>{hr(_t.target.value),Cr("email",Hr(_t.target.value))},onKeyDown:_t=>{_t.key==="Enter"&&$()},style:{...Mt("16px"),borderColor:Ee.email&&Kt?xt:J}})),Ee.email&&Kt&&d.push(v.createElement("p",{key:"email-err",style:{color:xt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Ee.email)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:$,disabled:Ge||!Kt,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":ot,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"16px"}},Ge?"Please wait...":"Send Reset Link")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In"))):Mn==="reset"&&(d.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Set New Password")),d.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:tt,marginBottom:"24px",textAlign:"center"}},"Enter the reset code and your new password")),d.push(V("input",{key:"code",type:"text",placeholder:"Reset code",value:zi,onChange:_t=>kn(_t.target.value),style:Mt()})),d.push(mt("pass","New password",be,_t=>{St(_t),Cr("pass",Fi(_t))},k,!!(Ee.pass&&be))),Ee.pass&&be&&d.push(v.createElement("p",{key:"pass-err",style:{color:xt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Ee.pass)),ai&&d.push(v.createElement("p",{key:"err",style:{color:xt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},ai)),d.push(v.createElement("button",{key:"submt",onClick:k,disabled:Ge||!zi||!be,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:Ge?B?"#4b5563":"#9ca3af":ot,color:ut,border:"none",cursor:Ge?"not-allowed":"pointer",marginBottom:"16px"}},Ge?"Please wait...":"Reset Password")),d.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:tt,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In")));const g=((pt=e==null?void 0:e.config)==null?void 0:pt.auth)||{},_=g.style==="page"?"page":"modal",C=g.containerStyle||{},R=v.createElement("div",{key:"auth-box",style:{width:"100%",maxWidth:_==="page"?"400px":"360px",padding:"24px",backgroundColor:"#000000",borderRadius:"12px",...C}},...d);if(_==="page"){const _t=((Ot=ce.colors)==null?void 0:Ot.primary)||"#4f46e5",jt=g.coverImage?`url(${g.coverImage}) center/cover no-repeat`:_t,Gt=(zt=e==null?void 0:e.config)!=null&&zt.logo&&((Nt=e==null?void 0:e.config)==null?void 0:Nt.logo)!==""?e.config.logo:"",ue=Gt?v.createElement("img",{src:Gt,alt:"",style:{position:"absolute",bottom:"-6%",left:"50%",width:"90%",maxWidth:"660px",height:"auto",objectFit:"contain",transform:"translateX(-50%) rotate(-8deg)",opacity:.92,filter:"brightness(0) invert(1)"}}):v.createElement("div",{style:{color:"#ffffff",opacity:.95}},Un.renderIcon(a,96));return v.createElement("div",{key:"auth-page",style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",backgroundColor:gt,zIndex:1e4,animation:"bf-fade-in 0.2s ease"}},v.createElement("div",{style:{flex:si?"1 1 100%":"0 0 40%",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",backgroundColor:"#000000"}},R),v.createElement("div",{style:{flex:"0 0 60%",background:jt,display:si?"none":"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"}},ue))}return v.createElement("div",{key:"auth-form",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},R)},$a=async(M,$,k)=>{var Z,B;try{let W=String(Es(M)??"");const tt=W.match(/^\{\{\s*(.+?)\s*\?\s*(.*?)\s+:\s+(.*?)\s*\}\}$/);tt&&(W=Os(tt[1])?tt[2]:tt[3]);const Q=W.split(";").map(mt=>mt.trim()).filter(Boolean);if(Q.length>1){for(const mt of Q)await $a(mt,void 0,k);return}if(W==="go_back"){_o();return}if(W==="toggle_theme"){Ss((de._colorMode||ce.colorMode)==="dark"?"light":"dark");return}if(W==="close_modal"){Bi();return}const J=W.match(/^(toast|show_toast):(.*)$/);if(J){const mt=J[2].trim();mt&&je(mt,"success");return}const ot=W.match(/^scroll_to:([\w-]+)$/);if(ot){(Z=document.getElementById(ot[1]))==null||Z.scrollIntoView({behavior:"smooth",block:"start"});return}const ut=W.match(/^set_data:([\w.]+)=(.*)$/);if(ut){ae(mt=>({...mt,[ut[1]]:ut[2]}));return}const gt=W.match(/^native:([a-z][\w.-]*)$/i);if(gt){if(!i){je("Native app required","error");return}const mt=gt[1],At=await i(mt,de);if(At&&typeof At=="object"&&!Array.isArray(At)){const a=mt.replace(/[^\w]/g,"_");ae(d=>({...d,native:{...d.native||{},[a]:At}}))}return}const xt=W.match(/^copy_to_clipboard:(.*)$/);if(xt){const mt=xt[1];try{await navigator.clipboard.writeText(mt)}catch{const At=document.createElement("textarea");At.value=mt,At.style.position="fixed",At.style.opacity="0",document.body.appendChild(At),At.select(),document.execCommand("copy"),At.remove()}je("API key copied","success");return}const Mt=W.match(/^auth:(login|register|forgot|reset|logout)$/);if(Mt){if(Mt[1]==="logout"){if(!dt)return;localStorage.removeItem("token"),localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),Ke.current=!1,ln.current=null,Ct(!1),Lt(!1),lt(null),G(!1),pr("/");return}if(dt)return;un(null),re(Mt[1]),Lt(!0);return}if(W==="accept_startup_modal"){const mt=ce.startupModal;mt&&localStorage.setItem(`backflow_startup_modal_${mt}`,"1"),Bi();const At=et.find(a=>a.route==="/");At&&(ne(a=>[...a,kt]),Nn(At.id));return}if(W==="decline_startup_modal"){Bi();const mt=et.find(At=>At.route==="/");mt&&(ne(At=>[...At,kt]),Nn(mt.id));return}if(W==="toggle_select"){ae(mt=>({...mt,_selectMode:!mt._selectMode,...mt._selectMode?{_selIds:[]}:{}}));return}if(W.startsWith("go_to_step:"))pr(W.replace("go_to_step:","")),Hi($,!0);else if(W.startsWith("navigate:"))pr(W.replace("navigate:","")),Hi($,!0);else if(_u(W)&&t){const mt=su(W),At=await Uf(t,mt,de);At!=null&&At.data?ae(a=>({...a,...At.data})):At&&typeof At=="object"&&!Array.isArray(At)&&ae(a=>({...a,...At})),At!=null&&At.url&&String(At.url).startsWith("http")&&window.open(String(At.url),"_blank","noopener,noreferrer"),Hi($,!0)}else if(W.startsWith("show_modal:")){const mt=W.replace("show_modal:","");if(We[mt]){const At=We[mt];if(vs(At.popover&&(k!=null&&k.anchorElement)?k.anchorElement.getBoundingClientRect():null),bs.current=At.popover&&(k==null?void 0:k.anchorElement)||null,jn.current&&typeof jn.current=="object"){const g=Object.keys(jn.current);ae(_=>{const C={..._};for(const R of Ma.current)g.includes(R)||delete C[R];return{...C,...jn.current}}),Ma.current=g}const a=At.clearFormKeys;Array.isArray(a)&&a.length>0&&ae(g=>{const _={...g};for(const C of a)delete _[C];return _});const d=At.defaults;d&&typeof d=="object"&&ae(g=>{const _={...g};for(const[C,R]of Object.entries(d))_[C]===void 0&&(_[C]=R);return _}),At.preload&&await Ts(String(At.preload)),(Te==null?void 0:Te.id)===mt||(Sn==null?void 0:Sn.id)===mt||(Xn(null),cn({id:mt,definition:At}))}else{const At=mt.split("|");cn({id:"__legacy",definition:{title:At[0]||"Notice",components:At[1]?[{type:"text",text:At[1],color:"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}Hi($,!0)}else W.startsWith("execute_workflow:")?(await Ts(W.replace("execute_workflow:",""),k),Hi($,!0)):W.startsWith("fetch:")&&(await Ts(W.replace("fetch:",""),k),o==null||o(W.replace("fetch:","")),Hi($,!0))}catch(W){if(Gg("[handleButtonClick] caught error:",W,"callbacks:",$),(W==null?void 0:W.status)===401){await Oo({status:401},!0);return}if(W instanceof ko){if(Jn(W,$==null?void 0:$.onError))return;je(W.errors.length>1?W.errors:W.errors[0],"error")}else(B=$==null?void 0:$.onError)!=null&&B.message?je($.onError.message,"error"):je(W instanceof Error?W.message:"An error occurred","error")}},_c=M=>{const $=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(isNaN($.getTime()))return String(M??"");const k=Math.floor((Date.now()-$.getTime())/6e4);if(k<1)return"just now";if(k<60)return`${k}m ago`;const Z=Math.floor(k/60);if(Z<24)return`${Z}h ago`;const B=Math.floor(Z/24);return B<7?`${B}d ago`:$.toLocaleDateString()},Gr=(M,$)=>{if($==="timeago")return _c(M);const k=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(!isNaN(k.getTime())){if($==="date")return k.toLocaleDateString();if($==="time")return k.toLocaleTimeString();if($==="datetime")return k.toLocaleString()}return String(M??"")},fn=v.useRef({}),Zr=M=>{const $=M.split(".").filter(Boolean);if($.length===0)return;let k=fn.current[$[0]]??de[$[0]];for(let Z=1;Z<$.length;Z++){if(k==null)return;const B=$[Z];if(Array.isArray(k))if(B==="first")k=k[0];else if(B==="last")k=k[k.length-1];else if(B==="length")k=k.length;else if(/^\d+$/.test(B))k=k[Number(B)];else if(B==="index")k=k[0];else return;else if(k&&typeof k=="object"&&Array.isArray(k.items))B==="response"?k=k.response:B==="first"?k=k.items[0]:B==="last"?k=k.items[k.items.length-1]:B==="length"?k=k.items.length:/^\d+$/.test(B)?k=k.items[Number(B)]:B==="index"?k=k.items[0]:k=k[B];else if(typeof k=="object")k=k[B];else return}return k},Ia=v.useRef({}),[Lh,Nh]=v.useState({}),Sc=v.useCallback(M=>(Ia.current[M]||(Ia.current[M]=import(M).catch(()=>fetch(M).then($=>$.text()).then($=>{const k={};return new Function("module","exports",$)(k,k),k.exports||k}))),Ia.current[M]),[]),jh=(M,$,k,Z)=>{if(!M)return"";if(M.startsWith("sdk:")){const tt=k||"",Q=Lh[tt];if(tt&&Q!==void 0)return Q;const J=M.slice(4);return t&&Uf(t,J,{...de,$data:fn.current}).then(ot=>{en.current||(Z&&(fn.current[Z]=ot),Nh(ut=>({...ut,[tt]:String(ot??"")})))}).catch(()=>{}),""}const B=M.match(/^([A-Za-z_]\w*)\s*\(\s*(.*?)\s*\)$/s);if(B){const tt=B[1],Q=jh(B[2]);if($){const J=Lh[k||""];return k&&J!==void 0?J:(Sc($).then(ot=>{var gt,xt;const ut=ot&&(ot[tt]||((gt=ot.default)==null?void 0:gt[tt])||((xt=ot.exports)==null?void 0:xt[tt]))||(typeof ot=="function"?ot:void 0);typeof ut=="function"&&k&&Promise.resolve(ut(Q,{data:fn.current})).then(Mt=>{en.current||(Z&&(fn.current[Z]=Mt),Nh(mt=>({...mt,[k]:String(Mt??"")})))})}).catch(()=>{}),"")}return tt==="timeago"?_c(Q):tt==="date"?Gr(Q,"date"):tt==="time"?Gr(Q,"time"):tt==="datetime"?Gr(Q,"datetime"):tt==="upper"?String(Q).toUpperCase():tt==="lower"?String(Q).toLowerCase():String(Q??"")}if(M.startsWith("{{")&&M.endsWith("}}")){const Q=M.slice(2,-2).trim().split("|").map(gt=>gt.trim()),J=Q[0],ot=Q[1],ut=J.startsWith("{")&&J.endsWith("}")?Zr(J.slice(1,-1)):J.startsWith("$")?Zr(J.slice(1)):de[J];return ot?Gr(ut,ot):String(ut??"")}if(M.startsWith("{")&&M.endsWith("}"))return String(Zr(M.slice(1,-1))??"");const W=M.trim();return/^[A-Za-z_][\w.-]*$/.test(W)?String(Zr(W)??""):String(M??"")},Es=M=>M?M.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+(?:\|\w+)?))?\s*(?:\|\|\s*(.+?))?\}\}/g,($,k,Z,B)=>{let W,tt=Z;if(Z!=null&&Z.includes("|")){const J=Z.split("|");tt=J[0],W=J[1]}const Q=Zr(tt?`${k}.${tt}`:k);if(Q!=null){const J=W?Gr(Q,W):Q;return Array.isArray(J)||typeof J=="object"?JSON.stringify(J):String(J)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}).replace(/\{\{(\w+(?:\.\w+)*)\s*(?:\|(date|time|datetime|timeago)\s*)?(?:\|\|\s*(.+?))?\}\}/g,($,k,Z,B)=>{const W=k.split(".");let tt=de;for(const Q of W)tt=tt==null?void 0:tt[Q];if(tt!==void 0)return Z?Gr(tt,Z):String(tt);if(jn.current){let Q=jn.current;for(const J of W)Q=Q==null?void 0:Q[J];if(Q!==void 0)return Z?Gr(Q,Z):String(Q)}if(W[0]==="config"){let Q=e==null?void 0:e.config;for(const J of W.slice(1))Q=Q==null?void 0:Q[J];if(Q!==void 0)return String(Q)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}):"",Cs=(M,$)=>{if(!M)return!0;if(typeof M=="object")try{const W=Q=>{const J=Date.parse(String(Q));return Number.isNaN(J)?Number(Q):J},tt={...de,...$,now:()=>Date.now(),date:W,isAfter:(Q,J)=>W(Q)>W(J),isBefore:(Q,J)=>W(Q)<W(J),includes:(Q,J)=>Array.isArray(Q)?Q.includes(J):String(Q??"").includes(String(J??"")),length:Q=>String(Q??"").length,lower:Q=>String(Q??"").toLowerCase(),upper:Q=>String(Q??"").toUpperCase(),round:Math.round,abs:Math.abs};return!!sht.evaluate(M.expression,tt)}catch{return!1}const k=W=>{var Q;if(W==="auth"){const J=(Q=e==null?void 0:e.auth)==null?void 0:Q.signedIn;return J===void 0?dt:J}if(W.startsWith("[")&&W.includes("]")){const J=W.indexOf("]"),ot=fn.current[W.slice(1,J)],ut=W.slice(J+1).replace(/^\./,"");let gt;const xt=ut.split(".").filter(Boolean);xt[0]==="response"||xt[0]==="items"?gt=ot:gt=(ot==null?void 0:ot.items)??ot;for(const Mt of xt){if(gt==null)return;Array.isArray(gt)&&Mt==="length"?gt=gt.length:gt=gt==null?void 0:gt[Mt]}return gt}let tt=$;for(const J of W.split("."))tt=tt==null?void 0:tt[J];return tt},Z=M.trim();if(Z.includes("||"))return Z.split("||").some(W=>Cs(W,$));if(Z.includes("&&"))return Z.split("&&").every(W=>Cs(W,$));if(Z.startsWith("!"))return!k(Z.slice(1).trim());const B=Z.match(/^(\[[^\]]+\](?:\.\w+)*|\w+(?:\.\w+)*)\s*(==|!=|>|<|>=|<=)\s*(.+)$/);if(B){const W=k(B[1]),tt=B[3].trim().replace(/^["']|["']$/g,"");switch(B[2]){case"==":return String(W)===tt;case"!=":return String(W)!==tt;case">":return Number(W)>Number(tt);case"<":return Number(W)<Number(tt);case">=":return Number(W)>=Number(tt);case"<=":return Number(W)<=Number(tt)}}return!!k(Z)},Os=(M,$)=>Cs(M,$||de),qi=(M,$,k)=>{if(!f||h!==$&&!(u&&k&&u===k))return M;const B={...M};return f.size!==void 0&&(B.transform=`scale(${f.size/100})`,B.transformOrigin="center center"),f.spacing!==void 0&&(B.margin=`${f.spacing}px`),f.alignment&&(B.textAlign=f.alignment,f.alignment==="left"?(B.marginLeft="0",B.marginRight="auto"):f.alignment==="right"&&(B.marginLeft="auto",B.marginRight="0")),f.color&&(B.color=f.color),f.gridCols!==void 0&&(B.gridTemplateColumns=`repeat(${f.gridCols}, minmax(0, 1fr))`),f.gridGap!==void 0&&(B.gap=`${f.gridGap}px`),f.buttonBackground&&(B.background=f.buttonBackground),f.buttonTextColor&&(B.color=f.buttonTextColor),f.buttonBorderRadius!==void 0&&(B.borderRadius=`${f.buttonBorderRadius}px`),f.linkColor&&(B.color=f.linkColor),f.linkTextDecoration&&(B.textDecoration=f.linkTextDecoration),f.flexDirection&&(B.flexDirection=f.flexDirection),f.flexGap!==void 0&&(B.gap=`${f.flexGap}px`),B},Am=(M,$)=>{const k={...M};return $.scale!==void 0&&$.scale!==100&&(k.transform=`scale(${$.scale/100})`,k.transformOrigin="center center"),$.spacing!==void 0&&$.spacing!==0&&(k.margin=`${$.spacing}px`),$.alignment&&$.alignment!=="center"&&(k.textAlign=$.alignment,$.alignment==="left"?(k.marginLeft="0",k.marginRight="auto"):$.alignment==="right"&&(k.marginLeft="auto",k.marginRight="0")),$.color&&(k.color=$.color),$.background&&(k.backgroundColor=$.background),$.borderColor&&(k.borderColor=$.borderColor),k},Ms=(M,$,k)=>{const Z=k==null?void 0:k.componentClass,W=h===M||u&&Z&&u===Z,tt=k?Am($,k):$,Q=qi(tt,M,Z),J=(k==null?void 0:k.className)||"";/\bfont-serif\b/.test(J)&&(Q.fontFamily=ce.typography.headingFontFamily),/\bfont-sans\b/.test(J)&&(Q.fontFamily=ce.typography.fontFamily),k!=null&&k.fieldSpan&&k.fieldSpan>1&&(Q.gridColumn=`span ${k.fieldSpan} / span ${k.fieldSpan}`),k!=null&&k.rawStyle&&Object.assign(Q,k.rawStyle);const ot=Et==="css-driven"?{"data-bf-r":`${gn}-${M}`}:{};if(W){const gt=Q.boxShadow?`${Q.boxShadow}, `:"";return{"data-component-key":M,...ot,style:{...Q,boxShadow:`${gt}0 0 0 3px ${ce.colors.primary}`}}}return Object.keys(Q).length>0?{"data-component-key":M,...ot,style:Q}:{"data-component-key":M,...ot}},Qn=(M,$)=>{var tt;if(!M)return{};const k=vy(M),Z=M.split(/\s+/).filter(Q=>!/^(sm|md|lg|xl|2xl):/.test(Q)).join(" "),B=vt(Z||"flex");if(!yy(k))return B;if(Et==="css-driven"){const Q={flexDirection:"fd",gap:"gap",width:"w",minHeight:"min-h",alignItems:"items",justifyContent:"justify",display:"display",gridTemplateColumns:"grid-template",fontSize:"text",borderRadius:"radius",padding:"p",paddingLeft:"px",paddingRight:"px",paddingTop:"py",paddingBottom:"py",margin:"m",marginTop:"mt",marginRight:"mr",marginBottom:"mb",marginLeft:"ml"},J=(ot,ut)=>`var(--bf-${Q[ot]||ot}-${$}, ${B[ot]||ut})`;if(k.flexDirection.size>0&&(B.flexDirection=J("flexDirection","column")),k.gap.size>0&&(B.gap=J("gap","0px")),k.width.size>0&&(B.width=J("width","auto")),k.minHeight.size>0&&(B.minHeight=J("minHeight","0px")),k.alignItems.size>0&&(B.alignItems=J("alignItems","stretch")),k.justifyContent.size>0&&(B.justifyContent=J("justifyContent","flex-start")),k.display.size>0&&(B.display=J("display","flex")),k.gridCols.size>0){const ot=B.gridTemplateColumns||"1",ut=typeof ot=="string"?(tt=ot.match(/^repeat\((\d+)/))==null?void 0:tt[1]:ot;B.gridTemplateColumns=`repeat(var(--bf-cols-${$}, ${ut||"1"}), minmax(0, 1fr))`}return k.gridTemplateColumns.size>0&&(B.gridTemplateColumns=J("gridTemplateColumns",String(B.gridTemplateColumns||"none"))),k.textSize.size>0&&(B.fontSize=J("fontSize","1rem")),k.borderRadius.size>0&&(B.borderRadius=J("borderRadius","0px")),k.padding.p.size>0&&(B.padding=J("padding","0px")),k.padding.px.size>0&&(B.paddingLeft=J("paddingLeft","0px"),B.paddingRight=J("paddingRight","0px")),k.padding.py.size>0&&(B.paddingTop=J("paddingTop","0px"),B.paddingBottom=J("paddingBottom","0px")),k.margin.all.size>0&&(B.margin=J("margin","0px")),k.margin.t.size>0&&(B.marginTop=J("marginTop","0px")),k.margin.r.size>0&&(B.marginRight=J("marginRight","0px")),k.margin.b.size>0&&(B.marginBottom=J("marginBottom","0px")),k.margin.l.size>0&&(B.marginLeft=J("marginLeft","0px")),k.margin.x.size>0&&(B.marginLeft=J("marginLeft","0px"),B.marginRight=J("marginRight","0px")),k.margin.y.size>0&&(B.marginTop=J("marginTop","0px"),B.marginBottom=J("marginBottom","0px")),B}const W=se;if(k.flexDirection.size>0&&(B.flexDirection=Vt(k.flexDirection,W,"column")),k.gap.size>0&&(B.gap=Vt(k.gap,W,"0px")),k.width.size>0&&(B.width=Vt(k.width,W,"auto")),k.minHeight.size>0&&(B.minHeight=Vt(k.minHeight,W,"0px")),k.alignItems.size>0&&(B.alignItems=Vt(k.alignItems,W,"stretch")),k.justifyContent.size>0&&(B.justifyContent=Vt(k.justifyContent,W,"flex-start")),k.display.size>0&&(B.display=Vt(k.display,W,"flex")),k.gridCols.size>0){const Q=Vt(k.gridCols,W,1);B.gridTemplateColumns=`repeat(${Q}, minmax(0, 1fr))`}return k.gridTemplateColumns.size>0&&(B.gridTemplateColumns=Vt(k.gridTemplateColumns,W,String(B.gridTemplateColumns||"none"))),k.textSize.size>0&&(B.fontSize=Vt(k.textSize,W,"1rem")),k.borderRadius.size>0&&(B.borderRadius=Vt(k.borderRadius,W,"0px")),k.padding.p.size>0&&(B.padding=Vt(k.padding.p,W,"0px")),k.padding.px.size>0&&(B.paddingLeft=Vt(k.padding.px,W,"0px"),B.paddingRight=Vt(k.padding.px,W,"0px")),k.padding.py.size>0&&(B.paddingTop=Vt(k.padding.py,W,"0px"),B.paddingBottom=Vt(k.padding.py,W,"0px")),k.margin.all.size>0&&(B.margin=Vt(k.margin.all,W,"0px")),k.margin.t.size>0&&(B.marginTop=Vt(k.margin.t,W,"0px")),k.margin.r.size>0&&(B.marginRight=Vt(k.margin.r,W,"0px")),k.margin.b.size>0&&(B.marginBottom=Vt(k.margin.b,W,"0px")),k.margin.l.size>0&&(B.marginLeft=Vt(k.margin.l,W,"0px")),k.margin.x.size>0&&(B.marginLeft=Vt(k.margin.x,W,"0px"),B.marginRight=Vt(k.margin.x,W,"0px")),k.margin.y.size>0&&(B.marginTop=Vt(k.margin.y,W,"0px"),B.marginBottom=Vt(k.margin.y,W,"0px")),B},Pc=v.useRef(new Map),Dh=v.useCallback(async M=>{const $=Pc.current.get(M);if($)return $;try{const k=r||localStorage.getItem("token")||"",Z=await fetch(`/api/admin/schema?collection=${encodeURIComponent(M)}`,{headers:{Authorization:`Bearer ${k}`}});if(!Z.ok)return null;const B=await Z.json(),tt=(Array.isArray(B)?B:Array.isArray(B==null?void 0:B.data)?B.data:[]).find(Q=>Q.collection===M)||null;return Pc.current.set(M,tt),tt}catch{return null}},[r]),Un={cfg:ce,sdk:t,apiUrl:N,renderMode:Et,scopeId:gn,widgets:[...Array.isArray(e==null?void 0:e.widgets)?e.widgets:[],...Object.values(Oi).flatMap(M=>M.widgets||[])],widgetStack:[],parseClassName:vt,containerWidth:se,interactionDisabled:m,previewMode:j,isAuthenticated:dt,styleOverrides:f,selectedComponentKey:h,selectedComponentClass:u,sceneData:de,setSceneData:ae,setColorMode:M=>Ss(M),portalTarget:Me.current,imageErrors:It,setImageErrors:Po,handleButtonClick:$a,interpolateText:Es,evaluateExpression:jh,evaluateCondition:Os,showToast:je,setActiveModal:cn,dismissModal:Bi,setOverlayModal:Xn,dismissOverlayModal:Eo,fetchListData:Dn,fetchEntitySchema:Dh,goBack:_o,currentSceneId:kt,isMobileView:si,navigateToScene:pr,mobileMenuOpen:gs,setMobileMenuOpen:ys,renderComponent:(M,$,k)=>Wf(Un,M,$,k),renderIcon:(M,$,k)=>(n==null?void 0:n(M,$,k))??xb(M,$,k),getCommonProps:Ms,imageReplacements:x,listData:ki,rowContextRef:jn,uploadFile:dr,runBulkSelectAction:As,selectDynamicOptions:$i,setSelectDynamicOptions:Ii,loading:Er,buttonLoading:Li,withLoading:Vi,paginationState:On,parseClassNameResponsive:Qn};O&&(Un.renderPhaserGame=(M,$)=>O(Un,M,$));let yn=[];const Ra=v.useMemo(()=>{const M={};for(const[$,k]of Object.entries(de))$.startsWith("_")||(M[$]=k);return JSON.stringify(M)},[de]),La=v.useRef({}),Ac=v.useRef(""),Tc=v.useRef(""),Ec=v.useRef({}),tr=v.useRef({}),Gi=v.useRef(On);Gi.current=On;const Bh=v.useRef(Er);Bh.current=Er;const mr=v.useRef({}),Cc=v.useRef(new Set),gr=v.useRef(null);v.useEffect(()=>{if(!ge||!dt){Ur.current.forEach($=>$()),Ur.current.clear(),To.current.clear();return}const M=$=>{var Z;const k=$.getAttribute("data-bf-scroll-load");!k||Cc.current.has(k)||(Cc.current.add(k),(Z=gr.current)==null||Z.observe($))};gr.current||(gr.current=new IntersectionObserver($=>{for(const k of $){if(!k.isIntersecting)continue;const Z=k.target.getAttribute("data-bf-scroll-load");if(!Z||mr.current[Z])continue;const B=Gi.current[Z],W=li.current[Z];if(!W||!(B!=null&&B.hasMore)||Bh.current[Z])continue;mr.current[Z]=!0;const tt=Ec.current[Z]||1;Ec.current[Z]=tt+1;const Q=tr.current[Z];Dn(W,Z,tt,B.limit,Q==null?void 0:Q.field,Q==null?void 0:Q.direction,void 0,!0).finally(()=>{var J;if(mr.current[Z]=!1,k.target.isConnected){const ot=k.target.getBoundingClientRect();ot.bottom>-160&&ot.top<(window.innerHeight||800)+160&&((J=gr.current)==null||J.observe(k.target))}})}},{rootMargin:"160px 0px"})),document.querySelectorAll("[data-bf-scroll-load]").forEach(M)},[kt,ge,Dn,ki,Er,On]),v.useEffect(()=>()=>{var M;(M=gr.current)==null||M.disconnect(),gr.current=null,Cc.current=new Set},[kt]),v.useEffect(()=>{if(!ge)return;const M=tt=>typeof tt=="string"?tt.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*(?:\|\|\s*(.+?))?\}\}/g,(Q,J,ot,ut)=>{const gt=Zr(ot?`${J}.${ot}`:J);return gt!=null?String(gt):ut!==void 0?ut.replace(/^["']|["']$/g,""):""}).replace(/\{\{([\w.]+)\}\}/g,(Q,J)=>{const ot=J.split(".").reduce((ut,gt)=>ut==null?void 0:ut[gt],de);return ot!=null?String(ot):""}):"";Ac.current!==kt&&(Ac.current=kt);let $=new Set;const k=(tt,Q="")=>{Array.isArray(tt)&&tt.forEach((J,ot)=>{var Mt;const ut=`${Q}-${ot}`;if((J.type==="list"||J.type==="table")&&J.dataSource){$.add(ut),J.key&&$.add(J.key),tr.current[ut]=J.sort||{};const mt=M(J.dataSource),At=La.current[ut]!==mt;At&&(La.current[ut]=mt,Ec.current[ut]=1,Dn(mt,ut,0,J.pageSize||10,void 0,void 0,J.key));const a=J.realtime,d=a?M(a.channel||""):"",g=a?M(a.url||""):"",_=a?M(a.event||""):"",C=a?`${g}|${d}|${_}`:"",R=To.current.get(ut)!==C;if(a&&(At||R)){To.current.set(ut,C);const q=Ur.current.get(ut);q&&q();const rt=J.pageSize||10;let st;const pt=Nt=>{if(!a.bind)return;let _t=Nt;try{_t=typeof Nt=="string"?JSON.parse(Nt):Nt}catch{}a.bindField&&(!_t||_t[a.bindField]===void 0)||_t&&typeof _t=="object"&&ae(jt=>({...jt,[a.bind]:_t}))},Ot=Nt=>{if(!a.filter)return!0;let _t=Nt;if(typeof _t=="string")try{_t=JSON.parse(_t)}catch{return!1}return!_t||typeof _t!="object"?!1:Object.entries(a.filter).every(([jt,Gt])=>{const ue=typeof Gt=="string"?Es(Gt):Gt;return ue===""||_t[jt]===ue})},zt=(Nt,_t)=>{if(!a.onEvent||!Array.isArray(_t))return;let jt=Nt;if(typeof jt=="string")try{jt=JSON.parse(jt)}catch{return}const Gt=jt==null?void 0:jt.id,ue=_t.find(Oe=>(Oe==null?void 0:Oe.id)===Gt);if(ue&&!(a.onEvent.when&&!Cs(a.onEvent.when,ue))){if(a.onEvent.once===!0){const Oe=[ut,a.onEvent.action,a.onEvent.when||"",(ue==null?void 0:ue.id)||Gt||""].join(":");if(ms.current.has(Oe))return;ms.current.add(Oe)}jn.current=ue,Ma.current=Object.keys(ue),ae(Oe=>({...Oe,...ue})),$a(a.onEvent.action,{}).catch(()=>{})}};switch(a.mode){case"poll":{const Nt=a.interval||5e3,_t=window.setInterval(()=>Dn(mt,ut,0,rt),Nt);st=()=>clearInterval(_t);break}case"sse":{if(!g&&!d){st=()=>{};break}const Nt=r||localStorage.getItem("token")||"",_t=g||`/events?channel=${d}`,jt=Nt&&!_t.includes("token=")?`${_t}${_t.includes("?")?"&":"?"}token=${encodeURIComponent(Nt)}`:_t,Gt=new EventSource(jt),ue=Oe=>{Ot(Oe.data)&&(pt(Oe.data),Dn(mt,ut,0,rt))};_?Gt.addEventListener(_,ue):Gt.onmessage=ue,Gt.onerror=()=>Gt.close(),st=()=>Gt.close();break}case"ws":{const Nt=d||(w?`tenant:${w}:entities`:"");if(!g&&!Nt){st=()=>{};break}let _t=null;const jt=()=>{var ue;let Gt;if(Nt&&((ue=t==null?void 0:t.client)!=null&&ue.createWebSocket))Gt=t.client.createWebSocket(Nt);else{const Oe=g||`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws?channel=${Nt}`;Gt=new WebSocket(Oe)}Gt.onmessage=Oe=>{Ot(Oe.data)&&(pt(Oe.data),Dn(mt,ut,0,rt).then(Ki=>{const Hn=Array.isArray(Ki)?Ki:ki[ut];a.onEvent&&zt(Oe.data,Hn);const Ls=de==null?void 0:de.id;if(Ls&&Array.isArray(Hn)&&Ac.current===kt){const er=Hn.find(kr=>(kr==null?void 0:kr.id)===Ls);er&&ae(kr=>({...kr,...er}))}}))},Gt.onclose=()=>setTimeout(jt,3e3),_t=Gt};jt(),st=()=>_t==null?void 0:_t.close();break}default:st=()=>{}}Ur.current.set(ut,st)}}if(J.type==="select"&&J.dataSource){const mt=`${ut}-sel`,At=M(J.dataSource);La.current[mt]!==At&&(La.current[mt]=At,(async()=>{try{const a=J.dataSource,d=M(a),g=await fetch(d,{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!g.ok)return;const _=await g.json(),C=J.dataField||"configs",R=J.optionLabel||"label",q=J.optionValue||"value",rt=_[C]||_.data||_,st=Array.isArray(rt)?rt.map(pt=>({label:pt[R]||pt.name||pt.label,value:pt[q]||pt.id||pt.name||pt.label})):[];Ii(pt=>({...pt,[ut]:st}))}catch{}})())}J.children&&k(J.children,ut);const gt=J.accordionItems||(J.type==="accordion"?J.items:null);Array.isArray(gt)&&gt.forEach((mt,At)=>{Array.isArray(mt==null?void 0:mt.content)&&k(mt.content,`${ut}-acc-${At}-content`)}),Array.isArray(J.tabItems)&&J.tabItems.forEach((mt,At)=>{const a=Array.isArray(mt==null?void 0:mt.content)?mt.content:Array.isArray(mt==null?void 0:mt.children)?mt.children:null;a&&k(a,`${ut}-tabcontent-${At}`)});const xt=J;if(xt.type==="widget"&&xt.widgetId){const mt=(Mt=e==null?void 0:e.widgets)==null?void 0:Mt.find(At=>At.id===xt.widgetId);mt&&Array.isArray(mt.components)&&k(mt.components,`${ut}-${xt.widgetId}`)}})},Z=`${kt}|${Ra}|${dt}`;Tc.current!==Z&&(Tc.current=Z,k(yn),hn.current=$);const B=Te||Sn,W=B?We==null?void 0:We[B.id]:void 0;$=new Set,W&&Array.isArray(W==null?void 0:W.components)&&k(W.components,"modal"),Ui.current=new Set([...hn.current,...$])},[kt,Dn,Ra,Te==null?void 0:Te.id,Sn==null?void 0:Sn.id,dt]),v.useEffect(()=>()=>{Ur.current.forEach(M=>M()),Ur.current.clear()},[kt]);const Oc=v.useMemo(()=>{if(!ge||Et!=="css-driven")return null;const M=new Map,$=(k,Z)=>{k.forEach((B,W)=>{const tt=`${Z}-${W}`;if(B.className){const Q=vy(B.className);if(yy(Q)){const J=X$(gn,tt,Q);J&&M.set(tt,J)}}B.children&&$(B.children,tt)})};return $(yn,""),M},[kt,yn,Et,gn]),$o=v.useRef(wc);$o.current=wc;const Zi=ce.realtime,ks=Zi==null?void 0:Zi.mode,Na=Zi==null?void 0:Zi.url;if(v.useEffect(()=>{if(!dt||ks!=="sse"||!Na)return;const M=r||localStorage.getItem("token");if(!M)return;let $=null,k=!1;return(async()=>{try{const Z=N||(t==null?void 0:t.endpoint)||window.location.origin,B=await fetch(`${Z}${Na}/token`,{headers:{Authorization:`Bearer ${M}`}});if(!B.ok)return;const{token:W}=await B.json();if(!W||k)return;$=new EventSource(`${Z}${Na}/subscribe?token=${encodeURIComponent(W)}`),$.onmessage=tt=>{try{const Q=JSON.parse(tt.data);Q!=null&&Q.message&&$o.current(Q,"success")}catch{}},$.onerror=()=>$==null?void 0:$.close()}catch{}})(),()=>{k=!0,$==null||$.close()}},[dt,N,r,ks,Na]),!ge)return v.createElement(v.Fragment,null,iht(ct,ee.length,_o,P));const Jt=ge,ui=Jt.backgroundColor,zh=ui&&Jg(ui)!==(ce.colorMode==="dark"?"dark":"light")?Jg(ui)==="dark"?Pu.text:Au.text:ce.colors.text,Io=Jt.height!==void 0?typeof Jt.height=="number"?`${Jt.height}px`:Jt.height:void 0,ja=Jt.minHeight!==void 0?typeof Jt.minHeight=="number"?`${Jt.minHeight}px`:Jt.minHeight:void 0,Yr=Jt.className?{...yT,fontFamily:ce.typography.fontFamily,display:"flex",flexDirection:"column",width:"100%",maxWidth:"100%",position:"relative",...Io?{height:Io}:{},...ja?{minHeight:ja}:{},backgroundColor:ui||ce.colors.background,color:zh,...vt(Jt.className)}:{...yT,fontFamily:ce.typography.fontFamily,display:"flex",flexDirection:"column",position:"relative",width:"100%",maxWidth:"100%",...Io?{height:Io}:{},...ja?{minHeight:ja}:{},backgroundColor:ui||ce.colors.background,color:zh},Fh=Array.isArray(Jt.components)?Jt.components:[],Ro=rht(gn),Wh=(ge==null?void 0:ge.requireAuth)===!0||(Jt==null?void 0:Jt.requiresAuth)===!0||(Ft==null?void 0:Ft.requiresAuth)===!0||((Lo=Ft==null?void 0:Ft.config)==null?void 0:Lo.requiresAuth)===!0,Da=(Wh||nt)&&!dt?ci():null,Mc=dt&&Wh&&X===!1&&!bt?v.createElement("div",{key:"email-banner",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"10px 40px",backgroundColor:ce.colorMode==="dark"?"#78350f":"#fef3c7",color:ce.colorMode==="dark"?"#fef3c7":"#92400e",fontSize:"13px",fontWeight:500,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}},Un.renderIcon("alert-triangle",14),v.createElement("span",null,"Verify your email — check your inbox for the confirmation link."),v.createElement("button",{"aria-label":"Dismiss",onClick:()=>me(!0),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",padding:"4px"}},Un.renderIcon("x",16))):null,yr=e,Ba=Array.isArray(yr==null?void 0:yr.widgets)?yr.widgets:[],$s=new Set,fi=M=>{if(Array.isArray(M))for(const $ of M)$&&$.type==="widget"&&$.widgetId&&$s.add($.widgetId),$&&Array.isArray($.children)&&fi($.children)};fi(Fh);for(const M of Ba)fi(M.components);const za=Ba.filter(M=>$s.has(M.id)?!1:M.sceneIds==="*"?!0:Array.isArray(M.sceneIds)?M.sceneIds.includes("*")||M.sceneIds.includes(kt):!1),kc=Tr.map(M=>{var Z,B,W;const $=Oi[M.id],k=M.sourceSceneId?(Z=$==null?void 0:$.steps)==null?void 0:Z.find(tt=>tt.id===M.sourceSceneId):(B=$==null?void 0:$.steps)==null?void 0:B.find(tt=>tt.type==="render_scene");return(W=k==null?void 0:k.config)!=null&&W.components?{...M,components:k.config.components}:null}).filter(Boolean);yn=[...Fh],(Yi=(Yh=yr.layout)==null?void 0:Yh.header)!=null&&Yi.length?yn.splice(0,0,...yr.layout.header):(Rc=(Ic=Jt==null?void 0:Jt.layout)==null?void 0:Ic.header)!=null&&Rc.length&&yn.splice(0,0,...Jt.layout.header);for(const M of za||[]){const $=M.components||[];if(!$.length)continue;if(M.targetKey){const Z=M.targetKey.split("-").filter(Boolean).map(Number);if(Z.length>0){let B=yn,W=Z[0];for(let Q=0;Q<Z.length-1;Q++){const J=B[Z[Q]];if(!J||!Array.isArray(J.children))break;B=J.children,W=Z[Q+1]}const tt=M.targetPosition||"before";if(tt==="inside"){const Q=B[W];Q&&(Array.isArray(Q.children)||(Q.children=[]),Q.children.unshift(...$))}else tt==="after"?B.splice(W+1,0,...$):B.splice(W,0,...$);continue}}const k=M.index??yn.length;yn.splice(k,0,...$)}for(const M of kc){if(M.targetKey){const $=M.targetKey.split("-").filter(Boolean).map(Number);let k=yn,Z=$[0];for(let W=0;W<$.length-1;W++){const tt=k[$[W]];if(!tt||!Array.isArray(tt.children))break;k=tt.children,Z=$[W+1]}const B=M.targetPosition||"before";if(B==="inside"){const W=k[Z];W&&(Array.isArray(W.children)||(W.children=[]),W.children.unshift(...M.components))}else B==="after"?k.splice(Z+1,0,...M.components):k.splice(Z,0,...M.components);continue}yn.splice(M.index??yn.length,0,...M.components)}(Mr=(Kh=yr.layout)==null?void 0:Kh.footer)!=null&&Mr.length?yn.push(...yr.layout.footer):(Nc=(Lc=Jt==null?void 0:Jt.layout)==null?void 0:Lc.footer)!=null&&Nc.length&&yn.push(...Jt.layout.footer);const Vh=Oc&&Oc.size>0?v.createElement("style",{key:"bf-responsive"},Array.from(Oc.values()).join(`
198
198
  `)):null,Em=v.createElement("style",{key:"bf-transitions"},`#${gn} * { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease; }
199
199
  @keyframes bf-fade-in { from { opacity: 0; } to { opacity: 1; } }
200
200
  @keyframes bf-fade-out { from { opacity: 1; } to { opacity: 0; } }