(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55838,(t,e,i)=>{"use strict";var s=t.r(71645),n="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},r=s.useState,o=s.useEffect,l=s.useLayoutEffect,a=s.useDebugValue;function h(t){var e=t.getSnapshot;t=t.value;try{var i=e();return!n(t,i)}catch(t){return!0}}var u="u"{"use strict";t.i(47167),e.exports=t.r(55838)},52822,(t,e,i)=>{"use strict";var s=t.r(71645),n=t.r(2239),r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=n.useSyncExternalStore,l=s.useRef,a=s.useEffect,h=s.useMemo,u=s.useDebugValue;i.useSyncExternalStoreWithSelector=function(t,e,i,s,n){var c=l(null);if(null===c.current){var d={hasValue:!1,value:null};c.current=d}else d=c.current;var f=o(t,(c=h(function(){function t(t){if(!a){if(a=!0,o=t,t=s(t),void 0!==n&&d.hasValue){var e=d.value;if(n(e,t))return l=e}return l=t}if(e=l,r(o,t))return e;var i=s(t);return void 0!==n&&n(e,i)?(o=t,e):(o=t,l=i)}var o,l,a=!1,h=void 0===i?null:i;return[function(){return t(e())},null===h?void 0:function(){return t(h())}]},[e,i,s,n]))[0],c[1]);return a(function(){d.hasValue=!0,d.value=f},[f]),u(f),f}},30224,(t,e,i)=>{"use strict";t.i(47167),e.exports=t.r(52822)},52683,t=>{"use strict";let e,i,s,n,r,o,l,a,h;var u,c,d,f,p,m,g,v,b,y,x,w,S,M,k,C,E,T,P,R,_,L,N,A,j,z,D,O,I=t.i(43476),V=t.i(71645);let F=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],B=new Set([...F,"pathRotation"]),W=(t,e,i)=>i>e?e:i"number"==typeof t,parse:parseFloat,transform:t=>t},K={...$,transform:t=>W(0,1,t)},U={...$,default:1},Q=t=>Math.round(1e5*t)/1e5,H=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,q=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>i=>!!("string"==typeof i&&q.test(i)&&i.startsWith(t)||e&&null!=i&&Object.prototype.hasOwnProperty.call(i,e)),G=(t,e,i)=>s=>{if("string"!=typeof s)return s;let[n,r,o,l]=s.match(H);return{[t]:parseFloat(n),[e]:parseFloat(r),[i]:parseFloat(o),alpha:void 0!==l?parseFloat(l):1}},Z={...$,transform:t=>Math.round(W(0,255,t))},X={test:Y("rgb","red"),parse:G("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:s=1})=>"rgba("+Z.transform(t)+", "+Z.transform(e)+", "+Z.transform(i)+", "+Q(K.transform(s))+")"},J={test:Y("#"),parse:function(t){let e="",i="",s="",n="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),n=t.substring(4,5),e+=e,i+=i,s+=s,n+=n),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:n?parseInt(n,16)/255:1}},transform:X.transform},tt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),te=tt("deg"),ti=tt("%"),ts=tt("px"),tn=tt("vh"),tr=tt("vw"),to={...ti,parse:t=>ti.parse(t)/100,transform:t=>ti.transform(100*t)},tl={test:Y("hsl","hue"),parse:G("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:s=1})=>"hsla("+Math.round(t)+", "+ti.transform(Q(e))+", "+ti.transform(Q(i))+", "+Q(K.transform(s))+")"},ta={test:t=>X.test(t)||J.test(t)||tl.test(t),parse:t=>X.test(t)?X.parse(t):tl.test(t)?tl.parse(t):J.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?X.transform(t):tl.transform(t),getAnimatableNone:t=>{let e=ta.parse(t);return e.alpha=0,ta.transform(e)}},th=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,tu="number",tc="color",td=/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 tf(t){let e=t.toString(),i=[],s={color:[],number:[],var:[]},n=[],r=0,o=e.replace(td,t=>(ta.test(t)?(s.color.push(r),n.push(tc),i.push(ta.parse(t))):t.startsWith("var(")?(s.var.push(r),n.push("var"),i.push(t)):(s.number.push(r),n.push(tu),i.push(parseFloat(t))),++r,"${}")).split("${}");return{values:i,split:o,indexes:s,types:n}}function tp({split:t,types:e}){let i=t.length;return s=>{let n="";for(let r=0;r0},parse:function(t){return tf(t).values},createTransformer:function(t){return tp(tf(t))},getAnimatableNone:function(t){let e=tf(t);return tp(e)(e.values.map((t,i)=>((t,e)=>"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof t?0:ta.test(t)?ta.getAnimatableNone(t):t)(t,e.split[i])))}},tg=new Set(["brightness","contrast","saturate","opacity"]);function tv(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[s]=i.match(H)||[];if(!s)return t;let n=i.replace(s,""),r=+!!tg.has(e);return s!==i&&(r*=100),e+"("+r+n+")"}let tb=/\b([a-z-]*)\(.*?\)/gu,ty={...tm,getAnimatableNone:t=>{let e=t.match(tb);return e?e.map(tv).join(" "):t}},tx={...tm,getAnimatableNone:t=>{let e=tm.parse(t);return tm.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},tw={...$,transform:Math.round},tS={borderWidth:ts,borderTopWidth:ts,borderRightWidth:ts,borderBottomWidth:ts,borderLeftWidth:ts,borderRadius:ts,borderTopLeftRadius:ts,borderTopRightRadius:ts,borderBottomRightRadius:ts,borderBottomLeftRadius:ts,width:ts,maxWidth:ts,height:ts,maxHeight:ts,top:ts,right:ts,bottom:ts,left:ts,inset:ts,insetBlock:ts,insetBlockStart:ts,insetBlockEnd:ts,insetInline:ts,insetInlineStart:ts,insetInlineEnd:ts,padding:ts,paddingTop:ts,paddingRight:ts,paddingBottom:ts,paddingLeft:ts,paddingBlock:ts,paddingBlockStart:ts,paddingBlockEnd:ts,paddingInline:ts,paddingInlineStart:ts,paddingInlineEnd:ts,margin:ts,marginTop:ts,marginRight:ts,marginBottom:ts,marginLeft:ts,marginBlock:ts,marginBlockStart:ts,marginBlockEnd:ts,marginInline:ts,marginInlineStart:ts,marginInlineEnd:ts,fontSize:ts,backgroundPositionX:ts,backgroundPositionY:ts,rotate:te,pathRotation:te,rotateX:te,rotateY:te,rotateZ:te,scale:U,scaleX:U,scaleY:U,scaleZ:U,skew:te,skewX:te,skewY:te,distance:ts,translateX:ts,translateY:ts,translateZ:ts,x:ts,y:ts,z:ts,perspective:ts,transformPerspective:ts,opacity:K,originX:to,originY:to,originZ:ts,zIndex:tw,fillOpacity:K,strokeOpacity:K,numOctaves:tw},tM={...tS,color:ta,backgroundColor:ta,outlineColor:ta,fill:ta,stroke:ta,borderColor:ta,borderTopColor:ta,borderRightColor:ta,borderBottomColor:ta,borderLeftColor:ta,filter:ty,WebkitFilter:ty,mask:tx,WebkitMask:tx},tk=t=>tM[t],tC=()=>({translate:0,scale:1,origin:0,originPoint:0}),tE=()=>({x:tC(),y:tC()}),tT=()=>({min:0,max:0}),tP=()=>({x:tT(),y:tT()}),tR=t=>!!(t&&t.getVelocity),t_=new Set(["width","height","top","left","right","bottom",...F]),tL=t=>e=>e.test(t),tN=[$,ts,ti,te,tr,tn,{test:t=>"auto"===t,parse:t=>t}],tA=t=>tN.find(tL(t));var tj=t.i(47167);let tz=()=>{},tD=()=>{};tj.default;let tO=t=>e=>"string"==typeof e&&e.startsWith(t),tI=tO("--"),tV=tO("var(--"),tF=t=>!!tV(t)&&tB.test(t.split("/*")[0].trim()),tB=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function tW(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}let t$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,tK=t=>180*t/Math.PI,tU=t=>tH(tK(Math.atan2(t[1],t[0]))),tQ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:tU,rotateZ:tU,skewX:t=>tK(Math.atan(t[1])),skewY:t=>tK(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tH=t=>((t%=360)<0&&(t+=360),t),tq=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),tY=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),tG={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tq,scaleY:tY,scale:t=>(tq(t)+tY(t))/2,rotateX:t=>tH(tK(Math.atan2(t[6],t[5]))),rotateY:t=>tH(tK(Math.atan2(-t[2],t[0]))),rotateZ:tU,rotate:tU,skewX:t=>tK(Math.atan(t[4])),skewY:t=>tK(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function tZ(t){return+!!t.includes("scale")}function tX(t,e){let i,s;if(!t||"none"===t)return tZ(e);let n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(n)i=tG,s=n;else{let e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=tQ,s=e}if(!s)return tZ(e);let r=i[e],o=s[1].split(",").map(tJ);return"function"==typeof r?r(o):o[r]}function tJ(t){return parseFloat(t.trim())}let t0=t=>t===$||t===ts,t1=new Set(["x","y","z"]),t2=F.filter(t=>!t1.has(t)),t5={width:({x:t},{paddingLeft:e="0",paddingRight:i="0",boxSizing:s})=>{let n=t.max-t.min;return"border-box"===s?n:n-parseFloat(e)-parseFloat(i)},height:({y:t},{paddingTop:e="0",paddingBottom:i="0",boxSizing:s})=>{let n=t.max-t.min;return"border-box"===s?n:n-parseFloat(e)-parseFloat(i)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>tX(e,"x"),y:(t,{transform:e})=>tX(e,"y")};t5.translateX=t5.x,t5.translateY=t5.y;let t3=t=>t,t4={},t6=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function t9(t,e){let i=!1,s=!0,n={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,o=t6.reduce((t,e)=>(t[e]=function(t){let e=new Set,i=new Set,s=!1,n=!1,r=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function l(e){r.has(e)&&(a.schedule(e),t()),e(o)}let a={schedule:(t,n=!1,o=!1)=>{let l=o&&s?e:i;return n&&r.add(t),l.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(o=t,s){n=!0;return}s=!0;let r=e;e=i,i=r,e.forEach(l),e.clear(),s=!1,n&&(n=!1,a.process(t))}};return a}(r),t),{}),{setup:l,read:a,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:f,postRender:p}=o,m=()=>{let r=t4.useManualTiming,o=r?n.timestamp:performance.now();i=!1,r||(n.delta=s?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,l.process(n),a.process(n),h.process(n),u.process(n),c.process(n),d.process(n),f.process(n),p.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(m))};return{schedule:t6.reduce((e,r)=>{let l=o[r];return e[r]=(e,r=!1,o=!1)=>(!i&&(i=!0,s=!0,n.isProcessing||t(m)),l.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;etypeof requestAnimationFrame?requestAnimationFrame:t3,!0),ei=new Set,es=!1,en=!1,er=!1;function eo(){if(en){let t=Array.from(ei).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{let e,s=(e=[],t2.forEach(i=>{let s=t.getValue(i);void 0!==s&&(e.push([i,s.get()]),s.set(+!!i.startsWith("scale")))}),e);s.length&&(i.set(t,s),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}en=!1,es=!1,ei.forEach(t=>t.complete(er)),ei.clear()}function el(){ei.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(en=!0)})}class ea{constructor(t,e,i,s,n,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=s,this.element=n,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ei.add(this),es||(es=!0,t7.read(el),t7.resolveKeyframes(eo))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:i,motionValue:s}=this;if(null===t[0]){let n=s?.get(),r=t[t.length-1];if(void 0!==n)t[0]=n;else if(i&&e){let s=i.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===n&&s.set(t[0])}for(let e=1;e{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}let ef=t=>1e3*t;function ep(t,e){-1===t.indexOf(e)&&t.push(e)}function em(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)}class eg{constructor(){this.subscriptions=[]}add(t){return ep(this.subscriptions,t),()=>em(this.subscriptions,t)}notify(t,e,i){let s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,i);else for(let n=0;n(void 0===e&&(e=t()),e)}let ey={};function ex(t,e){let i=eb(t);return()=>ey[e]??i()}let ew=ex(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),eS=t=>null!==t;function eM(t,{repeat:e,repeatType:i="loop"},s,n=1){let r=t.filter(eS),o=n<0||e&&"loop"!==i&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}class ek{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}let eC=t=>Array.isArray(t)&&"number"==typeof t[0],eE=ex(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),eT=(t,e,i=10)=>{let s="",n=Math.max(Math.round(e/i),2);for(let e=0;e`cubic-bezier(${t}, ${e}, ${i}, ${s})`,eR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:eP([0,.65,.55,1]),circOut:eP([.55,0,1,.45]),backIn:eP([.31,.01,.66,-.59]),backOut:eP([.33,1.53,.69,.99])};function e_(t){return"function"==typeof t&&"applyToOptions"in t}class eL extends ek{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:s,pseudoElement:n,allowFlatten:r=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=!!n,this.allowFlatten=r,this.options=t,tD(t.type);const a=function({type:t,...e}){return e_(t)&&eE()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,i,{delay:s=0,duration:n=300,repeat:r=0,repeatType:o="loop",ease:l="easeOut",times:a}={},h){let u={[e]:i};a&&(u.offset=a);let c=function t(e,i){if(e)return"function"==typeof e?eE()?eT(e,i):"ease-out":eC(e)?eP(e):Array.isArray(e)?e.map(e=>t(e,i)||eR.easeOut):eR[e]}(l,n);Array.isArray(c)&&(u.easing=c);let d={delay:s,duration:n,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};return h&&(d.pseudoElement=h),t.animate(u,d)}(e,i,s,a,n),!1===a.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let t=eM(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),ev(e,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(t){let e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ef(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:i,observe:s}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ew())?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),i&&(this.animation.rangeEnd=i),t3):s(this)}}let eN=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),{schedule:eA}=t9(queueMicrotask,!1);function ej(){e=void 0}let ez={now:()=>(void 0===e&&ez.set(et.isProcessing||t4.useManualTiming?et.timestamp:performance.now()),e),set:t=>{e=t,queueMicrotask(ej)}},eD=(t,e)=>e?1e3/e*t:0,eO;class eI{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{let e=ez.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=ez.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new eg);let i=this.events[t].add(e);return"change"===t?()=>{i(),t7.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return eO&&eO.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=ez.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return eD(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function eV(t,e){return new eI(t,e)}let eF=[...tN,ta,tm],eB=new WeakMap;function eW(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function e$(t){return"string"==typeof t||Array.isArray(t)}let eK=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],eU=["initial",...eK];function eQ(t){return eW(t.animate)||eU.some(e=>e$(t[e]))}function eH(t){return!!(eQ(t)||t.variants)}let eq={current:null},eY={current:!1},eG="u">typeof window;function eZ(t){let e=[{},{}];return t?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function eX(t,e,i,s){if("function"==typeof e){let[n,r]=eZ(s);e=e(void 0!==i?i:t.custom,n,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[n,r]=eZ(s);e=e(void 0!==i?i:t.custom,n,r)}return e}let eJ=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],e0={};class e1{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:s,skipAnimations:n,blockInitialAnimation:r,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ea,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let t=ez.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(eY.current||function(){if(eY.current=!0,eG)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>eq.current=t.matches;t.addEventListener("change",e),e()}else eq.current=!1}(),this.shouldReduceMotion=eq.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let t in this.projection&&this.projection.unmount(),t8(this.notifyUpdate),t8(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){let i;if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&eN.has(t)&&this.current instanceof HTMLElement){let{factory:i,keyframes:s,times:n,ease:r,duration:o}=e.accelerate,l=new eL({element:this.current,name:t,keyframes:s,times:n,ease:r,duration:ef(o)}),a=i(l);this.valueSubscriptions.set(t,()=>{a(),l.cancel()});return}let s=B.has(t);s&&this.onBindTransform&&this.onBindTransform();let n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&t7.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in e0){let e=e0[t];if(!e)continue;let{isEnabled:i,Feature:s}=e;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):tP()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){let i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=eV(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];if(null!=i){let s,n;if("string"==typeof i&&(s=i,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(s)||(n=i,/^0[^.\s]+$/u.test(n))))i=parseFloat(i);else{let s;s=i,!eF.find(tL(s))&&tm.test(e)&&(i=eu(t,e))}this.setBaseTarget(t,tR(i)?i.get():i)}return tR(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){let e,{initial:i}=this.props;if("string"==typeof i||"object"==typeof i){let s=eX(this.props,i,this.presenceContext?.custom);s&&(e=s[t])}if(i&&void 0!==e)return e;let s=this.getBaseTargetFromProps(this.props,t);return void 0===s||tR(s)?void 0!==this.initialValues[t]&&void 0===e?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new eg),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){eA.render(this.render)}}class e2 extends e1{constructor(){super(...arguments),this.KeyframeResolver=ed}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){let i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;tR(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function e5(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}let e3=(t,e)=>e&&"number"==typeof t?e.transform(t):t,e4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},e6=F.length;function e9(t,e,i){let{style:s,vars:n,transformOrigin:r}=t,o=!1,l=!1;for(let t in e){let i=e[t];if(B.has(t)){o=!0;continue}if(tI(t)){n[t]=i;continue}{let e=e3(i,tS[t]);t.startsWith("origin")?(l=!0,r[t]=e):s[t]=e}}if(!e.transform&&(o||i?s.transform=function(t,e,i){let s="",n=!0;for(let r=0;r"string"==typeof t&&"svg"===t.toLowerCase();function ir(t,{style:e,vars:i},s,n){let r,o=t.style;for(r in e)o[r]=e[r];for(r in n?.applyProjectionStyles(o,s),i)o.setProperty(r,i[r])}let io=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function il(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let ia={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t)if(!ts.test(t))return t;else t=parseFloat(t);let i=il(t,e.target.x),s=il(t,e.target.y);return`${i}% ${s}%`}},ih=(t,e,i)=>t+(e-t)*i,iu={borderRadius:{...ia,applyTo:[...io]},borderTopLeftRadius:ia,borderTopRightRadius:ia,borderBottomLeftRadius:ia,borderBottomRightRadius:ia,boxShadow:{correct:(t,{treeScale:e,projectionDelta:i})=>{let s=tm.parse(t);if(s.length>5)return t;let n=tm.createTransformer(t),r=+("number"!=typeof s[0]),o=i.x.scale*e.x,l=i.y.scale*e.y;s[0+r]/=o,s[1+r]/=l;let a=ih(o,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=a),"number"==typeof s[3+r]&&(s[3+r]/=a),n(s)}}};function ic(t,{layout:e,layoutId:i}){return B.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!iu[t]||"opacity"===t)}function id(t,e,i){let s=t.style,n=e?.style,r={};if(!s)return r;for(let e in s)(tR(s[e])||n&&tR(n[e])||ic(e,t)||i?.getValue(e)?.liveStyle!==void 0)&&(r[e]=s[e]);return r}function ip(t,e,i){let s=id(t,e,i);for(let i in t)(tR(t[i])||tR(e[i]))&&(s[-1!==F.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return s}class im extends e2{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=tP}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(B.has(e)){let t=tk(e);return t&&t.default||0}return e=ii.has(e)?e:e5(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return ip(t,e,i)}build(t,e,i){ie(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,s){for(let i in ir(t,e,void 0,s),e.attrs)t.setAttribute(ii.has(i)?i:e5(i),e.attrs[i])}mount(t){this.isSVGTag=is(t.tagName),super.mount(t)}}function ig({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function iv(t){return void 0===t||1===t}function ib({scale:t,scaleX:e,scaleY:i}){return!iv(t)||!iv(e)||!iv(i)}function iy(t){return ib(t)||ix(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ix(t){var e,i;return(e=t.x)&&"0%"!==e||(i=t.y)&&"0%"!==i}function iw(t,e,i,s,n){return void 0!==n&&(t=s+n*(t-s)),s+i*(t-s)+e}function iS(t,e=0,i=1,s,n){t.min=iw(t.min,e,i,s,n),t.max=iw(t.max,e,i,s,n)}function iM(t,{x:e,y:i}){iS(t.x,e.translate,e.scale,e.originPoint),iS(t.y,i.translate,i.scale,i.originPoint)}function ik(t,e){t.min+=e,t.max+=e}function iC(t,e,i,s,n=.5){let r=ih(t.min,t.max,n);iS(t,e,i,r,s)}function iE(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function iT(t,e,i){let s=i??t;iC(t.x,iE(e.x,s.x),e.scaleX,e.scale,e.originX),iC(t.y,iE(e.y,s.y),e.scaleY,e.scale,e.originY)}function iP(t,e){return ig(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}class iR extends e2{constructor(){super(...arguments),this.type="html",this.renderInstance=ir}mount(t){tD(t.style),super.mount(t)}readValueFromInstance(t,e){if(B.has(e))return this.projection?.isProjecting?tZ(e):((t,e)=>{let{transform:i="none"}=getComputedStyle(t);return tX(i,e)})(t,e);{let i=window.getComputedStyle(t),s=(tI(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:e}){return iP(t,e)}build(t,e,i){e9(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return id(t,e,i)}}let i_=["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 iL(t){if("string"!=typeof t||t.includes("-"));else if(i_.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}let iN=(0,V.createContext)({}),iA=(0,V.createContext)({strict:!1}),ij=(0,V.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),iz=(0,V.createContext)({});function iD(t){return Array.isArray(t)?t.join(" "):t}let iO=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function iI(t,e,i){for(let s in e)tR(e[s])||ic(s,i)||(t[s]=e[s])}let iV=()=>({...iO(),attrs:{}}),iF=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","propagate","ignoreStrict","viewport"]);function iB(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||iF.has(t)}let iW=t=>!iB(t);try{u=(()=>{let t=Error("Cannot find module '@emotion/is-prop-valid'");throw t.code="MODULE_NOT_FOUND",t})().default,"function"==typeof u&&(iW=t=>t.startsWith("on")?!iB(t):u(t))}catch{}function i$(t){return tR(t)?t.get():t}let iK=(0,V.createContext)(null);function iU(t){let e=(0,V.useRef)(null);return null===e.current&&(e.current=t()),e.current}let iQ=t=>(e,i)=>{let s=(0,V.useContext)(iz),n=(0,V.useContext)(iK),r=()=>(function({scrapeMotionValuesFromProps:t,createRenderState:e},i,s,n){return{latestValues:function(t,e,i,s){let n={},r=s(t,{});for(let t in r)n[t]=i$(r[t]);let{initial:o,animate:l}=t,a=eQ(t),h=eH(t);e&&h&&!a&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===l&&(l=e.animate));let u=!!i&&!1===i.initial,c=(u=u||!1===o)?l:o;if(c&&"boolean"!=typeof c&&!eW(c)){let e=Array.isArray(c)?c:[c];for(let i=0;iiY[e].some(e=>!!t[e])};e0=t,iG=!0}(),e0}let iX=Symbol.for("motionComponentSymbol"),iJ="data-"+e5("framerAppearId"),i0=(0,V.createContext)({});function i1(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}let i2="u">typeof window?V.useLayoutEffect:V.useEffect;function i5(t,{forwardMotionProps:e=!1,type:i}={},s,n){s&&function(t){let e=iZ();for(let i in t)e[i]={...e[i],...t[i]};e0=e}(s);let r=i?"svg"===i:iL(t),o=r?iq:iH;function l(i,s){var l;let a,h,u,c={...(0,V.useContext)(ij),...i,layoutId:function({layoutId:t}){let e=(0,V.useContext)(iN).id;return e&&void 0!==t?e+"-"+t:t}(i)},{isStatic:d}=c,f=function(t){let{initial:e,animate:i}=function(t,e){if(eQ(t)){let{initial:e,animate:i}=t;return{initial:!1===e||e$(e)?e:void 0,animate:e$(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,V.useContext)(iz));return(0,V.useMemo)(()=>({initial:e,animate:i}),[iD(e),iD(i)])}(i),p=o(i,d);if(!d&&"u">typeof window){(0,V.useContext)(iA).strict;let e=function(t){let{drag:e,layout:i}=iZ();if(!e&&!i)return{};let s={...e,...i};return{MeasureLayout:e?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);a=e.MeasureLayout,f.visualElement=function(t,e,i,s,n,r){let{visualElement:o}=(0,V.useContext)(iz),l=(0,V.useContext)(iA),a=(0,V.useContext)(iK),h=(0,V.useContext)(ij),u=h.reducedMotion,c=h.skipAnimations,d=(0,V.useRef)(null),f=(0,V.useRef)(!1);s=s||l.renderer,!d.current&&s&&(d.current=s(t,{visualState:e,parent:o,props:i,presenceContext:a,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:u,skipAnimations:c,isSVG:r}),f.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));let p=d.current,m=(0,V.useContext)(i0);p&&!p.projection&&n&&("html"===p.type||"svg"===p.type)&&function(t,e,i,s){let{layoutId:n,layout:r,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:h,layoutAnchor:u,layoutCrossfade:c}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:n,layout:r,alwaysMeasureLayout:!!o||l&&i1(l),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:a,layoutRoot:h,layoutAnchor:u})}(d.current,i,n,m);let g=(0,V.useRef)(!1);(0,V.useInsertionEffect)(()=>{p&&g.current&&p.update(i,a)});let v=i[iJ],b=(0,V.useRef)(!!v&&"u">typeof window&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return i2(()=>{f.current=!0,p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),b.current&&p.animationState&&p.animationState.animateChanges())}),(0,V.useEffect)(()=>{p&&(!b.current&&p.animationState&&p.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),b.current=!1),p.enteringChildren=void 0)}),p}(t,p,c,n,e.ProjectionNode,r)}return(0,I.jsxs)(iz.Provider,{value:f,children:[a&&f.visualElement?(0,I.jsx)(a,{visualElement:f.visualElement,...c}):null,function(t,e,i,{latestValues:s},n,r=!1,o){let l=(o??iL(t)?function(t,e,i,s){let n=(0,V.useMemo)(()=>{let i=iV();return ie(i,e,is(s),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){let e={};iI(e,t.style,t),n.style={...e,...n.style}}return n}:function(t,e){let i,s,n={},r=(i=t.style||{},iI(s={},i,t),Object.assign(s,function({transformTemplate:t},e){return(0,V.useMemo)(()=>{let i=iO();return e9(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),s);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n})(e,s,n,t),a=function(t,e,i){let s={};for(let n in t)("values"!==n||"object"!=typeof t.values)&&!tR(t[n])&&(iW(n)||!0===i&&iB(n)||!e&&!iB(n)||t.draggable&&n.startsWith("onDrag"))&&(s[n]=t[n]);return s}(e,"string"==typeof t,r),h=t!==V.Fragment?{...a,...l,ref:i}:{},{children:u}=e,c=(0,V.useMemo)(()=>tR(u)?u.get():u,[u]);return(0,V.createElement)(t,{...h,children:c})}(t,i,(l=f.visualElement,h=(0,V.useRef)(s),(0,V.useInsertionEffect)(()=>{h.current=s}),u=(0,V.useRef)(null),(0,V.useCallback)(t=>{t&&p.onMount?.(t),l&&(t?l.mount(t):l.unmount());let e=h.current;if("function"==typeof e)if(t){let i=e(t);"function"==typeof i&&(u.current=i)}else u.current?(u.current(),u.current=null):e(t);else e&&(e.current=t)},[l])),p,d,e,r)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;let a=(0,V.forwardRef)(l);return a[iX]=t,a}class i3{constructor(t){this.isMounted=!1,this.node=t}update(){}}function i4(t,e,i){let s=t.getProps();return eX(s,e,void 0!==i?i:s.custom,t)}function i6(t,e){if(t?.inherit&&e){let{inherit:i,...s}=t;return{...e,...s}}return t}function i9(t,e){let i=t?.[e]??t?.default??t;return i!==t?i6(i,t):i}let i7=t=>Array.isArray(t);function i8(t,e){let i=t.getValue("willChange");if(tR(i)&&i.add)return i.add(e);if(!i&&t4.WillChange){let i=new t4.WillChange("auto");t.addValue("willChange",i),i.add(e)}}let st=(...t)=>t.reduce((t,e)=>i=>e(t(i)));function se(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function si(t,e){return i=>i>0?e:t}let ss=(t,e,i)=>{let s=t*t,n=i*(e*e-s)+s;return n<0?0:Math.sqrt(n)},sn=[J,X,tl];function sr(t){let e=sn.find(e=>e.test(t));if(tz(`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let i=e.parse(t);return e===tl&&(i=function({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,i/=100;let n=0,r=0,o=0;if(e/=100){let s=i<.5?i*(1+e):i+e-i*e,l=2*i-s;n=se(l,s,t+1/3),r=se(l,s,t),o=se(l,s,t-1/3)}else n=r=o=i;return{red:Math.round(255*n),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(i)),i}let so=(t,e)=>{let i=sr(t),s=sr(e);if(!i||!s)return si(t,e);let n={...i};return t=>(n.red=ss(i.red,s.red,t),n.green=ss(i.green,s.green,t),n.blue=ss(i.blue,s.blue,t),n.alpha=ih(i.alpha,s.alpha,t),X.transform(n))},sl=new Set(["none","hidden"]);function sa(t,e){return i=>ih(t,e,i)}function sh(t){return"number"==typeof t?sa:"string"==typeof t?tF(t)?si:ta.test(t)?so:sd:Array.isArray(t)?su:"object"==typeof t?ta.test(t)?so:sc:si}function su(t,e){let i=[...t],s=i.length,n=t.map((t,i)=>sh(t)(t,e[i]));return t=>{for(let e=0;e{for(let e in s)i[e]=s[e](t);return i}}let sd=(t,e)=>{let i=tm.createTransformer(e),s=tf(t),n=tf(e);if(!(s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length))return tz(`Complex values '${t}' and '${e}' 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.`),si(t,e);if(sl.has(t)&&!n.values.length||sl.has(e)&&!s.values.length)return sl.has(t)?i=>i<=0?t:e:i=>i>=1?e:t;return st(su(function(t,e){let i=[],s={color:0,var:0,number:0};for(let n=0;n{let e=({timestamp:e})=>t(e);return{start:(t=!0)=>t7.update(e,t),stop:()=>t8(e),now:()=>et.isProcessing?et.timestamp:ez.now()}};function sm(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}let sg=.01,sv=2,sb=.005,sy=.5;function sx(t,e){return t*Math.sqrt(1-e*e)}let sw=["duration","bounce"],sS=["stiffness","damping","mass"];function sM(t,e){return e.some(e=>void 0!==t[e])}function sk(t=.3,e=.3){let i,s,n,r,o,l,a="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:h,restDelta:u}=a,c=a.keyframes[0],d=a.keyframes[a.keyframes.length-1],f={done:!1,value:c},{stiffness:p,damping:m,mass:g,duration:v,velocity:b,isResolvedFromDuration:y}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!sM(t,sS)&&sM(t,sw))if(e.velocity=0,t.visualDuration){let i=2*Math.PI/(1.2*t.visualDuration),s=i*i,n=2*W(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:1,stiffness:s,damping:n}}else{let i=function({duration:t=800,bounce:e=.3,velocity:i=0,mass:s=1}){let n,r;tz(ef(10));let o=1-e;o=W(.05,1,o),t=W(.01,10,t/1e3),o<1?(n=e=>{let s=e*o,n=s*t;return .001-(s-i)/sx(e,o)*Math.exp(-n)},r=e=>{let s=e*o*t,r=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),a=sx(Math.pow(e,2),o);return(s*i+i-r)*l*(-n(e)+.001>0?-1:1)/a}):(n=e=>-.001+Math.exp(-e*t)*((e-i)*t+1),r=e=>t*t*(i-e)*Math.exp(-e*t));let l=function(t,e,i){let s=i;for(let i=1;i<12;i++)s-=t(s)/e(s);return s}(n,r,5/t);if(t=ef(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{let e=Math.pow(l,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}({...t,velocity:0});(e={...e,...i,mass:1}).isResolvedFromDuration=!0}return e}({...a,velocity:-((a.velocity||0)/1e3)}),x=b||0,w=m/(2*Math.sqrt(p*g)),S=d-c,M=Math.sqrt(p/g)/1e3,k=5>Math.abs(S);if(h||(h=k?sg:sv),u||(u=k?sb:sy),w<1)n=sx(M,w),r=(x+w*M*S)/n,i=t=>d-Math.exp(-w*M*t)*(r*Math.sin(n*t)+S*Math.cos(n*t)),o=w*M*r+S*n,l=w*M*S-r*n,s=t=>Math.exp(-w*M*t)*(o*Math.sin(n*t)+l*Math.cos(n*t));else if(1===w){i=t=>d-Math.exp(-M*t)*(S+(x+M*S)*t);let t=x+M*S;s=e=>Math.exp(-M*e)*(M*t*e-x)}else{let t=M*Math.sqrt(w*w-1);i=e=>{let i=Math.exp(-w*M*e),s=Math.min(t*e,300);return d-i*((x+w*M*S)*Math.sinh(s)+t*S*Math.cosh(s))/t};let e=(x+w*M*S)/t,n=w*M*e-S*t,r=w*M*S-e*t;s=e=>{let i=Math.exp(-w*M*e),s=Math.min(t*e,300);return i*(n*Math.sinh(s)+r*Math.cosh(s))}}let C={calculatedDuration:y&&v||null,velocity:t=>ef(s(t)),next:t=>{if(!y&&w<1){let e=Math.exp(-w*M*t),i=Math.sin(n*t),s=Math.cos(n*t),a=d-e*(r*i+S*s);return f.done=Math.abs(ef(e*(o*i+l*s)))<=h&&Math.abs(d-a)<=u,f.value=f.done?d:a,f}let e=i(t);return y?f.done=t>=v:f.done=Math.abs(ef(s(t)))<=h&&Math.abs(d-e)<=u,f.value=f.done?d:e,f},toString:()=>{let t=Math.min(sm(C),2e4),e=eT(e=>C.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return C}function sC(t,e,i){let s=Math.max(e-5,0);return eD(i-t(s),e-s)}function sE({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:n=10,bounceStiffness:r=500,modifyTarget:o,min:l,max:a,restDelta:h=.5,restSpeed:u}){let c,d,f=t[0],p={done:!1,value:f},m=i*e,g=f+m,v=void 0===o?g:o(g);v!==g&&(m=v-f);let b=t=>-m*Math.exp(-t/s),y=t=>v+b(t),x=t=>{let e=b(t),i=y(t);p.done=Math.abs(e)<=h,p.value=p.done?v:i},w=t=>{let e;if(e=p.value,void 0!==l&&ea){var i;c=t,d=sk({keyframes:[p.value,(i=p.value,void 0===l?a:void 0===a||Math.abs(l-i){let e=!1;return(d||void 0!==c||(e=!0,x(t),w(t)),void 0!==c&&t>=c)?d.next(t-c):(e||x(t),p)}}}sk.applyToOptions=t=>{let e=function(t,e=100,i){let s=i({...t,keyframes:[0,e]}),n=Math.min(sm(s),2e4);return{type:"keyframes",ease:t=>s.next(n*t).value/e,duration:n/1e3}}(t,100,sk);return t.ease=e.ease,t.duration=ef(e.duration),t.type="keyframes",t};let sT=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function sP(t,e,i,s){return t===e&&i===s?t3:n=>0===n||1===n?n:sT(function(t,e,i,s,n){let r,o,l=0;do(r=sT(o=e+(i-e)/2,s,n)-t)>0?i=o:e=o;while(Math.abs(r)>1e-7&&++l<12)return o}(n,0,1,t,i),e,s)}let sR=sP(.42,0,1,1),s_=sP(0,0,.58,1),sL=sP(.42,0,.58,1),sN=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,sA=t=>e=>1-t(1-e),sj=sP(.33,1.53,.69,.99),sz=sA(sj),sD=sN(sz),sO=t=>t>=1?1:(t*=2)<1?.5*sz(t):.5*(2-Math.pow(2,-10*(t-1))),sI=t=>1-Math.sin(Math.acos(t)),sV=sA(sI),sF=sN(sI),sB={linear:t3,easeIn:sR,easeInOut:sL,easeOut:s_,circIn:sI,circInOut:sF,circOut:sV,backIn:sz,backInOut:sD,backOut:sj,anticipate:sO},sW=t=>{if(eC(t)){tD(t.length);let[e,i,s,n]=t;return sP(e,i,s,n)}return"string"==typeof t?(tD(sB[t],`Invalid easing type '${t}'`),sB[t]):t},s$=(t,e,i)=>{let s=e-t;return s?(i-t)/s:1};function sK({duration:t=300,keyframes:e,times:i,ease:s="easeInOut"}){var n;let r,o=Array.isArray(s)&&"number"!=typeof s[0]?s.map(sW):sW(s),l={done:!1,value:e[0]},a=function(t,e,{clamp:i=!0,ease:s,mixer:n}={}){let r=t.length;if(tD(e.length),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];let o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());let l=function(t,e,i){let s=[],n=i||t4.mix||sf,r=t.length-1;for(let i=0;i{if(o&&i1)for(;sh(W(t[0],t[r-1],e)):h}((n=i&&i.length===e.length?i:(!function(t,e){let i=t[t.length-1];for(let s=1;s<=e;s++){let n=s$(0,e,s);t.push(ih(i,1,n))}}(r=[0],e.length-1),r),n.map(e=>e*t)),e,{ease:Array.isArray(o)?o:e.map(()=>o||sL).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(l.value=a(e),l.done=e>=t,l)}}let sU={decay:sE,inertia:sE,tween:sK,keyframes:sK,spring:sk};function sQ(t){"string"==typeof t.type&&(t.type=sU[t.type])}let sH=t=>t/100;class sq extends ek{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==ez.now()&&this.tick(ez.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){let{options:t}=this;sQ(t);let{type:e=sK,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:r=0}=t,{keyframes:o}=t,l=e||sK;l!==sK&&"number"!=typeof o[0]&&(this.mixKeyframes=st(sH,sf(o[0],o[1])),o=[0,100]);let a=l({...t,keyframes:o});"mirror"===n&&(this.mirroredGenerator=l({...t,keyframes:[...o].reverse(),velocity:-r})),null===a.calculatedDuration&&(a.calculatedDuration=sm(a));let{calculatedDuration:h}=a;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=a}updateTime(t){let e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){let i,{generator:s,totalDuration:n,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:a}=this;if(null===this.startTime)return s.next(0);let{delay:h=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);let v=this.currentTime-h*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>n;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let y=this.currentTime,x=s;if(c){let t=Math.min(this.currentTime,n)/l,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,(e=Math.min(e,c+1))%2&&("reverse"===d?(i=1-i,f&&(i-=f/l)):"mirror"===d&&(x=o)),y=W(0,1,i)*l}b?(this.delayState.value=u[0],i=this.delayState):i=x.next(y),r&&!b&&(i.value=r(i.value));let{done:w}=i;b||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&p!==sE&&(i.value=eM(u,this.options,g,this.speed)),m&&m(i.value),S&&this.finish(),i}then(t,e){return this.finished.then(t,e)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return this.currentTime/1e3}set time(t){t=ef(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let e=this.generator.next(t).value;return sC(t=>this.generator.next(t).value,t,e)}get speed(){return this.playbackSpeed}set speed(t){let e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(ez.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:t=sp,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();let i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ez.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}let sY={anticipate:sO,backInOut:sD,circInOut:sF};class sG extends eL{constructor(t){!function(t){"string"==typeof t.ease&&t.ease in sY&&(t.ease=sY[t.ease])}(t),sQ(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:e,onUpdate:i,onComplete:s,element:n,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);let o=new sq({...r,autoplay:!1}),l=Math.max(10,ez.now()-this.startTime),a=W(0,10,l-10),h=o.sample(l).value,{name:u}=this.options;n&&u&&ev(n,u,h),e.setWithVelocity(o.sample(Math.max(0,l-a)).value,h,a),o.stop()}}let sZ=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(tm.test(t)||"0"===t)&&!t.startsWith("url("));function sX(t){t.duration=0,t.type="keyframes"}let sJ=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,s0=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),s1=eb(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class s2 extends ek{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:r="loop",keyframes:o,name:l,motionValue:a,element:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ez.now();const c={autoplay:t,delay:e,type:i,repeat:s,repeatDelay:n,repeatType:r,name:l,motionValue:a,element:h,...u},d=h?.KeyframeResolver||ea;this.keyframeResolver=new d(o,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),l,a,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,s){let n;this.keyframeResolver=void 0;let{name:r,type:o,velocity:l,delay:a,isHandoff:h,onUpdate:u}=i;this.resolvedAt=ez.now();let c=!0;!function(t,e,i,s){let n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;let r=t[t.length-1],o=sZ(n,e),l=sZ(r,e);return tz(`You are trying to animate ${e} from "${n}" to "${r}". "${o?r:n}" is not an animatable value.`),!!o&&!!l&&(function(t){let e=t[0];if(1===t.length)return!0;for(let i=0;i40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},f=c&&!h&&function(t){let{motionValue:e,name:i,repeatDelay:s,repeatType:n,damping:r,type:o,keyframes:l}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement)&&!(a instanceof SVGElement))return!1;let{onUpdate:h,transformTemplate:u}=e.owner.getProps();return s1()&&i&&(eN.has(i)||s0.has(i)&&function(t){for(let e=0;e{this.notifyFinished()}).catch(t3),this.pendingTimeline&&(this.stopTimeline=n.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=n}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),er=!0,el(),eo(),er=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let s5={type:"spring",stiffness:500,damping:25,restSpeed:10},s3={type:"keyframes",duration:.8},s4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},s6=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),s9=(t,e,i,s={},n,r)=>o=>{let l=i9(s,t)||{},a=l.delay||s.delay||0,{elapsed:h=0}=s;h-=ef(a);let u={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:n};!function(t){for(let e in t)if(!s6.has(e))return!0;return!1}(l)&&Object.assign(u,((t,{keyframes:e})=>e.length>2?s3:B.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:s5:s4)(t,u)),u.duration&&(u.duration=ef(u.duration)),u.repeatDelay&&(u.repeatDelay=ef(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if(!1!==u.type&&(0!==u.duration||u.repeatDelay)||(sX(u),0===u.delay&&(c=!0)),(t4.instantAnimations||t4.skipAnimations||n?.shouldSkipAnimations||l.skipAnimations)&&(c=!0,sX(u),u.delay=0),u.allowFlatten=!l.type&&!l.ease,c&&!r&&void 0!==e.get()){let t=eM(u.keyframes,l);if(void 0!==t)return void t7.update(()=>{u.onUpdate(t),u.onComplete()})}return l.isSync?new sq(u):new s2(u)};function s7(t,e,{delay:i=0,transitionOverride:s,type:n}={}){let{transition:r,transitionEnd:o,...l}=e,a=t.getDefaultTransition();r=r?i6(r,a):a;let h=r?.reduceMotion,u=r?.skipAnimations;s&&(r=s);let c=[],d=n&&t.animationState&&t.animationState.getState()[n],f=r?.path;for(let e in f&&f.animateVisualElement(t,l,r,i,c),l){let s=t.getValue(e,t.latestValues[e]??null),n=l[e];if(void 0===n||d&&function({protectedKeys:t,needsAnimating:e},i){let s=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,s}(d,e))continue;let o={delay:i,...i9(r||{},e)};u&&(o.skipAnimations=!0);let a=s.get();if(void 0!==a&&!s.isAnimating()&&!Array.isArray(n)&&n===a&&!o.velocity){t7.update(()=>s.set(n));continue}let f=!1;if(window.MotionHandoffAnimation){let i=t.props[iJ];if(i){let t=window.MotionHandoffAnimation(i,e,t7);null!==t&&(o.startTime=t,f=!0)}}i8(t,e);let p=h??t.shouldReduceMotion;s.start(s9(e,s,n,p&&t_.has(e)?{type:!1}:o,t,f));let m=s.animation;m&&c.push(m)}if(o){let e=()=>t7.update(()=>{o&&function(t,e){let{transitionEnd:i={},transition:s={},...n}=i4(t,e)||{};for(let e in n={...n,...i}){var r;let i=i7(r=n[e])?r[r.length-1]||0:r;t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,eV(i))}}(t,o)});c.length?Promise.all(c).then(e):e()}return c}function s8(t,e,i,s=0,n=1){let r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,l=(o-1)*s;return"function"==typeof i?i(r,o):1===n?r*s:l-r*s}function nt(t,e,i={}){let s=i4(t,e,"exit"===i.type?t.presenceContext?.custom:void 0),{transition:n=t.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(n=i.transitionOverride);let r=s?()=>Promise.all(s7(t,s,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{let{delayChildren:r=0,staggerChildren:o,staggerDirection:l}=n;return function(t,e,i=0,s=0,n=0,r=1,o){let l=[];for(let a of t.variantChildren)a.notify("AnimationStart",e),l.push(nt(a,e,{...o,delay:i+("function"==typeof s?0:s)+s8(t.variantChildren,a,s,n,r)}).then(()=>a.notify("AnimationComplete",e)));return Promise.all(l)}(t,e,s,r,o,l,i)}:()=>Promise.resolve(),{when:l}=n;if(!l)return Promise.all([r(),o(i.delay)]);{let[t,e]="beforeChildren"===l?[r,o]:[o,r];return t().then(()=>e())}}let ne=eU.length;function ni(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let s=0;st.removeEventListener(e,i,s)}let nu={x:!1,y:!1};function nc(t){return t.max-t.min}function nd(t,e,i,s=.5){t.origin=s,t.originPoint=ih(e.min,e.max,t.origin),t.scale=nc(i)/nc(e),t.translate=ih(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function nf(t,e,i,s){nd(t.x,e.x,i.x,s?s.originX:void 0),nd(t.y,e.y,i.y,s?s.originY:void 0)}function np(t,e,i,s=0){t.min=(s?ih(i.min,i.max,s):i.min)+e.min,t.max=t.min+nc(e)}function nm(t,e,i,s=0){let n=s?ih(i.min,i.max,s):i.min;t.min=e.min-n,t.max=t.min+nc(e)}function ng(t,e,i,s){nm(t.x,e.x,i.x,s?.x),nm(t.y,e.y,i.y,s?.y)}let nv=t=>"object"==typeof t&&null!==t;function nb(t){return nv(t)&&"ownerSVGElement"in t}function ny(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);let n=i?.[t]??s.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(t=>null!=t)}let nx=new WeakMap,nw=(t,e,i)=>(s,n)=>n&&n[0]?n[0][t+"Size"]:nb(s)&&"getBBox"in s?s.getBBox()[e]:s[i],nS=nw("inline","width","offsetWidth"),nM=nw("block","height","offsetHeight");function nk({target:t,borderBoxSize:e}){nx.get(t)?.forEach(i=>{i(t,{get width(){return nS(t,e)},get height(){return nM(t,e)}})})}function nC(t){t.forEach(nk)}let nE=new Set;function nT(t,e){let n;return"function"==typeof t?(nE.add(t),s||(s=()=>{let t={get width(){return window.innerWidth},get height(){return window.innerHeight}};nE.forEach(e=>e(t))},window.addEventListener("resize",s)),()=>{nE.delete(t),nE.size||"function"!=typeof s||(window.removeEventListener("resize",s),s=void 0)}):(!i&&"u">typeof ResizeObserver&&(i=new ResizeObserver(nC)),(n=ny(t)).forEach(t=>{let s=nx.get(t);s||(s=new Set,nx.set(t,s)),s.add(e),i?.observe(t)}),()=>{n.forEach(t=>{let s=nx.get(t);s?.delete(e),s?.size||i?.unobserve(t)})})}let nP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),nR=new Set(["INPUT","SELECT","TEXTAREA"]),n_=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function nL(t){return{point:{x:t.pageX,y:t.pageY}}}function nN(t,e,i,s){return nh(t,e,t=>n_(t)&&i(t,nL(t)),s)}let nA=({current:t})=>t?t.ownerDocument.defaultView:null,nj=(t,e)=>Math.abs(t-e),nz=new Set(["auto","scroll"]);class nD{constructor(t,e,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:n=!1,distanceThreshold:r=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=nO(this.lastRawMoveEventInfo,this.transformPagePoint));let i=nV(this.lastMoveEventInfo,this.history),s=null!==this.startEvent,n=(t=i.offset,e={x:0,y:0},Math.sqrt(nj(t.x,e.x)**2+nj(t.y,e.y)**2)>=this.distanceThreshold);if(!s&&!n)return;let{point:r}=i,{timestamp:o}=et;this.history.push({...r,timestamp:o});let{onStart:l,onMove:a}=this.handlers;s||(l&&l(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,i)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=nO(e,this.transformPagePoint),t7.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:s,resumeAnimation:n}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&n&&n(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=nV("pointercancel"===t.type?this.lastMoveEventInfo:nO(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,r),s&&s(t,r)},!n_(t))return;this.dragSnapToOrigin=n,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=s||window;const l=nO(nL(t),this.transformPagePoint),{point:a}=l,{timestamp:h}=et;this.history=[{...a,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,nV(l,this.history));const c={passive:!0,capture:!0};this.removeListeners=st(nN(this.contextWindow,"pointermove",this.handlePointerMove,c),nN(this.contextWindow,"pointerup",this.handlePointerUp,c),nN(this.contextWindow,"pointercancel",this.handlePointerUp,c)),o&&this.startScrollTracking(o)}startScrollTracking(t){let e=t.parentElement;for(;e;){let t=getComputedStyle(e);(nz.has(t.overflowX)||nz.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){let e=this.scrollPositions.get(t);if(!e)return;let i=t===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},n={x:s.x-e.x,y:s.y-e.y};(0!==n.x||0!==n.y)&&(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=n.x,this.lastMoveEventInfo.point.y+=n.y):this.history.length>0&&(this.history[0].x-=n.x,this.history[0].y-=n.y),this.scrollPositions.set(t,s),t7.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),t8(this.updatePoint)}}function nO(t,e){return e?{point:e(t.point)}:t}function nI(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nV({point:t},e){return{point:t,delta:nI(t,nF(e)),offset:nI(t,e[0]),velocity:function(t){if(t.length<2)return{x:0,y:0};let e=t.length-1,i=null,s=nF(t);for(;e>=0&&(i=t[e],!(s.timestamp-i.timestamp>ef(.1)));)e--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*ef(.1)&&(i=t[1]);let n=(s.timestamp-i.timestamp)/1e3;if(0===n)return{x:0,y:0};let r={x:(s.x-i.x)/n,y:(s.y-i.y)/n};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}(e)}}function nF(t){return t[t.length-1]}function nB(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function nW(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(nL(t).point),this.stopAnimation()},r=(t,e)=>{let{drag:i,dragPropagation:s,onDragStart:n}=this.getProps();if(i&&!s&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(t){if("x"===t||"y"===t)if(nu[t])return null;else return nu[t]=!0,()=>{nu[t]=!1};return nu.x||nu.y?null:(nu.x=nu.y=!0,()=>{nu.x=nu.y=!1})}(i),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),na(t=>{let e=this.getAxisMotionValue(t).get()||0;if(ti.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let s=i.layout.layoutBox[t];s&&(e=nc(s)*(parseFloat(e)/100))}}this.originPoint[t]=e}),n&&t7.update(()=>n(t,e),!1,!0),i8(this.visualElement,"transform");let{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},o=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;let{dragPropagation:i,dragDirectionLock:s,onDirectionLock:n,onDrag:r}=this.getProps();if(!i&&!this.openDragLock)return;let{offset:o}=e;if(s&&null===this.currentDirection){this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(o),null!==this.currentDirection&&n&&n(this.currentDirection);return}this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&t7.update(()=>r(t,e),!1,!0)},l=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},a=()=>{let{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new nD(t,{onSessionStart:n,onStart:r,onMove:o,onSessionEnd:l,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:nA(this.visualElement),element:this.visualElement.current})}stop(t,e){let i=t||this.latestPointerEvent,s=e||this.latestPanInfo,n=this.isDragging;if(this.cancel(),!n||!s||!i)return;let{velocity:r}=s;this.startAnimation(r);let{onDragEnd:o}=this.getProps();o&&t7.postRender(()=>o(i,s))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){let{drag:s}=this.getProps();if(!i||!nq(t,s,this.currentDirection))return;let n=this.getAxisMotionValue(t),r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&ti&&(t=s?ih(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),n.set(r)}resolveConstraints(){let{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&i1(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=function(t,{top:e,left:i,bottom:s,right:n}){return{x:nB(t.x,i,n),y:nB(t.y,e,s)}}(i.layoutBox,t):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:n$(t,"left","right"),y:n$(t,"top","bottom")}}(e),s!==this.constraints&&!i1(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&na(t=>{var e,s;let n;!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=(e=i.layoutBox[t],s=this.constraints[t],n={},void 0!==s.min&&(n.min=s.min-e.min),void 0!==s.max&&(n.max=s.max-e.min),n))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!i1(e))return!1;let s=e.current;tD();let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;n.root&&(n.root.scroll=void 0,n.root.updateScroll());let r=function(t,e,i){let s=iP(t,i),{scroll:n}=e;return n&&(ik(s.x,n.offset.x),ik(s.y,n.offset.y)),s}(s,n.root,this.visualElement.getTransformPagePoint()),o=(t=n.layout.layoutBox,{x:nW(t.x,r.x),y:nW(t.y,r.y)});if(i){let t=i(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=ig(t))}return o}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:s,dragTransition:n,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{};return Promise.all(na(o=>{if(!nq(o,e,this.currentDirection))return;let a=l&&l[o]||{};(!0===r||r===o)&&(a={min:0,max:0});let h={type:"inertia",velocity:i?t[o]:0,bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...n,...a};return this.startAxisValueAnimation(o,h)})).then(o)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return i8(this.visualElement,t),i.start(s9(t,i,0,e,this.visualElement,!1))}stopAnimation(){na(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`;return this.visualElement.getProps()[e]||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){na(e=>{let{drag:i}=this.getProps();if(!nq(e,i,this.currentDirection))return;let{projection:s}=this.visualElement,n=this.getAxisMotionValue(e);if(s&&s.layout){let{min:i,max:r}=s.layout.layoutBox[e],o=n.get()||0;n.set(t[e]-ih(i,r,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!i1(e)||!i||!this.constraints)return;this.stopAnimation();let s={x:0,y:0};na(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){var i,n;let r,o,l,a=e.get();s[t]=(i={min:a,max:a},n=this.constraints[t],r=.5,o=nc(i),(l=nc(n))>o?r=s$(n.min,n.max-o,i.min):o>l&&(r=s$(i.min,i.max-l,n.min)),W(0,1,r))}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),na(e=>{if(!nq(e,t,null))return;let i=this.getAxisMotionValue(e),{min:n,max:r}=this.constraints[e];i.set(ih(n,r,s[e]))}),this.visualElement.render()}addListeners(){let t;if(!this.visualElement.current)return;nU.set(this.visualElement,this);let e=this.visualElement.current,i=nN(e,"pointerdown",t=>{let{drag:i,dragListener:s=!0}=this.getProps(),n=t.target,r=n!==e&&(nR.has(n.tagName)||!0===n.isContentEditable);i&&s&&!r&&this.start(t)}),s=()=>{var i,s,n;let r,o,{dragConstraints:l}=this.getProps();i1(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),t||(i=e,s=l.current,r=nT(i,nH(n=()=>this.scalePositionWithinConstraints())),o=nT(s,nH(n)),t=()=>{r(),o()}))},{projection:n}=this.visualElement,r=n.addEventListener("measure",s);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),t7.read(s);let o=nh(window,"resize",()=>this.scalePositionWithinConstraints()),l=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(na(e=>{let i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),i(),r(),l&&l(),t&&t()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:n=!1,dragElastic:r=.35,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:n,dragElastic:r,dragMomentum:o}}}function nH(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function nq(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}let nY=t=>(e,i)=>{t&&t7.update(()=>t(e,i),!1,!0)},nG={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var nZ=V;function nX(t=!0){let e=(0,V.useContext)(iK);if(null===e)return[!0,null];let{isPresent:i,onExitComplete:s,register:n}=e,r=(0,V.useId)();(0,V.useEffect)(()=>{if(t)return n(r)},[t]);let o=(0,V.useCallback)(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,o]:[!0]}let nJ=!1;class n0 extends nZ.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:n}=t;n&&(e.group&&e.group.add(n),i&&i.register&&s&&i.register(n),nJ&&n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),nG.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:s,isPresent:n}=this.props,{projection:r}=i;return r&&(r.isPresent=n,t.layoutDependency!==e&&r.setOptions({...r.options,layoutDependency:e}),nJ=!0,s||t.layoutDependency!==e||void 0===e||t.isPresent!==n?r.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?r.promote():r.relegate()||t7.postRender(()=>{let t=r.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:t,layoutAnchor:e}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=e,i.root.didUpdate(),eA.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:s}=t;nJ=!0,s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function n1(t){let[e,i]=nX(),s=(0,nZ.useContext)(iN);return(0,I.jsx)(n0,{...t,layoutGroup:s,switchLayoutGroup:(0,nZ.useContext)(i0),isPresent:e,safeToRemove:i})}let n2=io.length,n5=t=>"string"==typeof t?parseFloat(t):t,n3=t=>"number"==typeof t||ts.test(t);function n4(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let n6=n7(0,.5,sV),n9=n7(.5,.95,t3);function n7(t,e,i){return s=>se?1:i(s$(t,e,s))}function n8(t,e){t.min=e.min,t.max=e.max}function rt(t,e){n8(t.x,e.x),n8(t.y,e.y)}function re(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function ri(t,e,i,s,n){return t-=e,t=s+1/i*(t-s),void 0!==n&&(t=s+1/n*(t-s)),t}function rs(t,e,[i,s,n],r,o){!function(t,e=0,i=1,s=.5,n,r=t,o=t){if(ti.test(e)&&(e=parseFloat(e),e=ih(o.min,o.max,e/100)-o.min),"number"!=typeof e)return;let l=ih(r.min,r.max,s);t===r&&(l-=e),t.min=ri(t.min,e,i,l,n),t.max=ri(t.max,e,i,l,n)}(t,e[i],e[s],e[n],e.scale,r,o)}let rn=["x","scaleX","originX"],rr=["y","scaleY","originY"];function ro(t,e,i,s){rs(t.x,e,rn,i?i.x:void 0,s?s.x:void 0),rs(t.y,e,rr,i?i.y:void 0,s?s.y:void 0)}function rl(t){return 0===t.translate&&1===t.scale}function ra(t){return rl(t.x)&&rl(t.y)}function rh(t,e){return t.min===e.min&&t.max===e.max}function ru(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function rc(t,e){return ru(t.x,e.x)&&ru(t.y,e.y)}function rd(t){return nc(t.x)/nc(t.y)}function rf(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class rp{constructor(){this.members=[]}add(t){ep(this.members,t);for(let e=this.members.length-1;e>=0;e--){let i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;let s=i.instance;s&&!1!==s.isConnected||i.snapshot||(em(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(em(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){let t=this.members[e];if(!1!==t.isPresent&&t.instance?.isConnected!==!1)return this.promote(t),!0}return!1}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();let{layoutDependency:s}=i.options,{layoutDependency:n}=t.options;(void 0===s||s!==n)&&(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}let rm=(t,e)=>t.depth-e.depth;class rg{constructor(){this.children=[],this.isDirty=!1}add(t){ep(this.children,t),this.isDirty=!0}remove(t){em(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(rm),this.isDirty=!1,this.children.forEach(t)}}let rv=["","X","Y","Z"],rb=0;function ry(t,e,i,s){let{latestValues:n}=e;n[t]&&(i[t]=n[t],e.setStaticValue(t,0),s&&(s[t]=0))}function rx({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:n}){return class{constructor(t={},i=e?.()){this.id=rb++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(rM),this.nodes.forEach(rN),this.nodes.forEach(rA),this.nodes.forEach(rk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;t7.read(()=>{s=window.innerWidth}),t(e,()=>{let t=window.innerWidth;if(t!==s){let e,r;s=t,this.root.updateBlockedByResize=!0,i&&i(),e=ez.now(),r=({timestamp:t})=>{let i=t-e;i>=250&&(t8(r),n())},t7.setup(r,!0),i=()=>t8(r),nG.hasAnimatedSinceResize&&(nG.hasAnimatedSinceResize=!1,this.nodes.forEach(rL))}})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&n&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let r=this.options.transition||n.getDefaultTransition()||rV,{onLayoutAnimationStart:o,onLayoutAnimationComplete:l}=n.getProps(),a=!this.targetLayout||!rc(this.targetLayout,s),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(a||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let e={...i9(r,"layout"),onPlay:o,onComplete:l};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||rL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),t8(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(rj),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:i}=e.options;if(!i)return;let s=i.props[iJ];if(window.MotionHasOptimisedAnimation(s,"transform")){let{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",t7,!(t||i))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&t(n)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||nc(this.snapshot.measuredBox.x)||nc(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,e),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=tP());let{target:l}=t;if(!l){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(re(this.prevProjectionDelta.x,this.projectionDelta.x),re(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nf(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===o&&rf(this.projectionDelta.x,this.prevProjectionDelta.x)&&rf(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=tE(),this.projectionDelta=tE(),this.projectionDeltaWithTransform=tE()}setAnimationOrigin(t,e=!1,i){let s,n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},l=tE();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=tP(),h=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=!!(h&&!c&&!0===this.options.crossfade&&!this.path.some(rI));this.animationProgress=0;let f=i?.interpolateProjection(t);this.mixTargetDelta=e=>{let i=e/1e3,n=f?.(i);if(n?(l.x.translate=n.x,l.x.scale=ih(t.x.scale,1,i),l.x.origin=t.x.origin,l.x.originPoint=t.x.originPoint,l.y.translate=n.y,l.y.scale=ih(t.y.scale,1,i),l.y.origin=t.y.origin,l.y.originPoint=t.y.originPoint):(rD(l.x,t.x,i),rD(l.y,t.y,i)),this.setTargetDelta(l),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,p,m,g,v,b;ng(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),m=this.relativeTarget,g=this.relativeTargetOrigin,v=a,b=i,rO(m.x,g.x,v.x,b),rO(m.y,g.y,v.y,b),s&&(u=this.relativeTarget,p=s,rh(u.x,p.x)&&rh(u.y,p.y))&&(this.isProjectionDirty=!1),s||(s=tP()),rt(s,this.relativeTarget)}h&&(this.animationValues=o,function(t,e,i,s,n,r){n?(t.opacity=ih(0,i.opacity??1,n6(s)),t.opacityExit=ih(e.opacity??1,0,n9(s))):r&&(t.opacity=ih(e.opacity??1,i.opacity??1,s));for(let n=0;n{var e,i,s;let n;nG.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=eV(0)),this.motionValue.jump(0,!1),this.currentAnimation=(e=this.motionValue,i=[0,1e3],s={...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}},(n=tR(e)?e:eV(e)).start(s9("",n,i,s)),n.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:s,latestValues:n}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&r$(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||tP();let e=nc(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let s=nc(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}rt(e,i),iT(e,n),nf(this.projectionDeltaWithTransform,this.layoutCorrected,e,n)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new rp),this.sharedNodes.get(t).add(e);let i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){let{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){let s=this.getStack();s&&s.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;let s={};i.z&&ry("z",t,s,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(rE),this.root.sharedNodes.clear()}}}function rw(t){t.updateLayout()}function rS(t){let e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){let{layoutBox:i,measuredBox:s}=t.layout,{animationType:n}=t.options,r=e.source!==t.layout.source;if("size"===n)na(t=>{let s=r?e.measuredBox[t]:e.layoutBox[t],n=nc(s);s.min=i[t].min,s.max=s.min+n});else if("x"===n||"y"===n){let t="x"===n?"y":"x";n8(r?e.measuredBox[t]:e.layoutBox[t],i[t])}else r$(n,e.layoutBox,i)&&na(s=>{let n=r?e.measuredBox[s]:e.layoutBox[s],o=nc(i[s]);n.max=n.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+o)});let o=tE();nf(o,i,e.layoutBox);let l=tE();r?nf(l,t.applyTransform(s,!0),e.measuredBox):nf(l,i,e.layoutBox);let a=!ra(o),h=!1;if(!t.resumeFrom){let s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){let{snapshot:n,layout:r}=s;if(n&&r){let o=t.options.layoutAnchor||void 0,l=tP();ng(l,e.layoutBox,n.layoutBox,o);let a=tP();ng(a,i,r.layoutBox,o),rc(l,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=l,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:l,layoutDelta:o,hasLayoutChanged:a,hasRelativeLayoutChanged:h})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function rM(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function rk(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function rC(t){t.clearSnapshot()}function rE(t){t.clearMeasurements()}function rT(t){t.isLayoutDirty=!0,t.updateLayout()}function rP(t){t.isLayoutDirty=!1}function rR(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function r_(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function rL(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function rN(t){t.resolveTargetDelta()}function rA(t){t.calcProjection()}function rj(t){t.resetSkewAndRotation()}function rz(t){t.removeLeadSnapshot()}function rD(t,e,i){t.translate=ih(e.translate,0,i),t.scale=ih(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function rO(t,e,i,s){t.min=ih(e.min,i.min,s),t.max=ih(e.max,i.max,s)}function rI(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let rV={duration:.45,ease:[.4,0,.1,1]},rF=t=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),rB=rF("applewebkit/")&&!rF("chrome/")?Math.round:t3;function rW(t){t.min=rB(t.min),t.max=rB(t.max)}function r$(t,e,i){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(rd(e)-rd(i)))}function rK(t){return t!==t.root&&t.scroll?.wasRoot}let rU=rx({attachResizeListener:(t,e)=>nh(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rQ={current:void 0},rH=rx({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rQ.current){let t=new rU({});t.mount(window),t.setOptions({layoutScroll:!0}),rQ.current=t}return rQ.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position});function rq(t,e){let i=ny(t),s=new AbortController;return[i,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function rY(t,e,i){let{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===i);let n=s["onHover"+i];n&&t7.postRender(()=>n(e,nL(e)))}function rG(t){return nv(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}let rZ=(t,e)=>!!e&&(t===e||rZ(t,e.parentElement)),rX=new WeakSet;function rJ(t){return e=>{"Enter"===e.key&&t(e)}}function r0(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function r1(t){return n_(t)&&!(nu.x||nu.y)}let r2=new WeakSet;function r5(t,e,i){let{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===i);let n=s["onTap"+("End"===i?"":i)];n&&t7.postRender(()=>n(e,nL(e)))}let r3=new WeakMap,r4=new WeakMap,r6=t=>{let e=r3.get(t.target);e&&e(t)},r9=t=>{t.forEach(r6)},r7={some:0,all:1},r8=function(t,e){if("u"i5(i,s,t,e);return new Proxy((t,e)=>s(t,e),{get:(n,r)=>"create"===r?s:(i.has(r)||i.set(r,i5(r,void 0,t,e)),i.get(r))})}({animation:{Feature:class extends i3{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e))s=Promise.all(e.map(e=>nt(t,e,i)));else if("string"==typeof e)s=nt(t,e,i);else{let n="function"==typeof e?i4(t,e,i.custom):e;s=Promise.all(s7(t,n,i))}return s.then(()=>{t.notify("AnimationComplete",e)})})(t,e,i))),i=no(),s=!0,n=!1,r=e=>(i,s)=>{let n=i4(t,s,"exit"===e?t.presenceContext?.custom:void 0);if(n){let{transition:t,transitionEnd:e,...s}=n;i={...i,...s,...e}}return i};function o(o){let{props:l}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){let i=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(i.initial=e.props.initial),i}let i={};for(let t=0;td&&b,M=!1,k=Array.isArray(v)?v:[v],C=k.reduce(r(m),{});!1===y&&(C={});let{prevResolvedValues:E={}}=g,T={...E,...C},P=e=>{S=!0,u.has(e)&&(M=!0,u.delete(e)),g.needsAnimating[e]=!0;let i=t.getValue(e);i&&(i.liveStyle=!1)};for(let t in T){let e=C[t],i=E[t];if(!c.hasOwnProperty(t))(i7(e)&&i7(i)?!ni(e,i)||w:e!==i)?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):g.protectedKeys[t]=!0}g.prevProp=v,g.prevResolvedValues=C,g.isActive&&(c={...c,...C}),(s||n)&&t.blockInitialAnimation&&(S=!1);let R=x&&w,_=!R||M;S&&_&&h.push(...k.map(e=>{let i={type:m};if("string"==typeof e&&(s||n)&&!R&&t.manuallyAnimateOnMount&&t.parent){let{parent:s}=t,n=i4(s,e);if(s.enteringChildren&&n){let{delayChildren:e}=n.transition||{};i.delay=s8(s.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){let e={};if("boolean"!=typeof l.initial){let i=i4(t,Array.isArray(l.initial)?l.initial[0]:l.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{let s=t.getBaseTarget(i),n=t.getValue(i);n&&(n.liveStyle=!0),e[i]=s??null}),h.push({animation:e})}let m=!!h.length;return s&&(!1===l.initial||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,n=!1,m?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,s){if(i[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,s)),i[e].isActive=s;let n=o(e);for(let t in i)i[t].protectedKeys={};return n},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=no(),n=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();eW(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends i3{constructor(){super(...arguments),this.id=nl++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&!1===i){if(this.isExitComplete){let{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){let i=i4(this.node,t,e);if(i){let{transition:t,transitionEnd:e,...s}=i;for(let t in s)this.node.getValue(t)?.jump(s[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){let{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}},inView:{Feature:class extends i3{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var t;let e;this.stopObserver?.();let{viewport:i={}}=this.node.getProps(),{root:s,margin:n,amount:r="some",once:o}=i,l={root:s?s.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:r7[r]},a=t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,o&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:s}=this.node.getProps(),n=e?i:s;n&&n(t)};this.stopObserver=(t=this.node.current,e=function({root:t,...e}){let i=t||document;r4.has(i)||r4.set(i,{});let s=r4.get(i),n=JSON.stringify(e);return s[n]||(s[n]=new IntersectionObserver(r9,{root:t,...e})),s[n]}(l),r3.set(t,a),e.observe(t),()=>{r3.delete(t),e.unobserve(t)})}mount(){this.startObserver()}update(){if("u"t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends i3{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=function(t,e,i={}){let[s,n,r]=rq(t,i),o=t=>{let s=t.currentTarget;if(!r1(t)||r2.has(t))return;rX.add(s),i.stopPropagation&&r2.add(t);let r=e(s,t),o={...n,capture:!0},l=(t,e)=>{window.removeEventListener("pointerup",a,o),window.removeEventListener("pointercancel",h,o),rX.has(s)&&rX.delete(s),r1(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{l(t,s===window||s===document||i.useGlobalTarget||rZ(s,t.target))},h=t=>{l(t,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",h,o)};return s.forEach(t=>{((i.useGlobalTarget?window:t).addEventListener("pointerdown",o,n),rG(t))&&(t.addEventListener("focus",t=>((t,e)=>{let i=t.currentTarget;if(!i)return;let s=rJ(()=>{if(rX.has(i))return;r0(i,"down");let t=rJ(()=>{r0(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>r0(i,"cancel"),e)});i.addEventListener("keydown",s,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),e)})(t,n)),nP.has(t.tagName)||!0===t.isContentEditable||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}(t,(t,e)=>(r5(this.node,e,"Start"),(t,{success:e})=>r5(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:i?.tap===!1})}unmount(){}}},focus:{Feature:class extends i3{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){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=st(nh(this.node.current,"focus",()=>this.onFocus()),nh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends i3{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){let[s,n,r]=rq(t,i);return s.forEach(t=>{let i,s=!1,r=!1,o=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",a)},l=t=>{s=!1,window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l),r&&(r=!1,o(t))},a=t=>{if("touch"!==t.pointerType){if(s){r=!0;return}o(t)}};t.addEventListener("pointerenter",s=>{if("touch"===s.pointerType||nu.x||nu.y)return;r=!1;let o=e(t,s);"function"==typeof o&&(i=o,t.addEventListener("pointerleave",a,n))},n),t.addEventListener("pointerdown",()=>{s=!0,window.addEventListener("pointerup",l,n),window.addEventListener("pointercancel",l,n)},n)}),r}(t,(t,e)=>(rY(this.node,e,"Start"),t=>rY(this.node,t,"End"))))}unmount(){}}},pan:{Feature:class extends i3{constructor(){super(...arguments),this.removePointerDownListener=t3}onPointerDown(t){this.session=new nD(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nA(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:nY(t),onStart:nY(e),onMove:nY(i),onEnd:(t,e)=>{delete this.session,s&&t7.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=nN(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends i3{constructor(t){super(t),this.removeGroupControls=t3,this.removeListeners=t3,this.controls=new nQ(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t3}update(){let{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:rH,MeasureLayout:n1},layout:{ProjectionNode:rH,MeasureLayout:n1}},(t,e)=>e.isSVG??iL(t)?new im(e):new iR(e,{allowProjection:t!==V.Fragment}));var ot=V;function oe(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}class oi extends ot.Component{getSnapshotBeforeUpdate(t){let e=this.props.childRef.current;if(rG(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let t=e.offsetParent,i=rG(t)&&t.offsetWidth||0,s=rG(t)&&t.offsetHeight||0,n=getComputedStyle(e),r=this.props.sizeRef.current;r.height=parseFloat(n.height),r.width=parseFloat(n.width),r.top=e.offsetTop,r.left=e.offsetLeft,r.right=i-r.width-r.left,r.bottom=s-r.height-r.top,r.direction=n.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function os({children:t,isPresent:e,anchorX:i,anchorY:s,root:n,pop:r}){let o=(0,ot.useId)(),l=(0,ot.useRef)(null),a=(0,ot.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=(0,ot.useContext)(ij),u=function(...t){return V.useCallback(function(...t){return e=>{let i=!1,s=t.map(t=>{let s=oe(t,e);return i||"function"!=typeof s||(i=!0),s});if(i)return()=>{for(let e=0;e{let{width:t,height:u,top:c,left:d,right:f,bottom:p,direction:m}=a.current;if(e||!1===r||!l.current||!t||!u)return;let g="rtl"===m,v="left"===i?g?`right: ${f}`:`left: ${d}`:g?`left: ${d}`:`right: ${f}`,b="bottom"===s?`bottom: ${p}`:`top: ${c}`;l.current.dataset.motionPopId=o;let y=document.createElement("style");h&&(y.nonce=h);let x=n??document.head;return x.appendChild(y),y.sheet&&y.sheet.insertRule(` [data-motion-pop-id="${o}"] { position: absolute !important; width: ${t}px !important; height: ${u}px !important; ${v}px !important; ${b}px !important; } `),()=>{l.current?.removeAttribute("data-motion-pop-id"),x.contains(y)&&x.removeChild(y)}},[e]),(0,I.jsx)(oi,{isPresent:e,childRef:l,sizeRef:a,pop:r,children:!1===r?t:ot.cloneElement(t,{ref:u})})}let on=({children:t,initial:e,isPresent:i,onExitComplete:s,custom:n,presenceAffectsLayout:r,mode:o,anchorX:l,anchorY:a,root:h})=>{let u=iU(or),c=(0,V.useId)(),d=(0,V.useRef)(i),f=(0,V.useRef)(s);i2(()=>{d.current=i,f.current=s});let p=!0,m=(0,V.useMemo)(()=>(p=!1,{id:c,initial:e,isPresent:i,custom:n,onExitComplete:t=>{for(let e of(u.set(t,!0),u.values()))if(!e)return;s&&s()},register:t=>(u.set(t,!1),()=>{u.delete(t),d.current||u.size||f.current?.()})}),[i,u,s]);return r&&p&&(m={...m}),(0,V.useMemo)(()=>{u.forEach((t,e)=>u.set(e,!1))},[i]),V.useEffect(()=>{i||u.size||!s||s()},[i]),t=(0,I.jsx)(os,{pop:"popLayout"===o,isPresent:i,anchorX:l,anchorY:a,root:h,children:t}),(0,I.jsx)(iK.Provider,{value:m,children:t})};function or(){return new Map}let oo=t=>t.key||"";function ol(t){let e=[];return V.Children.forEach(t,t=>{(0,V.isValidElement)(t)&&e.push(t)}),e}let oa=({children:t,custom:e,initial:i=!0,onExitComplete:s,presenceAffectsLayout:n=!0,mode:r="sync",propagate:o=!1,anchorX:l="left",anchorY:a="top",root:h})=>{let[u,c]=nX(o),d=(0,V.useMemo)(()=>ol(t),[t]),f=o&&!u?[]:d.map(oo),p=(0,V.useRef)(!0),m=(0,V.useRef)(d),g=iU(()=>new Map),v=(0,V.useRef)(new Set),[b,y]=(0,V.useState)(d),[x,w]=(0,V.useState)(d);i2(()=>{p.current=!1,m.current=d;for(let t=0;t{let b=oo(t),y=(!o||!!u)&&(d===x||f.includes(b));return(0,I.jsx)(on,{isPresent:y,initial:(!p.current||!!i)&&void 0,custom:e,presenceAffectsLayout:n,mode:r,root:h,onExitComplete:y?void 0:()=>{if(v.current.has(b)||!g.has(b))return;v.current.add(b),g.set(b,!0);let t=!0;g.forEach(e=>{e||(t=!1)}),t&&(M?.(),w(m.current),o&&c?.(),s&&s())},anchorX:l,anchorY:a,children:t},b)})})};function oh({controlled:t,default:e,name:i,state:s="value"}){let{current:n}=V.useRef(void 0!==t),[r,o]=V.useState(e),l=V.useCallback(t=>{n||o(t)},[]);return[n?t:r,l]}t.s([],59657),t.i(59657);let ou="u">typeof document?V.useLayoutEffect:()=>{},oc={...V},od={};function of(t,e){let i=V.useRef(od);return i.current===od&&(i.current=t(e)),i}let op=oc.useInsertionEffect,om=op&&op!==oc.useLayoutEffect?op:t=>t();function og(t){let e=of(ov).current;return e.next=t,om(e.effect),e.trampoline}function ov(){let t={next:void 0,callback:ob,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function ob(){}let oy=function(t,...e){let i=new URL("https://base-ui.com/production-error");return i.searchParams.set("code",t.toString()),e.forEach(t=>i.searchParams.append("args[]",t)),`Base UI error #${t}; visit ${i} for the full message.`};function ox(t,e,i,s){var n,r,o,l,a;let h=of(ow).current;return n=h,r=t,o=e,l=i,a=s,(n.refs[0]!==r||n.refs[1]!==o||n.refs[2]!==l||n.refs[3]!==a)&&oS(h,[t,e,i,s]),h.callback}function ow(){return{callback:null,cleanup:null,refs:[]}}function oS(t,e){if(t.refs=e,e.every(t=>null==t)){t.callback=null;return}t.callback=i=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),null!=i){let s=Array(e.length).fill(null);for(let t=0;t{for(let t=0;t=19?e?.ref:t.ref)??null}function oC(t,e){return t&&!e?t:!t&&e?e:t||e?{...t,...e}:void 0}function oE(){}let oT=Object.freeze([]),oP=Object.freeze({});function oR(t,e){return"function"==typeof t?t(e):t}let o_={};function oL(t,e,i,s,n){if(!i&&!s&&!n&&!t)return oN(e);let r=oN(t);return e&&(r=oA(r,e)),i&&(r=oA(r,i)),s&&(r=oA(r,s)),n&&(r=oA(r,n)),r}function oN(t){return oz(t)?{...oD(t,o_)}:function(t){let e={...t};for(let t in e){let i=e[t];oj(t,i)&&(e[t]=oO(i))}return e}(t)}function oA(t,e){return oz(e)?oD(e,t):function(t,e){if(!e)return t;for(let i in e){let s=e[i];switch(i){case"style":t[i]=oC(t.style,s);break;case"className":t[i]=oV(t.className,s);break;default:oj(i,s)?t[i]=function(t,e){return e?t?(...i)=>{let s=i[0];if(oF(s)){oI(s);let n=e(...i);return s.baseUIHandlerPrevented||t?.(...i),n}let n=e(...i);return t?.(...i),n}:oO(e):t}(t[i],s):t[i]=s}}return t}(t,e)}function oj(t,e){let i=t.charCodeAt(0),s=t.charCodeAt(1),n=t.charCodeAt(2);return 111===i&&110===s&&n>=65&&n<=90&&("function"==typeof e||void 0===e)}function oz(t){return"function"==typeof t}function oD(t,e){return oz(t)?t(e):t??o_}function oO(t){return t?(...e)=>{let i=e[0];return oF(i)&&oI(i),t(...e)}:t}function oI(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function oV(t,e){return e?t?e+" "+t:e:t}function oF(t){return null!=t&&"object"==typeof t&&"nativeEvent"in t}function oB(t,e,i={}){let s=e.render,n=function(t,e={}){var i,s,n;let{className:r,style:o,render:l}=t,{state:a=oP,ref:h,props:u,stateAttributesMapping:c,enabled:d=!0}=e,f=d?"function"==typeof r?r(a):r:void 0,p=d?oR(o,a):void 0,m=d?function(t,e){let i={};for(let s in t){let n=t[s];if(e?.hasOwnProperty(s)){let t=e[s](n);null!=t&&Object.assign(i,t);continue}!0===n?i[`data-${s.toLowerCase()}`]="":n&&(i[`data-${s.toLowerCase()}`]=n.toString())}return i}(a,c):oP,g=d&&u?function(t){if(Array.isArray(t)){if(0===t.length)return o_;if(1===t.length)return oN(t[0]);let e=oN(t[0]);for(let i=1;itypeof document)if(d)if(Array.isArray(h)){let t;i=[v.ref,ok(l),...h],s=t=of(ow).current,n=i,(s.refs.length!==n.length||s.refs.some((t,e)=>t!==n[e]))&&oS(t,i),v.ref=t.callback}else v.ref=ox(v.ref,ok(l),h);else ox(null,null);return d?(void 0!==f&&(v.className=oV(v.className,f)),void 0!==p&&(v.style=oC(v.style,p)),v):oP}(e,i);return!1===i.enabled?null:function(t,e,i,s){if(e){if("function"==typeof e)return e(i,s);let t=oL(i,e.props);t.ref=i.ref;let n=e;return n?.$$typeof===oW&&(n=V.Children.toArray(e)[0]),V.cloneElement(n,t)}if(t&&"string"==typeof t){var n,r;return n=t,r=i,"button"===n?(0,V.createElement)("button",{type:"button",...r,key:r.key}):"img"===n?(0,V.createElement)("img",{alt:"",...r,key:r.key}):V.createElement(n,r)}throw Error(oy(8))}(t,s,n,i.state??oP)}let oW=Symbol.for("react.lazy"),o$=V.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function oK(t){let{children:e,elementsRef:i,labelsRef:s,onMapChange:n}=t,r=og(n),[,o]=V.useState(!1),l=of(oQ).current,a=of(oU).current,h=V.useRef(0),u=V.useRef(!0),c=V.useRef([]),d=V.useRef(null),f=og(()=>{u.current||(u.current=!0,o(t=>!t))}),p=og((t,e)=>{a.set(t,e),f()}),m=og(t=>{a.delete(t),f()}),g=og(t=>{let e=new Map;return i.current.length=0,s&&(s.current.length=0),t.forEach(t=>{e.set(t.element,{...t.registration.metadata??{},index:t.index}),i.current[t.index]=t.element,s&&(s.current[t.index]=void 0!==t.registration.label?t.registration.label:t.registration.textRef?.current?.textContent??t.element.textContent)}),h.current=i.current.length,e}),v=og(()=>{var t;let e,i,s,n,[o,h]=(t=a,e=new Set,i=[],s=[],t.forEach((t,n)=>{if(!n.isConnected)return;let r=t.index,o={index:r??-1,element:n,registration:t};null===r?s.push(o):r>=0&&(e.add(r),i.push(o))}),n=0,s.sort((t,e)=>oH(t.element,e.element)),s.forEach(t=>{for(;e.has(n);)n+=1;t.index=n,i.push(t),n+=1}),e.size>0&&i.sort((t,e)=>t.index-e.index),[i,s.map(t=>t.element)]),p=g(o);!function(t){if(d.current?.disconnect(),d.current=null,"function"!=typeof MutationObserver||t.length<2)return;let e=new MutationObserver(i=>{if(!function(t){for(let e of t)for(let t=0;t0){e.disconnect(),f();return}s=i}});d.current=e;let i=new Set;for(let e=1;ee.observe(t,{childList:!0}))}(h),c.current=o,u.current=!1,l.forEach(t=>t(p)),r(p)});ou(()=>(u.current||g(c.current),()=>{i.current=[],s&&(s.current=[])}),[i,s,g]),ou(()=>{u.current&&v()}),ou(()=>()=>{d.current?.disconnect(),u.current=!0},[]);let b=og(t=>(l.add(t),()=>{l.delete(t)})),y=V.useMemo(()=>({register:p,unregister:m,subscribeMapChange:b,nextIndexRef:h}),[p,m,b,h]);return(0,I.jsx)(o$.Provider,{value:y,children:e})}function oU(){return new Map}function oQ(){return new Set}function oH(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}let oq=V.createContext(void 0);function oY(){let t=V.useContext(oq);if(void 0===t)throw Error(oy(64));return t}let oG={tabActivationDirection:t=>({"data-activation-direction":t})};function oZ(t,e,i,s){let n=!1,r=!1,o=s??oP;return{reason:t,event:e??new Event("base-ui"),cancel(){n=!0},allowPropagation(){r=!0},get isCanceled(){return n},get isPropagationAllowed(){return r},trigger:i,...o}}t.s(["cancelOpen",0,"cancel-open","chipRemovePress",0,"chip-remove-press","clearPress",0,"clear-press","closePress",0,"close-press","closeWatcher",0,"close-watcher","decrementPress",0,"decrement-press","disabled",0,"disabled","drag",0,"drag","escapeKey",0,"escape-key","focusOut",0,"focus-out","imperativeAction",0,"imperative-action","incrementPress",0,"increment-press","initial",0,"initial","inputBlur",0,"input-blur","inputChange",0,"input-change","inputClear",0,"input-clear","inputPaste",0,"input-paste","inputPress",0,"input-press","itemPress",0,"item-press","keyboard",0,"keyboard","linkPress",0,"link-press","listNavigation",0,"list-navigation","missing",0,"missing","none",0,"none","outsidePress",0,"outside-press","pointer",0,"pointer","scrub",0,"scrub","siblingOpen",0,"sibling-open","swipe",0,"swipe","trackPress",0,"track-press","triggerFocus",0,"trigger-focus","triggerHover",0,"trigger-hover","triggerPress",0,"trigger-press","wheel",0,"wheel","windowResize",0,"window-resize"],16856);var oX=t.i(16856),oX=oX;let oJ=V.forwardRef(function(t,e){let{className:i,defaultValue:s=0,onValueChange:n,orientation:r="horizontal",render:o,value:l,style:a,...h}=t,u=void 0!==t.defaultValue,c=V.useRef([]),[d,f]=V.useState(()=>new Map),[p,m]=oh({controlled:l,default:s,name:"Tabs",state:"value"}),g=void 0!==l,[v,b]=V.useState(()=>new Map),y=V.useRef(void 0),x=V.useCallback(t=>o0(v,t),[v]),[w,S]=V.useState(()=>({previousValue:p,tabActivationDirection:"none"})),{previousValue:M,tabActivationDirection:k}=w,C=k,E=!1;M!==p&&(C=o1(M,p,r,v),E=null!=M&&null!=p&&null==x(p));let T=E?M:p,P=M!==T||k!==C;ou(()=>{P&&S({previousValue:T,tabActivationDirection:C})},[T,P,C]);let R=og((t,e)=>{e.activationDirection=o1(p,t,r,v),n?.(t,e),e.isCanceled||m(t)}),_=og((t,e)=>{n?.(t,oZ(e,void 0,void 0,{activationDirection:"none"}))}),L=og((t,e)=>(f(i=>{let s=new Map(i);return s.set(t,e),s}),()=>{f(i=>{if(i.get(t)!==e)return i;let s=new Map(i);return s.delete(t),s})})),N=V.useCallback(t=>d.get(t),[d]),A=V.useCallback(t=>{for(let e of v.values())if(t===e.value)return e.id},[v]),j=V.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:A,getTabPanelIdByValue:N,onValueChange:R,orientation:r,registerMountedTabPanel:L,setTabMap:b,tabActivationDirection:C,value:p}),[x,A,N,R,r,L,b,C,p]),z=V.useMemo(()=>{for(let t of v.values())if(t.value===p)return t},[v,p]),D=V.useMemo(()=>{for(let t of v.values())if(!t.disabled)return t.value},[v]),O=V.useRef(!u),F=V.useRef(s),B=V.useRef(u),W=V.useRef(!1);ou(()=>{if(g)return;function t(t,e){m(t),S({previousValue:t,tabActivationDirection:"none"}),_(t,e),O.current=!1}if(0===v.size){W.current&&null!==p&&!y.current?.isConnected&&t(null,oX.missing);return}W.current=!0,y.current=v.keys().next().value;let e=z?.disabled,i=null==z&&null!==p;if(e||p!==F.current||(B.current=!1),B.current&&e&&p===F.current)return;let s=O.current;if(e||i){let i=D??null;if(p===i){O.current=!1;return}let n=oX.missing;s?n=oX.initial:e&&(n=oX.disabled),t(i,n);return}s&&null!=z&&(_(p,oX.initial),O.current=!1)},[D,g,_,z,m,v,p]);let $=oB("div",t,{state:{orientation:r,tabActivationDirection:C},ref:e,props:h,stateAttributesMapping:oG});return(0,I.jsx)(oq.Provider,{value:j,children:(0,I.jsx)(oK,{elementsRef:c,children:$})})});function o0(t,e){for(let[i,s]of t.entries())if(e===s.value)return i;return null}function o1(t,e,i,s){if(null==t||null==e)return"none";let[n,r,o]="horizontal"===i?["left","left","right"]:["top","up","down"],l=o0(s,t),a=o0(s,e);if(null==l||null==a)return l!==a&&("number"==typeof t||"string"==typeof t)&&typeof t==typeof e?e>t?o:r:"none";let h=l.getBoundingClientRect()[n],u=a.getBoundingClientRect()[n];return uh?o:"none"}function o2(t){return t?.ownerDocument||document}let o5=0,o3=oc.useId;function o4(t,e){if(void 0!==o3){let i=o3();return t??(e?`${e}-${i}`:i)}return function(t,e="mui"){let[i,s]=V.useState(t),n=t||i;return V.useEffect(()=>{null==i&&(o5+=1,s(`${e}-${o5}`))},[i,e]),n}(t,e)}function o6(t){return o4(t,"base-ui")}function o9(){return"u">typeof window}function o7(t){return lt(t)?(t.nodeName||"").toLowerCase():"#document"}function o8(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function lt(t){return!!o9()&&(t instanceof Node||t instanceof o8(t).Node)}function le(t){return!!o9()&&(t instanceof Element||t instanceof o8(t).Element)}function li(t){return!!o9()&&(t instanceof HTMLElement||t instanceof o8(t).HTMLElement)}function ls(t){return!(!o9()||"u"{let t={onKeyDown(t){i&&e&&"Tab"!==t.key&&t.preventDefault()}};return s||(t.tabIndex=n,!r&&i&&(t.tabIndex=e?n:-1)),(r&&(e||o)||!r&&i)&&(t["aria-disabled"]=i),r&&(!e||l)&&(t.disabled=i),t},[s,i,e,o,l,r,n])}}({focusableWhenDisabled:i,disabled:e,composite:a,tabIndex:s,isNativeButton:n}),u=V.useCallback(()=>{let t=o.current;lu(t)&&a&&e&&void 0===h.disabled&&t.disabled&&(t.disabled=!1)},[e,h.disabled,a]);return ou(u,[u]),{getButtonProps:V.useCallback((t={})=>{let{onClick:i,onMouseDown:s,onKeyUp:r,onKeyDown:o,onPointerDown:l,...u}=t;return oL({onClick(t){e?t.preventDefault():i?.(t)},onMouseDown(t){e||s?.(t)},onKeyDown(t){var i;if(e||(oI(t),o?.(t),t.baseUIHandlerPrevented))return;let s=t.target===t.currentTarget,r=t.currentTarget,l=lu(r),h=!n&&li(i=r)&&"A"===i.tagName&&!!i.href,u=s&&(n?l:!h),c="Enter"===t.key,d=" "===t.key,f=r.getAttribute("role"),p=f?.startsWith("menuitem")||"option"===f||"gridcell"===f;if(s&&a&&d){if(t.defaultPrevented&&p)return;t.preventDefault(),(!n||l)&&(t.preventBaseUIHandler(),la(r,t));return}if(!u||n||!d&&!c){s&&h&&d&&t.preventDefault();return}!t.defaultPrevented&&(t.preventDefault(),c&&(t.preventBaseUIHandler(),la(r,t)))},onKeyUp(t){e||((oI(t),r?.(t),t.target===t.currentTarget&&n&&a&&lu(t.currentTarget)&&" "===t.key)?t.preventDefault():!t.baseUIHandlerPrevented&&(t.target!==t.currentTarget||n||a||t.defaultPrevented||" "!==t.key||(t.preventBaseUIHandler(),la(t.currentTarget,t))))},onPointerDown(t){e?t.preventDefault():l?.(t)}},n?{type:"button"}:{role:"button"},h,u)},[e,h,a,n]),buttonRef:og(t=>{o.current=t,u()})}}function lu(t){return li(t)&&"BUTTON"===t.tagName}let lc="data-composite-item-active";function ld(t={}){let{guess:e,label:i,metadata:s,textRef:n,index:r}=t,{register:o,unregister:l,subscribeMapChange:a,nextIndexRef:h}=V.useContext(o$),u=V.useRef(-1),[c,d]=V.useState(null==r&&e?()=>{if(-1===u.current){let t=h.current;h.current+=1,u.current=t}return u.current}:-1),f=r??c,p=V.useRef(null),m=V.useCallback(t=>{let e=p.current;e&&l(e),p.current=t,t&&o(t,{metadata:s??null,index:r??null,label:i,textRef:n})},[r,o,l,s,i,n]);return ou(()=>{if(null==r)return a(t=>{let e=p.current?t.get(p.current)?.index:null;null!=e&&d(e)})},[r,a]),{ref:m,index:f}}let lf=V.createContext(void 0);function lp(){let t=V.useContext(lf);if(void 0===t)throw Error(oy(65));return t}var oX=oX;function lm(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function lg(t,e){if(!t||!e)return!1;let i=e.getRootNode?.();if(t.contains(e))return!0;if(i&&ls(i)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function lv(t){return"composedPath"in t?t.composedPath()[0]:t.target}let lb=V.forwardRef(function(t,e){let{className:i,disabled:s=!1,render:n,value:r,id:o,nativeButton:l=!0,style:a,...h}=t,{value:u,getTabPanelIdByValue:c,onValueChange:d,orientation:f,tabActivationDirection:p}=oY(),{activateOnFocus:m,registerTabResizeObserverElement:g,tabsListElement:v}=lp(),{highlightedIndex:b,onHighlightedIndexChange:y}=ll(),x=o6(o),{compositeProps:w,compositeRef:S,index:M}=function(t={}){let{highlightItemOnHover:e,highlightedIndex:i,onHighlightedIndexChange:s}=ll(),{ref:n,index:r}=ld(t),o=i===r,l=V.useRef(null),a=ox(n,l);return{compositeProps:{tabIndex:o?0:-1,onFocus(){s(r)},onMouseMove(){let t=l.current;if(!e||!t)return;let i=t.hasAttribute("disabled")||"true"===t.ariaDisabled;o||i||t.focus()}},compositeRef:a,index:r}}({metadata:V.useMemo(()=>({disabled:s,id:x,value:r}),[s,x,r])}),k=r===u,C=V.useRef(!1),E=V.useRef(null),T=og(t=>{E.current?.(),E.current=t?g(t):null});ou(()=>{if(C.current){C.current=!1;return}if(k&&M>-1&&b!==M){if(null!=v){let t=lm(o2(v));if(t&&lg(v,t))return}s||y(M)}},[k,M,b,y,s,v]);let{getButtonProps:P,buttonRef:R}=lh({disabled:s,native:l,focusableWhenDisabled:!0}),_=c(r),L=V.useRef(!1),N=V.useRef(!1);function A(t){d(r,oZ(oX.none,t.nativeEvent,void 0,{activationDirection:"none"}))}return oB("button",t,{state:{disabled:s,active:k,orientation:f,tabActivationDirection:p},ref:[e,R,S,T],props:[w,{role:"tab","aria-controls":_,"aria-selected":k,id:x,onClick:function(t){k||s||A(t)},onFocus:function(t){k||s||m&&(!L.current||N.current)&&A(t)},onPointerDown:function(t){if(k||s)return;L.current=!0,N.current=0===t.button;let e=o2(t.currentTarget);function i(){L.current=!1,N.current=!1,e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i)}e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i)},[lc]:k?"":void 0,onKeyDownCapture(){C.current=!0}},h,P],stateAttributesMapping:oG})}),ly=Math.round;function lx(t){let e=lr(t),i=parseFloat(e.width)||0,s=parseFloat(e.height)||0,n=li(t),r=n?t.offsetWidth:i,o=n?t.offsetHeight:s;return(ly(i)!==r||ly(s)!==o)&&(i=r,s=o),{width:i,height:s}}var lw=t.i(2239);function lS(){return oE}function lM(){return!1}function lk(){return!0}let lC=V.createContext(void 0),lE={disableStyleElements:!1};function lT(t){let{script:e}=t,{nonce:i}=V.useContext(lC)??lE;return(0,lw.useSyncExternalStore)(lS,lM,lk)?(0,I.jsx)("script",{nonce:i,dangerouslySetInnerHTML:{__html:e},suppressHydrationWarning:!0}):null}let lP={...oG,activeTabPosition:()=>null,activeTabSize:()=>null},lR=V.forwardRef(function(t,e){let{className:i,render:s,renderBeforeHydration:n=!1,style:r,...o}=t,{getTabElementBySelectedValue:l,orientation:a,tabActivationDirection:h,value:u}=oY(),{tabsListElement:c,registerIndicatorUpdateListener:d}=lp(),f=function(){let[,t]=V.useState({});return V.useCallback(()=>{t({})},[])}();V.useEffect(()=>d(f),[d,f]);let p=0,m=0,g=0,v=0,b=0,y=0,x=!1;if(null!=u&&null!=c){let t=l(u);if(null!=t){x=!0;let{width:e,height:i}=lx(t),{width:s,height:n}=lx(c),r=t.getBoundingClientRect(),o=c.getBoundingClientRect(),l=s>0?o.width/s:1,a=n>0?o.height/n:1;if(l>Number.EPSILON&&a>Number.EPSILON){let t=r.left-o.left,e=r.top-o.top;p=t/l+c.scrollLeft-c.clientLeft,g=e/a+c.scrollTop-c.clientTop}else p=t.offsetLeft,g=t.offsetTop;b=e,y=i,m=c.scrollWidth-p-b,v=c.scrollHeight-g-y}}let w=x?{left:p,right:m,top:g,bottom:v}:null,S=x?{width:b,height:y}:null,M=oB("span",t,{state:{orientation:a,activeTabPosition:w,activeTabSize:S,tabActivationDirection:h},ref:e,props:[{role:"presentation",style:x?{"--active-tab-left":`${p}px`,"--active-tab-right":`${m}px`,"--active-tab-top":`${g}px`,"--active-tab-bottom":`${v}px`,"--active-tab-width":`${b}px`,"--active-tab-height":`${y}px`}:void 0,hidden:!(x&&b>0&&y>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:lP});return null==u?null:(0,I.jsxs)(V.Fragment,{children:[M,n&&(T||(T=(0,I.jsx)(lT,{script:""})))]})});function l_(t){return oM>=19?t:t?"true":void 0}let lL=((c={}).startingStyle="data-starting-style",c.endingStyle="data-ending-style",c),lN={"data-starting-style":""},lA={"data-ending-style":""},lj={transitionStatus:t=>"starting"===t?lN:"ending"===t?lA:null};var lz=t.i(74080);function lD(t){V.useEffect(t,oT)}let lO=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;let e=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let i=0;i=this.callbacks.length||(this.callbacks[e]=null,this.callbacksCount-=1)}};class lI{static create(){return new lI}static request(t){return lO.request(t)}static cancel(t){return lO.cancel(t)}currentId=null;request(t){this.cancel(),this.currentId=lO.request(()=>{this.currentId=null,t()})}cancel=()=>{null!==this.currentId&&(lO.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel}function lV(){let t=of(lI.create).current;return lD(t.disposeEffect),t}function lF(t){return null==t?t:"current"in t?t.current:t}function lB(t,e=!1){let i=lV();return og((s,n=null)=>{i.cancel();let r=lF(t);if(null==r)return;let o=()=>{lz.flushSync(s)};if("function"!=typeof r.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)return void s();function l(){Promise.all(r.getAnimations().map(t=>t.finished)).then(()=>{n?.aborted||o()},()=>{n?.aborted||(r.getAnimations().some(t=>t.pending||"finished"!==t.playState)?l():o())})}if(e){let t="data-starting-style";if(!r.hasAttribute(t))return void i.request(l);let e=new MutationObserver(()=>{r.hasAttribute(t)||(e.disconnect(),l())});return e.observe(r,{attributes:!0,attributeFilter:[t]}),void n?.addEventListener("abort",()=>e.disconnect(),{once:!0})}i.request(l)})}function lW(t){let{enabled:e=!0,open:i,ref:s,onComplete:n}=t,r=og(n),o=lB(s,i);V.useEffect(()=>{if(!e)return;let t=new AbortController;return o(r,t.signal),()=>{t.abort()}},[e,i,r,o])}function l$(t,e=!1,i=!1){let[s,n]=V.useState(t&&e?"idle":void 0),[r,o]=V.useState(t);return t&&!r&&(o(!0),n("starting")),t||!r||"ending"===s||i||n("ending"),t||r||"ending"!==s||n(void 0),ou(()=>{if(!t&&r&&"ending"!==s&&i){let t=lI.request(()=>{n("ending")});return()=>{lI.cancel(t)}}},[t,r,s,i]),ou(()=>{if(!t||e)return;let i=lI.request(()=>{n(void 0)});return()=>{lI.cancel(i)}},[e,t]),ou(()=>{if(!t||!e)return;t&&r&&"idle"!==s&&n("starting");let i=lI.request(()=>{n("idle")});return()=>{lI.cancel(i)}},[e,t,r,s]),{mounted:r,setMounted:o,transitionStatus:s}}let lK={...oG,...lj},lU=V.forwardRef(function(t,e){let{className:i,value:s,render:n,keepMounted:r=!1,style:o,...l}=t,{value:a,getTabIdByPanelValue:h,orientation:u,tabActivationDirection:c,registerMountedTabPanel:d}=oY(),f=o6(),{ref:p,index:m}=ld(),g=s===a,{mounted:v,transitionStatus:b,setMounted:y}=l$(g),x=!v,w=h(s),S=V.useRef(null),M=oB("div",t,{state:{hidden:x,orientation:u,tabActivationDirection:c,transitionStatus:b},ref:[e,p,S],props:[{"aria-labelledby":w,hidden:x,id:f,role:"tabpanel",tabIndex:g?0:-1,inert:l_(!g),"data-index":m},l],stateAttributesMapping:lK});return(lW({open:g,ref:S,onComplete(){g||y(!1)}}),ou(()=>{if(null!=f&&(!x||r))return d(s,f)},[x,r,s,f,d]),r||v)?M:null}),lQ="ArrowUp",lH="ArrowDown",lq="ArrowLeft",lY="ArrowRight",lG="Home",lZ=new Set([lQ,lH,lq,lY,lG,"End"]),lX=["Shift","Control","Alt","Meta"];function lJ(t){return!!(li(t)&&"INPUT"===t.tagName&&null!=t.selectionStart||li(t)&&"TEXTAREA"===t.tagName)}function l0(t,e,i,s){if(!t||!e||!e.scrollTo)return;let n=t.scrollLeft,r=t.scrollTop,o=t.clientWidtht.scrollLeft+t.clientWidth-r.scrollPaddingRight?n=s+e.offsetWidth+o.scrollMarginRight-t.clientWidth+r.scrollPaddingRight:s-o.scrollMarginLeftt.scrollLeft+t.clientWidth-r.scrollPaddingRight&&(n=s+e.offsetWidth+o.scrollMarginRight-t.clientWidth+r.scrollPaddingRight))}if(l&&"horizontal"!==s){let i=l1(t,e,"top"),s=l2(t),n=l2(e);i-n.scrollMarginTopt.scrollTop+t.clientHeight-s.scrollPaddingBottom&&(r=i+e.offsetHeight+n.scrollMarginBottom-t.clientHeight+s.scrollPaddingBottom)}t.scrollTo({left:n,top:r,behavior:"auto"})}function l1(t,e,i){let s="left"===i?"offsetLeft":"offsetTop",n=0;for(;e.offsetParent&&(n+=e[s],e.offsetParent!==t);)e=e.offsetParent;return n}function l2(t){let e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}function l5(t,e){return e<0||e>=t.length}function l3(t,{startingIndex:e=-1,decrement:i=!1,disabledIndices:s,amount:n=1}={}){let r=e;do r+=i?-n:n;while(r>=0&&r<=t.length-1&&l4(t,r,s))return r}function l4(t,e,i){if("function"==typeof i?i(e):i?.includes(e)??!1)return!0;let s=t[e];return!!s&&(!!(!l6(s)||s.matches(":disabled"))||!i&&(s.hasAttribute("disabled")||"true"===s.getAttribute("aria-disabled")))}function l6(t,e=t?lr(t):null){var i;return!!t&&!!t.isConnected&&!!e&&"hidden"!==(i=e).visibility&&"collapse"!==i.visibility&&("function"==typeof t.checkVisibility?t.checkVisibility():"none"!==e.display&&"contents"!==e.display)}let l9=[],l7=V.createContext(void 0);function l8(t){let e,{render:i,className:s,style:n,refs:r=oT,props:o=oT,state:l=oP,stateAttributesMapping:a,highlightedIndex:h,onHighlightedIndexChange:u,orientation:c,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:g,stopEventPropagation:v=!0,rootRef:b,disabledIndices:y,modifierKeys:x,highlightItemOnHover:w=!1,tag:S="div",...M}=t,{props:k,highlightedIndex:C,onHighlightedIndexChange:E,elementsRef:T,onMapChange:P,relayKeyboardEvent:R}=function(t){let{loopFocus:e=!0,orientation:i="both",grid:s,onLoop:n,direction:r,highlightedIndex:o,onHighlightedIndexChange:l,rootRef:a,enableHomeAndEndKeys:h=!1,stopEventPropagation:u,disabledIndices:c,modifierKeys:d=l9}=t,[f,p]=V.useState(0),m=null!=s,g=V.useRef(null),v=ox(g,a),b=V.useRef([]),y=V.useRef(!1),x=o??f,w=og((t,e=!1)=>{if((l??p)(t),e){let e=b.current[t];l0(g.current,e,r,i)}}),S=og(t=>{if(0===t.size||y.current)return;y.current=!0;let e=Array.from(t.keys()),s=e.find(t=>t?.hasAttribute(lc))??null,n=s?t.get(s)?.index??-1:-1;if(-1!==n)w(n);else if(l4(e,x,c)){let t=l3(e,{disabledIndices:c});l5(e,t)||w(t)}l0(g.current,s,r,i)});ou(()=>{if(null==c||null!=o||!y.current)return;let t=b.current;if(l4(t,x,c)){let e=l3(t,{disabledIndices:c});l5(t,e)||w(e)}},[c,o,x,b,w]);let M=og((t,e,i)=>n?n(t,e,i,b):i),k=og(t=>{let o=t.key===lG||"End"===t.key;if(!lZ.has(t.key)||!h&&o||function(t,e){for(let i of lX)if(!e.includes(i)&&t.getModifierState(i))return!0;return!1}(t,d)||!g.current)return;let l="rtl"===r,a=l?lq:lY,f=l?lY:lq,p="vertical"===i?lH:a,v="vertical"===i?lQ:f,y=lv(t.nativeEvent);if(null!=y&&lJ(y)&&!(null==y||y.hasAttribute("disabled")||"true"===y.getAttribute("aria-disabled"))){let e=y.selectionStart,i=y.selectionEnd,s=y.value;if(null==e||t.shiftKey||e!==i||t.key!==v&&e0)return}let S=x,k=l3(b.current,{disabledIndices:c}),C=l3(b.current,{decrement:!0,startingIndex:b.current.length,disabledIndices:c});null!=s&&(S=s({disabledIndices:c,elementsRef:b,event:t,highlightedIndex:x,loopFocus:e,maxIndex:C,minIndex:k,onLoop:M,orientation:i,rtl:l}));let E="vertical"!==i&&t.key===a||"horizontal"!==i&&t.key===lH,T="vertical"!==i&&t.key===f||"horizontal"!==i&&t.key===lQ;h&&(t.key===lG?S=k:"End"===t.key&&(S=C)),S===x&&(E||T)&&(e&&S===C&&E?(S=k,n&&(S=n(t,x,S,b))):e&&S===k&&T?(S=C,n&&(S=n(t,x,S,b))):S=l3(b.current,{startingIndex:S,decrement:T,disabledIndices:c})),S===x||l5(b.current,S)||(u&&t.stopPropagation(),(m||o||E||T)&&t.preventDefault(),w(S,!0),queueMicrotask(()=>{b.current[S]?.focus()}))});return{props:{ref:v,onFocus(t){let e=g.current,i=lv(t.nativeEvent);e&&null!=i&&lJ(i)&&i.setSelectionRange(0,i.value.length)},onKeyDown:k},highlightedIndex:x,onHighlightedIndexChange:w,elementsRef:b,onMapChange:S,relayKeyboardEvent:k}}({grid:d,loopFocus:f,onLoop:p,orientation:c,highlightedIndex:h,onHighlightedIndexChange:u,rootRef:b,stopEventPropagation:v,enableHomeAndEndKeys:m,direction:(e=V.useContext(l7),e?.direction??"ltr"),disabledIndices:y,modifierKeys:x}),_=oB(S,t,{state:l,ref:r,props:[k,...o,M],stateAttributesMapping:a}),L=V.useMemo(()=>({highlightedIndex:C,onHighlightedIndexChange:E,highlightItemOnHover:w,relayKeyboardEvent:R}),[C,E,w,R]);return(0,I.jsx)(lo.Provider,{value:L,children:(0,I.jsx)(oK,{elementsRef:T,onMapChange:t=>{g?.(t),P(t)},children:_})})}let at=V.forwardRef(function(t,e){let{activateOnFocus:i=!1,className:s,loopFocus:n=!0,render:r,style:o,...l}=t,{orientation:a,setTabMap:h,tabActivationDirection:u}=oY(),[c,d]=V.useState(0),[f,p]=V.useState(null),m=V.useRef(new Set),g=V.useRef(new Set),v=V.useRef(null);ou(()=>{if("u"{m.current.forEach(t=>{t()})});return v.current=t,f&&t.observe(f),g.current.forEach(e=>{t.observe(e)}),()=>{t.disconnect(),v.current=null}},[f]);let b=og(t=>(m.current.add(t),()=>{m.current.delete(t)})),y=og(t=>(g.current.add(t),v.current?.observe(t),()=>{g.current.delete(t),v.current?.unobserve(t)})),x=V.useMemo(()=>({activateOnFocus:i,registerIndicatorUpdateListener:b,registerTabResizeObserverElement:y,tabsListElement:f}),[i,b,y,f]);return(0,I.jsx)(lf.Provider,{value:x,children:(0,I.jsx)(l8,{render:r,className:s,style:o,state:{orientation:a,tabActivationDirection:u},refs:[e,p],props:[{"aria-orientation":"vertical"===a?"vertical":void 0,role:"tablist"},l],stateAttributesMapping:oG,highlightedIndex:c,enableHomeAndEndKeys:!0,loopFocus:n,orientation:a,onHighlightedIndexChange:d,onMapChange:h,disabledIndices:oT})})});t.s(["Indicator",0,lR,"List",0,at,"Panel",0,lU,"Root",0,oJ,"Tab",0,lb],69281);var ae=t.i(69281),ae=ae;function ai(){for(var t,e,i=0,s="",n=arguments.length;i"boolean"==typeof t?`${t}`:0===t?"0":t,an=(t,e)=>i=>{var s;if((null==e?void 0:e.variants)==null)return ai(t,null==i?void 0:i.class,null==i?void 0:i.className);let{variants:n,defaultVariants:r}=e,o=Object.keys(n).map(t=>{let e=null==i?void 0:i[t],s=null==r?void 0:r[t];if(null===e)return null;let o=as(e)||as(s);return n[t][o]}),l=i&&Object.entries(i).reduce((t,e)=>{let[i,s]=e;return void 0===s||(t[i]=s),t},{});return ai(t,o,null==e||null==(s=e.compoundVariants)?void 0:s.reduce((t,e)=>{let{class:i,className:s,...n}=e;return Object.entries(n).every(t=>{let[e,i]=t;return Array.isArray(i)?i.includes({...r,...l}[e]):({...r,...l})[e]===i})?[...t,i,s]:t},[]),null==i?void 0:i.class,null==i?void 0:i.className)},ar=(t=new Map,e=null,i)=>({nextPart:t,validators:e,classGroupId:i}),ao=[],al=(t,e,i)=>{if(0==t.length-e)return i.classGroupId;let s=t[e],n=i.nextPart.get(s);if(n){let i=al(t,e+1,n);if(i)return i}let r=i.validators;if(null===r)return;let o=0===e?t.join("-"):t.slice(e).join("-"),l=r.length;for(let t=0;t{let i=ar();for(let s in t)ah(t[s],i,s,e);return i},ah=(t,e,i,s)=>{let n=t.length;for(let r=0;r{"string"==typeof t?ac(t,e,i):"function"==typeof t?ad(t,e,i,s):af(t,e,i,s)},ac=(t,e,i)=>{(""===t?e:ap(e,t)).classGroupId=i},ad=(t,e,i,s)=>{am(t)?ah(t(s),e,i,s):(null===e.validators&&(e.validators=[]),e.validators.push({classGroupId:i,validator:t}))},af=(t,e,i,s)=>{let n=Object.entries(t),r=n.length;for(let t=0;t{let i=t,s=e.split("-"),n=s.length;for(let t=0;t"isThemeGetter"in t&&!0===t.isThemeGetter,ag=[],av=(t,e,i,s,n)=>({modifiers:t,hasImportantModifier:e,baseClassName:i,maybePostfixModifierPosition:s,isExternal:n}),ab=/\s+/,ay=t=>{let e;if("string"==typeof t)return t;let i="";for(let s=0;s{let e=e=>e[t]||ax;return e.isThemeGetter=!0,e},aS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ak=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,a_=t=>ak.test(t),aL=t=>!!t&&!Number.isNaN(Number(t)),aN=t=>!!t&&Number.isInteger(Number(t)),aA=t=>t.endsWith("%")&&aL(t.slice(0,-1)),aj=t=>aC.test(t),az=()=>!0,aD=t=>aE.test(t)&&!aT.test(t),aO=()=>!1,aI=t=>aP.test(t),aV=t=>aR.test(t),aF=t=>!a$(t)&&!aZ(t),aB=t=>t.startsWith("@container")&&("/"===t[10]&&void 0!==t[11]||"s"===t[11]&&void 0!==t[16]&&t.startsWith("-size/",10)||"n"===t[11]&&void 0!==t[18]&&t.startsWith("-normal/",10)),aW=t=>a4(t,a8,aO),a$=t=>aS.test(t),aK=t=>a4(t,ht,aD),aU=t=>a4(t,he,aL),aQ=t=>a4(t,hs,az),aH=t=>a4(t,hi,aO),aq=t=>a4(t,a9,aO),aY=t=>a4(t,a7,aV),aG=t=>a4(t,hn,aI),aZ=t=>aM.test(t),aX=t=>a6(t,ht),aJ=t=>a6(t,hi),a0=t=>a6(t,a9),a1=t=>a6(t,a8),a2=t=>a6(t,a7),a5=t=>a6(t,hn,!0),a3=t=>a6(t,hs,!0),a4=(t,e,i)=>{let s=aS.exec(t);return!!s&&(s[1]?e(s[1]):i(s[2]))},a6=(t,e,i=!1)=>{let s=aM.exec(t);return!!s&&(s[1]?e(s[1]):i)},a9=t=>"position"===t||"percentage"===t,a7=t=>"image"===t||"url"===t,a8=t=>"length"===t||"size"===t||"bg-size"===t,ht=t=>"length"===t,he=t=>"number"===t,hi=t=>"family-name"===t,hs=t=>"number"===t||"weight"===t,hn=t=>"shadow"===t,hr=(d=()=>{let t=aw("color"),e=aw("font"),i=aw("text"),s=aw("font-weight"),n=aw("tracking"),r=aw("leading"),o=aw("breakpoint"),l=aw("container"),a=aw("spacing"),h=aw("radius"),u=aw("shadow"),c=aw("inset-shadow"),d=aw("text-shadow"),f=aw("drop-shadow"),p=aw("blur"),m=aw("perspective"),g=aw("aspect"),v=aw("ease"),b=aw("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),aZ,a$],S=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],k=()=>[aZ,a$,a],C=()=>[a_,"full","auto",...k()],E=()=>[aN,"none","subgrid",aZ,a$],T=()=>["auto",{span:["full",aN,aZ,a$]},aN,aZ,a$],P=()=>[aN,"auto",aZ,a$],R=()=>["auto","min","max","fr",aZ,a$],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...k()],A=()=>[a_,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],j=()=>[a_,"screen","full","dvw","lvw","svw","min","max","fit",...k()],z=()=>[a_,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],D=()=>[t,aZ,a$],O=()=>[...x(),a0,aq,{position:[aZ,a$]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",a1,aW,{size:[aZ,a$]}],F=()=>[aA,aX,aK],B=()=>["","none","full",h,aZ,a$],W=()=>["",aL,aX,aK],$=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[aL,aA,a0,aq],Q=()=>["","none",p,aZ,a$],H=()=>["none",aL,aZ,a$],q=()=>["none",aL,aZ,a$],Y=()=>[aL,aZ,a$],G=()=>[a_,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[aj],breakpoint:[aj],color:[az],container:[aj],"drop-shadow":[aj],ease:["in","out","in-out"],font:[aF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[aj],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[aj],shadow:[aj],spacing:["px",aL],text:[aj],"text-shadow":[aj],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",a_,a$,aZ,g]}],container:["container"],"container-type":[{"@container":["","normal","size",aZ,a$]}],"container-named":[aB],columns:[{columns:[aL,a$,aZ,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[aN,"auto",aZ,a$]}],basis:[{basis:[a_,"full","auto",l,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[aL,a_,"auto","initial","none",a$]}],grow:[{grow:["",aL,aZ,a$]}],shrink:[{shrink:["",aL,aZ,a$]}],order:[{order:[aN,"first","last","none",aZ,a$]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",i,aX,aK]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,a3,aQ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",aA,a$]}],"font-family":[{font:[aJ,aH,e]}],"font-features":[{"font-features":[a$]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,aZ,a$]}],"line-clamp":[{"line-clamp":[aL,"none",aZ,aU]}],leading:[{leading:[r,...k()]}],"list-image":[{"list-image":["none",aZ,a$]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",aZ,a$]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:[aL,"from-font","auto",aZ,aK]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[aL,"auto",aZ,a$]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"tab-size":[{tab:[aN,aZ,a$]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",aZ,a$]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",aZ,a$]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},aN,aZ,a$],radial:["",aZ,a$],conic:[aN,aZ,a$]},a2,aY]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$(),"hidden","none"]}],"divide-style":[{divide:[...$(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...$(),"none","hidden"]}],"outline-offset":[{"outline-offset":[aL,aZ,a$]}],"outline-w":[{outline:["",aL,aX,aK]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",u,a5,aG]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",c,a5,aG]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[aL,aK]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",d,a5,aG]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[aL,aZ,a$]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[aL]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[aZ,a$]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[aL]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",aZ,a$]}],filter:[{filter:["","none",aZ,a$]}],blur:[{blur:Q()}],brightness:[{brightness:[aL,aZ,a$]}],contrast:[{contrast:[aL,aZ,a$]}],"drop-shadow":[{"drop-shadow":["","none",f,a5,aG]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",aL,aZ,a$]}],"hue-rotate":[{"hue-rotate":[aL,aZ,a$]}],invert:[{invert:["",aL,aZ,a$]}],saturate:[{saturate:[aL,aZ,a$]}],sepia:[{sepia:["",aL,aZ,a$]}],"backdrop-filter":[{"backdrop-filter":["","none",aZ,a$]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[aL,aZ,a$]}],"backdrop-contrast":[{"backdrop-contrast":[aL,aZ,a$]}],"backdrop-grayscale":[{"backdrop-grayscale":["",aL,aZ,a$]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[aL,aZ,a$]}],"backdrop-invert":[{"backdrop-invert":["",aL,aZ,a$]}],"backdrop-opacity":[{"backdrop-opacity":[aL,aZ,a$]}],"backdrop-saturate":[{"backdrop-saturate":[aL,aZ,a$]}],"backdrop-sepia":[{"backdrop-sepia":["",aL,aZ,a$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",aZ,a$]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[aL,"initial",aZ,a$]}],ease:[{ease:["linear","initial",v,aZ,a$]}],delay:[{delay:[aL,aZ,a$]}],animate:[{animate:["none",b,aZ,a$]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,aZ,a$]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:H()}],"rotate-x":[{"rotate-x":H()}],"rotate-y":[{"rotate-y":H()}],"rotate-z":[{"rotate-z":H()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[aZ,a$,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],zoom:[{zoom:[aN,aZ,a$]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",aZ,a$]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",aZ,a$]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[aL,aX,aK,aU]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},a=t=>{let e=r(t);if(e)return e;let i=((t,e)=>{let{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:r,postfixLookupClassGroupIds:o}=e,l=[],a=t.trim().split(ab),h="";for(let t=a.length-1;t>=0;t-=1){let e,u=a[t],{isExternal:c,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=i(u);if(c){h=u+(h.length>0?" "+h:h);continue}let g=!!m;if(g){let t=(e=s(p.substring(0,m)))&&o[e]?s(p):void 0;t&&t!==e&&(e=t,g=!1)}else e=s(p);if(!e){if(!g||!(e=s(p))){h=u+(h.length>0?" "+h:h);continue}g=!1}let v=0===d.length?"":1===d.length?d[0]:r(d).join(":"),b=f?v+"!":v,y=b+e;if(l.indexOf(y)>-1)continue;l.push(y);let x=n(e,g);for(let t=0;t0?" "+h:h)}return h})(t,n);return o(t,i),i},l=t=>{var e;let i;return r=(n={cache:(t=>{if(t<1)return{get:()=>void 0,set:()=>{}};let e=0,i=Object.create(null),s=Object.create(null),n=(n,r)=>{i[n]=r,++e>t&&(e=0,s=i,i=Object.create(null))};return{get(t){let e=i[t];return void 0!==e?e:void 0!==(e=s[t])?(n(t,e),e):void 0},set(t,e){t in i?i[t]=e:n(t,e)}}})((e=[].reduce((t,e)=>e(t),d())).cacheSize),parseClassName:(t=>{let{prefix:e,experimentalParseClassName:i}=t,s=t=>{let e,i=[],s=0,n=0,r=0,o=t.length;for(let l=0;lr?e-r:void 0)};if(e){let t=e+":",i=s;s=e=>e.startsWith(t)?i(e.slice(t.length)):av(ag,!1,e,void 0,!0)}if(i){let t=s;s=e=>i({className:e,parseClassName:t})}return s})(e),sortModifiers:(i=new Map,e.orderSensitiveModifiers.forEach((t,e)=>{i.set(t,1e6+e)}),t=>{let e=[],s=[];for(let n=0;n0&&(s.sort(),e.push(...s),s=[]),e.push(r)):s.push(r)}return s.length>0&&(s.sort(),e.push(...s)),e}),postfixLookupClassGroupIds:(t=>{let e=Object.create(null),i=t.postfixLookupClassGroups;if(i)for(let t=0;t{let e=(t=>{let{theme:e,classGroups:i}=t;return aa(i,e)})(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:t=>{if(t.startsWith("[")&&t.endsWith("]")){var i;let e,s,n;return -1===(i=t).slice(1,-1).indexOf(":")?void 0:(s=(e=i.slice(1,-1)).indexOf(":"),(n=e.slice(0,s))?"arbitrary.."+n:void 0)}let s=t.split("-"),n=+(""===s[0]&&s.length>1);return al(s,n,e)},getConflictingClassGroupIds:(t,e)=>{if(e){let e=s[t],n=i[t];if(e){if(n){let t=Array(n.length+e.length);for(let e=0;el(((...t)=>{let e,i,s=0,n="";for(;ssvg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function hd({className:t,variant:e="default",render:i,...s}){var n;return oB((n={defaultTagName:"span",props:oL({className:ho(hc({variant:e}),t)},s),render:i,state:{slot:"badge",variant:e}}).defaultTagName??"div",n,n)}let hf=V.forwardRef(function(t,e){let{render:i,className:s,disabled:n=!1,focusableWhenDisabled:r=!1,nativeButton:o=!0,style:l,...a}=t,{getButtonProps:h,buttonRef:u}=lh({disabled:n,focusableWhenDisabled:r,native:o});return oB("button",t,{state:{disabled:n},ref:[e,u],props:[a,h]})}),hp=an("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function hm({className:t,variant:e="default",size:i="default",...s}){return(0,I.jsx)(hf,{"data-slot":"button",className:ho(hp({variant:e,size:i,className:t})),...s})}t.s([],14651),t.i(14651);let hg=V.createContext(void 0);function hv(t){let e=V.useContext(hg);if(!t&&void 0===e)throw Error(oy(27));return e}(f={}).open="data-open",f.closed="data-closed",f[f.startingStyle=lL.startingStyle]="startingStyle",f[f.endingStyle=lL.endingStyle]="endingStyle",f.anchorHidden="data-anchor-hidden",f.side="data-side",f.align="data-align";let hb={"data-popup-open":""},hy={"data-open":""},hx={"data-closed":""},hw={"data-anchor-hidden":""},hS={open:t=>t?hb:null},hM={open:t=>t?hy:hx,anchorHidden:t=>t?hw:null},hk={...hM,...lj},hC=V.forwardRef(function(t,e){let{render:i,className:s,style:n,forceRender:r=!1,...o}=t,l=hv(),a=l.useState("open"),h=l.useState("nested"),u=l.useState("mounted");return oB("div",t,{state:{open:a,transitionStatus:l.useState("transitionStatus")},ref:[l.context.backdropRef,e],stateAttributesMapping:hk,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},o],enabled:r||!h})});var oX=oX;let hE=V.forwardRef(function(t,e){let{render:i,className:s,style:n,disabled:r=!1,nativeButton:o=!0,...l}=t,a=hv(),h=a.useState("open"),{getButtonProps:u,buttonRef:c}=lh({disabled:r,native:o});return oB("button",t,{state:{disabled:r},ref:[e,c],props:[{onClick:function(t){h&&a.setOpen(!1,oZ(oX.closePress,t.nativeEvent))}},l,u]})}),hT=V.forwardRef(function(t,e){let{render:i,className:s,style:n,id:r,...o}=t,l=hv(),a=o6(r);return l.useSyncedValueWithCleanup("descriptionElementId",a),oB("p",t,{ref:e,props:[{id:a},o]})});function hP(t,e,i,s){return t.addEventListener(e,i,s),()=>{t.removeEventListener(e,i,s)}}function hR(...t){return()=>{for(let e=0;e{e.current=e.next}};return e}class hN{static create(){return new hN}currentId=0;start(t,e){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,e()},t)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}function hA(){let t=of(hN.create).current;return lD(t.disposeEffect),t}t.s([],64949),t.i(64949);let{userAgent:hj,platform:hz,maxTouchPoints:hD}="u"1,hF="android",hB=hI===hF||hO.includes(hF),hW=!hV&&hI.startsWith("mac"),h$=hI.startsWith("win"),hK=!hB&&/^(linux|chrome os)/.test(hI),hU=hW||hV;t.s(["android",0,hB,"apple",0,hU,"ios",0,hV,"linux",0,hK,"mac",0,hW,"windows",0,h$],3720);var hQ=t.i(3720);let hH="u">typeof CSS&&!!CSS.supports?.("-webkit-backdrop-filter:none"),hq=!hH&&hO.includes("firefox"),hY=!hH&&hO.includes("chrom");t.s(["blink",0,hY,"gecko",0,hq,"webkit",0,hH],79850);var hG=t.i(79850);t.s(["voiceOver",0,hU],99170);var hZ=t.i(99170);let hX=/jsdom|happydom/.test(hO);t.s(["jsdom",0,hX],36174);var hJ=t.i(36174);t.s(["engine",0,hG,"env",0,hJ,"os",0,hQ,"screenReader",0,hZ],79214);var h0=t.i(79214),h0=h0,h0=h0;let h1={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},h2={...h1,position:"fixed",top:0,left:0};({...h1,position:"absolute"});let h5=V.forwardRef(function(t,e){let[i,s]=V.useState();return ou(()=>{h0.screenReader.voiceOver&&h0.engine.webkit&&s("button")},[]),(0,I.jsx)("span",{...t,ref:e,style:h2,"aria-hidden":!i||void 0,tabIndex:0,role:i,"data-base-ui-focus-guard":""})}),h3="data-base-ui-focusable";function h4(t,e){return null!=e&&("composedPath"in t?t.composedPath().includes(e):null!=t.target&&e.contains(t.target))}function h6(t){return li(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function h9(t){return!!t&&"combobox"===t.getAttribute("role")&&h6(t)}function h7(t){return t?t.hasAttribute(h3)?t:t.querySelector(`[${h3}]`)||t:null}var h0=h0;function h8(t){return!h0.env.jsdom&&(!h0.os.android&&0===t.width&&0===t.height||h0.os.android&&1===t.width&&1===t.height&&0===t.pressure&&0===t.detail&&"mouse"===t.pointerType||t.width<1&&t.height<1&&0===t.pressure&&0===t.detail&&"touch"===t.pointerType)}function ut(t,e){let i=["mouse","pen"];return e||i.push("",void 0),i.includes(t)}function ue(t){for(let e of Array.from(t.children))if("summary"===o7(e))return e;return null}function ui(t){let e=t?o7(t):"";return null!=t&&t.matches('a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]')&&("summary"!==e||null!=t.parentElement&&"details"===o7(t.parentElement)&&ue(t.parentElement)===t)&&("details"!==e||null==ue(t))&&("input"!==e||"hidden"!==t.type)}function us(t){if(!ui(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=function(t){let e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;let i=t.getRootNode();return ls(i)?i.host:null}(e)){let i=e!==t,s="slot"===o7(e);if(e.hasAttribute("inert")||i&&"details"===o7(e)&&!e.open&&!function(t,e){let i=ue(e);return!!i&&(t===i||lg(i,t))}(t,e)||e.hasAttribute("hidden")||!s&&!function(t,e){let i=lr(t);return e?"none"!==i.display:l6(t,i)}(e,i))return!1}return!0}function un(t){let e=t.tabIndex;if(e<0){let e=o7(t);if("details"===e||"audio"===e||"video"===e||li(t)&&t.isContentEditable)return 0}return e}function ur(t){return"input"!==o7(t)?null:"radio"===t.type&&""!==t.name?t:null}function uo(t){if(li(t)&&"slot"===o7(t)){let e=t.assignedElements({flatten:!0});if(e.length>0)return e}return li(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function ul(t){return us(t)&&un(t)>=0}function ua(t){let e=[];return!function t(e,i){uo(e).forEach(e=>{ui(e)&&i.push(e),t(e,i)})}(t,e),e.filter(us)}function uh(t){let e=ua(t);return e.filter(t=>un(t)>=0&&function(t,e){let i=ur(t);if(!i)return!0;let s=e.find(t=>{let e=ur(t);return e?.name===i.name&&e.form===i.form&&e.checked});return s?s===i:e.find(t=>{let e=ur(t);return e?.name===i.name&&e.form===i.form})===i}(t,e))}function uu(t,e){let i=uh(t),s=i.length;if(0===s)return;let n=lm(o2(t)),r=i.indexOf(n);return i[-1===r?1===e?0:s-1:r+e]}function uc(t){return uu(o2(t).body,1)||t}function ud(t){return uu(o2(t).body,-1)||t}function uf(t,e){let i=e||t.currentTarget,s=t.relatedTarget;return!s||!lg(i,s)}function up(t){let e=[];!function t(e,i,s){uo(e).forEach(e=>{li(e)&&e.matches(i)&&s.push(e),t(e,i,s)})}(t,"[data-tabindex]",e),e.forEach(t=>{let e=t.dataset.tabindex;delete t.dataset.tabindex,e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")})}function um(t,e,i=!0){return t.filter(t=>t.parentId===e).flatMap(e=>[...!i||e.context?.open?[e]:[],...um(t,e.id,i)])}function ug(t,e){let i=[],s=t.find(t=>t.id===e)?.parentId;for(;s;){let e=t.find(t=>t.id===s);s=e?.parentId,e&&(i=i.concat(e))}return i}var oX=oX;function uv(t){return`data-base-ui-${t}`}let ub=0;function uy(t,e={}){let{preventScroll:i=!1,sync:s=!1,shouldFocus:n}=e;function r(){(!n||n())&&t?.focus({preventScroll:i})}if(cancelAnimationFrame(ub),s)return r(),oE;let o=requestAnimationFrame(r);return ub=o,()=>{ub===o&&(cancelAnimationFrame(o),ub=0)}}let ux={inert:new WeakMap,"aria-hidden":new WeakMap},uw="data-base-ui-inert",uS={inert:new WeakSet,"aria-hidden":new WeakSet},uM=new WeakMap,uk=0,uC=(t,e)=>e.map(e=>{if(t.contains(e))return e;let i=function t(e){return e?ls(e)?e.host:t(e.parentNode):null}(e);return t.contains(i)?i:null}).filter(t=>null!=t),uE=t=>{let e=new Set;return t.forEach(t=>{let i=t;for(;i&&!e.has(i);)e.add(i),i=i.parentNode}),e},uT=(t,e,i)=>{let s=[],n=t=>{!t||i.has(t)||Array.from(t.children).forEach(t=>{"script"!==o7(t)&&(e.has(t)?n(t):s.push(t))})};return n(t),s};function uP(t,e={}){let{ariaHidden:i=!1,inert:s=!1,mark:n=!0}=e,r=o2(t[0]).body;return function(t,e,i,s,{mark:n=!0}){let r=null;s?r="inert":i&&(r="aria-hidden");let o=null,l=null,a=uC(e,t),h=n?uT(e,uE(a),new Set(a)):[],u=[],c=[];if(r){let t=ux[r],i=uS[r];l=i,o=t;let s=uC(e,Array.from(e.querySelectorAll("[aria-live]"))),n=a.concat(s);uT(e,uE(n),new Set(n)).forEach(e=>{let s=e.getAttribute(r),n=null!==s&&"false"!==s,o=(t.get(e)||0)+1;t.set(e,o),u.push(e),1===o&&n&&i.add(e),n||e.setAttribute(r,"inert"===r?"":"true")})}return n&&h.forEach(t=>{let e=(uM.get(t)||0)+1;uM.set(t,e),c.push(t),1===e&&t.setAttribute(uw,"")}),uk+=1,()=>{o&&u.forEach(t=>{let e=(o.get(t)||0)-1;o.set(t,e),e||(!l?.has(t)&&r&&t.removeAttribute(r),l?.delete(t))}),n&&c.forEach(t=>{let e=(uM.get(t)||0)-1;uM.set(t,e),e||t.removeAttribute(uw)}),(uk-=1)||(ux.inert=new WeakMap,ux["aria-hidden"]=new WeakMap,uS.inert=new WeakSet,uS["aria-hidden"]=new WeakSet,uM=new WeakMap)}}(t,r,i,s,{mark:n})}var oX=oX;let uR="data-base-ui-click-trigger",u_={clipPath:"inset(50%)",position:"fixed",top:0,left:0},uL=V.createContext(null),uN=uv("portal"),uA=V.forwardRef(function(t,e){let{render:i,className:s,style:n,children:r,container:o,...l}=t,{node:a,nodeId:h,subtree:u}=function(t={}){let{ref:e,container:i,componentProps:s=oP,elementProps:n}=t,r=o4(),o=V.useContext(uL),l=o?.portalNode,[a,h]=V.useState(null),[u,c]=V.useState(null),d=og(t=>{null!==t&&c(t)}),f=V.useRef(null);ou(()=>{if(null===i){f.current&&(f.current=null,c(null),h(null));return}let t=(i&&(lt(i)?i:i.current))??l??document.body;if(null==t){f.current&&(f.current=null,c(null),h(null));return}f.current!==t&&(f.current=t,c(null),h(t))},[i,l]);let p=oB("div",s,{ref:[e,d],props:[{id:r,[uN]:""},n]}),m=a&&p?lz.createPortal(p,a):null;return{node:u,nodeId:V.isValidElement(p)?p.props.id:void 0,subtree:m}}({container:o,ref:e,componentProps:t,elementProps:l}),c=V.useRef(null),d=V.useRef(null),f=V.useRef(null),p=V.useRef(null),[m,g]=V.useState(null),v=V.useRef(!1),b=m?.modal,y=m?.open,x=!!m&&!m.modal&&m.open&&!!a;V.useEffect(()=>{if(a&&!b)return hR(hP(a,"focusin",t,!0),hP(a,"focusout",t,!0));function t(t){a&&t.relatedTarget&&uf(t)&&("focusin"===t.type?v.current&&(up(a),v.current=!1):(uh(a).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),v.current=!0))}},[a,b]),ou(()=>{a&&!0===y&&v.current&&(up(a),v.current=!1)},[y,a]);let w=V.useMemo(()=>({beforeOutsideRef:c,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:a,setFocusManagerState:g}),[a]);return(0,I.jsxs)(V.Fragment,{children:[u,(0,I.jsxs)(uL.Provider,{value:w,children:[x&&a&&(0,I.jsx)(h5,{"data-type":"outside",ref:c,onFocus:t=>{if(uf(t,a))f.current?.focus();else{let t=ud(m?m.domReference:null);t?.focus()}}}),x&&a&&(0,I.jsx)("span",{"aria-owns":h,style:u_}),a&&lz.createPortal(r,a),x&&a&&(0,I.jsx)(h5,{"data-type":"outside",ref:d,onFocus:t=>{if(uf(t,a))p.current?.focus();else{let e=uc(m?m.domReference:null);e?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,oZ(oX.focusOut,t.nativeEvent))}}})]})]})}),uj=V.createContext(null),uz=V.createContext(null),uD=t=>{let e=V.useContext(uz);return t??e},uO=[];function uI(){uO=uO.filter(t=>t.deref()?.isConnected)}function uV(t){uI(),t&&"body"!==o7(t)&&(uO.push(new WeakRef(t)),uO.length>20&&(uO=uO.slice(-20)))}function uF(){return uI(),uO[uO.length-1]?.deref()}function uB(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;let e=ua(t).filter(t=>{let e=t.getAttribute("data-tabindex")||"";return ul(t)||t.hasAttribute("data-tabindex")&&!e.startsWith("-")}),i=t.getAttribute("tabindex");0===e.length?"0"!==i&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):("-1"!==i||t.hasAttribute("data-tabindex")&&"-1"!==t.getAttribute("data-tabindex"))&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function uW(t){let{context:e,children:i,disabled:s=!1,initialFocus:n=!0,returnFocus:r=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:h="",nextFocusableElement:u,previousFocusableElement:c,beforeContentFocusGuardRef:d,externalTree:f,getInsideElements:p}=t,m="rootStore"in e?e.rootStore:e,g=m.useState("open"),v=m.useState("domReferenceElement"),b=m.useState("floatingElement"),{events:y,dataRef:x}=m.context,w=og(()=>x.current.floatingContext?.nodeId),S=h9(v)&&!1===n,M=h_(n),k=h_(r),C=h_(h),E=h_(g),T=uD(f),P=V.useContext(uL),R=V.useRef(!1),_=V.useRef(!1),L=V.useRef(!1),N=V.useRef(null),A=V.useRef(""),j=V.useRef(""),z=V.useRef(null),D=V.useRef(null),O=ox(z,d,P?.beforeInsideRef),F=ox(D,P?.afterInsideRef),B=hA(),W=hA(),$=lV(),K=null!=P,U=h7(b),Q=og((t=U)=>t?uh(t):[]),H=og(()=>p?.().filter(t=>null!=t)??[]);V.useEffect(()=>{if(!s&&l)return hP(o2(U),"keydown",function(t){"Tab"===t.key&&lg(U,lm(o2(U)))&&0===Q().length&&!S&&(t.preventDefault(),t.stopPropagation())})},[s,U,l,S,Q]),V.useEffect(()=>{if(s||!g)return;let t=o2(U);function e(){L.current=!1}return hR(hP(t,"pointerdown",function(t){let e=lv(t),i=H();L.current=!(lg(b,e)||lg(v,e)||lg(P?.portalNode,e)||i.some(t=>t===e||lg(t,e))),j.current=t.pointerType||"keyboard",e?.closest(`[${uR}]`)&&(_.current=!0,W.start(0,()=>{_.current=!1}))},!0),hP(t,"pointerup",e,!0),hP(t,"pointercancel",e,!0),hP(t,"keydown",function(){j.current="keyboard"},!0),e)},[s,b,v,U,g,P,W,H]),V.useEffect(()=>{if(s||!a)return;let t=o2(U);function e(e){let i=e.relatedTarget,s=e.currentTarget,n=lv(e);l&&null==i&&null!=n&&lg(b,n)&&uV(n),queueMicrotask(()=>{let r=w(),a=m.context.triggerElements,h=H(),d=i?.hasAttribute(uv("focus-guard"))&&[z.current,D.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,lF(c),lF(u)].includes(i),f=!(lg(v,i)||lg(b,i)||lg(i,b)||lg(P?.portalNode,i)||h.some(t=>t===i||lg(t,i))||a.hasMatchingElement(t=>lg(t,i))||d||T&&(um(T.nodesRef.current,r).find(t=>lg(t.context?.elements.floating,i)||lg(t.context?.elements.domReference,i))||ug(T.nodesRef.current,r).find(t=>[t.context?.elements.floating,h7(t.context?.elements.floating)].includes(i)||t.context?.elements.domReference===i)));if(s===v&&U&&uB(U),o&&s!==v&&!l6(n)&&lm(t)===t.body){if(li(U)&&(U.focus(),"popup"===o))return void $.request(()=>{U.focus()});let t=Q(),e=N.current,i=(e&&t.includes(e)?e:null)||t[t.length-1]||U;li(i)&&i.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(S||!l)&&i&&f&&!_.current&&(S||i!==uF())&&(R.current=!0,m.setOpen(!1,oZ(oX.focusOut,e)))})}let i=li(v)?v:null;if(b||i)return hR(i&&hP(i,"focusout",e),i&&hP(i,"pointerdown",function(){_.current=!0,W.start(0,()=>{_.current=!1})}),b&&hP(b,"focusin",function(t){let e=lv(t);ul(e)&&(N.current=e)}),b&&hP(b,"focusout",e),b&&P&&hP(b,"focusout",function(){L.current||(x.current.insideReactTree=!0,B.start(0,()=>{x.current.insideReactTree=!1}))},!0))},[s,v,b,U,l,T,P,m,a,o,Q,S,w,x,B,W,$,u,c,H]),V.useEffect(()=>{if(s||!b||!g)return;let t=Array.from(P?.portalNode?.querySelectorAll(`[${uv("portal")}]`)||[]),e=T?ug(T.nodesRef.current,w()):[],i=e.find(t=>h9(t.context?.elements.domReference||null))?.context?.elements.domReference,n=uP([b,...t,z.current,D.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...H(),i,lF(c),lF(u),S?v:null].filter(t=>null!=t),{ariaHidden:l||S,mark:!1}),r=uP([b,...t].filter(t=>null!=t));return()=>{r(),n()}},[g,s,v,b,l,P,S,T,w,u,c,H]),ou(()=>{if(!g||s||!li(U))return;A.current="",j.current="";let t=o2(U),e=lm(t);queueMicrotask(()=>{let i,s=M.current,n="function"==typeof s?s(C.current||""):s;if(void 0===n||!1===n||lg(U,e))return;let r=null,o=()=>(null==r&&(r=Q(U)),r[0]||U);i=(i=!0===n||null===n?o():lF(n))||o();let l=lg(U,lm(t));uy(i,{preventScroll:i===U,shouldFocus(){if(!E.current)return!1;if(l)return!0;let e=lm(t);return!(e!==i&&lg(U,e))}})})},[s,g,U,Q,M,C,E]),ou(()=>{if(s||!U)return;let t=o2(U),e=lm(t),i=null==C.current;function n(t){var e,i,s;let n;if(t.open||(e=t.nativeEvent,i=j.current,n=o8(lv(e)),A.current=e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?i||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?i||(0===e.detail?"keyboard":"mouse"):""),t.reason===oX.triggerHover&&"mouseleave"===t.nativeEvent.type&&(R.current=!0),t.reason===oX.outsidePress)if(t.nested)R.current=!1;else if(""===(s=t.nativeEvent).pointerType&&s.isTrusted||(h0.os.android&&s.pointerType?"click"===s.type&&1===s.buttons:0===s.detail&&!s.pointerType)||h8(t.nativeEvent))R.current=!1;else{let t=!1;o2(U).createElement("div").focus({get preventScroll(){return t=!0,!1}}),t?R.current=!1:R.current=!0}}return uV(e),y.on("openchange",n),()=>{y.off("openchange",n);let s=lm(t),r=H(),o=lg(b,s)||r.some(t=>t===s||lg(t,s))||T&&um(T.nodesRef.current,w(),!1).some(t=>lg(t.context?.elements.floating,s)),l=k.current,a=A.current,h=function(t){let s=k.current,n="function"==typeof s?s(t):s;if(void 0===n||!1===n)return null;null===n&&(n=!0);let r=v?.isConnected?v:null,o=e?.isConnected&&"body"!==o7(e)?e:null,l=i?o||r:r||o;return(l||(l=uF()||null),"boolean"==typeof n)?l:lF(n)||l||null}(a);queueMicrotask(()=>{let e=h?ul(h)?h:uh(h)[0]||h:null;if(l&&!R.current&&li(e)&&("boolean"!=typeof l||e===s||s===t.body||o)){let t={preventScroll:!0};"keyboard"===a&&(t.focusVisible=!0),e.focus(t)}R.current=!1})}},[s,b,U,k,C,y,T,v,w,H]),ou(()=>{if(!h0.engine.webkit||g||!b)return;let t=lm(o2(b));li(t)&&h6(t)&&lg(b,t)&&t.blur()},[g,b]),ou(()=>{if(!s&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:a,open:g,onOpenChange:m.setOpen,domReference:v}),()=>{P.setFocusManagerState(null)}},[s,P,l,g,m,a,v]),ou(()=>{if(!s&&U)return uB(U),()=>{queueMicrotask(uI)}},[s,U]);let q=!s&&(!l||!S)&&(K||l);return(0,I.jsxs)(V.Fragment,{children:[q&&(0,I.jsx)(h5,{"data-type":"inside",ref:O,onFocus:t=>{if(l){let t=Q();uy(t[t.length-1])}else if(P?.portalNode)if(R.current=!1,uf(t,P.portalNode)){let t=uc(v);t?.focus()}else lF(c??P.beforeOutsideRef)?.focus()}}),i,q&&(0,I.jsx)(h5,{"data-type":"inside",ref:F,onFocus:t=>{if(l)uy(Q()[0]);else if(P?.portalNode)if(a&&(R.current=!0),uf(t,P.portalNode)){let t=ud(v);t?.focus()}else lF(u??P.afterOutsideRef)?.focus()}})]})}let u$=V.createContext(void 0);function uK(){let t=V.useContext(u$);if(void 0===t)throw Error(oy(26));return t}var uU=t.i(30224);let uQ=oM>=19?function(t,e,i,s,n){let r;if(!h){let r;return r=V.useCallback(()=>e(t.getSnapshot(),i,s,n),[t,e,i,s,n]),(0,lw.useSyncExternalStore)(t.subscribe,r,r)}let o=h.syncIndex;return h.syncIndex+=1,h.didInitialize?(r=h.syncHooks[o]).store===t&&r.selector===e&&Object.is(r.a1,i)&&Object.is(r.a2,s)&&Object.is(r.a3,n)||(r.store!==t&&(h.didChangeStore=!0),r.store=t,r.selector=e,r.a1=i,r.a2=s,r.a3=n,r.value=e(t.getSnapshot(),i,s,n)):(r={store:t,selector:e,a1:i,a2:s,a3:n,value:e(t.getSnapshot(),i,s,n)},h.syncHooks.push(r)),r.value}:function(t,e,i,s,n){return(0,uU.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getSnapshot,t=>e(t,i,s,n))};[].push({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let i=0;i0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{let i=new Set;for(let e of t.syncHooks)i.add(e.store);let s=[];for(let t of i)s.push(t.subscribe(e));return()=>{for(let t of s)t()}}),(0,lw.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getSnapshot))}});class uH{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;let e=this.updateTick;for(let i of this.listeners){if(e!==this.updateTick)return;i(t)}}update(t){for(let e in t)if(!Object.is(this.state[e],t[e]))return void this.setState({...this.state,...t})}set(t,e){Object.is(this.state[t],e)||this.setState({...this.state,[t]:e})}notifyAll(){let t={...this.state};this.setState(t)}use(t,e,i,s){return uQ(this,t,e,i,s)}}class uq extends uH{constructor(t,e={},i){super(t),this.context=e,this.selectors=i}useSyncedValue(t,e){V.useDebugValue(t);let i=this;ou(()=>{i.state[t]!==e&&i.set(t,e)},[i,t,e])}useSyncedValueWithCleanup(t,e){let i=this;ou(()=>(i.state[t]!==e&&i.set(t,e),()=>{i.set(t,void 0)}),[i,t,e])}useSyncedValues(t){let e=this;ou(()=>{e.update(t)},[e,...Object.values(t)])}useControlledProp(t,e){V.useDebugValue(t);let i=this,s=void 0!==e;ou(()=>{s&&!Object.is(i.state[t],e)&&i.setState({...i.state,[t]:e})},[i,t,e,s])}select(t,e,i,s){return(0,this.selectors[t])(this.state,e,i,s)}useState(t,e,i,s){return V.useDebugValue(t),uQ(this,this.selectors[t],e,i,s)}useContextCallback(t,e){V.useDebugValue(t);let i=og(e??oE);this.context[t]=i}useStateSetter(t){let e=V.useRef(void 0);return void 0===e.current&&(e.current=e=>{this.set(t,e)}),e.current}observe(t,e){let i,s=(i="function"==typeof t?t:this.selectors[t])(this.state);return e(s,s,this),this.subscribe(t=>{let n=i(t);if(!Object.is(s,n)){let t=s;s=n,e(n,t,this)}})}}let uY={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class uG extends uq{constructor(t){const{syncOnly:e,nested:i,onOpenChange:s,triggerElements:n,...r}=t;super({...r,positionReference:r.referenceElement,domReferenceElement:r.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:function(){let t=new Map;return{emit(e,i){t.get(e)?.forEach(t=>t(i))},on(e,i){t.has(e)||t.set(e,new Set),t.get(e).add(i)},off(e,i){t.get(e)?.delete(i)}}}(),nested:i,triggerElements:n},uY),this.syncOnly=e}syncOpenEvent=(t,e)=>{let i;t&&this.state.open&&(null==e||"click"!==(i=e.type)&&"mousedown"!==i&&"keydown"!==i&&"keyup"!==i)||(this.context.dataRef.current.openEvent=t?e:void 0)};dispatchOpenChange=(t,e)=>{this.syncOpenEvent(t,e.event);let i={open:t,reason:e.reason,nativeEvent:e.event,nested:this.context.nested,triggerElement:e.trigger};this.context.events.emit("openchange",i)};setOpen=(t,e)=>{this.syncOnly||this.dispatchOpenChange(t,e),this.context.onOpenChange?.(t,e)}}var oX=oX;let uZ={tabIndex:-1,[h3]:""};function uX({handle:t,store:e}){return ou(()=>t.attachStore(e),[t,e]),null}let uJ={...hM,...lj,nestedDialogOpen:t=>t?{"data-nested-dialog-open":""}:null},u0=V.forwardRef(function(t,e){var i;let{render:s,className:n,style:r,finalFocus:o,initialFocus:l,...a}=t,h=hv(),u=h.useState("descriptionElementId"),c=h.useState("disablePointerDismissal"),d=h.useState("floatingRootContext"),f=h.useState("popupProps"),p=h.useState("modal"),m=h.useState("mounted"),g=h.useState("nested"),v=h.useState("nestedOpenDialogCount"),b=h.useState("open"),y=h.useState("openMethod"),x=h.useState("titleElementId"),w=h.useState("transitionStatus"),S=h.useState("role"),M=d.useState("floatingId");uK(),lW({open:b,ref:h.context.popupRef,onComplete(){b&&h.context.onOpenChangeComplete?.(!0)}});let k=void 0===l?(i=h.context.popupRef,t=>"touch"!==t||i.current):l,C=h.useStateSetter("popupElement"),E=oB("div",t,{state:{open:b,nested:g,transitionStatus:w,nestedDialogOpen:v>0},props:[f,{id:M,"aria-labelledby":x,"aria-describedby":u,role:S,...uZ,hidden:!m,onKeyDown(t){lZ.has(t.key)&&t.stopPropagation()},style:{"--nested-dialogs":v}},a],ref:[e,h.context.popupRef,C],stateAttributesMapping:uJ});return(0,I.jsx)(uW,{context:d,openInteractionType:y,disabled:!m,closeOnFocusOut:!c,initialFocus:k,returnFocus:o,modal:!1!==p,restoreFocus:"popup",children:E})}),u1=V.forwardRef(function(t,e){let i,{cutout:s,...n}=t;if(s){let t=s.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${t.left}px ${t.top}px,${t.left}px ${t.bottom}px,${t.right}px ${t.bottom}px,${t.right}px ${t.top}px,${t.left}px ${t.top}px)`}return(0,I.jsx)("div",{ref:e,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})}),u2=V.forwardRef(function(t,e){let{keepMounted:i=!1,...s}=t,n=hv(),r=n.useState("mounted"),o=n.useState("modal"),l=n.useState("open");return r||i?(0,I.jsx)(u$.Provider,{value:i,children:(0,I.jsxs)(uA,{ref:e,...s,children:[r&&!0===o&&(0,I.jsx)(u1,{ref:n.context.internalBackdropRef,inert:l_(!l)}),t.children]})}):null});var h0=h0;let u5={},u3={},u4="";function u6(t,e){return!function(t){let{overflow:e,overflowX:i,overflowY:s,display:n}=lr(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&"inline"!==n&&"contents"!==n}(t)?e:t}function u9(t,e,i){return/hidden|clip/.test(t.getComputedStyle(u6(e,i)).overflowY)}class u7{lockCount=0;restore=null;timeoutLock=hN.create();timeoutUnlock=hN.create();acquire(t){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{0===this.lockCount&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){let e,i,s;if(0===this.lockCount||null!==this.restore)return;let n=o2(t),r=n.documentElement,o=n.body,l=o8(r);if(u9(l,r,o)){let e=new l.MutationObserver(()=>{u9(l,r,o)||(e.disconnect(),this.restore=null,this.lock(t))}),i={attributes:!0};e.observe(r,i),e.observe(o,i),this.restore=()=>e.disconnect();return}let a=h0.os.ios||!function(t){if("u"0}(t);this.restore=a?(s={overflowY:(i=u6((e=o2(t)).documentElement,e.body)).style.overflowY,overflowX:i.style.overflowX},Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}):function(t){let e=o2(t),i=e.documentElement,s=e.body,n=o8(i),r=0,o=0,l=!1,a=lI.create();if(h0.engine.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function h(){let e=n.getComputedStyle(i),a=n.getComputedStyle(s),h=(e.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";r=i.scrollTop,o=i.scrollLeft,u5={scrollbarGutter:i.style.scrollbarGutter,overflowY:i.style.overflowY,overflowX:i.style.overflowX},u4=i.style.scrollBehavior,u3={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};let u=i.scrollHeight>i.clientHeight,c=i.scrollWidth>i.clientWidth,d="scroll"===e.overflowY||"scroll"===a.overflowY,f="scroll"===e.overflowX||"scroll"===a.overflowX,p=Math.max(0,n.innerWidth-s.clientWidth),m=Math.max(0,n.innerHeight-s.clientHeight),g=parseFloat(a.marginTop)+parseFloat(a.marginBottom),v=parseFloat(a.marginLeft)+parseFloat(a.marginRight),b=u6(i,s);if(l=function(t){if(!("u">typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||"u"{a.cancel(),u(),"function"==typeof n.removeEventListener&&c()}}(t)}}let u8=new u7;var h0=h0,oX=oX;function ct(){return!1}function ce({store:t,parentContext:e,isDrawer:i}){var s;let n=t.useState("open"),r=t.useState("disablePointerDismissal"),o=t.useState("modal"),l=t.useState("popupElement"),a=t.useState("floatingRootContext"),[h,u]=V.useState(0),[c,d]=V.useState(0),f=0===h,p=function(t,e={}){let{enabled:i=!0,escapeKey:s=!0,outsidePress:n=!0,outsidePressEvent:r="sloppy",referencePress:o=ct,bubbles:l,externalTree:a}=e,h="rootStore"in t?t.rootStore:t,u=h.useState("open"),c=h.useState("floatingElement"),{dataRef:d}=h.context,f=uD(a),p=og("function"==typeof n?n:()=>!1),m="function"==typeof n?p:n,g=!1!==m,v=og(()=>r),{escapeKey:b,outsidePress:y}={escapeKey:"boolean"==typeof l?l:l?.escapeKey??!1,outsidePress:"boolean"==typeof l?l:l?.outsidePress??!0},x=V.useRef(!1),w=V.useRef(!1),S=V.useRef(!1),M=V.useRef(!1),k=V.useRef(""),C=V.useRef(null),E=hA(),T=hA(),P=og(()=>{T.clear(),d.current.insideReactTree=!1}),R=og(t=>{let e=d.current.floatingContext?.nodeId;return(f?um(f.nodesRef.current,e):[]).some(e=>e.context?.open&&!e.context.dataRef.current[t])}),_=og(t=>h4(t,h.select("floatingElement"))||h4(t,h.select("domReferenceElement"))),L=og(t=>{o()&&h.setOpen(!1,oZ(oX.triggerPress,t.nativeEvent))}),N=og(t=>{if(!u||!i||!s||"Escape"!==t.key||M.current||!b&&R("__escapeKeyBubbles"))return;let e="nativeEvent"in t?t.nativeEvent:t,n=oZ(oX.escapeKey,e);h.setOpen(!1,n),n.isCanceled||t.preventDefault(),b||n.isPropagationAllowed||t.stopPropagation()}),A=og(()=>{d.current.insideReactTree=!0,T.start(0,P)}),j=og(t=>{if(!u||!i||0!==t.button)return;let e=lv(t.nativeEvent);lg(h.select("floatingElement"),e)&&(x.current||(x.current=!0,w.current=!1))}),z=og(t=>{!u||!i||(t.defaultPrevented||t.nativeEvent.defaultPrevented)&&x.current&&(w.current=!0)});V.useEffect(()=>{if(!u||!i)return P;d.current.__escapeKeyBubbles=b,d.current.__outsidePressBubbles=y;let t=new hN,e=new hN;function n(){S.current=!0,e.start(0,()=>{S.current=!1})}function r(){x.current=!1,w.current=!1}function o(){let t=k.current,e=v(),i="function"==typeof e?e():e;return"string"==typeof i?i:i["pen"!==t&&t?t:"mouse"]}function l(t){let e=d.current.floatingContext?.nodeId,i=f&&um(f.nodesRef.current,e).some(e=>h4(t,e.context?.elements.floating));return _(t)||i}function a(t){let i;if("intentional"===(i=o())&&"click"!==t.type||"sloppy"===i&&"click"===t.type){"click"===t.type||_(t)||(e.clear(),S.current=!1),P();return}if(d.current.insideReactTree)return void P();let s=lv(t),n=`[${uv("inert")}]`,r=le(s)?s.getRootNode():null,a=Array.from((ls(r)?r:o2(h.select("floatingElement"))).querySelectorAll(n)),u=h.context.triggerElements;if(s&&(u.hasElement(s)||u.hasMatchingElement(t=>lg(t,s))))return;let c=le(s)?s:null;for(;c&&!ln(c);){let t=function(t){var e;if("html"===o7(t))return t;let i=t.assignedSlot||t.parentNode||ls(t)&&t.host||(null==(e=(lt(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement);return ls(i)?i.host:i}(c);if(ln(t)||!le(t))break;c=t}if(!(a.length&&le(s)&&!s.matches("html,body")&&!lg(s,h.select("floatingElement"))&&a.every(t=>!lg(c,t)))){if(li(s)&&!("touches"in t)){let e=ln(s),i=lr(s),n=/auto|scroll/,r=e||n.test(i.overflowX),o=e||n.test(i.overflowY),l=r&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,a=o&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,h="rtl"===i.direction,u=a&&(h?t.offsetX<=s.offsetWidth-s.clientWidth:t.offsetX>s.clientWidth),c=l&&t.offsetY>s.clientHeight;if(u||c)return}if(!l(t)){if("intentional"===o()&&S.current){e.clear(),S.current=!1;return}"function"==typeof m&&!m(t)||R("__outsidePressBubbles")||(h.setOpen(!1,oZ(oX.outsidePress,t)),P())}}}function p(t){if("sloppy"!==o()||!h.select("open")||!i||_(t))return;let e=t.touches[0];e&&(C.current={startTime:Date.now(),startX:e.clientX,startY:e.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{C.current&&(C.current.dismissOnTouchEnd=!1,C.current.dismissOnMouseDown=!1)}))}function T(t,e){let i=lv(t);if(!i)return;let s=hP(i,t.type,()=>{e(t),s()})}function L(t){E.clear(),"pointerdown"===t.type&&(k.current=t.pointerType),("mousedown"!==t.type||!C.current||C.current.dismissOnMouseDown)&&T(t,t=>{if("pointerdown"===t.type)"sloppy"!==o()||"touch"===t.pointerType||!h.select("open")||!i||_(t)||a(t);else a(t)})}function A(t){if(!x.current)return;let i=w.current;if(r(),"intentional"===o()){if("pointercancel"===t.type){i&&n();return}l(t)||(i?n():("function"!=typeof m||m(t))&&(e.clear(),S.current=!0,P()))}}function j(t){if("sloppy"!==o()||!C.current||_(t))return;let e=t.touches[0];if(!e)return;let i=Math.abs(e.clientX-C.current.startX),s=Math.abs(e.clientY-C.current.startY),n=Math.sqrt(i*i+s*s);n>5&&(C.current.dismissOnTouchEnd=!0),n>10&&(a(t),E.clear(),C.current=null)}function z(t){"sloppy"!==o()||!C.current||_(t)||(C.current.dismissOnTouchEnd&&a(t),E.clear(),C.current=null)}let D=o2(c),O=hR(s&&hR(hP(D,"keydown",N),hP(D,"compositionstart",function(){t.clear(),M.current=!0}),hP(D,"compositionend",function(){t.start(5*!!h0.engine.webkit,()=>{M.current=!1})})),g&&hR(hP(D,"click",L,!0),hP(D,"pointerdown",L,!0),hP(D,"pointerup",A,!0),hP(D,"pointercancel",A,!0),hP(D,"mousedown",L,!0),hP(D,"mouseup",A,!0),hP(D,"touchstart",function(t){k.current="touch",T(t,p)},!0),hP(D,"touchmove",function(t){T(t,j)},!0),hP(D,"touchend",function(t){T(t,z)},!0)));return()=>{O(),t.clear(),e.clear(),r(),S.current=!1,P()}},[d,c,s,g,m,u,i,b,y,N,P,v,R,_,f,h,E]);let D=V.useMemo(()=>({onKeyDown:N,onPointerDown:L,onClick:L}),[N,L]),O=V.useMemo(()=>({onKeyDown:N,onPointerDown:z,onMouseDown:z,onClickCapture:A,onMouseDownCapture(t){A(),j(t)},onPointerDownCapture(t){A(),j(t)},onMouseUpCapture:A,onTouchEndCapture:A,onTouchMoveCapture:A}),[N,A,j,z]);return V.useMemo(()=>i?{reference:D,floating:O,trigger:D}:{},[i,D,O])}(a,{outsidePressEvent:()=>t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:"trap-focus"===o?"sloppy":"intentional",touch:"sloppy"},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||"button"in e&&0!==e.button)return!1;if("touches"in e){if("touchend"===e.type){if(1!==e.changedTouches.length||0!==e.touches.length)return!1}else if(1!==e.touches.length)return!1}let i=lv(e);if(f&&!r){if(o){let e=t.context.internalBackdropRef.current,s=t.context.backdropRef.current;return!e&&!s||e===i||s===i||lg(i,l)&&!i?.hasAttribute("data-base-ui-portal")}return!0}return!1},escapeKey:f});return!function(t=!0,e=null){ou(()=>{if(t)return u8.acquire(e)},[t,e])}(n&&!0===o,l),t.useContextCallback("onNestedDialogOpen",(t,e)=>{u(t),d(e)}),ou(()=>(e?.onNestedDialogOpen&&(n?e.onNestedDialogOpen(h+1,c+ +!!i):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&n&&e.onNestedDialogOpen(0,0)}),[i,n,h,c,e]),s={activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:h,nestedOpenDrawerCount:c},t.useSyncedValues(s),ou(()=>()=>{t.update({activeTriggerProps:oP,inactiveTriggerProps:oP,popupProps:oP})},[t]),null}class ci extends uq{setState(t){}update(t){}set(t,e){}notifyAll(){}}class cs{constructor(){this.idMap=new Map}add(t,e){this.idMap.set(t,e)}delete(t){this.idMap.delete(t)}hasElement(t){for(let e of this.idMap.values())if(e===t)return!0;return!1}hasMatchingElement(t){for(let e of this.idMap.values())if(t(e))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}let cn=t=>t.triggerIdProp??t.activeTriggerId,cr=t=>t.openProp??t.open,co=t=>(t.popupElement?.id??t.floatingId)||void 0;function cl(t,e){return void 0!==e&&cr(t)&&cn(t)===e}let ca={open:cr,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:cn,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:co,isTriggerActive:(t,e)=>void 0!==e&&cn(t)===e,isOpenedByTrigger:(t,e)=>cl(t,e),isMountedByTrigger:(t,e)=>void 0!==e&&cn(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>cl(t,e)||void 0!==e&&cr(t)&&null==cn(t)&&1===t.triggerCount?co(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class ch extends uq{constructor(t,e,i){const s=new cs;super(cu(t,s,e,i),cc(s),ca)}setOpen=(t,e)=>{if(e.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},t||null!=e.trigger||null==this.state.activeTriggerId||(e.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,e),e.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,e);let i={open:t};!function(t,e,i,s=!1){e?t.preventUnmountingOnClose=!1:s&&(t.preventUnmountingOnClose=!0);let n=i?.id??null;(n||e)&&(t.activeTriggerId=n,t.activeTriggerElement=i??null)}(i,t,e.trigger),this.update(i)}}function cu(t,e,i,s=!1){let n={...{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new uG({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new cs,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0}),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:oP,inactiveTriggerProps:oP,popupProps:oP},modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t};return n.floatingRootContext=function(t,e,i=!1){return new uG({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:i,onOpenChange:void 0})}(e,i,s),n}function cc(t){return{popupRef:V.createRef(),backdropRef:V.createRef(),internalBackdropRef:V.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}var oX=oX;let cd=V.forwardRef(function(t,e){let{render:i,className:s,style:n,children:r,...o}=t,l=uK(),a=hv(),h=a.useState("open"),u=a.useState("nested"),c=a.useState("transitionStatus"),d=a.useState("nestedOpenDialogCount"),f=a.useState("mounted");return oB("div",t,{enabled:l||f,state:{open:h,nested:u,transitionStatus:c,nestedDialogOpen:d>0},ref:[e,a.useStateSetter("viewportElement")],stateAttributesMapping:uJ,props:[{role:"presentation",hidden:!f,style:{pointerEvents:h?void 0:"none"},children:r},o]})}),cf=V.forwardRef(function(t,e){let{render:i,className:s,style:n,id:r,...o}=t,l=hv(),a=o6(r);return l.useSyncedValueWithCleanup("titleElementId",a),oB("h2",t,{ref:e,props:[{id:a},o]})});var oX=oX,h0=h0;let cp=V.forwardRef(function(t,e){var i;let s,n,r,o,l,a,h,u,{render:c,className:d,style:f,disabled:p=!1,nativeButton:m=!0,id:g,payload:v,handle:b,...y}=t,x=hv(!0),w=(s=V.useCallback(t=>void 0===b?oE:b.subscribeStore(t),[b]),n=V.useCallback(()=>void 0===b?void 0:b.store,[b]),(0,lw.useSyncExternalStore)(s,n,()=>b?.serverStore)??x);if(!w)throw Error(oy(79));let S=o6(g),M=w.useState("floatingRootContext"),k=w.useState("isOpenedByTrigger",S),C=w.useState("triggerPopupId",S),E=V.useRef(null),{registerTrigger:T,isMountedByThisTrigger:P}=(i={payload:v},r=w.useState("isMountedByTrigger",S),o=V.useRef(null),l=V.useRef(null),a=V.useCallback(t=>{if(void 0===S)return;let e=!1;if(null!==o.current){let t=o.current,i=l.current,s=w.context.triggerElements.getById(t);i&&s===i&&(w.context.triggerElements.delete(t),e=!0),o.current=null,l.current=null}if(null!==t&&(o.current=S,l.current=t,w.context.triggerElements.add(S,t),e=!0),e){let t=w.context.triggerElements.size;w.select("open")&&w.state.triggerCount!==t&&w.set("triggerCount",t)}},[w,S]),h=og(t=>{let e=w.select("open"),s=w.select("activeTriggerId");s===S?w.update({activeTriggerElement:t,...e?i:null}):null==s&&e&&w.update({activeTriggerId:S,activeTriggerElement:t,...i})}),u=V.useCallback(t=>{a(t),t&&h(t)},[a,h]),ou(()=>{r&&w.update({activeTriggerElement:E.current,...i})},[r,w,E,...Object.values(i)]),{registerTrigger:u,isMountedByThisTrigger:r}),{getButtonProps:R,buttonRef:_}=lh({disabled:p,native:m}),L=function(t,e={}){let{enabled:i=!0,event:s="click",toggle:n=!0,ignoreMouse:r=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:a=oX.triggerPress}=e,h="rootStore"in t?t.rootStore:t,u=h.context.dataRef,c=V.useRef(void 0),d=lV(),f=hA(),p=V.useMemo(()=>{function t(t,e,i,s){let n=oZ(a,e,i);t&&"touch"===s&&l>0?f.start(l,()=>{h.setOpen(!0,n)}):h.setOpen(t,n)}function e(t,e,i){let s=u.current.openEvent,r=h.select("domReferenceElement")!==e;return!!t&&!!r||!t||!n||!!s&&!!o&&!i(s.type)}return{onPointerDown(t){c.current=ut(t.pointerType,!0)&&h8(t.nativeEvent)?"virtual":t.pointerType},onMouseDown(i){let n=c.current,o=i.nativeEvent,l=h.select("open");if(0!==i.button||"click"===s||ut(n,!0)&&r)return;let a=e(l,i.currentTarget,t=>"click"===t||"mousedown"===t),u=lv(o);if(h6(u))return void t(a,o,u,n);let f=i.currentTarget;d.request(()=>{t(a,o,f,n)})},onClick(i){if("mousedown-only"===s)return;let n=c.current;if("mousedown"===s&&n){c.current=void 0;return}ut(n,!0)&&r||t(e(h.select("open"),i.currentTarget,t=>"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t),i.nativeEvent,i.currentTarget,n)},onKeyDown(){c.current=void 0}}},[u,s,r,a,h,o,n,d,f,l]);return V.useMemo(()=>i?{reference:p}:oP,[i,p])}(M),N=function(t,e){var i;let s,n,{onClick:r,onPointerDown:o}=(i=og((i,s)=>{("function"==typeof t?t():t)||e(s||(h0.os.ios?"touch":""))}),s=V.useRef(""),n=V.useCallback(t=>{t.defaultPrevented||(s.current=t.pointerType,i(t,t.pointerType))},[i]),{onClick:V.useCallback(t=>{0===t.detail?i(t,"keyboard"):("pointerType"in t?i(t,t.pointerType):i(t,s.current),s.current="")},[i]),onPointerDown:n});return V.useMemo(()=>({onClick:r,onPointerDown:o}),[r,o])}(()=>w.select("open"),t=>{w.set("openMethod",t)}),A=w.useState("triggerProps",P);return oB("button",t,{state:{disabled:p,open:k},ref:[_,e,T,E],props:[L.reference,A,N,{[uR]:"",id:S,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":C},y,R],stateAttributesMapping:hS})});var oX=oX,oX=oX;class cm{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(t,e,i=!0){this.fallbackStore=t,this.componentName=e,this.throwOnMissingTrigger=i}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(t){return this.storeListeners.add(t),()=>{this.storeListeners.delete(t)}}attachStore(t){return this.attachedStores.push(t),this.setActiveStore(t),()=>{let e=this.attachedStores.lastIndexOf(t);-1!==e&&this.attachedStores.splice(e,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(t){this.attachedStoreValue!==t&&(this.attachedStoreValue=t,this.storeListeners.forEach(t=>{t()}))}openByTrigger(t){let e,i=this.attachedStore;if(null!==i){if(t){for(let i=this.attachedStores.length-1;i>=0&&!e;i-=1)e=this.attachedStores[i].context.triggerElements.getById(t);e??=this.fallbackStore.context.triggerElements.getById(t)}if(t&&!e&&this.throwOnMissingTrigger)throw Error(oy(99,this.componentName,t,this.componentName));i.setOpen(!0,oZ(oX.imperativeAction,void 0,e))}}closePopup(){let t=this.attachedStore;null===t||t.setOpen(!1,oZ(oX.imperativeAction))}}class cg extends cm{constructor(){super(function(){let t=new cs;return new ci(Object.freeze(cu(void 0,t)),Object.freeze(cc(t)),ca)}(),"Dialog",!1)}open(t){this.openByTrigger(t)}openWithPayload(t){let e=this.attachedStore;null===e||(e.set("payload",t),e.setOpen(!0,oZ(oX.imperativeAction)))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}t.s(["Backdrop",0,hC,"Close",0,hE,"Description",0,hT,"Handle",0,cg,"Popup",0,u0,"Portal",0,u2,"Root",0,function(t){return function(t,e){var i;let{children:s,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:l,disablePointerDismissal:a=!1,modal:h=!0,actionsRef:u,handle:c,triggerId:d,defaultTriggerId:f=null}=e,p="alert-dialog"===t,m=hv(!0),g={modal:!!p||h,disablePointerDismissal:p||a,nested:null!=m,role:p?"alertdialog":"dialog"},v=function(t,e=!1){let i=o4(),s=null!=(V.useContext(uj)?.id||null),n=of(()=>t(i,s)).current;return!function(t){let{popupStore:e,treatPopupAsFloatingElement:i=!1,floatingRootContext:s,floatingId:n,nested:r,onOpenChange:o}=t,l=e.useState("open"),a=e.useState("activeTriggerElement"),h=e.useState(i?"popupElement":"positionerElement"),u=e.context.triggerElements,c=V.useRef(null);void 0===s&&null===c.current&&(c.current=new uG({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:h,triggerElements:u,onOpenChange:o,floatingId:n,syncOnly:!0,nested:r}));let d=s??c.current;e.useSyncedValue("floatingId",n),ou(()=>{let t={open:l,floatingId:n,referenceElement:a,floatingElement:h};le(a)&&(t.domReferenceElement=a),d.state.positionReference===d.state.referenceElement&&(t.positionReference=a),d.update(t)},[l,n,a,h,d]),d.context.onOpenChange=o,d.context.nested=r}({popupStore:n,treatPopupAsFloatingElement:e,floatingRootContext:n.state.floatingRootContext,floatingId:i,nested:s,onOpenChange:n.setOpen}),n}((t,e)=>new ch({open:r,openProp:n,activeTriggerId:f,triggerIdProp:d,...g},t,e),!0);v.useControlledProp("openProp",n),v.useControlledProp("triggerIdProp",d),v.useSyncedValues(g),v.useContextCallback("onOpenChange",o),v.useContextCallback("onOpenChangeComplete",l);let b=v.useState("open"),y=v.useState("mounted"),x=v.useState("payload");ou(()=>{i||null===v.state.openMethod||v.set("openMethod",null)},[i=b,v]),ou(()=>()=>{null!==v.state.openMethod&&v.set("openMethod",null)},[v]),function(t,e={}){let{closeOnActiveTriggerUnmount:i=!1}=e,s=V.useRef(null),n=t.useState("open"),r=t.useState("triggerCount"),o=t.useState("activeTriggerId"),l=t.useState("activeTriggerElement");ou(()=>{if(!n){s.current=null,0!==t.state.triggerCount&&t.set("triggerCount",0);return}let e=t.context.triggerElements.size,r={};t.state.triggerCount!==e&&(r.triggerCount=e);let o=t.select("activeTriggerId"),l=null;if(o){let e=t.context.triggerElements.getById(o);if(e)s.current=o,e!==t.state.activeTriggerElement&&(r.activeTriggerElement=e);else{for(let[e,i]of t.context.triggerElements.entries())if(i===t.state.activeTriggerElement){r.activeTriggerId=e,r.activeTriggerElement=i,s.current=e;break}void 0===r.activeTriggerId&&(s.current===o?l=o:s.current=null)}}else s.current=null;if(!l&&!o&&1===e){let e=t.context.triggerElements.entries().next();if(!e.done){let[t,i]=e.value;r.activeTriggerId=t,r.activeTriggerElement=i,s.current=t}}(void 0!==r.triggerCount||void 0!==r.activeTriggerId||void 0!==r.activeTriggerElement)&&t.update(r),l&&i&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===l&&!t.context.triggerElements.getById(l)){let e=oZ(oX.none);t.setOpen(!1,e),e.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[n,t,r,o,l,i])}(v);let{forceUnmount:w}=function(t,e){let{mounted:i,setMounted:s,transitionStatus:n}=l$(t),r=e.useState("preventUnmountingOnClose"),o=!t&&r;e.useSyncedValues({mounted:i,transitionStatus:n,preventUnmountingOnClose:o});let l=og(()=>{s(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),e.context.onOpenChangeComplete?.(!1)});return lW({enabled:i&&!t&&!o,open:t,ref:e.context.popupRef,onComplete(){t||l()}}),{forceUnmount:l,transitionStatus:n}}(b,v);V.useImperativeHandle(u,()=>({unmount:w,close:()=>v.setOpen(!1,oZ(oX.imperativeAction))}),[w,v]);let S=b||y;return(0,I.jsxs)(hg.Provider,{value:v,children:[c&&(0,I.jsx)(uX,{handle:c,store:v}),S&&(0,I.jsx)(ce,{store:v,parentContext:m?.context,isDrawer:"drawer"===t}),"function"==typeof s?s({payload:x}):s]})}("dialog",t)},"Title",0,cf,"Trigger",0,cp,"Viewport",0,cd,"createHandle",0,function(){return new cg}],28376);var cv=t.i(28376),cv=cv;let cb=(...t)=>t.filter((t,e,i)=>!!t&&""!==t.trim()&&i.indexOf(t)===e).join(" ").trim(),cy=t=>{let e=t.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,e,i)=>i?i.toUpperCase():e.toLowerCase());return e.charAt(0).toUpperCase()+e.slice(1)};var cx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let cw=(0,V.createContext)({}),cS=(0,V.forwardRef)(({color:t,size:e,strokeWidth:i,absoluteStrokeWidth:s,className:n="",children:r,iconNode:o,...l},a)=>{let{size:h=24,strokeWidth:u=2,absoluteStrokeWidth:c=!1,color:d="currentColor",className:f=""}=(0,V.useContext)(cw)??{},p=s??c?24*Number(i??u)/Number(e??h):i??u;return(0,V.createElement)("svg",{ref:a,...cx,width:e??h??cx.width,height:e??h??cx.height,stroke:t??d,strokeWidth:p,className:cb("lucide",f,n),...!r&&!(t=>{for(let e in t)if(e.startsWith("aria-")||"role"===e||"title"===e)return!0;return!1})(l)&&{"aria-hidden":"true"},...l},[...o.map(([t,e])=>(0,V.createElement)(t,e)),...Array.isArray(r)?r:[r]])}),cM=(t,e)=>{let i=(0,V.forwardRef)(({className:i,...s},n)=>(0,V.createElement)(cS,{ref:n,iconNode:e,className:cb(`lucide-${cy(t).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,i),...s}));return i.displayName=cy(t),i},ck=cM("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function cC({...t}){return(0,I.jsx)(cv.Root,{"data-slot":"sheet",...t})}function cE({...t}){return(0,I.jsx)(cv.Portal,{"data-slot":"sheet-portal",...t})}function cT({className:t,...e}){return(0,I.jsx)(cv.Backdrop,{"data-slot":"sheet-overlay",className:ho("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",t),...e})}function cP({className:t,children:e,side:i="right",showCloseButton:s=!0,...n}){return(0,I.jsxs)(cE,{children:[(0,I.jsx)(cT,{}),(0,I.jsxs)(cv.Popup,{"data-slot":"sheet-content","data-side":i,className:ho("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...n,children:[e,s&&(0,I.jsxs)(cv.Close,{"data-slot":"sheet-close",render:(0,I.jsx)(hm,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,I.jsx)(ck,{}),(0,I.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function cR({className:t,...e}){return(0,I.jsx)("div",{"data-slot":"sheet-header",className:ho("flex flex-col gap-0.5 p-4",t),...e})}function c_({className:t,...e}){return(0,I.jsx)(cv.Title,{"data-slot":"sheet-title",className:ho("font-heading text-base font-medium text-foreground",t),...e})}t.s([],58842),t.i(58842);var oX=oX;let cL=V.createContext(void 0);function cN(){let t=V.useContext(cL);if(void 0===t)throw Error(oy(15));return t}let cA=((p={}).open="data-open",p.closed="data-closed",p[p.startingStyle=lL.startingStyle]="startingStyle",p[p.endingStyle=lL.endingStyle]="endingStyle",p),cj=((m={}).panelOpen="data-panel-open",m),cz={[cA.open]:""},cD={[cA.closed]:""},cO={open:t=>t?cz:cD,...lj},cI=V.forwardRef(function(t,e){let{render:i,className:s,defaultOpen:n=!1,disabled:r=!1,onOpenChange:o,open:l,style:a,...h}=t,u=og(o),c=function(t){let{open:e,defaultOpen:i,onOpenChange:s,disabled:n}=t,[r,o]=oh({controlled:e,default:i,name:"Collapsible",state:"open"}),{mounted:l,setMounted:a,transitionStatus:h}=l$(r,!0,!0),u=o6(),[c,d]=V.useState(),f=null===c?void 0:c??u,p=og(t=>{let e=!r,i=oZ(oX.triggerPress,t.nativeEvent);s(e,i),i.isCanceled||o(e)});return V.useMemo(()=>({defaultPanelId:u,disabled:n,handleTrigger:p,mounted:l,open:r,panelId:f,setMounted:a,setOpen:o,setPanelIdState:d,transitionStatus:h}),[u,n,p,l,r,f,a,o,d,h])}({open:l,defaultOpen:n,onOpenChange:u,disabled:r}),d=V.useMemo(()=>({open:c.open,disabled:c.disabled,transitionStatus:c.transitionStatus}),[c.open,c.disabled,c.transitionStatus]),f=V.useMemo(()=>({...c,onOpenChange:u,state:d}),[c,u,d]),p=oB("div",t,{state:d,ref:e,props:h,stateAttributesMapping:cO});return(0,I.jsx)(cL.Provider,{value:f,children:p})}),cV={open:t=>t?{[cj.panelOpen]:""}:null,...lj},cF=V.forwardRef(function(t,e){let{panelId:i,open:s,handleTrigger:n,state:r,disabled:o}=cN(),{className:l,disabled:a=o,render:h,nativeButton:u=!0,style:c,...d}=t,{getButtonProps:f,buttonRef:p}=lh({disabled:a,focusableWhenDisabled:!0,native:u});return oB("button",t,{state:r,ref:[e,p],props:[{"aria-controls":s?i:void 0,"aria-expanded":s,onClick:n},d,f],stateAttributesMapping:cV})});var oX=oX;let cB={height:void 0,width:void 0};function cW(t){return{height:t.scrollHeight,width:t.scrollWidth}}function c$(t){return t.split(",").map(t=>t.trim()).some(t=>""!==t&&Number.parseFloat(t)>0)}function cK(t,e,i){let s=t.style.getPropertyValue(e),n=t.style.getPropertyPriority(e);return t.style.setProperty(e,i),()=>{""===s?t.style.removeProperty(e):t.style.setProperty(e,s,n)}}let cU=((g={}).collapsiblePanelHeight="--collapsible-panel-height",g.collapsiblePanelWidth="--collapsible-panel-width",g),cQ=V.forwardRef(function(t,e){let{className:i,hiddenUntilFound:s,keepMounted:n,render:r,id:o,style:l,...a}=t,{defaultPanelId:h,mounted:u,onOpenChange:c,open:d,setMounted:f,setPanelIdState:p,setOpen:m,state:g,transitionStatus:v}=cN(),b=o||void 0,y=b??h;ou(()=>(p(t=>b??(null===t?void 0:t)),()=>{p(t=>t===b?null:t)}),[b,p]);let{height:x,props:w,ref:S,shouldPreventOpenAnimation:M,shouldRender:k,transitionStatus:C,width:E}=function(t){let{externalRef:e,hiddenUntilFound:i,id:s,keepMounted:n,mounted:r,onOpenChange:o,open:l,setMounted:a,setOpen:h,transitionStatus:u}=t,c=V.useRef(null),d=V.useRef(null),[f,p]=V.useState(cB),m=V.useRef(cB),g=V.useRef(!1),v=V.useRef(l),b=V.useRef(!1),[y,x]=V.useState(!1),w=V.useRef(null),S=ox(e,c),M=h_(l),k=lB(c),C=!l&&!r,E=y?"idle":u,T=l&&(v.current||b.current),P=!l&&r&&"css-animation"===d.current&&void 0===f.height&&void 0===f.width?m.current:f,R=i&&C&&"css-animation"!==d.current,_=og((t,e=!0)=>{e&&(m.current=t),p(t)}),L=og(()=>{w.current?.(),w.current=null}),N=og(t=>{L(),w.current=()=>{w.current=null,t()}}),A=og(()=>{l&&r&&"css-animation"===d.current&&(b.current=!0)});ou(()=>{y&&"starting"!==u&&x(!1)},[y,u]),V.useEffect(()=>()=>{A(),L()},[A,L]),ou(()=>{var t,e;let i,s,n,o=c.current;if(!o)return;!l&&w.current&&L();let h=(t=o,e=T,s=((i=o8(t).getComputedStyle(t)).animationName.split(",").map(t=>t.trim()).some(t=>""!==t&&"none"!==t)||e)&&c$(i.animationDuration),n=c$(i.transitionDuration),s&&n||n?"css-transition":s?"css-animation":"none");if(d.current=h,l&&"idle"===u&&v.current&&"css-animation"===h){m.current=cW(o);return}if(l&&"starting"===u){let t=g.current;if(g.current=!1,"none"===h){_(cW(o)),x(!0);return}if("css-transition"===h){let e=function(t){let e={"justify-content":t.style.justifyContent,"align-items":t.style.alignItems,"align-content":t.style.alignContent,"justify-items":t.style.justifyItems};function i(){Object.entries(e).forEach(([e,i])=>{""===i?t.style.removeProperty(e):t.style.setProperty(e,i)})}Object.keys(e).forEach(e=>{t.style.setProperty(e,"initial","important")});let s=lI.request(i);return()=>{lI.cancel(s),i()}}(o);return _(cW(o)),t&&(N(cK(o,"transition-duration","0s")),x(!0)),e}_(cW(o));let e=cK(o,"animation-name","none");if(!t)return void e();let i=cK(o,"animation-duration","0s");return e(),N(i),void x(!0)}if(!l&&r&&("idle"===u||"starting"===u)){if(v.current=!1,b.current=!1,"none"===h){_(cB,!1),a(!1);return}_(cW(o));return}if("ending"!==u)return;if("none"===h)return void a(!1);let f=cW(o);f.height>0||f.width>0?(_(f),"css-animation"===h&&cK(o,"animation-name","none")()):a(!1)},[r,l,L,_,a,N,T,u]),lW({enabled:l&&r&&"idle"===E,open:!0,ref:c,onComplete(){l&&_(cB,!1)}}),V.useEffect(()=>{if(l||!r||"ending"!==E||!c.current)return;let t=new AbortController,e=-1;function i(){M.current||(a(!1),_(cB,!1))}return e=lI.request(()=>{k(i,t.signal)}),()=>{lI.cancel(e),t.abort()}},[M,r,l,E,k,_,a]),ou(()=>{let t=c.current;t&&i&&C&&t.setAttribute("hidden","until-found")},[C,i]),V.useEffect(function(){let t=c.current;if(t)return hP(t,"beforematch",function(t){let e=oZ(oX.none,t);o(!0,e),e.isCanceled||(g.current=!0,h(!0))})},[o,h]);let j=n||i||r||l;return{height:P.height,props:{...R?{[cA.startingStyle]:""}:void 0,hidden:C,id:s},ref:S,shouldPreventOpenAnimation:T,shouldRender:j,transitionStatus:E,width:P.width}}({externalRef:e,hiddenUntilFound:s??!1,id:y,keepMounted:n??!1,mounted:u,onOpenChange:c,open:d,setMounted:f,setOpen:m,transitionStatus:v}),T={...g,transitionStatus:C},P=oR(l,T),R=oB("div",{...t,style:void 0},{state:T,ref:S,props:[w,{style:{[cU.collapsiblePanelHeight]:void 0===x?"auto":`${x}px`,[cU.collapsiblePanelWidth]:void 0===E?"auto":`${E}px`}},a,P?{style:P}:void 0,M?{style:{animationName:"none"}}:void 0],stateAttributesMapping:cO});return k?R:null});t.s(["Panel",0,cQ,"Root",0,cI,"Trigger",0,cF],96315);var cH=t.i(96315),cH=cH;function cq({...t}){return(0,I.jsx)(cH.Root,{"data-slot":"collapsible",...t})}function cY({...t}){return(0,I.jsx)(cH.Trigger,{"data-slot":"collapsible-trigger",...t})}function cG({...t}){return(0,I.jsx)(cH.Panel,{"data-slot":"collapsible-content",...t})}let cZ=cM("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),cX=cM("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),cJ=cM("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),c0=cM("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),c1=cM("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);function c2({className:t,size:e="default",...i}){return(0,I.jsx)("div",{"data-slot":"card","data-size":e,className:ho("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...i})}let c5=cM("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),c3=cM("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]);function c4({name:t,strategy:e,tab:i,onClick:s,badge:n,stats:r,pnlPct:o,status:l}){if(e){let i=e.allocation+(e.pnl??0),n=i>=e.allocation,r=e.pnl??0,o=e.pnl_pct??0;return(0,I.jsxs)(c2,{className:"p-4 cursor-pointer hover:border-primary/50 hover:shadow-md transition-all duration-200 hover:-translate-y-0.5 border-border",onClick:s,children:[(0,I.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("p",{className:"text-xs font-semibold leading-tight",children:t}),(0,I.jsxs)("p",{className:"text-[9px] text-muted-foreground mt-0.5",children:["$",e.allocation," · ",e.type]})]}),(0,I.jsxs)("div",{className:"flex gap-1",children:[(0,I.jsx)(hd,{variant:"running"===e.status?"default":"secondary",className:"text-[8px] h-4 px-1.5",children:e.status?.toUpperCase()}),(0,I.jsx)(hd,{variant:"outline",className:"text-[8px] h-4 px-1.5 border-border",children:e.fee_model?.toUpperCase()})]})]}),(0,I.jsxs)("div",{className:`text-xl font-mono font-bold mb-2 flex items-center gap-1 ${n?"text-green-500":"text-red-500"}`,children:[n?(0,I.jsx)(c5,{className:"w-4 h-4"}):(0,I.jsx)(c3,{className:"w-4 h-4"}),"$",i.toFixed(2)]}),(0,I.jsxs)("div",{className:"flex gap-3 text-[9px] text-muted-foreground flex-wrap",children:[(0,I.jsxs)("span",{children:["PnL: ",(0,I.jsxs)("b",{className:o>=0?"text-green-500":"text-red-500",children:[r>=0?"+":"",r.toFixed(2)," (",o>=0?"+":"",o.toFixed(2),"%)"]})]}),(0,I.jsxs)("span",{children:["Trades: ",(0,I.jsx)("b",{children:e.trades_today??0})]}),(0,I.jsxs)("span",{children:["Win: ",(0,I.jsxs)("b",{children:[Math.round((e.win_rate??0)*100),"%"]})]}),(0,I.jsxs)("span",{children:["Pos: ",(0,I.jsx)("b",{children:(e.position??0).toFixed(4)})]})]}),(0,I.jsxs)("div",{className:"mt-2 pt-2 border-t border-border/50 text-[9px] text-muted-foreground leading-relaxed",children:[(0,I.jsx)("b",{children:"Alloc:"})," $",e.allocation," · ",(0,I.jsx)("b",{children:"Max pos:"})," ",e.max_position??"—"," · ",(0,I.jsx)("b",{children:"Stop:"})," ",e.stop_loss??"—"]})]})}return(0,I.jsxs)(c2,{className:"p-4 cursor-pointer hover:border-primary/50 hover:shadow-md transition-all duration-200 hover:-translate-y-0.5 border-border",onClick:s,children:[(0,I.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("p",{className:"text-xs font-semibold leading-tight",children:t}),(0,I.jsx)("p",{className:"text-[9px] text-muted-foreground mt-0.5",children:n??"Backtest"})]}),(0,I.jsx)(hd,{variant:"secondary",className:"text-[8px] h-4 px-1.5",children:l??"BACKTEST"})]}),(0,I.jsxs)("div",{className:`text-xl font-mono font-bold mb-2 flex items-center gap-1 ${(o??0)>=0?"text-green-500":"text-red-500"}`,children:[(o??0)>=0?(0,I.jsx)(c5,{className:"w-4 h-4"}):(0,I.jsx)(c3,{className:"w-4 h-4"}),(o??0)>=0?"+":"",(o??0).toFixed(2),"%"]}),r&&(0,I.jsx)("div",{className:"flex gap-3 text-[9px] text-muted-foreground flex-wrap",children:r.map(t=>(0,I.jsxs)("span",{children:[t.label,": ",(0,I.jsx)("b",{className:t.negative?"text-red-500":"",children:t.value})]},t.label))})]})}function c6(t){var e=t.width,i=t.height;if(e<0)throw Error("Negative width is not allowed for Size");if(i<0)throw Error("Negative height is not allowed for Size");return{width:e,height:i}}function c9(t,e){return t.width===e.width&&t.height===e.height}var c7=function(){function t(t){var e=this;this._resolutionListener=function(){return e._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return t.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(t.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),t.prototype.subscribe=function(t){var e=this,i={next:t};return this._observers.push(i),{unsubscribe:function(){e._observers=e._observers.filter(function(t){return t!==i})}}},t.prototype._installResolutionListener=function(){if(null!==this._resolutionMediaQueryList)throw 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)},t.prototype._uninstallResolutionListener=function(){null!==this._resolutionMediaQueryList&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},t.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},t.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach(function(e){return e.next(t._window.devicePixelRatio)}),this._reinstallResolutionListener()},t}(),c8=function(){function t(t,e,i){var s;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=c6({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=null!=e?e:function(t){return t},this._allowResizeObserver=null==(s=null==i?void 0:i.allowResizeObserver)||s,this._chooseAndInitObserver()}return t.prototype.dispose=function(){var t,e;if(null===this._canvasElement)throw Error("Object is disposed");null==(t=this._canvasElementResizeObserver)||t.disconnect(),this._canvasElementResizeObserver=null,null==(e=this._devicePixelRatioObservable)||e.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(t.prototype,"canvasElement",{get:function(){if(null===this._canvasElement)throw Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bitmapSize",{get:function(){return c6({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),t.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=c6(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},t.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},t.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(e){return e!==t})},Object.defineProperty(t.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),t.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},t.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(e){return e!==t})},t.prototype.applySuggestedBitmapSize=function(){if(null!==this._suggestedBitmapSize){var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)}},t.prototype._resizeBitmap=function(t){var e=this.bitmapSize;c9(e,t)||(this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(e,t))},t.prototype._emitBitmapSizeChanged=function(t,e){var i=this;this._bitmapSizeChangedListeners.forEach(function(s){return s.call(i,t,e)})},t.prototype._suggestNewBitmapSize=function(t){var e=this._suggestedBitmapSize,i=c6(this._transformBitmapSize(t,this._canvasElementClientSize)),s=c9(this.bitmapSize,i)?null:i;null===e&&null===s||null!==e&&null!==s&&c9(e,s)||(this._suggestedBitmapSize=s,this._emitSuggestedBitmapSizeChanged(e,s))},t.prototype._emitSuggestedBitmapSizeChanged=function(t,e){var i=this;this._suggestedBitmapSizeChangedListeners.forEach(function(s){return s.call(i,t,e)})},t.prototype._chooseAndInitObserver=function(){var t=this;this._allowResizeObserver?new Promise(function(t){var e=new ResizeObserver(function(i){t(i.every(function(t){return"devicePixelContentBoxSize"in t})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1}).then(function(e){return e?t._initResizeObserver():t._initDevicePixelRatioObservable()}):this._initDevicePixelRatioObservable()},t.prototype._initDevicePixelRatioObservable=function(){var t=this;if(null!==this._canvasElement){var e=dt(this._canvasElement);if(null===e)throw Error("No window is associated with the canvas");this._devicePixelRatioObservable=new c7(e),this._devicePixelRatioObservable.subscribe(function(){return t._invalidateBitmapSize()}),this._invalidateBitmapSize()}},t.prototype._invalidateBitmapSize=function(){if(null!==this._canvasElement){var t,e,i=dt(this._canvasElement);if(null!==i){var s,n,r=null!=(e=null==(t=this._devicePixelRatioObservable)?void 0:t.value)?e:i.devicePixelRatio,o=this._canvasElement.getClientRects(),l=void 0!==o[0]?(s=o[0],n=r,c6({width:Math.round(s.left*n+s.width*n)-Math.round(s.left*n),height:Math.round(s.top*n+s.height*n)-Math.round(s.top*n)})):c6({width:this._canvasElementClientSize.width*r,height:this._canvasElementClientSize.height*r});this._suggestNewBitmapSize(l)}}},t.prototype._initResizeObserver=function(){var t=this;null!==this._canvasElement&&(this._canvasElementResizeObserver=new ResizeObserver(function(e){var i=e.find(function(e){return e.target===t._canvasElement});if(i&&i.devicePixelContentBoxSize&&i.devicePixelContentBoxSize[0]){var s=i.devicePixelContentBoxSize[0],n=c6({width:s.inlineSize,height:s.blockSize});t._suggestNewBitmapSize(n)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},t}();function dt(t){return t.ownerDocument.defaultView}var de=function(){function t(t,e,i){if(0===e.width||0===e.height)throw TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=e,0===i.width||0===i.height)throw TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=i,this._context=t}return t.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()}},t.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(t.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),t}();function di(t,e){var i=t.canvasElementClientSize;if(0===i.width||0===i.height)return null;var s=t.bitmapSize;if(0===s.width||0===s.height)return null;var n=t.canvasElement.getContext("2d",e);return null===n?null:new de(n,i,s)}let ds={title:"",visible:!0,hitTestTolerance:3,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};function dn(t,e){let i=function(t,e){switch(t){case 0:default:return[];case 1:return[e,e];case 2:return[2*e,2*e];case 3:return[6*e,6*e];case 4:return[e,4*e]}}(e,t.lineWidth);return t.setLineDash(i),i}function dr(t,e,i,s){t.beginPath();let n=t.lineWidth%2?.5:0;t.moveTo(i,e+n),t.lineTo(s,e+n),t.stroke()}function dl(t,e){if(!t)throw Error("Assertion failed"+(e?": "+e:""))}function da(t){if(void 0===t)throw Error("Value is undefined");return t}function dh(t){if(null===t)throw Error("Value is null");return t}function du(t){return dh(da(t))}(v=P||(P={}))[v.Simple=0]="Simple",v[v.WithSteps=1]="WithSteps",v[v.Curved=2]="Curved",(b=R||(R={}))[b.Solid=0]="Solid",b[b.Dotted=1]="Dotted",b[b.Dashed=2]="Dashed",b[b.LargeDashed=3]="LargeDashed",b[b.SparseDotted=4]="SparseDotted";class dc{constructor(){this.t=[]}i(t,e,i){this.t.push({h:t,l:e,o:!0===i})}_(t){let e=this.t.findIndex(e=>t===e.h);e>-1&&this.t.splice(e,1)}u(t){this.t=this.t.filter(e=>e.l!==t)}p(t,e,i){let s=[...this.t];this.t=this.t.filter(t=>!t.o),s.forEach(s=>s.h(t,e,i))}v(){return this.t.length>0}m(){this.t=[]}}function dd(t,...e){for(let i of e)for(let e in i)void 0!==i[e]&&Object.prototype.hasOwnProperty.call(i,e)&&!["__proto__","constructor","prototype"].includes(e)&&("object"!=typeof i[e]||void 0===t[e]||Array.isArray(i[e])?t[e]=i[e]:dd(t[e],i[e]));return t}function df(t){return"number"==typeof t&&isFinite(t)}function dp(t){return"number"==typeof t&&t%1==0}function dm(t){return"string"==typeof t}function dg(t){return"boolean"==typeof t}function dv(t){let e,i,s;if(!t||"object"!=typeof t)return t;for(i in e=Array.isArray(t)?[]:{},t)t.hasOwnProperty(i)&&(s=t[i],e[i]=s&&"object"==typeof s?dv(s):s);return e}function db(t){return null!==t}function dy(t){return null===t?void 0:t}let dx="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function dw(t,e,i){return void 0===e&&(e=dx),`${i=void 0!==i?`${i} `:""}${t}px ${e}`}class dS{constructor(t){this.M={S:1,C:5,k:NaN,P:"",T:"",R:"",D:"",I:0,V:0,B:0,A:0,L:0},this.O=t}N(){let t=this.M,e=this.F(),i=this.W();return t.k===e&&t.T===i||(t.k=e,t.T=i,t.P=dw(e,i),t.A=2.5/12*e,t.I=t.A,t.V=e/12*t.C,t.B=e/12*t.C,t.L=0),t.R=this.H(),t.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}}function dM(t){return t<0?0:t>255?255:Math.round(t)||0}function dk(t){return .199*t[0]+.687*t[1]+.114*t[2]}class dC{constructor(t,e){this.j=new Map,this.q=t,e&&(this.j=e)}Y(t,e){if("transparent"===t)return t;let i=this.K(t),s=i[3];return`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${e*s})`}Z(t){let e=this.K(t);return{G:`rgb(${e[0]}, ${e[1]}, ${e[2]})`,X:dk(e)>160?"black":"white"}}J(t){return dk(this.K(t))}tt(t,e,i){var s;let[n,r,o,l]=this.K(t),[a,h,u,c]=this.K(e),d=[dM(n+i*(a-n)),dM(r+i*(h-r)),dM(o+i*(u-o)),(s=l+i*(c-l))<=0||s>1?Math.min(Math.max(s,0),1):Math.round(1e4*s)/1e4];return`rgba(${d[0]}, ${d[1]}, ${d[2]}, ${d[3]})`}K(t){let e,i,s=this.j.get(t);if(s)return s;let n=((e=document.createElement("div")).style.display="none",document.body.appendChild(e),e.style.color=t,i=window.getComputedStyle(e).color,document.body.removeChild(e),i).match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!n){if(this.q.length)for(let e of this.q){let i=e(t);if(i)return this.j.set(t,i),i}throw Error(`Failed to parse color: ${t}`)}let r=[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),n[4]?parseFloat(n[4]):1];return this.j.set(t,r),r}}class dE{constructor(){this.it=[]}nt(t){this.it=t}st(t,e,i){this.it.forEach(s=>{s.st(t,e,i)})}}class dT{st(t,e,i){t.useBitmapCoordinateSpace(t=>this.et(t,e,i))}}class dP extends dT{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et({context:t,horizontalPixelRatio:e,verticalPixelRatio:i}){if(null===this.rt||null===this.rt.lt)return;let s=this.rt.lt,n=this.rt,r=Math.max(1,Math.floor(e))%2/2,o=o=>{t.beginPath();for(let l=s.to-1;l>=s.from;--l){let s=n.ot[l],a=Math.round(s._t*e)+r,h=s.ut*i,u=o*i+r;t.moveTo(a,h),t.arc(a,h,u,0,2*Math.PI)}t.fill()};n.ct>0&&(t.fillStyle=n.dt,o(n.ft+n.ct)),t.fillStyle=n.vt,o(n.ft)}}function dR(){return{ot:[{_t:0,ut:0,wt:0,Mt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}let d_={from:0,to:1};class dL{constructor(t,e,i){this.gt=new dE,this.bt=[],this.St=[],this.xt=!0,this.O=t,this.Ct=e,this.yt=i,this.gt.nt(this.bt)}kt(t){this.Pt(),this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.gt}Pt(){let t=this.yt.Dt();t.length!==this.bt.length&&(this.St=t.map(dR),this.bt=this.St.map(t=>{let e=new dP;return e.ht(t),e}),this.gt.nt(this.bt))}Rt(){let t=2===this.Ct.N().mode||!this.Ct.It(),e=this.yt.Vt(),i=this.Ct.Bt(),s=this.O.Et();this.Pt(),e.forEach((e,n)=>{let r=this.St[n],o=e.At(i),l=e.Lt();!t&&null!==o&&e.It()&&null!==l?(r.vt=o.zt,r.ft=o.ft,r.ct=o.Ot,r.ot[0].Mt=o.Mt,r.ot[0].ut=e.Ft().Nt(o.Mt,l.Wt),r.dt=o.Ht??this.O.Ut(r.ot[0].ut/e.Ft().$t()),r.ot[0].wt=i,r.ot[0]._t=s.jt(i),r.lt=d_):r.lt=null})}}class dN extends dT{constructor(t){super(),this.qt=t}et({context:t,bitmapSize:e,horizontalPixelRatio:i,verticalPixelRatio:s}){var n;let r;if(null===this.qt)return;let o=this.qt.Yt.It,l=this.qt.Kt.It;if(!o&&!l)return;let a=Math.round(this.qt._t*i),h=Math.round(this.qt.ut*s);t.lineCap="butt",o&&a>=0&&(t.lineWidth=Math.floor(this.qt.Yt.ct*i),t.strokeStyle=this.qt.Yt.R,t.fillStyle=this.qt.Yt.R,dn(t,this.qt.Yt.Zt),n=e.height,t.beginPath(),r=t.lineWidth%2?.5:0,t.moveTo(a+r,0),t.lineTo(a+r,n),t.stroke()),l&&h>=0&&(t.lineWidth=Math.floor(this.qt.Kt.ct*s),t.strokeStyle=this.qt.Kt.R,t.fillStyle=this.qt.Kt.R,dn(t,this.qt.Kt.Zt),dr(t,h,0,e.width))}}class dA{constructor(t,e){this.xt=!0,this.Gt={Yt:{ct:1,Zt:0,R:"",It:!1},Kt:{ct:1,Zt:0,R:"",It:!1},_t:0,ut:0},this.Xt=new dN(this.Gt),this.Jt=t,this.yt=e}kt(){this.xt=!0}Tt(t){return this.xt&&(this.Rt(),this.xt=!1),this.Xt}Rt(){let t=this.Jt.It(),e=this.yt.Qt().N().crosshair,i=this.Gt;2===e.mode?(i.Kt.It=!1,i.Yt.It=!1):(i.Kt.It=t&&this.Jt.ti(this.yt),i.Yt.It=t&&this.Jt.ii(),i.Kt.ct=e.horzLine.width,i.Kt.Zt=e.horzLine.style,i.Kt.R=e.horzLine.color,i.Yt.ct=e.vertLine.width,i.Yt.Zt=e.vertLine.style,i.Yt.R=e.vertLine.color,i._t=this.Jt.ni(),i.ut=this.Jt.si())}}function dj(t,e,i,s,n,r){t.save(),t.globalCompositeOperation="copy",t.fillStyle=r,t.fillRect(e,i,s,n),t.restore()}function dz(t,e,i,s,n,r){t.beginPath(),t.roundRect?t.roundRect(e,i,s,n,r):(t.lineTo(e+s-r[1],i),0!==r[1]&&t.arcTo(e+s,i,e+s,i+r[1],r[1]),t.lineTo(e+s,i+n-r[2]),0!==r[2]&&t.arcTo(e+s,i+n,e+s-r[2],i+n,r[2]),t.lineTo(e+r[3],i+n),0!==r[3]&&t.arcTo(e,i+n,e,i+n-r[3],r[3]),t.lineTo(e,i+r[0]),0!==r[0]&&t.arcTo(e,i,e+r[0],i,r[0]))}function dD(t,e,i,s,n,r,o=0,l=[0,0,0,0],a=""){var h;if(t.save(),!o||!a||a===r)return dz(t,e,i,s,n,l),t.fillStyle=r,t.fill(),void t.restore();let u=o/2;dz(t,e+u,i+u,s-o,n-o,(h=-u,l.map(t=>0===t?t:t+h))),"transparent"!==r&&(t.fillStyle=r,t.fill()),"transparent"!==a&&(t.lineWidth=o,t.strokeStyle=a,t.closePath(),t.stroke()),t.restore()}function dO(t,e,i,s,n,r,o){t.save(),t.globalCompositeOperation="copy";let l=t.createLinearGradient(0,0,0,n);l.addColorStop(0,r),l.addColorStop(1,o),t.fillStyle=l,t.fillRect(e,i,s,n),t.restore()}class dI{constructor(t,e){this.ht(t,e)}ht(t,e){this.qt=t,this.ei=e}$t(t,e){return this.qt.It?t.k+t.A+t.I:0}st(t,e,i,s){if(!this.qt.It||0===this.qt.ri.length)return;let n=this.qt.R,r=this.ei.G,o=t.useBitmapCoordinateSpace(t=>{let o=t.context;o.font=e.P;let l=this.hi(t,e,i,s),a=l.ai;return l.li?dD(o,a.oi,a._i,a.ui,a.ci,r,a.di,[a.ft,0,0,a.ft],r):dD(o,a.fi,a._i,a.ui,a.ci,r,a.di,[0,a.ft,a.ft,0],r),this.qt.pi&&(o.fillStyle=n,o.fillRect(a.fi,a.mi,a.wi-a.fi,a.Mi)),this.qt.gi&&(o.fillStyle=e.D,o.fillRect(l.li?a.bi-a.di:0,a._i,a.di,a.Si-a._i)),l});t.useMediaCoordinateSpace(({context:t})=>{let i=o.xi;t.font=e.P,t.textAlign=o.li?"right":"left",t.textBaseline="middle",t.fillStyle=n,t.fillText(this.qt.ri,i.Ci,(i._i+i.Si)/2+i.yi)})}hi(t,e,i,s){let n,r,o,{context:l,bitmapSize:a,mediaSize:h,horizontalPixelRatio:u,verticalPixelRatio:c}=t,d=this.qt.pi||!this.qt.ki?e.C:0,f=this.qt.Pi?e.S:0,p=e.A+this.ei.Ti,m=e.I+this.ei.Ri,g=e.V,v=e.B,b=this.qt.ri,y=e.k,x=i.Di(l,b),w=Math.ceil(i.Ii(l,b)),S=e.S+g+v+w+d,M=Math.max(1,Math.floor(c)),k=Math.round((y+p+m)*c);k%2!=M%2&&(k+=1);let C=f>0?Math.max(1,Math.floor(f*u)):0,E=Math.round(S*u),T=Math.round(d*u),P=Math.round((this.ei.Vi??this.ei.Bi??this.ei.Ei)*c)-Math.floor(.5*c),R=Math.floor(P+M/2-k/2),_=R+k,L="right"===s,N=L?h.width-f:f,A=L?a.width-C:C;return L?(n=A-E,r=A-T,o=N-d-g-f):(n=A+E,r=A+T,o=N+d+g),{li:L,ai:{_i:R,mi:P,Si:_,ui:E,ci:k,ft:2*u,di:C,oi:n,fi:A,wi:r,Mi:M,bi:a.width},xi:{_i:R/c,Si:_/c,Ci:o,yi:x}}}}class dV{constructor(t){this.Ai={Ei:0,G:"#000",Ri:0,Ti:0},this.Li={ri:"",It:!1,pi:!0,ki:!1,Ht:"",R:"#FFF",gi:!1,Pi:!1},this.zi={ri:"",It:!1,pi:!1,ki:!0,Ht:"",R:"#FFF",gi:!0,Pi:!0},this.xt=!0,this.Oi=new(t||dI)(this.Li,this.Ai),this.Ni=new(t||dI)(this.zi,this.Ai)}ri(){return this.Fi(),this.Li.ri}Ei(){return this.Fi(),this.Ai.Ei}kt(){this.xt=!0}$t(t,e=!1){return Math.max(this.Oi.$t(t,e),this.Ni.$t(t,e))}Wi(){return this.Ai.Vi??null}Hi(){return this.Ai.Vi??this.Ai.Bi??this.Ei()}Ui(t){this.Ai.Bi=t??void 0}$i(){return this.Fi(),this.Li.It||this.zi.It}ji(){return this.Fi(),this.Li.It}Tt(t){return this.Fi(),this.Li.pi=this.Li.pi&&t.N().ticksVisible,this.zi.pi=this.zi.pi&&t.N().ticksVisible,this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Oi}qi(){return this.Fi(),this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Ni}Fi(){this.xt&&(this.Li.pi=!0,this.zi.pi=!1,this.Yi(this.Li,this.zi,this.Ai))}}class dF extends dV{constructor(t,e,i){super(),this.Jt=t,this.Ki=e,this.Zi=i}Yi(t,e,i){if(t.It=!1,2===this.Jt.N().mode)return;let s=this.Jt.N().horzLine;if(!s.labelVisible)return;let n=this.Ki.Lt();if(!this.Jt.It()||this.Ki.Gi()||null===n)return;let r=this.Ki.Xi().Z(s.labelBackgroundColor);i.G=r.G,t.R=r.X;let o=2/12*this.Ki.k();i.Ti=o,i.Ri=o;let l=this.Zi(this.Ki);i.Ei=l.Ei,t.ri=this.Ki.Ji(l.Mt,n),t.It=!0}}let dB=/[1-9]/g;class dW{constructor(){this.qt=null}ht(t){this.qt=t}st(t,e){if(null===this.qt||!1===this.qt.It||0===this.qt.ri.length)return;let i=t.useMediaCoordinateSpace(({context:t})=>(t.font=e.P,Math.round(e.Qi.Ii(t,dh(this.qt).ri,dB))));if(i<=0)return;let s=e.tn,n=i+2*s,r=n/2,o=this.qt.nn,l=this.qt.Ei,a=Math.floor(l-r)+.5;a<0?(l+=Math.abs(0-a),a=Math.floor(l-r)+.5):a+n>o&&(l-=Math.abs(o-(a+n)),a=Math.floor(l-r)+.5);let h=a+n,u=Math.ceil(0+e.S+e.C+e.A+e.k+e.I);t.useBitmapCoordinateSpace(({context:t,horizontalPixelRatio:i,verticalPixelRatio:s})=>{let n=dh(this.qt);t.fillStyle=n.G;let r=Math.round(a*i),o=Math.round(0*s),l=Math.round(h*i),c=Math.round(u*s),d=Math.round(2*i);if(t.beginPath(),t.moveTo(r,o),t.lineTo(r,c-d),t.arcTo(r,c,r+d,c,d),t.lineTo(l-d,c),t.arcTo(l,c,l,c-d,d),t.lineTo(l,o),t.fill(),n.pi){let r=Math.round(n.Ei*i),l=Math.round((o+e.C)*s);t.fillStyle=n.R;let a=Math.max(1,Math.floor(i)),h=Math.floor(.5*i);t.fillRect(r-h,o,a,l-o)}}),t.useMediaCoordinateSpace(({context:t})=>{let i=dh(this.qt),n=0+e.S+e.C+e.A+e.k/2;t.font=e.P,t.textAlign="left",t.textBaseline="middle",t.fillStyle=i.R;let r=e.Qi.Di(t,"Apr0");t.translate(a+s,n+r),t.fillText(i.ri,0,0)})}}class d${constructor(t,e,i){this.xt=!0,this.Xt=new dW,this.Gt={It:!1,G:"#4c525e",R:"white",ri:"",nn:0,Ei:NaN,pi:!0},this.Ct=t,this.sn=e,this.Zi=i}kt(){this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Xt.ht(this.Gt),this.Xt}Rt(){let t=this.Gt;if(t.It=!1,2===this.Ct.N().mode)return;let e=this.Ct.N().vertLine;if(!e.labelVisible)return;let i=this.sn.Et();if(i.Gi())return;t.nn=i.nn();let s=this.Zi();if(null===s)return;t.Ei=s.Ei;let n=i.en(this.Ct.Bt());t.ri=i.rn(dh(n)),t.It=!0;let r=this.sn.Xi().Z(e.labelBackgroundColor);t.G=r.G,t.R=r.X,t.pi=i.N().ticksVisible}}class dK{constructor(){this.hn=null,this.an=0}ln(){return this.an}_n(t){this.an=t}Ft(){return this.hn}un(t){this.hn=t}cn(t){return[]}dn(){return[]}It(){return!0}}(y=_||(_={}))[y.Normal=0]="Normal",y[y.Magnet=1]="Magnet",y[y.Hidden=2]="Hidden",y[y.MagnetOHLC=3]="MagnetOHLC";class dU extends dK{constructor(t,e){let i,s,n,r;super(),this.yt=null,this.fn=NaN,this.pn=0,this.vn=!1,this.mn=new Map,this.wn=!1,this.Mn=new WeakMap,this.gn=new WeakMap,this.bn=NaN,this.Sn=NaN,this.xn=NaN,this.Cn=NaN,this.sn=t,this.yn=e,this.kn=(i=()=>this.fn,s=()=>this.Sn,t=>{let e=s(),n=i();if(t===dh(this.yt).Pn())return{Mt:n,Ei:e};{let i=dh(t.Lt());return{Mt:t.Tn(e,i),Ei:e}}});const o=(n=()=>this.pn,r=()=>this.ni(),()=>{let t=this.sn.Et().Rn(n()),e=r();return t&&Number.isFinite(e)?{wt:t,Ei:e}:null});this.Dn=new d$(this,t,o)}N(){return this.yn}In(t,e){this.xn=t,this.Cn=e}Vn(){this.xn=NaN,this.Cn=NaN}Bn(){return this.xn}En(){return this.Cn}An(t,e,i){this.wn||(this.wn=!0),this.vn=!0,this.Ln(t,e,i)}Bt(){return this.pn}ni(){return this.bn}si(){return this.Sn}It(){return this.vn}zn(){this.vn=!1,this.On(),this.fn=NaN,this.bn=NaN,this.Sn=NaN,this.yt=null,this.Vn(),this.Nn()}Fn(t){if(!this.yn.doNotSnapToHiddenSeriesIndices)return t;let e=this.sn,i=e.Et(),s=null,n=null;for(let i of e.Wn()){let e=i.Un().Hn(t,-1);if(e){if(e.$n===t)return t;(null===s||e.$n>s)&&(s=e.$n)}let r=i.Un().Hn(t,1);if(r){if(r.$n===t)return t;(null===n||r.$nMath.abs(o-i.jt(t)));return r[l.indexOf(Math.min(...l))]}jn(t){let e=this.Mn.get(t);e||(e=new dA(this,t),this.Mn.set(t,e));let i=this.gn.get(t);return i||(i=new dL(this.sn,this,t),this.gn.set(t,i)),[e,i]}ti(t){return t===this.yt&&this.yn.horzLine.visible}ii(){return this.yn.vertLine.visible}qn(t,e){this.vn&&this.yt===t||this.mn.clear();let i=[];return this.yt===t&&i.push(this.Yn(this.mn,e,this.kn)),i}dn(){return this.vn?[this.Dn]:[]}Kn(){return this.yt}Nn(){this.sn.Zn().forEach(t=>{this.Mn.get(t)?.kt(),this.gn.get(t)?.kt()}),this.mn.forEach(t=>t.kt()),this.Dn.kt()}Gn(t){return t&&!t.Pn().Gi()?t.Pn():null}Ln(t,e,i){this.Xn(t,e,i)&&this.Nn()}Xn(t,e,i){let s=this.bn,n=this.Sn,r=this.fn,o=this.pn,l=this.yt,a=this.Gn(i);this.pn=t,this.bn=isNaN(t)?NaN:this.sn.Et().jt(t),this.yt=i;let h=null!==a?a.Lt():null;return null!==a&&null!==h?(this.fn=e,this.Sn=a.Nt(e,h)):(this.fn=NaN,this.Sn=NaN),s!==this.bn||n!==this.Sn||o!==this.pn||r!==this.fn||l!==this.yt}On(){let t=this.sn.Jn().map(t=>t.Un().Qn()).filter(db),e=0===t.length?null:Math.max(...t);this.pn=null!==e?e:NaN}Yn(t,e,i){let s=t.get(e);return void 0===s&&(s=new dF(this,e,i),t.set(e,s)),s}}function dQ(t){return"left"===t||"right"===t}class dH{constructor(t){this.ts=new Map,this.ns=[],this.ss=t}es(t,e){var i;let s=(i=this.ts.get(t),void 0===i?e:{rs:Math.max(i.rs,e.rs),hs:i.hs||e.hs});this.ts.set(t,s)}ls(){return this.ss}_s(t){let e=this.ts.get(t);return void 0===e?{rs:this.ss}:{rs:Math.max(this.ss,e.rs),hs:e.hs}}us(){this.cs(),this.ns=[{ds:0}]}fs(t){this.cs(),this.ns=[{ds:1,Wt:t}]}ps(t){this.vs(),this.ns.push({ds:5,Wt:t})}cs(){this.vs(),this.ns.push({ds:6})}ws(){this.cs(),this.ns=[{ds:4}]}Ms(t){this.cs(),this.ns.push({ds:2,Wt:t})}gs(t){this.cs(),this.ns.push({ds:3,Wt:t})}bs(){return this.ns}Ss(t){for(let e of t.ns)this.xs(e);this.ss=Math.max(this.ss,t.ss),t.ts.forEach((t,e)=>{this.es(e,t)})}static Cs(){return new dH(2)}static ys(){return new dH(3)}xs(t){switch(t.ds){case 0:this.us();break;case 1:this.fs(t.Wt);break;case 2:this.Ms(t.Wt);break;case 3:this.gs(t.Wt);break;case 4:this.ws();break;case 5:this.ps(t.Wt);break;case 6:this.vs()}}vs(){let t=this.ns.findIndex(t=>5===t.ds);-1!==t&&this.ns.splice(t,1)}}class dq{formatTickmarks(t){return t.map(t=>this.format(t))}}function dY(t,e){if(!df(t))return"n/a";if(!dp(e)||e<0||e>16)throw TypeError("invalid length");return 0===e?t.toString():("0000000000000000"+t.toString()).slice(-e)}class dG extends dq{constructor(t,e){if(super(),e||(e=1),df(t)&&dp(t)||(t=100),t<0)throw TypeError("invalid base");this.Ki=t,this.ks=e,this.Ps()}format(t){let e=t<0?"−":"";return t=Math.abs(t),e+this.Ts(t)}Ps(){if(this.Rs=0,this.Ki>0&&this.ks>0){let t=this.Ki;for(;t>1;)t/=10,this.Rs++}}Ts(t){let e=this.Ki/this.ks,i=Math.floor(t),s="",n=void 0!==this.Rs?this.Rs:NaN;if(e>1){let r=+(Math.round(t*e)-i*e).toFixed(this.Rs);r>=e&&(r-=e,i+=1),s="."+dY(r.toFixed(this.Rs)*this.ks,n)}else i=Math.round(i*e)/e,n>0&&(s="."+dY(0,n));return i.toFixed(0)+s}}class dZ extends dG{constructor(t=100){super(t)}format(t){return`${super.format(t)}%`}}class dX extends dq{constructor(t){super(),this.Ds=t}format(t){let e="";return t<0&&(e="-",t=-t),t<995?e+this.Is(t):t<999995?e+this.Is(t/1e3)+"K":t<0x3b9ac9fb?(t=1e3*Math.round(t/1e3),e+this.Is(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),e+this.Is(t/1e9)+"B")}Is(t){let e=Math.pow(10,this.Ds);return((t=Math.round(t*e)/e)>=1e-15&&t<1?t.toFixed(this.Ds).replace(/\.?0+$/,""):String(t)).replace(/(\.[1-9]*)0+$/,(t,e)=>e)}}let dJ=/[2-9]/g;class d0{constructor(t=50){this.Vs=0,this.Bs=1,this.Es=1,this.As={},this.Ls=new Map,this.zs=t}Os(){this.Vs=0,this.Ls.clear(),this.Bs=1,this.Es=1,this.As={}}Ii(t,e,i){return this.Ns(t,e,i).width}Di(t,e,i){let s=this.Ns(t,e,i);return((s.actualBoundingBoxAscent||0)-(s.actualBoundingBoxDescent||0))/2}Ns(t,e,i){let s=String(e).replace(i||dJ,"0");if(this.Ls.has(s))return da(this.Ls.get(s)).Fs;if(this.Vs===this.zs){let t=this.As[this.Es];delete this.As[this.Es],this.Ls.delete(t),this.Es++,this.Vs--}t.save(),t.textBaseline="middle";let n=t.measureText(s);return t.restore(),0===n.width&&e.length||(this.Ls.set(s,{Fs:n,Ws:this.Bs}),this.As[this.Bs]=s,this.Vs++,this.Bs++),n}}class d1{constructor(t){this.Hs=null,this.M=null,this.Us="right",this.$s=t}js(t,e,i){this.Hs=t,this.M=e,this.Us=i}st(t){null!==this.M&&null!==this.Hs&&this.Hs.st(t,this.M,this.$s,this.Us)}}class d2{constructor(t,e,i){this.qs=t,this.$s=new d0(50),this.Ys=e,this.O=i,this.F=-1,this.Xt=new d1(this.$s)}Tt(){let t=this.O.Ks(this.Ys);if(null===t)return null;let e=t.Zs(this.Ys)?t.Gs():this.Ys.Ft();if(null===e)return null;let i=t.Xs(e);if("overlay"===i)return null;let s=this.O.Js();return s.k!==this.F&&(this.F=s.k,this.$s.Os()),this.Xt.js(this.qs.qi(),s,i),this.Xt}}class d5 extends dT{constructor(){super(...arguments),this.qt=null}ht(t){this.qt=t}Qs(t,e){if(!this.qt?.It)return null;let{ut:i,ct:s,te:n}=this.qt;return e>=i-s-7&&e<=i+s+7?{ie:this.qt,ne:Math.abs(e-i),se:2,ee:"price-line",te:n}:null}et({context:t,bitmapSize:e,horizontalPixelRatio:i,verticalPixelRatio:s}){if(null===this.qt||!1===this.qt.It)return;let n=Math.round(this.qt.ut*s);n<0||n>e.height||(t.lineCap="butt",t.strokeStyle=this.qt.R,t.lineWidth=Math.floor(this.qt.ct*i),dn(t,this.qt.Zt),dr(t,n,0,e.width))}}class d3{constructor(t){this.re={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Zt:0,It:!1},this.he=new d5,this.xt=!0,this.ae=t,this.le=t.Qt(),this.he.ht(this.re)}kt(){this.xt=!0}Tt(){return this.ae.It()?(this.xt&&(this.oe(),this.xt=!1),this.he):null}}class d4 extends d3{constructor(t){super(t)}oe(){this.re.It=!1;let t=this.ae.Ft(),e=t._e()._e;if(2!==e&&3!==e)return;let i=this.ae.N();if(!i.baseLineVisible||!this.ae.It())return;let s=this.ae.Lt();null!==s&&(this.re.It=!0,this.re.ut=t.Nt(s.Wt,s.Wt),this.re.R=i.baseLineColor,this.re.ct=i.baseLineWidth,this.re.Zt=i.baseLineStyle)}}class d6 extends dT{constructor(){super(...arguments),this.qt=null}ht(t){this.qt=t}ue(){return this.qt}et({context:t,horizontalPixelRatio:e,verticalPixelRatio:i}){let s=this.qt;if(null===s)return;let n=Math.max(1,Math.floor(e)),r=n%2/2,o=Math.round(s.ce.x*e)+r,l=s.ce.y*i;t.fillStyle=s.de,t.beginPath();let a=Math.max(2,1.5*s.fe)*e;t.arc(o,l,a,0,2*Math.PI,!1),t.fill(),t.fillStyle=s.pe,t.beginPath(),t.arc(o,l,s.ft*e,0,2*Math.PI,!1),t.fill(),t.lineWidth=n,t.strokeStyle=s.ve,t.beginPath(),t.arc(o,l,s.ft*e+n/2,0,2*Math.PI,!1),t.stroke()}}let d9=[{me:0,we:.25,Me:4,ge:10,be:.25,Se:0,xe:.4,Ce:.8},{me:.25,we:.525,Me:10,ge:14,be:0,Se:0,xe:.8,Ce:0},{me:.525,we:1,Me:14,ge:14,be:0,Se:0,xe:0,Ce:0}];class d7{constructor(t){this.Xt=new d6,this.xt=!0,this.ye=!0,this.ke=performance.now(),this.Pe=this.ke-1,this.Te=t}Re(){this.Pe=this.ke-1,this.kt()}De(){if(this.kt(),2===this.Te.N().lastPriceAnimation){let t=performance.now(),e=this.Pe-t;if(e>0)return void(e<650&&(this.Pe+=2600));this.ke=t,this.Pe=t+2600}}kt(){this.xt=!0}Ie(){this.ye=!0}It(){return 0!==this.Te.N().lastPriceAnimation}Ve(){switch(this.Te.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.Pe}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ye=!1):this.ye&&(this.Be(),this.ye=!1),this.Xt}Rt(){this.Xt.ht(null);let t=this.Te.Qt().Et(),e=t.Ee(),i=this.Te.Lt();if(null===e||null===i)return;let s=this.Te.Ae(!0);if(s.Le||!e.ze(s.$n))return;let n={x:t.jt(s.$n),y:this.Te.Ft().Nt(s.Mt,i.Wt)},r=s.R,o=this.Te.N().lineWidth,l=this.Oe(this.Ne(),r);this.Xt.ht({de:r,fe:o,pe:l.pe,ve:l.ve,ft:l.ft,ce:n})}Be(){let t=this.Xt.ue();if(null!==t){let e=this.Oe(this.Ne(),t.de);t.pe=e.pe,t.ve=e.ve,t.ft=e.ft}}Ne(){return this.Ve()?performance.now()-this.ke:2599}Fe(t,e,i,s){return this.Te.Qt().Xi().Y(t,i+(s-i)*e)}Oe(t,e){var i;let s,n=t%2600/2600;for(let t of d9)if(n>=t.me&&n<=t.we){s=t;break}dl(void 0!==s,"Last price animation internal logic error");let r=(n-s.me)/(s.we-s.me);return{pe:this.Fe(e,r,s.be,s.Se),ve:this.Fe(e,r,s.xe,s.Ce),ft:(i=s.Me)+(s.ge-i)*r}}}class d8 extends d3{constructor(t){super(t)}oe(){let t=this.re;t.It=!1;let e=this.ae.N();if(!e.priceLineVisible||!this.ae.It())return;let i=this.ae.Ae(0===e.priceLineSource);i.Le||(t.It=!0,t.ut=i.Ei,t.R=this.ae.We(i.R),t.ct=e.priceLineWidth,t.Zt=e.priceLineStyle)}}class ft extends dV{constructor(t){super(),this.Jt=t}Yi(t,e,i){t.It=!1,e.It=!1;let s=this.Jt;if(!s.It())return;let n=s.N(),r=n.lastValueVisible,o=""!==s.He(),l=0===n.seriesLastValueMode,a=s.Ae(!1);if(a.Le)return;r&&(t.ri=this.Ue(a,r,l),t.It=0!==t.ri.length),(o||l)&&(e.ri=this.$e(a,r,o,l),e.It=e.ri.length>0);let h=s.We(a.R),u=this.Jt.Qt().Xi().Z(h);i.G=u.G,i.Ei=a.Ei,e.Ht=s.Qt().Ut(a.Ei/s.Ft().$t()),t.Ht=h,t.R=u.X,e.R=u.X}$e(t,e,i,s){let n="",r=this.Jt.He();return i&&0!==r.length&&(n+=`${r} `),e&&s&&(n+=this.Jt.Ft().je()?t.qe:t.Ye),n.trim()}Ue(t,e,i){return e?i?this.Jt.Ft().je()?t.Ye:t.qe:t.ri:""}}function fe(t,e,i,s){let n=Number.isFinite(e),r=Number.isFinite(i);return n&&r?t(e,i):n||r?n?e:i:s}class fi{constructor(t,e){this.Ke=t,this.Ze=e}Ge(t){return null!==t&&this.Ke===t.Ke&&this.Ze===t.Ze}Xe(){return new fi(this.Ke,this.Ze)}Je(){return this.Ke}Qe(){return this.Ze}tr(){return this.Ze-this.Ke}Gi(){return this.Ze===this.Ke||Number.isNaN(this.Ze)||Number.isNaN(this.Ke)}Ss(t){return null===t?this:new fi(fe(Math.min,this.Je(),t.Je(),-1/0),fe(Math.max,this.Qe(),t.Qe(),1/0))}ir(t){if(!df(t)||0==this.Ze-this.Ke)return;let e=.5*(this.Ze+this.Ke),i=this.Ze-e,s=this.Ke-e;i*=t,s*=t,this.Ze=e+i,this.Ke=e+s}nr(t){df(t)&&(this.Ze+=t,this.Ke+=t)}sr(){return{minValue:this.Ke,maxValue:this.Ze}}static er(t){return null===t?null:new fi(t.minValue,t.maxValue)}}class fs{constructor(t,e){this.rr=t,this.hr=e||null}ar(){return this.rr}lr(){return this.hr}sr(){return{priceRange:null===this.rr?null:this.rr.sr(),margins:this.hr||void 0}}static er(t){return null===t?null:new fs(fi.er(t.priceRange),t.margins)}}let fn=[2,4,8,16,32,64,128,256,512];class fr extends d3{constructor(t,e){super(t),this._r=e}oe(){let t=this.re;t.It=!1;let e=this._r.N();if(!this.ae.It()||!e.lineVisible)return;let i=this._r.ur();null!==i&&(t.It=!0,t.ut=i,t.R=e.color,t.ct=e.lineWidth,t.Zt=e.lineStyle,t.te=this._r.N().id)}}class fo extends dV{constructor(t,e){super(),this.Te=t,this._r=e}Yi(t,e,i){t.It=!1,e.It=!1;let s=this._r.N(),n=s.axisLabelVisible,r=""!==s.title,o=this.Te;if(!n||!o.It())return;let l=this._r.ur();if(null===l)return;r&&(e.ri=s.title,e.It=!0),e.Ht=o.Qt().Ut(l/o.Ft().$t()),t.ri=this.cr(s.price),t.It=!0;let a=this.Te.Qt().Xi().Z(s.axisLabelColor||s.color);i.G=a.G;let h=s.axisLabelTextColor||a.X;t.R=h,e.R=h,i.Ei=l}cr(t){let e=this.Te.Lt();return null===e?"":this.Te.Ft().Ji(t,e.Wt)}}class fl{constructor(t,e){this.Te=t,this.yn=e,this.dr=new fr(t,this),this.qs=new fo(t,this),this.pr=new d2(this.qs,t,t.Qt())}vr(t){dd(this.yn,t),this.kt(),this.Te.Qt().mr()}N(){return this.yn}wr(){return this.dr}Mr(){return this.pr}gr(){return this.qs}kt(){this.dr.kt(),this.qs.kt()}ur(){let t=this.Te,e=t.Ft();if(t.Qt().Et().Gi()||e.Gi())return null;let i=t.Lt();return null===i?null:e.Nt(this.yn.price,i.Wt)}}class fa{constructor(){this.br=new WeakMap}Sr(t,e,i){let s=1/e*i;return t>=s?1:Math.min(Math.pow(2,Math.floor(Math.log2(s/t))),512)}Cr(t,e,i,s=!1,n){if(0===t.length||e<=1)return t;let r=this.yr(e);if(r<=1)return t;let o=this.kr(t),l=o.Pr.get(r);return void 0!==l||(l=this.Tr(t,r,i,s,n,o.Pr),o.Pr.set(r,l)),l}Rr(t,e,i,s,n=!1,r){if(i<1||0===t.length)return t;let o=this.kr(t),l=o.Pr.get(i);if(!l)return this.Cr(t,i,s,n,r);let a=this.Dr(t,e,i,l,n,s,r);return o.Pr.set(i,a),a}yr(t){if(t<=2)return 2;for(let e of fn)if(t<=e)return e;return 512}Ir(t){if(0===t.length)return 0;let e=t[0],i=t[t.length-1];return 31*t.length+17*e.$n+13*i.$n}Tr(t,e,i,s=!1,n,r=new Map){if(2===e)return this.Vr(t,2,i,s,n);let o=e/2,l=r.get(o);return l||(l=this.Tr(t,o,i,s,n,r),r.set(o,l)),this.Br(l,i,s,n)}Vr(t,e,i,s=!1,n){let r=this.Er(t,e,i,s,n);return this.Ar(r,s)}Br(t,e,i=!1,s){let n=this.Er(t,2,e,i,s);return this.Ar(n,i)}Er(t,e,i,s=!1,n){let r=[];for(let o=0;o=e){let e=this.Lr(t[o],t[o+1],i,s,n);e.zr=!1,r.push(e)}else if(0===r.length)r.push(this.Or(t[o],!0));else{let e=r[r.length-1];r[r.length-1]=this.Nr(e,t[o],i,s,n)}return r}Fr(t,e){return(t??1)+(e??1)}Lr(t,e,i,s=!1,n){if(!s||!i||!n){let i=t.Wt[1]>e.Wt[1]?t.Wt[1]:e.Wt[1],s=t.Wt[2]e.Wt[1]?t.qr:e.Wt[1],Yr:t.Yrthis.th(t,e))}Dr(t,e,i,s,n=!1,r,o){if(0===s.length)return s;let l=t.length-1,a=Math.floor(l/i)*i;if(Math.min(a+i,t.length)-ai){let s=t.slice();return s[s.length-1]=e,this.Cr(s,i,r,n,o)}if(Math.floor((l-1)/i)===Math.floor(l/i)||1===s.length){let h=Math.min(a+i,t.length),u=h-a;if(u<=0)return s;let c=1===u?this.Or(a===l?e:t[a],!0):this.Jr(t,a,h,l,e,r,n,o);return s[s.length-1]=this.th(c,n),s}{let s=t.slice();return s[s.length-1]=e,this.Cr(s,i,r,n,o)}}Or(t,e=!1){return{Wr:t.$n,Hr:t.$n,Ur:t.wt,$r:t.wt,jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3],Zr:t.Zr??1,Gr:t.ue,zr:e}}kr(t){let e=this.ih(t),i=this.Ir(t);return e.nh!==i&&(e.Pr.clear(),e.nh=i),e}ih(t){let e=this.br.get(t);return void 0===e&&(e={nh:this.Ir(t),Pr:new Map},this.br.set(t,e)),e}}class fh extends dK{constructor(t){super(),this.sn=t}Qt(){return this.sn}}let fu={Bar:(t,e,i,s)=>{let n=e.upColor,r=e.downColor,o=dh(t(i,s)),l=du(o.Wt[0])<=du(o.Wt[3]);return{sh:o.R??(l?n:r)}},Candlestick:(t,e,i,s)=>{let n=e.upColor,r=e.downColor,o=e.borderUpColor,l=e.borderDownColor,a=e.wickUpColor,h=e.wickDownColor,u=dh(t(i,s)),c=du(u.Wt[0])<=du(u.Wt[3]);return{sh:u.R??(c?n:r),eh:u.Ht??(c?o:l),rh:u.hh??(c?a:h)}},Custom:(t,e,i,s)=>({sh:dh(t(i,s)).R??e.color}),Area:(t,e,i,s)=>{let n=dh(t(i,s));return{sh:n.vt??e.lineColor,vt:n.vt??e.lineColor,ah:n.ah??e.topColor,oh:n.oh??e.bottomColor}},Baseline:(t,e,i,s)=>{let n=dh(t(i,s));return{sh:n.Wt[3]>=e.baseValue.price?e.topLineColor:e.bottomLineColor,_h:n._h??e.topLineColor,uh:n.uh??e.bottomLineColor,dh:n.dh??e.topFillColor1,fh:n.fh??e.topFillColor2,ph:n.ph??e.bottomFillColor1,mh:n.mh??e.bottomFillColor2}},Line:(t,e,i,s)=>{let n=dh(t(i,s));return{sh:n.R??e.color,vt:n.R??e.color}},Histogram:(t,e,i,s)=>({sh:dh(t(i,s)).R??e.color})};class fc{constructor(t){this.wh=(t,e)=>void 0!==e?e.Wt:this.Te.Un().Mh(t),this.Te=t,this.gh=fu[t.bh()]}Sh(t,e){return this.gh(this.wh,this.Te.N(),t,e)}}function fd(t,e,i,s,n=0,r=e.length){let o=r-n;for(;0>1,l=n+r;s(e[l],i)===t?(n=l+1,o-=r+1):o=r}return n}let ff=fd.bind(null,!0),fp=fd.bind(null,!1);(x=L||(L={}))[x.NearestLeft=-1]="NearestLeft",x[x.None=0]="None",x[x.NearestRight=1]="NearestRight";class fm{constructor(){this.xh=[],this.Ch=new Map,this.yh=new Map,this.kh=[]}Ph(){return this.Th()>0?this.xh[this.xh.length-1]:null}Rh(){return this.Th()>0?this.Dh(0):null}Qn(){return this.Th()>0?this.Dh(this.xh.length-1):null}Th(){return this.xh.length}Gi(){return 0===this.Th()}ze(t){return null!==this.Ih(t,0)}Mh(t){return this.Hn(t)}Hn(t,e=0){let i=this.Ih(t,e);return null===i?null:{...this.Vh(i),$n:this.Dh(i)}}Bh(){return this.xh}Eh(t,e,i){if(this.Gi())return null;let s=null;for(let n of i)s=fg(s,this.Ah(t,e,n));return s}ht(t){this.yh.clear(),this.Ch.clear(),this.xh=t,this.kh=t.map(t=>t.$n)}Lh(){return this.kh}Dh(t){return this.xh[t].$n}Vh(t){return this.xh[t]}Ih(t,e){let i=this.zh(t);if(null===i&&0!==e)switch(e){case -1:return this.Oh(t);case 1:return this.Nh(t);default:throw TypeError("Unknown search mode")}return i}Oh(t){let e=this.Fh(t);return e>0&&(e-=1),e!==this.xh.length&&this.Dh(e)t.$nt.$n>e)}Hh(t,e,i){let s=null;for(let n=t;ns.$h&&(s.$h=t)))}return s}Ah(t,e,i){if(this.Gi())return null;let s=null,n=dh(this.Rh()),r=dh(this.Qn()),o=Math.max(t,n),l=Math.min(e,r),a=30*Math.ceil(o/30),h=Math.max(a,30*Math.floor(l/30));{let t=this.Fh(o),n=this.Wh(Math.min(l,a,e));s=fg(s,this.Hh(t,n,i))}let u=this.Ch.get(i);void 0===u&&(u=new Map,this.Ch.set(i,u));for(let t=Math.max(a+1,o);tnew fy(t));return this.Xh={Kh:t,Zh:e},e}Qs(t,e){return this.Jh.hitTest?.(t,e)??null}}let fw=class extends fx{cn(){return[]}};class fS{constructor(t){this.jh=t}st(t,e,i){this.jh.draw(t,fv)}qh(t,e,i){this.jh.drawBackground?.(t,fv)}}class fM{constructor(t){this.Ls=null,this.Yh=t}Tt(){let t=this.Yh.renderer();if(null===t)return null;if(this.Ls?.Kh===t)return this.Ls.Zh;let e=new fS(t);return this.Ls={Kh:t,Zh:e},e}Gh(){return this.Yh.zOrder?.()??"normal"}}function fk(t){return{ri:t.text(),Ei:t.coordinate(),Vi:t.fixedCoordinate?.(),R:t.textColor(),G:t.backColor(),It:t.visible?.()??!0,pi:t.tickVisible?.()??!0}}class fC{constructor(t,e){this.Xt=new dW,this.ta=t,this.ia=e}Tt(){return this.Xt.ht({nn:this.ia.nn(),...fk(this.ta)}),this.Xt}}class fE extends dV{constructor(t,e){super(),this.ta=t,this.Ki=e}Yi(t,e,i){let s=fk(this.ta);i.G=s.G,t.R=s.R;let n=2/12*this.Ki.k();i.Ti=n,i.Ri=n,i.Ei=s.Ei,i.Vi=s.Vi,t.ri=s.ri,t.It=s.It,t.pi=s.pi}}class fT extends fx{constructor(t,e){super(t),this.na=null,this.sa=null,this.ea=null,this.ra=null,this.Te=e}dn(){let t=this.Jh.timeAxisViews?.()??[];if(this.na?.Kh===t)return this.na.Zh;let e=this.Te.Qt().Et(),i=t.map(t=>new fC(t,e));return this.na={Kh:t,Zh:i},i}qn(){let t=this.Jh.priceAxisViews?.()??[];if(this.sa?.Kh===t)return this.sa.Zh;let e=this.Te.Ft(),i=t.map(t=>new fE(t,e));return this.sa={Kh:t,Zh:i},i}ha(){let t=this.Jh.priceAxisPaneViews?.()??[];if(this.ea?.Kh===t)return this.ea.Zh;let e=t.map(t=>new fM(t));return this.ea={Kh:t,Zh:e},e}aa(){let t=this.Jh.timeAxisPaneViews?.()??[];if(this.ra?.Kh===t)return this.ra.Zh;let e=t.map(t=>new fM(t));return this.ra={Kh:t,Zh:e},e}la(t,e){return this.Jh.autoscaleInfo?.(t,e)??null}}function fP(t,e,i,s){t.forEach(t=>{e(t).forEach(t=>{t.Gh()===i&&s.push(t)})})}function fR(t){return t.jn()}function f_(t){return t.ha()}function fL(t){return t.aa()}let fN=["Area","Line","Baseline"];class fA extends fh{constructor(t,e,i,s,n){super(t),this.qt=new fm,this.dr=new d8(this),this.oa=[],this._a=new d4(this),this.ua=null,this.ca=null,this.da=null,this.fa=[],this.pa=new fa,this.va=new Map,this.ma=null,this.yn=i,this.wa=e;const r=new ft(this);if(this.mn=[r],this.pr=new d2(r,this,t),fN.includes(this.wa)&&(this.ua=new d7(this)),this.Ma(),this.Yh=s(this,this.Qt(),n),"Custom"===this.wa){const t=this.Yh;t.ga&&this.ba(t.ga)}}m(){null!==this.da&&clearTimeout(this.da)}We(t){return this.yn.priceLineColor||t}Ae(t){let e,i,s={Le:!0},n=this.Ft();if(this.Qt().Et().Gi()||n.Gi()||this.qt.Gi())return s;let r=this.Qt().Et().Ee(),o=this.Lt();if(null===r||null===o)return s;if(t){let t=this.qt.Ph();if(null===t)return s;e=t,i=t.$n}else{let t=this.qt.Hn(r.bi(),-1);if(null===t||null===(e=this.qt.Mh(t.$n)))return s;i=t.$n}let l=e.Wt[3],a=this.Sa().Sh(i,{Wt:e}),h=n.Nt(l,o.Wt);return{Le:!1,Mt:l,ri:n.Ji(l,o.Wt),qe:n.xa(l),Ye:n.Ca(l,o.Wt),R:a.sh,Ei:h,$n:i}}Sa(){return null!==this.ca||(this.ca=new fc(this)),this.ca}N(){return this.yn}vr(t){let e=this.Qt(),{priceScaleId:i,visible:s,priceFormat:n}=t;void 0!==i&&i!==this.yn.priceScaleId&&e.ya(this,i),void 0!==s&&s!==this.yn.visible&&e.ka();let r=void 0!==t.conflationThresholdFactor;dd(this.yn,t),r&&(this.va.clear(),this.Qt().mr()),void 0!==n&&(this.Ma(),e.Pa()),e.Ta(this),e.Ra(),this.Yh.kt("options")}ht(t,e){this.qt.ht(t),this.va.clear();let i=this.Qt().Et().N();i.enableConflation&&i.precomputeConflationOnInit&&this.Da(i.precomputeConflationPriority),this.Yh.kt("data"),null!==this.ua&&(e&&e.Ia?this.ua.De():0===t.length&&this.ua.Re());let s=this.Qt().Ks(this);this.Qt().Va(s),this.Qt().Ta(this),this.Qt().Ra(),this.Qt().mr()}Ba(t){let e=new fl(this,t);return this.oa.push(e),this.Qt().Ta(this),e}Ea(t){let e=this.oa.indexOf(t);-1!==e&&this.oa.splice(e,1),this.Qt().Ta(this)}Aa(){return this.oa}bh(){return this.wa}Lt(){let t=this.La();return null===t?null:{Wt:t.Wt[3],za:t.wt}}La(){let t=this.Qt().Et().Ee();if(null===t)return null;let e=t.Oa();return this.qt.Hn(e,1)}Un(){return this.qt}ba(t){this.ma=t,this.va.clear()}Na(){return!!this.Qt().Et().N().enableConflation&&this.Fa()>1}Rr(t){if(!this.Na())return;let e=this.Fa();if(!this.va.has(e))return;let i="Custom"===this.wa,s=i&&this.ma||void 0,n=i&&this.Yh.Wa?t=>{let e=this.Yh.Wa(t);return Array.isArray(e)?e:["number"==typeof e?e:0]}:void 0,r=this.pa.Rr(this.qt.Bh(),t,e,s,i,n),o=new fm;o.ht(r),this.va.set(e,o)}Ha(){let t=this.Qt().Et().N().enableConflation;if("Custom"===this.wa&&null===this.ma||!t)return this.qt;let e=this.Fa(),i=this.va.get(e);return i||(this.Ua(e),this.va.get(e)??this.qt)}$a(t){let e=this.qt.Mh(t);return null===e?null:"Bar"===this.wa||"Candlestick"===this.wa||"Custom"===this.wa?{jr:e.Wt[0],qr:e.Wt[1],Yr:e.Wt[2],Kr:e.Wt[3]}:e.Wt[3]}ja(t){let e=[];fP(this.fa,fR,"top",e);let i=this.ua;return null!==i&&i.It()&&(null===this.da&&i.Ve()&&(this.da=setTimeout(()=>{this.da=null,this.Qt().qa()},0)),i.Ie(),e.unshift(i)),e}jn(){let t=[];this.Ya()||t.push(this._a),t.push(this.Yh,this.dr);let e=this.oa.map(t=>t.wr());return t.push(...e),fP(this.fa,fR,"normal",t),t}Ka(){return this.Za(fR,"bottom")}Ga(t){return this.Za(f_,t)}Xa(t){return this.Za(fL,t)}Ja(t,e){return this.fa.map(i=>i.Qs(t,e)).filter(t=>null!==t)}cn(){return[this.pr,...this.oa.map(t=>t.Mr())]}qn(t,e){if(e!==this.hn&&!this.Ya())return[];let i=[...this.mn];for(let t of this.oa)i.push(t.gr());return this.fa.forEach(t=>{i.push(...t.qn())}),i}dn(){let t=[];return this.fa.forEach(e=>{t.push(...e.dn())}),t}la(t,e){if(void 0!==this.yn.autoscaleInfoProvider){let i=this.yn.autoscaleInfoProvider(()=>{let i=this.Qa(t,e);return null===i?null:i.sr()});return fs.er(i)}return this.Qa(t,e)}Kh(){let t=this.yn.priceFormat;return t.base??1/t.minMove}tl(){return this.il}Nn(){for(let t of(this.Yh.kt(),this.mn))t.kt();for(let t of this.oa)t.kt();this.dr.kt(),this._a.kt(),this.ua?.kt(),this.fa.forEach(t=>t.Nn())}Ft(){return dh(super.Ft())}At(t){if(!(("Line"===this.wa||"Area"===this.wa||"Baseline"===this.wa)&&this.yn.crosshairMarkerVisible))return null;let e=this.qt.Mh(t);return null===e?null:{Mt:e.Wt[3],ft:this.nl(),Ht:this.sl(),Ot:this.el(),zt:this.rl(t)}}He(){return this.yn.title}It(){return this.yn.visible}hl(t){this.fa.push(new fT(t,this))}al(t){this.fa=this.fa.filter(e=>e.Qh()!==t)}ll(){if("Custom"===this.wa)return t=>this.Yh.Wa(t)}ol(){if("Custom"===this.wa)return t=>this.Yh._l(t)}ul(){return this.qt.Lh()}Ya(){return!dQ(this.Ft().cl())}Qa(t,e){if(!dp(t)||!dp(e)||this.qt.Gi())return null;let i="Line"===this.wa||"Area"===this.wa||"Baseline"===this.wa||"Histogram"===this.wa?[3]:[2,1],s=this.qt.Eh(t,e,i),n=null!==s?new fi(s.Uh,s.$h):null,r=null;if("Histogram"===this.bh()){let t=this.yn.base,e=new fi(t,t);n=null!==n?n.Ss(e):e}return this.fa.forEach(i=>{let s=i.la(t,e);if(s?.priceRange){let t=new fi(s.priceRange.minValue,s.priceRange.maxValue);n=null!==n?n.Ss(t):t}s?.margins&&(r=s.margins)}),new fs(n,r)}nl(){switch(this.wa){case"Line":case"Area":case"Baseline":return this.yn.crosshairMarkerRadius}return 0}sl(){switch(this.wa){case"Line":case"Area":case"Baseline":{let t=this.yn.crosshairMarkerBorderColor;if(0!==t.length)return t}}return null}el(){switch(this.wa){case"Line":case"Area":case"Baseline":return this.yn.crosshairMarkerBorderWidth}return 0}rl(t){switch(this.wa){case"Line":case"Area":case"Baseline":{let t=this.yn.crosshairMarkerBackgroundColor;if(0!==t.length)return t}}return this.Sa().Sh(t).sh}Ma(){switch(this.yn.priceFormat.type){case"custom":{let t=this.yn.priceFormat.formatter;this.il={format:t,formatTickmarks:this.yn.priceFormat.tickmarksFormatter??(e=>e.map(t))};break}case"volume":this.il=new dX(this.yn.priceFormat.precision);break;case"percent":this.il=new dZ(this.yn.priceFormat.precision);break;default:{let t=Math.pow(10,this.yn.priceFormat.precision);this.il=new dG(t,this.yn.priceFormat.minMove*t)}}null!==this.hn&&this.hn.dl()}Za(t,e){let i=[];return fP(this.fa,t,e,i),i}Fa(){let{fl:t,pl:e,vl:i}=this.ml();return this.pa.Sr(t,e,i)}ml(){let t=this.Qt().Et(),e=t.fl(),i=window.devicePixelRatio||1,s=t.N().conflationThresholdFactor;return{fl:e,pl:i,vl:this.yn.conflationThresholdFactor??s??1}}wl(t){let e,i=this.qt.Bh();if("Custom"===this.wa&&null!==this.ma){let s=this.ll();if(!s)throw Error("Custom series with conflation reducer must have a priceValueBuilder method");e=this.pa.Cr(i,t,this.ma,!0,t=>s(t))}else e=this.pa.Cr(i,t);let s=new fm;return s.ht(e),s}Ua(t){let e=this.wl(t);this.va.set(t,e)}Da(t){if("Custom"!==this.wa||null!==this.ma&&this.ll())for(let e of(this.va.clear(),this.Qt().Et().Ml())){let i=()=>{this.gl(e)},s="object"==typeof window&&window||"object"==typeof self&&self;s?.Sl?.bl?s.Sl.bl(()=>{i()},{se:t}):Promise.resolve().then(()=>i())}}gl(t){if(this.va.has(t)||0===this.qt.Bh().length)return;let e=this.wl(t);this.va.set(t,e)}}let fj=[3],fz=[0,1,2,3];class fD{constructor(t){this.yn=t}xl(t,e,i){if(0===this.yn.mode)return t;let s=i.Pn(),n=s.Lt();if(null===n)return t;let r=s.Nt(t,n),o=i.Cl().filter(t=>t instanceof fA).reduce((t,s)=>{if(i.Zs(s)||!s.It())return t;let n=s.Ft(),r=s.Un();if(n.Gi()||!r.ze(e))return t;let o=r.Mh(e);if(null===o)return t;let l=du(s.Lt()),a=3===this.yn.mode?fz:fj;return t.concat(a.map(t=>n.Nt(o.Wt[t],l.Wt)))},[]);if(0===o.length)return t;o.sort((t,e)=>Math.abs(t-r)-Math.abs(e-r));let l=o[0];return s.Tn(l,n)}}function fO(t,e,i){return Math.min(Math.max(t,e),i)}class fI extends dT{constructor(){super(...arguments),this.qt=null}ht(t){this.qt=t}et({context:t,bitmapSize:e,horizontalPixelRatio:i,verticalPixelRatio:s}){var n;if(null===this.qt)return;let r=Math.max(1,Math.floor(i));t.lineWidth=r,n=()=>{let n=dh(this.qt);if(n.yl){for(let s of(t.strokeStyle=n.kl,dn(t,n.Pl),t.beginPath(),n.Tl)){let n=Math.round(s.Rl*i);t.moveTo(n,-r),t.lineTo(n,e.height+r)}t.stroke()}if(n.Dl){for(let i of(t.strokeStyle=n.Il,dn(t,n.Vl),t.beginPath(),n.Bl)){let n=Math.round(i.Rl*s);t.moveTo(-r,n),t.lineTo(e.width+r,n)}t.stroke()}},t.save(),t.lineWidth%2&&t.translate(.5,.5),n(),t.restore()}}class fV{constructor(t){this.Xt=new fI,this.xt=!0,this.yt=t}kt(){this.xt=!0}Tt(){if(this.xt){let t=this.yt.Qt().N().grid,e={Dl:t.horzLines.visible,yl:t.vertLines.visible,Il:t.horzLines.color,kl:t.vertLines.color,Vl:t.horzLines.style,Pl:t.vertLines.style,Bl:this.yt.Pn().El(),Tl:(this.yt.Qt().Et().El()||[]).map(t=>({Rl:t.coord}))};this.Xt.ht(e),this.xt=!1}return this.Xt}}class fF{constructor(t){this.Yh=new fV(t)}wr(){return this.Yh}}let fB={Al:4,Ll:1e-4};function fW(t,e){let i=100*(t-e)/e;return e<0?-i:i}function f$(t,e){let i=100*(t-e)/e+100;return e<0?-i:i}function fK(t,e){let i=Math.abs(t);if(i<1e-15)return 0;let s=Math.log10(i+e.Ll)+e.Al;return t<0?-s:s}function fU(t,e){let i=Math.abs(t);if(i<1e-15)return 0;let s=Math.pow(10,i-e.Al)-e.Ll;return t<0?-s:s}function fQ(t,e){return null===t?null:new fi(fK(t.Je(),e),fK(t.Qe(),e))}function fH(t,e){return null===t?null:new fi(fU(t.Je(),e),fU(t.Qe(),e))}function fq(t){if(null===t)return fB;let e=Math.abs(t.Qe()-t.Je());if(e>=1||e<1e-15)return fB;let i=Math.ceil(Math.abs(Math.log10(e))),s=fB.Al+i;return{Al:s,Ll:1/Math.pow(10,s)}}class fY{constructor(t,e){if(this.zl=t,this.Ol=e,function(t){if(t<0)return!1;if(t>1e18)return!0;for(let e=t;e>1;e/=10)if(e%10!=0)return!1;return!0}(this.zl))this.Nl=[2,2.5,2];else{this.Nl=[];for(let t=this.zl;1!==t;){if(t%2==0)this.Nl.push(2),t/=2;else{if(t%5!=0)throw Error("unexpected base");this.Nl.push(2,2.5),t/=5}if(this.Nl.length>100)throw Error("something wrong with base")}}}Fl(t,e,i){let s=0===this.zl?0:1/this.zl,n=Math.pow(10,Math.max(0,Math.ceil(Math.log10(t-e)))),r=0,o=this.Ol[0];for(;;){let t=s-n<=1e-14&&n>s+1e-14,e=i*o-n<=1e-14,l=1-n<=1e-14;if(!(t&&e&&l))break;n/=o,o=this.Ol[++r%this.Ol.length]}if(n<=s+1e-14&&(n=s),n=Math.max(1,n),this.Nl.length>0&&1e-14>Math.abs(n-1))for(r=0,o=this.Nl[0];i*o-n<=1e-14&&n>s+1e-14;)n/=o,o=this.Nl[++r%this.Nl.length];return n}}class fG{constructor(t,e,i,s){this.Wl=[],this.Ki=t,this.zl=e,this.Hl=i,this.Ul=s}Fl(t,e){if(tt.Jl),c=this.Ki.Ql(u);for(let t=0;t=s?1:-1,u=null,c=0;for(let d=i-a;d>s;d-=e){let i=this.Ul(d,t,!0);null!==u&&Math.abs(i-u)r||(c0&&o[0].Rl-l.Rl0&&a.Rl-o[o.length-1].Rldh(t.ln())-dh(e.ln()))}(w=N||(N={}))[w.Normal=0]="Normal",w[w.Logarithmic=1]="Logarithmic",w[w.Percentage=2]="Percentage",w[w.IndexedTo100=3]="IndexedTo100";let fX=new dZ,fJ=new dG(100,1);class f0{constructor(t,e,i,s,n){this.ho=0,this.ao=null,this.rr=null,this.lo=null,this.oo={_o:!1,uo:null},this.co=!1,this.do=0,this.fo=0,this.po=new dc,this.vo=new dc,this.mo=[],this.wo=null,this.Mo=null,this.bo=null,this.So=null,this.xo=null,this.il=fJ,this.Co=fq(null),this.yo=t,this.yn=e,this.ko=i,this.Po=s,this.To=n,this.Ro=new fG(this,100,this.Do.bind(this),this.Io.bind(this))}cl(){return this.yo}N(){return this.yn}vr(t){if(dd(this.yn,t),this.dl(),void 0!==t.mode&&this.Vo({_e:t.mode}),void 0!==t.scaleMargins){let e=da(t.scaleMargins.top),i=da(t.scaleMargins.bottom);if(e<0||e>1)throw Error(`Invalid top margin - expect value between 0 and 1, given=${e}`);if(i<0||i>1)throw Error(`Invalid bottom margin - expect value between 0 and 1, given=${i}`);if(e+i>1)throw Error(`Invalid margins - sum of margins must be less than 1, given=${e+i}`);this.Bo(),this.bo=null}}Eo(){return this.yn.autoScale}Ao(){return this.co}so(){return 1===this.yn.mode}je(){return 2===this.yn.mode}Lo(){return 3===this.yn.mode}ro(){return this.Co}_e(){return{hs:this.yn.autoScale,zo:this.yn.invertScale,_e:this.yn.mode}}Vo(t){let e=this._e(),i=null;void 0!==t.hs&&(this.yn.autoScale=t.hs),void 0!==t._e&&(this.yn.mode=t._e,2!==t._e&&3!==t._e||(this.yn.autoScale=!0),this.oo._o=!1),1===e._e&&t._e!==e._e&&(function(t,e){if(null===t)return!1;let i=fU(t.Je(),e),s=fU(t.Qe(),e);return isFinite(i)&&isFinite(s)}(this.rr,this.Co)?null!==(i=fH(this.rr,this.Co))&&this.Oo(i):this.yn.autoScale=!0),1===t._e&&t._e!==e._e&&null!==(i=fQ(this.rr,this.Co))&&this.Oo(i);let s=e._e!==this.yn.mode;s&&(2===e._e||this.je())&&this.dl(),s&&(3===e._e||this.Lo())&&this.dl(),void 0!==t.zo&&e.zo!==t.zo&&(this.yn.invertScale=t.zo,this.No()),this.vo.p(e,this._e())}Fo(){return this.vo}k(){return this.ko.fontSize}$t(){return this.ho}Wo(t){this.ho!==t&&(this.ho=t,this.Bo(),this.bo=null)}Ho(){if(this.ao)return this.ao;let t=this.$t()-this.Uo()-this.$o();return this.ao=t,t}ar(){return this.jo(),this.rr}Oo(t,e){let i=this.rr;(e||null===i&&null!==t||null!==i&&!i.Ge(t))&&(this.bo=null,this.rr=t)}qo(t){this.Oo(t),this.Yo(null!==t)}Gi(){return this.jo(),0===this.ho||!this.rr||this.rr.Gi()}Ko(t){return this.zo()?t:this.$t()-1-t}Nt(t,e){return this.je()?t=fW(t,e):this.Lo()&&(t=f$(t,e)),this.Io(t,e)}Zo(t,e,i){this.jo();let s=this.$o(),n=dh(this.ar()),r=n.Je(),o=n.Qe(),l=this.Ho()-1,a=this.zo(),h=l/(o-r),u=void 0===i?0:i.from,c=void 0===i?t.length:i.to,d=this.Go();for(let i=u;it.Nn())}Kl(){return this.yn.ensureEdgeTickMarksVisible&&this.Eo()}Gl(){return this.k()/2}dl(){this.bo=null;let t=1/0;for(let e of(this.wo=null,this.mo))e.ln()fK(t,this.Co):null}b_(t,e,i){return void 0===e?(void 0===i&&(i=this.tl()),i.format(t)):e(t)}S_(t,e,i){return void 0===e?(void 0===i&&(i=this.tl()),i.formatTickmarks(t)):e(t)}cr(t,e){return this.b_(t,this.Po.priceFormatter,e)}v_(t,e){let i=this.Po.priceFormatter;return this.S_(t,this.Po.tickmarksPriceFormatter??(i?t=>t.map(i):void 0),e)}f_(t,e){return this.b_(t,this.Po.percentageFormatter,e)}p_(t,e){let i=this.Po.percentageFormatter;return this.S_(t,this.Po.tickmarksPercentageFormatter??(i?t=>t.map(i):void 0),e)}}function f1(t){return t instanceof fA}class f2{constructor(t,e){this.mo=[],this.x_=new Map,this.ho=0,this.C_=0,this.y_=1,this.Mo=null,this.k_=null,this.P_=!1,this.T_=new dc,this.fa=[],this.ia=t,this.sn=e,this.R_=new fF(this);const i=e.N();this.D_=this.I_("left",i.leftPriceScale),this.V_=this.I_("right",i.rightPriceScale),this.D_.Fo().i(this.B_.bind(this,this.D_),this),this.V_.Fo().i(this.B_.bind(this,this.V_),this),this.E_(i)}E_(t){if(t.leftPriceScale&&this.D_.vr(t.leftPriceScale),t.rightPriceScale&&this.V_.vr(t.rightPriceScale),t.localization&&(this.D_.dl(),this.V_.dl()),t.overlayPriceScales)for(let e of Array.from(this.x_.values())){let i=dh(e[0].Ft());i.vr(t.overlayPriceScales),t.localization&&i.dl()}}A_(t){switch(t){case"left":return this.D_;case"right":return this.V_}return this.x_.has(t)?da(this.x_.get(t))[0].Ft():null}m(){this.Qt().L_().u(this),this.D_.Fo().u(this),this.V_.Fo().u(this),this.mo.forEach(t=>{t.m&&t.m()}),this.fa=this.fa.filter(t=>{let e=t.Qh();return e.detached&&e.detached(),!1}),this.T_.p()}z_(){return this.y_}O_(t){this.y_=t}Qt(){return this.sn}nn(){return this.C_}$t(){return this.ho}N_(t){this.C_=t,this.F_()}Wo(t){this.ho=t,this.D_.Wo(t),this.V_.Wo(t),this.mo.forEach(e=>{if(this.Zs(e)){let i=e.Ft();null!==i&&i.Wo(t)}}),this.F_()}W_(t){this.P_=t}H_(){return this.P_}U_(){return this.mo.filter(f1)}Cl(){return this.mo}Zs(t){let e=t.Ft();return null===e||this.D_!==e&&this.V_!==e}s_(t,e,i){this.j_(t,e,i?t.ln():this.mo.length)}r_(t,e){let i=this.mo.indexOf(t);dl(-1!==i,"removeDataSource: invalid data source"),this.mo.splice(i,1),e||this.mo.forEach((t,e)=>t._n(e));let s=dh(t.Ft()).cl();if(this.x_.has(s)){let e=da(this.x_.get(s)),i=e.indexOf(t);-1!==i&&(e.splice(i,1),0===e.length&&this.x_.delete(s))}let n=t.Ft();n&&n.Cl().indexOf(t)>=0&&(n.r_(t),this.q_(n)),this.Y_()}Xs(t){return t===this.D_?"left":t===this.V_?"right":"overlay"}K_(){return this.D_}Z_(){return this.V_}G_(t,e){t.l_(e)}X_(t,e){t.o_(e),this.F_()}J_(t){t.__()}Q_(t,e){t.u_(e)}tu(t,e){t.c_(e),this.F_()}iu(t){t.d_()}F_(){this.mo.forEach(t=>{t.Nn()})}Pn(){let[t,e]=this.nu(),i=null;return t.N().visible&&0!==t.Cl().length?i=t:e.N().visible&&0!==e.Cl().length?i=e:0!==this.mo.length&&(i=this.mo[0].Ft()),null===i&&(i=this.Gs()??t),i}Gs(){let[t,e]=this.nu();return t.N().visible?t:e.N().visible?e:null}q_(t){null!==t&&t.Eo()&&this.su(t)}eu(t){let e=this.ia.Ee();t.Vo({hs:!0}),null!==e&&t.w_(e),this.F_()}ru(){this.su(this.D_),this.su(this.V_)}hu(){this.q_(this.D_),this.q_(this.V_),this.mo.forEach(t=>{this.Zs(t)&&this.q_(t.Ft())}),this.F_(),this.sn.mr()}Dt(){return null===this.Mo&&(this.Mo=fZ(this.mo)),this.Mo}au(){let t=this.Dt(),e=this.sn.ou()?.lu,i=this.sn.N().hoveredSeriesOnTop,s=this.k_;if(null!==s&&s.Kh===t&&s._u===e&&s.uu===i)return s.cu;let n=function(t,e,i){if(!i)return t;let s=t.indexOf(e);if(-1===s||s===t.length-1)return t;let n=[];for(let e=0;et._n(e)),this.Y_(),[this.D_,this.V_]))s.e_(),s.dl();this.sn.mr()}Vt(){return this.Dt().filter(f1)}fu(){return this.T_}pu(){return this.R_}hl(t){this.fa.push(new fw(t))}al(t){this.fa=this.fa.filter(e=>e.Qh()!==t),t.detached&&t.detached(),this.sn.mr()}vu(){return this.fa}Ja(t,e){return this.fa.map(i=>i.Qs(t,e)).filter(t=>null!==t)}su(t){let e=t.m_();if(e&&e.length>0&&!this.ia.Gi()){let e=this.ia.Ee();null!==e&&t.w_(e)}t.Nn()}j_(t,e,i){let s=this.A_(e);if(null===s&&(s=this.I_(e,this.sn.N().overlayPriceScales)),this.mo.splice(i,0,t),!dQ(e)){let i=this.x_.get(e)||[];i.push(t),this.x_.set(e,i)}t._n(i),s.s_(t),t.un(s),this.q_(s),this.Y_()}Y_(){this.Mo=null,this.k_=null}nu(){return"left"===this.sn.N().defaultVisiblePriceScaleId?[this.D_,this.V_]:[this.V_,this.D_]}B_(t,e,i){e._e!==i._e&&this.su(t)}I_(t,e){let i=new f0(t,{visible:!0,autoScale:!0,...dv(e)},this.sn.N().layout,this.sn.N().localization,this.sn.Xi());return i.Wo(this.$t()),i}}function f5(t,e){return null===e||2===t.se&&2!==e.se||(2!==e.se||2===t.se)&&t.ne!==e.ne&&t.ne= left"),this.ku=t,this.Pu=e}Oa(){return this.ku}bi(){return this.Pu}Tu(){return this.Pu-this.ku+1}ze(t){return this.ku<=t&&t<=this.Pu}Ge(t){return this.ku===t.Oa()&&this.Pu===t.bi()}}function f8(t,e){return null===t||null===e?t===e:t.Ge(e)}class pt{constructor(){this.Ru=new Map,this.Ls=null,this.Du=!1}Iu(t){this.Du=t,this.Ls=null}Vu(t,e){this.Bu(e),this.Ls=null;for(let i=e;i{t<=i[0].index?e.push(s):i.splice(ff(i,t,e=>e.index!e||i.has(t.index);for(let e of Array.from(this.Ru.keys()).sort((t,e)=>e-t)){if(!this.Ru.get(e))continue;let i=s;s=[];let r=i.length,o=0,l=da(this.Ru.get(e)),a=l.length,h=1/0,u=-1/0;for(let e=0;e=t&&c-u>=t&&n(a))s.push(a),u=c;else if(this.Du)return i}for(;oe.weight?t:e}class ps{constructor(t,e,i,s){this.C_=0,this.Uu=null,this.$u=[],this.xo=null,this.So=null,this.ju=new pt,this.qu=new Map,this.Yu=pe.Hu(),this.Ku=!0,this.Zu=new dc,this.Gu=new dc,this.Xu=new dc,this.Ju=null,this.Qu=null,this.tc=new Map,this.nc=-1,this.sc=[],this.ec=1,this.yn=e,this.Po=i,this.rc=e.rightOffset,this.hc=e.barSpacing,this.sn=t,this.ac(e),this.xu=s,this.lc(),this.ju.Iu(e.uniformDistribution),this.oc(),this._c()}N(){return this.yn}uc(t){dd(this.Po,t),this.cc(),this.lc()}vr(t,e){dd(this.yn,t),this.yn.fixLeftEdge&&this.dc(),this.yn.fixRightEdge&&this.fc(),void 0!==t.barSpacing&&this.sn.Ms(t.barSpacing),void 0!==t.rightOffset&&this.sn.gs(t.rightOffset),this.ac(t),void 0===t.minBarSpacing&&void 0===t.maxBarSpacing||this.sn.Ms(t.barSpacing??this.hc),void 0!==t.ignoreWhitespaceIndices&&t.ignoreWhitespaceIndices!==this.yn.ignoreWhitespaceIndices&&this._c(),this.cc(),this.lc(),void 0===t.enableConflation&&void 0===t.conflationThresholdFactor||this.oc(),this.Xu.p()}Rn(t){return this.$u[t]?.time??null}en(t){return this.$u[t]??null}vc(t,e){if(this.$u.length<1)return null;if(this.xu.key(t)>this.xu.key(this.$u[this.$u.length-1].time))return e?this.$u.length-1:null;let i=ff(this.$u,this.xu.key(t),(t,e)=>this.xu.key(t.time)0}Ee(){return this.wc(),this.Yu.Fu()}Mc(){return this.wc(),this.Yu.Wu()}gc(){let t=this.Ee();if(null===t)return null;let e={from:t.Oa(),to:t.bi()};return this.bc(e)}bc(t){let e=Math.round(t.from),i=Math.round(t.to),s=dh(this.Sc()),n=dh(this.xc());return{from:dh(this.en(Math.max(s,e))),to:dh(this.en(Math.min(n,i)))}}Cc(t){return{from:dh(this.vc(t.from,!0)),to:dh(this.vc(t.to,!0))}}nn(){return this.C_}N_(t){if(!isFinite(t)||t<=0||this.C_===t)return;let e=this.Mc(),i=this.C_;if(this.C_=t,this.Ku=!0,this.yn.lockVisibleTimeRangeOnResize&&0!==i){let e=this.hc*t/i;this.hc=e}this.yn.fixLeftEdge&&null!==e&&0>=e.Oa()&&(this.rc-=Math.round((i-t)/this.hc)+1,this.Ku=!0),this.yc(),this.kc()}jt(t){if(this.Gi()||!dp(t))return 0;let e=this.Pc()+this.rc-t;return this.C_-(e+.5)*this.hc-1}Tc(t,e){let i=this.Pc(),s=void 0===e?0:e.from,n=void 0===e?t.length:e.to;for(let e=s;ee/2&&!h?i.needAlignCoordinate=!1:i.needAlignCoordinate=u&&t.index<=l||c&&t.index>=a,d++)}return this.sc.length=d,this.Qu=this.sc,this.sc}Oc(){let t;this.Ku=!0,this.Ms(this.yn.barSpacing),t=void 0!==this.yn.rightOffsetPixels?this.yn.rightOffsetPixels/this.fl():this.yn.rightOffset,this.gs(t)}Nc(t){this.Ku=!0,this.Uu=t,this.kc(),this.dc()}Fc(t,e){let i=this.Dc(t),s=this.fl();this.Ms(s+s/10*e),this.yn.rightBarStaysOnScroll||this.gs(this.Ac()+(i-this.Dc(t)))}l_(t){this.xo&&this.d_(),null===this.So&&null===this.Ju&&(this.Gi()||(this.So=t,this.Wc()))}o_(t){if(null===this.Ju)return;let e=fO(this.C_-t,0,this.C_),i=fO(this.C_-dh(this.So),0,this.C_);0!==e&&0!==i&&this.Ms(this.Ju.fl*e/i)}__(){null!==this.So&&(this.So=null,this.Hc())}u_(t){null===this.xo&&null===this.Ju&&(this.Gi()||(this.xo=t,this.Wc()))}c_(t){if(null===this.xo)return;let e=(this.xo-t)/this.fl();this.rc=dh(this.Ju).Ac+e,this.Ku=!0,this.kc()}d_(){null!==this.xo&&(this.xo=null,this.Hc())}Uc(){this.$c(this.yn.rightOffset)}$c(t,e=400){if(!isFinite(t))throw RangeError("offset is required and must be finite number");if(!isFinite(e)||e<=0)throw RangeError("animationDuration (optional) must be finite positive number");let i=this.rc,s=performance.now();this.sn.ps({jc:t=>(t-s)/e>=1,qc:n=>{let r=(n-s)/e;return r>=1?t:i+(t-i)*r}})}kt(t,e){this.Ku=!0,this.$u=t,this.ju.Vu(t,e),this.kc()}Yc(){return this.Zu}Kc(){return this.Gu}Zc(){return this.Xu}Pc(){return this.Uu||0}Gc(t,e){let i=t.Tu(),s=e&&this.yn.rightOffsetPixels||0;this.Ec((this.C_-s)/i),this.rc=t.bi()-this.Pc(),e&&(this.rc=s?s/this.fl():this.yn.rightOffset),this.kc(),this.Ku=!0,this.sn.Bc(),this.sn.mr()}Xc(){let t=this.Sc(),e=this.xc();if(null===t||null===e)return;let i=!this.yn.rightOffsetPixels&&this.yn.rightOffset||0;this.Gc(new f7(t,e+i),!0)}Jc(t){let e=new f7(t.from,t.to);this.Gc(e)}rn(t){return void 0!==this.Po.timeFormatter?this.Po.timeFormatter(t.originalTime):this.xu.formatHorzItem(t.time)}_c(){if(this.yn.ignoreWhitespaceIndices){for(let t of(this.tc.clear(),this.sn.Jn()))for(let e of t.ul())this.tc.set(e,!0);this.nc++}}Qc(){return this.ec}Ml(){let t=1/(window.devicePixelRatio||1),e=this.yn.minBarSpacing;if(e>=t)return[1];let i=[1],s=2;for(;s<=512;)e0?this.yn.maxBarSpacing:.5*this.C_}ed(){return this.yn.fixLeftEdge&&this.yn.fixRightEdge&&0!==this.$u.length?this.C_/this.$u.length:this.yn.minBarSpacing}oc(){if(!this.yn.enableConflation)return void(this.ec=1);let t=1/(window.devicePixelRatio||1)*(this.yn.conflationThresholdFactor??1);if(this.hc>=t)return void(this.ec=1);let e=Math.pow(2,Math.floor(Math.log2(t/this.hc)));this.ec=Math.min(e,512)}kc(){let t=this.hd();null!==t&&this.rce&&(this.rc=e,this.Ku=!0)}hd(){let t=this.Sc(),e=this.Uu;return null===t||null===e?null:t-e-1+(this.yn.fixLeftEdge?this.C_/this.hc:Math.min(2,this.$u.length))}ad(){return this.yn.fixRightEdge?0:this.C_/this.hc-Math.min(2,this.$u.length)}Wc(){this.Ju={fl:this.fl(),Ac:this.Ac()}}Hc(){this.Ju=null}zc(t){let e=this.qu.get(t.weight);return void 0===e&&(e=new f9(t=>this.ld(t),this.xu),this.qu.set(t.weight,e)),e.Cu(t)}ld(t){return this.xu.formatTickmark(t,this.Po)}sd(t){let e=this.Yu;this.Yu=t,f8(e.Fu(),this.Yu.Fu())||this.Zu.p(),f8(e.Wu(),this.Yu.Wu())||this.Gu.p(),this.nd()}nd(){this.Qu=null}cc(){this.nd(),this.qu.clear()}lc(){this.xu.updateFormatter(this.Po)}dc(){if(!this.yn.fixLeftEdge)return;let t=this.Sc();if(null===t)return;let e=this.Ee();if(null===e)return;let i=e.Oa()-t;if(i<0){let t=this.rc-i-1;this.gs(t)}this.yc()}fc(){this.kc(),this.yc()}Ic(t){return!this.yn.ignoreWhitespaceIndices||this.tc.get(t)||!1}Vc(t){let e=function*(t){let e=Math.round(t),i=ei)break}return t}ac(t){if(void 0!==t.rightOffsetPixels){let e=t.rightOffsetPixels/(t.barSpacing||this.hc);this.sn.gs(e)}}}(S=A||(A={}))[S.OnTouchEnd=0]="OnTouchEnd",S[S.OnNextTap=1]="OnNextTap";class pn{constructor(t,e,i){this.od=[],this._d=[],this.ud=null,this.C_=0,this.dd=null,this.fd=new dc,this.pd=new dc,this.vd=null,this.md=t,this.yn=e,this.xu=i,this.To=new dC(this.yn.layout.colorParsers),this.wd=new dS(this),this.ia=new ps(this,e.timeScale,this.yn.localization,i),this.Ct=new dU(this,e.crosshair),this.Md=new fD(e.crosshair),e.addDefaultPane&&(this.gd(0),this.od[0].O_(2)),this.bd=this.Sd(0),this.xd=this.Sd(1)}Pa(){this.Cd(dH.ys())}mr(){this.Cd(dH.Cs())}qa(){this.Cd(new dH(1))}Ta(t){let e=this.yd(t);this.Cd(e)}ou(){return this.dd}kd(t){if(this.dd?.lu===t?.lu&&this.dd?.wu?.te===t?.wu?.te&&this.dd?.wu?.ie===t?.wu?.ie&&this.dd?.mu===t?.mu&&this.dd?.ee===t?.ee)return;let e=this.dd;this.dd=t,null!==e&&this.Ta(e.lu),null!==t&&t.lu!==e?.lu&&this.Ta(t.lu)}N(){return this.yn}vr(t){dd(this.yn,t),this.od.forEach(e=>e.E_(t)),void 0!==t.timeScale&&this.ia.vr(t.timeScale),void 0!==t.localization&&this.ia.uc(t.localization),(t.leftPriceScale||t.rightPriceScale)&&this.fd.p(),this.bd=this.Sd(0),this.xd=this.Sd(1),this.Pa()}Pd(t,e,i=0){let s=this.od[i];if(void 0===s)return;if("left"===t)return dd(this.yn,{leftPriceScale:e}),s.E_({leftPriceScale:e}),this.fd.p(),void this.Pa();if("right"===t)return dd(this.yn,{rightPriceScale:e}),s.E_({rightPriceScale:e}),this.fd.p(),void this.Pa();let n=this.Td(t,i);null!==n&&(n.Ft.vr(e),this.fd.p())}Td(t,e){let i=this.od[e];if(void 0===i)return null;let s=i.A_(t);return null!==s?{Kn:i,Ft:s}:null}Et(){return this.ia}Zn(){return this.od}Rd(){return this.Ct}Dd(){return this.pd}Id(t,e){t.Wo(e),this.Bc()}N_(t){this.C_=t,this.ia.N_(this.C_),this.od.forEach(e=>e.N_(t)),this.Bc()}Vd(t){1!==this.od.length&&(dl(t>=0&&t=0&&tt+e.z_(),0),n=this.od.reduce((t,e)=>t+e.$t(),0),r=n-30*(this.od.length-1);e=Math.min(r,Math.max(30,e));let o=s/n,l=i.$t();i.O_(e*o);let a=e-l,h=this.od.length-1;for(let t of this.od)if(t!==i){let e=Math.min(r,Math.max(30,t.$t()-a/h));a-=t.$t()-e,h-=1;let i=e*o;t.O_(i)}this.Pa()}Ed(t,e){dl(t>=0&&t=0&&e=0&&t=0&&et.It())),this.ud}ka(){this.ud=null}jd(t,e,i,s,n){this.Ct.In(t,e);let r=NaN,o=this.ia.Rc(t,!0),l=this.ia.Ee();null!==l&&(o=Math.min(Math.max(l.Oa(),o),l.bi())),o=this.Ct.Fn(o);let a=s.Pn(),h=a.Lt();if(null!==h&&(r=a.Tn(e,h)),r=this.Md.xl(r,o,s),this.Ct.An(o,r,s),this.qa(),!n){let n=f6(s,t,e);this.kd(n&&{lu:n.lu,wu:n.wu,mu:n.mu||null,ee:n.ee}),this.pd.p(this.Ct.Bt(),{x:t,y:e},i)}}qd(t,e,i){let s=i.Pn(),n=s.Lt(),r=s.Nt(t,dh(n)),o=this.ia.vc(e,!0),l=this.ia.jt(dh(o));this.jd(l,r,null,i,!0)}Yd(t){this.Rd().zn(),this.qa(),t||this.pd.p(null,null,null)}Ra(){let t=this.Ct.Kn();if(null!==t){let e=this.Ct.Bn(),i=this.Ct.En();this.jd(e,i,null,t)}this.Ct.Nn()}Kd(t,e,i){let s=this.ia.Rn(0);void 0!==e&&void 0!==i&&this.ia.kt(e,i);let n=this.ia.Rn(0),r=this.ia.Pc(),o=this.ia.Ee();if(null!==o&&null!==s&&null!==n){let e=o.ze(r),l=this.xu.key(s)>this.xu.key(n),a=null!==t&&t>r&&!l,h=this.ia.N().allowShiftVisibleRangeOnWhitespaceReplacement,u=e&&(void 0!==i||h)&&this.ia.N().shiftVisibleRangeOnNewBar;if(a&&!u){let e=t-r;this.ia.gs(this.ia.Ac()-e)}}this.ia.Nc(t)}Va(t){null!==t&&t.hu()}Ks(t){if(t instanceof f2)return t;let e=this.od.find(e=>e.Dt().includes(t));return void 0===e?null:e}Bc(){this.od.forEach(t=>t.hu()),this.Ra()}m(){this.od.forEach(t=>t.m()),this.od.length=0,this.yn.localization.priceFormatter=void 0,this.yn.localization.percentageFormatter=void 0,this.yn.localization.timeFormatter=void 0}Zd(){return this.wd}Js(){return this.wd.N()}L_(){return this.fd}Gd(t,e){let i=this.gd(e);this.Xd(t,i),this._d.push(t),this.ka(),1===this._d.length?this.Pa():this.mr()}Jd(t){let e=this.Ks(t),i=this._d.indexOf(t);dl(-1!==i,"Series not found");let s=dh(e);this._d.splice(i,1),s.r_(t),t.m&&t.m(),this.ka(),this.ia._c(),this.Qd(s)}ya(t,e){let i=dh(this.Ks(t));i.r_(t,!0),i.s_(t,e,!0)}Xc(){let t=dH.Cs();t.us(),this.Cd(t)}tf(t){let e=dH.Cs();e.fs(t),this.Cd(e)}ws(){let t=dH.Cs();t.ws(),this.Cd(t)}Ms(t){let e=dH.Cs();e.Ms(t),this.Cd(e)}gs(t){let e=dH.Cs();e.gs(t),this.Cd(e)}ps(t){let e=dH.Cs();e.ps(t),this.Cd(e)}cs(){let t=dH.Cs();t.cs(),this.Cd(t)}if(){let t=this.yn.defaultVisiblePriceScaleId,e=this.yn.leftPriceScale.visible;return e!==this.yn.rightPriceScale.visible?e?"left":"right":t}nf(t,e){if(dl(e>=0,"Index should be greater or equal to 0"),e===this.sf(t))return;let i=dh(this.Ks(t));i.r_(t);let s=this.gd(e);this.Xd(t,s);let n=!1;0===i.Cl().length&&(n=this.Qd(i)),n||this.Pa()}ef(){return this.xd}$(){return this.bd}Ut(t){let e=this.xd,i=this.bd;if(e===i)return e;if(t=Math.max(0,Math.min(100,Math.round(100*t))),null===this.vd||this.vd.ah!==i||this.vd.oh!==e)this.vd={ah:i,oh:e,rf:new Map};else{let e=this.vd.rf.get(t);if(void 0!==e)return e}let s=this.To.tt(i,e,t/100);return this.vd.rf.set(t,s),s}hf(t){return this.od.indexOf(t)}Xi(){return this.To}af(){return this.lf()}lf(t){let e=new f2(this.ia,this);this.od.push(e);let i=t??this.od.length-1,s=dH.ys();return s.es(i,{rs:0,hs:!0}),this.Cd(s),e}gd(t){return dl(t>=0,"Index should be greater or equal to 0"),(t=Math.min(this.od.length,t))e.U_().includes(t))}Ld(t,e){let i=new dH(e);if(null!==t){let s=this.od.indexOf(t);i.es(s,{rs:e})}return i}yd(t,e){return void 0===e&&(e=2),this.Ld(this.Ks(t),e)}Cd(t){this.md&&this.md(t),this.od.forEach(t=>t.pu().wr().kt())}Xd(t,e){let i=t.N().priceScaleId,s=void 0!==i?i:this.if();e.s_(t,s),dQ(s)||t.vr(t.N())}Sd(t){let e=this.yn.layout;return"gradient"===e.background.type?0===t?e.background.topColor:e.background.bottomColor:e.background.color}Qd(t){return!t.H_()&&0===t.Cl().length&&this.od.length>1&&(this.od.splice(this.hf(t),1),this.Pa(),!0)}}function pr(t){if(t>=1)return 0;let e=0;for(;e<8&&!(1e-8>Math.abs(Math.round(t)-t));e++)t*=10;return e}function po(t){return!df(t)&&!dm(t)}(M=j||(j={}))[M.Disabled=0]="Disabled",M[M.Continuous=1]="Continuous",M[M.OnDataUpdate=2]="OnDataUpdate",(k=z||(z={}))[k.LastBar=0]="LastBar",k[k.LastVisible=1]="LastVisible",(C=D||(D={})).Solid="solid",C.VerticalGradient="gradient",(E=O||(O={}))[E.Year=0]="Year",E[E.Month=1]="Month",E[E.DayOfMonth=2]="DayOfMonth",E[E.Time=3]="Time",E[E.TimeWithSeconds=4]="TimeWithSeconds";class pl{constructor(t="yyyy-MM-dd",e="default"){this._f=t,this.uf=e}Cu(t){return function(t,e,i){return e.replace(/yyyy/g,dY(t.getUTCFullYear(),4)).replace(/yy/g,dY(t.getUTCFullYear()%100,2)).replace(/MMMM/g,new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"long"})).replace(/MMM/g,new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"short"})).replace(/MM/g,dY(t.getUTCMonth()+1,2)).replace(/dd/g,dY(t.getUTCDate(),2))}(t,this._f,this.uf)}}class pa{constructor(t){this.cf=t||"%h:%m:%s"}Cu(t){return this.cf.replace("%h",dY(t.getUTCHours(),2)).replace("%m",dY(t.getUTCMinutes(),2)).replace("%s",dY(t.getUTCSeconds(),2))}}let ph={df:"yyyy-MM-dd",ff:"%h:%m:%s",pf:" ",vf:"default"};class pu{constructor(t={}){const e={...ph,...t};this.mf=new pl(e.df,e.vf),this.wf=new pa(e.ff),this.Mf=e.pf}Cu(t){return`${this.mf.Cu(t)}${this.Mf}${this.wf.Cu(t)}`}}function pc(t){return 60*t*6e4}function pd(t){return 60*t*1e3}let pf=[{gf:1e3,bf:10},{gf:pd(1),bf:20},{gf:pd(5),bf:21},{gf:pd(30),bf:22},{gf:pc(1),bf:30},{gf:pc(3),bf:31},{gf:pc(6),bf:32},{gf:pc(12),bf:33}];function pp(t,e){if(t.getUTCFullYear()!==e.getUTCFullYear())return 70;if(t.getUTCMonth()!==e.getUTCMonth())return 60;if(t.getUTCDate()!==e.getUTCDate())return 50;for(let i=pf.length-1;i>=0;--i)if(Math.floor(e.getTime()/pf[i].gf)!==Math.floor(t.getTime()/pf[i].gf))return pf[i].bf;return 0}function pm(t){let e=t;if(dm(t)&&(e=pv(t)),!po(e))throw Error("time must be of type BusinessDay");return{Sf:Math.round(new Date(Date.UTC(e.year,e.month-1,e.day,0,0,0,0)).getTime()/1e3),xf:e}}function pg(t){if(!df(t))throw Error("time must be of type isUTCTimestamp");return{Sf:t}}function pv(t){let e=new Date(t);if(isNaN(e.getTime()))throw Error(`Invalid date string=${t}, expected format=yyyy-mm-dd`);return{day:e.getUTCDate(),month:e.getUTCMonth()+1,year:e.getUTCFullYear()}}function pb(t){dm(t.time)&&(t.time=pv(t.time))}class py{options(){return this.yn}setOptions(t){this.yn=t,this.updateFormatter(t.localization)}preprocessData(t){Array.isArray(t)?t.forEach(pb):pb(t)}createConverterToInternalObj(t){return dh(0===t.length?null:po(t[0].time)||dm(t[0].time)?pm:pg)}key(t){return"object"==typeof t&&"Sf"in t?t.Sf:this.key(this.convertHorzItemToInternal(t))}cacheKey(t){return void 0===t.xf?new Date(1e3*t.Sf).getTime():new Date(Date.UTC(t.xf.year,t.xf.month-1,t.xf.day)).getTime()}convertHorzItemToInternal(t){return df(t)?pg(t):po(t)?pm(t):pm(pv(t))}updateFormatter(t){if(!this.yn)return;let e=t.dateFormat;this.yn.timeScale.timeVisible?this.Cf=new pu({df:e,ff:this.yn.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",pf:" ",vf:t.locale}):this.Cf=new pl(e,t.locale)}formatHorzItem(t){return this.Cf.Cu(new Date(1e3*t.Sf))}formatTickmark(t,e){let i=function(t,e,i){switch(t){case 0:case 10:return e?i?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return e?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(t.weight,this.yn.timeScale.timeVisible,this.yn.timeScale.secondsVisible),s=this.yn.timeScale;if(void 0!==s.tickMarkFormatter){let n=s.tickMarkFormatter(t.originalTime,i,e.locale);if(null!==n)return n}return function(t,e,i){let s={};switch(e){case 0:s.year="numeric";break;case 1:s.month="short";break;case 2:s.day="numeric";break;case 3:s.hour12=!1,s.hour="2-digit",s.minute="2-digit";break;case 4:s.hour12=!1,s.hour="2-digit",s.minute="2-digit",s.second="2-digit"}let n=new Date(void 0===t.xf?1e3*t.Sf:Date.UTC(t.xf.year,t.xf.month-1,t.xf.day));return new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()).toLocaleString(i,s)}(t.time,i,e.locale)}maxTickMarkWeight(t){let e=t.reduce(pi,t[0]).weight;return e>30&&e<50&&(e=30),e}fillWeightsForPoints(t,e){!function(t,e=0){if(0===t.length)return;let i=0===e?null:t[e-1].time.Sf,s=null!==i?new Date(1e3*i):null,n=0;for(let r=e;r1){let e=Math.ceil(n/(t.length-1)),i=new Date(1e3*(t[0].time.Sf-e));t[0].timeWeight=pp(new Date(1e3*t[0].time.Sf),i)}}(t,e)}static yf(t){return dd({localization:{dateFormat:"dd MMM 'yy"}},t??{})}}let px="u">typeof window;function pw(){return!!px&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function pS(){return!!px&&/iPhone|iPad|iPod/.test(window.navigator.platform)}class pM{constructor(t,e,i){this.kf=0,this.Pf=null,this.Tf={_t:-1/0,ut:1/0},this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0},this.Vf=null,this.Bf=!1,this.Ef=null,this.Af=null,this.Lf=!1,this.zf=!1,this.Of=!1,this.Nf=null,this.Ff=null,this.Wf=null,this.Hf=null,this.Uf=null,this.$f=null,this.jf=null,this.qf=0,this.Yf=!1,this.Kf=!1,this.Zf=!1,this.Gf=0,this.Xf=null,this.Jf=!pS(),this.Qf=t=>{this.tp(t)},this.ip=t=>{if(this.np(t)){let e=this.sp(t);if(++this.Rf,this.Df&&this.Rf>1){let{ep:i}=this.rp(pE(t),this.If);i<30&&!this.Of&&this.hp(e,this.lp.ap),this.op()}}else{let e=this.sp(t);if(++this.kf,this.Pf&&this.kf>1){let{ep:i}=this.rp(pE(t),this.Tf);i<5&&!this.zf&&this._p(e,this.lp.up),this.cp()}}},this.dp=t,this.lp=e,this.yn=i,this.fp()}m(){null!==this.Nf&&(this.Nf(),this.Nf=null),null!==this.Ff&&(this.Ff(),this.Ff=null),null!==this.Hf&&(this.Hf(),this.Hf=null),null!==this.Uf&&(this.Uf(),this.Uf=null),null!==this.$f&&(this.$f(),this.$f=null),null!==this.Wf&&(this.Wf(),this.Wf=null),this.pp(),this.cp()}vp(t){this.Hf&&this.Hf();let e=this.mp.bind(this);if(this.Hf=()=>{this.dp.removeEventListener("mousemove",e)},this.dp.addEventListener("mousemove",e),this.np(t))return;let i=this.sp(t);this._p(i,this.lp.wp),this.Jf=!0}cp(){null!==this.Pf&&clearTimeout(this.Pf),this.kf=0,this.Pf=null,this.Tf={_t:-1/0,ut:1/0}}op(){null!==this.Df&&clearTimeout(this.Df),this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0}}mp(t){if(this.Zf||null!==this.Af||this.np(t))return;let e=this.sp(t);this._p(e,this.lp.Mp),this.Jf=!0}gp(t){let e=pP(t.changedTouches,dh(this.Xf));if(null===e||(this.Gf=pT(t),null!==this.jf)||this.Kf)return;this.Yf=!0;let{bp:i,Sp:s,ep:n}=this.rp(pE(e),dh(this.Af));if(this.Lf||!(n<5)){if(!this.Lf){let t=.5*i,e=s>=t&&!this.yn.xp(),n=t>s&&!this.yn.Cp();e||n||(this.Kf=!0),this.Lf=!0,this.Of=!0,this.pp(),this.op()}if(!this.Kf){let i=this.sp(t,e);this.hp(i,this.lp.yp),pC(t)}}}kp(t){if(0!==t.button)return;let{ep:e}=this.rp(pE(t),dh(this.Ef));if(e>=5&&(this.zf=!0,this.cp()),this.zf){let e=this.sp(t);this._p(e,this.lp.Pp)}}rp(t,e){let i=Math.abs(e._t-t._t),s=Math.abs(e.ut-t.ut);return{bp:i,Sp:s,ep:i+s}}Tp(t){let e=pP(t.changedTouches,dh(this.Xf));if(null===e&&0===t.touches.length&&(e=t.changedTouches[0]),null===e)return;this.Xf=null,this.Gf=pT(t),this.pp(),this.Af=null,this.$f&&(this.$f(),this.$f=null);let i=this.sp(t,e);if(this.hp(i,this.lp.Rp),++this.Rf,this.Df&&this.Rf>1){let{ep:t}=this.rp(pE(e),this.If);t<30&&!this.Of&&this.hp(i,this.lp.ap),this.op()}else this.Of||(this.hp(i,this.lp.Dp),this.lp.Dp&&pC(t));0===this.Rf&&pC(t),0===t.touches.length&&this.Bf&&(this.Bf=!1,pC(t))}tp(t){if(0!==t.button)return;let e=this.sp(t);if(this.Ef=null,this.Zf=!1,this.Uf&&(this.Uf(),this.Uf=null),pw()&&this.dp.ownerDocument.documentElement.removeEventListener("mouseleave",this.Qf),!this.np(t))if(this._p(e,this.lp.Ip),++this.kf,this.Pf&&this.kf>1){let{ep:i}=this.rp(pE(t),this.Tf);i<5&&!this.zf&&this._p(e,this.lp.up),this.cp()}else this.zf||this._p(e,this.lp.Vp)}pp(){null!==this.Vf&&(clearTimeout(this.Vf),this.Vf=null)}Bp(t){if(null!==this.Xf)return;let e=t.changedTouches[0];this.Xf=e.identifier,this.Gf=pT(t);let i=this.dp.ownerDocument.documentElement;this.Of=!1,this.Lf=!1,this.Kf=!1,this.Af=pE(e),this.$f&&(this.$f(),this.$f=null);{let e=this.gp.bind(this),s=this.Tp.bind(this);this.$f=()=>{i.removeEventListener("touchmove",e),i.removeEventListener("touchend",s)},i.addEventListener("touchmove",e,{passive:!1}),i.addEventListener("touchend",s,{passive:!1}),this.pp(),this.Vf=setTimeout(this.Ep.bind(this,t),240)}let s=this.sp(t,e);this.hp(s,this.lp.Ap),this.Df||(this.Rf=0,this.Df=setTimeout(this.op.bind(this),500),this.If=pE(e))}Lp(t){if(0!==t.button)return;let e=this.dp.ownerDocument.documentElement;pw()&&e.addEventListener("mouseleave",this.Qf),this.zf=!1,this.Ef=pE(t),this.Uf&&(this.Uf(),this.Uf=null);{let t=this.kp.bind(this),i=this.tp.bind(this);this.Uf=()=>{e.removeEventListener("mousemove",t),e.removeEventListener("mouseup",i)},e.addEventListener("mousemove",t),e.addEventListener("mouseup",i)}if(this.Zf=!0,this.np(t))return;let i=this.sp(t);this._p(i,this.lp.zp),this.Pf||(this.kf=0,this.Pf=setTimeout(this.cp.bind(this),500),this.Tf=pE(t))}fp(){var t;this.dp.addEventListener("mouseenter",this.vp.bind(this)),this.dp.addEventListener("touchcancel",this.pp.bind(this));{let t=this.dp.ownerDocument,e=t=>{this.lp.Op&&(t.composed&&this.dp.contains(t.composedPath()[0])||t.target&&this.dp.contains(t.target)||this.lp.Op())};this.Ff=()=>{t.removeEventListener("touchstart",e)},this.Nf=()=>{t.removeEventListener("mousedown",e)},t.addEventListener("mousedown",e),t.addEventListener("touchstart",e,{passive:!0})}pS()&&(this.Wf=()=>{this.dp.removeEventListener("dblclick",this.ip)},this.dp.addEventListener("dblclick",this.ip)),this.dp.addEventListener("mouseleave",this.Np.bind(this)),this.dp.addEventListener("touchstart",this.Bp.bind(this),{passive:!0}),t=this.dp,px&&void 0!==window.chrome&&t.addEventListener("mousedown",t=>{if(1===t.button)return t.preventDefault(),!1}),this.dp.addEventListener("mousedown",this.Lp.bind(this)),this.Fp(),this.dp.addEventListener("touchmove",()=>{},{passive:!1})}Fp(){void 0===this.lp.Wp&&void 0===this.lp.Hp&&void 0===this.lp.Up||(this.dp.addEventListener("touchstart",t=>this.$p(t.touches),{passive:!0}),this.dp.addEventListener("touchmove",t=>{if(2===t.touches.length&&null!==this.jf&&void 0!==this.lp.Hp){let e=pk(t.touches[0],t.touches[1])/this.qf;this.lp.Hp(this.jf,e),pC(t)}},{passive:!1}),this.dp.addEventListener("touchend",t=>{this.$p(t.touches)}))}$p(t){1===t.length&&(this.Yf=!1),2!==t.length||this.Yf||this.Bf?this.jp():this.qp(t)}qp(t){let e=this.dp.getBoundingClientRect()||{left:0,top:0};this.jf={_t:(t[0].clientX-e.left+(t[1].clientX-e.left))/2,ut:(t[0].clientY-e.top+(t[1].clientY-e.top))/2},this.qf=pk(t[0],t[1]),void 0!==this.lp.Wp&&this.lp.Wp(),this.pp()}jp(){null!==this.jf&&(this.jf=null,void 0!==this.lp.Up&&this.lp.Up())}Np(t){if(this.Hf&&this.Hf(),this.np(t)||!this.Jf)return;let e=this.sp(t);this._p(e,this.lp.Yp),this.Jf=!pS()}Ep(t){let e=pP(t.touches,dh(this.Xf));if(null===e)return;let i=this.sp(t,e);this.hp(i,this.lp.Kp),this.Of=!0,this.Bf=!0}np(t){return t.sourceCapabilities&&void 0!==t.sourceCapabilities.firesTouchEvents?t.sourceCapabilities.firesTouchEvents:pT(t){"touchstart"!==t.type&&pC(t)}}}}function pk(t,e){let i=t.clientX-e.clientX,s=t.clientY-e.clientY;return Math.sqrt(i*i+s*s)}function pC(t){t.cancelable&&t.preventDefault()}function pE(t){return{_t:t.pageX,ut:t.pageY}}function pT(t){return t.timeStamp||performance.now()}function pP(t,e){for(let i=0;i!1,Cp:()=>!0}),this.Qp={vv:i,pv:t}}ov(){this.lv.style.background=this.sv.N().layout.panes.separatorColor}mv(t){null!==this.Qp&&(this.Qp.vv.style.backgroundColor=this.sv.N().layout.panes.separatorHoverColor)}wv(t){null!==this.Qp&&null===this.nv&&(this.Qp.vv.style.backgroundColor="")}Mv(t){if(null===this.Qp)return;let e=this.ev.Sv().z_()+this.hv.Sv().z_(),i=e/(this.ev.cv().height+this.hv.cv().height),s=30*i;e<=2*s||(this.nv={xv:t.pageY,Cv:this.ev.Sv().z_(),yv:e-s,kv:e,Pv:i,Tv:s},this.Qp.pv.style.display="block")}gv(t){let e=this.nv;if(null===e)return;let i=(t.pageY-e.xv)*e.Pv,s=fO(e.Cv+i,e.Tv,e.yv);this.ev.Sv().O_(s),this.hv.Sv().O_(e.kv-s),this.sv.Qt().Pa()}bv(t){null!==this.nv&&null!==this.Qp&&(this.nv=null,this.Qp.pv.style.display="none")}}function p_(t,e,i){let s=(t.Rv-e.Rv)/(t.wt-e.wt);return Math.sign(s)*Math.min(Math.abs(s),i)}class pL{constructor(t,e,i,s){this.Dv=null,this.Iv=null,this.Vv=null,this.Bv=null,this.Ev=null,this.Av=0,this.Lv=0,this.zv=t,this.Ov=e,this.Nv=i,this.ks=s}Fv(t,e){if(null!==this.Dv){if(this.Dv.wt===e)return void(this.Dv.Rv=t);if(Math.abs(this.Dv.Rv-t)50)return;let u=0,c=p_(this.Dv,this.Iv,this.Ov),d=(i=this.Dv,s=this.Iv,i.Rv-s.Rv),f=[c],p=[d];if(u+=d,null!==this.Vv){let t=p_(this.Iv,this.Vv,this.Ov);if(Math.sign(t)===Math.sign(c)){let e=(n=this.Iv,r=this.Vv,n.Rv-r.Rv);if(f.push(t),p.push(e),u+=e,null!==this.Bv){let t=p_(this.Vv,this.Bv,this.Ov);if(Math.sign(t)===Math.sign(c)){let e=(o=this.Vv,l=this.Bv,o.Rv-l.Rv);f.push(t),p.push(e),u+=e}}}}let m=0;for(let t=0;t160?"dark":"light"}Gv(){return this.qv.N().layout.attributionLogo}Jv(){let t=new URL(location.href);return t.hostname?"&utm_source="+t.hostname+t.pathname:""}Yv(){this.Zv()&&(this.Kv(),this.vn=this.Gv(),this.vn&&(this.$v=this.Xv(),this.Uv=document.createElement("style"),this.Uv.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.Hv=document.createElement("a"),this.Hv.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.Jv()}`,this.Hv.title="Charting by TradingView",this.Hv.id="tv-attr-logo",this.Hv.target="_blank",this.Hv.innerHTML='',this.Hv.toggleAttribute("data-dark","dark"===this.$v),this.jv.appendChild(this.Uv),this.jv.appendChild(this.Hv)))}}function pA(t,e){let i=dh(t.ownerDocument).createElement("canvas");t.appendChild(i);let s=function(t,e){if("device-pixel-content-box"===e.type)return new c8(t,e.transform,e.options);throw Error("Unsupported binding target")}(i,{type:"device-pixel-content-box",options:{allowResizeObserver:!0},transform:(t,e)=>({width:Math.max(t.width,e.width),height:Math.max(t.height,e.height)})});return s.resizeCanvasElement(e),s}function pj(t){t.width=1,t.height=1,t.getContext("2d")?.clearRect(0,0,1,1)}function pz(t,e,i,s){t.qh&&t.qh(e,i,s)}function pD(t,e,i,s){t.st(e,i,s)}function pO(t,e,i,s){for(let n of t(i,s)){let t=n.Tt(s);null!==t&&e(t)}}function pI(t,e){return i=>void 0===i.Ft||(i.Ft()?.cl()??"")!==e?[]:i.Ga?.(t)??[]}function pV(t,e,i,s){if(!t.length)return;let n=0,r=t[0].$t(s,!0),o=1===e?i/2-(t[0].Hi()-r/2):t[0].Hi()-r/2-i/2;o=Math.max(0,o);for(let r=1;rc-h:ui)&&o>0){let s=Math.min(1===e?-1-r:r-i,o);for(let i=n;i{this.rm||this.yt.am().Qt().mr()},this.lm=()=>{this.rm||this.yt.am().Qt().mr()},this.yt=t,this.yn=e,this.ko=e.layout,this.wd=i,this.om="left"===s,this._m=pI("normal",s),this.um=pI("top",s),this.dm=pI("bottom",s),this.lv=document.createElement("div"),this.lv.style.height="100%",this.lv.style.overflow="hidden",this.lv.style.width="25px",this.lv.style.left="0",this.lv.style.position="relative",this.fm=pA(this.lv,c6({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);const n=this.fm.canvasElement;n.style.position="absolute",n.style.zIndex="1",n.style.left="0",n.style.top="0",this.pm=pA(this.lv,c6({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);const r=this.pm.canvasElement;r.style.position="absolute",r.style.zIndex="2",r.style.left="0",r.style.top="0";const o={zp:this.Mv.bind(this),Ap:this.Mv.bind(this),Pp:this.gv.bind(this),yp:this.gv.bind(this),Op:this.vm.bind(this),Ip:this.bv.bind(this),Rp:this.bv.bind(this),up:this.wm.bind(this),ap:this.wm.bind(this),wp:this.Mm.bind(this),Yp:this.wv.bind(this)};this.tv=new pM(this.pm.canvasElement,o,{xp:()=>!this.yn.handleScroll.vertTouchDrag,Cp:()=>!0})}m(){this.tv.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),pj(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),pj(this.fm.canvasElement),this.fm.dispose(),null!==this.Ki&&this.Ki.a_().u(this),this.Ki=null}uv(){return this.lv}k(){return this.ko.fontSize}gm(){let t=this.wd.N();return this.nm!==t.P&&(this.im.Os(),this.nm=t.P),t}bm(){var t,e;if(null===this.Ki)return 0;let i=0,s=this.gm(),n=dh(this.fm.canvasElement.getContext("2d",{colorSpace:this.yt.am().N().layout.colorSpace}));n.save();let r=this.Ki.El();n.font=this.Sm(),r.length>0&&(i=Math.max(this.im.Ii(n,r[0].io),this.im.Ii(n,r[r.length-1].io)));let o=this.xm();for(let t=o.length;t--;){let e=this.im.Ii(n,o[t].ri());e>i&&(i=e)}let l=this.Ki.Lt();if(null!==l&&null!==this.Qv&&2!==(t=this.yn.crosshair).mode&&t.horzLine.visible&&t.horzLine.labelVisible){let t=this.Ki.Tn(1,l),e=this.Ki.Tn(this.Qv.height-2,l);i=Math.max(i,this.im.Ii(n,this.Ki.Ji(Math.floor(Math.min(t,e))+.11111111111111,l)),this.im.Ii(n,this.Ki.Ji(Math.ceil(Math.max(t,e))-.11111111111111,l)))}n.restore();let a=i||34;return(e=Math.ceil(s.S+s.C+s.V+s.B+5+a))+e%2}Cm(t){null!==this.Qv&&c9(this.Qv,t)||(this.Qv=t,this.rm=!0,this.fm.resizeCanvasElement(t),this.pm.resizeCanvasElement(t),this.rm=!1,this.lv.style.width=`${t.width}px`,this.lv.style.height=`${t.height}px`)}ym(){return dh(this.Qv).width}un(t){this.Ki!==t&&(null!==this.Ki&&this.Ki.a_().u(this),this.Ki=t,t.a_().i(this.po.bind(this),this))}Ft(){return this.Ki}Os(){let t=this.yt.Sv();this.yt.am().Qt().eu(t,dh(this.Ft()))}km(t){if(null===this.Qv)return;let e={colorSpace:this.yt.am().N().layout.colorSpace};if(1!==t){this.Pm(),this.fm.applySuggestedBitmapSize();let t=di(this.fm,e);null!==t&&(t.useBitmapCoordinateSpace(t=>{this.Tm(t),this.Rm(t)}),this.yt.Dm(t,this.dm),this.Im(t),this.yt.Dm(t,this._m),this.Vm(t))}this.pm.applySuggestedBitmapSize();let i=di(this.pm,e);null!==i&&(i.useBitmapCoordinateSpace(({context:t,bitmapSize:e})=>{t.clearRect(0,0,e.width,e.height)}),this.Bm(i),this.yt.Dm(i,this.um))}dv(){return this.fm.bitmapSize}fv(t,e,i,s){let n=this.dv();if(n.width>0&&n.height>0&&(t.drawImage(this.fm.canvasElement,e,i),s)){let s=this.pm.canvasElement;t.drawImage(s,e,i)}}kt(){this.Ki?.El()}Mv(t){if(null===this.Ki||this.Ki.Gi()||!this.yn.handleScale.axisPressedMouseMove.price)return;let e=this.yt.am().Qt(),i=this.yt.Sv();this.tm=!0,e.G_(i,this.Ki,t.localY)}gv(t){if(null===this.Ki||!this.yn.handleScale.axisPressedMouseMove.price)return;let e=this.yt.am().Qt(),i=this.yt.Sv(),s=this.Ki;e.X_(i,s,t.localY)}vm(){if(null===this.Ki||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt.am().Qt(),e=this.yt.Sv(),i=this.Ki;this.tm&&(this.tm=!1,t.J_(e,i))}bv(t){if(null===this.Ki||!this.yn.handleScale.axisPressedMouseMove.price)return;let e=this.yt.am().Qt(),i=this.yt.Sv();this.tm=!1,e.J_(i,this.Ki)}wm(t){this.yn.handleScale.axisDoubleClickReset.price&&this.Os()}Mm(t){null!==this.Ki&&(!this.yt.am().Qt().N().handleScale.axisPressedMouseMove.price||this.Ki.je()||this.Ki.Lo()||this.Em(1))}wv(t){this.Em(0)}xm(){let t=[],e=null===this.Ki?void 0:this.Ki;return(i=>{for(let s=0;s{t.fillStyle=i.borderColor;let l=Math.max(1,Math.floor(o)),a=Math.floor(.5*o),h=Math.round(s.C*r);for(let i of(t.beginPath(),e))t.rect(Math.floor(n*r),Math.round(i.Rl*o)-a,h,l);t.fill()}),t.useMediaCoordinateSpace(({context:t})=>{t.font=this.Sm(),t.fillStyle=i.textColor??this.ko.textColor,t.textAlign=this.om?"right":"left",t.textBaseline="middle";let r=this.om?Math.round(n-s.V):Math.round(n+s.C+s.V),o=e.map(e=>this.im.Di(t,e.io));for(let i=e.length;i--;){let s=e[i];t.fillText(s.io,r,s.Rl+o[i])}})}Pm(){if(null===this.Qv||null===this.Ki)return;let t=this.Qv.height/2,e=[],i=this.Ki.Dt().slice(),s=this.yt.Sv(),n=this.gm();this.Ki===s.Gs()&&this.yt.Sv().Dt().forEach(t=>{s.Zs(t)&&i.push(t)});let r=this.Ki.Cl()[0],o=this.Ki;i.forEach(i=>{let n=i.qn(s,o);n.forEach(t=>{t.$i()&&null===t.Wi()&&(t.Ui(null),e.push(t))}),r===i&&n.length>0&&(t=n[0].Ei())}),this.Ki.N().alignLabels&&this.Am(e,n,t)}Am(t,e,i){if(null===this.Qv)return;let s=t.filter(t=>t.Ei()<=i),n=t.filter(t=>t.Ei()>i);for(let i of(s.sort((t,e)=>e.Ei()-t.Ei()),s.length&&n.length&&n.push(s[0]),n.sort((t,e)=>t.Ei()-e.Ei()),t)){let t=Math.floor(i.$t(e)/2),s=i.Ei();s>-t&&sthis.Qv.height-t&&s{e.ji()&&e.Tt(dh(this.Ki)).st(t,i,this.im,s)})}Bm(t){if(null===this.Qv||null===this.Ki)return;let e=this.yt.am().Qt(),i=[],s=this.yt.Sv(),n=e.Rd().qn(s,this.Ki);n.length&&i.push(n);let r=this.gm(),o=this.om?"right":"left";i.forEach(e=>{e.forEach(e=>{e.Tt(dh(this.Ki)).st(t,r,this.im,o)})})}Em(t){this.lv.style.cursor=1===t?"ns-resize":"default"}po(){let t=this.bm();this.sm{this.rm||null===this.Zm||this.sn().mr()},this.lm=()=>{this.rm||null===this.Zm||this.sn().mr()},this.qv=t,this.Zm=e,this.Zm.fu().i(this.Gm.bind(this),this,!0),this.Xm=document.createElement("td"),this.Xm.style.padding="0",this.Xm.style.position="relative";const i=document.createElement("div");i.style.width="100%",i.style.height="100%",i.style.position="relative",i.style.overflow="hidden",this.Jm=document.createElement("td"),this.Jm.style.padding="0",this.Qm=document.createElement("td"),this.Qm.style.padding="0",this.Xm.appendChild(i),this.fm=pA(i,c6({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);const s=this.fm.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.pm=pA(i,c6({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);const n=this.pm.canvasElement;n.style.position="absolute",n.style.zIndex="2",n.style.left="0",n.style.top="0",this.av=document.createElement("tr"),this.av.appendChild(this.Jm),this.av.appendChild(this.Xm),this.av.appendChild(this.Qm),this.tw(),this.tv=new pM(this.pm.canvasElement,this,{xp:()=>null===this.jm&&!this.qv.N().handleScroll.vertTouchDrag,Cp:()=>null===this.jm&&!this.qv.N().handleScroll.horzTouchDrag})}m(){null!==this.Lm&&this.Lm.m(),null!==this.zm&&this.zm.m(),this.Om=null,this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),pj(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),pj(this.fm.canvasElement),this.fm.dispose(),null!==this.Zm&&(this.Zm.fu().u(this),this.Zm.m()),this.tv.m()}Sv(){return dh(this.Zm)}iw(t){null!==this.Zm&&this.Zm.fu().u(this),this.Zm=t,null!==this.Zm&&this.Zm.fu().i(pU.prototype.Gm.bind(this),this,!0),this.tw(),this.qv.rv().indexOf(this)===this.qv.rv().length-1?(this.Om=this.Om??new pN(this.Xm,this.qv),this.Om.kt()):(this.Om?.Kv(),this.Om=null)}am(){return this.qv}uv(){return this.av}tw(){if(null!==this.Zm&&(this.nw(),0!==this.sn().Jn().length)){if(null!==this.Lm){let t=this.Zm.K_();this.Lm.un(dh(t))}if(null!==this.zm){let t=this.Zm.Z_();this.zm.un(dh(t))}}}sw(){null!==this.Lm&&this.Lm.kt(),null!==this.zm&&this.zm.kt()}z_(){return null!==this.Zm?this.Zm.z_():0}O_(t){this.Zm&&this.Zm.O_(t)}wp(t){if(!this.Zm)return;this.ew();let e=t.localX,i=t.localY;this.rw(e,i,t)}zp(t){this.ew(),this.hw(),this.rw(t.localX,t.localY,t)}Mp(t){if(!this.Zm)return;this.ew();let e=t.localX,i=t.localY;this.rw(e,i,t)}Vp(t){null!==this.Zm&&(this.ew(),this.rw(t.localX,t.localY,t),this.aw(t))}up(t){null!==this.Zm&&this.lw(this.Hm,t)}ap(t){this.up(t)}Pp(t){this.ew(),this.ow(t),this.rw(t.localX,t.localY,t)}Ip(t){null!==this.Zm&&(this.ew(),this.$m=!1,this._w(t))}Dp(t){null!==this.Zm&&this.aw(t)}Kp(t){if(this.$m=!0,null===this.jm){let e={x:t.localX,y:t.localY};this.uw(e,e,t)}}Yp(t){null!==this.Zm&&(this.ew(),this.Zm.Qt().kd(null),this.cw())}dw(){return this.Wm}fw(){return this.Hm}Wp(){this.Um=1,this.sn().cs()}Hp(t,e){if(!this.qv.N().handleScale.pinch)return;let i=5*(e-this.Um);this.Um=e,this.sn().Od(t._t,i)}Ap(t){this.$m=!1,this.qm=null!==this.jm,this.hw();let e=this.sn().Rd();null!==this.jm&&e.It()&&(this.Ym={x:e.ni(),y:e.si()},this.jm={x:t.localX,y:t.localY})}yp(t){if(null===this.Zm)return;let e=t.localX,i=t.localY;if(null===this.jm)this.ow(t);else{this.qm=!1;let s=dh(this.Ym),n=s.x+(e-this.jm.x),r=s.y+(i-this.jm.y);this.rw(n,r,t)}}Rp(t){0===this.am().N().trackingMode.exitMode&&(this.qm=!0),this.pw(),this._w(t)}Qs(t,e){let i=this.Zm;return null===i?null:f6(i,t,e)}mw(t,e){dh("left"===e?this.Lm:this.zm).Cm(c6({width:t,height:this.Qv.height}))}cv(){return this.Qv}Cm(t){c9(this.Qv,t)||(this.Qv=t,this.rm=!0,this.fm.resizeCanvasElement(t),this.pm.resizeCanvasElement(t),this.rm=!1,this.Xm.style.width=t.width+"px",this.Xm.style.height=t.height+"px")}ww(){let t=dh(this.Zm);for(let e of(t.q_(t.K_()),t.q_(t.Z_()),t.Cl()))if(t.Zs(e)){let i=e.Ft();null!==i&&t.q_(i),e.Nn()}for(let e of t.vu())e.Nn()}dv(){return this.fm.bitmapSize}fv(t,e,i,s){let n=this.dv();if(n.width>0&&n.height>0&&(t.drawImage(this.fm.canvasElement,e,i),s)){let s=this.pm.canvasElement;null!==t&&t.drawImage(s,e,i)}}km(t){if(0===t||null===this.Zm)return;t>1&&this.ww(),null!==this.Lm&&this.Lm.km(t),null!==this.zm&&this.zm.km(t);let e={colorSpace:this.qv.N().layout.colorSpace};if(1!==t){this.fm.applySuggestedBitmapSize();let t=di(this.fm,e);null!==t&&(t.useBitmapCoordinateSpace(t=>{this.Tm(t)}),this.Zm&&(this.Mw(t,pB),this.gw(t),this.Mw(t,pW),this.Mw(t,p$)))}this.pm.applySuggestedBitmapSize();let i=di(this.pm,e);null!==i&&(i.useBitmapCoordinateSpace(({context:t,bitmapSize:e})=>{t.clearRect(0,0,e.width,e.height)}),this.bw(i),this.Mw(i,pK),this.Mw(i,p$))}Sw(){return this.Lm}xw(){return this.zm}Dm(t,e){this.Mw(t,e)}Gm(){null!==this.Zm&&this.Zm.fu().u(this),this.Zm=null}aw(t){this.lw(this.Wm,t)}lw(t,e){let i=e.localX,s=e.localY;t.v()&&t.p(this.sn().Et().Rc(i),{x:i,y:s},e)}Tm({context:t,bitmapSize:e}){let{width:i,height:s}=e,n=this.sn(),r=n.$(),o=n.ef();r===o?dj(t,0,0,i,s,o):dO(t,0,0,i,s,r,o)}gw(t){let e=dh(this.Zm),i=e.pu().wr().Tt(e);null!==i&&i.st(t,!1)}bw(t){this.Cw(t,pW,pD,this.sn().Rd())}Mw(t,e){let i=dh(this.Zm),s=i.au(),n=i.vu();for(let i of n)this.Cw(t,e,pz,i);for(let i of s)this.Cw(t,e,pz,i);for(let i of n)this.Cw(t,e,pD,i);for(let i of s)this.Cw(t,e,pD,i)}Cw(t,e,i,s){let n=dh(this.Zm),r=n.Qt().ou(),o=null!==r&&r.lu===s,l=null!==r&&o&&void 0!==r.wu?r.wu.ie:void 0;pO(e,e=>i(e,t,o,l),s,n)}nw(){if(null===this.Zm)return;let t=this.qv,e=this.Zm.K_().N().visible,i=this.Zm.Z_().N().visible;e||null===this.Lm||(this.Jm.removeChild(this.Lm.uv()),this.Lm.m(),this.Lm=null),i||null===this.zm||(this.Qm.removeChild(this.zm.uv()),this.zm.m(),this.zm=null);let s=t.Qt().Zd();e&&null===this.Lm&&(this.Lm=new pF(this,t.N(),s,"left"),this.Jm.appendChild(this.Lm.uv())),i&&null===this.zm&&(this.zm=new pF(this,t.N(),s,"right"),this.Qm.appendChild(this.zm.uv()))}yw(t){return t.Zp&&this.$m||null!==this.jm}rw(t,e,i){t=Math.max(0,Math.min(t,this.Qv.width-1)),e=Math.max(0,Math.min(e,this.Qv.height-1)),this.sn().jd(t,e,i,dh(this.Zm))}cw(){this.sn().Yd()}pw(){this.qm&&(this.jm=null,this.cw())}uw(t,e,i){this.jm=t,this.qm=!1,this.rw(e.x,e.y,i);let s=this.sn().Rd();this.Ym={x:s.ni(),y:s.si()}}sn(){return this.qv.Qt()}_w(t){if(!this.Fm)return;let e=this.sn(),i=this.Sv();if(e.iu(i,i.Pn()),this.Nm=null,this.Fm=!1,e.Hd(),null!==this.Km){let t=performance.now(),i=e.Et();this.Km.me(i.Ac(),t),this.Km.jc(t)||e.ps(this.Km)}}ew(){this.jm=null}hw(){if(this.Zm){if(this.sn().cs(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)dh(document.activeElement).blur();else{let t=document.getSelection();null!==t&&t.removeAllRanges()}this.Zm.Pn().Gi()||this.sn().Et().Gi()}}ow(t){if(null===this.Zm)return;let e=this.sn(),i=e.Et();if(i.Gi())return;let s=this.qv.N(),n=s.handleScroll,r=s.kineticScroll;if((!n.pressedMouseMove||t.Zp)&&(!n.horzTouchDrag&&!n.vertTouchDrag||!t.Zp))return;let o=this.Zm.Pn(),l=performance.now();if(null!==this.Nm||this.yw(t)||(this.Nm={x:t.clientX,y:t.clientY,Sf:l,kw:t.localX,Pw:t.localY}),null!==this.Nm&&!this.Fm&&(this.Nm.x!==t.clientX||this.Nm.y!==t.clientY)){if(t.Zp&&r.touch||!t.Zp&&r.mouse){let t=i.fl();this.Km=new pL(.2/t,7/t,.997,15/t),this.Km.Fv(i.Ac(),this.Nm.Sf)}else this.Km=null;o.Gi()||e.Q_(this.Zm,o,t.localY),e.Fd(t.localX),this.Fm=!0}this.Fm&&(o.Gi()||e.tu(this.Zm,o,t.localY),e.Wd(t.localX),null!==this.Km&&this.Km.Fv(i.Ac(),l))}}class pQ{constructor(t,e,i,s,n){this.xt=!0,this.Qv=c6({width:0,height:0}),this.hm=()=>this.km(3),this.om="left"===t,this.wd=i.Zd,this.yn=e,this.Tw=s,this.Rw=n,this.lv=document.createElement("div"),this.lv.style.width="25px",this.lv.style.height="100%",this.lv.style.overflow="hidden",this.fm=pA(this.lv,c6({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm)}m(){this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),pj(this.fm.canvasElement),this.fm.dispose()}uv(){return this.lv}cv(){return this.Qv}Cm(t){c9(this.Qv,t)||(this.Qv=t,this.fm.resizeCanvasElement(t),this.lv.style.width=`${t.width}px`,this.lv.style.height=`${t.height}px`,this.xt=!0)}km(t){if(t<3&&!this.xt||0===this.Qv.width||0===this.Qv.height)return;this.xt=!1,this.fm.applySuggestedBitmapSize();let e=di(this.fm,{colorSpace:this.yn.layout.colorSpace});null!==e&&e.useBitmapCoordinateSpace(t=>{this.Tm(t),this.Rm(t)})}dv(){return this.fm.bitmapSize}fv(t,e,i){let s=this.dv();s.width>0&&s.height>0&&t.drawImage(this.fm.canvasElement,e,i)}Rm({context:t,bitmapSize:e,horizontalPixelRatio:i,verticalPixelRatio:s}){if(!this.Tw())return;t.fillStyle=this.yn.timeScale.borderColor;let n=Math.floor(this.wd.N().S*i),r=Math.floor(this.wd.N().S*s),o=this.om?e.width-n:0;t.fillRect(o,0,n,r)}Tm({context:t,bitmapSize:e}){dj(t,0,0,e.width,e.height,this.Rw())}}function pH(t){return e=>e.Xa?.(t)??[]}let pq=pH("normal"),pY=pH("top"),pG=pH("bottom");class pZ{constructor(t,e){this.Dw=null,this.Iw=null,this.M=null,this.Vw=!1,this.Qv=c6({width:0,height:0}),this.Bw=new dc,this.im=new d0(5),this.rm=!1,this.hm=()=>{this.rm||this.qv.Qt().mr()},this.lm=()=>{this.rm||this.qv.Qt().mr()},this.qv=t,this.xu=e,this.yn=t.N().layout,this.Hv=document.createElement("tr"),this.Ew=document.createElement("td"),this.Ew.style.padding="0",this.Aw=document.createElement("td"),this.Aw.style.padding="0",this.lv=document.createElement("td"),this.lv.style.height="25px",this.lv.style.padding="0",this.Lw=document.createElement("div"),this.Lw.style.width="100%",this.Lw.style.height="100%",this.Lw.style.position="relative",this.Lw.style.overflow="hidden",this.lv.appendChild(this.Lw),this.fm=pA(this.Lw,c6({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);const i=this.fm.canvasElement;i.style.position="absolute",i.style.zIndex="1",i.style.left="0",i.style.top="0",this.pm=pA(this.Lw,c6({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);const s=this.pm.canvasElement;s.style.position="absolute",s.style.zIndex="2",s.style.left="0",s.style.top="0",this.Hv.appendChild(this.Ew),this.Hv.appendChild(this.lv),this.Hv.appendChild(this.Aw),this.zw(),this.qv.Qt().L_().i(this.zw.bind(this),this),this.tv=new pM(this.pm.canvasElement,this,{xp:()=>!0,Cp:()=>!this.qv.N().handleScroll.horzTouchDrag})}m(){this.tv.m(),null!==this.Dw&&this.Dw.m(),null!==this.Iw&&this.Iw.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),pj(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),pj(this.fm.canvasElement),this.fm.dispose()}uv(){return this.Hv}Ow(){return this.Dw}Nw(){return this.Iw}zp(t){if(this.Vw)return;this.Vw=!0;let e=this.qv.Qt();!e.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&e.zd(t.localX)}Ap(t){this.zp(t)}Op(){let t=this.qv.Qt();!t.Et().Gi()&&this.Vw&&(this.Vw=!1,this.qv.N().handleScale.axisPressedMouseMove.time&&t.$d())}Pp(t){let e=this.qv.Qt();!e.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&e.Ud(t.localX)}yp(t){this.Pp(t)}Ip(){this.Vw=!1;let t=this.qv.Qt();t.Et().Gi()&&!this.qv.N().handleScale.axisPressedMouseMove.time||t.$d()}Rp(){this.Ip()}up(){this.qv.N().handleScale.axisDoubleClickReset.time&&this.qv.Qt().ws()}ap(){this.up()}wp(){this.qv.Qt().N().handleScale.axisPressedMouseMove.time&&this.Em(1)}Yp(){this.Em(0)}cv(){return this.Qv}Fw(){return this.Bw}Ww(t,e,i){c9(this.Qv,t)||(this.Qv=t,this.rm=!0,this.fm.resizeCanvasElement(t),this.pm.resizeCanvasElement(t),this.rm=!1,this.lv.style.width=`${t.width}px`,this.lv.style.height=`${t.height}px`,this.Bw.p(t)),null!==this.Dw&&this.Dw.Cm(c6({width:e,height:t.height})),null!==this.Iw&&this.Iw.Cm(c6({width:i,height:t.height}))}Hw(){let t=this.Uw();return Math.ceil(t.S+t.C+t.k+t.A+t.I+t.$w)}kt(){this.qv.Qt().Et().El()}dv(){return this.fm.bitmapSize}fv(t,e,i,s){let n=this.dv();if(n.width>0&&n.height>0&&(t.drawImage(this.fm.canvasElement,e,i),s)){let s=this.pm.canvasElement;t.drawImage(s,e,i)}}km(t){if(0===t)return;let e={colorSpace:this.yn.colorSpace};if(1!==t){this.fm.applySuggestedBitmapSize();let i=di(this.fm,e);null!==i&&(i.useBitmapCoordinateSpace(t=>{this.Tm(t),this.Rm(t),this.jw(i,pG)}),this.Im(i),this.jw(i,pq)),null!==this.Dw&&this.Dw.km(t),null!==this.Iw&&this.Iw.km(t)}this.pm.applySuggestedBitmapSize();let i=di(this.pm,e);null!==i&&(i.useBitmapCoordinateSpace(({context:t,bitmapSize:e})=>{t.clearRect(0,0,e.width,e.height)}),this.qw([...this.qv.Qt().Jn(),this.qv.Qt().Rd()],i),this.jw(i,pY))}jw(t,e){let i=this.qv.Qt().Jn();for(let s of i)pO(e,e=>pz(e,t,!1,void 0),s,void 0);for(let s of i)pO(e,e=>pD(e,t,!1,void 0),s,void 0)}Tm({context:t,bitmapSize:e}){dj(t,0,0,e.width,e.height,this.qv.Qt().ef())}Rm({context:t,bitmapSize:e,verticalPixelRatio:i}){if(this.qv.N().timeScale.borderVisible){t.fillStyle=this.Yw();let s=Math.max(1,Math.floor(this.Uw().S*i));t.fillRect(0,0,e.width,s)}}Im(t){let e=this.qv.Qt().Et(),i=e.El();if(!i||0===i.length)return;let s=this.xu.maxTickMarkWeight(i),n=this.Uw(),r=e.N();r.borderVisible&&r.ticksVisible&&t.useBitmapCoordinateSpace(({context:t,horizontalPixelRatio:e,verticalPixelRatio:s})=>{t.strokeStyle=this.Yw(),t.fillStyle=this.Yw();let r=Math.max(1,Math.floor(e)),o=Math.floor(.5*e);t.beginPath();let l=Math.round(n.C*s);for(let s=i.length;s--;){let n=Math.round(i[s].coord*e);t.rect(n-o,0,r,l)}t.fill()}),t.useMediaCoordinateSpace(({context:t})=>{let e=n.S+n.C+n.A+n.k/2;for(let n of(t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.H(),t.font=this.Sm(),i))if(n.weight=s){let i=n.needAlignCoordinate?this.Kw(t,n.coord,n.label):n.coord;t.fillText(n.label,i,e)}})}Kw(t,e,i){let s=this.im.Ii(t,i),n=Math.floor(e-s/2)+.5;return n<0?e+=Math.abs(0-n):n+s>this.Qv.width&&(e-=Math.abs(this.Qv.width-(n+s))),e}qw(t,e){let i=this.Uw();for(let s of t)for(let t of s.dn())t.Tt().st(e,i)}Yw(){return this.qv.N().timeScale.borderColor}H(){return this.yn.textColor}F(){return this.yn.fontSize}Sm(){return dw(this.F(),this.yn.fontFamily)}Zw(){return dw(this.F(),this.yn.fontFamily,"bold")}Uw(){null===this.M&&(this.M={S:1,L:NaN,A:NaN,I:NaN,tn:NaN,C:5,k:NaN,P:"",Qi:new d0,$w:0});let t=this.M,e=this.Sm();if(t.P!==e){let i=this.F();t.k=i,t.P=e,t.A=3*i/12,t.I=3*i/12,t.tn=9*i/12,t.L=0,t.$w=4*i/12,t.Qi.Os()}return this.M}Em(t){this.lv.style.cursor=1===t?"ew-resize":"default"}zw(){let t=this.qv.Qt(),e=t.N();e.leftPriceScale.visible||null===this.Dw||(this.Ew.removeChild(this.Dw.uv()),this.Dw.m(),this.Dw=null),e.rightPriceScale.visible||null===this.Iw||(this.Aw.removeChild(this.Iw.uv()),this.Iw.m(),this.Iw=null);let i={Zd:this.qv.Qt().Zd()},s=()=>e.leftPriceScale.borderVisible&&t.Et().N().borderVisible,n=()=>t.ef();e.leftPriceScale.visible&&null===this.Dw&&(this.Dw=new pQ("left",e,i,s,n),this.Ew.appendChild(this.Dw.uv())),e.rightPriceScale.visible&&null===this.Iw&&(this.Iw=new pQ("right",e,i,s,n),this.Aw.appendChild(this.Iw.uv()))}}let pX=!!px&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(t=>t.brand.includes("Chromium"))&&!!px&&(navigator?.userAgentData?.platform?"Windows"===navigator.userAgentData.platform:navigator.userAgent.toLowerCase().indexOf("win")>=0);class pJ{constructor(t,e,i){var s;this.Gw=[],this.Xw=[],this.Jw=0,this.ho=0,this.C_=0,this.Qw=0,this.tM=0,this.iM=null,this.nM=!1,this.Wm=new dc,this.Hm=new dc,this.pd=new dc,this.sM=null,this.eM=null,this.jv=t,this.yn=e,this.xu=i,this.Hv=document.createElement("div"),this.Hv.classList.add("tv-lightweight-charts"),this.Hv.style.overflow="hidden",this.Hv.style.direction="ltr",this.Hv.style.width="100%",this.Hv.style.height="100%",(s=this.Hv).style.userSelect="none",s.style.webkitUserSelect="none",s.style.msUserSelect="none",s.style.MozUserSelect="none",s.style.webkitTapHighlightColor="transparent",this.rM=document.createElement("table"),this.rM.setAttribute("cellspacing","0"),this.Hv.appendChild(this.rM),this.hM=this.aM.bind(this),p0(this.yn)&&this.lM(!0),this.sn=new pn(this.md.bind(this),this.yn,i),this.Qt().Dd().i(this.oM.bind(this),this),this._M=new pZ(this,this.xu),this.rM.appendChild(this._M.uv());const n=e.autoSize&&this.uM();let r=this.yn.width,o=this.yn.height;if(n||0===r||0===o){const e=t.getBoundingClientRect();r=r||e.width,o=o||e.height}this.cM(r,o),this.dM(),t.appendChild(this.Hv),this.fM(),this.sn.Et().Zc().i(this.sn.Pa.bind(this.sn),this),this.sn.L_().i(this.sn.Pa.bind(this.sn),this)}Qt(){return this.sn}N(){return this.yn}rv(){return this.Gw}pM(){return this._M}m(){for(let t of(this.lM(!1),0!==this.Jw&&window.cancelAnimationFrame(this.Jw),this.sn.Dd().u(this),this.sn.Et().Zc().u(this),this.sn.L_().u(this),this.sn.m(),this.Gw))this.rM.removeChild(t.uv()),t.dw().u(this),t.fw().u(this),t.m();for(let t of(this.Gw=[],this.Xw))this.vM(t);this.Xw=[],dh(this._M).m(),null!==this.Hv.parentElement&&this.Hv.parentElement.removeChild(this.Hv),this.pd.m(),this.Wm.m(),this.Hm.m(),this.mM()}cM(t,e,i=!1){var s;let n,r;if(this.ho===e&&this.C_===t)return;let o=(n=Math.floor((s=c6({width:t,height:e})).width),c6({width:n-n%2,height:(r=Math.floor(s.height))-r%2}));this.ho=o.height,this.C_=o.width;let l=this.ho+"px",a=this.C_+"px";if(this.wM()||(dh(this.Hv).style.height=l,dh(this.Hv).style.width=a),this.rM.style.height=l,this.rM.style.width=a,i){0!==this.Jw&&(window.cancelAnimationFrame(this.Jw),this.Jw=0),this.nM=!1;let t=dH.ys();null!==this.iM&&(t.Ss(this.iM),this.iM=null),this.MM(t,performance.now())}else this.sn.Pa()}km(t){void 0===t&&(t=dH.ys());for(let e=0;e{t.kt()})}bM(t){(void 0!==t.autoSize||!this.sM||void 0===t.width&&void 0===t.height)&&(t.autoSize&&!this.sM&&this.uM(),!1===t.autoSize&&null!==this.sM&&this.mM(),t.autoSize||void 0===t.width&&void 0===t.height||this.cM(t.width||this.C_,t.height||this.ho))}xM(t,e){let i=0,s=0,n=this.Gw[0],r=(i,s)=>{let n=0;for(let r=0;r{dh("left"===e?this._M.Ow():this._M.Nw()).fv(dh(t),i,s)};if(this.yn.timeScale.visible){let i=this._M.dv();if(null!==t){let r=0;this.yM()&&(o("left",r,s),r=dh(n.Sw()).dv().width),this._M.fv(t,r,s,e),r+=i.width,this.kM()&&o("right",r,s)}s+=i.height}return c6({width:i,height:s})}DM(){var t,e,i;let s=0,n=0,r=0;for(let t of this.Gw)this.yM()&&(n=Math.max(n,dh(t.Sw()).bm(),this.yn.leftPriceScale.minimumWidth)),this.kM()&&(r=Math.max(r,dh(t.xw()).bm(),this.yn.rightPriceScale.minimumWidth)),s+=t.z_();n=(e=n)+e%2,r=(i=r)+i%2;let o=this.C_,l=this.ho,a=Math.max(o-n-r,0),h=+this.Xw.length,u=this.yn.timeScale.visible,c=u?Math.max(this._M.Hw(),this.yn.timeScale.minimumHeight):0,d=h+(c=(t=c)+t%2),f=l{t.sw()}),3===this.iM?.ls()&&(this.iM.Ss(t),this.VM(),this.BM(this.iM),this.EM(this.iM,e),t=this.iM,this.iM=null)),this.km(t)}EM(t,e){for(let i of t.bs())this.xs(i,e)}BM(t){let e=this.sn.Zn();for(let i=0;i{if(this.nM=!1,this.Jw=0,null!==this.iM){let e=this.iM;for(let i of(this.iM=null,this.MM(e,t),e.bs()))if(5===i.ds&&!i.Wt.jc(t)){this.Qt().ps(i.Wt);break}}}))}VM(){this.dM()}vM(t){this.rM.removeChild(t.uv()),t.m()}dM(){let t=this.sn.Zn(),e=t.length,i=this.Gw.length;for(let t=e;t0){let t=new pR(this,s-1,s);this.Xw.push(t),this.rM.insertBefore(t.uv(),this._M.uv())}this.rM.insertBefore(e.uv(),this._M.uv())}for(let i=0;i{let i=e.Un().Hn(t);null!==i&&h.set(e,i)}),null!==t){let e=this.sn.Et().en(t)?.originalTime;void 0!==e&&(o=e)}let u=this.Qt().ou(),c=this.OM(s),d=(l=null!==u&&u.lu instanceof fA?u.lu:void 0,a=u?.wu?.te,null===u||void 0===u.ee?{NM:l,FM:a}:{NM:l,FM:a,WM:{ds:u.ee,HM:(n=u.lu,r=u.ee,n instanceof f2?"pane-primitive":"marker"===r||"primitive"===r?"series-primitive":"series"),UM:function(t,e){switch(t){case"custom":return void 0!==e?"custom-object":"series";case"price-line":return"custom-price-line";case"marker":return"series-marker";case"primitive":return"primitive";default:return"series"}}(u.ee,a),U_:l,$M:a,jM:void 0!==c&&-1!==c?c:void 0}});return{Qr:o,$n:t??void 0,qM:e??void 0,jM:-1!==c?c:void 0,NM:d.NM,YM:h,FM:d.FM,WM:d.WM,KM:i??void 0}}OM(t){let e=-1;if(t)e=this.Gw.indexOf(t);else{let t=this.Qt().Rd().Kn();null!==t&&(e=this.Qt().Zn().indexOf(t))}return e}AM(t,e,i,s){this.Wm.p(()=>this.zM(e,i,s,t))}LM(t,e,i,s){this.Hm.p(()=>this.zM(e,i,s,t))}oM(t,e,i){this.PM(this.Qt().ou()?.mu??null),this.pd.p(()=>this.zM(t,e,i))}fM(){let t=this.yn.timeScale.visible?"":"none";this._M.uv().style.display=t}yM(){return this.Gw[0].Sv().K_().N().visible}kM(){return this.Gw[0].Sv().Z_().N().visible}uM(){return"ResizeObserver"in window&&(this.sM=new ResizeObserver(t=>{let e=t[t.length-1];if(!e)return;let i=e.contentRect.width,s=e.contentRect.height;this.cM(i,s,!0)}),this.sM.observe(this.jv,{box:"border-box"}),!0)}mM(){null!==this.sM&&this.sM.disconnect(),this.sM=null}}function p0(t){return!!(t.handleScroll.mouseWheel||t.handleScale.mouseWheel)}function p1(t,e,i,s){let n=i.value,r={$n:e,wt:t,Wt:[n,n,n,n],Qr:s};return void 0!==i.color&&(r.R=i.color),r}function p2(t,e,i,s){let n=i.value,r={$n:e,wt:t,Wt:[n,n,n,n],Qr:s};return void 0!==i.lineColor&&(r.vt=i.lineColor),void 0!==i.topColor&&(r.ah=i.topColor),void 0!==i.bottomColor&&(r.oh=i.bottomColor),r}function p5(t,e,i,s){let n=i.value,r={$n:e,wt:t,Wt:[n,n,n,n],Qr:s};return void 0!==i.topLineColor&&(r._h=i.topLineColor),void 0!==i.bottomLineColor&&(r.uh=i.bottomLineColor),void 0!==i.topFillColor1&&(r.dh=i.topFillColor1),void 0!==i.topFillColor2&&(r.fh=i.topFillColor2),void 0!==i.bottomFillColor1&&(r.ph=i.bottomFillColor1),void 0!==i.bottomFillColor2&&(r.mh=i.bottomFillColor2),r}function p3(t,e,i,s){let n={$n:e,wt:t,Wt:[i.open,i.high,i.low,i.close],Qr:s};return void 0!==i.color&&(n.R=i.color),n}function p4(t,e,i,s){let n={$n:e,wt:t,Wt:[i.open,i.high,i.low,i.close],Qr:s};return void 0!==i.color&&(n.R=i.color),void 0!==i.borderColor&&(n.Ht=i.borderColor),void 0!==i.wickColor&&(n.hh=i.wickColor),n}function p6(t,e,i,s,n){let r=da(n)(i),o=Math.max(...r),l=Math.min(...r),a=r[r.length-1],{time:h,color:u,...c}=i;return{$n:e,wt:t,Wt:[a,o,l,a],Qr:s,ue:c,R:u}}function p9(t){return void 0!==t.Wt}function p7(t,e){return void 0!==e.customValues&&(t.ZM=e.customValues),t}function p8(t){return(e,i,s,n,r,o)=>(o?o(s):void 0===s.open&&void 0===s.value)?p7({wt:e,$n:i,Qr:n},s):p7(t(e,i,s,n,r),s)}function mt(t){return({Candlestick:p8(p4),Bar:p8(p3),Area:p8(p2),Baseline:p8(p5),Histogram:p8(p1),Line:p8(p1),Custom:p8(p6)})[t]}function me(t){return{$n:0,GM:new Map,za:t}}function mi(t,e){if(void 0!==t&&0!==t.length)return{XM:e.key(t[0].wt),JM:e.key(t[t.length-1].wt)}}function ms(t){let e;return t.forEach(t=>{void 0===e&&(e=t.Qr)}),da(e)}class mn{constructor(t){this.QM=new Map,this.tg=new Map,this.ig=new Map,this.ng=[],this.xu=t}m(){this.QM.clear(),this.tg.clear(),this.ig.clear(),this.ng=[]}sg(t,e){let i=0!==this.QM.size,s=!1,n=this.tg.get(t);if(void 0!==n)if(1===this.tg.size)i=!1,s=!0,this.QM.clear();else for(let e of this.ng)e.pointData.GM.delete(t)&&(s=!0);let r=[];if(0!==e.length){let i=e.map(t=>t.time),n=this.xu.createConverterToInternalObj(e),o=mt(t.bh()),l=t.ll(),a=t.ol();r=e.map((e,r)=>{let h=n(e.time),u=this.xu.key(h),c=this.QM.get(u);void 0===c&&(c=me(h),this.QM.set(u,c),s=!0);let d=o(h,c.$n,e,i[r],l,a);return c.GM.set(t,d),d})}i&&this.eg(),this.rg(t,r);let o=-1;if(s){let t=[];this.QM.forEach(e=>{t.push({timeWeight:0,time:e.za,pointData:e,originalTime:ms(e.GM)})}),t.sort((t,e)=>this.xu.key(t.time)-this.xu.key(e.time)),o=this.hg(t)}return this.ag(t,o,function(t,e,i){let s=mi(t,i),n=mi(e,i);if(void 0!==s&&void 0!==n)return{lg:!1,Ia:s.JM>=n.JM&&s.XM>=n.XM}}(this.tg.get(t),n,this.xu))}Jd(t){return this.sg(t,[])}og(t,e,i){if(i&&t.Na())throw Error("Historical updates are not supported when conflation is enabled. Conflation requires data to be processed in order.");void 0===e.Qr&&(e.Qr=e.time),this.xu.preprocessData(e);let s=this.xu.createConverterToInternalObj([e])(e.time),n=this.ig.get(t);if(!i&&void 0!==n&&this.xu.key(s)this.xu.key(t.time)this.xu.key(s.wt)?p9(e)&&i.push(e):p9(e)?i[i.length-1]=e:i.splice(-1,1),this.ig.set(t,e.wt)}_g(t,e,i){let s=this.tg.get(t);if(void 0===s)return;let n=ff(s,i,(t,e)=>t.$n{0!==e.length&&(t=Math.max(t,e[e.length-1].$n))}),t}ag(t,e,i){let s=this.dg();if(-1!==e)this.tg.forEach((e,n)=>{s.U_.set(n,{ue:e,pg:n===t?i:void 0})}),this.tg.has(t)||s.U_.set(t,{ue:[],pg:i}),s.Et.vg=this.ng,s.Et.mg=e;else{let e=this.tg.get(t);s.U_.set(t,{ue:e||[],pg:i})}return s}dg(){return{U_:new Map,Et:{Pc:this.fg()}}}}function mr(t,e){t.$n=e,t.GM.forEach(t=>{t.$n=e})}function mo(t,e){return t._t=e.to||0===t.length)return null;let a=n/2+r,h=ff(t,i-a,mo,l=e.from,e.to),u=fp(t,i+a,ml,h,e.to);if(h>=u)return null;let c=1/0;for(let l=h;le.from?t[l-1]:void 0,u=lf)continue;o(a,mu);let p=mu[0],m=mu[1],g=Math.min(p,m),v=Math.max(p,m),b=g-r,y=v+r;s>=g&&s<=v?c=Math.min(c,0):s>=b&&s<=y&&(c=Math.min(c,Math.min(Math.abs(s-g),Math.abs(v-s))))}return Number.isFinite(c)?ma(c,0,"series-range"):null}function md(t,e){return t.wt({...t,...this.ae.Sa().Sh(t.wt)}))}Rg(){this.Sg=null}yg(){let t=this.le.Et(),e=t.N().enableConflation?t.Qc():0;e!==this.xg&&(this.Mg=!0,this.xg=e),this.Mg&&(this.Dg(),this.Mg=!1),this.gg&&(this.Tg(),this.gg=!1),this.wg&&(this.Ig(),this.wg=!1)}Ig(){let t=this.ae.Ft(),e=this.le.Et();if(this.Rg(),e.Gi()||t.Gi())return;let i=e.Ee();if(null===i||0===this.ae.Un().Th())return;let s=this.ae.Lt();null!==s&&(this.Sg=function(t,e,i){let s=e.Oa(),n=e.bi(),r=ff(t,s,md),o=fp(t,n,mf);if(!i)return{from:r,to:o};let l=r,a=o;return r>0&&r=s&&(l=r-1),o>0&&othis.Ag(t))}get ga(){return this.Yh.conflationReducer}Wa(t){return this.Yh.priceValueBuilder(t)}_l(t){return this.Yh.isWhitespace(t)}Pg(t,e){let i=this.Eg.hitTest?.(t,e,t=>this.Ag(t));if(null!=i)return{ne:i.distance,se:function(t){switch(t){case"point":return 2;case"range":return 0;default:return 1}}(i.type),ee:"custom",mu:i.cursorStyle,te:i.objectId,ie:i.hitTestData};let s=mc(this.bg,this.Sg,t,e,this.le.Et().fl(),this.ae.N().hitTestTolerance,(t,e)=>{let i=t.Lg,s=NaN,n=NaN;if(void 0!==i&&!this.Yh.isWhitespace(i))for(let t of this.Yh.priceValueBuilder(i)){let e=this.Ag(t);null!==e&&(s=Number.isNaN(s)?e:Math.min(s,e),n=Number.isNaN(n)?e:Math.max(n,e))}e[0]=s,e[1]=n});return null===s?null:{...s,ee:"custom"}}Dg(){let t=this.ae.Sa();this.bg=this.ae.Ha().Bh().map(e=>({wt:e.$n,_t:NaN,...t.Sh(e.$n),Lg:e.ue}))}Vg(t,e){e.Tc(this.bg,dy(this.Sg))}Bg(){this.Yh.update({bars:this.bg.map(mv),barSpacing:this.le.Et().fl(),visibleRange:this.Sg,conflationFactor:this.le.Et().Qc()},this.ae.N())}Ag(t){let e=this.ae.Lt();return null===e?null:this.ae.Ft().Nt(t,e.Wt)}}function mv(t){return{x:t._t,time:t.wt,originalData:t.Lg,barColor:t.sh}}let mb={color:"#2196f3"},my=(t,e,i)=>new mg(t,e,du(i));function mx(t){let e={value:t.Wt[3],time:t.Qr};return void 0!==t.ZM&&(e.customValues=t.ZM),e}function mw(t){let e=mx(t);return void 0!==t.R&&(e.color=t.R),e}function mS(t){let e=mx(t);return void 0!==t.vt&&(e.lineColor=t.vt),void 0!==t.ah&&(e.topColor=t.ah),void 0!==t.oh&&(e.bottomColor=t.oh),e}function mM(t){let e=mx(t);return void 0!==t._h&&(e.topLineColor=t._h),void 0!==t.uh&&(e.bottomLineColor=t.uh),void 0!==t.dh&&(e.topFillColor1=t.dh),void 0!==t.fh&&(e.topFillColor2=t.fh),void 0!==t.ph&&(e.bottomFillColor1=t.ph),void 0!==t.mh&&(e.bottomFillColor2=t.mh),e}function mk(t){let e={open:t.Wt[0],high:t.Wt[1],low:t.Wt[2],close:t.Wt[3],time:t.Qr};return void 0!==t.ZM&&(e.customValues=t.ZM),e}function mC(t){let e=mk(t);return void 0!==t.R&&(e.color=t.R),e}function mE(t){let e=mk(t),{R:i,Ht:s,hh:n}=t;return void 0!==i&&(e.color=i),void 0!==s&&(e.borderColor=s),void 0!==n&&(e.wickColor=n),e}function mT(t){return({Area:mS,Line:mw,Baseline:mM,Histogram:mw,Bar:mC,Candlestick:mE,Custom:mP})[t]}function mP(t){let e=t.Qr;return{...t.ue,time:e}}let mR={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1,doNotSnapToHiddenSeriesIndices:!1},m_={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},mL={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:dx,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},mN={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1,tickMarkDensity:2.5},mA={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1,enableConflation:!1,conflationThresholdFactor:1,precomputeConflationOnInit:!1,precomputeConflationPriority:"background"};function mj(){return{addDefaultPane:!0,hoveredSeriesOnTop:!0,width:0,height:0,autoSize:!1,layout:mL,crosshair:mR,grid:m_,overlayPriceScales:{...mN},leftPriceScale:{...mN,visible:!1},rightPriceScale:{...mN,visible:!0},defaultVisiblePriceScaleId:"right",timeScale:mA,localization:{locale:px?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class mz{constructor(t,e,i){this.sv=t,this.zg=e,this.Og=i??0}applyOptions(t){this.sv.Qt().Pd(this.zg,t,this.Og)}options(){return this.Ki().N()}width(){return dQ(this.zg)?this.sv.CM(this.zg):0}setVisibleRange(t){this.setAutoScale(!1),this.Ki().qo(new fi(t.from,t.to))}getVisibleRange(){let t,e,i=this.Ki().ar();if(null===i)return null;if(this.Ki().so()){let s=this.Ki().M_(),n=pr(s);t=Number((Math.round((i=fH(i,this.Ki().ro())).Je()/s)*s).toFixed(n)),e=Number((Math.round(i.Qe()/s)*s).toFixed(n))}else t=i.Je(),e=i.Qe();return{from:t,to:e}}setAutoScale(t){this.applyOptions({autoScale:t})}Ki(){return dh(this.sv.Qt().Td(this.zg,this.Og)).Ft}}class mD{constructor(t,e,i,s){this.sv=t,this.yt=i,this.Ng=e,this.Fg=s}getHeight(){return this.yt.$t()}setHeight(t){let e=this.sv.Qt(),i=e.hf(this.yt);e.Bd(i,t)}getStretchFactor(){return this.yt.z_()}setStretchFactor(t){this.yt.O_(t),this.sv.Qt().Pa()}paneIndex(){return this.sv.Qt().hf(this.yt)}moveTo(t){let e=this.paneIndex();e!==t&&(dl(t>=0&&tthis.Ng(t))??[]}getHTMLElement(){let t=this.sv.rv();return t&&0!==t.length&&t[this.paneIndex()]?t[this.paneIndex()].uv():null}attachPrimitive(t){this.yt.hl(t),t.attached&&t.attached({chart:this.Fg,requestUpdate:()=>this.yt.Qt().Pa()})}detachPrimitive(t){this.yt.al(t)}priceScale(t){if(null===this.yt.A_(t))throw Error(`Cannot find price scale with id: ${t}`);return new mz(this.sv,t,this.paneIndex())}setPreserveEmptyPane(t){this.yt.W_(t)}preserveEmptyPane(){return this.yt.H_()}addCustomSeries(t,e={},i=0){return this.Fg.addCustomSeries(t,e,i)}addSeries(t,e={}){return this.Fg.addSeries(t,e,this.paneIndex())}}let mO={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class mI{constructor(t){this._r=t}applyOptions(t){this._r.vr(t)}options(){return this._r.N()}Wg(){return this._r}}class mV{constructor(t,e,i,s,n,r){this.Hg=new dc,this.ae=t,this.Ug=e,this.$g=i,this.xu=n,this.Fg=s,this.jg=r}m(){this.Hg.m()}priceFormatter(){return this.ae.tl()}priceToCoordinate(t){let e=this.ae.Lt();return null===e?null:this.ae.Ft().Nt(t,e.Wt)}coordinateToPrice(t){let e=this.ae.Lt();return null===e?null:this.ae.Ft().Tn(t,e.Wt)}barsInLogicalRange(t){if(null===t)return null;let e=new pe(new f7(t.from,t.to)).Fu(),i=this.ae.Un();if(i.Gi())return null;let s=i.Hn(e.Oa(),1),n=i.Hn(e.bi(),-1),r=dh(i.Rh()),o=dh(i.Qn());if(null!==s&&null!==n&&s.$n>n.$n)return{barsBefore:t.from-r,barsAfter:o-t.to};let l={barsBefore:null===s||s.$n===r?t.from-r:s.$n-r,barsAfter:null===n||n.$n===o?o-t.to:o-n.$n};return null!==s&&null!==n&&(l.from=s.Qr,l.to=n.Qr),l}setData(t){this.xu,this.ae.bh(),this.Ug.qg(this.ae,t),this.Yg("full")}update(t,e=!1){this.ae.bh(),this.Ug.Kg(this.ae,t,e),this.Yg("update")}pop(t=1){let e=this.Ug.Zg(this.ae,t);0!==e.length&&this.Yg("update");let i=mT(this.seriesType());return e.map(t=>i(t))}dataByIndex(t,e){let i=this.ae.Un().Hn(t,e);return null===i?null:mT(this.seriesType())(i)}data(){let t=mT(this.seriesType());return this.ae.Un().Bh().map(e=>t(e))}subscribeDataChanged(t){this.Hg.i(t)}unsubscribeDataChanged(t){this.Hg._(t)}applyOptions(t){this.ae.vr(t)}options(){return dv(this.ae.N())}priceScale(){return this.$g.priceScale(this.ae.Ft().cl(),this.getPane().paneIndex())}createPriceLine(t){let e=dd(dv(mO),t);return new mI(this.ae.Ba(e))}removePriceLine(t){this.ae.Ea(t.Wg())}priceLines(){return this.ae.Aa().map(t=>new mI(t))}seriesType(){return this.ae.bh()}lastValueData(t){let e=this.ae.Ae(t);return e.Le?{noData:!0}:{noData:!1,price:e.Mt,color:e.R}}attachPrimitive(t){this.ae.hl(t),t.attached&&t.attached({chart:this.Fg,series:this,requestUpdate:()=>this.ae.Qt().Pa(),horzScaleBehavior:this.xu})}detachPrimitive(t){this.ae.al(t),t.detached&&t.detached(),this.ae.Qt().Pa()}getPane(){let t=this.ae,e=dh(this.ae.Qt().Ks(t));return this.jg(e)}moveToPane(t){this.ae.Qt().nf(this.ae,t)}seriesOrder(){let t=this.ae.Qt().Ks(this.ae);return null===t?-1:t.U_().indexOf(this.ae)}setSeriesOrder(t){let e=this.ae.Qt().Ks(this.ae);null!==e&&e.du(this.ae,t)}Yg(t){this.Hg.v()&&this.Hg.p(t)}}class mF{constructor(t,e,i){this.Gg=new dc,this.Gu=new dc,this.Bw=new dc,this.sn=t,this.ia=t.Et(),this._M=e,this.ia.Yc().i(this.Xg.bind(this)),this.ia.Kc().i(this.Jg.bind(this)),this._M.Fw().i(this.Qg.bind(this)),this.xu=i}m(){this.ia.Yc().u(this),this.ia.Kc().u(this),this._M.Fw().u(this),this.Gg.m(),this.Gu.m(),this.Bw.m()}scrollPosition(){return this.ia.Ac()}scrollToPosition(t,e){e?this.ia.$c(t,1e3):this.sn.gs(t)}scrollToRealTime(){this.ia.Uc()}getVisibleRange(){let t=this.ia.gc();return null===t?null:{from:t.from.originalTime,to:t.to.originalTime}}setVisibleRange(t){let e={from:this.xu.convertHorzItemToInternal(t.from),to:this.xu.convertHorzItemToInternal(t.to)},i=this.ia.Cc(e);this.sn.tf(i)}getVisibleLogicalRange(){let t=this.ia.Mc();return null===t?null:{from:t.Oa(),to:t.bi()}}setVisibleLogicalRange(t){dl(t.from<=t.to,"The from index cannot be after the to index."),this.sn.tf(t)}resetTimeScale(){this.sn.ws()}fitContent(){this.sn.Xc()}logicalToCoordinate(t){let e=this.sn.Et();return e.Gi()?null:e.jt(t)}coordinateToLogical(t){return this.ia.Gi()?null:this.ia.Rc(t)}timeToIndex(t,e){let i=this.xu.convertHorzItemToInternal(t);return this.ia.vc(i,e)}timeToCoordinate(t){let e=this.timeToIndex(t,!1);return null===e?null:this.ia.jt(e)}coordinateToTime(t){let e=this.sn.Et(),i=e.Rc(t),s=e.en(i);return null===s?null:s.originalTime}width(){return this._M.cv().width}height(){return this._M.cv().height}subscribeVisibleTimeRangeChange(t){this.Gg.i(t)}unsubscribeVisibleTimeRangeChange(t){this.Gg._(t)}subscribeVisibleLogicalRangeChange(t){this.Gu.i(t)}unsubscribeVisibleLogicalRangeChange(t){this.Gu._(t)}subscribeSizeChange(t){this.Bw.i(t)}unsubscribeSizeChange(t){this.Bw._(t)}applyOptions(t){this.ia.vr(t)}options(){return{...dv(this.ia.N()),barSpacing:this.ia.fl()}}Xg(){this.Gg.v()&&this.Gg.p(this.getVisibleRange())}Jg(){this.Gu.v()&&this.Gu.p(this.getVisibleLogicalRange())}Qg(t){this.Bw.p(t.width,t.height)}}function mB(t){return function(t){if(dg(t.handleScale)){let e=t.handleScale;t.handleScale={axisDoubleClickReset:{time:e,price:e},axisPressedMouseMove:{time:e,price:e},mouseWheel:e,pinch:e}}else if(void 0!==t.handleScale){let{axisPressedMouseMove:e,axisDoubleClickReset:i}=t.handleScale;dg(e)&&(t.handleScale.axisPressedMouseMove={time:e,price:e}),dg(i)&&(t.handleScale.axisDoubleClickReset={time:i,price:i})}let e=t.handleScroll;dg(e)&&(t.handleScroll={horzTouchDrag:e,vertTouchDrag:e,mouseWheel:e,pressedMouseMove:e})}(t),t}class mW{constructor(t,e,i){this.tb=new Map,this.ib=new Map,this.nb=new dc,this.sb=new dc,this.eb=new dc,this.od=new WeakMap,this.rb=new mn(e);const s=void 0===i?dv(mj()):dd(dv(mj()),mB(i));this.hb=e,this.sv=new pJ(t,s,e),this.sv.dw().i(t=>{this.nb.v()&&this.nb.p(this.ab(t()))},this),this.sv.fw().i(t=>{this.sb.v()&&this.sb.p(this.ab(t()))},this),this.sv.Dd().i(t=>{this.eb.v()&&this.eb.p(this.ab(t()))},this);const n=this.sv.Qt();this.lb=new mF(n,this.sv.pM(),this.hb)}remove(){this.sv.dw().u(this),this.sv.fw().u(this),this.sv.Dd().u(this),this.lb.m(),this.sv.m(),this.tb.clear(),this.ib.clear(),this.nb.m(),this.sb.m(),this.eb.m(),this.rb.m()}resize(t,e,i){this.autoSizeActive()||this.sv.cM(t,e,i)}addCustomSeries(t,e={},i=0){let s,n=(s=du(t),{type:"Custom",isBuiltIn:!1,defaultOptions:{...mb,...s.defaultOptions()},ob:my,_b:s});return this.ub(n,e,i)}addSeries(t,e={},i=0){return this.ub(t,e,i)}removeSeries(t){let e=da(this.tb.get(t)),i=this.rb.Jd(e);this.sv.Qt().Jd(e),this.cb(i),this.tb.delete(t),this.ib.delete(e)}qg(t,e){this.cb(this.rb.sg(t,e))}Kg(t,e,i){this.cb(this.rb.og(t,e,i))}Zg(t,e){let[i,s]=this.rb.cg(t,e);return 0!==i.length&&this.cb(s),i}subscribeClick(t){this.nb.i(t)}unsubscribeClick(t){this.nb._(t)}subscribeCrosshairMove(t){this.eb.i(t)}unsubscribeCrosshairMove(t){this.eb._(t)}subscribeDblClick(t){this.sb.i(t)}unsubscribeDblClick(t){this.sb._(t)}priceScale(t,e=0){return new mz(this.sv,t,e)}timeScale(){return this.lb}applyOptions(t){this.sv.vr(mB(t))}options(){return this.sv.N()}takeScreenshot(t=!1,e=!1){let i,s;try{e||(i=this.sv.Qt().N().crosshair.mode,this.sv.vr({crosshair:{mode:2}})),s=this.sv.SM(t)}finally{e||void 0===i||this.sv.Qt().vr({crosshair:{mode:i}})}return s}addPane(t=!1){let e=this.sv.Qt().af();return e.W_(t),this.fb(e)}removePane(t){this.sv.Qt().Vd(t)}swapPanes(t,e){this.sv.Qt().Ed(t,e)}autoSizeActive(){return this.sv.wM()}chartElement(){return this.sv.vv()}panes(){return this.sv.Qt().Zn().map(t=>this.fb(t))}paneSize(t=0){let e=this.sv.RM(t);return{height:e.height,width:e.width}}setCrosshairPosition(t,e,i){let s=this.tb.get(i);if(void 0===s)return;let n=this.sv.Qt().Ks(s);null!==n&&this.sv.Qt().qd(t,e,n)}clearCrosshairPosition(){this.sv.Qt().Yd(!0)}horzBehaviour(){return this.hb}ub(t,e={},i=0){var s;dl(void 0!==t.ob),void 0===(s=e.priceFormat)||"custom"===s.type||void 0!==s.minMove&&void 0===s.precision&&(s.precision=pr(s.minMove)),"Candlestick"===t.type&&(void 0!==e.borderColor&&(e.borderUpColor=e.borderColor,e.borderDownColor=e.borderColor),void 0!==e.wickColor&&(e.wickUpColor=e.wickColor,e.wickDownColor=e.wickColor));let n=dd(dv(ds),dv(t.defaultOptions),e),r=t.ob,o=new fA(this.sv.Qt(),t.type,n,r,t._b);this.sv.Qt().Gd(o,i);let l=new mV(o,this,this,this,this.hb,t=>this.fb(t));return this.tb.set(l,o),this.ib.set(o,l),l}cb(t){let e=this.sv.Qt();e.Kd(t.Et.Pc,t.Et.vg,t.Et.mg),t.U_.forEach((t,e)=>e.ht(t.ue,t.pg)),e.Et()._c(),e.Bc()}pb(t){return da(this.ib.get(t))}mb(t){return void 0!==t&&this.ib.has(t)?this.pb(t):void 0}ab(t){let e=new Map;t.YM.forEach((t,i)=>{let s=i.bh(),n=mT(s)(t);if("Custom"!==s){var r;dl(void 0!==(r=n).open||void 0!==r.value)}else{let t=i.ol();dl(!t||!1===t(n))}e.set(this.pb(i),n)});let i=this.mb(t.NM),s=void 0===t.WM?void 0:{type:t.WM.ds,sourceKind:t.WM.HM,objectKind:t.WM.UM,series:this.mb(t.WM.U_),objectId:t.WM.$M,paneIndex:t.WM.jM};return{time:t.Qr,logical:t.$n,point:t.qM,paneIndex:t.jM,hoveredInfo:s,hoveredSeries:i,hoveredObjectId:t.FM,seriesData:e,sourceEvent:t.KM}}fb(t){let e=this.od.get(t);return e||(e=new mD(this.sv,t=>this.pb(t),t,this),this.od.set(t,e)),e}}function m$(t,e,i,s){return Math.hypot(i-t,s-e)}function mK(t,e,i,s,n,r,o,l=0){if(0===e.length||s.from>=e.length||s.to<=0)return;let{context:a,horizontalPixelRatio:h,verticalPixelRatio:u}=t,c=e[s.from],d=r(t,c),f=c;if(s.to-s.from<2){let e=n/2;a.beginPath();let i={_t:c._t-e,ut:c.ut},s={_t:c._t+e,ut:c.ut};a.moveTo(i._t*h,i.ut*u),a.lineTo(s._t*h,s.ut*u),o(t,d,i,s)}else{let n=l>0,p=0,m=(e,i)=>{if(o(t,d,f,i),a.beginPath(),d=e,f=i,n){let t=p%l;a.lineDashOffset=t,p=t}},g=f;a.beginPath(),a.moveTo(c._t*h,c.ut*u);for(let o=s.from+1;ot+e,0);void 0!==n&&mK(t,e,n,i,s,u,mq,c),l&&function(t,e,i,s,n){if(s.to-s.from<=0)return;let{horizontalPixelRatio:r,verticalPixelRatio:o,context:l}=t,a=null,h=Math.max(1,Math.floor(r))%2/2,u=i*o+h;for(let i=s.to-1;i>=s.from;--i){let s=e[i];if(s){let e=n(t,s);e!==a&&(null!==a&&l.fill(),l.beginPath(),l.fillStyle=e,a=e);let i=Math.round(s._t*r)+h,c=s.ut*o;l.moveTo(i,c),l.arc(i,c,u,0,2*Math.PI)}}l.fill()}(t,e,l,i,u)}}class mG extends mY{bb(t,e){return e.vt}}function mZ(t,e,i,s,n){let r=1-n;return r*r*r*t+3*r*r*n*e+3*r*n*n*i+n*n*n*s}class mX extends mp{constructor(t,e){super(t,e,!0)}Vg(t,e,i){e.Tc(this.bg,dy(this.Sg)),t.Zo(this.bg,i,dy(this.Sg))}Sb(t,e){return{wt:t,Mt:e,_t:NaN,ut:NaN}}Dg(){let t=this.ae.Sa();this.bg=this.ae.Ha().Bh().map(e=>{let i;if((e.Zr??1)>1){let t=e.Wt[1],s=e.Wt[2],n=e.Wt[3];i=Math.abs(t-n)>Math.abs(s-n)?t:s}else i=e.Wt[3];return this.xb(e.$n,i,t)})}}class mJ extends mX{Pg(t,e){let i=this.ae.N();return function(t,e,i,s,n,r,o,l=0,a=0){var h,u,c,d,f;if(null===e||e.from>=e.to||0===t.length)return null;let p=Math.max(r/2,o??0)+a,m=1/0;if(void 0!==o){let n=o+a,r=ff(t,i-n,mo,h=e.from,e.to),l=fp(t,i+n,ml,r,e.to);for(let e=r;e=u-(d=o+a))||!(i<=c+d))continue;let r=Math.hypot(i-n._t,s-n.ut);r<=o+a&&(m=Math.min(m,r))}}if(e.to-e.from<2){let n=t[e.from],r=Math.max(l/2,p),o=mh(i,s,n._t-r,n.ut,n._t+r,n.ut);return o<=p&&(m=Math.min(m,o)),Number.isFinite(m)?ma(m,2,"series-point"):null}let g=1/0,v=ff(t,i-p,mo,f=e.from,e.to),b=fp(t,i+p,ml,v,e.to),y=Math.max(e.from+1,v),x=Math.min(e.to,b+1);for(let e=y;e=l-p)||!(i<=a+p))continue;let h=function(t,e,i,s,n,r,o,l){switch(n){case 1:{let n=Math.min(mh(t,e,i._t,i.ut,s._t,i.ut),mh(t,e,s._t,i.ut,s._t,s.ut));return n<=l?n:null}case 2:{let[n,a]=mH(r,o-1,o),h=function(t,e,i){let s=1/0,n=i[0];for(let r=1;r<=12;r++){let o=r/12,l={_t:mZ(i[0]._t,i[1]._t,i[2]._t,i[3]._t,o),ut:mZ(i[0].ut,i[1].ut,i[2].ut,i[3].ut,o)};s=Math.min(s,mh(t,e,n._t,n.ut,l._t,l.ut)),n=l}return s}(t,e,[i,n,a,s]);return h<=l?h:null}default:{let n=mh(t,e,i._t,i.ut,s._t,s.ut);return n<=l?n:null}}}(i,s,r,o,n,t,e,p);null!==h&&(g=Math.min(g,h))}return Number.isFinite(m)?ma(m,2,"series-point"):Number.isFinite(g)?ma(g,1,"series-line"):null}(this.bg,this.Sg,t,e,i.lineType,i.lineVisible?i.lineWidth:1,i.pointMarkersVisible?i.pointMarkersRadius||i.lineWidth/2+2:void 0,this.le.Et().fl(),i.hitTestTolerance)}}function m0(t,e,i,s,n){let{context:r,horizontalPixelRatio:o,verticalPixelRatio:l}=e;r.lineTo(n._t*o,t*l),r.lineTo(s._t*o,t*l),r.closePath(),r.fillStyle=i,r.fill()}class m1 extends dT{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et(t){if(null===this.rt)return;let{ot:e,lt:i,wb:s,ct:n,Zt:r,Mb:o}=this.rt,l=this.rt.Db??(this.rt.Ib?0:t.mediaSize.height);if(null===i)return;let a=t.context;a.lineCap="butt",a.lineJoin="round",a.lineWidth=n,dn(a,r),a.lineWidth=1,mK(t,e,o,i,s,this.Vb.bind(this),m0.bind(null,l))}}class m2{Bb(t,e){let i=this.Eb,{Ab:s,Lb:n,zb:r,Ob:o,Db:l,Nb:a,Fb:h}=e;if(void 0===this.Wb||void 0===i||i.Ab!==s||i.Lb!==n||i.zb!==r||i.Ob!==o||i.Db!==l||i.Nb!==a||i.Fb!==h){let{verticalPixelRatio:i}=t,u=l||a>0?i:1,c=a*u,d=h===t.bitmapSize.height?h:h*u,f=t.context.createLinearGradient(0,c,0,d);if(f.addColorStop(0,s),null!=l){let t=fO(((l??0)*u-c)/(d-c),0,1);f.addColorStop(t,n),f.addColorStop(t,r)}f.addColorStop(1,o),this.Wb=f,this.Eb=e}return this.Wb}}class m5 extends m1{constructor(){super(...arguments),this.Hb=new m2}Vb(t,e){return this.Hb.Bb(t,{Ab:e.ah,Lb:"",zb:"",Ob:e.oh,Nb:this.rt?.Nb??0,Fb:t.bitmapSize.height})}}class m3 extends mJ{constructor(t,e){super(t,e),this.kg=new dE,this.qb=new m5,this.Yb=new mG,this.kg.nt([this.qb,this.Yb])}xb(t,e,i){return{...this.Sb(t,e),...i.Sh(t)}}Bg(){let t,e=this.ae.N();if(null!==this.Sg&&0!==this.bg.length){if(e.relativeGradient){t=this.bg[this.Sg.from].ut;for(let e=this.Sg.from;enew m3(t,e)};function m6({data:t,color:e="#3b82f6",height:i=260}){let s=(0,V.useRef)(null),n=(0,V.useRef)(null),r=(0,V.useRef)(null);return(0,V.useEffect)(()=>{var o,l,a,h;let u;if(!s.current||0===t.length)return;let c=(o=s.current,l={layout:{background:{type:D.Solid,color:"transparent"},textColor:"oklch(0.7559 0.0125 239.9659)"},grid:{vertLines:{color:"rgba(255,255,255,0.03)"},horzLines:{color:"rgba(255,255,255,0.03)"}},rightPriceScale:{borderColor:"rgba(255,255,255,0.08)"},timeScale:{borderColor:"rgba(255,255,255,0.08)",timeVisible:!0},crosshair:{mode:0},width:s.current.clientWidth,height:i},a=new py,h=py.yf(l),u=new mW(function(t){if(dm(t)){let e=document.getElementById(t);return dl(null!==e,`Cannot find element in DOM with id=${t}`),e}return t}(o),a,h),a.setOptions(u.options()),u),d=c.addSeries(m4,{lineColor:e,topColor:`${e}26`,bottomColor:`${e}05`,lineWidth:2}),f=t.map(t=>({time:t.t,value:t.v}));d.setData(f),c.timeScale().fitContent(),n.current=c,r.current=d;let p=()=>{s.current&&n.current&&n.current.applyOptions({width:s.current.clientWidth})};return window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p),c.remove()}},[t,e,i]),(0,V.useEffect)(()=>{if(r.current&&t.length>0){let e=t.map(t=>({time:t.t,value:t.v}));r.current.setData(e),n.current?.timeScale().fitContent()}},[t]),(0,I.jsx)("div",{ref:s,style:{width:"100%",height:i}})}function m9({className:t,...e}){return(0,I.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,I.jsx)("table",{"data-slot":"table",className:ho("w-full caption-bottom text-sm",t),...e})})}function m7({className:t,...e}){return(0,I.jsx)("thead",{"data-slot":"table-header",className:ho("[&_tr]:border-b",t),...e})}function m8({className:t,...e}){return(0,I.jsx)("tbody",{"data-slot":"table-body",className:ho("[&_tr:last-child]:border-0",t),...e})}function gt({className:t,...e}){return(0,I.jsx)("tr",{"data-slot":"table-row",className:ho("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...e})}function ge({className:t,...e}){return(0,I.jsx)("th",{"data-slot":"table-head",className:ho("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",t),...e})}function gi({className:t,...e}){return(0,I.jsx)("td",{"data-slot":"table-cell",className:ho("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",t),...e})}function gs({positions:t,orders:e}){return(0,I.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[(0,I.jsxs)(c2,{className:"p-4",children:[(0,I.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:["Open Positions (",t.length,")"]}),0===t.length?(0,I.jsx)("p",{className:"text-xs text-muted-foreground",children:"No open positions"}):(0,I.jsxs)(m9,{children:[(0,I.jsx)(m7,{children:(0,I.jsxs)(gt,{className:"border-border",children:[(0,I.jsx)(ge,{className:"text-[9px] h-7",children:"Strategy"}),(0,I.jsx)(ge,{className:"text-[9px] h-7",children:"Size"}),(0,I.jsx)(ge,{className:"text-[9px] h-7",children:"Entry"}),(0,I.jsx)(ge,{className:"text-[9px] h-7 text-right",children:"PnL"})]})}),(0,I.jsx)(m8,{children:t.map((t,e)=>(0,I.jsxs)(gt,{className:"border-border/50",children:[(0,I.jsx)(gi,{className:"text-[10px] py-1.5",children:t.strategy}),(0,I.jsx)(gi,{className:"text-[10px] font-mono py-1.5",children:Math.abs(t.size).toFixed(4)}),(0,I.jsxs)(gi,{className:"text-[10px] font-mono py-1.5",children:["$",(t.entry_px??0).toFixed(1)]}),(0,I.jsxs)(gi,{className:`text-[10px] font-mono py-1.5 text-right ${(t.pnl??0)>=0?"text-green-500":"text-red-500"}`,children:[(t.pnl??0)>=0?"+":"","$",(t.pnl??0).toFixed(2)]})]},e))})]})]}),(0,I.jsxs)(c2,{className:"p-4",children:[(0,I.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:["Open Orders (",e.length,")"]}),0===e.length?(0,I.jsx)("p",{className:"text-xs text-muted-foreground",children:"No open orders"}):(0,I.jsxs)(m9,{children:[(0,I.jsx)(m7,{children:(0,I.jsxs)(gt,{className:"border-border",children:[(0,I.jsx)(ge,{className:"text-[9px] h-7",children:"Coin"}),(0,I.jsx)(ge,{className:"text-[9px] h-7",children:"Side"}),(0,I.jsx)(ge,{className:"text-[9px] h-7",children:"Size"}),(0,I.jsx)(ge,{className:"text-[9px] h-7 text-right",children:"Price"})]})}),(0,I.jsx)(m8,{children:e.map((t,e)=>(0,I.jsxs)(gt,{className:"border-border/50",children:[(0,I.jsx)(gi,{className:"text-[10px] py-1.5",children:t.coin}),(0,I.jsx)(gi,{className:"text-[10px] py-1.5",children:(0,I.jsx)(hd,{variant:"outline",className:`text-[8px] h-4 ${"B"===t.side?"text-green-500":"text-red-500"}`,children:"B"===t.side?"BUY":"SELL"})}),(0,I.jsx)(gi,{className:"text-[10px] font-mono py-1.5",children:t.sz}),(0,I.jsxs)(gi,{className:"text-[10px] font-mono py-1.5 text-right",children:["$",t.limitPx??"MKT"]})]},e))})]})]})]})}({...ds,color:"#2196f3"});let gn="/cv/api",gr=`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}/cv/ws`;async function go(){let t=await fetch(`${gn}/backtests`),e=await t.json(),i={};for(let t of e)i[t.strategy]||(i[t.strategy]=t);return i}async function gl(){let t=await fetch(`${gn}/backtests/historical`),e=await t.json(),i={};for(let t of e)i[t.strategy]||(i[t.strategy]=t);return i}async function ga(t){return(await fetch(`${gn}/backtest/${encodeURIComponent(t)}`)).json()}async function gh(t,e,i){return(await fetch(`${gn}/backtest/${encodeURIComponent(t)}/recalc?fee_tier=${e}&staking_tier=${i}`)).json()}t.s(["default",0,function(){let[t,e]=(0,V.useState)("live"),{data:i,connected:s}=function(){let[t,e]=(0,V.useState)(null),[i,s]=(0,V.useState)(!1),n=(0,V.useRef)(null),r=(0,V.useRef)(void 0),o=(0,V.useCallback)(()=>{try{let t=new WebSocket(gr);n.current=t,t.onopen=()=>s(!0),t.onclose=()=>{s(!1),r.current=setTimeout(o,5e3)},t.onmessage=t=>{try{let i=JSON.parse(t.data);e(i)}catch{}}}catch{r.current=setTimeout(o,5e3)}},[]);return(0,V.useEffect)(()=>(o(),()=>{n.current?.close(),clearTimeout(r.current)}),[o]),{data:t,connected:i}}(),{data:n}=function(){let[t,e]=(0,V.useState)(null),[i,s]=(0,V.useState)(!1),n=(0,V.useRef)(null);return(0,V.useEffect)(()=>{let t=`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}/cv/ws/paper`,i=()=>{try{let r=new WebSocket(t);n.current=r,r.onopen=()=>s(!0),r.onclose=()=>{s(!1),setTimeout(i,5e3)},r.onmessage=t=>{try{let i=JSON.parse(t.data);e(i)}catch{}}}catch{setTimeout(i,5e3)}};return i(),()=>n.current?.close()},[]),{data:t,connected:i}}(),[r,o]=(0,V.useState)({}),[l,a]=(0,V.useState)({}),[h,u]=(0,V.useState)(!1),[c,d]=(0,V.useState)(""),[f,p]=(0,V.useState)("live"),[m,g]=(0,V.useState)(null),[v,b]=(0,V.useState)(!0),[y,x]=(0,V.useState)(0),[w,S]=(0,V.useState)("none"),[M,k]=(0,V.useState)(!1);(0,V.useEffect)(()=>{go().then(o)},[]),(0,V.useEffect)(()=>{gl().then(a)},[]);let C="live"===t?i?.strategies??{}:"paper"===t?n?.strategies??{}:{},E=(0,V.useCallback)(async(t,e)=>{if(d(t),p(e),u(!0),"backtest"===e){let e=r[t];e&&g(await ga(e.name))}else if("historical"===e){let e=l[t];e&&g(await ga(e.name))}else g(null)},[r,l]),T=(0,V.useCallback)(async()=>{c&&"backtest"===f&&g(await gh(r[c]?.name??c,y,w))},[c,f,y,w,r]),P=("paper"===t?n:"live"===t?i:null)?.strategies?.[c];return(0,I.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,I.jsx)("header",{className:"sticky top-0 z-50 border-b border-border bg-background/80 backdrop-blur-xl",children:(0,I.jsxs)("div",{className:"flex items-center justify-between px-6 py-3 max-w-[1440px] mx-auto",children:[(0,I.jsxs)("div",{className:"flex items-center gap-3",children:[(0,I.jsx)("span",{className:`w-2 h-2 rounded-full ${s?"bg-green-500 animate-pulse":"bg-red-500"}`}),(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"FTDT Quant Lab"}),(0,I.jsx)("p",{className:"text-[10px] text-muted-foreground",children:"live"===t?"Live Testnet":"paper"===t?`Paper \xb7 $${n?.total_equity?.toLocaleString()??"100K"}`:"backtest"===t?"30-day Backtests":"Historical · Mainnet Data"})]})]}),(0,I.jsx)("div",{className:"flex items-center gap-3",children:(0,I.jsx)(hd,{variant:s?"default":"destructive",className:"text-[10px] h-5",children:s?"LIVE":"OFFLINE"})})]})}),(0,I.jsx)("div",{className:"border-b border-border bg-background/80 backdrop-blur-xl sticky top-[49px] z-40",children:(0,I.jsx)(hl,{value:t,onValueChange:t=>e(t),className:"max-w-[1440px] mx-auto px-6",children:(0,I.jsxs)(hh,{className:"h-10 bg-transparent border-0 gap-0 p-0",children:[(0,I.jsxs)(hu,{value:"live",className:"data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none px-5 text-xs h-10",children:["Live",(0,I.jsx)(hd,{variant:"outline",className:"ml-1.5 text-[9px] h-4 px-1.5 bg-amber-500/10 text-amber-400 border-0",children:"Testnet"})]}),(0,I.jsxs)(hu,{value:"paper",className:"data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none px-5 text-xs h-10",children:["Paper",(0,I.jsx)(hd,{variant:"outline",className:"ml-1.5 text-[9px] h-4 px-1.5 bg-purple-500/10 text-purple-400 border-0",children:"$100K"})]}),(0,I.jsx)(hu,{value:"backtest",className:"data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none px-5 text-xs h-10",children:"Backtest"}),(0,I.jsxs)(hu,{value:"historical",className:"data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none px-5 text-xs h-10",children:["Historical",(0,I.jsx)(hd,{variant:"outline",className:"ml-1.5 text-[9px] h-4 px-1.5 bg-purple-500/10 text-purple-400 border-0",children:"Real Data"})]})]})})}),(0,I.jsxs)("main",{className:"max-w-[1440px] mx-auto px-6 py-6",children:[(0,I.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 mb-6",children:[(0,I.jsx)(oa,{mode:"popLayout",children:Object.entries(C).map(([e,i])=>(0,I.jsx)(r8.div,{layout:!0,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,scale:.95},transition:{duration:.2},children:(0,I.jsx)(c4,{name:e,strategy:i,tab:t,onClick:()=>E(e,t)})},`${t}-${e}`))}),"backtest"===t&&Object.entries(r).map(([t,e])=>(0,I.jsx)(c4,{name:t,tab:"backtest",onClick:()=>E(t,"backtest"),badge:"30-day backtest",stats:[{label:"Sharpe",value:e.sharpe.toFixed(2)},{label:"Max DD",value:`${(100*e.max_dd).toFixed(1)}%`,negative:!0},{label:"Win",value:`${Math.round(100*e.win_rate)}%`}],pnlPct:e.pnl_pct,status:"BACKTEST"},t)),"historical"===t&&Object.entries(l).map(([t,e])=>(0,I.jsx)(c4,{name:t,tab:"historical",onClick:()=>E(t,"historical"),badge:`30d \xb7 ${e.coin??"BTC"} \xb7 Mainnet`,stats:[{label:"Sharpe",value:e.sharpe.toFixed(2)},{label:"Max DD",value:`${(100*e.max_dd).toFixed(1)}%`,negative:!0},{label:"Win",value:`${Math.round(100*e.win_rate)}%`}],pnlPct:e.pnl_pct,status:"REAL DATA"},t))]}),(0,I.jsxs)(cq,{open:M,onOpenChange:k,className:"mb-6",children:[(0,I.jsxs)(cY,{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",children:[M?(0,I.jsx)(cZ,{className:"w-3 h-3"}):(0,I.jsx)(cX,{className:"w-3 h-3"}),"Open Positions & Orders (",i?.open_positions?.length??0," pos · ",i?.open_orders?.length??0," ord)"]}),(0,I.jsx)(cG,{children:(0,I.jsx)(gs,{positions:i?.open_positions??[],orders:i?.open_orders??[]})})]}),(0,I.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-6",children:[(0,I.jsxs)("a",{href:"https://ftdt.io",target:"_blank",className:"flex items-center gap-3 p-4 rounded-lg border border-border bg-card hover:border-primary/50 transition-colors",children:[(0,I.jsx)(cJ,{className:"w-4 h-4 text-primary"}),(0,I.jsxs)("div",{children:[(0,I.jsx)("p",{className:"text-xs font-medium",children:"ftdt.io"}),(0,I.jsx)("p",{className:"text-[10px] text-muted-foreground",children:"Main platform"})]})]}),(0,I.jsxs)("a",{href:"https://app.ftdt.io/quant-lab",target:"_blank",className:"flex items-center gap-3 p-4 rounded-lg border border-border bg-card hover:border-primary/50 transition-colors",children:[(0,I.jsx)(c1,{className:"w-4 h-4 text-chart-2"}),(0,I.jsxs)("div",{children:[(0,I.jsx)("p",{className:"text-xs font-medium",children:"Quant Lab ↗"}),(0,I.jsx)("p",{className:"text-[10px] text-muted-foreground",children:"Web dashboard"})]})]}),(0,I.jsxs)("a",{href:"https://git.ftdt.io/rams/ftdt-quant-lab",target:"_blank",className:"flex items-center gap-3 p-4 rounded-lg border border-border bg-card hover:border-primary/50 transition-colors",children:[(0,I.jsx)(c0,{className:"w-4 h-4 text-chart-3"}),(0,I.jsxs)("div",{children:[(0,I.jsx)("p",{className:"text-xs font-medium",children:"Git Repo"}),(0,I.jsx)("p",{className:"text-[10px] text-muted-foreground",children:"rams/ftdt-quant-lab"})]})]})]})]}),(0,I.jsx)(cC,{open:h,onOpenChange:u,children:(0,I.jsxs)(cP,{side:"right",className:"w-full sm:max-w-[720px] lg:max-w-[900px] p-0 overflow-y-auto bg-background border-l border-border",children:[(0,I.jsxs)(cR,{className:"sticky top-0 z-10 bg-card/80 backdrop-blur-xl border-b border-border px-6 py-4",children:[(0,I.jsx)(c_,{className:"text-base font-bold",children:c}),(0,I.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[P&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(hd,{variant:"outline",className:"text-[10px]",children:P.type}),(0,I.jsx)(hd,{variant:"running"===P.status?"default":"secondary",className:"text-[10px]",children:P.status?.toUpperCase()}),(0,I.jsx)("span",{className:"text-[10px] text-muted-foreground",children:P.instrument})]}),"backtest"===f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("select",{value:y,onChange:t=>x(Number(t.target.value)),className:"text-[10px] bg-card border border-border rounded px-2 py-1 text-foreground",children:[(0,I.jsx)("option",{value:0,children:"Tier 0 (0.045/0.015%)"}),(0,I.jsx)("option",{value:1,children:"Tier 1 — >$5M (0.040/0.012%)"}),(0,I.jsx)("option",{value:2,children:"Tier 2 — >$25M (0.035/0.008%)"}),(0,I.jsx)("option",{value:3,children:"Tier 3 — >$100M (0.030/0.004%)"}),(0,I.jsx)("option",{value:4,children:"Tier 4 — >$500M (0.028/0.000%)"}),(0,I.jsx)("option",{value:5,children:"Tier 5 — >$2B (0.026/0.000%)"}),(0,I.jsx)("option",{value:6,children:"Tier 6 — >$7B (0.024/0.000%)"})]}),(0,I.jsx)(hm,{size:"sm",variant:"outline",className:"text-[10px] h-6 px-2",onClick:T,children:"Recalc"})]})]})]}),(0,I.jsx)("div",{className:"px-6 py-4 space-y-6",children:P&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed p-3 bg-muted/50 rounded-lg border border-border",children:P.description}),(0,I.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:[{l:"PnL",v:`$${P.pnl?.toFixed(4)}`},{l:"PnL%",v:`${P.pnl_pct>=0?"+":""}${P.pnl_pct?.toFixed(2)}%`,up:P.pnl_pct>=0},{l:"Trades",v:String(P.trades_today??0)},{l:"Win Rate",v:`${Math.round((P.win_rate??0)*100)}%`},{l:"Fees",v:`$${(P.fee_paid??0).toFixed(4)}`,up:!1},{l:"Position",v:(P.position??0).toFixed(4)}].map(({l:t,v:e,up:i})=>(0,I.jsxs)("div",{className:"p-3 rounded-lg border border-border bg-card/50",children:[(0,I.jsx)("p",{className:"text-[9px] text-muted-foreground uppercase tracking-wider mb-1",children:t}),(0,I.jsx)("p",{className:`text-sm font-mono font-semibold ${!0===i?"text-green-500":!1===i&&"Position"!==t?"text-red-500":""}`,children:e})]},t))}),(("paper"===t?n:i)?.equity_history?.length??0)>0&&(0,I.jsx)("div",{className:"rounded-lg border border-border overflow-hidden h-[260px]",children:(0,I.jsx)(m6,{data:("paper"===t?n:i).equity_history,color:"var(--chart-1)"})})]})})]})})]})}],52683)}]);